@arcgis/core 4.33.0-next.20250423 → 4.33.0-next.20250425
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d4d011eea16a89a5aad9.js → 0219c3f9408d3fa3c9a0.js} +1 -1
- package/assets/esri/core/workers/chunks/070839cb71c8e764b8d7.js +1 -0
- package/assets/esri/core/workers/chunks/19084a293694c5a00cae.js +1 -0
- 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/{fa8a3c75f9b41d31559b.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/2bed8a5ed9ae3760fa2f.js +1 -0
- package/assets/esri/core/workers/chunks/2e3019ce49e972a815ca.js +1 -0
- package/assets/esri/core/workers/chunks/335b539893569e3d7b82.js +1 -0
- package/assets/esri/core/workers/chunks/38f5e6a202ce292edd9f.js +1 -0
- package/assets/esri/core/workers/chunks/415903f481392c72870f.js +1 -0
- package/assets/esri/core/workers/chunks/4351b3e54b309935faed.js +1 -0
- package/assets/esri/core/workers/chunks/4da99f058cca83937e9b.js +1 -0
- package/assets/esri/core/workers/chunks/5acdd49c5f1a49fdc6e7.js +1 -0
- 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/7cd32b10ed0e18e44ef2.js +1 -0
- package/assets/esri/core/workers/chunks/9661ee8569ee208e6237.js +1 -0
- package/assets/esri/core/workers/chunks/968f2f841c011095a6d2.js +1 -0
- 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/a0c51c4c30a5f749dfc6.js +1 -0
- package/assets/esri/core/workers/chunks/a2676f3f135ad5fdf872.js +1 -0
- package/assets/esri/core/workers/chunks/a8430e1e2142f1ce9b92.js +1 -0
- package/assets/esri/core/workers/chunks/{fdcbd28f38bc485ac5e3.js → ab6ecd8eeec5ff761b34.js} +1 -1
- package/assets/esri/core/workers/chunks/b53300b46646cfad2526.js +319 -0
- package/assets/esri/core/workers/chunks/bf543bdec3da0fe278fb.js +1 -0
- package/assets/esri/core/workers/chunks/{5bdd5ae2d2f23ef6b331.js → c87e2a63b96e0da77dfe.js} +1 -1
- package/assets/esri/core/workers/chunks/cc4dd739c4c7e3ccea3f.js +1 -0
- package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +1 -0
- package/assets/esri/core/workers/chunks/{7c42281188b874ffcdad.js → db5913824d5e5a2a8365.js} +1 -1
- package/assets/esri/core/workers/chunks/{48a1bb1e171dd06a7c6e.js → dd94585508f49863dc15.js} +1 -1
- package/assets/esri/core/workers/chunks/{9408a72968cbd985dd24.js → f2cef954b58c6604642c.js} +34 -34
- package/assets/esri/core/workers/chunks/f52e597dca4b32a81881.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/BloomBlur.glsl.js +7 -7
- package/chunks/BloomComposition.glsl.js +24 -25
- package/chunks/ShadowCastAccumulate.glsl.js +13 -9
- package/chunks/ShadowCastVisualize.glsl.js +24 -9
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/sphere.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/support/normalizeUtilsSync.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +544 -116
- package/layers/DimensionLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/ParquetLayer.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/mixins/ImageryTileMixin.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/ParquetEncodingLocation.d.ts +4 -0
- package/layers/support/ParquetEncodingLocation.js +1 -1
- package/layers/support/ParquetEncodingWkb.d.ts +4 -0
- package/layers/support/ParquetEncodingWkb.js +1 -1
- package/layers/support/RasterStorageInfo.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/parquetUtils.d.ts +3 -0
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterDatasets/RawBlockCache.js +1 -1
- package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFormats/pixelRangeUtils.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/portal/schemas/integratedMesh3DTilesLayerItem.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/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/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.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/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.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/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.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/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/Factory.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/SimpleFeatureRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.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 -20
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendColorsPremultiplied.glsl.js +5 -0
- 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/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.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/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechniqueConfiguration.js +5 -0
- package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/input/ViewEvents.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- 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/views/webgl/textureUtils.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/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.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/ElevationProfile/ElevationProfileInteraction.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/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.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/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ThresholdOptions.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/AnalysisViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/184d7c8ea818bec5c462.js +0 -1
- package/assets/esri/core/workers/chunks/22f604726529ee6f8c25.js +0 -1
- package/assets/esri/core/workers/chunks/244d2196bac5ef279436.js +0 -1
- package/assets/esri/core/workers/chunks/26fcbe053194bd78fcc3.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/4f8782b3b6ad414409e8.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/8dd26b12c625d20196ed.js +0 -319
- package/assets/esri/core/workers/chunks/931275cfa2c55eb0f504.js +0 -1
- 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/a276980c06d5d311a37e.js +0 -1
- package/assets/esri/core/workers/chunks/b42ecc7c3eb2fd8d1308.js +0 -1
- package/assets/esri/core/workers/chunks/ccc50f28f217e50cc2c3.js +0 -1
- package/assets/esri/core/workers/chunks/d04efa51da9b4eb3a8a7.js +0 -1
- package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +0 -1
- package/assets/esri/core/workers/chunks/dd8e72d6784a8ebc115d.js +0 -1
- package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +0 -1
- package/assets/esri/core/workers/chunks/ed3d1d0465f4a4d8df4a.js +0 -1
- package/views/webgl/formats.js +0 -5
package/chunks/lyr3DWorker.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{c as r,g as e}from"./_commonjsHelpers.js";var t,n={exports:{}};function o(){return t||(t=1,e=n,o="undefined"!=typeof document?document.currentScript?.src:void 0,a=function(e={}){var t,n,a,i,s=e,l=new Promise(((r,e)=>{t=r,n=e})),u=Object.assign({},s),d="./this.program",c=(r,e)=>{throw e},f="";function h(r){return s.locateFile?s.locateFile(r,f):f+r}"undefined"!=typeof document&&document.currentScript&&(f=document.currentScript.src),o&&(f=o),f=f.startsWith("blob:")?"":f.substr(0,f.replace(/[?#].*/,"").lastIndexOf("/")+1),a=r=>fetch(r,{credentials:"same-origin"}).then((r=>r.ok?r.arrayBuffer():Promise.reject(new Error(r.status+" : "+r.url))));var m=s.print||console.log.bind(console),p=s.printErr||console.error.bind(console);Object.assign(s,u),u=null,s.arguments&&s.arguments,s.thisProgram&&(d=s.thisProgram);var v,w,y,g,E,_,b,k,F,P=s.wasmBinary,A=!1;function S(){var r=v.buffer;s.HEAP8=w=new Int8Array(r),s.HEAP16=g=new Int16Array(r),s.HEAPU8=y=new Uint8Array(r),s.HEAPU16=E=new Uint16Array(r),s.HEAP32=_=new Int32Array(r),s.HEAPU32=b=new Uint32Array(r),s.HEAPF32=k=new Float32Array(r),s.HEAPF64=F=new Float64Array(r)}var D=[],$=[],C=[];function T(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)x(s.preRun.shift());tr(D)}function j(){s.noFSInit||jr.initialized||jr.init(),jr.ignorePermissions=!1,tr($)}function M(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)N(s.postRun.shift());tr(C)}function x(r){D.unshift(r)}function R(r){$.unshift(r)}function N(r){C.unshift(r)}var z=0,W=null;function O(r){return r}function U(r){z++,s.monitorRunDependencies?.(z)}function B(r){if(z--,s.monitorRunDependencies?.(z),0==z&&W){var e=W;W=null,e()}}function L(r){s.onAbort?.(r),p(r="Aborted("+r+")"),A=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}var I,H,V,q="data:application/octet-stream;base64,",X=r=>r.startsWith(q);function G(){var r="lyr3DWorker.wasm";return X(r)?r:h(r)}function K(r){if(r==I&&P)return new Uint8Array(P);throw"both async and sync fetching of the wasm failed"}function Y(r){return P?Promise.resolve().then((()=>K(r))):a(r).then((r=>new Uint8Array(r)),(()=>K(r)))}function J(r,e,t){return Y(r).then((r=>WebAssembly.instantiate(r,e))).then(t,(r=>{p(`failed to asynchronously prepare wasm: ${r}`),L(r)}))}function Q(r,e,t,n){return r||"function"!=typeof WebAssembly.instantiateStreaming||X(e)||"function"!=typeof fetch?J(e,t,n):fetch(e,{credentials:"same-origin"}).then((r=>WebAssembly.instantiateStreaming(r,t).then(n,(function(r){return p(`wasm streaming compile failed: ${r}`),p("falling back to ArrayBuffer instantiation"),J(e,t,n)}))))}function Z(){return{a:nn}}function rr(){function r(r,e){return on=r.exports,v=on._,S(),ye=on.ba,R(on.$),B(),on}function e(e){r(e.instance)}U();var t=Z();if(s.instantiateWasm)try{return s.instantiateWasm(t,r)}catch(o){p(`Module.instantiateWasm callback failed with error: ${o}`),n(o)}return I??=G(),Q(P,I,t,e).catch(n),{}}class er{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var tr=r=>{for(;r.length>0;)r.shift()(s)},nr=s.noExitRuntime||!0,or=r=>dn(r),ar=()=>cn();class ir{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){b[this.ptr+4>>2]=r}get_type(){return b[this.ptr+4>>2]}set_destructor(r){b[this.ptr+8>>2]=r}get_destructor(){return b[this.ptr+8>>2]}set_caught(r){r=r?1:0,w[this.ptr+12]=r}get_caught(){return 0!=w[this.ptr+12]}set_rethrown(r){r=r?1:0,w[this.ptr+13]=r}get_rethrown(){return 0!=w[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){b[this.ptr+16>>2]=r}get_adjusted_ptr(){return b[this.ptr+16>>2]}}var sr=(r,e,t)=>{throw new ir(r).init(e,t),r},lr=()=>{var r=_[+xr.varargs>>2];return xr.varargs+=4,r},ur=lr,dr={isAbs:r=>"/"===r.charAt(0),splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=dr.isAbs(r),t="/"===r.substr(-1);return(r=dr.normalizeArray(r.split("/").filter((r=>!!r)),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=dr.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:r=>{if("/"===r)return"/";var e=(r=(r=dr.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},join:(...r)=>dr.normalize(r.join("/")),join2:(r,e)=>dr.normalize(r+"/"+e)},cr=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return r=>crypto.getRandomValues(r);L("initRandomDevice")},fr=r=>(fr=cr())(r),hr={resolve:(...r)=>{for(var e="",t=!1,n=r.length-1;n>=-1&&!t;n--){var o=n>=0?r[n]:jr.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,t=dr.isAbs(o)}return(t?"/":"")+(e=dr.normalizeArray(e.split("/").filter((r=>!!r)),!t).join("/"))||"."},relative:(r,e)=>{function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=hr.resolve(r).substr(1),e=hr.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},mr="undefined"!=typeof TextDecoder?new TextDecoder:void 0,pr=(r,e=0,t=NaN)=>{for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.buffer&&mr)return mr.decode(r.subarray(e,o));for(var a="";e<o;){var i=r[e++];if(128&i){var s=63&r[e++];if(192!=(224&i)){var l=63&r[e++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&r[e++])<65536)a+=String.fromCharCode(i);else{var u=i-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},vr=[],wr=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},yr=(r,e,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i)),s<=127){if(t>=a)break;e[t++]=s}else if(s<=2047){if(t+1>=a)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=a)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o};function gr(r,e,t){var n=wr(r)+1,o=new Array(n),a=yr(r,o,0,o.length);return o.length=a,o}var Er=()=>{if(!vr.length){var r=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(r=window.prompt("Input: "))&&(r+="\n"),!r)return null;vr=gr(r)}return vr.shift()},_r={ttys:[],init(){},shutdown(){},register(r,e){_r.ttys[r]={input:[],output:[],ops:e},jr.registerDevice(r,_r.stream_ops)},stream_ops:{open(r){var e=_r.ttys[r.node.rdev];if(!e)throw new jr.ErrnoError(43);r.tty=e,r.seekable=!1},close(r){r.tty.ops.fsync(r.tty)},fsync(r){r.tty.ops.fsync(r.tty)},read(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new jr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(l){throw new jr.ErrnoError(29)}if(void 0===s&&0===a)throw new jr.ErrnoError(6);if(null==s)break;a++,e[t+i]=s}return a&&(r.node.timestamp=Date.now()),a},write(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new jr.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,e[t+a])}catch(i){throw new jr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:r=>Er(),put_char(r,e){null===e||10===e?(m(pr(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(m(pr(r.output)),r.output=[])},ioctl_tcgets:r=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(r,e,t)=>0,ioctl_tiocgwinsz:r=>[24,80]},default_tty1_ops:{put_char(r,e){null===e||10===e?(p(pr(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(p(pr(r.output)),r.output=[])}}},br=(r,e)=>Math.ceil(r/e)*e,kr=r=>{L()},Fr={ops_table:null,mount:r=>Fr.createNode(null,"/",16895,0),createNode(r,e,t,n){if(jr.isBlkdev(t)||jr.isFIFO(t))throw new jr.ErrnoError(63);Fr.ops_table||={dir:{node:{getattr:Fr.node_ops.getattr,setattr:Fr.node_ops.setattr,lookup:Fr.node_ops.lookup,mknod:Fr.node_ops.mknod,rename:Fr.node_ops.rename,unlink:Fr.node_ops.unlink,rmdir:Fr.node_ops.rmdir,readdir:Fr.node_ops.readdir,symlink:Fr.node_ops.symlink},stream:{llseek:Fr.stream_ops.llseek}},file:{node:{getattr:Fr.node_ops.getattr,setattr:Fr.node_ops.setattr},stream:{llseek:Fr.stream_ops.llseek,read:Fr.stream_ops.read,write:Fr.stream_ops.write,allocate:Fr.stream_ops.allocate,mmap:Fr.stream_ops.mmap,msync:Fr.stream_ops.msync}},link:{node:{getattr:Fr.node_ops.getattr,setattr:Fr.node_ops.setattr,readlink:Fr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Fr.node_ops.getattr,setattr:Fr.node_ops.setattr},stream:jr.chrdev_stream_ops}};var o=jr.createNode(r,e,t,n);return jr.isDir(o.mode)?(o.node_ops=Fr.ops_table.dir.node,o.stream_ops=Fr.ops_table.dir.stream,o.contents={}):jr.isFile(o.mode)?(o.node_ops=Fr.ops_table.file.node,o.stream_ops=Fr.ops_table.file.stream,o.usedBytes=0,o.contents=null):jr.isLink(o.mode)?(o.node_ops=Fr.ops_table.link.node,o.stream_ops=Fr.ops_table.link.stream):jr.isChrdev(o.mode)&&(o.node_ops=Fr.ops_table.chrdev.node,o.stream_ops=Fr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:r=>r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0),expandFileStorage(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){var n=1048576;e=Math.max(e,t*(t<n?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var o=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(o.subarray(0,r.usedBytes),0)}},resizeFileStorage(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr(r){var e={};return e.dev=jr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,jr.isDir(r.mode)?e.size=4096:jr.isFile(r.mode)?e.size=r.usedBytes:jr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&Fr.resizeFileStorage(r,e.size)},lookup(r,e){throw Fr.doesNotExistError},mknod:(r,e,t,n)=>Fr.createNode(r,e,t,n),rename(r,e,t){if(jr.isDir(r.mode)){var n;try{n=jr.lookupNode(e,t)}catch(a){}if(n)for(var o in n.contents)throw new jr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp},unlink(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir(r,e){var t=jr.lookupNode(r,e);for(var n in t.contents)throw new jr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir(r){var e=[".",".."];for(var t of Object.keys(r.contents))e.push(t);return e},symlink(r,e,t){var n=Fr.createNode(r,e,41471,0);return n.link=t,n},readlink(r){if(!jr.isLink(r.mode))throw new jr.ErrnoError(28);return r.link}},stream_ops:{read(r,e,t,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)e.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)e[t+s]=a[o+s];return i},write(r,e,t,n,o,a){if(e.buffer===w.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.timestamp=Date.now(),e.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=e.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=e.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(e.subarray(t,t+n),o),n}if(Fr.expandFileStorage(i,o+n),i.contents.subarray&&e.subarray)i.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=e[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&jr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new jr.ErrnoError(28);return n},allocate(r,e,t){Fr.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap(r,e,t,n,o){if(!jr.isFile(r.node.mode))throw new jr.ErrnoError(43);var a,i,s=r.node.contents;if(2&o||!s||s.buffer!==w.buffer){if(i=!0,!(a=kr()))throw new jr.ErrnoError(48);s&&((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),w.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(r,e,t,n,o)=>(Fr.stream_ops.write(r,e,0,n,t,!1),0)}},Pr=(r,e,t,n)=>{var o=O(`al ${r}`);a(r).then((r=>{e(new Uint8Array(r)),o&&B()}),(e=>{if(!t)throw`Loading data file "${r}" failed.`;t()})),o&&U()},Ar=(r,e,t,n,o,a)=>{jr.createDataFile(r,e,t,n,o,a)},Sr=s.preloadPlugins||[],Dr=(r,e,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return Sr.forEach((a=>{o||a.canHandle(e)&&(a.handle(r,e,t,n),o=!0)})),o},$r=(r,e,t,n,o,a,i,s,l,u)=>{var d=e?hr.resolve(dr.join2(r,e)):r;function c(t){function c(t){u?.(),s||Ar(r,e,t,n,o,l),a?.(),B()}Dr(t,d,c,(()=>{i?.(),B()}))||c(t)}U(),"string"==typeof t?Pr(t,c,i):c(t)},Cr=r=>{var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[r];if(void 0===e)throw new Error(`Unknown file open mode: ${r}`);return e},Tr=(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},jr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{name="ErrnoError";constructor(r){this.errno=r}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{shared={};get object(){return this.node}set object(r){this.node=r}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(r){this.shared.flags=r}get position(){return this.shared.position}set position(r){this.shared.position=r}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.id=jr.nextInode++,this.name=e,this.mode=t,this.rdev=n}get read(){return(this.mode&this.readMode)===this.readMode}set read(r){r?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(r){r?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return jr.isDir(this.mode)}get isDevice(){return jr.isChrdev(this.mode)}},lookupPath(r,e={}){if(!(r=hr.resolve(r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if((e=Object.assign(t,e)).recurse_count>8)throw new jr.ErrnoError(32);for(var n=r.split("/").filter((r=>!!r)),o=jr.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&e.parent)break;if(o=jr.lookupNode(o,n[i]),a=dr.join2(a,n[i]),jr.isMountpoint(o)&&(!s||s&&e.follow_mount)&&(o=o.mounted.root),!s||e.follow)for(var l=0;jr.isLink(o.mode);){var u=jr.readlink(a);if(a=hr.resolve(dr.dirname(a),u),o=jr.lookupPath(a,{recurse_count:e.recurse_count+1}).node,l++>40)throw new jr.ErrnoError(32)}}return{path:a,node:o}},getPath(r){for(var e;;){if(jr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t}e=e?`${r.name}/${e}`:r.name,r=r.parent}},hashName(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%jr.nameTable.length},hashAddNode(r){var e=jr.hashName(r.parent.id,r.name);r.name_next=jr.nameTable[e],jr.nameTable[e]=r},hashRemoveNode(r){var e=jr.hashName(r.parent.id,r.name);if(jr.nameTable[e]===r)jr.nameTable[e]=r.name_next;else for(var t=jr.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode(r,e){var t=jr.mayLookup(r);if(t)throw new jr.ErrnoError(t);for(var n=jr.hashName(r.id,e),o=jr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===e)return o}return jr.lookup(r,e)},createNode(r,e,t,n){var o=new jr.FSNode(r,e,t,n);return jr.hashAddNode(o),o},destroyNode(r){jr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>!(49152&~r),flagsToPermissionString(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>jr.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup(r){if(!jr.isDir(r.mode))return 54;var e=jr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate(r,e){try{return jr.lookupNode(r,e),20}catch(t){}return jr.nodePermissions(r,"wx")},mayDelete(r,e,t){var n;try{n=jr.lookupNode(r,e)}catch(a){return a.errno}var o=jr.nodePermissions(r,"wx");if(o)return o;if(t){if(!jr.isDir(n.mode))return 54;if(jr.isRoot(n)||jr.getPath(n)===jr.cwd())return 10}else if(jr.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?jr.isLink(r.mode)?32:jr.isDir(r.mode)&&("r"!==jr.flagsToPermissionString(e)||512&e)?31:jr.nodePermissions(r,jr.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd(){for(var r=0;r<=jr.MAX_OPEN_FDS;r++)if(!jr.streams[r])return r;throw new jr.ErrnoError(33)},getStreamChecked(r){var e=jr.getStream(r);if(!e)throw new jr.ErrnoError(8);return e},getStream:r=>jr.streams[r],createStream:(r,e=-1)=>(r=Object.assign(new jr.FSStream,r),-1==e&&(e=jr.nextfd()),r.fd=e,jr.streams[e]=r,r),closeStream(r){jr.streams[r]=null},dupStream(r,e=-1){var t=jr.createStream(r,e);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(r){var e=jr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open?.(r)},llseek(){throw new jr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice(r,e){jr.devices[r]={stream_ops:e}},getDevice:r=>jr.devices[r],getMounts(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push(...n.mounts)}return e},syncfs(r,e){"function"==typeof r&&(e=r,r=!1),jr.syncFSRequests++,jr.syncFSRequests>1&&p(`warning: ${jr.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=jr.getMounts(jr.root.mount),n=0;function o(r){return jr.syncFSRequests--,e(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)}))},mount(r,e,t){var n,o="/"===t,a=!t;if(o&&jr.root)throw new jr.ErrnoError(10);if(!o&&!a){var i=jr.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,jr.isMountpoint(n))throw new jr.ErrnoError(10);if(!jr.isDir(n.mode))throw new jr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},l=r.mount(s);return l.mount=s,s.root=l,o?jr.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(r){var e=jr.lookupPath(r,{follow_mount:!1});if(!jr.isMountpoint(e.node))throw new jr.ErrnoError(28);var t=e.node,n=t.mounted,o=jr.getMounts(n);Object.keys(jr.nameTable).forEach((r=>{for(var e=jr.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&jr.destroyNode(e),e=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod(r,e,t){var n=jr.lookupPath(r,{parent:!0}).node,o=dr.basename(r);if(!o||"."===o||".."===o)throw new jr.ErrnoError(28);var a=jr.mayCreate(n,o);if(a)throw new jr.ErrnoError(a);if(!n.node_ops.mknod)throw new jr.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},statfs(r){var e={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:jr.nextInode,ffree:jr.nextInode-1,fsid:42,flags:2,namelen:255},t=jr.lookupPath(r,{follow:!0}).node;return t?.node_ops.statfs&&Object.assign(e,t.node_ops.statfs(t.mount.opts.root)),e},create:(r,e=438)=>(e&=4095,e|=32768,jr.mknod(r,e,0)),mkdir:(r,e=511)=>(e&=1023,e|=16384,jr.mknod(r,e,0)),mkdirTree(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{jr.mkdir(n,e)}catch(a){if(20!=a.errno)throw a}}},mkdev:(r,e,t)=>(void 0===t&&(t=e,e=438),e|=8192,jr.mknod(r,e,t)),symlink(r,e){if(!hr.resolve(r))throw new jr.ErrnoError(44);var t=jr.lookupPath(e,{parent:!0}).node;if(!t)throw new jr.ErrnoError(44);var n=dr.basename(e),o=jr.mayCreate(t,n);if(o)throw new jr.ErrnoError(o);if(!t.node_ops.symlink)throw new jr.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename(r,e){var t,n,o=dr.dirname(r),a=dr.dirname(e),i=dr.basename(r),s=dr.basename(e);if(t=jr.lookupPath(r,{parent:!0}).node,n=jr.lookupPath(e,{parent:!0}).node,!t||!n)throw new jr.ErrnoError(44);if(t.mount!==n.mount)throw new jr.ErrnoError(75);var l,u=jr.lookupNode(t,i),d=hr.relative(r,a);if("."!==d.charAt(0))throw new jr.ErrnoError(28);if("."!==(d=hr.relative(e,o)).charAt(0))throw new jr.ErrnoError(55);try{l=jr.lookupNode(n,s)}catch(h){}if(u!==l){var c=jr.isDir(u.mode),f=jr.mayDelete(t,i,c);if(f)throw new jr.ErrnoError(f);if(f=l?jr.mayDelete(n,s,c):jr.mayCreate(n,s))throw new jr.ErrnoError(f);if(!t.node_ops.rename)throw new jr.ErrnoError(63);if(jr.isMountpoint(u)||l&&jr.isMountpoint(l))throw new jr.ErrnoError(10);if(n!==t&&(f=jr.nodePermissions(t,"w")))throw new jr.ErrnoError(f);jr.hashRemoveNode(u);try{t.node_ops.rename(u,n,s),u.parent=n}catch(h){throw h}finally{jr.hashAddNode(u)}}},rmdir(r){var e=jr.lookupPath(r,{parent:!0}).node,t=dr.basename(r),n=jr.lookupNode(e,t),o=jr.mayDelete(e,t,!0);if(o)throw new jr.ErrnoError(o);if(!e.node_ops.rmdir)throw new jr.ErrnoError(63);if(jr.isMountpoint(n))throw new jr.ErrnoError(10);e.node_ops.rmdir(e,t),jr.destroyNode(n)},readdir(r){var e=jr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new jr.ErrnoError(54);return e.node_ops.readdir(e)},unlink(r){var e=jr.lookupPath(r,{parent:!0}).node;if(!e)throw new jr.ErrnoError(44);var t=dr.basename(r),n=jr.lookupNode(e,t),o=jr.mayDelete(e,t,!1);if(o)throw new jr.ErrnoError(o);if(!e.node_ops.unlink)throw new jr.ErrnoError(63);if(jr.isMountpoint(n))throw new jr.ErrnoError(10);e.node_ops.unlink(e,t),jr.destroyNode(n)},readlink(r){var e=jr.lookupPath(r).node;if(!e)throw new jr.ErrnoError(44);if(!e.node_ops.readlink)throw new jr.ErrnoError(28);return e.node_ops.readlink(e)},stat(r,e){var t=jr.lookupPath(r,{follow:!e}).node;if(!t)throw new jr.ErrnoError(44);if(!t.node_ops.getattr)throw new jr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>jr.stat(r,!0),chmod(r,e,t){var n;if(!(n="string"==typeof r?jr.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new jr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod(r,e){jr.chmod(r,e,!0)},fchmod(r,e){var t=jr.getStreamChecked(r);jr.chmod(t.node,e)},chown(r,e,t,n){var o;if(!(o="string"==typeof r?jr.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new jr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(r,e,t){jr.chown(r,e,t,!0)},fchown(r,e,t){var n=jr.getStreamChecked(r);jr.chown(n.node,e,t)},truncate(r,e){if(e<0)throw new jr.ErrnoError(28);var t;if(!(t="string"==typeof r?jr.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new jr.ErrnoError(63);if(jr.isDir(t.mode))throw new jr.ErrnoError(31);if(!jr.isFile(t.mode))throw new jr.ErrnoError(28);var n=jr.nodePermissions(t,"w");if(n)throw new jr.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate(r,e){var t=jr.getStreamChecked(r);if(!(2097155&t.flags))throw new jr.ErrnoError(28);jr.truncate(t.node,e)},utime(r,e,t){var n=jr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open(r,e,t=438){if(""===r)throw new jr.ErrnoError(44);var n;if(t=64&(e="string"==typeof e?Cr(e):e)?4095&t|32768:0,"object"==typeof r)n=r;else{r=dr.normalize(r);try{n=jr.lookupPath(r,{follow:!(131072&e)}).node}catch(l){}}var o=!1;if(64&e)if(n){if(128&e)throw new jr.ErrnoError(20)}else n=jr.mknod(r,t,0),o=!0;if(!n)throw new jr.ErrnoError(44);if(jr.isChrdev(n.mode)&&(e&=-513),65536&e&&!jr.isDir(n.mode))throw new jr.ErrnoError(54);if(!o){var a=jr.mayOpen(n,e);if(a)throw new jr.ErrnoError(a)}512&e&&!o&&jr.truncate(n,0),e&=-131713;var i=jr.createStream({node:n,path:jr.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!s.logReadFiles||1&e||r in jr.readFiles||(jr.readFiles[r]=1),i},close(r){if(jr.isClosed(r))throw new jr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{jr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek(r,e,t){if(jr.isClosed(r))throw new jr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new jr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new jr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read(r,e,t,n,o){if(n<0||o<0)throw new jr.ErrnoError(28);if(jr.isClosed(r))throw new jr.ErrnoError(8);if(1==(2097155&r.flags))throw new jr.ErrnoError(8);if(jr.isDir(r.node.mode))throw new jr.ErrnoError(31);if(!r.stream_ops.read)throw new jr.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new jr.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,e,t,n,o);return a||(r.position+=i),i},write(r,e,t,n,o,a){if(n<0||o<0)throw new jr.ErrnoError(28);if(jr.isClosed(r))throw new jr.ErrnoError(8);if(!(2097155&r.flags))throw new jr.ErrnoError(8);if(jr.isDir(r.node.mode))throw new jr.ErrnoError(31);if(!r.stream_ops.write)throw new jr.ErrnoError(28);r.seekable&&1024&r.flags&&jr.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new jr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,a);return i||(r.position+=s),s},allocate(r,e,t){if(jr.isClosed(r))throw new jr.ErrnoError(8);if(e<0||t<=0)throw new jr.ErrnoError(28);if(!(2097155&r.flags))throw new jr.ErrnoError(8);if(!jr.isFile(r.node.mode)&&!jr.isDir(r.node.mode))throw new jr.ErrnoError(43);if(!r.stream_ops.allocate)throw new jr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap(r,e,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&r.flags))throw new jr.ErrnoError(2);if(1==(2097155&r.flags))throw new jr.ErrnoError(2);if(!r.stream_ops.mmap)throw new jr.ErrnoError(43);if(!e)throw new jr.ErrnoError(28);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,ioctl(r,e,t){if(!r.stream_ops.ioctl)throw new jr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile(r,e={}){if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(`Invalid encoding type "${e.encoding}"`);var t,n=jr.open(r,e.flags),o=jr.stat(r).size,a=new Uint8Array(o);return jr.read(n,a,0,o,0),"utf8"===e.encoding?t=pr(a):"binary"===e.encoding&&(t=a),jr.close(n),t},writeFile(r,e,t={}){t.flags=t.flags||577;var n=jr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(wr(e)+1),a=yr(e,o,0,o.length);jr.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");jr.write(n,e,0,e.byteLength,void 0,t.canOwn)}jr.close(n)},cwd:()=>jr.currentPath,chdir(r){var e=jr.lookupPath(r,{follow:!0});if(null===e.node)throw new jr.ErrnoError(44);if(!jr.isDir(e.node.mode))throw new jr.ErrnoError(54);var t=jr.nodePermissions(e.node,"x");if(t)throw new jr.ErrnoError(t);jr.currentPath=e.path},createDefaultDirectories(){jr.mkdir("/tmp"),jr.mkdir("/home"),jr.mkdir("/home/web_user")},createDefaultDevices(){jr.mkdir("/dev"),jr.registerDevice(jr.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n,llseek:()=>0}),jr.mkdev("/dev/null",jr.makedev(1,3)),_r.register(jr.makedev(5,0),_r.default_tty_ops),_r.register(jr.makedev(6,0),_r.default_tty1_ops),jr.mkdev("/dev/tty",jr.makedev(5,0)),jr.mkdev("/dev/tty1",jr.makedev(6,0));var r=new Uint8Array(1024),e=0,t=()=>(0===e&&(e=fr(r).byteLength),r[--e]);jr.createDevice("/dev","random",t),jr.createDevice("/dev","urandom",t),jr.mkdir("/dev/shm"),jr.mkdir("/dev/shm/tmp")},createSpecialDirectories(){jr.mkdir("/proc");var r=jr.mkdir("/proc/self");jr.mkdir("/proc/self/fd"),jr.mount({mount(){var e=jr.createNode(r,"fd",16895,73);return e.node_ops={lookup(r,e){var t=+e,n=jr.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams(r,e,t){r?jr.createDevice("/dev","stdin",r):jr.symlink("/dev/tty","/dev/stdin"),e?jr.createDevice("/dev","stdout",null,e):jr.symlink("/dev/tty","/dev/stdout"),t?jr.createDevice("/dev","stderr",null,t):jr.symlink("/dev/tty1","/dev/stderr"),jr.open("/dev/stdin",0),jr.open("/dev/stdout",1),jr.open("/dev/stderr",1)},staticInit(){jr.nameTable=new Array(4096),jr.mount(Fr,{},"/"),jr.createDefaultDirectories(),jr.createDefaultDevices(),jr.createSpecialDirectories(),jr.filesystems={MEMFS:Fr}},init(r,e,t){jr.initialized=!0,r??=s.stdin,e??=s.stdout,t??=s.stderr,jr.createStandardStreams(r,e,t)},quit(){jr.initialized=!1;for(var r=0;r<jr.streams.length;r++){var e=jr.streams[r];e&&jr.close(e)}},findObject(r,e){var t=jr.analyzePath(r,e);return t.exists?t.object:null},analyzePath(r,e){try{r=(n=jr.lookupPath(r,{follow:!e})).path}catch(o){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=jr.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=dr.basename(r),n=jr.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(o){t.error=o.errno}return t},createPath(r,e,t,n){r="string"==typeof r?r:jr.getPath(r);for(var o=e.split("/").reverse();o.length;){var a=o.pop();if(a){var i=dr.join2(r,a);try{jr.mkdir(i)}catch(s){}r=i}}return i},createFile(r,e,t,n,o){var a=dr.join2("string"==typeof r?r:jr.getPath(r),e),i=Tr(n,o);return jr.create(a,i)},createDataFile(r,e,t,n,o,a){var i=e;r&&(r="string"==typeof r?r:jr.getPath(r),i=e?dr.join2(r,e):r);var s=Tr(n,o),l=jr.create(i,s);if(t){if("string"==typeof t){for(var u=new Array(t.length),d=0,c=t.length;d<c;++d)u[d]=t.charCodeAt(d);t=u}jr.chmod(l,146|s);var f=jr.open(l,577);jr.write(f,t,0,t.length,0,a),jr.close(f),jr.chmod(l,s)}},createDevice(r,e,t,n){var o=dr.join2("string"==typeof r?r:jr.getPath(r),e),a=Tr(!!t,!!n);jr.createDevice.major??=64;var i=jr.makedev(jr.createDevice.major++,0);return jr.registerDevice(i,{open(r){r.seekable=!1},close(r){n?.buffer?.length&&n(10)},read(r,e,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(u){throw new jr.ErrnoError(29)}if(void 0===l&&0===i)throw new jr.ErrnoError(6);if(null==l)break;i++,e[n+s]=l}return i&&(r.node.timestamp=Date.now()),i},write(r,e,t,o,a){for(var i=0;i<o;i++)try{n(e[t+i])}catch(s){throw new jr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),i}}),jr.mkdev(o,a,i)},forceLoadFile(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{r.contents=i(r.url),r.usedBytes=r.contents.length}catch(e){throw new jr.ErrnoError(29)}},createLazyFile(r,e,t,n,o){if("undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},i=jr.createFile(r,e,a,n,o);a.contents?i.contents=a.contents:a.url&&(i.contents=null,i.url=a.url),Object.defineProperties(i,{usedBytes:{get:function(){return this.contents.length}}});var s={};function l(r,e,t,n,o){var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)e[t+s]=a[o+s];else for(s=0;s<i;s++)e[t+s]=a.get(o+s);return i}return Object.keys(i.stream_ops).forEach((r=>{var e=i.stream_ops[r];s[r]=(...r)=>(jr.forceLoadFile(i),e(...r))})),s.read=(r,e,t,n,o)=>(jr.forceLoadFile(i),l(r,e,t,n,o)),s.mmap=(r,e,t,n,o)=>{jr.forceLoadFile(i);var a=kr();if(!a)throw new jr.ErrnoError(48);return l(r,w,a,e,t),{ptr:a,allocated:!0}},i.stream_ops=s,i}},Mr=(r,e)=>r?pr(y,r,e):"",xr={DEFAULT_POLLMASK:5,calculateAt(r,e,t){if(dr.isAbs(e))return e;var n;if(n=-100===r?jr.cwd():xr.getStreamFromFD(r).path,0==e.length){if(!t)throw new jr.ErrnoError(44);return n}return dr.join2(n,e)},doStat(r,e,t){var n=r(e);_[t>>2]=n.dev,_[t+4>>2]=n.mode,b[t+8>>2]=n.nlink,_[t+12>>2]=n.uid,_[t+16>>2]=n.gid,_[t+20>>2]=n.rdev,V=[n.size>>>0,(H=n.size,+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],_[t+24>>2]=V[0],_[t+28>>2]=V[1],_[t+32>>2]=4096,_[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return V=[Math.floor(o/1e3)>>>0,(H=Math.floor(o/1e3),+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],_[t+40>>2]=V[0],_[t+44>>2]=V[1],b[t+48>>2]=o%1e3*1e3*1e3,V=[Math.floor(a/1e3)>>>0,(H=Math.floor(a/1e3),+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],_[t+56>>2]=V[0],_[t+60>>2]=V[1],b[t+64>>2]=a%1e3*1e3*1e3,V=[Math.floor(i/1e3)>>>0,(H=Math.floor(i/1e3),+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],_[t+72>>2]=V[0],_[t+76>>2]=V[1],b[t+80>>2]=i%1e3*1e3*1e3,V=[n.ino>>>0,(H=n.ino,+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],_[t+88>>2]=V[0],_[t+92>>2]=V[1],0},doMsync(r,e,t,n,o){if(!jr.isFile(e.node.mode))throw new jr.ErrnoError(43);if(2&n)return 0;var a=y.slice(r,r+t);jr.msync(e,a,o,t,n)},getStreamFromFD:r=>jr.getStreamChecked(r),varargs:void 0,getStr:r=>Mr(r)};function Rr(r,e,t){xr.varargs=t;try{var n=xr.getStreamFromFD(r);switch(e){case 0:if((o=lr())<0)return-28;for(;jr.streams[o];)o++;return jr.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=lr();return n.flags|=o,0;case 12:return o=ur(),g[o+0>>1]=2,0}return-28}catch(a){if(void 0===jr||"ErrnoError"!==a.name)throw a;return-a.errno}}function Nr(r,e,t){xr.varargs=t;try{var n=xr.getStreamFromFD(r);switch(e){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=ur();_[a>>2]=o.c_iflag||0,_[a+4>>2]=o.c_oflag||0,_[a+8>>2]=o.c_cflag||0,_[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)w[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=ur();var s=_[a>>2],l=_[a+4>>2],u=_[a+8>>2],d=_[a+12>>2],c=[];for(i=0;i<32;i++)c.push(w[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,e,{c_iflag:s,c_oflag:l,c_cflag:u,c_lflag:d,c_cc:c})}return 0;case 21519:return n.tty?(a=ur(),_[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=ur(),jr.ioctl(n,e,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=ur(),g[a>>1]=f[0],g[a+2>>1]=f[1]}return 0;default:return-28}}catch(h){if(void 0===jr||"ErrnoError"!==h.name)throw h;return-h.errno}}function zr(r,e,t,n){xr.varargs=n;try{e=xr.getStr(e),e=xr.calculateAt(r,e);var o=n?lr():0;return jr.open(e,t,o).fd}catch(a){if(void 0===jr||"ErrnoError"!==a.name)throw a;return-a.errno}}var Wr=()=>L(""),Or={},Ur=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function Br(r){return this.fromWireType(b[r>>2])}var Lr,Ir,Hr,Vr={},qr={},Xr={},Gr=r=>{throw new Lr(r)},Kr=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&Gr("Mismatched type converter count");for(var o=0;o<r.length;++o)te(r[o],n[o])}r.forEach((r=>Xr[r]=e));var o=new Array(e.length),a=[],i=0;e.forEach(((r,e)=>{qr.hasOwnProperty(r)?o[e]=qr[r]:(a.push(r),Vr.hasOwnProperty(r)||(Vr[r]=[]),Vr[r].push((()=>{o[e]=qr[r],++i===a.length&&n(o)})))})),0===a.length&&n(o)},Yr=r=>{var e=Or[r];delete Or[r];var t=e.rawConstructor,n=e.rawDestructor,o=e.fields,a=o.map((r=>r.getterReturnType)).concat(o.map((r=>r.setterArgumentType)));Kr([r],a,(r=>{var a={};return o.forEach(((e,t)=>{var n=e.fieldName,i=r[t],s=e.getter,l=e.getterContext,u=r[t+o.length],d=e.setter,c=e.setterContext;a[n]={read:r=>i.fromWireType(s(l,r)),write:(r,e)=>{var t=[];d(c,r,u.toWireType(t,e)),Ur(t)}}})),[{name:e.name,fromWireType:r=>{var e={};for(var t in a)e[t]=a[t].read(r);return n(r),e},toWireType:(r,e)=>{for(var o in a)if(!(o in e))throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,e[o]);return null!==r&&r.push(n,i),i},argPackAdvance:ne,readValueFromPointer:Br,destructorFunction:n}]}))},Jr=(r,e,t,n,o)=>{},Qr=()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);Ir=r},Zr=r=>{for(var e="",t=r;y[t];)e+=Ir[y[t++]];return e},re=r=>{throw new Hr(r)};function ee(r,e,t={}){var n=e.name;if(r||re(`type "${n}" must have a positive integer typeid pointer`),qr.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;re(`Cannot register type '${n}' twice`)}if(qr[r]=e,delete Xr[r],Vr.hasOwnProperty(r)){var o=Vr[r];delete Vr[r],o.forEach((r=>r()))}}function te(r,e,t={}){return ee(r,e,t)}var ne=8,oe=(r,e,t,n)=>{te(r,{name:e=Zr(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:ne,readValueFromPointer:function(r){return this.fromWireType(y[r])},destructorFunction:null})},ae=[],ie=[],se=r=>{r>9&&0==--ie[r+1]&&(ie[r]=void 0,ae.push(r))},le=()=>ie.length/2-5-ae.length,ue=()=>{ie.push(0,1,void 0,1,null,1,!0,1,!1,1),s.count_emval_handles=le},de={toValue:r=>(r||re("Cannot use deleted val. handle = "+r),ie[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=ae.pop()||ie.length;return ie[e]=r,ie[e+1]=1,e}}}},ce={name:"emscripten::val",fromWireType:r=>{var e=de.toValue(r);return se(r),e},toWireType:(r,e)=>de.toHandle(e),argPackAdvance:ne,readValueFromPointer:Br,destructorFunction:null},fe=r=>te(r,ce),he=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(k[r>>2])};case 8:return function(r){return this.fromWireType(F[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},me=(r,e,t)=>{te(r,{name:e=Zr(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:ne,readValueFromPointer:he(e,t),destructorFunction:null})},pe=(r,e)=>Object.defineProperty(e,"name",{value:r});function ve(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}function we(r,e,t,n,o,a){var i=e.length;i<2&&re("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var s=ve(e),l="void"!==e[0].name,u=i-2,d=new Array(u),c=[],f=[];return pe(r,(function(...r){var t;f.length=0,c.length=1,c[0]=o;for(var a=0;a<u;++a)d[a]=e[a+2].toWireType(f,r[a]),c.push(d[a]);function i(r){if(s)Ur(f);else for(var n=2;n<e.length;n++){var o=1===n?t:d[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(o)}if(l)return e[0].fromWireType(r)}return i(n(...c))}))}var ye,ge,Ee=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||re(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},_e=(r,e,t)=>{s.hasOwnProperty(r)?((void 0===t||void 0!==s[r].overloadTable&&void 0!==s[r].overloadTable[t])&&re(`Cannot register public name '${r}' twice`),Ee(s,r,r),s[r].overloadTable.hasOwnProperty(t)&&re(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),s[r].overloadTable[t]=e):(s[r]=e,s[r].argCount=t)},be=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(b[e+4*n>>2]);return t},ke=(r,e,t)=>{s.hasOwnProperty(r)||Gr("Replacing nonexistent public symbol"),void 0!==s[r].overloadTable&&void 0!==t?s[r].overloadTable[t]=e:(s[r]=e,s[r].argCount=t)},Fe=(r,e,t)=>(r=r.replace(/p/g,"i"),(0,s["dynCall_"+r])(e,...t)),Pe=[],Ae=r=>{var e=Pe[r];return e||(r>=Pe.length&&(Pe.length=r+1),Pe[r]=e=ye.get(r)),e},Se=(r,e,t=[])=>r.includes("j")?Fe(r,e,t):Ae(e)(...t),De=(r,e)=>(...t)=>Se(r,e,t),$e=(r,e)=>{function t(){return r.includes("j")?De(r,e):Ae(e)}r=Zr(r);var n=t();return"function"!=typeof n&&re(`unknown function pointer with signature ${r}: ${e}`),n},Ce=(r,e)=>{var t=pe(e,(function(r){this.name=e,this.message=r;var t=new Error(r).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},t},Te=r=>{var e=an(r),t=Zr(e);return ln(e),t},je=(r,e)=>{var t=[],n={};function o(r){n[r]||qr[r]||(Xr[r]?Xr[r].forEach(o):(t.push(r),n[r]=!0))}throw e.forEach(o),new ge(`${r}: `+t.map(Te).join([", "]))},Me=r=>{const e=(r=r.trim()).indexOf("(");return-1!==e?r.substr(0,e):r},xe=(r,e,t,n,o,a,i,s)=>{var l=be(e,t);r=Zr(r),r=Me(r),o=$e(n,o),_e(r,(function(){je(`Cannot call ${r} due to unbound types`,l)}),e-1),Kr([],l,(t=>{var n=[t[0],null].concat(t.slice(1));return ke(r,we(r,n,null,o,a),e-1),[]}))},Re=(r,e,t)=>{switch(e){case 1:return t?r=>w[r]:r=>y[r];case 2:return t?r=>g[r>>1]:r=>E[r>>1];case 4:return t?r=>_[r>>2]:r=>b[r>>2];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},Ne=(r,e,t,n,o)=>{e=Zr(e);var a=r=>r;if(0===n){var i=32-8*t;a=r=>r<<i>>>i}var s=e.includes("unsigned"),l=(r,e)=>{};te(r,{name:e,fromWireType:a,toWireType:s?function(r,e){return l(e,this.name),e>>>0}:function(r,e){return l(e,this.name),e},argPackAdvance:ne,readValueFromPointer:Re(e,t,0!==n),destructorFunction:null})},ze=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(r){var e=b[r>>2],t=b[r+4>>2];return new n(w.buffer,t,e)}te(r,{name:t=Zr(t),fromWireType:o,argPackAdvance:ne,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},We=(r,e,t)=>yr(r,y,e,t),Oe=(r,e)=>{var t="std::string"===(e=Zr(e));te(r,{name:e,fromWireType(r){var e,n=b[r>>2],o=r+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==y[s]){var l=Mr(a,s-a);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),a=s+1}}else{var u=new Array(n);for(i=0;i<n;++i)u[i]=String.fromCharCode(y[o+i]);e=u.join("")}return ln(r),e},toWireType(r,e){var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||re("Cannot pass non-string to std::string"),n=t&&o?wr(e):e.length;var a=sn(4+n+1),i=a+4;if(b[a>>2]=n,t&&o)We(e,i,n+1);else if(o)for(var s=0;s<n;++s){var l=e.charCodeAt(s);l>255&&(ln(i),re("String has UTF-16 code units that do not fit in 8 bits")),y[i+s]=l}else for(s=0;s<n;++s)y[i+s]=e[s];return null!==r&&r.push(ln,a),a},argPackAdvance:ne,readValueFromPointer:Br,destructorFunction(r){ln(r)}})},Ue="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Be=(r,e)=>{for(var t=r,n=t>>1,o=n+e/2;!(n>=o)&&E[n];)++n;if((t=n<<1)-r>32&&Ue)return Ue.decode(y.subarray(r,t));for(var a="",i=0;!(i>=e/2);++i){var s=g[r+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},Le=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,o=(t-=2)<2*r.length?t/2:r.length,a=0;a<o;++a){var i=r.charCodeAt(a);g[e>>1]=i,e+=2}return g[e>>1]=0,e-n},Ie=r=>2*r.length,He=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var o=_[r+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Ve=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,o=n+t-4,a=0;a<r.length;++a){var i=r.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),_[e>>2]=i,(e+=4)+4>o)break}return _[e>>2]=0,e-n},qe=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&++t,e+=4}return e},Xe=(r,e,t)=>{var n,o,a,i;t=Zr(t),2===e?(n=Be,o=Le,i=Ie,a=r=>E[r>>1]):4===e&&(n=He,o=Ve,i=qe,a=r=>b[r>>2]),te(r,{name:t,fromWireType:r=>{for(var t,o=b[r>>2],i=r+4,s=0;s<=o;++s){var l=r+4+s*e;if(s==o||0==a(l)){var u=n(i,l-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=l+e}}return ln(r),t},toWireType:(r,n)=>{"string"!=typeof n&&re(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=sn(4+a+e);return b[s>>2]=a/e,o(n,s+4,a+e),null!==r&&r.push(ln,s),s},argPackAdvance:ne,readValueFromPointer:Br,destructorFunction(r){ln(r)}})},Ge=(r,e,t,n,o,a)=>{Or[r]={name:Zr(e),rawConstructor:$e(t,n),rawDestructor:$e(o,a),fields:[]}},Ke=(r,e,t,n,o,a,i,s,l,u)=>{Or[r].fields.push({fieldName:Zr(e),getterReturnType:t,getter:$e(n,o),getterContext:a,setterArgumentType:i,setter:$e(s,l),setterContext:u})},Ye=(r,e)=>{te(r,{isVoid:!0,name:e=Zr(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},Je=r=>{do{var e=b[r>>2],t=b[(r+=4)>>2],n=b[(r+=4)>>2];r+=4;var o=Mr(e);jr.createPath("/",dr.dirname(o),!0,!0),jr.createDataFile(o,null,w.subarray(n,n+t),!0,!0,!0)}while(b[r>>2])},Qe=(r,e,t)=>y.copyWithin(r,e,e+t),Ze=()=>{throw 1/0},rt=(r,e)=>{var t=qr[r];return void 0===t&&re(`${e} has unknown type ${Te(r)}`),t},et=(r,e,t)=>{var n=[],o=r.toWireType(n,t);return n.length&&(b[e>>2]=de.toHandle(n)),o},tt=(r,e,t)=>(r=de.toValue(r),e=rt(e,"emval::as"),et(e,t,r)),nt={},ot=r=>{var e=nt[r];return void 0===e?Zr(r):e},at=[],it=(r,e,t,n,o)=>(r=at[r])(e=de.toValue(e),e[t=ot(t)],n,o),st=()=>{if("object"==typeof globalThis)return globalThis;function e(r){r.$$$embind_global$$$=r;var e="object"==typeof $$$embind_global$$$&&r.$$$embind_global$$$==r;return e||delete r.$$$embind_global$$$,e}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof r&&e(r)?$$$embind_global$$$=r:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},lt=r=>0===r?de.toHandle(st()):(r=ot(r),de.toHandle(st()[r])),ut=r=>{var e=at.length;return at.push(r),e},dt=(r,e)=>{for(var t=new Array(r),n=0;n<r;++n)t[n]=rt(b[e+4*n>>2],"parameter "+n);return t},ct=Reflect.construct,ft=(r,e,t)=>{var n=dt(r,e),o=n.shift();r--;var a=new Array(r),i=(e,i,s,l)=>{for(var u=0,d=0;d<r;++d)a[d]=n[d].readValueFromPointer(l+u),u+=n[d].argPackAdvance;var c=1===t?ct(i,a):i.apply(e,a);return et(o,s,c)},s=`methodCaller<(${n.map((r=>r.name)).join(", ")}) => ${o.name}>`;return ut(pe(s,i))},ht=(r,e)=>(r=de.toValue(r),e=de.toValue(e),de.toHandle(r[e])),mt=r=>{r>9&&(ie[r+1]+=1)},pt=()=>de.toHandle([]),vt=r=>de.toHandle(ot(r)),wt=r=>{var e=de.toValue(r);Ur(e),se(r)},yt=(r,e,t)=>{r=de.toValue(r),e=de.toValue(e),t=de.toValue(t),r[e]=t},gt=(r,e)=>{var t=(r=rt(r,"_emval_take_value")).readValueFromPointer(e);return de.toHandle(t)},Et=(r,e,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),u=Math.max(s,l);b[r>>2]=60*u,_[e>>2]=Number(s!=l);var d=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=d(s),f=d(l);l<s?(We(c,t,17),We(f,n,17)):(We(c,n,17),We(f,t,17))},_t=()=>2147483648,bt=r=>{var e=(r-v.buffer.byteLength+65535)/65536|0;try{return v.grow(e),S(),1}catch(t){}},kt=r=>{var e=y.length;r>>>=0;var t=_t();if(r>t)return!1;for(var n=1;n<=4;n*=2){var o=e*(1+.2/n);o=Math.min(o,r+100663296);var a=Math.min(t,br(Math.max(r,o),65536));if(bt(a))return!0}return!1},Ft={},Pt=()=>d||"./this.program",At=()=>{if(!At.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Pt()};for(var e in Ft)void 0===Ft[e]?delete r[e]:r[e]=Ft[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);At.strings=t}return At.strings},St=(r,e)=>{for(var t=0;t<r.length;++t)w[e++]=r.charCodeAt(t);w[e]=0},Dt=(r,e)=>{var t=0;return At().forEach(((n,o)=>{var a=e+t;b[r+4*o>>2]=a,St(n,a),t+=n.length+1})),0},$t=(r,e)=>{var t=At();b[r>>2]=t.length;var n=0;return t.forEach((r=>n+=r.length+1)),b[e>>2]=n,0},Ct=0,Tt=()=>nr||Ct>0,jt=r=>{Tt()||(s.onExit?.(r),A=!0),c(r,new er(r))},Mt=(r,e)=>{jt(r)};function xt(r){try{var e=xr.getStreamFromFD(r);return jr.close(e),0}catch(t){if(void 0===jr||"ErrnoError"!==t.name)throw t;return t.errno}}var Rt=(r,e,t,n)=>{for(var o=0,a=0;a<t;a++){var i=b[e>>2],s=b[e+4>>2];e+=8;var l=jr.read(r,w,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o};function Nt(r,e,t,n){try{var o=xr.getStreamFromFD(r),a=Rt(o,e,t);return b[n>>2]=a,0}catch(i){if(void 0===jr||"ErrnoError"!==i.name)throw i;return i.errno}}var zt=(r,e)=>e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN;function Wt(r,e,t,n,o){var a=zt(e,t);try{if(isNaN(a))return 61;var i=xr.getStreamFromFD(r);return jr.llseek(i,a,n),V=[i.position>>>0,(H=i.position,+Math.abs(H)>=1?H>0?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],_[o>>2]=V[0],_[o+4>>2]=V[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(s){if(void 0===jr||"ErrnoError"!==s.name)throw s;return s.errno}}var Ot=(r,e,t,n)=>{for(var o=0,a=0;a<t;a++){var i=b[e>>2],s=b[e+4>>2];e+=8;var l=jr.write(r,w,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o};function Ut(r,e,t,n){try{var o=xr.getStreamFromFD(r),a=Ot(o,e,t);return b[n>>2]=a,0}catch(i){if(void 0===jr||"ErrnoError"!==i.name)throw i;return i.errno}}var Bt,Lt=(r,e)=>{r<128?e.push(r):e.push(r%128|128,r>>7)},It=r=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==r[0]?[]:[e[r[0]]]},n=1;n<r.length;++n)t.parameters.push(e[r[n]]);return t},Ht=(r,e)=>{var t=r.slice(0,1),n=r.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96),Lt(n.length,e);for(var a=0;a<n.length;++a)e.push(o[n[a]]);"v"==t?e.push(0):e.push(1,o[t])},Vt=(r,e)=>{if("function"==typeof WebAssembly.Function)return new WebAssembly.Function(It(e),r);var t=[1];Ht(e,t);var n=[0,97,115,109,1,0,0,0,1];Lt(t.length,n),n.push(...t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(o,{e:{f:r}}).exports.f},qt=(r,e)=>{if(Bt)for(var t=r;t<r+e;t++){var n=Ae(t);n&&Bt.set(n,t)}},Xt=r=>(Bt||(Bt=new WeakMap,qt(0,ye.length)),Bt.get(r)||0),Gt=[],Kt=()=>{if(Gt.length)return Gt.pop();try{ye.grow(1)}catch(p){if(!(p instanceof RangeError))throw p;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return ye.length-1},Yt=(r,e)=>{ye.set(r,e),Pe[r]=ye.get(r)},Jt=(r,e)=>{var t=Xt(r);if(t)return t;var n=Kt();try{Yt(n,r)}catch(p){if(!(p instanceof TypeError))throw p;var o=Vt(r,e);Yt(n,o)}return Bt.set(r,n),n},Qt=jr.createPath,Zt=r=>jr.unlink(r),rn=jr.createLazyFile,en=jr.createDevice;jr.createPreloadedFile=$r,jr.staticInit(),s.FS_createPath=jr.createPath,s.FS_createDataFile=jr.createDataFile,s.FS_createPreloadedFile=jr.createPreloadedFile,s.FS_unlink=jr.unlink,s.FS_createLazyFile=jr.createLazyFile,s.FS_createDevice=jr.createDevice,Fr.doesNotExistError=new jr.ErrnoError(44),Fr.doesNotExistError.stack="<generic error, no stack>",Lr=s.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Qr(),Hr=s.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},ue(),ge=s.UnboundTypeError=Ce(Error,"UnboundTypeError");var tn,nn={i:sr,w:Rr,M:Nr,N:zr,P:Wr,V:Yr,F:Jr,T:oe,S:fe,y:me,q:xe,c:Ne,b:ze,x:Oe,p:Xe,W:Ge,k:Ke,U:Ye,R:Je,O:Qe,G:Ze,Y:tt,z:it,a:se,Z:lt,A:ft,m:ht,g:mt,B:pt,h:vt,r:wt,X:yt,l:gt,I:Et,H:kt,J:Dt,K:$t,Q:Mt,u:xt,L:Nt,E:Wt,v:Ut,n:fn,j:pn,o:wn,s:yn,D:En,t:vn,d:hn,C:_n,e:gn,f:mn},on=rr(),an=r=>(an=on.aa)(r),sn=s._malloc=r=>(sn=s._malloc=on.ca)(r),ln=s._free=r=>(ln=s._free=on.da)(r),un=(r,e)=>(un=on.ea)(r,e),dn=r=>(dn=on.fa)(r),cn=()=>(cn=on.ga)();function fn(r,e){var t=ar();try{return Ae(r)(e)}catch(n){if(or(t),n!==n+0)throw n;un(1,0)}}function hn(r,e){var t=ar();try{Ae(r)(e)}catch(n){if(or(t),n!==n+0)throw n;un(1,0)}}function mn(r,e,t,n){var o=ar();try{Ae(r)(e,t,n)}catch(a){if(or(o),a!==a+0)throw a;un(1,0)}}function pn(r,e,t){var n=ar();try{return Ae(r)(e,t)}catch(o){if(or(n),o!==o+0)throw o;un(1,0)}}function vn(r){var e=ar();try{Ae(r)()}catch(t){if(or(e),t!==t+0)throw t;un(1,0)}}function wn(r,e,t,n){var o=ar();try{return Ae(r)(e,t,n)}catch(a){if(or(o),a!==a+0)throw a;un(1,0)}}function yn(r,e,t,n,o){var a=ar();try{return Ae(r)(e,t,n,o)}catch(i){if(or(a),i!==i+0)throw i;un(1,0)}}function gn(r,e,t){var n=ar();try{Ae(r)(e,t)}catch(o){if(or(n),o!==o+0)throw o;un(1,0)}}function En(r,e,t,n,o,a,i,s,l,u){var d=ar();try{return Ae(r)(e,t,n,o,a,i,s,l,u)}catch(c){if(or(d),c!==c+0)throw c;un(1,0)}}function _n(r,e,t,n){var o=ar();try{Ae(r)(e,t,n)}catch(a){if(or(o),a!==a+0)throw a;un(1,0)}}function bn(){function r(){tn||(tn=!0,s.calledRun=!0,A||(j(),t(s),s.onRuntimeInitialized?.(),M()))}z>0||(T(),z>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>s.setStatus("")),1),r()}),1)):r()))}if(s.dynCall_viji=(r,e,t,n,o)=>(s.dynCall_viji=on.ha)(r,e,t,n,o),s.dynCall_ji=(r,e)=>(s.dynCall_ji=on.ia)(r,e),s.dynCall_jiji=(r,e,t,n,o)=>(s.dynCall_jiji=on.ja)(r,e,t,n,o),s.dynCall_viijii=(r,e,t,n,o,a,i)=>(s.dynCall_viijii=on.ka)(r,e,t,n,o,a,i),s.dynCall_iiiiij=(r,e,t,n,o,a,i)=>(s.dynCall_iiiiij=on.la)(r,e,t,n,o,a,i),s.dynCall_iiiiijj=(r,e,t,n,o,a,i,l,u)=>(s.dynCall_iiiiijj=on.ma)(r,e,t,n,o,a,i,l,u),s.dynCall_iiiiiijj=(r,e,t,n,o,a,i,l,u,d)=>(s.dynCall_iiiiiijj=on.na)(r,e,t,n,o,a,i,l,u,d),s.___emscripten_embedded_file_data=1536624,s.addRunDependency=U,s.removeRunDependency=B,s.addFunction=Jt,s.UTF8ToString=Mr,s.FS_createPreloadedFile=$r,s.FS_unlink=Zt,s.FS_createPath=Qt,s.FS_createDevice=en,s.FS_createDataFile=Ar,s.FS_createLazyFile=rn,W=function r(){tn||bn(),tn||(W=r)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return bn(),l},e.exports=a),n.exports;var e,o,a}const a=e(o()),i=Object.freeze(Object.defineProperty({__proto__:null,default:a},Symbol.toStringTag,{value:"Module"}));export{i as l};
|
|
5
|
+
import{c as r,g as e}from"./_commonjsHelpers.js";var t,n={exports:{}};function o(){return t||(t=1,e=n,o="undefined"!=typeof document?document.currentScript?.src:void 0,a=async function(e={}){var t,n,a,i,s=e,l=new Promise(((r,e)=>{t=r,n=e})),u="./this.program",d=(r,e)=>{throw e},c="";function f(r){return s.locateFile?s.locateFile(r,c):c+r}"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),o&&(c=o),c=c.startsWith("blob:")?"":c.slice(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1),a=async r=>{var e=await fetch(r,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)};var m,h,p,v,w,y,g,E,_,b,k,F,A=console.log.bind(console),P=console.error.bind(console),S=!1;function D(){var r=h.buffer;p=new Int8Array(r),w=new Int16Array(r),s.HEAPU8=v=new Uint8Array(r),y=new Uint16Array(r),g=new Int32Array(r),s.HEAPU32=E=new Uint32Array(r),_=new Float32Array(r),s.HEAPF64=F=new Float64Array(r),b=new BigInt64Array(r),k=new BigUint64Array(r)}function $(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)K(s.preRun.shift());q(Y)}function T(){s.noFSInit||Ar.initialized||Ar.init(),Gt._(),Ar.ignorePermissions=!1}function C(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)G(s.postRun.shift());q(X)}var x,M=0,N=null;function j(r){M++,s.monitorRunDependencies?.(M)}function R(r){if(M--,s.monitorRunDependencies?.(M),0==M&&N){var e=N;N=null,e()}}function B(r){s.onAbort?.(r),P(r="Aborted("+r+")"),S=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}function O(){return f("lyr3DWorker.wasm")}function z(r){if(r==x&&m)return new Uint8Array(m);throw"both async and sync fetching of the wasm failed"}async function W(r){if(!m)try{var e=await a(r);return new Uint8Array(e)}catch{}return z(r)}async function I(r,e){try{var t=await W(r);return await WebAssembly.instantiate(t,e)}catch(n){P(`failed to asynchronously prepare wasm: ${n}`),B(n)}}async function L(r,e,t){if(!r&&"function"==typeof WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(o){P(`wasm streaming compile failed: ${o}`),P("falling back to ArrayBuffer instantiation")}return I(e,t)}function U(){return{a:Xt}}async function V(){function r(r,e){return Gt=r.exports,h=Gt.Z,D(),me=Gt.aa,R(),Gt}function e(e){return r(e.instance)}j();var t=U();if(s.instantiateWasm)return new Promise(((e,n)=>{s.instantiateWasm(t,((t,n)=>{e(r(t))}))}));x??=O();try{return e(await L(m,x,t))}catch(o){return n(o),Promise.reject(o)}}class H{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var q=r=>{for(;r.length>0;)r.shift()(s)},X=[],G=r=>X.push(r),Y=[],K=r=>Y.push(r),J=!0,Q=r=>Zt(r),Z=()=>rn();class rr{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){E[this.ptr+4>>2]=r}get_type(){return E[this.ptr+4>>2]}set_destructor(r){E[this.ptr+8>>2]=r}get_destructor(){return E[this.ptr+8>>2]}set_caught(r){r=r?1:0,p[this.ptr+12]=r}get_caught(){return 0!=p[this.ptr+12]}set_rethrown(r){r=r?1:0,p[this.ptr+13]=r}get_rethrown(){return 0!=p[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){E[this.ptr+16>>2]=r}get_adjusted_ptr(){return E[this.ptr+16>>2]}}var er=(r,e,t)=>{throw new rr(r).init(e,t),r},tr=()=>{var r=g[+Sr.varargs>>2];return Sr.varargs+=4,r},nr=tr,or={isAbs:r=>"/"===r.charAt(0),splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=or.isAbs(r),t="/"===r.slice(-1);return(r=or.normalizeArray(r.split("/").filter((r=>!!r)),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=or.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.slice(0,-1)),t+n):"."},basename:r=>r&&r.match(/([^\/]+|\/)\/*$/)[1],join:(...r)=>or.normalize(r.join("/")),join2:(r,e)=>or.normalize(r+"/"+e)},ar=()=>r=>crypto.getRandomValues(r),ir=r=>{(ir=ar())(r)},sr={resolve:(...r)=>{for(var e="",t=!1,n=r.length-1;n>=-1&&!t;n--){var o=n>=0?r[n]:Ar.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,t=or.isAbs(o)}return(t?"/":"")+(e=or.normalizeArray(e.split("/").filter((r=>!!r)),!t).join("/"))||"."},relative:(r,e)=>{function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=sr.resolve(r).slice(1),e=sr.resolve(e).slice(1);for(var n=t(r.split("/")),o=t(e.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},lr="undefined"!=typeof TextDecoder?new TextDecoder:void 0,ur=(r,e=0,t=NaN)=>{for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.buffer&&lr)return lr.decode(r.subarray(e,o));for(var a="";e<o;){var i=r[e++];if(128&i){var s=63&r[e++];if(192!=(224&i)){var l=63&r[e++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&r[e++])<65536)a+=String.fromCharCode(i);else{var u=i-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},dr=[],cr=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},fr=(r,e,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i)),s<=127){if(t>=a)break;e[t++]=s}else if(s<=2047){if(t+1>=a)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=a)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o},mr=(r,e,t)=>{var n=cr(r)+1,o=new Array(n),a=fr(r,o,0,o.length);return o.length=a,o},hr=()=>{if(!dr.length){var r=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(r=window.prompt("Input: "))&&(r+="\n"),!r)return null;dr=mr(r)}return dr.shift()},pr={ttys:[],init(){},shutdown(){},register(r,e){pr.ttys[r]={input:[],output:[],ops:e},Ar.registerDevice(r,pr.stream_ops)},stream_ops:{open(r){var e=pr.ttys[r.node.rdev];if(!e)throw new Ar.ErrnoError(43);r.tty=e,r.seekable=!1},close(r){r.tty.ops.fsync(r.tty)},fsync(r){r.tty.ops.fsync(r.tty)},read(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new Ar.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(l){throw new Ar.ErrnoError(29)}if(void 0===s&&0===a)throw new Ar.ErrnoError(6);if(null==s)break;a++,e[t+i]=s}return a&&(r.node.atime=Date.now()),a},write(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new Ar.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,e[t+a])}catch(i){throw new Ar.ErrnoError(29)}return n&&(r.node.mtime=r.node.ctime=Date.now()),a}},default_tty_ops:{get_char:r=>hr(),put_char(r,e){null===e||10===e?(A(ur(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output?.length>0&&(A(ur(r.output)),r.output=[])},ioctl_tcgets:r=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(r,e,t)=>0,ioctl_tiocgwinsz:r=>[24,80]},default_tty1_ops:{put_char(r,e){null===e||10===e?(P(ur(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output?.length>0&&(P(ur(r.output)),r.output=[])}}},vr=r=>{B()},wr={ops_table:null,mount:r=>wr.createNode(null,"/",16895,0),createNode(r,e,t,n){if(Ar.isBlkdev(t)||Ar.isFIFO(t))throw new Ar.ErrnoError(63);wr.ops_table||={dir:{node:{getattr:wr.node_ops.getattr,setattr:wr.node_ops.setattr,lookup:wr.node_ops.lookup,mknod:wr.node_ops.mknod,rename:wr.node_ops.rename,unlink:wr.node_ops.unlink,rmdir:wr.node_ops.rmdir,readdir:wr.node_ops.readdir,symlink:wr.node_ops.symlink},stream:{llseek:wr.stream_ops.llseek}},file:{node:{getattr:wr.node_ops.getattr,setattr:wr.node_ops.setattr},stream:{llseek:wr.stream_ops.llseek,read:wr.stream_ops.read,write:wr.stream_ops.write,mmap:wr.stream_ops.mmap,msync:wr.stream_ops.msync}},link:{node:{getattr:wr.node_ops.getattr,setattr:wr.node_ops.setattr,readlink:wr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:wr.node_ops.getattr,setattr:wr.node_ops.setattr},stream:Ar.chrdev_stream_ops}};var o=Ar.createNode(r,e,t,n);return Ar.isDir(o.mode)?(o.node_ops=wr.ops_table.dir.node,o.stream_ops=wr.ops_table.dir.stream,o.contents={}):Ar.isFile(o.mode)?(o.node_ops=wr.ops_table.file.node,o.stream_ops=wr.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ar.isLink(o.mode)?(o.node_ops=wr.ops_table.link.node,o.stream_ops=wr.ops_table.link.stream):Ar.isChrdev(o.mode)&&(o.node_ops=wr.ops_table.chrdev.node,o.stream_ops=wr.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),r&&(r.contents[e]=o,r.atime=r.mtime=r.ctime=o.atime),o},getFileDataAsTypedArray:r=>r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0),expandFileStorage(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){var n=1048576;e=Math.max(e,t*(t<n?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var o=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(o.subarray(0,r.usedBytes),0)}},resizeFileStorage(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr(r){var e={};return e.dev=Ar.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,Ar.isDir(r.mode)?e.size=4096:Ar.isFile(r.mode)?e.size=r.usedBytes:Ar.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.atime),e.mtime=new Date(r.mtime),e.ctime=new Date(r.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(r,e){for(const t of["mode","atime","mtime","ctime"])null!=e[t]&&(r[t]=e[t]);void 0!==e.size&&wr.resizeFileStorage(r,e.size)},lookup(r,e){throw wr.doesNotExistError},mknod:(r,e,t,n)=>wr.createNode(r,e,t,n),rename(r,e,t){var n;try{n=Ar.lookupNode(e,t)}catch(a){}if(n){if(Ar.isDir(r.mode))for(var o in n.contents)throw new Ar.ErrnoError(55);Ar.hashRemoveNode(n)}delete r.parent.contents[r.name],e.contents[t]=r,r.name=t,e.ctime=e.mtime=r.parent.ctime=r.parent.mtime=Date.now()},unlink(r,e){delete r.contents[e],r.ctime=r.mtime=Date.now()},rmdir(r,e){var t=Ar.lookupNode(r,e);for(var n in t.contents)throw new Ar.ErrnoError(55);delete r.contents[e],r.ctime=r.mtime=Date.now()},readdir:r=>[".","..",...Object.keys(r.contents)],symlink(r,e,t){var n=wr.createNode(r,e,41471,0);return n.link=t,n},readlink(r){if(!Ar.isLink(r.mode))throw new Ar.ErrnoError(28);return r.link}},stream_ops:{read(r,e,t,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)e.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)e[t+s]=a[o+s];return i},write(r,e,t,n,o,a){if(e.buffer===p.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.mtime=i.ctime=Date.now(),e.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=e.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=e.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(e.subarray(t,t+n),o),n}if(wr.expandFileStorage(i,o+n),i.contents.subarray&&e.subarray)i.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=e[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&Ar.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new Ar.ErrnoError(28);return n},mmap(r,e,t,n,o){if(!Ar.isFile(r.node.mode))throw new Ar.ErrnoError(43);var a,i,s=r.node.contents;if(2&o||!s||s.buffer!==p.buffer){if(i=!0,!(a=vr()))throw new Ar.ErrnoError(48);s&&((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),p.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(r,e,t,n,o)=>(wr.stream_ops.write(r,e,0,n,t,!1),0)}},yr=async r=>{var e=await a(r);return new Uint8Array(e)},gr=(r,e,t,n,o,a)=>{Ar.createDataFile(r,e,t,n,o,a)},Er=[],_r=(r,e,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return Er.forEach((a=>{o||a.canHandle(e)&&(a.handle(r,e,t,n),o=!0)})),o},br=(r,e,t,n,o,a,i,s,l,u)=>{var d=e?sr.resolve(or.join2(r,e)):r;function c(t){function c(t){u?.(),s||gr(r,e,t,n,o,l),a?.(),R()}_r(t,d,c,(()=>{i?.(),R()}))||c(t)}j(),"string"==typeof t?yr(t).then(c,i):c(t)},kr=r=>{var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[r];if(void 0===e)throw new Error(`Unknown file open mode: ${r}`);return e},Fr=(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},Ar={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class{name="ErrnoError";constructor(r){this.errno=r}},FSStream:class{shared={};get object(){return this.node}set object(r){this.node=r}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(r){this.shared.flags=r}get position(){return this.shared.position}set position(r){this.shared.position=r}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.id=Ar.nextInode++,this.name=e,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(r){r?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(r){r?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return Ar.isDir(this.mode)}get isDevice(){return Ar.isChrdev(this.mode)}},lookupPath(r,e={}){if(!r)throw new Ar.ErrnoError(44);e.follow_mount??=!0,or.isAbs(r)||(r=Ar.cwd()+"/"+r);r:for(var t=0;t<40;t++){for(var n=r.split("/").filter((r=>!!r)),o=Ar.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&e.parent)break;if("."!==n[i])if(".."!==n[i]){a=or.join2(a,n[i]);try{o=Ar.lookupNode(o,n[i])}catch(u){if(44===u?.errno&&s&&e.noent_okay)return{path:a};throw u}if(!Ar.isMountpoint(o)||s&&!e.follow_mount||(o=o.mounted.root),Ar.isLink(o.mode)&&(!s||e.follow)){if(!o.node_ops.readlink)throw new Ar.ErrnoError(52);var l=o.node_ops.readlink(o);or.isAbs(l)||(l=or.dirname(a)+"/"+l),r=l+"/"+n.slice(i+1).join("/");continue r}}else{if(a=or.dirname(a),Ar.isRoot(o)){r=a+"/"+n.slice(i+1).join("/");continue r}o=o.parent}}return{path:a,node:o}}throw new Ar.ErrnoError(32)},getPath(r){for(var e;;){if(Ar.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t}e=e?`${r.name}/${e}`:r.name,r=r.parent}},hashName(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%Ar.nameTable.length},hashAddNode(r){var e=Ar.hashName(r.parent.id,r.name);r.name_next=Ar.nameTable[e],Ar.nameTable[e]=r},hashRemoveNode(r){var e=Ar.hashName(r.parent.id,r.name);if(Ar.nameTable[e]===r)Ar.nameTable[e]=r.name_next;else for(var t=Ar.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode(r,e){var t=Ar.mayLookup(r);if(t)throw new Ar.ErrnoError(t);for(var n=Ar.hashName(r.id,e),o=Ar.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===e)return o}return Ar.lookup(r,e)},createNode(r,e,t,n){var o=new Ar.FSNode(r,e,t,n);return Ar.hashAddNode(o),o},destroyNode(r){Ar.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>!(49152&~r),flagsToPermissionString(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>Ar.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup(r){if(!Ar.isDir(r.mode))return 54;var e=Ar.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate(r,e){if(!Ar.isDir(r.mode))return 54;try{return Ar.lookupNode(r,e),20}catch(t){}return Ar.nodePermissions(r,"wx")},mayDelete(r,e,t){var n;try{n=Ar.lookupNode(r,e)}catch(a){return a.errno}var o=Ar.nodePermissions(r,"wx");if(o)return o;if(t){if(!Ar.isDir(n.mode))return 54;if(Ar.isRoot(n)||Ar.getPath(n)===Ar.cwd())return 10}else if(Ar.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?Ar.isLink(r.mode)?32:Ar.isDir(r.mode)&&("r"!==Ar.flagsToPermissionString(e)||576&e)?31:Ar.nodePermissions(r,Ar.flagsToPermissionString(e)):44,checkOpExists(r,e){if(!r)throw new Ar.ErrnoError(e);return r},MAX_OPEN_FDS:4096,nextfd(){for(var r=0;r<=Ar.MAX_OPEN_FDS;r++)if(!Ar.streams[r])return r;throw new Ar.ErrnoError(33)},getStreamChecked(r){var e=Ar.getStream(r);if(!e)throw new Ar.ErrnoError(8);return e},getStream:r=>Ar.streams[r],createStream:(r,e=-1)=>(r=Object.assign(new Ar.FSStream,r),-1==e&&(e=Ar.nextfd()),r.fd=e,Ar.streams[e]=r,r),closeStream(r){Ar.streams[r]=null},dupStream(r,e=-1){var t=Ar.createStream(r,e);return t.stream_ops?.dup?.(t),t},doSetAttr(r,e,t){var n=r?.stream_ops.setattr,o=n?r:e;n??=e.node_ops.setattr,Ar.checkOpExists(n,63),n(o,t)},chrdev_stream_ops:{open(r){var e=Ar.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open?.(r)},llseek(){throw new Ar.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice(r,e){Ar.devices[r]={stream_ops:e}},getDevice:r=>Ar.devices[r],getMounts(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push(...n.mounts)}return e},syncfs(r,e){"function"==typeof r&&(e=r,r=!1),Ar.syncFSRequests++,Ar.syncFSRequests>1&&P(`warning: ${Ar.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=Ar.getMounts(Ar.root.mount),n=0;function o(r){return Ar.syncFSRequests--,e(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)}))},mount(r,e,t){var n,o="/"===t,a=!t;if(o&&Ar.root)throw new Ar.ErrnoError(10);if(!o&&!a){var i=Ar.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,Ar.isMountpoint(n))throw new Ar.ErrnoError(10);if(!Ar.isDir(n.mode))throw new Ar.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},l=r.mount(s);return l.mount=s,s.root=l,o?Ar.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(r){var e=Ar.lookupPath(r,{follow_mount:!1});if(!Ar.isMountpoint(e.node))throw new Ar.ErrnoError(28);var t=e.node,n=t.mounted,o=Ar.getMounts(n);Object.keys(Ar.nameTable).forEach((r=>{for(var e=Ar.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&Ar.destroyNode(e),e=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod(r,e,t){var n=Ar.lookupPath(r,{parent:!0}).node,o=or.basename(r);if(!o)throw new Ar.ErrnoError(28);if("."===o||".."===o)throw new Ar.ErrnoError(20);var a=Ar.mayCreate(n,o);if(a)throw new Ar.ErrnoError(a);if(!n.node_ops.mknod)throw new Ar.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},statfs:r=>Ar.statfsNode(Ar.lookupPath(r,{follow:!0}).node),statfsStream:r=>Ar.statfsNode(r.node),statfsNode(r){var e={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:Ar.nextInode,ffree:Ar.nextInode-1,fsid:42,flags:2,namelen:255};return r.node_ops.statfs&&Object.assign(e,r.node_ops.statfs(r.mount.opts.root)),e},create:(r,e=438)=>(e&=4095,e|=32768,Ar.mknod(r,e,0)),mkdir:(r,e=511)=>(e&=1023,e|=16384,Ar.mknod(r,e,0)),mkdirTree(r,e){var t=r.split("/"),n="";for(var o of t)if(o){(n||or.isAbs(r))&&(n+="/"),n+=o;try{Ar.mkdir(n,e)}catch(a){if(20!=a.errno)throw a}}},mkdev:(r,e,t)=>(void 0===t&&(t=e,e=438),e|=8192,Ar.mknod(r,e,t)),symlink(r,e){if(!sr.resolve(r))throw new Ar.ErrnoError(44);var t=Ar.lookupPath(e,{parent:!0}).node;if(!t)throw new Ar.ErrnoError(44);var n=or.basename(e),o=Ar.mayCreate(t,n);if(o)throw new Ar.ErrnoError(o);if(!t.node_ops.symlink)throw new Ar.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename(r,e){var t,n,o=or.dirname(r),a=or.dirname(e),i=or.basename(r),s=or.basename(e);if(t=Ar.lookupPath(r,{parent:!0}).node,n=Ar.lookupPath(e,{parent:!0}).node,!t||!n)throw new Ar.ErrnoError(44);if(t.mount!==n.mount)throw new Ar.ErrnoError(75);var l,u=Ar.lookupNode(t,i),d=sr.relative(r,a);if("."!==d.charAt(0))throw new Ar.ErrnoError(28);if("."!==(d=sr.relative(e,o)).charAt(0))throw new Ar.ErrnoError(55);try{l=Ar.lookupNode(n,s)}catch(m){}if(u!==l){var c=Ar.isDir(u.mode),f=Ar.mayDelete(t,i,c);if(f)throw new Ar.ErrnoError(f);if(f=l?Ar.mayDelete(n,s,c):Ar.mayCreate(n,s))throw new Ar.ErrnoError(f);if(!t.node_ops.rename)throw new Ar.ErrnoError(63);if(Ar.isMountpoint(u)||l&&Ar.isMountpoint(l))throw new Ar.ErrnoError(10);if(n!==t&&(f=Ar.nodePermissions(t,"w")))throw new Ar.ErrnoError(f);Ar.hashRemoveNode(u);try{t.node_ops.rename(u,n,s),u.parent=n}catch(m){throw m}finally{Ar.hashAddNode(u)}}},rmdir(r){var e=Ar.lookupPath(r,{parent:!0}).node,t=or.basename(r),n=Ar.lookupNode(e,t),o=Ar.mayDelete(e,t,!0);if(o)throw new Ar.ErrnoError(o);if(!e.node_ops.rmdir)throw new Ar.ErrnoError(63);if(Ar.isMountpoint(n))throw new Ar.ErrnoError(10);e.node_ops.rmdir(e,t),Ar.destroyNode(n)},readdir(r){var e=Ar.lookupPath(r,{follow:!0}).node;return Ar.checkOpExists(e.node_ops.readdir,54)(e)},unlink(r){var e=Ar.lookupPath(r,{parent:!0}).node;if(!e)throw new Ar.ErrnoError(44);var t=or.basename(r),n=Ar.lookupNode(e,t),o=Ar.mayDelete(e,t,!1);if(o)throw new Ar.ErrnoError(o);if(!e.node_ops.unlink)throw new Ar.ErrnoError(63);if(Ar.isMountpoint(n))throw new Ar.ErrnoError(10);e.node_ops.unlink(e,t),Ar.destroyNode(n)},readlink(r){var e=Ar.lookupPath(r).node;if(!e)throw new Ar.ErrnoError(44);if(!e.node_ops.readlink)throw new Ar.ErrnoError(28);return e.node_ops.readlink(e)},stat(r,e){var t=Ar.lookupPath(r,{follow:!e}).node;return Ar.checkOpExists(t.node_ops.getattr,63)(t)},fstat(r){var e=Ar.getStreamChecked(r),t=e.node,n=e.stream_ops.getattr,o=n?e:t;return n??=t.node_ops.getattr,Ar.checkOpExists(n,63),n(o)},lstat:r=>Ar.stat(r,!0),doChmod(r,e,t,n){Ar.doSetAttr(r,e,{mode:4095&t|-4096&e.mode,ctime:Date.now(),dontFollow:n})},chmod(r,e,t){var n;n="string"==typeof r?Ar.lookupPath(r,{follow:!t}).node:r,Ar.doChmod(null,n,e,t)},lchmod(r,e){Ar.chmod(r,e,!0)},fchmod(r,e){var t=Ar.getStreamChecked(r);Ar.doChmod(t,t.node,e,!1)},doChown(r,e,t){Ar.doSetAttr(r,e,{timestamp:Date.now(),dontFollow:t})},chown(r,e,t,n){var o;o="string"==typeof r?Ar.lookupPath(r,{follow:!n}).node:r,Ar.doChown(null,o,n)},lchown(r,e,t){Ar.chown(r,e,t,!0)},fchown(r,e,t){var n=Ar.getStreamChecked(r);Ar.doChown(n,n.node,!1)},doTruncate(r,e,t){if(Ar.isDir(e.mode))throw new Ar.ErrnoError(31);if(!Ar.isFile(e.mode))throw new Ar.ErrnoError(28);var n=Ar.nodePermissions(e,"w");if(n)throw new Ar.ErrnoError(n);Ar.doSetAttr(r,e,{size:t,timestamp:Date.now()})},truncate(r,e){if(e<0)throw new Ar.ErrnoError(28);var t;t="string"==typeof r?Ar.lookupPath(r,{follow:!0}).node:r,Ar.doTruncate(null,t,e)},ftruncate(r,e){var t=Ar.getStreamChecked(r);if(e<0||!(2097155&t.flags))throw new Ar.ErrnoError(28);Ar.doTruncate(t,t.node,e)},utime(r,e,t){var n=Ar.lookupPath(r,{follow:!0}).node;Ar.checkOpExists(n.node_ops.setattr,63)(n,{atime:e,mtime:t})},open(r,e,t=438){if(""===r)throw new Ar.ErrnoError(44);var n,o;if(t=64&(e="string"==typeof e?kr(e):e)?4095&t|32768:0,"object"==typeof r)n=r;else{o=r.endsWith("/");var a=Ar.lookupPath(r,{follow:!(131072&e),noent_okay:!0});n=a.node,r=a.path}var i=!1;if(64&e)if(n){if(128&e)throw new Ar.ErrnoError(20)}else{if(o)throw new Ar.ErrnoError(31);n=Ar.mknod(r,511|t,0),i=!0}if(!n)throw new Ar.ErrnoError(44);if(Ar.isChrdev(n.mode)&&(e&=-513),65536&e&&!Ar.isDir(n.mode))throw new Ar.ErrnoError(54);if(!i){var l=Ar.mayOpen(n,e);if(l)throw new Ar.ErrnoError(l)}512&e&&!i&&Ar.truncate(n,0),e&=-131713;var u=Ar.createStream({node:n,path:Ar.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),i&&Ar.chmod(n,511&t),!s.logReadFiles||1&e||r in Ar.readFiles||(Ar.readFiles[r]=1),u},close(r){if(Ar.isClosed(r))throw new Ar.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{Ar.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek(r,e,t){if(Ar.isClosed(r))throw new Ar.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Ar.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Ar.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read(r,e,t,n,o){if(n<0||o<0)throw new Ar.ErrnoError(28);if(Ar.isClosed(r))throw new Ar.ErrnoError(8);if(1==(2097155&r.flags))throw new Ar.ErrnoError(8);if(Ar.isDir(r.node.mode))throw new Ar.ErrnoError(31);if(!r.stream_ops.read)throw new Ar.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new Ar.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,e,t,n,o);return a||(r.position+=i),i},write(r,e,t,n,o,a){if(n<0||o<0)throw new Ar.ErrnoError(28);if(Ar.isClosed(r))throw new Ar.ErrnoError(8);if(!(2097155&r.flags))throw new Ar.ErrnoError(8);if(Ar.isDir(r.node.mode))throw new Ar.ErrnoError(31);if(!r.stream_ops.write)throw new Ar.ErrnoError(28);r.seekable&&1024&r.flags&&Ar.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new Ar.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,a);return i||(r.position+=s),s},mmap(r,e,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&r.flags))throw new Ar.ErrnoError(2);if(1==(2097155&r.flags))throw new Ar.ErrnoError(2);if(!r.stream_ops.mmap)throw new Ar.ErrnoError(43);if(!e)throw new Ar.ErrnoError(28);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,ioctl(r,e,t){if(!r.stream_ops.ioctl)throw new Ar.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile(r,e={}){if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(`Invalid encoding type "${e.encoding}"`);var t,n=Ar.open(r,e.flags),o=Ar.stat(r).size,a=new Uint8Array(o);return Ar.read(n,a,0,o,0),"utf8"===e.encoding?t=ur(a):"binary"===e.encoding&&(t=a),Ar.close(n),t},writeFile(r,e,t={}){t.flags=t.flags||577;var n=Ar.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(cr(e)+1),a=fr(e,o,0,o.length);Ar.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Ar.write(n,e,0,e.byteLength,void 0,t.canOwn)}Ar.close(n)},cwd:()=>Ar.currentPath,chdir(r){var e=Ar.lookupPath(r,{follow:!0});if(null===e.node)throw new Ar.ErrnoError(44);if(!Ar.isDir(e.node.mode))throw new Ar.ErrnoError(54);var t=Ar.nodePermissions(e.node,"x");if(t)throw new Ar.ErrnoError(t);Ar.currentPath=e.path},createDefaultDirectories(){Ar.mkdir("/tmp"),Ar.mkdir("/home"),Ar.mkdir("/home/web_user")},createDefaultDevices(){Ar.mkdir("/dev"),Ar.registerDevice(Ar.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n,llseek:()=>0}),Ar.mkdev("/dev/null",Ar.makedev(1,3)),pr.register(Ar.makedev(5,0),pr.default_tty_ops),pr.register(Ar.makedev(6,0),pr.default_tty1_ops),Ar.mkdev("/dev/tty",Ar.makedev(5,0)),Ar.mkdev("/dev/tty1",Ar.makedev(6,0));var r=new Uint8Array(1024),e=0,t=()=>(0===e&&(ir(r),e=r.byteLength),r[--e]);Ar.createDevice("/dev","random",t),Ar.createDevice("/dev","urandom",t),Ar.mkdir("/dev/shm"),Ar.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ar.mkdir("/proc");var r=Ar.mkdir("/proc/self");Ar.mkdir("/proc/self/fd"),Ar.mount({mount(){var e=Ar.createNode(r,"fd",16895,73);return e.stream_ops={llseek:wr.stream_ops.llseek},e.node_ops={lookup(r,e){var t=+e,n=Ar.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path},id:t+1};return o.parent=o,o},readdir:()=>Array.from(Ar.streams.entries()).filter((([r,e])=>e)).map((([r,e])=>r.toString()))},e}},{},"/proc/self/fd")},createStandardStreams(r,e,t){r?Ar.createDevice("/dev","stdin",r):Ar.symlink("/dev/tty","/dev/stdin"),e?Ar.createDevice("/dev","stdout",null,e):Ar.symlink("/dev/tty","/dev/stdout"),t?Ar.createDevice("/dev","stderr",null,t):Ar.symlink("/dev/tty1","/dev/stderr"),Ar.open("/dev/stdin",0),Ar.open("/dev/stdout",1),Ar.open("/dev/stderr",1)},staticInit(){Ar.nameTable=new Array(4096),Ar.mount(wr,{},"/"),Ar.createDefaultDirectories(),Ar.createDefaultDevices(),Ar.createSpecialDirectories(),Ar.filesystems={MEMFS:wr}},init(r,e,t){Ar.initialized=!0,r??=s.stdin,e??=s.stdout,t??=s.stderr,Ar.createStandardStreams(r,e,t)},quit(){for(var r of(Ar.initialized=!1,Ar.streams))r&&Ar.close(r)},findObject(r,e){var t=Ar.analyzePath(r,e);return t.exists?t.object:null},analyzePath(r,e){try{r=(n=Ar.lookupPath(r,{follow:!e})).path}catch(o){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Ar.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=or.basename(r),n=Ar.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(o){t.error=o.errno}return t},createPath(r,e,t,n){r="string"==typeof r?r:Ar.getPath(r);for(var o=e.split("/").reverse();o.length;){var a=o.pop();if(a){var i=or.join2(r,a);try{Ar.mkdir(i)}catch(s){if(20!=s.errno)throw s}r=i}}return i},createFile(r,e,t,n,o){var a=or.join2("string"==typeof r?r:Ar.getPath(r),e),i=Fr(n,o);return Ar.create(a,i)},createDataFile(r,e,t,n,o,a){var i=e;r&&(r="string"==typeof r?r:Ar.getPath(r),i=e?or.join2(r,e):r);var s=Fr(n,o),l=Ar.create(i,s);if(t){if("string"==typeof t){for(var u=new Array(t.length),d=0,c=t.length;d<c;++d)u[d]=t.charCodeAt(d);t=u}Ar.chmod(l,146|s);var f=Ar.open(l,577);Ar.write(f,t,0,t.length,0,a),Ar.close(f),Ar.chmod(l,s)}},createDevice(r,e,t,n){var o=or.join2("string"==typeof r?r:Ar.getPath(r),e),a=Fr(!!t,!!n);Ar.createDevice.major??=64;var i=Ar.makedev(Ar.createDevice.major++,0);return Ar.registerDevice(i,{open(r){r.seekable=!1},close(r){n?.buffer?.length&&n(10)},read(r,e,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(u){throw new Ar.ErrnoError(29)}if(void 0===l&&0===i)throw new Ar.ErrnoError(6);if(null==l)break;i++,e[n+s]=l}return i&&(r.node.atime=Date.now()),i},write(r,e,t,o,a){for(var i=0;i<o;i++)try{n(e[t+i])}catch(s){throw new Ar.ErrnoError(29)}return o&&(r.node.mtime=r.node.ctime=Date.now()),i}}),Ar.mkdev(o,a,i)},forceLoadFile(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{r.contents=i(r.url),r.usedBytes=r.contents.length}catch(e){throw new Ar.ErrnoError(29)}},createLazyFile(r,e,t,n,o){if("undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},i=Ar.createFile(r,e,a,n,o);a.contents?i.contents=a.contents:a.url&&(i.contents=null,i.url=a.url),Object.defineProperties(i,{usedBytes:{get:function(){return this.contents.length}}});var s={};function l(r,e,t,n,o){var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)e[t+s]=a[o+s];else for(s=0;s<i;s++)e[t+s]=a.get(o+s);return i}return Object.keys(i.stream_ops).forEach((r=>{var e=i.stream_ops[r];s[r]=(...r)=>(Ar.forceLoadFile(i),e(...r))})),s.read=(r,e,t,n,o)=>(Ar.forceLoadFile(i),l(r,e,t,n,o)),s.mmap=(r,e,t,n,o)=>{Ar.forceLoadFile(i);var a=vr();if(!a)throw new Ar.ErrnoError(48);return l(r,p,a,e,t),{ptr:a,allocated:!0}},i.stream_ops=s,i}},Pr=(r,e)=>r?ur(v,r,e):"",Sr={DEFAULT_POLLMASK:5,calculateAt(r,e,t){if(or.isAbs(e))return e;var n;if(n=-100===r?Ar.cwd():Sr.getStreamFromFD(r).path,0==e.length){if(!t)throw new Ar.ErrnoError(44);return n}return n+"/"+e},writeStat(r,e){g[r>>2]=e.dev,g[r+4>>2]=e.mode,E[r+8>>2]=e.nlink,g[r+12>>2]=e.uid,g[r+16>>2]=e.gid,g[r+20>>2]=e.rdev,b[r+24>>3]=BigInt(e.size),g[r+32>>2]=4096,g[r+36>>2]=e.blocks;var t=e.atime.getTime(),n=e.mtime.getTime(),o=e.ctime.getTime();return b[r+40>>3]=BigInt(Math.floor(t/1e3)),E[r+48>>2]=t%1e3*1e3*1e3,b[r+56>>3]=BigInt(Math.floor(n/1e3)),E[r+64>>2]=n%1e3*1e3*1e3,b[r+72>>3]=BigInt(Math.floor(o/1e3)),E[r+80>>2]=o%1e3*1e3*1e3,b[r+88>>3]=BigInt(e.ino),0},writeStatFs(r,e){g[r+4>>2]=e.bsize,g[r+40>>2]=e.bsize,g[r+8>>2]=e.blocks,g[r+12>>2]=e.bfree,g[r+16>>2]=e.bavail,g[r+20>>2]=e.files,g[r+24>>2]=e.ffree,g[r+28>>2]=e.fsid,g[r+44>>2]=e.flags,g[r+36>>2]=e.namelen},doMsync(r,e,t,n,o){if(!Ar.isFile(e.node.mode))throw new Ar.ErrnoError(43);if(2&n)return 0;var a=v.slice(r,r+t);Ar.msync(e,a,o,t,n)},getStreamFromFD:r=>Ar.getStreamChecked(r),varargs:void 0,getStr:r=>Pr(r)};function Dr(r,e,t){Sr.varargs=t;try{var n=Sr.getStreamFromFD(r);switch(e){case 0:if((o=tr())<0)return-28;for(;Ar.streams[o];)o++;return Ar.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=tr();return n.flags|=o,0;case 12:return o=nr(),w[o+0>>1]=2,0}return-28}catch(a){if(void 0===Ar||"ErrnoError"!==a.name)throw a;return-a.errno}}function $r(r,e,t){Sr.varargs=t;try{var n=Sr.getStreamFromFD(r);switch(e){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=nr();g[a>>2]=o.c_iflag||0,g[a+4>>2]=o.c_oflag||0,g[a+8>>2]=o.c_cflag||0,g[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)p[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=nr();var s=g[a>>2],l=g[a+4>>2],u=g[a+8>>2],d=g[a+12>>2],c=[];for(i=0;i<32;i++)c.push(p[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,e,{c_iflag:s,c_oflag:l,c_cflag:u,c_lflag:d,c_cc:c})}return 0;case 21519:return n.tty?(a=nr(),g[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=nr(),Ar.ioctl(n,e,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=nr(),w[a>>1]=f[0],w[a+2>>1]=f[1]}return 0;default:return-28}}catch(m){if(void 0===Ar||"ErrnoError"!==m.name)throw m;return-m.errno}}function Tr(r,e,t,n){Sr.varargs=n;try{e=Sr.getStr(e),e=Sr.calculateAt(r,e);var o=n?tr():0;return Ar.open(e,t,o).fd}catch(a){if(void 0===Ar||"ErrnoError"!==a.name)throw a;return-a.errno}}var Cr=()=>B(""),xr={},Mr=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function Nr(r){return this.fromWireType(E[r>>2])}var jr,Rr={},Br={},Or={},zr=s.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Wr=r=>{throw new zr(r)},Ir=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&Wr("Mismatched type converter count");for(var o=0;o<r.length;++o)Yr(r[o],n[o])}r.forEach((r=>Or[r]=e));var o=new Array(e.length),a=[],i=0;e.forEach(((r,e)=>{Br.hasOwnProperty(r)?o[e]=Br[r]:(a.push(r),Rr.hasOwnProperty(r)||(Rr[r]=[]),Rr[r].push((()=>{o[e]=Br[r],++i===a.length&&n(o)})))})),0===a.length&&n(o)},Lr=r=>{var e=xr[r];delete xr[r];var t=e.rawConstructor,n=e.rawDestructor,o=e.fields,a=o.map((r=>r.getterReturnType)).concat(o.map((r=>r.setterArgumentType)));Ir([r],a,(r=>{var a={};return o.forEach(((e,t)=>{var n=e.fieldName,i=r[t],s=r[t].optional,l=e.getter,u=e.getterContext,d=r[t+o.length],c=e.setter,f=e.setterContext;a[n]={read:r=>i.fromWireType(l(u,r)),write:(r,e)=>{var t=[];c(f,r,d.toWireType(t,e)),Mr(t)},optional:s}})),[{name:e.name,fromWireType:r=>{var e={};for(var t in a)e[t]=a[t].read(r);return n(r),e},toWireType:(r,e)=>{for(var o in a)if(!(o in e)&&!a[o].optional)throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,e[o]);return null!==r&&r.push(n,i),i},argPackAdvance:Qr,readValueFromPointer:Nr,destructorFunction:n}]}))},Ur=r=>{if(null===r)return"null";var e=typeof r;return"object"===e||"array"===e||"function"===e?r.toString():""+r},Vr=()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);jr=r},Hr=r=>{for(var e="",t=r;v[t];)e+=jr[v[t++]];return e},qr=s.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},Xr=r=>{throw new qr(r)};function Gr(r,e,t={}){var n=e.name;if(r||Xr(`type "${n}" must have a positive integer typeid pointer`),Br.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;Xr(`Cannot register type '${n}' twice`)}if(Br[r]=e,delete Or[r],Rr.hasOwnProperty(r)){var o=Rr[r];delete Rr[r],o.forEach((r=>r()))}}function Yr(r,e,t={}){return Gr(r,e,t)}var Kr=(r,e,t)=>{switch(e){case 1:return t?r=>p[r]:r=>v[r];case 2:return t?r=>w[r>>1]:r=>y[r>>1];case 4:return t?r=>g[r>>2]:r=>E[r>>2];case 8:return t?r=>b[r>>3]:r=>k[r>>3];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},Jr=(r,e,t,n,o)=>{var a=-1!=(e=Hr(e)).indexOf("u");Yr(r,{name:e,fromWireType:r=>r,toWireType:function(r,e){if("bigint"!=typeof e&&"number"!=typeof e)throw new TypeError(`Cannot convert "${Ur(e)}" to ${this.name}`);return"number"==typeof e&&(e=BigInt(e)),e},argPackAdvance:Qr,readValueFromPointer:Kr(e,t,!a),destructorFunction:null})},Qr=8,Zr=(r,e,t,n)=>{Yr(r,{name:e=Hr(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:Qr,readValueFromPointer:function(r){return this.fromWireType(v[r])},destructorFunction:null})},re=[],ee=[],te=r=>{r>9&&0==--ee[r+1]&&(ee[r]=void 0,re.push(r))},ne=()=>ee.length/2-5-re.length,oe=()=>{ee.push(0,1,void 0,1,null,1,!0,1,!1,1),s.count_emval_handles=ne},ae={toValue:r=>(r||Xr(`Cannot use deleted val. handle = ${r}`),ee[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=re.pop()||ee.length;return ee[e]=r,ee[e+1]=1,e}}}},ie={name:"emscripten::val",fromWireType:r=>{var e=ae.toValue(r);return te(r),e},toWireType:(r,e)=>ae.toHandle(e),argPackAdvance:Qr,readValueFromPointer:Nr,destructorFunction:null},se=r=>Yr(r,ie),le=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(_[r>>2])};case 8:return function(r){return this.fromWireType(F[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},ue=(r,e,t)=>{Yr(r,{name:e=Hr(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:Qr,readValueFromPointer:le(e,t),destructorFunction:null})},de=(r,e)=>Object.defineProperty(e,"name",{value:r});function ce(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}function fe(r,e,t,n,o,a){var i=e.length;i<2&&Xr("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var s=ce(e),l="void"!==e[0].name,u=i-2,d=new Array(u),c=[],f=[];return de(r,(function(...r){var t;f.length=0,c.length=1,c[0]=o;for(var a=0;a<u;++a)d[a]=e[a+2].toWireType(f,r[a]),c.push(d[a]);function i(r){if(s)Mr(f);else for(var n=2;n<e.length;n++){var o=1===n?t:d[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(o)}if(l)return e[0].fromWireType(r)}return i(n(...c))}))}var me,he=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||Xr(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},pe=(r,e,t)=>{s.hasOwnProperty(r)?((void 0===t||void 0!==s[r].overloadTable&&void 0!==s[r].overloadTable[t])&&Xr(`Cannot register public name '${r}' twice`),he(s,r,r),s[r].overloadTable.hasOwnProperty(t)&&Xr(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),s[r].overloadTable[t]=e):(s[r]=e,s[r].argCount=t)},ve=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(E[e+4*n>>2]);return t},we=(r,e,t)=>{s.hasOwnProperty(r)||Wr("Replacing nonexistent public symbol"),void 0!==s[r].overloadTable&&void 0!==t?s[r].overloadTable[t]=e:(s[r]=e,s[r].argCount=t)},ye=[],ge=r=>{var e=ye[r];return e||(ye[r]=e=me.get(r)),e},Ee=(r,e,t=!1)=>{function n(){return ge(e)}r=Hr(r);var o=n();return"function"!=typeof o&&Xr(`unknown function pointer with signature ${r}: ${e}`),o};class _e extends Error{}var be=r=>{var e=Yt(r),t=Hr(e);return Jt(e),t},ke=(r,e)=>{var t=[],n={};function o(r){n[r]||Br[r]||(Or[r]?Or[r].forEach(o):(t.push(r),n[r]=!0))}throw e.forEach(o),new _e(`${r}: `+t.map(be).join([", "]))},Fe=r=>{const e=(r=r.trim()).indexOf("(");return-1===e?r:r.slice(0,e)},Ae=(r,e,t,n,o,a,i,s)=>{var l=ve(e,t);r=Hr(r),r=Fe(r),o=Ee(n,o,i),pe(r,(function(){ke(`Cannot call ${r} due to unbound types`,l)}),e-1),Ir([],l,(t=>{var n=[t[0],null].concat(t.slice(1));return we(r,fe(r,n,null,o,a),e-1),[]}))},Pe=(r,e,t,n,o)=>{e=Hr(e);var a=r=>r;if(0===n){var i=32-8*t;a=r=>r<<i>>>i}var s=e.includes("unsigned"),l=(r,e)=>{};Yr(r,{name:e,fromWireType:a,toWireType:s?function(r,e){return l(e,this.name),e>>>0}:function(r,e){return l(e,this.name),e},argPackAdvance:Qr,readValueFromPointer:Kr(e,t,0!==n),destructorFunction:null})},Se=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];function o(r){var e=E[r>>2],t=E[r+4>>2];return new n(p.buffer,t,e)}Yr(r,{name:t=Hr(t),fromWireType:o,argPackAdvance:Qr,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},De=(r,e,t)=>fr(r,v,e,t),$e=(r,e)=>{Yr(r,{name:e=Hr(e),fromWireType(r){for(var e,t=E[r>>2],n=r+4,o=n,a=0;a<=t;++a){var i=n+a;if(a==t||0==v[i]){var s=Pr(o,i-o);void 0===e?e=s:(e+=String.fromCharCode(0),e+=s),o=i+1}}return Jt(r),e},toWireType(r,e){var t;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var n="string"==typeof e;n||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT||Xr("Cannot pass non-string to std::string"),t=n?cr(e):e.length;var o=Kt(4+t+1),a=o+4;return E[o>>2]=t,n?De(e,a,t+1):v.set(e,a),null!==r&&r.push(Jt,o),o},argPackAdvance:Qr,readValueFromPointer:Nr,destructorFunction(r){Jt(r)}})},Te="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ce=(r,e)=>{for(var t=r,n=t>>1,o=n+e/2;!(n>=o)&&y[n];)++n;if((t=n<<1)-r>32&&Te)return Te.decode(v.subarray(r,t));for(var a="",i=0;!(i>=e/2);++i){var s=w[r+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},xe=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,o=(t-=2)<2*r.length?t/2:r.length,a=0;a<o;++a){var i=r.charCodeAt(a);w[e>>1]=i,e+=2}return w[e>>1]=0,e-n},Me=r=>2*r.length,Ne=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var o=g[r+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},je=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,o=n+t-4,a=0;a<r.length;++a){var i=r.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),g[e>>2]=i,(e+=4)+4>o)break}return g[e>>2]=0,e-n},Re=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&++t,e+=4}return e},Be=(r,e,t)=>{var n,o,a,i;t=Hr(t),2===e?(n=Ce,o=xe,i=Me,a=r=>y[r>>1]):4===e&&(n=Ne,o=je,i=Re,a=r=>E[r>>2]),Yr(r,{name:t,fromWireType:r=>{for(var t,o=E[r>>2],i=r+4,s=0;s<=o;++s){var l=r+4+s*e;if(s==o||0==a(l)){var u=n(i,l-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=l+e}}return Jt(r),t},toWireType:(r,n)=>{"string"!=typeof n&&Xr(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=Kt(4+a+e);return E[s>>2]=a/e,o(n,s+4,a+e),null!==r&&r.push(Jt,s),s},argPackAdvance:Qr,readValueFromPointer:Nr,destructorFunction(r){Jt(r)}})},Oe=(r,e,t,n,o,a)=>{xr[r]={name:Hr(e),rawConstructor:Ee(t,n),rawDestructor:Ee(o,a),fields:[]}},ze=(r,e,t,n,o,a,i,s,l,u)=>{xr[r].fields.push({fieldName:Hr(e),getterReturnType:t,getter:Ee(n,o),getterContext:a,setterArgumentType:i,setter:Ee(s,l),setterContext:u})},We=(r,e)=>{Yr(r,{isVoid:!0,name:e=Hr(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},Ie=r=>{do{var e=E[r>>2],t=E[(r+=4)>>2],n=E[(r+=4)>>2];r+=4;var o=Pr(e);Ar.createPath("/",or.dirname(o),!0,!0),Ar.createDataFile(o,null,p.subarray(n,n+t),!0,!0,!0)}while(E[r>>2])},Le=()=>{throw 1/0},Ue=(r,e)=>{var t=Br[r];return void 0===t&&Xr(`${e} has unknown type ${be(r)}`),t},Ve=(r,e,t)=>{var n=[],o=r.toWireType(n,t);return n.length&&(E[e>>2]=ae.toHandle(n)),o},He=(r,e,t)=>(r=ae.toValue(r),e=Ue(e,"emval::as"),Ve(e,t,r)),qe={},Xe=r=>{var e=qe[r];return void 0===e?Hr(r):e},Ge=[],Ye=(r,e,t,n,o)=>(r=Ge[r])(e=ae.toValue(e),e[t=Xe(t)],n,o),Ke=()=>{if("object"==typeof globalThis)return globalThis;function e(r){r.$$$embind_global$$$=r;var e="object"==typeof $$$embind_global$$$&&r.$$$embind_global$$$==r;return e||delete r.$$$embind_global$$$,e}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof r&&e(r)?$$$embind_global$$$=r:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},Je=r=>0===r?ae.toHandle(Ke()):(r=Xe(r),ae.toHandle(Ke()[r])),Qe=r=>{var e=Ge.length;return Ge.push(r),e},Ze=(r,e)=>{for(var t=new Array(r),n=0;n<r;++n)t[n]=Ue(E[e+4*n>>2],`parameter ${n}`);return t},rt=Reflect.construct,et=(r,e,t)=>{var n=Ze(r,e),o=n.shift();r--;var a=new Array(r),i=(e,i,s,l)=>{for(var u=0,d=0;d<r;++d)a[d]=n[d].readValueFromPointer(l+u),u+=n[d].argPackAdvance;var c=1===t?rt(i,a):i.apply(e,a);return Ve(o,s,c)},s=`methodCaller<(${n.map((r=>r.name)).join(", ")}) => ${o.name}>`;return Qe(de(s,i))},tt=(r,e)=>(r=ae.toValue(r),e=ae.toValue(e),ae.toHandle(r[e])),nt=r=>{r>9&&(ee[r+1]+=1)},ot=()=>ae.toHandle([]),at=r=>ae.toHandle(Xe(r)),it=r=>{var e=ae.toValue(r);Mr(e),te(r)},st=(r,e,t)=>{r=ae.toValue(r),e=ae.toValue(e),t=ae.toValue(t),r[e]=t},lt=(r,e)=>{var t=(r=Ue(r,"_emval_take_value")).readValueFromPointer(e);return ae.toHandle(t)},ut=(r,e,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),u=Math.max(s,l);E[r>>2]=60*u,g[e>>2]=Number(s!=l);var d=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=d(s),f=d(l);l<s?(De(c,t,17),De(f,n,17)):(De(c,n,17),De(f,t,17))},dt=()=>2147483648,ct=(r,e)=>Math.ceil(r/e)*e,ft=r=>{var e=(r-h.buffer.byteLength+65535)/65536|0;try{return h.grow(e),D(),1}catch(t){}},mt=r=>{var e=v.length;r>>>=0;var t=dt();if(r>t)return!1;for(var n=1;n<=4;n*=2){var o=e*(1+.2/n);o=Math.min(o,r+100663296);var a=Math.min(t,ct(Math.max(r,o),65536));if(ft(a))return!0}return!1},ht={},pt=()=>u||"./this.program",vt=()=>{if(!vt.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:pt()};for(var e in ht)void 0===ht[e]?delete r[e]:r[e]=ht[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);vt.strings=t}return vt.strings},wt=(r,e)=>{var t=0,n=0;for(var o of vt()){var a=e+t;E[r+n>>2]=a,t+=De(o,a,1/0)+1,n+=4}return 0},yt=(r,e)=>{var t=vt();E[r>>2]=t.length;var n=0;for(var o of t)n+=cr(o)+1;return E[e>>2]=n,0},gt=0,Et=()=>J||gt>0,_t=r=>{Et()||(s.onExit?.(r),S=!0),d(r,new H(r))},bt=(r,e)=>{_t(r)};function kt(r){try{var e=Sr.getStreamFromFD(r);return Ar.close(e),0}catch(t){if(void 0===Ar||"ErrnoError"!==t.name)throw t;return t.errno}}var Ft=(r,e,t,n)=>{for(var o=0,a=0;a<t;a++){var i=E[e>>2],s=E[e+4>>2];e+=8;var l=Ar.read(r,p,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o};function At(r,e,t,n){try{var o=Sr.getStreamFromFD(r),a=Ft(o,e,t);return E[n>>2]=a,0}catch(i){if(void 0===Ar||"ErrnoError"!==i.name)throw i;return i.errno}}var Pt=9007199254740992,St=-9007199254740992,Dt=r=>r<St||r>Pt?NaN:Number(r);function $t(r,e,t,n){e=Dt(e);try{if(isNaN(e))return 61;var o=Sr.getStreamFromFD(r);return Ar.llseek(o,e,t),b[n>>3]=BigInt(o.position),o.getdents&&0===e&&0===t&&(o.getdents=null),0}catch(a){if(void 0===Ar||"ErrnoError"!==a.name)throw a;return a.errno}}var Tt=(r,e,t,n)=>{for(var o=0,a=0;a<t;a++){var i=E[e>>2],s=E[e+4>>2];e+=8;var l=Ar.write(r,p,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o};function Ct(r,e,t,n){try{var o=Sr.getStreamFromFD(r),a=Tt(o,e,t);return E[n>>2]=a,0}catch(i){if(void 0===Ar||"ErrnoError"!==i.name)throw i;return i.errno}}var xt,Mt=(r,e)=>{r<128?e.push(r):e.push(r%128|128,r>>7)},Nt=r=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==r[0]?[]:[e[r[0]]]},n=1;n<r.length;++n)t.parameters.push(e[r[n]]);return t},jt=(r,e)=>{var t=r.slice(0,1),n=r.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};for(var a of(e.push(96),Mt(n.length,e),n))e.push(o[a]);"v"==t?e.push(0):e.push(1,o[t])},Rt=(r,e)=>{if("function"==typeof WebAssembly.Function)return new WebAssembly.Function(Nt(e),r);var t=[1];jt(e,t);var n=[0,97,115,109,1,0,0,0,1];Mt(t.length,n),n.push(...t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(o,{e:{f:r}}).exports.f},Bt=(r,e)=>{if(xt)for(var t=r;t<r+e;t++){var n=ge(t);n&&xt.set(n,t)}},Ot=r=>(xt||(xt=new WeakMap,Bt(0,me.length)),xt.get(r)||0),zt=[],Wt=()=>{if(zt.length)return zt.pop();try{me.grow(1)}catch(P){if(!(P instanceof RangeError))throw P;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return me.length-1},It=(r,e)=>{me.set(r,e),ye[r]=me.get(r)},Lt=(r,e)=>{var t=Ot(r);if(t)return t;var n=Wt();try{It(n,r)}catch(P){if(!(P instanceof TypeError))throw P;var o=Rt(r,e);It(n,o)}return xt.set(r,n),n},Ut=Ar.createPath,Vt=r=>Ar.unlink(r),Ht=Ar.createLazyFile,qt=Ar.createDevice;Ar.createPreloadedFile=br,Ar.staticInit(),s.FS_createPath=Ar.createPath,s.FS_createDataFile=Ar.createDataFile,s.FS_createPreloadedFile=Ar.createPreloadedFile,s.FS_unlink=Ar.unlink,s.FS_createLazyFile=Ar.createLazyFile,s.FS_createDevice=Ar.createDevice,wr.doesNotExistError=new Ar.ErrnoError(44),wr.doesNotExistError.stack="<generic error, no stack>",Vr(),oe(),s.noExitRuntime&&(J=s.noExitRuntime),s.preloadPlugins&&(Er=s.preloadPlugins),s.print&&(A=s.print),s.printErr&&(P=s.printErr),s.wasmBinary&&(m=s.wasmBinary),s.arguments&&s.arguments,s.thisProgram&&(u=s.thisProgram),s.addRunDependency=j,s.removeRunDependency=R,s.addFunction=Lt,s.UTF8ToString=Pr,s.FS_createPreloadedFile=br,s.FS_unlink=Vt,s.FS_createPath=Ut,s.FS_createDevice=qt,s.FS_createDataFile=gr,s.FS_createLazyFile=Ht;var Xt={i:er,w:Dr,L:$r,M:Tr,N:Cr,U:Lr,y:Jr,S:Zr,Q:se,x:ue,q:Ae,c:Pe,b:Se,R:$e,p:Be,V:Oe,k:ze,T:We,P:Ie,E:Le,X:He,z:Ye,a:te,Y:Je,A:et,m:tt,g:nt,B:ot,h:at,r:it,W:st,l:lt,G:ut,F:mt,I:wt,J:yt,O:bt,u:kt,K:At,H:$t,v:Ct,n:en,j:on,o:sn,s:ln,D:dn,t:an,d:tn,C:cn,e:un,f:nn},Gt=await V();Gt._;var Yt=Gt.$,Kt=s._malloc=Gt.ba,Jt=s._free=Gt.ca,Qt=Gt.da,Zt=Gt.ea,rn=Gt.fa;function en(r,e){var t=Z();try{return ge(r)(e)}catch(n){if(Q(t),n!==n+0)throw n;Qt(1,0)}}function tn(r,e){var t=Z();try{ge(r)(e)}catch(n){if(Q(t),n!==n+0)throw n;Qt(1,0)}}function nn(r,e,t,n){var o=Z();try{ge(r)(e,t,n)}catch(a){if(Q(o),a!==a+0)throw a;Qt(1,0)}}function on(r,e,t){var n=Z();try{return ge(r)(e,t)}catch(o){if(Q(n),o!==o+0)throw o;Qt(1,0)}}function an(r){var e=Z();try{ge(r)()}catch(t){if(Q(e),t!==t+0)throw t;Qt(1,0)}}function sn(r,e,t,n){var o=Z();try{return ge(r)(e,t,n)}catch(a){if(Q(o),a!==a+0)throw a;Qt(1,0)}}function ln(r,e,t,n,o){var a=Z();try{return ge(r)(e,t,n,o)}catch(i){if(Q(a),i!==i+0)throw i;Qt(1,0)}}function un(r,e,t){var n=Z();try{ge(r)(e,t)}catch(o){if(Q(n),o!==o+0)throw o;Qt(1,0)}}function dn(r,e,t,n,o,a,i,s,l,u){var d=Z();try{return ge(r)(e,t,n,o,a,i,s,l,u)}catch(c){if(Q(d),c!==c+0)throw c;Qt(1,0)}}function cn(r,e,t,n){var o=Z();try{ge(r)(e,t,n)}catch(a){if(Q(o),a!==a+0)throw a;Qt(1,0)}}function fn(){function r(){s.calledRun=!0,S||(T(),t(s),s.onRuntimeInitialized?.(),C())}M>0?N=fn:($(),M>0?N=fn:s.setStatus?(s.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>s.setStatus("")),1),r()}),1)):r())}function mn(){if(s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.shift()()}return s.___emscripten_embedded_file_data=1537872,mn(),fn(),l},e.exports=a,e.exports.default=a),n.exports;var e,o,a}const a=e(o()),i=Object.freeze(Object.defineProperty({__proto__:null,default:a},Symbol.toStringTag,{value:"Module"}));export{i as l};
|
package/chunks/sphere.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"../core/has.js";import"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{fromRotation as r}from"../core/libs/gl-matrix-2/math/mat4.js";import{g as n,h as s,j as o,l as e,e as i,t as a,d as c,k as u,n as f,i as m,s as l,m as g,b as p}from"./vec32.js";import{create as h}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{e as M,c as j}from"./vec42.js";import{create as d,fromValues as y}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as b}from"../core/libs/gl-matrix-2/math/common.js";import{Axis as x}from"../geometry/support/Axis.js";import{fromPoints as v,closestPoint as S}from"../geometry/support/ray.js";import{cartesianToSpherical as q}from"../geometry/support/sphereUtils.js";import{angle as A}from"../geometry/support/vector.js";import{sv3d as P,sm4d as R}from"../geometry/support/vectorStacks.js";const C=E();function E(){return d()}const _=M,k=M;function w(t,r){return j(r,t)}function O(t,r){return y(t[0],t[1],t[2],r)}function T(t){return t}function z(t){t[0]=t[1]=t[2]=t[3]=0}function L(t,r){return t[0]=t[1]=t[2]=0,t[3]=r,t}function N(t){return t[3]}function U(t){return t}function V(t,r,n,s){return y(t,r,n,s)}function Z(t,r,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+r,n}function B(t,r,n){return t!==n&&w(t,n),n}function D(t,r){return r}function F(t,r,n){if(null==r)return!1;if(!Y(t,r,X))return!1;let{t0:s,t1:o}=X;if((s<0||o<s&&o>0)&&(s=o),s<0)return!1;if(n){const{origin:t,direction:o}=r;n[0]=t[0]+o[0]*s,n[1]=t[1]+o[1]*s,n[2]=t[2]+o[2]*s}return!0}function I(t,r,n){const s=v(r,n);if(!Y(t,s,X))return[];const{origin:o,direction:e}=s,{t0:i,t1:a}=X,c=r=>{const n=h();return p(n,o,e,r),$(t,n,n)};return Math.abs(i-a)<b()?[c(i)]:[c(i),c(a)]}const X={t0:0,t1:0};function Y(t,r,n){const{origin:s,direction:o}=r,e=G;e[0]=s[0]-t[0],e[1]=s[1]-t[1],e[2]=s[2]-t[2];const i=o[0]*o[0]+o[1]*o[1]+o[2]*o[2];if(0===i)return!1;const a=2*(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]),c=a*a-4*i*(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]-t[3]*t[3]);if(c<0)return!1;const u=Math.sqrt(c);return n.t0=(-a-u)/(2*i),n.t1=(-a+u)/(2*i),!0}const G=h();function H(t,r){return F(t,r,null)}function J(t,r,i){if(F(t,r,i))return i;const a=K(t,r,P.get());return n(i,r.origin,s(P.get(),r.direction,o(r.origin,a)/e(r.direction))),i}function K(t,n,o){const c=P.get(),u=R.get();i(c,n.origin,n.direction);const f=N(t);i(o,c,n.origin),s(o,o,1/e(o)*f);const m=rt(t,n.origin),l=A(n.origin,o);return r(u,l+m,c),a(o,o,u),o}function Q(t,r,n,s){const o=N(t),e=o*o,i=r+.5*Math.PI,a=n*n+e-2*Math.cos(i)*n*o,c=Math.sqrt(a),u=a-e;if(u<=0)return.5;const f=Math.sqrt(u),m=Math.acos(f/c)-Math.asin(o/(c/Math.sin(i)));return Math.min(1,(m+.5*s)/s)}function W(t,r,n){return F(t,r,n)?n:(S(r,U(t),n),$(t,n,n))}function $(t,r,o){const i=c(P.get(),r,U(t)),a=s(P.get(),i,t[3]/e(i));return n(o,a,U(t))}function tt(t,r){const n=c(P.get(),r,U(t)),s=u(n),o=t[3]*t[3];return Math.sqrt(Math.abs(s-o))}function rt(r,n){const s=c(P.get(),n,U(r)),o=e(s),i=N(r),a=i+Math.abs(i-o);return t(i/a)}const nt=h();function st(t,r,n,s){const o=c(nt,r,U(t));switch(n){case x.X:{const t=q(o,nt)[2];return m(s,-Math.sin(t),Math.cos(t),0)}case x.Y:{const t=q(o,nt),r=t[1],n=t[2],e=Math.sin(r);return m(s,-e*Math.cos(n),-e*Math.sin(n),Math.cos(r))}case x.Z:return f(s,o);default:return}}function ot(t,r){const n=c(ct,r,U(t));return e(n)-t[3]}function et(t,r,o,e){const i=ot(t,r),a=st(t,r,x.Z,ct),c=s(ct,a,o-i);return n(e,r,c)}function it(t,r){const n=l(U(t),r),s=N(t);return n<=s*s}function at(t,r,n=d()){const s=o(U(t),U(r)),e=t[3],i=r[3];return s+i<e?(j(n,t),n):s+e<i?(j(n,r),n):(g(n,U(t),U(r),(s+i-e)/(2*s)),n[3]=(s+e+i)/2,n)}const ct=h(),ut=E(),ft=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:C,altitudeAt:ot,angleToSilhouette:rt,axisAt:st,cameraFrustumCoverage:Q,clear:z,closestPoint:W,closestPointOnSilhouette:K,containsPoint:it,copy:w,create:E,distanceToSilhouette:tt,elevate:Z,equals:k,exactEquals:_,fromCenterAndRadius:O,fromRadius:L,fromValues:V,getCenter:U,getExtent:D,getRadius:N,intersectLine:I,intersectRay:F,intersectRayClosestSilhouette:J,intersectsRay:H,projectPoint:$,setAltitudeAt:et,setExtent:B,tmpSphere:ut,union:at,wrap:T},Symbol.toStringTag,{value:"Module"}));export{W as A,rt as B,st as C,ot as D,et as E,C as N,U as a,L as b,E as c,Q as d,w as e,V as f,N as g,
|
|
5
|
+
import"../core/has.js";import"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{fromRotation as r}from"../core/libs/gl-matrix-2/math/mat4.js";import{g as n,h as s,j as o,l as e,e as i,t as a,d as c,k as u,n as f,i as m,s as l,m as g,b as p}from"./vec32.js";import{create as h}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{e as M,c as j}from"./vec42.js";import{create as d,fromValues as y}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as b}from"../core/libs/gl-matrix-2/math/common.js";import{Axis as x}from"../geometry/support/Axis.js";import{fromPoints as v,closestPoint as S}from"../geometry/support/ray.js";import{cartesianToSpherical as q}from"../geometry/support/sphereUtils.js";import{angle as A}from"../geometry/support/vector.js";import{sv3d as P,sm4d as R}from"../geometry/support/vectorStacks.js";const C=E();function E(){return d()}const _=M,k=M;function w(t,r){return j(r,t)}function O(t,r){return y(t[0],t[1],t[2],r)}function T(t){return t}function z(t){t[0]=t[1]=t[2]=t[3]=0}function L(t,r){return t[0]=t[1]=t[2]=0,t[3]=r,t}function N(t){return t[3]}function U(t){return t}function V(t,r,n,s){return y(t,r,n,s)}function Z(t,r,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+r,n}function B(t,r,n){return t!==n&&w(t,n),n}function D(t,r){return r}function F(t,r,n){if(null==r)return!1;if(!Y(t,r,X))return!1;let{t0:s,t1:o}=X;if((s<0||o<s&&o>0)&&(s=o),s<0)return!1;if(n){const{origin:t,direction:o}=r;n[0]=t[0]+o[0]*s,n[1]=t[1]+o[1]*s,n[2]=t[2]+o[2]*s}return!0}function I(t,r,n){const s=v(r,n);if(!Y(t,s,X))return[];const{origin:o,direction:e}=s,{t0:i,t1:a}=X,c=r=>{const n=h();return p(n,o,e,r),$(t,n,n)};return Math.abs(i-a)<b()?[c(i)]:[c(i),c(a)]}const X={t0:0,t1:0};function Y(t,r,n){const{origin:s,direction:o}=r,e=G;e[0]=s[0]-t[0],e[1]=s[1]-t[1],e[2]=s[2]-t[2];const i=o[0]*o[0]+o[1]*o[1]+o[2]*o[2];if(0===i)return!1;const a=2*(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]),c=a*a-4*i*(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]-t[3]*t[3]);if(c<0)return!1;const u=Math.sqrt(c);return n.t0=(-a-u)/(2*i),n.t1=(-a+u)/(2*i),!0}const G=h();function H(t,r){return F(t,r,null)}function J(t,r,i){if(F(t,r,i))return i;const a=K(t,r,P.get());return n(i,r.origin,s(P.get(),r.direction,o(r.origin,a)/e(r.direction))),i}function K(t,n,o){const c=P.get(),u=R.get();i(c,n.origin,n.direction);const f=N(t);i(o,c,n.origin),s(o,o,1/e(o)*f);const m=rt(t,n.origin),l=A(n.origin,o);return r(u,l+m,c),a(o,o,u),o}function Q(t,r,n,s){const o=N(t),e=o*o,i=r+.5*Math.PI,a=n*n+e-2*Math.cos(i)*n*o,c=Math.sqrt(a),u=a-e;if(u<=0)return.5;const f=Math.sqrt(u),m=Math.acos(f/c)-Math.asin(o/(c/Math.sin(i)));return Math.min(1,(m+.5*s)/s)}function W(t,r,n){return F(t,r,n)?n:(S(r,U(t),n),$(t,n,n))}function $(t,r,o){const i=c(P.get(),r,U(t)),a=s(P.get(),i,t[3]/e(i));return n(o,a,U(t))}function tt(t,r){const n=c(P.get(),r,U(t)),s=u(n),o=t[3]*t[3];return Math.sqrt(Math.abs(s-o))}function rt(r,n){const s=c(P.get(),n,U(r)),o=e(s),i=N(r),a=i+Math.abs(i-o);return t(i/a)}const nt=h();function st(t,r,n,s){const o=c(nt,r,U(t));switch(n){case x.X:{const t=q(o,nt)[2];return m(s,-Math.sin(t),Math.cos(t),0)}case x.Y:{const t=q(o,nt),r=t[1],n=t[2],e=Math.sin(r);return m(s,-e*Math.cos(n),-e*Math.sin(n),Math.cos(r))}case x.Z:return f(s,o);default:return}}function ot(t,r){const n=c(ct,r,U(t));return e(n)-t[3]}function et(t,r,o,e){const i=ot(t,r),a=st(t,r,x.Z,ct),c=s(ct,a,o-i);return n(e,r,c)}function it(t,r){const n=l(U(t),r),s=N(t);return n<=s*s}function at(t,r,n=d()){const s=o(U(t),U(r)),e=t[3],i=r[3];return s+i<e?(j(n,t),n):s+e<i?(j(n,r),n):(g(n,U(t),U(r),(s+i-e)/(2*s)),n[3]=(s+e+i)/2,n)}const ct=h(),ut=E(),ft=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:C,altitudeAt:ot,angleToSilhouette:rt,axisAt:st,cameraFrustumCoverage:Q,clear:z,closestPoint:W,closestPointOnSilhouette:K,containsPoint:it,copy:w,create:E,distanceToSilhouette:tt,elevate:Z,equals:k,exactEquals:_,fromCenterAndRadius:O,fromRadius:L,fromValues:V,getCenter:U,getExtent:D,getRadius:N,intersectLine:I,intersectRay:F,intersectRayClosestSilhouette:J,intersectsRay:H,projectPoint:$,setAltitudeAt:et,setExtent:B,tmpSphere:ut,union:at,wrap:T},Symbol.toStringTag,{value:"Module"}));export{W as A,rt as B,st as C,ot as D,et as E,C as N,U as a,L as b,E as c,Q as d,w as e,V as f,N as g,F as h,H as i,tt as j,K as k,O as l,_ as m,I as n,it as o,$ as p,k as q,z as r,ft as s,ut as t,at as u,Z as v,T as w,B as x,D as y,J as z};
|
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
|
|
5
|
+
import{isSerializable as t}from"../../core/support/jsonUtils.js";import{create as i}from"./aaBoundingRect.js";import{getBoundsXY as s}from"./boundsUtils.js";import{closeRings as n}from"./coordsUtils.js";import{isPoint as e,isMultipoint as h,isExtent as o,isPolygon as u,isPolyline as r}from"./jsonUtils.js";import{cutParams as m,updatePolyGeometry as x,offsetMagnitude as l}from"./normalizeUtilsCommon.js";import{getInfo as _,isWebMercator as c}from"./spatialReferenceUtils.js";function p(t){return f(t,!0)}function a(t){return f(t,!1)}function f(i,n){if(null==i)return null;const p=i.spatialReference,a=_(p),f=t(i)?i.toJSON():i;if(!a)return f;const I=c(p)?102100:4326,g=m[I].maxX,v=m[I].minX;if(e(f))return y(f,g,v);if(h(f))return f.points=f.points.map((t=>y(t,g,v))),f;if(o(f))return d(f,a);if(u(f)||r(f)){const t=s(T,f),i={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},e=l(i.xmin,v)*(2*g),h=0===e?f:x(f,e);return i.xmin+=e,i.xmax+=e,i.xmax>g?C(h,g,n):i.xmin<v?C(h,v,n):h}return f}function d(t,i){if(!i)return t;const s=I(t,i).map((t=>t.extent));return s.length<2?s[0]||t:s.length>2?(t.xmin=i.valid[0],t.xmax=i.valid[1],t):{rings:s.map((t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]))}}function y(t,i,s){if(Array.isArray(t)){const n=t[0];if(n>i){const s=l(n,i);t[0]=n+s*(-2*i)}else if(n<s){const i=l(n,s);t[0]=n+i*(-2*s)}}else{const n=t.x;if(n>i){const s=l(n,i);t.x+=s*(-2*i)}else if(n<s){const i=l(n,s);t.x+=i*(-2*s)}}return t}function I(t,i){const s=[],{ymin:n,ymax:e,xmin:h,xmax:o}=t,u=t.xmax-t.xmin,[r,m]=i.valid,{x,frameId:l}=g(t.xmin,i),{x:_,frameId:c}=g(t.xmax,i),p=x===_&&u>0;if(u>2*m){const t={xmin:h<o?x:_,ymin:n,xmax:m,ymax:e},i={xmin:r,ymin:n,xmax:h<o?_:x,ymax:e},u={xmin:0,ymin:n,xmax:m,ymax:e},p={xmin:r,ymin:n,xmax:0,ymax:e},a=[],f=[];v(t,u)&&a.push(l),v(t,p)&&f.push(l),v(i,u)&&a.push(c),v(i,p)&&f.push(c);for(let s=l+1;s<c;s++)a.push(s),f.push(s);s.push(new P(t,[l]),new P(i,[c]),new P(u,a),new P(p,f))}else x>_||p?s.push(new P({xmin:x,ymin:n,xmax:m,ymax:e},[l]),new P({xmin:r,ymin:n,xmax:_,ymax:e},[c])):s.push(new P({xmin:x,ymin:n,xmax:_,ymax:e},[l]));return s}function g(t,i){const[s,n]=i.valid,e=2*n;let h,o=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,o=h):t<s&&(h=Math.ceil(Math.abs(t-s)/e),t+=h*e,o=-h),{x:t,frameId:o}}function v(t,i){const{xmin:s,ymin:n,xmax:e,ymax:h}=i;return O(t,s,n)&&O(t,s,h)&&O(t,e,h)&&O(t,e,n)}function O(t,i,s){return i>=t.xmin&&i<=t.xmax&&s>=t.ymin&&s<=t.ymax}function C(t,i,s=!0){const e=!r(t);if(e&&n(t),s){return(new S).cut(t,i)}const h=e?t.rings:t.paths,o=e?4:2,u=h.length,m=-2*i;for(let n=0;n<u;n++){const t=h[n];if(t&&t.length>=o){const i=[];for(const s of t)i.push([s[0]+m,s[1]]);h.push(i)}}return e?t.rings=h:t.paths=h,t}class P{constructor(t,i){this.extent=t,this.frameIds=i}}const T=i();class S{constructor(){this._linesIn=[],this._linesOut=[]}cut(t,i){let s;if(this._xCut=i,t.rings)this._closed=!0,s=t.rings,this._minPts=4;else{if(!t.paths)return null;this._closed=!1,s=t.paths,this._minPts=2}for(const e of s){if(!e||e.length<this._minPts)continue;let t=!0;for(const i of e)t?(this.moveTo(i),t=!1):this.lineTo(i);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),s=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&s.push(e);const n=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=n;s.push(e)}return this._closed?t.rings=s:t.paths=s,t}moveTo(t){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(t[0]),this._moveTo(t[0],t[1],this._prevSide),this._prevPt=t,this._firstPt=t}lineTo(t){const i=this._side(t[0]);if(i*this._prevSide==-1){const s=this._intersect(this._prevPt,t);this._lineTo(this._xCut,s,0),this._prevSide=0,this._lineTo(t[0],t[1],i)}else this._lineTo(t[0],t[1],i);this._prevSide=i,this._prevPt=t}close(){const t=this._firstPt,i=this._prevPt;t[0]===i[0]&&t[1]===i[1]||this.lineTo(t),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(t,i,s){this._closed?(this._lineIn.push([s<=0?t:this._xCut,i]),this._lineOut.push([s>=0?t:this._xCut,i])):(s<=0&&this._lineIn.push([t,i]),s>=0&&this._lineOut.push([t,i]))}_lineTo(t,i,s){this._closed?(j(this._lineIn,s<=0?t:this._xCut,i),j(this._lineOut,s>=0?t:this._xCut,i)):s<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([t,i])):s>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([t,i])):this._prevSide<0?(this._lineIn.push([t,i]),this._lineOut.push([t,i])):this._prevSide>0&&(this._lineOut.push([t,i]),this._lineIn.push([t,i]))}_checkClosingPt(t){const i=t.length;i>3&&t[0][0]===this._xCut&&t[i-2][0]===this._xCut&&t[1][0]===this._xCut&&(t[0][1]=t[i-2][1],t.pop())}_side(t){return t<this._xCut?-1:t>this._xCut?1:0}_intersect(t,i){const s=(this._xCut-t[0])/(i[0]-t[0]);return t[1]+s*(i[1]-t[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function j(t,i,s){const n=t.length;n>1&&t[n-1][0]===i&&t[n-2][0]===i?t[n-1][1]=s:t.push([i,s])}export{S as CutVertical,a as normalizeCentralMeridianForDisplay,p as normalizeCentralMeridianSync};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../core/has.js";import"../../core/Logger.js";import"../../core/mathUtils.js";import"../../core/libs/gl-matrix-2/math/mat4.js";import"../../chunks/vec32.js";import"../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../chunks/vec42.js";import"../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../core/libs/gl-matrix-2/math/common.js";import"./Axis.js";import"./ray.js";import"./sphereUtils.js";import"./vector.js";import"./vectorStacks.js";export{N as NullSphere,D as altitudeAt,B as angleToSilhouette,C as axisAt,d as cameraFrustumCoverage,r as clear,A as closestPoint,k as closestPointOnSilhouette,o as containsPoint,e as copy,c as create,
|
|
5
|
+
import"../../core/has.js";import"../../core/Logger.js";import"../../core/mathUtils.js";import"../../core/libs/gl-matrix-2/math/mat4.js";import"../../chunks/vec32.js";import"../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../chunks/vec42.js";import"../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../core/libs/gl-matrix-2/math/common.js";import"./Axis.js";import"./ray.js";import"./sphereUtils.js";import"./vector.js";import"./vectorStacks.js";export{N as NullSphere,D as altitudeAt,B as angleToSilhouette,C as axisAt,d as cameraFrustumCoverage,r as clear,A as closestPoint,k as closestPointOnSilhouette,o as containsPoint,e as copy,c as create,j as distanceToSilhouette,v as elevate,q as equals,m as exactEquals,l as fromCenterAndRadius,b as fromRadius,f as fromValues,a as getCenter,y as getExtent,g as getRadius,n as intersectLine,h as intersectRay,z as intersectRayClosestSilhouette,i as intersectsRay,p as projectPoint,E as setAltitudeAt,x as setExtent,t as tmpSphere,u as union,w as wrap}from"../../chunks/sphere.js";
|