@arcgis/core 5.1.0-next.38 → 5.1.0-next.39
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/applications/WebEditor/sketchUtils.js +1 -1
- package/arcade/batchExec.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{11058e660139c427c3e7.js → 01777e91cd4e0bf04fd0.js} +1 -1
- package/assets/esri/core/workers/chunks/{666db81085bc97831b18.js → 02a0a58ca5916db1db19.js} +1 -1
- package/assets/esri/core/workers/chunks/{3d18b8c1c759c7240721.js → 03c8453ae72a4e190252.js} +1 -1
- package/assets/esri/core/workers/chunks/{828998d33a48be161782.js → 04981ae9d7728208ffce.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2cf19a28aa5c32a99e3.js → 04b04548d4eb0941a01e.js} +1 -1
- package/assets/esri/core/workers/chunks/{64870f555fefa85a5c59.js → 06003996a378c45bc605.js} +1 -1
- package/assets/esri/core/workers/chunks/{ce063df750018024c9ed.js → 0601c316da0256a60538.js} +1 -1
- package/assets/esri/core/workers/chunks/{93bf908f596140ea4c61.js → 0d321b3496adc640d96a.js} +1 -1
- package/assets/esri/core/workers/chunks/0de66f13e84830a654fb.js +1 -0
- package/assets/esri/core/workers/chunks/{1ff40e6057916e8482b3.js → 0eb57ef4a1b387c951d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{0554f310066937098099.js → 10941b50f5933d168df6.js} +1 -1
- package/assets/esri/core/workers/chunks/{22aeab5c363645c04806.js → 13a009229c96ecb7b04f.js} +1 -1
- package/assets/esri/core/workers/chunks/13d55e3c9aea04116eaa.js +1 -0
- package/assets/esri/core/workers/chunks/{3b86e8eb553122d3b68d.js → 167e4ff7cbc88b42db71.js} +1 -1
- package/assets/esri/core/workers/chunks/16a767cc5f3e2e0e49c2.js +1 -0
- package/assets/esri/core/workers/chunks/19cbaeda71486df01d0f.js +1 -0
- package/assets/esri/core/workers/chunks/{96132a37bc08c7fa8f2e.js → 1a6a77902dd8c84e059a.js} +1 -1
- package/assets/esri/core/workers/chunks/{00947268b6de12329146.js → 1f5d9e5d4ddc623fd511.js} +1 -1
- package/assets/esri/core/workers/chunks/{a2d045217a42ecc36308.js → 236b4ab3da0bc8f788a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a66a2b4aaab0774c34f.js → 23af269e88f9ac101ffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{da60a6df2f7858a2910e.js → 244dd7a948ca8a7dc6ef.js} +1 -1
- package/assets/esri/core/workers/chunks/25946077568ab14c7bfc.js +1 -0
- package/assets/esri/core/workers/chunks/{bb7e0334f438daa665da.js → 26cafd20c8d03c274389.js} +1 -1
- package/assets/esri/core/workers/chunks/284ce99af7bdd73dc7e9.js +1 -0
- package/assets/esri/core/workers/chunks/{1d0153c7d65bd9ea7d39.js → 2b386374330d96387aec.js} +1 -1
- package/assets/esri/core/workers/chunks/2c12b1488819c038c6b1.js +1 -0
- package/assets/esri/core/workers/chunks/2d2c10c31cc1460dd96a.js +1 -0
- package/assets/esri/core/workers/chunks/{8bd24534ed185afcb124.js → 30cdb2d1d9f018f1642d.js} +1 -1
- package/assets/esri/core/workers/chunks/{5691c1624190abeaebea.js → 34484afe767d60f85982.js} +1 -1
- package/assets/esri/core/workers/chunks/35d115bde474c380c791.js +1 -0
- package/assets/esri/core/workers/chunks/{6a0c371ec3acd7529fe6.js → 36a0e48113ab59a4f21d.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc3939983cf6f78f7243.js → 38c28189f273636e4017.js} +1 -1
- package/assets/esri/core/workers/chunks/{e00000468fb8ec2b3d43.js → 392941013107bbd96503.js} +1 -1
- package/assets/esri/core/workers/chunks/{43f60f41d353d3fc7c4b.js → 399fcea09dfb1ad6deaa.js} +1 -1
- package/assets/esri/core/workers/chunks/39d71e83261bff46f6bf.js +1 -0
- package/assets/esri/core/workers/chunks/{a52a8254577840a23aba.js → 3d4bb59ab2f644f4d675.js} +1 -1
- package/assets/esri/core/workers/chunks/3e2953ea62817e75d840.js +1 -0
- package/assets/esri/core/workers/chunks/{582d45a41e29005f6c63.js → 4005d37d03c834da7629.js} +1 -1
- package/assets/esri/core/workers/chunks/{285f3b07de852bfc1604.js → 427183ea93e759943a78.js} +1 -1
- package/assets/esri/core/workers/chunks/{4ceba469398ef55de8ea.js → 42b556d56013350c9d80.js} +1 -1
- package/assets/esri/core/workers/chunks/{446bc8461403ed1ac7b2.js → 4577df99c92c7ec0f9de.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a2dd3d85d31dce29d94.js → 49d6249e98f023344e0a.js} +1 -1
- package/assets/esri/core/workers/chunks/{6f3f7f785241edacdb8b.js → 4b5737021a149aa786af.js} +1 -1
- package/assets/esri/core/workers/chunks/{210ef3f1cc6ef8a831bf.js → 4b79ebfb3328f9483147.js} +1 -1
- package/assets/esri/core/workers/chunks/{305b2a8dc6438c5fd4aa.js → 4d378d4e021a33b0047e.js} +1 -1
- package/assets/esri/core/workers/chunks/{114aecdbd2bd92b24de2.js → 52175ff9e8c2c136f90a.js} +1 -1
- package/assets/esri/core/workers/chunks/{dfee98e7d1b206f33ba9.js → 54db91c0a3bd1946e026.js} +1 -1
- package/assets/esri/core/workers/chunks/{c79e8003812b789724af.js → 5b2fe488a461bc433f59.js} +1 -1
- package/assets/esri/core/workers/chunks/{1fa2bf0d6740092ec619.js → 5b70295da76d9227f64b.js} +1 -1
- package/assets/esri/core/workers/chunks/5e59ff96aecdf2adcb3b.js +1 -0
- package/assets/esri/core/workers/chunks/{cb482e20e10ab0f63617.js → 5e9595eb6ae6a40e7265.js} +1 -1
- package/assets/esri/core/workers/chunks/{de9fea9b6f2269ee0703.js → 604f9e7228a66b6cf2f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0d836502321e7a80e61.js → 60d0f8a949b130baff81.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2303b2771fcd75f298b.js → 6258ae3d991ce652d97f.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0d6292aaa3f8a796de3.js → 65865c25487d23dd2e31.js} +1 -1
- package/assets/esri/core/workers/chunks/{d4b97ca16d79809ed6f2.js → 65ea5028eb12457a3aeb.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf100c80b75ba74b479c.js → 66a4d764937918a2779f.js} +1 -1
- package/assets/esri/core/workers/chunks/6ee956d5a92ca905f53f.js +1 -0
- package/assets/esri/core/workers/chunks/{14e05d37e10ebba8cf10.js → 6f58ec80abebb7bfbbb0.js} +1 -1
- package/assets/esri/core/workers/chunks/{5698098c3691b3b49283.js → 73d7337ac9efdbad14a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{568d32ceee1409809e5a.js → 749c368f5cc2366716f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{586bc903e2c285649bf2.js → 77769663cd712822d33e.js} +1 -1
- package/assets/esri/core/workers/chunks/{620965d2e1a9ccf81d43.js → 77f6659e400064d38130.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8f624f8c975728d75e2.js → 78472f69053061a18967.js} +1 -1
- package/assets/esri/core/workers/chunks/{0e7d3f3479fcb366cc6f.js → 80a1ccabd4257cc61e0d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d156e14fc34d0600fd5.js → 81b830f0d620587966ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{9cd548ea00b641d8e65d.js → 8333561a938bcdf6c2e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{283ce37403c5e7a76e95.js → 8677865189081e0b83bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{087403b53f15eb4d375c.js → 86f70bd786d6d57fde69.js} +1 -1
- package/assets/esri/core/workers/chunks/88c6cc90606409b5c884.js +1 -0
- package/assets/esri/core/workers/chunks/{8e10e4c25869af9da5ba.js → 8967a02f394a63f11030.js} +1 -1
- package/assets/esri/core/workers/chunks/{d2fa8bd3f4cd3cf6b436.js → 89dbea6f436d45a3b185.js} +1 -1
- package/assets/esri/core/workers/chunks/{8eed5b6cac937099102c.js → 8d5bc17557a31ed79ed8.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d6165796af522858e56.js → 8e18ac7b22d8dca1e1e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{ae72c530d52a6d4461be.js → 8e3cb1c584951c3d1eb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{67f95c57c1679935570b.js → 92f6d637f4786ba0d3e3.js} +1 -1
- package/assets/esri/core/workers/chunks/93846f8b77fc802069a7.js +1 -0
- package/assets/esri/core/workers/chunks/{34f2e9d7466abc0919e7.js → 9639b1dd27ccc17ee21e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7ebd836b98d14c7d3ecf.js → 969f58a2de4ebe63619d.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a3e5053e95db36f26dc.js → 9a95c28d4a3b3b4b2c50.js} +1 -1
- package/assets/esri/core/workers/chunks/{c3e4f8664988e50bda55.js → 9b365a6242b0287f8727.js} +1 -1
- package/assets/esri/core/workers/chunks/{e021b2f0e15aee5bf3ad.js → 9b80569819cd1c72a9ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{3dcb4ee8b862689a141b.js → 9bd68abc6b5b07b2add3.js} +1 -1
- package/assets/esri/core/workers/chunks/{952ff668d202e80b43b0.js → a029db48079af4b5cccd.js} +1 -1
- package/assets/esri/core/workers/chunks/{9cc1b44c5a325a840307.js → a1f36240a31057f998da.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff8de370abf661768380.js → a84d67c1a1008bca2075.js} +1 -1
- package/assets/esri/core/workers/chunks/{c6112dcd6b36e256d7b5.js → a90883ff02c0cc6450c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d196cf72cd8bef8d91d.js → abcb39ad1e2d54710766.js} +1 -1
- package/assets/esri/core/workers/chunks/{80f0810527743833b4b7.js → af804beb43d4d10c54d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c2e5b116bac21e7d577.js → b056b4c79bcd542dd1d2.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b9de873f87f0feeb20b.js → b1ac09d8fa340d194aa2.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f0e850ebea0ffd2708f.js → b1c5f69bd1400e66c635.js} +1 -1
- package/assets/esri/core/workers/chunks/{414a802b6365688d31cb.js → b6e63d8ce3c9ac9762f4.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7229019876c0e4ff545.js → b86cb84c03b76e824213.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9b83e020ff08c51ac1.js +1 -0
- package/assets/esri/core/workers/chunks/{623bfacf4b9c9a5387cc.js → c2f3fc1b34a6782b431f.js} +1 -1
- package/assets/esri/core/workers/chunks/c4f64195e44986644993.js +1 -0
- package/assets/esri/core/workers/chunks/{b7a3a7f7fb747f9689d7.js → c7799ba861ac5af08e6a.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c6e96b1c2b0418a4f1c.js → ca1b0cb14ea9ae1bf2a3.js} +1 -1
- package/assets/esri/core/workers/chunks/cce2d2c60d136e1bac75.js +1 -0
- package/assets/esri/core/workers/chunks/{b98366d8a5bc6cc2b219.js → cda2e445eb2ac269abdf.js} +1 -1
- package/assets/esri/core/workers/chunks/{448620052233e51b496c.js → cf74d1605ad2f21699e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4301ea9a6cb3bcef906.js → d0983cc19d19c19c3478.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee582bbe7365b678ec54.js → d50e6681ecb9612e4528.js} +1 -1
- package/assets/esri/core/workers/chunks/{68abe4e70ea48e978642.js → d51c41c1944df0cbab3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2f497339493926d4c9e.js → d53b31c9056f82831bc0.js} +1 -1
- package/assets/esri/core/workers/chunks/{ffc87a038712a4c9d2cb.js → d6eddb94f5f2e9759bd0.js} +1 -1
- package/assets/esri/core/workers/chunks/{6cdda5aa35fa12ea9345.js → d7439d357f68160844cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c853fd89f0e9f102c6e.js → dba479176db0a23c8034.js} +1 -1
- package/assets/esri/core/workers/chunks/{6792e981a3c73063a3e6.js → dd26e3a29161ea411e41.js} +1 -1
- package/assets/esri/core/workers/chunks/{0337138d3702a1a52ce0.js → de79645e559a2d1ffa67.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ddfd406b9044390e9f7.js → e47dd011c06ab42c18e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0da3a44f33f4d8e682b.js → e68d7aec0f095b6d743d.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca64867bc322a354be8e.js → e907acaec4c62adac2f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{9813f25192ea27084754.js → ea356a5b90ea44b5cbe1.js} +1 -1
- package/assets/esri/core/workers/chunks/{d30253b4990a76bfd72b.js → eab74d830c2eaa9d133b.js} +1 -1
- package/assets/esri/core/workers/chunks/{eef102e13fd8878eeb96.js → eb36417edc11fa80e312.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5dbda08d7fd4bed1c62.js → eca45cd479f7fd28ca6e.js} +1 -1
- package/assets/esri/core/workers/chunks/{56f64df68bb11c0c74d2.js → f209a7076d67cbf4d205.js} +1 -1
- package/assets/esri/core/workers/chunks/{b81780e5e7cd9a1a010a.js → f36a234ef35faf8ca04d.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ae9e9a65cb08b12caeb.js → f45e4eb89db31d7a7640.js} +3 -3
- package/assets/esri/core/workers/chunks/{45d57e561fc993bc75ed.js → f9cde38cb56c547e87e5.js} +1 -1
- package/assets/esri/core/workers/chunks/{0efe90bd43ab29dab8ae.js → f9da5c81535eaffc8b9c.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8ae8d1b456ace0b383b.js → fce8d4ff920baf8856e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{5fa5a2fb69f84e9092ba.js → fd629a3ab558adf52617.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bfc6f8c2d13ca4d2082.js → fdf4c1f202cfddf0f226.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b12865ac53d984d8149.js → fe7dec83e40014c55a6b.js} +1 -1
- package/assets/esri/core/workers/chunks/{5f3b25b30acd7a07f5c0.js → ff31936236dd9b1acb24.js} +1 -1
- package/assets/esri/core/workers/chunks/{122ff8d0d428f31fc5d1.js → ff8ec6369c8a1bee9bb4.js} +1 -1
- package/chunks/GaussianSplatComposition.glsl.js +21 -3
- package/chunks/OITDim.glsl.js +3 -4
- package/config.js +1 -1
- package/core/Promise.js +1 -1
- package/core/QueueProcessor.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/scheduling.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/intl/messages.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/transitions/FadeTransition.js +1 -1
- package/views/2d/engine/webgl/TextureUploadManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueDebugContainer.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationQuery.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/transparency/OITDim.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +2 -0
- package/views/PopupView.js +1 -1
- package/views/ViewAnimation.js +1 -1
- package/views/analysis/ExclusiveOperationManager.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/support/AnalysisViewManager.js +1 -1
- package/views/support/LayerLayerViewInfo.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/ScheduledQueueProcessor.js +1 -1
- package/views/support/waitForResources.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
- package/assets/esri/core/workers/chunks/1bf3e787eafec318bd2b.js +0 -1
- package/assets/esri/core/workers/chunks/1ee3d44e6d7add0b24cb.js +0 -1
- package/assets/esri/core/workers/chunks/34cdcee6d0ea595d7aed.js +0 -1
- package/assets/esri/core/workers/chunks/36f91b5c4345a179b8b1.js +0 -1
- package/assets/esri/core/workers/chunks/4d7f7b1e7663cf6088d1.js +0 -1
- package/assets/esri/core/workers/chunks/6997b4d5bcc9c4755375.js +0 -1
- package/assets/esri/core/workers/chunks/75664587bb80f4e187e1.js +0 -1
- package/assets/esri/core/workers/chunks/7975abb2162a82c88edb.js +0 -1
- package/assets/esri/core/workers/chunks/889835e61ea97f090082.js +0 -1
- package/assets/esri/core/workers/chunks/917474f9dd2039b82e9d.js +0 -1
- package/assets/esri/core/workers/chunks/bf668010f36179792592.js +0 -1
- package/assets/esri/core/workers/chunks/c7f27a84268a9b0d8cdb.js +0 -1
- package/assets/esri/core/workers/chunks/cd73d37ea0e66db46e45.js +0 -1
- package/assets/esri/core/workers/chunks/d456f06d0c6a5cc02be7.js +0 -1
- package/assets/esri/core/workers/chunks/dcef87f7d06c45cd928b.js +0 -1
- package/assets/esri/core/workers/chunks/e0344b45af88081fa186.js +0 -1
- package/assets/esri/core/workers/chunks/e16f5f089259988e8993.js +0 -1
- package/assets/esri/core/workers/chunks/fe21b2d31fbf83224e6b.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{createResolver as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as i}from"../../../core/units.js";import o from"../../../geometry/Extent.js";import{P as r,a as s,g as a,h as l,j as c}from"../../../chunks/pe.js";import f from"../../../geometry/Point.js";import u from"../../../geometry/Polygon.js";import{projectWithoutEngine as x}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{getInfo as h}from"../../../geometry/support/spatialReferenceUtils.js";function p(){if(!N)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}const g=(e,t,n,i=0)=>{if(1===n[0])return[0,0];let o=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(o=o>e[g]?e[g]:o,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-o)/l/n[0],u=(a-s)/c/n[1],x=2*i;let m=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,i=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,o=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((i-e[n+2*c+2])/f),s=Math.abs((o-e[n+2*c+3])/u);if(r+s>m&&(m=r+s,p=[r,s]),x&&m>x){h=!0;break}}if(h)break}return p},y={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},d=32,w=4,M=w,R=new Map,S=new Map,P=500,b=39.37,G=96;let k,E,T,N=!1;async function j(){return k||(k=n(),E=await import("../../../geometry/operators/projectOperator.js"),T=await import("../../../geometry/operators/support/geographicTransformationUtils.js"),E.isLoaded()||await E.load(),T.isLoaded()||await T.load(),N=!0,k.resolve()),k.promise}function v(e,t,n){if(p(),n){const n=E.execute(e,t);return T.getTransformation(t,e.spatialReference,n)}return T.getTransformation(e.spatialReference,t,e)}function C(e,t,n,i){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;p();const s=n.center,a=new o({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=E.execute(a,t,{geographicTransformation:i}),c=$(t);return null==l||null!=c&&l.width>=c?_(e,r,t):{x:l.width,y:l.height}}function _(e,t,n){const o=i(t)/i(n);return{x:e.x*o,y:e.y*o}}function z(e,n,o){const{spatialReference:r}=o;if(!r||!n||r.equals(n))return e;if(r.isGeographic&&n.isGeographic)return _(e,r,n);if(p(),!N)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*i(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const f=256,x=s*f/2,m=a*f/2,{x:h,y:g}=o.center,y=[];for(let t=0;t<=f;t++)y.push([h-x,g-m+t*a]);for(let t=1;t<=f;t++)y.push([h-x+t*s,g+m]);for(let t=1;t<=f;t++)y.push([h+x,g+m-t*a]);for(let t=1;t<f;t++)y.push([h+x-t*s,g-m]);y.push(y[0]);const d=new u({rings:[y],spatialReference:r}),w=E.execute(d,n);if(!w)return _(e,r,n);const M=w.extent,R=$(n);if(null==M||null!=R&&M.width>=R)return _(e,r,n);const S=pe(w.rings),P=s*a*f*f,b=Math.sqrt(S/P)/c,G={x:M.width/c/f,y:M.height/c/f},k={x:s*b,y:a*b},T=G.x*G.y;return Math.abs(T-k.x*k.y)/T<.1?G:k}function L(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*i(t)*G*b}function W(e,t){const{pixelSize:n,extent:i}=e;return L(z(n,t,i),t)}function I(e,t=.01){return i(e)?t/i(e):0}function O(e,t,n,i=!0){const o=e.spatialReference;if(o.equals(t))return e;p();const r=E.execute(e,t,{geographicTransformation:n});return i&&r?(A([e],[r],o,t),r):r}function A(e,t,n,i){const o=ee(n,!0),r=ee(i,!0),s=I(n,P),a=I(i,P);if(s&&null!=o&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:i}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(i-o[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(i-o[1])<s&&(n.x+=r[1]-r[0])}}function F(e){const{inSR:t,outSR:n,preferPE:i}=e;if(t.equals(n)){const{points:t}=X(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return B(e);if(i){if(t.isGeographic)return Y(e);if(null!=U(t))return Y(e)}return q(e)}function q(e){const{points:t}=X(e,null),{inSR:n,outSR:i,datumTransformation:o}=e,r=t.map(e=>new f(e[0],e[1],n)),s=E.executeMany(r,i,{geographicTransformation:o});return o&&A(r,s,n,i),s.map(e=>e?[e.x,e.y]:[NaN,NaN])}function Y(e){const{inSR:t,outSR:n,datumTransformation:i}=e,o=U(t),{points:a,mask:f}=X(e,o);if(!t.isGeographic){const e=t.wkid?r.coordsys(t.wkid):r.fromString(t.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,t.wkt2||t.wkt);l.projToGeog(e,a.length,a)}if(null!=i&&i.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=a.map(([e])=>e>t?1:e<-t?-1:0)),i.steps.forEach(e=>{const t=e.wkid?r.geogtran(e.wkid):r.fromString(s.PE_TYPE_GEOGTRAN,e.wkt);c.geogToGeog(t,a.length,a,null,e.isInverse?s.PE_TRANSFORM_2_TO_1:s.PE_TRANSFORM_1_TO_2)}),e)for(let n=0;n<a.length;n++){const i=e[n],o=a[n][0],r=o>t?1:o<-t?-1:0;i&&r&&i!==r&&(a[n][0]=i>0?o+360:o-360)}}if(!n.isGeographic){const e=U(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];K(a,t);const i=n.wkid?r.coordsys(n.wkid):r.fromString(n.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,n.wkt2||n.wkt);l.geogToProj(i,a.length,a)}let u=a;if(f&&a.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(a[t++]):u.push([NaN,NaN])}return u}function B(e){const{cols:t,rows:n,xres:i,yres:o,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:c}=e;r&&(l+=i/2,c-=o/2);const u=[],m=[],h=Math.max(t,n);for(let g=0;g<h;g++){const e=l+i*Math.min(t,g),r=c-o*Math.min(n,g),h=x(new f({x:e,y:r,spatialReference:s}),s,a);g<=t&&u.push(h.x),g<=n&&m.push(h.y)}const p=[];for(let f=0;f<t;f++)for(let e=0;e<n;e++)p.push([u[f],m[e]]);return p}function U(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),R.has(n)){const e=R.get(n);return t?e?.gcs:e?.pcs}const i=e.wkid?r.coordsys(e.wkid):r.fromString(e.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,e.wkt2||e.wkt),o=J(i,I(e,1e-4)),a=J(i,0,!0);return R.set(n,{pcs:o,gcs:a}),t?a:o}function J(e,t=0,n=!1){const i=a.generate(e),o=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!i||!o?.length)return null;let r=!1,s=o.find(e=>1===e.getInclusive()&&1===e.getKind());if(!s){if(s=o.find(e=>1===e.getInclusive()&&0===e.getKind()),!s)return null;r=!0}const l=n?0:(2===i.getNorthPoleLocation()?1:0)|(2===i.getSouthPoleLocation()?2:0),c=i.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:c,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:l};let u=0;const x=[];let[m,h]=f[0],[p,g]=f[0];for(let a=0,y=f.length;a<y;a++){u++,u===y&&(u=0);const[e,t]=f[a],[n,i]=f[u];if(i===t)x.push([e,n,t,i,2]);else{const o=(n-e)/(i-t||1e-4),r=e-o*t;t<i?x.push([o,r,t,i,0]):x.push([o,r,i,t,1])}m=m<e?m:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:x,bbox:[m,h,p,g],poleLocation:l}}function X(e,t){const n=[],{cols:i,rows:o,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<i;e++)for(let t=0;t<o;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(i*o);if(t.isEnvelope){const{isPannable:e,bbox:[a,u,x,m]}=t;for(let t=0,h=0;t<i;t++){const i=l+r*t,p=e||i>=a&&i<=x;for(let e=0;e<o;e++,h++){const t=c-s*e;p&&t>=u&&t<=m&&(n.push([i,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,x=[];for(let m=0;m<o;m++){const e=c-s*m,t=[],n=[];for(let o=0;o<u.length;o++){const[i,r,s,a,l]=u[o];if(e===s&&s===a)t.push(i),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const o=i*e+r;t.push(o),n.push(l)}}let i=t;if(t.length>2){let e=2===n[0]?0:n[0],o=t[0];i=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(i.push(0===e?Math.min(o,t[r-1]):Math.max(o,t[r-1])),e=n[r],o=t[r]),r===n.length-1&&i.push(0===n[r]?Math.min(o,t[r]):Math.max(o,t[r])));i.sort((e,t)=>e-t)}else t[0]>t[1]&&(i=[t[1],t[0]]);x.push(i)}for(let m=0,h=0;m<i;m++){const e=l+r*m;for(let t=0;t<o;t++,h++){const i=c-s*t,o=x[t];if(2===o.length)e>=o[0]&&e<=o[1]&&(n.push([e,i]),f[h]=1);else if(o.length>2){let t=!1;for(let n=0;n<o.length;n+=2)if(e>=o[n]&&e<=o[n+1]){t=!0;break}t&&(n.push([e,i]),f[h]=1)}}}return{points:n,mask:f}}function K(e,t){const[n,i]=t;for(let o=0;o<e.length;o++){const t=e[o][1];(t<n||t>i)&&(e[o]=[NaN,NaN])}}function D(e,t){const n=$(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??I(e[0].spatialReference),1===(e=e.filter(e=>e.width>t)).length)return e[0];let{xmin:i,xmax:r,ymin:s,ymax:a}=e[0];for(let o=1;o<e.length;o++){const t=e[o];r=t.xmax+n*o,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new o({xmin:i,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function H(t,n,i=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=ne(t),l=$(s,!0),c=$(n);if(0===a||null==l||null==c){const e=Z(t,n,i,r);if(e&&null==l&&null!=c&&Math.abs(e.width-c)<I(n)&&E.isLoaded()){const i=U(s);if(null!=i&&0===i.poleLocation&&t.width<(i.bbox[2]-i.bbox[0])/2)return V(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>I(s)){const{xmin:e,xmax:n}=t;for(let i=0;i<=a;i++){const r=0===i?e:-l/2,c=i===a?n-l*i:l/2;f[i]=new o({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}const u=f.map(e=>Z(e,n,i,r)).filter(e);return 0===u.length?null:D(u)}function Q(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:i,ymax:o,spatialReference:r}=e;e=new u({rings:[[[t,o],[i,o],[i,n],[t,n],[t,o]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(p(),E.execute(e,t,{geographicTransformation:n}))}function V(e,t){const n=$(t);if(null==n)return null;let{xmin:i,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new u({spatialReference:l,rings:[[[i,r],[s,r],[s,a],[i,a],[i,r]]]}),f=E.execute(c,t);if(2!==f.rings.length||!f.rings[0].length||!f.rings[1].length)return null;const{rings:x}=f,m=I(l),h=new o({spatialReference:t});for(let o=0;o<2;o++){i=s=x[o][0][0],r=a=x[o][0][1];for(let e=0;e<x[o].length;e++)i=i>x[o][e][0]?x[o][e][0]:i,s=s<x[o][e][0]?x[o][e][0]:s,r=r>x[o][e][1]?x[o][e][1]:r,a=a<x[o][e][1]?x[o][e][1]:a;if(0===o)h.ymin=r,h.ymax=a,h.xmin=i,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<m)h.xmin=i,h.xmax=h.xmax+n;else{if(!(Math.abs(i+n/2)<m))return null;h.xmax=s+n}}return h}function Z(e,t,n,i=!0,o=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;p();const s=E.execute(e,t,{geographicTransformation:n});if(o&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!i||!s)return s;const a=ee(r,!0),l=ee(t,!0);if(null==a||null==l)return s;const c=I(r,.001),u=I(r,P),x=I(t,.001);if(Math.abs(s.xmin-l[0])<x&&Math.abs(s.xmax-l[1])<x){const i=Math.abs(e.xmin-a[0]),o=Math.abs(a[1]-e.xmax);if(i<c&&o>u){s.xmin=l[0];const i=[];i.push(new f(e.xmax,e.ymin,r)),i.push(new f(e.xmax,(e.ymin+e.ymax)/2,r)),i.push(new f(e.xmax,e.ymax,r));const o=i.map(e=>O(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmax=Math.max.apply(null,o)}if(o<c&&i>u){s.xmax=l[1];const i=[];i.push(new f(e.xmin,e.ymin,r)),i.push(new f(e.xmin,(e.ymin+e.ymax)/2,r)),i.push(new f(e.xmin,e.ymax,r));const o=i.map(e=>O(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmin=Math.min.apply(null,o)}}else{const e=I(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function $(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*y[e.wkid]||null}function ee(e,t=!1){if(e.isGeographic)return[-180,180];const n=$(e,t);return n?[-n/2,n/2]:null}function te(e,t,n,i){let o=(e-t)/n;return o-Math.floor(o)!==0?o=Math.floor(o):i&&(o-=1),o}function ne(e,t=!1){const n=$(e.spatialReference);if(null==n)return 0;const i=t?0:-(n/2),o=I(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<o?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<o?-n/2:e.xmin;return te(r,i,n,!0)-te(s,i,n,!1)}function ie(e){const t=e.storageInfo.origin.x,n=$(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const i=n/2,{nativePixelSize:o,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=o.x;const u=[],x=null!=e.transform&&"gcs-shift"===e.transform.type,m=t+(x?0:i),h=x?n-t:i-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)===0?e:Math.ceil(e),i=h/f/l,o=i-Math.floor(i)===0?i:Math.ceil(i),r=Math.floor(m/f/l),a=Math.round(m/f)%l,x=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:o,leftMargin:a,rightPadding:x,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:i,pyramidsInfo:u,hasGCSSShiftTransform:x}}function oe(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(S.has(t))n=S.get(t);else{n=(e.wkid?r.coordsys(e.wkid):r.fromString(s.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),S.set(t,n)}return new m({wkid:n})}function re(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[d,d],i=se(e),o={cols:i.size[0]+1,rows:i.size[1]+1};const r=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let s=i.outofBoundPointCount===i.offsets.length/2||t&&r?[0,0]:g(i.offsets,o,n,M);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>M)&&(l.isGeographic||U(l),n=[w,w],i=se({...e,spacing:n}),o={cols:i.size[0]+1,rows:i.size[1]+1},s=g(i.offsets,o,n,M)),i.error=s,n[0]>1&&(i.coefficients=ae(i.offsets,o,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)i.gcsGrid={offsets:i.offsets,coefficients:i.coefficients,spacing:n};else{const t=U(l);if(null!=t&&!t.isEnvelope){const t=oe(l),s=H(e.projectedExtent,t),{offsets:a}=se({...e,srcBufferExtent:s,spacing:n}),c=ae(a,o,r);i.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return i}function se(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:i,datumTransformation:o,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;p();const{xmin:l,ymin:c,xmax:u,ymax:x}=t,m=$(a),h=null!=m&&(e.hasWrapAround||"gcs-shift"===r?.type),g=e.spacing||[d,d],y=g[0]*i.x,M=g[1]*i.y,R=1===g[0],S=Math.ceil((u-l)/y-.1/g[0])+(R?0:1),b=Math.ceil((x-c)/M-.1/g[1])+(R?0:1),G=F({cols:S,rows:b,xmin:l,ymax:x,xres:y,yres:M,inSR:s,outSR:a,datumTransformation:o,preferPE:g[0]<=w,usePixelCenter:R}),k=[];let E,T=0;const N=R?-1:NaN,{xmin:j,xmax:v,ymax:C,width:_,height:z}=n,L=I(a,P),W=null!=m&&j>0&&v>m/2,O=U(s),A=null!=O&&O.poleLocation>0;for(let p=0;p<S;p++){const e=[];for(let t=0;t<b;t++){let n=G[p*b+t];if(h&&n[0]>v&&n[0]>m/2-L?n[0]-=m:h&&0===p&&n[0]<0&&W&&!r&&(n[0]+=m),!n||isNaN(n[0])||isNaN(n[1]))k.push(N),k.push(N),e.push(null),T++;else{if(r){const e=r.inverseTransform(new f({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),p>0&&h&&E[t]&&n[0]<E[t][0]&&(n[0]+=m,A&&n[0]>v&&n[0]>m&&(n[0]-=m)),k.push((n[0]-j)/_),k.push((C-n[1])/z)}}E=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:T,spacing:g,size:R?[S,b]:[S-1,b-1]}}function ae(e,t,n){const{cols:i,rows:o}=t,r=new Float32Array((i-1)*(o-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<i-1;l++){for(let t=0;t<o-1;t++){let n=l*o*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],x=e[n+3];n+=2*o;const m=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(i-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*x+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*m+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function le(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:D(n,t)}function ce(e){const{spatialReference:t}=e,n=h(t);if(!n)return e;const[i,r]=n.valid,s=r-i;let a=0;if(e.xmin<i){const t=i-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new o({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function fe(e,t,n){const{storageInfo:o,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=o,c="mixed"===o.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/c;if(null!=l&&l.length){const e=l[l.length-1],o=(e.x+e.y)/2,c=(r.x+r.y)/2;if(u<=c)s=0;else if(u>=o)s=l.length,a=u/o>8;else{let e,t=c;for(let i=1;i<=l.length;i++){if(e=(l[i-1].x+l[i-1].y)/2,u<=e){u===e?s=i:"down"===n?(s=i-1,a=u/t>8):s="up"===n||u-t>e-u||u/t>2?i:i-1;break}t=e}}const x=0===s?r:l[s-1];if(a){Math.min(x.x,x.y)*i(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new f({x:x.x,y:x.y,spatialReference:t.spatialReference}),excessiveReading:a}}const x=Math.log(e.x/r.x)/Math.LN2,m=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===n?Math.floor(Math.min(x,m)):"up"===n?Math.ceil(Math.max(x,m)):Math.round((x+m)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new f({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function ue(e,t,n=!1){const{pixelSize:i,extent:o}=e,r=v(o,t,!1),s=H(le(o,(i.x+i.y)/16),t,r);return!s||n||0===ne(s)?s:Z(o,t,r)}function xe(e,t,n){const i=n?.tileSize??512,o=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,pixelSize:a}=e,l=z(a,t,s);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(l.x+l.y)/2,f=L(c,t),u=256/i,x=t.isGeographic?295828763.7958547*u:591657527.591555*u,m=(t.isGeographic?.703125:156543.03392800014)*u;let h="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const p=ue(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(x/2/f)/Math.LN2));if(!h&&p&&o&&(t.isGeographic||t.isWebMercator)){const n=$(t);if(h=ne(p)>0||null!=n&&p.width>n/4,!h&&null!=n){let t=-1;if(g<3)t=2**g*c*i;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:o=2}=e.storageInfo;t=o**n*c*i}const o=Math.ceil(n/t);h=1===o||2===o&&n/2-p.xmax<t}}let y,d=f;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(h){d=x;const n=me(e,t);y={x:n.x*m,y:n.y*m}}else{y={x:a.x,y:a.y};let e=0;for(;d<x*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,x)/Math.min(d,x)<=w&&(d=x)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,f)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*a.x;let t=S.findIndex(t=>t.x>=a.x-e&&t.x<=a.x+e);t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex(t=>t.x<=a.x+e),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:l,scales:R,srcResolutions:S,isCustomTilingScheme:!h}}function me(e,t){if(t.isWGS84||t.isWebMercator){const n=t.isGeographic?1341104507446289e-21:.29858214164761665,i=t.isGeographic?4326:3857,o=ue(e,new m({wkid:i}),!0),r=z({x:n,y:n},e.spatialReference,o);return{x:r.x/n,y:r.y/n}}const n=z(e.pixelSize,t,e.extent),i=(n.x+n.y)/2;return{x:e.pixelSize.x/i,y:e.pixelSize.y/i}}function he(e,t){const{spatialReference:n,lods:i}=t,{x:o,y:r}=me(e,n);return i.map(({resolution:e})=>({x:e*o,y:e*r}))}function pe(e){let t=0;for(const n of e){const e=n.length;let i=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)i+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=i/2}return Math.abs(t)}export{xe as computeProjectedScales,me as computeSrcResolutionRatio,he as computeSrcResolutions,d as defaultGridSpacing,M as defaultProjectionToleranceInPixels,v as getDefaultDatumTransformationForDataset,F as getProjectedGridPoints,re as getProjectionOffsetGrid,ie as getRasterDatasetAlignmentInfo,W as getSourceScale,$ as getWorldWidth,ne as getWorldWrapCount,j as load,w as minimumGridSpacing,ue as projectDatasetExtent,z as projectDatasetResolution,H as projectExtent,O as projectPoint,Q as projectPolygon,C as projectResolution,ce as shiftExtent,le as snapExtent,fe as snapPyramid};
|
|
2
|
+
import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getMetersPerUnitForSR as n}from"../../../core/units.js";import i from"../../../geometry/Extent.js";import{P as o,a as r,g as s,h as a,j as l}from"../../../chunks/pe.js";import c from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{projectWithoutEngine as u}from"../../../geometry/projectionUtils.js";import x from"../../../geometry/SpatialReference.js";import{getInfo as m}from"../../../geometry/support/spatialReferenceUtils.js";function h(){if(!T)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}const p=(e,t,n,i=0)=>{if(1===n[0])return[0,0];let o=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(o=o>e[g]?e[g]:o,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-o)/l/n[0],u=(a-s)/c/n[1],x=2*i;let m=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,i=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,o=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((i-e[n+2*c+2])/f),s=Math.abs((o-e[n+2*c+3])/u);if(r+s>m&&(m=r+s,p=[r,s]),x&&m>x){h=!0;break}}if(h)break}return p},g={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},y=32,d=4,w=d,M=new Map,R=new Map,S=500,P=39.37,b=96;let G,k,E,T=!1;async function N(){return G||(G=Promise.withResolvers(),k=await import("../../../geometry/operators/projectOperator.js"),E=await import("../../../geometry/operators/support/geographicTransformationUtils.js"),k.isLoaded()||await k.load(),E.isLoaded()||await E.load(),T=!0,G.resolve()),G.promise}function v(e,t,n){if(h(),n){const n=k.execute(e,t);return E.getTransformation(t,e.spatialReference,n)}return E.getTransformation(e.spatialReference,t,e)}function j(e,t,n,o){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;h();const s=n.center,a=new i({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=k.execute(a,t,{geographicTransformation:o}),c=Z(t);return null==l||null!=c&&l.width>=c?C(e,r,t):{x:l.width,y:l.height}}function C(e,t,i){const o=n(t)/n(i);return{x:e.x*o,y:e.y*o}}function _(e,i,o){const{spatialReference:r}=o;if(!r||!i||r.equals(i))return e;if(r.isGeographic&&i.isGeographic)return C(e,r,i);if(h(),!T)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*n(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const u=256,x=s*u/2,m=a*u/2,{x:p,y:g}=o.center,y=[];for(let t=0;t<=u;t++)y.push([p-x,g-m+t*a]);for(let t=1;t<=u;t++)y.push([p-x+t*s,g+m]);for(let t=1;t<=u;t++)y.push([p+x,g+m-t*a]);for(let t=1;t<u;t++)y.push([p+x-t*s,g-m]);y.push(y[0]);const d=new f({rings:[y],spatialReference:r}),w=k.execute(d,i);if(!w)return C(e,r,i);const M=w.extent,R=Z(i);if(null==M||null!=R&&M.width>=R)return C(e,r,i);const S=he(w.rings),P=s*a*u*u,b=Math.sqrt(S/P)/c,G={x:M.width/c/u,y:M.height/c/u},E={x:s*b,y:a*b},N=G.x*G.y;return Math.abs(N-E.x*E.y)/N<.1?G:E}function z(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*n(t)*b*P}function L(e,t){const{pixelSize:n,extent:i}=e;return z(_(n,t,i),t)}function W(e,t=.01){return n(e)?t/n(e):0}function I(e,t,n,i=!0){const o=e.spatialReference;if(o.equals(t))return e;h();const r=k.execute(e,t,{geographicTransformation:n});return i&&r?(O([e],[r],o,t),r):r}function O(e,t,n,i){const o=$(n,!0),r=$(i,!0),s=W(n,S),a=W(i,S);if(s&&null!=o&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:i}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(i-o[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(i-o[1])<s&&(n.x+=r[1]-r[0])}}function A(e){const{inSR:t,outSR:n,preferPE:i}=e;if(t.equals(n)){const{points:t}=J(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return Y(e);if(i){if(t.isGeographic)return q(e);if(null!=B(t))return q(e)}return F(e)}function F(e){const{points:t}=J(e,null),{inSR:n,outSR:i,datumTransformation:o}=e,r=t.map(e=>new c(e[0],e[1],n)),s=k.executeMany(r,i,{geographicTransformation:o});return o&&O(r,s,n,i),s.map(e=>e?[e.x,e.y]:[NaN,NaN])}function q(e){const{inSR:t,outSR:n,datumTransformation:i}=e,s=B(t),{points:c,mask:f}=J(e,s);if(!t.isGeographic){const e=t.wkid?o.coordsys(t.wkid):o.fromString(t.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.projToGeog(e,c.length,c)}if(null!=i&&i.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map(([e])=>e>t?1:e<-t?-1:0)),i.steps.forEach(e=>{const t=e.wkid?o.geogtran(e.wkid):o.fromString(r.PE_TYPE_GEOGTRAN,e.wkt);l.geogToGeog(t,c.length,c,null,e.isInverse?r.PE_TRANSFORM_2_TO_1:r.PE_TRANSFORM_1_TO_2)}),e)for(let n=0;n<c.length;n++){const i=e[n],o=c[n][0],r=o>t?1:o<-t?-1:0;i&&r&&i!==r&&(c[n][0]=i>0?o+360:o-360)}}if(!n.isGeographic){const e=B(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];X(c,t);const i=n.wkid?o.coordsys(n.wkid):o.fromString(n.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,n.wkt2||n.wkt);a.geogToProj(i,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function Y(e){const{cols:t,rows:n,xres:i,yres:o,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:f}=e;r&&(l+=i/2,f-=o/2);const x=[],m=[],h=Math.max(t,n);for(let g=0;g<h;g++){const e=l+i*Math.min(t,g),r=f-o*Math.min(n,g),h=u(new c({x:e,y:r,spatialReference:s}),s,a);g<=t&&x.push(h.x),g<=n&&m.push(h.y)}const p=[];for(let c=0;c<t;c++)for(let e=0;e<n;e++)p.push([x[c],m[e]]);return p}function B(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),M.has(n)){const e=M.get(n);return t?e?.gcs:e?.pcs}const i=e.wkid?o.coordsys(e.wkid):o.fromString(e.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,e.wkt2||e.wkt),s=U(i,W(e,1e-4)),a=U(i,0,!0);return M.set(n,{pcs:s,gcs:a}),t?a:s}function U(e,t=0,n=!1){const i=s.generate(e),o=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!i||!o?.length)return null;let r=!1,a=o.find(e=>1===e.getInclusive()&&1===e.getKind());if(!a){if(a=o.find(e=>1===e.getInclusive()&&0===e.getKind()),!a)return null;r=!0}const l=n?0:(2===i.getNorthPoleLocation()?1:0)|(2===i.getSouthPoleLocation()?2:0),c=i.isPannableRectangle(),f=a.getCoord();if(r)return{isEnvelope:r,isPannable:c,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:l};let u=0;const x=[];let[m,h]=f[0],[p,g]=f[0];for(let s=0,y=f.length;s<y;s++){u++,u===y&&(u=0);const[e,t]=f[s],[n,i]=f[u];if(i===t)x.push([e,n,t,i,2]);else{const o=(n-e)/(i-t||1e-4),r=e-o*t;t<i?x.push([o,r,t,i,0]):x.push([o,r,i,t,1])}m=m<e?m:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:x,bbox:[m,h,p,g],poleLocation:l}}function J(e,t){const n=[],{cols:i,rows:o,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<i;e++)for(let t=0;t<o;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(i*o);if(t.isEnvelope){const{isPannable:e,bbox:[a,u,x,m]}=t;for(let t=0,h=0;t<i;t++){const i=l+r*t,p=e||i>=a&&i<=x;for(let e=0;e<o;e++,h++){const t=c-s*e;p&&t>=u&&t<=m&&(n.push([i,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,x=[];for(let m=0;m<o;m++){const e=c-s*m,t=[],n=[];for(let o=0;o<u.length;o++){const[i,r,s,a,l]=u[o];if(e===s&&s===a)t.push(i),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const o=i*e+r;t.push(o),n.push(l)}}let i=t;if(t.length>2){let e=2===n[0]?0:n[0],o=t[0];i=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(i.push(0===e?Math.min(o,t[r-1]):Math.max(o,t[r-1])),e=n[r],o=t[r]),r===n.length-1&&i.push(0===n[r]?Math.min(o,t[r]):Math.max(o,t[r])));i.sort((e,t)=>e-t)}else t[0]>t[1]&&(i=[t[1],t[0]]);x.push(i)}for(let m=0,h=0;m<i;m++){const e=l+r*m;for(let t=0;t<o;t++,h++){const i=c-s*t,o=x[t];if(2===o.length)e>=o[0]&&e<=o[1]&&(n.push([e,i]),f[h]=1);else if(o.length>2){let t=!1;for(let n=0;n<o.length;n+=2)if(e>=o[n]&&e<=o[n+1]){t=!0;break}t&&(n.push([e,i]),f[h]=1)}}}return{points:n,mask:f}}function X(e,t){const[n,i]=t;for(let o=0;o<e.length;o++){const t=e[o][1];(t<n||t>i)&&(e[o]=[NaN,NaN])}}function K(e,t){const n=Z(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??W(e[0].spatialReference),1===(e=e.filter(e=>e.width>t)).length)return e[0];let{xmin:o,xmax:r,ymin:s,ymax:a}=e[0];for(let i=1;i<e.length;i++){const t=e[i];r=t.xmax+n*i,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new i({xmin:o,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function D(t,n,o=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=te(t),l=Z(s,!0),c=Z(n);if(0===a||null==l||null==c){const e=V(t,n,o,r);if(e&&null==l&&null!=c&&Math.abs(e.width-c)<W(n)&&k.isLoaded()){const i=B(s);if(null!=i&&0===i.poleLocation&&t.width<(i.bbox[2]-i.bbox[0])/2)return Q(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>W(s)){const{xmin:e,xmax:n}=t;for(let o=0;o<=a;o++){const r=0===o?e:-l/2,c=o===a?n-l*o:l/2;f[o]=new i({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}const u=f.map(e=>V(e,n,o,r)).filter(e);return 0===u.length?null:K(u)}function H(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:i,ymax:o,spatialReference:r}=e;e=new f({rings:[[[t,o],[i,o],[i,n],[t,n],[t,o]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(h(),k.execute(e,t,{geographicTransformation:n}))}function Q(e,t){const n=Z(t);if(null==n)return null;let{xmin:o,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new f({spatialReference:l,rings:[[[o,r],[s,r],[s,a],[o,a],[o,r]]]}),u=k.execute(c,t);if(2!==u.rings.length||!u.rings[0].length||!u.rings[1].length)return null;const{rings:x}=u,m=W(l),h=new i({spatialReference:t});for(let i=0;i<2;i++){o=s=x[i][0][0],r=a=x[i][0][1];for(let e=0;e<x[i].length;e++)o=o>x[i][e][0]?x[i][e][0]:o,s=s<x[i][e][0]?x[i][e][0]:s,r=r>x[i][e][1]?x[i][e][1]:r,a=a<x[i][e][1]?x[i][e][1]:a;if(0===i)h.ymin=r,h.ymax=a,h.xmin=o,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<m)h.xmin=o,h.xmax=h.xmax+n;else{if(!(Math.abs(o+n/2)<m))return null;h.xmax=s+n}}return h}function V(e,t,n,i=!0,o=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;h();const s=k.execute(e,t,{geographicTransformation:n});if(o&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!i||!s)return s;const a=$(r,!0),l=$(t,!0);if(null==a||null==l)return s;const f=W(r,.001),u=W(r,S),x=W(t,.001);if(Math.abs(s.xmin-l[0])<x&&Math.abs(s.xmax-l[1])<x){const i=Math.abs(e.xmin-a[0]),o=Math.abs(a[1]-e.xmax);if(i<f&&o>u){s.xmin=l[0];const i=[];i.push(new c(e.xmax,e.ymin,r)),i.push(new c(e.xmax,(e.ymin+e.ymax)/2,r)),i.push(new c(e.xmax,e.ymax,r));const o=i.map(e=>I(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmax=Math.max.apply(null,o)}if(o<f&&i>u){s.xmax=l[1];const i=[];i.push(new c(e.xmin,e.ymin,r)),i.push(new c(e.xmin,(e.ymin+e.ymax)/2,r)),i.push(new c(e.xmin,e.ymax,r));const o=i.map(e=>I(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmin=Math.min.apply(null,o)}}else{const e=W(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function Z(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*g[e.wkid]||null}function $(e,t=!1){if(e.isGeographic)return[-180,180];const n=Z(e,t);return n?[-n/2,n/2]:null}function ee(e,t,n,i){let o=(e-t)/n;return o-Math.floor(o)!==0?o=Math.floor(o):i&&(o-=1),o}function te(e,t=!1){const n=Z(e.spatialReference);if(null==n)return 0;const i=t?0:-(n/2),o=W(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<o?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<o?-n/2:e.xmin;return ee(r,i,n,!0)-ee(s,i,n,!1)}function ne(e){const t=e.storageInfo.origin.x,n=Z(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const i=n/2,{nativePixelSize:o,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=o.x;const u=[],x=null!=e.transform&&"gcs-shift"===e.transform.type,m=t+(x?0:i),h=x?n-t:i-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)===0?e:Math.ceil(e),i=h/f/l,o=i-Math.floor(i)===0?i:Math.ceil(i),r=Math.floor(m/f/l),a=Math.round(m/f)%l,x=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:o,leftMargin:a,rightPadding:x,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:i,pyramidsInfo:u,hasGCSSShiftTransform:x}}function ie(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(R.has(t))n=R.get(t);else{n=(e.wkid?o.coordsys(e.wkid):o.fromString(r.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),R.set(t,n)}return new x({wkid:n})}function oe(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[y,y],i=re(e),o={cols:i.size[0]+1,rows:i.size[1]+1};const r=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let s=i.outofBoundPointCount===i.offsets.length/2||t&&r?[0,0]:p(i.offsets,o,n,w);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>w)&&(l.isGeographic||B(l),n=[d,d],i=re({...e,spacing:n}),o={cols:i.size[0]+1,rows:i.size[1]+1},s=p(i.offsets,o,n,w)),i.error=s,n[0]>1&&(i.coefficients=se(i.offsets,o,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)i.gcsGrid={offsets:i.offsets,coefficients:i.coefficients,spacing:n};else{const t=B(l);if(null!=t&&!t.isEnvelope){const t=ie(l),s=D(e.projectedExtent,t),{offsets:a}=re({...e,srcBufferExtent:s,spacing:n}),c=se(a,o,r);i.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return i}function re(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:i,datumTransformation:o,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;h();const{xmin:l,ymin:f,xmax:u,ymax:x}=t,m=Z(a),p=null!=m&&(e.hasWrapAround||"gcs-shift"===r?.type),g=e.spacing||[y,y],w=g[0]*i.x,M=g[1]*i.y,R=1===g[0],P=Math.ceil((u-l)/w-.1/g[0])+(R?0:1),b=Math.ceil((x-f)/M-.1/g[1])+(R?0:1),G=A({cols:P,rows:b,xmin:l,ymax:x,xres:w,yres:M,inSR:s,outSR:a,datumTransformation:o,preferPE:g[0]<=d,usePixelCenter:R}),k=[];let E,T=0;const N=R?-1:NaN,{xmin:v,xmax:j,ymax:C,width:_,height:z}=n,L=W(a,S),I=null!=m&&v>0&&j>m/2,O=B(s),F=null!=O&&O.poleLocation>0;for(let h=0;h<P;h++){const e=[];for(let t=0;t<b;t++){let n=G[h*b+t];if(p&&n[0]>j&&n[0]>m/2-L?n[0]-=m:p&&0===h&&n[0]<0&&I&&!r&&(n[0]+=m),!n||isNaN(n[0])||isNaN(n[1]))k.push(N),k.push(N),e.push(null),T++;else{if(r){const e=r.inverseTransform(new c({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),h>0&&p&&E[t]&&n[0]<E[t][0]&&(n[0]+=m,F&&n[0]>j&&n[0]>m&&(n[0]-=m)),k.push((n[0]-v)/_),k.push((C-n[1])/z)}}E=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:T,spacing:g,size:R?[P,b]:[P-1,b-1]}}function se(e,t,n){const{cols:i,rows:o}=t,r=new Float32Array((i-1)*(o-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<i-1;l++){for(let t=0;t<o-1;t++){let n=l*o*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],x=e[n+3];n+=2*o;const m=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(i-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*x+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*m+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ae(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:K(n,t)}function le(e){const{spatialReference:t}=e,n=m(t);if(!n)return e;const[o,r]=n.valid,s=r-o;let a=0;if(e.xmin<o){const t=o-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new i({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function ce(e,t,i){const{storageInfo:o,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=o,f="mixed"===o.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/f;if(null!=l&&l.length){const e=l[l.length-1],o=(e.x+e.y)/2,f=(r.x+r.y)/2;if(u<=f)s=0;else if(u>=o)s=l.length,a=u/o>8;else{let e,t=f;for(let n=1;n<=l.length;n++){if(e=(l[n-1].x+l[n-1].y)/2,u<=e){u===e?s=n:"down"===i?(s=n-1,a=u/t>8):s="up"===i||u-t>e-u||u/t>2?n:n-1;break}t=e}}const x=0===s?r:l[s-1];if(a){Math.min(x.x,x.y)*n(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new c({x:x.x,y:x.y,spatialReference:t.spatialReference}),excessiveReading:a}}const x=Math.log(e.x/r.x)/Math.LN2,m=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===i?Math.floor(Math.min(x,m)):"up"===i?Math.ceil(Math.max(x,m)):Math.round((x+m)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new c({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function fe(e,t,n=!1){const{pixelSize:i,extent:o}=e,r=v(o,t,!1),s=D(ae(o,(i.x+i.y)/16),t,r);return!s||n||0===te(s)?s:V(o,t,r)}function ue(e,t,n){const i=n?.tileSize??512,o=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,pixelSize:a}=e,l=_(a,t,s);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(l.x+l.y)/2,f=z(c,t),u=256/i,x=t.isGeographic?295828763.7958547*u:591657527.591555*u,m=(t.isGeographic?.703125:156543.03392800014)*u;let h="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const p=fe(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(x/2/f)/Math.LN2));if(!h&&p&&o&&(t.isGeographic||t.isWebMercator)){const n=Z(t);if(h=te(p)>0||null!=n&&p.width>n/4,!h&&null!=n){let t=-1;if(g<3)t=2**g*c*i;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:o=2}=e.storageInfo;t=o**n*c*i}const o=Math.ceil(n/t);h=1===o||2===o&&n/2-p.xmax<t}}let y,d=f;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(h){d=x;const n=xe(e,t);y={x:n.x*m,y:n.y*m}}else{y={x:a.x,y:a.y};let e=0;for(;d<x*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,x)/Math.min(d,x)<=w&&(d=x)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,f)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*a.x;let t=S.findIndex(t=>t.x>=a.x-e&&t.x<=a.x+e);t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex(t=>t.x<=a.x+e),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:l,scales:R,srcResolutions:S,isCustomTilingScheme:!h}}function xe(e,t){if(t.isWGS84||t.isWebMercator){const n=t.isGeographic?1341104507446289e-21:.29858214164761665,i=t.isGeographic?4326:3857,o=fe(e,new x({wkid:i}),!0),r=_({x:n,y:n},e.spatialReference,o);return{x:r.x/n,y:r.y/n}}const n=_(e.pixelSize,t,e.extent),i=(n.x+n.y)/2;return{x:e.pixelSize.x/i,y:e.pixelSize.y/i}}function me(e,t){const{spatialReference:n,lods:i}=t,{x:o,y:r}=xe(e,n);return i.map(({resolution:e})=>({x:e*o,y:e*r}))}function he(e){let t=0;for(const n of e){const e=n.length;let i=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)i+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=i/2}return Math.abs(t)}export{ue as computeProjectedScales,xe as computeSrcResolutionRatio,me as computeSrcResolutions,y as defaultGridSpacing,w as defaultProjectionToleranceInPixels,v as getDefaultDatumTransformationForDataset,A as getProjectedGridPoints,oe as getProjectionOffsetGrid,ne as getRasterDatasetAlignmentInfo,L as getSourceScale,Z as getWorldWidth,te as getWorldWrapCount,N as load,d as minimumGridSpacing,fe as projectDatasetExtent,_ as projectDatasetResolution,D as projectExtent,I as projectPoint,H as projectPolygon,j as projectResolution,le as shiftExtent,ae as snapExtent,ce as snapPyramid};
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const c="20260312",b="701f3a4dbef1743e0a6cbbc3cbc01d12f4d9d0cb";export{c as buildDate,b as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{onAbortOrThrow as t,throwIfNotAbortError as e}from"../../../core/promiseUtils.js";import{identity as i,translate as s,rotate as r,scaleByVec2 as h,multiply as o}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as a}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{DisplayObject as n}from"./DisplayObject.js";import l from"./ImageryBitmapSource.js";import{SizedPixelFormat as c}from"../../webgl/enums.js";import d from"../../webgl/Texture.js";import{TextureDescriptor as _}from"../../webgl/TextureDescriptor.js";function m(t){t instanceof ImageBitmap&&t.close()}function p(t){return t&&"render"in t}function x(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function g(t){return p(t)?t instanceof l?t.getRenderedRasterPixels()?.renderedRasterPixels:x(t):t}class f extends n{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._texture=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){super.destroy(),this._texture&&(this._texture.dispose(),this._texture=null),this._source&&m(this._source),null!=this._uploadStatus&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return void 0!==this._height?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){null==t&&null==this._source||(this._source&&m(this._source),this._source=t,this.invalidateTexture(),this.requestRender())}get texture(){return this._texture}get width(){return void 0!==this._width?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(e,i){null!=this._uploadStatus&&this._uploadStatus.controller.abort();const s=new AbortController,r=Promise.withResolvers();return t(i,()=>s.abort()),t(s,t=>r.reject(t)),this._uploadStatus={controller:s,resolver:r},this.source=e,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=i(this.transforms.displayViewScreenMat3),[u,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,c=l*this.width,d=l*this.height,_=Math.PI*this.rotation/180;s(e,e,a(u,n)),s(e,e,a(c/2,d/2)),r(e,e,-_),s(e,e,a(-c/2,-d/2)),h(e,e,a(c,d)),o(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:i}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const s=g(this.source);try{if(null!=this._uploadStatus){const{controller:t,resolver:e}=this._uploadStatus,r={signal:t.signal},{width:h,height:o}=this,u=this._texture,a=i.textureUploadManager;await a.enqueueTextureUpdate({data:s,texture:u,width:h,height:o},r),e.resolve(),this._uploadStatus=null}else this._texture.setData(s);this.ready()}catch(r){e(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:u()}}_createTexture(t){const e=this.immutable,i=new _(this._sourceWidth,this._sourceHeight);return i.internalFormat=e?c.RGBA8:6408,i.wrapMode=33071,i.isImmutable=e,new d(t,i)}}export{f as Bitmap,p as isImageSource,x as rasterize};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import has from"../../../../core/has.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";let o=class extends t{constructor(e){super(e),this.computedOpacity=1,this.computedVisible=!0,this.opacity=1,this.visible=!0,this._fadeOutResolver=null,this._fadeInResolver=null}get transitioning(){return(this._fadeOutResolver||!this.visible?0:this.opacity)!==this.computedOpacity}endTransition(){this._fadeInResolver?.resolve(),this._fadeOutResolver?.resolve(),this._fadeInResolver=this._fadeOutResolver=null,this.computedOpacity=this.visible?this.opacity:0}fadeIn(){return this._fadeInResolver||(this.opacity=1,this.computedOpacity=0,this._fadeOutResolver?.resolve(),this._fadeOutResolver=null,this._fadeInResolver=Promise.withResolvers()),this._fadeInResolver.promise}fadeOut(){return this._fadeOutResolver||(this.opacity=0,this._fadeInResolver?.resolve(),this._fadeInResolver=null,this._fadeOutResolver=Promise.withResolvers()),this._fadeOutResolver.promise}transitionStep(e,t){const i=has("mapview-transitions-duration"),s=i?1/i:0;if(0===s)this.computedOpacity=this.opacity,this.computedVisible=this.visible;else{const t=this._fadeOutResolver||!this.visible?0:this.opacity,i=this.computedOpacity;if(i===t)this.computedVisible=this.visible;else{const o=e*s;this.computedOpacity=i>t?Math.max(t,i-o):Math.min(t,i+o),this.computedVisible=this.computedOpacity>0}}this.transitioning||(this._fadeInResolver?.resolve(),this._fadeOutResolver?.resolve(),this._fadeOutResolver=this._fadeInResolver=null)}};e([i()],o.prototype,"computedOpacity",void 0),e([i()],o.prototype,"computedVisible",void 0),e([i()],o.prototype,"opacity",void 0),e([i()],o.prototype,"visible",void 0),e([i()],o.prototype,"transitioning",null),e([i()],o.prototype,"_fadeOutResolver",void 0),e([i()],o.prototype,"_fadeInResolver",void 0),o=e([s("esri.views.2d.engine.transitions.FadeTransition")],o);export{o as FadeTransition};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{throwIfAborted as e,onAbortOrThrow as t}from"../../../../core/promiseUtils.js";import{textureUploadManagerChunkSize as s,textureUploadManagerBudget as o}from"./definitions.js";class r{constructor(e){this._queue=[],this._refreshable=e}destroy(){this._queue=[]}enqueueTextureUpdate(o,r){const u=Promise.withResolvers(),n=o,h=s,i=Math.ceil(n.height/h);e(r);for(let e=0;e<i;e++){const t=e*h,s=e===i-1,a=s?n.height-h*e:h;this._queue.push({type:"chunk",request:o,resolver:u,chunk:e,chunkOffset:t,destHeight:a,chunkIsLast:s,options:r})}return t(r,e=>u.reject(e)),u.promise}upload(){const e=performance.now();let t=0;for(;this._queue.length;){const s=this._queue.shift();if(s){if(null!=s.options.signal&&s.options.signal.aborted)continue;switch(s.type){case"chunk":this._uploadChunk(s);break;case"no-chunk":this._uploadNoChunk(s)}++t;const r=performance.now()-e;if(r+r/t>=o)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(e){const{request:t,resolver:s,chunkOffset:o,chunkIsLast:r,destHeight:u}=e,{data:n,texture:h,width:i}=t;null!=n&&(h.updateData(0,0,o,i,u,n,o),r&&s.resolve())}_uploadNoChunk(e){const{request:t,resolver:s}=e,{data:o,texture:r}=t;r.setData(o),s.resolve()}}export{r as TextureUploadManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{Container as e}from"../../../Container.js";import{TestDisplayObject as s}from"./TestDisplayObject.js";class r extends e{constructor(e,s){super(),this.store=e,this.meshData=s}whenRender(){return null==this._resolver&&(this._resolver=Promise.withResolvers(),this.requestRender()),this._resolver.promise}doRender(e){const r=this._stage?.bufferPool,t=s.fromMeshData(this.meshData,r,this.store);for(const[s,o]of this.store.entries())t.setActiveMesh(s),o.techniqueRef.render(e,t);t.destroy(),this._resolver&&(this._resolver.resolve(),this._resolver=null)}}export{r as TechniqueDebugContainer};
|