@arcgis/core 4.33.0-next.20250422 → 4.33.0-next.20250424
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/Graphic.js +1 -1
- package/WebScene.js +1 -1
- package/analysis/Analysis.d.ts +4 -0
- package/analysis/Analysis.js +1 -1
- package/analysis/SliceAnalysis.js +1 -1
- package/analysis/SlicePlane.js +1 -1
- package/analysis/support/AnalysisOriginWebScene.d.ts +4 -0
- package/analysis/support/AnalysisOriginWebScene.js +5 -0
- package/analysis/support/SliceAnalysisExcludedLayer.js +5 -0
- package/arcade/geometry/constructors.js +1 -1
- package/assets/components/assets/icon/mosaicMethodBlend16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodBlend24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodBlend32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodByAttribute16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodByAttribute24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodByAttribute32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToCenter16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToCenter24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToCenter32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToNadir16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToNadir24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodClosestToNadir32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodFirst16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodFirst24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodFirst32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLast16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLast24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLast32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLockRaster16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLockRaster24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodLockRaster32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMaximum16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMaximum24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMaximum32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMean16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMean24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMean32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMinimum16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMinimum24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodMinimum32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNone16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNone24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNone32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNorthWest16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNorthWest24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodNorthWest32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSeamline16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSeamline24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSeamline32.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSum16.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSum24.json +1 -0
- package/assets/components/assets/icon/mosaicMethodSum32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{b2f9f0767dadf185120c.js → 00612d6e05b1c8647668.js} +1 -1
- package/assets/esri/core/workers/chunks/{d4d011eea16a89a5aad9.js → 0219c3f9408d3fa3c9a0.js} +1 -1
- package/assets/esri/core/workers/chunks/{f54546c155fba2fd3a7e.js → 05d7d8ff3e4cbad32580.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1e275607d9754079f60.js → 079434fe765c53d304f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f8782b3b6ad414409e8.js → 0a48b9734ab4c64a6f4f.js} +1 -1
- package/assets/esri/core/workers/chunks/{0eed612e82a279ac8d1e.js → 11b55e7e76e50fe11bbe.js} +1 -1
- package/assets/esri/core/workers/chunks/{ccc50f28f217e50cc2c3.js → 1427e7953c3d8c87c5e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{184d7c8ea818bec5c462.js → 146b3699a9e8b1f2dcc2.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ba7d44eff348004f084.js → 1a6d2d090b643a87408a.js} +1 -1
- package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +1 -0
- package/assets/esri/core/workers/chunks/{5e5225623977e61fd0ef.js → 213adc87c843d627c5d6.js} +1 -1
- package/assets/esri/core/workers/chunks/235efd948ae470a6f238.js +1 -0
- package/assets/esri/core/workers/chunks/{60d3b329e69f3cddb7f4.js → 265f69d153b7b6f07e42.js} +1 -1
- package/assets/esri/core/workers/chunks/{769b66cca8347f0f84db.js → 279bbd61b32577693a4a.js} +1 -1
- package/assets/esri/core/workers/chunks/290b065b377f9d2ee058.js +1 -0
- package/assets/esri/core/workers/chunks/29d3245261a7223124ed.js +1 -0
- package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js → 30551c1d3e4fa7be86c1.js} +2 -2
- package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js.LICENSE.txt → 30551c1d3e4fa7be86c1.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/335b539893569e3d7b82.js +1 -0
- package/assets/esri/core/workers/chunks/{78242f2bf742b33d99fa.js → 3795793643f4db64af0e.js} +1 -1
- package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js → 3cf001abca8ad933bccf.js} +2 -2
- package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js.LICENSE.txt → 3cf001abca8ad933bccf.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js → 543eb46b55cacd6e1dbc.js} +2 -2
- package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js.LICENSE.txt → 543eb46b55cacd6e1dbc.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js → 577f24923fa4d08360e4.js} +2 -2
- package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js.LICENSE.txt → 577f24923fa4d08360e4.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/5958af341014e13475d2.js +1 -0
- package/assets/esri/core/workers/chunks/{f46c4a69ef2f763e905b.js → 5d63dfa5a60c88e03b28.js} +1 -1
- package/assets/esri/core/workers/chunks/60f7cd05e88701f43d3f.js +1 -0
- package/assets/esri/core/workers/chunks/{26e0a0a13060cd3e4291.js → 626ba3a7dee952308566.js} +1 -1
- package/assets/esri/core/workers/chunks/7bfa18dd8771d4932533.js +1 -0
- package/assets/esri/core/workers/chunks/7cd32b10ed0e18e44ef2.js +1 -0
- package/assets/esri/core/workers/chunks/7ffa68d69c138db1295d.js +1 -0
- package/assets/esri/core/workers/chunks/8dd26b12c625d20196ed.js +319 -0
- package/assets/esri/core/workers/chunks/91f8547a13f0461045ef.js +1 -0
- package/assets/esri/core/workers/chunks/9661ee8569ee208e6237.js +1 -0
- package/assets/esri/core/workers/chunks/{c2f38c66fae2cdb57445.js → 96e5d192c8d23c1e324f.js} +1 -1
- package/assets/esri/core/workers/chunks/974742af7beb000c4b4a.js +1 -0
- package/assets/esri/core/workers/chunks/{e27fa1e84f16b7f19a90.js → 9850ff14bd9c7da81c65.js} +1 -1
- package/assets/esri/core/workers/chunks/{796cf1c2ca9955595836.js → 9b2ab27159500315fbc1.js} +1 -1
- package/assets/esri/core/workers/chunks/{a276980c06d5d311a37e.js → 9f416cc5673665f8c37c.js} +1 -1
- package/assets/esri/core/workers/chunks/a0c51c4c30a5f749dfc6.js +1 -0
- package/assets/esri/core/workers/chunks/a79511b926a2830bb160.js +1 -0
- package/assets/esri/core/workers/chunks/{fdcbd28f38bc485ac5e3.js → ab6ecd8eeec5ff761b34.js} +1 -1
- package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js → ac9c6779771ec855da79.js} +2 -2
- package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js.LICENSE.txt → ac9c6779771ec855da79.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{ef6e805c49e1afdf966b.js → c054198c6438cb57f188.js} +1 -1
- package/assets/esri/core/workers/chunks/c5d786166a5609b85276.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{5bdd5ae2d2f23ef6b331.js → c87e2a63b96e0da77dfe.js} +1 -1
- package/assets/esri/core/workers/chunks/{601fc99426f0213b0769.js → cbec01223d51cdb9ee79.js} +1 -1
- package/assets/esri/core/workers/chunks/cc4dd739c4c7e3ccea3f.js +1 -0
- package/assets/esri/core/workers/chunks/{90c893959145827961ac.js → cd9343c78a7c3acdbbcd.js} +1 -1
- package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +1 -0
- package/assets/esri/core/workers/chunks/{26fcbe053194bd78fcc3.js → d8474dca270b25705699.js} +1 -1
- package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js → d8dc922f7466300b668f.js} +2 -2
- package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js.LICENSE.txt → d8dc922f7466300b668f.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{96cddbbeef61a4f33f29.js → db5913824d5e5a2a8365.js} +1 -1
- package/assets/esri/core/workers/chunks/{48a1bb1e171dd06a7c6e.js → dd94585508f49863dc15.js} +1 -1
- package/assets/esri/core/workers/chunks/e524462c63834fae7e01.js +2 -0
- package/assets/esri/core/workers/chunks/{02176f84d6d57f1bc1c8.js.LICENSE.txt → e524462c63834fae7e01.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{e7e987558cf017c62458.js → ebfa4a0334401f5e004a.js} +1 -1
- package/assets/esri/core/workers/chunks/{736a11e64e5f03e3936b.js → f2cef954b58c6604642c.js} +64 -64
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/BloomBlur.glsl.js +7 -7
- package/chunks/BloomComposition.glsl.js +24 -25
- package/chunks/Bufferer-CicaNej1.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +5 -0
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/chunks/relateOperator.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/Collection.js +1 -1
- package/core/JSONSupport.js +1 -1
- package/core/SetUtils.js +1 -1
- package/{views/webgl/GLObjectType.js → core/support/jsonUtils.js} +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.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/operatorSimplifyOGC.js +5 -0
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/simplifyOGCOperator.d.ts +6 -0
- package/geometry/operators/simplifyOGCOperator.js +5 -0
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/normalizeUtilsSync.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +442 -113
- package/layers/DimensionLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/ViewshedLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/FieldsIndex.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
- package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFormats/{TiffTags.js → tiffTag.js} +1 -1
- package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
- package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
- package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
- package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
- package/layers/support/rasterFunctions/RemapFunction.js +1 -1
- package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
- package/layers/support/videoUtils.js +5 -0
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/versionManagement/utils.js +1 -1
- package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/atmosphereUtils.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/EngineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/TileActionSynchronizer.js +5 -0
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/cameraUtilsSpherical.js +1 -1
- package/views/3d/support/geometryUtils/sphere.js +1 -1
- package/views/3d/terrain/OverlayRenderTargets.js +1 -1
- package/views/3d/webgl/ManagedDepthTexture.js +1 -1
- package/views/3d/webgl/ManagedFBO.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +12 -14
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/interactive/Tooltip.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +4 -0
- package/views/layers/LineOfSightLayerView.js +5 -0
- package/views/webgl/FBOAttachmentType.js +5 -0
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Renderbuffer.js +1 -1
- package/views/webgl/RenderbufferDescriptor.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/TextureDescriptor.js +1 -1
- package/webscene/InitialViewProperties.js +1 -1
- package/webscene/Presentation.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/SlideLegendInfo.js +1 -1
- package/webscene/background/ColorBackground.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/compare.js +1 -1
- package/webscene/spec-certification/index.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/webscene/spec-certification/utils.js +1 -1
- package/webscene/support/Description.js +1 -1
- package/webscene/support/SlideElements.js +1 -1
- package/webscene/support/SlideEnvironment.js +1 -1
- package/webscene/support/SlideGround.js +1 -1
- package/webscene/support/SlideVisibleLayer.js +1 -1
- package/webscene/support/Title.js +1 -1
- package/webscene/support/analysisUtils.js +5 -0
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/support/SketchController.js +5 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/02176f84d6d57f1bc1c8.js +0 -2
- package/assets/esri/core/workers/chunks/244d2196bac5ef279436.js +0 -1
- package/assets/esri/core/workers/chunks/32f2e0c88046b39916cc.js +0 -1
- package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +0 -1
- package/assets/esri/core/workers/chunks/5ffc3ca6c6a4d32e1282.js +0 -1
- package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +0 -1
- package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +0 -1
- package/assets/esri/core/workers/chunks/873327fc41edd3830afa.js +0 -319
- package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +0 -1
- package/assets/esri/core/workers/chunks/95379fdd6917c8a84c71.js +0 -1
- package/assets/esri/core/workers/chunks/9b21dc4659922cc577cb.js +0 -1
- package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +0 -1
- package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +0 -1
- package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +0 -1
- package/assets/esri/core/workers/chunks/dd8e72d6784a8ebc115d.js +0 -1
- package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +0 -1
- package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +0 -1
- package/views/3d/webgl/formats.js +0 -5
package/core/Collection.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"./ArrayPool.js";import s from"./Evented.js";import{makeHandle as i}from"./handleUtils.js";import{clone as r}from"./lang.js";import n from"./ObjectPool.js";import{ObservableChangesType as h}from"./ObservableChangesType.js";import{schedule as o}from"./scheduling.js";import{ensureType as l,ensureOneOfType as a}from"./accessorSupport/ensureType.js";import{trackAccess as c}from"./accessorSupport/tracking.js";import{property as f}from"./accessorSupport/decorators/property.js";import{shared as _}from"./accessorSupport/decorators/shared.js";import{subclass as u}from"./accessorSupport/decorators/subclass.js";import{SimpleObservable as m}from"./accessorSupport/tracking/SimpleObservable.js";var g;class d{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}}class p{constructor(e,t,s,i,r){this.target=e,this.added=t,this.removed=s,this.start=i,this.deleteCount=r}}const b=new n(d,void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function v(e){e&&"object"==typeof e&&"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}function y(e){return e?e instanceof R?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function E(e){if(e?.length)return e[0]}function A(e,t,s,i){const r=Math.min(e.length-s,t.length-i);let n=0;for(;n<r&&e[s+n]===t[i+n];)n++;return n}function C(e,t,s,i){t&&t.forEach(((t,r,n)=>{e.push(t),C(e,s.call(i,t,r,n),s,i)}))}const O=new Set,M=new Set,D=new Set,x=new Map;let j=0,R=class extends s.EventedAccessor{static{g=this}static{this.ofType=t=>{if(!t)return g;if(x.has(t))return x.get(t);let s=null;if("function"==typeof t)s=t.prototype.declaredClass;else if(t.base)s=t.base.prototype.declaredClass;else for(const e in t.typeMap){const i=t.typeMap[e].prototype.declaredClass;s?s+=` | ${i}`:s=i}let i=class extends g{};return e([_({Type:t,ensureType:"function"==typeof t?l(t):a(t)})],i.prototype,"itemType",void 0),i=e([u(`esri.core.Collection<${s}>`)],i),x.set(t,i),i}}static isCollection(e){return null!=e&&e instanceof g}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new m,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:j++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof g?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),this._emitter.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get items(){return c(this._observable),this._items}set items(e){this._emitBeforeChanges(h.ADD)||(this._splice(0,this.length,y(e)),this._emitAfterChanges(h.ADD))}hasEventListener(e){return!this.destroyed&&("change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e))}on(e,t){if(this.destroyed)return i();if("change"===e){const e=this._chgListeners,s={removed:!1,callback:t};return e.push(s),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),i((()=>{s.removed=!0,e.splice(e.indexOf(s),1)}))}return this._emitter.on(e,t)}once(e,t){const s="deref"in t?()=>t.deref():()=>t,i=this.on(e,(e=>{s()?.call(null,e),i.remove()}));return i}add(e,t){if(c(this._observable),this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t??null);return this._splice(s,0,[e]),this._emitAfterChanges(h.ADD),this}addMany(e,t=this._items.length){if(c(this._observable),!e?.length)return this;if(this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t);return this._splice(s,0,y(e)),this._emitAfterChanges(h.ADD),this}at(e){if(c(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(h.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return c(this._observable),this._createNewInstance({items:this._items.map(r)})}concat(...e){c(this._observable);const t=e.map(y);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const s=this._splice(0,this.length),i=s.length;for(let r=0;r<i;r++)e.call(t,s[r],r,s);this._emitAfterChanges(h.REMOVE)}destroyAll(){this.drain(v)}destroyMany(e){const t=this.removeMany(e);return t.forEach(v),t}every(e,t){return c(this._observable),this._items.every(e,t)}filter(e,t){c(this._observable);const s=2===arguments.length?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:s})}find(e,t){return c(this._observable),this._items.find(e,t)}findIndex(e,t){return c(this._observable),this._items.findIndex(e,t)}flatten(e,t){c(this._observable);const s=[];return C(s,this,e,t),new g(s)}forEach(e,t){return c(this._observable),this._items.forEach(e,t)}getItemAt(e){return c(this._observable),this._items[e]}getNextIndex(e){c(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return c(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return c(this._observable),this._items.indexOf(e,t)}join(e=","){return c(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return c(this._observable),this._items.lastIndexOf(e,t)}map(e,t){c(this._observable);const s=this._items.map(e,t);return new g({items:s})}reorder(e,t=this.length-1){c(this._observable);const s=this.indexOf(e);if(-1!==s){if(t<0?t=0:t>=this.length&&(t=this.length-1),s!==t){if(this._emitBeforeChanges(h.MOVE))return e;this._splice(s,1),this._splice(t,0,[e]),this._emitAfterChanges(h.MOVE)}return e}}pop(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=E(this._splice(this.length-1,1));return this._emitAfterChanges(h.REMOVE),e}push(...e){return c(this._observable),this._emitBeforeChanges(h.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(h.ADD)),this.length}reduce(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduce(e,t):s.reduce(e)}reduceRight(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(e,t):s.reduceRight(e)}remove(e){return c(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(c(this._observable),e<0||e>=this.length||this._emitBeforeChanges(h.REMOVE))return;const t=E(this._splice(e,1));return this._emitAfterChanges(h.REMOVE),t}removeMany(e){if(c(this._observable),!e?.length||this._emitBeforeChanges(h.REMOVE))return[];const t=e instanceof g?e.toArray():e,s=this._items,i=[],r=t.length;for(let n=0;n<r;n++){const e=t[n],r=s.indexOf(e);if(r>-1){const e=1+A(t,s,n+1,r+1),h=this._splice(r,e);h&&h.length>0&&i.push.apply(i,h),n+=e-1}}return this._emitAfterChanges(h.REMOVE),i}reverse(){if(c(this._observable),this._emitBeforeChanges(h.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(h.MOVE),this}shift(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=E(this._splice(0,1));return this._emitAfterChanges(h.REMOVE),e}slice(e=0,t=this.length){return c(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return c(this._observable),this._items.some(e,t)}sort(e){if(c(this._observable),!this.length||this._emitBeforeChanges(h.MOVE)||!this._requiresSort(e))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(h.MOVE),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){const t=this.length-1;for(let s=0;s<t;s++){if(e(this.items[s],this.items[s+1])>0)return!0}return!1}splice(e,t,...s){c(this._observable);const i=(t?h.REMOVE:0)|(s.length?h.ADD:0);if(this._emitBeforeChanges(i))return[];const r=this._splice(e,t,s)||[];return this._emitAfterChanges(i),r}toArray(){return c(this._observable),this._items.slice()}toJSON(){return c(this._observable),this.toArray()}toLocaleString(){return c(this._observable),this._items.toLocaleString()}toString(){return c(this._observable),this._items.toString()}unshift(...e){return c(this._observable),!e.length||this._emitBeforeChanges(h.ADD)||(this._splice(0,0,e),this._emitAfterChanges(h.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,s){const i=this._items,r=this.itemType;let n,h;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=o((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(h=i.splice(e,t),this.hasEventListener("before-remove")){const t=b.acquire();t.target=this,t.cancellable=!0;for(let s=0,r=h.length;s<r;s++)n=h[s],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(h.splice(s,1),i.splice(e,0,n),e+=1,s-=1,r-=1);b.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=b.acquire();e.target=this,e.cancellable=!1;const t=h.length;for(let s=0;s<t;s++)e.reset(h[s]),this.emit("after-remove",e);b.release(e)}}if(s?.length){if(r){const e=[];for(const t of s){const s=r.ensureType(t);null==s&&null!=t||e.push(s)}s=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),h=e===this.length;if(t||n){const r=b.acquire();r.target=this,r.cancellable=!0;const o=b.acquire();o.target=this,o.cancellable=!1;for(const l of s)t?(r.reset(l),this.emit("before-add",r),r.defaultPrevented||(h?i.push(l):i.splice(e++,0,l),this._set("length",i.length),n&&(o.reset(l),this.emit("after-add",o)))):(h?i.push(l):i.splice(e++,0,l),this._set("length",i.length),o.reset(l),this.emit("after-add",o));b.release(o),b.release(r)}else{if(h)for(const e of s)i.push(e);else i.splice(e,0,...s);this._set("length",i.length)}}if((s?.length||h?.length)&&this._notifyChangeEvent(s,h),this.hasEventListener("after-splice")){const i=new p(this,s,h,e,t);this.emit("after-splice",i)}return h}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const s=b.acquire();s.target=this,s.cancellable=!0,s.type=e,this.emit("before-changes",s),t=s.defaultPrevented,b.release(s)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=b.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),b.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const e=this._notifications;this._notifications=null;for(const s of e){const e=s.changes;O.clear(),M.clear(),D.clear();for(const{added:t,removed:s}of e){if(t)if(0===D.size&&0===M.size)for(const e of t)O.add(e);else for(const e of t)M.has(e)?(D.add(e),M.delete(e)):D.has(e)||O.add(e);if(s)if(0===D.size&&0===O.size)for(const e of s)M.add(e);else for(const e of s)O.has(e)?O.delete(e):(D.delete(e),M.add(e))}const i=t.acquire();O.forEach((e=>{i.push(e)}));const r=t.acquire();M.forEach((e=>{r.push(e)}));const n=this._items,h=s.items,o=t.acquire();if(D.forEach((e=>{h.indexOf(e)!==n.indexOf(e)&&o.push(e)})),s.listeners&&(i.length||r.length||o.length)){const e={target:this,added:i,removed:r,moved:o},t=s.listeners.length;for(let i=0;i<t;i++){const t=s.listeners[i];t.removed||t.callback.call(this,e)}}t.release(i),t.release(r),t.release(o)}O.clear(),M.clear(),D.clear()}};e([f()],R.prototype,"_updating",void 0),e([f()],R.prototype,"length",void 0),e([f()],R.prototype,"items",null),e([f({readOnly:!0})],R.prototype,"updating",null),R=g=e([u("esri.core.Collection")],R);const V=R;export{V as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"./ArrayPool.js";import s from"./Evented.js";import{makeHandle as i}from"./handleUtils.js";import{clone as r}from"./lang.js";import n from"./ObjectPool.js";import{ObservableChangesType as h}from"./ObservableChangesType.js";import{schedule as o}from"./scheduling.js";import{ensureType as l,ensureOneOfType as a}from"./accessorSupport/ensureType.js";import{trackAccess as c}from"./accessorSupport/tracking.js";import{property as f}from"./accessorSupport/decorators/property.js";import{shared as _}from"./accessorSupport/decorators/shared.js";import{subclass as m}from"./accessorSupport/decorators/subclass.js";import{SimpleObservable as u}from"./accessorSupport/tracking/SimpleObservable.js";import{isSerializable as g}from"./support/jsonUtils.js";var d;class p{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}}class b{constructor(e,t,s,i,r){this.target=e,this.added=t,this.removed=s,this.start=i,this.deleteCount=r}}const v=new n(p,void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function y(e){e&&"object"==typeof e&&"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}function E(e){return e?e instanceof S?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function A(e){if(e?.length)return e[0]}function C(e,t,s,i){const r=Math.min(e.length-s,t.length-i);let n=0;for(;n<r&&e[s+n]===t[i+n];)n++;return n}function O(e,t,s,i){t&&t.forEach(((t,r,n)=>{e.push(t),O(e,s.call(i,t,r,n),s,i)}))}const M=new Set,D=new Set,j=new Set,x=new Map;let R=0,S=class extends s.EventedAccessor{static{d=this}static{this.ofType=t=>{if(!t)return d;if(x.has(t))return x.get(t);let s=null;if("function"==typeof t)s=t.prototype.declaredClass;else if(t.base)s=t.base.prototype.declaredClass;else for(const e in t.typeMap){const i=t.typeMap[e].prototype.declaredClass;s?s+=` | ${i}`:s=i}let i=class extends d{};return e([_({Type:t,ensureType:"function"==typeof t?l(t):a(t)})],i.prototype,"itemType",void 0),i=e([m(`esri.core.Collection<${s}>`)],i),x.set(t,i),i}}static isCollection(e){return null!=e&&e instanceof d}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new u,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:R++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof d?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),this._emitter.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get items(){return c(this._observable),this._items}set items(e){this._emitBeforeChanges(h.ADD)||(this._splice(0,this.length,E(e)),this._emitAfterChanges(h.ADD))}hasEventListener(e){return!this.destroyed&&("change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e))}on(e,t){if(this.destroyed)return i();if("change"===e){const e=this._chgListeners,s={removed:!1,callback:t};return e.push(s),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),i((()=>{s.removed=!0,e.splice(e.indexOf(s),1)}))}return this._emitter.on(e,t)}once(e,t){const s="deref"in t?()=>t.deref():()=>t,i=this.on(e,(e=>{s()?.call(null,e),i.remove()}));return i}add(e,t){if(c(this._observable),this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t??null);return this._splice(s,0,[e]),this._emitAfterChanges(h.ADD),this}addMany(e,t=this._items.length){if(c(this._observable),!e?.length)return this;if(this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t);return this._splice(s,0,E(e)),this._emitAfterChanges(h.ADD),this}at(e){if(c(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(h.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return c(this._observable),this._createNewInstance({items:this._items.map(r)})}concat(...e){c(this._observable);const t=e.map(E);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const s=this._splice(0,this.length),i=s.length;for(let r=0;r<i;r++)e.call(t,s[r],r,s);this._emitAfterChanges(h.REMOVE)}destroyAll(){this.drain(y)}destroyMany(e){const t=this.removeMany(e);return t.forEach(y),t}every(e,t){return c(this._observable),this._items.every(e,t)}filter(e,t){c(this._observable);const s=2===arguments.length?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:s})}find(e,t){return c(this._observable),this._items.find(e,t)}findIndex(e,t){return c(this._observable),this._items.findIndex(e,t)}flatten(e,t){c(this._observable);const s=[];return O(s,this,e,t),new d(s)}forEach(e,t){return c(this._observable),this._items.forEach(e,t)}getItemAt(e){return c(this._observable),this._items[e]}getNextIndex(e){c(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return c(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return c(this._observable),this._items.indexOf(e,t)}join(e=","){return c(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return c(this._observable),this._items.lastIndexOf(e,t)}map(e,t){c(this._observable);const s=this._items.map(e,t);return new d({items:s})}reorder(e,t=this.length-1){c(this._observable);const s=this.indexOf(e);if(-1!==s){if(t<0?t=0:t>=this.length&&(t=this.length-1),s!==t){if(this._emitBeforeChanges(h.MOVE))return e;this._splice(s,1),this._splice(t,0,[e]),this._emitAfterChanges(h.MOVE)}return e}}pop(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=A(this._splice(this.length-1,1));return this._emitAfterChanges(h.REMOVE),e}push(...e){return c(this._observable),this._emitBeforeChanges(h.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(h.ADD)),this.length}reduce(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduce(e,t):s.reduce(e)}reduceRight(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(e,t):s.reduceRight(e)}remove(e){return c(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(c(this._observable),e<0||e>=this.length||this._emitBeforeChanges(h.REMOVE))return;const t=A(this._splice(e,1));return this._emitAfterChanges(h.REMOVE),t}removeMany(e){if(c(this._observable),!e?.length||this._emitBeforeChanges(h.REMOVE))return[];const t=e instanceof d?e.toArray():e,s=this._items,i=[],r=t.length;for(let n=0;n<r;n++){const e=t[n],r=s.indexOf(e);if(r>-1){const e=1+C(t,s,n+1,r+1),h=this._splice(r,e);h&&h.length>0&&i.push.apply(i,h),n+=e-1}}return this._emitAfterChanges(h.REMOVE),i}reverse(){if(c(this._observable),this._emitBeforeChanges(h.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(h.MOVE),this}shift(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=A(this._splice(0,1));return this._emitAfterChanges(h.REMOVE),e}slice(e=0,t=this.length){return c(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return c(this._observable),this._items.some(e,t)}sort(e){if(c(this._observable),!this.length||this._emitBeforeChanges(h.MOVE)||!this._requiresSort(e))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(h.MOVE),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){const t=this.length-1;for(let s=0;s<t;s++){if(e(this.items[s],this.items[s+1])>0)return!0}return!1}splice(e,t,...s){c(this._observable);const i=(t?h.REMOVE:0)|(s.length?h.ADD:0);if(this._emitBeforeChanges(i))return[];const r=this._splice(e,t,s)||[];return this._emitAfterChanges(i),r}toArray(){return c(this._observable),this._items.slice()}toJSON(e){c(this._observable);return this.toArray().map((t=>g(t)?t.toJSON(e):t))}toLocaleString(){return c(this._observable),this._items.toLocaleString()}toString(){return c(this._observable),this._items.toString()}unshift(...e){return c(this._observable),!e.length||this._emitBeforeChanges(h.ADD)||(this._splice(0,0,e),this._emitAfterChanges(h.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,s){const i=this._items,r=this.itemType;let n,h;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=o((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(h=i.splice(e,t),this.hasEventListener("before-remove")){const t=v.acquire();t.target=this,t.cancellable=!0;for(let s=0,r=h.length;s<r;s++)n=h[s],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(h.splice(s,1),i.splice(e,0,n),e+=1,s-=1,r-=1);v.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=v.acquire();e.target=this,e.cancellable=!1;const t=h.length;for(let s=0;s<t;s++)e.reset(h[s]),this.emit("after-remove",e);v.release(e)}}if(s?.length){if(r){const e=[];for(const t of s){const s=r.ensureType(t);null==s&&null!=t||e.push(s)}s=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),h=e===this.length;if(t||n){const r=v.acquire();r.target=this,r.cancellable=!0;const o=v.acquire();o.target=this,o.cancellable=!1;for(const l of s)t?(r.reset(l),this.emit("before-add",r),r.defaultPrevented||(h?i.push(l):i.splice(e++,0,l),this._set("length",i.length),n&&(o.reset(l),this.emit("after-add",o)))):(h?i.push(l):i.splice(e++,0,l),this._set("length",i.length),o.reset(l),this.emit("after-add",o));v.release(o),v.release(r)}else{if(h)for(const e of s)i.push(e);else i.splice(e,0,...s);this._set("length",i.length)}}if((s?.length||h?.length)&&this._notifyChangeEvent(s,h),this.hasEventListener("after-splice")){const i=new b(this,s,h,e,t);this.emit("after-splice",i)}return h}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const s=v.acquire();s.target=this,s.cancellable=!0,s.type=e,this.emit("before-changes",s),t=s.defaultPrevented,v.release(s)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=v.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),v.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const e=this._notifications;this._notifications=null;for(const s of e){const e=s.changes;M.clear(),D.clear(),j.clear();for(const{added:t,removed:s}of e){if(t)if(0===j.size&&0===D.size)for(const e of t)M.add(e);else for(const e of t)D.has(e)?(j.add(e),D.delete(e)):j.has(e)||M.add(e);if(s)if(0===j.size&&0===M.size)for(const e of s)D.add(e);else for(const e of s)M.has(e)?M.delete(e):(j.delete(e),D.add(e))}const i=t.acquire();M.forEach((e=>{i.push(e)}));const r=t.acquire();D.forEach((e=>{r.push(e)}));const n=this._items,h=s.items,o=t.acquire();if(j.forEach((e=>{h.indexOf(e)!==n.indexOf(e)&&o.push(e)})),s.listeners&&(i.length||r.length||o.length)){const e={target:this,added:i,removed:r,moved:o},t=s.listeners.length;for(let i=0;i<t;i++){const t=s.listeners[i];t.removed||t.callback.call(this,e)}}t.release(i),t.release(r),t.release(o)}M.clear(),D.clear(),j.clear()}};e([f()],S.prototype,"_updating",void 0),e([f()],S.prototype,"length",void 0),e([f()],S.prototype,"items",null),e([f({readOnly:!0})],S.prototype,"updating",null),S=d=e([m("esri.core.Collection")],S);const V=S;export{V as default};
|
package/core/JSONSupport.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../chunks/tslib.es6.js";import t from"./Accessor.js";import{DefaultsStore as
|
|
5
|
+
import{_ as r}from"../chunks/tslib.es6.js";import t from"./Accessor.js";import{DefaultsStore as s}from"./accessorSupport/DefaultsStore.js";import{setupConstructedDefaults as o}from"./accessorSupport/defaultsStoreUtils.js";import{read as e}from"./accessorSupport/read.js";import{getProperties as c}from"./accessorSupport/utils.js";import{write as i}from"./accessorSupport/write.js";import{subclass as p}from"./accessorSupport/decorators/subclass.js";const u=t=>{let u=class extends t{constructor(...r){super(...r);const t=c(this),e=t.store,i=new s;t.store=i,o(t,e,i)}read(r,t){e(this,r,t)}write(r,t){return i(this,r??{},t)}toJSON(r){return this.write({},r)}static fromJSON(r,t){return a.call(this,r,t)}};return u=r([p("esri.core.JSONSupport")],u),u.prototype.toJSON.isDefaultToJSON=!0,u};function a(r,t){if(!r)return null;if(r.declaredClass)throw new Error("JSON object is already hydrated");const s=new this;return s.read(r,t),s}let n=class extends(u(t)){};n=r([p("esri.core.JSONSupport")],n),function(r){r.JSONSupportMixin=u}(n||(n={}));const l=n;export{l as default};
|
package/core/SetUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function n(n,r){for(const t of n.values())if(r(t))return!0;return!1}function r(n,r){if(!r)return n;for(const t of r)null!=t&&n.add(t);return n}function t(n,r){return null!=r&&n.add(r),n}function u(n,t){const u=new Set;return r(u,n),r(u,t),u}function
|
|
5
|
+
function n(n,r){for(const t of n.values())if(r(t))return!0;return!1}function r(n,r){if(!r)return n;for(const t of r)null!=t&&n.add(t);return n}function t(n,r){return null!=r&&n.add(r),n}function u(n,t){const u=new Set;return r(u,n),r(u,t),u}function e(n,r){const t=new Set;for(const u of r)n.has(u)&&t.add(u);return t}function o(n,r){if(!n||!r)return!1;if(n===r)return!0;for(const t of n)if(!r.has(t))return!1;return!0}function f(n,r){if(null==n&&null==r)return!0;if(null==n||null==r||n.size!==r.size)return!1;for(const t of n)if(!r.has(t))return!1;return!0}function i(n,r){const t=new Set(n);for(const u of r)t.delete(u);return t}function c(n,r){return i(u(n,r),e(n,r))}function l(n){return n.values().next().value}function s(n){let r;for(r of n);return r}export{r as addMany,t as addMaybe,i as difference,f as equals,l as first,e as intersection,o as isSubsetOf,s as last,n as someSet,c as symmetricDifference,u as union};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
function t(t){return t&&"object"==typeof t&&"toJSON"in t&&"function"==typeof t.toJSON}export{t as isSerializable};
|
package/core/urlUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../config.js";import{isSome as n}from"./arrayUtils.js";import e from"./Error.js";import r from"./JSONSupport.js";import o from"./Logger.js";import{parseKnownArcGISOnlineDomain as i}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as s,arrayBufferToBase64 as l}from"../support/base64Utils.js";const u=()=>o.getLogger("esri.core.urlUtils"),c=t.request,f="esri/config: esriConfig.request.proxyUrl is not set.",a=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,p=/^\s*http:/i,h=/^\s*https:/i,d=/^\s*file:/i,m=/:\d+$/,y=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),$=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class x{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let n=this.uri.match(g);this.scheme=n[2]||(n[1]?"":null),this.authority=n[4]||(n[3]?"":null),this.path=n[5],this.query=n[7]||(n[6]?"":null),this.fragment=n[9]||(n[8]?"":null),null!=this.authority&&(n=this.authority.match($),this.user=n[3]||null,this.password=n[4]||null,this.host=n[6]||n[7],this.port=n[9]||null)}toString(){return this.uri}}const w={},O=new x(t.applicationUrl);let U=O;const R=j();let q=R;const C=()=>U,b=()=>q;function j(){const t=U.path,n=t.slice(0,t.lastIndexOf("/")+1);return`${`${U.scheme}://${U.host}${null!=U.port?`:${U.port}`:""}`}${n}`}const L={setAppUrl:t=>U=t,setAppBaseUrl:t=>q=t,restoreUrls:()=>{U=O,q=R}};function I(t){if(!t)return null;const n={path:null,query:null},e=new x(t),r=t.indexOf("?");return null===e.query?n.path=t:(n.path=t.slice(0,r),n.query=A(e.query)),e.fragment&&(n.hash=e.fragment,null===e.query&&(n.path=n.path.slice(0,n.path.length-(e.fragment.length+1)))),n}function A(t){const n=t.split("&"),e={};for(const r of n){if(!r)continue;const t=r.indexOf("=");let n,o;t<0?(n=decodeURIComponent(r),o=""):(n=decodeURIComponent(r.slice(0,t)),o=decodeURIComponent(r.slice(t+1)));let i=e[n];"string"==typeof i&&(i=e[n]=[i]),Array.isArray(i)?i.push(o):e[n]=o}return e}function v(t,n){return t?n&&"function"==typeof n?Object.keys(t).map((e=>encodeURIComponent(e)+"="+encodeURIComponent(n(e,t[e])))).join("&"):Object.keys(t).map((e=>{const o=t[e];if(null==o)return"";const i=encodeURIComponent(e)+"=",s=n?.[e];return s?i+encodeURIComponent(s(o)):Array.isArray(o)?o.map((t=>r.isSerializable(t)?i+encodeURIComponent(JSON.stringify(t)):i+encodeURIComponent(t))).join("&"):r.isSerializable(o)?i+encodeURIComponent(JSON.stringify(o)):i+encodeURIComponent(o)})).filter((t=>t)).join("&"):""}function S(t=!1){let n,r=c.proxyUrl;if("string"==typeof t){n=dt(t);const e=H(t);e&&(r=e.proxyUrl)}else n=!!t;if(!r)throw u().warn(f),new e("urlUtils:proxy-not-set",f);n&&wt()&&(r=$t(r));return I(r)}function P(t,n=!1){const e=H(t);let r,o;if(e){const t=E(e.proxyUrl);r=t.path,o=t.query?A(t.query):null}else if(n){const n=S(t);r=n.path,o=n.query}if(r){const n=I(t);t=r+"?"+n.path;const e=v({...o,...n.query});e&&(t=`${t}?${e}`)}return t}const k={path:"",query:""};function E(t){const n=t.indexOf("?");return-1!==n?(k.path=t.slice(0,n),k.query=t.slice(n+1)):(k.path=t,k.query=null),k}function B(t){return t=(t=Ot(t=Ct(t=E(t).path),!0)).toLowerCase()}function z(t){const n={proxyUrl:t.proxyUrl,urlPrefix:B(t.urlPrefix)},e=c.proxyRules,r=n.urlPrefix;let o=e.length;for(let i=0;i<e.length;i++){const t=e[i].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=i;break}0===t.indexOf(r)&&(o=i+1)}return e.splice(o,0,n),o}function H(t){const n=c.proxyRules,e=B(t);for(let r=0;r<n.length;r++)if(0===e.indexOf(n[r].urlPrefix))return n[r]}function T(t,n){if(!t||!n)return!1;t=N(t),n=N(n);const e=i(t),r=i(n);return null!=e&&null!=r?e.portalHostname===r.portalHostname:null==e&&null==r&&F(t,n,!0)}function W(t,n){if(!t||!n)return!1;t=N(t),n=N(n);const e=i(t),r=i(n);return null!=e&&null!=r&&e.portalHostname===r.portalHostname}function J(t,n){return t=N(t),n=N(n),Ot(t)===Ot(n)}function N(t){const n=(t=K(t)).indexOf("/sharing");return n>0?t.slice(0,n):t.replace(/\/+$/,"")}function D(t,n=c.interceptors){const e=n=>null==n||n instanceof RegExp&&n.test(t)||"string"==typeof n&&t.startsWith(n);if(n)for(const r of n)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r;return null}function F(t,n,e=!1){if(!t||!n)return!1;const r=vt(t),o=vt(n);return!(!e&&r.scheme!==o.scheme)&&(null!=r.host&&null!=o.host&&(r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port))}function M(t){if("string"==typeof t){if(!Y(t))return!0;t=vt(t)}if(F(t,U))return!0;const n=c.trustedServers||[];for(let e=0;e<n.length;e++){const r=Q(n[e]);for(let n=0;n<r.length;n++)if(F(t,r[n]))return!0}return!1}function Q(t){return w[t]||(ht(t)||pt(t)?w[t]=[new x(_(t))]:w[t]=[new x(`http://${t}`),new x(`https://${t}`)]),w[t]}function _(t,n=q,e){return pt(t)?e?.preserveProtocolRelative?t:"http"===U.scheme&&U.authority===X(t).slice(2)?`http:${t}`:`https:${t}`:ht(t)?t:V("/"===t[0]?Ut(n):n,t)}function G(t,n=q,e){if(null==t||!Y(t))return t;const r=K(t),o=r.toLowerCase(),i=K(n).toLowerCase().replace(/\/+$/,""),s=e?K(e).toLowerCase().replace(/\/+$/,""):null;if(s&&0!==i.indexOf(s))return t;const l=(t,n,e)=>-1===(e=t.indexOf(n,e))?t.length:e;let u=l(o,"/",o.indexOf("//")+2),c=-1;for(;o.slice(0,u+1)===i.slice(0,u)+"/"&&(c=u+1,u!==o.length);)u=l(o,"/",u+1);if(-1===c)return t;if(s&&c<s.length)return t;t=r.slice(c);const f=i.slice(c-1).replaceAll(/[^/]+/g,"").length;if(f>0)for(let a=0;a<f;a++)t=`../${t}`;else t=`./${t}`;return t}function K(t){return t=It(t=Lt(t=jt(t=_(t=t.trim()))))}function V(...t){const e=t.filter(n);if(!e?.length)return;const r=[];if(Y(e[0])){const t=e[0],n=t.indexOf("//");-1!==n&&(r.push(t.slice(0,n+1)),yt(e[0])&&(r[0]+="/"),e[0]=t.slice(n+2))}else"/"===e[0][0]&&r.push("");const o=e.reduce(((t,n)=>n?t.concat(n.split("/")):t),[]);for(let n=0;n<o.length;n++){const t=o[n];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&n===o.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function X(t,n=!1){if(null==t||Z(t)||tt(t))return null;let e=t.indexOf("://");if(-1===e&&pt(t))e=2;else{if(-1===e)return null;e+=3}const r=t.indexOf("/",e);return-1!==r&&(t=t.slice(0,r)),n&&(t=Ot(t,!0)),t}function Y(t){return pt(t)||ht(t)}function Z(t){return null!=t&&"blob:"===t.slice(0,5)}function tt(t){return null!=t&&"data:"===t.slice(0,5)}function nt(t){const n=ot(t);return n?.isBase64?s(n.data):null}function et(t){return l(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const rt=/^data:(.*?)(;base64)?,(.*)$/;function ot(t){const n=t.match(rt);if(!n)return null;const[,e,r,o]=n;return{mediaType:e,isBase64:!!r,data:o}}function it(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function st(t){return(await fetch(t)).blob()}function lt(t){const n=nt(t);if(!n)return null;const e=ot(t);return new Blob([n],{type:e.mediaType})}function ut(t,n){ft(t,n)}function ct(t,n){at(t,n)}function ft(t,n){const e=lt(t);return!!e&&at(e,n)}function at(t,n){if(!t)return!1;const e=document.createElement("a");if(!("download"in e))return!1;const r=URL.createObjectURL(t);return e.download=n,e.href=r,e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(r),!0}function pt(t){return null!=t&&"/"===t[0]&&"/"===t[1]}function ht(t){return null!=t&&a.test(t)}function dt(t){return null!=t&&h.test(t)||"https"===U.scheme&&pt(t)}function mt(t){return null!=t&&p.test(t)||"http"===U.scheme&&pt(t)}function yt(t){return null!=t&&d.test(t)}function gt(t){return pt(t)?`http:${t}`:t.replace(h,"http:")}function $t(t){return pt(t)?`https:${t}`:t.replace(p,"https:")}function xt(){return"http"===U.scheme}function wt(){return"https"===U.scheme}function Ot(t,n=!1){return pt(t)?t.slice(2):(t=t.replace(a,""),n&&t.length>1&&"/"===t[0]&&"/"===t[1]&&(t=t.slice(2)),t)}function Ut(t){const n=t.indexOf("//"),e=t.indexOf("/",n+2);return-1===e?t:t.slice(0,e)}function Rt(t){let n=0;if(Y(t)){const e=t.indexOf("//");-1!==e&&(n=e+2)}const e=t.lastIndexOf("/");return e<n?t:t.slice(0,e+1)}function qt(t,n){if(!t)return"";const e=I(t).path.replace(/\/+$/,""),r=e.slice(e.lastIndexOf("/")+1);if(!n?.length)return r;const o=new RegExp(`\\.(${n.join("|")})$`,"i");return r.replace(o,"")}function Ct(t){return t.endsWith("/")?t:`${t}/`}function bt(t){return t.replace(/\/+$/,"")}function jt(t){if(/^https?:\/\//i.test(t)){const n=E(t);t=(t=n.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),n.query&&(t+=`?${n.query}`)}return t}function Lt(t){return t.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}function It(t){const n=c.httpsDomains;if(!mt(t))return t;const e=t.indexOf("/",7);let r;if(r=-1===e?t:t.slice(0,e),r=r.toLowerCase().slice(7),m.test(r)){if(!r.endsWith(":80"))return t;r=r.slice(0,-3),t=t.replace(":80","")}return xt()&&r===U.authority&&!y.test(t)||(wt()&&r===U.authority||n&&n.some((t=>r===t||r.endsWith(`.${t}`)))||wt()&&!H(t))&&(t=$t(t)),t}function At(t,n,e){if(!(n&&e&&t&&Y(t)))return t;const r=t.indexOf("//"),o=t.indexOf("/",r+2),i=t.indexOf(":",r+2),s=Math.min(o<0?t.length:o,i<0?t.length:i);if(t.slice(r+2,s).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(s)}`}function vt(t){return"string"==typeof t?new x(_(t)):(t.scheme||(t.scheme=U.scheme),t)}function St(t){return Jt.test(t)}function Pt(t,n){const e=I(t),r=Object.keys(e.query||{});return r.length>0&&n&&n.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),e.path}function kt(t,n,e){const r=I(t),o=r.query||{};return o[n]=String(e),`${r.path}?${v(o)}`}function Et(t,n){if(!n)return t;const e=I(t),r=e.query||{};for(const[i,s]of Object.entries(n))null!=s&&(r[i]=s);const o=v(r);return o?`${e.path}?${o}`:e.path}function Bt(t,n){const{path:e,query:r}=I(t);if(!r)return t;delete r[n];const o=v(r);return o?`${e}?${o}`:e}function zt(t){if(null==t)return null;const n=t.match(Wt);return n?n[2]:null}function Ht(t){if(null==t)return null;const n=t.match(Wt);return n?{path:n[1],extension:n[2]}:{path:t,extension:null}}async function Tt(t){if("string"==typeof t){return ot(t)??{data:t}}return new Promise(((n,e)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>n(ot(r.result)),r.onerror=t=>e(t)}))}const Wt=/([^.]*)\.([^/]*)$/,Jt=/(^data:image\/svg|\.svg$)/i;export{x as Url,P as addProxy,z as addProxyRule,kt as addQueryParameter,Et as addQueryParameters,et as base64UrlEncode,st as blobUrlToBlob,At as changeDomain,ot as dataComponents,nt as dataToArrayBuffer,lt as dataToBlob,ct as downloadBlobAsFile,ut as downloadDataAsFile,Ct as ensureTrailingSlash,b as getAppBaseUrl,C as getAppUrl,qt as getFilename,D as getInterceptor,X as getOrigin,zt as getPathExtension,H as getProxyRule,S as getProxyUrl,ht as hasProtocol,W as hasSameCanonicalArcGISOnlinePortal,T as hasSameCanonicalPortal,F as hasSameOrigin,J as hasSamePortal,Y as isAbsolute,wt as isAppHTTPS,Z as isBlobProtocol,tt as isDataProtocol,dt as isHTTPSProtocol,pt as isProtocolRelative,St as isSVG,M as isTrustedServer,V as join,_ as makeAbsolute,it as makeData,G as makeRelative,K as normalize,v as objectToQuery,Tt as parseData,A as queryToObject,Rt as removeFile,Bt as removeQueryParameter,Pt as removeQueryParameters,bt as removeTrailingSlash,Ht as splitPathExtension,L as test,gt as toHTTP,$t as toHTTPS,w as trustedServersUrlCache,I as urlToObject};
|
|
5
|
+
import t from"../config.js";import{isSome as n}from"./arrayUtils.js";import e from"./Error.js";import r from"./Logger.js";import{isSerializable as o}from"./support/jsonUtils.js";import{parseKnownArcGISOnlineDomain as i}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as s,arrayBufferToBase64 as u}from"../support/base64Utils.js";const l=()=>r.getLogger("esri.core.urlUtils"),c=t.request,f="esri/config: esriConfig.request.proxyUrl is not set.",a=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,p=/^\s*http:/i,h=/^\s*https:/i,d=/^\s*file:/i,m=/:\d+$/,y=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),$=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class x{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let n=this.uri.match(g);this.scheme=n[2]||(n[1]?"":null),this.authority=n[4]||(n[3]?"":null),this.path=n[5],this.query=n[7]||(n[6]?"":null),this.fragment=n[9]||(n[8]?"":null),null!=this.authority&&(n=this.authority.match($),this.user=n[3]||null,this.password=n[4]||null,this.host=n[6]||n[7],this.port=n[9]||null)}toString(){return this.uri}}const w={},U=new x(t.applicationUrl);let O=U;const R=b();let q=R;const C=()=>O,j=()=>q;function b(){const t=O.path,n=t.slice(0,t.lastIndexOf("/")+1);return`${`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}`}${n}`}const L={setAppUrl:t=>O=t,setAppBaseUrl:t=>q=t,restoreUrls:()=>{O=U,q=R}};function I(t){if(!t)return null;const n={path:null,query:null},e=new x(t),r=t.indexOf("?");return null===e.query?n.path=t:(n.path=t.slice(0,r),n.query=A(e.query)),e.fragment&&(n.hash=e.fragment,null===e.query&&(n.path=n.path.slice(0,n.path.length-(e.fragment.length+1)))),n}function A(t){const n=t.split("&"),e={};for(const r of n){if(!r)continue;const t=r.indexOf("=");let n,o;t<0?(n=decodeURIComponent(r),o=""):(n=decodeURIComponent(r.slice(0,t)),o=decodeURIComponent(r.slice(t+1)));let i=e[n];"string"==typeof i&&(i=e[n]=[i]),Array.isArray(i)?i.push(o):e[n]=o}return e}function v(t,n){return t?n&&"function"==typeof n?Object.keys(t).map((e=>encodeURIComponent(e)+"="+encodeURIComponent(n(e,t[e])))).join("&"):Object.keys(t).map((e=>{const r=t[e];if(null==r)return"";const i=encodeURIComponent(e)+"=",s=n?.[e];return s?i+encodeURIComponent(s(r)):Array.isArray(r)?r.map((t=>o(t)?i+encodeURIComponent(JSON.stringify(t)):i+encodeURIComponent(t))).join("&"):o(r)?i+encodeURIComponent(JSON.stringify(r)):i+encodeURIComponent(r)})).filter((t=>t)).join("&"):""}function P(t=!1){let n,r=c.proxyUrl;if("string"==typeof t){n=dt(t);const e=T(t);e&&(r=e.proxyUrl)}else n=!!t;if(!r)throw l().warn(f),new e("urlUtils:proxy-not-set",f);n&&wt()&&(r=$t(r));return I(r)}function k(t,n=!1){const e=T(t);let r,o;if(e){const t=B(e.proxyUrl);r=t.path,o=t.query?A(t.query):null}else if(n){const n=P(t);r=n.path,o=n.query}if(r){const n=I(t);t=r+"?"+n.path;const e=v({...o,...n.query});e&&(t=`${t}?${e}`)}return t}const E={path:"",query:""};function B(t){const n=t.indexOf("?");return-1!==n?(E.path=t.slice(0,n),E.query=t.slice(n+1)):(E.path=t,E.query=null),E}function S(t){return t=(t=Ut(t=Ct(t=B(t).path),!0)).toLowerCase()}function H(t){const n={proxyUrl:t.proxyUrl,urlPrefix:S(t.urlPrefix)},e=c.proxyRules,r=n.urlPrefix;let o=e.length;for(let i=0;i<e.length;i++){const t=e[i].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=i;break}0===t.indexOf(r)&&(o=i+1)}return e.splice(o,0,n),o}function T(t){const n=c.proxyRules,e=S(t);for(let r=0;r<n.length;r++)if(0===e.indexOf(n[r].urlPrefix))return n[r]}function W(t,n){if(!t||!n)return!1;t=J(t),n=J(n);const e=i(t),r=i(n);return null!=e&&null!=r?e.portalHostname===r.portalHostname:null==e&&null==r&&F(t,n,!0)}function z(t,n){if(!t||!n)return!1;t=J(t),n=J(n);const e=i(t),r=i(n);return null!=e&&null!=r&&e.portalHostname===r.portalHostname}function D(t,n){return t=J(t),n=J(n),Ut(t)===Ut(n)}function J(t){const n=(t=K(t)).indexOf("/sharing");return n>0?t.slice(0,n):t.replace(/\/+$/,"")}function N(t,n=c.interceptors){const e=n=>null==n||n instanceof RegExp&&n.test(t)||"string"==typeof n&&t.startsWith(n);if(n)for(const r of n)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r;return null}function F(t,n,e=!1){if(!t||!n)return!1;const r=vt(t),o=vt(n);return!(!e&&r.scheme!==o.scheme)&&(null!=r.host&&null!=o.host&&(r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port))}function M(t){if("string"==typeof t){if(!Y(t))return!0;t=vt(t)}if(F(t,O))return!0;const n=c.trustedServers||[];for(let e=0;e<n.length;e++){const r=Q(n[e]);for(let n=0;n<r.length;n++)if(F(t,r[n]))return!0}return!1}function Q(t){return w[t]||(ht(t)||pt(t)?w[t]=[new x(_(t))]:w[t]=[new x(`http://${t}`),new x(`https://${t}`)]),w[t]}function _(t,n=q,e){return pt(t)?e?.preserveProtocolRelative?t:"http"===O.scheme&&O.authority===X(t).slice(2)?`http:${t}`:`https:${t}`:ht(t)?t:V("/"===t[0]?Ot(n):n,t)}function G(t,n=q,e){if(null==t||!Y(t))return t;const r=K(t),o=r.toLowerCase(),i=K(n).toLowerCase().replace(/\/+$/,""),s=e?K(e).toLowerCase().replace(/\/+$/,""):null;if(s&&0!==i.indexOf(s))return t;const u=(t,n,e)=>-1===(e=t.indexOf(n,e))?t.length:e;let l=u(o,"/",o.indexOf("//")+2),c=-1;for(;o.slice(0,l+1)===i.slice(0,l)+"/"&&(c=l+1,l!==o.length);)l=u(o,"/",l+1);if(-1===c)return t;if(s&&c<s.length)return t;t=r.slice(c);const f=i.slice(c-1).replaceAll(/[^/]+/g,"").length;if(f>0)for(let a=0;a<f;a++)t=`../${t}`;else t=`./${t}`;return t}function K(t){return t=It(t=Lt(t=bt(t=_(t=t.trim()))))}function V(...t){const e=t.filter(n);if(!e?.length)return;const r=[];if(Y(e[0])){const t=e[0],n=t.indexOf("//");-1!==n&&(r.push(t.slice(0,n+1)),yt(e[0])&&(r[0]+="/"),e[0]=t.slice(n+2))}else"/"===e[0][0]&&r.push("");const o=e.reduce(((t,n)=>n?t.concat(n.split("/")):t),[]);for(let n=0;n<o.length;n++){const t=o[n];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&n===o.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function X(t,n=!1){if(null==t||Z(t)||tt(t))return null;let e=t.indexOf("://");if(-1===e&&pt(t))e=2;else{if(-1===e)return null;e+=3}const r=t.indexOf("/",e);return-1!==r&&(t=t.slice(0,r)),n&&(t=Ut(t,!0)),t}function Y(t){return pt(t)||ht(t)}function Z(t){return null!=t&&"blob:"===t.slice(0,5)}function tt(t){return null!=t&&"data:"===t.slice(0,5)}function nt(t){const n=ot(t);return n?.isBase64?s(n.data):null}function et(t){return u(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const rt=/^data:(.*?)(;base64)?,(.*)$/;function ot(t){const n=t.match(rt);if(!n)return null;const[,e,r,o]=n;return{mediaType:e,isBase64:!!r,data:o}}function it(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function st(t){return(await fetch(t)).blob()}function ut(t){const n=nt(t);if(!n)return null;const e=ot(t);return new Blob([n],{type:e.mediaType})}function lt(t,n){ft(t,n)}function ct(t,n){at(t,n)}function ft(t,n){const e=ut(t);return!!e&&at(e,n)}function at(t,n){if(!t)return!1;const e=document.createElement("a");if(!("download"in e))return!1;const r=URL.createObjectURL(t);return e.download=n,e.href=r,e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(r),!0}function pt(t){return null!=t&&"/"===t[0]&&"/"===t[1]}function ht(t){return null!=t&&a.test(t)}function dt(t){return null!=t&&h.test(t)||"https"===O.scheme&&pt(t)}function mt(t){return null!=t&&p.test(t)||"http"===O.scheme&&pt(t)}function yt(t){return null!=t&&d.test(t)}function gt(t){return pt(t)?`http:${t}`:t.replace(h,"http:")}function $t(t){return pt(t)?`https:${t}`:t.replace(p,"https:")}function xt(){return"http"===O.scheme}function wt(){return"https"===O.scheme}function Ut(t,n=!1){return pt(t)?t.slice(2):(t=t.replace(a,""),n&&t.length>1&&"/"===t[0]&&"/"===t[1]&&(t=t.slice(2)),t)}function Ot(t){const n=t.indexOf("//"),e=t.indexOf("/",n+2);return-1===e?t:t.slice(0,e)}function Rt(t){let n=0;if(Y(t)){const e=t.indexOf("//");-1!==e&&(n=e+2)}const e=t.lastIndexOf("/");return e<n?t:t.slice(0,e+1)}function qt(t,n){if(!t)return"";const e=I(t).path.replace(/\/+$/,""),r=e.slice(e.lastIndexOf("/")+1);if(!n?.length)return r;const o=new RegExp(`\\.(${n.join("|")})$`,"i");return r.replace(o,"")}function Ct(t){return t.endsWith("/")?t:`${t}/`}function jt(t){return t.replace(/\/+$/,"")}function bt(t){if(/^https?:\/\//i.test(t)){const n=B(t);t=(t=n.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),n.query&&(t+=`?${n.query}`)}return t}function Lt(t){return t.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}function It(t){const n=c.httpsDomains;if(!mt(t))return t;const e=t.indexOf("/",7);let r;if(r=-1===e?t:t.slice(0,e),r=r.toLowerCase().slice(7),m.test(r)){if(!r.endsWith(":80"))return t;r=r.slice(0,-3),t=t.replace(":80","")}return xt()&&r===O.authority&&!y.test(t)||(wt()&&r===O.authority||n&&n.some((t=>r===t||r.endsWith(`.${t}`)))||wt()&&!T(t))&&(t=$t(t)),t}function At(t,n,e){if(!(n&&e&&t&&Y(t)))return t;const r=t.indexOf("//"),o=t.indexOf("/",r+2),i=t.indexOf(":",r+2),s=Math.min(o<0?t.length:o,i<0?t.length:i);if(t.slice(r+2,s).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(s)}`}function vt(t){return"string"==typeof t?new x(_(t)):(t.scheme||(t.scheme=O.scheme),t)}function Pt(t){return Dt.test(t)}function kt(t,n){const e=I(t),r=Object.keys(e.query||{});return r.length>0&&n&&n.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),e.path}function Et(t,n,e){const r=I(t),o=r.query||{};return o[n]=String(e),`${r.path}?${v(o)}`}function Bt(t,n){if(!n)return t;const e=I(t),r=e.query||{};for(const[i,s]of Object.entries(n))null!=s&&(r[i]=s);const o=v(r);return o?`${e.path}?${o}`:e.path}function St(t,n){const{path:e,query:r}=I(t);if(!r)return t;delete r[n];const o=v(r);return o?`${e}?${o}`:e}function Ht(t){if(null==t)return null;const n=t.match(zt);return n?n[2]:null}function Tt(t){if(null==t)return null;const n=t.match(zt);return n?{path:n[1],extension:n[2]}:{path:t,extension:null}}async function Wt(t){if("string"==typeof t){return ot(t)??{data:t}}return new Promise(((n,e)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>n(ot(r.result)),r.onerror=t=>e(t)}))}const zt=/([^.]*)\.([^/]*)$/,Dt=/(^data:image\/svg|\.svg$)/i;export{x as Url,k as addProxy,H as addProxyRule,Et as addQueryParameter,Bt as addQueryParameters,et as base64UrlEncode,st as blobUrlToBlob,At as changeDomain,ot as dataComponents,nt as dataToArrayBuffer,ut as dataToBlob,ct as downloadBlobAsFile,lt as downloadDataAsFile,Ct as ensureTrailingSlash,j as getAppBaseUrl,C as getAppUrl,qt as getFilename,N as getInterceptor,X as getOrigin,Ht as getPathExtension,T as getProxyRule,P as getProxyUrl,ht as hasProtocol,z as hasSameCanonicalArcGISOnlinePortal,W as hasSameCanonicalPortal,F as hasSameOrigin,D as hasSamePortal,Y as isAbsolute,wt as isAppHTTPS,Z as isBlobProtocol,tt as isDataProtocol,dt as isHTTPSProtocol,pt as isProtocolRelative,Pt as isSVG,M as isTrustedServer,V as join,_ as makeAbsolute,it as makeData,G as makeRelative,K as normalize,v as objectToQuery,Wt as parseData,A as queryToObject,Rt as removeFile,St as removeQueryParameter,kt as removeQueryParameters,jt as removeTrailingSlash,Tt as splitPathExtension,L as test,gt as toHTTP,$t as toHTTPS,w as trustedServersUrlCache,I as urlToObject};
|
package/geometry/Mesh.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import r from"../core/Loadable.js";import o from"../core/Logger.js";import s from"../core/Promise.js";import{throwIfAborted as n,whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import r from"../core/Loadable.js";import o from"../core/Logger.js";import s from"../core/Promise.js";import{throwIfAborted as n,whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{fromValues as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"./Geometry.js";import h from"./Point.js";import u from"./Polygon.js";import{create as d,fromBuffer as f,zero as g}from"./support/aaBoundingBox.js";import{composeAxes as x,create as y}from"./support/axisAngleDegrees.js";import v from"./support/MeshComponent.js";import{componentNotFoundMessage as j,meshNotLoadedMessage as w,invalidLocationMessage as S,invalidPolygonMessage as b,InvalidLocationError as A}from"./support/meshErrors.js";import L from"./support/MeshGeoreferencedVertexSpace.js";import M from"./support/MeshLocalVertexSpace.js";import R from"./support/MeshTransform.js";import{MeshVertexAttributes as C}from"./support/MeshVertexAttributes.js";import{vertexSpaceOriginToPoint as _,isRelativeVertexSpace as F,selectVertexSpace as U}from"./support/meshVertexSpaceUtils.js";import{triangulate as P}from"./support/triangulationUtils.js";import{centerAt as E}from"./support/meshUtils/centerAt.js";import{computeMeshExtent as B}from"./support/meshUtils/extent.js";import{loadExternal as G}from"./support/meshUtils/loadExternal.js";import{Metadata as k}from"./support/meshUtils/Metadata.js";import{convertUnitGeometry as I,createUnitSizeBox as T,extractSingleFaceOfBox as V,createUnitSizeSphere as O,createUnitSizeCylinder as z,convertPlaneSizeParameter as D,createUnitSizePlane as N}from"./support/meshUtils/primitives.js";import{rotate as W}from"./support/meshUtils/rotate.js";import{scale as Z}from"./support/meshUtils/scale.js";var H;const K={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:L,local:M}};let q=H=class extends(r.LoadableMixin(s.EsriPromiseMixin(l))){constructor(e){super(e),this.components=null,this.vertexSpace=new L,this.transform=null,this.metadata=new k,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.addHandles(a((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone()))})),(()=>this._clearSources()),{once:!0,sync:!0}))}))}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,r=this;return B({get transform(){return r.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?d(g):f(e)}get origin(){const e=_(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:r}=this._transformedExtent;return new h({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(v.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}o.getLogger(this).error("removeComponent()",j)}}rotate(e,t,r,o){return x(e,t,r,J),W(this,J,o),this}offset(e,t,r){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:o,vertexAttributes:s}=this,n=s?.position;if(!n)return this;if(F(o)){const[s,n,i]=o.origin;o.origin=m(s+e,n+t,i+r)}else{for(let o=0;o<n.length;o+=3)n[o]+=e,n[o+1]+=t,n[o+2]+=r;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(Z(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(E(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(G(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneAndModifyVertexAttributes(this.vertexAttributes.clone(),this.vertexSpace.clone(),{preserveMetadata:!0})}cloneAndModifyVertexAttributes(e,t,r){let o=null;if(this.components){const e=new Map,t=new Map;o=this.components.map((r=>r.cloneWithDeduplication(e,t)))}const s={components:o,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:r?.preserveMetadata?this.metadata.clone():new k};return new H(s)}cloneShallow(){return new H({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([import("./support/meshUtils/exporters/gltf/gltfexport.js"),this.load(e)]);return n(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce(((e,t)=>e+t.memoryUsage),this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(o.getLogger(this).error(e,w),!1)}static createBox(e,t){if(!(e instanceof h))return o.getLogger(this.prototype).error(".createBox()",S),null;const r=new H(I(T(),e,t));return t?.imageFace&&"all"!==t.imageFace?V(r,t.imageFace):r}static createSphere(e,t){return e instanceof h?new H(I(O(t?.densificationFactor||0),e,t)):(o.getLogger(this.prototype).error(".createSphere()",S),null)}static createCylinder(e,t){return e instanceof h?new H(I(z(t?.densificationFactor||0),e,t)):(o.getLogger(this.prototype).error(".createCylinder()",S),null)}static createPlane(e,t){if(!(e instanceof h))return o.getLogger(this.prototype).error(".createPlane()",S),null;const r=t?.facing??"up",s=D(r,t?.size);return new H(I(N(r),e,{...t,size:s}))}static createFromPolygon(e,t){if(!(e instanceof u))return o.getLogger(this.prototype).error(".createFromPolygon()",b),null;const r=P(e);return new H({vertexAttributes:new C({position:r.position}),components:[new v({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new L})}static async createFromGLTF(e,t,r){if(!(e instanceof h)){const e=new A;throw o.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:s}=await i(import("./support/meshUtils/loadGLTFMesh.js"),r);return new H(await s(e,t,r))}static createWithExternalSource(e,t,r){const o=r?.extent??null,{spatialReference:s}=e,n=r?.transform?.clone()??new R,i=U(e,r),a=r?.unitConversionDisabled,p={source:t,extent:o,unitConversionDisabled:a},c=new k;return c.externalSources.push(p),new H({metadata:c,transform:n,vertexSpace:i,spatialReference:s})}static createIncomplete(e,r){const{spatialReference:o}=e,s=r?.transform?.clone()??new R,n=U(e,r),i=new H({transform:s,vertexSpace:n,spatialReference:o});return i.addResolvingPromise(Promise.reject(new t("mesh-incomplete","Mesh resources are not complete"))),i}};e([p({type:[v],json:{write:!0}})],q.prototype,"components",void 0),e([p({nonNullable:!0,types:K,constructOnly:!0,json:{write:!0}})],q.prototype,"vertexSpace",void 0),e([p({type:R,json:{write:!0}})],q.prototype,"transform",void 0),e([p({constructOnly:!0})],q.prototype,"metadata",void 0),e([p()],q.prototype,"hasExtent",null),e([p()],q.prototype,"_transformedExtent",null),e([p()],q.prototype,"_untransformedBounds",null),e([p()],q.prototype,"origin",null),e([p({readOnly:!0,json:{read:!1}})],q.prototype,"extent",null),e([p({readOnly:!0,json:{read:!1,write:!0,default:!0}})],q.prototype,"hasZ",void 0),e([p({readOnly:!0,json:{read:!1,write:!0,default:!1}})],q.prototype,"hasM",void 0),e([p({type:C,nonNullable:!0,json:{write:!0}})],q.prototype,"vertexAttributes",void 0),q=H=e([c("esri.geometry.Mesh")],q);const J=y(),Q=q;export{Q as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{t as e,
|
|
5
|
+
import{t as e,o as t,G as n,b as r}from"../../chunks/Geometry.js";import{Envelope2D as o}from"../../chunks/Envelope2D.js";import{a as s,P as a,A as i,B as g}from"../../chunks/Envelope.js";import{S as m,f as u}from"../../chunks/QuadraticBezier.js";import{w as c}from"../../chunks/Point2D.js";import{getSpatialReference as l,fromPolyline as p,fromSpatialReference as d,toPolyline as h}from"./support/apiConverter.js";function f(t,n,r,a,i){if(t.isEmpty()||n.isEmpty())return null;if(8&a&&16&a)return null;2&a&&4&a&&e("");const g=new o,m=new o;t.queryEnvelope(g),n.queryEnvelope(m),g.mergeEnvelope2D(m);return P(t,n,s(r,g,!0).total(),a)}function P(e,o,s,i){t(e),t(o);let g,c=!1;const l=e.querySegmentIterator(),p=o.querySegmentIterator();let d=0;const h=new m,f=new a({vd:e.getDescription()}),P=new a({vd:e.getDescription()}),y=[],x=[];for(S(e,y,x);l.nextPath();){let t=!0,o=0;for(;2!==o;){if(0===o){l.nextSegment().getGeometryType()!==n.enumLine&&r(""),o++}else{l.resetToLastSegment();if(l.previousSegment().getGeometryType()!==n.enumLine&&r(""),c&&t){const n=l.getPathIndex();g.addSegmentsFromPath(e,n,0,e.getSegmentCountPath(n),!0),t=!1}o++}let a=!1;if(d<x.length){const e=x[y[d]],t=l.getPathIndex();if(e.m_path===t){const t=1===o?l.getStartPointIndex():l.getEndPointIndex();e.m_pointIndex===t&&(a=!0,d++)}}if(1===o){if(8&i)continue}else if(16&i)continue;if(!a){1===o?l.previousSegment():l.nextSegment();const a=1===o?l.nextSegment():l.previousSegment(),m=a,d=m.calculateLength2D();p.resetToFirstPath();let y=!1,S=Number.NaN;for(;p.nextPath();){for(;p.hasNextSegment();){const e=p.nextSegment();e.getGeometryType()!==n.enumLine&&r("");const t=e,{bIntersect:a,t1:i,t2:g}=u(m,t);if(a){const e=t.calculateLength2D();if(g*e>=-s&&(1-g)*e>=-s)if(1===o){if(i*d<=-s)(Number.isNaN(S)||i>S)&&(S=i);else if(i*d<=s){S=Number.NaN,y=!0;break}}else if((1-i)*d<=-s)(Number.isNaN(S)||i<S)&&(S=i);else if((1-i)*d<=s){S=Number.NaN,y=!0;break}}}if(y)break}if(!Number.isNaN(S)){if(!c){g=e.createInstance();for(let t=0;t<l.getPathIndex();t++)g.addPath(e,t,!0)}if(1===o){a.queryCoord(S,f);const n=l.getPathIndex();if(2&i?e.getPointByVal(e.getPathStart(n),P):4&i&&P.setEmpty(),1&i||(h.create(a.getGeometryType()),a.copyTo(h.get()),h.get().setEnd(f),h.get().reverse(),g.addSegment(h.get(),!0),t=!1),g.addSegmentsFromPath(e,n,0,e.getSegmentCountPath(n),t),1&i){const e=g.getPathStart(n);g.setPointByVal(e,f)}if(2&i||4&i){const e=g.getPathStart(n),t=f.getXY();P.setXY(t),g.setPointByVal(e,P)}c=!0,t=!1}else{const n=l.getPathIndex();if(t&&(g.addSegmentsFromPath(e,n,0,e.getSegmentCountPath(n),!0),t=!1),2&i?e.getPointByVal(e.getPathEnd(n)-1,P):4&i&&P.setEmpty(),a.queryCoord(S,f),1&i){const e=g.getPathEnd(n);g.setPointByVal(e-1,f)}else h.create(a.getGeometryType()),a.copyTo(h.get()),h.get().setEnd(f),g.addSegment(h.get(),!1);if(2&i||4&i){const e=g.getPathEnd(n),t=f.getXY();P.setXY(t),g.setPointByVal(e-1,P)}c=!0}}}}}return c?g:null}function y(e,t){return{m_path:e,m_pointIndex:t}}function S(e,t,n){const r=[],o=[],s=e.querySegmentIterator();for(;s.nextPath();){s.resetToFirstSegment();const e=s.nextSegment().getStartXY(),t=s.getPathIndex(),n=s.getStartPointIndex();r.push(e),o.push(y(t,n)),s.resetToLastSegment();const a=s.previousSegment().getEndXY(),i=s.getPathIndex(),g=s.getEndPointIndex();r.push(a),o.push(y(i,g))}const a=new i(0);for(let i=0;i<r.length;i++)a.add(i);const m={userSort(e,t,n){n.sort(e,t,((e,t)=>r[e].compare(r[t])))},getValue:e=>r[e].y};(new g).sort(a,0,a.size(),m);for(let i=0;i<a.size()-1;i++){const e=r[a.read(i)];if(e.equals(r[a.read(i+1)])){do{const e=o[a.read(i)];n.push(e),i++}while(i<a.size()&&e.equals(r[a.read(i)]));i--}}c(t,n.length,0);for(let i=0;i<n.length;i++)t[i]=i;t.sort(((e,t)=>{const r=n[e],o=n[t];return r.m_path<o.m_path?-1:r.m_path>o.m_path?1:r.m_pointIndex<o.m_pointIndex?-1:1}))}class x{getOperatorType(){return 10007}supportsCurves(){return!1}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(e,t,n,r,o){return f(e,t,n,r)}}const E=new x;function I(e,t,n){let r=0;n&&(n.relocateEnds&&(r|=1),n.keepEndAttributes&&(r|=2),n.noEndAttributes&&(r|=4),n.noExtendAtFrom&&(r|=8),n.noExtendAtTo&&(r|=16));const o=l(e),s=E.execute(p(e),p(t),d(o),r,null);return s?h(s,o):null}const N=E.supportsCurves();export{I as execute,N 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{l as i,d as n,i as s,G as o,t as r,g as h}from"../../../chunks/Geometry.js";import{m as d,P as g,i as a,u as c,n as l,b as u,d as f,v as m}from"../../../chunks/Point2D.js";import{a as p,M as E,r as x,e as P}from"../../../chunks/QuadraticBezier.js";function _(t,e,i,n,s,o){const r=n-e;if(r<=o)return P(t,e,i,n,s),i;const h=w(t,e,n,s,Math.min(Math.max(r>>1,3),100)),d=t[h];t[e]=u(t[h],t[h]=t[e]);let g=e+1,a=!1;for(let c=e+1;c!==n;++c)s(t[c],d)&&(t[g]=u(t[c],t[c]=t[g]),++g,a=!0);if(!a)for(let c=e+1;c<i;++c)s(d,t[c])||(c!==g&&(t[g]=u(t[c],t[c]=t[g])),++g);return--g,t[g]=u(t[e],t[e]=t[g]),g}function F(t,e,i){const n=Math.trunc(e/2);let s=BigInt(n);const o=BigInt(e);for(let h=0;h<i;++h)t.push(Number(s%o)),s=6364136223846793005n*s+1442695040888963407n&0x7fffffffffffffffn,s=BigInt.asUintN(64,s);m(t);const r=c(t,((t,e)=>t===e));t.length=r}function w(t,e,i,n,s){const o=[];F(o,i-e,s);const r=[];for(let d=0,g=o.length;d<g;d++){const i=o[d];r.push(l(t[e+i],i))}const h=Math.trunc(r.length/2);return r.sort(((t,e)=>n(t.first,e.first)?-1:1)),e+r[h].second}function k(){return{p:new g,userData:Number.NaN,edge:null}}class T{constructor(){this.info=0,this.mask=!1,this.p=null,this.a=[null,null],this.twin=null}nextFreeEdge(){return this.twin}setIndex(t){this.info=t,this.mask=!1}getIndex(){return this.info}setMask(){this.mask=!0}getMask(){return this.mask}}function y(t,e){return{first:t,second:e}}function b(t,e){t.first=e.first,t.second=e.second}function C(){return this.i1-this.i0}function D(){return{i0:Number.NaN,i1:Number.NaN,nextFreeEdgeIndex:[-1],box:[y(null,null),y(null,null)],size:C}}function I(){return{k:0,pTask:null,pTask0:null,pTask1:null}}function X(){return{p:[new g,new g],points:[null,null]}}function Y(){return{p:[null,null,null]}}class N{constructor(){this.m_nextFreePairEdge=y(null,null),this.m_points=[],this.m_pointZero=null,this.m_edges=[],this.m_voronoiToEdge=[],this.m_nextFreeEdge=0}clear(){this.m_nextFreePairEdge=y(null,null),this.m_points.length=0,this.m_pointZero=null,this.m_edges.length=0,this.m_voronoiToEdge.length=0,this.m_nextFreeEdge=0}reservePoints(t){h(t>1)}prepare(t){{const e=k();e.p.x=Number.POSITIVE_INFINITY,e.p.y=Number.POSITIVE_INFINITY,e.userData=t,this.m_points.push(e)}}addVertex(t,e){const i=k();i.p.assign(t),i.userData=e,i.edge=null,this.m_points.push(i)}removeDuplicates(){const t=this.m_points.shift();this.m_points.sort(((t,e)=>t.p.compareX(e.p)));const e=c(this.m_points,((t,e)=>t.p.equals(e.p))),i=e!==this.m_points.length;return this.m_points.length=e,this.m_points.unshift(t),i}boundVoronoiCells(t,e){const i=this.m_points.length;if(i<2)return!1;const n=[this.m_points[1].p.clone(),this.m_points[1].p.clone()];for(let d=2;d<i;d++){const t=this.m_points[d].p;t.x<n[0].x&&(n[0].x=t.x),n[1].x<t.x&&(n[1].x=t.x),t.y<n[0].y&&(n[0].y=t.y),n[1].y<t.y&&(n[1].y=t.y)}const s=new g;s.x=.5*(n[0].x+n[1].x),s.y=.5*(n[0].y+n[1].y);let o=0;for(let d=1;d<i;d++){const t=this.m_points[d].p,e=g.sqrDistanceCoords(t.x,t.y,s.x,s.y);o<e&&(o=e)}const r=Math.sqrt(o),h=Math.max(r+2*t,1.5*r);{const t=.8660254037844386,i=.5;let n=1,o=0;for(let r=0;r<12;r++){const r=new g;r.x=s.x+h*n,r.y=s.y+h*o,this.addVertex(r,e);const d=n*i+o*t;n=n*t-o*i,o=d}}return!0}construct(){const t=D();return!!this.constructTask(t)&&(this.solveTask(t),!0)}constructTask(t){if(this.m_pointZero=this.createZeroHandle(),h(void 0!==this.m_pointZero),this.m_points.length<3)return!1;const e=6*(this.m_points.length-2);this.m_edges=d(T,e);for(let i=0;i<e;i++)this.m_edges[i].setIndex(i);return t.i0=1,t.i1=this.m_points.length,t.nextFreeEdgeIndex[0]=0,!0}splitTask(t,e,i,n){const s=t,o=e,r=i,h=n;s.k=this.findMaxSide(h.i0,h.i1);let d=h.i0+h.i1>>1;const g=1250;if(0===s.k){d=_(this.m_points,h.i0,d,h.i1,((t,e)=>t.p[0]!==e.p[0]?t.p[0]<e.p[0]:t.p[1]<e.p[1]),g)}else{d=_(this.m_points,h.i0,d,h.i1,((t,e)=>t.p[1]!==e.p[1]?t.p[1]<e.p[1]:t.p[0]<e.p[0]),g)}o.i0=h.i0,o.i1=d,o.nextFreeEdgeIndex[0]=h.nextFreeEdgeIndex[0],h.nextFreeEdgeIndex[0]+=6*(o.i1-o.i0-1)+2,r.i0=d,r.i1=h.i1,r.nextFreeEdgeIndex[0]=h.nextFreeEdgeIndex[0],h.nextFreeEdgeIndex[0]+=6*(r.i1-r.i0-1)+2,s.pTask=h,s.pTask0=o,s.pTask1=r}solveMergeTask(t){const e=this.newPairEdgeEx(t.pTask.nextFreeEdgeIndex,!1);if(t.pTask.box[t.k]=y(t.pTask0.box[t.k].first,t.pTask1.box[t.k].second),t.pTask.box[1-t.k]=y(A(this.getPointXYFromEdge(t.pTask0.box[1-t.k].first),this.getPointXYFromEdge(t.pTask1.box[1-t.k].first),1-t.k)?t.pTask0.box[1-t.k].first:t.pTask1.box[1-t.k].first,A(this.getPointXYFromEdge(t.pTask0.box[1-t.k].second),this.getPointXYFromEdge(t.pTask1.box[1-t.k].second),1-t.k)?t.pTask1.box[1-t.k].second:t.pTask0.box[1-t.k].second),t.pTask.i0+2===t.pTask.i1){const i=t.pTask0.box[t.k].second,n=i.twin,s=t.pTask1.box[t.k].first,o=s.twin;return this.joinEdges2(n,o),this.joinEdges2(o,n),void this.join(i,s,0,1,e)}const i=[new Array(2),new Array(2)];i[0][0]=i[1][0]=y(t.pTask0.box[t.k].second,t.pTask0.box[t.k].second.twin),i[0][1]=i[1][1]=y(t.pTask1.box[t.k].first,t.pTask1.box[t.k].first.twin);const n=[!1,!1];if(t.pTask0.i0+1===t.pTask0.i1?(this.findEdgeSide(i[0],n,1,0),this.findEdgeSide(i[1],n,1,1)):(this.findEdge(i[0],n,0),this.findEdge(i[1],n,1)),n[0]||n[1]){if(n[0]){const e=this.newPairEdgeEx(t.pTask0.nextFreeEdgeIndex,!1);this.insertEdge(i[0][0].first,e.first,0),this.insertEdge(i[0][0].second,e.second,1)}if(n[1]){const e=this.newPairEdgeEx(t.pTask1.nextFreeEdgeIndex,!1);this.insertEdge(i[0][1].first,e.first,1),this.insertEdge(i[0][1].second,e.second,0)}}else this.getNextDEdge(i[0][0].first,0)!==i[0][0].first&&(i[1][0]=this.newPairEdgeEx(t.pTask0.nextFreeEdgeIndex,!1),this.insertEdge(i[0][0].first,i[1][0].first,0),this.insertEdge(i[0][0].second,i[1][0].second,1)),this.getNextDEdge(i[0][1].first,0)!==i[0][1].first&&(i[1][1]=this.newPairEdgeEx(t.pTask1.nextFreeEdgeIndex,!1),this.insertEdge(i[0][1].first,i[1][1].first,1),this.insertEdge(i[0][1].second,i[1][1].second,0));this.merge(i[1][0],i[0][0],i[0][1],i[1][1],e)}solveTask(t){const e=t;switch(e.i1-e.i0){case 1:{this.insertPoint(e.i0,e.nextFreeEdgeIndex);const t=this.m_points[e.i0].edge;e.box[0]=e.box[1]=l(t,t)}break;case 2:{const t=e.i0,i=t+1;this.insertPoint(t,e.nextFreeEdgeIndex),this.insertPoint(i,e.nextFreeEdgeIndex);const n=this.m_points[t],s=this.m_points[i],o=n.edge,r=s.edge,h=o.twin,d=r.twin;this.joinEdges2(h,d),this.joinEdges2(d,h);const g=this.newPairEdgeEx(e.nextFreeEdgeIndex,!1);this.join(o,r,0,1,g);for(let a=0;a<2;a++)e.box[a]=A(this.getPointXY(n),this.getPointXY(s),a)?y(o,r):y(r,o)}break;case 3:{const t=[e.i0,e.i0+1,e.i0+2];this.insertPoint(t[0],e.nextFreeEdgeIndex),this.insertPoint(t[1],e.nextFreeEdgeIndex),this.insertPoint(t[2],e.nextFreeEdgeIndex);const i=[this.m_points[t[0]],this.m_points[t[1]],this.m_points[t[2]]],n=this.caseFromCompare(i[0].p,i[1].p,i[2].p),s=[i[0].edge,i[1].edge,i[2].edge],o=N.c_aTableDelaunayTriangulationSolution[n],r=v(19*v(1+(7&o))),h=v(19*v(1+(o>>5)));let d=v(o<<3)>>6;const g=3&r,a=r>>6,c=3&h,l=h>>6;e.box[0]=y(s[g],s[a]),e.box[1]=y(s[c],s[l]);const f=[s[0].twin,s[1].twin,s[2].twin],m=[this.newPairEdgeEx(e.nextFreeEdgeIndex,!1),this.newPairEdgeEx(e.nextFreeEdgeIndex,!1),this.newPairEdgeEx(e.nextFreeEdgeIndex,!1)];switch(3===d&&(d=this.orientation(i[0].p,i[1].p,i[2].p)+1),d){case 0:this.joinEdges2(f[0],f[2]),this.joinEdges2(f[2],f[1]),this.joinEdges2(f[1],f[0]),this.join(s[0],s[2],0,1,m[0]),this.join(s[2],s[1],0,1,m[1]),this.join(s[1],s[0],0,1,m[2]);break;case 1:{const t=[0,1,2];t[3-(g+a)]=u(t[1],t[1]=t[3-(g+a)]),this.joinEdges2(f[t[0]],f[t[1]]),this.joinEdges2(f[t[1]],f[t[2]]),this.joinEdges2(f[t[2]],f[t[0]]),this.join(s[t[0]],s[t[1]],0,1,m[0]),this.join(s[t[1]],s[t[2]],0,1,m[1]),this.join(m[1].first,f[t[2]],0,1,m[2])}break;case 2:this.joinEdges2(f[0],f[1]),this.joinEdges2(f[1],f[2]),this.joinEdges2(f[2],f[0]),this.join(s[0],s[1],0,1,m[0]),this.join(s[1],s[2],0,1,m[1]),this.join(s[2],s[0],0,1,m[2])}}break;default:{const e=I(),i=D(),n=D();this.splitTask(e,i,n,t),this.solveTask(i),this.solveTask(n),this.solveMergeTask(e)}}}getOutsideHull(){const t=[],e=this.m_points[0].edge;let i=e;do{t.push(this.getPointFromEdge(this.getTwinEdge(i))),i=this.getNextDEdge(i,0)}while(i!==e);return t}getConvexHull(){const t=[],e=this.m_points[0].edge;let i=e;do{const e=this.getPointFromEdge(this.getTwinEdge(i));t.length<2||!this.insideLine(this.getPointXY(t.at(-2)),this.getPointXY(t.at(-1)),this.getPointXY(e))?t.push(e):t[t.length-1]=e,i=this.getNextDEdge(i,0)}while(i!==e);return 2<t.length&&this.insideLine(this.getPointXY(t[0]),this.getPointXY(t.at(-1)),this.getPointXY(t.at(-2)))&&t.pop(),2<t.length&&this.insideLine(this.getPointXY(t[1]),this.getPointXY(t[0]),this.getPointXY(t.at(-1)))&&(t[0]=t.at(-1),t.pop()),t}getVoronoiPolygon(t,e){t.length=0;const i=this.getEdgeFromPoint(e);let n=i;for(;;){const e=this.calculateCircleCenter(n);t.push(e);const s=this.getNextDEdge(n,1);if(s===i)break;n=s}}getNearestPoint(t){this.isInfinitePointFromPoint(t)&&r("Not supported for the infinite point");const e=this.getPointXY(t);let i=this.m_pointZero,n=Number.MAX_VALUE;const s=this.getEdgeFromPoint(t);let o=s;do{const t=this.getPointFromEdge(this.getTwinEdge(o));if(!this.isInfinitePointFromPoint(t)){const s=g.sqrDistance(e,this.getPointXY(t));s<n&&(i=t,n=s)}o=this.getCounterClockwiseEdge(o)}while(o!==s);return i}addConstraint(t,e){const i=[null],n=[null];if(!this.constraintFindFirstEdge(i,n,t,e))return y(n[0],i[0]);i[0]=this.getTwinEdge(i[0]);const s=this.getPointXY(t),o=this.getPointXY(e),h=[new Array(0),new Array(0)],d=i[0];for(;;){const t=this.getClockwiseEdge(n[0]);t.getMask()&&r("add_constraint");const d=y(t,this.getTwinEdge(t));this.deleteTwinEdges(d,!0);const g=this.getCounterClockwiseEdge(this.getTwinEdge(i[0])),a=this.getTwinEdge(this.getClockwiseEdge(n[0])),c=this.getPointFromEdge(a);if(c===e){h[0].push(i[0]),i[0]=g,h[1].push(n[0]),n[0]=a;break}const l=this.orientation(s,o,this.getPointXY(c));0===l&&r("add_constraint - point on constraint"),0<l?(h[0].push(i[0]),i[0]=g):(h[1].push(n[0]),n[0]=a)}h[0].push(i[0]),h[1].push(n[0]);const g=this.newPairEdge();g.first.setMask(),g.second.setMask(),this.join(n[0],d,1,1,g),this.triangulateConstraint(h[0],1,h[0].length-1,g),h[1].reverse();const a=y(g.second,g.first);return this.triangulateConstraint(h[1],1,h[1].length-1,a),a}verify(){for(let t=0,e=this.m_edges.length;t<e;t++){const e=this.m_edges[t];if(!e.getMask()&&!this.testEdge(e))return!1}return!0}getDelaunayTriangleCount(){return this.m_points.length-2<<1}getVoronoiSegments(t=Number.MAX_VALUE){const e=[];for(let i=0,n=this.m_edges.length;i<n;i+=2){const n=y(null,null);if(n.first=this.m_edges[i],n.second=n.first.twin,this.isInfinitePointFromEdge(n.first)&&(n.second=u(n.first,n.first=n.second)),this.isInfinitePointFromEdge(n.second)){const i=d(g,3);i[0]=this.calculateCircleCenter(this.getNextDEdge(n.first,0).twin,1),i[2]=this.calculateCircleCenter(this.getNextDEdge(n.first,1),1);const s=d(g,2);s[0].assign(i[0]),s[1].assign(i[2]),s[0].rightPerpendicularThis(),s[1].leftPerpendicularThis(),i[1]=i[0].add(s[0]).add(i[2].add(s[1])),i[1].normalize();for(const e of i)e.mulThis(t);const o=X();o.points[0]=n.first.p,o.points[1]=n.second.p;for(let t=0;t<i.length-1;t++){for(let e=0;e<2;e++)o.p[e]=i[t+e];o.p[0].equals(o.p[1])||e.push(o)}}else if(this.isInfinitePointFromEdge(this.getNextDEdge(n.first,0).twin)&&this.isInfinitePointFromEdge(this.getNextDEdge(n.first,1).twin)){const t=d(g,3);t[0]=this.calculateCircleCenter(n.first),t[1]=this.getPointXY(this.getPointFromEdge(n.first)).add(this.getPointXY(this.getPointFromEdge(n.second))).mul(.5),t[2]=this.calculateCircleCenter(n.second);const i=X();i.points[0]=n.first.p,i.points[1]=n.second.p;for(let n=0;n<t.length-1;n++){for(let e=0;e<2;e++)i.p[e]=t[n+e];i.p[0].equals(i.p[1])||e.push(i)}}else{const t=X();t.p[0]=this.calculateCircleCenter(n.first),t.p[1]=this.calculateCircleCenter(n.second),t.points[0]=n.first.p,t.points[1]=n.second.p,t.p[0].equals(t.p[1])||e.push(t)}}return e}startDelaunayTriangles(){return-1}nextDelaunayTriangle(t,e){for(;;){if(++e[0],e[0]===this.m_edges.length)return!1;const i=this.m_edges[e[0]];if(t.p[0]=this.getPointFromEdge(i),this.isInfinitePointFromPoint(t.p[0]))continue;const n=this.getTwinEdge(i);if(t.p[1]=this.getPointFromEdge(n),this.isInfinitePointFromPoint(t.p[1]))continue;if(this.getPointXY(t.p[1]).lt(this.getPointXY(t.p[0])))continue;const s=this.getTwinEdge(this.getNextDEdge(i,1));if(t.p[2]=this.getPointFromEdge(s),!this.isInfinitePointFromPoint(t.p[2])&&!this.getPointXY(t.p[2]).lt(this.getPointXY(t.p[0])))return!0}}getPointCount(){return this.m_points.length-1}getPoint(t){return this.m_points[t+1]}getInfinitePoint(){return this.m_pointZero}isInfinitePointFromPoint(t){return t===this.m_pointZero}getPointXY(t){return t.p}getPointIndex(t){return t.userData}setPointIndex(t,e){t.userData=e}getEdgeFromPoint(t){return t.edge}isInfinitePointFromEdge(t){return t.p===this.m_pointZero}getEdgeCount(){return this.m_edges.length}getEdge(t){return this.m_edges[t]}getEdgeIndex(t){return t.getIndex()}getPointFromEdge(t){return t.p}getPointXYFromEdge(t){return t.p.p}getCounterClockwiseEdge(t){return t.a[0]}getClockwiseEdge(t){return t.a[1]}getTwinEdge(t){return t.twin}getPreviousEdge(t){return this.getTwinEdge(this.getCounterClockwiseEdge(t))}getNextEdge(t){return this.getClockwiseEdge(this.getTwinEdge(t))}getNextDEdge(t,e=1){return t.a[e]}newPairEdge(){const t=y(this.m_nextFreePairEdge.first,this.m_nextFreePairEdge.second);return this.m_nextFreePairEdge.first=this.m_nextFreePairEdge.first.nextFreeEdge(),this.m_nextFreePairEdge.second=this.m_nextFreePairEdge.second.nextFreeEdge(),t.first.twin=t.second,t.second.twin=t.first,t}newPairEdgeEx(t,e){let i;if(e&&null!==this.m_nextFreePairEdge.first)i=y(this.m_nextFreePairEdge.first,this.m_nextFreePairEdge.second),this.m_nextFreePairEdge.first=this.m_nextFreePairEdge.first.nextFreeEdge(),this.m_nextFreePairEdge.second=this.m_nextFreePairEdge.second.nextFreeEdge();else{const e=t[0]++,n=t[0]++;i=y(this.m_edges[e],this.m_edges[n])}return i.first.twin=i.second,i.second.twin=i.first,i}insertEdge(t,e,i){e.p=t.p;const n=t.a[i],s=e.a;s[i]=n,s[1-i]=t,t.a[i]=e,n.a[1-i]=e}insertPoint(t,e){const i=this.m_points[t],n=this.newPairEdgeEx(e,!1),s=n.first,o=n.second;i.edge=n.first,s.p=this.m_points[t],s.a[0]=n.first,s.a[1]=n.first,o.p=this.m_pointZero,o.a[0]=n.second,o.a[1]=n.second,null===this.m_points[0].edge&&(this.m_points[0].edge=n.second)}deleteTwinEdges(t,e){this.deleteEdge(t.first),this.deleteEdge(t.second),e&&(t.first.twin=this.m_nextFreePairEdge.first,t.second.twin=this.m_nextFreePairEdge.second,this.m_nextFreePairEdge=t)}join(t,e,i,n,s){this.insertEdge(t,s.first,i),this.insertEdge(e,s.second,n)}joinEdges2(t,e){t.a[1]=e,e.a[0]=t}checkEdge(t,e,i,n,s){for(;;){const o=y(null,null);if(o.first=this.getNextDEdge(t.first,n),o.second=o.first.twin,this.isInfinitePointFromEdge(o.second))return t;const r=this.getPointXYFromEdge(t.second),h=this.getPointXYFromEdge(o.second);if(this.inCircle(e,i,r,h)<=0)return t;if(this.deleteTwinEdges(t,s),!s){const e=this.getNextDEdge(t.second,n).twin;this.join(o.second,e,n,n,t)}t=o}}calculateCircleCenter(t,e=Number.MAX_VALUE){const i=this.getPointXYFromEdge(t),n=this.getPointXYFromEdge(t.twin),s=this.getNextDEdge(t,0);if(this.isInfinitePointFromEdge(s.twin)){const t=new g;if(Number.isNaN(e))t.setNAN();else{const s=n.sub(i);s.leftPerpendicularThis(),t.assign(s),t.divThis(Math.max(Math.abs(t.x),Math.abs(t.y))),t.normalize(),t.mulThis(e)}return t}const o=this.getPointXYFromEdge(s.twin);return this.calculateCircleCenterFromThreePoints(i,n,o)}createZeroHandle(){return this.m_points[0]}deleteEdge(t){const e=t,i=e.p;i.edge===t&&(i.edge=e.a[0]),e.a[0].a[1]=e.a[1],e.a[1].a[0]=e.a[0]}testEdge(t){if(this.isInfinitePointFromEdge(t))return!0;const e=t.twin;if(this.isInfinitePointFromEdge(e))return!0;const i=this.getNextDEdge(t,0).twin,n=this.getNextDEdge(e,0).twin;if(this.isInfinitePointFromEdge(i)||this.isInfinitePointFromEdge(n))return!0;const s=this.getPointXYFromEdge(t),o=this.getPointXYFromEdge(e),r=this.getPointXYFromEdge(i),h=this.getPointXYFromEdge(n);return!(this.orientation(s,o,r)<=0)&&(!(0<=this.orientation(s,o,h))&&this.inCircle(s,o,r,h)<=0)}findMaxSide(t,e){const i=[this.m_points[t].p.clone(),this.m_points[t].p.clone()];for(t++;t!==e;t++){const e=this.m_points[t].p;e.x<i[0].x&&(i[0].x=e.x),i[1].x<e.x&&(i[1].x=e.x),e.y<i[0].y&&(i[0].y=e.y),i[1].y<e.y&&(i[1].y=e.y)}return i[1].x-i[0].x<i[1].y-i[0].y?1:0}findEdge(t,e,i){let n=!1,s=0;for(;;){const o=y(null,null);if(o.second=this.getNextDEdge(t[s].second,i^s),o.first=o.second.twin,0===i&&this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(o.first))<0||1===i&&0<this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(o.first)))t[s]=o,e[s]=!0,n=!1;else{if(n)return;s^=1,n=!0}}}findEdgeSide(t,e,i,n){for(;;){const s=y(null,null);if(s.second=this.getNextDEdge(t[i].second,n^i),s.first=s.second.twin,!(0===n&&this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(s.first))<0||1===n&&0<this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(s.first))))return;t[i]=s,e[i]=!0}}merge(t,e,i,n,s){const o={...t},r={...n},h={...s};let d={...e},g={...i};const a=d.second,c=g.second;for(;;){if(this.join(d.first,g.first,0,1,h),d.first=this.getNextDEdge(h.first,0),g.first=this.getNextDEdge(h.second,1),d.first===o.first&&g.first===r.first){this.joinEdges2(a,c),this.joinEdges2(r.second,o.second);break}d.second=d.first.twin,g.second=g.first.twin;const t=this.getPointXYFromEdge(h.first),e=this.getPointXYFromEdge(h.second);if(d.first===o.first){let i=y(null,null);i.first=this.getNextDEdge(g.first,1),i.second=i.first.twin,i=this.checkEdge(i,t,e,1,!1),b(d,h),b(h,g),g=y(i.second,i.first)}else if(g.first===r.first){let i=y(null,null);i.first=this.getNextDEdge(d.first,0),i.second=i.first.twin,i=this.checkEdge(i,t,e,0,!1),g=y(h.second,h.first),b(h,d),d=y(i.second,i.first)}else{let i=y(null,null);i.first=this.getNextDEdge(d.first,0),i.second=i.first.twin,i=this.checkEdge(i,t,e,0,!1);let n=y(null,null);n.first=this.getNextDEdge(g.first,1),n.second=n.first.twin,n=this.checkEdge(n,t,e,1,!1);const s=this.getPointXYFromEdge(i.second),o=this.getPointXYFromEdge(n.second);let r=this.inCircle(t,e,s,o);0===r&&(r=this.orientation(t,e,o)),0<r?(b(d,h),b(h,g),g=y(n.second,n.first)):(g=y(h.second,h.first),b(h,d),d=y(i.second,i.first))}this.deleteTwinEdges(h,!1)}}findEdgeClockwise(t,e,i,n,s,o){for(t[0]=n;;){e[0]=t[0],++e[0]===i.length&&(e[0]=0);const n=this.orientation(s,o,this.getPointXYFromEdge(i[e[0]]));if(n<=0)return n<0;t[0]=e[0]}}findEdgeCounterClockwise(t,e,i,n,s,o){for(e[0]=n;;){t[0]=0!==e[0]?e[0]:i.length,t[0]--;const n=this.orientation(s,o,this.getPointXYFromEdge(i[t[0]]));if(0<=n)return 0<n;e[0]=t[0]}}constraintFindFirstEdge(t,e,i,n){const s=[];{const o=this.getEdgeFromPoint(i);let r=o;do{const i=this.getTwinEdge(r);if(this.getPointFromEdge(i)===n)return t[0]=i,e[0]=r,t[0].setMask(),e[0].setMask(),!1;s.push(i),r=this.getClockwiseEdge(r)}while(r!==o)}s.length<3&&r("add_constraint");let o=-1;for(let c=0,l=s.length;c<l;c++)this.isInfinitePointFromEdge(s[c])&&(-1!==o&&r("add_constraint"),o=c);const h=this.getPointXY(i),d=this.getPointXY(n);let g,a;if(-1!==o){x(s,0,o+1,s.length),s.pop();0===this.orientation(h,d,this.getPointXYFromEdge(s[0]))&&r("add_constraint - point on constraint");for(0===this.orientation(h,d,this.getPointXYFromEdge(s.at(-1)))&&r("add_constraint - point on constraint"),g=0,a=s.length-1;g+1!==a;){const t=g+a>>1,e=this.orientation(h,d,this.getPointXYFromEdge(s[t]));0===e&&r("add_constraint - point on constraint"),0<e?g=t:a=t}}else{let t=0,e=this.orientation(h,d,this.getPointXYFromEdge(s[t]));if(0!==e)if(0<e){const e=[0],i=[0];this.findEdgeClockwise(e,i,s,t,h,d)||r("add_constraint"),g=e[0],a=i[0]}else{const e=[0],i=[0];this.findEdgeCounterClockwise(e,i,s,t,h,d)||r("add_constraint"),g=e[0],a=i[0]}else{t++,e=this.orientation(h,d,this.getPointXYFromEdge(s[t])),e<=0&&r("add_constraint");const i=[0],n=[0];this.findEdgeClockwise(i,n,s,t,h,d)||r("add_constraint"),g=i[0],a=n[0]}}return t[0]=s[g],e[0]=s[a],!0}triangulateConstraint(t,e,i,n){if(e===i)return;let s=i;for(let o=e;o!==i;++o)this.inCircle(this.getPointXYFromEdge(n.first),this.getPointXYFromEdge(n.second),this.getPointXYFromEdge(t[s]),this.getPointXYFromEdge(t[o]))<0&&(s=o);if(s!==i){const e=this.newPairEdge();this.join(n.first,t[s],1,1,e),t[s]=e.second,this.triangulateConstraint(t,s+1,i,e)}if(s!==e){const i=this.newPairEdge();this.join(t[s],n.second,1,0,i),this.triangulateConstraint(t,e,s-1,i)}}insideLine(t,e,i){return 0===this.orientation(t,e,i)&&(e.x<t.x!=e.x<i.x||e.y<t.y!=e.y<i.y)}orientation(t,e,i){return g.orientationRobust(t,e,i)}inCircle(t,e,i,n){return g.inCircleRobust(t,e,i,n)}calculateCircleCenterFromThreePoints(t,e,i){return e.lt(t)&&(e=u(t,t=e)),i.lt(e)&&(i=u(e,e=i)),e.lt(t)&&(e=u(t,t=e)),g.calculateCircleCenterFromThreePoints(t,e,i)}compare(t,e){return 3*((j(t[0]<e[0])<<1)+j(t[0]>e[0]))+(j(t[1]<e[1])<<1)+j(t[1]>e[1])-1}caseFromCompare(t,e,i){return(this.compare(t,e)<<6)+(this.compare(t,i)<<3)+this.compare(e,i)}}function j(t){return t?1:0}function A(t,e,i){return t[i]!==e[i]?t[i]<e[i]:t[1-i]<e[1-i]}function v(t){return 255&t}N.c_aTableDelaunayTriangulationSolution=Uint8Array.from([41,74,0,0,0,0,0,0,0,206,0,0,0,0,0,0,0,0,0,0,65,0,0,0,0,0,33,33,65,0,0,0,0,0,0,0,193,0,0,0,0,0,0,0,0,0,0,214,0,0,0,0,0,86,54,86,0,0,0,0,0,0,0,214,173,0,0,0,0,0,0,0,107,239,0,0,0,0,0,0,0,0,0,181,0,0,0,0,0,0,0,181,0,0,0,0,0,0,117,117,245,0,0,0,0,0,0,0,0,0,103,0,0,0,0,0,0,0,167,0,0,0,0,0,0,231,103,231,0,0,0,0,0,0,50,0,0,0,0,0,0,0,0,198,0,0,41,0,0,74,0,0,49,0,0,49,0,0,50,0,0,194,0,0,193,0,0,194,0,0,0,0,0,206,0,0,0,0,0,0,0,0,54,0,0,0,0,0,0,0,0,198,0,0,0,0,0,82,50,82,0,0,0,0,0,0,0,198,0,66,0,0,65,0,0,66,49,66,33,57,65,82,50,90,0,194,0,0,193,0,0,194,0,0,0,0,0,0,0,214,0,0,0,0,0,86,54,86,0,0,0,0,0,0,0,222,0,0,0,0,0,0,178,0,0,0,0,0,0,230,102,230,177,0,0,177,0,0,178,0,177,0,0,177,0,0,178,0,113,226,113,113,249,226,122,226,0,0,0,0,0,0,102,0,0,0,0,0,0,0,190,0,0,0,0,0,0,230,102,230,0,0,0,165,0,0,0,0,0,0,0,0,243,0,0,0,0,0,173,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,0,0,245,0,0,0,0,0,107,0,0,239,0,0,163,0,0,163,0,0,167,0,0,247,0,0,243,0,0,247,0,0,37,37,69,0,0,0,0,0,0,0,211,0,0,0,0,0,0,0,69,0,0,0,0,0,37,37,69,0,0,0,0,0,0,0,221,0,0,0,0,215,0,0,211,0,0,215,35,87,35,35,91,87,63,87,0,215,0,0,211,0,0,215,0,0,0,165,0,0,0,0,0,0,115,115,243,0,0,0,0,0,0,181,0,0,0,0,0,0,0,189,0,0,0,0,0,0,117,117,245,0,0,0,99,0,0,99,0,0,103,0,163,0,0,163,0,0,167,0,99,247,115,123,243,231,103,255]);class M{constructor(t){this.m_numberOfSets=t,this.m_elements=Array.from({length:t},((t,e)=>e)),this.m_sizes=f(t,1)}getNumberOfSets(){return this.m_numberOfSets}connected(t,e){return this.findRoot(t)===this.findRoot(e)}connect(t,e){const i=this.findRoot(t),n=this.findRoot(e);return i!==n&&(this.m_sizes[i]<this.m_sizes[n]?(this.m_sizes[n]+=this.m_sizes[i],this.m_elements[i]=n):(this.m_sizes[i]+=this.m_sizes[n],this.m_elements[n]=i),--this.m_numberOfSets,!0)}connectRange(t,e,i){if(e!==i)for(let n=e;n<i;++n)this.connect(t[e],t[n])}size(){return this.m_elements.length}size1(t){return h(0),0}findRoot(t){let e=t;if(this.m_elements[e]!==e)do{this.m_elements[e]=this.m_elements[this.m_elements[e]],e=this.m_elements[e]}while(this.m_elements[e]!==e);return e}}function S(){return l(Number.NaN,l([0,0,0],[0,0,0]))}function G(t,e){if(t.first!==e.first)return t.first-e.first;let i=t.second.first,n=e.second.first;for(let s=0;s<3;++s)if(i[s]!==n[s])return i[s]-n[s];i=t.second.second,n=e.second.second;for(let s=0;s<3;++s)if(i[s]!==n[s])return i[s]-n[s];return 0}class q{getOperatorType(){return 10112}accelerateGeometry(t,e,i){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!1}executeMany(t,e,i,n){return new z(t,e,i,n)}execute(t,e,i,n=null){const s=new z(null,e,!1,i);s.addGeometry(t);return s.buildAlphaShape(n)}}class z extends t{alphaShapeConstruct(t,e){const i=t.getEdgeCount(),n=new p({vd:this.m_vertexDescription});if(!n)throw new Error("alphaShapeConstruct");for(let s=0;s<i;++s){if(2!==e[s])continue;const i=y(null,null);i.first=t.getEdge(s),i.second=t.getTwinEdge(i.first);if(1!==e[t.getEdgeIndex(i.second)])continue;t.getPointXYFromEdge(i.first),n.startPath(t.getPointXYFromEdge(i.first));let o=s,r=i.second;for(;;){for(e[o]=3,r=t.getCounterClockwiseEdge(r);1===e[t.getEdgeIndex(r)];)r=t.getCounterClockwiseEdge(r);if(r===i.first)break;n.lineTo(t.getPointXYFromEdge(r)),o=t.getEdgeIndex(r),r=t.getTwinEdge(r)}}return n}alphaShape(t,e){const i=t.getEdgeCount(),n=new Uint8Array(i);for(let s=0;s<i;++s){if(0!==n[s])continue;const i=Y(),o=t.getEdge(s);i.p[0]=t.getPointFromEdge(o);const r=t.getClockwiseEdge(t.getTwinEdge(o));i.p[1]=t.getPointFromEdge(r);const h=t.getEdgeIndex(r),a=t.getClockwiseEdge(t.getTwinEdge(r));i.p[2]=t.getPointFromEdge(a);const c=t.getEdgeIndex(a);let l=1;for(let e=0;e<3;++e)if(t.isInfinitePointFromPoint(i.p[e])){l=2;break}if(1===l){const n=d(g,3);for(let e=0;e<3;++e)n[e]=t.getPointXY(i.p[e]);const s=g.sqrDistance(n[0],n[1]),o=g.sqrDistance(n[1],n[2]),r=g.sqrDistance(n[2],n[0]),h=2*n[1].sub(n[0]).crossProduct(n[2].sub(n[0]));e<s*o*r/(h*h)&&(l=2)}n[s]=n[h]=n[c]=l}return this.alphaShapeConstruct(t,n)}alphaShapeAlphaOut(t,e){const i=t.getEdgeCount(),n=new Uint8Array(i),s=[],o=new M(t.getPointCount());for(let h=0;h<i;++h){if(0!==n[h])continue;const e=Y(),i=t.getEdge(h);e.p[0]=t.getPointFromEdge(i);const o=t.getClockwiseEdge(t.getTwinEdge(i));e.p[1]=t.getPointFromEdge(o);const r=t.getEdgeIndex(o),d=t.getClockwiseEdge(t.getTwinEdge(o));e.p[2]=t.getPointFromEdge(d);const a=t.getEdgeIndex(d);let c=1;for(let n=0;n<3;++n)if(t.isInfinitePointFromPoint(e.p[n])){c=2;break}if(1===c){const i=new Array(3);for(let s=0;s<3;++s)i[s]=t.getPointXY(e.p[s]);const n=g.sqrDistance(i[0],i[1]),o=g.sqrDistance(i[1],i[2]),d=g.sqrDistance(i[2],i[0]),l=i[1].sub(i[0]).crossProduct(i[2].sub(i[0])),u=S();u.first=n*o*d/(l*l),u.second.first[0]=h,u.second.first[1]=r,u.second.first[2]=a,u.second.second[0]=t.getPointIndex(e.p[0]),u.second.second[1]=t.getPointIndex(e.p[1]),u.second.second[2]=t.getPointIndex(e.p[2]),s.push(u),c=2}n[h]=n[r]=n[a]=c}s.sort(((t,e)=>G(t,e)));let r=0;for(const h of s){if(1===o.getNumberOfSets()&&h.first!==r)break;n[h.second.first[0]]=n[h.second.first[1]]=n[h.second.first[2]]=1;const t=[h.second.second[0],h.second.second[1],h.second.second[2]];o.connectRange(t,0,3),r=h.first}return e&&(e[0]=.25*r),this.alphaShapeConstruct(t,n)}constructor(t,e,i,n){super(),this.m_multiPointForAttributes=null,this.m_inputGeometryCursor=null,this.m_index=-1,this.m_nDelaunayPoints=0,this.m_cDelaunay=new N,this.m_vertexDescription=null,this.m_progressTracker=n,this.m_alpha=Number.isNaN(e)||!Number.isFinite(e)||e<0?-1:e<Number.MIN_VALUE?0:e,this.m_bMerge=i,this.m_bDone=!1,this.m_inputGeometryCursor=t,this.prepareDelaunay()}prepareDelaunay(){this.m_nDelaunayPoints=0,this.m_cDelaunay.clear(),0!==this.m_alpha&&this.m_cDelaunay.prepare(a())}next(){if(this.m_bMerge){if(!this.m_bDone){const t=this.calculateAlphaShapeMerging(this.m_inputGeometryCursor,this.m_progressTracker);return this.m_bDone=!0,t}return null}if(!this.m_bDone){const t=this.m_inputGeometryCursor.next();if(null!==t)return i(t),n(t),this.m_index=this.m_inputGeometryCursor.getGeometryID(),this.calculateAlphaShape(t,this.m_progressTracker);this.m_bDone=!0}return null}tock(){return!0}getRank(){return 1}getGeometryID(){return this.m_index}calculateAlphaShapeMerging(t,e){let s;for(;s=t.next();)i(s),n(s),this.addGeometry(s);return this.buildAlphaShape()}calculateAlphaShape(t,e){return t.isEmpty()?new p({vd:t.getDescription()}):(this.prepareDelaunay(),this.addGeometry(t),this.buildAlphaShape())}buildAlphaShape(t=null){if(t&&(t[0]=this.m_alpha),0===this.m_alpha)return this.m_vertexDescription?new p({vd:this.m_vertexDescription}):new p;if(this.m_cDelaunay.removeDuplicates())for(let e=0,i=this.m_cDelaunay.getPointCount();e<i;++e)this.m_cDelaunay.setPointIndex(this.m_cDelaunay.getPoint(e),e);if(!this.m_cDelaunay.construct())return this.m_vertexDescription?new p({vd:this.m_vertexDescription}):new p;return this.m_alpha<0?this.alphaShapeAlphaOut(this.m_cDelaunay,t):this.alphaShape(this.m_cDelaunay,this.m_alpha)}addGeometry(t){if(i(t),n(t),0===this.m_alpha)return;if(this.m_vertexDescription&&this.m_bMerge||(this.m_vertexDescription=t.getDescription(),this.m_vertexDescription.getAttributeCount()>1?this.m_multiPointForAttributes=new E({vd:this.m_vertexDescription}):this.m_multiPointForAttributes=null),t.isEmpty())return;const e=t.getGeometryType();if(s(e)){const e=t,i=new g;for(let t=0,n=e.getPointCount();t<n;t++)e.queryXY(t,i),this.m_cDelaunay.addVertex(i,this.m_nDelaunayPoints++);this.m_multiPointForAttributes&&this.m_multiPointForAttributes.addPoints(e,0,-1)}else if(e===o.enumPoint){const e=t,i=e.getXY();this.m_cDelaunay.addVertex(i,this.m_nDelaunayPoints++),this.m_multiPointForAttributes&&this.m_multiPointForAttributes.add(e)}else r("bad geometry type")}}const V=new q;function O(t,e,i){return V.execute(t,e,null,i)}function Z(t,i,n){const s=V.executeMany(new e(t),i,n,null);return Array.from(s)}function R(){return V.supportsCurves()}export{O as execute,Z as executeMany,R as supportsCurves};
|
|
5
|
+
import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{o as i,d as n,i as s,G as o,t as r,g as h}from"../../../chunks/Geometry.js";import{m as d,P as g,i as a,u as c,n as l,b as u,d as f,v as m}from"../../../chunks/Point2D.js";import{a as p,M as E,r as x,e as P}from"../../../chunks/QuadraticBezier.js";function _(t,e,i,n,s,o){const r=n-e;if(r<=o)return P(t,e,i,n,s),i;const h=w(t,e,n,s,Math.min(Math.max(r>>1,3),100)),d=t[h];t[e]=u(t[h],t[h]=t[e]);let g=e+1,a=!1;for(let c=e+1;c!==n;++c)s(t[c],d)&&(t[g]=u(t[c],t[c]=t[g]),++g,a=!0);if(!a)for(let c=e+1;c<i;++c)s(d,t[c])||(c!==g&&(t[g]=u(t[c],t[c]=t[g])),++g);return--g,t[g]=u(t[e],t[e]=t[g]),g}function F(t,e,i){const n=Math.trunc(e/2);let s=BigInt(n);const o=BigInt(e);for(let h=0;h<i;++h)t.push(Number(s%o)),s=6364136223846793005n*s+1442695040888963407n&0x7fffffffffffffffn,s=BigInt.asUintN(64,s);m(t);const r=c(t,((t,e)=>t===e));t.length=r}function w(t,e,i,n,s){const o=[];F(o,i-e,s);const r=[];for(let d=0,g=o.length;d<g;d++){const i=o[d];r.push(l(t[e+i],i))}const h=Math.trunc(r.length/2);return r.sort(((t,e)=>n(t.first,e.first)?-1:1)),e+r[h].second}function k(){return{p:new g,userData:Number.NaN,edge:null}}class T{constructor(){this.info=0,this.mask=!1,this.p=null,this.a=[null,null],this.twin=null}nextFreeEdge(){return this.twin}setIndex(t){this.info=t,this.mask=!1}getIndex(){return this.info}setMask(){this.mask=!0}getMask(){return this.mask}}function y(t,e){return{first:t,second:e}}function b(t,e){t.first=e.first,t.second=e.second}function C(){return this.i1-this.i0}function D(){return{i0:Number.NaN,i1:Number.NaN,nextFreeEdgeIndex:[-1],box:[y(null,null),y(null,null)],size:C}}function I(){return{k:0,pTask:null,pTask0:null,pTask1:null}}function X(){return{p:[new g,new g],points:[null,null]}}function Y(){return{p:[null,null,null]}}class N{constructor(){this.m_nextFreePairEdge=y(null,null),this.m_points=[],this.m_pointZero=null,this.m_edges=[],this.m_voronoiToEdge=[],this.m_nextFreeEdge=0}clear(){this.m_nextFreePairEdge=y(null,null),this.m_points.length=0,this.m_pointZero=null,this.m_edges.length=0,this.m_voronoiToEdge.length=0,this.m_nextFreeEdge=0}reservePoints(t){h(t>1)}prepare(t){{const e=k();e.p.x=Number.POSITIVE_INFINITY,e.p.y=Number.POSITIVE_INFINITY,e.userData=t,this.m_points.push(e)}}addVertex(t,e){const i=k();i.p.assign(t),i.userData=e,i.edge=null,this.m_points.push(i)}removeDuplicates(){const t=this.m_points.shift();this.m_points.sort(((t,e)=>t.p.compareX(e.p)));const e=c(this.m_points,((t,e)=>t.p.equals(e.p))),i=e!==this.m_points.length;return this.m_points.length=e,this.m_points.unshift(t),i}boundVoronoiCells(t,e){const i=this.m_points.length;if(i<2)return!1;const n=[this.m_points[1].p.clone(),this.m_points[1].p.clone()];for(let d=2;d<i;d++){const t=this.m_points[d].p;t.x<n[0].x&&(n[0].x=t.x),n[1].x<t.x&&(n[1].x=t.x),t.y<n[0].y&&(n[0].y=t.y),n[1].y<t.y&&(n[1].y=t.y)}const s=new g;s.x=.5*(n[0].x+n[1].x),s.y=.5*(n[0].y+n[1].y);let o=0;for(let d=1;d<i;d++){const t=this.m_points[d].p,e=g.sqrDistanceCoords(t.x,t.y,s.x,s.y);o<e&&(o=e)}const r=Math.sqrt(o),h=Math.max(r+2*t,1.5*r);{const t=.8660254037844386,i=.5;let n=1,o=0;for(let r=0;r<12;r++){const r=new g;r.x=s.x+h*n,r.y=s.y+h*o,this.addVertex(r,e);const d=n*i+o*t;n=n*t-o*i,o=d}}return!0}construct(){const t=D();return!!this.constructTask(t)&&(this.solveTask(t),!0)}constructTask(t){if(this.m_pointZero=this.createZeroHandle(),h(void 0!==this.m_pointZero),this.m_points.length<3)return!1;const e=6*(this.m_points.length-2);this.m_edges=d(T,e);for(let i=0;i<e;i++)this.m_edges[i].setIndex(i);return t.i0=1,t.i1=this.m_points.length,t.nextFreeEdgeIndex[0]=0,!0}splitTask(t,e,i,n){const s=t,o=e,r=i,h=n;s.k=this.findMaxSide(h.i0,h.i1);let d=h.i0+h.i1>>1;const g=1250;if(0===s.k){d=_(this.m_points,h.i0,d,h.i1,((t,e)=>t.p[0]!==e.p[0]?t.p[0]<e.p[0]:t.p[1]<e.p[1]),g)}else{d=_(this.m_points,h.i0,d,h.i1,((t,e)=>t.p[1]!==e.p[1]?t.p[1]<e.p[1]:t.p[0]<e.p[0]),g)}o.i0=h.i0,o.i1=d,o.nextFreeEdgeIndex[0]=h.nextFreeEdgeIndex[0],h.nextFreeEdgeIndex[0]+=6*(o.i1-o.i0-1)+2,r.i0=d,r.i1=h.i1,r.nextFreeEdgeIndex[0]=h.nextFreeEdgeIndex[0],h.nextFreeEdgeIndex[0]+=6*(r.i1-r.i0-1)+2,s.pTask=h,s.pTask0=o,s.pTask1=r}solveMergeTask(t){const e=this.newPairEdgeEx(t.pTask.nextFreeEdgeIndex,!1);if(t.pTask.box[t.k]=y(t.pTask0.box[t.k].first,t.pTask1.box[t.k].second),t.pTask.box[1-t.k]=y(A(this.getPointXYFromEdge(t.pTask0.box[1-t.k].first),this.getPointXYFromEdge(t.pTask1.box[1-t.k].first),1-t.k)?t.pTask0.box[1-t.k].first:t.pTask1.box[1-t.k].first,A(this.getPointXYFromEdge(t.pTask0.box[1-t.k].second),this.getPointXYFromEdge(t.pTask1.box[1-t.k].second),1-t.k)?t.pTask1.box[1-t.k].second:t.pTask0.box[1-t.k].second),t.pTask.i0+2===t.pTask.i1){const i=t.pTask0.box[t.k].second,n=i.twin,s=t.pTask1.box[t.k].first,o=s.twin;return this.joinEdges2(n,o),this.joinEdges2(o,n),void this.join(i,s,0,1,e)}const i=[new Array(2),new Array(2)];i[0][0]=i[1][0]=y(t.pTask0.box[t.k].second,t.pTask0.box[t.k].second.twin),i[0][1]=i[1][1]=y(t.pTask1.box[t.k].first,t.pTask1.box[t.k].first.twin);const n=[!1,!1];if(t.pTask0.i0+1===t.pTask0.i1?(this.findEdgeSide(i[0],n,1,0),this.findEdgeSide(i[1],n,1,1)):(this.findEdge(i[0],n,0),this.findEdge(i[1],n,1)),n[0]||n[1]){if(n[0]){const e=this.newPairEdgeEx(t.pTask0.nextFreeEdgeIndex,!1);this.insertEdge(i[0][0].first,e.first,0),this.insertEdge(i[0][0].second,e.second,1)}if(n[1]){const e=this.newPairEdgeEx(t.pTask1.nextFreeEdgeIndex,!1);this.insertEdge(i[0][1].first,e.first,1),this.insertEdge(i[0][1].second,e.second,0)}}else this.getNextDEdge(i[0][0].first,0)!==i[0][0].first&&(i[1][0]=this.newPairEdgeEx(t.pTask0.nextFreeEdgeIndex,!1),this.insertEdge(i[0][0].first,i[1][0].first,0),this.insertEdge(i[0][0].second,i[1][0].second,1)),this.getNextDEdge(i[0][1].first,0)!==i[0][1].first&&(i[1][1]=this.newPairEdgeEx(t.pTask1.nextFreeEdgeIndex,!1),this.insertEdge(i[0][1].first,i[1][1].first,1),this.insertEdge(i[0][1].second,i[1][1].second,0));this.merge(i[1][0],i[0][0],i[0][1],i[1][1],e)}solveTask(t){const e=t;switch(e.i1-e.i0){case 1:{this.insertPoint(e.i0,e.nextFreeEdgeIndex);const t=this.m_points[e.i0].edge;e.box[0]=e.box[1]=l(t,t)}break;case 2:{const t=e.i0,i=t+1;this.insertPoint(t,e.nextFreeEdgeIndex),this.insertPoint(i,e.nextFreeEdgeIndex);const n=this.m_points[t],s=this.m_points[i],o=n.edge,r=s.edge,h=o.twin,d=r.twin;this.joinEdges2(h,d),this.joinEdges2(d,h);const g=this.newPairEdgeEx(e.nextFreeEdgeIndex,!1);this.join(o,r,0,1,g);for(let a=0;a<2;a++)e.box[a]=A(this.getPointXY(n),this.getPointXY(s),a)?y(o,r):y(r,o)}break;case 3:{const t=[e.i0,e.i0+1,e.i0+2];this.insertPoint(t[0],e.nextFreeEdgeIndex),this.insertPoint(t[1],e.nextFreeEdgeIndex),this.insertPoint(t[2],e.nextFreeEdgeIndex);const i=[this.m_points[t[0]],this.m_points[t[1]],this.m_points[t[2]]],n=this.caseFromCompare(i[0].p,i[1].p,i[2].p),s=[i[0].edge,i[1].edge,i[2].edge],o=N.c_aTableDelaunayTriangulationSolution[n],r=v(19*v(1+(7&o))),h=v(19*v(1+(o>>5)));let d=v(o<<3)>>6;const g=3&r,a=r>>6,c=3&h,l=h>>6;e.box[0]=y(s[g],s[a]),e.box[1]=y(s[c],s[l]);const f=[s[0].twin,s[1].twin,s[2].twin],m=[this.newPairEdgeEx(e.nextFreeEdgeIndex,!1),this.newPairEdgeEx(e.nextFreeEdgeIndex,!1),this.newPairEdgeEx(e.nextFreeEdgeIndex,!1)];switch(3===d&&(d=this.orientation(i[0].p,i[1].p,i[2].p)+1),d){case 0:this.joinEdges2(f[0],f[2]),this.joinEdges2(f[2],f[1]),this.joinEdges2(f[1],f[0]),this.join(s[0],s[2],0,1,m[0]),this.join(s[2],s[1],0,1,m[1]),this.join(s[1],s[0],0,1,m[2]);break;case 1:{const t=[0,1,2];t[3-(g+a)]=u(t[1],t[1]=t[3-(g+a)]),this.joinEdges2(f[t[0]],f[t[1]]),this.joinEdges2(f[t[1]],f[t[2]]),this.joinEdges2(f[t[2]],f[t[0]]),this.join(s[t[0]],s[t[1]],0,1,m[0]),this.join(s[t[1]],s[t[2]],0,1,m[1]),this.join(m[1].first,f[t[2]],0,1,m[2])}break;case 2:this.joinEdges2(f[0],f[1]),this.joinEdges2(f[1],f[2]),this.joinEdges2(f[2],f[0]),this.join(s[0],s[1],0,1,m[0]),this.join(s[1],s[2],0,1,m[1]),this.join(s[2],s[0],0,1,m[2])}}break;default:{const e=I(),i=D(),n=D();this.splitTask(e,i,n,t),this.solveTask(i),this.solveTask(n),this.solveMergeTask(e)}}}getOutsideHull(){const t=[],e=this.m_points[0].edge;let i=e;do{t.push(this.getPointFromEdge(this.getTwinEdge(i))),i=this.getNextDEdge(i,0)}while(i!==e);return t}getConvexHull(){const t=[],e=this.m_points[0].edge;let i=e;do{const e=this.getPointFromEdge(this.getTwinEdge(i));t.length<2||!this.insideLine(this.getPointXY(t.at(-2)),this.getPointXY(t.at(-1)),this.getPointXY(e))?t.push(e):t[t.length-1]=e,i=this.getNextDEdge(i,0)}while(i!==e);return 2<t.length&&this.insideLine(this.getPointXY(t[0]),this.getPointXY(t.at(-1)),this.getPointXY(t.at(-2)))&&t.pop(),2<t.length&&this.insideLine(this.getPointXY(t[1]),this.getPointXY(t[0]),this.getPointXY(t.at(-1)))&&(t[0]=t.at(-1),t.pop()),t}getVoronoiPolygon(t,e){t.length=0;const i=this.getEdgeFromPoint(e);let n=i;for(;;){const e=this.calculateCircleCenter(n);t.push(e);const s=this.getNextDEdge(n,1);if(s===i)break;n=s}}getNearestPoint(t){this.isInfinitePointFromPoint(t)&&r("Not supported for the infinite point");const e=this.getPointXY(t);let i=this.m_pointZero,n=Number.MAX_VALUE;const s=this.getEdgeFromPoint(t);let o=s;do{const t=this.getPointFromEdge(this.getTwinEdge(o));if(!this.isInfinitePointFromPoint(t)){const s=g.sqrDistance(e,this.getPointXY(t));s<n&&(i=t,n=s)}o=this.getCounterClockwiseEdge(o)}while(o!==s);return i}addConstraint(t,e){const i=[null],n=[null];if(!this.constraintFindFirstEdge(i,n,t,e))return y(n[0],i[0]);i[0]=this.getTwinEdge(i[0]);const s=this.getPointXY(t),o=this.getPointXY(e),h=[new Array(0),new Array(0)],d=i[0];for(;;){const t=this.getClockwiseEdge(n[0]);t.getMask()&&r("add_constraint");const d=y(t,this.getTwinEdge(t));this.deleteTwinEdges(d,!0);const g=this.getCounterClockwiseEdge(this.getTwinEdge(i[0])),a=this.getTwinEdge(this.getClockwiseEdge(n[0])),c=this.getPointFromEdge(a);if(c===e){h[0].push(i[0]),i[0]=g,h[1].push(n[0]),n[0]=a;break}const l=this.orientation(s,o,this.getPointXY(c));0===l&&r("add_constraint - point on constraint"),0<l?(h[0].push(i[0]),i[0]=g):(h[1].push(n[0]),n[0]=a)}h[0].push(i[0]),h[1].push(n[0]);const g=this.newPairEdge();g.first.setMask(),g.second.setMask(),this.join(n[0],d,1,1,g),this.triangulateConstraint(h[0],1,h[0].length-1,g),h[1].reverse();const a=y(g.second,g.first);return this.triangulateConstraint(h[1],1,h[1].length-1,a),a}verify(){for(let t=0,e=this.m_edges.length;t<e;t++){const e=this.m_edges[t];if(!e.getMask()&&!this.testEdge(e))return!1}return!0}getDelaunayTriangleCount(){return this.m_points.length-2<<1}getVoronoiSegments(t=Number.MAX_VALUE){const e=[];for(let i=0,n=this.m_edges.length;i<n;i+=2){const n=y(null,null);if(n.first=this.m_edges[i],n.second=n.first.twin,this.isInfinitePointFromEdge(n.first)&&(n.second=u(n.first,n.first=n.second)),this.isInfinitePointFromEdge(n.second)){const i=d(g,3);i[0]=this.calculateCircleCenter(this.getNextDEdge(n.first,0).twin,1),i[2]=this.calculateCircleCenter(this.getNextDEdge(n.first,1),1);const s=d(g,2);s[0].assign(i[0]),s[1].assign(i[2]),s[0].rightPerpendicularThis(),s[1].leftPerpendicularThis(),i[1]=i[0].add(s[0]).add(i[2].add(s[1])),i[1].normalize();for(const e of i)e.mulThis(t);const o=X();o.points[0]=n.first.p,o.points[1]=n.second.p;for(let t=0;t<i.length-1;t++){for(let e=0;e<2;e++)o.p[e]=i[t+e];o.p[0].equals(o.p[1])||e.push(o)}}else if(this.isInfinitePointFromEdge(this.getNextDEdge(n.first,0).twin)&&this.isInfinitePointFromEdge(this.getNextDEdge(n.first,1).twin)){const t=d(g,3);t[0]=this.calculateCircleCenter(n.first),t[1]=this.getPointXY(this.getPointFromEdge(n.first)).add(this.getPointXY(this.getPointFromEdge(n.second))).mul(.5),t[2]=this.calculateCircleCenter(n.second);const i=X();i.points[0]=n.first.p,i.points[1]=n.second.p;for(let n=0;n<t.length-1;n++){for(let e=0;e<2;e++)i.p[e]=t[n+e];i.p[0].equals(i.p[1])||e.push(i)}}else{const t=X();t.p[0]=this.calculateCircleCenter(n.first),t.p[1]=this.calculateCircleCenter(n.second),t.points[0]=n.first.p,t.points[1]=n.second.p,t.p[0].equals(t.p[1])||e.push(t)}}return e}startDelaunayTriangles(){return-1}nextDelaunayTriangle(t,e){for(;;){if(++e[0],e[0]===this.m_edges.length)return!1;const i=this.m_edges[e[0]];if(t.p[0]=this.getPointFromEdge(i),this.isInfinitePointFromPoint(t.p[0]))continue;const n=this.getTwinEdge(i);if(t.p[1]=this.getPointFromEdge(n),this.isInfinitePointFromPoint(t.p[1]))continue;if(this.getPointXY(t.p[1]).lt(this.getPointXY(t.p[0])))continue;const s=this.getTwinEdge(this.getNextDEdge(i,1));if(t.p[2]=this.getPointFromEdge(s),!this.isInfinitePointFromPoint(t.p[2])&&!this.getPointXY(t.p[2]).lt(this.getPointXY(t.p[0])))return!0}}getPointCount(){return this.m_points.length-1}getPoint(t){return this.m_points[t+1]}getInfinitePoint(){return this.m_pointZero}isInfinitePointFromPoint(t){return t===this.m_pointZero}getPointXY(t){return t.p}getPointIndex(t){return t.userData}setPointIndex(t,e){t.userData=e}getEdgeFromPoint(t){return t.edge}isInfinitePointFromEdge(t){return t.p===this.m_pointZero}getEdgeCount(){return this.m_edges.length}getEdge(t){return this.m_edges[t]}getEdgeIndex(t){return t.getIndex()}getPointFromEdge(t){return t.p}getPointXYFromEdge(t){return t.p.p}getCounterClockwiseEdge(t){return t.a[0]}getClockwiseEdge(t){return t.a[1]}getTwinEdge(t){return t.twin}getPreviousEdge(t){return this.getTwinEdge(this.getCounterClockwiseEdge(t))}getNextEdge(t){return this.getClockwiseEdge(this.getTwinEdge(t))}getNextDEdge(t,e=1){return t.a[e]}newPairEdge(){const t=y(this.m_nextFreePairEdge.first,this.m_nextFreePairEdge.second);return this.m_nextFreePairEdge.first=this.m_nextFreePairEdge.first.nextFreeEdge(),this.m_nextFreePairEdge.second=this.m_nextFreePairEdge.second.nextFreeEdge(),t.first.twin=t.second,t.second.twin=t.first,t}newPairEdgeEx(t,e){let i;if(e&&null!==this.m_nextFreePairEdge.first)i=y(this.m_nextFreePairEdge.first,this.m_nextFreePairEdge.second),this.m_nextFreePairEdge.first=this.m_nextFreePairEdge.first.nextFreeEdge(),this.m_nextFreePairEdge.second=this.m_nextFreePairEdge.second.nextFreeEdge();else{const e=t[0]++,n=t[0]++;i=y(this.m_edges[e],this.m_edges[n])}return i.first.twin=i.second,i.second.twin=i.first,i}insertEdge(t,e,i){e.p=t.p;const n=t.a[i],s=e.a;s[i]=n,s[1-i]=t,t.a[i]=e,n.a[1-i]=e}insertPoint(t,e){const i=this.m_points[t],n=this.newPairEdgeEx(e,!1),s=n.first,o=n.second;i.edge=n.first,s.p=this.m_points[t],s.a[0]=n.first,s.a[1]=n.first,o.p=this.m_pointZero,o.a[0]=n.second,o.a[1]=n.second,null===this.m_points[0].edge&&(this.m_points[0].edge=n.second)}deleteTwinEdges(t,e){this.deleteEdge(t.first),this.deleteEdge(t.second),e&&(t.first.twin=this.m_nextFreePairEdge.first,t.second.twin=this.m_nextFreePairEdge.second,this.m_nextFreePairEdge=t)}join(t,e,i,n,s){this.insertEdge(t,s.first,i),this.insertEdge(e,s.second,n)}joinEdges2(t,e){t.a[1]=e,e.a[0]=t}checkEdge(t,e,i,n,s){for(;;){const o=y(null,null);if(o.first=this.getNextDEdge(t.first,n),o.second=o.first.twin,this.isInfinitePointFromEdge(o.second))return t;const r=this.getPointXYFromEdge(t.second),h=this.getPointXYFromEdge(o.second);if(this.inCircle(e,i,r,h)<=0)return t;if(this.deleteTwinEdges(t,s),!s){const e=this.getNextDEdge(t.second,n).twin;this.join(o.second,e,n,n,t)}t=o}}calculateCircleCenter(t,e=Number.MAX_VALUE){const i=this.getPointXYFromEdge(t),n=this.getPointXYFromEdge(t.twin),s=this.getNextDEdge(t,0);if(this.isInfinitePointFromEdge(s.twin)){const t=new g;if(Number.isNaN(e))t.setNAN();else{const s=n.sub(i);s.leftPerpendicularThis(),t.assign(s),t.divThis(Math.max(Math.abs(t.x),Math.abs(t.y))),t.normalize(),t.mulThis(e)}return t}const o=this.getPointXYFromEdge(s.twin);return this.calculateCircleCenterFromThreePoints(i,n,o)}createZeroHandle(){return this.m_points[0]}deleteEdge(t){const e=t,i=e.p;i.edge===t&&(i.edge=e.a[0]),e.a[0].a[1]=e.a[1],e.a[1].a[0]=e.a[0]}testEdge(t){if(this.isInfinitePointFromEdge(t))return!0;const e=t.twin;if(this.isInfinitePointFromEdge(e))return!0;const i=this.getNextDEdge(t,0).twin,n=this.getNextDEdge(e,0).twin;if(this.isInfinitePointFromEdge(i)||this.isInfinitePointFromEdge(n))return!0;const s=this.getPointXYFromEdge(t),o=this.getPointXYFromEdge(e),r=this.getPointXYFromEdge(i),h=this.getPointXYFromEdge(n);return!(this.orientation(s,o,r)<=0)&&(!(0<=this.orientation(s,o,h))&&this.inCircle(s,o,r,h)<=0)}findMaxSide(t,e){const i=[this.m_points[t].p.clone(),this.m_points[t].p.clone()];for(t++;t!==e;t++){const e=this.m_points[t].p;e.x<i[0].x&&(i[0].x=e.x),i[1].x<e.x&&(i[1].x=e.x),e.y<i[0].y&&(i[0].y=e.y),i[1].y<e.y&&(i[1].y=e.y)}return i[1].x-i[0].x<i[1].y-i[0].y?1:0}findEdge(t,e,i){let n=!1,s=0;for(;;){const o=y(null,null);if(o.second=this.getNextDEdge(t[s].second,i^s),o.first=o.second.twin,0===i&&this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(o.first))<0||1===i&&0<this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(o.first)))t[s]=o,e[s]=!0,n=!1;else{if(n)return;s^=1,n=!0}}}findEdgeSide(t,e,i,n){for(;;){const s=y(null,null);if(s.second=this.getNextDEdge(t[i].second,n^i),s.first=s.second.twin,!(0===n&&this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(s.first))<0||1===n&&0<this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(s.first))))return;t[i]=s,e[i]=!0}}merge(t,e,i,n,s){const o={...t},r={...n},h={...s};let d={...e},g={...i};const a=d.second,c=g.second;for(;;){if(this.join(d.first,g.first,0,1,h),d.first=this.getNextDEdge(h.first,0),g.first=this.getNextDEdge(h.second,1),d.first===o.first&&g.first===r.first){this.joinEdges2(a,c),this.joinEdges2(r.second,o.second);break}d.second=d.first.twin,g.second=g.first.twin;const t=this.getPointXYFromEdge(h.first),e=this.getPointXYFromEdge(h.second);if(d.first===o.first){let i=y(null,null);i.first=this.getNextDEdge(g.first,1),i.second=i.first.twin,i=this.checkEdge(i,t,e,1,!1),b(d,h),b(h,g),g=y(i.second,i.first)}else if(g.first===r.first){let i=y(null,null);i.first=this.getNextDEdge(d.first,0),i.second=i.first.twin,i=this.checkEdge(i,t,e,0,!1),g=y(h.second,h.first),b(h,d),d=y(i.second,i.first)}else{let i=y(null,null);i.first=this.getNextDEdge(d.first,0),i.second=i.first.twin,i=this.checkEdge(i,t,e,0,!1);let n=y(null,null);n.first=this.getNextDEdge(g.first,1),n.second=n.first.twin,n=this.checkEdge(n,t,e,1,!1);const s=this.getPointXYFromEdge(i.second),o=this.getPointXYFromEdge(n.second);let r=this.inCircle(t,e,s,o);0===r&&(r=this.orientation(t,e,o)),0<r?(b(d,h),b(h,g),g=y(n.second,n.first)):(g=y(h.second,h.first),b(h,d),d=y(i.second,i.first))}this.deleteTwinEdges(h,!1)}}findEdgeClockwise(t,e,i,n,s,o){for(t[0]=n;;){e[0]=t[0],++e[0]===i.length&&(e[0]=0);const n=this.orientation(s,o,this.getPointXYFromEdge(i[e[0]]));if(n<=0)return n<0;t[0]=e[0]}}findEdgeCounterClockwise(t,e,i,n,s,o){for(e[0]=n;;){t[0]=0!==e[0]?e[0]:i.length,t[0]--;const n=this.orientation(s,o,this.getPointXYFromEdge(i[t[0]]));if(0<=n)return 0<n;e[0]=t[0]}}constraintFindFirstEdge(t,e,i,n){const s=[];{const o=this.getEdgeFromPoint(i);let r=o;do{const i=this.getTwinEdge(r);if(this.getPointFromEdge(i)===n)return t[0]=i,e[0]=r,t[0].setMask(),e[0].setMask(),!1;s.push(i),r=this.getClockwiseEdge(r)}while(r!==o)}s.length<3&&r("add_constraint");let o=-1;for(let c=0,l=s.length;c<l;c++)this.isInfinitePointFromEdge(s[c])&&(-1!==o&&r("add_constraint"),o=c);const h=this.getPointXY(i),d=this.getPointXY(n);let g,a;if(-1!==o){x(s,0,o+1,s.length),s.pop();0===this.orientation(h,d,this.getPointXYFromEdge(s[0]))&&r("add_constraint - point on constraint");for(0===this.orientation(h,d,this.getPointXYFromEdge(s.at(-1)))&&r("add_constraint - point on constraint"),g=0,a=s.length-1;g+1!==a;){const t=g+a>>1,e=this.orientation(h,d,this.getPointXYFromEdge(s[t]));0===e&&r("add_constraint - point on constraint"),0<e?g=t:a=t}}else{let t=0,e=this.orientation(h,d,this.getPointXYFromEdge(s[t]));if(0!==e)if(0<e){const e=[0],i=[0];this.findEdgeClockwise(e,i,s,t,h,d)||r("add_constraint"),g=e[0],a=i[0]}else{const e=[0],i=[0];this.findEdgeCounterClockwise(e,i,s,t,h,d)||r("add_constraint"),g=e[0],a=i[0]}else{t++,e=this.orientation(h,d,this.getPointXYFromEdge(s[t])),e<=0&&r("add_constraint");const i=[0],n=[0];this.findEdgeClockwise(i,n,s,t,h,d)||r("add_constraint"),g=i[0],a=n[0]}}return t[0]=s[g],e[0]=s[a],!0}triangulateConstraint(t,e,i,n){if(e===i)return;let s=i;for(let o=e;o!==i;++o)this.inCircle(this.getPointXYFromEdge(n.first),this.getPointXYFromEdge(n.second),this.getPointXYFromEdge(t[s]),this.getPointXYFromEdge(t[o]))<0&&(s=o);if(s!==i){const e=this.newPairEdge();this.join(n.first,t[s],1,1,e),t[s]=e.second,this.triangulateConstraint(t,s+1,i,e)}if(s!==e){const i=this.newPairEdge();this.join(t[s],n.second,1,0,i),this.triangulateConstraint(t,e,s-1,i)}}insideLine(t,e,i){return 0===this.orientation(t,e,i)&&(e.x<t.x!=e.x<i.x||e.y<t.y!=e.y<i.y)}orientation(t,e,i){return g.orientationRobust(t,e,i)}inCircle(t,e,i,n){return g.inCircleRobust(t,e,i,n)}calculateCircleCenterFromThreePoints(t,e,i){return e.lt(t)&&(e=u(t,t=e)),i.lt(e)&&(i=u(e,e=i)),e.lt(t)&&(e=u(t,t=e)),g.calculateCircleCenterFromThreePoints(t,e,i)}compare(t,e){return 3*((j(t[0]<e[0])<<1)+j(t[0]>e[0]))+(j(t[1]<e[1])<<1)+j(t[1]>e[1])-1}caseFromCompare(t,e,i){return(this.compare(t,e)<<6)+(this.compare(t,i)<<3)+this.compare(e,i)}}function j(t){return t?1:0}function A(t,e,i){return t[i]!==e[i]?t[i]<e[i]:t[1-i]<e[1-i]}function v(t){return 255&t}N.c_aTableDelaunayTriangulationSolution=Uint8Array.from([41,74,0,0,0,0,0,0,0,206,0,0,0,0,0,0,0,0,0,0,65,0,0,0,0,0,33,33,65,0,0,0,0,0,0,0,193,0,0,0,0,0,0,0,0,0,0,214,0,0,0,0,0,86,54,86,0,0,0,0,0,0,0,214,173,0,0,0,0,0,0,0,107,239,0,0,0,0,0,0,0,0,0,181,0,0,0,0,0,0,0,181,0,0,0,0,0,0,117,117,245,0,0,0,0,0,0,0,0,0,103,0,0,0,0,0,0,0,167,0,0,0,0,0,0,231,103,231,0,0,0,0,0,0,50,0,0,0,0,0,0,0,0,198,0,0,41,0,0,74,0,0,49,0,0,49,0,0,50,0,0,194,0,0,193,0,0,194,0,0,0,0,0,206,0,0,0,0,0,0,0,0,54,0,0,0,0,0,0,0,0,198,0,0,0,0,0,82,50,82,0,0,0,0,0,0,0,198,0,66,0,0,65,0,0,66,49,66,33,57,65,82,50,90,0,194,0,0,193,0,0,194,0,0,0,0,0,0,0,214,0,0,0,0,0,86,54,86,0,0,0,0,0,0,0,222,0,0,0,0,0,0,178,0,0,0,0,0,0,230,102,230,177,0,0,177,0,0,178,0,177,0,0,177,0,0,178,0,113,226,113,113,249,226,122,226,0,0,0,0,0,0,102,0,0,0,0,0,0,0,190,0,0,0,0,0,0,230,102,230,0,0,0,165,0,0,0,0,0,0,0,0,243,0,0,0,0,0,173,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,0,0,245,0,0,0,0,0,107,0,0,239,0,0,163,0,0,163,0,0,167,0,0,247,0,0,243,0,0,247,0,0,37,37,69,0,0,0,0,0,0,0,211,0,0,0,0,0,0,0,69,0,0,0,0,0,37,37,69,0,0,0,0,0,0,0,221,0,0,0,0,215,0,0,211,0,0,215,35,87,35,35,91,87,63,87,0,215,0,0,211,0,0,215,0,0,0,165,0,0,0,0,0,0,115,115,243,0,0,0,0,0,0,181,0,0,0,0,0,0,0,189,0,0,0,0,0,0,117,117,245,0,0,0,99,0,0,99,0,0,103,0,163,0,0,163,0,0,167,0,99,247,115,123,243,231,103,255]);class M{constructor(t){this.m_numberOfSets=t,this.m_elements=Array.from({length:t},((t,e)=>e)),this.m_sizes=f(t,1)}getNumberOfSets(){return this.m_numberOfSets}connected(t,e){return this.findRoot(t)===this.findRoot(e)}connect(t,e){const i=this.findRoot(t),n=this.findRoot(e);return i!==n&&(this.m_sizes[i]<this.m_sizes[n]?(this.m_sizes[n]+=this.m_sizes[i],this.m_elements[i]=n):(this.m_sizes[i]+=this.m_sizes[n],this.m_elements[n]=i),--this.m_numberOfSets,!0)}connectRange(t,e,i){if(e!==i)for(let n=e;n<i;++n)this.connect(t[e],t[n])}size(){return this.m_elements.length}size1(t){return h(0),0}findRoot(t){let e=t;if(this.m_elements[e]!==e)do{this.m_elements[e]=this.m_elements[this.m_elements[e]],e=this.m_elements[e]}while(this.m_elements[e]!==e);return e}}function S(){return l(Number.NaN,l([0,0,0],[0,0,0]))}function G(t,e){if(t.first!==e.first)return t.first-e.first;let i=t.second.first,n=e.second.first;for(let s=0;s<3;++s)if(i[s]!==n[s])return i[s]-n[s];i=t.second.second,n=e.second.second;for(let s=0;s<3;++s)if(i[s]!==n[s])return i[s]-n[s];return 0}class q{getOperatorType(){return 10112}accelerateGeometry(t,e,i){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!1}executeMany(t,e,i,n){return new z(t,e,i,n)}execute(t,e,i,n=null){const s=new z(null,e,!1,i);s.addGeometry(t);return s.buildAlphaShape(n)}}class z extends t{alphaShapeConstruct(t,e){const i=t.getEdgeCount(),n=new p({vd:this.m_vertexDescription});if(!n)throw new Error("alphaShapeConstruct");for(let s=0;s<i;++s){if(2!==e[s])continue;const i=y(null,null);i.first=t.getEdge(s),i.second=t.getTwinEdge(i.first);if(1!==e[t.getEdgeIndex(i.second)])continue;t.getPointXYFromEdge(i.first),n.startPath(t.getPointXYFromEdge(i.first));let o=s,r=i.second;for(;;){for(e[o]=3,r=t.getCounterClockwiseEdge(r);1===e[t.getEdgeIndex(r)];)r=t.getCounterClockwiseEdge(r);if(r===i.first)break;n.lineTo(t.getPointXYFromEdge(r)),o=t.getEdgeIndex(r),r=t.getTwinEdge(r)}}return n}alphaShape(t,e){const i=t.getEdgeCount(),n=new Uint8Array(i);for(let s=0;s<i;++s){if(0!==n[s])continue;const i=Y(),o=t.getEdge(s);i.p[0]=t.getPointFromEdge(o);const r=t.getClockwiseEdge(t.getTwinEdge(o));i.p[1]=t.getPointFromEdge(r);const h=t.getEdgeIndex(r),a=t.getClockwiseEdge(t.getTwinEdge(r));i.p[2]=t.getPointFromEdge(a);const c=t.getEdgeIndex(a);let l=1;for(let e=0;e<3;++e)if(t.isInfinitePointFromPoint(i.p[e])){l=2;break}if(1===l){const n=d(g,3);for(let e=0;e<3;++e)n[e]=t.getPointXY(i.p[e]);const s=g.sqrDistance(n[0],n[1]),o=g.sqrDistance(n[1],n[2]),r=g.sqrDistance(n[2],n[0]),h=2*n[1].sub(n[0]).crossProduct(n[2].sub(n[0]));e<s*o*r/(h*h)&&(l=2)}n[s]=n[h]=n[c]=l}return this.alphaShapeConstruct(t,n)}alphaShapeAlphaOut(t,e){const i=t.getEdgeCount(),n=new Uint8Array(i),s=[],o=new M(t.getPointCount());for(let h=0;h<i;++h){if(0!==n[h])continue;const e=Y(),i=t.getEdge(h);e.p[0]=t.getPointFromEdge(i);const o=t.getClockwiseEdge(t.getTwinEdge(i));e.p[1]=t.getPointFromEdge(o);const r=t.getEdgeIndex(o),d=t.getClockwiseEdge(t.getTwinEdge(o));e.p[2]=t.getPointFromEdge(d);const a=t.getEdgeIndex(d);let c=1;for(let n=0;n<3;++n)if(t.isInfinitePointFromPoint(e.p[n])){c=2;break}if(1===c){const i=new Array(3);for(let s=0;s<3;++s)i[s]=t.getPointXY(e.p[s]);const n=g.sqrDistance(i[0],i[1]),o=g.sqrDistance(i[1],i[2]),d=g.sqrDistance(i[2],i[0]),l=i[1].sub(i[0]).crossProduct(i[2].sub(i[0])),u=S();u.first=n*o*d/(l*l),u.second.first[0]=h,u.second.first[1]=r,u.second.first[2]=a,u.second.second[0]=t.getPointIndex(e.p[0]),u.second.second[1]=t.getPointIndex(e.p[1]),u.second.second[2]=t.getPointIndex(e.p[2]),s.push(u),c=2}n[h]=n[r]=n[a]=c}s.sort(((t,e)=>G(t,e)));let r=0;for(const h of s){if(1===o.getNumberOfSets()&&h.first!==r)break;n[h.second.first[0]]=n[h.second.first[1]]=n[h.second.first[2]]=1;const t=[h.second.second[0],h.second.second[1],h.second.second[2]];o.connectRange(t,0,3),r=h.first}return e&&(e[0]=.25*r),this.alphaShapeConstruct(t,n)}constructor(t,e,i,n){super(),this.m_multiPointForAttributes=null,this.m_inputGeometryCursor=null,this.m_index=-1,this.m_nDelaunayPoints=0,this.m_cDelaunay=new N,this.m_vertexDescription=null,this.m_progressTracker=n,this.m_alpha=Number.isNaN(e)||!Number.isFinite(e)||e<0?-1:e<Number.MIN_VALUE?0:e,this.m_bMerge=i,this.m_bDone=!1,this.m_inputGeometryCursor=t,this.prepareDelaunay()}prepareDelaunay(){this.m_nDelaunayPoints=0,this.m_cDelaunay.clear(),0!==this.m_alpha&&this.m_cDelaunay.prepare(a())}next(){if(this.m_bMerge){if(!this.m_bDone){const t=this.calculateAlphaShapeMerging(this.m_inputGeometryCursor,this.m_progressTracker);return this.m_bDone=!0,t}return null}if(!this.m_bDone){const t=this.m_inputGeometryCursor.next();if(null!==t)return i(t),n(t),this.m_index=this.m_inputGeometryCursor.getGeometryID(),this.calculateAlphaShape(t,this.m_progressTracker);this.m_bDone=!0}return null}tock(){return!0}getRank(){return 1}getGeometryID(){return this.m_index}calculateAlphaShapeMerging(t,e){let s;for(;s=t.next();)i(s),n(s),this.addGeometry(s);return this.buildAlphaShape()}calculateAlphaShape(t,e){return t.isEmpty()?new p({vd:t.getDescription()}):(this.prepareDelaunay(),this.addGeometry(t),this.buildAlphaShape())}buildAlphaShape(t=null){if(t&&(t[0]=this.m_alpha),0===this.m_alpha)return this.m_vertexDescription?new p({vd:this.m_vertexDescription}):new p;if(this.m_cDelaunay.removeDuplicates())for(let e=0,i=this.m_cDelaunay.getPointCount();e<i;++e)this.m_cDelaunay.setPointIndex(this.m_cDelaunay.getPoint(e),e);if(!this.m_cDelaunay.construct())return this.m_vertexDescription?new p({vd:this.m_vertexDescription}):new p;return this.m_alpha<0?this.alphaShapeAlphaOut(this.m_cDelaunay,t):this.alphaShape(this.m_cDelaunay,this.m_alpha)}addGeometry(t){if(i(t),n(t),0===this.m_alpha)return;if(this.m_vertexDescription&&this.m_bMerge||(this.m_vertexDescription=t.getDescription(),this.m_vertexDescription.getAttributeCount()>1?this.m_multiPointForAttributes=new E({vd:this.m_vertexDescription}):this.m_multiPointForAttributes=null),t.isEmpty())return;const e=t.getGeometryType();if(s(e)){const e=t,i=new g;for(let t=0,n=e.getPointCount();t<n;t++)e.queryXY(t,i),this.m_cDelaunay.addVertex(i,this.m_nDelaunayPoints++);this.m_multiPointForAttributes&&this.m_multiPointForAttributes.addPoints(e,0,-1)}else if(e===o.enumPoint){const e=t,i=e.getXY();this.m_cDelaunay.addVertex(i,this.m_nDelaunayPoints++),this.m_multiPointForAttributes&&this.m_multiPointForAttributes.add(e)}else r("bad geometry type")}}const V=new q;function O(t,e,i){return V.execute(t,e,null,i)}function Z(t,i,n){const s=V.executeMany(new e(t),i,n,null);return Array.from(s)}function R(){return V.supportsCurves()}export{O as execute,Z as executeMany,R 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{E as r,n as s}from"../../../chunks/QuadraticBezier.js";import{G as o,
|
|
5
|
+
import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{E as r,n as s}from"../../../chunks/QuadraticBezier.js";import{G as o,k as n}from"../../../chunks/Geometry.js";import{Envelope2D as m}from"../../../chunks/Envelope2D.js";import{a as i}from"../../../chunks/Envelope.js";import{h as u,al as l}from"../../../chunks/ProjectionTransformation.js";class p{getOperatorType(){return 10008}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,r,s){const o=(new u).executeMany(e,r,s);return new c(o,t,r,s)}}class c extends e{constructor(e,t,r,s){super(),this.m_resultPolygons=null,this.m_polygons=e,this.m_polylines=t,this.m_sr=r,this.m_progressTracker=s,this.m_bFirst=!0}tock(){return!0}getRank(){return 1}next(){return this.m_bFirst&&(this.performOperation(),this.m_bFirst=!1),this.m_resultPolygons?this.m_resultPolygons.next():null}getGeometryID(){return null!=this.m_resultPolygons?this.m_resultPolygons.getGeometryID():-1}performOperation(){const e=new m,t=new r;let u,p=s;for(;u=this.m_polylines.next();){if(u.getGeometryType()!==o.enumPolyline||u.isEmpty())continue;p===s?p=t.addGeometry(u):t.appendGeometry(p,u);const r=new m;u.queryEnvelope(r),e.mergeEnvelope2D(r)}if(0===t.getTotalPointCount())return;for(;u=this.m_polygons.next();){if(!n(u.getGeometryType())||u.isEmpty())continue;const r=new m;u.queryEnvelope(r),e.mergeEnvelope2D(r),t.addGeometry(u)}const c=i(this.m_sr,e,!0);this.m_resultPolygons=l(t,p,c,this.m_progressTracker)}}const a=new p;function y(e,r,s){const o=a.execute(new t(e),new t(r),s,null);return Array.from(o)}function h(){return a.supportsCurves()}export{y as execute,h 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{d as n,t as r,G as o,g as s}from"../../../chunks/Geometry.js";import{P as a,a as i}from"../../../chunks/Envelope.js";import{a as l,L as u}from"../../../chunks/QuadraticBezier.js";import{Envelope2D as c}from"../../../chunks/Envelope2D.js";import{P as m,q as N,r as g,m as h}from"../../../chunks/Point2D.js";import{
|
|
5
|
+
import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{d as n,t as r,G as o,g as s}from"../../../chunks/Geometry.js";import{P as a,a as i}from"../../../chunks/Envelope.js";import{a as l,L as u}from"../../../chunks/QuadraticBezier.js";import{Envelope2D as c}from"../../../chunks/Envelope2D.js";import{P as m,q as N,r as g,m as h}from"../../../chunks/Point2D.js";import{aj as y,i as P}from"../../../chunks/ProjectionTransformation.js";import{a as p}from"../../../chunks/Centroid-DZi-eb9F.js";import{O as f}from"../../../chunks/OperatorProximity.js";class d{getOperatorType(){return 10203}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}executeMany(e,t){return new x(e,t)}execute(e,t){return new x(null,t).labelPoint(e)}}class x extends e{progress_(){}tock(){return!0}getRank(){return 1}constructor(e,t){super(),this.m_index=-1,this.m_progressCounter=0,this.m_progressTracker=t,this.m_inputGeoms=e}next(){const e=this.m_inputGeoms.next();return e?(n(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.labelPoint(e)):null}getGeometryID(){return this.m_index}labelPoint(e){if(null===e&&r("null pointer is not allowed"),e.getGeometryType()===o.enumPoint)return e;if(e.isEmpty())return new a({vd:e.getDescription()});switch(e.getGeometryType()){case o.enumPolygon:return this.labelPointPolygon(e);case o.enumPolyline:return this.labelPointPolyline(e);case o.enumMultiPoint:return this.labelPointMultiPoint(e);case o.enumEnvelope:return this.labelPointEnvelope(e);default:r("geometry is not supported")}}labelPointPolygon(e){const t=new c;e.queryEnvelope(t);const n=i(null,t,!0).total();let r=null,o=e;if(e.hasNonLinearSegments()){const t=new l({copy:e}),a=y(t,.25*n,n);s(a!==e),r=a,o=r}let u=0,h=0;for(let s=0,a=o.getPathCount();s<a;++s){const e=Math.abs(o.calculateRingArea2D(s));e>h&&(h=e,u=s)}const d=new m;if(Math.abs(h)<=2*n*n?d.setNAN():d.assign(p(o,u)),Number.isNaN(d.x)){const e=new c;return o.queryPathEnvelope(u,e),new a({pt:e.getCenter()})}if(o.getPointCount()<4)return new a({x:d.x,y:d.y});const x=m.getNAN(),w=[x.clone(),x.clone(),x.clone(),x.clone()],b=[Number.NaN,Number.NaN,Number.NaN,Number.NaN],C=[Number.NaN,Number.NaN,Number.NaN,Number.NaN];let _=!1,D=(new f).getNearestCoordinate(o,d,!0,!1);if(0===D.m_distance&&(_=!0,w[0]=d,D=(new f).getNearestCoordinate(o,d,!1,!1),D.m_distance>.25*t.minDimension()*1.66666666))return new a({x:d.x,y:d.y});b[0]=D.m_distance,C[0]=0;const k=new m;let A=!1,E=.25,q=-1;const v=new c;o.queryPathEnvelope(u,v);do{let e=Number.NaN;if(w[1]=this.calculateParacentroid_(o,N(v.xmin,v.xmax,E),n),w[1].isNAN()||(D=(new f).getNearestCoordinate(o,w[1],!1,!1),e=D.m_distance),e>n&&1===P(o,w[1],n))A=!0,b[1]=e,C[1]=m.sqrDistance(w[1],d);else if(e>q&&(q=e,k.setCoordsPoint2D(w[1])),E-=.01,E<.1){if(!(q>=0))break;A=!0,b[1]=q,w[1]=k,C[1]=m.sqrDistance(w[1],d)}}while(!A);A=!1,E=.5,q=-1;let G=.01,M=1;do{let e=Number.NaN;if(w[2]=this.calculateParacentroid_(o,N(v.xmin,v.xmax,E),n),w[2].isNAN()||(D=(new f).getNearestCoordinate(o,w[2],!1,!1),e=D.m_distance),e>n&&1===P(o,w[2],n))A=!0,b[2]=e,C[2]=m.sqrDistance(w[2],d);else if(e>q&&(q=e,k.setCoordsPoint2D(w[2])),E=.5+G*M,G+=.01,M*=-1,E<.3||E>.7){if(!(q>=0))break;A=!0,b[2]=q,w[2]=k,C[2]=m.sqrDistance(w[2],d)}}while(!A);A=!1,E=.75,q=-1;do{let e=Number.NaN;if(w[3]=this.calculateParacentroid_(o,N(v.xmin,v.xmax,E),n),w[3].isNAN()||(D=(new f).getNearestCoordinate(o,w[3],!1,!1),e=D.m_distance),e>n&&1===P(o,w[3],n))A=!0,b[3]=e,C[3]=m.sqrDistance(w[3],d);else if(e>q&&(q=e,k.setCoordsPoint2D(w[3])),E+=.01,E>.9){if(!(q>=0))break;A=!0,b[3]=q,w[3]=k,C[3]=m.sqrDistance(w[3],d)}}while(!A);const S=[0,1,2,3],j=_?0:1;for(let s=j;s<4;s++)for(let e=j;e<3;e++){const t=C[e],n=C[e+1];if(g(t,n)>0){const r=S[e];S[e]=S[e+1],S[e+1]=r,C[e]=n,C[e+1]=t}}let X=j,L=0,T=0;for(let s=j;s<4;s++){switch(s){case 0:T=2*b[S[s]];break;case 1:T=1.66666666*b[S[s]];break;case 2:T=1.33333333*b[S[s]];break;case 3:T=b[S[s]]}T>L&&(L=T,X=S[s])}return s(!w[X].isNAN()),new a({x:w[X].x,y:w[X].y})}labelPointPolyline(e){const t=new m;if(e.getPointCount()>2*e.getPathCount()){let n=-1,r=-Number.MAX_VALUE;for(let t=0,i=e.getPathCount();t<i;t++)if(e.getPathSize(t)>2){const o=e.calculatePathLength2D(t);o>r&&(r=o,n=t)}const o=e.getPathStart(n),s=e.getPathEnd(n),a=Math.trunc((o+s)/2);t.assign(e.getXY(a))}else{let n=-Number.MAX_VALUE;const r=e.querySegmentIterator();for(;r.nextPath();)if(r.hasNextSegment()){const e=r.nextSegment(),o=e.calculateLength2D();o>n&&(n=o,t.assign(e.getCoord2D(e.lengthToT(.5*o))))}}return new a({x:t.x,y:t.y})}labelPointMultiPoint(e){const t=new c;e.queryEnvelope(t);const n=t.getCenter(),r=(new f).getNearestCoordinate(e,n,!1,!1).m_coordinate;return new a({x:r.x,y:r.y})}labelPointEnvelope(e){const t=e.getCenterXY();return new a({x:t.x,y:t.y})}calculateParacentroid_(e,t,n){const r=new c;e.queryEnvelope(r);const o=new m(t,0);let a=Number.MAX_VALUE,i=Number.MAX_VALUE,l=!1,N=!1;const g=new u;g.setStartXYCoords(o.x,r.ymin-1),g.setEndXYCoords(o.x,r.ymax+1);const y=new c,P=new m,p=new m,f=h(m,2),d=e.querySegmentIterator();for(;d.nextPath();)for(;d.hasNextSegment();){const e=d.nextSegment();if(e.queryEnvelope(y),s(e.isMonotoneQuickAndDirty()),P.setCoordsPoint2D(g.getStartXY()),p.setCoordsPoint2D(g.getEndXY()),0===y.clipLine(P,p))continue;if(1!==g.intersect(e,f,null,null,n))continue;const t=f[0].y;a>i?t<a&&(a=t,l=!0):t<i&&(i=t,N=!0)}return l&&N?o.y=(a+i)/2:o.setNAN(),o}}const w=new d;function b(e){return w.execute(e,null)}function C(e){const n=w.executeMany(new t(e),null);return Array.from(n)}function _(){return w.supportsCurves()}export{b as execute,C as executeMany,_ 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as e,S as r}from"../../../chunks/SimpleGeometryCursor.js";import{E as t}from"../../../chunks/QuadraticBezier.js";import{
|
|
5
|
+
import{G as e,S as r}from"../../../chunks/SimpleGeometryCursor.js";import{E as t}from"../../../chunks/QuadraticBezier.js";import{j as s,d as n}from"../../../chunks/Geometry.js";import{a as o}from"../../../chunks/Envelope.js";import{as as m}from"../../../chunks/ProjectionTransformation.js";class i{getOperatorType(){return 10010}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}executeMany(e,r,t){return new u(e,r,t)}}class u extends e{constructor(e,r,t){super(),this.m_result=null,this.m_geoms=e,this.m_sr=r,this.m_progressTracker=t,this.m_bfirst=!0,this.m_index=-1}tock(){return!0}getRank(){return 1}next(){return this.m_bfirst&&(this.performOperation(),this.m_bfirst=!1),this.m_result?this.m_result.next():null}getGeometryID(){return null!==this.m_result?this.m_result.getGeometryID():-1}performOperation(){const e=new t;for(let t=this.m_geoms.next();null!==t;t=this.m_geoms.next())t.isEmpty()||t.getDimension()<1||s(t.getGeometryType())||(n(t),e.addGeometry(t));if(0===e.getGeometryCount())return;const r=e.getEnvelope2D(this.m_progressTracker),i=o(this.m_sr,r,!0);this.m_result=m(e,i,this.m_progressTracker)}}const a=new i;function c(e,t){const s=a.executeMany(new r(e),t,null);return Array.from(s)}function p(){return a.supportsCurves()}export{c as executeMany,p 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{d as n,G as r,t as s,
|
|
5
|
+
import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{d as n,G as r,t as s,k as i,f as o,c as u}from"../../../chunks/Geometry.js";import{E as l,b as m}from"../../../chunks/Point2D.js";import{V as c,P as a}from"../../../chunks/Envelope.js";import{g as h,M as p,S as g,P as d,G as y}from"../../../chunks/QuadraticBezier.js";function _(t,e,n,r,s){return new f(e,n,r,s).processGeometry(t)}class f{constructor(t,e,n,r){this.m_interval=n,this.m_progressTracker=r,this.m_attribute=t,this.m_ord=e,(c.getComponentCount(this.m_attribute)<=e||e<0)&&s("LocateBetween: ordinate");2===c.getInterpolation(this.m_attribute)&&s("LocateBetween: angular interpolation")}processGeometry(t){const e=t.getGeometryType();if(e===r.enumGeometryCollection)return this.processGeometryCollection(t);if(i(e)&&s("LocateBetween does not support Polygons and Envelopes."),t.isEmpty()||!t.hasAttribute(this.m_attribute))return new a({vd:t.getDescription()});if(o(e))return this.processSegment(t);switch(e){case r.enumPoint:return this.processPoint(t);case r.enumMultiPoint:return this.processMultiPoint(t);case r.enumPolyline:return this.processPolyline(t);default:u("LocateBetween")}}processPoint(t){const e=t.getAttributeAsDbl(this.m_attribute,this.m_ord);return this.m_interval.containsCoordinate(e)?new p({point:t}):new a({vd:t.getDescription()})}processMultiPoint(t){let e=null,n=-1;const r=t.getAttributeStreamRef(this.m_attribute),s=c.getComponentCount(this.m_attribute);for(let i=0,o=0,u=t.getPointCount();i<u;++i,o+=s){const s=r.readAsDbl(o);this.m_interval.containsCoordinate(s)?-1===n&&(n=i):n>=0&&(e||(e=new p({vd:t.getDescription()})),e.addPoints(t,n,i),n=-1)}return n>=0&&(e||(e=new p({vd:t.getDescription()})),e.addPoints(t,n,-1)),e||new a({vd:t.getDescription()})}processPolyline(t){const e=t.queryInterval(this.m_attribute,this.m_ord);if(this.m_interval.contains(e))return t;if(!this.m_interval.isIntersecting(e))return new a({vd:t.getDescription()});let n=null,s=null;const i=t.querySegmentIterator(),o=new g,u=new a,l=new a,m=new a;let c=!0,h=!1;for(;i.nextPath();)for(c=!0,h=!1;i.hasNextSegment();){const t=i.nextSegment(),e=[null],a=this.processSegmentHelper(t,o,e,u);if(a!==r.enumUnknown)if(a===r.enumPoint){if(!c&&(s.getPointByVal(s.getPointCount()-1,l),l.equals(u)))continue;if(c=!0,h&&(t.queryStart(l),u.equals(l)))continue;t.queryEnd(l),h=u.equals(l),n?n.add(u):n=new p({point:u})}else a===r.enumLine&&(h=!1,s||(s=new d),c&&(null===n||n.isEmpty()||(n.getPointByVal(n.getPointCount()-1,l),e[0].queryStart(u),l.equals(u)&&n.removePoint(n.getPointCount()-1))),s.addSegment(e[0],c),t.queryEnd(l),e[0].queryEnd(m),c=!l.equals(m));else c=!0,h=!1}if(null!==n&&n.isEmpty()&&(n=null),null!==n&&null!==s){const t=new y;return t.addGeometry(s),t.addGeometry(n),t}return null!==n?n:null!==s?s:new a({vd:t.getDescription()})}processSegment(t){const e=t.getAttributeAsDbl(0,this.m_attribute,this.m_ord),n=t.getAttributeAsDbl(1,this.m_attribute,this.m_ord),r=Number.isNaN(e)?n:e,s=Number.isNaN(n)?e:n,i=new l;i.setCoords(r,s);const o=i.clone();if(o.intersect(this.m_interval),o.isEmpty())return new a({vd:t.getDescription()});if(i.equals(o))return t;const u=s-r,c=t.calculateLength2D();if(0===o.width()){const e=new a({vd:t.getDescription()}),n=(o.vmin-r)/u,s=t.lengthToT(n*c);return t.queryCoord(s,e),e}let h=(o.vmin-r)/u,p=(o.vmax-r)/u;return h>p&&(p=m(h,h=p)),h=t.lengthToT(h*c),p=t.lengthToT(p*c),t.cut(h,p)}processGeometryCollection(t){if(t.isEmpty()||!t.hasAttribute(this.m_attribute))return new a({vd:t.getDescription()});const e=h(t),n=new y;for(let r=e.next();null!==r;r=e.next()){const t=this.processGeometry(r);t.isEmpty()||n.addGeometry(t)}return n.isEmpty()?new a({vd:t.getDescription()}):n}processSegmentHelper(t,e,n,s){const i=t.getAttributeAsDbl(0,this.m_attribute,this.m_ord),o=t.getAttributeAsDbl(1,this.m_attribute,this.m_ord),u=Number.isNaN(i)?o:i,c=Number.isNaN(o)?i:o,a=new l;a.setCoords(u,c);const h=a.clone();if(h.intersect(this.m_interval),h.isEmpty())return r.enumUnknown;if(a.equals(h))return n[0]=t,r.enumLine;const p=c-u,g=t.calculateLength2D();if(0===h.width()){const e=(h.vmin-u)/p,n=1===e?1:t.lengthToT(e*g);return t.queryCoord(n,s),r.enumPoint}let d=(h.vmin-u)/p,y=(h.vmax-u)/p;return d>y&&(y=m(d,d=y)),d=1===d?1:t.lengthToT(d*g),y=1===y?1:t.lengthToT(y*g),t.queryCut(d,y,e),n[0]=e.get(),r.enumLine}}class w{getOperatorType(){return 10801}accelerateGeometry(t,e,n){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}executeMany(t,e,n){return new b(t,e,n)}}class b extends t{constructor(t,e,n){super(),this.m_collectionCursor=null,this.m_interval=e,this.m_progressTracker=n,this.m_inputGeoms=t,this.m_index=-1}tock(){return!0}getRank(){return 1}next(){if(this.m_collectionCursor){const t=this.m_collectionCursor.next();if(t)return t;this.m_collectionCursor=null}const t=this.m_inputGeoms.next();if(null===t)return null;n(t),this.m_index=this.m_inputGeoms.getGeometryID();const e=_(t,2,0,this.m_interval,this.m_progressTracker);if(e.getGeometryType()===r.enumGeometryCollection){this.m_collectionCursor=h(e);return this.m_collectionCursor.next()}return e}getGeometryID(){return this.m_index}}const v=new w;function C(t,n){const r=v.executeMany(new e(t),n,null);return Array.from(r)}function P(){return v.supportsCurves()}export{C as executeMany,P 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{S as e,G as t}from"../../../chunks/SimpleGeometryCursor.js";import{c as r,
|
|
5
|
+
import{S as e,G as t}from"../../../chunks/SimpleGeometryCursor.js";import{c as r,o as n,d as s,G as o,i,t as u}from"../../../chunks/Geometry.js";import{m as c,h as m,a,j as l,M as g}from"../../../chunks/QuadraticBezier.js";import{m as d,P as h}from"../../../chunks/Point2D.js";class p{getOperatorType(){return 10113}supportsCurves(){return!1}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,r){return new y(e,t,r)}execute(t,n){const s=new e([t]),o=this.executeMany(s,!1,n).next();return o||r("null output"),o}minimumBoundingCircle(e,t,r,n){return c(e,t,r)}}class y extends t{constructor(e,t,r){super(),this.m_geometryCursor=e,this.m_bMerge=t,this.m_progressTracker=r}tock(){return!0}getRank(){return 1}next(){if(this.m_bMerge)return this.mergedMinimumBoundingCircle();const e=this.m_geometryCursor.next();return e?this.minimumBoundingCircle(e):null}getGeometryID(){return this.m_geometryCursor.getGeometryID()}minimumBoundingCircle(e){if(n(e),s(e),this.m_progressTracker?.checkProgress(),e.isEmpty())return e.clone();const t=e.getGeometryType();if(t===o.enumPoint)return this.makeCircle([e.getXY()],1);if(t===o.enumLine){const t=e,r=[t.getStartXY(),t.getEndXY()];return this.makeCircle(r,2)}if(t===o.enumEnvelope){const t=e,r=d(h,2);return t.queryCorner(0,r[0]),t.queryCorner(2,r[1]),this.makeCircle(r,2)}if(i(t)){const t=e,r=[0,0,0],n=m(t,r),s=new Array(n);for(let e=0;e<n;++e)s[e]=t.getXY(r[e]);return this.makeCircle(s,n)}u("Geometry type not supported.")}makeCircle(e,t){const r=new a,n=new l;if(1===t)n.constructCircleRadius(0,e[0],!1);else if(2===t){const t=h.lerp(e[0],e[1],.5),r=h.distance(e[0],t),s=h.distance(e[1],t);n.constructCircleRadius(Math.max(r,s),t,!1)}else if(3===t){const t=h.calculateCircleCenterFromThreePoints(e[0],e[1],e[2]),r=h.distance(e[0],t),s=h.distance(e[1],t),o=h.distance(e[2],t);n.constructCircleRadius(Math.max(r,s,o),t,!1)}return r.addPathFromClosedSegment(n,!1),r}mergedMinimumBoundingCircle(){let e=null,t=this.m_geometryCursor.next();if(!t)return null;e=new g;const r=e.getImpl();do{n(t),s(t),this.m_progressTracker?.checkProgress();switch(t.getGeometryType()){case o.enumPoint:r.addPoint2D(t.getXY());break;case o.enumLine:r.addPoint2D(t.getStartXY()),r.addPoint2D(t.getEndXY());break;case o.enumEnvelope:for(let e=0;e<4;++e){const n=new h;t.queryCorner(e,n),r.addPoint2D(n)}break;case o.enumMultiPoint:case o.enumPolyline:case o.enumPolygon:{const e=t.getImpl();for(let t=0,n=e.getPointCount();t<n;t++)r.addPoint2D(e.getXY(t));break}default:u("Geometry type not supported.")}}while(t=this.m_geometryCursor.next());return this.minimumBoundingCircle(e)}}const C=new p;function f(e){return C.execute(e,null)}function k(t,r){const n=C.executeMany(new e(t),r,null);return Array.from(n)}function P(){return C.supportsCurves()}export{f as execute,k as executeMany,P as supportsCurves};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{S as n}from"../../../chunks/SimpleGeometryCursor.js";import{O as r}from"../../../chunks/OperatorSimplifyOGC.js";const e=new r;function u(n,r,u){return e.execute(n,r,u,null)}function t(r,u,t){const o=e.executeMany(new n(r),u,t,null);return Array.from(o)}function o(n,r,u){return e.isSimple(n,r,u,null,null)}function s(){return e.supportsCurves()}export{u as execute,t as executeMany,o as isSimple,s 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{S as e,G as t}from"../../../chunks/SimpleGeometryCursor.js";import{c as n,d as r,G as s}from"../../../chunks/Geometry.js";import{P as o,d as i}from"../../../chunks/Point2D.js";import{M as u}from"../../../chunks/QuadraticBezier.js";import{Envelope2D as m}from"../../../chunks/Envelope2D.js";import{a as c,d as a}from"../../../chunks/Envelope.js";import{
|
|
5
|
+
import{S as e,G as t}from"../../../chunks/SimpleGeometryCursor.js";import{c as n,d as r,G as s}from"../../../chunks/Geometry.js";import{P as o,d as i}from"../../../chunks/Point2D.js";import{M as u}from"../../../chunks/QuadraticBezier.js";import{Envelope2D as m}from"../../../chunks/Envelope2D.js";import{a as c,d as a}from"../../../chunks/Envelope.js";import{ak as p}from"../../../chunks/ProjectionTransformation.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 h(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 u=new m,a=new m,l=new m;e.queryEnvelope(u),t.queryEnvelope(a),l.setCoords({env2D:u}),l.mergeEnvelope2D(a);const h=c(n,l,!0),y=e.getGeometryType(),g=t.getGeometryType();return y===s.enumPoint&&g===s.enumPoint?d(e,t,h):y===s.enumPoint&&g===s.enumMultiPoint?f(t,e,h):y===s.enumMultiPoint&&g===s.enumPoint?f(e,t,h):p(e,t,n,r)}function d(e,t,n,r){const s=a(n),i=s*s,m=e.getXY(),c=t.getXY(),p=new u({vd:e.getDescription()});return o.sqrDistance(m,c)>i&&(p.add(e),p.add(t)),p}function f(e,t,n,r){const s=e.getImpl().getAttributeStreamRef(0),o=e.getPointCount(),u=t.getXY(),c=e.createInstance(),p=a(n),l=new m;if(e.queryEnvelope(l),l.inflateCoords(p,p),l.contains(u)){const n=p*p;let r=!1;const m=i(o,!1);for(let e=0;e<o;e++){const t=s.read(2*e),o=s.read(2*e+1),i=t-u.x,c=o-u.y;i*i+c*c<=n&&(r=!0,m[e]=!0)}if(r)for(let t=0;t<o;t++)m[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(),h(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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{b as e,
|
|
5
|
+
import{b as e,o as t,G as r,c as s}from"../../chunks/Geometry.js";import{P as a,S as n,a as m}from"../../chunks/QuadraticBezier.js";import{Envelope2D as i}from"../../chunks/Envelope2D.js";import{a as o,P as h}from"../../chunks/Envelope.js";import{g as l}from"../../chunks/ProjectionTransformation.js";import{getSpatialReference as c,fromGeometry as u,fromPolyline as g,fromSpatialReference as _,toGeometry as d}from"./support/apiConverter.js";function x(s,n,m,h){if(n.getPathCount()>1&&e(""),s.isEmpty()||n.isEmpty())return null;t(s),t(n);let l=null;const c=new i;s.queryEnvelope(c);const u=new i;n.queryEnvelope(u);const g=new i;g.setCoords({env2D:c}),g.mergeEnvelope2D(u);const _=o(m,g,!1).total(),d=new A(h);let x=d.setIndicesAndScalars(s,n,_);if(x){const e=d.getTrimmedPolyline(s,n);if(e.isEmpty())return null;l=d.getReshapedMultiPath(s,e,m)}else{if(Number.isNaN(d.m_scalarB0)||s.getGeometryType()===r.enumPolyline)return null;const e=new a;if(e.add(n,!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,m)}return l}class A{constructor(e){this.m_progressTracker=e,this.clearIndicesAndScalars()}setIndicesAndScalars(e,t,s){const a=new i,n=new i;e.queryEnvelope(a),e.queryEnvelope(n),a.inflateCoords(s,s);if(!a.intersect(n))return!1;const m=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,v=Number.NaN;for(o.nextPath();o.hasNextSegment();){const e=o.nextSegment(),t=new i;for(e.queryEnvelope(t),t.inflateCoords(s,s),m.resetToFirstPath();m.nextPath();){for(;m.hasNextSegment();){const r=m.nextSegment(),a=new i;if(r.queryEnvelope(a),t.isIntersecting(a)){if(0!==e.intersect(r,null,l,h,s)&&(Number.isNaN(S)||l[0]<S)&&(c=m.getPathIndex(),g=m.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 y=e.getGeometryType();for(o.resetToLastSegment();o.hasPreviousSegment();){const e=o.previousSegment(),t=new i;for(e.queryEnvelope(t),t.inflateCoords(s,s),y===r.enumPolygon?m.resetToPath(c):m.resetToFirstPath();m.nextPath();){for(;m.hasNextSegment();){const r=m.nextSegment(),a=new i;if(r.queryEnvelope(a),t.isIntersecting(a)){const t=e.intersect(r,null,l,h,s);if(0!==t&&(Number.isNaN(v)||l[t-1]>v)&&(o.getStartPointIndex()!==this.m_vertexB0||l[t-1]!==this.m_scalarB0)&&(u=m.getPathIndex(),_=m.getStartPointIndex(),x=o.getStartPointIndex(),p=h[t-1],v=l[t-1],1===v))break}}if(1===v)break;if(y===r.enumPolygon)break}if(!Number.isNaN(v))break}return!Number.isNaN(v)&&(this.m_pathA1=u,this.m_vertexA1=_,this.m_vertexB1=x,this.m_scalarA1=p,this.m_scalarB1=v,!0)}getTrimmedPolyline(e,t){const r=new n,s=t.createInstance();let a=!0;const m=t.getImpl().querySegmentIterator();if(m.resetToVertex(this.m_vertexB0,0),this.m_vertexB0>this.m_vertexB1)return s;if(this.m_vertexB0===this.m_vertexB1){m.nextSegment().queryCut(this.m_scalarB0,this.m_scalarB1,r,!1),s.addSegment(r.get(),!0)}else for(;;){const e=m.nextSegment(),t=m.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 h,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 n;new h;const i=new m({vd:e.getDescription()});if(i.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),i.addSegment(a.get(),!1)}else{{const e=s.nextSegment();1!==this.m_scalarA1&&(e.queryCut(this.m_scalarA1,1,a),i.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),i.addSegment(a.get(),!1));break}i.addSegment(e,!1)}}const o=new m({vd:e.getDescription()}),c=t.clone();if(c.reversePath(0),o.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),o.addSegment(a.get(),!1)}else{{const e=s.nextSegment();1!==this.m_scalarA0&&(e.queryCut(this.m_scalarA0,1,a),o.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),o.addSegment(a.get(),!1));break}o.addSegment(e,!1)}}const u=Math.abs(i.calculateArea2D()),g=Math.abs(o.calculateArea2D());let _=e.createInstance();for(let n=0;n<e.getPathCount();n++)n===this.m_pathA0?u>=g?_.add(i,!1):_.add(o,!1):_.addPath(e,n,!0);return _=(new l).execute(_,r,!1,this.m_progressTracker),_}getReshapedPolyline(e,t){const r=e.getImpl().querySegmentIterator(),m=new a,i=new n;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,i),m.addSegment(i.get(),c),c=!1);break}m.addSegment(e,c),c=!1}if(o){const e=t.clone();e.reversePath(0),m.addSegmentsFromPath(e,0,0,e.getSegmentCount(),c)}else m.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,i),m.addSegment(i.get(),!1))}for(;r.hasNextSegment();){const e=r.nextSegment();m.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(m,!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 v(e,t){const r=c(e),s=S.execute(u(e),g(t),_(r),null);return d(s,r)}const y=S.supportsCurves();export{v as execute,y as supportsCurves};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "../../interfaces";
|
|
2
|
+
|
|
3
|
+
export const supportsCurves: __esri.simplifyOGCOperator["supportsCurves"];
|
|
4
|
+
export const execute: __esri.simplifyOGCOperator["execute"];
|
|
5
|
+
export const executeMany: __esri.simplifyOGCOperator["executeMany"];
|
|
6
|
+
export const isSimple: __esri.simplifyOGCOperator["isSimple"];
|