@arcgis/core 5.0.0-next.44 → 5.0.0-next.46
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +1 -0
- package/assets/esri/core/workers/chunks/{20ad34f9d45c64392022.js → 08c1ea29678da27136f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{5dc2f2e28c30386efadf.js → 10094eb2b94e98dd4a8a.js} +1 -1
- package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +1 -0
- package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +1 -0
- package/assets/esri/core/workers/chunks/{b809d499ff050976d9ed.js → 1c58064ea80e6a4a4a3b.js} +1 -1
- package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +1 -0
- package/assets/esri/core/workers/chunks/{ee67c8a7c1f8b482cd99.js → 1ced78750c61600b2d4e.js} +1 -1
- package/assets/esri/core/workers/chunks/{98175b454e807b1a3c5f.js → 1e152a34e368bd810a0f.js} +1 -1
- package/assets/esri/core/workers/chunks/1e17ad6cdffa5016a3db.js +1 -0
- package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +1 -0
- package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +1 -0
- package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +1 -0
- package/assets/esri/core/workers/chunks/2209550b6510e25da375.js +1 -0
- package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +1 -0
- package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +1 -0
- package/assets/esri/core/workers/chunks/{1c0fb4795a52204882a8.js → 2550d2ba935cfdf30236.js} +1 -1
- package/assets/esri/core/workers/chunks/{49e6219dd08cb6c27023.js → 273ac1066095d63d6a6f.js} +1 -1
- package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +1 -0
- package/assets/esri/core/workers/chunks/{cda5c95fd49b8901f7d4.js → 3298e96d3f2e49e338d2.js} +1 -1
- package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +1 -0
- package/assets/esri/core/workers/chunks/{e5baa30944061418cb13.js → 35f086a2ae0585348ae6.js} +1 -1
- package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → 37ea150dec5e491f691e.js} +1 -1
- package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +1 -0
- package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +1 -0
- package/assets/esri/core/workers/chunks/40a722933af28823953b.js +1 -0
- package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → 424daef7b5dec1b99aba.js} +1 -1
- package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +1 -0
- package/assets/esri/core/workers/chunks/{d14e75b160aa432233c6.js → 461093ce28ceadd7853d.js} +1 -1
- package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +1 -0
- package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +1 -0
- package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +1 -0
- package/assets/esri/core/workers/chunks/{31186e83fe009aa0fd36.js → 4d933de84afb2e3b7d18.js} +1 -1
- package/assets/esri/core/workers/chunks/{83aa39fbb1fad3b9d143.js → 4ff771942531fb2755c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0017c6739d2532793e6.js → 513a4ef960e27500f986.js} +1 -1
- package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +1 -0
- package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → 57fd5e1260269002d18a.js} +1 -1
- package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +1 -0
- package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 60362c5651ef41fa7e5f.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8a9971c8354569cb81d.js → 609919428305d8c8c243.js} +1 -1
- package/assets/esri/core/workers/chunks/{ab88577987cf2fe1cb32.js → 61373d2fa7e7638d3395.js} +1 -1
- package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +1 -0
- package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +1 -0
- package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +1 -0
- package/assets/esri/core/workers/chunks/{35272810c2ed04eb403d.js → 6f3943bebe2d5f4994f7.js} +1 -1
- package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +1 -0
- package/assets/esri/core/workers/chunks/{7ba13b52fce1060fbb2a.js → 7147fc7502b385b302b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ba8a2e1c0fb4e1efc7c.js → 7364fb5e99933533890d.js} +1 -1
- package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +1 -0
- package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +1 -0
- package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +1 -0
- package/assets/esri/core/workers/chunks/{040f3d8e1099c4843390.js → 81a60dfa600b690098f9.js} +1 -1
- package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +1 -0
- package/assets/esri/core/workers/chunks/{75643711d9585ee26a15.js → 83c8e5a92d8d6193cb32.js} +1 -1
- package/assets/esri/core/workers/chunks/{e537e1d37f3fcb14fce2.js → 870022661376442411e4.js} +1 -1
- package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +1 -0
- package/assets/esri/core/workers/chunks/{31b074ae2162a3508d2a.js → 8b578ffc3a83089aa782.js} +1 -1
- package/assets/esri/core/workers/chunks/{48c8ef4170e803a564d6.js → 8b75861196d1ce5cba63.js} +1 -1
- package/assets/esri/core/workers/chunks/8be61e13530fd0dc2fd1.js +1 -0
- package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +1 -0
- package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +1 -0
- package/assets/esri/core/workers/chunks/91d9ade78854f40a962d.js +1 -0
- package/assets/esri/core/workers/chunks/{74881340e040bfd0580f.js → 934bc1028b287f8df4aa.js} +1 -1
- package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +1 -0
- package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +1 -0
- package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +1 -0
- package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +1 -0
- package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +1 -0
- package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +1 -0
- package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +1 -0
- package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +1 -0
- package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +1 -0
- package/assets/esri/core/workers/chunks/aab93e885b6c7c6aa76e.js +316 -0
- package/assets/esri/core/workers/chunks/adfe28c1c1619cdd3ca1.js +1019 -0
- package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +1 -0
- package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +1 -0
- package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +1 -0
- package/assets/esri/core/workers/chunks/{9a855a10798348a21bab.js → bff814d34b38ec80c44d.js} +1 -1
- package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +1 -0
- package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +1 -0
- package/assets/esri/core/workers/chunks/{9461cc37ab3397265270.js → c5e8ff4721b15ac3c6eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{4cda42b94e9cb58dd372.js → ca61077e0a598654f33f.js} +1 -1
- package/assets/esri/core/workers/chunks/{61a9ffd4cf07d8bb7a9b.js → ca81be5bdb88ef557bf3.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca1c65eb7f5900c60170.js → cd8fec3500e6503ae020.js} +1 -1
- package/assets/esri/core/workers/chunks/ce90e8489143228262e7.js +1 -0
- package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +1 -0
- package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
- package/assets/esri/core/workers/chunks/{19820cddba13a3585c0b.js → d561624ddb9388732b25.js} +1 -1
- package/assets/esri/core/workers/chunks/d65ca3b8fccae8c3c3fa.js +1 -0
- package/assets/esri/core/workers/chunks/{630eba99f48ea79a9560.js → d705410c369bd03b1875.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c7682b300b877f60095.js → d76513a6260d9ec4ea25.js} +1 -1
- package/assets/esri/core/workers/chunks/{7c08c0824ad354177787.js → d7878fba02814adaf19f.js} +1 -1
- package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +1 -0
- package/assets/esri/core/workers/chunks/d8dc130ea559be1f68c6.js +1 -0
- package/assets/esri/core/workers/chunks/{768ae52b4e5c3e571ef5.js → dc29cb16704e2e4d0a46.js} +1 -1
- package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +1 -0
- package/assets/esri/core/workers/chunks/{3f33708eb39c7169a226.js → f2ba50eb29f93df885d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e5d41f51572e3e7cf92.js → f7163048146ddaedfc36.js} +1 -1
- package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +1 -0
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/urlUtils.d.ts +1 -0
- package/core/workers/workerFactory.js +1 -1
- package/geometry/FlatGeometry.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/curves/circleUtils.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +148 -21
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +2 -2
- package/rest/print.js +1 -1
- package/rest/support/LegendLayer.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +1 -1
- package/views/2d/interactive/SegmentLabels2D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/interactive/SegmentLabels3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.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/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatColorTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.js +5 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.js +5 -0
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/templates/GroupElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +5 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm/TextElementInput.d.ts +2 -2
- package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +5 -0
- package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +5 -0
- package/widgets/PanoramicViewer/support/PanoramicMediaError.js +5 -0
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Print/CustomTemplate.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print/TemplateOptions.js +1 -1
- package/widgets/Print.js +1 -1
- package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +0 -1
- package/assets/esri/core/workers/chunks/1e0e7cef7ef947894bbe.js +0 -1019
- package/assets/esri/core/workers/chunks/20988e116f3723228f36.js +0 -1
- package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +0 -1
- package/assets/esri/core/workers/chunks/274f2b5e6dbc58505142.js +0 -1
- package/assets/esri/core/workers/chunks/27dfbe3d903b95d4c67a.js +0 -1
- package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +0 -1
- package/assets/esri/core/workers/chunks/2c4218306747f5d15575.js +0 -1
- package/assets/esri/core/workers/chunks/2db7a7607657f1d669f7.js +0 -1
- package/assets/esri/core/workers/chunks/3767617c0dfc7d801441.js +0 -1
- package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +0 -1
- package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +0 -1
- package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +0 -1
- package/assets/esri/core/workers/chunks/538ddb267aa328814865.js +0 -1
- package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +0 -1
- package/assets/esri/core/workers/chunks/55818fe7a7aa1e5c8bbd.js +0 -1
- package/assets/esri/core/workers/chunks/5f781ef46ce7c4048c2f.js +0 -1
- package/assets/esri/core/workers/chunks/60f2de8dd8876bfd715a.js +0 -1
- package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +0 -1
- package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +0 -1
- package/assets/esri/core/workers/chunks/71dd80231ea656a6380c.js +0 -1
- package/assets/esri/core/workers/chunks/725819839434c59102f3.js +0 -1
- package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +0 -1
- package/assets/esri/core/workers/chunks/768d9b6eaba7bfa18dde.js +0 -1
- package/assets/esri/core/workers/chunks/77b45957cfe42523c1c8.js +0 -1
- package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +0 -1
- package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +0 -1
- package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +0 -1
- package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +0 -1
- package/assets/esri/core/workers/chunks/93c5f097bb7b380bb175.js +0 -1
- package/assets/esri/core/workers/chunks/9f0172b83f25ef5f8d40.js +0 -1
- package/assets/esri/core/workers/chunks/ae793d814cf32db9fbde.js +0 -1
- package/assets/esri/core/workers/chunks/b21cf62652ca772108c8.js +0 -1
- package/assets/esri/core/workers/chunks/c5c02ace54fe4ab9214b.js +0 -1
- package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +0 -1
- package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +0 -1
- package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +0 -1
- package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +0 -1
- package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +0 -1
- package/assets/esri/core/workers/chunks/e093e745708f722bc1b9.js +0 -1
- package/assets/esri/core/workers/chunks/e501d68a1464805c4b4e.js +0 -1
- package/assets/esri/core/workers/chunks/ea3cba01c60d9bc72719.js +0 -316
- package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +0 -1
package/widgets/Print.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{formatNumber as t}from"../intl.js";import i from"../core/Collection.js";import{deprecateWidget as a}from"../core/deprecate.js";import{JSONMap as l}from"../core/jsonMap.js";import o from"../core/Logger.js";import{watch as n,on as s,whenOnce as r}from"../core/reactiveUtils.js";import{unitName as c}from"../core/unitFormatUtils.js";import{addProxy as p,hasSameOrigin as d}from"../core/urlUtils.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureInteger as h}from"../core/accessorSupport/ensureType.js";import b from"../geometry/SpatialReference.js";import{isValid as _}from"../geometry/support/spatialReferenceUtils.js";import v from"../portal/Portal.js";import{reArcGISOnlineDomain as g}from"../portal/support/urlUtils.js";import{findToken as f}from"../rest/utils.js";import{formatJsonMap as y}from"../rest/support/fileFormat.js";import T from"./Widget.js";import w from"./Print/FileLink.js";import k from"./Print/PrintViewModel.js";import x from"./Print/TemplateOptions.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{globalCss as S}from"./support/globalCss.js";import{Heading as I}from"./support/Heading.js";import{legacyIcon as O}from"./support/legacyIcon.js";import{messageBundle as E,tsx as L,isRTL as $,tsxFragment as M,isActivationKey as F}from"./support/widget.js";const P="map-only",A="esri-print",R={base:A,headerTitle:`${A}__header-title`,layoutTabList:`${A}__layout-tab-list`,layoutTab:`${A}__layout-tab`,layoutSection:`${A}__layout-section`,mapOnlySection:`${A}__map-only-section`,panelItemsCentered:`${A}__panel-items--centered`,loader:`${A}__loader`,swapButton:`${A}__swap-button`,printButton:`${A}__export-button`,printButtonSection:`${A}__export-button-section`,printButtonSectionDivider:`${A}__export-button-section--divider`,templateSelectContainer:`${A}__template-select-container`,templateSelectIcon:`${A}__template-select-icon`,templateSelectError:`${A}__template-select-error`,templateSelectArrow:`${A}__template-select-arrow`,formSectionContainer:`${A}__form-section-container`,advancedOptionsSection:`${A}__advanced-options-section`,advancedOptionsContainer:`${A}__advanced-options-container`,browseTemplateButtonContainer:`${A}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${A}__browse-template-button-container-filter`,exportedFilesContainer:`${A}__export-panel-container`,exportedFilesTitle:`${A}__export-title`,exportedFile:`${A}__exported-file`,exportedFileLinkTitle:`${A}__exported-file-link-title`,exportedFileLinkDescription:`${A}__exported-file-link-description`,exportedFilesEmpty:`${A}__exported-files-empty`,printWidgetContainer:`${A}__container`,content:`${A}__content`,panelContainer:`${A}__panel-container`,scaleInfoContainer:`${A}__scale-info-container`,scaleInputContainer:`${A}__scale-input-container`,scaleInput:`${A}__scale-input`,sizeContainer:`${A}__size-container`,panelError:`${A}__panel--error`,exportedFileLoader:`${A}__exported-file--loader`,exportSection:`${A}__export-section`,exportSectionCentered:`${A}__export-section--centered`,templateButtonContainer:`${A}__template-button-container`,templateDoneButton:`${A}__template-done-button`,templateSelectFlowItemContainer:`${A}__template-select-flow-item-container`,templateSelectFlowItemContent:`${A}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${A}__template-select-flow-item-list-heading`,srLabel:`${A}__sr-label`,invalidWkidText:`${A}__invalid-wkid-text`};function B(e){return!isNaN(e)&&e>0&&Number.isFinite(e)}function N(e){return e?.toLowerCase()===P}function V(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const D=new l({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),j=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let U=class extends T{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._selectedTab="layoutTab",this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new k,this._onInput=e=>{"layoutTab"===this._selectedTab?this.templateOptions.title=e.currentTarget.value:"mapOnlyTab"===this._selectedTab&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=f(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},a(o.getLogger(this),"Print","arcgis-print",{version:"4.33"}),this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([n(()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format],()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=y.apiValues;this._formats=e.format.choiceList.map(e=>{const i=t.find(t=>new RegExp(`\\b${t}\\b`,"i").test(e))??e;return{value:i,label:e===i?e.toUpperCase():e}}).sort((e,t)=>e.label.localeCompare(t.label))}const t=this._formats.some(({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format));if(e.format.defaultValue&&!t){const t=this._formats.find(({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue))?.value;return void(t&&(this.templateOptions.format=t))}}),n(()=>[this.templateOptions.id,this.viewModel.loaded],()=>{const{layout:e}=this.templateOptions;this._selectedTab=N(e)?"mapOnlyTab":"layoutTab","layoutTab"===this._selectedTab&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))}),n(()=>this.templateOptions.dpi,e=>{e<=0&&(this.templateOptions.dpi=1)}),n(()=>this.viewModel.view?.scale,e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}),s(()=>this.viewModel,"submit",e=>this.emit("submit",e)),s(()=>this.viewModel,"complete",e=>this.emit("complete",e))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout(()=>{this._awaitingServerResponse=!0,this.scheduleRender()},500);this.viewModel.load().then(()=>{clearTimeout(i),this._awaitingServerResponse=!1})}loadDependencies(){return C({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get exportedLinks(){return this.viewModel.exportedLinks}set exportedLinks(e){this.viewModel.exportedLinks=e}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get saveExportEnabled(){return this.viewModel.saveExportEnabled}set saveExportEnabled(e){this.viewModel.saveExportEnabled=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:c,layout:p,layoutItem:d,legendEnabled:m,northArrowEnabled:u,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:y}=t,T="ready"!==i.state||this._awaitingServerResponse||!(p||d),w=this._renderTitleOrFileNameSection(),k=L("div",{class:R.formSectionContainer},L("calcite-label",null,e.fileFormatTitle,L("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map(({value:e,label:t},i)=>L("calcite-combobox-item",{key:`file-format-${i}`,selected:e===this.templateOptions.format,textLabel:t,value:e}))))),x=L("calcite-label",{layout:"inline"},L("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),C=L("div",null,L("div",{class:R.formSectionContainer},L("calcite-label",null,e.template,L("calcite-block",{class:R.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",label:e.template,loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},L("calcite-icon",{class:R.templateSelectIcon,icon:(this._selectedTemplate?.layout?j.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?L("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,L("calcite-icon",{class:R.templateSelectArrow,icon:$()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),x),E=L("div",{class:R.formSectionContainer},L("calcite-label",null,e.dpi,L("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._updateNumberInputValue}))),M=L("div",{class:R.formSectionContainer},L("calcite-label",null,L("div",{class:R.srLabel},e.outSpatialReference,L("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),L("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=h(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new b({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||_(i.outSpatialReference)}}),this._isValidSpatialReference?null:L("div",{class:R.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),F=L("div",{class:this.classes(R.scaleInfoContainer,R.formSectionContainer)},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),L("div",{class:R.scaleInputContainer},L("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:R.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),L("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),P=L("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:R.advancedOptionsContainer,key:"advanced-section-for-layout"},F,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?L("div",{class:R.formSectionContainer,key:"author-info"},L("calcite-label",null,e.author,L("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?L("div",{class:R.formSectionContainer,key:"copyright-text"},L("calcite-label",null,e.copyright,L("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,E,M,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?L("div",{class:R.formSectionContainer,key:"legend-info"},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:!!m,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?L("div",{class:R.formSectionContainer,key:"north-arrow"},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:!!u,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?L("div",{class:R.formSectionContainer,key:"scale-bar"},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),A=L("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:R.advancedOptionsContainer},F,E,M,L("div",{class:R.formSectionContainer},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),B=this.exportedLinks.toArray(),N=this._renderExportedLinkItems(B),V={[R.exportSectionCentered]:!B.length},D="layoutTab"===this._selectedTab?L("section",{"aria-labelledby":`${this.id}__layoutTab`,class:R.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},L("div",{class:R.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?w:null,C,"layoutTab"===this._selectedTab?k:null,L("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,disabled:!(p||d?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},P))):"mapOnlyTab"===this._selectedTab?L("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:R.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},L("div",{class:R.panelContainer},w,k,L("div",null,L("div",{class:this.classes(R.sizeContainer,R.formSectionContainer)},L("calcite-label",null,e.width,L("calcite-input-number",{bind:this,"data-input-name":"width",value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue})),L("calcite-label",null,e.height,L("calcite-input-number",{bind:this,"data-input-name":"height",value:`${c}`,onCalciteInputNumberInput:this._updateNumberInputValue})),L("button",{"aria-label":e.swap,bind:this,class:this.classes(S.widgetButton,R.swapButton,O.swap),onclick:this._switchInput,type:"button"})),x),L("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},A))):L("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(R.exportSection,V),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},L("div",{class:R.panelContainer},L("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:R.exportedFilesContainer},0===B.length?L("div",{class:R.exportedFilesEmpty},L("calcite-icon",{icon:"file",scale:"l"}),L("div",null,L(I,{class:R.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),L("div",null,e.exportHint))):N))),U="2d"!==a?.type,H=L("div",{class:R.panelError},a?U?e.sceneViewError:e.serviceError:e.noViewError),z=B.some(({state:e})=>"pending"===e),W=L("div",{class:R.content,key:"panel"},L("div",null,L("ul",{bind:this,class:R.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},L("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"layoutTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"layoutTab",id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),L("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"mapOnlyTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"mapOnlyTab",id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),L("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"exportTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"exportTab",id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},z?L("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),D),"exportTab"!==this._selectedTab?L("div",{class:this.classes(R.printButtonSection,!this.saveExportHidden&&this.portal?R.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,L("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(R.printButton),disabled:T||!(p||d?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),q=L("calcite-flow",{key:"root-flow"},L("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},L("div",{class:R.printWidgetContainer},this.headerVisible?L("header",{class:R.headerTitle},e.export):null,this.error||U||!a?H:W)),this._renderChooseTemplateFlowItem()),K="initializing"===i.state,J=K?this._renderLoader():q,G={[R.panelItemsCentered]:K};return L("div",{bind:this,class:this.classes(R.base,S.widget,S.panel,G)},J)}_getPageSizeLabel(e){if(!e)return;const i=e.layoutTemplateInfo;if(!i)return;const a=D.fromJSON(i.pageUnits.toLowerCase());return`${t(i.pageSize[0])} × ${t(i.pageSize[1])} ${c(this.messagesUnits,a,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l,type:o}=e;if("print-service-template"===o&&this.messages[a])return this.messages[a];const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:t,layoutItem:i})=>!N(t)&&!!i?.id&&e.includes(i.id)):[]}_getDefaultTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:t,layoutItem:i})=>!(N(t)||i?.id&&e.includes(i.id))):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter(({layout:e})=>!N(e))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort((e,t)=>(e.label??"")>(t.label??"")?1:-1),e.map(e=>L("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},L("calcite-icon",{icon:(e.layout?j.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?L("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?L("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?L("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=g.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?L("calcite-button",{appearance:"outline",class:n?R.browseTemplateButtonContainerFilter:R.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return L("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},L("div",{class:R.templateSelectFlowItemContainer},L("div",{class:R.templateSelectFlowItemContent},n?null:s,L("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?L("div",{key:"my-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.myTemplates,t?L("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?L("div",{key:"org-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.organizationTemplates,t?L("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?L("div",{key:"default-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?L("div",{key:"service-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),L("div",{class:R.templateButtonContainer},L("calcite-button",{class:R.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?L("div",{class:R.formSectionContainer,key:"custom-text-elements"},e.map((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:L("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,L("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))})):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l="layoutTab"===this._selectedTab?e:t,o="layoutTab"===this._selectedTab?i:a,n="layoutTab"===this._selectedTab?this.templateOptions.title:this.templateOptions.fileName;return L("div",{class:R.formSectionContainer,key:l},L("calcite-label",null,l,L("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&"layoutTab"===this._selectedTab||"mapOnlyTab"===t&&"mapOnlyTab"===this._selectedTab||"exportTab"===t&&"exportTab"===this._selectedTab)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[R.loader]:this._awaitingServerResponse};return L("div",{class:this.classes(e),key:"loader"})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find(e=>{const[i]=Object.entries(e)[0];return i===t})[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(!B(l)){const e=a[i];return void(t.value=`${e}`)}a[i]=l}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t="layoutTab"===this._selectedTab?e.title:e.fileName,{promise:i}=this.viewModel.export(t||this.messages.untitled);this._selectedTab="exportTab",i.then(()=>this.scheduleRender())}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,l=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&l?L("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s"},L("calcite-list",{label:""},e.portalItem?L("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},L("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):L("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(r(()=>e.portalItem).then(e=>{e.itemPageUrl&&this.scheduleRender()}),await this.saveAsButtonCallback(e))}},L("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),L("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},L("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e){const t=this.messages,{url:i,state:a,error:l}=e,o=e.formattedName??"";let n=i||null;n&&(n=p(n));const s=d(n,location.href),r="error"===a?"print-task:cim-symbol-unsupported"===l?.name?t.exportWebMapCIMError:t.exportWebMapError:null;return L("div",{class:R.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},L("div",null,L("div",{class:R.exportedFileLinkTitle},o),L("div",{class:R.exportedFileLinkDescription},"pending"===a?t.generatingExport:r||(s?t.ready:t.linkReady))),"ready"===a?L("calcite-icon",{"aria-label":`${o}. ${t.linkReady}`,icon:s?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?L("calcite-loader",{class:R.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):L("calcite-icon",{icon:V(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e){const{state:t}=e,i=e.formattedName??"",a=this.saveAsButtonCallback&&"error"!==t&&this._isFormatAllowedForSaving(e.extension);return"pending"!==t?L("calcite-action",{icon:a?"ellipsis":"x",id:a?`${i}-popover-button`:void 0,key:a?`${i}-saveAs-action`:`${i}-action`,onclick:a?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:a?this.messagesCommon.options:this.messagesCommon.remove}):null}_renderExportedLinkItem(e){const t=e.formattedName??"";return L(M,null,L("calcite-list-item",{key:t,label:t},this._renderExportedLinkItemContent(e),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return L("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList,selectionMode:"none"},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,"mapOnlyTab"===this._selectedTab)this.viewModel.applyTemplate(P);else if("layoutTab"===this._selectedTab){const e=this._selectedTemplate??this.viewModel.defaultTemplate;this.viewModel.applyTemplate(e)}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(F(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case"layoutTab":this._toggleTab("ArrowLeft"===t?"exportTab":"mapOnlyTab");break;case"mapOnlyTab":this._toggleTab("ArrowLeft"===t?"layoutTab":"exportTab");break;case"exportTab":this._toggleTab("ArrowLeft"===t?"mapOnlyTab":"layoutTab")}e.preventDefault(),e.stopPropagation()}}};e([m()],U.prototype,"_showTemplates",void 0),e([m()],U.prototype,"_isValidSpatialReference",void 0),e([m()],U.prototype,"allowedFormats",null),e([m()],U.prototype,"allowedFormatsForSaving",void 0),e([m()],U.prototype,"allowedLayouts",null),e([m()],U.prototype,"browseTemplateButtonOnClick",void 0),e([m()],U.prototype,"error",null),e([m({type:i.ofType(w)})],U.prototype,"exportedLinks",null),e([m()],U.prototype,"extraParameters",null),e([m()],U.prototype,"headerVisible",void 0),e([m()],U.prototype,"headingLevel",void 0),e([m()],U.prototype,"icon",null),e([m()],U.prototype,"includeDefaultTemplates",null),e([m()],U.prototype,"includeOrganizationTemplates",void 0),e([m()],U.prototype,"label",null),e([m(),E("esri/widgets/Print/t9n/Print")],U.prototype,"messages",void 0),e([m(),E("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([m(),E("esri/core/t9n/Units")],U.prototype,"messagesUnits",void 0),e([m({type:b})],U.prototype,"outSpatialReference",null),e([m({type:v})],U.prototype,"portal",null),e([m()],U.prototype,"saveExportEnabled",null),e([m()],U.prototype,"saveExportHidden",void 0),e([m()],U.prototype,"showPrintAreaEnabled",null),e([m()],U.prototype,"printServiceUrl",null),e([m()],U.prototype,"saveAsButtonCallback",void 0),e([m()],U.prototype,"templateCustomTextElements",null),e([m({type:x})],U.prototype,"templateOptions",null),e([m()],U.prototype,"view",null),e([m({type:k})],U.prototype,"viewModel",void 0),U=e([u("esri.widgets.Print")],U);const H=U;export{H as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{formatNumber as t}from"../intl.js";import i from"../core/Collection.js";import{deprecateWidget as a}from"../core/deprecate.js";import{JSONMap as l}from"../core/jsonMap.js";import o from"../core/Logger.js";import{watch as n,on as s,whenOnce as r}from"../core/reactiveUtils.js";import{unitName as c}from"../core/unitFormatUtils.js";import{addProxy as p,hasSameOrigin as d}from"../core/urlUtils.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureInteger as h}from"../core/accessorSupport/ensureType.js";import b from"../geometry/SpatialReference.js";import{isValid as _}from"../geometry/support/spatialReferenceUtils.js";import v from"../portal/Portal.js";import{reArcGISOnlineDomain as g}from"../portal/support/urlUtils.js";import{findToken as f}from"../rest/utils.js";import{formatJsonMap as y}from"../rest/support/fileFormat.js";import T from"./Widget.js";import w from"./Print/FileLink.js";import k from"./Print/PrintViewModel.js";import x from"./Print/TemplateOptions.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{globalCss as S}from"./support/globalCss.js";import{Heading as I}from"./support/Heading.js";import{legacyIcon as O}from"./support/legacyIcon.js";import{messageBundle as E,tsx as L,isRTL as $,tsxFragment as F,isActivationKey as M}from"./support/widget.js";const P="map-only",A="esri-print",R={base:A,headerTitle:`${A}__header-title`,layoutTabList:`${A}__layout-tab-list`,layoutTab:`${A}__layout-tab`,layoutSection:`${A}__layout-section`,mapOnlySection:`${A}__map-only-section`,panelItemsCentered:`${A}__panel-items--centered`,loader:`${A}__loader`,swapButton:`${A}__swap-button`,printButton:`${A}__export-button`,printButtonSection:`${A}__export-button-section`,printButtonSectionDivider:`${A}__export-button-section--divider`,templateSelectContainer:`${A}__template-select-container`,templateSelectIcon:`${A}__template-select-icon`,templateSelectError:`${A}__template-select-error`,templateSelectArrow:`${A}__template-select-arrow`,formSectionContainer:`${A}__form-section-container`,advancedOptionsSection:`${A}__advanced-options-section`,advancedOptionsContainer:`${A}__advanced-options-container`,browseTemplateButtonContainer:`${A}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${A}__browse-template-button-container-filter`,exportedFilesContainer:`${A}__export-panel-container`,exportedFilesTitle:`${A}__export-title`,exportedFile:`${A}__exported-file`,exportedFileLinkTitle:`${A}__exported-file-link-title`,exportedFileLinkDescription:`${A}__exported-file-link-description`,exportedFilesEmpty:`${A}__exported-files-empty`,printWidgetContainer:`${A}__container`,content:`${A}__content`,panelContainer:`${A}__panel-container`,scaleInfoContainer:`${A}__scale-info-container`,scaleInputContainer:`${A}__scale-input-container`,scaleInput:`${A}__scale-input`,sizeContainer:`${A}__size-container`,panelError:`${A}__panel--error`,exportedFileLoader:`${A}__exported-file--loader`,exportSection:`${A}__export-section`,exportSectionCentered:`${A}__export-section--centered`,templateButtonContainer:`${A}__template-button-container`,templateDoneButton:`${A}__template-done-button`,templateSelectFlowItemContainer:`${A}__template-select-flow-item-container`,templateSelectFlowItemContent:`${A}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${A}__template-select-flow-item-list-heading`,srLabel:`${A}__sr-label`,invalidWkidText:`${A}__invalid-wkid-text`};function B(e){return!isNaN(e)&&e>0&&Number.isFinite(e)}function N(e){return e?.toLowerCase()===P}function V(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const D=new l({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),j=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let U=class extends T{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._selectedTab="layoutTab",this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new k,this._onInput=e=>{"layoutTab"===this._selectedTab?this.templateOptions.title=e.currentTarget.value:"mapOnlyTab"===this._selectedTab&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=f(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},a(o.getLogger(this),"Print","arcgis-print",{version:"4.33"}),this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([n(()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format],()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=y.apiValues;this._formats=e.format.choiceList.map(e=>{const i=t.find(t=>new RegExp(`\\b${t}\\b`,"i").test(e))??e;return{value:i,label:e===i?e.toUpperCase():e}}).sort((e,t)=>e.label.localeCompare(t.label))}const t=this._formats.some(({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format));if(e.format.defaultValue&&!t){const t=this._formats.find(({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue))?.value;return void(t&&(this.templateOptions.format=t))}}),n(()=>[this.templateOptions.id,this.viewModel.loaded],()=>{const{layout:e}=this.templateOptions;this._selectedTab=N(e)?"mapOnlyTab":"layoutTab","layoutTab"===this._selectedTab&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))}),n(()=>this.templateOptions.dpi,e=>{e<=0&&(this.templateOptions.dpi=1)}),n(()=>this.viewModel.view?.scale,e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}),s(()=>this.viewModel,"submit",e=>this.emit("submit",e)),s(()=>this.viewModel,"complete",e=>this.emit("complete",e))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout(()=>{this._awaitingServerResponse=!0,this.scheduleRender()},500);this.viewModel.load().then(()=>{clearTimeout(i),this._awaitingServerResponse=!1})}loadDependencies(){return C({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get exportedLinks(){return this.viewModel.exportedLinks}set exportedLinks(e){this.viewModel.exportedLinks=e}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get saveExportEnabled(){return this.viewModel.saveExportEnabled}set saveExportEnabled(e){this.viewModel.saveExportEnabled=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:c,layout:p,layoutItem:d,legendEnabled:m,northArrowEnabled:u,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:y}=t,T="ready"!==i.state||this._awaitingServerResponse||!(p||d),w=this._renderTitleOrFileNameSection(),k=L("div",{class:R.formSectionContainer},L("calcite-label",null,e.fileFormatTitle,L("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map(({value:e,label:t},i)=>L("calcite-combobox-item",{key:`file-format-${i}`,selected:e===this.templateOptions.format,textLabel:t,value:e}))))),x=L("calcite-label",{layout:"inline"},L("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),C=L("div",null,L("div",{class:R.formSectionContainer},L("calcite-label",null,e.template,L("calcite-block",{class:R.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",label:e.template,loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},L("calcite-icon",{class:R.templateSelectIcon,icon:(this._selectedTemplate?.layout?j.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?L("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,L("calcite-icon",{class:R.templateSelectArrow,icon:$()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),x),E=L("div",{class:R.formSectionContainer},L("calcite-label",null,e.dpi,L("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._updateNumberInputValue}))),F=L("div",{class:R.formSectionContainer},L("calcite-label",null,L("div",{class:R.srLabel},e.outSpatialReference,L("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),L("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=h(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new b({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||_(i.outSpatialReference)}}),this._isValidSpatialReference?null:L("div",{class:R.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),M=L("div",{class:this.classes(R.scaleInfoContainer,R.formSectionContainer)},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),L("div",{class:R.scaleInputContainer},L("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:R.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),L("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),P=L("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:R.advancedOptionsContainer,key:"advanced-section-for-layout"},M,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?L("div",{class:R.formSectionContainer,key:"author-info"},L("calcite-label",null,e.author,L("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?L("div",{class:R.formSectionContainer,key:"copyright-text"},L("calcite-label",null,e.copyright,L("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,E,F,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?L("div",{class:R.formSectionContainer,key:"legend-info"},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:!!m,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?L("div",{class:R.formSectionContainer,key:"north-arrow"},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:!!u,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?L("div",{class:R.formSectionContainer,key:"scale-bar"},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),A=L("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:R.advancedOptionsContainer},M,E,F,L("div",{class:R.formSectionContainer},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),B=this.exportedLinks.toArray(),N=this._renderExportedLinkItems(B),V={[R.exportSectionCentered]:!B.length},D="layoutTab"===this._selectedTab?L("section",{"aria-labelledby":`${this.id}__layoutTab`,class:R.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},L("div",{class:R.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?w:null,C,"layoutTab"===this._selectedTab?k:null,L("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,disabled:!(p||d?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},P))):"mapOnlyTab"===this._selectedTab?L("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:R.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},L("div",{class:R.panelContainer},w,k,L("div",null,L("div",{class:this.classes(R.sizeContainer,R.formSectionContainer)},L("calcite-label",null,e.width,L("calcite-input-number",{bind:this,"data-input-name":"width",value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue})),L("calcite-label",null,e.height,L("calcite-input-number",{bind:this,"data-input-name":"height",value:`${c}`,onCalciteInputNumberInput:this._updateNumberInputValue})),L("button",{"aria-label":e.swap,bind:this,class:this.classes(S.widgetButton,R.swapButton,O.swap),onclick:this._switchInput,type:"button"})),x),L("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},A))):L("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(R.exportSection,V),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},L("div",{class:R.panelContainer},L("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:R.exportedFilesContainer},0===B.length?L("div",{class:R.exportedFilesEmpty},L("calcite-icon",{icon:"file",scale:"l"}),L("div",null,L(I,{class:R.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),L("div",null,e.exportHint))):N))),U="2d"!==a?.type,H=L("div",{class:R.panelError},a?U?e.sceneViewError:e.serviceError:e.noViewError),z=B.some(({state:e})=>"pending"===e),W=L("div",{class:R.content,key:"panel"},L("div",null,L("ul",{bind:this,class:R.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},L("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"layoutTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"layoutTab",id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),L("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"mapOnlyTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"mapOnlyTab",id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),L("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"exportTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"exportTab",id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},z?L("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),D),"exportTab"!==this._selectedTab?L("div",{class:this.classes(R.printButtonSection,!this.saveExportHidden&&this.portal?R.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,L("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(R.printButton),disabled:T||!(p||d?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),q=L("calcite-flow",{key:"root-flow"},L("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},L("div",{class:R.printWidgetContainer},this.headerVisible?L("header",{class:R.headerTitle},e.export):null,this.error||U||!a?H:W)),this._renderChooseTemplateFlowItem()),K="initializing"===i.state,J=K?this._renderLoader():q,G={[R.panelItemsCentered]:K};return L("div",{bind:this,class:this.classes(R.base,S.widget,S.panel,G)},J)}_getPageSizeLabel(e){if(!e)return;const i=e.layoutTemplateInfo;if(!i)return;const a=D.fromJSON(i.pageUnits.toLowerCase());return`${t(i.pageSize[0])} × ${t(i.pageSize[1])} ${c(this.messagesUnits,a,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l}=e,o=a&&!l&&this.messages[a]?this.messages[a]:null;if(o)return o;const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!N(e)&&!!t?.id):[]}_getDefaultTemplates(){return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!N(e)&&!t?.id):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter(({layout:e})=>!N(e))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort((e,t)=>(e.label??"")>(t.label??"")?1:-1),e.map(e=>L("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},L("calcite-icon",{icon:(e.layout?j.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?L("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?L("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?L("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=g.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?L("calcite-button",{appearance:"outline",class:n?R.browseTemplateButtonContainerFilter:R.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return L("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},L("div",{class:R.templateSelectFlowItemContainer},L("div",{class:R.templateSelectFlowItemContent},n?null:s,L("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?L("div",{key:"my-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.myTemplates,t?L("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?L("div",{key:"org-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.organizationTemplates,t?L("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?L("div",{key:"default-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?L("div",{key:"service-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),L("div",{class:R.templateButtonContainer},L("calcite-button",{class:R.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?L("div",{class:R.formSectionContainer,key:"custom-text-elements"},e.map((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:L("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,L("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))})):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l="layoutTab"===this._selectedTab?e:t,o="layoutTab"===this._selectedTab?i:a,n="layoutTab"===this._selectedTab?this.templateOptions.title:this.templateOptions.fileName;return L("div",{class:R.formSectionContainer,key:l},L("calcite-label",null,l,L("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&"layoutTab"===this._selectedTab||"mapOnlyTab"===t&&"mapOnlyTab"===this._selectedTab||"exportTab"===t&&"exportTab"===this._selectedTab)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[R.loader]:this._awaitingServerResponse};return L("div",{class:this.classes(e),key:"loader"})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find(e=>{const[i]=Object.entries(e)[0];return i===t})[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(!B(l)){const e=a[i];return void(t.value=`${e}`)}a[i]=l}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t="layoutTab"===this._selectedTab?e.title:e.fileName,{promise:i}=this.viewModel.export(t||this.messages.untitled);this._selectedTab="exportTab",i.then(()=>this.scheduleRender())}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,l=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&l?L("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s"},L("calcite-list",{label:""},e.portalItem?L("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},L("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):L("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(r(()=>e.portalItem).then(e=>{e.itemPageUrl&&this.scheduleRender()}),await this.saveAsButtonCallback(e))}},L("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),L("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},L("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e){const t=this.messages,{url:i,state:a,error:l}=e,o=e.formattedName??"";let n=i||null;n&&(n=p(n));const s=d(n,location.href),r="error"===a?"print-task:cim-symbol-unsupported"===l?.name?t.exportWebMapCIMError:t.exportWebMapError:null;return L("div",{class:R.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},L("div",null,L("div",{class:R.exportedFileLinkTitle},o),L("div",{class:R.exportedFileLinkDescription},"pending"===a?t.generatingExport:r||(s?t.ready:t.linkReady))),"ready"===a?L("calcite-icon",{"aria-label":`${o}. ${t.linkReady}`,icon:s?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?L("calcite-loader",{class:R.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):L("calcite-icon",{icon:V(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e){const{state:t}=e,i=e.formattedName??"",a=this.saveAsButtonCallback&&"error"!==t&&this._isFormatAllowedForSaving(e.extension);return"pending"!==t?L("calcite-action",{icon:a?"ellipsis":"x",id:a?`${i}-popover-button`:void 0,key:a?`${i}-saveAs-action`:`${i}-action`,onclick:a?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:a?this.messagesCommon.options:this.messagesCommon.remove}):null}_renderExportedLinkItem(e){const t=e.formattedName??"";return L(F,null,L("calcite-list-item",{key:t,label:t},this._renderExportedLinkItemContent(e),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return L("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList,selectionMode:"none"},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,"mapOnlyTab"===this._selectedTab)this.viewModel.applyTemplate(P);else if("layoutTab"===this._selectedTab){const e=this._selectedTemplate??this.viewModel.defaultTemplate;this.viewModel.applyTemplate(e)}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(M(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case"layoutTab":this._toggleTab("ArrowLeft"===t?"exportTab":"mapOnlyTab");break;case"mapOnlyTab":this._toggleTab("ArrowLeft"===t?"layoutTab":"exportTab");break;case"exportTab":this._toggleTab("ArrowLeft"===t?"mapOnlyTab":"layoutTab")}e.preventDefault(),e.stopPropagation()}}};e([m()],U.prototype,"_showTemplates",void 0),e([m()],U.prototype,"_isValidSpatialReference",void 0),e([m()],U.prototype,"allowedFormats",null),e([m()],U.prototype,"allowedFormatsForSaving",void 0),e([m()],U.prototype,"allowedLayouts",null),e([m()],U.prototype,"browseTemplateButtonOnClick",void 0),e([m()],U.prototype,"error",null),e([m({type:i.ofType(w)})],U.prototype,"exportedLinks",null),e([m()],U.prototype,"extraParameters",null),e([m()],U.prototype,"headerVisible",void 0),e([m()],U.prototype,"headingLevel",void 0),e([m()],U.prototype,"icon",null),e([m()],U.prototype,"includeDefaultTemplates",null),e([m()],U.prototype,"includeOrganizationTemplates",void 0),e([m()],U.prototype,"label",null),e([m(),E("esri/widgets/Print/t9n/Print")],U.prototype,"messages",void 0),e([m(),E("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([m(),E("esri/core/t9n/Units")],U.prototype,"messagesUnits",void 0),e([m({type:b})],U.prototype,"outSpatialReference",null),e([m({type:v})],U.prototype,"portal",null),e([m()],U.prototype,"saveExportEnabled",null),e([m()],U.prototype,"saveExportHidden",void 0),e([m()],U.prototype,"showPrintAreaEnabled",null),e([m()],U.prototype,"printServiceUrl",null),e([m()],U.prototype,"saveAsButtonCallback",void 0),e([m()],U.prototype,"templateCustomTextElements",null),e([m({type:x})],U.prototype,"templateOptions",null),e([m()],U.prototype,"view",null),e([m({type:k})],U.prototype,"viewModel",void 0),U=e([u("esri.widgets.Print")],U);const H=U;export{H as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1698,7375],{21015:(e,t,r)=>{r.d(t,{R:()=>u});var n=r(11254),o=r(60999),s=r(49186),a=r(74887),i=r(84952);class u{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,i.DB)(e)?((0,a.Te)(t),(0,i.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const i=await(0,o.Ke)((0,n.A)(t,{responseType:e,...r}));if(i.ok)return i.value.data;throw(0,a.QP)(i.error),new s.A("gltf-loader-request-error",`Request for resource failed: ${i.error}`)}}},24045:(e,t,r)=>{function n(e,t){const r=e.count;t||(t=new e.TypedArrayConstructor(r));for(let n=0;n<r;n++)t[n]=e.get(n);return t}r.d(t,{m:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,makeDense:n},Symbol.toStringTag,{value:"Module"}))},43609:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>a,n:()=>o});var n=r(34275);function o(e,t){s(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r=2,o=r){const s=t.length/2;let a=0,i=0;if(!(0,n.iu)(t)||(0,n.dk)(t)){for(let n=0;n<s;++n)e[a]=t[i],e[a+1]=t[i+1],a+=r,i+=o;return}const u=(0,n.a3)(t);if((0,n.JI)(t))for(let n=0;n<s;++n)e[a]=Math.max(t[i]/u,-1),e[a+1]=Math.max(t[i+1]/u,-1),a+=r,i+=o;else for(let n=0;n<s;++n)e[a]=t[i]/u,e[a+1]=t[i+1]/u,a+=r,i+=o}function a(e,t,r,n){const o=e.typedBuffer,s=e.typedBufferStride,a=n?.count??e.count;let i=(n?.dstIndex??0)*s;for(let e=0;e<a;++e)o[i]=t,o[i+1]=r,i+=s}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:s,normalizeIntegerBufferView:o},Symbol.toStringTag,{value:"Module"}))},46140:(e,t,r)=>{r.d(t,{R:()=>o});var n=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new n.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,s]=t.split("."),a=/^\s*\d+\s*$/;if(!o?.match||!a.test(o))throw new n.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!a.test(s))throw new n.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const i=parseInt(o,10),u=parseInt(s,10);return new e(i,u,r)}}},51530:(e,t,r)=>{r.d(t,{KB:()=>a,Xi:()=>o,pn:()=>i,x3:()=>s});var n=r(44208);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function s(e){return"encoded-mesh-texture"===e?.type}async function a(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function i(e,t){if("image/ktx2"===t)return new o(e);const r=new Blob([e],{type:t});let s=URL.createObjectURL(r);switch(t){case"image/jpeg":s+="#.jpg";break;case"image/png":s+="#.png"}const a=new Image;if((0,n.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{o(),e(a)},n=e=>{o(),t(e)},o=()=>{URL.revokeObjectURL(s),a.removeEventListener("load",r),a.removeEventListener("error",n)};a.addEventListener("load",r),a.addEventListener("error",n),a.src=s});try{a.src=s,await a.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(s),a}},51698:(e,t,r)=>{r.d(t,{loadGLTF:()=>j});var n=r(53966),o=r(93637),s=r(9093),a=r(49186),i=r(91869),u=r(74887),l=r(84952),c=r(46140),f=r(58083),d=r(67026),p=r(82534),m=r(13030),h=r(24045),T=(r(44208),r(2741));let _;function g(){return _??=(async()=>{const{default:e}=await r.e(2423).then(r.bind(r,2423));return await e({locateFile:e=>(0,T.s)(`esri/libs/dracoMeshDecoder/${e}`)})})(),_}class y{constructor(e){this._data=e,this._offset4=0,this._dataUint32=new Uint32Array(this._data,0,Math.floor(this._data.byteLength/4))}readUint32(){const e=this._offset4;return this._offset4+=1,this._dataUint32[e]}readUint8Array(e){const t=4*this._offset4;return this._offset4+=e/4,new Uint8Array(this._data,t,e)}remainingBytes(){return this._data.byteLength-4*this._offset4}}var w=r(21818);const x={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1},b={pbrMetallicRoughness:x,emissiveFactor:[0,0,0],alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1},S={ESRI_externalColorMixMode:"tint",ESRI_receiveShadows:!0,ESRI_receiveAmbientOcclusion:!0},R=(e={})=>{const t={...x,...e.pbrMetallicRoughness},r=function(e){switch(e.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:(0,w.Xb)(e.ESRI_externalColorMixMode),e.ESRI_externalColorMixMode="tint"}return e}({...S,...e.extras});return{...b,...e,pbrMetallicRoughness:t,extras:r}},A={magFilter:9729,minFilter:9987,wrapS:10497,wrapT:10497},E=e=>({...A,...e});var O=r(51530),N=r(63907);const v=1179937895;class I{constructor(e,t,r,n){if(this._context=e,this.uri=t,this.json=r,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._dracoBuffersSize=0,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform","KHR_draco_mesh_compression","KHR_materials_emissive_strength"],this._baseUri=function(e){let t,r;return e.replace(/^(.*\/)?([^/]*)$/,(e,n,o)=>(t=n||"",r=o||"","")),{dirPart:t,filePart:r}}(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==r.scenes)throw new a.A("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==r.meshes)throw new a.A("gltf-loader-unsupported-feature","Meshes must be defined");if(null==r.nodes)throw new a.A("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,t,r){if((0,l.DB)(t)){const r=(0,l.r$)(t);if(r&&"model/gltf-binary"!==r.mediaType)try{const n=JSON.parse(r.isBase64?atob(r.data):r.data);return new I(e,t,n)}catch{}const n=(0,l.lJ)(t);if(I._isGLBData(n))return this._fromGLBData(e,t,n)}if(F.test(t)||"gltf"===r?.expectedType){const n=await e.loadJSON(t,r);return new I(e,t,n)}const n=await e.loadBinary(t,r);if(I._isGLBData(n))return this._fromGLBData(e,t,n);if(P.test(t)||"glb"===r?.expectedType)throw new a.A("gltf-loader-invalid-glb","This is not a valid glb file.");const o=await e.loadJSON(t,r);return new I(e,t,o)}static _isGLBData(e){if(null==e)return!1;const t=new y(e);return t.remainingBytes()>=4&&t.readUint32()===v}static async _fromGLBData(e,t,r){const n=await I._parseGLBData(r);return new I(e,t,n.json,n.binaryData)}static async _parseGLBData(e){const t=new y(e);if(t.remainingBytes()<12)throw new a.A("gltf-loader-error","glb binary data is insufficiently large.");const r=t.readUint32(),o=t.readUint32(),s=t.readUint32();if(r!==v)throw new a.A("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength<s)throw new a.A("gltf-loader-error","glb binary data is smaller than header specifies.");if(2!==o)throw new a.A("gltf-loader-unsupported-feature","An unsupported glb container version was detected. Only version 2 is supported.");let i,u,l=0;for(;t.remainingBytes()>=8;){const e=t.readUint32(),r=t.readUint32();if(0===l){if(1313821514!==r)throw new a.A("gltf-loader-error","First glb chunk must be JSON.");if(e<0)throw new a.A("gltf-loader-error","No JSON data found.");i=await(0,O.KB)(t.readUint8Array(e))}else if(1===l){if(5130562!==r)throw new a.A("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");u=t.readUint8Array(e)}else n.A.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");l+=1}if(!i)throw new a.A("gltf-loader-error","No glb JSON chunk detected.");return{json:i,binaryData:u}}async getBuffer(e,t){const r=this.json.buffers[e];if(null==r.uri){if(null==this._glbBuffer)throw new a.A("gltf-loader-error","glb buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(e,t);if(n.byteLength!==r.byteLength)throw new a.A("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const n=this.json.buffers[e].uri,o=this._context.loadBinary(this._resolveUri(n),t).then(e=>new Uint8Array(e));return this._bufferLoaders.set(e,o),o}_validateAccessor(e){if(!this.json.accessors)throw new a.A("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if(t.type in["MAT2","MAT3","MAT4"])throw new a.A("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);return t}_getComponentInfo(e,t){const r=L[e.type],n=t?.componentType||e.componentType,o=M[n];return{componentType:n,componentCount:r,componentByteSize:o,denseByteStride:r*o}}getDracoAccessor(e,t){const r=this._validateAccessor(e),n=t.accessorInfos.get(e),{componentType:o,componentCount:s,componentByteSize:a,denseByteStride:i}=this._getComponentInfo(r,n);return{raw:t.data.buffer,byteStride:i,byteOffset:t.data.byteOffset+(n?.byteOffset||0),entryCount:n?.count??r.count,isDenselyPacked:!0,componentCount:s,componentByteSize:a,componentType:o,min:r.min,max:r.max,normalized:!!r.normalized}}async getAccessor(e,t){const r=this._validateAccessor(e);if(null==r?.bufferView)throw new a.A("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");const{componentCount:n,componentByteSize:o,denseByteStride:s}=this._getComponentInfo(r),i=this.json.bufferViews[r.bufferView],u=await this.getBuffer(i.buffer,t),l=i.byteStride||s;return{raw:u.buffer,byteStride:l,byteOffset:u.byteOffset+(i.byteOffset||0)+(r.byteOffset||0),entryCount:r.count,isDenselyPacked:l===s,componentCount:n,componentByteSize:o,componentType:r.componentType,min:r.min,max:r.max,normalized:!!r.normalized}}async getIndexData(e,t,r){if(null==e.indices)return;const n=e.indices,o=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(o.isDenselyPacked)switch(o.componentType){case N.pe.UNSIGNED_BYTE:return new Uint8Array(o.raw,o.byteOffset,o.entryCount);case N.pe.UNSIGNED_SHORT:return new Uint16Array(o.raw,o.byteOffset,o.entryCount);case N.pe.UNSIGNED_INT:return new Uint32Array(o.raw,o.byteOffset,o.entryCount)}else switch(o.componentType){case N.pe.UNSIGNED_BYTE:return(0,h.m)(U(m.SL,o));case N.pe.UNSIGNED_SHORT:return(0,h.m)(U(m.h,o));case N.pe.UNSIGNED_INT:return(0,h.m)(U(m.P,o))}}async getPositionData(e,t,r){if(null==e.attributes.POSITION)throw new a.A("gltf-loader-unsupported-feature","No POSITION vertex data found.");const n=e.attributes.POSITION,s=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(s.componentType!==N.pe.FLOAT)throw new a.A("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+(0,o.i7)(N.pe,s.componentType));if(3!==s.componentCount)throw new a.A("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+s.componentCount.toFixed());return U(m.xs,s)}async getNormalData(e,t,r){if(null==e.attributes.NORMAL)throw new a.A("gltf-loader-error","No NORMAL vertex data found.");const n=e.attributes.NORMAL,s=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(s.componentType!==N.pe.FLOAT)throw new a.A("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+(0,o.i7)(N.pe,s.componentType));if(3!==s.componentCount)throw new a.A("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+s.componentCount.toFixed());return U(m.xs,s)}async getTangentData(e,t,r){if(null==e.attributes.TANGENT)throw new a.A("gltf-loader-error","No TANGENT vertex data found.");const n=e.attributes.TANGENT,s=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(s.componentType!==N.pe.FLOAT)throw new a.A("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+(0,o.i7)(N.pe,s.componentType));if(4!==s.componentCount)throw new a.A("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+s.componentCount.toFixed());return U(m.Eq,s)}async getTextureCoordinates(e,t,r){if(null==e.attributes.TEXCOORD_0)throw new a.A("gltf-loader-error","No TEXCOORD_0 vertex data found.");const n=e.attributes.TEXCOORD_0,o=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(2!==o.componentCount)throw new a.A("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+o.componentCount.toFixed());if(o.componentType===N.pe.FLOAT)return U(m.gH,o);if(!o.normalized)throw new a.A("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return function(e){switch(e.componentType){case N.pe.BYTE:return new m.D6(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.UNSIGNED_BYTE:return new m.LC(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.SHORT:return new m.mJ(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.UNSIGNED_SHORT:return new m.Yi(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.UNSIGNED_INT:return new m.An(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.FLOAT:return new m.gH(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}(o)}async getVertexColors(e,t,r){if(null==e.attributes.COLOR_0)throw new a.A("gltf-loader-error","No COLOR_0 vertex data found.");const n=e.attributes.COLOR_0,s=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(4!==s.componentCount&&3!==s.componentCount)throw new a.A("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+s.componentCount.toFixed());if(4===s.componentCount){if(s.componentType===N.pe.FLOAT)return U(m.Eq,s);if(s.componentType===N.pe.UNSIGNED_BYTE)return U(m.XP,s);if(s.componentType===N.pe.UNSIGNED_SHORT)return U(m.Uz,s)}else if(3===s.componentCount){if(s.componentType===N.pe.FLOAT)return U(m.xs,s);if(s.componentType===N.pe.UNSIGNED_BYTE)return U(m.eI,s);if(s.componentType===N.pe.UNSIGNED_SHORT)return U(m.nS,s)}throw new a.A("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+(0,o.i7)(N.pe,s.componentType))}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const o=null!=e.material?R(this.json.materials[e.material]):R(),s=o.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(s.baseColorTexture,t),u=this.getTexture(o.normalTexture,t),l=r?this.getTexture(o.occlusionTexture,t):void 0,c=r?this.getTexture(o.emissiveTexture,t):void 0,f=r?this.getTexture(s.metallicRoughnessTexture,t):void 0,d=null!=e.material?e.material:-1;n={alphaMode:o.alphaMode,alphaCutoff:o.alphaCutoff,color:s.baseColorFactor,doubleSided:!!o.doubleSided,colorTexture:await i,normalTexture:await u,name:o.name,id:d,occlusionTexture:await l,emissiveTexture:await c,emissiveFactor:o.emissiveFactor,emissiveStrengthKHR:o.extensions?.KHR_materials_emissive_strength?.emissiveStrength,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,metallicRoughnessTexture:await f,hasVertexColors:a,ESRI_externalColorMixMode:o.extras.ESRI_externalColorMixMode,colorTextureTransform:s?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:o.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:o.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:o.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:s?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:o.extras.ESRI_receiveAmbientOcclusion,receiveShadows:o.extras.ESRI_receiveShadows}}return n}async decode(e,t){const r=e.extensions?.KHR_draco_mesh_compression;if(!r)return;if(null==e.indices)throw new a.A("gltf-loader-error","Found Draco compressed primitive without indices.");const n=this.json.bufferViews[r.bufferView],o=await this.getBuffer(n.buffer,t),s=(await g()).decode(new Uint8Array(o.buffer,o.byteOffset+(n.byteOffset||0),n.byteLength));this._bufferLoaders.delete(n.buffer);const i=new Map([[e.indices,s.indices],[e.attributes.POSITION,s.positions]]);return e.attributes.TEXCOORD_0&&i.set(e.attributes.TEXCOORD_0,s.uvs),e.attributes.NORMAL&&i.set(e.attributes.NORMAL,s.normals),e.attributes.COLOR_0&&i.set(e.attributes.COLOR_0,s.colors),e.attributes.TANGENT&&i.set(e.attributes.TANGENT,s.tangents),this._dracoBuffersSize+=s.buffer.byteLength,{data:s.buffer,accessorInfos:i}}async getTexture(e,t){if(!e)return;if(0!==(e.texCoord||0))throw new a.A("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const r=e.index,n=this.json.textures[r],o=E(null!=n.sampler?this.json.samplers[n.sampler]:{}),s=D(n),u=this.json.images[s],l=await this._loadTextureImageData(r,n,t);return(0,i.tE)(this._textureCache,r,()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>{throw new a.A("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${e}`)};return{data:l,wrapS:e(o.wrapS)?o.wrapS:t(o.wrapS),wrapT:e(o.wrapT)?o.wrapT:t(o.wrapT),minFilter:o.minFilter,name:u.name,id:r}})}getNodeTransform(e){if(void 0===e)return C;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),n=this.json.nodes[e];n.matrix?t=(0,f.lw)((0,s.vt)(),r,n.matrix):n.translation||n.rotation||n.scale?(t=(0,s.o8)(r),n.translation&&(0,f.Tl)(t,t,n.translation),n.rotation&&(G[3]=(0,d.Xd)(G,n.rotation),(0,f.e$)(t,t,G[3],G)),n.scale&&(0,f.hs)(t,t,n.scale)):t=(0,s.o8)(r),this._nodeTransformCache.set(e,t)}return t}_resolveUri(e){return(0,l.s2)(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=c.R.parse(this.json.asset.version,"glTF");B.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(e=>this._supportedExtensions.includes(e)))throw new a.A("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(e=>{this._nodeParentMap.set(e,t)})})}async _loadTextureImageData(e,t,r){const n=this._textureLoaders.get(e);if(n)return n;const o=this._createTextureLoader(t,r);return this._textureLoaders.set(e,o),o}async _createTextureLoader(e,t){const r=D(e),n=this.json.images[r];if(n.uri){if(n.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(n.uri),t);return new O.Xi(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(n.uri),t)}if(null==n.bufferView)throw new a.A("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==n.mimeType)throw new a.A("gltf-loader-unsupported-feature","Image mimeType must be defined.");const o=this.json.bufferViews[n.bufferView],s=await this.getBuffer(o.buffer,t);if(null!=o.byteStride)throw new a.A("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=s.byteOffset+(o.byteOffset||0);return(0,O.pn)(new Uint8Array(s.buffer,i,o.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await(0,u.nA)(Array.from(this._bufferLoaders.values())),t=await(0,u.nA)(Array.from(this._textureLoaders.values()));return e.reduce((e,t)=>e+(t?.byteLength??0),0)+this._dracoBuffersSize+t.reduce((e,t)=>e+(t?(0,O.x3)(t)?t.data.byteLength:t.width*t.height*4:0),0)}}const C=(0,f.hM)((0,s.vt)(),Math.PI/2),B=new c.R(2,0,"glTF"),G=(0,p.vt)(),L={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},M={[N.pe.BYTE]:1,[N.pe.UNSIGNED_BYTE]:1,[N.pe.SHORT]:2,[N.pe.UNSIGNED_SHORT]:2,[N.pe.HALF_FLOAT]:2,[N.pe.FLOAT]:4,[N.pe.INT]:4,[N.pe.UNSIGNED_INT]:4};function U(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}function D(e){if(null!=e.extensions?.KHR_texture_basisu)return e.extensions.KHR_texture_basisu.source;if(null!==e.source)return e.source;throw new a.A("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const F=/\.gltf$/i,P=/\.glb$/i;let H=0;async function j(e,t,r={},a=!0){const i=await I.load(e,t,r),u="gltf_"+H++,l={lods:[],materials:new Map,textures:new Map,meta:$(i)},c=!(!i.json.asset.extras||"symbolResource"!==i.json.asset.extras.ESRI_type),f=i.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,d=new Map;let p=!1;await k(i,async(e,t,c,f)=>{const m=d.get(c)??0;d.set(c,m+1);const h=void 0!==e.mode?e.mode:N.WR.TRIANGLES,T=h===N.WR.TRIANGLES||h===N.WR.TRIANGLE_STRIP||h===N.WR.TRIANGLE_FAN?h:null;if(null==T)return void n.A.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+(0,o.i7)(N.WR,h)+"). Skipping primitive.");if(!i.hasPositions(e))return void n.A.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const _=await i.decode(e,r);p||=!!_;const g=i.getPositionData(e,r,_),y=i.getMaterial(e,r,a),w=i.hasNormals(e)?i.getNormalData(e,r,_):null,x=i.hasTangents(e)?i.getTangentData(e,r,_):null,b=i.hasTextureCoordinates(e)?i.getTextureCoordinates(e,r,_):null,S=i.hasVertexColors(e)?i.getVertexColors(e,r,_):null,R=i.getIndexData(e,r,_),A={name:f,transform:(0,s.o8)(t),attributes:{position:await g,normal:w?await w:null,texCoord0:b?await b:null,color:S?await S:null,tangent:x?await x:null},indices:await R,primitiveType:T,material:z(l,await y,u)};let E=null;null!=l.meta?.ESRI_lod&&"screenSpaceRadius"===l.meta.ESRI_lod.metric&&(E=l.meta.ESRI_lod.thresholds[c]),l.lods[c]=l.lods[c]||{parts:[],name:f,lodThreshold:E},l.lods[c].parts[m]=A});for(const e of l.lods)e.parts=e.parts.filter(e=>!!e);const m=await i.getLoadedBuffersSize();return{model:l,meta:{isEsriSymbolResource:c,uri:i.uri,ESRI_webstyle:f,isDracoDecompressed:p},customMeta:{},usedMemory:m}}function $(e){const t=e.json;let r=null;return t.nodes.forEach(e=>{const t=e.extras;null!=t&&(t.ESRI_proxyEllipsoid||t.ESRI_lod)&&(r=t)}),r}async function k(e,t){const r=e.json,o=r.scenes[r.scene||0].nodes,s=o.length>1,a=[];for(const e of o){const t=r.nodes[e];a.push(i(e,0)),V(t)&&!s&&t.extensions.MSFT_lod.ids.forEach((e,t)=>i(e,t+1))}async function i(o,s){const u=r.nodes[o],l=e.getNodeTransform(o);if(null!=u.weights&&n.A.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),null!=u.mesh){const e=r.meshes[u.mesh];for(const r of e.primitives)a.push(t(r,l,s,e.name))}for(const e of u.children||[])a.push(i(e,s))}await Promise.all(a)}function V(e){return e.extensions?.MSFT_lod&&Array.isArray(e.extensions.MSFT_lod.ids)}function z(e,t,r){const n=t=>{const n=`${r}_tex_${t&&t.id}${t?.name?"_"+t.name:""}`;if(t&&!e.textures.has(n)){const r=function(e,t={}){return{data:e,parameters:{wrap:{s:10497,t:10497,...t.wrap},noUnpackFlip:!0,mipmap:!1,...t}}}(t.data,{wrap:{s:t.wrapS,t:t.wrapT},mipmap:X.has(t.minFilter),noUnpackFlip:!0});e.textures.set(n,r)}return n},o=`${r}_mat_${t.id}_${t.name}`;if(!e.materials.has(o)){const r=function(e={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclusion:!0,colorTexture:null,normalTexture:null,occlusionTexture:null,emissiveTexture:null,emissiveStrengthKHR:null,metallicRoughnessTexture:null,colorTextureTransform:null,normalTextureTransform:null,occlusionTextureTransform:null,emissiveTextureTransform:null,metallicRoughnessTextureTransform:null,emissiveFactor:[0,0,0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...e}}({color:[t.color[0],t.color[1],t.color[2]],opacity:t.color[3],alphaMode:t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,colorMixMode:t.ESRI_externalColorMixMode,colorTexture:t.colorTexture?n(t.colorTexture):void 0,normalTexture:t.normalTexture?n(t.normalTexture):void 0,occlusionTexture:t.occlusionTexture?n(t.occlusionTexture):void 0,emissiveTexture:t.emissiveTexture?n(t.emissiveTexture):void 0,metallicRoughnessTexture:t.metallicRoughnessTexture?n(t.metallicRoughnessTexture):void 0,emissiveFactor:[t.emissiveFactor[0],t.emissiveFactor[1],t.emissiveFactor[2]],emissiveStrengthKHR:t.emissiveStrengthKHR,colorTextureTransform:t.colorTextureTransform,normalTextureTransform:t.normalTextureTransform,occlusionTextureTransform:t.occlusionTextureTransform,emissiveTextureTransform:t.emissiveTextureTransform,metallicRoughnessTextureTransform:t.metallicRoughnessTextureTransform,metallicFactor:t.metallicFactor,roughnessFactor:t.roughnessFactor,receiveShadows:t.receiveShadows,receiveAmbientOcclusion:t.receiveAmbientOcclusion});e.materials.set(o,r)}return o}const X=new Set([9987,9985])},63907:(e,t,r)=>{r.d(t,{$0:()=>f,CQ:()=>T,Fq:()=>m,H0:()=>s,SB:()=>u,WR:()=>n,XN:()=>a,iE:()=>i,ld:()=>l,nI:()=>h,pe:()=>o,r6:()=>d,vt:()=>c,yI:()=>p});const n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},o={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},s={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},a=Object.values(s),i={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},u={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},l={FLOAT:o.FLOAT,UNSIGNED_BYTE:o.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:o.BYTE,UNSIGNED_SHORT:o.UNSIGNED_SHORT,SHORT:o.SHORT,UNSIGNED_INT:o.UNSIGNED_INT,INT:o.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},c={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},f=0,d=36064,p=36065,m=36066,h=33306,T={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},84498:(e,t,r)=>{r.d(t,{x:()=>a});var n=r(34275),o=r(97146),s=r(63907);function a(e,t){switch(t){case s.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,o.tM)(e):(0,n.mg)(e)?new Uint16Array(e):e}(e);case s.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,n=(0,o.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(n[e++]=t,n[e++]=t+1,n[e++]=t+2):(n[e++]=t+1,n[e++]=t,n[e++]=t+2)}else{let t=0;for(let o=0;o<r;o+=1)o%2==0?(n[t++]=e[o],n[t++]=e[o+1],n[t++]=e[o+2]):(n[t++]=e[o+1],n[t++]=e[o],n[t++]=e[o+2])}return n}(e);case s.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,n=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)n[e++]=0,n[e++]=t+1,n[e++]=t+2;return n}const o=e[0];let s=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];n[a++]=o,n[a++]=s,n[a++]=r,s=r}return n}(e)}}},90239:(e,t,r)=>{function n(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>n})},97375:(e,t,r)=>{r.r(t),r.d(t,{loadGLTFMesh:()=>G});var n=r(68197),o=r(40876),s=r(49186),a=r(91869),i=r(34727),u=r(77690),l=r(29242),c=r(51850),f=r(91829),d=r(16939),p=r(80882),m=r(35063),h=r(51147),T=r(1193),_=r(27615),g=r(13030),y=r(73354),w=r(65686),x=r(90239);Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride,i=r?r.count:t.count;let u=(r?.dstIndex??0)*o,l=(r?.srcIndex??0)*a;for(let e=0;e<i;++e){for(let e=0;e<9;++e)n[u+e]=s[l+e];u+=o,l+=a}}},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride,i=r?r.count:t.count;let u=(r?.dstIndex??0)*o,l=(r?.srcIndex??0)*a;for(let e=0;e<i;++e){for(let e=0;e<16;++e)n[u+e]=s[l+e];u+=o,l+=a}}},Symbol.toStringTag,{value:"Module"})),r(24045);var b=r(43609);function S(e,t,r=3,n=r){const o=t.length/n;let s=0,a=0;for(let i=0;i<o;++i)e[s]=t[a],e[s+1]=t[a+1],e[s+2]=t[a+2],s+=r,a+=n}function R(e,t,r,n,o){const s=e.typedBuffer,a=e.typedBufferStride,i=o?.count??e.count;let u=(o?.dstIndex??0)*a;for(let e=0;e<i;++e)s[u]=t,s[u+1]=r,s[u+2]=n,u+=a}function A(e,t,r=4){const n=t.typedBuffer,o=t.typedBufferStride,s=t.count;let a=0,i=0;for(let t=0;t<s;++t)e[a]=n[i],e[a+1]=n[i+1],e[a+2]=n[i+2],e[a+3]=n[i+3],a+=r,i+=o}function E(e,t,r,n,o,s){const a=e.typedBuffer,i=e.typedBufferStride,u=s?.count??e.count;let l=(s?.dstIndex??0)*i;for(let e=0;e<u;++e)a[l]=t,a[l+1]=r,a[l+2]=n,a[l+3]=o,l+=i}function O(e,t){return new e(new ArrayBuffer(t*e.ElementCount*(0,x.GJ)(e.ElementType)))}Object.freeze(Object.defineProperty({__proto__:null,copy:S,copyView:function(e,t){S(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)},fill:R},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,copy:A,copyView:function(e,t){A(e.typedBuffer,t,e.typedBufferStride)},fill:E},Symbol.toStringTag,{value:"Module"}));var N=r(72258),v=r(21015),I=r(51698),C=r(84498),B=r(51530);async function G(e,t,r){const o=new v.R(r?.resolveFile),u=await(0,I.loadGLTF)(o,t,r,!0),l=u.model,d=l.lods.shift(),y=new Map,w=new Map;l.textures.forEach((e,t)=>y.set(t,function(e){return new m.A({data:((0,B.x3)(e.data),e.data),wrap:F(e.parameters.wrap)})}(e))),l.materials.forEach((e,t)=>w.set(t,function(e,t){const r=new n.A(function(e,t){return(0,f.fA)(H(e[0]),H(e[1]),H(e[2]),t)}(e.color,e.opacity)),o=e.emissiveFactor?new n.A(function(e){return(0,c.fA)(H(e[0]),H(e[1]),H(e[2]))}(e.emissiveFactor)):null,s=e=>e?new h.A({scale:e.scale?[e.scale[0],e.scale[1]]:[1,1],rotation:(0,i.KJ)(e.rotation??0),offset:e.offset?[e.offset[0],e.offset[1]]:[0,0]}):null;return new p.A({color:r,colorTexture:t.get(e.colorTexture),normalTexture:t.get(e.normalTexture),emissiveColor:o,emissiveStrength:e.emissiveStrengthKHR,emissiveTexture:t.get(e.emissiveTexture),occlusionTexture:t.get(e.occlusionTexture),alphaMode:D(e.alphaMode),alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,metallic:e.metallicFactor,roughness:e.roughnessFactor,metallicRoughnessTexture:t.get(e.metallicRoughnessTexture),colorTextureTransform:s(e.colorTextureTransform),normalTextureTransform:s(e.normalTextureTransform),occlusionTextureTransform:s(e.occlusionTextureTransform),emissiveTextureTransform:s(e.emissiveTextureTransform),metallicRoughnessTextureTransform:s(e.metallicRoughnessTextureTransform)})}(e,y)));const x=function(e){let t=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},n=new Map,o=new Map,s=[];for(const i of e.parts){const{position:e,normal:u,color:l,tangent:c,texCoord0:f}=i.attributes,d=`\n ${L(e,n)}/\n ${L(u,n)}/\n ${L(l,n)}/\n ${L(c,n)}/\n ${L(f,n)}/\n ${M(i.transform)}\n `;let p=!1;const m=(0,a.tE)(o,d,()=>(p=!0,{start:t,length:e.count}));p&&(t+=e.count),u&&(r.normal=!0),l&&(r.color=!0),c&&(r.tangent=!0),f&&(r.texCoord0=!0),s.push({gltf:i,writeVertices:p,region:m})}return{vertexAttributes:{position:O(g.Xm,t),normal:r.normal?O(g.xs,t):null,tangent:r.tangent?O(g.Eq,t):null,color:r.color?O(g.XP,t):null,texCoord0:r.texCoord0?O(g.gH,t):null},parts:s,components:[]}}(d);for(const e of x.parts)U(x,e,w);const{position:b,normal:S,tangent:R,color:A,texCoord0:E}=x.vertexAttributes,C=(0,_.TE)(e,r),G=e.spatialReference.isGeographic?(0,_.TE)(e):C,P=(0,N.UR)({vertexAttributes:{position:b.typedBuffer,normal:S?.typedBuffer,tangent:R?.typedBuffer},vertexSpace:G,spatialReference:e.spatialReference},C,{allowBufferReuse:!0,sourceUnit:r?.unitConversionDisabled?void 0:"meters"});if(!P)throw new s.A("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${G.type} to ${C.type}`);return{mesh:{transform:null,vertexSpace:C,components:x.components,spatialReference:e.spatialReference,vertexAttributes:new T.H({...P,color:A?.typedBuffer,uv:E?.typedBuffer})},meta:u.meta}}function L(e,t){if(null==e)return"-";const r=e.typedBuffer;return`${(0,a.tE)(t,r.buffer,()=>t.size)}/${r.byteOffset}/${r.byteLength}`}function M(e){return null!=e?e.toString():"-"}function U(e,t,r){t.writeVertices&&function(e,t){const{position:r,normal:n,tangent:o,color:s,texCoord0:a}=e.vertexAttributes,c=t.region.start,{attributes:f,transform:d}=t.gltf,p=f.position.count;if((0,y.d)(r.slice(c,p),f.position,d),null!=f.normal&&null!=n){const e=(0,u.Ge)((0,l.vt)(),d),t=n.slice(c,p);(0,y.c)(t,f.normal,e),(0,i.or)(e)&&(0,y.e)(t,t)}else null!=n&&R(n,0,0,1,{dstIndex:c,count:p});if(null!=f.tangent&&null!=o){const e=(0,u.z0)((0,l.vt)(),d),t=o.slice(c,p);(0,w.a)(t,f.tangent,e),(0,i.or)(e)&&(0,w.n)(t,t)}else null!=o&&E(o,0,0,1,1,{dstIndex:c,count:p});if(null!=f.texCoord0&&null!=a?(0,b.n)(a.slice(c,p),f.texCoord0):null!=a&&(0,b.f)(a,0,0,{dstIndex:c,count:p}),null!=f.color&&null!=s){const e=f.color,t=s.slice(c,p);if(4===e.elementCount)e instanceof g.Eq?(0,w.l)(t,e,1,255):(e instanceof g.XP||e instanceof g.Uz)&&(0,w.l)(t,e,1/255,255);else{E(t,255,255,255,255);const r=g.eI.fromTypedArray(t.typedBuffer,t.typedBufferStride);e instanceof g.xs?(0,y.l)(r,e,1,255):(e instanceof g.eI||e instanceof g.nS)&&(0,y.l)(r,e,1/255,255)}}else null!=s&&E(s.slice(c,p),255,255,255,255)}(e,t);const{indices:n,attributes:o,primitiveType:s,material:a}=t.gltf;let c=(0,C.x)(n||o.position.count,s);const f=t.region.start;if(f){const e=new Uint32Array(c);for(let t=0;t<c.length;t++)e[t]+=f;c=e}e.components.push(new d.A({name:t.gltf.name,faces:c,material:r.get(a),shading:o.normal?"source":"flat",trustSourceNormals:!0}))}function D(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend"}}function F(e){return{horizontal:P(e.s),vertical:P(e.t)}}function P(e){switch(e){case 33071:return"clamp";case 33648:return"mirror";case 10497:return"repeat"}}function H(e){return e**(1/o.Tf)*255}}}]);
|