@vcmap/ui 5.0.0-rc.8 → 5.0.0
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/README.md +95 -64
- package/app.config.json +3 -0
- package/build/.eslintrc +3 -0
- package/build/build.js +302 -165
- package/build/buildCesium.js +39 -19
- package/build/buildHelpers.js +279 -88
- package/build/buildPreview.js +16 -6
- package/build/bundle.js +57 -0
- package/build/commonViteConfig.js +7 -16
- package/build/determineHost.js +17 -4
- package/build/generateOLLib.js +15 -18
- package/build/getPluginProxies.js +35 -3
- package/build/info/conf.json +21 -19
- package/build/info/publish.js +16 -5
- package/config/aerowest.config.json +47 -54
- package/config/base.config.json +597 -662
- package/config/codes.config.json +401 -0
- package/config/dev.config.json +460 -14
- package/config/graphFeatureInfo.config.json +141 -0
- package/config/projects.config.json +29 -0
- package/config/www.config.json +1801 -0
- package/dist/assets/@mdi/font/LICENSE +20 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.min.e3f476.css +3 -0
- package/dist/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/dist/assets/cesium/ThirdParty/Workers/basis_transcoder.js +21 -0
- package/dist/assets/cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/assets/cesium/ThirdParty/Workers/pako_deflate.min.js +2 -0
- package/dist/assets/cesium/ThirdParty/Workers/pako_inflate.min.js +2 -0
- package/dist/assets/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/dist/assets/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/assets/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/assets/cesium/ThirdParty/google-earth-dbroot-parser.js +8337 -0
- package/dist/assets/cesium/Workers/chunk-227AJNOA.js +59 -0
- package/dist/assets/cesium/Workers/chunk-2R5O53JW.js +157 -0
- package/dist/assets/cesium/Workers/chunk-34YUDLRP.js +781 -0
- package/dist/assets/cesium/Workers/chunk-3W63OHNJ.js +100 -0
- package/dist/assets/cesium/Workers/chunk-4MFFIWUA.js +163 -0
- package/dist/assets/cesium/Workers/chunk-66QLLS45.js +218 -0
- package/dist/assets/cesium/Workers/chunk-6BTKZDRG.js +77 -0
- package/dist/assets/cesium/Workers/chunk-A4JVFBQ3.js +101 -0
- package/dist/assets/cesium/Workers/chunk-ABADGKYE.js +58 -0
- package/dist/assets/cesium/Workers/chunk-AFFLIKOH.js +353 -0
- package/dist/assets/cesium/Workers/chunk-AHKEZ2OE.js +629 -0
- package/dist/assets/cesium/Workers/chunk-C3SXRKRW.js +476 -0
- package/dist/assets/cesium/Workers/chunk-CCFQRR6D.js +55 -0
- package/dist/assets/cesium/Workers/chunk-CHHNOC2C.js +1860 -0
- package/dist/assets/cesium/Workers/chunk-CTELOFLA.js +196 -0
- package/dist/assets/cesium/Workers/chunk-DUHWWBQQ.js +3273 -0
- package/dist/assets/cesium/Workers/chunk-EW2GWJYB.js +44 -0
- package/dist/assets/cesium/Workers/chunk-GLZBE3ML.js +421 -0
- package/dist/assets/cesium/Workers/chunk-HARLBUOL.js +236 -0
- package/dist/assets/cesium/Workers/chunk-HQF437NJ.js +117 -0
- package/dist/assets/cesium/Workers/chunk-IPA4EACJ.js +368 -0
- package/dist/assets/cesium/Workers/chunk-J3JY6I2C.js +1009 -0
- package/dist/assets/cesium/Workers/chunk-JB2LWGH4.js +390 -0
- package/dist/assets/cesium/Workers/chunk-JS3AW5BK.js +634 -0
- package/dist/assets/cesium/Workers/chunk-K36FEYS7.js +452 -0
- package/dist/assets/cesium/Workers/chunk-KD4Y7CZL.js +400 -0
- package/dist/assets/cesium/Workers/chunk-KTJSNCK4.js +842 -0
- package/dist/assets/cesium/Workers/chunk-LLUNNUJV.js +258 -0
- package/dist/assets/cesium/Workers/chunk-MPAZH4BF.js +37 -0
- package/dist/assets/cesium/Workers/chunk-MYZB7C4T.js +1258 -0
- package/dist/assets/cesium/Workers/chunk-N3JIFFX2.js +501 -0
- package/dist/assets/cesium/Workers/chunk-O5AMBQ36.js +430 -0
- package/dist/assets/cesium/Workers/chunk-OAVNIRB4.js +124 -0
- package/dist/assets/cesium/Workers/chunk-OYFCF4PL.js +171 -0
- package/dist/assets/cesium/Workers/chunk-OZJDGN5F.js +1477 -0
- package/dist/assets/cesium/Workers/chunk-PCJWUS4M.js +2041 -0
- package/dist/assets/cesium/Workers/chunk-PFQBCKBM.js +8644 -0
- package/dist/assets/cesium/Workers/chunk-QIKODV5G.js +305 -0
- package/dist/assets/cesium/Workers/chunk-QJ3DFBH3.js +73 -0
- package/dist/assets/cesium/Workers/chunk-QMEMZIJI.js +138 -0
- package/dist/assets/cesium/Workers/chunk-QT3MPEMI.js +102 -0
- package/dist/assets/cesium/Workers/chunk-RP2A7BR5.js +289 -0
- package/dist/assets/cesium/Workers/chunk-RW6LU2CJ.js +138 -0
- package/dist/assets/cesium/Workers/chunk-TFC6TZ3S.js +757 -0
- package/dist/assets/cesium/Workers/chunk-V3NGATMV.js +693 -0
- package/dist/assets/cesium/Workers/chunk-VLGOATD6.js +1075 -0
- package/dist/assets/cesium/Workers/chunk-WXTV4ATB.js +39 -0
- package/dist/assets/cesium/Workers/chunk-X4SU25DT.js +302 -0
- package/dist/assets/cesium/Workers/chunk-XTY7B2N6.js +2716 -0
- package/dist/assets/cesium/Workers/chunk-XY7MGBKC.js +513 -0
- package/dist/assets/cesium/Workers/chunk-Z24VKNDO.js +834 -0
- package/dist/assets/cesium/Workers/chunk-ZA25DG4Y.js +684 -0
- package/dist/assets/cesium/Workers/chunk-ZFOBYDGF.js +73 -0
- package/dist/assets/cesium/Workers/combineGeometry.js +67 -1
- package/dist/assets/cesium/Workers/createBoxGeometry.js +57 -1
- package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +234 -1
- package/dist/assets/cesium/Workers/createCircleGeometry.js +196 -1
- package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +146 -1
- package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +506 -1
- package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +224 -1
- package/dist/assets/cesium/Workers/createCorridorGeometry.js +1262 -1
- package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +567 -1
- package/dist/assets/cesium/Workers/createCylinderGeometry.js +59 -1
- package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +231 -1
- package/dist/assets/cesium/Workers/createEllipseGeometry.js +70 -1
- package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +63 -1
- package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +58 -1
- package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +60 -1
- package/dist/assets/cesium/Workers/createFrustumGeometry.js +57 -1
- package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +234 -1
- package/dist/assets/cesium/Workers/createGeometry.js +150 -1
- package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1607 -1
- package/dist/assets/cesium/Workers/createPlaneGeometry.js +223 -1
- package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +123 -1
- package/dist/assets/cesium/Workers/createPolygonGeometry.js +1134 -1
- package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +542 -1
- package/dist/assets/cesium/Workers/createPolylineGeometry.js +495 -1
- package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +379 -1
- package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +277 -1
- package/dist/assets/cesium/Workers/createRectangleGeometry.js +1273 -1
- package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +480 -1
- package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +399 -1
- package/dist/assets/cesium/Workers/createSphereGeometry.js +117 -1
- package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +117 -1
- package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +32 -1
- package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +492 -1
- package/dist/assets/cesium/Workers/createVectorTileGeometries.js +386 -1
- package/dist/assets/cesium/Workers/createVectorTilePoints.js +112 -1
- package/dist/assets/cesium/Workers/createVectorTilePolygons.js +384 -1
- package/dist/assets/cesium/Workers/createVectorTilePolylines.js +262 -1
- package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +568 -1
- package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2277 -3
- package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +745 -1
- package/dist/assets/cesium/Workers/createWallGeometry.js +489 -1
- package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +337 -1
- package/dist/assets/cesium/Workers/decodeDraco.js +369 -1
- package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +2650 -1
- package/dist/assets/cesium/Workers/decodeI3S.js +835 -0
- package/dist/assets/cesium/Workers/transcodeKTX2.js +3425 -1
- package/dist/assets/cesium/Workers/transferTypedArrayTest.js +41 -1
- package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +818 -1
- package/dist/assets/cesium.4137c8.js +164897 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/core.306872.js +19286 -0
- package/dist/assets/core.js +1 -1
- package/dist/assets/favicon-128.4c4ce5.png +0 -0
- package/dist/assets/favicon-180.5b99c0.png +0 -0
- package/dist/assets/favicon-192.0e205e.png +0 -0
- package/dist/assets/favicon-32.6b9add.png +0 -0
- package/dist/assets/favicon.d5ec97.svg +10 -0
- package/dist/assets/font/OFL.txt +93 -0
- package/dist/assets/font/TitilliumWeb-Regular.9ca076.woff2 +0 -0
- package/dist/assets/index-cfed33b1.js +1 -0
- package/dist/assets/ol.328bbf.js +60117 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/style/icon-marker-blue.534e37.png +0 -0
- package/dist/assets/style/icon-marker-green.0b6a92.png +0 -0
- package/dist/assets/style/icon-marker-o-blue.7b6d62.png +0 -0
- package/dist/assets/style/icon-marker-o-green.c863c0.png +0 -0
- package/dist/assets/style/icon-marker-o-red.93ff58.png +0 -0
- package/dist/assets/style/icon-marker-o.036477.png +0 -0
- package/dist/assets/style/icon-marker-red.313d03.png +0 -0
- package/dist/assets/style/icon-marker.70960f.png +0 -0
- package/dist/assets/style/icon-pin-blue.7be369.png +0 -0
- package/dist/assets/style/icon-pin-green.cbb935.png +0 -0
- package/dist/assets/style/icon-pin-red.3f25b2.png +0 -0
- package/dist/assets/style/icon-pin.b7ce77.png +0 -0
- package/dist/assets/ui.e84ce9.css +5 -0
- package/dist/assets/ui.e84ce9.js +16488 -0
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.1c8696.js +4911 -0
- package/dist/assets/vue.js +5 -1
- package/dist/assets/vuetify.008fac.css +5 -0
- package/dist/assets/vuetify.008fac.js +21262 -0
- package/dist/assets/vuetify.js +5 -2
- package/dist/index.html +90 -8
- package/index.html +111 -0
- package/index.js +203 -18
- package/lib/cesium.js +1 -1
- package/lib/core.js +1 -1
- package/lib/olLib.js +861 -843
- package/lib/ui.js +1 -1
- package/lib/vue.js +2 -1
- package/lib/vuetify.js +2 -2
- package/package.json +53 -34
- package/plugins/.eslintrc +9 -0
- package/plugins/@vcmap-show-case/README.md +28 -0
- package/plugins/@vcmap-show-case/buttons-example/README.md +4 -0
- package/plugins/@vcmap-show-case/buttons-example/package.json +5 -0
- package/plugins/@vcmap-show-case/buttons-example/src/ButtonsExample.vue +282 -0
- package/plugins/@vcmap-show-case/buttons-example/src/index.js +51 -0
- package/plugins/@vcmap-show-case/category-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/category-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/category-tester/src/CategoriesExample.vue +135 -0
- package/plugins/@vcmap-show-case/category-tester/src/CollectionComponentOptions.vue +209 -0
- package/plugins/@vcmap-show-case/category-tester/src/index.js +73 -0
- package/plugins/@vcmap-show-case/collection-manager-example/README.md +3 -0
- package/plugins/@vcmap-show-case/collection-manager-example/package.json +5 -0
- package/plugins/@vcmap-show-case/collection-manager-example/src/CollectionManagerExample.vue +182 -0
- package/plugins/@vcmap-show-case/collection-manager-example/src/index.js +79 -0
- package/plugins/@vcmap-show-case/config-editor/README.md +3 -0
- package/plugins/@vcmap-show-case/config-editor/package.json +5 -0
- package/plugins/@vcmap-show-case/config-editor/src/ConfigEditor.vue +62 -0
- package/plugins/@vcmap-show-case/config-editor/src/index.js +49 -0
- package/plugins/@vcmap-show-case/context-menu-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/context-menu-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/context-menu-tester/src/index.js +41 -0
- package/plugins/@vcmap-show-case/form-inputs-example/README.md +4 -0
- package/plugins/@vcmap-show-case/form-inputs-example/config.json +5 -0
- package/plugins/@vcmap-show-case/form-inputs-example/package.json +5 -0
- package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +516 -0
- package/plugins/@vcmap-show-case/form-inputs-example/src/exampleActions.js +36 -0
- package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/index.js +123 -39
- package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/validation.js +14 -2
- package/plugins/@vcmap-show-case/hello-world/README.md +31 -0
- package/plugins/@vcmap-show-case/hello-world/package.json +6 -0
- package/plugins/@vcmap-show-case/hello-world/plugin-assets/vcs_logo.png +0 -0
- package/plugins/@vcmap-show-case/hello-world/src/defaultOptions.js +4 -0
- package/plugins/@vcmap-show-case/hello-world/src/helloWorld.vue +69 -0
- package/plugins/@vcmap-show-case/hello-world/src/index.js +142 -0
- package/plugins/@vcmap-show-case/hello-world/tests/helloWorld.spec.js +53 -0
- package/plugins/@vcmap-show-case/icons-example/README.md +5 -0
- package/plugins/@vcmap-show-case/icons-example/package.json +5 -0
- package/plugins/@vcmap-show-case/icons-example/src/AllIconsComponent.vue +51 -0
- package/plugins/@vcmap-show-case/icons-example/src/index.js +46 -0
- package/plugins/@vcmap-show-case/list-example/README.md +3 -0
- package/plugins/@vcmap-show-case/list-example/package.json +5 -0
- package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +411 -0
- package/plugins/@vcmap-show-case/list-example/src/index.js +46 -0
- package/plugins/@vcmap-show-case/notifier-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/notifier-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/notifier-tester/src/NotifierTester.vue +82 -0
- package/plugins/@vcmap-show-case/notifier-tester/src/index.js +42 -0
- package/plugins/@vcmap-show-case/plugin-editors/README.md +4 -0
- package/plugins/@vcmap-show-case/plugin-editors/package.json +5 -0
- package/plugins/@vcmap-show-case/plugin-editors/src/PluginEditors.vue +119 -0
- package/plugins/@vcmap-show-case/plugin-editors/src/index.js +41 -0
- package/plugins/@vcmap-show-case/project-selector/README.md +25 -0
- package/plugins/@vcmap-show-case/project-selector/config.json +15 -0
- package/plugins/@vcmap-show-case/project-selector/package.json +13 -0
- package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +65 -0
- package/plugins/@vcmap-show-case/project-selector/src/ProjectSelectorComponent.vue +102 -0
- package/plugins/@vcmap-show-case/project-selector/src/de.json +10 -0
- package/plugins/@vcmap-show-case/project-selector/src/en.json +10 -0
- package/plugins/@vcmap-show-case/project-selector/src/index.js +269 -0
- package/plugins/@vcmap-show-case/simple-graph/README.md +71 -0
- package/plugins/@vcmap-show-case/simple-graph/package.json +11 -0
- package/plugins/@vcmap-show-case/simple-graph/src/SimpleGraphComponent.vue +59 -0
- package/plugins/@vcmap-show-case/simple-graph/src/index.js +17 -0
- package/plugins/@vcmap-show-case/simple-graph/src/simpleGraphView.js +78 -0
- package/plugins/@vcmap-show-case/style-input-example/README.md +4 -0
- package/plugins/@vcmap-show-case/style-input-example/package.json +5 -0
- package/plugins/@vcmap-show-case/style-input-example/src/StyleExample.vue +190 -0
- package/plugins/@vcmap-show-case/style-input-example/src/index.js +42 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/README.md +21 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/config.json +3 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/package.json +5 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/src/index.js +34 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/src/switchMapCallback.js +47 -0
- package/plugins/@vcmap-show-case/table-example/README.md +3 -0
- package/plugins/@vcmap-show-case/table-example/package.json +5 -0
- package/plugins/@vcmap-show-case/table-example/src/DataTableExample.vue +182 -0
- package/plugins/@vcmap-show-case/table-example/src/index.js +49 -0
- package/plugins/@vcmap-show-case/textfields-example/README.md +3 -0
- package/plugins/@vcmap-show-case/textfields-example/package.json +5 -0
- package/plugins/{example/mySuperComponent.vue → @vcmap-show-case/textfields-example/src/TextfieldsExample.vue} +13 -31
- package/plugins/@vcmap-show-case/textfields-example/src/index.js +64 -0
- package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/README.md +5 -3
- package/plugins/@vcmap-show-case/theme-changer/config.json +69 -0
- package/plugins/@vcmap-show-case/theme-changer/package.json +11 -0
- package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/ThemeChangerComponent.vue +36 -8
- package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/index.js +20 -14
- package/plugins/@vcmap-show-case/vector-properties-example/package.json +5 -0
- package/plugins/@vcmap-show-case/vector-properties-example/src/VectorPropertiesExample.vue +128 -0
- package/plugins/@vcmap-show-case/vector-properties-example/src/index.js +40 -0
- package/plugins/@vcmap-show-case/window-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/window-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/window-tester/src/EmptyComponent.vue +18 -0
- package/plugins/@vcmap-show-case/window-tester/src/MyCustomHeader.vue +31 -0
- package/plugins/@vcmap-show-case/window-tester/src/WindowExample.vue +185 -0
- package/plugins/@vcmap-show-case/window-tester/src/WindowExampleContent.vue +18 -0
- package/plugins/@vcmap-show-case/window-tester/src/WindowExampleToggleChild.vue +45 -0
- package/plugins/@vcmap-show-case/window-tester/src/index.js +80 -0
- package/plugins/@vcmap-show-case/window-tester/src/toolboxData.js +288 -0
- package/plugins/@vcmap-show-case/wizard-example/README.md +3 -0
- package/plugins/@vcmap-show-case/wizard-example/package.json +5 -0
- package/plugins/@vcmap-show-case/wizard-example/src/WizardExample.vue +127 -0
- package/plugins/@vcmap-show-case/wizard-example/src/index.js +53 -0
- package/plugins/package.json +9 -2
- package/public/assets/@mdi/font/LICENSE +20 -0
- package/public/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
- package/public/assets/@mdi/font/css/materialdesignicons.min.css +3 -0
- package/public/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/public/assets/favicon-128.png +0 -0
- package/public/assets/favicon-180.png +0 -0
- package/public/assets/favicon-192.png +0 -0
- package/public/assets/favicon-32.png +0 -0
- package/public/assets/favicon.svg +10 -0
- package/public/assets/font/OFL.txt +93 -0
- package/public/assets/font/TitilliumWeb-Regular.woff2 +0 -0
- package/public/assets/style/icon-marker-blue.png +0 -0
- package/public/assets/style/icon-marker-green.png +0 -0
- package/public/assets/style/icon-marker-o-blue.png +0 -0
- package/public/assets/style/icon-marker-o-green.png +0 -0
- package/public/assets/style/icon-marker-o-red.png +0 -0
- package/public/assets/style/icon-marker-o.png +0 -0
- package/public/assets/style/icon-marker-red.png +0 -0
- package/public/assets/style/icon-marker.png +0 -0
- package/public/assets/style/icon-pin-blue.png +0 -0
- package/public/assets/style/icon-pin-green.png +0 -0
- package/public/assets/style/icon-pin-red.png +0 -0
- package/public/assets/style/icon-pin.png +0 -0
- package/src/actions/StyleSelector.vue +121 -0
- package/src/actions/actionHelper.js +186 -50
- package/src/actions/stateRefAction.js +2 -3
- package/src/application/VcsApp.vue +539 -93
- package/src/application/VcsAppWrapper.vue +32 -0
- package/src/application/VcsAttributions.vue +83 -0
- package/src/application/VcsAttributionsFooter.vue +83 -0
- package/src/application/VcsMap.vue +22 -5
- package/src/application/VcsNavbar.vue +217 -0
- package/src/application/VcsSettings.vue +98 -0
- package/src/application/attributionsHelper.js +162 -0
- package/src/callback/activateLayersCallback.js +54 -0
- package/src/callback/applyLayerStyleCallback.js +63 -0
- package/src/callback/deactivateLayersCallback.js +54 -0
- package/src/callback/goToViewpointCallback.js +54 -0
- package/src/callback/vcsCallback.js +66 -0
- package/src/components/ImageElementInjector.vue +24 -0
- package/src/components/buttons/VcsActionButtonList.vue +129 -0
- package/src/components/buttons/VcsButton.vue +151 -0
- package/src/components/buttons/VcsFormButton.vue +178 -0
- package/src/components/buttons/VcsToolButton.vue +161 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +115 -0
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue +290 -0
- package/src/components/form-inputs-controls/VcsDatePicker.vue +156 -0
- package/src/components/form-inputs-controls/VcsFormSection.vue +150 -0
- package/src/components/form-inputs-controls/VcsLabel.vue +56 -0
- package/src/components/form-inputs-controls/VcsRadio.vue +149 -0
- package/src/components/form-inputs-controls/VcsRadioGrid.vue +175 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +211 -0
- package/src/components/form-inputs-controls/VcsSlider.vue +73 -0
- package/src/components/form-inputs-controls/VcsTextArea.vue +180 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +298 -0
- package/src/components/form-inputs-controls/VcsWizard.vue +137 -0
- package/src/components/form-inputs-controls/VcsWizardStep.vue +161 -0
- package/src/components/form-inputs-controls/composables.js +31 -0
- package/src/components/form-output/VcsFormattedNumber.vue +103 -0
- package/src/components/icons/+all.js +463 -0
- package/src/components/icons/2DAreaIcon.vue +58 -0
- package/src/components/icons/2DDistanceIcon.vue +24 -0
- package/src/components/icons/3DAreaIcon.vue +58 -0
- package/src/components/icons/3DDistanceIcon.vue +24 -0
- package/src/components/icons/3DHeightIcon.vue +24 -0
- package/src/components/icons/AngleIcon.vue +16 -0
- package/src/components/icons/AssociationsIcon.vue +37 -0
- package/src/components/icons/AxisIcon.vue +35 -0
- package/src/components/icons/BoundingBoxIcon.vue +38 -0
- package/src/components/icons/CheckboxCheckedIcon.vue +12 -0
- package/src/components/icons/CheckboxIcon.vue +21 -0
- package/src/components/icons/CheckboxIndeterminateIcon.vue +10 -0
- package/src/components/icons/CircleIcon.vue +25 -0
- package/src/components/icons/ClippingHorizontalIcon.vue +18 -0
- package/src/components/icons/ClippingIcon.vue +17 -0
- package/src/components/icons/ClippingVerticalIcon.vue +18 -0
- package/src/components/icons/ColorPickerIcon.vue +17 -0
- package/src/components/icons/ColorSwatchIcon.vue +21 -0
- package/src/components/icons/CommentIcon.vue +19 -0
- package/src/components/icons/CompassIcon.vue +24 -0
- package/src/components/icons/ComponentsIcon.vue +18 -0
- package/src/components/icons/ConeIcon.vue +30 -0
- package/src/components/icons/DimensionsHouseIcon.vue +20 -0
- package/src/components/icons/EditIcon.vue +17 -0
- package/src/components/icons/EditVerticesIcon.vue +35 -0
- package/src/components/icons/ElevationProfileIcon.vue +104 -0
- package/src/components/icons/ExportAreaIcon.vue +17 -0
- package/src/components/icons/ExportFlightIcon.vue +17 -0
- package/src/components/icons/ExportIcon.vue +24 -0
- package/src/components/icons/ExternalLinkIcon.vue +23 -0
- package/src/components/icons/EyeIcon.vue +17 -0
- package/src/components/icons/FastForwardIcon.vue +17 -0
- package/src/components/icons/FilterIcon.vue +18 -0
- package/src/components/icons/GlobalTerrainIcon.vue +19 -0
- package/src/components/icons/GlobeNatureIcon.vue +17 -0
- package/src/components/icons/GroundIcon.vue +27 -0
- package/src/components/icons/HealthCareIndustriesIcon.vue +113 -0
- package/src/components/icons/HelpIcon.vue +17 -0
- package/src/components/icons/HideIcon.vue +25 -0
- package/src/components/icons/HomePointIcon.vue +17 -0
- package/src/components/icons/HospitalsIcon.vue +223 -0
- package/src/components/icons/HouseIcon.vue +32 -0
- package/src/components/icons/ImportIcon.vue +18 -0
- package/src/components/icons/InfoIcon.vue +24 -0
- package/src/components/icons/KebabIcon.vue +38 -0
- package/src/components/icons/LabelIcon.vue +23 -0
- package/src/components/icons/LayersIcon.vue +28 -0
- package/src/components/icons/LegendIcon.vue +24 -0
- package/src/components/icons/LineIcon.vue +22 -0
- package/src/components/icons/LinkIcon.vue +17 -0
- package/src/components/icons/LogoutIcon.vue +17 -0
- package/src/components/icons/MapIcon.vue +18 -0
- package/src/components/icons/MenuIcon.vue +36 -0
- package/src/components/icons/MinusIcon.vue +18 -0
- package/src/components/icons/ObjectAttributeIcon.vue +18 -0
- package/src/components/icons/ObjectSelectIcon.vue +18 -0
- package/src/components/icons/ObliqueViewIcon.vue +19 -0
- package/src/components/icons/PdfIcon.vue +19 -0
- package/src/components/icons/PedestrianIcon.vue +17 -0
- package/src/components/icons/PenIcon.vue +16 -0
- package/src/components/icons/PlayCircleIcon.vue +20 -0
- package/src/components/icons/PlusIcon.vue +18 -0
- package/src/components/icons/PoiIcon.vue +23 -0
- package/src/components/icons/PointIcon.vue +40 -0
- package/src/components/icons/PointSelectIcon.vue +18 -0
- package/src/components/icons/PresentationModeIcon.vue +17 -0
- package/src/components/icons/ProgressIcon.vue +26 -0
- package/src/components/icons/QueryIcon.vue +39 -0
- package/src/components/icons/RectangleIcon.vue +24 -0
- package/src/components/icons/ReturnIcon.vue +17 -0
- package/src/components/icons/RewindIcon.vue +16 -0
- package/src/components/icons/RotateLeftIcon.vue +17 -0
- package/src/components/icons/RotateRightIcon.vue +17 -0
- package/src/components/icons/ScreenshotIcon.vue +53 -0
- package/src/components/icons/SearchIcon.vue +17 -0
- package/src/components/icons/ShadowIcon.vue +18 -0
- package/src/components/icons/ShapesIcon.vue +35 -0
- package/src/components/icons/ShareIcon.vue +22 -0
- package/src/components/icons/SimpleCircleFilledIcon.vue +18 -0
- package/src/components/icons/SimpleCircleHalfFilledIcon.vue +16 -0
- package/src/components/icons/SimpleCircleOutlinedIcon.vue +13 -0
- package/src/components/icons/SkipNextIcon.vue +18 -0
- package/src/components/icons/SkipPreviousIcon.vue +18 -0
- package/src/components/icons/SplitViewIcon.vue +19 -0
- package/src/components/icons/TerrainBoxIcon.vue +19 -0
- package/src/components/icons/TextStyleIcon.vue +17 -0
- package/src/components/icons/ThreeDimensionsIcon.vue +17 -0
- package/src/components/icons/ToolsIcon.vue +16 -0
- package/src/components/icons/TouchIcon.vue +18 -0
- package/src/components/icons/TrashCanIcon.vue +18 -0
- package/src/components/icons/TriangleIcon.vue +16 -0
- package/src/components/icons/TwoDimensionsIcon.vue +18 -0
- package/src/components/icons/UploadIcon.vue +17 -0
- package/src/components/icons/UserProfileIcon.vue +17 -0
- package/src/components/icons/UserShareIcon.vue +16 -0
- package/src/components/icons/VideoRecorderIcon.vue +23 -0
- package/src/components/icons/ViewpointFlightIcon.vue +28 -0
- package/src/components/icons/ViewpointIcon.vue +28 -0
- package/src/components/icons/Viewshed360Icon.vue +18 -0
- package/src/components/icons/ViewshedConeIcon.vue +17 -0
- package/src/components/icons/ViewshedIcon.vue +18 -0
- package/src/components/icons/WalkingIcon.vue +17 -0
- package/src/components/icons/WallIcon.vue +22 -0
- package/src/components/icons/WandIcon.vue +123 -0
- package/src/components/lists/VcsActionList.vue +132 -0
- package/src/components/lists/VcsList.vue +590 -0
- package/src/components/lists/VcsTreeview.vue +112 -0
- package/src/components/lists/VcsTreeviewLeaf.vue +81 -0
- package/src/components/lists/VcsTreeviewSearchbar.vue +148 -0
- package/src/components/notification/VcsBadge.vue +29 -0
- package/src/components/notification/VcsHelp.vue +39 -0
- package/src/components/notification/VcsTooltip.vue +160 -0
- package/src/components/notification/validation.js +19 -0
- package/src/components/plugins/AbstractConfigEditor.vue +84 -0
- package/src/components/style/MenuWrapper.vue +140 -0
- package/src/components/style/VcsFillMenu.vue +61 -0
- package/src/components/style/VcsFillSelector.vue +45 -0
- package/src/components/style/VcsImageMenu.vue +83 -0
- package/src/components/style/VcsImageSelector.vue +577 -0
- package/src/components/style/VcsStrokeMenu.vue +73 -0
- package/src/components/style/VcsStrokeSelector.vue +88 -0
- package/src/components/style/VcsTextMenu.vue +81 -0
- package/src/components/style/VcsTextSelector.vue +269 -0
- package/src/components/style/VcsVectorStyleComponent.vue +114 -0
- package/src/components/style/composables.js +84 -0
- package/src/components/tables/VcsDataTable.vue +475 -0
- package/src/components/tables/VcsTable.vue +145 -0
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +778 -0
- package/src/components/vector-properties/composables.js +93 -0
- package/src/contentTree/LayerTree.vue +19 -15
- package/src/contentTree/contentTreeCollection.js +114 -42
- package/src/contentTree/contentTreeItem.js +109 -43
- package/src/contentTree/groupContentTreeItem.js +46 -23
- package/src/contentTree/layerContentTreeItem.js +54 -23
- package/src/contentTree/layerGroupContentTreeItem.js +58 -26
- package/src/contentTree/nodeContentTreeItem.js +19 -8
- package/src/contentTree/obliqueCollectionContentTreeItem.js +51 -22
- package/src/contentTree/subContentTreeItem.js +14 -5
- package/src/contentTree/vcsObjectContentTreeItem.js +27 -16
- package/src/contentTree/viewpointContentTreeItem.js +121 -0
- package/src/downloadHelper.js +52 -0
- package/src/featureInfo/AddressBalloonComponent.vue +58 -0
- package/src/featureInfo/BalloonComponent.vue +193 -0
- package/src/featureInfo/abstractFeatureInfoView.js +346 -0
- package/src/featureInfo/addressBalloonFeatureInfoView.js +130 -0
- package/src/featureInfo/balloonFeatureInfoView.js +159 -0
- package/src/featureInfo/balloonHelper.js +172 -0
- package/src/featureInfo/featureInfo.js +525 -0
- package/src/featureInfo/featureInfoInteraction.js +48 -0
- package/src/featureInfo/iframeFeatureInfoView.js +97 -0
- package/src/featureInfo/tableFeatureInfoView.js +120 -0
- package/src/i18n/de.js +195 -0
- package/src/i18n/en.js +195 -0
- package/src/i18n/i18nCollection.js +137 -0
- package/src/init.js +121 -36
- package/src/legend/StyleLegendItem.vue +176 -0
- package/src/legend/VcsLegend.vue +140 -0
- package/src/legend/legendHelper.js +204 -0
- package/src/logo-mobile.svg +9 -0
- package/src/logo.svg +26 -0
- package/src/manager/buttonManager.js +30 -61
- package/src/manager/collectionManager/CollectionComponent.vue +140 -0
- package/src/manager/collectionManager/CollectionComponentList.vue +77 -0
- package/src/manager/collectionManager/CollectionComponentProvider.vue +39 -0
- package/src/manager/collectionManager/CollectionManager.vue +62 -0
- package/src/manager/collectionManager/categoryManager.js +83 -0
- package/src/manager/collectionManager/collectionComponent.js +470 -0
- package/src/manager/collectionManager/collectionManager.js +432 -0
- package/src/manager/contextMenu/ContextMenuComponent.vue +43 -0
- package/src/manager/contextMenu/contextMenuInteraction.js +47 -0
- package/src/manager/contextMenu/contextMenuManager.js +220 -0
- package/src/manager/navbarManager.js +115 -0
- package/src/manager/toolbox/GroupToolboxComponent.vue +128 -0
- package/src/manager/toolbox/SelectToolboxComponent.vue +144 -0
- package/src/manager/toolbox/ToolboxManager.vue +139 -74
- package/src/manager/toolbox/toolboxManager.js +371 -0
- package/src/manager/window/WindowComponent.vue +105 -85
- package/src/manager/window/WindowComponentHeader.vue +116 -25
- package/src/manager/window/WindowManager.vue +133 -50
- package/src/manager/window/windowHelper.js +465 -0
- package/src/manager/window/windowManager.js +297 -91
- package/src/navigation/{mapNavCompass.vue → MapNavCompass.vue} +31 -11
- package/src/navigation/MapNavigation.vue +291 -0
- package/src/navigation/ObliqueRotation.vue +69 -0
- package/src/navigation/{orientationToolsButton.vue → OrientationToolsButton.vue} +14 -13
- package/src/navigation/{tiltSlider.vue → TiltSlider.vue} +40 -17
- package/src/navigation/VcsCompass.vue +69 -0
- package/src/navigation/VcsZoomButton.vue +52 -0
- package/src/navigation/overviewMap.js +142 -104
- package/src/navigation/overviewMapClickedInteraction.js +6 -1
- package/src/notifier/NotifierComponent.vue +86 -0
- package/src/notifier/notifier.js +129 -0
- package/src/pluginHelper.js +148 -20
- package/src/search/ResultItem.vue +83 -0
- package/src/search/ResultsComponent.vue +103 -0
- package/src/search/SearchComponent.vue +116 -0
- package/src/search/search.js +342 -0
- package/src/setup.js +9 -10
- package/src/state.js +272 -0
- package/src/styles/_theming.scss +69 -11
- package/src/styles/_typography.scss +3 -6
- package/src/styles/main.scss +12 -0
- package/src/styles/shades.scss +4 -0
- package/src/styles/utils/_border.scss +1 -1
- package/src/styles/utils/_cursor.scss +4 -0
- package/src/styles/utils/_display.scss +1 -1
- package/src/styles/variables.scss +138 -0
- package/src/styles/vcsFont.scss +2 -0
- package/src/styles/vcsGrid.scss +13 -0
- package/src/uiConfig.js +83 -0
- package/src/vcsUiApp.js +510 -69
- package/src/vuePlugins/i18n.js +51 -13
- package/src/vuePlugins/vuetify.js +104 -43
- package/config/berlin.config.json +0 -529
- package/dist/assets/cesium/Workers/ArcType-fc72c06c.js +0 -1
- package/dist/assets/cesium/Workers/AttributeCompression-80665726.js +0 -1
- package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-a655a4bc.js +0 -1
- package/dist/assets/cesium/Workers/BoundingRectangle-c3b79029.js +0 -1
- package/dist/assets/cesium/Workers/BoxGeometry-f8f9c981.js +0 -1
- package/dist/assets/cesium/Workers/Color-de06a177.js +0 -1
- package/dist/assets/cesium/Workers/ComponentDatatype-a15c9a19.js +0 -1
- package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-48cdc26d.js +0 -1
- package/dist/assets/cesium/Workers/CorridorGeometryLibrary-ddc027d3.js +0 -1
- package/dist/assets/cesium/Workers/CylinderGeometry-82a8cbe6.js +0 -1
- package/dist/assets/cesium/Workers/CylinderGeometryLibrary-76cda53e.js +0 -1
- package/dist/assets/cesium/Workers/EllipseGeometry-32d55454.js +0 -1
- package/dist/assets/cesium/Workers/EllipseGeometryLibrary-b2ae188a.js +0 -1
- package/dist/assets/cesium/Workers/EllipseOutlineGeometry-f05a5a27.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidGeodesic-19e75e11.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidGeometry-7c99fc81.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-21c243df.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidRhumbLine-6145377b.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +0 -1
- package/dist/assets/cesium/Workers/EncodedCartesian3-d9f5c4a4.js +0 -1
- package/dist/assets/cesium/Workers/FrustumGeometry-17776af8.js +0 -1
- package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +0 -1
- package/dist/assets/cesium/Workers/GeometryAttributes-32b29525.js +0 -1
- package/dist/assets/cesium/Workers/GeometryInstance-4fbf16ba.js +0 -1
- package/dist/assets/cesium/Workers/GeometryOffsetAttribute-8c5e10db.js +0 -1
- package/dist/assets/cesium/Workers/GeometryPipeline-309fad76.js +0 -1
- package/dist/assets/cesium/Workers/IndexDatatype-f1dcdf35.js +0 -1
- package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +0 -1
- package/dist/assets/cesium/Workers/Matrix2-47e98d76.js +0 -1
- package/dist/assets/cesium/Workers/OrientedBoundingBox-fcb5b750.js +0 -1
- package/dist/assets/cesium/Workers/Plane-3f01019d.js +0 -1
- package/dist/assets/cesium/Workers/PolygonGeometryLibrary-0b29eb16.js +0 -1
- package/dist/assets/cesium/Workers/PolygonPipeline-a934c4dd.js +0 -1
- package/dist/assets/cesium/Workers/PolylinePipeline-8095c9bc.js +0 -1
- package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-67d12fff.js +0 -1
- package/dist/assets/cesium/Workers/PrimitivePipeline-980e44c5.js +0 -1
- package/dist/assets/cesium/Workers/RectangleGeometryLibrary-621c6de8.js +0 -1
- package/dist/assets/cesium/Workers/RuntimeError-8952249c.js +0 -1
- package/dist/assets/cesium/Workers/TerrainEncoding-f96552d5.js +0 -1
- package/dist/assets/cesium/Workers/Transforms-c8cb8f43.js +0 -39
- package/dist/assets/cesium/Workers/VertexFormat-a0b706b0.js +0 -1
- package/dist/assets/cesium/Workers/WallGeometryLibrary-c03d8479.js +0 -1
- package/dist/assets/cesium/Workers/WebGLConstants-508b9636.js +0 -1
- package/dist/assets/cesium/Workers/WebMercatorProjection-79b3214e.js +0 -1
- package/dist/assets/cesium/Workers/_commonjsHelpers-3aae1032-26891ab7.js +0 -1
- package/dist/assets/cesium/Workers/_rollup_plugin_ignore_empty_module_placeholder-57d574d0.js +0 -1
- package/dist/assets/cesium/Workers/arrayRemoveDuplicates-dc2f4046.js +0 -1
- package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +0 -6
- package/dist/assets/cesium/Workers/combine-3c023bda.js +0 -1
- package/dist/assets/cesium/Workers/defaultValue-81eec7ed.js +0 -1
- package/dist/assets/cesium.6b5bb6.js +0 -9105
- package/dist/assets/core.98f9bb.js +0 -4
- package/dist/assets/index.0be2842f.js +0 -1
- package/dist/assets/index.60dea538.css +0 -1
- package/dist/assets/ol.0561aa.js +0 -318
- package/dist/assets/ui.b7c1e3.css +0 -1
- package/dist/assets/ui.b7c1e3.js +0 -39
- package/dist/assets/uicomponents.682c5f.css +0 -1
- package/dist/assets/uicomponents.682c5f.js +0 -32
- package/dist/assets/uicomponents.js +0 -1
- package/dist/assets/vue-composition-api.f926fa.js +0 -14
- package/dist/assets/vue-composition-api.js +0 -2
- package/dist/assets/vue.ddcb6b.js +0 -9
- package/dist/assets/vuetify.d21163.css +0 -5
- package/dist/assets/vuetify.d21163.js +0 -48
- package/lib/uicomponents.js +0 -1
- package/lib/vue-composition-api.js +0 -2
- package/map.config.json +0 -35
- package/plugins/@vcmap/pluginExample/config.json +0 -6
- package/plugins/@vcmap/pluginExample/package.json +0 -7
- package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +0 -374
- package/plugins/@vcmap/project-selector/ContextsListComponent.vue +0 -62
- package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +0 -81
- package/plugins/@vcmap/project-selector/README.md +0 -29
- package/plugins/@vcmap/project-selector/config.json +0 -15
- package/plugins/@vcmap/project-selector/index.js +0 -254
- package/plugins/@vcmap/project-selector/package.json +0 -15
- package/plugins/@vcmap/theme-changer/config.json +0 -69
- package/plugins/@vcmap/theme-changer/package.json +0 -12
- package/plugins/buttonExamples/ButtonExamples.vue +0 -190
- package/plugins/buttonExamples/index.js +0 -40
- package/plugins/categoryTest/Categories.vue +0 -145
- package/plugins/categoryTest/Category.vue +0 -114
- package/plugins/categoryTest/ItemEditor.vue +0 -13
- package/plugins/categoryTest/index.js +0 -41
- package/plugins/example/index.js +0 -56
- package/plugins/test/editor.vue +0 -63
- package/plugins/test/index.js +0 -93
- package/plugins/test/myCustomHeader.vue +0 -19
- package/plugins/test/toolbox-data.js +0 -49
- package/plugins/test/vcsContent.vue +0 -23
- package/plugins/test/windowManagerExample.vue +0 -144
- package/src/actions/styleSelector.vue +0 -90
- package/src/application/Navbar.vue +0 -118
- package/src/application/empty-cmp.vue +0 -6
- package/src/assets/logo.svg +0 -26
- package/src/contentTree/viewPointContentTreeItem.js +0 -107
- package/src/lang/de.js +0 -60
- package/src/lang/en.js +0 -53
- package/src/manager/toolbox/ToolboxMultiSelectButton.vue +0 -96
- package/src/manager/toolbox/ToolboxSingleSelectButton.vue +0 -98
- package/src/manager/toolbox/toolbox-manager.js +0 -203
- package/src/navigation/mapNavigation.vue +0 -201
- package/src/navigation/obliqueRotation.vue +0 -48
- package/src/navigation/vcsCompass.vue +0 -144
- package/src/navigation/vcsZoomButton.vue +0 -27
- package/start.js +0 -3
package/dist/assets/ol.0561aa.js
DELETED
@@ -1,318 +0,0 @@
|
|
1
|
-
var GO=Object.defineProperty,UO=Object.defineProperties;var zO=Object.getOwnPropertyDescriptors;var mf=Object.getOwnPropertySymbols;var Sx=Object.prototype.hasOwnProperty,Rx=Object.prototype.propertyIsEnumerable;var wx=(n,e,t)=>e in n?GO(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Gu=(n,e)=>{for(var t in e||(e={}))Sx.call(e,t)&&wx(n,t,e[t]);if(mf)for(var t of mf(e))Rx.call(e,t)&&wx(n,t,e[t]);return n},Uu=(n,e)=>UO(n,zO(e));var zu=(n,e)=>{var t={};for(var i in n)Sx.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&mf)for(var i of mf(n))e.indexOf(i)<0&&Rx.call(n,i)&&(t[i]=n[i]);return t};function fe(){return function(){throw new Error("Unimplemented abstract method.")}()}let BO=0;function oe(n){return n.ol_uid||(n.ol_uid=String(++BO))}const yf="latest";class jO extends Error{constructor(e){const i="Assertion failed. See https://openlayers.org/en/"+yf+"/doc/errors/#"+e+" for details.";super(i);this.code=e,this.name="AssertionError",this.message=i}}var _f=jO;class YO{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}function bx(n){n.stopPropagation()}function XO(n){n.preventDefault()}var ni=YO,Ps={PROPERTYCHANGE:"propertychange"};class VO{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}var ko=VO;function Ix(n,e,t){let i,r;const s=t||Vr;let o=0,a=n.length,l=!1;for(;o<a;)i=o+(a-o>>1),r=+s(n[i],e),r<0?o=i+1:(a=i,l=!r);return l?o:~o}function Vr(n,e){return n>e?1:n<e?-1:0}function Ye(n,e){return n.indexOf(e)>=0}function Bu(n,e,t){const i=n.length;if(n[0]<=e)return 0;if(e<=n[i-1])return i-1;{let r;if(t>0){for(r=1;r<i;++r)if(n[r]<e)return r-1}else if(t<0){for(r=1;r<i;++r)if(n[r]<=e)return r}else for(r=1;r<i;++r){if(n[r]==e)return r;if(n[r]<e)return typeof t=="function"?t(e,n[r-1],n[r])>0?r-1:r:n[r-1]-e<e-n[r]?r-1:r}return i-1}}function Cx(n,e,t){for(;e<t;){const i=n[e];n[e]=n[t],n[t]=i,++e,--t}}function qe(n,e){const t=Array.isArray(e)?e:[e],i=t.length;for(let r=0;r<i;r++)n[n.length]=t[r]}function WO(n,e){const t=n.indexOf(e),i=t>-1;return i&&n.splice(t,1),i}function Go(n,e){const t=n.length>>>0;let i;for(let r=0;r<t;r++)if(i=n[r],e(i,r,n))return i;return null}function dr(n,e){const t=n.length;if(t!==e.length)return!1;for(let i=0;i<t;i++)if(n[i]!==e[i])return!1;return!0}function ZO(n,e){const t=n.length,i=Array(n.length);let r;for(r=0;r<t;r++)i[r]={index:r,value:n[r]};for(i.sort(function(s,o){return e(s.value,o.value)||s.index-o.index}),r=0;r<n.length;r++)n[r]=i[r].value}function vf(n,e){let t;return!n.every(function(r,s){return t=s,!e(r,s,n)})?t:-1}function Lx(n,e,t){const i=e||Vr;return n.every(function(r,s){if(s===0)return!0;const o=i(n[s-1],r);return!(o>0||t&&o===0)})}function an(){return!0}function Ms(){return!1}function Fs(){}function Ox(n){let e=!1,t,i,r;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==r||!dr(s,i))&&(e=!0,r=this,i=s,t=n.apply(this,arguments)),t}}function Ax(n){function e(){let t;try{t=n()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}return e()}const ie=typeof Object.assign=="function"?Object.assign:function(n,e){if(n==null)throw new TypeError("Cannot convert undefined or null to object");const t=Object(n);for(let i=1,r=arguments.length;i<r;++i){const s=arguments[i];if(s!=null)for(const o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t};function Ns(n){for(const e in n)delete n[e]}const xf=typeof Object.values=="function"?Object.values:function(n){const e=[];for(const t in n)e.push(n[t]);return e};function Wn(n){let e;for(e in n)return!1;return!e}class HO extends ko{constructor(e){super();this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;const i=this.listeners_||(this.listeners_={}),r=i[e]||(i[e]=[]);r.indexOf(t)===-1&&r.push(t)}dispatchEvent(e){const t=typeof e=="string",i=t?e:e.type,r=this.listeners_&&this.listeners_[i];if(!r)return;const s=t?new ni(e):e;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let u=0,c=r.length;u<c;++u)if("handleEvent"in r[u]?l=r[u].handleEvent(s):l=r[u].call(this,s),l===!1||s.propagationStopped){l=!1;break}if(--o[i]===0){let u=a[i];for(delete a[i];u--;)this.removeEventListener(i,Fs);delete o[i]}return l}disposeInternal(){this.listeners_&&Ns(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){const i=this.listeners_&&this.listeners_[e];if(i){const r=i.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[r]=Fs,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}}var $s=HO,re={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function ge(n,e,t,i,r){if(i&&i!==n&&(t=t.bind(i)),r){const o=t;t=function(){n.removeEventListener(e,t),o.apply(this,arguments)}}const s={target:n,type:e,listener:t};return n.addEventListener(e,t),s}function Uo(n,e,t,i){return ge(n,e,t,i,!0)}function He(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),Ns(n))}class Ef extends $s{constructor(){super();this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(re.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){const i=e.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ge(this,e[s],t);return r}else return ge(this,e,t)}onceInternal(e,t){let i;if(Array.isArray(e)){const r=e.length;i=new Array(r);for(let s=0;s<r;++s)i[s]=Uo(this,e[s],t)}else i=Uo(this,e,t);return t.ol_key=i,i}unInternal(e,t){const i=t.ol_key;if(i)Px(i);else if(Array.isArray(e))for(let r=0,s=e.length;r<s;++r)this.removeEventListener(e[r],t);else this.removeEventListener(e,t)}}Ef.prototype.on,Ef.prototype.once,Ef.prototype.un;function Px(n){if(Array.isArray(n))for(let e=0,t=n.length;e<t;++e)He(n[e]);else He(n)}var Tf=Ef;class am extends ni{constructor(e,t,i){super(e);this.key=t,this.oldValue=i}}class KO extends Tf{constructor(e){super();this.on,this.once,this.un,oe(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&ie({},this.values_)||{}}hasProperties(){return!!this.values_}notify(e,t){let i;i=`change:${e}`,this.hasListener(i)&&this.dispatchEvent(new am(i,e,t)),i=Ps.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new am(i,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,i){const r=this.values_||(this.values_={});if(i)r[e]=t;else{const s=r[e];r[e]=t,s!==t&&this.notify(e,s)}}setProperties(e,t){for(const i in e)this.set(i,e[i],t)}applyProperties(e){!e.values_||ie(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){const i=this.values_[e];delete this.values_[e],Wn(this.values_)&&(this.values_=null),t||this.notify(e,i)}}}var ln=KO,Dt={ADD:"add",REMOVE:"remove"};const Mx={LENGTH:"length"};class ju extends ni{constructor(e,t,i){super(e);this.element=t,this.index=i}}class qO extends ln{constructor(e,t){super();this.on,this.once,this.un;const i=t||{};if(this.unique_=!!i.unique,this.array_=e||[],this.unique_)for(let r=0,s=this.array_.length;r<s;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,i=e.length;t<i;++t)this.push(e[t]);return this}forEach(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)e(t[i],i,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(Mx.LENGTH)}insertAt(e,t){this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new ju(Dt.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)if(t[i]===e)return this.removeAt(i)}removeAt(e){const t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new ju(Dt.REMOVE,t,e)),t}setAt(e,t){const i=this.getLength();if(e<i){this.unique_&&this.assertUnique_(t,e);const r=this.array_[e];this.array_[e]=t,this.dispatchEvent(new ju(Dt.REMOVE,r,e)),this.dispatchEvent(new ju(Dt.ADD,t,e))}else{for(let r=i;r<e;++r)this.insertAt(r,void 0);this.insertAt(e,t)}}updateLength_(){this.set(Mx.LENGTH,this.array_.length)}assertUnique_(e,t){for(let i=0,r=this.array_.length;i<r;++i)if(this.array_[i]===e&&i!==t)throw new _f(58)}}var qt=qO,K={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function lm(n){return Math.pow(n,3)}function Ds(n){return 1-lm(1-n)}function wf(n){return 3*n*n-2*n*n*n}function Fx(n){return n}function JO(n){return n<.5?wf(2*n):1-wf(2*(n-.5))}class QO extends $s{constructor(e,t,i){super();const r=i||{};this.tileCoord=e,this.state=t,this.interimTile=null,this.key="",this.transition_=r.transition===void 0?250:r.transition,this.transitionStarts_={},this.interpolate=!!r.interpolate}changed(){this.dispatchEvent(re.CHANGE)}release(){}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){if(!this.interimTile)return this;let e=this.interimTile;do{if(e.getState()==K.LOADED)return this.transition_=0,e;e=e.interimTile}while(e);return this}refreshInterimChain(){if(!this.interimTile)return;let e=this.interimTile,t=this;do{if(e.getState()==K.LOADED){e.interimTile=null;break}else e.getState()==K.LOADING?t=e:e.getState()==K.IDLE?t.interimTile=e.interimTile:t=e;e=t.interimTile}while(e)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==K.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}load(){fe()}getAlpha(e,t){if(!this.transition_)return 1;let i=this.transitionStarts_[e];if(!i)i=t,this.transitionStarts_[e]=i;else if(i===-1)return 1;const r=t-i+1e3/60;return r>=this.transition_?1:lm(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}}var ks=QO;class eA extends ks{constructor(e){const t=K.IDLE;super(e.tileCoord,t,{transition:e.transition,interpolate:e.interpolate});this.loader_=e.loader,this.data_=null,this.error_=null}getData(){return this.data_}getError(){return this.error_}load(){this.state=K.LOADING,this.changed();const e=this;this.loader_().then(function(t){e.data_=t,e.state=K.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=K.ERROR,e.changed()})}}var um=eA;function ce(n,e){if(!n)throw new _f(e)}class H1 extends ln{constructor(e){super();if(this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const t=e;this.setGeometry(t)}else{const t=e;this.setProperties(t)}}clone(){const e=new H1(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const t=this.getGeometry();t&&e.setGeometry(t.clone());const i=this.getStyle();return i&&e.setStyle(i),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(He(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=ge(e,re.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?Nx(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function Nx(n){if(typeof n=="function")return n;{let e;return Array.isArray(n)?e=n:(ce(typeof n.getZIndex=="function",41),e=[n]),function(){return e}}}var lt=H1,q={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},M={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};const Zn={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},tA={"9001":Zn.METERS,"9002":Zn.FEET,"9003":Zn.USFEET,"9101":Zn.RADIANS,"9102":Zn.DEGREES};function cm(n){return tA[n]}const Oi={};Oi[Zn.RADIANS]=6370997/(2*Math.PI),Oi[Zn.DEGREES]=2*Math.PI*6370997/360,Oi[Zn.FEET]=.3048,Oi[Zn.METERS]=1,Oi[Zn.USFEET]=1200/3937;var Ui=Zn;const tl=typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"?navigator.userAgent.toLowerCase():"",$x=tl.indexOf("firefox")!==-1,iA=tl.indexOf("safari")!==-1&&tl.indexOf("chrom")==-1,Dx=tl.indexOf("webkit")!==-1&&tl.indexOf("edge")==-1,hm=tl.indexOf("macintosh")!==-1,Sf=typeof devicePixelRatio!="undefined"?devicePixelRatio:1,Yu=typeof WorkerGlobalScope!="undefined"&&typeof OffscreenCanvas!="undefined"&&self instanceof WorkerGlobalScope,kx=typeof Image!="undefined"&&Image.prototype.decode,fm=function(){let n=!1;try{const e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return n}(),dm=new Array(6);function xt(){return[1,0,0,1,0,0]}function il(n){return nl(n,1,0,0,1,0,0)}function zo(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=e[0],u=e[1],c=e[2],h=e[3],f=e[4],d=e[5];return n[0]=t*l+r*u,n[1]=i*l+s*u,n[2]=t*c+r*h,n[3]=i*c+s*h,n[4]=t*f+r*d+o,n[5]=i*f+s*d+a,n}function nl(n,e,t,i,r,s,o){return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n[4]=s,n[5]=o,n}function Gx(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function rt(n,e){const t=e[0],i=e[1];return e[0]=n[0]*t+n[2]*i+n[4],e[1]=n[1]*t+n[3]*i+n[5],e}function Ux(n,e){const t=Math.cos(e),i=Math.sin(e);return zo(n,nl(dm,t,i,-i,t,0,0))}function rl(n,e,t){return zo(n,nl(dm,e,0,0,t,0,0))}function zx(n,e,t){return nl(n,e,0,0,t,0,0)}function Bx(n,e,t){return zo(n,nl(dm,1,0,0,1,e,t))}function Ti(n,e,t,i,r,s,o,a){const l=Math.sin(s),u=Math.cos(s);return n[0]=i*u,n[1]=r*l,n[2]=-i*l,n[3]=r*u,n[4]=o*i*u-a*i*l+e,n[5]=o*r*l+a*r*u+t,n}function nA(n,e,t,i,r,s,o){return Xu(Ti(xt(),n,e,t,i,r,s,o))}function rA(n){return Bo(n,n)}function Bo(n,e){const t=jx(e);ce(t!==0,32);const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5];return n[0]=o/t,n[1]=-r/t,n[2]=-s/t,n[3]=i/t,n[4]=(s*l-o*a)/t,n[5]=-(i*l-r*a)/t,n}function jx(n){return n[0]*n[3]-n[1]*n[2]}let Yx;function Xu(n){const e="matrix("+n.join(", ")+")";if(Yu)return e;const t=Yx||(Yx=document.createElement("div"));return t.style.transform=e,t.style.transform}var sl={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},ci={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Lt(n){const e=wi();for(let t=0,i=n.length;t<i;++t)Yo(e,n[t]);return e}function sA(n,e,t){const i=Math.min.apply(null,n),r=Math.min.apply(null,e),s=Math.max.apply(null,n),o=Math.max.apply(null,e);return hn(i,r,s,o,t)}function un(n,e,t){return t?(t[0]=n[0]-e,t[1]=n[1]-e,t[2]=n[2]+e,t[3]=n[3]+e,t):[n[0]-e,n[1]-e,n[2]+e,n[3]+e]}function pm(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function Gs(n,e,t){let i,r;return e<n[0]?i=n[0]-e:n[2]<e?i=e-n[2]:i=0,t<n[1]?r=n[1]-t:n[3]<t?r=t-n[3]:r=0,i*i+r*r}function cn(n,e){return Rf(n,e[0],e[1])}function hi(n,e){return n[0]<=e[0]&&e[2]<=n[2]&&n[1]<=e[1]&&e[3]<=n[3]}function Rf(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function bf(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=e[0],a=e[1];let l=ci.UNKNOWN;return o<t?l=l|ci.LEFT:o>r&&(l=l|ci.RIGHT),a<i?l=l|ci.BELOW:a>s&&(l=l|ci.ABOVE),l===ci.UNKNOWN&&(l=ci.INTERSECTING),l}function wi(){return[1/0,1/0,-1/0,-1/0]}function hn(n,e,t,i,r){return r?(r[0]=n,r[1]=e,r[2]=t,r[3]=i,r):[n,e,t,i]}function Us(n){return hn(1/0,1/0,-1/0,-1/0,n)}function jo(n,e){const t=n[0],i=n[1];return hn(t,i,t,i,e)}function oA(n,e){const t=Us(e);return mm(t,n)}function If(n,e,t,i,r){const s=Us(r);return ym(s,n,e,t,i)}function aA(n,e){const t=Us(e);return Vx(t,n)}function Tn(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function Xx(n,e,t){return Math.abs(n[0]-e[0])<t&&Math.abs(n[2]-e[2])<t&&Math.abs(n[1]-e[1])<t&&Math.abs(n[3]-e[3])<t}function gm(n,e){return e[0]<n[0]&&(n[0]=e[0]),e[2]>n[2]&&(n[2]=e[2]),e[1]<n[1]&&(n[1]=e[1]),e[3]>n[3]&&(n[3]=e[3]),n}function Yo(n,e){e[0]<n[0]&&(n[0]=e[0]),e[0]>n[2]&&(n[2]=e[0]),e[1]<n[1]&&(n[1]=e[1]),e[1]>n[3]&&(n[3]=e[1])}function mm(n,e){for(let t=0,i=e.length;t<i;++t)Yo(n,e[t]);return n}function ym(n,e,t,i,r){for(;t<i;t+=r)Wx(n,e[t],e[t+1]);return n}function Vx(n,e){for(let t=0,i=e.length;t<i;++t)mm(n,e[t]);return n}function Wx(n,e,t){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}function Cf(n,e){let t;return t=e(Xo(n)),t||(t=e(Vo(n)),t)||(t=e(al(n)),t)||(t=e(An(n)),t)?t:!1}function ol(n){let e=0;return zs(n)||(e=Ae(n)*ft(n)),e}function Xo(n){return[n[0],n[1]]}function Vo(n){return[n[2],n[1]]}function fi(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function Zx(n,e){let t;return e===sl.BOTTOM_LEFT?t=Xo(n):e===sl.BOTTOM_RIGHT?t=Vo(n):e===sl.TOP_LEFT?t=An(n):e===sl.TOP_RIGHT?t=al(n):ce(!1,13),t}function lA(n,e){const t=Math.min(n[0],e[0]),i=Math.min(n[1],e[1]),r=Math.max(n[2],e[2]),s=Math.max(n[3],e[3]);return(r-t)*(s-i)}function Wo(n,e,t,i,r){const s=e*i[0]/2,o=e*i[1]/2,a=Math.cos(t),l=Math.sin(t),u=s*a,c=s*l,h=o*a,f=o*l,d=n[0],p=n[1],m=d-u+f,g=d-u-f,v=d+u-f,y=d+u+f,x=p-c-h,_=p-c+h,E=p+c+h,T=p+c-h;return hn(Math.min(m,g,v,y),Math.min(x,_,E,T),Math.max(m,g,v,y),Math.max(x,_,E,T),r)}function ft(n){return n[3]-n[1]}function uA(n,e){const t=Ai(n,e);return ol(t)}function Ai(n,e,t){const i=t||wi();return dt(n,e)?(n[0]>e[0]?i[0]=n[0]:i[0]=e[0],n[1]>e[1]?i[1]=n[1]:i[1]=e[1],n[2]<e[2]?i[2]=n[2]:i[2]=e[2],n[3]<e[3]?i[3]=n[3]:i[3]=e[3]):Us(i),i}function cA(n){return Ae(n)+ft(n)}function hA(n){return[n[2]-n[0],n[3]-n[1]]}function An(n){return[n[0],n[3]]}function al(n){return[n[2],n[3]]}function Ae(n){return n[2]-n[0]}function dt(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function zs(n){return n[2]<n[0]||n[3]<n[1]}function Hx(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function Vu(n,e){const t=(n[2]-n[0])/2*(e-1),i=(n[3]-n[1])/2*(e-1);n[0]-=t,n[2]+=t,n[1]-=i,n[3]+=i}function Kx(n,e,t){let i=!1;const r=bf(n,e),s=bf(n,t);if(r===ci.INTERSECTING||s===ci.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],u=n[3],c=e[0],h=e[1],f=t[0],d=t[1],p=(d-h)/(f-c);let m,g;!!(s&ci.ABOVE)&&!(r&ci.ABOVE)&&(m=f-(d-u)/p,i=m>=o&&m<=l),!i&&!!(s&ci.RIGHT)&&!(r&ci.RIGHT)&&(g=d-(f-l)*p,i=g>=a&&g<=u),!i&&!!(s&ci.BELOW)&&!(r&ci.BELOW)&&(m=f-(d-a)/p,i=m>=o&&m<=l),!i&&!!(s&ci.LEFT)&&!(r&ci.LEFT)&&(g=d-(f-o)*p,i=g>=a&&g<=u)}return i}function Zo(n,e,t,i){let r=[];if(i>1){const a=n[2]-n[0],l=n[3]-n[1];for(let u=0;u<i;++u)r.push(n[0]+a*u/i,n[1],n[2],n[1]+l*u/i,n[2]-a*u/i,n[3],n[0],n[3]-l*u/i)}else r=[n[0],n[1],n[2],n[1],n[2],n[3],n[0],n[3]];e(r,r,2);const s=[],o=[];for(let a=0,l=r.length;a<l;a+=2)s.push(r[a]),o.push(r[a+1]);return sA(s,o,t)}function _m(n,e){const t=e.getExtent(),i=fi(n);if(e.canWrapX()&&(i[0]<t[0]||i[0]>=t[2])){const r=Ae(t),o=Math.floor((i[0]-t[0])/r)*r;n[0]-=o,n[2]-=o}return n}class fA{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Oi[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}var Ho=fA;function Ie(n,e,t){return Math.min(Math.max(n,e),t)}const qx=function(){let n;return"cosh"in Math?n=Math.cosh:n=function(e){const t=Math.exp(e);return(t+1/t)/2},n}(),vm=function(){let n;return"log2"in Math?n=Math.log2:n=function(e){return Math.log(e)*Math.LOG2E},n}();function xm(n,e,t,i,r,s){const o=r-t,a=s-i;if(o!==0||a!==0){const l=((n-t)*o+(e-i)*a)/(o*o+a*a);l>1?(t=r,i=s):l>0&&(t+=o*l,i+=a*l)}return Wr(n,e,t,i)}function Wr(n,e,t,i){const r=t-n,s=i-e;return r*r+s*s}function Jx(n){const e=n.length;for(let i=0;i<e;i++){let r=i,s=Math.abs(n[i][i]);for(let a=i+1;a<e;a++){const l=Math.abs(n[a][i]);l>s&&(s=l,r=a)}if(s===0)return null;const o=n[r];n[r]=n[i],n[i]=o;for(let a=i+1;a<e;a++){const l=-n[a][i]/n[i][i];for(let u=i;u<e+1;u++)i==u?n[a][u]=0:n[a][u]+=l*n[i][u]}}const t=new Array(e);for(let i=e-1;i>=0;i--){t[i]=n[i][e]/n[i][i];for(let r=i-1;r>=0;r--)n[r][e]-=n[r][i]*t[i]}return t}function Wu(n){return n*180/Math.PI}function di(n){return n*Math.PI/180}function Pn(n,e){const t=n%e;return t*e<0?t+e:t}function pr(n,e,t){return n+t*(e-n)}function Lf(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function Em(n,e){return Math.round(Lf(n,e))}function Ko(n,e){return Math.floor(Lf(n,e))}function Zr(n,e){return Math.ceil(Lf(n,e))}const ll=6378137,qo=Math.PI*ll,Qx=[-qo,-qo,qo,qo],eE=[-180,-85,180,85],Zu=ll*Math.log(Math.tan(Math.PI/2));class ul extends Ho{constructor(e){super({code:e,units:Ui.METERS,extent:Qx,global:!0,worldExtent:eE,getPointResolution:function(t,i){return t/qx(i[1]/ll)}})}}const Tm=[new ul("EPSG:3857"),new ul("EPSG:102100"),new ul("EPSG:102113"),new ul("EPSG:900913"),new ul("http://www.opengis.net/def/crs/EPSG/0/3857"),new ul("http://www.opengis.net/gml/srs/epsg.xml#3857")];function tE(n,e,t){const i=n.length,r=t>1?t:2;let s=e;s===void 0&&(r>2?s=n.slice():s=new Array(i));for(let o=0;o<i;o+=r){s[o]=qo*n[o]/180;let a=ll*Math.log(Math.tan(Math.PI*(+n[o+1]+90)/360));a>Zu?a=Zu:a<-Zu&&(a=-Zu),s[o+1]=a}return s}function iE(n,e,t){const i=n.length,r=t>1?t:2;let s=e;s===void 0&&(r>2?s=n.slice():s=new Array(i));for(let o=0;o<i;o+=r)s[o]=180*n[o]/qo,s[o+1]=360*Math.atan(Math.exp(n[o+1]/ll))/Math.PI-90;return s}const nE=6378137,wm=[-180,-90,180,90],rE=Math.PI*nE/180;class Jo extends Ho{constructor(e,t){super({code:e,units:Ui.DEGREES,extent:wm,axisOrientation:t,global:!0,metersPerUnit:rE,worldExtent:wm})}}const Sm=[new Jo("CRS:84"),new Jo("EPSG:4326","neu"),new Jo("urn:ogc:def:crs:OGC:1.3:CRS84"),new Jo("urn:ogc:def:crs:OGC:2:84"),new Jo("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Jo("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Jo("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Of={};function sE(){Of={}}function oE(n){return Of[n]||Of[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function aE(n,e){Of[n]=e}let Hn={};function lE(){Hn={}}function Qo(n,e,t){const i=n.getCode(),r=e.getCode();i in Hn||(Hn[i]={}),Hn[i][r]=t}function dA(n,e){const t=n.getCode(),i=e.getCode(),r=Hn[t][i];return delete Hn[t][i],Wn(Hn[t])&&delete Hn[t],r}function Rm(n,e){let t;return n in Hn&&e in Hn[n]&&(t=Hn[n][e]),t}function Bs(n,e,t){const i=t!==void 0?n.toFixed(t):""+n;let r=i.indexOf(".");return r=r===-1?i.length:r,r>e?i:new Array(1+e-r).join("0")+i}function bm(n,e){const t=(""+n).split("."),i=(""+e).split(".");for(let r=0;r<Math.max(t.length,i.length);r++){const s=parseInt(t[r]||"0",10),o=parseInt(i[r]||"0",10);if(s>o)return 1;if(o>s)return-1}return 0}function Im(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function uE(n,e){const t=e.getRadius(),i=e.getCenter(),r=i[0],s=i[1],o=n[0],a=n[1];let l=o-r;const u=a-s;l===0&&u===0&&(l=1);const c=Math.sqrt(l*l+u*u),h=r+t*l/c,f=s+t*u/c;return[h,f]}function Hu(n,e){const t=n[0],i=n[1],r=e[0],s=e[1],o=r[0],a=r[1],l=s[0],u=s[1],c=l-o,h=u-a,f=c===0&&h===0?0:(c*(t-o)+h*(i-a))/(c*c+h*h||0);let d,p;return f<=0?(d=o,p=a):f>=1?(d=l,p=u):(d=o+f*c,p=a+f*h),[d,p]}function pA(n){return function(e){return hE(e,n)}}function Ku(n,e,t){const i=Pn(e+180,360)-180,r=Math.abs(3600*i),s=t||0,o=Math.pow(10,s);let a=Math.floor(r/3600),l=Math.floor((r-a*3600)/60),u=r-a*3600-l*60;return u=Math.ceil(u*o)/o,u>=60&&(u=0,l+=1),l>=60&&(l=0,a+=1),a+"\xB0 "+Bs(l,2)+"\u2032 "+Bs(u,2,s)+"\u2033"+(i==0?"":" "+n.charAt(i<0?1:0))}function cE(n,e,t){return n?e.replace("{x}",n[0].toFixed(t)).replace("{y}",n[1].toFixed(t)):""}function Mn(n,e){let t=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=e[i]){t=!1;break}return t}function Af(n,e){const t=Math.cos(e),i=Math.sin(e),r=n[0]*t-n[1]*i,s=n[1]*t+n[0]*i;return n[0]=r,n[1]=s,n}function Cm(n,e){return n[0]*=e,n[1]*=e,n}function fn(n,e){const t=n[0]-e[0],i=n[1]-e[1];return t*t+i*i}function qu(n,e){return Math.sqrt(fn(n,e))}function Ju(n,e){return fn(n,Hu(n,e))}function gA(n,e){return n?Ku("NS",n[1],e)+" "+Ku("EW",n[0],e):""}function hE(n,e){return cE(n,"{x}, {y}",e)}function Pf(n,e){if(e.canWrapX()){const t=Ae(e.getExtent()),i=Lm(n,e,t);i&&(n[0]-=i*t)}return n}function Lm(n,e,t){const i=e.getExtent();let r=0;if(e.canWrapX()&&(n[0]<i[0]||n[0]>i[2])){const s=t||Ae(i);r=Math.floor((n[0]-i[0])/s)}return r}const Qu=63710088e-1;function Mf(n,e,t){const i=t||Qu,r=di(n[1]),s=di(e[1]),o=(s-r)/2,a=di(e[0]-n[0])/2,l=Math.sin(o)*Math.sin(o)+Math.sin(a)*Math.sin(a)*Math.cos(r)*Math.cos(s);return 2*i*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Om(n,e){let t=0;for(let i=0,r=n.length;i<r-1;++i)t+=Mf(n[i],n[i+1],e);return t}function fE(n,e){const t=e||{},i=t.radius||Qu,r=t.projection||"EPSG:3857",s=n.getType();s!==M.GEOMETRY_COLLECTION&&(n=n.clone().transform(r,"EPSG:4326"));let o=0,a,l,u,c,h,f;switch(s){case M.POINT:case M.MULTI_POINT:break;case M.LINE_STRING:case M.LINEAR_RING:{a=n.getCoordinates(),o=Om(a,i);break}case M.MULTI_LINE_STRING:case M.POLYGON:{for(a=n.getCoordinates(),u=0,c=a.length;u<c;++u)o+=Om(a[u],i);break}case M.MULTI_POLYGON:{for(a=n.getCoordinates(),u=0,c=a.length;u<c;++u)for(l=a[u],h=0,f=l.length;h<f;++h)o+=Om(l[h],i);break}case M.GEOMETRY_COLLECTION:{const d=n.getGeometries();for(u=0,c=d.length;u<c;++u)o+=fE(d[u],e);break}default:throw new Error("Unsupported geometry type: "+s)}return o}function Ff(n,e){let t=0;const i=n.length;let r=n[i-1][0],s=n[i-1][1];for(let o=0;o<i;o++){const a=n[o][0],l=n[o][1];t+=di(a-r)*(2+Math.sin(di(s))+Math.sin(di(l))),r=a,s=l}return t*e*e/2}function dE(n,e){const t=e||{},i=t.radius||Qu,r=t.projection||"EPSG:3857",s=n.getType();s!==M.GEOMETRY_COLLECTION&&(n=n.clone().transform(r,"EPSG:4326"));let o=0,a,l,u,c,h,f;switch(s){case M.POINT:case M.MULTI_POINT:case M.LINE_STRING:case M.MULTI_LINE_STRING:case M.LINEAR_RING:break;case M.POLYGON:{for(a=n.getCoordinates(),o=Math.abs(Ff(a[0],i)),u=1,c=a.length;u<c;++u)o-=Math.abs(Ff(a[u],i));break}case M.MULTI_POLYGON:{for(a=n.getCoordinates(),u=0,c=a.length;u<c;++u)for(l=a[u],o+=Math.abs(Ff(l[0],i)),h=1,f=l.length;h<f;++h)o-=Math.abs(Ff(l[h],i));break}case M.GEOMETRY_COLLECTION:{const d=n.getGeometries();for(u=0,c=d.length;u<c;++u)o+=dE(d[u],e);break}default:throw new Error("Unsupported geometry type: "+s)}return o}function pE(n,e,t,i){const r=i||Qu,s=di(n[1]),o=di(n[0]),a=e/r,l=Math.asin(Math.sin(s)*Math.cos(a)+Math.cos(s)*Math.sin(a)*Math.cos(t)),u=o+Math.atan2(Math.sin(t)*Math.sin(a)*Math.cos(s),Math.cos(a)-Math.sin(s)*Math.sin(l));return[Wu(u),Wu(l)]}let Am=!0;function Pm(n){Am=!(n===void 0?!0:n)}function Nf(n,e,t){let i;if(e!==void 0){for(let r=0,s=n.length;r<s;++r)e[r]=n[r];i=e}else i=n.slice();return i}function ec(n,e,t){if(e!==void 0&&n!==e){for(let i=0,r=n.length;i<r;++i)e[i]=n[i];n=e}return n}function Mm(n){aE(n.getCode(),n),Qo(n,n,Nf)}function gE(n){n.forEach(Mm)}function se(n){return typeof n=="string"?oE(n):n||null}function tc(n,e,t,i){n=se(n);let r;const s=n.getPointResolutionFunc();if(s){if(r=s(e,t),i&&i!==n.getUnits()){const o=n.getMetersPerUnit();o&&(r=r*o/Oi[i])}}else{const o=n.getUnits();if(o==Ui.DEGREES&&!i||i==Ui.DEGREES)r=e;else{const a=wn(n,se("EPSG:4326"));if(a===ec&&o!==Ui.DEGREES)r=e*n.getMetersPerUnit();else{let u=[t[0]-e/2,t[1],t[0]+e/2,t[1],t[0],t[1]-e/2,t[0],t[1]+e/2];u=a(u,u,2);const c=Mf(u.slice(0,2),u.slice(2,4)),h=Mf(u.slice(4,6),u.slice(6,8));r=(c+h)/2}const l=i?Oi[i]:n.getMetersPerUnit();l!==void 0&&(r/=l)}}return r}function $f(n){gE(n),n.forEach(function(e){n.forEach(function(t){e!==t&&Qo(e,t,Nf)})})}function mE(n,e,t,i){n.forEach(function(r){e.forEach(function(s){Qo(r,s,t),Qo(s,r,i)})})}function mA(){sE(),lE()}function Df(n,e){return n?typeof n=="string"?se(n):n:se(e)}function Fm(n){return function(e,t,i){const r=e.length,s=i!==void 0?i:2,o=t!==void 0?t:new Array(r);for(let a=0;a<r;a+=s){const l=n([e[a],e[a+1]]);o[a]=l[0],o[a+1]=l[1];for(let u=s-1;u>=2;--u)o[a+u]=e[a+u]}return o}}function yE(n,e,t,i){const r=se(n),s=se(e);Qo(r,s,Fm(t)),Qo(s,r,Fm(i))}function yA(n,e){return Pm(),js(n,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function _A(n,e){const t=js(n,e!==void 0?e:"EPSG:3857","EPSG:4326"),i=t[0];return(i<-180||i>180)&&(t[0]=Pn(i+180,360)-180),t}function dn(n,e){if(n===e)return!0;const t=n.getUnits()===e.getUnits();return(n.getCode()===e.getCode()||wn(n,e)===Nf)&&t}function wn(n,e){const t=n.getCode(),i=e.getCode();let r=Rm(t,i);return r||(r=ec),r}function Kn(n,e){const t=se(n),i=se(e);return wn(t,i)}function js(n,e,t){return Kn(e,t)(n,void 0,n.length)}function cl(n,e,t,i){const r=Kn(e,t);return Zo(n,r,void 0,i)}function vA(n,e,t){return wn(e,t)(n)}let Wi=null;function _E(n){Wi=se(n)}function xA(){Wi=null}function Zi(){return Wi}function EA(){_E("EPSG:4326")}function Hr(n,e){return Wi?js(n,e,Wi):n}function ut(n,e){return Wi?js(n,Wi,e):(Am&&!Mn(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Am=!1,console.warn("Call useGeographic() ol/proj once to work with [longitude, latitude] coordinates.")),n)}function Ys(n,e){return Wi?cl(n,e,Wi):n}function pn(n,e){return Wi?cl(n,Wi,e):n}function vE(n,e){if(!Wi)return n;const t=se(e).getUnits(),i=Wi.getUnits();return t&&i?n*Oi[t]/Oi[i]:n}function xE(n,e){if(!Wi)return n;const t=se(e).getUnits(),i=Wi.getUnits();return t&&i?n*Oi[i]/Oi[t]:n}function Nm(n,e,t){return function(i){let r=i[0],s=i[1],o,a;if(n.canWrapX()){const l=n.getExtent(),u=Ae(l);a=Lm(i,n,u),a&&(r=r-a*u),r=Ie(r,l[0],l[2]),s=Ie(s,l[1],l[3]),o=t([r,s])}else o=t(i);return a&&e.canWrapX()&&(o[0]+=a*Ae(e.getExtent())),o}}function EE(){$f(Tm),$f(Sm),mE(Sm,Tm,tE,iE)}EE();function Kr(n,e,t,i,r,s){const o=s||[];let a=0;for(let l=e;l<t;l+=i){const u=n[l],c=n[l+1];o[a++]=r[0]*u+r[2]*c+r[4],o[a++]=r[1]*u+r[3]*c+r[5]}return s&&o.length!=a&&(o.length=a),o}function kf(n,e,t,i,r,s,o){const a=o||[],l=Math.cos(r),u=Math.sin(r),c=s[0],h=s[1];let f=0;for(let d=e;d<t;d+=i){const p=n[d]-c,m=n[d+1]-h;a[f++]=c+p*l-m*u,a[f++]=h+p*u+m*l;for(let g=d+2;g<d+i;++g)a[f++]=n[g]}return o&&a.length!=f&&(a.length=f),a}function TE(n,e,t,i,r,s,o,a){const l=a||[],u=o[0],c=o[1];let h=0;for(let f=e;f<t;f+=i){const d=n[f]-u,p=n[f+1]-c;l[h++]=u+r*d,l[h++]=c+s*p;for(let m=f+2;m<f+i;++m)l[h++]=n[m]}return a&&l.length!=h&&(l.length=h),l}function $m(n,e,t,i,r,s,o){const a=o||[];let l=0;for(let u=e;u<t;u+=i){a[l++]=n[u]+r,a[l++]=n[u+1]+s;for(let c=u+2;c<u+i;++c)a[l++]=n[c]}return o&&a.length!=l&&(a.length=l),a}const wE=xt();class TA extends ln{constructor(){super();this.extent_=wi(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Ox(function(e,t,i){if(!i)return this.getSimplifiedGeometry(t);const r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return fe()}closestPointXY(e,t,i,r){return fe()}containsXY(e,t){const i=this.getClosestPoint([e,t]);return i[0]===e&&i[1]===t}getClosestPoint(e,t){const i=t||[NaN,NaN];return this.closestPointXY(e[0],e[1],i,1/0),i}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return fe()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Us(t),this.extentRevision_=this.getRevision()}return Hx(this.extent_,e)}rotate(e,t){fe()}scale(e,t,i){fe()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return fe()}getType(){return fe()}applyTransform(e){fe()}intersectsExtent(e){return fe()}translate(e,t){fe()}transform(e,t){const i=se(e),r=i.getUnits()==Ui.TILE_PIXELS?function(s,o,a){const l=i.getExtent(),u=i.getWorldExtent(),c=ft(u)/ft(l);return Ti(wE,u[0],u[3],c,-c,0,0,0),Kr(s,0,s.length,a,wE,o),Kn(i,t)(s,o,a)}:Kn(i,t);return this.applyTransform(r),this}}var Dm=TA;class wA extends Dm{constructor(){super();this.layout=q.XY,this.stride=2,this.flatCoordinates=null}computeExtent(e){return If(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return fe()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=Gf(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){fe()}setLayout(e,t,i){let r;if(e)r=Gf(e);else{for(let s=0;s<i;++s)if(t.length===0){this.layout=q.XY,this.stride=2;return}else t=t[0];r=t.length,e=SA(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();kf(i,0,i.length,r,e,t,i),this.changed()}}scale(e,t,i){let r=t;r===void 0&&(r=e);let s=i;s||(s=fi(this.getExtent()));const o=this.getFlatCoordinates();if(o){const a=this.getStride();TE(o,0,o.length,a,e,r,s,o),this.changed()}}translate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();$m(i,0,i.length,r,e,t,i),this.changed()}}}function SA(n){let e;return n==2?e=q.XY:n==3?e=q.XYZ:n==4&&(e=q.XYZM),e}function Gf(n){let e;return n==q.XY?e=2:n==q.XYZ||n==q.XYM?e=3:n==q.XYZM&&(e=4),e}function SE(n,e,t){const i=n.getFlatCoordinates();if(i){const r=n.getStride();return Kr(i,0,i.length,r,e,t)}else return null}var qn=wA;function RE(n,e,t,i,r,s,o){const a=n[e],l=n[e+1],u=n[t]-a,c=n[t+1]-l;let h;if(u===0&&c===0)h=e;else{const f=((r-a)*u+(s-l)*c)/(u*u+c*c);if(f>1)h=t;else if(f>0){for(let d=0;d<i;++d)o[d]=pr(n[e+d],n[t+d],f);o.length=i;return}else h=e}for(let f=0;f<i;++f)o[f]=n[h+f];o.length=i}function Uf(n,e,t,i,r){let s=n[e],o=n[e+1];for(e+=i;e<t;e+=i){const a=n[e],l=n[e+1],u=Wr(s,o,a,l);u>r&&(r=u),s=a,o=l}return r}function zf(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Uf(n,e,a,i,r),e=a}return r}function bE(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=zf(n,e,a,i,r),e=a[a.length-1]}return r}function Bf(n,e,t,i,r,s,o,a,l,u,c){if(e==t)return u;let h,f;if(r===0)if(f=Wr(o,a,n[e],n[e+1]),f<u){for(h=0;h<i;++h)l[h]=n[e+h];return l.length=i,f}else return u;const d=c||[NaN,NaN];let p=e+i;for(;p<t;)if(RE(n,p-i,p,i,o,a,d),f=Wr(o,a,d[0],d[1]),f<u){for(u=f,h=0;h<i;++h)l[h]=d[h];l.length=i,p+=i}else p+=i*Math.max((Math.sqrt(f)-Math.sqrt(u))/r|0,1);if(s&&(RE(n,t-i,e,i,o,a,d),f=Wr(o,a,d[0],d[1]),f<u)){for(u=f,h=0;h<i;++h)l[h]=d[h];l.length=i}return u}function jf(n,e,t,i,r,s,o,a,l,u,c){const h=c||[NaN,NaN];for(let f=0,d=t.length;f<d;++f){const p=t[f];u=Bf(n,e,p,i,r,s,o,a,l,u,h),e=p}return u}function IE(n,e,t,i,r,s,o,a,l,u,c){const h=c||[NaN,NaN];for(let f=0,d=t.length;f<d;++f){const p=t[f];u=jf(n,e,p,i,r,s,o,a,l,u,h),e=p[p.length-1]}return u}function km(n,e,t,i){for(let r=0,s=t.length;r<s;++r)n[e++]=t[r];return e}function hl(n,e,t,i){for(let r=0,s=t.length;r<s;++r){const o=t[r];for(let a=0;a<i;++a)n[e++]=o[a]}return e}function Yf(n,e,t,i,r){const s=r||[];let o=0;for(let a=0,l=t.length;a<l;++a){const u=hl(n,e,t[a],i);s[o++]=u,e=u}return s.length=o,s}function CE(n,e,t,i,r){const s=r||[];let o=0;for(let a=0,l=t.length;a<l;++a){const u=Yf(n,e,t[a],i,s[o]);s[o++]=u,e=u[u.length-1]}return s.length=o,s}function RA(n,e,t,i,r,s,o){const a=o!==void 0?o:[];return s||(t=LE(n,e,t,i,r,a,0),n=a,e=0,i=2),a.length=ic(n,e,t,i,r,a,0),a}function ic(n,e,t,i,r,s,o){const a=(t-e)/i;if(a<3){for(;e<t;e+=i)s[o++]=n[e],s[o++]=n[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const u=[e,t-i];let c=0;for(;u.length>0;){const h=u.pop(),f=u.pop();let d=0;const p=n[f],m=n[f+1],g=n[h],v=n[h+1];for(let y=f+i;y<h;y+=i){const x=n[y],_=n[y+1],E=xm(x,_,p,m,g,v);E>d&&(c=y,d=E)}d>r&&(l[(c-e)/i]=1,f+i<c&&u.push(f,c),c+i<h&&u.push(c,h))}for(let h=0;h<a;++h)l[h]&&(s[o++]=n[e+h*i],s[o++]=n[e+h*i+1]);return o}function Gm(n,e,t,i,r,s,o,a){for(let l=0,u=t.length;l<u;++l){const c=t[l];o=ic(n,e,c,i,r,s,o),a.push(o),e=c}return o}function bA(n,e,t,i,r,s,o,a){for(let l=0,u=t.length;l<u;++l){const c=t[l],h=[];o=Gm(n,e,c,i,r,s,o,h),a.push(h),e=c[c.length-1]}return o}function LE(n,e,t,i,r,s,o){if(t<=e+i){for(;e<t;e+=i)s[o++]=n[e],s[o++]=n[e+1];return o}let a=n[e],l=n[e+1];s[o++]=a,s[o++]=l;let u=a,c=l;for(e+=i;e<t;e+=i)u=n[e],c=n[e+1],Wr(a,l,u,c)>r&&(s[o++]=u,s[o++]=c,a=u,l=c);return(u!=a||c!=l)&&(s[o++]=u,s[o++]=c),o}function Xs(n,e){return e*Math.round(n/e)}function OE(n,e,t,i,r,s,o){if(e==t)return o;let a=Xs(n[e],r),l=Xs(n[e+1],r);e+=i,s[o++]=a,s[o++]=l;let u,c;do if(u=Xs(n[e],r),c=Xs(n[e+1],r),e+=i,e==t)return s[o++]=u,s[o++]=c,o;while(u==a&&c==l);for(;e<t;){const h=Xs(n[e],r),f=Xs(n[e+1],r);if(e+=i,h==u&&f==c)continue;const d=u-a,p=c-l,m=h-a,g=f-l;if(d*g==p*m&&(d<0&&m<d||d==m||d>0&&m>d)&&(p<0&&g<p||p==g||p>0&&g>p)){u=h,c=f;continue}s[o++]=u,s[o++]=c,a=u,l=c,u=h,c=f}return s[o++]=u,s[o++]=c,o}function Um(n,e,t,i,r,s,o,a){for(let l=0,u=t.length;l<u;++l){const c=t[l];o=OE(n,e,c,i,r,s,o),a.push(o),e=c}return o}function AE(n,e,t,i,r,s,o,a){for(let l=0,u=t.length;l<u;++l){const c=t[l],h=[];o=Um(n,e,c,i,r,s,o,h),a.push(h),e=c[c.length-1]}return o}function gr(n,e,t,i,r){const s=r!==void 0?r:[];let o=0;for(let a=e;a<t;a+=i)s[o++]=n.slice(a,a+i);return s.length=o,s}function fl(n,e,t,i,r){const s=r!==void 0?r:[];let o=0;for(let a=0,l=t.length;a<l;++a){const u=t[a];s[o++]=gr(n,e,u,i,s[o]),e=u}return s.length=o,s}function Xf(n,e,t,i,r){const s=r!==void 0?r:[];let o=0;for(let a=0,l=t.length;a<l;++a){const u=t[a];s[o++]=fl(n,e,u,i,s[o]),e=u[u.length-1]}return s.length=o,s}function Vf(n,e,t,i){let r=0,s=n[t-i],o=n[t-i+1];for(;e<t;e+=i){const a=n[e],l=n[e+1];r+=o*a-s*l,s=a,o=l}return r/2}function zm(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=Vf(n,e,a,i),e=a}return r}function PE(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=zm(n,e,a,i),e=a[a.length-1]}return r}class Dg extends qn{constructor(e,t){super();this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new Dg(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,i,r){return r<Gs(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Uf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Bf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))}getArea(){return Vf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return gr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=ic(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new Dg(t,q.XY)}getType(){return M.LINEAR_RING}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=hl(this.flatCoordinates,0,e,this.stride),this.changed()}}var dl=Dg;class K1 extends qn{constructor(e,t){super();this.setCoordinates(e,t)}clone(){const e=new K1(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=Wr(e,t,s[0],s[1]);if(o<r){const a=this.stride;for(let l=0;l<a;++l)i[l]=s[l];return i.length=a,o}else return r}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(e){return jo(this.flatCoordinates,e)}getType(){return M.POINT}intersectsExtent(e){return Rf(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=km(this.flatCoordinates,0,e,this.stride),this.changed()}}var Et=K1;function ME(n,e,t,i,r){return!Cf(r,function(o){return!Vs(n,e,t,i,o[0],o[1])})}function Vs(n,e,t,i,r,s){let o=0,a=n[t-i],l=n[t-i+1];for(;e<t;e+=i){const u=n[e],c=n[e+1];l<=s?c>s&&(u-a)*(s-l)-(r-a)*(c-l)>0&&o++:c<=s&&(u-a)*(s-l)-(r-a)*(c-l)<0&&o--,a=u,l=c}return o!==0}function Wf(n,e,t,i,r,s){if(t.length===0||!Vs(n,e,t[0],i,r,s))return!1;for(let o=1,a=t.length;o<a;++o)if(Vs(n,t[o-1],t[o],i,r,s))return!1;return!0}function FE(n,e,t,i,r,s){if(t.length===0)return!1;for(let o=0,a=t.length;o<a;++o){const l=t[o];if(Wf(n,e,l,i,r,s))return!0;e=l[l.length-1]}return!1}function Zf(n,e,t,i,r,s,o){let a,l,u,c,h,f,d;const p=r[s+1],m=[];for(let y=0,x=t.length;y<x;++y){const _=t[y];for(c=n[_-i],f=n[_-i+1],a=e;a<_;a+=i)h=n[a],d=n[a+1],(p<=f&&d<=p||f<=p&&p<=d)&&(u=(p-f)/(d-f)*(h-c)+c,m.push(u)),c=h,f=d}let g=NaN,v=-1/0;for(m.sort(Vr),c=m[0],a=1,l=m.length;a<l;++a){h=m[a];const y=Math.abs(h-c);y>v&&(u=(c+h)/2,Wf(n,e,t,i,u,p)&&(g=u,v=y)),c=h}return isNaN(g)&&(g=r[s]),o?(o.push(g,p,v),o):[g,p,v]}function Bm(n,e,t,i,r){let s=[];for(let o=0,a=t.length;o<a;++o){const l=t[o];s=Zf(n,e,l,i,r,2*o,s),e=l[l.length-1]}return s}function jm(n,e,t,i,r){let s;for(e+=i;e<t;e+=i)if(s=r(n.slice(e-i,e),n.slice(e,e+i)),s)return s;return!1}function nc(n,e,t,i,r){const s=ym(wi(),n,e,t,i);return dt(r,s)?hi(r,s)||s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:jm(n,e,t,i,function(o,a){return Kx(r,o,a)}):!1}function NE(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){if(nc(n,e,t[s],i,r))return!0;e=t[s]}return!1}function $E(n,e,t,i,r){return!!(nc(n,e,t,i,r)||Vs(n,e,t,i,r[0],r[1])||Vs(n,e,t,i,r[0],r[3])||Vs(n,e,t,i,r[2],r[1])||Vs(n,e,t,i,r[2],r[3]))}function Ym(n,e,t,i,r){if(!$E(n,e,t[0],i,r))return!1;if(t.length===1)return!0;for(let s=1,o=t.length;s<o;++s)if(ME(n,t[s-1],t[s],i,r)&&!nc(n,t[s-1],t[s],i,r))return!1;return!0}function DE(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(Ym(n,e,a,i,r))return!0;e=a[a.length-1]}return!1}function kE(n,e,t,i){for(;e<t-i;){for(let r=0;r<i;++r){const s=n[e+r];n[e+r]=n[t-i+r],n[t-i+r]=s}e+=i,t-=i}}function rc(n,e,t,i){let r=0,s=n[t-i],o=n[t-i+1];for(;e<t;e+=i){const a=n[e],l=n[e+1];r+=(a-s)*(l+o),s=a,o=l}return r===0?void 0:r>0}function Xm(n,e,t,i,r){const s=r!==void 0?r:!1;for(let o=0,a=t.length;o<a;++o){const l=t[o],u=rc(n,e,l,i);if(o===0){if(s&&u||!s&&!u)return!1}else if(s&&!u||!s&&u)return!1;e=l}return!0}function GE(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(!Xm(n,e,a,i,r))return!1;a.length&&(e=a[a.length-1])}return!0}function Hf(n,e,t,i,r){const s=r!==void 0?r:!1;for(let o=0,a=t.length;o<a;++o){const l=t[o],u=rc(n,e,l,i);(o===0?s&&u||!s&&!u:s&&!u||!s&&u)&&kE(n,e,l,i),e=l}return e}function Vm(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s)e=Hf(n,e,t[s],i,r);return e}function Wm(n,e){const t=[];let i=0,r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];if(!rc(n,i,a,2))t.push(e.slice(r,s+1));else{if(t.length===0)continue;t[t.length-1].push(e[r])}r=s+1,i=a}return t}class qa extends qn{constructor(e,t,i){super();this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&i?(this.setFlatCoordinates(t,e),this.ends_=i):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?qe(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new qa(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Gs(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(zf(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jf(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return Wf(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return zm(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),Hf(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,fl(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=fi(this.getExtent());this.flatInteriorPoint_=Zf(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Et(this.getFlatInteriorPoint(),q.XYM)}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new dl(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o],u=new dl(t.slice(s,l),e);r.push(u),s=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Xm(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Hf(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Um(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,i),new qa(t,q.XY,i)}getType(){return M.POLYGON}intersectsExtent(e){return Ym(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Yf(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}var pi=qa;function UE(n,e,t,i){const r=t||32,s=[];for(let o=0;o<r;++o)qe(s,pE(n,e,2*Math.PI*o/r,i));return s.push(s[0],s[1]),new qa(s,q.XY,[s.length])}function ea(n){const e=n[0],t=n[1],i=n[2],r=n[3],s=[e,t,e,r,i,r,i,t,e,t];return new qa(s,q.XY,[s.length])}function sc(n,e,t){const i=e||32,r=n.getStride(),s=n.getLayout(),o=n.getCenter(),a=r*(i+1),l=new Array(a);for(let h=0;h<a;h+=r){l[h]=0,l[h+1]=0;for(let f=2;f<r;f++)l[h+f]=o[f]}const u=[l.length],c=new qa(l,s,u);return Zm(c,o,n.getRadius(),t),c}function Zm(n,e,t,i){const r=n.getFlatCoordinates(),s=n.getStride(),o=r.length/s-1,a=i||0;for(let l=0;l<=o;++l){const u=l*s,c=a+Pn(l,o)*2*Math.PI/o;r[u]=e[0]+t*Math.cos(c),r[u+1]=e[1]+t*Math.sin(c)}n.changed()}const kt={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"};class IA extends ni{constructor(e){super(re.ERROR);this.code=e.code,this.message=e.message}}class CA extends ln{constructor(e){super();this.on,this.once,this.un;const t=e||{};this.position_=null,this.transform_=ec,this.watchId_=void 0,this.addChangeListener(kt.PROJECTION,this.handleProjectionChanged_),this.addChangeListener(kt.TRACKING,this.handleTrackingChanged_),t.projection!==void 0&&this.setProjection(t.projection),t.trackingOptions!==void 0&&this.setTrackingOptions(t.trackingOptions),this.setTracking(t.tracking!==void 0?t.tracking:!1)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const e=this.getProjection();e&&(this.transform_=wn(se("EPSG:4326"),e),this.position_&&this.set(kt.POSITION,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const e=this.getTracking();e&&this.watchId_===void 0?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!e&&this.watchId_!==void 0&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(e){const t=e.coords;this.set(kt.ACCURACY,t.accuracy),this.set(kt.ALTITUDE,t.altitude===null?void 0:t.altitude),this.set(kt.ALTITUDE_ACCURACY,t.altitudeAccuracy===null?void 0:t.altitudeAccuracy),this.set(kt.HEADING,t.heading===null?void 0:di(t.heading)),this.position_?(this.position_[0]=t.longitude,this.position_[1]=t.latitude):this.position_=[t.longitude,t.latitude];const i=this.transform_(this.position_);this.set(kt.POSITION,i),this.set(kt.SPEED,t.speed===null?void 0:t.speed);const r=UE(this.position_,t.accuracy);r.applyTransform(this.transform_),this.set(kt.ACCURACY_GEOMETRY,r),this.changed()}positionError_(e){this.dispatchEvent(new IA(e))}getAccuracy(){return this.get(kt.ACCURACY)}getAccuracyGeometry(){return this.get(kt.ACCURACY_GEOMETRY)||null}getAltitude(){return this.get(kt.ALTITUDE)}getAltitudeAccuracy(){return this.get(kt.ALTITUDE_ACCURACY)}getHeading(){return this.get(kt.HEADING)}getPosition(){return this.get(kt.POSITION)}getProjection(){return this.get(kt.PROJECTION)}getSpeed(){return this.get(kt.SPEED)}getTracking(){return this.get(kt.TRACKING)}getTrackingOptions(){return this.get(kt.TRACKING_OPTIONS)}setProjection(e){this.set(kt.PROJECTION,se(e))}setTracking(e){this.set(kt.TRACKING,e)}setTrackingOptions(e){this.set(kt.TRACKING_OPTIONS,e)}}var zE=CA;class LA extends $s{constructor(e,t,i,r){super();this.extent=e,this.pixelRatio_=i,this.resolution=t,this.state=r}changed(){this.dispatchEvent(re.CHANGE)}getExtent(){return this.extent}getImage(){return fe()}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){fe()}}var oc=LA,ye={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class OA extends oc{constructor(e,t,i,r,s,o){super(e,t,i,ye.IDLE);this.src_=r,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.state=ye.IDLE,this.imageLoadFunction_=o}getImage(){return this.image_}handleImageError_(){this.state=ye.ERROR,this.unlistenImage_(),this.changed()}handleImageLoad_(){this.resolution===void 0&&(this.resolution=ft(this.extent)/this.image_.height),this.state=ye.LOADED,this.unlistenImage_(),this.changed()}load(){(this.state==ye.IDLE||this.state==ye.ERROR)&&(this.state=ye.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Kf(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}setImage(e){this.image_=e,this.resolution=ft(this.extent)/this.image_.height}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function Kf(n,e,t){const i=n;let r=!0,s=!1,o=!1;const a=[Uo(i,re.LOAD,function(){o=!0,s||e()})];return i.src&&kx?(s=!0,i.decode().then(function(){r&&e()}).catch(function(l){r&&(o?e():t())})):a.push(Uo(i,re.ERROR,t)),function(){r=!1,a.forEach(He)}}var pl=OA;class AA extends oc{constructor(e,t,i,r,s){const o=s!==void 0?ye.IDLE:ye.LOADED;super(e,t,i,o);this.loader_=s!==void 0?s:null,this.canvas_=r,this.error_=null}getError(){return this.error_}handleLoad_(e){e?(this.error_=e,this.state=ye.ERROR):this.state=ye.LOADED,this.changed()}load(){this.state==ye.IDLE&&(this.state=ye.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}var ac=AA;function Yt(n,e,t,i){let r;return t&&t.length?r=t.shift():Yu?r=new OffscreenCanvas(n||300,e||300):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("2d",i)}function BE(n){let e=n.offsetWidth;const t=getComputedStyle(n);return e+=parseInt(t.marginLeft,10)+parseInt(t.marginRight,10),e}function jE(n){let e=n.offsetHeight;const t=getComputedStyle(n);return e+=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10),e}function ta(n,e){const t=e.parentNode;t&&t.replaceChild(n,e)}function lc(n){return n&&n.parentNode?n.parentNode.removeChild(n):null}function Hm(n){for(;n.lastChild;)n.removeChild(n.lastChild)}function YE(n,e){const t=n.childNodes;for(let i=0;;++i){const r=t[i],s=e[i];if(!r&&!s)break;if(r!==s){if(!r){n.appendChild(s);continue}if(!s){n.removeChild(r),--i;continue}n.insertBefore(s,r)}}}class PA extends ks{constructor(e,t,i,r,s,o){super(e,t,o);this.crossOrigin_=r,this.src_=i,this.key=i,this.image_=new Image,r!==null&&(this.image_.crossOrigin=r),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(e){this.image_=e,this.state=K.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=K.ERROR,this.unlistenImage_(),this.image_=MA(),this.changed()}handleImageLoad_(){const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=K.LOADED:this.state=K.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==K.ERROR&&(this.state=K.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==K.IDLE&&(this.state=K.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Kf(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function MA(){const n=Yt(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}var ia=PA;class FA{constructor(e,t,i){this.decay_=e,this.minVelocity_=t,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let i=t-3;for(;i>0&&this.points_[i+2]>e;)i-=3;const r=this.points_[t+2]-this.points_[i+2];if(r<1e3/60)return!1;const s=this.points_[t]-this.points_[i],o=this.points_[t+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}var Km=FA;const XE=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,VE=/^([a-z]*)$|^hsla?\(.*\)$/i;function qm(n){return typeof n=="string"?n:e0(n)}function WE(n){const e=document.createElement("div");if(e.style.color=n,e.style.color!==""){document.body.appendChild(e);const t=getComputedStyle(e).color;return document.body.removeChild(e),t}else return""}const Jm=function(){const e={};let t=0;return function(i){let r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=1024){let s=0;for(const o in e)(s++&3)===0&&(delete e[o],--t)}r=NA(i),e[i]=r,++t}return r}}();function na(n){return Array.isArray(n)?n:Jm(n)}function NA(n){let e,t,i,r,s;if(VE.exec(n)&&(n=WE(n)),XE.exec(n)){const o=n.length-1;let a;o<=4?a=1:a=2;const l=o===4||o===8;e=parseInt(n.substr(1+0*a,a),16),t=parseInt(n.substr(1+1*a,a),16),i=parseInt(n.substr(1+2*a,a),16),l?r=parseInt(n.substr(1+3*a,a),16):r=255,a==1&&(e=(e<<4)+e,t=(t<<4)+t,i=(i<<4)+i,l&&(r=(r<<4)+r)),s=[e,t,i,r/255]}else n.indexOf("rgba(")==0?(s=n.slice(5,-1).split(",").map(Number),Qm(s)):n.indexOf("rgb(")==0?(s=n.slice(4,-1).split(",").map(Number),s.push(1),Qm(s)):ce(!1,14);return s}function Qm(n){return n[0]=Ie(n[0]+.5|0,0,255),n[1]=Ie(n[1]+.5|0,0,255),n[2]=Ie(n[2]+.5|0,0,255),n[3]=Ie(n[3],0,1),n}function e0(n){let e=n[0];e!=(e|0)&&(e=e+.5|0);let t=n[1];t!=(t|0)&&(t=t+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const r=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+e+","+t+","+i+","+r+")"}function ZE(n){return VE.test(n)&&(n=WE(n)),XE.test(n)||n.indexOf("rgba(")===0||n.indexOf("rgb(")===0}class HE{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const t in this.cache_){const i=this.cache_[t];(e++&3)===0&&!i.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}}get(e,t,i){const r=KE(e,t,i);return r in this.cache_?this.cache_[r]:null}set(e,t,i,r){const s=KE(e,t,i);this.cache_[s]=r,++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function KE(n,e,t){const i=t?qm(t):"null";return e+":"+n+":"+i}var $A=HE;const uc=new HE;var Qe={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};class DA extends ln{constructor(e){super();this.on,this.once,this.un,this.background_=e.background;const t=ie({},e);typeof e.properties=="object"&&(delete t.properties,ie(t,e.properties)),t[Qe.OPACITY]=e.opacity!==void 0?e.opacity:1,ce(typeof t[Qe.OPACITY]=="number",64),t[Qe.VISIBLE]=e.visible!==void 0?e.visible:!0,t[Qe.Z_INDEX]=e.zIndex,t[Qe.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[Qe.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[Qe.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[Qe.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=t.className!==void 0?t.className:"ol-layer",delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const t=this.state_||{layer:this,managed:e===void 0?!0:e},i=this.getZIndex();return t.opacity=Ie(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=i===void 0&&!t.managed?1/0:i,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return fe()}getLayerStatesArray(e){return fe()}getExtent(){return this.get(Qe.EXTENT)}getMaxResolution(){return this.get(Qe.MAX_RESOLUTION)}getMinResolution(){return this.get(Qe.MIN_RESOLUTION)}getMinZoom(){return this.get(Qe.MIN_ZOOM)}getMaxZoom(){return this.get(Qe.MAX_ZOOM)}getOpacity(){return this.get(Qe.OPACITY)}getSourceState(){return fe()}getVisible(){return this.get(Qe.VISIBLE)}getZIndex(){return this.get(Qe.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(Qe.EXTENT,e)}setMaxResolution(e){this.set(Qe.MAX_RESOLUTION,e)}setMinResolution(e){this.set(Qe.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(Qe.MAX_ZOOM,e)}setMinZoom(e){this.set(Qe.MIN_ZOOM,e)}setOpacity(e){ce(typeof e=="number",64),this.set(Qe.OPACITY,e)}setVisible(e){this.set(Qe.VISIBLE,e)}setZIndex(e){this.set(Qe.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}var t0=DA,Hi={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},Ge={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};class kA extends t0{constructor(e){const t=ie({},e);delete t.source;super(t);this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(Qe.SOURCE,this.handleSourcePropertyChange_);const i=e.source?e.source:null;this.setSource(i)}getLayersArray(e){const t=e||[];return t.push(this),t}getLayerStatesArray(e){const t=e||[];return t.push(this.getLayerState()),t}getSource(){return this.get(Qe.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const e=this.getSource();return e?e.getState():Ge.UNDEFINED}handleSourceChange_(){this.changed()}handleSourcePropertyChange_(){this.sourceChangeKey_&&(He(this.sourceChangeKey_),this.sourceChangeKey_=null);const e=this.getSource();e&&(this.sourceChangeKey_=ge(e,re.CHANGE,this.handleSourceChange_,this)),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):new Promise(t=>t([]))}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}render(e,t){const i=this.getRenderer();if(i.prepareFrame(e))return this.rendered=!0,i.renderFrame(e,t)}unrender(){this.rendered=!1}setMapInternal(e){e||this.unrender(),this.set(Qe.MAP,e)}getMapInternal(){return this.get(Qe.MAP)}setMap(e){this.mapPrecomposeKey_&&(He(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(He(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=ge(e,Hi.PRECOMPOSE,function(t){const r=t.frameState.layerStatesArray,s=this.getLayerState(!1);ce(!r.some(function(o){return o.layer===s.layer}),67),r.push(s)},this),this.mapRenderKey_=ge(this,re.CHANGE,e.render,e),this.changed())}setSource(e){this.set(Qe.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function cc(n,e){if(!n.visible)return!1;const t=e.resolution;if(t<n.minResolution||t>=n.maxResolution)return!1;const i=e.zoom;return i>n.minZoom&&i<=n.maxZoom}var ra=kA;class GA extends ko{constructor(e){super();this.map_=e}dispatchRenderEvent(e,t){fe()}calculateMatrices2D(e){const t=e.viewState,i=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;Ti(i,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),Bo(r,i)}forEachFeatureAtCoordinate(e,t,i,r,s,o,a,l){let u;const c=t.viewState;function h(_,E,T,w){return s.call(o,E,_?T:null,w)}const f=c.projection,d=Pf(e.slice(),f),p=[[0,0]];if(f.canWrapX()&&r){const _=f.getExtent(),E=Ae(_);p.push([-E,0],[E,0])}const m=t.layerStatesArray,g=m.length,v=[],y=[];for(let _=0;_<p.length;_++)for(let E=g-1;E>=0;--E){const T=m[E],w=T.layer;if(w.hasRenderer()&&cc(T,c)&&a.call(l,w)){const S=w.getRenderer(),R=w.getSource();if(S&&R){const b=R.getWrapX()?d:e,I=h.bind(null,T.managed);y[0]=b[0]+p[_][0],y[1]=b[1]+p[_][1],u=S.forEachFeatureAtCoordinate(y,t,i,I,v)}if(u)return u}}if(v.length===0)return;const x=1/v.length;return v.forEach((_,E)=>_.distanceSq+=E*x),v.sort((_,E)=>_.distanceSq-E.distanceSq),v.some(_=>u=_.callback(_.feature,_.layer,_.geometry)),u}forEachLayerAtPixel(e,t,i,r,s){return fe()}hasFeatureAtCoordinate(e,t,i,r,s,o){return this.forEachFeatureAtCoordinate(e,t,i,r,an,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(e){fe()}scheduleExpireIconCache(e){uc.canExpireCache()&&e.postRenderFunctions.push(UA)}}function UA(n,e){uc.expire()}var qE=GA;class zA extends ni{constructor(e,t,i,r){super(e);this.inversePixelTransform=t,this.frameState=i,this.context=r}}var gl=zA;const hc="ol-hidden",JE="ol-selectable",Jn="ol-unselectable",i0="ol-unsupported",Ws="ol-control",fc="ol-collapsed",BA=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),QE=["style","variant","weight","size","lineHeight","family"],n0=function(n){const e=n.match(BA);if(!e)return null;const t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,r=QE.length;i<r;++i){const s=e[i+1];s!==void 0&&(t[QE[i]]=s)}return t.families=t.family.split(/,\s?/),t};function r0(n){return n===1?"":String(Math.round(n*100)/100)}const s0="10px sans-serif",mr="#000",dc="round",ml=[],yl=0,sa="round",_l=10,vl="#000",xl="center",pc="middle",Zs=[0,0,0,0],El=1,yr=new ln,eT=new $s;eT.setSize=function(){console.warn("labelCache is deprecated.")};let Tl=null,o0;const qf={},tT=function(){const e="32px ",t=["monospace","serif"],i=t.length,r="wmytzilWMYTZIL@#/&?$%10\uF013";let s,o;function a(u,c,h){let f=!0;for(let d=0;d<i;++d){const p=t[d];if(o=gc(u+" "+c+" "+e+p,r),h!=p){const m=gc(u+" "+c+" "+e+h+","+p,r);f=f&&m!=o}}return!!f}function l(){let u=!0;const c=yr.getKeys();for(let h=0,f=c.length;h<f;++h){const d=c[h];yr.get(d)<100&&(a.apply(this,d.split(`
|
2
|
-
`))?(Ns(qf),Tl=null,o0=void 0,yr.set(d,100)):(yr.set(d,yr.get(d)+1,!0),u=!1))}u&&(clearInterval(s),s=void 0)}return function(u){const c=n0(u);if(!c)return;const h=c.families;for(let f=0,d=h.length;f<d;++f){const p=h[f],m=c.style+`
|
3
|
-
`+c.weight+`
|
4
|
-
`+p;yr.get(m)===void 0&&(yr.set(m,100,!0),a(c.style,c.weight,p)||(yr.set(m,0,!0),s===void 0&&(s=setInterval(l,32))))}}}(),iT=function(){let n;return function(e){let t=qf[e];if(t==null){if(Yu){const i=n0(e),r=nT(e,"\u017Dg");t=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=e,document.body.appendChild(n),t=n.offsetHeight,document.body.removeChild(n);qf[e]=t}return t}}();function nT(n,e){return Tl||(Tl=Yt(1,1)),n!=o0&&(Tl.font=n,o0=Tl.font),Tl.measureText(e)}function gc(n,e){return nT(n,e).width}function a0(n,e,t){if(e in t)return t[e];const i=gc(n,e);return t[e]=i,i}function rT(n,e){const t=[],i=[],r=[];let s=0,o=0,a=0,l=0;for(let u=0,c=e.length;u<=c;u+=2){const h=e[u];if(h===`
|
5
|
-
`||u===c){s=Math.max(s,o),r.push(o),o=0,a+=l;continue}const f=e[u+1]||n.font,d=gc(f,h);t.push(d),o+=d;const p=iT(f);i.push(p),l=Math.max(l,p)}return{width:s,height:a,widths:t,heights:i,lineWidths:r}}function jA(n,e,t,i){e!==0&&(n.translate(t,i),n.rotate(e),n.translate(-t,-i))}function sT(n,e,t,i,r,s,o,a,l,u,c){n.save(),t!==1&&(n.globalAlpha*=t),e&&n.setTransform.apply(n,e),i.contextInstructions?(n.translate(l,u),n.scale(c[0],c[1]),YA(i,n)):c[0]<0||c[1]<0?(n.translate(l,u),n.scale(c[0],c[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,l,u,o*c[0],a*c[1]),n.restore()}function YA(n,e){const t=n.contextInstructions;for(let i=0,r=t.length;i<r;i+=2)Array.isArray(t[i+1])?e[t[i]].apply(e,t[i+1]):e[t[i]]=t[i+1]}class XA extends qE{constructor(e){super(e);this.fontChangeListenerKey_=ge(yr,Ps.PROPERTYCHANGE,e.redrawText.bind(e)),this.element_=document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=Jn+" ol-layers";const i=e.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){const i=this.getMap();if(i.hasListener(e)){const r=new gl(e,void 0,t);i.dispatchEvent(r)}}disposeInternal(){He(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Hi.PRECOMPOSE,e);const t=e.layerStatesArray.sort(function(o,a){return o.zIndex-a.zIndex}),i=e.viewState;this.children_.length=0;const r=[];let s=null;for(let o=0,a=t.length;o<a;++o){const l=t[o];e.layerIndex=o;const u=l.layer,c=u.getSourceState();if(!cc(l,i)||c!=Ge.READY&&c!=Ge.UNDEFINED){u.unrender();continue}const h=u.render(e,s);!h||(h!==s&&(this.children_.push(h),s=h),"getDeclutter"in u&&r.push(u))}for(let o=r.length-1;o>=0;--o)r[o].renderDeclutter(e);YE(this.element_,this.children_),this.dispatchRenderEvent(Hi.POSTCOMPOSE,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}forEachLayerAtPixel(e,t,i,r,s){const o=t.viewState,a=t.layerStatesArray,l=a.length;for(let u=l-1;u>=0;--u){const c=a[u],h=c.layer;if(h.hasRenderer()&&cc(c,o)&&s(h)){const d=h.getRenderer().getDataAtPixel(e,t,i);if(d){const p=r(h,d);if(p)return p}}}}}var l0=XA;class qr extends ni{constructor(e,t){super(e);this.layer=t}}const u0={LAYERS:"layers"};class q1 extends t0{constructor(e){const t=e||{},i=ie({},t);delete i.layers;let r=t.layers;super(i);this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(u0.LAYERS,this.handleLayersChanged_),r?Array.isArray(r)?r=new qt(r.slice(),{unique:!0}):ce(typeof r.getArray=="function",43):r=new qt(void 0,{unique:!0}),this.setLayers(r)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(He),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(ge(e,Dt.ADD,this.handleLayersAdd_,this),ge(e,Dt.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(He);Ns(this.listenerKeys_);const t=e.getArray();for(let i=0,r=t.length;i<r;i++){const s=t[i];this.registerLayerListeners_(s),this.dispatchEvent(new qr("addlayer",s))}this.changed()}registerLayerListeners_(e){const t=[ge(e,Ps.PROPERTYCHANGE,this.handleLayerChange_,this),ge(e,re.CHANGE,this.handleLayerChange_,this)];e instanceof q1&&t.push(ge(e,"addlayer",this.handleLayerGroupAdd_,this),ge(e,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[oe(e)]=t}handleLayerGroupAdd_(e){this.dispatchEvent(new qr("addlayer",e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new qr("removelayer",e.layer))}handleLayersAdd_(e){const t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new qr("addlayer",t)),this.changed()}handleLayersRemove_(e){const t=e.element,i=oe(t);this.listenerKeys_[i].forEach(He),delete this.listenerKeys_[i],this.dispatchEvent(new qr("removelayer",t)),this.changed()}getLayers(){return this.get(u0.LAYERS)}setLayers(e){const t=this.getLayers();if(t){const i=t.getArray();for(let r=0,s=i.length;r<s;++r)this.dispatchEvent(new qr("removelayer",i[r]))}this.set(u0.LAYERS,e)}getLayersArray(e){const t=e!==void 0?e:[];return this.getLayers().forEach(function(i){i.getLayersArray(t)}),t}getLayerStatesArray(e){const t=e!==void 0?e:[],i=t.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(t)});const r=this.getLayerState();let s=r.zIndex;!e&&r.zIndex===void 0&&(s=0);for(let o=i,a=t.length;o<a;o++){const l=t[o];l.opacity*=r.opacity,l.visible=l.visible&&r.visible,l.maxResolution=Math.min(l.maxResolution,r.maxResolution),l.minResolution=Math.max(l.minResolution,r.minResolution),l.minZoom=Math.max(l.minZoom,r.minZoom),l.maxZoom=Math.min(l.maxZoom,r.maxZoom),r.extent!==void 0&&(l.extent!==void 0?l.extent=Ai(l.extent,r.extent):l.extent=r.extent),l.zIndex===void 0&&(l.zIndex=s)}return t}getSourceState(){return Ge.READY}}var mc=q1;class VA extends ni{constructor(e,t,i){super(e);this.map=t,this.frameState=i!==void 0?i:null}}var wl=VA;class WA extends wl{constructor(e,t,i,r,s){super(e,t,s);this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=r!==void 0?r:!1}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}var Qn=WA,Pe={SINGLECLICK:"singleclick",CLICK:re.CLICK,DBLCLICK:re.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},er={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class ZA extends $s{constructor(e,t){super(e);this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;const i=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=ge(i,er.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=ge(i,er.POINTERMOVE,this.relayEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(re.TOUCHMOVE,this.boundHandleTouchMove_,fm?{passive:!1}:!1)}emulateClick_(e){let t=new Qn(Pe.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new Qn(Pe.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;const i=new Qn(Pe.SINGLECLICK,this.map_,e);this.dispatchEvent(i)}.bind(this),250)}updateActivePointers_(e){const t=e;t.type==Pe.POINTERUP||t.type==Pe.POINTERCANCEL?delete this.trackedTouches_[t.pointerId]:t.type==Pe.POINTERDOWN&&(this.trackedTouches_[t.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length}handlePointerUp_(e){this.updateActivePointers_(e);const t=new Qn(Pe.POINTERUP,this.map_,e);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_===0&&(this.dragListenerKeys_.forEach(He),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_===0,this.updateActivePointers_(e);const t=new Qn(Pe.POINTERDOWN,this.map_,e);this.dispatchEvent(t),this.down_={};for(const i in e){const r=e[i];this.down_[i]=typeof r=="function"?Fs:r}if(this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ge(i,Pe.POINTERMOVE,this.handlePointerMove_,this),ge(i,Pe.POINTERUP,this.handlePointerUp_,this),ge(this.element_,Pe.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ge(this.element_.getRootNode(),Pe.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.dragging_=!0;const t=new Qn(Pe.POINTERDRAG,this.map_,e,this.dragging_);this.dispatchEvent(t)}}relayEvent_(e){this.originalPointerMoveEvent_=e;const t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Qn(e.type,this.map_,e,t))}handleTouchMove_(e){const t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(He(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(re.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(He(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(He),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}var c0=ZA,oa={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"},Xt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};const yc=1/0;class HA{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Ns(this.queuedElements_)}dequeue(){const e=this.elements_,t=this.priorities_,i=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));const r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(e){ce(!(this.keyFunction_(e)in this.queuedElements_),31);const t=this.priorityFunction_(e);return t!=yc?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const t=this.elements_,i=this.priorities_,r=t.length,s=t[e],o=i[e],a=e;for(;e<r>>1;){const l=this.getLeftChildIndex_(e),u=this.getRightChildIndex_(e),c=u<r&&i[u]<i[l]?u:l;t[e]=t[c],i[e]=i[c],e=c}t[e]=s,i[e]=o,this.siftDown_(a,e)}siftDown_(e,t){const i=this.elements_,r=this.priorities_,s=i[t],o=r[t];for(;t>e;){const a=this.getParentIndex_(t);if(r[a]>o)i[t]=i[a],r[t]=r[a],t=a;else break}i[t]=s,r[t]=o}reprioritize(){const e=this.priorityFunction_,t=this.elements_,i=this.priorities_;let r=0;const s=t.length;let o,a,l;for(a=0;a<s;++a)o=t[a],l=e(o),l==yc?delete this.queuedElements_[this.keyFunction_(o)]:(i[r]=l,t[r++]=o);t.length=r,i.length=r,this.heapify_()}}var oT=HA;class KA extends oT{constructor(e,t){super(function(i){return e.apply(null,i)},function(i){return i[0].getKey()});this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){const t=super.enqueue(e);return t&&e[0].addEventListener(re.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const t=e.target,i=t.getState();if(i===K.LOADED||i===K.ERROR||i===K.EMPTY){t.removeEventListener(re.CHANGE,this.boundHandleTileChange_);const r=t.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let i=0,r,s,o;for(;this.tilesLoading_<e&&i<t&&this.getCount()>0;)s=this.dequeue()[0],o=s.getKey(),r=s.getState(),r===K.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++i,s.load())}}var Jf=KA;function aT(n,e,t,i,r){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return yc;const s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}var pt={ANIMATING:0,INTERACTING:1},gn={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};const lT=42,aa=256;function h0(n,e,t){return function(i,r,s,o,a){if(!i)return;if(!r&&!e)return i;const l=e?0:s[0]*r,u=e?0:s[1]*r,c=a?a[0]:0,h=a?a[1]:0;let f=n[0]+l/2+c,d=n[2]-l/2+c,p=n[1]+u/2+h,m=n[3]-u/2+h;f>d&&(f=(d+f)/2,d=f),p>m&&(p=(m+p)/2,m=p);let g=Ie(i[0],f,d),v=Ie(i[1],p,m);if(o&&t&&r){const y=30*r;g+=-y*Math.log(1+Math.max(0,f-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-d)/y),v+=-y*Math.log(1+Math.max(0,p-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-m)/y)}return[g,v]}}function uT(n){return n}function f0(n,e,t,i){const r=Ae(e)/t[0],s=ft(e)/t[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function d0(n,e,t){let i=Math.min(n,e);const r=50;return i*=Math.log(1+r*Math.max(0,n/e-1))/r+1,t&&(i=Math.max(i,t),i/=Math.log(1+r*Math.max(0,t/n-1))/r+1),Ie(i,t/2,e*2)}function cT(n,e,t,i){return function(r,s,o,a){if(r!==void 0){const l=n[0],u=n[n.length-1],c=t?f0(l,t,o,i):l;if(a)return(e!==void 0?e:!0)?d0(r,c,u):Ie(r,u,c);const h=Math.min(c,r),f=Math.floor(Bu(n,h,s));return n[f]>c&&f<n.length-1?n[f+1]:n[f]}else return}}function hT(n,e,t,i,r,s){return function(o,a,l,u){if(o!==void 0){const c=r?f0(e,r,l,s):e,h=t!==void 0?t:0;if(u)return(i!==void 0?i:!0)?d0(o,c,h):Ie(o,h,c);const f=1e-9,d=Math.ceil(Math.log(e/c)/Math.log(n)-f),p=-a*(.5-f)+.5,m=Math.min(c,o),g=Math.floor(Math.log(e/m)/Math.log(n)+p),v=Math.max(d,g),y=e/Math.pow(n,v);return Ie(y,h,c)}else return}}function p0(n,e,t,i,r){return function(s,o,a,l){if(s!==void 0){const u=i?f0(n,i,a,r):n;return!(t!==void 0?t:!0)||!l?Ie(s,e,u):d0(s,u,e)}else return}}function Qf(n){if(n!==void 0)return 0}function g0(n){if(n!==void 0)return n}function fT(n){const e=2*Math.PI/n;return function(t,i){if(i)return t;if(t!==void 0)return t=Math.floor(t/e+.5)*e,t}}function dT(n){const e=n||di(5);return function(t,i){if(i)return t;if(t!==void 0)return Math.abs(t)<=e?0:t}}const m0=0;class qA extends ln{constructor(e){super();this.on,this.once,this.un;const t=ie({},e);this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Df(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.center&&(t.center=ut(t.center,this.projection_)),t.extent&&(t.extent=pn(t.extent,this.projection_)),t.projection&&Pm(),this.applyOptions_(t)}applyOptions_(e){const t=ie({},e);for(const a in gn)delete t[a];this.setProperties(t,!0);const i=gT(e);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=i.minZoom;const r=pT(e),s=i.constraint,o=mT(e);this.constraints_={center:r,resolution:s,rotation:o},this.setRotation(e.rotation!==void 0?e.rotation:0),this.setCenterInternal(e.center!==void 0?e.center:null),e.resolution!==void 0?this.setResolution(e.resolution):e.zoom!==void 0&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;const i=this.getCenter();if(i){const r=e||[0,0,0,0];t=t||[0,0,0,0];const s=this.getResolution(),o=s/2*(r[3]-t[3]+t[1]-r[1]),a=s/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([i[0]+o,i[1]-a])}}getUpdatedOptions_(e){const t=this.getProperties();return t.resolution!==void 0?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),ie({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const t=new Array(arguments.length);for(let i=0;i<t.length;++i){let r=arguments[i];r.center&&(r=ie({},r),r.center=ut(r.center,this.getProjection())),r.anchor&&(r=ie({},r),r.anchor=ut(r.anchor,this.getProjection())),t[i]=r}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,i;t>1&&typeof arguments[t-1]=="function"&&(i=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){const c=arguments[r];c.center&&this.setCenterInternal(c.center),c.zoom!==void 0?this.setZoom(c.zoom):c.resolution&&this.setResolution(c.resolution),c.rotation!==void 0&&this.setRotation(c.rotation)}if(r===t){i&&ed(i,!0);return}let s=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const u=[];for(;r<t;++r){const c=arguments[r],h={start:s,complete:!1,anchor:c.anchor,duration:c.duration!==void 0?c.duration:1e3,easing:c.easing||wf,callback:i};if(c.center&&(h.sourceCenter=o,h.targetCenter=c.center.slice(),o=h.targetCenter),c.zoom!==void 0?(h.sourceResolution=a,h.targetResolution=this.getResolutionForZoom(c.zoom),a=h.targetResolution):c.resolution&&(h.sourceResolution=a,h.targetResolution=c.resolution,a=h.targetResolution),c.rotation!==void 0){h.sourceRotation=l;const f=Pn(c.rotation-l+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=l+f,l=h.targetRotation}yT(h)?h.complete=!0:s+=h.duration,u.push(h)}this.animations_.push(u),this.setHint(pt.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[pt.ANIMATING]>0}getInteracting(){return this.hints_[pt.INTERACTING]>0}cancelAnimations(){this.setHint(pt.ANIMATING,-this.hints_[pt.ANIMATING]);let e;for(let t=0,i=this.animations_.length;t<i;++t){const r=this.animations_[t];if(r[0].callback&&ed(r[0].callback,!1),!e)for(let s=0,o=r.length;s<o;++s){const a=r[s];if(!a.complete){e=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const e=Date.now();let t=!1;for(let i=this.animations_.length-1;i>=0;--i){const r=this.animations_[i];let s=!0;for(let o=0,a=r.length;o<a;++o){const l=r[o];if(l.complete)continue;const u=e-l.start;let c=l.duration>0?u/l.duration:1;c>=1?(l.complete=!0,c=1):s=!1;const h=l.easing(c);if(l.sourceCenter){const f=l.sourceCenter[0],d=l.sourceCenter[1],p=l.targetCenter[0],m=l.targetCenter[1];this.nextCenter_=l.targetCenter;const g=f+h*(p-f),v=d+h*(m-d);this.targetCenter_=[g,v]}if(l.sourceResolution&&l.targetResolution){const f=h===1?l.targetResolution:l.sourceResolution+h*(l.targetResolution-l.sourceResolution);if(l.anchor){const d=this.getViewportSize_(this.getRotation()),p=this.constraints_.resolution(f,0,d,!0);this.targetCenter_=this.calculateCenterZoom(p,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=f,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const f=h===1?Pn(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+h*(l.targetRotation-l.sourceRotation);if(l.anchor){const d=this.constraints_.rotation(f,!0);this.targetCenter_=this.calculateCenterRotate(d,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=f}if(this.applyTargetState_(!0),t=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(pt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=r[0].callback;o&&ed(o,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let i;const r=this.getCenterInternal();return r!==void 0&&(i=[r[0]-t[0],r[1]-t[1]],Af(i,e-this.getRotation()),Im(i,t)),i}calculateCenterZoom(e,t){let i;const r=this.getCenterInternal(),s=this.getResolution();if(r!==void 0&&s!==void 0){const o=t[0]-e*(t[0]-r[0])/s,a=t[1]-e*(t[1]-r[1])/s;i=[o,a]}return i}getViewportSize_(e){const t=this.viewportSize_;if(e){const i=t[0],r=t[1];return[Math.abs(i*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(i*Math.sin(e))+Math.abs(r*Math.cos(e))]}else return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&Hr(e,this.getProjection())}getCenterInternal(){return this.get(gn.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const t=this.calculateExtentInternal(e);return Ys(t,this.getProjection())}calculateExtentInternal(e){const t=e||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();ce(i,1);const r=this.getResolution();ce(r!==void 0,2);const s=this.getRotation();return ce(s!==void 0,3),Wo(i,r,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(gn.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(pn(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){const i=t||this.getViewportSizeMinusPadding_(),r=Ae(e)/i[0],s=ft(e)/i[1];return Math.max(r,s)}getResolutionForValueFunction(e){const t=e||2,i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/Math.log(t);return function(o){return i/Math.pow(t,o*s)}}getRotation(){return this.get(gn.ROTATION)}getValueForResolutionFunction(e){const t=Math.log(e||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/t;return function(o){return Math.log(i/o)/t/s}}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e);const i=this.padding_;return i&&(t=[t[0]-i[1]-i[3],t[1]-i[0]-i[2]]),t}getState(){const e=this.getProjection(),t=this.getResolution(),i=this.getRotation();let r=this.getCenterInternal();const s=this.padding_;if(s){const o=this.getViewportSizeMinusPadding_();r=y0(r,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],t,i)}return{center:r.slice(0),projection:e!==void 0?e:null,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getZoom(){let e;const t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,i,r;if(this.resolutions_){const s=Bu(this.resolutions_,e,1);t=s,i=this.resolutions_[s],s==this.resolutions_.length-1?r=2:r=i/this.resolutions_[s+1]}else i=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(i/e)/Math.log(r)}getResolutionForZoom(e){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const t=Ie(Math.floor(e),0,this.resolutions_.length-2),i=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/Math.pow(i,Ie(e-t,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let i;if(ce(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function",24),Array.isArray(e)){ce(!zs(e),25);const r=pn(e,this.getProjection());i=ea(r)}else if(e.getType()===M.CIRCLE){const r=pn(e.getExtent(),this.getProjection());i=ea(r),i.rotate(this.getRotation(),fi(r))}else{const r=Zi();r?i=e.clone().transform(r,this.getProjection()):i=e}this.fitInternal(i,t)}rotatedExtentForGeometry(e){const t=this.getRotation(),i=Math.cos(t),r=Math.sin(-t),s=e.getFlatCoordinates(),o=e.getStride();let a=1/0,l=1/0,u=-1/0,c=-1/0;for(let h=0,f=s.length;h<f;h+=o){const d=s[h]*i-s[h+1]*r,p=s[h]*r+s[h+1]*i;a=Math.min(a,d),l=Math.min(l,p),u=Math.max(u,d),c=Math.max(c,p)}return[a,l,u,c]}fitInternal(e,t){const i=t||{};let r=i.size;r||(r=this.getViewportSizeMinusPadding_());const s=i.padding!==void 0?i.padding:[0,0,0,0],o=i.nearest!==void 0?i.nearest:!1;let a;i.minResolution!==void 0?a=i.minResolution:i.maxZoom!==void 0?a=this.getResolutionForZoom(i.maxZoom):a=0;const l=this.rotatedExtentForGeometry(e);let u=this.getResolutionForExtentInternal(l,[r[0]-s[1]-s[3],r[1]-s[0]-s[2]]);u=isNaN(u)?a:Math.max(u,a),u=this.getConstrainedResolution(u,o?0:1);const c=this.getRotation(),h=Math.sin(c),f=Math.cos(c),d=fi(l);d[0]+=(s[1]-s[3])/2*u,d[1]+=(s[0]-s[2])/2*u;const p=d[0]*f-d[1]*h,m=d[1]*f+d[0]*h,g=this.getConstrainedCenter([p,m],u),v=i.callback?i.callback:Fs;i.duration!==void 0?this.animateInternal({resolution:u,center:g,duration:i.duration,easing:i.easing},v):(this.targetResolution_=u,this.targetCenter_=g,this.applyTargetState_(!1,!0),ed(v,!0))}centerOn(e,t,i){this.centerOnInternal(ut(e,this.getProjection()),t,i)}centerOnInternal(e,t,i){this.setCenterInternal(y0(e,t,i,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,i,r){let s;const o=this.padding_;if(o&&e){const a=this.getViewportSizeMinusPadding_(-i),l=y0(e,r,[a[0]/2+o[3],a[1]/2+o[0]],t,i);s=[e[0]-l[0],e[1]-l[1]]}return s}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){const t=Hr(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){const t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){const i=t&&ut(t,this.getProjection());this.adjustResolutionInternal(e,i)}adjustResolutionInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),s=this.constraints_.resolution(this.targetResolution_*e,0,r,i);t&&(this.targetCenter_=this.calculateCenterZoom(s,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(Math.pow(this.zoomFactor_,-e),t)}adjustRotation(e,t){t&&(t=ut(t,this.getProjection())),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,i);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&ut(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){const i=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,i),s=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,s,i),a=this.constraints_.center(this.targetCenter_,o,s,i,this.calculateCenterShift(this.targetCenter_,o,r,s));this.get(gn.ROTATION)!==r&&this.set(gn.ROTATION,r),this.get(gn.RESOLUTION)!==o&&(this.set(gn.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(gn.CENTER)||!Mn(this.get(gn.CENTER),a))&&this.set(gn.CENTER,a),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,i){const r=e!==void 0?e:200,s=t||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),l=this.constraints_.resolution(this.targetResolution_,s,a),u=this.constraints_.center(this.targetCenter_,l,a,!1,this.calculateCenterShift(this.targetCenter_,l,o,a));if(r===0&&!this.cancelAnchor_){this.targetResolution_=l,this.targetRotation_=o,this.targetCenter_=u,this.applyTargetState_();return}const c=i||(r===0?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,(this.getResolution()!==l||this.getRotation()!==o||!this.getCenterInternal()||!Mn(this.getCenterInternal(),u))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:u,resolution:l,duration:r,easing:Ds,anchor:c}))}beginInteraction(){this.resolveConstraints(0),this.setHint(pt.INTERACTING,1)}endInteraction(e,t,i){const r=i&&ut(i,this.getProjection());this.endInteractionInternal(e,t,r)}endInteractionInternal(e,t,i){this.setHint(pt.INTERACTING,-1),this.resolveConstraints(e,t,i)}getConstrainedCenter(e,t){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),i)}getConstrainedZoom(e,t){const i=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(i,t))}getConstrainedResolution(e,t){const i=t||0,r=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,i,r)}}function ed(n,e){setTimeout(function(){n(e)},0)}function pT(n){if(n.extent!==void 0){const t=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return h0(n.extent,n.constrainOnlyCenter,t)}const e=Df(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,h0(t,!1,!1)}return uT}function gT(n){let e,t,i,o=n.minZoom!==void 0?n.minZoom:m0,a=n.maxZoom!==void 0?n.maxZoom:28;const l=n.zoomFactor!==void 0?n.zoomFactor:2,u=n.multiWorld!==void 0?n.multiWorld:!1,c=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,h=n.showFullExtent!==void 0?n.showFullExtent:!1,f=Df(n.projection,"EPSG:3857"),d=f.getExtent();let p=n.constrainOnlyCenter,m=n.extent;if(!u&&!m&&f.isGlobal()&&(p=!1,m=d),n.resolutions!==void 0){const g=n.resolutions;t=g[o],i=g[a]!==void 0?g[a]:g[g.length-1],n.constrainResolution?e=cT(g,c,!p&&m,h):e=p0(t,i,c,!p&&m,h)}else{const v=(d?Math.max(Ae(d),ft(d)):360*Oi[Ui.DEGREES]/f.getMetersPerUnit())/aa/Math.pow(2,m0),y=v/Math.pow(2,28-m0);t=n.maxResolution,t!==void 0?o=0:t=v/Math.pow(l,o),i=n.minResolution,i===void 0&&(n.maxZoom!==void 0?n.maxResolution!==void 0?i=t/Math.pow(l,a):i=v/Math.pow(l,a):i=y),a=o+Math.floor(Math.log(t/i)/Math.log(l)),i=t/Math.pow(l,a-o),n.constrainResolution?e=hT(l,t,i,c,!p&&m,h):e=p0(t,i,c,!p&&m,h)}return{constraint:e,maxResolution:t,minResolution:i,minZoom:o,zoomFactor:l}}function mT(n){if(n.enableRotation!==void 0?n.enableRotation:!0){const t=n.constrainRotation;return t===void 0||t===!0?dT():t===!1?g0:typeof t=="number"?fT(t):g0}else return Qf}function yT(n){return!(n.sourceCenter&&n.targetCenter&&!Mn(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function y0(n,e,t,i,r){const s=Math.cos(-r);let o=Math.sin(-r),a=n[0]*s-n[1]*o,l=n[1]*s+n[0]*o;a+=(e[0]/2-t[0])*i,l+=(t[1]-e[1]/2)*i,o=-o;const u=a*s-l*o,c=l*s+a*o;return[u,c]}var _r=qA;function _0(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]+2*e,t[1]=n[1]+2*e,t}function v0(n){return n[0]>0&&n[1]>0}function td(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]*e+.5|0,t[1]=n[1]*e+.5|0,t}function Tt(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}function _T(n){if(n instanceof ra){n.setMapInternal(null);return}n instanceof mc&&n.getLayers().forEach(_T)}function vT(n,e){if(n instanceof ra){n.setMapInternal(e);return}if(n instanceof mc){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i)vT(t[i],e)}}class JA extends ln{constructor(e){super();this.on,this.once,this.un;const t=QA(e);this.renderComplete_,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading!==void 0?e.maxTilesLoading:16,this.pixelRatio_=e.pixelRatio!==void 0?e.pixelRatio:Sf,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(this),this.coordinateToPixelTransform_=xt(),this.pixelToCoordinateTransform_=xt(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.controls=t.controls||new qt,this.interactions=t.interactions||new qt,this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Jf(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Xt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Xt.VIEW,this.handleViewChanged_),this.addChangeListener(Xt.SIZE,this.handleSizeChanged_),this.addChangeListener(Xt.TARGET,this.handleTargetChanged_),this.setProperties(t.values);const i=this;e.view&&!(e.view instanceof _r)&&e.view.then(function(r){i.setView(new _r(r))}),this.controls.addEventListener(Dt.ADD,function(r){r.element.setMap(this)}.bind(this)),this.controls.addEventListener(Dt.REMOVE,function(r){r.element.setMap(null)}.bind(this)),this.interactions.addEventListener(Dt.ADD,function(r){r.element.setMap(this)}.bind(this)),this.interactions.addEventListener(Dt.REMOVE,function(r){r.element.setMap(null)}.bind(this)),this.overlays_.addEventListener(Dt.ADD,function(r){this.addOverlayInternal_(r.element)}.bind(this)),this.overlays_.addEventListener(Dt.REMOVE,function(r){const o=r.element.getId();o!==void 0&&delete this.overlayIdIndex_[o.toString()],r.element.setMap(null)}.bind(this)),this.controls.forEach(function(r){r.setMap(this)}.bind(this)),this.interactions.forEach(function(r){r.setMap(this)}.bind(this)),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}createRenderer(){throw new Error("Use a map type that has a createRenderer method")}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){vT(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,i){if(!this.frameState_)return;const r=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:an,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,a,t,null,o,null)}getFeaturesAtPixel(e,t){const i=[];return this.forEachFeatureAtPixel(e,function(r){i.push(r)},t),i}getAllLayers(){const e=[];function t(i){i.forEach(function(r){r instanceof mc?t(r.getLayers()):e.push(r)})}return t(this.getLayers()),e}forEachLayerAtPixel(e,t,i){if(!this.frameState_)return;const r=i||{},s=r.hitTolerance!==void 0?r.hitTolerance:0,o=r.layerFilter||an;return this.renderer_.forEachLayerAtPixel(e,this.frameState_,s,t,o)}hasFeatureAtPixel(e,t){if(!this.frameState_)return!1;const i=this.getCoordinateFromPixelInternal(e);t=t!==void 0?t:{};const r=t.layerFilter!==void 0?t.layerFilter:an,s=t.hitTolerance!==void 0?t.hitTolerance:0,o=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const t=this.viewport_.getBoundingClientRect(),i="changedTouches"in e?e.changedTouches[0]:e;return[i.clientX-t.left,i.clientY-t.top]}getTarget(){return this.get(Xt.TARGET)}getTargetElement(){const e=this.getTarget();return e!==void 0?typeof e=="string"?document.getElementById(e):e:null}getCoordinateFromPixel(e){return Hr(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?rt(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const t=this.overlayIdIndex_[e.toString()];return t!==void 0?t:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Xt.LAYERGROUP)}setLayers(e){const t=this.getLayerGroup();if(e instanceof qt){t.setLayers(e);return}const i=t.getLayers();i.clear(),i.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,i=e.length;t<i;++t){const r=e[t].layer;if(!r.getRenderer().ready)return!0;const s=r.getSource();if(s&&s.loading)return!0}return!1}getPixelFromCoordinate(e){const t=ut(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){const t=this.frameState_;return t?rt(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Xt.SIZE)}getView(){return this.get(Xt.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,i,r){return aT(this.frameState_,e,t,i,r)}handleBrowserEvent(e,t){const i=t||e.type,r=new Qn(i,this,e);this.handleMapBrowserEvent(r)}handleMapBrowserEvent(e){if(!this.frameState_)return;const t=e.originalEvent,i=t.type;if(i===er.POINTERDOWN||i===re.WHEEL||i===re.KEYDOWN){const r=this.getOwnerDocument(),s=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=t.target;if(this.overlayContainerStopEvent_.contains(o)||!(s===r?r.documentElement:s).contains(o))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){const r=this.getInteractions().getArray().slice();for(let s=r.length-1;s>=0;s--){const o=r[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let r=this.maxTilesLoading_,s=r;if(e){const o=e.viewHints;if(o[pt.ANIMATING]||o[pt.INTERACTING]){const a=Date.now()-e.time>8;r=a?0:8,s=a?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,s))}e&&this.hasListener(Hi.RENDERCOMPLETE)&&!e.animate&&this.renderComplete_&&this.renderer_.dispatchRenderEvent(Hi.RENDERCOMPLETE,e);const i=this.postRenderFunctions_;for(let r=0,s=i.length;r<s;++r)i[r](this,e);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let t=0,i=this.targetChangeHandlerKeys_.length;t<i;++t)He(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(re.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(re.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,lc(this.viewport_)}const e=this.getTargetElement();if(!e)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{e.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new c0(this,this.moveTolerance_);for(const r in Pe)this.mapBrowserEventHandler_.addEventListener(Pe[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(re.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(re.WHEEL,this.boundHandleBrowserEvent_,fm?{passive:!1}:!1);const t=this.getOwnerDocument().defaultView,i=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.targetChangeHandlerKeys_=[ge(i,re.KEYDOWN,this.handleBrowserEvent,this),ge(i,re.KEYPRESS,this.handleBrowserEvent,this),ge(t,re.RESIZE,this.updateSize,this)]}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(He(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(He(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=ge(e,Ps.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ge(e,re.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(He),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new qr("addlayer",e)),this.layerGroupPropertyListenerKeys_=[ge(e,Ps.PROPERTYCHANGE,this.render,this),ge(e,re.CHANGE,this.render,this),ge(e,"addlayer",this.handleLayerAdd_,this),ge(e,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,i=e.length;t<i;++t){const r=e[t].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){_T(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){const t=this.getSize(),i=this.getView(),r=this.frameState_;let s=null;if(t!==void 0&&v0(t)&&i&&i.isDef()){const o=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Wo(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:oe(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;s.nextExtent=Wo(a.nextCenter,a.nextResolution,l,t)}}this.frameState_=s,this.renderer_.renderFrame(s),s&&(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),r&&(!this.previousExtent_||!zs(this.previousExtent_)&&!Tn(s.extent,this.previousExtent_))&&(this.dispatchEvent(new wl(oa.MOVESTART,this,r)),this.previousExtent_=Us(this.previousExtent_)),this.previousExtent_&&!s.viewHints[pt.ANIMATING]&&!s.viewHints[pt.INTERACTING]&&!Tn(s.extent,this.previousExtent_)&&(this.dispatchEvent(new wl(oa.MOVEEND,this,s)),pm(s.extent,this.previousExtent_))),this.dispatchEvent(new wl(oa.POSTRENDER,this,s)),this.renderComplete_=!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const t=this.getLayerGroup();t&&this.handleLayerRemove_(new qr("removelayer",t)),this.set(Xt.LAYERGROUP,e)}setSize(e){this.set(Xt.SIZE,e)}setTarget(e){this.set(Xt.TARGET,e)}setView(e){if(!e||e instanceof _r){this.set(Xt.VIEW,e);return}this.set(Xt.VIEW,new _r);const t=this;e.then(function(i){t.setView(new _r(i))})}updateSize(){const e=this.getTargetElement();let t;if(e){const i=getComputedStyle(e),r=e.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),s=e.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);!isNaN(r)&&!isNaN(s)&&(t=[r,s],!v0(t)&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0."))}this.setSize(t),this.updateViewportSize_()}updateViewportSize_(){const e=this.getView();if(e){let t;const i=getComputedStyle(this.viewport_);i.width&&i.height&&(t=[parseInt(i.width,10),parseInt(i.height,10)]),e.setViewportSize(t)}}}function QA(n){let e=null;n.keyboardEventTarget!==void 0&&(e=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);const t={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new mc({layers:n.layers});t[Xt.LAYERGROUP]=i,t[Xt.TARGET]=n.target,t[Xt.VIEW]=n.view instanceof _r?n.view:new _r;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new qt(n.controls.slice()):(ce(typeof n.controls.getArray=="function",47),r=n.controls));let s;n.interactions!==void 0&&(Array.isArray(n.interactions)?s=new qt(n.interactions.slice()):(ce(typeof n.interactions.getArray=="function",48),s=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new qt(n.overlays.slice()):(ce(typeof n.overlays.getArray=="function",49),o=n.overlays):o=new qt,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:t}}var id=JA;class eP extends ln{constructor(e){super();const t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents="auto"),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){lc(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&lc(this.element);for(let t=0,i=this.listenerKeys.length;t<i;++t)He(this.listenerKeys[t]);this.listenerKeys.length=0,this.map_=e,e&&((this.target_?this.target_:e.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Fs&&this.listenerKeys.push(ge(e,oa.POSTRENDER,this.render,this)),e.render())}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}var vr=eP;class tP extends vr{constructor(e){const t=e||{};super({element:document.createElement("div"),render:t.render,target:t.target});this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1);const i=t.className!==void 0?t.className:"ol-attribution",r=t.tipLabel!==void 0?t.tipLabel:"Attributions",s=t.expandClassName!==void 0?t.expandClassName:i+"-expand",o=t.collapseLabel!==void 0?t.collapseLabel:"\u203A",a=t.collapseClassName!==void 0?t.collapseClassName:i+"-collapse";typeof o=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o,this.collapseLabel_.className=a):this.collapseLabel_=o;const l=t.label!==void 0?t.label:"i";typeof l=="string"?(this.label_=document.createElement("span"),this.label_.textContent=l,this.label_.className=s):this.label_=l;const u=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=r,this.toggleButton_.appendChild(u),this.toggleButton_.addEventListener(re.CLICK,this.handleClick_.bind(this),!1);const c=i+" "+Jn+" "+Ws+(this.collapsed_&&this.collapsible_?" "+fc:"")+(this.collapsible_?"":" ol-uncollapsible"),h=this.element;h.className=c,h.appendChild(this.toggleButton_),h.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){const t={},i=[];let r=!0;const s=e.layerStatesArray;for(let o=0,a=s.length;o<a;++o){const l=s[o];if(!cc(l,e.viewState))continue;const u=l.layer.getSource();if(!u)continue;const c=u.getAttributions();if(!c)continue;const h=c(e);if(!!h)if(r=r&&u.getAttributionsCollapsible()!==!1,Array.isArray(h))for(let f=0,d=h.length;f<d;++f)h[f]in t||(i.push(h[f]),t[h[f]]=!0);else h in t||(i.push(h),t[h]=!0)}return this.overrideCollapsible_||this.setCollapsible(r),i}updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=this.collectSourceAttributions_(e),i=t.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!dr(t,this.renderedAttributions_)){Hm(this.ulElement_);for(let r=0,s=t.length;r<s;++r){const o=document.createElement("li");o.innerHTML=t[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(fc),this.collapsed_?ta(this.collapseLabel_,this.label_):ta(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}}var xT=tP;class iP extends vr{constructor(e){const t=e||{};super({element:document.createElement("div"),render:t.render,target:t.target});const i=t.className!==void 0?t.className:"ol-rotate",r=t.label!==void 0?t.label:"\u21E7",s=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof r=="string"?(this.label_=document.createElement("span"),this.label_.className=s,this.label_.textContent=r):(this.label_=r,this.label_.classList.add(s));const o=t.tipLabel?t.tipLabel:"Reset rotation",a=document.createElement("button");a.className=i+"-reset",a.setAttribute("type","button"),a.title=o,a.appendChild(this.label_),a.addEventListener(re.CLICK,this.handleClick_.bind(this),!1);const l=i+" "+Jn+" "+Ws,u=this.element;u.className=l,u.appendChild(a),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=t.duration!==void 0?t.duration:250,this.autoHide_=t.autoHide!==void 0?t.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(hc)}handleClick_(e){e.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const i=t.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?t.animate({rotation:0,duration:this.duration_,easing:Ds}):t.setRotation(0))}render(e){const t=e.frameState;if(!t)return;const i=t.viewState.rotation;if(i!=this.rotation_){const r="rotate("+i+"rad)";if(this.autoHide_){const s=this.element.classList.contains(hc);!s&&i===0?this.element.classList.add(hc):s&&i!==0&&this.element.classList.remove(hc)}this.label_.style.transform=r}this.rotation_=i}}var ET=iP;class nP extends vr{constructor(e){const t=e||{};super({element:document.createElement("div"),target:t.target});const i=t.className!==void 0?t.className:"ol-zoom",r=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:i+"-in",o=t.zoomOutClassName!==void 0?t.zoomOutClassName:i+"-out",a=t.zoomInLabel!==void 0?t.zoomInLabel:"+",l=t.zoomOutLabel!==void 0?t.zoomOutLabel:"\u2013",u=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",c=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=u,h.appendChild(typeof a=="string"?document.createTextNode(a):a),h.addEventListener(re.CLICK,this.handleClick_.bind(this,r),!1);const f=document.createElement("button");f.className=o,f.setAttribute("type","button"),f.title=c,f.appendChild(typeof l=="string"?document.createTextNode(l):l),f.addEventListener(re.CLICK,this.handleClick_.bind(this,-r),!1);const d=i+" "+Jn+" "+Ws,p=this.element;p.className=d,p.appendChild(h),p.appendChild(f),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const i=this.getMap().getView();if(!i)return;const r=i.getZoom();if(r!==void 0){const s=i.getConstrainedZoom(r+e);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:Ds})):i.setZoom(s)}}}var TT=nP;const wT=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],ST={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"};class rP extends vr{constructor(e){const t=e||{};super({element:document.createElement("div"),target:t.target});this.on,this.once,this.un,this.cssClassName_=t.className!==void 0?t.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=t.activeClassName!==void 0?t.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=t.inactiveClassName!==void 0?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const i=t.label!==void 0?t.label:"\u2922";this.labelNode_=typeof i=="string"?document.createTextNode(i):i;const r=t.labelActive!==void 0?t.labelActive:"\xD7";this.labelActiveNode_=typeof r=="string"?document.createTextNode(r):r,this.button_=document.createElement("button");const s=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_.setAttribute("type","button"),this.button_.title=s,this.button_.appendChild(this.labelNode_),this.button_.addEventListener(re.CLICK,this.handleClick_.bind(this),!1),this.element.className=`${this.cssClassName_} ${Jn} ${Ws}`,this.element.appendChild(this.button_),this.keys_=t.keys!==void 0?t.keys:!1,this.source_=t.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this)}handleClick_(e){e.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const e=this.getMap();if(!e)return;const t=e.getOwnerDocument();if(!!RT(t))if(bT(t))oP(t);else{let i;this.source_?i=typeof this.source_=="string"?t.getElementById(this.source_):this.source_:i=e.getTargetElement(),this.keys_?sP(i):IT(i)}}handleFullScreenChange_(){const e=this.getMap();if(!e)return;const t=this.isInFullscreen_;this.isInFullscreen_=bT(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(ta(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(ST.ENTERFULLSCREEN)):(ta(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(ST.LEAVEFULLSCREEN)),e.updateSize())}setClassName_(e,t){const i=this.activeClassName_,r=this.inactiveClassName_,s=t?i:r;e.classList.remove(...i),e.classList.remove(...r),e.classList.add(...s)}setMap(e){const t=this.getMap();t&&t.removeChangeListener(Xt.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(Xt.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const e=this.documentListeners_;for(let i=0,r=e.length;i<r;++i)He(e[i]);e.length=0;const t=this.getMap();if(t){const i=t.getOwnerDocument();RT(i)?this.element.classList.remove(i0):this.element.classList.add(i0);for(let r=0,s=wT.length;r<s;++r)e.push(ge(i,wT[r],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}}function RT(n){const e=n.body;return!!(e.webkitRequestFullscreen||e.msRequestFullscreen&&n.msFullscreenEnabled||e.requestFullscreen&&n.fullscreenEnabled)}function bT(n){return!!(n.webkitIsFullScreen||n.msFullscreenElement||n.fullscreenElement)}function IT(n){n.requestFullscreen?n.requestFullscreen():n.msRequestFullscreen?n.msRequestFullscreen():n.webkitRequestFullscreen&&n.webkitRequestFullscreen()}function sP(n){n.webkitRequestFullscreen?n.webkitRequestFullscreen():IT(n)}function oP(n){n.exitFullscreen?n.exitFullscreen():n.msExitFullscreen?n.msExitFullscreen():n.webkitExitFullscreen&&n.webkitExitFullscreen()}var aP=rP;const x0="projection",CT="coordinateFormat";class lP extends vr{constructor(e){const t=e||{},i=document.createElement("div");i.className=t.className!==void 0?t.className:"ol-mouse-position";super({element:i,render:t.render,target:t.target});this.on,this.once,this.un,this.addChangeListener(x0,this.handleProjectionChanged_),t.coordinateFormat&&this.setCoordinateFormat(t.coordinateFormat),t.projection&&this.setProjection(t.projection);let r=!0,s=" ";"undefinedHTML"in t?(t.undefinedHTML!==void 0&&(s=t.undefinedHTML),r=!!s):"placeholder"in t&&(t.placeholder===!1?r=!1:s=String(t.placeholder)),this.placeholder_=s,this.renderOnMouseOut_=r,this.renderedHTML_=i.innerHTML,this.mapProjection_=null,this.transform_=null}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(CT)}getProjection(){return this.get(x0)}handleMouseMove(e){const t=this.getMap();this.updateHTML_(t.getEventPixel(e))}handleMouseOut(e){this.updateHTML_(null)}setMap(e){if(super.setMap(e),e){const t=e.getViewport();this.listenerKeys.push(ge(t,er.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(ge(t,er.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(CT,e)}setProjection(e){this.set(x0,se(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){const s=this.getProjection();s?this.transform_=wn(this.mapProjection_,s):this.transform_=ec}const r=this.getMap().getCoordinateFromPixelInternal(e);if(r){const s=Zi();s&&(this.transform_=wn(this.mapProjection_,s)),this.transform_(r,r);const o=this.getCoordinateFormat();o?t=o(r):t=r.toString()}}(!this.renderedHTML_||t!==this.renderedHTML_)&&(this.element.innerHTML=t,this.renderedHTML_=t)}render(e){const t=e.frameState;t?this.mapProjection_!=t.viewState.projection&&(this.mapProjection_=t.viewState.projection,this.transform_=null):this.mapProjection_=null}}var uP=lP,Ki={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};const zi={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class cP extends ln{constructor(e){super();this.on,this.once,this.un,this.options=e,this.id=e.id,this.insertFirst=e.insertFirst!==void 0?e.insertFirst:!0,this.stopEvent=e.stopEvent!==void 0?e.stopEvent:!0,this.element=document.createElement("div"),this.element.className=e.className!==void 0?e.className:"ol-overlay-container "+JE,this.element.style.position="absolute",this.element.style.pointerEvents="auto";let t=e.autoPan;t&&typeof t!="object"&&(t={animation:e.autoPanAnimation,margin:e.autoPanMargin}),this.autoPan=t||!1,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(zi.ELEMENT,this.handleElementChanged),this.addChangeListener(zi.MAP,this.handleMapChanged),this.addChangeListener(zi.OFFSET,this.handleOffsetChanged),this.addChangeListener(zi.POSITION,this.handlePositionChanged),this.addChangeListener(zi.POSITIONING,this.handlePositioningChanged),e.element!==void 0&&this.setElement(e.element),this.setOffset(e.offset!==void 0?e.offset:[0,0]),this.setPositioning(e.positioning!==void 0?e.positioning:Ki.TOP_LEFT),e.position!==void 0&&this.setPosition(e.position)}getElement(){return this.get(zi.ELEMENT)}getId(){return this.id}getMap(){return this.get(zi.MAP)||null}getOffset(){return this.get(zi.OFFSET)}getPosition(){return this.get(zi.POSITION)}getPositioning(){return this.get(zi.POSITIONING)}handleElementChanged(){Hm(this.element);const e=this.getElement();e&&this.element.appendChild(e)}handleMapChanged(){this.mapPostrenderListenerKey&&(lc(this.element),He(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const e=this.getMap();if(e){this.mapPostrenderListenerKey=ge(e,oa.POSTRENDER,this.render,this),this.updatePixelPosition();const t=this.stopEvent?e.getOverlayContainerStopEvent():e.getOverlayContainer();this.insertFirst?t.insertBefore(this.element,t.childNodes[0]||null):t.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(e){this.set(zi.ELEMENT,e)}setMap(e){this.set(zi.MAP,e)}setOffset(e){this.set(zi.OFFSET,e)}setPosition(e){this.set(zi.POSITION,e)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(e){const t=this.getMap();if(!t||!t.getTargetElement()||!this.get(zi.POSITION))return;const i=this.getRect(t.getTargetElement(),t.getSize()),r=this.getElement(),s=this.getRect(r,[BE(r),jE(r)]),o=e||{},a=o.margin===void 0?20:o.margin;if(!hi(i,s)){const l=s[0]-i[0],u=i[2]-s[2],c=s[1]-i[1],h=i[3]-s[3],f=[0,0];if(l<0?f[0]=l-a:u<0&&(f[0]=Math.abs(u)+a),c<0?f[1]=c-a:h<0&&(f[1]=Math.abs(h)+a),f[0]!==0||f[1]!==0){const d=t.getView().getCenterInternal(),p=t.getPixelFromCoordinateInternal(d);if(!p)return;const m=[p[0]+f[0],p[1]+f[1]],g=o.animation||{};t.getView().animateInternal({center:t.getCoordinateFromPixelInternal(m),duration:g.duration,easing:g.easing})}}}getRect(e,t){const i=e.getBoundingClientRect(),r=i.left+window.pageXOffset,s=i.top+window.pageYOffset;return[r,s,r+t[0],s+t[1]]}setPositioning(e){this.set(zi.POSITIONING,e)}setVisible(e){this.rendered.visible!==e&&(this.element.style.display=e?"":"none",this.rendered.visible=e)}updatePixelPosition(){const e=this.getMap(),t=this.getPosition();if(!e||!e.isRendered()||!t){this.setVisible(!1);return}const i=e.getPixelFromCoordinate(t),r=e.getSize();this.updateRenderedPosition(i,r)}updateRenderedPosition(e,t){const i=this.element.style,r=this.getOffset(),s=this.getPositioning();this.setVisible(!0);const o=Math.round(e[0]+r[0])+"px",a=Math.round(e[1]+r[1])+"px";let l="0%",u="0%";s==Ki.BOTTOM_RIGHT||s==Ki.CENTER_RIGHT||s==Ki.TOP_RIGHT?l="-100%":(s==Ki.BOTTOM_CENTER||s==Ki.CENTER_CENTER||s==Ki.TOP_CENTER)&&(l="-50%"),s==Ki.BOTTOM_LEFT||s==Ki.BOTTOM_CENTER||s==Ki.BOTTOM_RIGHT?u="-100%":(s==Ki.CENTER_LEFT||s==Ki.CENTER_CENTER||s==Ki.CENTER_RIGHT)&&(u="-50%");const c=`translate(${l}, ${u}) translate(${o}, ${a})`;this.rendered.transform_!=c&&(this.rendered.transform_=c,i.transform=c,i.msTransform=c)}getOptions(){return this.options}}var E0=cP;const T0=.75,nd=.1;class hP extends id{createRenderer(){return new l0(this)}}class fP extends vr{constructor(e){const t=e||{};super({element:document.createElement("div"),render:t.render,target:t.target});this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=t.rotateWithView!==void 0?t.rotateWithView:!1,this.viewExtent_=void 0;const i=t.className!==void 0?t.className:"ol-overviewmap",r=t.tipLabel!==void 0?t.tipLabel:"Overview map",s=t.collapseLabel!==void 0?t.collapseLabel:"\u2039";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s):this.collapseLabel_=s;const o=t.label!==void 0?t.label:"\u203A";typeof o=="string"?(this.label_=document.createElement("span"),this.label_.textContent=o):this.label_=o;const a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,l=document.createElement("button");l.setAttribute("type","button"),l.title=r,l.appendChild(a),l.addEventListener(re.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=t.view,this.ovmap_=new hP({view:t.view});const u=this.ovmap_;t.layers&&t.layers.forEach(function(x){u.addLayer(x)});const c=document.createElement("div");c.className="ol-overviewmap-box",c.style.boxSizing="border-box",this.boxOverlay_=new E0({position:[0,0],positioning:Ki.CENTER_CENTER,element:c}),this.ovmap_.addOverlay(this.boxOverlay_);const h=i+" "+Jn+" "+Ws+(this.collapsed_&&this.collapsible_?" "+fc:"")+(this.collapsible_?"":" ol-uncollapsible"),f=this.element;f.className=h,f.appendChild(this.ovmapDiv_),f.appendChild(l);const d=this,p=this.boxOverlay_,m=this.boxOverlay_.getElement(),g=function(x){return{clientX:x.clientX,clientY:x.clientY}},v=function(x){const _=g(x),E=u.getEventCoordinateInternal(_);p.setPosition(E)},y=function(x){const _=u.getEventCoordinateInternal(x);d.getMap().getView().setCenterInternal(_),window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",y)};m.addEventListener("mousedown",function(){window.addEventListener("mousemove",v),window.addEventListener("mouseup",y)})}setMap(e){const t=this.getMap();if(e!==t){if(t){const i=t.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(ge(e,Ps.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===Xt.VIEW){const t=e.oldValue;t&&this.unbindView_(t);const i=this.getMap().getView();this.bindView_(i)}else!this.ovmap_.isRendered()&&(e.key===Xt.TARGET||e.key===Xt.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){const t=new _r({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(gn.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()}unbindView_(e){e.removeChangeListener(gn.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),s=e.getView().calculateExtentInternal(i);if(this.viewExtent_&&Tn(s,this.viewExtent_))return;this.viewExtent_=s;const o=t.getSize(),l=t.getView().calculateExtentInternal(o),u=t.getPixelFromCoordinateInternal(An(s)),c=t.getPixelFromCoordinateInternal(Vo(s)),h=Math.abs(u[0]-c[0]),f=Math.abs(u[1]-c[1]),d=o[0],p=o[1];h<d*nd||f<p*nd||h>d*T0||f>p*T0?this.resetExtent_():hi(l,s)||this.recenter_()}resetExtent_(){const e=this.getMap(),t=this.ovmap_,i=e.getSize(),s=e.getView().calculateExtentInternal(i),o=t.getView(),a=Math.log(T0/nd)/Math.LN2,l=1/(Math.pow(2,a/2)*nd);Vu(s,l),o.fitInternal(ea(s))}recenter_(){const e=this.getMap(),t=this.ovmap_,i=e.getView();t.getView().setCenterInternal(i.getCenterInternal())}updateBox_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),r=e.getView(),s=t.getView(),o=this.rotateWithView_?0:-r.getRotation(),a=this.boxOverlay_,l=this.boxOverlay_.getElement(),u=r.getCenterInternal(),c=r.getResolution(),h=s.getResolution(),f=i[0]*c/h,d=i[1]*c/h;if(a.setPosition(u),l){l.style.width=f+"px",l.style.height=d+"px";const p="rotate("+o+"rad)";l.style.transform=p}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=Uo(this.ovmap_,oa.POSTRENDER,function(e){delete this.ovmapPostrenderKey_,this.updateBox_()},this))}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(fc),this.collapsed_?ta(this.collapseLabel_,this.label_):ta(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;const e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}}var dP=fP;const w0="units",Hs={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},pP=[1,2,5],S0=25.4/.28;class gP extends vr{constructor(e){const t=e||{},i=t.className!==void 0?t.className:t.bar?"ol-scale-bar":"ol-scale-line";super({element:document.createElement("div"),render:t.render,target:t.target});this.on,this.once,this.un,this.innerElement_=document.createElement("div"),this.innerElement_.className=i+"-inner",this.element.className=i+" "+Jn,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=t.minWidth!==void 0?t.minWidth:64,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(w0,this.handleUnitsChanged_),this.setUnits(t.units||Hs.METRIC),this.scaleBar_=t.bar||!1,this.scaleBarSteps_=t.steps||4,this.scaleBarText_=t.text||!1,this.dpi_=t.dpi||void 0}getUnits(){return this.get(w0)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(w0,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=e.center,i=e.projection,r=this.getUnits(),s=r==Hs.DEGREES?Ui.DEGREES:Ui.METERS;let o=tc(i,e.resolution,t,s);const a=this.minWidth_*(this.dpi_||S0)/S0;let l=a*o,u="";if(r==Hs.DEGREES){const m=Oi[Ui.DEGREES];l*=m,l<m/60?(u="\u2033",o*=3600):l<m?(u="\u2032",o*=60):u="\xB0"}else r==Hs.IMPERIAL?l<.9144?(u="in",o/=.0254):l<1609.344?(u="ft",o/=.3048):(u="mi",o/=1609.344):r==Hs.NAUTICAL?(o/=1852,u="nm"):r==Hs.METRIC?l<.001?(u="\u03BCm",o*=1e6):l<1?(u="mm",o*=1e3):l<1e3?u="m":(u="km",o/=1e3):r==Hs.US?l<.9144?(u="in",o*=39.37):l<1609.344?(u="ft",o/=.30480061):(u="mi",o/=1609.3472):ce(!1,33);let c=3*Math.floor(Math.log(a*o)/Math.log(10)),h,f,d;for(;;){d=Math.floor(c/3);const m=Math.pow(10,d);if(h=pP[(c%3+3)%3]*m,f=Math.round(h/o),isNaN(f)){this.element.style.display="none",this.renderedVisible_=!1;return}else if(f>=a)break;++c}let p;this.scaleBar_?p=this.createScaleBar(f,h,u):p=h.toFixed(d<0?-d:0)+" "+u,this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+"px",this.renderedWidth_=f),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,t,i){const r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),s=[],o=e/this.scaleBarSteps_;let a="#ffffff";for(let c=0;c<this.scaleBarSteps_;c++)c===0&&s.push(this.createMarker("absolute",c)),s.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+a+';"></div>'+this.createMarker("relative",c)+(c%2===0||this.scaleBarSteps_===2?this.createStepText(c,e,!1,t,i):"")+"</div>"),c===this.scaleBarSteps_-1&&s.push(this.createStepText(c+1,e,!0,t,i)),a==="#ffffff"?a="#000000":a="#ffffff";let l;return this.scaleBarText_?l='<div class="ol-scale-text" style="width: '+e+'px;">'+r+"</div>":l="",'<div style="display: flex;">'+l+s.join("")+"</div>"}createMarker(e,t){const i=e==="absolute"?3:-10;return'<div class="ol-scale-step-marker" style="position: '+e+";top: "+i+'px;"></div>'}createStepText(e,t,i,r,s){const a=(e===0?0:Math.round(r/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+s),l=e===0?-3:t/this.scaleBarSteps_*-1,u=e===0?0:t/this.scaleBarSteps_*2;return'<div class="ol-scale-step-text" style="margin-left: '+l+"px;text-align: "+(e===0?"left":"center")+"; min-width: "+u+"px;left: "+(i?t+"px":"unset")+';">'+a+"</div>"}getScaleForResolution(){const e=tc(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Ui.METERS),t=this.dpi_||S0,i=1e3/25.4;return parseFloat(e.toString())*i*t}render(e){const t=e.frameState;t?this.viewState_=t.viewState:this.viewState_=null,this.updateElement_()}}var mP=gP;const _c={VERTICAL:0,HORIZONTAL:1};class yP extends vr{constructor(e){const t=e||{};super({element:document.createElement("div"),render:t.render});this.dragListenerKeys_=[],this.currentResolution_=void 0,this.direction_=_c.VERTICAL,this.dragging_,this.heightLimit_=0,this.widthLimit_=0,this.startX_,this.startY_,this.thumbSize_=null,this.sliderInitialized_=!1,this.duration_=t.duration!==void 0?t.duration:200;const i=t.className!==void 0?t.className:"ol-zoomslider",r=document.createElement("button");r.setAttribute("type","button"),r.className=i+"-thumb "+Jn;const s=this.element;s.className=i+" "+Jn+" "+Ws,s.appendChild(r),s.addEventListener(er.POINTERDOWN,this.handleDraggerStart_.bind(this),!1),s.addEventListener(er.POINTERMOVE,this.handleDraggerDrag_.bind(this),!1),s.addEventListener(er.POINTERUP,this.handleDraggerEnd_.bind(this),!1),s.addEventListener(re.CLICK,this.handleContainerClick_.bind(this),!1),r.addEventListener(re.CLICK,bx,!1)}setMap(e){super.setMap(e),e&&e.render()}initSlider_(){const e=this.element;let t=e.offsetWidth,i=e.offsetHeight;if(t===0&&i===0)return this.sliderInitialized_=!1;const r=getComputedStyle(e);t-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),i-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);const s=e.firstElementChild,o=getComputedStyle(s),a=s.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),l=s.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.thumbSize_=[a,l],t>i?(this.direction_=_c.HORIZONTAL,this.widthLimit_=t-a):(this.direction_=_c.VERTICAL,this.heightLimit_=i-l),this.sliderInitialized_=!0}handleContainerClick_(e){const t=this.getMap().getView(),i=this.getRelativePosition_(e.offsetX-this.thumbSize_[0]/2,e.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(i),s=t.getConstrainedZoom(t.getZoomForResolution(r));t.animateInternal({zoom:s,duration:this.duration_,easing:Ds})}handleDraggerStart_(e){if(!this.dragging_&&e.target===this.element.firstElementChild){const t=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=e.clientX-parseFloat(t.style.left),this.startY_=e.clientY-parseFloat(t.style.top),this.dragging_=!0,this.dragListenerKeys_.length===0){const i=this.handleDraggerDrag_,r=this.handleDraggerEnd_,s=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(ge(s,er.POINTERMOVE,i,this),ge(s,er.POINTERUP,r,this))}}}handleDraggerDrag_(e){if(this.dragging_){const t=e.clientX-this.startX_,i=e.clientY-this.startY_,r=this.getRelativePosition_(t,i);this.currentResolution_=this.getResolutionForPosition_(r),this.getMap().getView().setResolution(this.currentResolution_)}}handleDraggerEnd_(e){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(He),this.dragListenerKeys_.length=0)}setThumbPosition_(e){const t=this.getPositionForResolution_(e),i=this.element.firstElementChild;this.direction_==_c.HORIZONTAL?i.style.left=this.widthLimit_*t+"px":i.style.top=this.heightLimit_*t+"px"}getRelativePosition_(e,t){let i;return this.direction_===_c.HORIZONTAL?i=e/this.widthLimit_:i=t/this.heightLimit_,Ie(i,0,1)}getResolutionForPosition_(e){return this.getMap().getView().getResolutionForValueFunction()(1-e)}getPositionForResolution_(e){const t=this.getMap().getView().getValueForResolutionFunction();return Ie(1-t(e),0,1)}render(e){if(!e.frameState||!this.sliderInitialized_&&!this.initSlider_())return;const t=e.frameState.viewState.resolution;this.currentResolution_=t,this.setThumbPosition_(t)}}var _P=yP;class vP extends vr{constructor(e){const t=e||{};super({element:document.createElement("div"),target:t.target});this.extent=t.extent?t.extent:null;const i=t.className!==void 0?t.className:"ol-zoom-extent",r=t.label!==void 0?t.label:"E",s=t.tipLabel!==void 0?t.tipLabel:"Fit to extent",o=document.createElement("button");o.setAttribute("type","button"),o.title=s,o.appendChild(typeof r=="string"?document.createTextNode(r):r),o.addEventListener(re.CLICK,this.handleClick_.bind(this),!1);const a=i+" "+Jn+" "+Ws,l=this.element;l.className=a,l.appendChild(o)}handleClick_(e){e.preventDefault(),this.handleZoomToExtent()}handleZoomToExtent(){const t=this.getMap().getView(),i=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(ea(i))}}var xP=vP;function LT(n){const e=n||{},t=new qt;return(e.zoom!==void 0?e.zoom:!0)&&t.push(new TT(e.zoomOptions)),(e.rotate!==void 0?e.rotate:!0)&&t.push(new ET(e.rotateOptions)),(e.attribution!==void 0?e.attribution:!0)&&t.push(new xT(e.attributionOptions)),t}var vc={ACTIVE:"active"};class EP extends ln{constructor(e){super();this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(vc.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(vc.ACTIVE,e)}setMap(e){this.map_=e}}function OT(n,e,t){const i=n.getCenterInternal();if(i){const r=[i[0]+e[0],i[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:Fx,center:n.getConstrainedCenter(r)})}}function rd(n,e,t,i){const r=n.getZoom();if(r===void 0)return;const s=n.getConstrainedZoom(r+e),o=n.getResolutionForZoom(s);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:i!==void 0?i:250,easing:Ds})}var Ks=EP;class TP extends Ks{constructor(e){super();const t=e||{};this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(e){let t=!1;if(e.type==Pe.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();rd(a,o,s,this.duration_),i.preventDefault(),t=!0}return!t}}var AT=TP;class wP extends Ks{constructor(e){const t=e||{};super(t);t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==Pe.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==Pe.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==Pe.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==Pe.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){if(SP(e)){const t=e.originalEvent,i=t.pointerId.toString();e.type==Pe.POINTERUP?delete this.trackedPointers_[i]:e.type==Pe.POINTERDOWN?this.trackedPointers_[i]=t:i in this.trackedPointers_&&(this.trackedPointers_[i]=t),this.targetPointers=xf(this.trackedPointers_)}}}function sd(n){const e=n.length;let t=0,i=0;for(let r=0;r<e;r++)t+=n[r].clientX,i+=n[r].clientY;return[t/e,i/e]}function SP(n){const e=n.type;return e===Pe.POINTERDOWN||e===Pe.POINTERDRAG||e===Pe.POINTERUP}var Fn=wP;function od(n){const e=arguments;return function(t){let i=!0;for(let r=0,s=e.length;r<s&&(i=i&&e[r](t),!!i);++r);return i}}const PT=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},MT=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},FT=function(n){const e=n.map.getTargetElement(),t=n.map.getOwnerDocument().activeElement;return e.contains(t)},R0=function(n){return n.map.getTargetElement().hasAttribute("tabindex")?FT(n):!0},Sl=an,RP=function(n){return n.type==Pe.CLICK},b0=function(n){const e=n.originalEvent;return e.button==0&&!(Dx&&hm&&e.ctrlKey)},I0=Ms,bP=function(n){return n.type=="pointermove"},C0=function(n){return n.type==Pe.SINGLECLICK},IP=function(n){return n.type==Pe.DBLCLICK},ad=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},CP=function(n){const e=n.originalEvent;return!e.altKey&&(hm?e.metaKey:e.ctrlKey)&&!e.shiftKey},xc=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},L0=function(n){const t=n.originalEvent.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"},la=function(n){const e=n.originalEvent;return ce(e!==void 0,56),e.pointerType=="mouse"},LP=function(n){const e=n.originalEvent;return ce(e!==void 0,56),e.pointerType==="touch"},OP=function(n){const e=n.originalEvent;return ce(e!==void 0,56),e.pointerType==="pen"},O0=function(n){const e=n.originalEvent;return ce(e!==void 0,56),e.isPrimary&&e.button===0};class AP extends Fn{constructor(e){super({stopDown:Ms});const t=e||{};this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const i=t.condition?t.condition:od(ad,O0);this.condition_=t.onFocusOnly?od(R0,i):i,this.noKinetic_=!1}handleDragEvent(e){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());const t=this.targetPointers,i=sd(t);if(t.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){const r=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],o=e.map.getView();Cm(r,o.getResolution()),Af(r,o.getRotation()),o.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=t.length,e.originalEvent.preventDefault()}handleUpEvent(e){const t=e.map,i=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const r=this.kinetic_.getDistance(),s=this.kinetic_.getAngle(),o=i.getCenterInternal(),a=t.getPixelFromCoordinateInternal(o),l=t.getCoordinateFromPixelInternal([a[0]-r*Math.cos(s),a[1]-r*Math.sin(s)]);i.animateInternal({center:i.getConstrainedCenter(l),duration:500,easing:Ds})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}else return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){const i=e.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1}}var NT=AP;class PP extends Fn{constructor(e){const t=e||{};super({stopDown:Ms});this.condition_=t.condition?t.condition:MT,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(e){if(!la(e))return;const t=e.map,i=t.getView();if(i.getConstraints().rotation===Qf)return;const r=t.getSize(),s=e.pixel,o=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(e){return la(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return la(e)&&b0(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}var $T=PP;class MP extends ko{constructor(e){super();this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,t=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(e[0],t[0])+i,r.top=Math.min(e[1],t[1])+i,r.width=Math.abs(t[0]-e[0])+i,r.height=Math.abs(t[1]-e[1])+i}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){const e=this.startPixel_,t=this.endPixel_,r=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new pi([r])}getGeometry(){return this.geometry_}}var DT=MP;const ld={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class ud extends ni{constructor(e,t,i){super(e);this.coordinate=t,this.mapBrowserEvent=i}}class FP extends Fn{constructor(e){super();this.on,this.once,this.un;const t=e||{};this.box_=new DT(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:b0,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,i){const r=i[0]-t[0],s=i[1]-t[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new ud(ld.BOXDRAG,e.coordinate,e))}handleUpEvent(e){this.box_.setMap(null);const t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new ud(t?ld.BOXEND:ld.BOXCANCEL,e.coordinate,e)),!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new ud(ld.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}}var kT=FP;class NP extends kT{constructor(e){const t=e||{},i=t.condition?t.condition:xc;super({condition:i,className:t.className||"ol-dragzoom",minArea:t.minArea});this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(e){const i=this.getMap().getView();let r=this.getGeometry();if(this.out_){const s=i.rotatedExtentForGeometry(r),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;r=r.clone(),r.scale(a*a)}i.fitInternal(r,{duration:this.duration_,easing:Ds})}}var GT=NP,qs={LEFT:37,UP:38,RIGHT:39,DOWN:40};class $P extends Ks{constructor(e){super();const t=e||{};this.defaultCondition_=function(i){return ad(i)&&L0(i)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(e){let t=!1;if(e.type==re.KEYDOWN){const i=e.originalEvent,r=i.keyCode;if(this.condition_(e)&&(r==qs.DOWN||r==qs.LEFT||r==qs.RIGHT||r==qs.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,u=0;r==qs.DOWN?u=-a:r==qs.LEFT?l=-a:r==qs.RIGHT?l=a:u=a;const c=[l,u];Af(c,o.getRotation()),OT(o,c,this.duration_),i.preventDefault(),t=!0}}return!t}}var UT=$P;class DP extends Ks{constructor(e){super();const t=e||{};this.condition_=t.condition?t.condition:L0,this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(e){let t=!1;if(e.type==re.KEYDOWN||e.type==re.KEYPRESS){const i=e.originalEvent,r=i.charCode;if(this.condition_(e)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){const s=e.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_,a=s.getView();rd(a,o,void 0,this.duration_),i.preventDefault(),t=!0}}return!t}}var zT=DP;const cd={TRACKPAD:"trackpad",WHEEL:"wheel"};class kP extends Ks{constructor(e){const t=e||{};super(t);this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const i=t.condition?t.condition:Sl;this.condition_=t.onFocusOnly?od(R0,i):i,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(e){if(!this.condition_(e)||e.type!==re.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.coordinate);let s;if(e.type==re.WHEEL&&(s=r.deltaY,$x&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=Sf),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?cd.TRACKPAD:cd.WHEEL);const a=i.getView();if(this.mode_===cd.TRACKPAD&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=s;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(e){const t=e.getView();t.getAnimating()&&t.cancelAnimations();let i=-Ie(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),rd(t,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}var BT=kP;class GP extends Fn{constructor(e){const t=e||{},i=t;i.stopDown||(i.stopDown=Ms);super(i);this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(e){let t=0;const i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){const c=s-this.lastAngle_;this.rotationDelta_+=c,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=c}this.lastAngle_=s;const o=e.map,a=o.getView();if(a.getConstraints().rotation===Qf)return;const l=o.getViewport().getBoundingClientRect(),u=sd(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=o.getCoordinateFromPixelInternal(u),this.rotating_&&(o.render(),a.adjustRotationInternal(t,this.anchor_))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}else return!1}}var jT=GP;class UP extends Fn{constructor(e){const t=e||{},i=t;i.stopDown||(i.stopDown=Ms);super(i);this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1;const i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(t=this.lastDistance_/a),this.lastDistance_=a;const l=e.map,u=l.getView();t!=1&&(this.lastScaleDelta_=t);const c=l.getViewport().getBoundingClientRect(),h=sd(this.targetPointers);h[0]-=c.left,h[1]-=c.top,this.anchor_=l.getCoordinateFromPixelInternal(h),l.render(),u.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const i=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}else return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}else return!1}}var YT=UP,mn={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};const zP={ADD_FEATURES:"addfeatures"};class XT extends ni{constructor(e,t,i,r){super(e);this.features=i,this.file=t,this.projection=r}}class BP extends Ks{constructor(e){const t=e||{};super({handleEvent:an});this.on,this.once,this.un,this.readAsBuffer_=!1,this.formats_=[];const i=t.formatConstructors?t.formatConstructors:[];for(let r=0,s=i.length;r<s;++r){let o=i[r];typeof o=="function"&&(o=new o),this.formats_.push(o),this.readAsBuffer_=this.readAsBuffer_||o.getType()===mn.ARRAY_BUFFER}this.projection_=t.projection?se(t.projection):null,this.dropListenKeys_=null,this.source_=t.source||null,this.target=t.target?t.target:null}handleResult_(e,t){const i=t.target.result,r=this.getMap();let s=this.projection_;s||(s=r.getView().getProjection());let o;const a=this.formats_;for(let l=0,u=a.length;l<u;++l){const c=a[l];let h=i;this.readAsBuffer_&&c.getType()!==mn.ARRAY_BUFFER&&(o===void 0&&(o=new TextDecoder().decode(i)),h=o);const f=this.tryReadFeatures_(c,h,{featureProjection:s});if(f&&f.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(f)),this.dispatchEvent(new XT(zP.ADD_FEATURES,e,f,s));break}}}registerListeners_(){const e=this.getMap();if(e){const t=this.target?this.target:e.getViewport();this.dropListenKeys_=[ge(t,re.DROP,this.handleDrop,this),ge(t,re.DRAGENTER,this.handleStop,this),ge(t,re.DRAGOVER,this.handleStop,this),ge(t,re.DROP,this.handleStop,this)]}}setActive(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),super.setActive(e)}setMap(e){this.unregisterListeners_(),super.setMap(e),this.getActive()&&this.registerListeners_()}tryReadFeatures_(e,t,i){try{return e.readFeatures(t,i)}catch{return null}}unregisterListeners_(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(He),this.dropListenKeys_=null)}handleDrop(e){const t=e.dataTransfer.files;for(let i=0,r=t.length;i<r;++i){const s=t.item(i),o=new FileReader;o.addEventListener(re.LOAD,this.handleResult_.bind(this,s)),this.readAsBuffer_?o.readAsArrayBuffer(s):o.readAsText(s)}}handleStop(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy"}}var jP=BP;class YP extends Fn{constructor(e){const t=e||{};super(t);this.condition_=t.condition?t.condition:xc,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=t.duration!==void 0?t.duration:400}handleDragEvent(e){if(!la(e))return;const t=e.map,i=t.getSize(),r=e.pixel,s=r[0]-i[0]/2,o=i[1]/2-r[1],a=Math.atan2(o,s),l=Math.sqrt(s*s+o*o),u=t.getView();if(this.lastAngle_!==void 0){const c=this.lastAngle_-a;u.adjustRotationInternal(c)}this.lastAngle_=a,this.lastMagnitude_!==void 0&&u.adjustResolutionInternal(this.lastMagnitude_/l),this.lastMagnitude_!==void 0&&(this.lastScaleDelta_=this.lastMagnitude_/l),this.lastMagnitude_=l}handleUpEvent(e){if(!la(e))return!0;const i=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1}handleDownEvent(e){return la(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}}var XP=YP;class kg extends qn{constructor(e,t,i){super();if(i!==void 0&&t===void 0)this.setFlatCoordinates(i,e);else{const r=t||0;this.setCenterAndRadius(e,r,i)}}clone(){const e=new kg(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=e-s[0],a=t-s[1],l=o*o+a*a;if(l<r){if(l===0)for(let u=0;u<this.stride;++u)i[u]=s[u];else{const u=this.getRadius()/Math.sqrt(l);i[0]=s[0]+u*o,i[1]=s[1]+u*a;for(let c=2;c<this.stride;++c)i[c]=s[c]}return i.length=this.stride,l}else return r}containsXY(e,t){const i=this.flatCoordinates,r=e-i[0],s=t-i[1];return r*r+s*s<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){const t=this.flatCoordinates,i=t[this.stride]-t[0];return hn(t[0]-i,t[1]-i,t[0]+i,t[1]+i,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return M.CIRCLE}intersectsExtent(e){const t=this.getExtent();if(dt(e,t)){const i=this.getCenter();return e[0]<=i[0]&&e[2]>=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:Cf(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+i;for(let s=1;s<t;++s)r[t+s]=e[s];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,i){this.setLayout(i,e,0),this.flatCoordinates||(this.flatCoordinates=[]);const r=this.flatCoordinates;let s=km(r,0,e,this.stride);r[s++]=r[0]+t;for(let o=1,a=this.stride;o<a;++o)r[s++]=r[o];r.length=s,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){const i=this.getCenter(),r=this.getStride();this.setCenter(kf(i,0,i.length,r,e,t,i)),this.changed()}translate(e,t){const i=this.getCenter(),r=this.getStride();this.setCenter($m(i,0,i.length,r,e,t,i)),this.changed()}}kg.prototype.transform;var A0=kg;function Ec(n,e,t,i,r,s,o){let a,l;const u=(t-e)/i;if(u===1)a=e;else if(u===2)a=e,l=r;else if(u!==0){let f=n[e],d=n[e+1],p=0;const m=[0];for(let y=e+i;y<t;y+=i){const x=n[y],_=n[y+1];p+=Math.sqrt((x-f)*(x-f)+(_-d)*(_-d)),m.push(p),f=x,d=_}const g=r*p,v=Ix(m,g);v<0?(l=(g-m[-v-2])/(m[-v-1]-m[-v-2]),a=e+(-v-2)*i):a=e+v*i}const c=o>1?o:2,h=s||new Array(c);for(let f=0;f<c;++f)h[f]=a===void 0?NaN:l===void 0?n[a+f]:pr(n[a+f],n[a+i+f],l);return h}function hd(n,e,t,i,r,s){if(t==e)return null;let o;if(r<n[e+i-1])return s?(o=n.slice(e,e+i),o[i-1]=r,o):null;if(n[t-1]<r)return s?(o=n.slice(t-i,t),o[i-1]=r,o):null;if(r==n[e+i-1])return n.slice(e,e+i);let a=e/i,l=t/i;for(;a<l;){const f=a+l>>1;r<n[(f+1)*i-1]?l=f:a=f+1}const u=n[a*i-1];if(r==u)return n.slice((a-1)*i,(a-1)*i+i);const c=n[(a+1)*i-1],h=(r-u)/(c-u);o=[];for(let f=0;f<i-1;++f)o.push(pr(n[(a-1)*i+f],n[a*i+f],h));return o.push(r),o}function VT(n,e,t,i,r,s,o){if(o)return hd(n,e,t[t.length-1],i,r,s);let a;if(r<n[i-1])return s?(a=n.slice(0,i),a[i-1]=r,a):null;if(n[n.length-1]<r)return s?(a=n.slice(n.length-i),a[i-1]=r,a):null;for(let l=0,u=t.length;l<u;++l){const c=t[l];if(e!=c){if(r<n[e+i-1])return null;if(r<=n[c-1])return hd(n,e,c,i,r,!1);e=c}}return null}function fd(n,e,t,i){let r=n[e],s=n[e+1],o=0;for(let a=e+i;a<t;a+=i){const l=n[a],u=n[a+1];o+=Math.sqrt((l-r)*(l-r)+(u-s)*(u-s)),r=l,s=u}return o}function VP(n,e,t,i){let r=fd(n,e,t,i);const s=n[t-i]-n[e],o=n[t-i+1]-n[e+1];return r+=Math.sqrt(s*s+o*o),r}class Gg extends qn{constructor(e,t){super();this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){this.flatCoordinates?qe(this.flatCoordinates,e):this.flatCoordinates=e.slice(),this.changed()}clone(){const e=new Gg(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Gs(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Uf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Bf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))}forEachSegment(e){return jm(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){if(this.layout!=q.XYM&&this.layout!=q.XYZM)return null;const i=t!==void 0?t:!1;return hd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i)}getCoordinates(){return gr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return Ec(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return fd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const t=[];return t.length=ic(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new Gg(t,q.XY)}getType(){return M.LINE_STRING}intersectsExtent(e){return nc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=hl(this.flatCoordinates,0,e,this.stride),this.changed()}}var Gt=Gg;class Ug extends qn{constructor(e,t,i){super();if(this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&i)this.setFlatCoordinates(t,e),this.ends_=i;else{let r=this.getLayout();const s=e,o=[],a=[];for(let l=0,u=s.length;l<u;++l){const c=s[l];l===0&&(r=c.getLayout()),qe(o,c.getFlatCoordinates()),a.push(o.length)}this.setFlatCoordinates(r,o),this.ends_=a}}appendLineString(e){this.flatCoordinates?qe(this.flatCoordinates,e.getFlatCoordinates().slice()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Ug(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Gs(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(zf(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jf(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))}getCoordinateAtM(e,t,i){if(this.layout!=q.XYM&&this.layout!=q.XYZM||this.flatCoordinates.length===0)return null;const r=t!==void 0?t:!1,s=i!==void 0?i:!1;return VT(this.flatCoordinates,0,this.ends_,this.stride,e,r,s)}getCoordinates(){return fl(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new Gt(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){const e=this.flatCoordinates,t=this.ends_,i=this.layout,r=[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o],u=new Gt(e.slice(s,l),i);r.push(u),s=l}return r}getFlatMidpoints(){const e=[],t=this.flatCoordinates;let i=0;const r=this.ends_,s=this.stride;for(let o=0,a=r.length;o<a;++o){const l=r[o],u=Ec(t,i,l,s,.5);qe(e,u),i=l}return e}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Gm(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,i),new Ug(t,q.XY,i)}getType(){return M.MULTI_LINE_STRING}intersectsExtent(e){return NE(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Yf(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}var yn=Ug;class J1 extends qn{constructor(e,t){super();t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){this.flatCoordinates?qe(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.changed()}clone(){const e=new J1(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Gs(this.getExtent(),e,t))return r;const s=this.flatCoordinates,o=this.stride;for(let a=0,l=s.length;a<l;a+=o){const u=Wr(e,t,s[a],s[a+1]);if(u<r){r=u;for(let c=0;c<o;++c)i[c]=s[a+c];i.length=o}}return r}getCoordinates(){return gr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const t=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return e<0||t<=e?null:new Et(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){const e=this.flatCoordinates,t=this.layout,i=this.stride,r=[];for(let s=0,o=e.length;s<o;s+=i){const a=new Et(e.slice(s,s+i),t);r.push(a)}return r}getType(){return M.MULTI_POINT}intersectsExtent(e){const t=this.flatCoordinates,i=this.stride;for(let r=0,s=t.length;r<s;r+=i){const o=t[r],a=t[r+1];if(Rf(e,o,a))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=hl(this.flatCoordinates,0,e,this.stride),this.changed()}}var Nn=J1;function P0(n,e,t,i){const r=[];let s=wi();for(let o=0,a=t.length;o<a;++o){const l=t[o];s=If(n,e,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=l[l.length-1]}return r}class zg extends qn{constructor(e,t,i){super();if(this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(e[0])){let r=this.getLayout();const s=e,o=[],a=[];for(let l=0,u=s.length;l<u;++l){const c=s[l];l===0&&(r=c.getLayout());const h=o.length,f=c.getEnds();for(let d=0,p=f.length;d<p;++d)f[d]+=h;qe(o,c.getFlatCoordinates()),a.push(f)}t=r,e=o,i=a}t!==void 0&&i?(this.setFlatCoordinates(t,e),this.endss_=i):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{const i=this.flatCoordinates.length;qe(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let r=0,s=t.length;r<s;++r)t[r]+=i}this.endss_.push(t),this.changed()}clone(){const e=this.endss_.length,t=new Array(e);for(let r=0;r<e;++r)t[r]=this.endss_[r].slice();const i=new zg(this.flatCoordinates.slice(),this.layout,t);return i.applyProperties(this),i}closestPointXY(e,t,i,r){return r<Gs(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(bE(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),IE(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return FE(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return PE(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),Vm(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,Xf(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=P0(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Bm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Nn(this.getFlatInteriorPoints().slice(),q.XYM)}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;GE(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Vm(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=AE(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,i),new zg(t,q.XY,i)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{const s=this.endss_[e-1];t=s[s.length-1]}const i=this.endss_[e].slice(),r=i[i.length-1];if(t!==0)for(let s=0,o=i.length;s<o;++s)i[s]-=t;return new pi(this.flatCoordinates.slice(t,r),this.layout,i)}getPolygons(){const e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o].slice(),u=l[l.length-1];if(s!==0)for(let h=0,f=l.length;h<f;++h)l[h]-=s;const c=new pi(t.slice(s,u),e,l);r.push(c),s=u}return r}getType(){return M.MULTI_POLYGON}intersectsExtent(e){return DE(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=CE(this.flatCoordinates,0,e,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const r=i[i.length-1];this.flatCoordinates.length=r.length===0?0:r[r.length-1]}this.changed()}}var $n=zg;function WP(n,e,t,i,r){WT(n,e,t||0,i||n.length-1,r||ZP)}function WT(n,e,t,i,r){for(;i>t;){if(i-t>600){var s=i-t+1,o=e-t+1,a=Math.log(s),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1),c=Math.max(t,Math.floor(e-o*l/s+u)),h=Math.min(i,Math.floor(e+(s-o)*l/s+u));WT(n,e,c,h,r)}var f=n[e],d=t,p=i;for(Tc(n,t,e),r(n[i],f)>0&&Tc(n,t,i);d<p;){for(Tc(n,d,p),d++,p--;r(n[d],f)<0;)d++;for(;r(n[p],f)>0;)p--}r(n[t],f)===0?Tc(n,t,p):(p++,Tc(n,p,i)),p<=e&&(t=p+1),e<=p&&(i=p-1)}}function Tc(n,e,t){var i=n[e];n[e]=n[t],n[t]=i}function ZP(n,e){return n<e?-1:n>e?1:0}class dd{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const i=[];if(!gd(e,t))return i;const r=this.toBBox,s=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],l=t.leaf?r(a):a;gd(e,l)&&(t.leaf?i.push(a):F0(e,l)?this._all(a,i):s.push(a))}t=s.pop()}return i}collides(e){let t=this.data;if(!gd(e,t))return!1;const i=[];for(;t;){for(let r=0;r<t.children.length;r++){const s=t.children[r],o=t.leaf?this.toBBox(s):s;if(gd(e,o)){if(t.leaf||F0(e,o))return!0;i.push(s)}}t=i.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let i=0;i<e.length;i++)this.insert(e[i]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const i=this.data;this.data=t,t=i}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=bl([]),this}remove(e,t){if(!e)return this;let i=this.data;const r=this.toBBox(e),s=[],o=[];let a,l,u;for(;i||s.length;){if(i||(i=s.pop(),l=s[s.length-1],a=o.pop(),u=!0),i.leaf){const c=HP(e,i.children,t);if(c!==-1)return i.children.splice(c,1),s.push(i),this._condense(s),this}!u&&!i.leaf&&F0(i,r)?(s.push(i),o.push(a),a=0,l=i,i=i.children[0]):l?(a++,i=l.children[a],u=!1):i=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const i=[];for(;e;)e.leaf?t.push(...e.children):i.push(...e.children),e=i.pop();return t}_build(e,t,i,r){const s=i-t+1;let o=this._maxEntries,a;if(s<=o)return a=bl(e.slice(t,i+1)),Rl(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=bl([]),a.leaf=!1,a.height=r;const l=Math.ceil(s/o),u=l*Math.ceil(Math.sqrt(o));ZT(e,t,i,u,this.compareMinX);for(let c=t;c<=i;c+=u){const h=Math.min(c+u-1,i);ZT(e,c,h,l,this.compareMinY);for(let f=c;f<=h;f+=l){const d=Math.min(f+l-1,h);a.children.push(this._build(e,f,d,r-1))}}return Rl(a,this.toBBox),a}_chooseSubtree(e,t,i,r){for(;r.push(t),!(t.leaf||r.length-1===i);){let s=1/0,o=1/0,a;for(let l=0;l<t.children.length;l++){const u=t.children[l],c=M0(u),h=JP(e,u)-c;h<o?(o=h,s=c<s?c:s,a=u):h===o&&c<s&&(s=c,a=u)}t=a||t.children[0]}return t}_insert(e,t,i){const r=i?e:this.toBBox(e),s=[],o=this._chooseSubtree(r,this.data,t,s);for(o.children.push(e),Sc(o,r);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(r,s,t)}_split(e,t){const i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);const o=this._chooseSplitIndex(i,s,r),a=bl(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,Rl(i,this.toBBox),Rl(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=bl([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Rl(this.data,this.toBBox)}_chooseSplitIndex(e,t,i){let r,s=1/0,o=1/0;for(let a=t;a<=i-t;a++){const l=wc(e,0,a,this.toBBox),u=wc(e,a,i,this.toBBox),c=QP(l,u),h=M0(l)+M0(u);c<s?(s=c,r=a,o=h<o?h:o):c===s&&h<o&&(o=h,r=a)}return r||i-t}_chooseSplitAxis(e,t,i){const r=e.leaf?this.compareMinX:KP,s=e.leaf?this.compareMinY:qP,o=this._allDistMargin(e,t,i,r),a=this._allDistMargin(e,t,i,s);o<a&&e.children.sort(r)}_allDistMargin(e,t,i,r){e.children.sort(r);const s=this.toBBox,o=wc(e,0,t,s),a=wc(e,i-t,i,s);let l=pd(o)+pd(a);for(let u=t;u<i-t;u++){const c=e.children[u];Sc(o,e.leaf?s(c):c),l+=pd(o)}for(let u=i-t-1;u>=t;u--){const c=e.children[u];Sc(a,e.leaf?s(c):c),l+=pd(a)}return l}_adjustParentBBoxes(e,t,i){for(let r=i;r>=0;r--)Sc(t[r],e)}_condense(e){for(let t=e.length-1,i;t>=0;t--)e[t].children.length===0?t>0?(i=e[t-1].children,i.splice(i.indexOf(e[t]),1)):this.clear():Rl(e[t],this.toBBox)}}function HP(n,e,t){if(!t)return e.indexOf(n);for(let i=0;i<e.length;i++)if(t(n,e[i]))return i;return-1}function Rl(n,e){wc(n,0,n.children.length,e,n)}function wc(n,e,t,i,r){r||(r=bl(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<t;s++){const o=n.children[s];Sc(r,n.leaf?i(o):o)}return r}function Sc(n,e){return n.minX=Math.min(n.minX,e.minX),n.minY=Math.min(n.minY,e.minY),n.maxX=Math.max(n.maxX,e.maxX),n.maxY=Math.max(n.maxY,e.maxY),n}function KP(n,e){return n.minX-e.minX}function qP(n,e){return n.minY-e.minY}function M0(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function pd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function JP(n,e){return(Math.max(e.maxX,n.maxX)-Math.min(e.minX,n.minX))*(Math.max(e.maxY,n.maxY)-Math.min(e.minY,n.minY))}function QP(n,e){const t=Math.max(n.minX,e.minX),i=Math.max(n.minY,e.minY),r=Math.min(n.maxX,e.maxX),s=Math.min(n.maxY,e.maxY);return Math.max(0,r-t)*Math.max(0,s-i)}function F0(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function gd(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function bl(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ZT(n,e,t,i,r){const s=[e,t];for(;s.length;){if(t=s.pop(),e=s.pop(),t-e<=i)continue;const o=e+Math.ceil((t-e)/i/2)*i;WP(n,o,e,t,r),s.push(e,o,o,t)}}class Q1{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=Tt(e.scale),this.displacement_=e.displacement}clone(){const e=this.getScale();return new Q1({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getAnchor(){return fe()}getImage(e){return fe()}getHitDetectionImage(){return fe()}getPixelRatio(e){return 1}getImageState(){return fe()}getImageSize(){return fe()}getOrigin(){return fe()}getSize(){return fe()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=Tt(e)}listenImageChange(e){fe()}load(){fe()}unlistenImageChange(e){fe()}}var N0=Q1;function tr(n){return Array.isArray(n)?e0(n):n}class ex extends N0{constructor(e){const t=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:1,rotateWithView:t,rotation:e.rotation!==void 0?e.rotation:0,scale:e.scale!==void 0?e.scale:1,displacement:e.displacement!==void 0?e.displacement:[0,0]});this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=e.fill!==void 0?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius_=e.radius!==void 0?e.radius:e.radius1,this.radius2_=e.radius2,this.angle_=e.angle!==void 0?e.angle:0,this.stroke_=e.stroke!==void 0?e.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const e=this.getScale(),t=new ex({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t}getAnchor(){const e=this.size_;if(!e)return null;const t=this.getDisplacement();return[e[0]/2-t[0],e[1]/2+t[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.canvas_[e];if(!t){const i=this.renderOptions_,r=Yt(i.size*e,i.size*e);this.draw_(i,r,e),t=r.canvas,this.canvas_[e]=t}return t}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return ye.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,i){if(t===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return t;let r=this.radius_,s=this.radius2_===void 0?r:this.radius2_;if(r<s){const T=r;r=s,s=T}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=s*Math.sin(a),u=Math.sqrt(s*s-l*l),c=r-u,h=Math.sqrt(l*l+c*c),f=h/l;if(e==="miter"&&f<=i)return f*t;const d=t/2/f,p=t/2*(c/h),g=Math.sqrt((r+d)*(r+d)+p*p)-r;if(this.radius2_===void 0||e==="bevel")return g*2;const v=r*Math.sin(a),y=Math.sqrt(r*r-v*v),x=s-y,E=Math.sqrt(v*v+x*x)/v;if(E<=i){const T=E*t/2-s-r;return 2*Math.max(g,T)}return g*2}createRenderOptions(){let e=sa,t=0,i=null,r=0,s,o=0;this.stroke_&&(s=this.stroke_.getColor(),s===null&&(s=vl),s=tr(s),o=this.stroke_.getWidth(),o===void 0&&(o=El),i=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),e=this.stroke_.getLineJoin(),e===void 0&&(e=sa),t=this.stroke_.getMiterLimit(),t===void 0&&(t=_l));const a=this.calculateLineJoinSize_(e,o,t),l=Math.max(this.radius_,this.radius2_||0),u=Math.ceil(2*l+a);return{strokeStyle:s,strokeWidth:o,size:u,lineDash:i,lineDashOffset:r,lineJoin:e,miterLimit:t}}render(){this.renderOptions_=this.createRenderOptions();const e=this.renderOptions_.size;this.canvas_={},this.size_=[e,e]}draw_(e,t,i){if(t.scale(i,i),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let r=this.fill_.getColor();r===null&&(r=mr),t.fillStyle=tr(r),t.fill()}this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,t.setLineDash&&e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){if(this.fill_){let t=this.fill_.getColor(),i=0;if(typeof t=="string"&&(t=na(t)),t===null?i=1:Array.isArray(t)&&(i=t.length===4?t[3]:1),i===0){const r=Yt(e.size,e.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(e,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(e){let t=this.points_;const i=this.radius_;if(t===1/0)e.arc(0,0,i,0,2*Math.PI);else{const r=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(t*=2);const s=this.angle_-Math.PI/2,o=2*Math.PI/t;for(let a=0;a<t;a++){const l=s+a*o,u=a%2===0?i:r;e.lineTo(u*Math.cos(l),u*Math.sin(l))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=mr,t.fill(),this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}}var HT=ex;class tx extends HT{constructor(e){const t=e||{};super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0]})}clone(){const e=this.getScale(),t=new tx({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t}setRadius(e){this.radius_=e,this.render()}}var $0=tx;class ix{constructor(e){const t=e||{};this.color_=t.color!==void 0?t.color:null}clone(){const e=this.getColor();return new ix({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){this.color_=e}}var xr=ix;class nx{constructor(e){const t=e||{};this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const e=this.getColor();return new nx({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}}var ir=nx;class Mo{constructor(e){const t=e||{};this.geometry_=null,this.geometryFunction_=JT,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new Mo({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=JT,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function KT(n){let e;if(typeof n=="function")e=n;else{let t;Array.isArray(n)?t=n:(ce(typeof n.getZIndex=="function",41),t=[n]),e=function(){return t}}return e}let D0=null;function qT(n,e){if(!D0){const t=new xr({color:"rgba(255,255,255,0.4)"}),i=new ir({color:"#3399CC",width:1.25});D0=[new Mo({image:new $0({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return D0}function Il(){const n={},e=[255,255,255,1],t=[0,153,255,1],i=3;return n[M.POLYGON]=[new Mo({fill:new xr({color:[255,255,255,.5]})})],n[M.MULTI_POLYGON]=n[M.POLYGON],n[M.LINE_STRING]=[new Mo({stroke:new ir({color:e,width:i+2})}),new Mo({stroke:new ir({color:t,width:i})})],n[M.MULTI_LINE_STRING]=n[M.LINE_STRING],n[M.CIRCLE]=n[M.POLYGON].concat(n[M.LINE_STRING]),n[M.POINT]=[new Mo({image:new $0({radius:i*2,fill:new xr({color:t}),stroke:new ir({color:e,width:i/2})}),zIndex:1/0})],n[M.MULTI_POINT]=n[M.POINT],n[M.GEOMETRY_COLLECTION]=n[M.POLYGON].concat(n[M.LINE_STRING],n[M.POINT]),n}function JT(n){return n.getGeometry()}var Er=Mo;const QT={RENDER_ORDER:"renderOrder"};class eM extends ra{constructor(e){const t=e||{},i=ie({},t);delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting;super(i);this.declutter_=t.declutter!==void 0?t.declutter:!1,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(QT.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e){e.declutterTree||(e.declutterTree=new dd(9)),this.getRenderer().renderDeclutter(e)}setRenderOrder(e){this.set(QT.RENDER_ORDER,e)}setStyle(e){this.style_=e!==void 0?e:qT,this.styleFunction_=e===null?void 0:KT(this.style_),this.changed()}}var Cl=eM;const Rc={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},bc=[Rc.FILL],Jr=[Rc.STROKE],Js=[Rc.BEGIN_PATH],k0=[Rc.CLOSE_PATH];var xe=Rc;class tM{drawCustom(e,t,i,r){}drawGeometry(e){}setStyle(e){}drawCircle(e,t){}drawFeature(e,t){}drawGeometryCollection(e,t){}drawLineString(e,t){}drawMultiLineString(e,t){}drawMultiPoint(e,t){}drawMultiPolygon(e,t){}drawPoint(e,t){}drawPolygon(e,t){}drawText(e,t){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}}var G0=tM;class iM extends G0{constructor(e,t,i,r){super();this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){const t=this.pixelRatio;return t==1?e:e.map(function(i){return i*t})}appendFlatPointCoordinates(e,t){const i=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates;let o=s.length;for(let a=0,l=e.length;a<l;a+=t)r[0]=e[a],r[1]=e[a+1],cn(i,r)&&(s[o++]=r[0],s[o++]=r[1]);return o}appendFlatLineCoordinates(e,t,i,r,s,o){const a=this.coordinates;let l=a.length;const u=this.getBufferedMaxExtent();o&&(t+=r);let c=e[t],h=e[t+1];const f=this.tmpCoordinate_;let d=!0,p,m,g;for(p=t+r;p<i;p+=r)f[0]=e[p],f[1]=e[p+1],g=bf(u,f),g!==m?(d&&(a[l++]=c,a[l++]=h,d=!1),a[l++]=f[0],a[l++]=f[1]):g===ci.INTERSECTING?(a[l++]=f[0],a[l++]=f[1],d=!1):d=!0,c=f[0],h=f[1],m=g;return(s&&d||p===t+r)&&(a[l++]=c,a[l++]=h),l}drawCustomCoordinates_(e,t,i,r,s){for(let o=0,a=i.length;o<a;++o){const l=i[o],u=this.appendFlatLineCoordinates(e,t,l,r,!1,!1);s.push(u),t=l}return t}drawCustom(e,t,i,r){this.beginGeometry(e,t);const s=e.getType(),o=e.getStride(),a=this.coordinates.length;let l,u,c,h,f;switch(s){case M.MULTI_POLYGON:l=e.getOrientedFlatCoordinates(),h=[];const d=e.getEndss();f=0;for(let p=0,m=d.length;p<m;++p){const g=[];f=this.drawCustomCoordinates_(l,f,d[p],o,g),h.push(g)}this.instructions.push([xe.CUSTOM,a,h,e,i,Xf]),this.hitDetectionInstructions.push([xe.CUSTOM,a,h,e,r||i,Xf]);break;case M.POLYGON:case M.MULTI_LINE_STRING:c=[],l=s==M.POLYGON?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),f=this.drawCustomCoordinates_(l,0,e.getEnds(),o,c),this.instructions.push([xe.CUSTOM,a,c,e,i,fl]),this.hitDetectionInstructions.push([xe.CUSTOM,a,c,e,r||i,fl]);break;case M.LINE_STRING:case M.CIRCLE:l=e.getFlatCoordinates(),u=this.appendFlatLineCoordinates(l,0,l.length,o,!1,!1),this.instructions.push([xe.CUSTOM,a,u,e,i,gr]),this.hitDetectionInstructions.push([xe.CUSTOM,a,u,e,r||i,gr]);break;case M.MULTI_POINT:l=e.getFlatCoordinates(),u=this.appendFlatPointCoordinates(l,o),u>a&&(this.instructions.push([xe.CUSTOM,a,u,e,i,gr]),this.hitDetectionInstructions.push([xe.CUSTOM,a,u,e,r||i,gr]));break;case M.POINT:l=e.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),u=this.coordinates.length,this.instructions.push([xe.CUSTOM,a,u,e,i]),this.hitDetectionInstructions.push([xe.CUSTOM,a,u,e,r||i]);break}this.endGeometry(t)}beginGeometry(e,t){this.beginGeometryInstruction1_=[xe.BEGIN_GEOMETRY,t,0,e],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[xe.BEGIN_GEOMETRY,t,0,e],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const e=this.hitDetectionInstructions;e.reverse();let t;const i=e.length;let r,s,o=-1;for(t=0;t<i;++t)r=e[t],s=r[0],s==xe.END_GEOMETRY?o=t:s==xe.BEGIN_GEOMETRY&&(r[2]=t,Cx(this.hitDetectionInstructions,o,t),o=-1)}setFillStrokeStyle(e,t){const i=this.state;if(e){const r=e.getColor();i.fillStyle=tr(r||mr)}else i.fillStyle=void 0;if(t){const r=t.getColor();i.strokeStyle=tr(r||vl);const s=t.getLineCap();i.lineCap=s!==void 0?s:dc;const o=t.getLineDash();i.lineDash=o?o.slice():ml;const a=t.getLineDashOffset();i.lineDashOffset=a||yl;const l=t.getLineJoin();i.lineJoin=l!==void 0?l:sa;const u=t.getWidth();i.lineWidth=u!==void 0?u:El;const c=t.getMiterLimit();i.miterLimit=c!==void 0?c:_l,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(e){const t=e.fillStyle,i=[xe.SET_FILL_STYLE,t];return typeof t!="string"&&i.push(!0),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[xe.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){const i=e.fillStyle;(typeof i!="string"||e.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(t.call(this,e)),e.currentFillStyle=i)}updateStrokeStyle(e,t){const i=e.strokeStyle,r=e.lineCap,s=e.lineDash,o=e.lineDashOffset,a=e.lineJoin,l=e.lineWidth,u=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||s!=e.currentLineDash&&!dr(e.currentLineDash,s)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=l||e.currentMiterLimit!=u)&&(i!==void 0&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=s,e.currentLineDashOffset=o,e.currentLineJoin=a,e.currentLineWidth=l,e.currentMiterLimit=u)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const t=[xe.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=pm(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;un(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}var Ll=iM;class nM extends Ll{constructor(e,t,i,r){super(e,t,i,r);this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t){if(!this.image_)return;this.beginGeometry(e,t);const i=e.getFlatCoordinates(),r=e.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([xe.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([xe.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t){if(!this.image_)return;this.beginGeometry(e,t);const i=e.getFlatCoordinates(),r=e.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([xe.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([xe.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(t)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(e,t){const i=e.getAnchor(),r=e.getSize(),s=e.getHitDetectionImage(),o=e.getImage(this.pixelRatio),a=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=s,this.image_=o,this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterImageWithText_=t}}var ew=nM;class rM extends Ll{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinates_(e,t,i,r){const s=this.coordinates.length,o=this.appendFlatLineCoordinates(e,t,i,r,!1,!1),a=[xe.MOVE_TO_LINE_TO,s,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i}drawLineString(e,t){const i=this.state,r=i.strokeStyle,s=i.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([xe.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ml,yl],Js);const o=e.getFlatCoordinates(),a=e.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(Jr),this.endGeometry(t)}drawMultiLineString(e,t){const i=this.state,r=i.strokeStyle,s=i.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([xe.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],Js);const o=e.getEnds(),a=e.getFlatCoordinates(),l=e.getStride();let u=0;for(let c=0,h=o.length;c<h;++c)u=this.drawFlatCoordinates_(a,u,o[c],l);this.hitDetectionInstructions.push(Jr),this.endGeometry(t)}finish(){const e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Jr),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Jr),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(Js)}}var tw=rM;class sM extends Ll{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinatess_(e,t,i,r){const s=this.state,o=s.fillStyle!==void 0,a=s.strokeStyle!==void 0,l=i.length;this.instructions.push(Js),this.hitDetectionInstructions.push(Js);for(let u=0;u<l;++u){const c=i[u],h=this.coordinates.length,f=this.appendFlatLineCoordinates(e,t,c,r,!0,!a),d=[xe.MOVE_TO_LINE_TO,h,f];this.instructions.push(d),this.hitDetectionInstructions.push(d),a&&(this.instructions.push(k0),this.hitDetectionInstructions.push(k0)),t=c}return o&&(this.instructions.push(bc),this.hitDetectionInstructions.push(bc)),a&&(this.instructions.push(Jr),this.hitDetectionInstructions.push(Jr)),t}drawCircle(e,t){const i=this.state,r=i.fillStyle,s=i.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([xe.SET_FILL_STYLE,mr]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([xe.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);const o=e.getFlatCoordinates(),a=e.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);const u=[xe.CIRCLE,l];this.instructions.push(Js,u),this.hitDetectionInstructions.push(Js,u),i.fillStyle!==void 0&&(this.instructions.push(bc),this.hitDetectionInstructions.push(bc)),i.strokeStyle!==void 0&&(this.instructions.push(Jr),this.hitDetectionInstructions.push(Jr)),this.endGeometry(t)}drawPolygon(e,t){const i=this.state,r=i.fillStyle,s=i.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([xe.SET_FILL_STYLE,mr]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([xe.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);const o=e.getEnds(),a=e.getOrientedFlatCoordinates(),l=e.getStride();this.drawFlatCoordinatess_(a,0,o,l),this.endGeometry(t)}drawMultiPolygon(e,t){const i=this.state,r=i.fillStyle,s=i.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([xe.SET_FILL_STYLE,mr]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([xe.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);const o=e.getEndss(),a=e.getOrientedFlatCoordinates(),l=e.getStride();let u=0;for(let c=0,h=o.length;c<h;++c)u=this.drawFlatCoordinatess_(a,u,o[c],l);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const e=this.tolerance;if(e!==0){const t=this.coordinates;for(let i=0,r=t.length;i<r;++i)t[i]=Xs(t[i],e)}return super.finish()}setFillStrokeStyles_(){const e=this.state;e.fillStyle!==void 0&&this.updateFillStyle(e,this.createFill),e.strokeStyle!==void 0&&this.updateStrokeStyle(e,this.applyStroke)}}var U0=sM,z0={POINT:"point",LINE:"line"};function iw(n,e,t,i,r){let s=t,o=t,a=0,l=0,u=t,c,h,f,d,p,m,g,v,y,x;for(h=t;h<i;h+=r){const _=e[h],E=e[h+1];p!==void 0&&(y=_-p,x=E-m,d=Math.sqrt(y*y+x*x),g!==void 0&&(l+=f,c=Math.acos((g*y+v*x)/(f*d)),c>n&&(l>a&&(a=l,s=u,o=h),l=0,u=h-r)),f=d,g=y,v=x),p=_,m=E}return l+=d,l>a?[u,h]:[s,o]}const Ic={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class oM extends Ll{constructor(e,t,i,r){super(e,t,i,r);this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){const e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t){const i=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(this.text_===""||!s||!i&&!r)return;const o=this.coordinates;let a=o.length;const l=e.getType();let u=null,c=e.getStride();if(s.placement===z0.LINE&&(l==M.LINE_STRING||l==M.MULTI_LINE_STRING||l==M.POLYGON||l==M.MULTI_POLYGON)){if(!dt(this.getBufferedMaxExtent(),e.getExtent()))return;let h;if(u=e.getFlatCoordinates(),l==M.LINE_STRING)h=[u.length];else if(l==M.MULTI_LINE_STRING)h=e.getEnds();else if(l==M.POLYGON)h=e.getEnds().slice(0,1);else if(l==M.MULTI_POLYGON){const m=e.getEndss();h=[];for(let g=0,v=m.length;g<v;++g)h.push(m[g][0])}this.beginGeometry(e,t);const f=s.textAlign;let d=0,p;for(let m=0,g=h.length;m<g;++m){if(f==null){const y=iw(s.maxAngle,u,d,h[m],c);d=y[0],p=y[1]}else p=h[m];for(let y=d;y<p;y+=c)o.push(u[y],u[y+1]);const v=o.length;d=h[m],this.drawChars_(a,v),a=v}this.endGeometry(t)}else{let h=s.overflow?null:[];switch(l){case M.POINT:case M.MULTI_POINT:u=e.getFlatCoordinates();break;case M.LINE_STRING:u=e.getFlatMidpoint();break;case M.CIRCLE:u=e.getCenter();break;case M.MULTI_LINE_STRING:u=e.getFlatMidpoints(),c=2;break;case M.POLYGON:u=e.getFlatInteriorPoint(),s.overflow||h.push(u[2]/this.resolution),c=3;break;case M.MULTI_POLYGON:const g=e.getFlatInteriorPoints();u=[];for(let v=0,y=g.length;v<y;v+=3)s.overflow||h.push(g[v+2]/this.resolution),u.push(g[v],g[v+1]);if(u.length===0)return;c=2;break}const f=this.appendFlatPointCoordinates(u,c);if(f===a)return;if(h&&(f-a)/2!==u.length/c){let g=a/2;h=h.filter((v,y)=>{const x=o[(g+y)*2]===u[y*c]&&o[(g+y)*2+1]===u[y*c+1];return x||--g,x})}this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(e,t);let d=s.padding;if(d!=Zs&&(s.scale[0]<0||s.scale[1]<0)){let g=s.padding[0],v=s.padding[1],y=s.padding[2],x=s.padding[3];s.scale[0]<0&&(v=-v,x=-x),s.scale[1]<0&&(g=-g,y=-y),d=[g,v,y,x]}const p=this.pixelRatio;this.instructions.push([xe.DRAW_IMAGE,a,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,d==Zs?Zs:d.map(function(g){return g*p}),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);const m=1/p;this.hitDetectionInstructions.push([xe.DRAW_IMAGE,a,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterImageWithText_,d,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(t)}}saveTextStates_(){const e=this.textStrokeState_,t=this.textState_,i=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:t.font,textAlign:t.textAlign||xl,textBaseline:t.textBaseline||pc,scale:t.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(e,t){const i=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,u=Ic[r.textBaseline],c=this.textOffsetY_*l,h=this.text_,f=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([xe.DRAW_CHARS,e,t,u,r.overflow,a,r.maxAngle,l,c,s,f*l,h,o,1]),this.hitDetectionInstructions.push([xe.DRAW_CHARS,e,t,u,r.overflow,a,r.maxAngle,1,c,s,f,h,o,1/l])}setTextStyle(e,t){let i,r,s;if(!e)this.text_="";else{const o=e.getFill();o?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=tr(o.getColor()||mr)):(r=null,this.textFillState_=r);const a=e.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const p=a.getLineDash(),m=a.getLineDashOffset(),g=a.getWidth(),v=a.getMiterLimit();s.lineCap=a.getLineCap()||dc,s.lineDash=p?p.slice():ml,s.lineDashOffset=m===void 0?yl:m,s.lineJoin=a.getLineJoin()||sa,s.lineWidth=g===void 0?El:g,s.miterLimit=v===void 0?_l:v,s.strokeStyle=tr(a.getColor()||vl)}i=this.textState_;const l=e.getFont()||s0;tT(l);const u=e.getScaleArray();i.overflow=e.getOverflow(),i.font=l,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.textBaseline=e.getTextBaseline()||pc,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||Zs,i.scale=u===void 0?[1,1]:u;const c=e.getOffsetX(),h=e.getOffsetY(),f=e.getRotateWithView(),d=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=h===void 0?0:h,this.textRotateWithView_=f===void 0?!1:f,this.textRotation_=d===void 0?0:d,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:oe(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=r?typeof r.fillStyle=="string"?r.fillStyle:"|"+oe(r.fillStyle):""}this.declutterImageWithText_=t}}var nw=oM;const aM={Circle:U0,Default:Ll,Image:ew,LineString:tw,Polygon:U0,Text:nw};class lM{constructor(e,t,i,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}finish(){const e={};for(const t in this.buildersByZIndex_){e[t]=e[t]||{};const i=this.buildersByZIndex_[t];for(const r in i){const s=i[r].finish();e[t][r]=s}}return e}getBuilder(e,t){const i=e!==void 0?e.toString():"0";let r=this.buildersByZIndex_[i];r===void 0&&(r={},this.buildersByZIndex_[i]=r);let s=r[t];if(s===void 0){const o=aM[t];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=s}return s}}var Cc=lM;class uM extends Tf{constructor(e){super();this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.declutterExecutorGroup=null}getFeatures(e){return fe()}getData(e){return null}prepareFrame(e){return fe()}renderFrame(e,t){return fe()}loadedTileCallback(e,t,i){e[t]||(e[t]={}),e[t][i.tileCoord.toString()]=i}createLoadedTileFinder(e,t,i){return function(r,s){const o=this.loadedTileCallback.bind(this,i,r);return e.forEachLoadedTile(t,r,s,o)}.bind(this)}forEachFeatureAtCoordinate(e,t,i,r,s){}getDataAtPixel(e,t,i){return null}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){e.target.getState()===ye.LOADED&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=ye.LOADED&&t!=ye.ERROR&&e.addEventListener(re.CHANGE,this.boundHandleImageChange_),t==ye.IDLE&&(e.load(),t=e.getState()),t==ye.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e.getVisible()&&e.getSourceState()==Ge.READY&&e.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}var B0=uM;let Lc=null;function cM(){const n=document.createElement("canvas");n.width=1,n.height=1,Lc=n.getContext("2d")}class hM extends B0{constructor(e){super(e);this.container=null,this.renderedResolution,this.tempTransform=xt(),this.pixelTransform=xt(),this.inversePixelTransform=xt(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(e,t,i){Lc||cM(),Lc.clearRect(0,0,1,1);let r;try{Lc.drawImage(e,t,i,1,1,0,0,1,1),r=Lc.getImageData(0,0,1,1).data}catch{return null}return r}getBackground(e){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(e.viewState.resolution)),i||void 0}useContainer(e,t,i,r){const s=this.getLayer().getClassName();let o,a;if(e&&e.className===s&&e.style.opacity===""&&i===1&&(!r||e.style.backgroundColor&&dr(na(e.style.backgroundColor),na(r)))){const l=e.firstElementChild;l instanceof HTMLCanvasElement&&(a=l.getContext("2d"))}if(a&&a.canvas.style.transform===t?(this.container=e,this.context=a,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){o=document.createElement("div"),o.className=s;let l=o.style;l.position="absolute",l.width="100%",l.height="100%",r&&(l.backgroundColor=r),a=Yt();const u=a.canvas;o.appendChild(u),l=u.style,l.position="absolute",l.left="0",l.transformOrigin="top left",this.container=o,this.context=a}}clipUnrotated(e,t,i){const r=An(i),s=al(i),o=Vo(i),a=Xo(i);rt(t.coordinateToPixelTransform,r),rt(t.coordinateToPixelTransform,s),rt(t.coordinateToPixelTransform,o),rt(t.coordinateToPixelTransform,a);const l=this.inversePixelTransform;rt(l,r),rt(l,s),rt(l,o),rt(l,a),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(s[0]),Math.round(s[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.clip()}dispatchRenderEvent_(e,t,i){const r=this.getLayer();if(r.hasListener(e)){const s=new gl(e,this.inversePixelTransform,i,t);r.dispatchEvent(s)}}preRender(e,t){this.frameState=t,this.dispatchRenderEvent_(Hi.PRERENDER,e,t)}postRender(e,t){this.dispatchRenderEvent_(Hi.POSTRENDER,e,t)}getRenderTransform(e,t,i,r,s,o,a){const l=s/2,u=o/2,c=r/t,h=-c,f=-e[0]+a,d=-e[1];return Ti(this.tempTransform,l,u,c,h,-i,f,d)}getDataAtPixel(e,t,i){const r=rt(this.inversePixelTransform,e.slice()),s=this.context,a=this.getLayer().getExtent();if(a){const f=rt(t.pixelToCoordinateTransform,e.slice());if(!cn(a,f))return null}const l=Math.round(r[0]),u=Math.round(r[1]);let c=this.pixelContext_;if(!c){const f=document.createElement("canvas");f.width=1,f.height=1,c=f.getContext("2d"),this.pixelContext_=c}c.clearRect(0,0,1,1);let h;try{c.drawImage(s.canvas,l,u,1,1,0,0,1,1),h=c.getImageData(0,0,1,1).data}catch(f){return f.name==="SecurityError"?(this.pixelContext_=null,new Uint8Array):h}return h[3]===0?null:h}disposeInternal(){delete this.frameState,super.disposeInternal()}}var md=hM,Ue={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function rw(n,e,t,i,r,s,o,a,l,u,c,h){let f=n[e],d=n[e+1],p=0,m=0,g=0,v=0;function y(){p=f,m=d,e+=i,f=n[e],d=n[e+1],v+=g,g=Math.sqrt((f-p)*(f-p)+(d-m)*(d-m))}do y();while(e<t-i&&v+g<s);let x=g===0?0:(s-v)/g;const _=pr(p,f,x),E=pr(m,d,x),T=e-i,w=v,S=s+a*l(u,r,c);for(;e<t-i&&v+g<S;)y();x=g===0?0:(S-v)/g;const R=pr(p,f,x),b=pr(m,d,x);let I;if(h){const L=[_,E,R,b];kf(L,0,4,2,h,L,L),I=L[0]>L[2]}else I=_>R;const O=Math.PI,P=[],B=T+i===e;e=T,g=0,v=w,f=n[e],d=n[e+1];let A;if(B){y(),A=Math.atan2(d-m,f-p),I&&(A+=A>0?-O:O);const L=(R+_)/2,D=(b+E)/2;return P[0]=[L,D,(S-s)/2,A,r],P}for(let L=0,D=r.length;L<D;){y();let U=Math.atan2(d-m,f-p);if(I&&(U+=U>0?-O:O),A!==void 0){let z=U-A;if(z+=z>O?-2*O:z<-O?2*O:0,Math.abs(z)>o)return null}A=U;const G=L;let $=0;for(;L<D;++L){const z=I?D-L-1:L,j=a*l(u,r[z],c);if(e+i<t&&v+g<s+$+j/2)break;$+=j}if(L===G)continue;const k=I?r.substring(D-G,D-L):r.substring(G,L);x=g===0?0:(s+$/2-v)/g;const C=pr(p,f,x),Z=pr(m,d,x);P.push([C,Z,$/2,U,k]),s+=$}return P}const Ol=wi(),Qs=[],Qr=[],es=[],eo=[];function sw(n){return n[3].declutterBox}const fM=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function ow(n,e){return(e==="start"||e==="end")&&!fM.test(n)&&(e=e==="start"?"left":"right"),Ic[e]}function dM(n,e,t){return t>0&&n.push(`
|
6
|
-
`,""),n.push(e,""),n}class pM{constructor(e,t,i,r){this.overlaps=i,this.pixelRatio=t,this.resolution=e,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=xt(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}createLabel(e,t,i,r){const s=e+t+i+r;if(this.labels_[s])return this.labels_[s];const o=r?this.strokeStates[r]:null,a=i?this.fillStates[i]:null,l=this.textStates[t],u=this.pixelRatio,c=[l.scale[0]*u,l.scale[1]*u],h=Array.isArray(e),f=ow(h?e[0]:e,l.textAlign||xl),d=r&&o.lineWidth?o.lineWidth:0,p=h?e:e.split(`
|
7
|
-
`).reduce(dM,[]),{width:m,height:g,widths:v,heights:y,lineWidths:x}=rT(l,p),_=m+d,E=[],T=(_+2)*c[0],w=(g+d)*c[1],S={width:T<0?Math.floor(T):Math.ceil(T),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:E};(c[0]!=1||c[1]!=1)&&E.push("scale",c),r&&(E.push("strokeStyle",o.strokeStyle),E.push("lineWidth",d),E.push("lineCap",o.lineCap),E.push("lineJoin",o.lineJoin),E.push("miterLimit",o.miterLimit),(Yu?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(E.push("setLineDash",[o.lineDash]),E.push("lineDashOffset",o.lineDashOffset))),i&&E.push("fillStyle",a.fillStyle),E.push("textBaseline","middle"),E.push("textAlign","center");const R=.5-f;let b=f*_+R*d;const I=[],O=[];let P=0,B=0,A=0,L=0,D;for(let U=0,G=p.length;U<G;U+=2){const $=p[U];if($===`
|
8
|
-
`){B+=P,P=0,b=f*_+R*d,++L;continue}const k=p[U+1]||l.font;k!==D&&(r&&I.push("font",k),i&&O.push("font",k),D=k),P=Math.max(P,y[A]);const C=[$,b+R*v[A]+f*(v[A]-x[L]),.5*(d+P)+B];b+=v[A],r&&I.push("strokeText",C),i&&O.push("fillText",C),++A}return Array.prototype.push.apply(E,I),Array.prototype.push.apply(E,O),this.labels_[s]=S,S}replayTextBackground_(e,t,i,r,s,o,a){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,s),e.lineTo.apply(e,t),o&&(this.alignFill_=o[2],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())}calculateImageOrLabelDimensions_(e,t,i,r,s,o,a,l,u,c,h,f,d,p,m,g){a*=f[0],l*=f[1];let v=i-a,y=r-l;const x=s+u>e?e-u:s,_=o+c>t?t-c:o,E=p[3]+x*f[0]+p[1],T=p[0]+_*f[1]+p[2],w=v-p[3],S=y-p[0];(m||h!==0)&&(Qs[0]=w,eo[0]=w,Qs[1]=S,Qr[1]=S,Qr[0]=w+E,es[0]=Qr[0],es[1]=S+T,eo[1]=es[1]);let R;return h!==0?(R=Ti(xt(),i,r,1,1,h,-i,-r),rt(R,Qs),rt(R,Qr),rt(R,es),rt(R,eo),hn(Math.min(Qs[0],Qr[0],es[0],eo[0]),Math.min(Qs[1],Qr[1],es[1],eo[1]),Math.max(Qs[0],Qr[0],es[0],eo[0]),Math.max(Qs[1],Qr[1],es[1],eo[1]),Ol)):hn(Math.min(w,w+E),Math.min(S,S+T),Math.max(w,w+E),Math.max(S,S+T),Ol),d&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:_,originX:u,originY:c,declutterBox:{minX:Ol[0],minY:Ol[1],maxX:Ol[2],maxY:Ol[3],value:g},canvasTransform:R,scale:f}}replayImageOrLabel_(e,t,i,r,s,o,a){const l=!!(o||a),u=r.declutterBox,c=e.canvas,h=a?a[2]*r.scale[0]/2:0;return u.minX-h<=c.width/t&&u.maxX+h>=0&&u.minY-h<=c.height/t&&u.maxY+h>=0&&(l&&this.replayTextBackground_(e,Qs,Qr,es,eo,o,a),sT(e,r.canvasTransform,s,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){if(this.alignFill_){const t=rt(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;e.save(),e.translate(t[0]%i,t[1]%i),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.setLineDash&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))}drawLabelWithPointPlacement_(e,t,i,r){const s=this.textStates[t],o=this.createLabel(e,t,r,i),a=this.strokeStates[i],l=this.pixelRatio,u=ow(Array.isArray(e)?e[0]:e,s.textAlign||xl),c=Ic[s.textBaseline||pc],h=a&&a.lineWidth?a.lineWidth:0,f=o.width/l-2*s.scale[0],d=u*f+2*(.5-u)*h,p=c*o.height/l+2*(.5-c)*h;return{label:o,anchorX:d,anchorY:p}}execute_(e,t,i,r,s,o,a,l){let u;this.pixelCoordinates_&&dr(i,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=Kr(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Gx(this.renderedTransform_,i));let c=0;const h=r.length;let f=0,d,p,m,g,v,y,x,_,E,T,w,S,R=0,b=0,I=null,O=null;const P=this.coordinateCache_,B=this.viewRotation_,A=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,L={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:B},D=this.instructions!=r||this.overlaps?0:200;let U,G,$,k;for(;c<h;){const C=r[c];switch(C[0]){case xe.BEGIN_GEOMETRY:U=C[1],k=C[3],U.getGeometry()?a!==void 0&&!dt(a,k.getExtent())?c=C[2]+1:++c:c=C[2];break;case xe.BEGIN_PATH:R>D&&(this.fill_(e),R=0),b>D&&(e.stroke(),b=0),!R&&!b&&(e.beginPath(),g=NaN,v=NaN),++c;break;case xe.CIRCLE:f=C[1];const z=u[f],j=u[f+1],V=u[f+2],te=u[f+3],J=V-z,X=te-j,Se=Math.sqrt(J*J+X*X);e.moveTo(z+Se,j),e.arc(z,j,Se,0,2*Math.PI,!0),++c;break;case xe.CLOSE_PATH:e.closePath(),++c;break;case xe.CUSTOM:f=C[1],d=C[2];const _e=C[3],be=C[4],ht=C.length==6?C[5]:void 0;L.geometry=_e,L.feature=U,c in P||(P[c]=[]);const Ce=P[c];ht?ht(u,f,d,2,Ce):(Ce[0]=u[f],Ce[1]=u[f+1],Ce.length=2),be(Ce,L),++c;break;case xe.DRAW_IMAGE:f=C[1],d=C[2],_=C[3],p=C[4],m=C[5];let De=C[6];const Xe=C[7],Mt=C[8],Ut=C[9],Q=C[10];let Ft=C[11];const zt=C[12];let Rt=C[13];const nt=C[14];if(!_&&C.length>=19){E=C[18],T=C[19],w=C[20],S=C[21];const jt=this.drawLabelWithPointPlacement_(E,T,w,S);_=jt.label,C[3]=_;const Di=C[22];p=(jt.anchorX-Di)*this.pixelRatio,C[4]=p;const vi=C[23];m=(jt.anchorY-vi)*this.pixelRatio,C[5]=m,De=_.height,C[6]=De,Rt=_.width,C[13]=Rt}let Zt;C.length>24&&(Zt=C[24]);let Bt,Yi,Li;C.length>16?(Bt=C[15],Yi=C[16],Li=C[17]):(Bt=Zs,Yi=!1,Li=!1),Q&&A?Ft+=B:!Q&&!A&&(Ft-=B);let ai=0;for(;f<d;f+=2){if(Zt&&Zt[ai++]<Rt/this.pixelRatio)continue;const jt=this.calculateImageOrLabelDimensions_(_.width,_.height,u[f],u[f+1],Rt,De,p,m,Mt,Ut,Ft,zt,s,Bt,Yi||Li,U),Di=[e,t,_,jt,Xe,Yi?I:null,Li?O:null];let vi,li;if(l&&nt){const $t=d-f;if(!nt[$t]){nt[$t]=Di;continue}if(vi=nt[$t],delete nt[$t],li=sw(vi),l.collides(li))continue}l&&l.collides(jt.declutterBox)||(vi&&(l&&l.insert(li),this.replayImageOrLabel_.apply(this,vi)),l&&l.insert(jt.declutterBox),this.replayImageOrLabel_.apply(this,Di))}++c;break;case xe.DRAW_CHARS:const Nt=C[1],Ze=C[2],bt=C[3],Ht=C[4];S=C[5];const Kt=C[6],Ct=C[7],nn=C[8];w=C[9];const Xi=C[10];E=C[11],T=C[12];const Cs=[C[13],C[13]],Vi=this.textStates[T],rn=Vi.font,Yr=[Vi.scale[0]*Ct,Vi.scale[1]*Ct];let sn;rn in this.widths_?sn=this.widths_[rn]:(sn={},this.widths_[rn]=sn);const Yn=fd(u,Nt,Ze,2),fr=Math.abs(Yr[0])*a0(rn,E,sn);if(Ht||fr<=Yn){const jt=this.textStates[T].textAlign,Di=(Yn-fr)*Ic[jt],vi=rw(u,Nt,Ze,2,E,Di,Kt,Math.abs(Yr[0]),a0,rn,sn,A?0:this.viewRotation_);e:if(vi){const li=[];let $t,on,Xn,ui,ki;if(w)for($t=0,on=vi.length;$t<on;++$t){ki=vi[$t],Xn=ki[4],ui=this.createLabel(Xn,T,"",w),p=ki[2]+(Yr[0]<0?-Xi:Xi),m=bt*ui.height+(.5-bt)*2*Xi*Yr[1]/Yr[0]-nn;const En=this.calculateImageOrLabelDimensions_(ui.width,ui.height,ki[0],ki[1],ui.width,ui.height,p,m,0,0,ki[3],Cs,!1,Zs,!1,U);if(l&&l.collides(En.declutterBox))break e;li.push([e,t,ui,En,1,null,null])}if(S)for($t=0,on=vi.length;$t<on;++$t){ki=vi[$t],Xn=ki[4],ui=this.createLabel(Xn,T,S,""),p=ki[2],m=bt*ui.height-nn;const En=this.calculateImageOrLabelDimensions_(ui.width,ui.height,ki[0],ki[1],ui.width,ui.height,p,m,0,0,ki[3],Cs,!1,Zs,!1,U);if(l&&l.collides(En.declutterBox))break e;li.push([e,t,ui,En,1,null,null])}l&&l.load(li.map(sw));for(let En=0,Xr=li.length;En<Xr;++En)this.replayImageOrLabel_.apply(this,li[En])}}++c;break;case xe.END_GEOMETRY:if(o!==void 0){U=C[1];const jt=o(U,k);if(jt)return jt}++c;break;case xe.FILL:D?R++:this.fill_(e),++c;break;case xe.MOVE_TO_LINE_TO:for(f=C[1],d=C[2],G=u[f],$=u[f+1],y=G+.5|0,x=$+.5|0,(y!==g||x!==v)&&(e.moveTo(G,$),g=y,v=x),f+=2;f<d;f+=2)G=u[f],$=u[f+1],y=G+.5|0,x=$+.5|0,(f==d-2||y!==g||x!==v)&&(e.lineTo(G,$),g=y,v=x);++c;break;case xe.SET_FILL_STYLE:I=C,this.alignFill_=C[2],R&&(this.fill_(e),R=0,b&&(e.stroke(),b=0)),e.fillStyle=C[1],++c;break;case xe.SET_STROKE_STYLE:O=C,b&&(e.stroke(),b=0),this.setStrokeStyle_(e,C),++c;break;case xe.STROKE:D?b++:e.stroke(),++c;break;default:++c;break}}R&&this.fill_(e),b&&e.stroke()}execute(e,t,i,r,s,o){this.viewRotation_=r,this.execute_(e,t,i,this.instructions,s,void 0,void 0,o)}executeHitDetection(e,t,i,r,s){return this.viewRotation_=i,this.execute_(e,1,t,this.hitDetectionInstructions,!0,r,s)}}var aw=pM;const j0=[Ue.POLYGON,Ue.CIRCLE,Ue.LINE_STRING,Ue.IMAGE,Ue.TEXT,Ue.DEFAULT];class gM{constructor(e,t,i,r,s,o){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=t,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=xt(),this.createExecutors_(s)}clip(e,t){const i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()}createExecutors_(e){for(const t in e){let i=this.executorsByZIndex_[t];i===void 0&&(i={},this.executorsByZIndex_[t]=i);const r=e[t];for(const s in r){const o=r[s];i[s]=new aw(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}}hasExecutors(e){for(const t in this.executorsByZIndex_){const i=this.executorsByZIndex_[t];for(let r=0,s=e.length;r<s;++r)if(e[r]in i)return!0}return!1}forEachFeatureAtCoordinate(e,t,i,r,s,o){r=Math.round(r);const a=r*2+1,l=Ti(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),u=!this.hitDetectionContext_;u&&(this.hitDetectionContext_=Yt(a,a));const c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):u||c.clearRect(0,0,a,a);let h;this.renderBuffer_!==void 0&&(h=wi(),Yo(h,e),un(h,t*(this.renderBuffer_+r),h));const f=lw(r);let d;function p(E,T){const w=c.getImageData(0,0,a,a).data;for(let S=0,R=f.length;S<R;S++)if(w[f[S]]>0){if(!o||d!==Ue.IMAGE&&d!==Ue.TEXT||o.indexOf(E)!==-1){const b=(f[S]-3)/4,I=r-b%a,O=r-(b/a|0),P=s(E,T,I*I+O*O);if(P)return P}c.clearRect(0,0,a,a);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(Vr);let g,v,y,x,_;for(g=m.length-1;g>=0;--g){const E=m[g].toString();for(y=this.executorsByZIndex_[E],v=j0.length-1;v>=0;--v)if(d=j0[v],x=y[d],x!==void 0&&(_=x.executeHitDetection(c,l,i,p,h),_))return _}}getClipCoords(e){const t=this.maxExtent_;if(!t)return null;const i=t[0],r=t[1],s=t[2],o=t[3],a=[i,r,i,o,s,o,s,r];return Kr(a,0,8,2,e,a),a}isEmpty(){return Wn(this.executorsByZIndex_)}execute(e,t,i,r,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(Vr),this.maxExtent_&&(e.save(),this.clip(e,i));const u=o||j0;let c,h,f,d,p,m;for(a&&l.reverse(),c=0,h=l.length;c<h;++c){const g=l[c].toString();for(p=this.executorsByZIndex_[g],f=0,d=u.length;f<d;++f){const v=u[f];m=p[v],m!==void 0&&m.execute(e,t,i,r,s,a)}}this.maxExtent_&&e.restore()}}const Y0={};function lw(n){if(Y0[n]!==void 0)return Y0[n];const e=n*2+1,t=n*n,i=new Array(t+1);for(let s=0;s<=n;++s)for(let o=0;o<=n;++o){const a=s*s+o*o;if(a>t)break;let l=i[a];l||(l=[],i[a]=l),l.push(((n+s)*e+(n+o))*4+3),s>0&&l.push(((n-s)*e+(n+o))*4+3),o>0&&(l.push(((n+s)*e+(n-o))*4+3),s>0&&l.push(((n-s)*e+(n-o))*4+3))}const r=[];for(let s=0,o=i.length;s<o;++s)i[s]&&r.push(...i[s]);return Y0[n]=r,r}var Oc=gM;class mM extends G0{constructor(e,t,i,r,s,o,a){super();this.context_=e,this.pixelRatio_=t,this.extent_=i,this.transform_=r,this.viewRotation_=s,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=xt()}drawImages_(e,t,i,r){if(!this.image_)return;const s=Kr(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(let c=0,h=s.length;c<h;c+=2){const f=s[c]-this.imageAnchorX_,d=s[c+1]-this.imageAnchorY_;if(u!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const p=f+this.imageAnchorX_,m=d+this.imageAnchorY_;Ti(a,p,m,1,1,u,-p,-m),o.setTransform.apply(o,a),o.translate(p,m),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,f,d,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=l)}drawText_(e,t,i,r){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const s=Kr(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);t<i;t+=r){const l=s[t]+this.textOffsetX_,u=s[t+1]+this.textOffsetY_;if(a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1){const c=Ti(this.tmpLocalTransform_,l,u,1,1,a,-l,-u);o.setTransform.apply(o,c),o.translate(l,u),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,l,u),this.textFillState_&&o.fillText(this.text_,l,u)}}moveToLineTo_(e,t,i,r,s){const o=this.context_,a=Kr(e,t,i,r,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let l=a.length;s&&(l-=2);for(let u=2;u<l;u+=2)o.lineTo(a[u],a[u+1]);return s&&o.closePath(),i}drawRings_(e,t,i,r){for(let s=0,o=i.length;s<o;++s)t=this.moveToLineTo_(e,t,i[s],r,!0);return t}drawCircle(e){if(!!dt(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=SE(e,this.transform_,this.pixelCoordinates_),i=t[2]-t[0],r=t[3]-t[1],s=Math.sqrt(i*i+r*r),o=this.context_;o.beginPath(),o.arc(t[0],t[1],s,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case M.POINT:this.drawPoint(e);break;case M.LINE_STRING:this.drawLineString(e);break;case M.POLYGON:this.drawPolygon(e);break;case M.MULTI_POINT:this.drawMultiPoint(e);break;case M.MULTI_LINE_STRING:this.drawMultiLineString(e);break;case M.MULTI_POLYGON:this.drawMultiPolygon(e);break;case M.GEOMETRY_COLLECTION:this.drawGeometryCollection(e);break;case M.CIRCLE:this.drawCircle(e);break}}drawFeature(e,t){const i=t.getGeometryFunction()(e);!i||!dt(this.extent_,i.getExtent())||(this.setStyle(t),this.drawGeometry(i))}drawGeometryCollection(e){const t=e.getGeometriesArray();for(let i=0,r=t.length;i<r;++i)this.drawGeometry(t[i])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!dt(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(i,0,i.length,e.getStride(),!1),t.stroke()}if(this.text_!==""){const t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getExtent();if(!!dt(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,r=e.getFlatCoordinates();let s=0;const o=e.getEnds(),a=e.getStride();i.beginPath();for(let l=0,u=o.length;l<u;++l)s=this.moveToLineTo_(r,s,o[l],a,!1);i.stroke()}if(this.text_!==""){const i=e.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!dt(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride()),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!dt(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getOrientedFlatCoordinates();let r=0;const s=e.getEndss(),o=e.getStride();t.beginPath();for(let a=0,l=s.length;a<l;++a){const u=s[a];r=this.drawRings_(i,r,u,o)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){const t=this.context_,i=this.contextFillState_;i?i.fillStyle!=e.fillStyle&&(i.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){const t=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=e.lineCap&&(i.lineCap=e.lineCap,t.lineCap=e.lineCap),t.setLineDash&&(dr(i.lineDash,e.lineDash)||t.setLineDash(i.lineDash=e.lineDash),i.lineDashOffset!=e.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset)),i.lineJoin!=e.lineJoin&&(i.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),i.lineWidth!=e.lineWidth&&(i.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),i.miterLimit!=e.miterLimit&&(i.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),i.strokeStyle!=e.strokeStyle&&(i.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){const t=this.context_,i=this.contextTextState_,r=e.textAlign?e.textAlign:xl;i?(i.font!=e.font&&(i.font=e.font,t.font=e.font),i.textAlign!=r&&(i.textAlign=r,t.textAlign=r),i.textBaseline!=e.textBaseline&&(i.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=r,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(!e)this.fillState_=null;else{const i=e.getColor();this.fillState_={fillStyle:tr(i||mr)}}if(!t)this.strokeState_=null;else{const i=t.getColor(),r=t.getLineCap(),s=t.getLineDash(),o=t.getLineDashOffset(),a=t.getLineJoin(),l=t.getWidth(),u=t.getMiterLimit(),c=s||ml;this.strokeState_={lineCap:r!==void 0?r:dc,lineDash:this.pixelRatio_===1?c:c.map(h=>h*this.pixelRatio_),lineDashOffset:(o||yl)*this.pixelRatio_,lineJoin:a!==void 0?a:sa,lineWidth:(l!==void 0?l:El)*this.pixelRatio_,miterLimit:u!==void 0?u:_l,strokeStyle:tr(i||vl)}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}const i=e.getAnchor(),r=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=t[1]*this.pixelRatio_,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation(),this.imageScale_=e.getScaleArray(),this.imageWidth_=t[0]*this.pixelRatio_}setTextStyle(e){if(!e)this.text_="";else{const t=e.getFill();if(!t)this.textFillState_=null;else{const d=t.getColor();this.textFillState_={fillStyle:tr(d||mr)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const d=i.getColor(),p=i.getLineCap(),m=i.getLineDash(),g=i.getLineDashOffset(),v=i.getLineJoin(),y=i.getWidth(),x=i.getMiterLimit();this.textStrokeState_={lineCap:p!==void 0?p:dc,lineDash:m||ml,lineDashOffset:g||yl,lineJoin:v!==void 0?v:sa,lineWidth:y!==void 0?y:El,miterLimit:x!==void 0?x:_l,strokeStyle:tr(d||vl)}}const r=e.getFont(),s=e.getOffsetX(),o=e.getOffsetY(),a=e.getRotateWithView(),l=e.getRotation(),u=e.getScaleArray(),c=e.getText(),h=e.getTextAlign(),f=e.getTextBaseline();this.textState_={font:r!==void 0?r:s0,textAlign:h!==void 0?h:xl,textBaseline:f!==void 0?f:pc},this.text_=c!==void 0?Array.isArray(c)?c.reduce((d,p,m)=>d+=m%2?" ":p,""):c:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*u[0],this.pixelRatio_*u[1]]}}}var yd=mM,Bi={FRACTION:"fraction",PIXELS:"pixels"},ri={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};let Ac=null;class uw extends $s{constructor(e,t,i,r,s,o){super();this.hitDetectionImage_=null,this.image_=e||new Image,r!==null&&(this.image_.crossOrigin=r),this.canvas_={},this.color_=o,this.unlisten_=null,this.imageState_=s,this.size_=i,this.src_=t,this.tainted_}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ye.LOADED){Ac||(Ac=Yt(1,1)),Ac.drawImage(this.image_,0,0);try{Ac.getImageData(0,0,1,1),this.tainted_=!1}catch{Ac=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(re.CHANGE)}handleImageError_(){this.imageState_=ye.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ye.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()}getImage(e){return this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],t=this.size_[1],i=Yt(e,t);i.fillRect(0,0,e,t),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_==ye.IDLE){this.imageState_=ye.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Kf(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==ye.LOADED)return;const t=document.createElement("canvas");this.canvas_[e]=t,t.width=Math.ceil(this.image_.width*e),t.height=Math.ceil(this.image_.height*e);const i=t.getContext("2d");if(i.scale(e,e),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=qm(this.color_),i.fillRect(0,0,t.width/e,t.height/e),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{const r=i.getImageData(0,0,t.width,t.height),s=r.data,o=this.color_[0]/255,a=this.color_[1]/255,l=this.color_[2]/255,u=this.color_[3];for(let c=0,h=s.length;c<h;c+=4)s[c]*=o,s[c+1]*=a,s[c+2]*=l,s[c+3]*=u;i.putImageData(r,0,0)}}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function cw(n,e,t,i,r,s){let o=uc.get(e,i,s);return o||(o=new uw(n,e,t,i,r,s),uc.set(e,i,s,o)),o}var yM=uw;class rx extends N0{constructor(e){const t=e||{},i=t.opacity!==void 0?t.opacity:1,r=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,o=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:i,rotation:r,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:o});this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:ri.TOP_LEFT,this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:Bi.FRACTION,this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:Bi.FRACTION,this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const a=t.img!==void 0?t.img:null;this.imgSize_=t.imgSize;let l=t.src;ce(!(l!==void 0&&a),4),ce(!a||a&&this.imgSize_,5),(l===void 0||l.length===0)&&a&&(l=a.src||oe(a)),ce(l!==void 0&&l.length>0,6);const u=t.src!==void 0?ye.IDLE:ye.LOADED;this.color_=t.color!==void 0?na(t.color):null,this.iconImage_=cw(a,l,this.imgSize_!==void 0?this.imgSize_:null,this.crossOrigin_,u,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:ri.TOP_LEFT,this.origin_=null,this.size_=t.size!==void 0?t.size:null}clone(){const e=this.getScale();return new rx({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(e)?e.slice():e,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;const i=this.getSize();if(this.anchorXUnits_==Bi.FRACTION||this.anchorYUnits_==Bi.FRACTION){if(!i)return null;e=this.anchor_.slice(),this.anchorXUnits_==Bi.FRACTION&&(e[0]*=i[0]),this.anchorYUnits_==Bi.FRACTION&&(e[1]*=i[1])}if(this.anchorOrigin_!=ri.TOP_LEFT){if(!i)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_==ri.TOP_RIGHT||this.anchorOrigin_==ri.BOTTOM_RIGHT)&&(e[0]=-e[0]+i[0]),(this.anchorOrigin_==ri.BOTTOM_LEFT||this.anchorOrigin_==ri.BOTTOM_RIGHT)&&(e[1]=-e[1]+i[1])}this.normalizedAnchor_=e}const t=this.getDisplacement();return[e[0]-t[0],e[1]+t[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!=ri.TOP_LEFT){const t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),(this.offsetOrigin_==ri.TOP_RIGHT||this.offsetOrigin_==ri.BOTTOM_RIGHT)&&(e[0]=i[0]-t[0]-e[0]),(this.offsetOrigin_==ri.BOTTOM_LEFT||this.offsetOrigin_==ri.BOTTOM_RIGHT)&&(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}listenImageChange(e){this.iconImage_.addEventListener(re.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(re.CHANGE,e)}}var _d=rx;const _M="#333";class sx{constructor(e){const t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=Tt(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new xr({color:_M}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:z0.POINT,this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}clone(){const e=this.getScale();return new sx({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRotateWithView(e){this.rotateWithView_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=Tt(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}}var Pc=sx;const _n=.5;function X0(n,e,t,i,r,s,o){const a=n[0]*_n,l=n[1]*_n,u=Yt(a,l);u.imageSmoothingEnabled=!1;const c=u.canvas,h=new yd(u,_n,r,null,o),f=t.length,d=Math.floor((256*256*256-1)/f),p={};for(let g=1;g<=f;++g){const v=t[g-1],y=v.getStyleFunction()||i;if(!i)continue;let x=y(v,s);if(!x)continue;Array.isArray(x)||(x=[x]);const _=g*d,E="#"+("000000"+_.toString(16)).slice(-6);for(let T=0,w=x.length;T<w;++T){const S=x[T],R=S.getGeometryFunction()(v);if(!R||!dt(r,R.getExtent()))continue;const b=S.clone(),I=b.getFill();I&&I.setColor(E);const O=b.getStroke();O&&(O.setColor(E),O.setLineDash(null)),b.setText(void 0);const P=S.getImage();if(P&&P.getOpacity()!==0){const L=P.getImageSize();if(!L)continue;const D=Yt(L[0],L[1],void 0,{alpha:!1}),U=D.canvas;D.fillStyle=E,D.fillRect(0,0,U.width,U.height),b.setImage(new _d({img:U,imgSize:L,anchor:P.getAnchor(),anchorXUnits:Bi.PIXELS,anchorYUnits:Bi.PIXELS,offset:P.getOrigin(),opacity:1,size:P.getSize(),scale:P.getScale(),rotation:P.getRotation(),rotateWithView:P.getRotateWithView()}))}const B=b.getZIndex()||0;let A=p[B];A||(A={},p[B]=A,A[M.POLYGON]=[],A[M.CIRCLE]=[],A[M.LINE_STRING]=[],A[M.POINT]=[]),A[R.getType().replace("Multi","")].push(R,b)}}const m=Object.keys(p).map(Number).sort(Vr);for(let g=0,v=m.length;g<v;++g){const y=p[m[g]];for(const x in y){const _=y[x];for(let E=0,T=_.length;E<T;E+=2){h.setStyle(_[E+1]);for(let w=0,S=e.length;w<S;++w)h.setTransform(e[w]),h.drawGeometry(_[E])}}}return u.getImageData(0,0,c.width,c.height)}function V0(n,e,t){const i=[];if(t){const r=Math.floor(Math.round(n[0])*_n),s=Math.floor(Math.round(n[1])*_n),o=(Ie(r,0,t.width-1)+Ie(s,0,t.height-1)*t.width)*4,a=t.data[o],l=t.data[o+1],c=t.data[o+2]+256*(l+256*a),h=Math.floor((256*256*256-1)/e.length);c&&c%h===0&&i.push(e[c/h-1])}return i}const vM=.5,hw={Point:bM,LineString:wM,Polygon:CM,MultiPoint:IM,MultiLineString:SM,MultiPolygon:RM,GeometryCollection:TM,Circle:xM};function fw(n,e){return parseInt(oe(n),10)-parseInt(oe(e),10)}function vd(n,e){const t=xd(n,e);return t*t}function xd(n,e){return vM*n/e}function xM(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const l=n.getBuilder(t.getZIndex(),Ue.CIRCLE);l.setFillStrokeStyle(s,o),l.drawCircle(e,i)}const a=t.getText();if(a&&a.getText()){const l=(r||n).getBuilder(t.getZIndex(),Ue.TEXT);l.setTextStyle(a),l.drawText(e,i)}}function Mc(n,e,t,i,r,s,o){let a=!1;const l=t.getImage();if(l){let u=l.getImageState();u==ye.LOADED||u==ye.ERROR?l.unlistenImageChange(r):(u==ye.IDLE&&l.load(),u=l.getImageState(),l.listenImageChange(r),a=!0)}return EM(n,e,t,i,s,o),a}function EM(n,e,t,i,r,s){const o=t.getGeometryFunction()(e);if(!o)return;const a=o.simplifyTransformed(i,r);t.getRenderer()?dw(n,a,t,e):hw[a.getType()](n,a,t,e,s)}function dw(n,e,t,i){if(e.getType()==M.GEOMETRY_COLLECTION){const s=e.getGeometries();for(let o=0,a=s.length;o<a;++o)dw(n,s[o],t,i);return}n.getBuilder(t.getZIndex(),Ue.DEFAULT).drawCustom(e,i,t.getRenderer(),t.getHitDetectionRenderer())}function TM(n,e,t,i,r){const s=e.getGeometriesArray();let o,a;for(o=0,a=s.length;o<a;++o)hw[s[o].getType()](n,s[o],t,i,r)}function wM(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),Ue.LINE_STRING);a.setFillStrokeStyle(null,s),a.drawLineString(e,i)}const o=t.getText();if(o&&o.getText()){const a=(r||n).getBuilder(t.getZIndex(),Ue.TEXT);a.setTextStyle(o),a.drawText(e,i)}}function SM(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),Ue.LINE_STRING);a.setFillStrokeStyle(null,s),a.drawMultiLineString(e,i)}const o=t.getText();if(o&&o.getText()){const a=(r||n).getBuilder(t.getZIndex(),Ue.TEXT);a.setTextStyle(o),a.drawText(e,i)}}function RM(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(o||s){const l=n.getBuilder(t.getZIndex(),Ue.POLYGON);l.setFillStrokeStyle(s,o),l.drawMultiPolygon(e,i)}const a=t.getText();if(a&&a.getText()){const l=(r||n).getBuilder(t.getZIndex(),Ue.TEXT);l.setTextStyle(a),l.drawText(e,i)}}function bM(n,e,t,i,r){const s=t.getImage(),o=t.getText();let a;if(r&&(n=r,a=s&&o&&o.getText()?{}:void 0),s){if(s.getImageState()!=ye.LOADED)return;const l=n.getBuilder(t.getZIndex(),Ue.IMAGE);l.setImageStyle(s,a),l.drawPoint(e,i)}if(o&&o.getText()){const l=n.getBuilder(t.getZIndex(),Ue.TEXT);l.setTextStyle(o,a),l.drawText(e,i)}}function IM(n,e,t,i,r){const s=t.getImage(),o=t.getText();let a;if(r&&(n=r,a=s&&o&&o.getText()?{}:void 0),s){if(s.getImageState()!=ye.LOADED)return;const l=n.getBuilder(t.getZIndex(),Ue.IMAGE);l.setImageStyle(s,a),l.drawMultiPoint(e,i)}if(o&&o.getText()){const l=(r||n).getBuilder(t.getZIndex(),Ue.TEXT);l.setTextStyle(o,a),l.drawText(e,i)}}function CM(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const l=n.getBuilder(t.getZIndex(),Ue.POLYGON);l.setFillStrokeStyle(s,o),l.drawPolygon(e,i)}const a=t.getText();if(a&&a.getText()){const l=(r||n).getBuilder(t.getZIndex(),Ue.TEXT);l.setTextStyle(a),l.drawText(e,i)}}class LM extends md{constructor(e){super(e);this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.dirty_=!1,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=wi(),this.wrappedRenderedExtent_=wi(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0}renderWorlds(e,t,i){const r=t.extent,s=t.viewState,o=s.center,a=s.resolution,l=s.projection,u=s.rotation,c=l.getExtent(),h=this.getLayer().getSource(),f=t.pixelRatio,d=t.viewHints,p=!(d[pt.ANIMATING]||d[pt.INTERACTING]),m=this.context,g=Math.round(t.size[0]*f),v=Math.round(t.size[1]*f),y=h.getWrapX()&&l.canWrapX(),x=y?Ae(c):null,_=y?Math.ceil((r[2]-c[2])/x)+1:1;let E=y?Math.floor((r[0]-c[0])/x):0;do{const T=this.getRenderTransform(o,a,u,f,g,v,E*x);e.execute(m,1,T,u,p,void 0,i)}while(++E<_)}renderDeclutter(e){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,e,e.declutterTree)}renderFrame(e,t){const i=e.pixelRatio,r=e.layerStatesArray[e.layerIndex];zx(this.pixelTransform,1/i,1/i),Bo(this.inversePixelTransform,this.pixelTransform);const s=Xu(this.pixelTransform);this.useContainer(t,s,r.opacity,this.getBackground(e));const o=this.context,a=o.canvas,l=this.replayGroup_,u=this.declutterExecutorGroup;if((!l||l.isEmpty())&&(!u||u.isEmpty()))return null;const c=Math.round(e.size[0]*i),h=Math.round(e.size[1]*i);a.width!=c||a.height!=h?(a.width=c,a.height=h,a.style.transform!==s&&(a.style.transform=s)):this.containerReused||o.clearRect(0,0,c,h),this.preRender(o,e);const f=e.viewState,d=f.projection;let p=!1,m=!0;if(r.extent&&this.clipping){const y=pn(r.extent,d);m=dt(y,e.extent),p=m&&!hi(y,e.extent),p&&this.clipUnrotated(o,e,y)}m&&this.renderWorlds(l,e),p&&o.restore(),this.postRender(o,e);const g=r0(r.opacity),v=this.container;return g!==v.style.opacity&&(v.style.opacity=g),this.renderedRotation_!==f.rotation&&(this.renderedRotation_=f.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(e){return new Promise(function(t){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=[this.context.canvas.width,this.context.canvas.height];rt(this.pixelTransform,i);const r=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,u=this.getLayer(),c=[],h=i[0]*_n,f=i[1]*_n;c.push(this.getRenderTransform(r,s,o,_n,h,f,0).slice());const d=u.getSource(),p=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!hi(p,l)){let m=l[0];const g=Ae(p);let v=0,y;for(;m<p[0];)--v,y=g*v,c.push(this.getRenderTransform(r,s,o,_n,h,f,y).slice()),m+=g;for(v=0,m=l[2];m>p[2];)++v,y=g*v,c.push(this.getRenderTransform(r,s,o,_n,h,f,y).slice()),m-=g}this.hitDetectionImageData_=X0(i,c,this.renderedFeatures_,u.getStyleFunction(),l,s,o)}t(V0(e,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))}forEachFeatureAtCoordinate(e,t,i,r,s){if(!this.replayGroup_)return;const o=t.viewState.resolution,a=t.viewState.rotation,l=this.getLayer(),u={},c=function(d,p,m){const g=oe(d),v=u[g];if(v){if(v!==!0&&m<v.distanceSq){if(m===0)return u[g]=!0,s.splice(s.lastIndexOf(v),1),r(d,l,p);v.geometry=p,v.distanceSq=m}}else{if(m===0)return u[g]=!0,r(d,l,p);s.push(u[g]={feature:d,layer:l,geometry:p,distanceSq:m,callback:r})}};let h;const f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some(d=>h=d.forEachFeatureAtCoordinate(e,o,a,i,c,d===this.declutterExecutorGroup&&t.declutterTree?t.declutterTree.all().map(p=>p.value):null)),h}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){const t=this.getLayer(),i=t.getSource();if(!i)return!1;const r=e.viewHints[pt.ANIMATING],s=e.viewHints[pt.INTERACTING],o=t.getUpdateWhileAnimating(),a=t.getUpdateWhileInteracting();if(!this.dirty_&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=e.extent,u=e.viewState,c=u.projection,h=u.resolution,f=e.pixelRatio,d=t.getRevision(),p=t.getRenderBuffer();let m=t.getRenderOrder();m===void 0&&(m=fw);const g=u.center.slice(),v=un(l,p*h),y=v.slice(),x=[v.slice()],_=c.getExtent();if(i.getWrapX()&&c.canWrapX()&&!hi(_,e.extent)){const A=Ae(_),L=Math.max(Ae(v)/2,A);v[0]=_[0]-L,v[2]=_[2]+L,Pf(g,c);const D=_m(x[0],c);D[0]<_[0]&&D[2]<_[2]?x.push([D[0]+A,D[1],D[2]+A,D[3]]):D[0]>_[0]&&D[2]>_[2]&&x.push([D[0]-A,D[1],D[2]-A,D[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==d&&this.renderedRenderOrder_==m&&hi(this.wrappedRenderedExtent_,v))return dr(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;const E=new Cc(xd(h,f),v,h,f);let T;this.getLayer().getDeclutter()&&(T=new Cc(xd(h,f),v,h,f));const w=Zi();let S;if(w){for(let A=0,L=x.length;A<L;++A){const D=x[A],U=Ys(D,c);i.loadFeatures(U,vE(h,c),w)}S=wn(w,c)}else for(let A=0,L=x.length;A<L;++A)i.loadFeatures(x[A],h,c);const R=vd(h,f),b=function(A){let L;const D=A.getStyleFunction()||t.getStyleFunction();if(D&&(L=D(A,h)),L){const U=this.renderFeature(A,R,L,E,S,T);this.dirty_=this.dirty_||U}}.bind(this),I=Ys(v,c),O=i.getFeaturesInExtent(I);m&&O.sort(m);for(let A=0,L=O.length;A<L;++A)b(O[A]);this.renderedFeatures_=O;const P=E.finish(),B=new Oc(v,h,f,i.getOverlaps(),P,t.getRenderBuffer());return T&&(this.declutterExecutorGroup=new Oc(v,h,f,i.getOverlaps(),T.finish(),t.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=d,this.renderedRenderOrder_=m,this.renderedExtent_=y,this.wrappedRenderedExtent_=v,this.renderedCenter_=g,this.renderedProjection_=c,this.replayGroup_=B,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,i,r,s,o){if(!i)return!1;let a=!1;if(Array.isArray(i))for(let l=0,u=i.length;l<u;++l)a=Mc(r,e,i[l],t,this.boundHandleStyleImageChange_,s,o)||a;else a=Mc(r,e,i,t,this.boundHandleStyleImageChange_,s,o);return a}}var W0=LM;class OM extends Cl{constructor(e){super(e)}createRenderer(){return new W0(this)}}var ua=OM;class AM{constructor(e){this.rbush_=new dd(e),this.items_={}}insert(e,t){const i={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(i),this.items_[oe(t)]=i}load(e,t){const i=new Array(t.length);for(let r=0,s=t.length;r<s;r++){const o=e[r],a=t[r],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};i[r]=l,this.items_[oe(a)]=l}this.rbush_.load(i)}remove(e){const t=oe(e),i=this.items_[t];return delete this.items_[t],this.rbush_.remove(i)!==null}update(e,t){const i=this.items_[oe(t)],r=[i.minX,i.minY,i.maxX,i.maxY];Tn(r,e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(t){return t.value})}getInExtent(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(r){return r.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let i;for(let r=0,s=e.length;r<s;r++)if(i=t(e[r]),i)return i;return i}isEmpty(){return Wn(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const t=this.rbush_.toJSON();return hn(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(const t in e.items_)this.items_[t]=e.items_[t]}}var Fc=AM;class PM extends ln{constructor(e){super();this.projection=se(e.projection),this.attributions_=pw(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible!==void 0?e.attributionsCollapsible:!0,this.loading=!1,this.state_=e.state!==void 0?e.state:Ge.READY,this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const t=this;this.viewPromise_=new Promise(function(i,r){t.viewResolver=i,t.viewRejector=r})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(){return fe()}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=pw(e),this.changed()}setState(e){this.state_=e,this.changed()}}function pw(n){return n?Array.isArray(n)?function(e){return n}:typeof n=="function"?n:function(e){return[n]}:null}var Al=PM,si={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function gw(n,e){return[[-1/0,-1/0,1/0,1/0]]}function MM(n,e){return[n]}function FM(n){return function(e,t,i){const r=n.getZForResolution(xE(t,i)),s=n.getTileRangeForExtentAndZ(pn(e,i),r),o=[],a=[r,0,0];for(a[1]=s.minX;a[1]<=s.maxX;++a[1])for(a[2]=s.minY;a[2]<=s.maxY;++a[2])o.push(Ys(n.getTileCoordExtent(a),i));return o}}let mw=!1;function Z0(n,e,t,i,r,s,o){const a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(t,i,r):n,!0),e.getType()==mn.ARRAY_BUFFER&&(a.responseType="arraybuffer"),a.withCredentials=mw,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const u=e.getType();let c;u==mn.JSON||u==mn.TEXT?c=a.responseText:u==mn.XML?(c=a.responseXML,c||(c=new DOMParser().parseFromString(a.responseText,"application/xml"))):u==mn.ARRAY_BUFFER&&(c=a.response),c?s(e.readFeatures(c,{extent:t,featureProjection:r}),e.readProjection(c)):o()}else o()},a.onerror=o,a.send()}function H0(n,e){return function(t,i,r,s,o){const a=this;Z0(n,e,t,i,r,function(l,u){a.addFeatures(l),s!==void 0&&s(l)},o||Fs)}}function NM(n){mw=n}class ts extends ni{constructor(e,t,i){super(e);this.feature=t,this.features=i}}class $M extends Al{constructor(e){const t=e||{};super({attributions:t.attributions,interpolate:!0,projection:void 0,state:Ge.READY,wrapX:t.wrapX!==void 0?t.wrapX:!0});this.on,this.once,this.un,this.loader_=Fs,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(ce(this.format_,7),this.loader_=H0(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:gw;const i=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=i?new Fc:null,this.loadedExtentsRtree_=new Fc,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let r,s;Array.isArray(t.features)?s=t.features:t.features&&(r=t.features,s=r.getArray()),!i&&r===void 0&&(r=new qt(s)),s!==void 0&&this.addFeaturesInternal(s),r!==void 0&&this.bindFeaturesCollection_(r)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const t=oe(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);const i=e.getGeometry();if(i){const r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new ts(si.ADDFEATURE,e))}setupChangeEvents_(e,t){this.featureChangeKeys_[e]=[ge(t,re.CHANGE,this.handleFeatureChange_,this),ge(t,Ps.PROPERTYCHANGE,this.handleFeatureChange_,this)]}addToIndex_(e,t){let i=!0;const r=t.getId();return r!==void 0&&(r.toString()in this.idIndex_?i=!1:this.idIndex_[r.toString()]=t),i&&(ce(!(e in this.uidIndex_),30),this.uidIndex_[e]=t),i}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const t=[],i=[],r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s],l=oe(a);this.addToIndex_(l,a)&&i.push(a)}for(let s=0,o=i.length;s<o;s++){const a=i[s],l=oe(a);this.setupChangeEvents_(l,a);const u=a.getGeometry();if(u){const c=u.getExtent();t.push(c),r.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(si.ADDFEATURE))for(let s=0,o=i.length;s<o;s++)this.dispatchEvent(new ts(si.ADDFEATURE,i[s]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(si.ADDFEATURE,function(i){t||(t=!0,e.push(i.feature),t=!1)}),this.addEventListener(si.REMOVEFEATURE,function(i){t||(t=!0,e.remove(i.feature),t=!1)}),e.addEventListener(Dt.ADD,function(i){t||(t=!0,this.addFeature(i.element),t=!1)}.bind(this)),e.addEventListener(Dt.REMOVE,function(i){t||(t=!0,this.removeFeature(i.element),t=!1)}.bind(this)),this.featuresCollection_=e}clear(e){if(e){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(He);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=function(r){this.removeFeatureInternal(r)}.bind(this);this.featuresRtree_.forEach(i);for(const r in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const t=new ts(si.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){const i=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(i,function(r){if(r.getGeometry().intersectsCoordinate(e))return t(r)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(i){if(i.getGeometry().intersectsExtent(e)){const s=t(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),Wn(this.nullGeometryFeatures_)||qe(e,xf(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const t=[];return this.forEachFeatureAtCoordinateDirect(e,function(i){t.push(i)}),t}getFeaturesInExtent(e){return this.featuresRtree_?this.featuresRtree_.getInExtent(e):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){const i=e[0],r=e[1];let s=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0],u=t||an;return this.featuresRtree_.forEachInExtent(l,function(c){if(u(c)){const h=c.getGeometry(),f=a;if(a=h.closestPointXY(i,r,o,a),a<f){s=c;const d=Math.sqrt(a);l[0]=i-d,l[1]=r-d,l[2]=i+d,l[3]=r+d}}}),s}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){const t=this.idIndex_[e.toString()];return t!==void 0?t:null}getFeatureByUid(e){const t=this.uidIndex_[e];return t!==void 0?t:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){const t=e.target,i=oe(t),r=t.getGeometry();if(!r)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[i]=t);else{const o=r.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,t)):this.featuresRtree_&&this.featuresRtree_.update(o,t)}const s=t.getId();if(s!==void 0){const o=s.toString();this.idIndex_[o]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[o]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[i]=t;this.changed(),this.dispatchEvent(new ts(si.CHANGEFEATURE,t))}hasFeature(e){const t=e.getId();return t!==void 0?t in this.idIndex_:oe(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Wn(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,t,i){const r=this.loadedExtentsRtree_,s=this.strategy_(e,t,i);for(let o=0,a=s.length;o<a;++o){const l=s[o];r.forEachInExtent(l,function(c){return hi(c.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new ts(si.FEATURESLOADSTART)),this.loader_.call(this,l,t,i,function(c){--this.loadingExtentsCount_,this.dispatchEvent(new ts(si.FEATURESLOADEND,void 0,c))}.bind(this),function(){--this.loadingExtentsCount_,this.dispatchEvent(new ts(si.FEATURESLOADERROR))}.bind(this)),r.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const t=this.loadedExtentsRtree_;let i;t.forEachInExtent(e,function(r){if(Tn(r.extent,e))return i=r,!0}),i&&t.remove(i)}removeFeature(e){if(!e)return;const t=oe(e);t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){const t=oe(e),i=this.featureChangeKeys_[t];if(!i)return;i.forEach(He),delete this.featureChangeKeys_[t];const r=e.getId();return r!==void 0&&delete this.idIndex_[r.toString()],delete this.uidIndex_[t],this.dispatchEvent(new ts(si.REMOVEFEATURE,e)),e}removeFromIdIndex_(e){let t=!1;for(const i in this.idIndex_)if(this.idIndex_[i]===e){delete this.idIndex_[i],t=!0;break}return t}setLoader(e){this.loader_=e}setUrl(e){ce(this.format_,7),this.url_=e,this.setLoader(H0(e,this.format_))}}var ca=$M;const Je={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},Ed={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class Nc extends ni{constructor(e,t){super(e);this.feature=t}}class DM extends Fn{constructor(e){const t=e;t.stopDown||(t.stopDown=Ms);super(t);this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=zM(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_===Je.POLYGON?3:2,this.maxPoints_=this.mode_===Je.CIRCLE?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:an;let i=e.geometryFunction;if(!i){const r=this.mode_;if(r===Je.CIRCLE)i=function(s,o,a){const l=o||new A0([NaN,NaN]),u=ut(s[0],a),c=fn(u,ut(s[s.length-1],a));l.setCenterAndRadius(u,Math.sqrt(c));const h=Zi();return h&&l.transform(a,h),l};else{let s;r===Je.POINT?s=Et:r===Je.LINE_STRING?s=Gt:r===Je.POLYGON&&(s=pi),i=function(o,a,l){return a?r===Je.POLYGON?o[0].length?a.setCoordinates([o[0].concat([o[0][0]])]):a.setCoordinates([]):a.setCoordinates(o):a=new s(o),a}}}this.geometryFunction_=i,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new ua({source:new ca({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:kM(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:ad,this.freehandCondition_,e.freehand?this.freehandCondition_=Sl:this.freehandCondition_=e.freehandCondition?e.freehandCondition:xc,this.addChangeListener(vc.ACTIVE,this.updateState_)}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===re.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Je.POINT&&this.freehandCondition_(e);let t=e.type===Pe.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&e.type===Pe.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===Pe.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===Pe.POINTERDOWN?i=!1:t&&this.getPointerCount()<2?(i=e.type===Pe.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===Pe.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===Pe.DBLCLICK&&(i=!1),super.handleEvent(e)&&i}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Qn(Pe.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e),this.shouldHandle_){const i=!this.finishCoordinate_;i&&this.startDrawing_(e.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===Je.POINT)&&(this.atFinish_(e.pixel)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing();return!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const t=this.downPx_,i=e.pixel,r=t[0]-i[0],s=t[1]-i[1],o=r*r+s*s;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(e.coordinate):this.createOrUpdateSketchPoint_(e.coordinate.slice())}atFinish_(e){let t=!1;if(this.sketchFeature_){let i=!1,r=[this.finishCoordinate_];const s=this.mode_;if(s===Je.POINT)t=!0;else if(s===Je.CIRCLE)t=this.sketchCoords_.length===2;else if(s===Je.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(s===Je.POLYGON){const o=this.sketchCoords_;i=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(i){const o=this.getMap();for(let a=0,l=r.length;a<l;a++){const u=r[a],c=o.getPixelFromCoordinate(u),h=e[0]-c[0],f=e[1]-c[1],d=this.freehand_?1:this.snapTolerance_;if(t=Math.sqrt(h*h+f*f)<=d,t){this.finishCoordinate_=u;break}}}}return t}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new lt(new Et(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new lt);const t=e.getLinearRing(0);let i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),i.changed()):(i=new Gt(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(i))}startDrawing_(e){const t=this.getMap().getView().getProjection();this.finishCoordinate_=e,this.mode_===Je.POINT?this.sketchCoords_=e.slice():this.mode_===Je.POLYGON?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new lt(new Gt(this.sketchLineCoords_)));const i=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new lt,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Nc(Ed.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const t=this.getMap(),i=this.sketchFeature_.getGeometry(),r=t.getView().getProjection();let s,o;this.mode_===Je.POINT?o=this.sketchCoords_:this.mode_===Je.POLYGON?(s=this.sketchCoords_[0],o=s[s.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(s=this.sketchCoords_,o=s[s.length-1]),o[0]=e[0],o[1]=e[1],this.geometryFunction_(this.sketchCoords_,i,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),i.getType()===M.POLYGON&&this.mode_!==Je.POLYGON?this.createOrUpdateCustomSketchLine_(i):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();let r,s;const o=this.mode_;o===Je.LINE_STRING||o===Je.CIRCLE?(this.finishCoordinate_=e.slice(),s=this.sketchCoords_,s.length>=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),this.geometryFunction_(s,t,i)):o===Je.POLYGON&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),r&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,t,i)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r&&this.finishDrawing()}removeLastPoint(){if(!this.sketchFeature_)return;const e=this.sketchFeature_.getGeometry(),t=this.getMap().getView().getProjection();let i;const r=this.mode_;if(r===Je.LINE_STRING||r===Je.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();const s=this.finishCoordinate_.slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}this.geometryFunction_(i,e,t),e.getType()===M.POLYGON&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===Je.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);const s=this.sketchLine_.getGeometry();if(i.length>=2){const o=i[i.length-2].slice();i[i.length-1]=o,this.createOrUpdateSketchPoint_(o)}s.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,e,t)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}finishDrawing(){const e=this.abortDrawing_();if(!e)return;let t=this.sketchCoords_;const i=e.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===Je.LINE_STRING?(t.pop(),this.geometryFunction_(t,i,r)):this.mode_===Je.POLYGON&&(t[0].pop(),this.geometryFunction_(t,i,r),t=i.getCoordinates()),this.type_===M.MULTI_POINT?e.setGeometry(new Nn([t])):this.type_===M.MULTI_LINE_STRING?e.setGeometry(new yn([t])):this.type_===M.MULTI_POLYGON&&e.setGeometry(new $n([t])),this.dispatchEvent(new Nc(Ed.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e)}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new Nc(Ed.DRAWABORT,e))}appendCoordinates(e){const t=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(e[0]);let r;if(t===Je.LINE_STRING||t===Je.CIRCLE)r=this.sketchCoords_;else if(t===Je.POLYGON)r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&r.shift(),r.pop();for(let o=0;o<e.length;o++)this.addToDrawing_(e[o]);const s=e[e.length-1];this.addToDrawing_(s),this.modifyDrawing_(s)}extend(e){const i=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=i.getCoordinates();const r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new lt(new Et(r)),this.updateSketchFeatures_(),this.dispatchEvent(new Nc(Ed.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){const e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}}function kM(){const n=Il();return function(e,t){return n[e.getGeometry().getType()]}}function GM(n,e){return function(t,i,r){const s=ut(t[0],r),o=ut(t[t.length-1],r),a=Math.sqrt(fn(s,o)),l=i||sc(new A0(s),n);let u=e;if(!e&&e!==0){const h=o[0]-s[0],f=o[1]-s[1];u=Math.atan2(f,h)}Zm(l,s,a,u);const c=Zi();return c&&l.transform(r,c),l}}function UM(){return function(n,e,t){const i=Lt([n[0],n[n.length-1]].map(function(a){return ut(a,t)})),r=[[Xo(i),Vo(i),al(i),An(i),Xo(i)]];let s=e;s?s.setCoordinates(r):s=new pi(r);const o=Zi();return o&&s.transform(t,o),s}}function zM(n){switch(n){case M.POINT:case M.MULTI_POINT:return Je.POINT;case M.LINE_STRING:case M.MULTI_LINE_STRING:return Je.LINE_STRING;case M.POLYGON:case M.MULTI_POLYGON:return Je.POLYGON;case M.CIRCLE:return Je.CIRCLE;default:throw new Error("Invalid type: "+n)}}var BM=DM;const jM={EXTENTCHANGED:"extentchanged"};class yw extends ni{constructor(e){super(jM.EXTENTCHANGED);this.extent=e}}class YM extends Fn{constructor(e){const t=e||{};super(t);this.on,this.once,this.un,this.condition_=t.condition?t.condition:Sl,this.extent_=null,this.pointerHandler_=null,this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.snappedToVertex_=!1,this.extentFeature_=null,this.vertexFeature_=null,e||(e={}),this.extentOverlay_=new ua({source:new ca({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:XM(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.vertexOverlay_=new ua({source:new ca({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:VM(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&this.setExtent(e.extent)}snapToVertex_(e,t){const i=t.getCoordinateFromPixelInternal(e),r=function(o,a){return Ju(i,o)-Ju(i,a)},s=this.getExtentInternal();if(s){const o=WM(s);o.sort(r);const a=o[0];let l=Hu(i,a);const u=t.getPixelFromCoordinateInternal(l);if(qu(e,u)<=this.pixelTolerance_){const c=t.getPixelFromCoordinateInternal(a[0]),h=t.getPixelFromCoordinateInternal(a[1]),f=fn(u,c),d=fn(u,h),p=Math.sqrt(Math.min(f,d));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(l=f>d?a[1]:a[0]),l}}return null}handlePointerMove_(e){const t=e.pixel,i=e.map;let r=this.snapToVertex_(t,i);r||(r=i.getCoordinateFromPixelInternal(t)),this.createOrUpdatePointerFeature_(r)}createOrUpdateExtentFeature_(e){let t=this.extentFeature_;return t?e?t.setGeometry(ea(e)):t.setGeometry(void 0):(e?t=new lt(ea(e)):t=new lt({}),this.extentFeature_=t,this.extentOverlay_.getSource().addFeature(t)),t}createOrUpdatePointerFeature_(e){let t=this.vertexFeature_;return t?t.getGeometry().setCoordinates(e):(t=new lt(new Et(e)),this.vertexFeature_=t,this.vertexOverlay_.getSource().addFeature(t)),t}handleEvent(e){return!e.originalEvent||!this.condition_(e)?!0:(e.type==Pe.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),super.handleEvent(e),!1)}handleDownEvent(e){const t=e.pixel,i=e.map,r=this.getExtentInternal();let s=this.snapToVertex_(t,i);const o=function(a){let l=null,u=null;return a[0]==r[0]?l=r[2]:a[0]==r[2]&&(l=r[0]),a[1]==r[1]?u=r[3]:a[1]==r[3]&&(u=r[1]),l!==null&&u!==null?[l,u]:null};if(s&&r){const a=s[0]==r[0]||s[0]==r[2]?s[0]:null,l=s[1]==r[1]||s[1]==r[3]?s[1]:null;a!==null&&l!==null?this.pointerHandler_=_w(o(s)):a!==null?this.pointerHandler_=vw(o([a,r[1]]),o([a,r[3]])):l!==null&&(this.pointerHandler_=vw(o([r[0],l]),o([r[2],l])))}else s=i.getCoordinateFromPixelInternal(t),this.setExtent([s[0],s[1],s[0],s[1]]),this.pointerHandler_=_w(s);return!0}handleDragEvent(e){if(this.pointerHandler_){const t=e.coordinate;this.setExtent(this.pointerHandler_(t)),this.createOrUpdatePointerFeature_(t)}}handleUpEvent(e){this.pointerHandler_=null;const t=this.getExtentInternal();return(!t||ol(t)===0)&&this.setExtent(null),!1}setMap(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),super.setMap(e)}getExtent(){return Ys(this.getExtentInternal(),this.getMap().getView().getProjection())}getExtentInternal(){return this.extent_}setExtent(e){this.extent_=e||null,this.createOrUpdateExtentFeature_(e),this.dispatchEvent(new yw(this.extent_))}}function XM(){const n=Il();return function(e,t){return n[M.POLYGON]}}function VM(){const n=Il();return function(e,t){return n[M.POINT]}}function _w(n){return function(e){return Lt([n,e])}}function vw(n,e){return n[0]==e[0]?function(t){return Lt([n,[t[0],e[1]]])}:n[1]==e[1]?function(t){return Lt([n,[e[0],t[1]]])}:null}function WM(n){return[[[n[0],n[1]],[n[0],n[3]]],[[n[0],n[3]],[n[2],n[3]]],[[n[2],n[3]],[n[2],n[1]]],[[n[2],n[1]],[n[0],n[1]]]]}var ZM=YM;const xw=0,$c=1,Ew=[0,0,0,0],Pl=[],K0={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class Td extends ni{constructor(e,t,i){super(e);this.features=t,this.mapBrowserEvent=i}}class HM extends Fn{constructor(e){super(e);this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:O0,this.defaultDeleteCondition_=function(i){return PT(i)&&C0(i)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Sl,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new Fc,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new ua({source:new ca({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:qM(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new qt(this.source_.getFeatures()),this.source_.addEventListener(si.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(si.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(Dt.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(Dt.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}addFeature_(e){const t=e.getGeometry();if(t){const r=this.SEGMENT_WRITERS_[t.getType()];r&&r(e,t)}const i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),e.addEventListener(re.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new qt;const i=this.featuresBeingModified_.getArray();for(let r=0,s=t.length;r<s;++r){const o=t[r];for(let a=0,l=o.length;a<l;++a){const u=o[a].feature;u&&i.indexOf(u)===-1&&this.featuresBeingModified_.push(u)}}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new Td(K0.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(re.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(e){const t=this.rBush_,i=[];t.forEach(function(r){e===r.feature&&i.push(r)});for(let r=i.length-1;r>=0;--r){const s=i[r];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===s&&this.dragSegments_.splice(o,1);t.remove(s)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){const t=e.element;this.removeFeature_(t)}writePointGeometry_(e,t){const i=t.getCoordinates(),r={feature:e,geometry:t,segment:[i,i]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length-1;r<s;++r){const o=i.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:o};this.rBush_.insert(Lt(o),a)}}writeMultiLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const u=o.slice(a,a+2),c={feature:e,geometry:t,depth:[r],index:a,segment:u};this.rBush_.insert(Lt(u),c)}}}writePolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const u=o.slice(a,a+2),c={feature:e,geometry:t,depth:[r],index:a,segment:u};this.rBush_.insert(Lt(u),c)}}}writeMultiPolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length;a<l;++a){const u=o[a];for(let c=0,h=u.length-1;c<h;++c){const f=u.slice(c,c+2),d={feature:e,geometry:t,depth:[a,r],index:c,segment:f};this.rBush_.insert(Lt(f),d)}}}}writeCircleGeometry_(e,t){const i=t.getCenter(),r={feature:e,geometry:t,index:xw,segment:[i,i]},s={feature:e,geometry:t,index:$c,segment:[i,i]},o=[r,s];r.featureSegments=o,s.featureSegments=o,this.rBush_.insert(jo(i),r);let a=t;const l=Zi();if(l&&this.getMap()){const u=this.getMap().getView().getProjection();a=a.clone().transform(l,u),a=sc(a).transform(u,l)}this.rBush_.insert(a.getExtent(),s)}writeGeometryCollectionGeometry_(e,t){const i=t.getGeometriesArray();for(let r=0;r<i.length;++r){const s=i[r];this.SEGMENT_WRITERS_[s.getType()](e,s)}}createOrUpdateVertexFeature_(e,t,i){let r=this.vertexFeature_;return r?r.getGeometry().setCoordinates(e):(r=new lt(new Et(e)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r)),r.set("features",t),r.set("geometries",i),r}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==Pe.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(e.type!=Pe.SINGLECLICK||!this.ignoreNextSingleClick_?t=this.removePoint():t=!0),e.type==Pe.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_);const t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],i=[],r=[];for(let s=0,o=this.dragSegments_.length;s<o;++s){const a=this.dragSegments_[s],l=a[0],u=l.feature;i.indexOf(u)===-1&&i.push(u);const c=l.geometry;r.indexOf(c)===-1&&r.push(c);const h=l.depth;let f;const d=l.segment,p=a[1];for(;t.length<c.getStride();)t.push(d[p][t.length]);switch(c.getType()){case M.POINT:f=t,d[0]=t,d[1]=t;break;case M.MULTI_POINT:f=c.getCoordinates(),f[l.index]=t,d[0]=t,d[1]=t;break;case M.LINE_STRING:f=c.getCoordinates(),f[l.index+p]=t,d[p]=t;break;case M.MULTI_LINE_STRING:f=c.getCoordinates(),f[h[0]][l.index+p]=t,d[p]=t;break;case M.POLYGON:f=c.getCoordinates(),f[h[0]][l.index+p]=t,d[p]=t;break;case M.MULTI_POLYGON:f=c.getCoordinates(),f[h[1]][h[0]][l.index+p]=t,d[p]=t;break;case M.CIRCLE:if(d[0]=t,d[1]=t,l.index===xw)this.changingFeature_=!0,c.setCenter(t),this.changingFeature_=!1;else{this.changingFeature_=!0;const m=e.map.getView().getProjection();let g=qu(ut(c.getCenter(),m),ut(t,m));const v=Zi();if(v){const y=c.clone().transform(v,m);y.setRadius(g),g=y.transform(m,v).getRadius()}c.setRadius(g),this.changingFeature_=!1}break}f&&this.setGeometryCoordinates_(c,f)}this.createOrUpdateVertexFeature_(t,i,r)}handleDownEvent(e){if(!this.condition_(e))return!1;const t=e.coordinate;this.handlePointerAtPixel_(e.pixel,e.map,t),this.dragSegments_.length=0,this.featuresBeingModified_=null;const i=this.vertexFeature_;if(i){const r=e.map.getView().getProjection(),s=[],o=i.getGeometry().getCoordinates(),a=Lt([o]),l=this.rBush_.getInExtent(a),u={};l.sort(KM);for(let c=0,h=l.length;c<h;++c){const f=l[c],d=f.segment;let p=oe(f.geometry);const m=f.depth;if(m&&(p+="-"+m.join("-")),u[p]||(u[p]=new Array(2)),f.geometry.getType()===M.CIRCLE&&f.index===$c){const g=ww(t,f,r);Mn(g,o)&&!u[p][0]&&(this.dragSegments_.push([f,0]),u[p][0]=f);continue}if(Mn(d[0],o)&&!u[p][0]){this.dragSegments_.push([f,0]),u[p][0]=f;continue}if(Mn(d[1],o)&&!u[p][1]){if((f.geometry.getType()===M.LINE_STRING||f.geometry.getType()===M.MULTI_LINE_STRING)&&u[p][0]&&u[p][0].index===0)continue;this.dragSegments_.push([f,1]),u[p][1]=f;continue}oe(d)in this.vertexSegments_&&!u[p][0]&&!u[p][1]&&this.insertVertexCondition_(e)&&s.push(f)}s.length&&this.willModifyFeatures_(e,[s]);for(let c=s.length-1;c>=0;--c)this.insertVertex_(s[c],o)}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const i=this.dragSegments_[t][0],r=i.geometry;if(r.getType()===M.CIRCLE){const s=r.getCenter(),o=i.featureSegments[0],a=i.featureSegments[1];o.segment[0]=s,o.segment[1]=s,a.segment[0]=s,a.segment[1]=s,this.rBush_.update(jo(s),o);let l=r;const u=Zi();if(u){const c=e.map.getView().getProjection();l=l.clone().transform(u,c),l=sc(l).transform(c,u)}this.rBush_.update(l.getExtent(),a)}else this.rBush_.update(Lt(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Td(K0.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.pixel,e.map,e.coordinate)}handlePointerAtPixel_(e,t,i){const r=i||t.getCoordinateFromPixel(e),s=t.getView().getProjection(),o=function(u,c){return Tw(r,u,s)-Tw(r,c,s)};let a,l;if(this.hitDetection_){const u=typeof this.hitDetection_=="object"?c=>c===this.hitDetection_:void 0;t.forEachFeatureAtPixel(e,(c,h,f)=>{if(f=f||c.getGeometry(),f.getType()===M.POINT&&Ye(this.features_.getArray(),c)){l=f;const d=f.getFlatCoordinates().slice(0,2);a=[{feature:c,geometry:f,segment:[d,d]}]}return!0},{layerFilter:u})}if(!a){const u=pn(jo(r,Ew),s),c=t.getView().getResolution()*this.pixelTolerance_,h=Ys(un(u,c,Ew),s);a=this.rBush_.getInExtent(h)}if(a&&a.length>0){const u=a.sort(o)[0],c=u.segment;let h=ww(r,u,s);const f=t.getPixelFromCoordinate(h);let d=qu(e,f);if(l||d<=this.pixelTolerance_){const p={};if(p[oe(c)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-r[0],this.delta_[1]=h[1]-r[1]),u.geometry.getType()===M.CIRCLE&&u.index===$c)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[u.feature],[u.geometry]);else{const m=t.getPixelFromCoordinate(c[0]),g=t.getPixelFromCoordinate(c[1]),v=fn(f,m),y=fn(f,g);d=Math.sqrt(Math.min(v,y)),this.snappedToVertex_=d<=this.pixelTolerance_,this.snappedToVertex_&&(h=v>y?c[1]:c[0]),this.createOrUpdateVertexFeature_(h,[u.feature],[u.geometry]);const x={};x[oe(u.geometry)]=!0;for(let _=1,E=a.length;_<E;++_){const T=a[_].segment;if(Mn(c[0],T[0])&&Mn(c[1],T[1])||Mn(c[0],T[1])&&Mn(c[1],T[0])){const w=oe(a[_].geometry);w in x||(x[w]=!0,p[oe(T)]=!0)}else break}}this.vertexSegments_=p;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(e,t){const i=e.segment,r=e.feature,s=e.geometry,o=e.depth,a=e.index;let l;for(;t.length<s.getStride();)t.push(0);switch(s.getType()){case M.MULTI_LINE_STRING:l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case M.POLYGON:l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case M.MULTI_POLYGON:l=s.getCoordinates(),l[o[1]][o[0]].splice(a+1,0,t);break;case M.LINE_STRING:l=s.getCoordinates(),l.splice(a+1,0,t);break;default:return}this.setGeometryCoordinates_(s,l);const u=this.rBush_;u.remove(e),this.updateSegmentIndices_(s,a,o,1);const c={segment:[i[0],t],feature:r,geometry:s,depth:o,index:a};u.insert(Lt(c.segment),c),this.dragSegments_.push([c,1]);const h={segment:[t,i[1]],feature:r,geometry:s,depth:o,index:a+1};u.insert(Lt(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0}removePoint(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Pe.POINTERDRAG){const e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_);const t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new Td(K0.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,t}return!1}removeVertex_(){const e=this.dragSegments_,t={};let i=!1,r,s,o,a,l,u,c,h,f,d,p;for(l=e.length-1;l>=0;--l)o=e[l],d=o[0],p=oe(d.feature),d.depth&&(p+="-"+d.depth.join("-")),p in t||(t[p]={}),o[1]===0?(t[p].right=d,t[p].index=d.index):o[1]==1&&(t[p].left=d,t[p].index=d.index+1);for(p in t){switch(f=t[p].right,c=t[p].left,u=t[p].index,h=u-1,c!==void 0?d=c:d=f,h<0&&(h=0),a=d.geometry,s=a.getCoordinates(),r=s,i=!1,a.getType()){case M.MULTI_LINE_STRING:s[d.depth[0]].length>2&&(s[d.depth[0]].splice(u,1),i=!0);break;case M.LINE_STRING:s.length>2&&(s.splice(u,1),i=!0);break;case M.MULTI_POLYGON:r=r[d.depth[1]];case M.POLYGON:r=r[d.depth[0]],r.length>4&&(u==r.length-1&&(u=0),r.splice(u,1),i=!0,u===0&&(r.pop(),r.push(r[0]),h=r.length-1));break}if(i){this.setGeometryCoordinates_(a,s);const m=[];if(c!==void 0&&(this.rBush_.remove(c),m.push(c.segment[0])),f!==void 0&&(this.rBush_.remove(f),m.push(f.segment[1])),c!==void 0&&f!==void 0){const g={depth:d.depth,feature:d.feature,geometry:d.geometry,index:h,segment:m};this.rBush_.insert(Lt(g.segment),g)}this.updateSegmentIndices_(a,u,d.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return i}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,i,r){this.rBush_.forEachInExtent(e.getExtent(),function(s){s.geometry===e&&(i===void 0||s.depth===void 0||dr(s.depth,i))&&s.index>t&&(s.index+=r)})}}function KM(n,e){return n.index-e.index}function Tw(n,e,t){const i=e.geometry;if(i.getType()===M.CIRCLE){let s=i;if(e.index===$c){const o=Zi();o&&(s=s.clone().transform(o,t));const a=fn(s.getCenter(),ut(n,t)),l=Math.sqrt(a)-s.getRadius();return l*l}}const r=ut(n,t);return Pl[0]=ut(e.segment[0],t),Pl[1]=ut(e.segment[1],t),Ju(r,Pl)}function ww(n,e,t){const i=e.geometry;if(i.getType()===M.CIRCLE&&e.index===$c){let s=i;const o=Zi();return o&&(s=s.clone().transform(o,t)),Hr(s.getClosestPoint(ut(n,t)),t)}const r=ut(n,t);return Pl[0]=ut(e.segment[0],t),Pl[1]=ut(e.segment[1],t),Hr(Hu(r,Pl),t)}function qM(){const n=Il();return function(e,t){return n[M.POINT]}}var JM=HM;const QM={SELECT:"select"};class Sw extends ni{constructor(e,t,i,r){super(e);this.selected=t,this.deselected=i,this.mapBrowserEvent=r}}const wd={};class ox extends Ks{constructor(e){super();this.on,this.once,this.un;const t=e||{};this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=t.condition?t.condition:C0,this.addCondition_=t.addCondition?t.addCondition:I0,this.removeCondition_=t.removeCondition?t.removeCondition:I0,this.toggleCondition_=t.toggleCondition?t.toggleCondition:xc,this.multi_=t.multi?t.multi:!1,this.filter_=t.filter?t.filter:an,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.style_=t.style!==void 0?t.style:eF(),this.features_=t.features||new qt;let i;if(t.layers)if(typeof t.layers=="function")i=t.layers;else{const r=t.layers;i=function(s){return Ye(r,s)}}else i=an;this.layerFilter_=i,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[oe(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[oe(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(Dt.ADD,this.boundAddFeature_),this.features_.addEventListener(Dt.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(Dt.ADD,this.boundAddFeature_),this.features_.removeEventListener(Dt.REMOVE,this.boundRemoveFeature_))}addFeature_(e){const t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){const i=this.getMap().getAllLayers().find(function(r){if(r instanceof ua&&r.getSource()&&r.getSource().hasFeature(t))return r});i&&this.addFeatureLayerAssociation_(t,i)}}removeFeature_(e){const t=e.element;this.style_&&this.restorePreviousStyle_(t)}getStyle(){return this.style_}applySelectedStyle_(e){const t=oe(e);t in wd||(wd[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(e){const t=this.getMap().getInteractions().getArray();for(let r=t.length-1;r>=0;--r){const s=t[r];if(s!==this&&s instanceof ox&&s.getStyle()&&s.getFeatures().getArray().lastIndexOf(e)!==-1){e.setStyle(s.getStyle());return}}const i=oe(e);e.setStyle(wd[i]),delete wd[i]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[oe(e)]}handleEvent(e){if(!this.condition_(e))return!0;const t=this.addCondition_(e),i=this.removeCondition_(e),r=this.toggleCondition_(e),s=!t&&!i&&!r,o=e.map,a=this.getFeatures(),l=[],u=[];if(s){Ns(this.featureLayerAssociation_),o.forEachFeatureAtPixel(e.pixel,function(c,h){if(this.filter_(c,h))return this.addFeatureLayerAssociation_(c,h),u.push(c),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let c=a.getLength()-1;c>=0;--c){const h=a.item(c),f=u.indexOf(h);f>-1?u.splice(f,1):(a.remove(h),l.push(h))}u.length!==0&&a.extend(u)}else{o.forEachFeatureAtPixel(e.pixel,function(c,h){if(this.filter_(c,h))return(t||r)&&!Ye(a.getArray(),c)?(this.addFeatureLayerAssociation_(c,h),u.push(c)):(i||r)&&Ye(a.getArray(),c)&&(l.push(c),this.removeFeatureLayerAssociation_(c)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let c=l.length-1;c>=0;--c)a.remove(l[c]);a.extend(u)}return(u.length>0||l.length>0)&&this.dispatchEvent(new Sw(QM.SELECT,u,l,e)),!0}}function eF(){const n=Il();return qe(n[M.POLYGON],n[M.LINE_STRING]),qe(n[M.GEOMETRY_COLLECTION],n[M.LINE_STRING]),function(e){return e.getGeometry()?n[e.getGeometry().getType()]:null}}var tF=ox;function Rw(n){if(n.feature)return n.feature;if(n.element)return n.element}const Ml=[];class iF extends Fn{constructor(e){const t=e||{},i=t;i.handleDownEvent||(i.handleDownEvent=an),i.stopDown||(i.stopDown=Ms);super(i);this.source_=t.source?t.source:null,this.vertex_=t.vertex!==void 0?t.vertex:!0,this.edge_=t.edge!==void 0?t.edge:!0,this.features_=t.features?t.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.rBush_=new Fc,this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this)}}addFeature(e,t){const i=t!==void 0?t:!0,r=oe(e),s=e.getGeometry();if(s){const o=this.SEGMENT_WRITERS_[s.getType()];o&&(this.indexedFeaturesExtents_[r]=s.getExtent(wi()),o(e,s))}i&&(this.featureChangeListenerKeys_[r]=ge(e,re.CHANGE,this.handleFeatureChange_,this))}forEachFeatureAdd_(e){this.addFeature(e)}forEachFeatureRemove_(e){this.removeFeature(e)}getFeatures_(){let e;return this.features_?e=this.features_:this.source_&&(e=this.source_.getFeatures()),e}handleEvent(e){const t=this.snapTo(e.pixel,e.coordinate,e.map);return t.snapped&&(e.coordinate=t.vertex.slice(0,2),e.pixel=t.vertexPixel),super.handleEvent(e)}handleFeatureAdd_(e){const t=Rw(e);this.addFeature(t)}handleFeatureRemove_(e){const t=Rw(e);this.removeFeature(t)}handleFeatureChange_(e){const t=e.target;if(this.handlingDownUpSequence){const i=oe(t);i in this.pendingFeatures_||(this.pendingFeatures_[i]=t)}else this.updateFeature_(t)}handleUpEvent(e){const t=xf(this.pendingFeatures_);return t.length&&(t.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1}removeFeature(e,t){const i=t!==void 0?t:!0,r=oe(e),s=this.indexedFeaturesExtents_[r];if(s){const o=this.rBush_,a=[];o.forEachInExtent(s,function(l){e===l.feature&&a.push(l)});for(let l=a.length-1;l>=0;--l)o.remove(a[l])}i&&(He(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])}setMap(e){const t=this.getMap(),i=this.featuresListenerKeys_,r=this.getFeatures_();t&&(i.forEach(He),i.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),super.setMap(e),e&&(this.features_?i.push(ge(this.features_,Dt.ADD,this.handleFeatureAdd_,this),ge(this.features_,Dt.REMOVE,this.handleFeatureRemove_,this)):this.source_&&i.push(ge(this.source_,si.ADDFEATURE,this.handleFeatureAdd_,this),ge(this.source_,si.REMOVEFEATURE,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))}snapTo(e,t,i){const r=i.getCoordinateFromPixel([e[0]-this.pixelTolerance_,e[1]+this.pixelTolerance_]),s=i.getCoordinateFromPixel([e[0]+this.pixelTolerance_,e[1]-this.pixelTolerance_]),o=Lt([r,s]);let a=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(a=a.filter(function(g){return g.feature.getGeometry().getType()!==M.CIRCLE}));let l=!1,u=null,c=null;if(a.length===0)return{snapped:l,vertex:u,vertexPixel:c};const h=i.getView().getProjection(),f=ut(t,h);let d,p=1/0;for(let g=0;g<a.length;++g){const v=a[g];Ml[0]=ut(v.segment[0],h),Ml[1]=ut(v.segment[1],h);const y=Ju(f,Ml);y<p&&(d=v,p=y)}const m=d.segment;if(this.vertex_&&!this.edge_){const g=i.getPixelFromCoordinate(m[0]),v=i.getPixelFromCoordinate(m[1]),y=fn(e,g),x=fn(e,v);Math.sqrt(Math.min(y,x))<=this.pixelTolerance_&&(l=!0,u=y>x?m[1]:m[0],c=i.getPixelFromCoordinate(u))}else if(this.edge_){const g=d.feature.getGeometry().getType()===M.CIRCLE;if(g){let v=d.feature.getGeometry();const y=Zi();y&&(v=v.clone().transform(y,h)),u=Hr(uE(f,v),h)}else Ml[0]=ut(m[0],h),Ml[1]=ut(m[1],h),u=Hr(Hu(f,Ml),h);if(c=i.getPixelFromCoordinate(u),qu(e,c)<=this.pixelTolerance_&&(l=!0,this.vertex_&&!g)){const v=i.getPixelFromCoordinate(m[0]),y=i.getPixelFromCoordinate(m[1]),x=fn(c,v),_=fn(c,y);Math.sqrt(Math.min(x,_))<=this.pixelTolerance_&&(u=x>_?m[1]:m[0],c=i.getPixelFromCoordinate(u))}}return l&&(c=[Math.round(c[0]),Math.round(c[1])]),{snapped:l,vertex:u,vertexPixel:c}}updateFeature_(e){this.removeFeature(e,!1),this.addFeature(e,!1)}writeCircleGeometry_(e,t){const i=this.getMap().getView().getProjection();let r=t;const s=Zi();s&&(r=r.clone().transform(s,i));const o=sc(r);s&&o.transform(i,s);const a=o.getCoordinates()[0];for(let l=0,u=a.length-1;l<u;++l){const c=a.slice(l,l+2),h={feature:e,segment:c};this.rBush_.insert(Lt(c),h)}}writeGeometryCollectionGeometry_(e,t){const i=t.getGeometriesArray();for(let r=0;r<i.length;++r){const s=this.SEGMENT_WRITERS_[i[r].getType()];s&&s(e,i[r])}}writeLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length-1;r<s;++r){const o=i.slice(r,r+2),a={feature:e,segment:o};this.rBush_.insert(Lt(o),a)}}writeMultiLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const u=o.slice(a,a+2),c={feature:e,segment:u};this.rBush_.insert(Lt(u),c)}}}writeMultiPointGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r],a={feature:e,segment:[o,o]};this.rBush_.insert(t.getExtent(),a)}}writeMultiPolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length;a<l;++a){const u=o[a];for(let c=0,h=u.length-1;c<h;++c){const f=u.slice(c,c+2),d={feature:e,segment:f};this.rBush_.insert(Lt(f),d)}}}}writePointGeometry_(e,t){const i=t.getCoordinates(),r={feature:e,segment:[i,i]};this.rBush_.insert(t.getExtent(),r)}writePolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const u=o.slice(a,a+2),c={feature:e,segment:u};this.rBush_.insert(Lt(u),c)}}}}var nF=iF;const q0={TRANSLATESTART:"translatestart",TRANSLATING:"translating",TRANSLATEEND:"translateend"};class Sd extends ni{constructor(e,t,i,r,s){super(e);this.features=t,this.coordinate=i,this.startCoordinate=r,this.mapBrowserEvent=s}}class rF extends Fn{constructor(e){const t=e||{};super(t);this.on,this.once,this.un,this.lastCoordinate_=null,this.startCoordinate_=null,this.features_=t.features!==void 0?t.features:null;let i;if(t.layers&&!this.features_)if(typeof t.layers=="function")i=t.layers;else{const r=t.layers;i=function(s){return Ye(r,s)}}else i=an;this.layerFilter_=i,this.filter_=t.filter&&!this.features_?t.filter:an,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.condition_=t.condition?t.condition:Sl,this.lastFeature_=null,this.addChangeListener(vc.ACTIVE,this.handleActiveChanged_)}handleDownEvent(e){if(!e.originalEvent||!this.condition_(e))return!1;if(this.lastFeature_=this.featuresAtPixel_(e.pixel,e.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=e.coordinate,this.lastCoordinate_=e.coordinate,this.handleMoveEvent(e);const t=this.features_||new qt([this.lastFeature_]);return this.dispatchEvent(new Sd(q0.TRANSLATESTART,t,e.coordinate,this.startCoordinate_,e)),!0}return!1}handleUpEvent(e){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(e);const t=this.features_||new qt([this.lastFeature_]);return this.dispatchEvent(new Sd(q0.TRANSLATEEND,t,e.coordinate,this.startCoordinate_,e)),this.startCoordinate_=null,!0}return!1}handleDragEvent(e){if(this.lastCoordinate_){const t=e.coordinate,i=t[0]-this.lastCoordinate_[0],r=t[1]-this.lastCoordinate_[1],s=this.features_||new qt([this.lastFeature_]);s.forEach(function(o){const a=o.getGeometry();a.translate(i,r),o.setGeometry(a)}),this.lastCoordinate_=t,this.dispatchEvent(new Sd(q0.TRANSLATING,s,t,this.startCoordinate_,e))}}handleMoveEvent(e){const t=e.map.getViewport();this.featuresAtPixel_(e.pixel,e.map)?(t.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),t.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):t.classList.remove("ol-grab","ol-grabbing")}featuresAtPixel_(e,t){return t.forEachFeatureAtPixel(e,function(i,r){if(this.filter_(i,r)&&(!this.features_||Ye(this.features_.getArray(),i)))return i}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})}getHitTolerance(){return this.hitTolerance_}setHitTolerance(e){this.hitTolerance_=e}setMap(e){const t=this.getMap();super.setMap(e),this.updateState_(t)}handleActiveChanged_(){this.updateState_(null)}updateState_(e){let t=this.getMap();const i=this.getActive();(!t||!i)&&(t=t||e,t&&t.getViewport().classList.remove("ol-grab","ol-grabbing"))}}var sF=rF;function bw(n){const e=n||{},t=new qt,i=new Km(-.005,.05,100);return(e.altShiftDragRotate!==void 0?e.altShiftDragRotate:!0)&&t.push(new $T),(e.doubleClickZoom!==void 0?e.doubleClickZoom:!0)&&t.push(new AT({delta:e.zoomDelta,duration:e.zoomDuration})),(e.dragPan!==void 0?e.dragPan:!0)&&t.push(new NT({onFocusOnly:e.onFocusOnly,kinetic:i})),(e.pinchRotate!==void 0?e.pinchRotate:!0)&&t.push(new jT),(e.pinchZoom!==void 0?e.pinchZoom:!0)&&t.push(new YT({duration:e.zoomDuration})),(e.keyboard!==void 0?e.keyboard:!0)&&(t.push(new UT),t.push(new zT({delta:e.zoomDelta,duration:e.zoomDuration}))),(e.mouseWheelZoom!==void 0?e.mouseWheelZoom:!0)&&t.push(new BT({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(e.shiftDragZoom!==void 0?e.shiftDragZoom:!0)&&t.push(new GT({duration:e.zoomDuration})),t}class oF extends id{constructor(e){e=ie({},e),e.controls||(e.controls=LT()),e.interactions||(e.interactions=bw({onFocusOnly:!0}));super(e)}createRenderer(){return new l0(this)}}var Iw=oF;class aF{constructor(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){const i=this.entries_[e];return ce(i!==void 0,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(e){const t=this.entries_[e];return ce(t!==void 0,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.key_;return e}getValues(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){ce(!(e in this.entries_),16);const i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_}setSize(e){this.highWaterMark=e}}var Rd=aF;function Fl(n,e,t,i){return i!==void 0?(i[0]=n,i[1]=e,i[2]=t,i):[n,e,t]}function Tr(n,e,t){return n+"/"+e+"/"+t}function Nl(n){return Tr(n[0],n[1],n[2])}function Cw(n){const[e,t,i]=n.substring(n.lastIndexOf("/")+1,n.length).split(",").map(Number);return Tr(e,t,i)}function J0(n){return n.split("/").map(Number)}function bd(n){return(n[1]<<n[0])+n[2]}function Lw(n,e){const t=n[0],i=n[1],r=n[2];if(e.getMinZoom()>t||t>e.getMaxZoom())return!1;const s=e.getFullTileRange(t);return s?s.containsXY(i,r):!0}class lF extends Rd{expireCache(e){for(;this.canExpireCache()&&!(this.peekLast().getKey()in e);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const e=this.peekFirstKey(),i=J0(e)[0];this.forEach(function(r){r.tileCoord[0]!==i&&(this.remove(Nl(r.tileCoord)),r.release())}.bind(this))}}var Dc=lF;class Ow{constructor(e,t,i,r){this.minX=e,this.maxX=t,this.minY=i,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function ha(n,e,t,i,r){return r!==void 0?(r.minX=n,r.maxX=e,r.minY=t,r.maxY=i,r):new Ow(n,e,t,i)}var kc=Ow;const Aw=[];class uF extends ks{constructor(e,t,i,r){super(e,t,{transition:0});this.context_={},this.executorGroups={},this.declutterExecutorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=r.bind(void 0,this),this.wrappedTileCoord=i}getContext(e){const t=oe(e);return t in this.context_||(this.context_[t]=Yt(1,1,Aw)),this.context_[t]}hasContext(e){return oe(e)in this.context_}getImage(e){return this.hasContext(e)?this.getContext(e).canvas:null}getReplayState(e){const t=oe(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){for(const e in this.context_)Aw.push(this.context_[e].canvas),delete this.context_[e];super.release()}}var Q0=uF;class cF extends ks{constructor(e,t,i,r,s,o){super(e,t,o);this.extent=null,this.format_=r,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=s,this.url_=i,this.key=i}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==K.IDLE&&(this.setState(K.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(e,t){this.setFeatures(e)}onError(){this.setState(K.ERROR)}setFeatures(e){this.features_=e,this.setState(K.LOADED)}setLoader(e){this.loader_=e}}var ey=cF;class hF{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}getReadOptions(e,t){let i;if(t){let r=t.dataProjection?se(t.dataProjection):this.readProjection(e);t.extent&&r&&r.getUnits()===Ui.TILE_PIXELS&&(r=se(r),r.setWorldExtent(t.extent)),i={dataProjection:r,featureProjection:t.featureProjection}}return this.adaptOptions(i)}adaptOptions(e){return ie({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)}getType(){return fe()}readFeature(e,t){return fe()}readFeatures(e,t){return fe()}readGeometry(e,t){return fe()}readProjection(e){return fe()}writeFeature(e,t){return fe()}writeFeatures(e,t){return fe()}writeGeometry(e,t){return fe()}}var $l=hF;function yt(n,e,t){const i=t?se(t.featureProjection):null,r=t?se(t.dataProjection):null;let s;if(i&&r&&!dn(i,r)?s=(e?n.clone():n).transform(e?i:r,e?r:i):s=n,e&&t&&t.decimals!==void 0){const o=Math.pow(10,t.decimals),a=function(l){for(let u=0,c=l.length;u<c;++u)l[u]=Math.round(l[u]*o)/o;return l};s===n&&(s=n.clone()),s.applyTransform(a)}return s}function Id(n,e){const t=e?se(e.featureProjection):null,i=e?se(e.dataProjection):null;return t&&i&&!dn(t,i)?cl(n,i,t):n}class fF extends $l{constructor(){super()}getType(){return mn.JSON}readFeature(e,t){return this.readFeatureFromObject(Cd(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(Cd(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return fe()}readFeaturesFromObject(e,t){return fe()}readGeometry(e,t){return this.readGeometryFromObject(Cd(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return fe()}readProjection(e){return this.readProjectionFromObject(Cd(e))}readProjectionFromObject(e){return fe()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return fe()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return fe()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return fe()}}function Cd(n){if(typeof n=="string"){const e=JSON.parse(n);return e||null}else return n!==null?n:null}var Ld=fF;const fa={};fa[M.POINT]=gF,fa[M.LINE_STRING]=mF,fa[M.POLYGON]=xF,fa[M.MULTI_POINT]=_F,fa[M.MULTI_LINE_STRING]=yF,fa[M.MULTI_POLYGON]=vF;const da={};da[M.POINT]=EF,da[M.LINE_STRING]=TF,da[M.POLYGON]=wF,da[M.MULTI_POINT]=RF,da[M.MULTI_LINE_STRING]=SF,da[M.MULTI_POLYGON]=bF;class dF extends Ld{constructor(e){const t=e||{};super();this.geometryName_=t.geometryName}readFeatureFromObject(e,t,i){const r=e,s=Pw(r.geometry,t),o=new lt;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(s),r.attributes){o.setProperties(r.attributes,!0);const a=r.attributes[i];a!==void 0&&o.setId(a)}return o}readFeaturesFromObject(e,t){const i=t||{};if(e.features){const r=e,s=[],o=r.features;for(let a=0,l=o.length;a<l;++a)s.push(this.readFeatureFromObject(o[a],i,e.objectIdFieldName));return s}else return[this.readFeatureFromObject(e,i)]}readGeometryFromObject(e,t){return Pw(e,t)}readProjectionFromObject(e){if(e.spatialReference&&e.spatialReference.wkid!==void 0){const i=e.spatialReference.wkid;return se("EPSG:"+i)}else return null}writeGeometryObject(e,t){return Mw(e,this.adaptOptions(t))}writeFeatureObject(e,t){t=this.adaptOptions(t);const i={};if(!e.hasProperties())return i.attributes={},i;const r=e.getProperties(),s=e.getGeometry();if(s){i.geometry=Mw(s,t);const o=t&&(t.dataProjection||t.featureProjection);o&&(i.geometry.spatialReference={wkid:Number(se(o).getCode().split(":").pop())}),delete r[e.getGeometryName()]}return Wn(r)?i.attributes={}:i.attributes=r,i}writeFeaturesObject(e,t){t=this.adaptOptions(t);const i=[];for(let r=0,s=e.length;r<s;++r)i.push(this.writeFeatureObject(e[r],t));return{features:i}}}function Pw(n,e){if(!n)return null;let t;if(typeof n.x=="number"&&typeof n.y=="number")t=M.POINT;else if(n.points)t=M.MULTI_POINT;else if(n.paths)n.paths.length===1?t=M.LINE_STRING:t=M.MULTI_LINE_STRING;else if(n.rings){const r=n,s=Dl(r),o=pF(r.rings,s);o.length===1?(t=M.POLYGON,n=ie({},n,{rings:o[0]})):(t=M.MULTI_POLYGON,n=ie({},n,{rings:o}))}const i=fa[t];return yt(i(n),!1,e)}function pF(n,e){const t=[],i=[],r=[];let s,o;for(s=0,o=n.length;s<o;++s)t.length=0,hl(t,0,n[s],e.length),rc(t,0,t.length,e.length)?i.push([n[s]]):r.push(n[s]);for(;r.length;){const a=r.shift();let l=!1;for(s=i.length-1;s>=0;s--){const u=i[s][0];if(hi(new dl(u).getExtent(),new dl(a).getExtent())){i[s].push(a),l=!0;break}}l||i.push([a.reverse()])}return i}function gF(n){let e;return n.m!==void 0&&n.z!==void 0?e=new Et([n.x,n.y,n.z,n.m],q.XYZM):n.z!==void 0?e=new Et([n.x,n.y,n.z],q.XYZ):n.m!==void 0?e=new Et([n.x,n.y,n.m],q.XYM):e=new Et([n.x,n.y]),e}function mF(n){const e=Dl(n);return new Gt(n.paths[0],e)}function yF(n){const e=Dl(n);return new yn(n.paths,e)}function Dl(n){let e=q.XY;return n.hasZ===!0&&n.hasM===!0?e=q.XYZM:n.hasZ===!0?e=q.XYZ:n.hasM===!0&&(e=q.XYM),e}function _F(n){const e=Dl(n);return new Nn(n.points,e)}function vF(n){const e=Dl(n);return new $n(n.rings,e)}function xF(n){const e=Dl(n);return new pi(n.rings,e)}function EF(n,e){const t=n.getCoordinates();let i;const r=n.getLayout();return r===q.XYZ?i={x:t[0],y:t[1],z:t[2]}:r===q.XYM?i={x:t[0],y:t[1],m:t[2]}:r===q.XYZM?i={x:t[0],y:t[1],z:t[2],m:t[3]}:r===q.XY?i={x:t[0],y:t[1]}:ce(!1,34),i}function Gc(n){const e=n.getLayout();return{hasZ:e===q.XYZ||e===q.XYZM,hasM:e===q.XYM||e===q.XYZM}}function TF(n,e){const t=Gc(n);return{hasZ:t.hasZ,hasM:t.hasM,paths:[n.getCoordinates()]}}function wF(n,e){const t=Gc(n);return{hasZ:t.hasZ,hasM:t.hasM,rings:n.getCoordinates(!1)}}function SF(n,e){const t=Gc(n);return{hasZ:t.hasZ,hasM:t.hasM,paths:n.getCoordinates()}}function RF(n,e){const t=Gc(n);return{hasZ:t.hasZ,hasM:t.hasM,points:n.getCoordinates()}}function bF(n,e){const t=Gc(n),i=n.getCoordinates(!1),r=[];for(let s=0;s<i.length;s++)for(let o=i[s].length-1;o>=0;o--)r.push(i[s][o]);return{hasZ:t.hasZ,hasM:t.hasM,rings:r}}function Mw(n,e){return da[n.getType()](yt(n,!0,e),e)}var IF=dF;const to="http://www.w3.org/2001/XMLSchema-instance";function Ee(n,e){return pa().createElementNS(n,e)}function ji(n,e){return ty(n,e,[]).join("")}function ty(n,e,t){if(n.nodeType==Node.CDATA_SECTION_NODE||n.nodeType==Node.TEXT_NODE)e?t.push(String(n.nodeValue).replace(/(\r\n|\r|\n)/g,"")):t.push(n.nodeValue);else{let i;for(i=n.firstChild;i;i=i.nextSibling)ty(i,e,t)}return t}function nr(n){return"documentElement"in n}function Fw(n,e,t){return n.getAttributeNS(e,t)||""}function rr(n){return new DOMParser().parseFromString(n,"application/xml")}function iy(n,e){return function(t,i){const r=n.call(e!==void 0?e:this,t,i);if(r!==void 0){const s=i[i.length-1];qe(s,r)}}}function he(n,e){return function(t,i){const r=n.call(e!==void 0?e:this,t,i);r!==void 0&&i[i.length-1].push(r)}}function me(n,e){return function(t,i){const r=n.call(e!==void 0?e:this,t,i);r!==void 0&&(i[i.length-1]=r)}}function _t(n,e,t){return function(i,r){const s=n.call(t!==void 0?t:this,i,r);if(s!==void 0){const o=r[r.length-1],a=e!==void 0?e:i.localName;let l;a in o?l=o[a]:(l=[],o[a]=l),l.push(s)}}}function F(n,e,t){return function(i,r){const s=n.call(t!==void 0?t:this,i,r);if(s!==void 0){const o=r[r.length-1],a=e!==void 0?e:i.localName;o[a]=s}}}function N(n,e){return function(t,i,r){n.call(e!==void 0?e:this,t,i,r),r[r.length-1].node.appendChild(t)}}function ny(n,e){let t,i;return function(r,s,o){if(t===void 0){t={};const a={};a[r.localName]=n,t[r.namespaceURI]=a,i=Ot(r.localName)}ry(t,i,s,o)}}function Ot(n,e){const t=n;return function(i,r,s){const a=r[r.length-1].node;let l=t;l===void 0&&(l=s);const u=e!==void 0?e:a.namespaceURI;return Ee(u,l)}}const gi=Ot();function qi(n,e){const t=e.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=n[e[r]];return i}function Y(n,e,t){const i=t!==void 0?t:{};let r,s;for(r=0,s=n.length;r<s;++r)i[n[r]]=e;return i}function Ji(n,e,t,i){let r;for(r=e.firstElementChild;r;r=r.nextElementSibling){const s=n[r.namespaceURI];if(s!==void 0){const o=s[r.localName];o!==void 0&&o.call(i,r,t)}}}function W(n,e,t,i,r){return i.push(n),Ji(e,t,i,r),i.pop()}function ry(n,e,t,i,r,s){const o=(r!==void 0?r:t).length;let a,l;for(let u=0;u<o;++u)a=t[u],a!==void 0&&(l=e.call(s!==void 0?s:this,a,i,r!==void 0?r[u]:void 0),l!==void 0&&n[l.namespaceURI][l.localName].call(s,l,a,i))}function Te(n,e,t,i,r,s,o){return r.push(n),ry(e,t,i,r,s,o),r.pop()}let Od;function CF(n){Od=n}function Nw(){return Od===void 0&&typeof XMLSerializer!="undefined"&&(Od=new XMLSerializer),Od}let Ad;function LF(n){Ad=n}function pa(){return Ad===void 0&&typeof document!="undefined"&&(Ad=document.implementation.createDocument("","",null)),Ad}class OF extends $l{constructor(){super();this.xmlSerializer_=Nw()}getType(){return mn.XML}readFeature(e,t){if(e)if(typeof e=="string"){const i=rr(e);return this.readFeatureFromDocument(i,t)}else return nr(e)?this.readFeatureFromDocument(e,t):this.readFeatureFromNode(e,t);else return null}readFeatureFromDocument(e,t){const i=this.readFeaturesFromDocument(e,t);return i.length>0?i[0]:null}readFeatureFromNode(e,t){return null}readFeatures(e,t){if(e)if(typeof e=="string"){const i=rr(e);return this.readFeaturesFromDocument(i,t)}else return nr(e)?this.readFeaturesFromDocument(e,t):this.readFeaturesFromNode(e,t);else return[]}readFeaturesFromDocument(e,t){const i=[];for(let r=e.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&qe(i,this.readFeaturesFromNode(r,t));return i}readFeaturesFromNode(e,t){return fe()}readGeometry(e,t){if(e)if(typeof e=="string"){const i=rr(e);return this.readGeometryFromDocument(i,t)}else return nr(e)?this.readGeometryFromDocument(e,t):this.readGeometryFromNode(e,t);else return null}readGeometryFromDocument(e,t){return null}readGeometryFromNode(e,t){return null}readProjection(e){if(e)if(typeof e=="string"){const t=rr(e);return this.readProjectionFromDocument(t)}else return nr(e)?this.readProjectionFromDocument(e):this.readProjectionFromNode(e);else return null}readProjectionFromDocument(e){return this.dataProjection}readProjectionFromNode(e){return this.dataProjection}writeFeature(e,t){const i=this.writeFeatureNode(e,t);return this.xmlSerializer_.serializeToString(i)}writeFeatureNode(e,t){return null}writeFeatures(e,t){const i=this.writeFeaturesNode(e,t);return this.xmlSerializer_.serializeToString(i)}writeFeaturesNode(e,t){return null}writeGeometry(e,t){const i=this.writeGeometryNode(e,t);return this.xmlSerializer_.serializeToString(i)}writeGeometryNode(e,t){return null}}var ga=OF;const wr="http://www.opengis.net/gml",AF=/^[\s\xa0]*$/;class Vt extends ga{constructor(e){super();const t=e||{};this.featureType=t.featureType,this.featureNS=t.featureNS,this.srsName=t.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[this.namespace]={featureMember:he(this.readFeaturesInternal),featureMembers:me(this.readFeaturesInternal)},this.supportedMediaTypes=["application/gml+xml"]}readFeaturesInternal(e,t){const i=e.localName;let r=null;if(i=="FeatureCollection")r=W([],this.FEATURE_COLLECTION_PARSERS,e,t,this);else if(i=="featureMembers"||i=="featureMember"||i=="member"){const s=t[0];let o=s.featureType,a=s.featureNS;const l="p",u="p0";if(!o&&e.childNodes){o=[],a={};for(let f=0,d=e.childNodes.length;f<d;++f){const p=e.childNodes[f];if(p.nodeType===1){const m=p.nodeName.split(":").pop();if(o.indexOf(m)===-1){let g="",v=0;const y=p.namespaceURI;for(const x in a){if(a[x]===y){g=x;break}++v}g||(g=l+v,a[g]=y),o.push(g+":"+m)}}}i!="featureMember"&&(s.featureType=o,s.featureNS=a)}if(typeof a=="string"){const f=a;a={},a[u]=f}const c={},h=Array.isArray(o)?o:[o];for(const f in a){const d={};for(let p=0,m=h.length;p<m;++p)(h[p].indexOf(":")===-1?u:h[p].split(":")[0])===f&&(d[h[p].split(":").pop()]=i=="featureMembers"?he(this.readFeatureElement,this):me(this.readFeatureElement,this));c[a[f]]=d}i=="featureMember"||i=="member"?r=W(void 0,c,e,t):r=W([],c,e,t)}return r===null&&(r=[]),r}readGeometryElement(e,t){const i=t[0];i.srsName=e.firstElementChild.getAttribute("srsName"),i.srsDimension=e.firstElementChild.getAttribute("srsDimension");const r=W(null,this.GEOMETRY_PARSERS,e,t,this);if(r)return Array.isArray(r)?Id(r,i):yt(r,!1,i)}readFeatureElementInternal(e,t,i){let r;const s={};for(let o=e.firstElementChild;o;o=o.nextElementSibling){let a;const l=o.localName;o.childNodes.length===0||o.childNodes.length===1&&(o.firstChild.nodeType===3||o.firstChild.nodeType===4)?(a=ji(o,!1),AF.test(a)&&(a=void 0)):(i&&(a=this.readGeometryElement(o,t)),a?l!=="boundedBy"&&(r=l):a=this.readFeatureElementInternal(o,t,!1)),s[l]?(s[l]instanceof Array||(s[l]=[s[l]]),s[l].push(a)):s[l]=a;const u=o.attributes.length;if(u>0){s[l]={_content_:s[l]};for(let c=0;c<u;c++){const h=o.attributes[c].name;s[l][h]=o.attributes[c].value}}}if(i){const o=new lt(s);r&&o.setGeometryName(r);const a=e.getAttribute("fid")||Fw(e,this.namespace,"id");return a&&o.setId(a),o}else return s}readFeatureElement(e,t){return this.readFeatureElementInternal(e,t,!0)}readPoint(e,t){const i=this.readFlatCoordinatesFromNode(e,t);if(i)return new Et(i,q.XYZ)}readMultiPoint(e,t){const i=W([],this.MULTIPOINT_PARSERS,e,t,this);if(i)return new Nn(i)}readMultiLineString(e,t){const i=W([],this.MULTILINESTRING_PARSERS,e,t,this);if(i)return new yn(i)}readMultiPolygon(e,t){const i=W([],this.MULTIPOLYGON_PARSERS,e,t,this);if(i)return new $n(i)}pointMemberParser(e,t){Ji(this.POINTMEMBER_PARSERS,e,t,this)}lineStringMemberParser(e,t){Ji(this.LINESTRINGMEMBER_PARSERS,e,t,this)}polygonMemberParser(e,t){Ji(this.POLYGONMEMBER_PARSERS,e,t,this)}readLineString(e,t){const i=this.readFlatCoordinatesFromNode(e,t);if(i)return new Gt(i,q.XYZ)}readFlatLinearRing(e,t){const i=W(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,t,this);if(i)return i}readLinearRing(e,t){const i=this.readFlatCoordinatesFromNode(e,t);if(i)return new dl(i,q.XYZ)}readPolygon(e,t){const i=W([null],this.FLAT_LINEAR_RINGS_PARSERS,e,t,this);if(i&&i[0]){const r=i[0],s=[r.length];let o,a;for(o=1,a=i.length;o<a;++o)qe(r,i[o]),s.push(r.length);return new pi(r,q.XYZ,s)}else return}readFlatCoordinatesFromNode(e,t){return W(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,t,this)}readGeometryFromNode(e,t){const i=this.readGeometryElement(e,[this.getReadOptions(e,t||{})]);return i||null}readFeaturesFromNode(e,t){const i={featureType:this.featureType,featureNS:this.featureNS};return t&&ie(i,this.getReadOptions(e,t)),this.readFeaturesInternal(e,[i])||[]}readProjectionFromNode(e){return se(this.srsName?this.srsName:e.firstElementChild.getAttribute("srsName"))}}Vt.prototype.namespace=wr,Vt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},Vt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},Vt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},Vt.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:he(Vt.prototype.pointMemberParser),pointMembers:he(Vt.prototype.pointMemberParser)}},Vt.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:he(Vt.prototype.lineStringMemberParser),lineStringMembers:he(Vt.prototype.lineStringMemberParser)}},Vt.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:he(Vt.prototype.polygonMemberParser),polygonMembers:he(Vt.prototype.polygonMemberParser)}},Vt.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:he(Vt.prototype.readFlatCoordinatesFromNode)}},Vt.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:he(Vt.prototype.readLineString)}},Vt.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:he(Vt.prototype.readPolygon)}},Vt.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:me(Vt.prototype.readFlatLinearRing)}};var ze=Vt;function is(n){const e=ji(n,!1);return io(e)}function io(n){const e=/^\s*(true|1)|(false|0)\s*$/.exec(n);if(e)return e[1]!==void 0||!1}function Pd(n){const e=ji(n,!1),t=Date.parse(e);return isNaN(t)?void 0:t/1e3}function Ke(n){const e=ji(n,!1);return Sr(e)}function Sr(n){const e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(n);if(e)return parseFloat(e[1])}function Wt(n){const e=ji(n,!1);return Rr(e)}function Rr(n){const e=/^\s*(\d+)\s*$/.exec(n);if(e)return parseInt(e[1],10)}function H(n){return ji(n,!1).trim()}function ma(n,e){ve(n,e?"1":"0")}function $w(n,e){n.appendChild(pa().createCDATASection(e))}function Dw(n,e){const t=new Date(e*1e3),i=t.getUTCFullYear()+"-"+Bs(t.getUTCMonth()+1,2)+"-"+Bs(t.getUTCDate(),2)+"T"+Bs(t.getUTCHours(),2)+":"+Bs(t.getUTCMinutes(),2)+":"+Bs(t.getUTCSeconds(),2)+"Z";n.appendChild(pa().createTextNode(i))}function Qi(n,e){const t=e.toPrecision();n.appendChild(pa().createTextNode(t))}function Uc(n,e){const t=e.toString();n.appendChild(pa().createTextNode(t))}function ve(n,e){n.appendChild(pa().createTextNode(e))}const PF=wr+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",MF={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class Ve extends ze{constructor(e){const t=e||{};super(t);this.FEATURE_COLLECTION_PARSERS[wr].featureMember=he(this.readFeaturesInternal),this.schemaLocation=t.schemaLocation?t.schemaLocation:PF}readFlatCoordinates(e,t){const i=ji(e,!1).replace(/^\s*|\s*$/g,""),s=t[0].srsName;let o="enu";if(s){const u=se(s);u&&(o=u.getAxisOrientation())}const a=i.trim().split(/\s+/),l=[];for(let u=0,c=a.length;u<c;u++){const h=a[u].split(/,+/),f=parseFloat(h[0]),d=parseFloat(h[1]),p=h.length===3?parseFloat(h[2]):0;o.substr(0,2)==="en"?l.push(f,d,p):l.push(d,f,p)}return l}readBox(e,t){const i=W([null],this.BOX_PARSERS_,e,t,this);return hn(i[1][0],i[1][1],i[1][3],i[1][4])}innerBoundaryIsParser(e,t){const i=W(void 0,this.RING_PARSERS,e,t,this);i&&t[t.length-1].push(i)}outerBoundaryIsParser(e,t){const i=W(void 0,this.RING_PARSERS,e,t,this);if(i){const r=t[t.length-1];r[0]=i}}GEOMETRY_NODE_FACTORY_(e,t,i){const r=t[t.length-1],s=r.multiSurface,o=r.surface,a=r.multiCurve;let l;return Array.isArray(e)?l="Envelope":(l=e.getType(),l==="MultiPolygon"&&s===!0?l="MultiSurface":l==="Polygon"&&o===!0?l="Surface":l==="MultiLineString"&&a===!0&&(l="MultiCurve")),Ee("http://www.opengis.net/gml",l)}writeFeatureElement(e,t,i){const r=t.getId();r&&e.setAttribute("fid",r);const s=i[i.length-1],o=s.featureNS,a=t.getGeometryName();s.serializers||(s.serializers={},s.serializers[o]={});const l=[],u=[];if(t.hasProperties()){const h=t.getProperties();for(const f in h){const d=h[f];d!==null&&(l.push(f),u.push(d),f==a||typeof d.getSimplifiedGeometry=="function"?f in s.serializers[o]||(s.serializers[o][f]=N(this.writeGeometryElement,this)):f in s.serializers[o]||(s.serializers[o][f]=N(ve)))}}const c=ie({},s);c.node=e,Te(c,s.serializers,Ot(void 0,o),u,i,l)}writeCurveOrLineString(e,t,i){const s=i[i.length-1].srsName;if(e.nodeName!=="LineStringSegment"&&s&&e.setAttribute("srsName",s),e.nodeName==="LineString"||e.nodeName==="LineStringSegment"){const o=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(o),this.writeCoordinates_(o,t,i)}else if(e.nodeName==="Curve"){const o=Ee(e.namespaceURI,"segments");e.appendChild(o),this.writeCurveSegments_(o,t,i)}}writeLineStringOrCurveMember(e,t,i){const r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(e.appendChild(r),this.writeCurveOrLineString(r,t,i))}writeMultiCurveOrLineString(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=r.curve;o&&e.setAttribute("srsName",o);const l=t.getLineStrings();Te({node:e,hasZ:s,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeGeometryElement(e,t,i){const r=i[i.length-1],s=ie({},r);s.node=e;let o;Array.isArray(t)?o=Id(t,r):o=yt(t,!0,r),Te(s,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[o],i,void 0,this)}createCoordinatesNode_(e){const t=Ee(e,"coordinates");return t.setAttribute("decimal","."),t.setAttribute("cs",","),t.setAttribute("ts"," "),t}writeCoordinates_(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=t.getCoordinates(),l=a.length,u=new Array(l);for(let c=0;c<l;++c){const h=a[c];u[c]=this.getCoords_(h,o,s)}ve(e,u.join(" "))}writeCurveSegments_(e,t,i){const r=Ee(e.namespaceURI,"LineStringSegment");e.appendChild(r),this.writeCurveOrLineString(r,t,i)}writeSurfaceOrPolygon(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName;if(e.nodeName!=="PolygonPatch"&&o&&e.setAttribute("srsName",o),e.nodeName==="Polygon"||e.nodeName==="PolygonPatch"){const a=t.getLinearRings();Te({node:e,hasZ:s,srsName:o},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,a,i,void 0,this)}else if(e.nodeName==="Surface"){const a=Ee(e.namespaceURI,"patches");e.appendChild(a),this.writeSurfacePatches_(a,t,i)}}RING_NODE_FACTORY_(e,t,i){const r=t[t.length-1],s=r.node,o=r.exteriorWritten;return o===void 0&&(r.exteriorWritten=!0),Ee(s.namespaceURI,o!==void 0?"innerBoundaryIs":"outerBoundaryIs")}writeSurfacePatches_(e,t,i){const r=Ee(e.namespaceURI,"PolygonPatch");e.appendChild(r),this.writeSurfaceOrPolygon(r,t,i)}writeRing(e,t,i){const r=Ee(e.namespaceURI,"LinearRing");e.appendChild(r),this.writeLinearRing(r,t,i)}getCoords_(e,t,i){let r="enu";t&&(r=se(t).getAxisOrientation());let s=r.substr(0,2)==="en"?e[0]+","+e[1]:e[1]+","+e[0];if(i){const o=e[2]||0;s+=","+o}return s}writePoint(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName;o&&e.setAttribute("srsName",o);const a=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(a);const l=t.getCoordinates(),u=this.getCoords_(l,o,s);ve(a,u)}writeMultiPoint(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName;o&&e.setAttribute("srsName",o);const a=t.getPoints();Te({node:e,hasZ:s,srsName:o},this.POINTMEMBER_SERIALIZERS,Ot("pointMember"),a,i,void 0,this)}writePointMember(e,t,i){const r=Ee(e.namespaceURI,"Point");e.appendChild(r),this.writePoint(r,t,i)}writeLinearRing(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(o),this.writeCoordinates_(o,t,i)}writeMultiSurfaceOrPolygon(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=r.surface;o&&e.setAttribute("srsName",o);const l=t.getPolygons();Te({node:e,hasZ:s,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeSurfaceOrPolygonMember(e,t,i){const r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(e.appendChild(r),this.writeSurfaceOrPolygon(r,t,i))}writeEnvelope(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=["lowerCorner","upperCorner"],a=[t[0]+" "+t[1],t[2]+" "+t[3]];Te({node:e},this.ENVELOPE_SERIALIZERS,gi,a,i,o,this)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(e,t,i){const r=t[t.length-1].node;return Ee("http://www.opengis.net/gml",MF[r.nodeName])}}Ve.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:me(Ve.prototype.readFlatCoordinates)}},Ve.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:Ve.prototype.innerBoundaryIsParser,outerBoundaryIs:Ve.prototype.outerBoundaryIsParser}},Ve.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:he(Ve.prototype.readFlatCoordinates)}},Ve.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:me(ze.prototype.readPoint),MultiPoint:me(ze.prototype.readMultiPoint),LineString:me(ze.prototype.readLineString),MultiLineString:me(ze.prototype.readMultiLineString),LinearRing:me(ze.prototype.readLinearRing),Polygon:me(ze.prototype.readPolygon),MultiPolygon:me(ze.prototype.readMultiPolygon),Box:me(Ve.prototype.readBox)}},Ve.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:N(Ve.prototype.writeCurveOrLineString),MultiCurve:N(Ve.prototype.writeMultiCurveOrLineString),Point:N(Ve.prototype.writePoint),MultiPoint:N(Ve.prototype.writeMultiPoint),LineString:N(Ve.prototype.writeCurveOrLineString),MultiLineString:N(Ve.prototype.writeMultiCurveOrLineString),LinearRing:N(Ve.prototype.writeLinearRing),Polygon:N(Ve.prototype.writeSurfaceOrPolygon),MultiPolygon:N(Ve.prototype.writeMultiSurfaceOrPolygon),Surface:N(Ve.prototype.writeSurfaceOrPolygon),MultiSurface:N(Ve.prototype.writeMultiSurfaceOrPolygon),Envelope:N(Ve.prototype.writeEnvelope)}},Ve.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:N(Ve.prototype.writeLineStringOrCurveMember),curveMember:N(Ve.prototype.writeLineStringOrCurveMember)}},Ve.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:N(Ve.prototype.writeRing),innerBoundaryIs:N(Ve.prototype.writeRing)}},Ve.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:N(Ve.prototype.writePointMember)}},Ve.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:N(Ve.prototype.writeSurfaceOrPolygonMember),polygonMember:N(Ve.prototype.writeSurfaceOrPolygonMember)}},Ve.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:N(ve),upperCorner:N(ve)}};var ya=Ve;const FF=wr+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",NF={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class de extends ze{constructor(e){const t=e||{};super(t);this.surface_=t.surface!==void 0?t.surface:!1,this.curve_=t.curve!==void 0?t.curve:!1,this.multiCurve_=t.multiCurve!==void 0?t.multiCurve:!0,this.multiSurface_=t.multiSurface!==void 0?t.multiSurface:!0,this.schemaLocation=t.schemaLocation?t.schemaLocation:FF,this.hasZ=t.hasZ!==void 0?t.hasZ:!1}readMultiCurve(e,t){const i=W([],this.MULTICURVE_PARSERS,e,t,this);if(i)return new yn(i)}readMultiSurface(e,t){const i=W([],this.MULTISURFACE_PARSERS,e,t,this);if(i)return new $n(i)}curveMemberParser(e,t){Ji(this.CURVEMEMBER_PARSERS,e,t,this)}surfaceMemberParser(e,t){Ji(this.SURFACEMEMBER_PARSERS,e,t,this)}readPatch(e,t){return W([null],this.PATCHES_PARSERS,e,t,this)}readSegment(e,t){return W([null],this.SEGMENTS_PARSERS,e,t,this)}readPolygonPatch(e,t){return W([null],this.FLAT_LINEAR_RINGS_PARSERS,e,t,this)}readLineStringSegment(e,t){return W([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,t,this)}interiorParser(e,t){const i=W(void 0,this.RING_PARSERS,e,t,this);i&&t[t.length-1].push(i)}exteriorParser(e,t){const i=W(void 0,this.RING_PARSERS,e,t,this);if(i){const r=t[t.length-1];r[0]=i}}readSurface(e,t){const i=W([null],this.SURFACE_PARSERS,e,t,this);if(i&&i[0]){const r=i[0],s=[r.length];let o,a;for(o=1,a=i.length;o<a;++o)qe(r,i[o]),s.push(r.length);return new pi(r,q.XYZ,s)}else return}readCurve(e,t){const i=W([null],this.CURVE_PARSERS,e,t,this);if(i)return new Gt(i,q.XYZ)}readEnvelope(e,t){const i=W([null],this.ENVELOPE_PARSERS,e,t,this);return hn(i[1][0],i[1][1],i[2][0],i[2][1])}readFlatPos(e,t){let i=ji(e,!1);const r=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,s=[];let o;for(;o=r.exec(i);)s.push(parseFloat(o[1])),i=i.substr(o[0].length);if(i!=="")return;const l=t[0].srsName;let u="enu";if(l&&(u=se(l).getAxisOrientation()),u==="neu"){let h,f;for(h=0,f=s.length;h<f;h+=3){const d=s[h],p=s[h+1];s[h]=p,s[h+1]=d}}const c=s.length;if(c==2&&s.push(0),c!==0)return s}readFlatPosList(e,t){const i=ji(e,!1).replace(/^\s*|\s*$/g,""),r=t[0],s=r.srsName,o=r.srsDimension;let a="enu";s&&(a=se(s).getAxisOrientation());const l=i.split(/\s+/);let u=2;e.getAttribute("srsDimension")?u=Rr(e.getAttribute("srsDimension")):e.getAttribute("dimension")?u=Rr(e.getAttribute("dimension")):e.parentNode.getAttribute("srsDimension")?u=Rr(e.parentNode.getAttribute("srsDimension")):o&&(u=Rr(o));let c,h,f;const d=[];for(let p=0,m=l.length;p<m;p+=u)c=parseFloat(l[p]),h=parseFloat(l[p+1]),f=u===3?parseFloat(l[p+2]):0,a.substr(0,2)==="en"?d.push(c,h,f):d.push(h,c,f);return d}writePos_(e,t,i){const r=i[i.length-1],s=r.hasZ,o=s?"3":"2";e.setAttribute("srsDimension",o);const a=r.srsName;let l="enu";a&&(l=se(a).getAxisOrientation());const u=t.getCoordinates();let c;if(l.substr(0,2)==="en"?c=u[0]+" "+u[1]:c=u[1]+" "+u[0],s){const h=u[2]||0;c+=" "+h}ve(e,c)}getCoords_(e,t,i){let r="enu";t&&(r=se(t).getAxisOrientation());let s=r.substr(0,2)==="en"?e[0]+" "+e[1]:e[1]+" "+e[0];if(i){const o=e[2]||0;s+=" "+o}return s}writePosList_(e,t,i){const r=i[i.length-1],s=r.hasZ,o=s?"3":"2";e.setAttribute("srsDimension",o);const a=r.srsName,l=t.getCoordinates(),u=l.length,c=new Array(u);let h;for(let f=0;f<u;++f)h=l[f],c[f]=this.getCoords_(h,a,s);ve(e,c.join(" "))}writePoint(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=Ee(e.namespaceURI,"pos");e.appendChild(o),this.writePos_(o,t,i)}writeEnvelope(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=["lowerCorner","upperCorner"],a=[t[0]+" "+t[1],t[2]+" "+t[3]];Te({node:e},this.ENVELOPE_SERIALIZERS,gi,a,i,o,this)}writeLinearRing(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=Ee(e.namespaceURI,"posList");e.appendChild(o),this.writePosList_(o,t,i)}RING_NODE_FACTORY_(e,t,i){const r=t[t.length-1],s=r.node,o=r.exteriorWritten;return o===void 0&&(r.exteriorWritten=!0),Ee(s.namespaceURI,o!==void 0?"interior":"exterior")}writeSurfaceOrPolygon(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName;if(e.nodeName!=="PolygonPatch"&&o&&e.setAttribute("srsName",o),e.nodeName==="Polygon"||e.nodeName==="PolygonPatch"){const a=t.getLinearRings();Te({node:e,hasZ:s,srsName:o},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,a,i,void 0,this)}else if(e.nodeName==="Surface"){const a=Ee(e.namespaceURI,"patches");e.appendChild(a),this.writeSurfacePatches_(a,t,i)}}writeCurveOrLineString(e,t,i){const s=i[i.length-1].srsName;if(e.nodeName!=="LineStringSegment"&&s&&e.setAttribute("srsName",s),e.nodeName==="LineString"||e.nodeName==="LineStringSegment"){const o=Ee(e.namespaceURI,"posList");e.appendChild(o),this.writePosList_(o,t,i)}else if(e.nodeName==="Curve"){const o=Ee(e.namespaceURI,"segments");e.appendChild(o),this.writeCurveSegments_(o,t,i)}}writeMultiSurfaceOrPolygon(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=r.surface;o&&e.setAttribute("srsName",o);const l=t.getPolygons();Te({node:e,hasZ:s,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeMultiPoint(e,t,i){const r=i[i.length-1],s=r.srsName,o=r.hasZ;s&&e.setAttribute("srsName",s);const a=t.getPoints();Te({node:e,hasZ:o,srsName:s},this.POINTMEMBER_SERIALIZERS,Ot("pointMember"),a,i,void 0,this)}writeMultiCurveOrLineString(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=r.curve;o&&e.setAttribute("srsName",o);const l=t.getLineStrings();Te({node:e,hasZ:s,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeRing(e,t,i){const r=Ee(e.namespaceURI,"LinearRing");e.appendChild(r),this.writeLinearRing(r,t,i)}writeSurfaceOrPolygonMember(e,t,i){const r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(e.appendChild(r),this.writeSurfaceOrPolygon(r,t,i))}writePointMember(e,t,i){const r=Ee(e.namespaceURI,"Point");e.appendChild(r),this.writePoint(r,t,i)}writeLineStringOrCurveMember(e,t,i){const r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(e.appendChild(r),this.writeCurveOrLineString(r,t,i))}writeSurfacePatches_(e,t,i){const r=Ee(e.namespaceURI,"PolygonPatch");e.appendChild(r),this.writeSurfaceOrPolygon(r,t,i)}writeCurveSegments_(e,t,i){const r=Ee(e.namespaceURI,"LineStringSegment");e.appendChild(r),this.writeCurveOrLineString(r,t,i)}writeGeometryElement(e,t,i){const r=i[i.length-1],s=ie({},r);s.node=e;let o;Array.isArray(t)?o=Id(t,r):o=yt(t,!0,r),Te(s,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[o],i,void 0,this)}writeFeatureElement(e,t,i){const r=t.getId();r&&e.setAttribute("fid",r);const s=i[i.length-1],o=s.featureNS,a=t.getGeometryName();s.serializers||(s.serializers={},s.serializers[o]={});const l=[],u=[];if(t.hasProperties()){const h=t.getProperties();for(const f in h){const d=h[f];d!==null&&(l.push(f),u.push(d),f==a||typeof d.getSimplifiedGeometry=="function"?f in s.serializers[o]||(s.serializers[o][f]=N(this.writeGeometryElement,this)):f in s.serializers[o]||(s.serializers[o][f]=N(ve)))}}const c=ie({},s);c.node=e,Te(c,s.serializers,Ot(void 0,o),u,i,l)}writeFeatureMembers_(e,t,i){const r=i[i.length-1],s=r.featureType,o=r.featureNS,a={};a[o]={},a[o][s]=N(this.writeFeatureElement,this);const l=ie({},r);l.node=e,Te(l,a,Ot(s,o),t,i)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(e,t,i){const r=t[t.length-1].node;return Ee(this.namespace,NF[r.nodeName])}GEOMETRY_NODE_FACTORY_(e,t,i){const r=t[t.length-1],s=r.multiSurface,o=r.surface,a=r.curve,l=r.multiCurve;let u;return Array.isArray(e)?u="Envelope":(u=e.getType(),u==="MultiPolygon"&&s===!0?u="MultiSurface":u==="Polygon"&&o===!0?u="Surface":u==="LineString"&&a===!0?u="Curve":u==="MultiLineString"&&l===!0&&(u="MultiCurve")),Ee(this.namespace,u)}writeGeometryNode(e,t){t=this.adaptOptions(t);const i=Ee(this.namespace,"geom"),r={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return t&&ie(r,t),this.writeGeometryElement(i,e,[r]),i}writeFeaturesNode(e,t){t=this.adaptOptions(t);const i=Ee(this.namespace,"featureMembers");i.setAttributeNS(to,"xsi:schemaLocation",this.schemaLocation);const r={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return t&&ie(r,t),this.writeFeatureMembers_(i,e,[r]),i}}de.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:me(de.prototype.readFlatPos),posList:me(de.prototype.readFlatPosList),coordinates:me(ya.prototype.readFlatCoordinates)}},de.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:de.prototype.interiorParser,exterior:de.prototype.exteriorParser}},de.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:me(ze.prototype.readPoint),MultiPoint:me(ze.prototype.readMultiPoint),LineString:me(ze.prototype.readLineString),MultiLineString:me(ze.prototype.readMultiLineString),LinearRing:me(ze.prototype.readLinearRing),Polygon:me(ze.prototype.readPolygon),MultiPolygon:me(ze.prototype.readMultiPolygon),Surface:me(de.prototype.readSurface),MultiSurface:me(de.prototype.readMultiSurface),Curve:me(de.prototype.readCurve),MultiCurve:me(de.prototype.readMultiCurve),Envelope:me(de.prototype.readEnvelope)}},de.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:he(de.prototype.curveMemberParser),curveMembers:he(de.prototype.curveMemberParser)}},de.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:he(de.prototype.surfaceMemberParser),surfaceMembers:he(de.prototype.surfaceMemberParser)}},de.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:he(ze.prototype.readLineString),Curve:he(de.prototype.readCurve)}},de.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:he(ze.prototype.readPolygon),Surface:he(de.prototype.readSurface)}},de.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:me(de.prototype.readPatch)}},de.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:me(de.prototype.readSegment)}},de.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:he(de.prototype.readFlatPosList),upperCorner:he(de.prototype.readFlatPosList)}},de.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:me(de.prototype.readPolygonPatch)}},de.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:me(de.prototype.readLineStringSegment)}},de.prototype.writeFeatures,de.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:N(de.prototype.writeRing),interior:N(de.prototype.writeRing)}},de.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:N(ve),upperCorner:N(ve)}},de.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:N(de.prototype.writeSurfaceOrPolygonMember),polygonMember:N(de.prototype.writeSurfaceOrPolygonMember)}},de.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:N(de.prototype.writePointMember)}},de.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:N(de.prototype.writeLineStringOrCurveMember),curveMember:N(de.prototype.writeLineStringOrCurveMember)}},de.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:N(de.prototype.writeCurveOrLineString),MultiCurve:N(de.prototype.writeMultiCurveOrLineString),Point:N(de.prototype.writePoint),MultiPoint:N(de.prototype.writeMultiPoint),LineString:N(de.prototype.writeCurveOrLineString),MultiLineString:N(de.prototype.writeMultiCurveOrLineString),LinearRing:N(de.prototype.writeLinearRing),Polygon:N(de.prototype.writeSurfaceOrPolygon),MultiPolygon:N(de.prototype.writeMultiSurfaceOrPolygon),Surface:N(de.prototype.writeSurfaceOrPolygon),MultiSurface:N(de.prototype.writeMultiSurfaceOrPolygon),Envelope:N(de.prototype.writeEnvelope)}};var Me=de;const sy=Me;sy.prototype.writeFeatures,sy.prototype.writeFeaturesNode;var $F=sy;class st extends Me{constructor(e){const t=e||{};super(t);this.schemaLocation=t.schemaLocation?t.schemaLocation:this.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd"}}st.prototype.namespace="http://www.opengis.net/gml/3.2",st.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:me(Me.prototype.readFlatPos),posList:me(Me.prototype.readFlatPosList),coordinates:me(ya.prototype.readFlatCoordinates)}},st.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:Me.prototype.interiorParser,exterior:Me.prototype.exteriorParser}},st.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:me(ze.prototype.readPoint),MultiPoint:me(ze.prototype.readMultiPoint),LineString:me(ze.prototype.readLineString),MultiLineString:me(ze.prototype.readMultiLineString),LinearRing:me(ze.prototype.readLinearRing),Polygon:me(ze.prototype.readPolygon),MultiPolygon:me(ze.prototype.readMultiPolygon),Surface:me(st.prototype.readSurface),MultiSurface:me(Me.prototype.readMultiSurface),Curve:me(st.prototype.readCurve),MultiCurve:me(Me.prototype.readMultiCurve),Envelope:me(st.prototype.readEnvelope)}},st.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:he(Me.prototype.curveMemberParser),curveMembers:he(Me.prototype.curveMemberParser)}},st.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:he(Me.prototype.surfaceMemberParser),surfaceMembers:he(Me.prototype.surfaceMemberParser)}},st.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:he(ze.prototype.readLineString),Curve:he(Me.prototype.readCurve)}},st.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:he(ze.prototype.readPolygon),Surface:he(Me.prototype.readSurface)}},st.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:me(Me.prototype.readPatch)}},st.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:me(Me.prototype.readSegment)}},st.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:he(Me.prototype.readFlatPosList),upperCorner:he(Me.prototype.readFlatPosList)}},st.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:me(Me.prototype.readPolygonPatch)}},st.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:me(Me.prototype.readLineStringSegment)}},st.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:he(ze.prototype.pointMemberParser),pointMembers:he(ze.prototype.pointMemberParser)}},st.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:he(ze.prototype.lineStringMemberParser),lineStringMembers:he(ze.prototype.lineStringMemberParser)}},st.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:he(ze.prototype.polygonMemberParser),polygonMembers:he(ze.prototype.polygonMemberParser)}},st.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:he(ze.prototype.readFlatCoordinatesFromNode)}},st.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:he(ze.prototype.readLineString)}},st.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:he(ze.prototype.readPolygon)}},st.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:me(ze.prototype.readFlatLinearRing)}},st.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:N(Me.prototype.writeRing),interior:N(Me.prototype.writeRing)}},st.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:N(ve),upperCorner:N(ve)}},st.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:N(Me.prototype.writeSurfaceOrPolygonMember),polygonMember:N(Me.prototype.writeSurfaceOrPolygonMember)}},st.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:N(Me.prototype.writePointMember)}},st.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:N(Me.prototype.writeLineStringOrCurveMember),curveMember:N(Me.prototype.writeLineStringOrCurveMember)}},st.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:N(Me.prototype.writeCurveOrLineString),MultiCurve:N(Me.prototype.writeMultiCurveOrLineString),Point:N(st.prototype.writePoint),MultiPoint:N(Me.prototype.writeMultiPoint),LineString:N(Me.prototype.writeCurveOrLineString),MultiLineString:N(Me.prototype.writeMultiCurveOrLineString),LinearRing:N(Me.prototype.writeLinearRing),Polygon:N(Me.prototype.writeSurfaceOrPolygon),MultiPolygon:N(Me.prototype.writeMultiSurfaceOrPolygon),Surface:N(Me.prototype.writeSurfaceOrPolygon),MultiSurface:N(Me.prototype.writeMultiSurfaceOrPolygon),Envelope:N(Me.prototype.writeEnvelope)}};var Md=st;const oi=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],DF="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",kF={rte:kw,trk:Gw,wpt:Uw},GF=Y(oi,{rte:he(kw),trk:he(Gw),wpt:he(Uw)}),UF=Y(oi,{text:F(H,"linkText"),type:F(H,"linkType")}),zF=Y(oi,{rte:N(hN),trk:N(fN),wpt:N(pN)});class BF extends ga{constructor(e){super();const t=e||{};this.dataProjection=se("EPSG:4326"),this.readExtensions_=t.readExtensions}handleReadExtensions_(e){e||(e=[]);for(let t=0,i=e.length;t<i;++t){const r=e[t];if(this.readExtensions_){const s=r.get("extensionsNode_")||null;this.readExtensions_(r,s)}r.set("extensionsNode_",void 0)}}readFeatureFromNode(e,t){if(!Ye(oi,e.namespaceURI))return null;const i=kF[e.localName];if(!i)return null;const r=i(e,[this.getReadOptions(e,t)]);return r?(this.handleReadExtensions_([r]),r):null}readFeaturesFromNode(e,t){if(!Ye(oi,e.namespaceURI))return[];if(e.localName=="gpx"){const i=W([],GF,e,[this.getReadOptions(e,t)]);return i?(this.handleReadExtensions_(i),i):[]}return[]}writeFeaturesNode(e,t){t=this.adaptOptions(t);const i=Ee("http://www.topografix.com/GPX/1/1","gpx"),r="http://www.w3.org/2000/xmlns/";return i.setAttributeNS(r,"xmlns:xsi",to),i.setAttributeNS(to,"xsi:schemaLocation",DF),i.setAttribute("version","1.1"),i.setAttribute("creator","OpenLayers"),Te({node:i},zF,aN,e,[t]),i}}const jF=Y(oi,{name:F(H),cmt:F(H),desc:F(H),src:F(H),link:ly,number:F(Wt),extensions:uy,type:F(H),rtept:lN}),YF=Y(oi,{ele:F(Ke),time:F(Pd)}),XF=Y(oi,{name:F(H),cmt:F(H),desc:F(H),src:F(H),link:ly,number:F(Wt),type:F(H),extensions:uy,trkseg:cN}),VF=Y(oi,{trkpt:uN}),WF=Y(oi,{ele:F(Ke),time:F(Pd)}),ZF=Y(oi,{ele:F(Ke),time:F(Pd),magvar:F(Ke),geoidheight:F(Ke),name:F(H),cmt:F(H),desc:F(H),src:F(H),link:ly,sym:F(H),type:F(H),fix:F(H),sat:F(Wt),hdop:F(Ke),vdop:F(Ke),pdop:F(Ke),ageofdgpsdata:F(Ke),dgpsid:F(Wt),extensions:uy}),HF=["text","type"],KF=Y(oi,{text:N(ve),type:N(ve)}),qF=Y(oi,["name","cmt","desc","src","link","number","type","rtept"]),JF=Y(oi,{name:N(ve),cmt:N(ve),desc:N(ve),src:N(ve),link:N(cy),number:N(Uc),type:N(ve),rtept:ny(N(hy))}),QF=Y(oi,["ele","time"]),eN=Y(oi,["name","cmt","desc","src","link","number","type","trkseg"]),tN=Y(oi,{name:N(ve),cmt:N(ve),desc:N(ve),src:N(ve),link:N(cy),number:N(Uc),type:N(ve),trkseg:ny(N(dN))}),iN=Ot("trkpt"),nN=Y(oi,{trkpt:N(hy)}),rN=Y(oi,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),sN=Y(oi,{ele:N(Qi),time:N(Dw),magvar:N(Qi),geoidheight:N(Qi),name:N(ve),cmt:N(ve),desc:N(ve),src:N(ve),link:N(cy),sym:N(ve),type:N(ve),fix:N(ve),sat:N(Uc),hdop:N(Qi),vdop:N(Qi),pdop:N(Qi),ageofdgpsdata:N(Qi),dgpsid:N(Uc)}),oN={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function aN(n,e,t){const i=n.getGeometry();if(i){const r=oN[i.getType()];if(r){const s=e[e.length-1].node;return Ee(s.namespaceURI,r)}}}function oy(n,e,t,i){return n.push(parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))),"ele"in i?(n.push(i.ele),delete i.ele,e.hasZ=!0):n.push(0),"time"in i?(n.push(i.time),delete i.time,e.hasM=!0):n.push(0),n}function ay(n,e,t){let i=q.XY,r=2;if(n.hasZ&&n.hasM?(i=q.XYZM,r=4):n.hasZ?(i=q.XYZ,r=3):n.hasM&&(i=q.XYM,r=3),r!==4){for(let s=0,o=e.length/4;s<o;s++)e[s*r]=e[s*4],e[s*r+1]=e[s*4+1],n.hasZ&&(e[s*r+2]=e[s*4+2]),n.hasM&&(e[s*r+2]=e[s*4+3]);if(e.length=e.length/4*r,t)for(let s=0,o=t.length;s<o;s++)t[s]=t[s]/4*r}return i}function ly(n,e){const t=e[e.length-1],i=n.getAttribute("href");i!==null&&(t.link=i),Ji(UF,n,e)}function uy(n,e){const t=e[e.length-1];t.extensionsNode_=n}function lN(n,e){const t=W({},YF,n,e);if(t){const i=e[e.length-1],r=i.flatCoordinates,s=i.layoutOptions;oy(r,s,n,t)}}function uN(n,e){const t=W({},WF,n,e);if(t){const i=e[e.length-1],r=i.flatCoordinates,s=i.layoutOptions;oy(r,s,n,t)}}function cN(n,e){const t=e[e.length-1];Ji(VF,n,e);const i=t.flatCoordinates;t.ends.push(i.length)}function kw(n,e){const t=e[0],i=W({flatCoordinates:[],layoutOptions:{}},jF,n,e);if(!i)return;const r=i.flatCoordinates;delete i.flatCoordinates;const s=i.layoutOptions;delete i.layoutOptions;const o=ay(s,r),a=new Gt(r,o);yt(a,!1,t);const l=new lt(a);return l.setProperties(i,!0),l}function Gw(n,e){const t=e[0],i=W({flatCoordinates:[],ends:[],layoutOptions:{}},XF,n,e);if(!i)return;const r=i.flatCoordinates;delete i.flatCoordinates;const s=i.ends;delete i.ends;const o=i.layoutOptions;delete i.layoutOptions;const a=ay(o,r,s),l=new yn(r,a,s);yt(l,!1,t);const u=new lt(l);return u.setProperties(i,!0),u}function Uw(n,e){const t=e[0],i=W({},ZF,n,e);if(!i)return;const r={},s=oy([],r,n,i),o=ay(r,s),a=new Et(s,o);yt(a,!1,t);const l=new lt(a);return l.setProperties(i,!0),l}function cy(n,e,t){n.setAttribute("href",e);const r=t[t.length-1].properties,s=[r.linkText,r.linkType];Te({node:n},KF,gi,s,t,HF)}function hy(n,e,t){const i=t[t.length-1],s=i.node.namespaceURI,o=i.properties;switch(n.setAttributeNS(null,"lat",String(e[1])),n.setAttributeNS(null,"lon",String(e[0])),i.geometryLayout){case q.XYZM:e[3]!==0&&(o.time=e[3]);case q.XYZ:e[2]!==0&&(o.ele=e[2]);break;case q.XYM:e[2]!==0&&(o.time=e[2]);break}const l=n.nodeName=="rtept"?QF[s]:rN[s],u=qi(o,l);Te({node:n,properties:o},sN,gi,u,t,l)}function hN(n,e,t){const i=t[0],r=e.getProperties(),s={node:n};s.properties=r;const o=e.getGeometry();if(o.getType()==M.LINE_STRING){const c=yt(o,!0,i);s.geometryLayout=c.getLayout(),r.rtept=c.getCoordinates()}const a=t[t.length-1].node,l=qF[a.namespaceURI],u=qi(r,l);Te(s,JF,gi,u,t,l)}function fN(n,e,t){const i=t[0],r=e.getProperties(),s={node:n};s.properties=r;const o=e.getGeometry();if(o.getType()==M.MULTI_LINE_STRING){const c=yt(o,!0,i);r.trkseg=c.getLineStrings()}const a=t[t.length-1].node,l=eN[a.namespaceURI],u=qi(r,l);Te(s,tN,gi,u,t,l)}function dN(n,e,t){const i={node:n};i.geometryLayout=e.getLayout(),i.properties={},Te(i,nN,iN,e.getCoordinates(),t)}function pN(n,e,t){const i=t[0],r=t[t.length-1];r.properties=e.getProperties();const s=e.getGeometry();if(s.getType()==M.POINT){const o=yt(s,!0,i);r.geometryLayout=o.getLayout(),hy(n,o.getCoordinates(),t)}}var gN=BF;class Bg extends Dm{constructor(e){super();this.geometries_=e||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(He),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(!!this.geometries_)for(let e=0,t=this.geometries_.length;e<t;++e)this.changeEventsKeys_.push(ge(this.geometries_[e],re.CHANGE,this.changed,this))}clone(){const e=new Bg(null);return e.setGeometries(this.geometries_),e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Gs(this.getExtent(),e,t))return r;const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)r=s[o].closestPointXY(e,t,i,r);return r}containsXY(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)if(i[r].containsXY(e,t))return!0;return!1}computeExtent(e){Us(e);const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)gm(e,t[i].getExtent());return e}getGeometries(){return zw(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[];const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].getType()===this.getType()?e=e.concat(t[i].getGeometriesArrayRecursive()):e.push(t[i]);return e}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=[],i=this.geometries_;let r=!1;for(let s=0,o=i.length;s<o;++s){const a=i[s],l=a.getSimplifiedGeometry(e);t.push(l),l!==a&&(r=!0)}if(r){const s=new Bg(null);return s.setGeometriesArray(t),s}else return this.simplifiedGeometryMaxMinSquaredTolerance=e,this}getType(){return M.GEOMETRY_COLLECTION}intersectsExtent(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)if(t[i].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].rotate(e,t);this.changed()}scale(e,t,i){let r=i;r||(r=fi(this.getExtent()));const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)s[o].scale(e,t,r);this.changed()}setGeometries(e){this.setGeometriesArray(zw(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].applyTransform(e);this.changed()}translate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function zw(n){const e=[];for(let t=0,i=n.length;t<i;++t)e.push(n[t].clone());return e}var Pi=Bg;class mN extends Ld{constructor(e){const t=e||{};super();this.dataProjection=se(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=se(t.featureProjection)),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,t){let i=null;e.type==="Feature"?i=e:i={type:"Feature",geometry:e,properties:null};const r=fy(i.geometry,t),s=new lt;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&s.setGeometryName(i.geometry_name),s.setGeometry(r),"id"in i&&s.setId(i.id),i.properties&&s.setProperties(i.properties,!0),s}readFeaturesFromObject(e,t){const i=e;let r=null;if(i.type==="FeatureCollection"){const s=e;r=[];const o=s.features;for(let a=0,l=o.length;a<l;++a)r.push(this.readFeatureFromObject(o[a],t))}else r=[this.readFeatureFromObject(e,t)];return r}readGeometryFromObject(e,t){return fy(e,t)}readProjectionFromObject(e){const t=e.crs;let i;return t?t.type=="name"?i=se(t.properties.name):t.type==="EPSG"?i=se("EPSG:"+t.properties.code):ce(!1,36):i=this.dataProjection,i}writeFeatureObject(e,t){t=this.adaptOptions(t);const i={type:"Feature",geometry:null,properties:null},r=e.getId();if(r!==void 0&&(i.id=r),!e.hasProperties())return i;const s=e.getProperties(),o=e.getGeometry();return o&&(i.geometry=dy(o,t),delete s[e.getGeometryName()]),Wn(s)||(i.properties=s),i}writeFeaturesObject(e,t){t=this.adaptOptions(t);const i=[];for(let r=0,s=e.length;r<s;++r)i.push(this.writeFeatureObject(e[r],t));return{type:"FeatureCollection",features:i}}writeGeometryObject(e,t){return dy(e,this.adaptOptions(t))}}function fy(n,e){if(!n)return null;let t;switch(n.type){case M.POINT:{t=_N(n);break}case M.LINE_STRING:{t=vN(n);break}case M.POLYGON:{t=wN(n);break}case M.MULTI_POINT:{t=EN(n);break}case M.MULTI_LINE_STRING:{t=xN(n);break}case M.MULTI_POLYGON:{t=TN(n);break}case M.GEOMETRY_COLLECTION:{t=yN(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return yt(t,!1,e)}function yN(n,e){const t=n.geometries.map(function(i){return fy(i,e)});return new Pi(t)}function _N(n){return new Et(n.coordinates)}function vN(n){return new Gt(n.coordinates)}function xN(n){return new yn(n.coordinates)}function EN(n){return new Nn(n.coordinates)}function TN(n){return new $n(n.coordinates)}function wN(n){return new pi(n.coordinates)}function dy(n,e){n=yt(n,!0,e);const t=n.getType();let i;switch(t){case M.POINT:{i=LN(n);break}case M.LINE_STRING:{i=RN(n);break}case M.POLYGON:{i=ON(n,e);break}case M.MULTI_POINT:{i=IN(n);break}case M.MULTI_LINE_STRING:{i=bN(n);break}case M.MULTI_POLYGON:{i=CN(n,e);break}case M.GEOMETRY_COLLECTION:{i=SN(n,e);break}case M.CIRCLE:{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return i}function SN(n,e){const t=n.getGeometriesArray().map(function(i){const r=ie({},e);return delete r.featureProjection,dy(i,r)});return{type:"GeometryCollection",geometries:t}}function RN(n,e){return{type:"LineString",coordinates:n.getCoordinates()}}function bN(n,e){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function IN(n,e){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function CN(n,e){let t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(t)}}function LN(n,e){return{type:"Point",coordinates:n.getCoordinates()}}function ON(n,e){let t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(t)}}var AN=mN;class PN extends $l{constructor(){super()}getType(){return mn.TEXT}readFeature(e,t){return this.readFeatureFromText(Fd(e),this.adaptOptions(t))}readFeatureFromText(e,t){return fe()}readFeatures(e,t){return this.readFeaturesFromText(Fd(e),this.adaptOptions(t))}readFeaturesFromText(e,t){return fe()}readGeometry(e,t){return this.readGeometryFromText(Fd(e),this.adaptOptions(t))}readGeometryFromText(e,t){return fe()}readProjection(e){return this.readProjectionFromText(Fd(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,t){return this.writeFeatureText(e,this.adaptOptions(t))}writeFeatureText(e,t){return fe()}writeFeatures(e,t){return this.writeFeaturesText(e,this.adaptOptions(t))}writeFeaturesText(e,t){return fe()}writeGeometry(e,t){return this.writeGeometryText(e,this.adaptOptions(t))}writeGeometryText(e,t){return fe()}}function Fd(n){return typeof n=="string"?n:""}var Nd=PN;const zc={BAROMETRIC:"barometric",GPS:"gps",NONE:"none"},MN=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,FN=/^H.([A-Z]{3}).*?:(.*)/,NN=/^HFDTE(\d{2})(\d{2})(\d{2})/,$N=/\r\n|\r|\n/;class DN extends Nd{constructor(e){super();const t=e||{};this.dataProjection=se("EPSG:4326"),this.altitudeMode_=t.altitudeMode?t.altitudeMode:zc.NONE}readFeatureFromText(e,t){const i=this.altitudeMode_,r=e.split($N),s={},o=[];let a=2e3,l=0,u=1,c=-1,h,f;for(h=0,f=r.length;h<f;++h){const g=r[h];let v;if(g.charAt(0)=="B"){if(v=MN.exec(g),v){const y=parseInt(v[1],10),x=parseInt(v[2],10),_=parseInt(v[3],10);let E=parseInt(v[4],10)+parseInt(v[5],10)/6e4;v[6]=="S"&&(E=-E);let T=parseInt(v[7],10)+parseInt(v[8],10)/6e4;if(v[9]=="W"&&(T=-T),o.push(T,E),i!=zc.NONE){let S;i==zc.GPS?S=parseInt(v[11],10):i==zc.BAROMETRIC?S=parseInt(v[12],10):S=0,o.push(S)}let w=Date.UTC(a,l,u,y,x,_);w<c&&(w=Date.UTC(a,l,u+1,y,x,_)),o.push(w/1e3),c=w}}else g.charAt(0)=="H"&&(v=NN.exec(g),v?(u=parseInt(v[1],10),l=parseInt(v[2],10)-1,a=2e3+parseInt(v[3],10)):(v=FN.exec(g),v&&(s[v[1]]=v[2].trim())))}if(o.length===0)return null;const d=i==zc.NONE?q.XYM:q.XYZM,p=new Gt(o,d),m=new lt(yt(p,!1,t));return m.setProperties(s,!0),m}readFeaturesFromText(e,t){const i=this.readFeatureFromText(e,t);return i?[i]:[]}}var kN=DN;const Jt={VERSION1:"version1",VERSION2:"version2",VERSION3:"version3"},_a={};_a[Jt.VERSION1]={level0:{supports:[],formats:[],qualities:["native"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["native"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["native","color","grey","bitonal"]}},_a[Jt.VERSION2]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByDistortedWh","sizeByWh"],formats:["jpg","png"],qualities:["default","bitonal"]}},_a[Jt.VERSION3]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","regionSquare","sizeByW","sizeByH","sizeByWh"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionSquare","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["default"]}},_a.none={none:{supports:[],formats:[],qualities:[]}};const GN=/^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/,Bw=/^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/,UN=/(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/;function zN(n){let e=n.getComplianceLevelSupportedFeatures();return e===void 0&&(e=_a[Jt.VERSION1].level0),{url:n.imageInfo["@id"]===void 0?void 0:n.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),supports:e.supports,formats:[...e.formats,n.imageInfo.formats===void 0?[]:n.imageInfo.formats],qualities:[...e.qualities,n.imageInfo.qualities===void 0?[]:n.imageInfo.qualities],resolutions:n.imageInfo.scale_factors,tileSize:n.imageInfo.tile_width!==void 0?n.imageInfo.tile_height!==void 0?[n.imageInfo.tile_width,n.imageInfo.tile_height]:[n.imageInfo.tile_width,n.imageInfo.tile_width]:n.imageInfo.tile_height!=null?[n.imageInfo.tile_height,n.imageInfo.tile_height]:void 0}}function BN(n){const e=n.getComplianceLevelSupportedFeatures(),t=Array.isArray(n.imageInfo.profile)&&n.imageInfo.profile.length>1,i=t&&n.imageInfo.profile[1].supports?n.imageInfo.profile[1].supports:[],r=t&&n.imageInfo.profile[1].formats?n.imageInfo.profile[1].formats:[],s=t&&n.imageInfo.profile[1].qualities?n.imageInfo.profile[1].qualities:[];return{url:n.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:n.imageInfo.sizes===void 0?void 0:n.imageInfo.sizes.map(function(o){return[o.width,o.height]}),tileSize:n.imageInfo.tiles===void 0?void 0:[n.imageInfo.tiles.map(function(o){return o.width})[0],n.imageInfo.tiles.map(function(o){return o.height===void 0?o.width:o.height})[0]],resolutions:n.imageInfo.tiles===void 0?void 0:n.imageInfo.tiles.map(function(o){return o.scaleFactors})[0],supports:[...e.supports,...i],formats:[...e.formats,...r],qualities:[...e.qualities,...s]}}function jN(n){const e=n.getComplianceLevelSupportedFeatures(),t=n.imageInfo.extraFormats===void 0?e.formats:[...e.formats,...n.imageInfo.extraFormats],i=n.imageInfo.preferredFormats!==void 0&&Array.isArray(n.imageInfo.preferredFormats)&&n.imageInfo.preferredFormats.length>0?n.imageInfo.preferredFormats.filter(function(r){return Ye(["jpg","png","gif"],r)}).reduce(function(r,s){return r===void 0&&Ye(t,s)?s:r},void 0):void 0;return{url:n.imageInfo.id,sizes:n.imageInfo.sizes===void 0?void 0:n.imageInfo.sizes.map(function(r){return[r.width,r.height]}),tileSize:n.imageInfo.tiles===void 0?void 0:[n.imageInfo.tiles.map(function(r){return r.width})[0],n.imageInfo.tiles.map(function(r){return r.height})[0]],resolutions:n.imageInfo.tiles===void 0?void 0:n.imageInfo.tiles.map(function(r){return r.scaleFactors})[0],supports:n.imageInfo.extraFeatures===void 0?e.supports:[...e.supports,...n.imageInfo.extraFeatures],formats:t,qualities:n.imageInfo.extraQualities===void 0?e.qualities:[...e.qualities,...n.imageInfo.extraQualities],preferredFormat:i}}const $d={};$d[Jt.VERSION1]=zN,$d[Jt.VERSION2]=BN,$d[Jt.VERSION3]=jN;class YN{constructor(e){this.setImageInfo(e)}setImageInfo(e){typeof e=="string"?this.imageInfo=JSON.parse(e):this.imageInfo=e}getImageApiVersion(){if(this.imageInfo===void 0)return;let e=this.imageInfo["@context"]||"ol-no-context";typeof e=="string"&&(e=[e]);for(let t=0;t<e.length;t++)switch(e[t]){case"http://library.stanford.edu/iiif/image-api/1.1/context.json":case"http://iiif.io/api/image/1/context.json":return Jt.VERSION1;case"http://iiif.io/api/image/2/context.json":return Jt.VERSION2;case"http://iiif.io/api/image/3/context.json":return Jt.VERSION3;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(Jt.VERSION1)&&this.imageInfo.identifier)return Jt.VERSION1;break}ce(!1,61)}getComplianceLevelEntryFromProfile(e){if(!(this.imageInfo===void 0||this.imageInfo.profile===void 0))switch(e===void 0&&(e=this.getImageApiVersion()),e){case Jt.VERSION1:if(GN.test(this.imageInfo.profile))return this.imageInfo.profile;break;case Jt.VERSION3:if(UN.test(this.imageInfo.profile))return this.imageInfo.profile;break;case Jt.VERSION2:if(typeof this.imageInfo.profile=="string"&&Bw.test(this.imageInfo.profile))return this.imageInfo.profile;if(Array.isArray(this.imageInfo.profile)&&this.imageInfo.profile.length>0&&typeof this.imageInfo.profile[0]=="string"&&Bw.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0];break}}getComplianceLevelFromProfile(e){const t=this.getComplianceLevelEntryFromProfile(e);if(t===void 0)return;const i=t.match(/level[0-2](?:\.json)?$/g);return Array.isArray(i)?i[0].replace(".json",""):void 0}getComplianceLevelSupportedFeatures(){if(this.imageInfo===void 0)return;const e=this.getImageApiVersion(),t=this.getComplianceLevelFromProfile(e);return t===void 0?_a.none.none:_a[e][t]}getTileSourceOptions(e){const t=e||{},i=this.getImageApiVersion();if(i===void 0)return;const r=i===void 0?void 0:$d[i](this);if(r!==void 0)return{url:r.url,version:i,size:[this.imageInfo.width,this.imageInfo.height],sizes:r.sizes,format:t.format!==void 0&&Ye(r.formats,t.format)?t.format:r.preferredFormat!==void 0?r.preferredFormat:"jpg",supports:r.supports,quality:t.quality&&Ye(r.qualities,t.quality)?t.quality:Ye(r.qualities,"native")?"native":"default",resolutions:Array.isArray(r.resolutions)?r.resolutions.sort(function(s,o){return o-s}):void 0,tileSize:r.tileSize}}}var XN=YN;const ns=["http://www.google.com/kml/ext/2.2"],pe=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],VN="http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd",jw={fraction:Bi.FRACTION,pixels:Bi.PIXELS,insetPixels:Bi.PIXELS},WN=Y(pe,{ExtendedData:nS,Region:rS,MultiGeometry:F(eS,"geometry"),LineString:F(Jw,"geometry"),LinearRing:F(Qw,"geometry"),Point:F(tS,"geometry"),Polygon:F(iS,"geometry"),Style:F(xy),StyleMap:N$,address:F(H),description:F(H),name:F(H),open:F(is),phoneNumber:F(H),styleUrl:F(Ww),visibility:F(is)},Y(ns,{MultiTrack:F(T$,"geometry"),Track:F(qw,"geometry")})),ZN=Y(pe,{ExtendedData:nS,Region:rS,Link:W$,address:F(H),description:F(H),name:F(H),open:F(is),phoneNumber:F(H),visibility:F(is)}),HN=Y(pe,{href:F(Vw)}),Yw=Y(pe,{LatLonAltBox:U$,Lod:B$}),KN=Y(pe,["Document","Placemark"]),qN=Y(pe,{Document:N(tD),Placemark:N(cS)});let kl,Bc=null;function JN(){return Bc}let py,jc,Yc,Xc,Dd,kd=null;function QN(){return kd}let gy,Gd=null;function e$(){return Gd}let my,no=null;function t$(){return no}let yy=null;function i$(){return yy}let Ud=null;function n$(){return Ud}function zd(n){return 32/Math.min(n[0],n[1])}function r$(){kl=[255,255,255,1],Bc=new xr({color:kl}),py=[20,2],jc=Bi.PIXELS,Yc=Bi.PIXELS,Xc=[64,64],Dd="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",kd=new _d({anchor:py,anchorOrigin:ri.BOTTOM_LEFT,anchorXUnits:jc,anchorYUnits:Yc,crossOrigin:"anonymous",rotation:0,scale:zd(Xc),size:Xc,src:Dd}),gy="NO_IMAGE",Gd=new ir({color:kl,width:1}),my=new ir({color:[51,51,51,1],width:2}),no=new Pc({font:"bold 16px Helvetica",fill:Bc,stroke:my,scale:.8}),yy=new Er({fill:Bc,image:kd,text:no,stroke:Gd,zIndex:0}),Ud=[yy]}let Bd;function s$(n){return n}class o$ extends ga{constructor(e){super();const t=e||{};Ud||r$(),this.dataProjection=se("EPSG:4326"),this.defaultStyle_=t.defaultStyle?t.defaultStyle:Ud,this.extractStyles_=t.extractStyles!==void 0?t.extractStyles:!0,this.writeStyles_=t.writeStyles!==void 0?t.writeStyles:!0,this.sharedStyles_={},this.showPointNames_=t.showPointNames!==void 0?t.showPointNames:!0,this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",this.iconUrlFunction_=t.iconUrlFunction?t.iconUrlFunction:s$,this.supportedMediaTypes=["application/vnd.google-earth.kml+xml"]}readDocumentOrFolder_(e,t){const i=Y(pe,{Document:iy(this.readDocumentOrFolder_,this),Folder:iy(this.readDocumentOrFolder_,this),Placemark:he(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),r=W([],i,e,t,this);if(r)return r}readPlacemark_(e,t){const i=W({geometry:null},WN,e,t,this);if(!i)return;const r=new lt,s=e.getAttribute("id");s!==null&&r.setId(s);const o=t[0],a=i.geometry;if(a&&yt(a,!1,o),r.setGeometry(a),delete i.geometry,this.extractStyles_){const l=i.Style,u=i.styleUrl,c=l$(l,u,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);r.setStyle(c)}return delete i.Style,r.setProperties(i,!0),r}readSharedStyle_(e,t){const i=e.getAttribute("id");if(i!==null){const r=xy.call(this,e,t);if(r){let s,o=e.baseURI;(!o||o=="about:blank")&&(o=window.location.href),o?s=new URL("#"+i,o).href:s="#"+i,this.sharedStyles_[s]=r}}}readSharedStyleMap_(e,t){const i=e.getAttribute("id");if(i===null)return;const r=Hw.call(this,e,t);if(!r)return;let s,o=e.baseURI;(!o||o=="about:blank")&&(o=window.location.href),o?s=new URL("#"+i,o).href:s="#"+i,this.sharedStyles_[s]=r}readFeatureFromNode(e,t){if(!Ye(pe,e.namespaceURI))return null;const i=this.readPlacemark_(e,[this.getReadOptions(e,t)]);return i||null}readFeaturesFromNode(e,t){if(!Ye(pe,e.namespaceURI))return[];let i;const r=e.localName;if(r=="Document"||r=="Folder")return i=this.readDocumentOrFolder_(e,[this.getReadOptions(e,t)]),i||[];if(r=="Placemark"){const s=this.readPlacemark_(e,[this.getReadOptions(e,t)]);return s?[s]:[]}else if(r=="kml"){i=[];for(let s=e.firstElementChild;s;s=s.nextElementSibling){const o=this.readFeaturesFromNode(s,t);o&&qe(i,o)}return i}else return[]}readName(e){if(e)if(typeof e=="string"){const t=rr(e);return this.readNameFromDocument(t)}else return nr(e)?this.readNameFromDocument(e):this.readNameFromNode(e);else return}readNameFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE){const i=this.readNameFromNode(t);if(i)return i}}readNameFromNode(e){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(Ye(pe,t.namespaceURI)&&t.localName=="name")return H(t);for(let t=e.firstElementChild;t;t=t.nextElementSibling){const i=t.localName;if(Ye(pe,t.namespaceURI)&&(i=="Document"||i=="Folder"||i=="Placemark"||i=="kml")){const r=this.readNameFromNode(t);if(r)return r}}}readNetworkLinks(e){const t=[];if(typeof e=="string"){const i=rr(e);qe(t,this.readNetworkLinksFromDocument(i))}else nr(e)?qe(t,this.readNetworkLinksFromDocument(e)):qe(t,this.readNetworkLinksFromNode(e));return t}readNetworkLinksFromDocument(e){const t=[];for(let i=e.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&qe(t,this.readNetworkLinksFromNode(i));return t}readNetworkLinksFromNode(e){const t=[];for(let i=e.firstElementChild;i;i=i.nextElementSibling)if(Ye(pe,i.namespaceURI)&&i.localName=="NetworkLink"){const r=W({},ZN,i,[]);t.push(r)}for(let i=e.firstElementChild;i;i=i.nextElementSibling){const r=i.localName;Ye(pe,i.namespaceURI)&&(r=="Document"||r=="Folder"||r=="kml")&&qe(t,this.readNetworkLinksFromNode(i))}return t}readRegion(e){const t=[];if(typeof e=="string"){const i=rr(e);qe(t,this.readRegionFromDocument(i))}else nr(e)?qe(t,this.readRegionFromDocument(e)):qe(t,this.readRegionFromNode(e));return t}readRegionFromDocument(e){const t=[];for(let i=e.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&qe(t,this.readRegionFromNode(i));return t}readRegionFromNode(e){const t=[];for(let i=e.firstElementChild;i;i=i.nextElementSibling)if(Ye(pe,i.namespaceURI)&&i.localName=="Region"){const r=W({},Yw,i,[]);t.push(r)}for(let i=e.firstElementChild;i;i=i.nextElementSibling){const r=i.localName;Ye(pe,i.namespaceURI)&&(r=="Document"||r=="Folder"||r=="kml")&&qe(t,this.readRegionFromNode(i))}return t}writeFeaturesNode(e,t){t=this.adaptOptions(t);const i=Ee(pe[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",ns[0]),i.setAttributeNS(r,"xmlns:xsi",to),i.setAttributeNS(to,"xsi:schemaLocation",VN);const s={node:i},o={};e.length>1?o.Document=e:e.length==1&&(o.Placemark=e[0]);const a=KN[i.namespaceURI],l=qi(o,a);return Te(s,qN,gi,l,[t],a,this),i}}function a$(n,e){const t=[0,0];let i="start";const r=n.getImage();if(r){const a=r.getSize();if(a&&a.length==2){const l=r.getScaleArray(),u=r.getAnchor();t[0]=l[0]*(a[0]-u[0]),t[1]=l[1]*(a[1]/2-u[1]),i="left"}}let s=n.getText();return s?(s=s.clone(),s.setFont(s.getFont()||no.getFont()),s.setScale(s.getScale()||no.getScale()),s.setFill(s.getFill()||no.getFill()),s.setStroke(s.getStroke()||my)):s=no.clone(),s.setText(e),s.setOffsetX(t[0]),s.setOffsetY(t[1]),s.setTextAlign(i),new Er({image:r,text:s})}function l$(n,e,t,i,r){return function(s,o){let a=r,l="",u=[];if(a){const h=s.getGeometry();if(h)if(h instanceof Pi)u=h.getGeometriesArrayRecursive().filter(function(f){const d=f.getType();return d===M.POINT||d===M.MULTI_POINT}),a=u.length>0;else{const f=h.getType();a=f===M.POINT||f===M.MULTI_POINT}}a&&(l=s.get("name"),a=a&&!!l,a&&l.search(/&[^&]+;/)>-1&&(Bd||(Bd=document.createElement("textarea")),Bd.innerHTML=l,l=Bd.value));let c=t;if(n?c=n:e&&(c=Xw(e,t,i)),a){const h=a$(c[0],l);if(u.length>0){h.setGeometry(new Pi(u));const f=new Er({geometry:c[0].getGeometry(),image:null,fill:c[0].getFill(),stroke:c[0].getStroke(),text:null});return[h,f].concat(c.slice(1))}return h}return c}}function Xw(n,e,t){return Array.isArray(n)?n:typeof n=="string"?Xw(t[n],e,t):e}function jd(n){const e=ji(n,!1),t=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(t){const i=t[1];return[parseInt(i.substr(6,2),16),parseInt(i.substr(4,2),16),parseInt(i.substr(2,2),16),parseInt(i.substr(0,2),16)/255]}else return}function _y(n){let e=ji(n,!1);const t=[];e=e.replace(/\s*,\s*/g,",");const i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;let r;for(;r=i.exec(e);){const s=parseFloat(r[1]),o=parseFloat(r[2]),a=r[3]?parseFloat(r[3]):0;t.push(s,o,a),e=e.substr(r[0].length)}if(e==="")return t}function Vw(n){const e=ji(n,!1).trim();let t=n.baseURI;return(!t||t=="about:blank")&&(t=window.location.href),t?new URL(e,t).href:e}function Ww(n){const e=ji(n,!1).trim().replace(/^(?!.*#)/,"#");let t=n.baseURI;return(!t||t=="about:blank")&&(t=window.location.href),t?new URL(e,t).href:e}function u$(n){const e=n.getAttribute("xunits"),t=n.getAttribute("yunits");let i;return e!=="insetPixels"?t!=="insetPixels"?i=ri.BOTTOM_LEFT:i=ri.TOP_LEFT:t!=="insetPixels"?i=ri.BOTTOM_RIGHT:i=ri.TOP_RIGHT,{x:parseFloat(n.getAttribute("x")),xunits:jw[e],y:parseFloat(n.getAttribute("y")),yunits:jw[t],origin:i}}function Zw(n){return Ke(n)}const c$=Y(pe,{Pair:F$});function Hw(n,e){return W(void 0,c$,n,e,this)}const h$=Y(pe,{Icon:F(R$),color:F(jd),heading:F(Ke),hotSpot:F(u$),scale:F(Zw)});function f$(n,e){const t=W({},h$,n,e);if(!t)return;const i=e[e.length-1],r="Icon"in t?t.Icon:{},s=!("Icon"in t)||Object.keys(r).length>0;let o;const a=r.href;a?o=a:s&&(o=Dd);let l,u,c,h=ri.BOTTOM_LEFT;const f=t.hotSpot;f?(l=[f.x,f.y],u=f.xunits,c=f.yunits,h=f.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(o)&&(/pushpin/.test(o)?(l=py,u=jc,c=Yc):/arrow-reverse/.test(o)?(l=[54,42],u=jc,c=Yc):/paddle/.test(o)&&(l=[32,1],u=jc,c=Yc));let d;const p=r.x,m=r.y;p!==void 0&&m!==void 0&&(d=[p,m]);let g;const v=r.w,y=r.h;v!==void 0&&y!==void 0&&(g=[v,y]);let x;const _=t.heading;_!==void 0&&(x=di(_));const E=t.scale,T=t.color;if(s){o==Dd&&(g=Xc);const w=new _d({anchor:l,anchorOrigin:h,anchorXUnits:u,anchorYUnits:c,crossOrigin:this.crossOrigin_,offset:d,offsetOrigin:ri.BOTTOM_LEFT,rotation:x,scale:E,size:g,src:this.iconUrlFunction_(o),color:T}),S=w.getScaleArray()[0],R=w.getSize();if(R===null){const b=w.getImageState();if(b===ye.IDLE||b===ye.LOADING){const I=function(){const O=w.getImageState();if(!(O===ye.IDLE||O===ye.LOADING)){const P=w.getSize();if(P&&P.length==2){const B=zd(P);w.setScale(S*B)}w.unlistenImageChange(I)}};w.listenImageChange(I),b===ye.IDLE&&w.load()}}else if(R.length==2){const b=zd(R);w.setScale(S*b)}i.imageStyle=w}else i.imageStyle=gy}const d$=Y(pe,{color:F(jd),scale:F(Zw)});function p$(n,e){const t=W({},d$,n,e);if(!t)return;const i=e[e.length-1],r=new Pc({fill:new xr({color:"color"in t?t.color:kl}),scale:t.scale});i.textStyle=r}const g$=Y(pe,{color:F(jd),width:F(Ke)});function m$(n,e){const t=W({},g$,n,e);if(!t)return;const i=e[e.length-1],r=new ir({color:"color"in t?t.color:kl,width:"width"in t?t.width:1});i.strokeStyle=r}const y$=Y(pe,{color:F(jd),fill:F(is),outline:F(is)});function _$(n,e){const t=W({},y$,n,e);if(!t)return;const i=e[e.length-1],r=new xr({color:"color"in t?t.color:kl});i.fillStyle=r;const s=t.fill;s!==void 0&&(i.fill=s);const o=t.outline;o!==void 0&&(i.outline=o)}const v$=Y(pe,{coordinates:me(_y)});function Kw(n,e){return W(null,v$,n,e)}function x$(n,e){const i=e[e.length-1].coordinates,r=ji(n,!1),o=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(o){const a=parseFloat(o[1]),l=parseFloat(o[2]),u=parseFloat(o[3]);i.push([a,l,u])}else i.push([])}const E$=Y(ns,{Track:he(qw)});function T$(n,e){const t=W([],E$,n,e);if(!!t)return new yn(t)}const w$=Y(pe,{when:Z$},Y(ns,{coord:x$}));function qw(n,e){const t=W({coordinates:[],whens:[]},w$,n,e);if(!t)return;const i=[],r=t.coordinates,s=t.whens;for(let o=0,a=Math.min(r.length,s.length);o<a;++o)r[o].length==3&&i.push(r[o][0],r[o][1],r[o][2],s[o]);return new Gt(i,q.XYZM)}const S$=Y(pe,{href:F(Vw)},Y(ns,{x:F(Ke),y:F(Ke),w:F(Ke),h:F(Ke)}));function R$(n,e){const t=W({},S$,n,e);return t||null}const b$=Y(pe,{coordinates:me(_y)});function vy(n,e){return W(null,b$,n,e)}const Yd=Y(pe,{extrude:F(is),tessellate:F(is),altitudeMode:F(H)});function Jw(n,e){const t=W({},Yd,n,e),i=vy(n,e);if(i){const r=new Gt(i,q.XYZ);return r.setProperties(t,!0),r}else return}function Qw(n,e){const t=W({},Yd,n,e),i=vy(n,e);if(i){const r=new pi(i,q.XYZ,[i.length]);return r.setProperties(t,!0),r}else return}const I$=Y(pe,{LineString:he(Jw),LinearRing:he(Qw),MultiGeometry:he(eS),Point:he(tS),Polygon:he(iS)});function eS(n,e){const t=W([],I$,n,e);if(!t)return null;if(t.length===0)return new Pi(t);let i,r=!0;const s=t[0].getType();let o;for(let a=1,l=t.length;a<l;++a)if(o=t[a],o.getType()!=s){r=!1;break}if(r){let a,l;if(s==M.POINT){const u=t[0];a=u.getLayout(),l=u.getFlatCoordinates();for(let c=1,h=t.length;c<h;++c)o=t[c],qe(l,o.getFlatCoordinates());i=new Nn(l,a),Ey(i,t)}else s==M.LINE_STRING?(i=new yn(t),Ey(i,t)):s==M.POLYGON?(i=new $n(t),Ey(i,t)):s==M.GEOMETRY_COLLECTION?i=new Pi(t):ce(!1,37)}else i=new Pi(t);return i}function tS(n,e){const t=W({},Yd,n,e),i=vy(n,e);if(i){const r=new Et(i,q.XYZ);return r.setProperties(t,!0),r}else return}const C$=Y(pe,{innerBoundaryIs:Y$,outerBoundaryIs:V$});function iS(n,e){const t=W({},Yd,n,e),i=W([null],C$,n,e);if(i&&i[0]){const r=i[0],s=[r.length];for(let a=1,l=i.length;a<l;++a)qe(r,i[a]),s.push(r.length);const o=new pi(r,q.XYZ,s);return o.setProperties(t,!0),o}else return}const L$=Y(pe,{IconStyle:f$,LabelStyle:p$,LineStyle:m$,PolyStyle:_$});function xy(n,e){const t=W({},L$,n,e,this);if(!t)return null;let i="fillStyle"in t?t.fillStyle:Bc;const r=t.fill;r!==void 0&&!r&&(i=null);let s;"imageStyle"in t?t.imageStyle!=gy&&(s=t.imageStyle):s=kd;const o="textStyle"in t?t.textStyle:no,a="strokeStyle"in t?t.strokeStyle:Gd,l=t.outline;return l!==void 0&&!l?[new Er({geometry:function(u){const c=u.getGeometry(),h=c.getType();if(h===M.GEOMETRY_COLLECTION){const f=c;return new Pi(f.getGeometriesArrayRecursive().filter(function(d){const p=d.getType();return p!==M.POLYGON&&p!==M.MULTI_POLYGON}))}else if(h!==M.POLYGON&&h!==M.MULTI_POLYGON)return c},fill:i,image:s,stroke:a,text:o,zIndex:void 0}),new Er({geometry:function(u){const c=u.getGeometry(),h=c.getType();if(h===M.GEOMETRY_COLLECTION){const f=c;return new Pi(f.getGeometriesArrayRecursive().filter(function(d){const p=d.getType();return p===M.POLYGON||p===M.MULTI_POLYGON}))}else if(h===M.POLYGON||h===M.MULTI_POLYGON)return c},fill:i,stroke:null,zIndex:void 0})]:[new Er({fill:i,image:s,stroke:a,text:o,zIndex:void 0})]}function Ey(n,e){const t=e.length,i=new Array(e.length),r=new Array(e.length),s=new Array(e.length);let o,a,l;o=!1,a=!1,l=!1;for(let u=0;u<t;++u){const c=e[u];i[u]=c.get("extrude"),r[u]=c.get("tessellate"),s[u]=c.get("altitudeMode"),o=o||i[u]!==void 0,a=a||r[u]!==void 0,l=l||s[u]}o&&n.set("extrude",i),a&&n.set("tessellate",r),l&&n.set("altitudeMode",s)}const O$=Y(pe,{displayName:F(H),value:F(H)});function A$(n,e){const t=n.getAttribute("name");Ji(O$,n,e);const i=e[e.length-1];t&&i.displayName?i[t]={value:i.value,displayName:i.displayName,toString:function(){return i.value}}:t!==null?i[t]=i.value:i.displayName!==null&&(i[i.displayName]=i.value),delete i.value}const P$=Y(pe,{Data:A$,SchemaData:D$});function nS(n,e){Ji(P$,n,e)}function rS(n,e){Ji(Yw,n,e)}const M$=Y(pe,{Style:F(xy),key:F(H),styleUrl:F(Ww)});function F$(n,e){const t=W({},M$,n,e,this);if(!t)return;const i=t.key;if(i&&i=="normal"){const r=t.styleUrl;r&&(e[e.length-1]=r);const s=t.Style;s&&(e[e.length-1]=s)}}function N$(n,e){const t=Hw.call(this,n,e);if(!t)return;const i=e[e.length-1];Array.isArray(t)?i.Style=t:typeof t=="string"?i.styleUrl=t:ce(!1,38)}const $$=Y(pe,{SimpleData:k$});function D$(n,e){Ji($$,n,e)}function k$(n,e){const t=n.getAttribute("name");if(t!==null){const i=H(n),r=e[e.length-1];r[t]=i}}const G$=Y(pe,{altitudeMode:F(H),minAltitude:F(Ke),maxAltitude:F(Ke),north:F(Ke),south:F(Ke),east:F(Ke),west:F(Ke)});function U$(n,e){const t=W({},G$,n,e);if(!t)return;const i=e[e.length-1],r=[parseFloat(t.west),parseFloat(t.south),parseFloat(t.east),parseFloat(t.north)];i.extent=r,i.altitudeMode=t.altitudeMode,i.minAltitude=parseFloat(t.minAltitude),i.maxAltitude=parseFloat(t.maxAltitude)}const z$=Y(pe,{minLodPixels:F(Ke),maxLodPixels:F(Ke),minFadeExtent:F(Ke),maxFadeExtent:F(Ke)});function B$(n,e){const t=W({},z$,n,e);if(!t)return;const i=e[e.length-1];i.minLodPixels=parseFloat(t.minLodPixels),i.maxLodPixels=parseFloat(t.maxLodPixels),i.minFadeExtent=parseFloat(t.minFadeExtent),i.maxFadeExtent=parseFloat(t.maxFadeExtent)}const j$=Y(pe,{LinearRing:he(Kw)});function Y$(n,e){const t=W([],j$,n,e);t.length>0&&e[e.length-1].push(...t)}const X$=Y(pe,{LinearRing:me(Kw)});function V$(n,e){const t=W(void 0,X$,n,e);if(t){const i=e[e.length-1];i[0]=t}}function W$(n,e){Ji(HN,n,e)}function Z$(n,e){const i=e[e.length-1].whens,r=ji(n,!1),s=Date.parse(r);i.push(isNaN(s)?0:s)}function Xd(n,e){const t=na(e),r=[(t.length==4?t[3]:1)*255,t[2],t[1],t[0]];for(let s=0;s<4;++s){const o=Math.floor(r[s]).toString(16);r[s]=o.length==1?"0"+o:o}ve(n,r.join(""))}function H$(n,e,t){const i=t[t.length-1],r=i.layout,s=i.stride;let o;r==q.XY||r==q.XYM?o=2:r==q.XYZ||r==q.XYZM?o=3:ce(!1,34);const a=e.length;let l="";if(a>0){l+=e[0];for(let u=1;u<o;++u)l+=","+e[u];for(let u=s;u<a;u+=s){l+=" "+e[u];for(let c=1;c<o;++c)l+=","+e[u+c]}}ve(n,l)}const Vd=Y(pe,{Data:N(K$),value:N(J$),displayName:N(q$)});function K$(n,e,t){n.setAttribute("name",e.name);const i={node:n},r=e.value;typeof r=="object"?(r!==null&&r.displayName&&Te(i,Vd,gi,[r.displayName],t,["displayName"]),r!==null&&r.value&&Te(i,Vd,gi,[r.value],t,["value"])):Te(i,Vd,gi,[r],t,["value"])}function q$(n,e){$w(n,e)}function J$(n,e){ve(n,e)}const Q$=Y(pe,{Placemark:N(cS)}),eD=function(n,e,t){const i=e[e.length-1].node;return Ee(i.namespaceURI,"Placemark")};function tD(n,e,t){Te({node:n},Q$,eD,e,t,void 0,this)}const iD=Ot("Data");function nD(n,e,t){const i={node:n},r=e.names,s=e.values,o=r.length;for(let a=0;a<o;a++)Te(i,Vd,iD,[{name:r[a],value:s[a]}],t)}const sS=Y(pe,["href"],Y(ns,["x","y","w","h"])),oS=Y(pe,{href:N(ve)},Y(ns,{x:N(Qi),y:N(Qi),w:N(Qi),h:N(Qi)})),rD=function(n,e,t){return Ee(ns[0],"gx:"+t)};function sD(n,e,t){const i={node:n},r=t[t.length-1].node;let s=sS[r.namespaceURI],o=qi(e,s);Te(i,oS,gi,o,t,s),s=sS[ns[0]],o=qi(e,s),Te(i,oS,rD,o,t,s)}const oD=Y(pe,["scale","heading","Icon","color","hotSpot"]),aD=Y(pe,{Icon:N(sD),color:N(Xd),heading:N(Qi),hotSpot:N(FD),scale:N(dS)});function lD(n,e,t){const i={node:n},r={},s=e.getSrc(),o=e.getSize(),a=e.getImageSize(),l={href:s};if(o){l.w=o[0],l.h=o[1];const g=e.getAnchor(),v=e.getOrigin();if(v&&a&&v[0]!==0&&v[1]!==o[1]&&(l.x=v[0],l.y=a[1]-(v[1]+o[1])),g&&(g[0]!==o[0]/2||g[1]!==o[1]/2)){const y={x:g[0],xunits:Bi.PIXELS,y:o[1]-g[1],yunits:Bi.PIXELS};r.hotSpot=y}}r.Icon=l;let u=e.getScaleArray()[0],c=o;if(c===null&&(c=Xc),c.length==2){const g=zd(c);u=u/g}u!==1&&(r.scale=u);const h=e.getRotation();h!==0&&(r.heading=h);const f=e.getColor();f&&(r.color=f);const d=t[t.length-1].node,p=oD[d.namespaceURI],m=qi(r,p);Te(i,aD,gi,m,t,p)}const uD=Y(pe,["color","scale"]),cD=Y(pe,{color:N(Xd),scale:N(dS)});function hD(n,e,t){const i={node:n},r={},s=e.getFill();s&&(r.color=s.getColor());const o=e.getScale();o&&o!==1&&(r.scale=o);const a=t[t.length-1].node,l=uD[a.namespaceURI],u=qi(r,l);Te(i,cD,gi,u,t,l)}const fD=Y(pe,["color","width"]),dD=Y(pe,{color:N(Xd),width:N(Qi)});function pD(n,e,t){const i={node:n},r={color:e.getColor(),width:Number(e.getWidth())||1},s=t[t.length-1].node,o=fD[s.namespaceURI],a=qi(r,o);Te(i,dD,gi,a,t,o)}const gD={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},aS=function(n,e,t){if(n){const i=e[e.length-1].node;return Ee(i.namespaceURI,gD[n.getType()])}},mD=Ot("Point"),yD=Ot("LineString"),_D=Ot("LinearRing"),vD=Ot("Polygon"),xD=Y(pe,{LineString:N(Gl),Point:N(Gl),Polygon:N(fS),GeometryCollection:N(lS)});function lS(n,e,t){const i={node:n},r=e.getType();let s=[],o;r===M.GEOMETRY_COLLECTION?(e.getGeometriesArrayRecursive().forEach(function(a){const l=a.getType();l===M.MULTI_POINT?s=s.concat(a.getPoints()):l===M.MULTI_LINE_STRING?s=s.concat(a.getLineStrings()):l===M.MULTI_POLYGON?s=s.concat(a.getPolygons()):l===M.POINT||l===M.LINE_STRING||l===M.POLYGON?s.push(a):ce(!1,39)}),o=aS):r===M.MULTI_POINT?(s=e.getPoints(),o=mD):r===M.MULTI_LINE_STRING?(s=e.getLineStrings(),o=yD):r===M.MULTI_POLYGON?(s=e.getPolygons(),o=vD):ce(!1,39),Te(i,xD,o,s,t)}const ED=Y(pe,{LinearRing:N(Gl)});function uS(n,e,t){Te({node:n},ED,_D,[e],t)}const Ty=Y(pe,{ExtendedData:N(nD),MultiGeometry:N(lS),LineString:N(Gl),LinearRing:N(Gl),Point:N(Gl),Polygon:N(fS),Style:N(MD),address:N(ve),description:N(ve),name:N(ve),open:N(ma),phoneNumber:N(ve),styleUrl:N(ve),visibility:N(ma)}),TD=Y(pe,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),wD=Ot("ExtendedData");function cS(n,e,t){const i={node:n};e.getId()&&n.setAttribute("id",e.getId());const r=e.getProperties(),s={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};s[e.getGeometryName()]=1;const o=Object.keys(r||{}).sort().filter(function(d){return!s[d]}),a=e.getStyleFunction();if(a){const d=a(e,0);if(d){const p=Array.isArray(d)?d:[d];let m=p;if(e.getGeometry()&&(m=p.filter(function(g){const v=g.getGeometryFunction()(e);if(v){const y=v.getType();return y===M.GEOMETRY_COLLECTION?v.getGeometriesArrayRecursive().filter(function(x){const _=x.getType();return _===M.POINT||_===M.MULTI_POINT}).length:y===M.POINT||y===M.MULTI_POINT}})),this.writeStyles_){let g=p,v=p;e.getGeometry()&&(g=p.filter(function(y){const x=y.getGeometryFunction()(e);if(x){const _=x.getType();return _===M.GEOMETRY_COLLECTION?x.getGeometriesArrayRecursive().filter(function(E){const T=E.getType();return T===M.LINE_STRING||T===M.MULTI_LINE_STRING}).length:_===M.LINE_STRING||_===M.MULTI_LINE_STRING}}),v=p.filter(function(y){const x=y.getGeometryFunction()(e);if(x){const _=x.getType();return _===M.GEOMETRY_COLLECTION?x.getGeometriesArrayRecursive().filter(function(E){const T=E.getType();return T===M.POLYGON||T===M.MULTI_POLYGON}).length:_===M.POLYGON||_===M.MULTI_POLYGON}})),r.Style={pointStyles:m,lineStyles:g,polyStyles:v}}if(m.length&&r.name===void 0){const g=m[0].getText();g&&(r.name=g.getText())}}}const l=t[t.length-1].node,u=TD[l.namespaceURI],c=qi(r,u);if(Te(i,Ty,gi,c,t,u),o.length>0){const d=qi(r,o);Te(i,Ty,wD,[{names:o,values:d}],t)}const h=t[0];let f=e.getGeometry();f&&(f=yt(f,!0,h)),Te(i,Ty,aS,[f],t)}const SD=Y(pe,["extrude","tessellate","altitudeMode","coordinates"]),RD=Y(pe,{extrude:N(ma),tessellate:N(ma),altitudeMode:N(ve),coordinates:N(H$)});function Gl(n,e,t){const i=e.getFlatCoordinates(),r={node:n};r.layout=e.getLayout(),r.stride=e.getStride();const s=e.getProperties();s.coordinates=i;const o=t[t.length-1].node,a=SD[o.namespaceURI],l=qi(s,a);Te(r,RD,gi,l,t,a)}const bD=Y(pe,["color","fill","outline"]),hS=Y(pe,{outerBoundaryIs:N(uS),innerBoundaryIs:N(uS)}),ID=Ot("innerBoundaryIs"),CD=Ot("outerBoundaryIs");function fS(n,e,t){const i=e.getLinearRings(),r=i.shift(),s={node:n};Te(s,hS,ID,i,t),Te(s,hS,CD,[r],t)}const LD=Y(pe,{color:N(Xd),fill:N(ma),outline:N(ma)});function OD(n,e,t){const i={node:n},r=e.getFill(),s=e.getStroke(),o={color:r?r.getColor():void 0,fill:r?void 0:!1,outline:s?void 0:!1},a=t[t.length-1].node,l=bD[a.namespaceURI],u=qi(o,l);Te(i,LD,gi,u,t,l)}function dS(n,e){Qi(n,Math.round(e*1e6)/1e6)}const AD=Y(pe,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),PD=Y(pe,{IconStyle:N(lD),LabelStyle:N(hD),LineStyle:N(pD),PolyStyle:N(OD)});function MD(n,e,t){const i={node:n},r={};if(e.pointStyles.length){const l=e.pointStyles[0].getText();l&&(r.LabelStyle=l);const u=e.pointStyles[0].getImage();u&&typeof u.getSrc=="function"&&(r.IconStyle=u)}if(e.lineStyles.length){const l=e.lineStyles[0].getStroke();l&&(r.LineStyle=l)}if(e.polyStyles.length){const l=e.polyStyles[0].getStroke();l&&!r.LineStyle&&(r.LineStyle=l),r.PolyStyle=e.polyStyles[0]}const s=t[t.length-1].node,o=AD[s.namespaceURI],a=qi(r,o);Te(i,PD,gi,a,t,o)}function FD(n,e){n.setAttribute("x",String(e.x)),n.setAttribute("y",String(e.y)),n.setAttribute("xunits",e.xunits),n.setAttribute("yunits",e.yunits)}var ND=o$,$D=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},wy={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */wy.read=function(n,e,t,i,r){var s,o,a=r*8-i-1,l=(1<<a)-1,u=l>>1,c=-7,h=t?r-1:0,f=t?-1:1,d=n[e+h];for(h+=f,s=d&(1<<-c)-1,d>>=-c,c+=a;c>0;s=s*256+n[e+h],h+=f,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=i;c>0;o=o*256+n[e+h],h+=f,c-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-u}return(d?-1:1)*o*Math.pow(2,s-i)},wy.write=function(n,e,t,i,r,s){var o,a,l,u=s*8-r-1,c=(1<<u)-1,h=c>>1,f=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:s-1,p=i?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+h>=1?e+=f/l:e+=f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(e*l-1)*Math.pow(2,r),o=o+h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;n[t+d]=a&255,d+=p,a/=256,r-=8);for(o=o<<r|a,u+=r;u>0;n[t+d]=o&255,d+=p,o/=256,u-=8);n[t+d-p]|=m*128};var pS=ot,Wd=wy;function ot(n){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(n)?n:new Uint8Array(n||0),this.pos=0,this.type=0,this.length=this.buf.length}ot.Varint=0,ot.Fixed64=1,ot.Bytes=2,ot.Fixed32=5;var Sy=(1<<16)*(1<<16),gS=1/Sy,DD=12,mS=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");ot.prototype={destroy:function(){this.buf=null},readFields:function(n,e,t){for(t=t||this.length;this.pos<t;){var i=this.readVarint(),r=i>>3,s=this.pos;this.type=i&7,n(r,e,this),this.pos===s&&this.skip(i)}return e},readMessage:function(n,e){return this.readFields(n,e,this.readVarint()+this.pos)},readFixed32:function(){var n=Zd(this.buf,this.pos);return this.pos+=4,n},readSFixed32:function(){var n=_S(this.buf,this.pos);return this.pos+=4,n},readFixed64:function(){var n=Zd(this.buf,this.pos)+Zd(this.buf,this.pos+4)*Sy;return this.pos+=8,n},readSFixed64:function(){var n=Zd(this.buf,this.pos)+_S(this.buf,this.pos+4)*Sy;return this.pos+=8,n},readFloat:function(){var n=Wd.read(this.buf,this.pos,!0,23,4);return this.pos+=4,n},readDouble:function(){var n=Wd.read(this.buf,this.pos,!0,52,8);return this.pos+=8,n},readVarint:function(n){var e=this.buf,t,i;return i=e[this.pos++],t=i&127,i<128||(i=e[this.pos++],t|=(i&127)<<7,i<128)||(i=e[this.pos++],t|=(i&127)<<14,i<128)||(i=e[this.pos++],t|=(i&127)<<21,i<128)?t:(i=e[this.pos],t|=(i&15)<<28,kD(t,n,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var n=this.readVarint();return n%2===1?(n+1)/-2:n/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=DD&&mS?JD(this.buf,e,n):qD(this.buf,e,n)},readBytes:function(){var n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e},readPackedVarint:function(n,e){if(this.type!==ot.Bytes)return n.push(this.readVarint(e));var t=rs(this);for(n=n||[];this.pos<t;)n.push(this.readVarint(e));return n},readPackedSVarint:function(n){if(this.type!==ot.Bytes)return n.push(this.readSVarint());var e=rs(this);for(n=n||[];this.pos<e;)n.push(this.readSVarint());return n},readPackedBoolean:function(n){if(this.type!==ot.Bytes)return n.push(this.readBoolean());var e=rs(this);for(n=n||[];this.pos<e;)n.push(this.readBoolean());return n},readPackedFloat:function(n){if(this.type!==ot.Bytes)return n.push(this.readFloat());var e=rs(this);for(n=n||[];this.pos<e;)n.push(this.readFloat());return n},readPackedDouble:function(n){if(this.type!==ot.Bytes)return n.push(this.readDouble());var e=rs(this);for(n=n||[];this.pos<e;)n.push(this.readDouble());return n},readPackedFixed32:function(n){if(this.type!==ot.Bytes)return n.push(this.readFixed32());var e=rs(this);for(n=n||[];this.pos<e;)n.push(this.readFixed32());return n},readPackedSFixed32:function(n){if(this.type!==ot.Bytes)return n.push(this.readSFixed32());var e=rs(this);for(n=n||[];this.pos<e;)n.push(this.readSFixed32());return n},readPackedFixed64:function(n){if(this.type!==ot.Bytes)return n.push(this.readFixed64());var e=rs(this);for(n=n||[];this.pos<e;)n.push(this.readFixed64());return n},readPackedSFixed64:function(n){if(this.type!==ot.Bytes)return n.push(this.readSFixed64());var e=rs(this);for(n=n||[];this.pos<e;)n.push(this.readSFixed64());return n},skip:function(n){var e=n&7;if(e===ot.Varint)for(;this.buf[this.pos++]>127;);else if(e===ot.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ot.Fixed32)this.pos+=4;else if(e===ot.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(n,e){this.writeVarint(n<<3|e)},realloc:function(n){for(var e=this.length||16;e<this.pos+n;)e*=2;if(e!==this.length){var t=new Uint8Array(e);t.set(this.buf),this.buf=t,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(n){this.realloc(4),zl(this.buf,n,this.pos),this.pos+=4},writeSFixed32:function(n){this.realloc(4),zl(this.buf,n,this.pos),this.pos+=4},writeFixed64:function(n){this.realloc(8),zl(this.buf,n&-1,this.pos),zl(this.buf,Math.floor(n*gS),this.pos+4),this.pos+=8},writeSFixed64:function(n){this.realloc(8),zl(this.buf,n&-1,this.pos),zl(this.buf,Math.floor(n*gS),this.pos+4),this.pos+=8},writeVarint:function(n){if(n=+n||0,n>268435455||n<0){GD(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))},writeSVarint:function(n){this.writeVarint(n<0?-n*2-1:n*2)},writeBoolean:function(n){this.writeVarint(Boolean(n))},writeString:function(n){n=String(n),this.realloc(n.length*4),this.pos++;var e=this.pos;this.pos=QD(this.buf,n,this.pos);var t=this.pos-e;t>=128&&yS(e,t,this),this.pos=e-1,this.writeVarint(t),this.pos+=t},writeFloat:function(n){this.realloc(4),Wd.write(this.buf,n,this.pos,!0,23,4),this.pos+=4},writeDouble:function(n){this.realloc(8),Wd.write(this.buf,n,this.pos,!0,52,8),this.pos+=8},writeBytes:function(n){var e=n.length;this.writeVarint(e),this.realloc(e);for(var t=0;t<e;t++)this.buf[this.pos++]=n[t]},writeRawMessage:function(n,e){this.pos++;var t=this.pos;n(e,this);var i=this.pos-t;i>=128&&yS(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeMessage:function(n,e,t){this.writeTag(n,ot.Bytes),this.writeRawMessage(e,t)},writePackedVarint:function(n,e){e.length&&this.writeMessage(n,BD,e)},writePackedSVarint:function(n,e){e.length&&this.writeMessage(n,jD,e)},writePackedBoolean:function(n,e){e.length&&this.writeMessage(n,VD,e)},writePackedFloat:function(n,e){e.length&&this.writeMessage(n,YD,e)},writePackedDouble:function(n,e){e.length&&this.writeMessage(n,XD,e)},writePackedFixed32:function(n,e){e.length&&this.writeMessage(n,WD,e)},writePackedSFixed32:function(n,e){e.length&&this.writeMessage(n,ZD,e)},writePackedFixed64:function(n,e){e.length&&this.writeMessage(n,HD,e)},writePackedSFixed64:function(n,e){e.length&&this.writeMessage(n,KD,e)},writeBytesField:function(n,e){this.writeTag(n,ot.Bytes),this.writeBytes(e)},writeFixed32Field:function(n,e){this.writeTag(n,ot.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(n,e){this.writeTag(n,ot.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(n,e){this.writeTag(n,ot.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(n,e){this.writeTag(n,ot.Fixed64),this.writeSFixed64(e)},writeVarintField:function(n,e){this.writeTag(n,ot.Varint),this.writeVarint(e)},writeSVarintField:function(n,e){this.writeTag(n,ot.Varint),this.writeSVarint(e)},writeStringField:function(n,e){this.writeTag(n,ot.Bytes),this.writeString(e)},writeFloatField:function(n,e){this.writeTag(n,ot.Fixed32),this.writeFloat(e)},writeDoubleField:function(n,e){this.writeTag(n,ot.Fixed64),this.writeDouble(e)},writeBooleanField:function(n,e){this.writeVarintField(n,Boolean(e))}};function kD(n,e,t){var i=t.buf,r,s;if(s=i[t.pos++],r=(s&112)>>4,s<128||(s=i[t.pos++],r|=(s&127)<<3,s<128)||(s=i[t.pos++],r|=(s&127)<<10,s<128)||(s=i[t.pos++],r|=(s&127)<<17,s<128)||(s=i[t.pos++],r|=(s&127)<<24,s<128)||(s=i[t.pos++],r|=(s&1)<<31,s<128))return Ul(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function rs(n){return n.type===ot.Bytes?n.readVarint()+n.pos:n.pos+1}function Ul(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function GD(n,e){var t,i;if(n>=0?(t=n%4294967296|0,i=n/4294967296|0):(t=~(-n%4294967296),i=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,i=i+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),UD(t,i,e),zD(i,e)}function UD(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127}function zD(n,e){var t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),!!n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),!!n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),!!n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),!!n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),!!n&&(e.buf[e.pos++]=n&127)))))}function yS(n,e,t){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(i);for(var r=t.pos-1;r>=n;r--)t.buf[r+i]=t.buf[r]}function BD(n,e){for(var t=0;t<n.length;t++)e.writeVarint(n[t])}function jD(n,e){for(var t=0;t<n.length;t++)e.writeSVarint(n[t])}function YD(n,e){for(var t=0;t<n.length;t++)e.writeFloat(n[t])}function XD(n,e){for(var t=0;t<n.length;t++)e.writeDouble(n[t])}function VD(n,e){for(var t=0;t<n.length;t++)e.writeBoolean(n[t])}function WD(n,e){for(var t=0;t<n.length;t++)e.writeFixed32(n[t])}function ZD(n,e){for(var t=0;t<n.length;t++)e.writeSFixed32(n[t])}function HD(n,e){for(var t=0;t<n.length;t++)e.writeFixed64(n[t])}function KD(n,e){for(var t=0;t<n.length;t++)e.writeSFixed64(n[t])}function Zd(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+n[e+3]*16777216}function zl(n,e,t){n[t]=e,n[t+1]=e>>>8,n[t+2]=e>>>16,n[t+3]=e>>>24}function _S(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+(n[e+3]<<24)}function qD(n,e,t){for(var i="",r=e;r<t;){var s=n[r],o=null,a=s>239?4:s>223?3:s>191?2:1;if(r+a>t)break;var l,u,c;a===1?s<128&&(o=s):a===2?(l=n[r+1],(l&192)===128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):a===3?(l=n[r+1],u=n[r+2],(l&192)===128&&(u&192)===128&&(o=(s&15)<<12|(l&63)<<6|u&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):a===4&&(l=n[r+1],u=n[r+2],c=n[r+3],(l&192)===128&&(u&192)===128&&(c&192)===128&&(o=(s&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,a=1):o>65535&&(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),i+=String.fromCharCode(o),r+=a}return i}function JD(n,e,t){return mS.decode(n.subarray(e,t))}function QD(n,e,t){for(var i=0,r,s;i<e.length;i++){if(r=e.charCodeAt(i),r>55295&&r<57344)if(s)if(r<56320){n[t++]=239,n[t++]=191,n[t++]=189,s=r;continue}else r=s-55296<<10|r-56320|65536,s=null;else{r>56319||i+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):s=r;continue}else s&&(n[t++]=239,n[t++]=191,n[t++]=189,s=null);r<128?n[t++]=r:(r<2048?n[t++]=r>>6|192:(r<65536?n[t++]=r>>12|224:(n[t++]=r>>18|240,n[t++]=r>>12&63|128),n[t++]=r>>6&63|128),n[t++]=r&63|128)}return t}const vS=xt();class Vc{constructor(e,t,i,r,s){this.styleFunction,this.extent_,this.id_=s,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_===M.POINT?jo(this.flatCoordinates_):If(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=fi(this.getExtent());this.flatInteriorPoints_=Zf(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=P0(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Bm(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Ec(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let t=0;const i=this.ends_;for(let r=0,s=i.length;r<s;++r){const o=i[r],a=Ec(e,t,o,2,.5);qe(this.flatMidpoints_,a),t=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getStride(){return 2}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=se(e);const t=e.getExtent(),i=e.getWorldExtent();if(t&&i){const r=ft(i)/ft(t);Ti(vS,i[0],i[3],r,-r,0,0,0),Kr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,vS,this.flatCoordinates_)}}getEnds(){return this.ends_}}Vc.prototype.getEndss=Vc.prototype.getEnds,Vc.prototype.getFlatCoordinates=Vc.prototype.getOrientedFlatCoordinates;function xS(n){const e=n.getType();switch(e){case M.POINT:return new Et(n.getFlatCoordinates());case M.MULTI_POINT:return new Nn(n.getFlatCoordinates(),q.XY);case M.LINE_STRING:return new Gt(n.getFlatCoordinates(),q.XY);case M.MULTI_LINE_STRING:return new yn(n.getFlatCoordinates(),q.XY,n.getEnds());case M.POLYGON:const t=n.getFlatCoordinates(),i=n.getEnds(),r=Wm(t,i);return r.length>1?new $n(t,q.XY,r):new pi(t,q.XY,i);default:throw new Error("Invalid geometry type:"+e)}}function ek(n,e){const t=n.getId(),i=xS(n),r=n.getProperties(),s=new lt;return e!==void 0&&s.setGeometryName(e),s.setGeometry(i),t!==void 0&&s.setId(t),s.setProperties(r,!0),s}var Ry=Vc;class tk extends $l{constructor(e){super();const t=e||{};this.dataProjection=new Ho({code:"",units:Ui.TILE_PIXELS}),this.featureClass_=t.featureClass?t.featureClass:Ry,this.geometryName_=t.geometryName,this.layerName_=t.layerName?t.layerName:"layer",this.layers_=t.layers?t.layers:null,this.idProperty_=t.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,i,r){e.pos=t.geometry;const s=e.readVarint()+e.pos;let o=1,a=0,l=0,u=0,c=0,h=0;for(;e.pos<s;){if(!a){const f=e.readVarint();o=f&7,a=f>>3}a--,o===1||o===2?(l+=e.readSVarint(),u+=e.readSVarint(),o===1&&c>h&&(r.push(c),h=c),i.push(l,u),c+=2):o===7?c>h&&(i.push(i[h],i[h+1]),c+=2):ce(!1,59)}c>h&&(r.push(c),h=c)}createFeature_(e,t,i){const r=t.type;if(r===0)return null;let s;const o=t.properties;let a;this.idProperty_?(a=o[this.idProperty_],delete o[this.idProperty_]):a=t.id,o[this.layerName_]=t.layer.name;const l=[],u=[];this.readRawGeometry_(e,t,l,u);const c=ok(r,u.length);if(this.featureClass_===Ry)s=new this.featureClass_(c,l,u,o,a),s.transform(i.dataProjection);else{let h;if(c==M.POLYGON){const p=Wm(l,u);h=p.length>1?new $n(l,q.XY,p):new pi(l,q.XY,u)}else h=c===M.POINT?new Et(l,q.XY):c===M.LINE_STRING?new Gt(l,q.XY):c===M.POLYGON?new pi(l,q.XY,u):c===M.MULTI_POINT?new Nn(l,q.XY):c===M.MULTI_LINE_STRING?new yn(l,q.XY,u):null;const f=this.featureClass_;s=new f,this.geometryName_&&s.setGeometryName(this.geometryName_);const d=yt(h,!1,i);s.setGeometry(d),a!==void 0&&s.setId(a),s.setProperties(o,!0)}return s}getType(){return mn.ARRAY_BUFFER}readFeatures(e,t){const i=this.layers_,r=this.adaptOptions(t),s=se(r.dataProjection);s.setWorldExtent(r.extent),r.dataProjection=s;const o=new pS(e),a=o.readFields(ik,{}),l=[];for(const u in a){if(i&&i.indexOf(u)==-1)continue;const c=a[u],h=c?[0,0,c.extent,c.extent]:null;s.setExtent(h);for(let f=0,d=c.length;f<d;++f){const p=sk(o,c,f),m=this.createFeature_(o,p,r);m!==null&&l.push(m)}}return l}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}}function ik(n,e,t){if(n===3){const i={keys:[],values:[],features:[]},r=t.readVarint()+t.pos;t.readFields(nk,i,r),i.length=i.features.length,i.length&&(e[i.name]=i)}}function nk(n,e,t){if(n===15)e.version=t.readVarint();else if(n===1)e.name=t.readString();else if(n===5)e.extent=t.readVarint();else if(n===2)e.features.push(t.pos);else if(n===3)e.keys.push(t.readString());else if(n===4){let i=null;const r=t.readVarint()+t.pos;for(;t.pos<r;)n=t.readVarint()>>3,i=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null;e.values.push(i)}}function rk(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2){const i=t.readVarint()+t.pos;for(;t.pos<i;){const r=e.layer.keys[t.readVarint()],s=e.layer.values[t.readVarint()];e.properties[r]=s}}else n==3?e.type=t.readVarint():n==4&&(e.geometry=t.pos)}function sk(n,e,t){n.pos=e.features[t];const i=n.readVarint()+n.pos,r={layer:e,type:0,properties:{}};return n.readFields(rk,r,i),r}function ok(n,e){let t;return n===1?t=e===1?M.POINT:M.MULTI_POINT:n===2?t=e===1?M.LINE_STRING:M.MULTI_LINE_STRING:n===3&&(t=M.POLYGON),t}var ES=tk;const by=[null],ak=Y(by,{nd:dk,tag:TS}),lk=Y(by,{node:hk,way:fk});class uk extends ga{constructor(){super();this.dataProjection=se("EPSG:4326")}readFeaturesFromNode(e,t){const i=this.getReadOptions(e,t);if(e.localName=="osm"){const r=W({nodes:{},ways:[],features:[]},lk,e,[i]);for(let s=0;s<r.ways.length;s++){const o=r.ways[s],a=[];for(let c=0,h=o.ndrefs.length;c<h;c++){const f=r.nodes[o.ndrefs[c]];qe(a,f)}let l;o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?l=new pi(a,q.XY,[a.length]):l=new Gt(a,q.XY),yt(l,!1,i);const u=new lt(l);o.id!==void 0&&u.setId(o.id),u.setProperties(o.tags,!0),r.features.push(u)}if(r.features)return r.features}return[]}}const ck=Y(by,{tag:TS});function hk(n,e){const t=e[0],i=e[e.length-1],r=n.getAttribute("id"),s=[parseFloat(n.getAttribute("lon")),parseFloat(n.getAttribute("lat"))];i.nodes[r]=s;const o=W({tags:{}},ck,n,e);if(!Wn(o.tags)){const a=new Et(s);yt(a,!1,t);const l=new lt(a);r!==void 0&&l.setId(r),l.setProperties(o.tags,!0),i.features.push(l)}}function fk(n,e){const t=n.getAttribute("id"),i=W({id:t,ndrefs:[],tags:{}},ak,n,e);e[e.length-1].ways.push(i)}function dk(n,e){e[e.length-1].ndrefs.push(n.getAttribute("ref"))}function TS(n,e){const t=e[e.length-1];t.tags[n.getAttribute("k")]=n.getAttribute("v")}var pk=uk;class gk{read(e){if(e)if(typeof e=="string"){const t=rr(e);return this.readFromDocument(t)}else return nr(e)?this.readFromDocument(e):this.readFromNode(e);else return null}readFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readFromNode(t);return null}readFromNode(e){}}var Hd=gk;const mk="http://www.w3.org/1999/xlink";function va(n){return n.getAttributeNS(mk,"href")}const vn=[null,"http://www.opengis.net/ows/1.1"],yk=Y(vn,{ServiceIdentification:F(Bk),ServiceProvider:F(Yk),OperationsMetadata:F(Uk)});class _k extends Hd{constructor(){super()}readFromNode(e){const t=W({},yk,e,[]);return t||null}}const vk=Y(vn,{DeliveryPoint:F(H),City:F(H),AdministrativeArea:F(H),PostalCode:F(H),Country:F(H),ElectronicMailAddress:F(H)}),xk=Y(vn,{Value:_t(Xk)}),Ek=Y(vn,{AllowedValues:F(Mk)}),Tk=Y(vn,{Phone:F(zk),Address:F(Pk)}),wk=Y(vn,{HTTP:F(kk)}),Sk=Y(vn,{Get:_t(Dk),Post:void 0}),Rk=Y(vn,{DCP:F($k)}),bk=Y(vn,{Operation:Gk}),Ik=Y(vn,{Voice:F(H),Facsimile:F(H)}),Ck=Y(vn,{Constraint:_t(Fk)}),Lk=Y(vn,{IndividualName:F(H),PositionName:F(H),ContactInfo:F(Nk)}),Ok=Y(vn,{Abstract:F(H),AccessConstraints:F(H),Fees:F(H),Title:F(H),ServiceTypeVersion:F(H),ServiceType:F(H)}),Ak=Y(vn,{ProviderName:F(H),ProviderSite:F(va),ServiceContact:F(jk)});function Pk(n,e){return W({},vk,n,e)}function Mk(n,e){return W({},xk,n,e)}function Fk(n,e){const t=n.getAttribute("name");if(!!t)return W({name:t},Ek,n,e)}function Nk(n,e){return W({},Tk,n,e)}function $k(n,e){return W({},wk,n,e)}function Dk(n,e){const t=va(n);if(!!t)return W({href:t},Ck,n,e)}function kk(n,e){return W({},Sk,n,e)}function Gk(n,e){const t=n.getAttribute("name"),i=W({},Rk,n,e);if(!i)return;const r=e[e.length-1];r[t]=i}function Uk(n,e){return W({},bk,n,e)}function zk(n,e){return W({},Ik,n,e)}function Bk(n,e){return W({},Ok,n,e)}function jk(n,e){return W({},Lk,n,e)}function Yk(n,e){return W({},Ak,n,e)}function Xk(n,e){return H(n)}var wS=_k;function Iy(n,e,t,i,r,s){let o,a;r!==void 0?(o=r,a=s!==void 0?s:0):(o=[],a=0);let l=e;for(;l<t;){const u=n[l++];o[a++]=n[l++],o[a++]=u;for(let c=2;c<i;++c)o[a++]=n[l++]}return o.length=a,o}class Vk extends Nd{constructor(e){super();const t=e||{};this.dataProjection=se("EPSG:4326"),this.factor_=t.factor?t.factor:1e5,this.geometryLayout_=t.geometryLayout?t.geometryLayout:q.XY}readFeatureFromText(e,t){const i=this.readGeometryFromText(e,t);return new lt(i)}readFeaturesFromText(e,t){return[this.readFeatureFromText(e,t)]}readGeometryFromText(e,t){const i=Gf(this.geometryLayout_),r=RS(e,i,this.factor_);Iy(r,0,r.length,i,r);const s=gr(r,0,r.length,i),o=new Gt(s,this.geometryLayout_);return yt(o,!1,this.adaptOptions(t))}writeFeatureText(e,t){const i=e.getGeometry();return i?this.writeGeometryText(i,t):(ce(!1,40),"")}writeFeaturesText(e,t){return this.writeFeatureText(e[0],t)}writeGeometryText(e,t){e=yt(e,!0,this.adaptOptions(t));const i=e.getFlatCoordinates(),r=e.getStride();return Iy(i,0,i.length,r,i),SS(i,r,this.factor_)}}function SS(n,e,t){const i=t||1e5;let r;const s=new Array(e);for(r=0;r<e;++r)s[r]=0;for(let o=0,a=n.length;o<a;)for(r=0;r<e;++r,++o){const l=n[o],u=l-s[r];s[r]=l,n[o]=u}return bS(n,i)}function RS(n,e,t){const i=t||1e5;let r;const s=new Array(e);for(r=0;r<e;++r)s[r]=0;const o=IS(n,i);for(let a=0,l=o.length;a<l;)for(r=0;r<e;++r,++a)s[r]+=o[a],o[a]=s[r];return o}function bS(n,e){const t=e||1e5;for(let i=0,r=n.length;i<r;++i)n[i]=Math.round(n[i]*t);return CS(n)}function IS(n,e){const t=e||1e5,i=LS(n);for(let r=0,s=i.length;r<s;++r)i[r]/=t;return i}function CS(n){for(let e=0,t=n.length;e<t;++e){const i=n[e];n[e]=i<0?~(i<<1):i<<1}return OS(n)}function LS(n){const e=AS(n);for(let t=0,i=e.length;t<i;++t){const r=e[t];e[t]=r&1?~(r>>1):r>>1}return e}function OS(n){let e="";for(let t=0,i=n.length;t<i;++t)e+=PS(n[t]);return e}function AS(n){const e=[];let t=0,i=0;for(let r=0,s=n.length;r<s;++r){const o=n.charCodeAt(r)-63;t|=(o&31)<<i,o<32?(e.push(t),t=0,i=0):i+=5}return e}function PS(n){let e,t="";for(;n>=32;)e=(32|n&31)+63,t+=String.fromCharCode(e),n>>=5;return e=n+63,t+=String.fromCharCode(e),t}var Wk=Vk;class Zk extends Ld{constructor(e){super();const t=e||{};this.layerName_=t.layerName,this.layers_=t.layers?t.layers:null,this.dataProjection=se(t.dataProjection?t.dataProjection:"EPSG:4326")}readFeaturesFromObject(e,t){if(e.type=="Topology"){const i=e;let r,s=null,o=null;i.transform&&(r=i.transform,s=r.scale,o=r.translate);const a=i.arcs;r&&nG(a,s,o);const l=[],u=i.objects,c=this.layerName_;let h;for(const f in u)this.layers_&&this.layers_.indexOf(f)==-1||(u[f].type==="GeometryCollection"?(h=u[f],l.push.apply(l,iG(h,a,s,o,c,f,t))):(h=u[f],l.push(MS(h,a,s,o,c,f,t))));return l}else return[]}readProjectionFromObject(e){return this.dataProjection}}const Hk={Point:Kk,LineString:Jk,Polygon:eG,MultiPoint:qk,MultiLineString:Qk,MultiPolygon:tG};function Kd(n,e){const t=[];let i;for(let r=0,s=n.length;r<s;++r)if(i=n[r],r>0&&t.pop(),i>=0){const o=e[i];for(let a=0,l=o.length;a<l;++a)t.push(o[a].slice(0))}else{const o=e[~i];for(let a=o.length-1;a>=0;--a)t.push(o[a].slice(0))}return t}function Kk(n,e,t){const i=n.coordinates;return e&&t&&Cy(i,e,t),new Et(i)}function qk(n,e,t){const i=n.coordinates;if(e&&t)for(let r=0,s=i.length;r<s;++r)Cy(i[r],e,t);return new Nn(i)}function Jk(n,e){const t=Kd(n.arcs,e);return new Gt(t)}function Qk(n,e){const t=[];for(let i=0,r=n.arcs.length;i<r;++i)t[i]=Kd(n.arcs[i],e);return new yn(t)}function eG(n,e){const t=[];for(let i=0,r=n.arcs.length;i<r;++i)t[i]=Kd(n.arcs[i],e);return new pi(t)}function tG(n,e){const t=[];for(let i=0,r=n.arcs.length;i<r;++i){const s=n.arcs[i],o=[];for(let a=0,l=s.length;a<l;++a)o[a]=Kd(s[a],e);t[i]=o}return new $n(t)}function iG(n,e,t,i,r,s,o){const a=n.geometries,l=[];for(let u=0,c=a.length;u<c;++u)l[u]=MS(a[u],e,t,i,r,s,o);return l}function MS(n,e,t,i,r,s,o){let a=null;const l=n.type;if(l){const h=Hk[l];l==="Point"||l==="MultiPoint"?a=h(n,t,i):a=h(n,e),a=yt(a,!1,o)}const u=new lt({geometry:a});n.id!==void 0&&u.setId(n.id);let c=n.properties;return r&&(c||(c={}),c[r]=s),c&&u.setProperties(c,!0),u}function nG(n,e,t){for(let i=0,r=n.length;i<r;++i)rG(n[i],e,t)}function rG(n,e,t){let i=0,r=0;for(let s=0,o=n.length;s<o;++s){const a=n[s];i+=a[0],r+=a[1],a[0]=i,a[1]=r,Cy(a,e,t)}}function Cy(n,e,t){n[0]=n[0]*e[0]+t[0],n[1]=n[1]*e[1]+t[1]}var sG=Zk;class oG{constructor(e){this.tagName_=e}getTagName(){return this.tagName_}}var xa=oG;class aG extends xa{constructor(e,t){super(e);this.conditions=t,ce(this.conditions.length>=2,57)}}var Ly=aG;class lG extends Ly{constructor(e){super("And",Array.prototype.slice.call(arguments))}}var FS=lG;class uG extends xa{constructor(e,t,i){super("BBOX");if(this.geometryName=e,this.extent=t,t.length!==4)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");this.srsName=i}}var NS=uG;class cG extends xa{constructor(e,t,i,r){super(e);this.geometryName=t||"the_geom",this.geometry=i,this.srsName=r}}var Bl=cG;class hG extends Bl{constructor(e,t,i){super("Contains",e,t,i)}}var $S=hG;class fG extends Bl{constructor(e,t,i,r,s){super("DWithin",e,t,s);this.distance=i,this.unit=r}}var DS=fG;class dG extends Bl{constructor(e,t,i){super("Disjoint",e,t,i)}}var kS=dG;class pG extends xa{constructor(e,t){super(e);this.propertyName=t}}var jl=pG;class gG extends jl{constructor(e,t,i){super("During",e);this.begin=t,this.end=i}}var GS=gG;class mG extends jl{constructor(e,t,i,r){super(e,t);this.expression=i,this.matchCase=r}}var Ea=mG;class yG extends Ea{constructor(e,t,i){super("PropertyIsEqualTo",e,t,i)}}var US=yG;class _G extends Ea{constructor(e,t){super("PropertyIsGreaterThan",e,t)}}var zS=_G;class vG extends Ea{constructor(e,t){super("PropertyIsGreaterThanOrEqualTo",e,t)}}var BS=vG;class xG extends Bl{constructor(e,t,i){super("Intersects",e,t,i)}}var jS=xG;class EG extends jl{constructor(e,t,i){super("PropertyIsBetween",e);this.lowerBoundary=t,this.upperBoundary=i}}var YS=EG;class TG extends jl{constructor(e,t,i,r,s,o){super("PropertyIsLike",e);this.pattern=t,this.wildCard=i!==void 0?i:"*",this.singleChar=r!==void 0?r:".",this.escapeChar=s!==void 0?s:"!",this.matchCase=o}}var XS=TG;class wG extends jl{constructor(e){super("PropertyIsNull",e)}}var VS=wG;class SG extends Ea{constructor(e,t){super("PropertyIsLessThan",e,t)}}var WS=SG;class RG extends Ea{constructor(e,t){super("PropertyIsLessThanOrEqualTo",e,t)}}var ZS=RG;class bG extends xa{constructor(e){super("Not");this.condition=e}}var HS=bG;class IG extends Ea{constructor(e,t,i){super("PropertyIsNotEqualTo",e,t,i)}}var KS=IG;class CG extends Ly{constructor(e){super("Or",Array.prototype.slice.call(arguments))}}var qS=CG;class LG extends xa{constructor(e){super("ResourceId");this.rid=e}}var JS=LG;class OG extends Bl{constructor(e,t,i){super("Within",e,t,i)}}var QS=OG;function eR(n){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(FS,e))}function AG(n){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(qS,e))}function PG(n){return new HS(n)}function tR(n,e,t){return new NS(n,e,t)}function MG(n,e,t){return new $S(n,e,t)}function FG(n,e,t){return new jS(n,e,t)}function NG(n,e,t){return new kS(n,e,t)}function $G(n,e,t){return new QS(n,e,t)}function DG(n,e,t,i,r){return new DS(n,e,t,i,r)}function kG(n,e,t){return new US(n,e,t)}function GG(n,e,t){return new KS(n,e,t)}function UG(n,e){return new WS(n,e)}function zG(n,e){return new ZS(n,e)}function BG(n,e){return new zS(n,e)}function jG(n,e){return new BS(n,e)}function YG(n){return new VS(n)}function XG(n,e,t){return new YS(n,e,t)}function VG(n,e,t,i,r,s){return new XS(n,e,t,i,r,s)}function WG(n,e,t){return new GS(n,e,t)}function ZG(n){return new JS(n)}const iR={"http://www.opengis.net/gml":{boundedBy:F(ze.prototype.readGeometryElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:he(ze.prototype.readFeaturesInternal)}},HG={"http://www.opengis.net/wfs":{totalInserted:F(Wt),totalUpdated:F(Wt),totalDeleted:F(Wt)},"http://www.opengis.net/wfs/2.0":{totalInserted:F(Wt),totalUpdated:F(Wt),totalDeleted:F(Wt)}},KG={"http://www.opengis.net/wfs":{TransactionSummary:F(oR,"transactionSummary"),InsertResults:F(lR,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:F(oR,"transactionSummary"),InsertResults:F(lR,"insertIds")}},qG={"http://www.opengis.net/wfs":{PropertyName:N(ve)},"http://www.opengis.net/wfs/2.0":{PropertyName:N(ve)}},nR={"http://www.opengis.net/wfs":{Insert:N(uR),Update:N(fR),Delete:N(hR),Property:N(dR),Native:N(pR)},"http://www.opengis.net/wfs/2.0":{Insert:N(uR),Update:N(fR),Delete:N(hR),Property:N(dR),Native:N(pR)}},rR="feature",Oy="http://www.w3.org/2000/xmlns/",Ay={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},Py={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},My={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},sR={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},Fy={"2.0.0":Md,"1.1.0":Me,"1.0.0":ya},JG="1.1.0";class QG extends ga{constructor(e){super();const t=e||{};this.version_=t.version?t.version:JG,this.featureType_=t.featureType,this.featureNS_=t.featureNS,this.gmlFormat_=t.gmlFormat?t.gmlFormat:new Fy[this.version_],this.schemaLocation_=t.schemaLocation?t.schemaLocation:sR[this.version_]}getFeatureType(){return this.featureType_}setFeatureType(e){this.featureType_=e}readFeaturesFromNode(e,t){const i={node:e};ie(i,{featureType:this.featureType_,featureNS:this.featureNS_}),ie(i,this.getReadOptions(e,t||{}));const r=[i];let s;this.version_==="2.0.0"?s=iR:s=this.gmlFormat_.FEATURE_COLLECTION_PARSERS;let o=W([],s,e,r,this.gmlFormat_);return o||(o=[]),o}readTransactionResponse(e){if(e)if(typeof e=="string"){const t=rr(e);return this.readTransactionResponseFromDocument(t)}else return nr(e)?this.readTransactionResponseFromDocument(e):this.readTransactionResponseFromNode(e);else return}readFeatureCollectionMetadata(e){if(e)if(typeof e=="string"){const t=rr(e);return this.readFeatureCollectionMetadataFromDocument(t)}else return nr(e)?this.readFeatureCollectionMetadataFromDocument(e):this.readFeatureCollectionMetadataFromNode(e);else return}readFeatureCollectionMetadataFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(t)}readFeatureCollectionMetadataFromNode(e){const t={},i=Rr(e.getAttribute("numberOfFeatures"));return t.numberOfFeatures=i,W(t,iR,e,[],this.gmlFormat_)}readTransactionResponseFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(t)}readTransactionResponseFromNode(e){return W({},KG,e,[])}writeGetFeature(e){const t=Ee(Py[this.version_],"GetFeature");t.setAttribute("service","WFS"),t.setAttribute("version",this.version_),e.handle&&t.setAttribute("handle",e.handle),e.outputFormat&&t.setAttribute("outputFormat",e.outputFormat),e.maxFeatures!==void 0&&t.setAttribute("maxFeatures",String(e.maxFeatures)),e.resultType&&t.setAttribute("resultType",e.resultType),e.startIndex!==void 0&&t.setAttribute("startIndex",String(e.startIndex)),e.count!==void 0&&t.setAttribute("count",String(e.count)),e.viewParams!==void 0&&t.setAttribute("viewParams",e.viewParams),t.setAttributeNS(to,"xsi:schemaLocation",this.schemaLocation_);const i={node:t};if(ie(i,{version:this.version_,srsName:e.srsName,featureNS:e.featureNS?e.featureNS:this.featureNS_,featurePrefix:e.featurePrefix,propertyNames:e.propertyNames?e.propertyNames:[]}),ce(Array.isArray(e.featureTypes),11),typeof e.featureTypes[0]=="string"){let r=e.filter;e.bbox&&(ce(e.geometryName,12),r=this.combineBboxAndFilter(e.geometryName,e.bbox,e.srsName,r)),ie(i,{geometryName:e.geometryName,filter:r}),RR(t,e.featureTypes,[i])}else e.featureTypes.forEach(r=>{const s=this.combineBboxAndFilter(r.geometryName,r.bbox,e.srsName,e.filter);ie(i,{geometryName:r.geometryName,filter:s}),RR(t,[r.name],[i])});return t}combineBboxAndFilter(e,t,i,r){const s=tR(e,t,i);return r?eR(r,s):s}writeTransaction(e,t,i,r){const s=[],o=r.version?r.version:this.version_,a=Ee(Py[o],"Transaction");a.setAttribute("service","WFS"),a.setAttribute("version",o);let l;r&&(l=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle)),a.setAttributeNS(to,"xsi:schemaLocation",sR[o]);const u=e3(a,l,o,r);return e&&qd("Insert",e,s,u),t&&qd("Update",t,s,u),i&&qd("Delete",i,s,u),r.nativeElements&&qd("Native",r.nativeElements,s,u),a}readProjectionFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(t);return null}readProjectionFromNode(e){if(e.firstElementChild&&e.firstElementChild.firstElementChild){e=e.firstElementChild.firstElementChild;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(!(t.childNodes.length===0||t.childNodes.length===1&&t.firstChild.nodeType===3)){const i=[{}];return this.gmlFormat_.readGeometryElement(t,i),se(i.pop().srsName)}}return null}}function e3(n,e,t,i){const r=i.featurePrefix?i.featurePrefix:rR;let s;return t==="1.0.0"?s=2:t==="1.1.0"?s=3:t==="2.0.0"&&(s=3.2),ie({node:n},{version:t,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:r,gmlVersion:s,hasZ:i.hasZ,srsName:i.srsName},e)}function qd(n,e,t,i){Te(i,nR,Ot(n),e,t)}function oR(n,e){return W({},HG,n,e)}const t3={"http://www.opengis.net/ogc":{FeatureId:he(function(n,e){return n.getAttribute("fid")})},"http://www.opengis.net/ogc/1.1":{FeatureId:he(function(n,e){return n.getAttribute("fid")})}};function aR(n,e){Ji(t3,n,e)}const i3={"http://www.opengis.net/wfs":{Feature:aR},"http://www.opengis.net/wfs/2.0":{Feature:aR}};function lR(n,e){return W([],i3,n,e)}function uR(n,e,t){const i=t[t.length-1],r=i.featureType,s=i.featureNS,o=i.gmlVersion,a=Ee(s,r);n.appendChild(a),o===2?ya.prototype.writeFeatureElement(a,e,t):o===3?Me.prototype.writeFeatureElement(a,e,t):Md.prototype.writeFeatureElement(a,e,t)}function cR(n,e,t){const r=t[t.length-1].version,s=Ay[r],o=Ee(s,"Filter"),a=Ee(s,"FeatureId");o.appendChild(a),a.setAttribute("fid",e),n.appendChild(o)}function Ny(n,e){n=n||rR;const t=n+":";return e.indexOf(t)===0?e:t+e}function hR(n,e,t){const i=t[t.length-1];ce(e.getId()!==void 0,26);const r=i.featureType,s=i.featurePrefix,o=i.featureNS,a=Ny(s,r);n.setAttribute("typeName",a),n.setAttributeNS(Oy,"xmlns:"+s,o);const l=e.getId();l!==void 0&&cR(n,l,t)}function fR(n,e,t){const i=t[t.length-1];ce(e.getId()!==void 0,27);const r=i.version,s=i.featureType,o=i.featurePrefix,a=i.featureNS,l=Ny(o,s),u=e.getGeometryName();n.setAttribute("typeName",l),n.setAttributeNS(Oy,"xmlns:"+o,a);const c=e.getId();if(c!==void 0){const h=e.getKeys(),f=[];for(let d=0,p=h.length;d<p;d++){const m=e.get(h[d]);if(m!==void 0){let g=h[d];m&&typeof m.getSimplifiedGeometry=="function"&&(g=u),f.push({name:g,value:m})}}Te({version:r,gmlVersion:i.gmlVersion,node:n,hasZ:i.hasZ,srsName:i.srsName},nR,Ot("Property"),f,t),cR(n,c,t)}}function dR(n,e,t){const i=t[t.length-1],r=i.version,s=Py[r],o=Ee(s,"Name"),a=i.gmlVersion;if(n.appendChild(o),ve(o,e.name),e.value!==void 0&&e.value!==null){const l=Ee(s,"Value");n.appendChild(l),e.value&&typeof e.value.getSimplifiedGeometry=="function"?a===2?ya.prototype.writeGeometryElement(l,e.value,t):a===3?Me.prototype.writeGeometryElement(l,e.value,t):Md.prototype.writeGeometryElement(l,e.value,t):ve(l,e.value)}}function pR(n,e,t){e.vendorId&&n.setAttribute("vendorId",e.vendorId),e.safeToIgnore!==void 0&&n.setAttribute("safeToIgnore",String(e.safeToIgnore)),e.value!==void 0&&ve(n,e.value)}const Jd={"http://www.opengis.net/wfs":{Query:N(gR)},"http://www.opengis.net/wfs/2.0":{Query:N(gR)},"http://www.opengis.net/ogc":{During:N(vR),And:N(Qd),Or:N(Qd),Not:N(xR),BBOX:N(yR),Contains:N(ro),Intersects:N(ro),Within:N(ro),DWithin:N(_R),PropertyIsEqualTo:N(Dn),PropertyIsNotEqualTo:N(Dn),PropertyIsLessThan:N(Dn),PropertyIsLessThanOrEqualTo:N(Dn),PropertyIsGreaterThan:N(Dn),PropertyIsGreaterThanOrEqualTo:N(Dn),PropertyIsNull:N(ER),PropertyIsBetween:N(TR),PropertyIsLike:N(wR)},"http://www.opengis.net/fes/2.0":{During:N(vR),And:N(Qd),Or:N(Qd),Not:N(xR),BBOX:N(yR),Contains:N(ro),Disjoint:N(ro),Intersects:N(ro),ResourceId:N(n3),Within:N(ro),DWithin:N(_R),PropertyIsEqualTo:N(Dn),PropertyIsNotEqualTo:N(Dn),PropertyIsLessThan:N(Dn),PropertyIsLessThanOrEqualTo:N(Dn),PropertyIsGreaterThan:N(Dn),PropertyIsGreaterThanOrEqualTo:N(Dn),PropertyIsNull:N(ER),PropertyIsBetween:N(TR),PropertyIsLike:N(wR)}};function gR(n,e,t){const i=t[t.length-1],r=i.version,s=i.featurePrefix,o=i.featureNS,a=i.propertyNames,l=i.srsName;let u;s?u=Ny(s,e):u=e;let c;r==="2.0.0"?c="typeNames":c="typeName",n.setAttribute(c,u),l&&n.setAttribute("srsName",l),o&&n.setAttributeNS(Oy,"xmlns:"+s,o);const h=ie({},i);h.node=n,Te(h,qG,Ot("PropertyName"),a,t);const f=i.filter;if(f){const d=Ee(Wc(r),"Filter");n.appendChild(d),mR(d,f,t)}}function mR(n,e,t){const i=t[t.length-1],r={node:n};ie(r,{context:i}),Te(r,Jd,Ot(e.getTagName()),[e],t)}function yR(n,e,t){const i=t[t.length-1],s=i.context.version;i.srsName=e.srsName;const o=Fy[s];Yl(s,n,e.geometryName),o.prototype.writeGeometryElement(n,e.extent,t)}function n3(n,e,t){n.setAttribute("rid",e.rid)}function ro(n,e,t){const i=t[t.length-1],s=i.context.version;i.srsName=e.srsName;const o=Fy[s];Yl(s,n,e.geometryName),o.prototype.writeGeometryElement(n,e.geometry,t)}function _R(n,e,t){const s=t[t.length-1].context.version;ro(n,e,t);const o=Ee(Wc(s),"Distance");ve(o,e.distance.toString()),s==="2.0.0"?o.setAttribute("uom",e.unit):o.setAttribute("units",e.unit),n.appendChild(o)}function vR(n,e,t){const s=t[t.length-1].context.version;ep(My[s],"ValueReference",n,e.propertyName);const o=Ee(wr,"TimePeriod");n.appendChild(o);const a=Ee(wr,"begin");o.appendChild(a),SR(a,e.begin);const l=Ee(wr,"end");o.appendChild(l),SR(l,e.end)}function Qd(n,e,t){const r=t[t.length-1].context,s={node:n};ie(s,{context:r});const o=e.conditions;for(let a=0,l=o.length;a<l;++a){const u=o[a];Te(s,Jd,Ot(u.getTagName()),[u],t)}}function xR(n,e,t){const r=t[t.length-1].context,s={node:n};ie(s,{context:r});const o=e.condition;Te(s,Jd,Ot(o.getTagName()),[o],t)}function Dn(n,e,t){const s=t[t.length-1].context.version;e.matchCase!==void 0&&n.setAttribute("matchCase",e.matchCase.toString()),Yl(s,n,e.propertyName),tp(s,n,""+e.expression)}function ER(n,e,t){const s=t[t.length-1].context.version;Yl(s,n,e.propertyName)}function TR(n,e,t){const s=t[t.length-1].context.version,o=Wc(s);Yl(s,n,e.propertyName);const a=Ee(o,"LowerBoundary");n.appendChild(a),tp(s,a,""+e.lowerBoundary);const l=Ee(o,"UpperBoundary");n.appendChild(l),tp(s,l,""+e.upperBoundary)}function wR(n,e,t){const s=t[t.length-1].context.version;n.setAttribute("wildCard",e.wildCard),n.setAttribute("singleChar",e.singleChar),n.setAttribute("escapeChar",e.escapeChar),e.matchCase!==void 0&&n.setAttribute("matchCase",e.matchCase.toString()),Yl(s,n,e.propertyName),tp(s,n,""+e.pattern)}function ep(n,e,t,i){const r=Ee(n,e);ve(r,i),t.appendChild(r)}function tp(n,e,t){ep(Wc(n),"Literal",e,t)}function Yl(n,e,t){n==="2.0.0"?ep(My[n],"ValueReference",e,t):ep(Ay[n],"PropertyName",e,t)}function SR(n,e){const t=Ee(wr,"TimeInstant");n.appendChild(t);const i=Ee(wr,"timePosition");t.appendChild(i),ve(i,e)}function r3(n,e){const t=e||"1.1.0",i=Ee(Wc(t),"Filter"),r={node:i};return ie(r,{version:t,filter:n}),mR(i,n,[r]),i}function RR(n,e,t){const i=t[t.length-1],r=ie({},i);r.node=n,Te(r,Jd,Ot("Query"),e,t)}function Wc(n){let e;return n==="2.0.0"?e=My[n]:e=Ay[n],e}var s3=QG;const ct={POINT:1,LINE_STRING:2,POLYGON:3,MULTI_POINT:4,MULTI_LINE_STRING:5,MULTI_POLYGON:6,GEOMETRY_COLLECTION:7,POLYHEDRAL_SURFACE:15,TIN:16,TRIANGLE:17};class bR{constructor(e){this.view_=e,this.pos_=0,this.initialized_=!1,this.isLittleEndian_=!1,this.hasZ_=!1,this.hasM_=!1,this.srid_=null,this.layout_=q.XY}readUint8(){return this.view_.getUint8(this.pos_++)}readUint32(e){return this.view_.getUint32((this.pos_+=4)-4,e!==void 0?e:this.isLittleEndian_)}readDouble(e){return this.view_.getFloat64((this.pos_+=8)-8,e!==void 0?e:this.isLittleEndian_)}readPoint(){const e=[];return e.push(this.readDouble()),e.push(this.readDouble()),this.hasZ_&&e.push(this.readDouble()),this.hasM_&&e.push(this.readDouble()),e}readLineString(){const e=this.readUint32(),t=[];for(let i=0;i<e;i++)t.push(this.readPoint());return t}readPolygon(){const e=this.readUint32(),t=[];for(let i=0;i<e;i++)t.push(this.readLineString());return t}readWkbHeader(e){const i=this.readUint8()>0,r=this.readUint32(i),s=Math.floor((r&268435455)/1e3),o=Boolean(r&2147483648)||s===1||s===3,a=Boolean(r&1073741824)||s===2||s===3,l=Boolean(r&536870912),u=(r&268435455)%1e3,c=["XY",o?"Z":"",a?"M":""].join(""),h=l?this.readUint32(i):null;if(e!==void 0&&e!==u)throw new Error("Unexpected WKB geometry type "+u);if(this.initialized_){if(this.isLittleEndian_!==i)throw new Error("Inconsistent endian");if(this.layout_!==c)throw new Error("Inconsistent geometry layout");if(h&&this.srid_!==h)throw new Error("Inconsistent coordinate system (SRID)")}else this.isLittleEndian_=i,this.hasZ_=o,this.hasM_=a,this.layout_=c,this.srid_=h,this.initialized_=!0;return u}readWkbPayload(e){switch(e){case ct.POINT:return this.readPoint();case ct.LINE_STRING:return this.readLineString();case ct.POLYGON:case ct.TRIANGLE:return this.readPolygon();case ct.MULTI_POINT:return this.readMultiPoint();case ct.MULTI_LINE_STRING:return this.readMultiLineString();case ct.MULTI_POLYGON:case ct.POLYHEDRAL_SURFACE:case ct.TIN:return this.readMultiPolygon();case ct.GEOMETRY_COLLECTION:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+e+" is found")}}readWkbBlock(e){return this.readWkbPayload(this.readWkbHeader(e))}readWkbCollection(e,t){const i=this.readUint32(),r=[];for(let s=0;s<i;s++){const o=e.call(this,t);o&&r.push(o)}return r}readMultiPoint(){return this.readWkbCollection(this.readWkbBlock,ct.POINT)}readMultiLineString(){return this.readWkbCollection(this.readWkbBlock,ct.LINE_STRING)}readMultiPolygon(){return this.readWkbCollection(this.readWkbBlock,ct.POLYGON)}readGeometryCollection(){return this.readWkbCollection(this.readGeometry)}readGeometry(){const e=this.readWkbHeader(),t=this.readWkbPayload(e);switch(e){case ct.POINT:return new Et(t,this.layout_);case ct.LINE_STRING:return new Gt(t,this.layout_);case ct.POLYGON:case ct.TRIANGLE:return new pi(t,this.layout_);case ct.MULTI_POINT:return new Nn(t,this.layout_);case ct.MULTI_LINE_STRING:return new yn(t,this.layout_);case ct.MULTI_POLYGON:case ct.POLYHEDRAL_SURFACE:case ct.TIN:return new $n(t,this.layout_);case ct.GEOMETRY_COLLECTION:return new Pi(t);default:return null}}getSrid(){return this.srid_}}class o3{constructor(e){e=e||{},this.layout_=e.layout,this.isLittleEndian_=e.littleEndian!==!1,this.isEWKB_=e.ewkb!==!1,this.writeQueue_=[],this.nodata_=ie({X:0,Y:0,Z:0,M:0},e.nodata)}writeUint8(e){this.writeQueue_.push([1,e])}writeUint32(e){this.writeQueue_.push([4,e])}writeDouble(e){this.writeQueue_.push([8,e])}writePoint(e,t){const i=ie.apply(null,t.split("").map((r,s)=>({[r]:e[s]})));for(const r of this.layout_)this.writeDouble(r in i?i[r]:this.nodata_[r])}writeLineString(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writePoint(e[i],t)}writePolygon(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writeLineString(e[i],t)}writeWkbHeader(e,t){e%=1e3,this.layout_.indexOf("Z")>=0&&(e+=this.isEWKB_?2147483648:1e3),this.layout_.indexOf("M")>=0&&(e+=this.isEWKB_?1073741824:2e3),this.isEWKB_&&Number.isInteger(t)&&(e|=536870912),this.writeUint8(this.isLittleEndian_?1:0),this.writeUint32(e),this.isEWKB_&&Number.isInteger(t)&&this.writeUint32(t)}writeMultiPoint(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writeWkbHeader(1),this.writePoint(e[i],t)}writeMultiLineString(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writeWkbHeader(2),this.writeLineString(e[i],t)}writeMultiPolygon(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writeWkbHeader(3),this.writePolygon(e[i],t)}writeGeometryCollection(e){this.writeUint32(e.length);for(let t=0;t<e.length;t++)this.writeGeometry(e[t])}findMinimumLayout(e,t=q.XYZM){const i=(r,s)=>r===s?r:r===q.XYZM?s:s===q.XYZM?r:q.XY;if(e instanceof qn)return i(e.getLayout(),t);if(e instanceof Pi){const r=e.getGeometriesArray();for(let s=0;s<r.length&&t!==q.XY;s++)t=this.findMinimumLayout(r[s],t)}return t}writeGeometry(e,t){const i={[M.POINT]:ct.POINT,[M.LINE_STRING]:ct.LINE_STRING,[M.POLYGON]:ct.POLYGON,[M.MULTI_POINT]:ct.MULTI_POINT,[M.MULTI_LINE_STRING]:ct.MULTI_LINE_STRING,[M.MULTI_POLYGON]:ct.MULTI_POLYGON,[M.GEOMETRY_COLLECTION]:ct.GEOMETRY_COLLECTION},r=e.getType(),s=i[r];if(!s)throw new Error("GeometryType "+r+" is not supported");this.layout_||(this.layout_=this.findMinimumLayout(e)),this.writeWkbHeader(s,t),e instanceof qn?{[M.POINT]:this.writePoint,[M.LINE_STRING]:this.writeLineString,[M.POLYGON]:this.writePolygon,[M.MULTI_POINT]:this.writeMultiPoint,[M.MULTI_LINE_STRING]:this.writeMultiLineString,[M.MULTI_POLYGON]:this.writeMultiPolygon}[r].call(this,e.getCoordinates(),e.getLayout()):e instanceof Pi&&this.writeGeometryCollection(e.getGeometriesArray())}getBuffer(){const e=this.writeQueue_.reduce((s,o)=>s+o[0],0),t=new ArrayBuffer(e),i=new DataView(t);let r=0;return this.writeQueue_.forEach(s=>{switch(s[0]){case 1:i.setUint8(r,s[1]);break;case 4:i.setUint32(r,s[1],this.isLittleEndian_);break;case 8:i.setFloat64(r,s[1],this.isLittleEndian_);break}r+=s[0]}),t}}class a3 extends $l{constructor(e){super();const t=e||{};this.splitCollection=Boolean(t.splitCollection),this.viewCache_=null,this.hex_=t.hex!==!1,this.littleEndian_=t.littleEndian!==!1,this.ewkb_=t.ewkb!==!1,this.layout_=t.geometryLayout,this.nodataZ_=t.nodataZ||0,this.nodataM_=t.nodataM||0,this.srid_=t.srid}getType(){return this.hex_?mn.TEXT:mn.ARRAY_BUFFER}readFeature(e,t){return new lt({geometry:this.readGeometry(e,t)})}readFeatures(e,t){let i=[];const r=this.readGeometry(e,t);return this.splitCollection&&r instanceof Pi?i=r.getGeometriesArray():i=[r],i.map(s=>new lt({geometry:s}))}readGeometry(e,t){const i=IR(e);if(!i)return null;const s=new bR(i).readGeometry();this.viewCache_=i;const o=this.getReadOptions(e,t);return this.viewCache_=null,yt(s,!1,o)}readProjection(e){const t=this.viewCache_||IR(e);if(!t)return;const i=new bR(t);return i.readWkbHeader(),i.getSrid()&&se("EPSG:"+i.getSrid())||void 0}writeFeature(e,t){return this.writeGeometry(e.getGeometry(),t)}writeFeatures(e,t){return this.writeGeometry(new Pi(e.map(i=>i.getGeometry())),t)}writeGeometry(e,t){const i=this.adaptOptions(t),r=new o3({layout:this.layout_,littleEndian:this.littleEndian_,ewkb:this.ewkb_,nodata:{Z:this.nodataZ_,M:this.nodataM_}});let s=Number.isInteger(this.srid_)?Number(this.srid_):null;if(this.srid_!==!1&&!Number.isInteger(this.srid_)){const a=i.dataProjection&&se(i.dataProjection);if(a){const l=a.getCode();l.indexOf("EPSG:")===0&&(s=Number(l.substring(5)))}}r.writeGeometry(yt(e,!0,i),s);const o=r.getBuffer();return this.hex_?l3(o):o}}function l3(n){const e=new Uint8Array(n);return Array.from(e.values()).map(t=>(t<16?"0":"")+Number(t).toString(16).toUpperCase()).join("")}function u3(n){const e=new Uint8Array(n.length/2);for(let t=0;t<n.length/2;t++)e[t]=parseInt(n.substr(t*2,2),16);return new DataView(e.buffer)}function IR(n){return typeof n=="string"?u3(n):ArrayBuffer.isView(n)?n instanceof DataView?n:new DataView(n.buffer,n.byteOffset,n.byteLength):n instanceof ArrayBuffer?new DataView(n):null}var c3=a3;const h3={POINT:Et,LINESTRING:Gt,POLYGON:pi,MULTIPOINT:Nn,MULTILINESTRING:yn,MULTIPOLYGON:$n},CR="EMPTY",LR="Z",OR="M",f3="ZM",at={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},d3={};for(const n in M)d3[n]=M[n].toUpperCase();class p3{constructor(e){this.wkt=e,this.index_=-1}isAlpha_(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}isNumeric_(e,t){const i=t!==void 0?t:!1;return e>="0"&&e<="9"||e=="."&&!i}isWhiteSpace_(e){return e==" "||e==" "||e=="\r"||e==`
|
9
|
-
`}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const e=this.nextChar_(),t=this.index_;let i=e,r;if(e=="(")r=at.LEFT_PAREN;else if(e==",")r=at.COMMA;else if(e==")")r=at.RIGHT_PAREN;else if(this.isNumeric_(e)||e=="-")r=at.NUMBER,i=this.readNumber_();else if(this.isAlpha_(e))r=at.TEXT,i=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(e==="")r=at.EOF;else throw new Error("Unexpected character: "+e)}return{position:t,value:i,type:r}}readNumber_(){let e;const t=this.index_;let i=!1,r=!1;do e=="."?i=!0:(e=="e"||e=="E")&&(r=!0),e=this.nextChar_();while(this.isNumeric_(e,i)||!r&&(e=="e"||e=="E")||r&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(t,this.index_--))}readText_(){let e;const t=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(t,this.index_--).toUpperCase()}}class g3{constructor(e){this.lexer_=e,this.token_={position:0,type:at.START},this.layout_=q.XY}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(e){return this.token_.type==e}match(e){const t=this.isTokenType(e);return t&&this.consume_(),t}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let e=q.XY;const t=this.token_;if(this.isTokenType(at.TEXT)){const i=t.value;i===LR?e=q.XYZ:i===OR?e=q.XYM:i===f3&&(e=q.XYZM),e!==q.XY&&this.consume_()}return e}parseGeometryCollectionText_(){if(this.match(at.LEFT_PAREN)){const e=[];do e.push(this.parseGeometry_());while(this.match(at.COMMA));if(this.match(at.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(at.LEFT_PAREN)){const e=this.parsePoint_();if(this.match(at.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(at.LEFT_PAREN)){const e=this.parsePointList_();if(this.match(at.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(at.LEFT_PAREN)){const e=this.parseLineStringTextList_();if(this.match(at.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(at.LEFT_PAREN)){let e;if(this.token_.type==at.LEFT_PAREN?e=this.parsePointTextList_():e=this.parsePointList_(),this.match(at.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(at.LEFT_PAREN)){const e=this.parseLineStringTextList_();if(this.match(at.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(at.LEFT_PAREN)){const e=this.parsePolygonTextList_();if(this.match(at.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parsePoint_(){const e=[],t=this.layout_.length;for(let i=0;i<t;++i){const r=this.token_;if(this.match(at.NUMBER))e.push(r.value);else break}if(e.length==t)return e;throw new Error(this.formatErrorMessage_())}parsePointList_(){const e=[this.parsePoint_()];for(;this.match(at.COMMA);)e.push(this.parsePoint_());return e}parsePointTextList_(){const e=[this.parsePointText_()];for(;this.match(at.COMMA);)e.push(this.parsePointText_());return e}parseLineStringTextList_(){const e=[this.parseLineStringText_()];for(;this.match(at.COMMA);)e.push(this.parseLineStringText_());return e}parsePolygonTextList_(){const e=[this.parsePolygonText_()];for(;this.match(at.COMMA);)e.push(this.parsePolygonText_());return e}isEmptyGeometry_(){const e=this.isTokenType(at.TEXT)&&this.token_.value==CR;return e&&this.consume_(),e}formatErrorMessage_(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}parseGeometry_(){const e=this.token_;if(this.match(at.TEXT)){const t=e.value;this.layout_=this.parseGeometryLayout_();const i=this.isEmptyGeometry_();if(t=="GEOMETRYCOLLECTION"){if(i)return new Pi([]);const r=this.parseGeometryCollectionText_();return new Pi(r)}else{const r=h3[t];if(!r)throw new Error("Invalid geometry type: "+t);let s;if(i)t=="POINT"?s=[NaN,NaN]:s=[];else switch(t){case"POINT":{s=this.parsePointText_();break}case"LINESTRING":{s=this.parseLineStringText_();break}case"POLYGON":{s=this.parsePolygonText_();break}case"MULTIPOINT":{s=this.parseMultiPointText_();break}case"MULTILINESTRING":{s=this.parseMultiLineStringText_();break}case"MULTIPOLYGON":{s=this.parseMultiPolygonText_();break}}return new r(s,this.layout_)}}throw new Error(this.formatErrorMessage_())}}class m3 extends Nd{constructor(e){super();const t=e||{};this.splitCollection_=t.splitCollection!==void 0?t.splitCollection:!1}parse_(e){const t=new p3(e);return new g3(t).parse()}readFeatureFromText(e,t){const i=this.readGeometryFromText(e,t),r=new lt;return r.setGeometry(i),r}readFeaturesFromText(e,t){let i=[];const r=this.readGeometryFromText(e,t);this.splitCollection_&&r.getType()==M.GEOMETRY_COLLECTION?i=r.getGeometriesArray():i=[r];const s=[];for(let o=0,a=i.length;o<a;++o){const l=new lt;l.setGeometry(i[o]),s.push(l)}return s}readGeometryFromText(e,t){const i=this.parse_(e);return yt(i,!1,t)}writeFeatureText(e,t){const i=e.getGeometry();return i?this.writeGeometryText(i,t):""}writeFeaturesText(e,t){if(e.length==1)return this.writeFeatureText(e[0],t);const i=[];for(let s=0,o=e.length;s<o;++s)i.push(e[s].getGeometry());const r=new Pi(i);return this.writeGeometryText(r,t)}writeGeometryText(e,t){return MR(yt(e,!0,t))}}function AR(n){const e=n.getCoordinates();return e.length===0?"":e.join(" ")}function y3(n){const e=[],t=n.getPoints();for(let i=0,r=t.length;i<r;++i)e.push("("+AR(t[i])+")");return e.join(",")}function _3(n){const e=[],t=n.getGeometries();for(let i=0,r=t.length;i<r;++i)e.push(MR(t[i]));return e.join(",")}function $y(n){const e=n.getCoordinates(),t=[];for(let i=0,r=e.length;i<r;++i)t.push(e[i].join(" "));return t.join(",")}function v3(n){const e=[],t=n.getLineStrings();for(let i=0,r=t.length;i<r;++i)e.push("("+$y(t[i])+")");return e.join(",")}function PR(n){const e=[],t=n.getLinearRings();for(let i=0,r=t.length;i<r;++i)e.push("("+$y(t[i])+")");return e.join(",")}function x3(n){const e=[],t=n.getPolygons();for(let i=0,r=t.length;i<r;++i)e.push("("+PR(t[i])+")");return e.join(",")}function E3(n){const e=n.getLayout();let t="";return(e===q.XYZ||e===q.XYZM)&&(t+=LR),(e===q.XYM||e===q.XYZM)&&(t+=OR),t}const T3={Point:AR,LineString:$y,Polygon:PR,MultiPoint:y3,MultiLineString:v3,MultiPolygon:x3,GeometryCollection:_3};function MR(n){let e=n.getType();const i=T3[e](n);if(e=e.toUpperCase(),typeof n.getFlatCoordinates=="function"){const r=E3(n);r.length>0&&(e+=" "+r)}return i.length===0?e+" "+CR:e+"("+i+")"}var w3=m3;const Mi=[null,"http://www.opengis.net/wms"],S3=Y(Mi,{Service:F(X3),Capability:F(Y3)}),R3=Y(Mi,{Request:F(J3),Exception:F(H3),Layer:F(K3)});class b3 extends Hd{constructor(){super();this.version=void 0}readFromNode(e){this.version=e.getAttribute("version").trim();const t=W({version:this.version},S3,e,[]);return t||null}}const I3=Y(Mi,{Name:F(H),Title:F(H),Abstract:F(H),KeywordList:F(DR),OnlineResource:F(va),ContactInformation:F(V3),Fees:F(H),AccessConstraints:F(H),LayerLimit:F(Wt),MaxWidth:F(Wt),MaxHeight:F(Wt)}),C3=Y(Mi,{ContactPersonPrimary:F(W3),ContactPosition:F(H),ContactAddress:F(Z3),ContactVoiceTelephone:F(H),ContactFacsimileTelephone:F(H),ContactElectronicMailAddress:F(H)}),L3=Y(Mi,{ContactPerson:F(H),ContactOrganization:F(H)}),O3=Y(Mi,{AddressType:F(H),Address:F(H),City:F(H),StateOrProvince:F(H),PostCode:F(H),Country:F(H)}),A3=Y(Mi,{Format:he(H)}),FR=Y(Mi,{Name:F(H),Title:F(H),Abstract:F(H),KeywordList:F(DR),CRS:_t(H),EX_GeographicBoundingBox:F(j3),BoundingBox:_t(B3),Dimension:_t(q3),Attribution:F(z3),AuthorityURL:_t(tU),Identifier:_t(H),MetadataURL:_t(iU),DataURL:_t(ss),FeatureListURL:_t(ss),Style:_t(nU),MinScaleDenominator:F(Ke),MaxScaleDenominator:F(Ke),Layer:_t(NR)}),P3=Y(Mi,{Title:F(H),OnlineResource:F(va),LogoURL:F($R)}),M3=Y(Mi,{westBoundLongitude:F(Ke),eastBoundLongitude:F(Ke),southBoundLatitude:F(Ke),northBoundLatitude:F(Ke)}),F3=Y(Mi,{GetCapabilities:F(Dy),GetMap:F(Dy),GetFeatureInfo:F(Dy)}),N3=Y(Mi,{Format:_t(H),DCPType:_t(Q3)}),$3=Y(Mi,{HTTP:F(eU)}),D3=Y(Mi,{Get:F(ss),Post:F(ss)}),k3=Y(Mi,{Name:F(H),Title:F(H),Abstract:F(H),LegendURL:_t($R),StyleSheetURL:F(ss),StyleURL:F(ss)}),G3=Y(Mi,{Format:F(H),OnlineResource:F(va)}),U3=Y(Mi,{Keyword:he(H)});function z3(n,e){return W({},P3,n,e)}function B3(n,e){const t=[Sr(n.getAttribute("minx")),Sr(n.getAttribute("miny")),Sr(n.getAttribute("maxx")),Sr(n.getAttribute("maxy"))],i=[Sr(n.getAttribute("resx")),Sr(n.getAttribute("resy"))];return{crs:n.getAttribute("CRS"),extent:t,res:i}}function j3(n,e){const t=W({},M3,n,e);if(!t)return;const i=t.westBoundLongitude,r=t.southBoundLatitude,s=t.eastBoundLongitude,o=t.northBoundLatitude;if(!(i===void 0||r===void 0||s===void 0||o===void 0))return[i,r,s,o]}function Y3(n,e){return W({},R3,n,e)}function X3(n,e){return W({},I3,n,e)}function V3(n,e){return W({},C3,n,e)}function W3(n,e){return W({},L3,n,e)}function Z3(n,e){return W({},O3,n,e)}function H3(n,e){return W([],A3,n,e)}function K3(n,e){const t=W({},FR,n,e);return t.Layer===void 0?Object.assign(t,NR(n,e)):t}function NR(n,e){const t=e[e.length-1],i=W({},FR,n,e);if(!i)return;let r=io(n.getAttribute("queryable"));r===void 0&&(r=t.queryable),i.queryable=r!==void 0?r:!1;let s=Rr(n.getAttribute("cascaded"));s===void 0&&(s=t.cascaded),i.cascaded=s;let o=io(n.getAttribute("opaque"));o===void 0&&(o=t.opaque),i.opaque=o!==void 0?o:!1;let a=io(n.getAttribute("noSubsets"));a===void 0&&(a=t.noSubsets),i.noSubsets=a!==void 0?a:!1;let l=Sr(n.getAttribute("fixedWidth"));l||(l=t.fixedWidth),i.fixedWidth=l;let u=Sr(n.getAttribute("fixedHeight"));return u||(u=t.fixedHeight),i.fixedHeight=u,["Style","CRS","AuthorityURL"].forEach(function(f){if(f in t){const d=i[f]||[];i[f]=d.concat(t[f])}}),["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(f){if(!(f in i)){const d=t[f];i[f]=d}}),i}function q3(n,e){return{name:n.getAttribute("name"),units:n.getAttribute("units"),unitSymbol:n.getAttribute("unitSymbol"),default:n.getAttribute("default"),multipleValues:io(n.getAttribute("multipleValues")),nearestValue:io(n.getAttribute("nearestValue")),current:io(n.getAttribute("current")),values:H(n)}}function ss(n,e){return W({},G3,n,e)}function J3(n,e){return W({},F3,n,e)}function Q3(n,e){return W({},$3,n,e)}function eU(n,e){return W({},D3,n,e)}function Dy(n,e){return W({},N3,n,e)}function $R(n,e){const t=ss(n,e);if(t){const i=[Rr(n.getAttribute("width")),Rr(n.getAttribute("height"))];return t.size=i,t}}function tU(n,e){const t=ss(n,e);if(t)return t.name=n.getAttribute("name"),t}function iU(n,e){const t=ss(n,e);if(t)return t.type=n.getAttribute("type"),t}function nU(n,e){return W({},k3,n,e)}function DR(n,e){return W([],U3,n,e)}var rU=b3;const sU="_feature",oU="_layer";class aU extends ga{constructor(e){super();const t=e||{};this.featureNS_="http://mapserver.gis.umn.edu/mapserver",this.gmlFormat_=new ya,this.layers_=t.layers?t.layers:null}getLayers(){return this.layers_}setLayers(e){this.layers_=e}readFeatures_(e,t){e.setAttribute("namespaceURI",this.featureNS_);const i=e.localName;let r=[];if(e.childNodes.length===0)return r;if(i=="msGMLOutput")for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s];if(a.nodeType!==Node.ELEMENT_NODE)continue;const l=a,u=t[0],c=oU,h=l.localName.replace(c,"");if(this.layers_&&!Ye(this.layers_,h))continue;const f=h+sU;u.featureType=f,u.featureNS=this.featureNS_;const d={};d[f]=he(this.gmlFormat_.readFeatureElement,this.gmlFormat_);const p=Y([u.featureNS,null],d);l.setAttribute("namespaceURI",this.featureNS_);const m=W([],p,l,t,this.gmlFormat_);m&&qe(r,m)}if(i=="FeatureCollection"){const s=W([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,e,[{}],this.gmlFormat_);s&&(r=s)}return r}readFeaturesFromNode(e,t){const i={};return t&&ie(i,this.getReadOptions(e,t)),this.readFeatures_(e,[i])}}var lU=aU;const br=[null,"http://www.opengis.net/wmts/1.0"],Xl=[null,"http://www.opengis.net/ows/1.1"],uU=Y(br,{Contents:F(EU)});class cU extends Hd{constructor(){super();this.owsParser_=new wS}readFromNode(e){let t=e.getAttribute("version");t&&(t=t.trim());let i=this.owsParser_.readFromNode(e);return i?(i.version=t,i=W(i,uU,e,[]),i||null):null}}const hU=Y(br,{Layer:_t(TU),TileMatrixSet:_t(wU)}),fU=Y(br,{Style:_t(SU),Format:_t(H),TileMatrixSetLink:_t(RU),Dimension:_t(bU),ResourceURL:_t(IU)},Y(Xl,{Title:F(H),Abstract:F(H),WGS84BoundingBox:F(kR),Identifier:F(H)})),dU=Y(br,{LegendURL:_t(CU)},Y(Xl,{Title:F(H),Identifier:F(H)})),pU=Y(br,{TileMatrixSet:F(H),TileMatrixSetLimits:F(OU)}),gU=Y(br,{TileMatrixLimits:he(AU)}),mU=Y(br,{TileMatrix:F(H),MinTileRow:F(Wt),MaxTileRow:F(Wt),MinTileCol:F(Wt),MaxTileCol:F(Wt)}),yU=Y(br,{Default:F(H),Value:_t(H)},Y(Xl,{Identifier:F(H)})),_U=Y(Xl,{LowerCorner:he(ky),UpperCorner:he(ky)}),vU=Y(br,{WellKnownScaleSet:F(H),TileMatrix:_t(LU)},Y(Xl,{SupportedCRS:F(H),Identifier:F(H),BoundingBox:F(kR)})),xU=Y(br,{TopLeftCorner:F(ky),ScaleDenominator:F(Ke),TileWidth:F(Wt),TileHeight:F(Wt),MatrixWidth:F(Wt),MatrixHeight:F(Wt)},Y(Xl,{Identifier:F(H)}));function EU(n,e){return W({},hU,n,e)}function TU(n,e){return W({},fU,n,e)}function wU(n,e){return W({},vU,n,e)}function SU(n,e){const t=W({},dU,n,e);if(!t)return;const i=n.getAttribute("isDefault")==="true";return t.isDefault=i,t}function RU(n,e){return W({},pU,n,e)}function bU(n,e){return W({},yU,n,e)}function IU(n,e){const t=n.getAttribute("format"),i=n.getAttribute("template"),r=n.getAttribute("resourceType"),s={};return t&&(s.format=t),i&&(s.template=i),r&&(s.resourceType=r),s}function kR(n,e){const t=W([],_U,n,e);if(t.length==2)return Lt(t)}function CU(n,e){const t={};return t.format=n.getAttribute("format"),t.href=va(n),t}function ky(n,e){const t=H(n).split(/\s+/);if(!t||t.length!=2)return;const i=+t[0],r=+t[1];if(!(isNaN(i)||isNaN(r)))return[i,r]}function LU(n,e){return W({},xU,n,e)}function OU(n,e){return W([],gU,n,e)}function AU(n,e){return W({},mU,n,e)}var PU=cU;function Gy(n,e,t){const i=[];let r=n(0),s=n(1),o=e(r),a=e(s);const l=[s,r],u=[a,o],c=[1,0],h={};let f=1e5,d,p,m,g,v,y;for(;--f>0&&c.length>0;)m=c.pop(),r=l.pop(),o=u.pop(),y=m.toString(),y in h||(i.push(o[0],o[1]),h[y]=!0),g=c.pop(),s=l.pop(),a=u.pop(),v=(m+g)/2,d=n(v),p=e(d),xm(p[0],p[1],o[0],o[1],a[0],a[1])<t?(i.push(a[0],a[1]),y=g.toString(),h[y]=!0):(c.push(g,v,v,m),u.push(a,p,p,o),l.push(s,d,d,r));return i}function MU(n,e,t,i,r,s){const o=se("EPSG:4326"),a=Math.cos(di(e)),l=Math.sin(di(e)),u=Math.cos(di(i)),c=Math.sin(di(i)),h=Math.cos(di(t-n)),f=Math.sin(di(t-n)),d=l*c+a*u*h;return Gy(function(p){if(1<=d)return[t,i];const m=p*Math.acos(d),g=Math.cos(m),v=Math.sin(m),y=f*u,x=a*c-l*u*h,_=Math.atan2(y,x),E=Math.asin(l*g+a*v*Math.cos(_)),T=di(n)+Math.atan2(Math.sin(_)*v*a,g-l*Math.sin(E));return[Wu(T),Wu(E)]},Kn(o,r),s)}function GR(n,e,t,i,r){const s=se("EPSG:4326");return Gy(function(o){return[n,e+(t-e)*o]},Kn(s,i),r)}function UR(n,e,t,i,r){const s=se("EPSG:4326");return Gy(function(o){return[e+(t-e)*o,n]},Kn(s,i),r)}function FU(n,e,t,i){const r=t-i;return n[e]===n[r]&&n[e+1]===n[r+1]&&(t-e)/i>3?!!Vf(n,e,t,i):!1}function NU(n,e){const t=n.canvas,i=e||{},r=i.pixelRatio||Sf,s=i.size;s&&(t.width=s[0]*r,t.height=s[1]*r,t.style.width=s[0]+"px",t.style.height=s[1]+"px");const o=[0,0,t.width,t.height],a=rl(xt(),r,r);return new yd(n,r,o,a,0)}function zR(n){if(!(n.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");const e=n.inversePixelTransform[0],t=n.frameState,i=zo(n.inversePixelTransform.slice(),t.coordinateToPixelTransform),r=vd(t.viewState.resolution,e);let s;const o=Zi();return o&&(s=wn(o,t.viewState.projection)),new yd(n.context,e,t.extent,i,t.viewState.rotation,r,s)}function $U(n,e){return rt(n.inversePixelTransform,e.slice(0))}const DU=new ir({color:"rgba(0,0,0,0.2)"}),kU=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001];class GU extends ua{constructor(e){const t=e||{},i=ie({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},t);delete i.maxLines,delete i.strokeStyle,delete i.targetSize,delete i.showLabels,delete i.lonLabelFormatter,delete i.latLabelFormatter,delete i.lonLabelPosition,delete i.latLabelPosition,delete i.lonLabelStyle,delete i.latLabelStyle,delete i.intervals;super(i);this.projection_=null,this.maxLat_=1/0,this.maxLon_=1/0,this.minLat_=-1/0,this.minLon_=-1/0,this.maxX_=1/0,this.maxY_=1/0,this.minX_=-1/0,this.minY_=-1/0,this.targetSize_=t.targetSize!==void 0?t.targetSize:100,this.maxLines_=t.maxLines!==void 0?t.maxLines:100,this.meridians_=[],this.parallels_=[],this.strokeStyle_=t.strokeStyle!==void 0?t.strokeStyle:DU,this.fromLonLatTransform_=void 0,this.toLonLatTransform_=void 0,this.projectionCenterLonLat_=null,this.bottomLeft_=null,this.bottomRight_=null,this.topLeft_=null,this.topRight_=null,this.meridiansLabels_=null,this.parallelsLabels_=null,t.showLabels&&(this.lonLabelFormatter_=t.lonLabelFormatter==null?Ku.bind(this,"EW"):t.lonLabelFormatter,this.latLabelFormatter_=t.latLabelFormatter==null?Ku.bind(this,"NS"):t.latLabelFormatter,this.lonLabelPosition_=t.lonLabelPosition==null?0:t.lonLabelPosition,this.latLabelPosition_=t.latLabelPosition==null?1:t.latLabelPosition,this.lonLabelStyleBase_=new Er({text:t.lonLabelStyle!==void 0?t.lonLabelStyle.clone():new Pc({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new xr({color:"rgba(0,0,0,1)"}),stroke:new ir({color:"rgba(255,255,255,1)",width:3})})}),this.lonLabelStyle_=function(r){const s=r.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(s),this.lonLabelStyleBase_}.bind(this),this.latLabelStyleBase_=new Er({text:t.latLabelStyle!==void 0?t.latLabelStyle.clone():new Pc({font:"12px Calibri,sans-serif",textAlign:"right",fill:new xr({color:"rgba(0,0,0,1)"}),stroke:new ir({color:"rgba(255,255,255,1)",width:3})})}),this.latLabelStyle_=function(r){const s=r.get("graticule_label");return this.latLabelStyleBase_.getText().setText(s),this.latLabelStyleBase_}.bind(this),this.meridiansLabels_=[],this.parallelsLabels_=[],this.addEventListener(Hi.POSTRENDER,this.drawLabels_.bind(this))),this.intervals_=t.intervals!==void 0?t.intervals:kU,this.setSource(new ca({loader:this.loaderFunction.bind(this),strategy:this.strategyFunction.bind(this),features:new qt,overlaps:!1,useSpatialIndex:!1,wrapX:t.wrapX})),this.featurePool_=[],this.lineStyle_=new Er({stroke:this.strokeStyle_}),this.loadedExtent_=null,this.renderedExtent_=null,this.renderedResolution_=null,this.setRenderOrder(null)}strategyFunction(e,t){let i=e.slice();return this.projection_&&this.getSource().getWrapX()&&_m(i,this.projection_),this.loadedExtent_&&(Xx(this.loadedExtent_,i,t)?i=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[i]}loaderFunction(e,t,i){this.loadedExtent_=e;const r=this.getSource(),s=this.getExtent()||[-1/0,-1/0,1/0,1/0],o=Ai(s,e);if(this.renderedExtent_&&Tn(this.renderedExtent_,o)&&this.renderedResolution_===t||(this.renderedExtent_=o,this.renderedResolution_=t,zs(o)))return;const a=fi(o),l=t*t/4;(!this.projection_||!dn(this.projection_,i))&&this.updateProjectionInfo_(i),this.createGraticule_(o,a,t,l);let c=this.meridians_.length+this.parallels_.length;this.meridiansLabels_&&(c+=this.meridians_.length),this.parallelsLabels_&&(c+=this.parallels_.length);let h;for(;c>this.featurePool_.length;)h=new lt,this.featurePool_.push(h);const f=r.getFeaturesCollection();f.clear();let d=0,p,m;for(p=0,m=this.meridians_.length;p<m;++p)h=this.featurePool_[d++],h.setGeometry(this.meridians_[p]),h.setStyle(this.lineStyle_),f.push(h);for(p=0,m=this.parallels_.length;p<m;++p)h=this.featurePool_[d++],h.setGeometry(this.parallels_[p]),h.setStyle(this.lineStyle_),f.push(h)}addMeridian_(e,t,i,r,s,o){const a=this.getMeridian_(e,t,i,r,o);if(dt(a.getExtent(),s)){if(this.meridiansLabels_){const l=this.lonLabelFormatter_(e);o in this.meridiansLabels_?this.meridiansLabels_[o].text=l:this.meridiansLabels_[o]={geom:new Et([]),text:l}}this.meridians_[o++]=a}return o}addParallel_(e,t,i,r,s,o){const a=this.getParallel_(e,t,i,r,o);if(dt(a.getExtent(),s)){if(this.parallelsLabels_){const l=this.latLabelFormatter_(e);o in this.parallelsLabels_?this.parallelsLabels_[o].text=l:this.parallelsLabels_[o]={geom:new Et([]),text:l}}this.parallels_[o++]=a}return o}drawLabels_(e){const t=e.frameState.viewState.rotation,i=e.frameState.viewState.resolution,r=e.frameState.size,s=e.frameState.extent,o=fi(s);let a=s;if(t){const p=r[0]*i,m=r[1]*i;a=[o[0]-p/2,o[1]-m/2,o[0]+p/2,o[1]+m/2]}let l=0,u=0,c=this.latLabelPosition_<.5;const h=this.projection_.getExtent(),f=Ae(h);if(this.getSource().getWrapX()&&this.projection_.canWrapX()&&!hi(h,s)){l=Math.floor((s[0]-h[0])/f),u=Math.ceil((s[2]-h[2])/f);const p=Math.abs(t)>Math.PI/2;c=c!==p}const d=zR(e);for(let p=l;p<=u;++p){let m=this.meridians_.length+this.parallels_.length,g,v,y,x;if(this.meridiansLabels_)for(v=0,y=this.meridiansLabels_.length;v<y;++v){const _=this.meridians_[v];if(!t&&p===0)x=this.getMeridianPoint_(_,s,v);else{const E=_.clone();E.translate(p*f,0),E.rotate(-t,o),x=this.getMeridianPoint_(E,a,v),x.rotate(t,o)}g=this.featurePool_[m++],g.setGeometry(x),g.set("graticule_label",this.meridiansLabels_[v].text),d.drawFeature(g,this.lonLabelStyle_(g))}if(this.parallelsLabels_&&(p===l&&c||p===u&&!c))for(v=0,y=this.parallels_.length;v<y;++v){const _=this.parallels_[v];if(!t&&p===0)x=this.getParallelPoint_(_,s,v);else{const E=_.clone();E.translate(p*f,0),E.rotate(-t,o),x=this.getParallelPoint_(E,a,v),x.rotate(t,o)}g=this.featurePool_[m++],g.setGeometry(x),g.set("graticule_label",this.parallelsLabels_[v].text),d.drawFeature(g,this.latLabelStyle_(g))}}}createGraticule_(e,t,i,r){const s=this.getInterval_(i);if(s==-1){this.meridians_.length=0,this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),this.parallelsLabels_&&(this.parallelsLabels_.length=0);return}let o=!1;const a=this.projection_.getExtent(),l=Ae(a);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!hi(a,e)&&(Ae(e)>=l?(e[0]=a[0],e[2]=a[2]):o=!0);const u=[Ie(t[0],this.minX_,this.maxX_),Ie(t[1],this.minY_,this.maxY_)],c=this.toLonLatTransform_(u);isNaN(c[1])&&(c[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);let h=Ie(c[0],this.minLon_,this.maxLon_),f=Ie(c[1],this.minLat_,this.maxLat_);const d=this.maxLines_;let p,m,g,v,y=e;o||(y=[Ie(e[0],this.minX_,this.maxX_),Ie(e[1],this.minY_,this.maxY_),Ie(e[2],this.minX_,this.maxX_),Ie(e[3],this.minY_,this.maxY_)]);const x=Zo(y,this.toLonLatTransform_,void 0,8);let _=x[3],E=x[2],T=x[1],w=x[0];if(o||(cn(y,this.bottomLeft_)&&(w=this.minLon_,T=this.minLat_),cn(y,this.bottomRight_)&&(E=this.maxLon_,T=this.minLat_),cn(y,this.topLeft_)&&(w=this.minLon_,_=this.maxLat_),cn(y,this.topRight_)&&(E=this.maxLon_,_=this.maxLat_),_=Ie(_,f,this.maxLat_),E=Ie(E,h,this.maxLon_),T=Ie(T,this.minLat_,f),w=Ie(w,this.minLon_,h)),h=Math.floor(h/s)*s,v=Ie(h,this.minLon_,this.maxLon_),m=this.addMeridian_(v,T,_,r,e,0),p=0,o)for(;(v-=s)>=w&&p++<d;)m=this.addMeridian_(v,T,_,r,e,m);else for(;v!=this.minLon_&&p++<d;)v=Math.max(v-s,this.minLon_),m=this.addMeridian_(v,T,_,r,e,m);if(v=Ie(h,this.minLon_,this.maxLon_),p=0,o)for(;(v+=s)<=E&&p++<d;)m=this.addMeridian_(v,T,_,r,e,m);else for(;v!=this.maxLon_&&p++<d;)v=Math.min(v+s,this.maxLon_),m=this.addMeridian_(v,T,_,r,e,m);for(this.meridians_.length=m,this.meridiansLabels_&&(this.meridiansLabels_.length=m),f=Math.floor(f/s)*s,g=Ie(f,this.minLat_,this.maxLat_),m=this.addParallel_(g,w,E,r,e,0),p=0;g!=this.minLat_&&p++<d;)g=Math.max(g-s,this.minLat_),m=this.addParallel_(g,w,E,r,e,m);for(g=Ie(f,this.minLat_,this.maxLat_),p=0;g!=this.maxLat_&&p++<d;)g=Math.min(g+s,this.maxLat_),m=this.addParallel_(g,w,E,r,e,m);this.parallels_.length=m,this.parallelsLabels_&&(this.parallelsLabels_.length=m)}getInterval_(e){const t=this.projectionCenterLonLat_[0],i=this.projectionCenterLonLat_[1];let r=-1;const s=Math.pow(this.targetSize_*e,2),o=[],a=[];for(let l=0,u=this.intervals_.length;l<u;++l){const c=Ie(this.intervals_[l]/2,0,90),h=Ie(i,-90+c,90-c);if(o[0]=t-c,o[1]=h-c,a[0]=t+c,a[1]=h+c,this.fromLonLatTransform_(o,o),this.fromLonLatTransform_(a,a),Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)<=s)break;r=this.intervals_[l]}return r}getMeridian_(e,t,i,r,s){const o=GR(e,t,i,this.projection_,r);let a=this.meridians_[s];return a?(a.setFlatCoordinates(q.XY,o),a.changed()):(a=new Gt(o,q.XY),this.meridians_[s]=a),a}getMeridianPoint_(e,t,i){const r=e.getFlatCoordinates();let s=1,o=r.length-1;r[s]>r[o]&&(s=o,o=1);const a=Math.max(t[1],r[s]),l=Math.min(t[3],r[o]),u=Ie(t[1]+Math.abs(t[1]-t[3])*this.lonLabelPosition_,a,l),h=[r[s-1]+(r[o-1]-r[s-1])*(u-r[s])/(r[o]-r[s]),u],f=this.meridiansLabels_[i].geom;return f.setCoordinates(h),f}getMeridians(){return this.meridians_}getParallel_(e,t,i,r,s){const o=UR(e,t,i,this.projection_,r);let a=this.parallels_[s];return a?(a.setFlatCoordinates(q.XY,o),a.changed()):a=new Gt(o,q.XY),a}getParallelPoint_(e,t,i){const r=e.getFlatCoordinates();let s=0,o=r.length-2;r[s]>r[o]&&(s=o,o=0);const a=Math.max(t[0],r[s]),l=Math.min(t[2],r[o]),u=Ie(t[0]+Math.abs(t[0]-t[2])*this.latLabelPosition_,a,l),c=r[s+1]+(r[o+1]-r[s+1])*(u-r[s])/(r[o]-r[s]),h=[u,c],f=this.parallelsLabels_[i].geom;return f.setCoordinates(h),f}getParallels(){return this.parallels_}updateProjectionInfo_(e){const t=se("EPSG:4326"),i=e.getWorldExtent();this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0];const r=Kn(e,t);if(this.minLon_<this.maxLon_)this.toLonLatTransform_=r;else{const o=this.minLon_+this.maxLon_/2;this.maxLon_+=360,this.toLonLatTransform_=function(a,l,u){const c=u||2,h=r(a,l,c);for(let f=0,d=h.length;f<d;f+=c)h[f]<o&&(h[f]+=360);return h}}this.fromLonLatTransform_=Kn(t,e);const s=Zo([this.minLon_,this.minLat_,this.maxLon_,this.maxLat_],this.fromLonLatTransform_,void 0,8);this.minX_=s[0],this.maxX_=s[2],this.minY_=s[1],this.maxY_=s[3],this.bottomLeft_=this.fromLonLatTransform_([this.minLon_,this.minLat_]),this.bottomRight_=this.fromLonLatTransform_([this.maxLon_,this.minLat_]),this.topLeft_=this.fromLonLatTransform_([this.minLon_,this.maxLat_]),this.topRight_=this.fromLonLatTransform_([this.maxLon_,this.maxLat_]),this.projectionCenterLonLat_=this.toLonLatTransform_(fi(e.getExtent())),isNaN(this.projectionCenterLonLat_[1])&&(this.projectionCenterLonLat_[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=e}}var Uy=GU;class UU extends ra{constructor(e){const t=e||{};super(t)}}var BR=UU,os={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class zU extends ra{constructor(e){const t=e||{},i=ie({},t);delete i.preload,delete i.useInterimTilesOnError;super(i);this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(os.PRELOAD)}setPreload(e){this.set(os.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(os.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(os.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}var zy=zU;const Vl=34962,Zc=34963,jR=35040,ip=35044,Hc=35048,YR=5121,XR=5123,VR=5125,By=5126,WR=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function np(n,e){const t=ie({preserveDrawingBuffer:!0},e),i=WR.length;for(let r=0;r<i;++r)try{const s=n.getContext(WR[r],t);if(s)return s}catch{}return null}let jy;function BU(){if(!jy){const n=document.createElement("canvas"),e=np(n);e&&(jy=e.getSupportedExtensions())}return jy}const ZR={STATIC_DRAW:ip,STREAM_DRAW:jR,DYNAMIC_DRAW:Hc};class jU{constructor(e,t){this.array=null,this.type=e,ce(e===Vl||e===Zc,62),this.usage=t!==void 0?t:ZR.STATIC_DRAW}ofSize(e){this.array=new(rp(this.type))(e)}fromArray(e){const t=rp(this.type);this.array=t.from?t.from(e):new t(e)}fromArrayBuffer(e){this.array=new(rp(this.type))(e)}getType(){return this.type}getArray(){return this.array}getUsage(){return this.usage}getSize(){return this.array?this.array.length:0}}function rp(n){switch(n){case Vl:return Float32Array;case Zc:return Uint32Array;default:return Float32Array}}var Wl=jU,Kc={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};const YU=`
|
10
|
-
precision mediump float;
|
11
|
-
|
12
|
-
attribute vec2 a_position;
|
13
|
-
varying vec2 v_texCoord;
|
14
|
-
varying vec2 v_screenCoord;
|
15
|
-
|
16
|
-
uniform vec2 u_screenSize;
|
17
|
-
|
18
|
-
void main() {
|
19
|
-
v_texCoord = a_position * 0.5 + 0.5;
|
20
|
-
v_screenCoord = v_texCoord * u_screenSize;
|
21
|
-
gl_Position = vec4(a_position, 0.0, 1.0);
|
22
|
-
}
|
23
|
-
`,XU=`
|
24
|
-
precision mediump float;
|
25
|
-
|
26
|
-
uniform sampler2D u_image;
|
27
|
-
uniform float u_opacity;
|
28
|
-
|
29
|
-
varying vec2 v_texCoord;
|
30
|
-
|
31
|
-
void main() {
|
32
|
-
gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;
|
33
|
-
}
|
34
|
-
`;class VU{constructor(e){this.gl_=e.webGlContext;const t=this.gl_;this.scaleRatio_=e.scaleRatio||1,this.renderTargetTexture_=t.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=t.createFramebuffer();const i=t.createShader(t.VERTEX_SHADER);t.shaderSource(i,e.vertexShader||YU),t.compileShader(i);const r=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(r,e.fragmentShader||XU),t.compileShader(r),this.renderTargetProgram_=t.createProgram(),t.attachShader(this.renderTargetProgram_,i),t.attachShader(this.renderTargetProgram_,r),t.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=t.createBuffer();const s=[-1,-1,1,-1,-1,1,1,-1,1,1,-1,1];t.bindBuffer(t.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),t.bufferData(t.ARRAY_BUFFER,new Float32Array(s),t.STATIC_DRAW),this.renderTargetAttribLocation_=t.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=t.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=t.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=t.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],e.uniforms&&Object.keys(e.uniforms).forEach(function(o){this.uniforms_.push({value:e.uniforms[o],location:t.getUniformLocation(this.renderTargetProgram_,o)})}.bind(this))}getGL(){return this.gl_}init(e){const t=this.getGL(),i=[t.drawingBufferWidth*this.scaleRatio_,t.drawingBufferHeight*this.scaleRatio_];if(t.bindFramebuffer(t.FRAMEBUFFER,this.getFrameBuffer()),t.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;const r=0,s=t.RGBA,o=0,a=t.RGBA,l=t.UNSIGNED_BYTE,u=null;t.bindTexture(t.TEXTURE_2D,this.renderTargetTexture_),t.texImage2D(t.TEXTURE_2D,r,s,i[0],i[1],o,a,l,u),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.renderTargetTexture_,0)}}apply(e,t,i,r){const s=this.getGL(),o=e.size;if(s.bindFramebuffer(s.FRAMEBUFFER,t?t.getFrameBuffer():null),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.renderTargetTexture_),!t){const l=oe(s.canvas);if(!e.renderTargets[l]){const u=s.getContextAttributes();u&&u.preserveDrawingBuffer&&(s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),e.renderTargets[l]=!0}}s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.viewport(0,0,s.drawingBufferWidth,s.drawingBufferHeight),s.bindBuffer(s.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),s.useProgram(this.renderTargetProgram_),s.enableVertexAttribArray(this.renderTargetAttribLocation_),s.vertexAttribPointer(this.renderTargetAttribLocation_,2,s.FLOAT,!1,0,0),s.uniform2f(this.renderTargetUniformLocation_,o[0],o[1]),s.uniform1i(this.renderTargetTextureLocation_,0);const a=e.layerStatesArray[e.layerIndex].opacity;s.uniform1f(this.renderTargetOpacityLocation_,a),this.applyUniforms(e),i&&i(s,e),s.drawArrays(s.TRIANGLES,0,6),r&&r(s,e)}getFrameBuffer(){return this.frameBuffer_}applyUniforms(e){const t=this.getGL();let i,r=1;this.uniforms_.forEach(function(s){if(i=typeof s.value=="function"?s.value(e):s.value,i instanceof HTMLCanvasElement||i instanceof ImageData)s.texture||(s.texture=t.createTexture()),t.activeTexture(t[`TEXTURE${r}`]),t.bindTexture(t.TEXTURE_2D,s.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),i instanceof ImageData?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,i.width,i.height,0,t.UNSIGNED_BYTE,new Uint8Array(i.data)):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i),t.uniform1i(s.location,r++);else if(Array.isArray(i))switch(i.length){case 2:t.uniform2f(s.location,i[0],i[1]);return;case 3:t.uniform3f(s.location,i[0],i[1],i[2]);return;case 4:t.uniform4f(s.location,i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&t.uniform1f(s.location,i)})}}var Yy=VU;function Xy(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function qc(n,e){return n[0]=e[0],n[1]=e[1],n[4]=e[2],n[5]=e[3],n[12]=e[4],n[13]=e[5],n}const WU={FRAGMENT_SHADER:35632,VERTEX_SHADER:35633},Ta={PROJECTION_MATRIX:"u_projectionMatrix",OFFSET_SCALE_MATRIX:"u_offsetScaleMatrix",OFFSET_ROTATION_MATRIX:"u_offsetRotateMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution"},Sn={UNSIGNED_BYTE:YR,UNSIGNED_SHORT:XR,UNSIGNED_INT:VR,FLOAT:By},sp={};function HR(n){return"shared/"+n}let KR=0;function ZU(){const n="unique/"+KR;return KR+=1,n}function HU(n){let e=sp[n];if(!e){const t=document.createElement("canvas");t.style.position="absolute",t.style.left="0",e={users:0,canvas:t},sp[n]=e}return e.users+=1,e.canvas}function KU(n){const e=sp[n];if(!e||(e.users-=1,e.users>0))return;const t=e.canvas,r=np(t).getExtension("WEBGL_lose_context");r&&r.loseContext(),delete sp[n]}class qU extends ko{constructor(e){super();const t=e||{};this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?HR(t.canvasCacheKey):ZU(),this.canvas_=HU(this.canvasCacheKey_),this.gl_=np(this.canvas_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.canvas_.addEventListener(Kc.LOST,this.boundHandleWebGLContextLost_),this.canvas_.addEventListener(Kc.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=xt(),this.offsetScaleMatrix_=xt(),this.tmpMat4_=Xy(),this.uniformLocations_={},this.attribLocations_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms);const i=this.getGL();this.postProcessPasses_=t.postProcesses?t.postProcesses.map(function(r){return new Yy({webGlContext:i,scaleRatio:r.scaleRatio,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,uniforms:r.uniforms})}):[new Yy({webGlContext:i})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(e){this.uniforms_=[];for(const t in e)this.uniforms_.push({name:t,value:e[t]});this.uniformLocations_={}}canvasCacheKeyMatches(e){return this.canvasCacheKey_===HR(e)}getExtension(e){if(e in this.extensionCache_)return this.extensionCache_[e];const t=this.gl_.getExtension(e);return this.extensionCache_[e]=t,t}bindBuffer(e){const t=this.getGL(),i=oe(e);let r=this.bufferCache_[i];if(!r){const s=t.createBuffer();r={buffer:e,webGlBuffer:s},this.bufferCache_[i]=r}t.bindBuffer(e.getType(),r.webGlBuffer)}flushBufferData(e){const t=this.getGL();this.bindBuffer(e),t.bufferData(e.getType(),e.getArray(),e.getUsage())}deleteBuffer(e){const t=this.getGL(),i=oe(e),r=this.bufferCache_[i];r&&!t.isContextLost()&&t.deleteBuffer(r.webGlBuffer),delete this.bufferCache_[i]}disposeInternal(){this.canvas_.removeEventListener(Kc.LOST,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(Kc.RESTORED,this.boundHandleWebGLContextRestored_),KU(this.canvasCacheKey_),delete this.gl_,delete this.canvas_}prepareDraw(e,t){const i=this.getGL(),r=this.getCanvas(),s=e.size,o=e.pixelRatio;r.width=s[0]*o,r.height=s[1]*o,r.style.width=s[0]+"px",r.style.height=s[1]+"px",i.useProgram(this.currentProgram_);for(let a=this.postProcessPasses_.length-1;a>=0;a--)this.postProcessPasses_[a].init(e);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,t?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(e),this.applyUniforms(e)}prepareDrawToRenderTarget(e,t,i){const r=this.getGL(),s=t.getSize();r.bindFramebuffer(r.FRAMEBUFFER,t.getFramebuffer()),r.viewport(0,0,s[0],s[1]),r.bindTexture(r.TEXTURE_2D,t.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,i?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(e),this.applyUniforms(e)}drawElements(e,t){const i=this.getGL();this.getExtension("OES_element_index_uint");const r=i.UNSIGNED_INT,s=4,o=t-e,a=e*s;i.drawElements(i.TRIANGLES,o,r,a)}finalizeDraw(e,t,i){for(let r=0,s=this.postProcessPasses_.length;r<s;r++)r===s-1?this.postProcessPasses_[r].apply(e,null,t,i):this.postProcessPasses_[r].apply(e,this.postProcessPasses_[r+1])}getCanvas(){return this.canvas_}getGL(){return this.gl_}applyFrameState(e){const t=e.size,i=e.viewState.rotation,r=il(this.offsetScaleMatrix_);rl(r,2/t[0],2/t[1]);const s=il(this.offsetRotateMatrix_);i!==0&&Ux(s,-i),this.setUniformMatrixValue(Ta.OFFSET_SCALE_MATRIX,qc(this.tmpMat4_,r)),this.setUniformMatrixValue(Ta.OFFSET_ROTATION_MATRIX,qc(this.tmpMat4_,s)),this.setUniformFloatValue(Ta.TIME,(Date.now()-this.startTime_)*.001),this.setUniformFloatValue(Ta.ZOOM,e.viewState.zoom),this.setUniformFloatValue(Ta.RESOLUTION,e.viewState.resolution)}applyUniforms(e){const t=this.getGL();let i,r=0;this.uniforms_.forEach(function(s){if(i=typeof s.value=="function"?s.value(e):s.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData)s.texture||(s.prevValue=void 0,s.texture=t.createTexture()),t.activeTexture(t[`TEXTURE${r}`]),t.bindTexture(t.TEXTURE_2D,s.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(!(i instanceof HTMLImageElement)||i.complete)&&s.prevValue!==i&&(s.prevValue=i,t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i)),t.uniform1i(this.getUniformLocation(s.name),r++);else if(Array.isArray(i)&&i.length===6)this.setUniformMatrixValue(s.name,qc(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:t.uniform2f(this.getUniformLocation(s.name),i[0],i[1]);return;case 3:t.uniform3f(this.getUniformLocation(s.name),i[0],i[1],i[2]);return;case 4:t.uniform4f(this.getUniformLocation(s.name),i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&t.uniform1f(this.getUniformLocation(s.name),i)}.bind(this))}useProgram(e){return e==this.currentProgram_?!1:(this.getGL().useProgram(e),this.currentProgram_=e,this.uniformLocations_={},this.attribLocations_={},!0)}compileShader(e,t){const i=this.getGL(),r=i.createShader(t);return i.shaderSource(r,e),i.compileShader(r),r}getProgram(e,t){const i=this.getGL(),r=this.compileShader(e,i.FRAGMENT_SHADER),s=this.compileShader(t,i.VERTEX_SHADER),o=i.createProgram();if(i.attachShader(o,r),i.attachShader(o,s),i.linkProgram(o),!i.getShaderParameter(r,i.COMPILE_STATUS)){const a=`Fragment shader compliation failed: ${i.getShaderInfoLog(r)}`;throw new Error(a)}if(i.deleteShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS)){const a=`Vertex shader compilation failed: ${i.getShaderInfoLog(s)}`;throw new Error(a)}if(i.deleteShader(s),!i.getProgramParameter(o,i.LINK_STATUS)){const a=`GL program linking failed: ${i.getShaderInfoLog(s)}`;throw new Error(a)}return o}getUniformLocation(e){return this.uniformLocations_[e]===void 0&&(this.uniformLocations_[e]=this.getGL().getUniformLocation(this.currentProgram_,e)),this.uniformLocations_[e]}getAttributeLocation(e){return this.attribLocations_[e]===void 0&&(this.attribLocations_[e]=this.getGL().getAttribLocation(this.currentProgram_,e)),this.attribLocations_[e]}makeProjectionTransform(e,t){const i=e.size,r=e.viewState.rotation,s=e.viewState.resolution,o=e.viewState.center;return il(t),Ti(t,0,0,2/(s*i[0]),2/(s*i[1]),-r,-o[0],-o[1]),t}setUniformFloatValue(e,t){this.getGL().uniform1f(this.getUniformLocation(e),t)}setUniformFloatVec4(e,t){this.getGL().uniform4fv(this.getUniformLocation(e),t)}setUniformMatrixValue(e,t){this.getGL().uniformMatrix4fv(this.getUniformLocation(e),!1,t)}enableAttributeArray_(e,t,i,r,s){const o=this.getAttributeLocation(e);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,t,i,!1,r,s))}enableAttributes(e){const t=qR(e);let i=0;for(let r=0;r<e.length;r++){const s=e[r];this.enableAttributeArray_(s.name,s.size,s.type||By,t,i),i+=s.size*JR(s.type)}}handleWebGLContextLost(){Ns(this.bufferCache_),this.currentProgram_=null}handleWebGLContextRestored(){}createTexture(e,t,i){const r=this.getGL(),s=i||r.createTexture(),o=0,a=r.RGBA,l=0,u=r.RGBA,c=r.UNSIGNED_BYTE;return r.bindTexture(r.TEXTURE_2D,s),t?r.texImage2D(r.TEXTURE_2D,o,a,u,c,t):r.texImage2D(r.TEXTURE_2D,o,a,e[0],e[1],l,u,c,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),s}}function qR(n){let e=0;for(let t=0;t<n.length;t++){const i=n[t];e+=i.size*JR(i.type)}return e}function JR(n){switch(n){case Sn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Sn.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var QR=qU;const op={GENERATE_BUFFERS:"GENERATE_BUFFERS"};class ax extends B0{constructor(e,t){super(e);const i=t||{};this.inversePixelTransform_=xt(),this.pixelContext_=null,this.postProcesses_=i.postProcesses,this.uniforms_=i.uniforms,this.helper,e.addChangeListener(Qe.MAP,this.removeHelper.bind(this)),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(e,t){const i=this.getLayer();if(i.hasListener(Hi.PRECOMPOSE)){const r=new gl(Hi.PRECOMPOSE,void 0,t,e);i.dispatchEvent(r)}}dispatchPostComposeEvent(e,t){const i=this.getLayer();if(i.hasListener(Hi.POSTCOMPOSE)){const r=new gl(Hi.POSTCOMPOSE,void 0,t,e);i.dispatchEvent(r)}}reset(e){this.uniforms_=e.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(e){if(this.getLayer().getRenderSource()){let t=!0,i=-1,r;for(let o=0,a=e.layerStatesArray.length;o<a;o++){const l=e.layerStatesArray[o].layer,u=l.getRenderer();if(!(u instanceof ax)){t=!0;continue}const c=l.getClassName();if((t||c!==r)&&(i+=1,t=!1),r=c,u===this)break}const s="map/"+e.mapId+"/group/"+i;(!this.helper||!this.helper.canvasCacheKeyMatches(s))&&(this.removeHelper(),this.helper=new QR({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:s}),r&&(this.helper.getCanvas().className=r),this.afterHelperCreated())}return this.prepareFrameInternal(e)}afterHelperCreated(){}prepareFrameInternal(e){return!0}disposeInternal(){this.removeHelper(),super.disposeInternal()}dispatchRenderEvent_(e,t,i){const r=this.getLayer();if(r.hasListener(e)){Ti(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);const s=new gl(e,this.inversePixelTransform_,i,t);r.dispatchEvent(s)}}preRender(e,t){this.dispatchRenderEvent_(Hi.PRERENDER,e,t)}postRender(e,t){this.dispatchRenderEvent_(Hi.POSTRENDER,e,t)}getDataAtPixel(e,t,i){const r=rt([t.pixelRatio,0,0,t.pixelRatio,0,0],e.slice()),s=this.helper.getGL();if(!s)return null;const a=this.getLayer().getExtent();if(a){const d=rt(t.pixelToCoordinateTransform,e.slice());if(!cn(a,d))return null}const l=s.getContextAttributes();if(!l||!l.preserveDrawingBuffer)return new Uint8Array;const u=Math.round(r[0]),c=Math.round(r[1]);let h=this.pixelContext_;if(!h){const d=document.createElement("canvas");d.width=1,d.height=1,h=d.getContext("2d"),this.pixelContext_=h}h.clearRect(0,0,1,1);let f;try{h.drawImage(s.canvas,u,c,1,1,0,0,1,1),f=h.getImageData(0,0,1,1).data}catch{return f}return f[3]===0?null:f}}const JU=[],Vy={vertexPosition:0,indexPosition:0};function ap(n,e,t,i,r){n[e+0]=t,n[e+1]=i,n[e+2]=r}function QU(n,e,t,i,r,s){const l=3+r,u=n[e+0],c=n[e+1],h=JU;h.length=r;for(let m=0;m<h.length;m++)h[m]=n[e+2+m];let f=s?s.vertexPosition:0,d=s?s.indexPosition:0;const p=f/l;return ap(t,f,u,c,0),h.length&&t.set(h,f+3),f+=l,ap(t,f,u,c,1),h.length&&t.set(h,f+3),f+=l,ap(t,f,u,c,2),h.length&&t.set(h,f+3),f+=l,ap(t,f,u,c,3),h.length&&t.set(h,f+3),f+=l,i[d++]=p,i[d++]=p+1,i[d++]=p+3,i[d++]=p+1,i[d++]=p+2,i[d++]=p+3,Vy.vertexPosition=f,Vy.indexPosition=d,Vy}function e5(){const e=document.createElement("canvas").getContext("2d").createImageData(1,1);return e.data[0]=255,e.data[1]=255,e.data[2]=255,e.data[3]=255,e}function eb(n,e){const t=e||[],i=256,r=i-1;return t[0]=Math.floor(n/i/i/i)/r,t[1]=Math.floor(n/i/i)%i/r,t[2]=Math.floor(n/i)%i/r,t[3]=n%i/r,t}function tb(n){let e=0;const t=256,i=t-1;return e+=Math.round(n[0]*t*t*t*i),e+=Math.round(n[1]*t*t*i),e+=Math.round(n[2]*t*i),e+=Math.round(n[3]*i),e}var Wy=ax;const Ir=new Uint8Array(4);class t5{constructor(e,t){this.helper_=e;const i=e.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.size_=t||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(e){dr(e,this.size_)||(this.size_[0]=e[0],this.size_[1]=e[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const e=this.size_,t=this.helper_.getGL();t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer_),t.readPixels(0,0,e[0],e[1],t.RGBA,t.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(e,t){if(e<0||t<0||e>this.size_[0]||t>=this.size_[1])return Ir[0]=0,Ir[1]=0,Ir[2]=0,Ir[3]=0,Ir;this.readAll();const i=Math.floor(e)+(this.size_[1]-Math.floor(t)-1)*this.size_[0];return Ir[0]=this.data_[i*4],Ir[1]=this.data_[i*4+1],Ir[2]=this.data_[i*4+2],Ir[3]=this.data_[i*4+3],Ir}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}updateSize_(){const e=this.size_,t=this.helper_.getGL();this.texture_=this.helper_.createTexture(e,null,this.texture_),t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer_),t.viewport(0,0,e[0],e[1]),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(e[0]*e[1]*4)}}var ib=t5;function i5(){const n='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,a){var u=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=a?a.vertexPosition:0,h=a?a.indexPosition:0,d=b/u;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=u,l,v,1),c.length&&i.set(c,b+3),o(i,b+=u,l,v,2),c.length&&i.set(c,b+3),o(i,b+=u,l,v,3),c.length&&i.set(c,b+3),b+=u,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o,s=r.customAttributesCount,a=2+s,u=new Float32Array(r.renderInstructions),l=u.length/a,v=4*l*(s+3),c=new Uint32Array(6*l),g=new Float32Array(v),b=0;b<u.length;b+=a)o=i(u,b,g,c,s,o);var h=e({vertexBuffer:g.buffer,indexBuffer:c.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[g.buffer,c.buffer,u.buffer])}};';return new Worker(typeof Blob=="undefined"?"data:application/javascript;base64,"+Buffer.from(n,"binary").toString("base64"):URL.createObjectURL(new Blob([n],{type:"application/javascript"})))}class n5 extends Wy{constructor(e,t){const i=t.uniforms||{},r=xt();i[Ta.PROJECTION_MATRIX]=r;super(e,{uniforms:i,postProcesses:t.postProcesses});this.ready=!1,this.sourceRevision_=-1,this.verticesBuffer_=new Wl(Vl,Hc),this.hitVerticesBuffer_=new Wl(Vl,Hc),this.indicesBuffer_=new Wl(Zc,Hc),this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.program_,this.hitDetectionEnabled_=!!(t.hitFragmentShader&&t.hitVertexShader),this.hitVertexShader_=t.hitVertexShader,this.hitFragmentShader_=t.hitFragmentShader,this.hitProgram_;const s=t.attributes?t.attributes.map(function(a){return{name:"a_"+a.name,size:1,type:Sn.FLOAT}}):[];this.attributes=[{name:"a_position",size:2,type:Sn.FLOAT},{name:"a_index",size:1,type:Sn.FLOAT}].concat(s),this.hitDetectionAttributes=[{name:"a_position",size:2,type:Sn.FLOAT},{name:"a_index",size:1,type:Sn.FLOAT},{name:"a_hitColor",size:4,type:Sn.FLOAT},{name:"a_featureUid",size:1,type:Sn.FLOAT}].concat(s),this.customAttributes=t.attributes?t.attributes:[],this.previousExtent_=wi(),this.currentTransform_=r,this.renderTransform_=xt(),this.invertRenderTransform_=xt(),this.renderInstructions_=new Float32Array(0),this.hitRenderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.generateBuffersRun_=0,this.worker_=i5(),this.worker_.addEventListener("message",function(a){const l=a.data;if(l.type===op.GENERATE_BUFFERS){const u=l.projectionTransform;l.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(l.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(l.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(l.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=u,Bo(this.invertRenderTransform_,this.renderTransform_),l.hitDetection?this.hitRenderInstructions_=new Float32Array(a.data.renderInstructions):(this.renderInstructions_=new Float32Array(a.data.renderInstructions),l.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(this)),this.featureCache_={},this.featureCount_=0;const o=this.getLayer().getSource();this.sourceListenKeys_=[ge(o,si.ADDFEATURE,this.handleSourceFeatureAdded_,this),ge(o,si.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),ge(o,si.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),ge(o,si.CLEAR,this.handleSourceFeatureClear_,this)],o.forEachFeature(function(a){this.featureCache_[oe(a)]={feature:a,properties:a.getProperties(),geometry:a.getGeometry()},this.featureCount_++}.bind(this))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new ib(this.helper))}handleSourceFeatureAdded_(e){const t=e.feature;this.featureCache_[oe(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(e){const t=e.feature;this.featureCache_[oe(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()}}handleSourceFeatureDelete_(e){const t=e.feature;delete this.featureCache_[oe(t)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(e){const t=this.helper.getGL();this.preRender(t,e);const i=this.indicesBuffer_.getSize();this.helper.drawElements(0,i),this.helper.finalizeDraw(e,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const r=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(e),this.hitRenderTarget_.clearCachedData()),this.postRender(t,e),r}prepareFrameInternal(e){const t=this.getLayer(),i=t.getSource(),r=e.viewState,s=!e.viewHints[pt.ANIMATING]&&!e.viewHints[pt.INTERACTING],o=!Tn(this.previousExtent_,e.extent),a=this.sourceRevision_<i.getRevision();if(a&&(this.sourceRevision_=i.getRevision()),s&&(o||a)){const l=r.projection,u=r.resolution,c=t instanceof Cl?t.getRenderBuffer():0,h=un(e.extent,c*u);i.loadFeatures(h,u,l),this.rebuildBuffers_(e),this.previousExtent_=e.extent.slice()}return this.helper.makeProjectionTransform(e,this.currentTransform_),zo(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(e),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0}rebuildBuffers_(e){const t=xt();this.helper.makeProjectionTransform(e,t);const i=(2+this.customAttributes.length)*this.featureCount_;if((!this.renderInstructions_||this.renderInstructions_.length!==i)&&(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){const f=(7+this.customAttributes.length)*this.featureCount_;(!this.hitRenderInstructions_||this.hitRenderInstructions_.length!==f)&&(this.hitRenderInstructions_=new Float32Array(f))}let r,s;const o=[],a=[];let l=0,u=0,c;for(const f in this.featureCache_){if(r=this.featureCache_[f],s=r.geometry,!s||s.getType()!==M.POINT)continue;o[0]=s.getFlatCoordinates()[0],o[1]=s.getFlatCoordinates()[1],rt(t,o),c=eb(u+6,a),this.renderInstructions_[l++]=o[0],this.renderInstructions_[l++]=o[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[u++]=o[0],this.hitRenderInstructions_[u++]=o[1],this.hitRenderInstructions_[u++]=c[0],this.hitRenderInstructions_[u++]=c[1],this.hitRenderInstructions_[u++]=c[2],this.hitRenderInstructions_[u++]=c[3],this.hitRenderInstructions_[u++]=Number(f));let d;for(let p=0;p<this.customAttributes.length;p++)d=this.customAttributes[p].callback(r.feature,r.properties),this.renderInstructions_[l++]=d,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[u++]=d)}const h={type:op.GENERATE_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(h.projectionTransform=t,h.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(h,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){const f={type:op.GENERATE_BUFFERS,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};f.projectionTransform=t,f.hitDetection=!0,this.worker_.postMessage(f,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}}forEachFeatureAtCoordinate(e,t,i,r,s){if(ce(this.hitDetectionEnabled_,66),!this.hitRenderInstructions_)return;const o=rt(t.coordinateToPixelTransform,e.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),l=[a[0]/255,a[1]/255,a[2]/255,a[3]/255],u=tb(l),c=this.hitRenderInstructions_[u],h=Math.floor(c).toString(),d=this.getLayer().getSource().getFeatureByUid(h);if(d)return r(d,this.getLayer(),null)}renderHitDetection(e){if(!this.hitVerticesBuffer_.getSize())return;this.hitRenderTarget_.setSize([Math.floor(e.size[0]/2),Math.floor(e.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(e,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);const t=this.indicesBuffer_.getSize();this.helper.drawElements(0,t)}disposeInternal(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach(function(e){He(e)}),this.sourceListenKeys_=null,super.disposeInternal()}}var Zy=n5;const sr={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},r5=["#00f","#0ff","#0f0","#ff0","#f00"];class s5 extends Cl{constructor(e){const t=e||{},i=ie({},t);delete i.gradient,delete i.radius,delete i.blur,delete i.weight;super(i);this.gradient_=null,this.addChangeListener(sr.GRADIENT,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:r5),this.setBlur(t.blur!==void 0?t.blur:15),this.setRadius(t.radius!==void 0?t.radius:8);const r=t.weight?t.weight:"weight";typeof r=="string"?this.weightFunction_=function(s){return s.get(r)}:this.weightFunction_=r,this.setRenderOrder(null)}getBlur(){return this.get(sr.BLUR)}getGradient(){return this.get(sr.GRADIENT)}getRadius(){return this.get(sr.RADIUS)}handleGradientChanged_(){this.gradient_=o5(this.getGradient())}setBlur(e){this.set(sr.BLUR,e)}setGradient(e){this.set(sr.GRADIENT,e)}setRadius(e){this.set(sr.RADIUS,e)}createRenderer(){return new Zy(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(e){const t=this.weightFunction_(e);return t!==void 0?Ie(t,0,1):1}.bind(this)}],vertexShader:`
|
35
|
-
precision mediump float;
|
36
|
-
uniform mat4 u_projectionMatrix;
|
37
|
-
uniform mat4 u_offsetScaleMatrix;
|
38
|
-
uniform float u_size;
|
39
|
-
attribute vec2 a_position;
|
40
|
-
attribute float a_index;
|
41
|
-
attribute float a_weight;
|
42
|
-
|
43
|
-
varying vec2 v_texCoord;
|
44
|
-
varying float v_weight;
|
45
|
-
|
46
|
-
void main(void) {
|
47
|
-
mat4 offsetMatrix = u_offsetScaleMatrix;
|
48
|
-
float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;
|
49
|
-
float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;
|
50
|
-
vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);
|
51
|
-
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;
|
52
|
-
float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;
|
53
|
-
float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;
|
54
|
-
v_texCoord = vec2(u, v);
|
55
|
-
v_weight = a_weight;
|
56
|
-
}`,fragmentShader:`
|
57
|
-
precision mediump float;
|
58
|
-
uniform float u_blurSlope;
|
59
|
-
|
60
|
-
varying vec2 v_texCoord;
|
61
|
-
varying float v_weight;
|
62
|
-
|
63
|
-
void main(void) {
|
64
|
-
vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);
|
65
|
-
float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;
|
66
|
-
float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;
|
67
|
-
float alpha = smoothstep(0.0, 1.0, value) * v_weight;
|
68
|
-
gl_FragColor = vec4(alpha, alpha, alpha, alpha);
|
69
|
-
}`,hitVertexShader:`
|
70
|
-
precision mediump float;
|
71
|
-
uniform mat4 u_projectionMatrix;
|
72
|
-
uniform mat4 u_offsetScaleMatrix;
|
73
|
-
uniform float u_size;
|
74
|
-
attribute vec2 a_position;
|
75
|
-
attribute float a_index;
|
76
|
-
attribute float a_weight;
|
77
|
-
attribute vec4 a_hitColor;
|
78
|
-
|
79
|
-
varying vec2 v_texCoord;
|
80
|
-
varying float v_weight;
|
81
|
-
varying vec4 v_hitColor;
|
82
|
-
|
83
|
-
void main(void) {
|
84
|
-
mat4 offsetMatrix = u_offsetScaleMatrix;
|
85
|
-
float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;
|
86
|
-
float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;
|
87
|
-
vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);
|
88
|
-
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;
|
89
|
-
float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;
|
90
|
-
float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;
|
91
|
-
v_texCoord = vec2(u, v);
|
92
|
-
v_hitColor = a_hitColor;
|
93
|
-
v_weight = a_weight;
|
94
|
-
}`,hitFragmentShader:`
|
95
|
-
precision mediump float;
|
96
|
-
uniform float u_blurSlope;
|
97
|
-
|
98
|
-
varying vec2 v_texCoord;
|
99
|
-
varying float v_weight;
|
100
|
-
varying vec4 v_hitColor;
|
101
|
-
|
102
|
-
void main(void) {
|
103
|
-
vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);
|
104
|
-
float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;
|
105
|
-
float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;
|
106
|
-
float alpha = smoothstep(0.0, 1.0, value) * v_weight;
|
107
|
-
if (alpha < 0.05) {
|
108
|
-
discard;
|
109
|
-
}
|
110
|
-
|
111
|
-
gl_FragColor = v_hitColor;
|
112
|
-
}`,uniforms:{u_size:function(){return(this.get(sr.RADIUS)+this.get(sr.BLUR))*2}.bind(this),u_blurSlope:function(){return this.get(sr.RADIUS)/Math.max(1,this.get(sr.BLUR))}.bind(this)},postProcesses:[{fragmentShader:`
|
113
|
-
precision mediump float;
|
114
|
-
|
115
|
-
uniform sampler2D u_image;
|
116
|
-
uniform sampler2D u_gradientTexture;
|
117
|
-
uniform float u_opacity;
|
118
|
-
|
119
|
-
varying vec2 v_texCoord;
|
120
|
-
|
121
|
-
void main() {
|
122
|
-
vec4 color = texture2D(u_image, v_texCoord);
|
123
|
-
gl_FragColor.a = color.a * u_opacity;
|
124
|
-
gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;
|
125
|
-
gl_FragColor.rgb *= gl_FragColor.a;
|
126
|
-
}`,uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})}renderDeclutter(){}}function o5(n){const i=Yt(1,256),r=i.createLinearGradient(0,0,1,256),s=1/(n.length-1);for(let o=0,a=n.length;o<a;++o)r.addColorStop(o*s,n[o]);return i.fillStyle=r,i.fillRect(0,0,1,256),i.canvas}var a5=s5;const Hy=.5,l5=!0,wa={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Ky={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0};class u5 extends md{constructor(e){super(e);this.image_=null}getImage(){return this.image_?this.image_.getImage():null}prepareFrame(e){const t=e.layerStatesArray[e.layerIndex],i=e.pixelRatio,r=e.viewState,s=r.resolution,o=this.getLayer().getSource(),a=e.viewHints;let l=e.extent;if(t.extent!==void 0&&(l=Ai(l,pn(t.extent,r.projection))),!a[pt.ANIMATING]&&!a[pt.INTERACTING]&&!zs(l))if(o){let u=r.projection;const c=o.getImage(l,s,i,u);c&&this.loadImage(c)?this.image_=c:this.image_=null}else this.image_=null;return!!this.image_}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=rt(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!cn(s,r))return null;const o=this.image_.getExtent(),a=this.image_.getImage(),l=Ae(o),u=Math.floor(a.width*((r[0]-o[0])/l));if(u<0||u>=a.width)return null;const c=ft(o),h=Math.floor(a.height*((o[3]-r[1])/c));return h<0||h>=a.height?null:this.getImageData(a,u,h)}renderFrame(e,t){const i=this.image_,r=i.getExtent(),s=i.getResolution(),o=i.getPixelRatio(),a=e.layerStatesArray[e.layerIndex],l=e.pixelRatio,u=e.viewState,c=u.center,h=u.resolution,f=e.size,d=l*s/(h*o);let p=Math.round(f[0]*l),m=Math.round(f[1]*l);const g=u.rotation;if(g){const b=Math.round(Math.sqrt(p*p+m*m));p=b,m=b}Ti(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/l,1/l,g,-p/2,-m/2),Bo(this.inversePixelTransform,this.pixelTransform);const v=Xu(this.pixelTransform);this.useContainer(t,v,a.opacity,this.getBackground(e));const y=this.context,x=y.canvas;x.width!=p||x.height!=m?(x.width=p,x.height=m):this.containerReused||y.clearRect(0,0,p,m);let _=!1,E=!0;if(a.extent){const b=pn(a.extent,u.projection);E=dt(b,e.extent),_=E&&!hi(b,e.extent),_&&this.clipUnrotated(y,e,b)}const T=i.getImage(),w=Ti(this.tempTransform,p/2,m/2,d,d,0,o*(r[0]-c[0])/s,o*(c[1]-r[3])/s);this.renderedResolution=s*l/o;const S=T.width*w[0],R=T.height*w[3];if(this.getLayer().getSource().getInterpolate()||ie(y,wa),this.preRender(y,e),E&&S>=.5&&R>=.5){const b=w[4],I=w[5],O=a.opacity;let P;O!==1&&(P=y.globalAlpha,y.globalAlpha=O),y.drawImage(T,0,0,+T.width,+T.height,Math.round(b),Math.round(I),Math.round(S),Math.round(R)),O!==1&&(y.globalAlpha=P)}return this.postRender(y,e),_&&y.restore(),ie(y,Ky),v!==x.style.transform&&(x.style.transform=v),this.container}}var qy=u5;class c5 extends BR{constructor(e){super(e)}createRenderer(){return new qy(this)}getData(e){return super.getData(e)}}var nb=c5;const h5=10,rb=.25;class f5{constructor(e,t,i,r,s,o){this.sourceProj_=e,this.targetProj_=t;let a={};const l=Kn(this.targetProj_,this.sourceProj_);this.transformInv_=function(y){const x=y[0]+"/"+y[1];return a[x]||(a[x]=l(y)),a[x]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&Ae(r)==Ae(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Ae(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Ae(this.targetProj_.getExtent()):null;const u=An(i),c=al(i),h=Vo(i),f=Xo(i),d=this.transformInv_(u),p=this.transformInv_(c),m=this.transformInv_(h),g=this.transformInv_(f),v=h5+(o?Math.max(0,Math.ceil(vm(ol(i)/(o*o*256*256)))):0);if(this.addQuad_(u,c,h,f,d,p,m,g,v),this.wrapsXInSource_){let y=1/0;this.triangles_.forEach(function(x,_,E){y=Math.min(y,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(function(x){if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-y>this.sourceWorldWidth_/2){const _=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];_[0][0]-y>this.sourceWorldWidth_/2&&(_[0][0]-=this.sourceWorldWidth_),_[1][0]-y>this.sourceWorldWidth_/2&&(_[1][0]-=this.sourceWorldWidth_),_[2][0]-y>this.sourceWorldWidth_/2&&(_[2][0]-=this.sourceWorldWidth_);const E=Math.min(_[0][0],_[1][0],_[2][0]);Math.max(_[0][0],_[1][0],_[2][0])-E<this.sourceWorldWidth_/2&&(x.source=_)}}.bind(this))}a={}}addTriangle_(e,t,i,r,s,o){this.triangles_.push({source:[r,s,o],target:[e,t,i]})}addQuad_(e,t,i,r,s,o,a,l,u){const c=Lt([s,o,a,l]),h=this.sourceWorldWidth_?Ae(c)/this.sourceWorldWidth_:null,f=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&h>.5&&h<1;let p=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const g=Lt([e,t,i,r]);p=Ae(g)/this.targetWorldWidth_>rb||p}!d&&this.sourceProj_.isGlobal()&&h&&(p=h>rb||p)}if(!p&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!dt(c,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(u>0)p=!0;else if(m=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(u>0){if(!p){const g=[(e[0]+i[0])/2,(e[1]+i[1])/2],v=this.transformInv_(g);let y;d?y=(Pn(s[0],f)+Pn(a[0],f))/2-Pn(v[0],f):y=(s[0]+a[0])/2-v[0];const x=(s[1]+a[1])/2-v[1];p=y*y+x*x>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const g=[(t[0]+i[0])/2,(t[1]+i[1])/2],v=this.transformInv_(g),y=[(r[0]+e[0])/2,(r[1]+e[1])/2],x=this.transformInv_(y);this.addQuad_(e,t,g,y,s,o,v,x,u-1),this.addQuad_(y,g,i,r,x,v,a,l,u-1)}else{const g=[(e[0]+t[0])/2,(e[1]+t[1])/2],v=this.transformInv_(g),y=[(i[0]+r[0])/2,(i[1]+r[1])/2],x=this.transformInv_(y);this.addQuad_(e,g,y,r,s,v,x,l,u-1),this.addQuad_(g,t,i,y,v,o,a,x,u-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(e,i,r,s,a,l),(m&14)==0&&this.addTriangle_(e,i,t,s,a,o),m&&((m&13)==0&&this.addTriangle_(t,r,e,o,l,s),(m&7)==0&&this.addTriangle_(t,r,i,o,l,a))}calculateSourceExtent(){const e=wi();return this.triangles_.forEach(function(t,i,r){const s=t.source;Yo(e,s[0]),Yo(e,s[1]),Yo(e,s[2])}),e}getTriangles(){return this.triangles_}}var Jy=f5;let Qy;function sb(n,e,t,i,r){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(i,r),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,i)+1,Math.max(t,r)),n.restore()}function e_(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function d5(){if(Qy===void 0){const n=document.createElement("canvas").getContext("2d");n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",sb(n,4,5,4,0),sb(n,4,5,0,5);const e=n.getImageData(0,0,3,3).data;Qy=e_(e,0)||e_(e,4)||e_(e,8)}return Qy}function Zl(n,e,t,i){const r=js(t,e,n);let s=tc(e,i,t);const o=e.getMetersPerUnit();o!==void 0&&(s*=o);const a=n.getMetersPerUnit();a!==void 0&&(s/=a);const l=n.getExtent();if(!l||cn(l,r)){const u=tc(n,s,r)/s;isFinite(u)&&u>0&&(s/=u)}return s}function ob(n,e,t,i){const r=fi(t);let s=Zl(n,e,r,i);return(!isFinite(s)||s<=0)&&Cf(t,function(o){return s=Zl(n,e,o,i),isFinite(s)&&s>0}),s}function t_(n,e,t,i,r,s,o,a,l,u,c,h){const f=Yt(Math.round(t*n),Math.round(t*e));if(h||ie(f,wa),l.length===0)return f.canvas;f.scale(t,t);function d(_){return Math.round(_*t)/t}f.globalCompositeOperation="lighter";const p=wi();l.forEach(function(_,E,T){gm(p,_.extent)});const m=Ae(p),g=ft(p),v=Yt(Math.round(t*m/i),Math.round(t*g/i));h||ie(v,wa);const y=t/i;l.forEach(function(_,E,T){const w=_.extent[0]-p[0],S=-(_.extent[3]-p[3]),R=Ae(_.extent),b=ft(_.extent);_.image.width>0&&_.image.height>0&&v.drawImage(_.image,u,u,_.image.width-2*u,_.image.height-2*u,w*y,S*y,R*y,b*y)});const x=An(o);return a.getTriangles().forEach(function(_,E,T){const w=_.source,S=_.target;let R=w[0][0],b=w[0][1],I=w[1][0],O=w[1][1],P=w[2][0],B=w[2][1];const A=d((S[0][0]-x[0])/s),L=d(-(S[0][1]-x[1])/s),D=d((S[1][0]-x[0])/s),U=d(-(S[1][1]-x[1])/s),G=d((S[2][0]-x[0])/s),$=d(-(S[2][1]-x[1])/s),k=R,C=b;R=0,b=0,I-=k,O-=C,P-=k,B-=C;const Z=[[I,O,0,0,D-A],[P,B,0,0,G-A],[0,0,I,O,U-L],[0,0,P,B,$-L]],z=Jx(Z);if(!!z){if(f.save(),f.beginPath(),d5()||!h){f.moveTo(D,U);const j=4,V=A-D,te=L-U;for(let J=0;J<j;J++)f.lineTo(D+d((J+1)*V/j),U+d(J*te/(j-1))),J!=j-1&&f.lineTo(D+d((J+1)*V/j),U+d((J+1)*te/(j-1)));f.lineTo(G,$)}else f.moveTo(D,U),f.lineTo(A,L),f.lineTo(G,$);f.clip(),f.transform(z[0],z[2],z[1],z[3],A,L),f.translate(p[0]-k,p[3]-C),f.scale(i/t,-i/t),f.drawImage(v.canvas,0,0),f.restore()}}),c&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(_,E,T){const w=_.target,S=(w[0][0]-x[0])/s,R=-(w[0][1]-x[1])/s,b=(w[1][0]-x[0])/s,I=-(w[1][1]-x[1])/s,O=(w[2][0]-x[0])/s,P=-(w[2][1]-x[1])/s;f.beginPath(),f.moveTo(b,I),f.lineTo(S,R),f.lineTo(O,P),f.closePath(),f.stroke()}),f.restore()),f.canvas}class p5 extends ks{constructor(e,t,i,r,s,o,a,l,u,c,h,f){super(s,K.IDLE,{interpolate:!!f});this.renderEdges_=h!==void 0?h:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=o||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const d=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent();let m=this.sourceTileGrid_.getExtent();const g=p?Ai(d,p):d;if(ol(g)===0){this.state=K.EMPTY;return}const v=e.getExtent();v&&(m?m=Ai(m,v):m=v);const y=r.getResolution(this.wrappedTileCoord_[0]),x=ob(e,i,g,y);if(!isFinite(x)||x<=0){this.state=K.EMPTY;return}const _=c!==void 0?c:Hy;if(this.triangulation_=new Jy(e,i,g,m,x*_,y),this.triangulation_.getTriangles().length===0){this.state=K.EMPTY;return}this.sourceZ_=t.getZForResolution(x);let E=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(E[1]=Ie(E[1],m[1],m[3]),E[3]=Ie(E[3],m[1],m[3])):E=Ai(E,m)),!ol(E))this.state=K.EMPTY;else{const T=t.getTileRangeForExtentAndZ(E,this.sourceZ_);for(let w=T.minX;w<=T.maxX;w++)for(let S=T.minY;S<=T.maxY;S++){const R=u(this.sourceZ_,w,S,a);R&&this.sourceTiles_.push(R)}this.sourceTiles_.length===0&&(this.state=K.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(function(t,i,r){t&&t.getState()==K.LOADED&&e.push({extent:this.sourceTileGrid_.getTileCoordExtent(t.tileCoord),image:t.getImage()})}.bind(this)),this.sourceTiles_.length=0,e.length===0)this.state=K.ERROR;else{const t=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(t),r=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(t),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=t_(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=K.LOADED}this.changed()}load(){if(this.state==K.IDLE){this.state=K.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(t,i,r){const s=t.getState();if(s==K.IDLE||s==K.LOADING){e++;const o=ge(t,re.CHANGE,function(a){const l=t.getState();(l==K.LOADED||l==K.ERROR||l==K.EMPTY)&&(He(o),e--,e===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(o)}}.bind(this)),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(t,i,r){t.getState()==K.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(He),this.sourcesListenerKeys_=null}}var lp=p5;class g5 extends md{constructor(e){super(e);this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=wi(),this.tmpTileRange_=new kc(0,0,0,0)}isDrawableTile(e){const t=this.getLayer(),i=e.getState(),r=t.getUseInterimTilesOnError();return i==K.LOADED||i==K.EMPTY||i==K.ERROR&&!r}getTile(e,t,i,r){const s=r.pixelRatio,o=r.viewState.projection,a=this.getLayer();let u=a.getSource().getTile(e,t,i,s,o);return u.getState()==K.ERROR&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):u.setState(K.LOADED)),this.isDrawableTile(u)||(u=u.getInterimTile()),u}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=rt(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!cn(s,r))return null;const o=t.pixelRatio,a=t.viewState.projection,l=t.viewState,u=i.getRenderSource(),c=u.getTileGridForProjection(l.projection),h=u.getTilePixelRatio(t.pixelRatio);for(let f=c.getZForResolution(l.resolution);f>=c.getMinZoom();--f){const d=c.getTileCoordForCoordAndZ(r,f),p=u.getTile(f,d[1],d[2],o,a);if(!(p instanceof ia||p instanceof lp))return null;if(p.getState()!==K.LOADED)continue;const m=c.getOrigin(f),g=Tt(c.getTileSize(f)),v=c.getResolution(f),y=Math.floor(h*((r[0]-m[0])/v-d[1]*g[0])),x=Math.floor(h*((m[1]-r[1])/v-d[2]*g[1]));return this.getImageData(p.getImage(),y,x)}return null}loadedTileCallback(e,t,i){return this.isDrawableTile(i)?super.loadedTileCallback(e,t,i):!1}prepareFrame(e){return!!this.getLayer().getSource()}renderFrame(e,t){const i=e.layerStatesArray[e.layerIndex],r=e.viewState,s=r.projection,o=r.resolution,a=r.center,l=r.rotation,u=e.pixelRatio,c=this.getLayer(),h=c.getSource(),f=h.getRevision(),d=h.getTileGridForProjection(s),p=d.getZForResolution(o,h.zDirection),m=d.getResolution(p);let g=e.extent;const v=i.extent&&pn(i.extent,s);v&&(g=Ai(g,pn(i.extent,s)));const y=h.getTilePixelRatio(u);let x=Math.round(e.size[0]*y),_=Math.round(e.size[1]*y);if(l){const Z=Math.round(Math.sqrt(x*x+_*_));x=Z,_=Z}const E=m*x/2/y,T=m*_/2/y,w=[a[0]-E,a[1]-T,a[0]+E,a[1]+T],S=d.getTileRangeForExtentAndZ(g,p),R={};R[p]={};const b=this.createLoadedTileFinder(h,s,R),I=this.tmpExtent,O=this.tmpTileRange_;this.newTiles_=!1;for(let Z=S.minX;Z<=S.maxX;++Z)for(let z=S.minY;z<=S.maxY;++z){const j=this.getTile(p,Z,z,e);if(this.isDrawableTile(j)){const J=oe(this);if(j.getState()==K.LOADED){R[p][j.tileCoord.toString()]=j;const X=j.inTransition(J);!this.newTiles_&&(X||this.renderedTiles.indexOf(j)===-1)&&(this.newTiles_=!0)}if(j.getAlpha(J,e.time)===1)continue}const V=d.getTileCoordChildTileRange(j.tileCoord,O,I);let te=!1;V&&(te=b(p+1,V)),te||d.forEachTileCoordParentTileRange(j.tileCoord,b,O,I)}const P=m/o;Ti(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/y,1/y,l,-x/2,-_/2);const B=Xu(this.pixelTransform);this.useContainer(t,B,i.opacity,this.getBackground(e));const A=this.context,L=A.canvas;Bo(this.inversePixelTransform,this.pixelTransform),Ti(this.tempTransform,x/2,_/2,P,P,0,-x/2,-_/2),L.width!=x||L.height!=_?(L.width=x,L.height=_):this.containerReused||A.clearRect(0,0,x,_),v&&this.clipUnrotated(A,e,v),h.getInterpolate()||ie(A,wa),this.preRender(A,e),this.renderedTiles.length=0;let D=Object.keys(R).map(Number);D.sort(Vr);let U,G,$;i.opacity===1&&(!this.containerReused||h.getOpaque(e.viewState.projection))?D=D.reverse():(U=[],G=[]);for(let Z=D.length-1;Z>=0;--Z){const z=D[Z],j=h.getTilePixelSize(z,u,s),te=d.getResolution(z)/m,J=j[0]*te*P,X=j[1]*te*P,Se=d.getTileCoordForCoordAndZ(An(w),z),_e=d.getTileCoordExtent(Se),be=rt(this.tempTransform,[y*(_e[0]-w[0])/m,y*(w[3]-_e[3])/m]),ht=y*h.getGutterForProjection(s),Ce=R[z];for(const De in Ce){const Xe=Ce[De],Mt=Xe.tileCoord,Ut=Se[1]-Mt[1],Q=Math.round(be[0]-(Ut-1)*J),Ft=Se[2]-Mt[2],zt=Math.round(be[1]-(Ft-1)*X),Rt=Math.round(be[0]-Ut*J),nt=Math.round(be[1]-Ft*X),Zt=Q-Rt,Bt=zt-nt,Yi=p===z,Li=Yi&&Xe.getAlpha(oe(this),e.time)!==1;let ai=!1;if(!Li)if(U){$=[Rt,nt,Rt+Zt,nt,Rt+Zt,nt+Bt,Rt,nt+Bt];for(let Nt=0,Ze=U.length;Nt<Ze;++Nt)if(p!==z&&z<G[Nt]){const bt=U[Nt];dt([Rt,nt,Rt+Zt,nt+Bt],[bt[0],bt[3],bt[4],bt[7]])&&(ai||(A.save(),ai=!0),A.beginPath(),A.moveTo($[0],$[1]),A.lineTo($[2],$[3]),A.lineTo($[4],$[5]),A.lineTo($[6],$[7]),A.moveTo(bt[6],bt[7]),A.lineTo(bt[4],bt[5]),A.lineTo(bt[2],bt[3]),A.lineTo(bt[0],bt[1]),A.clip())}U.push($),G.push(z)}else A.clearRect(Rt,nt,Zt,Bt);this.drawTileImage(Xe,e,Rt,nt,Zt,Bt,ht,Yi),U&&!Li?(ai&&A.restore(),this.renderedTiles.unshift(Xe)):this.renderedTiles.push(Xe),this.updateUsedTiles(e.usedTiles,h,Xe)}}this.renderedRevision=f,this.renderedResolution=m,this.extentChanged=!this.renderedExtent_||!Tn(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=u,this.renderedProjection=s,this.manageTilePyramid(e,h,d,u,s,g,p,c.getPreload()),this.scheduleExpireCache(e,h),this.postRender(A,e),i.extent&&A.restore(),ie(A,Ky),B!==L.style.transform&&(L.style.transform=B);const k=r0(i.opacity),C=this.container;return k!==C.style.opacity&&(C.style.opacity=k),this.container}drawTileImage(e,t,i,r,s,o,a,l){const u=this.getTileImage(e);if(!u)return;const c=oe(this),h=l?e.getAlpha(c,t.time):1,f=h!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=h),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,i,r,s,o),f&&this.context.restore(),h!==1?t.animate=!0:l&&e.endTransition(c)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}scheduleExpireCache(e,t){if(t.canExpireCache()){const i=function(r,s,o){const a=oe(r);a in o.usedTiles&&r.expireCache(o.viewState.projection,o.usedTiles[a])}.bind(null,t);e.postRenderFunctions.push(i)}}updateUsedTiles(e,t,i){const r=oe(t);r in e||(e[r]={}),e[r][i.getKey()]=!0}manageTilePyramid(e,t,i,r,s,o,a,l,u){const c=oe(t);c in e.wantedTiles||(e.wantedTiles[c]={});const h=e.wantedTiles[c],f=e.tileQueue,d=i.getMinZoom();let p=0,m,g,v,y,x,_;for(_=d;_<=a;++_)for(g=i.getTileRangeForExtentAndZ(o,_,g),v=i.getResolution(_),y=g.minX;y<=g.maxX;++y)for(x=g.minY;x<=g.maxY;++x)a-_<=l?(++p,m=t.getTile(_,y,x,r,s),m.getState()==K.IDLE&&(h[m.getKey()]=!0,f.isKeyQueued(m.getKey())||f.enqueue([m,c,i.getTileCoordCenter(m.tileCoord),v])),u!==void 0&&u(m)):t.useTile(_,y,x,s);t.updateCacheSize(p,s)}}var i_=g5,as={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};const m5={image:[Ue.POLYGON,Ue.CIRCLE,Ue.LINE_STRING,Ue.IMAGE,Ue.TEXT],hybrid:[Ue.POLYGON,Ue.LINE_STRING],vector:[]},y5={hybrid:[Ue.IMAGE,Ue.TEXT,Ue.DEFAULT],vector:[Ue.POLYGON,Ue.CIRCLE,Ue.LINE_STRING,Ue.IMAGE,Ue.TEXT,Ue.DEFAULT]};class _5 extends i_{constructor(e){super(e);this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.dirty_=!1,this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.tmpTransform_=xt()}prepareTile(e,t,i){let r;const s=e.getState();return(s===K.LOADED||s===K.ERROR)&&(this.updateExecutorGroup_(e,t,i),this.tileImageNeedsRender_(e)&&(r=!0)),r}getTile(e,t,i,r){const s=r.pixelRatio,o=r.viewState,a=o.resolution,l=o.projection,u=this.getLayer(),c=u.getSource().getTile(e,t,i,s,l),h=r.viewHints,f=!(h[pt.ANIMATING]||h[pt.INTERACTING]);return(f||!c.wantedResolution)&&(c.wantedResolution=a),this.prepareTile(c,s,l)&&(f||Date.now()-r.time<8)&&u.getRenderMode()!==as.VECTOR&&this.renderTileImage_(c,r),super.getTile(e,t,i,r)}isDrawableTile(e){const t=this.getLayer();return super.isDrawableTile(e)&&(t.getRenderMode()===as.VECTOR?oe(t)in e.executorGroups:e.hasContext(t))}getTileImage(e){return e.getImage(this.getLayer())}prepareFrame(e){const t=this.getLayer().getRevision();return this.renderedLayerRevision_!=t&&(this.renderedTiles.length=0),this.renderedLayerRevision_=t,super.prepareFrame(e)}updateExecutorGroup_(e,t,i){const r=this.getLayer(),s=r.getRevision(),o=r.getRenderOrder()||null,a=e.wantedResolution,l=e.getReplayState(r);if(!l.dirty&&l.renderedResolution===a&&l.renderedRevision==s&&l.renderedRenderOrder==o)return;const u=r.getSource(),c=r.getDeclutter(),h=u.getTileGrid(),d=u.getTileGridForProjection(i).getTileCoordExtent(e.wrappedTileCoord),p=u.getSourceTiles(t,i,e),m=oe(r);delete e.hitDetectionImageData[m],e.executorGroups[m]=[],c&&(e.declutterExecutorGroups[m]=[]);for(let g=0,v=p.length;g<v;++g){const y=p[g];if(y.getState()!=K.LOADED)continue;const x=y.tileCoord,_=h.getTileCoordExtent(x),E=Ai(d,_),T=un(E,r.getRenderBuffer()*a,this.tmpExtent),w=Tn(_,E)?null:T;l.dirty=!1;const S=new Cc(0,T,a,t),R=c?new Cc(0,E,a,t):void 0,b=vd(a,t),I=function(L){let D;const U=L.getStyleFunction()||r.getStyleFunction();if(U&&(D=U(L,a)),D){const G=this.renderFeature(L,b,D,S,R);this.dirty_=this.dirty_||G,l.dirty=l.dirty||G}},O=y.getFeatures();o&&o!==l.renderedRenderOrder&&O.sort(o);for(let L=0,D=O.length;L<D;++L){const U=O[L];(!w||dt(w,U.getGeometry().getExtent()))&&I.call(this,U)}const P=S.finish(),B=r.getRenderMode()!==as.VECTOR&&c&&p.length===1?null:E,A=new Oc(B,a,t,u.getOverlaps(),P,r.getRenderBuffer());if(e.executorGroups[m].push(A),R){const L=new Oc(null,a,t,u.getOverlaps(),R.finish(),r.getRenderBuffer());e.declutterExecutorGroups[m].push(L)}}l.renderedRevision=s,l.renderedRenderOrder=o,l.renderedResolution=a}forEachFeatureAtCoordinate(e,t,i,r,s){const o=t.viewState.resolution,a=t.viewState.rotation;i=i==null?0:i;const l=this.getLayer(),c=l.getSource().getTileGridForProjection(t.viewState.projection),h=Lt([e]);un(h,o*i,h);const f={},d=function(g,v,y){let x=g.getId();x===void 0&&(x=oe(g));const _=f[x];if(_){if(_!==!0&&y<_.distanceSq){if(y===0)return f[x]=!0,s.splice(s.lastIndexOf(_),1),r(g,l,v);_.geometry=v,_.distanceSq=y}}else{if(y===0)return f[x]=!0,r(g,l,v);s.push(f[x]={feature:g,layer:l,geometry:v,distanceSq:y,callback:r})}},p=this.renderedTiles;let m;for(let g=0,v=p.length;!m&&g<v;++g){const y=p[g],x=c.getTileCoordExtent(y.wrappedTileCoord);if(!dt(x,h))continue;const _=oe(l),E=[y.executorGroups[_]],T=y.declutterExecutorGroups[_];T&&E.push(T),E.some(w=>{const S=w===T?t.declutterTree.all().map(R=>R.value):null;for(let R=0,b=w.length;R<b;++R)if(m=w[R].forEachFeatureAtCoordinate(e,o,a,i,d,S),m)return!0})}return m}getFeatures(e){return new Promise(function(t,i){const r=this.getLayer(),s=oe(r),o=r.getSource(),a=this.renderedProjection,l=a.getExtent(),u=this.renderedResolution,c=o.getTileGridForProjection(a),h=rt(this.renderedPixelToCoordinateTransform_,e.slice()),f=c.getTileCoordForCoordAndResolution(h,u);let d;for(let x=0,_=this.renderedTiles.length;x<_;++x)if(f.toString()===this.renderedTiles[x].tileCoord.toString()){if(d=this.renderedTiles[x],d.getState()===K.LOADED){const E=c.getTileCoordExtent(d.tileCoord);o.getWrapX()&&a.canWrapX()&&!hi(l,E)&&Pf(h,a);break}d=void 0}if(!d||d.loadingSourceTiles>0){t([]);return}const p=c.getTileCoordExtent(d.wrappedTileCoord),m=An(p),g=[(h[0]-m[0])/u,(m[1]-h[1])/u],v=d.getSourceTiles().reduce(function(x,_){return x.concat(_.getFeatures())},[]);let y=d.hitDetectionImageData[s];if(!y&&!this.animatingOrInteracting_){const x=Tt(c.getTileSize(c.getZForResolution(u))),_=this.renderedRotation_,E=[this.getRenderTransform(c.getTileCoordCenter(d.wrappedTileCoord),u,0,_n,x[0]*_n,x[1]*_n,0)];y=X0(x,E,v,r.getStyleFunction(),c.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(r).renderedResolution,_),d.hitDetectionImageData[s]=y}t(V0(g,v,y))}.bind(this))}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e){const t=this.context,i=t.globalAlpha;t.globalAlpha=this.getLayer().getOpacity();const r=e.viewHints,s=!(r[pt.ANIMATING]||r[pt.INTERACTING]),o=this.renderedTiles;for(let a=0,l=o.length;a<l;++a){const u=o[a],c=u.declutterExecutorGroups[oe(this.getLayer())];if(c)for(let h=c.length-1;h>=0;--h)c[h].execute(this.context,1,this.getTileRenderTransform(u,e),e.viewState.rotation,s,void 0,e.declutterTree)}t.globalAlpha=i}getTileRenderTransform(e,t){const i=t.pixelRatio,r=t.viewState,s=r.center,o=r.resolution,a=r.rotation,l=t.size,u=Math.round(l[0]*i),c=Math.round(l[1]*i),f=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),d=e.tileCoord,p=f.getTileCoordExtent(e.wrappedTileCoord),m=f.getTileCoordExtent(d,this.tmpExtent)[0]-p[0];return zo(rl(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,o,a,i,u,c,m))}renderFrame(e,t){const i=e.viewHints,r=!(i[pt.ANIMATING]||i[pt.INTERACTING]);super.renderFrame(e,t),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;const s=this.getLayer(),o=s.getRenderMode(),a=this.context,l=a.globalAlpha;a.globalAlpha=s.getOpacity();const u=y5[o],c=e.viewState,h=c.rotation,f=s.getSource(),p=f.getTileGridForProjection(c.projection).getZForResolution(c.resolution,f.zDirection),m=this.renderedTiles,g=[],v=[];for(let y=m.length-1;y>=0;--y){const x=m[y],_=x.executorGroups[oe(s)].filter(R=>R.hasExecutors(u));if(_.length===0)continue;const E=this.getTileRenderTransform(x,e),T=x.tileCoord[0];let w=!1;const S=_[0].getClipCoords(E);for(let R=0,b=g.length;R<b;++R)if(p!==T&&T<v[R]){const I=g[R];dt([S[0],S[3],S[4],S[7]],[I[0],I[3],I[4],I[7]])&&(w||(a.save(),w=!0),a.beginPath(),a.moveTo(S[0],S[1]),a.lineTo(S[2],S[3]),a.lineTo(S[4],S[5]),a.lineTo(S[6],S[7]),a.moveTo(I[6],I[7]),a.lineTo(I[4],I[5]),a.lineTo(I[2],I[3]),a.lineTo(I[0],I[1]),a.clip())}g.push(S),v.push(T);for(let R=0,b=_.length;R<b;++R)_[R].execute(a,1,E,h,r,u);w&&a.restore()}return a.globalAlpha=l,this.container}renderFeature(e,t,i,r,s){if(!i)return!1;let o=!1;if(Array.isArray(i))for(let a=0,l=i.length;a<l;++a)o=Mc(r,e,i[a],t,this.boundHandleStyleImageChange_,void 0,s)||o;else o=Mc(r,e,i,t,this.boundHandleStyleImageChange_,void 0,s);return o}tileImageNeedsRender_(e){const t=this.getLayer();if(t.getRenderMode()===as.VECTOR)return!1;const i=e.getReplayState(t),r=t.getRevision(),s=e.wantedResolution;return i.renderedTileResolution!==s||i.renderedTileRevision!==r}renderTileImage_(e,t){const i=this.getLayer(),r=e.getReplayState(i),s=i.getRevision(),o=e.executorGroups[oe(i)];r.renderedTileRevision=s;const a=e.wrappedTileCoord,l=a[0],u=i.getSource();let c=t.pixelRatio;const f=t.viewState.projection,d=u.getTileGridForProjection(f),p=d.getResolution(e.tileCoord[0]),m=t.pixelRatio/e.wantedResolution*p,g=d.getResolution(l),v=e.getContext(i);c=Math.round(Math.max(c,m/c));const y=u.getTilePixelSize(l,c,f);v.canvas.width=y[0],v.canvas.height=y[1];const x=c/m;if(x!==1){const w=il(this.tmpTransform_);rl(w,x,x),v.setTransform.apply(v,w)}const _=d.getTileCoordExtent(a,this.tmpExtent),E=m/g,T=il(this.tmpTransform_);rl(T,E,-E),Bx(T,-_[0],-_[3]);for(let w=0,S=o.length;w<S;++w)o[w].execute(v,x,T,0,!0,m5[i.getRenderMode()]);r.renderedTileResolution=e.wantedResolution}}var ab=_5;class v5 extends Cl{constructor(e){const t=e||{},i=ie({},t);delete i.preload,delete i.useInterimTilesOnError;super(i);this.on,this.once,this.un,t.renderMode===as.IMAGE&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),t.renderMode=void 0);const r=t.renderMode||as.HYBRID;ce(r==as.HYBRID||r==as.VECTOR,28),this.renderMode_=r,this.setPreload(t.preload?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0),this.getBackground,this.setBackground}createRenderer(){return new ab(this)}getFeatures(e){return super.getFeatures(e)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(os.PRELOAD)}getUseInterimTilesOnError(){return this.get(os.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(os.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(os.USE_INTERIM_TILES_ON_ERROR,e)}}var lb=v5,Sa={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};const x5=[0,0,0],so=5;class E5{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,ce(Lx(this.resolutions_,function(r,s){return s-r},!0),17);let t;if(!e.origins){for(let r=0,s=this.resolutions_.length-1;r<s;++r)if(!t)t=this.resolutions_[r]/this.resolutions_[r+1];else if(this.resolutions_[r]/this.resolutions_[r+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,ce(this.origins_.length==this.resolutions_.length,20));const i=e.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=An(i)),ce(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,ce(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:aa,ce(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map(function(r,s){const o=new kc(Math.min(0,r[0]),Math.max(r[0]-1,-1),Math.min(0,r[1]),Math.max(r[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o},this):i&&this.calculateTileRanges_(i)}forEachTileCoord(e,t,i){const r=this.getTileRangeForExtentAndZ(e,t);for(let s=r.minX,o=r.maxX;s<=o;++s)for(let a=r.minY,l=r.maxY;a<=l;++a)i([t,s,a])}forEachTileCoordParentTileRange(e,t,i,r){let s,o,a,l=null,u=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):l=this.getTileCoordExtent(e,r);u>=this.minZoom;){if(this.zoomFactor_===2?(o=Math.floor(o/2),a=Math.floor(a/2),s=ha(o,o,a,a,i)):s=this.getTileRangeForExtentAndZ(l,u,i),t(u,s))return!0;--u}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,i){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const s=e[1]*2,o=e[2]*2;return ha(s,s+1,o,o+1,t)}const r=this.getTileCoordExtent(e,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,i){if(t>this.maxZoom||t<this.minZoom)return null;const r=e[0],s=e[1],o=e[2];if(t===r)return ha(s,o,s,o,i);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,t-r),u=Math.floor(s*l),c=Math.floor(o*l);if(t<r)return ha(u,u,c,c,i);const h=Math.floor(l*(s+1))-1,f=Math.floor(l*(o+1))-1;return ha(u,h,c,f,i)}const a=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,t,i)}getTileRangeExtent(e,t,i){const r=this.getOrigin(e),s=this.getResolution(e),o=Tt(this.getTileSize(e),this.tmpSize_),a=r[0]+t.minX*o[0]*s,l=r[0]+(t.maxX+1)*o[0]*s,u=r[1]+t.minY*o[1]*s,c=r[1]+(t.maxY+1)*o[1]*s;return hn(a,u,l,c,i)}getTileRangeForExtentAndZ(e,t,i){const r=x5;this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,r);const s=r[1],o=r[2];return this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,r),ha(s,r[1],o,r[2],i)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),i=this.getResolution(e[0]),r=Tt(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*i,t[1]-(e[2]+.5)*r[1]*i]}getTileCoordExtent(e,t){const i=this.getOrigin(e[0]),r=this.getResolution(e[0]),s=Tt(this.getTileSize(e[0]),this.tmpSize_),o=i[0]+e[1]*s[0]*r,a=i[1]-(e[2]+1)*s[1]*r,l=o+s[0]*r,u=a+s[1]*r;return hn(o,a,l,u,t)}getTileCoordForCoordAndResolution(e,t,i){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,i)}getTileCoordForXYAndResolution_(e,t,i,r,s){const o=this.getZForResolution(i),a=i/this.getResolution(o),l=this.getOrigin(o),u=Tt(this.getTileSize(o),this.tmpSize_);let c=a*(e-l[0])/i/u[0],h=a*(l[1]-t)/i/u[1];return r?(c=Zr(c,so)-1,h=Zr(h,so)-1):(c=Ko(c,so),h=Ko(h,so)),Fl(o,c,h,s)}getTileCoordForXYAndZ_(e,t,i,r,s){const o=this.getOrigin(i),a=this.getResolution(i),l=Tt(this.getTileSize(i),this.tmpSize_);let u=(e-o[0])/a/l[0],c=(o[1]-t)/a/l[1];return r?(u=Zr(u,so)-1,c=Zr(c,so)-1):(u=Ko(u,so),c=Ko(c,so)),Fl(i,u,c,s)}getTileCoordForCoordAndZ(e,t,i){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,i)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){const i=Bu(this.resolutions_,e,t||0);return Ie(i,this.minZoom,this.maxZoom)}calculateTileRanges_(e){const t=this.resolutions_.length,i=new Array(t);for(let r=this.minZoom;r<t;++r)i[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=i}}var oo=E5;function n_(n){let e=n.getDefaultTileGrid();return e||(e=r_(n),n.setDefaultTileGrid(e)),e}function ub(n,e,t){const i=e[0],r=n.getTileCoordCenter(e),s=ls(t);if(cn(s,r))return e;{const o=Ae(s),a=Math.ceil((s[0]-r[0])/o);return r[0]+=o*a,n.getTileCoordForCoordAndZ(r,i)}}function cb(n,e,t,i){const r=i!==void 0?i:sl.TOP_LEFT,s=hb(n,e,t);return new oo({extent:n,origin:Zx(n,r),resolutions:s,tileSize:t})}function Ra(n){const e=n||{},t=e.extent||se("EPSG:3857").getExtent(),i={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:hb(t,e.maxZoom,e.tileSize,e.maxResolution)};return new oo(i)}function hb(n,e,t,i){const r=e!==void 0?e:lT,s=ft(n),o=Ae(n),a=Tt(t!==void 0?t:aa),l=i>0?i:Math.max(o/a[0],s/a[1]),u=r+1,c=new Array(u);for(let h=0;h<u;++h)c[h]=l/Math.pow(2,h);return c}function r_(n,e,t,i){const r=ls(n);return cb(r,e,t,i)}function ls(n){n=se(n);let e=n.getExtent();if(!e){const t=180*Oi[Ui.DEGREES]/n.getMetersPerUnit();e=hn(-t,-t,t,t)}return e}class T5 extends Al{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate});this.on,this.once,this.un,this.opaque_=e.opaque!==void 0?e.opaque:!1,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const t=[256,256];this.tileGrid&&Tt(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),t),this.tileCache=new Dc(e.cacheSize||0),this.tmpSize=[0,0],this.key_=e.key||"",this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(e,t){const i=this.getTileCacheForProjection(e);i&&i.expireCache(t)}forEachLoadedTile(e,t,i,r){const s=this.getTileCacheForProjection(e);if(!s)return!1;let o=!0,a,l,u;for(let c=i.minX;c<=i.maxX;++c)for(let h=i.minY;h<=i.maxY;++h)l=Tr(t,c,h),u=!1,s.containsKey(l)&&(a=s.get(l),u=a.getState()===K.LOADED,u&&(u=r(a)!==!1)),u||(o=!1);return o}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getOpaque(e){return this.opaque_}getResolutions(){return this.tileGrid?this.tileGrid.getResolutions():null}getTile(e,t,i,r,s){return fe()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:n_(e)}getTileCacheForProjection(e){return ce(dn(this.getProjection(),e),68),this.tileCache}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=this.getTilePixelRatio(t),o=Tt(r.getTileSize(e),this.tmpSize);return s==1?o:td(o,s,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){const i=t!==void 0?t:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(e=ub(r,e,i)),Lw(e,r)?e:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(e,t){const i=this.getTileCacheForProjection(t);e>i.highWaterMark&&(i.highWaterMark=e)}useTile(e,t,i,r){}}class s_ extends ni{constructor(e,t){super(e);this.tile=t}}var Jc=T5;function fb(n,e){const t=/\{z\}/g,i=/\{x\}/g,r=/\{y\}/g,s=/\{-y\}/g;return function(o,a,l){if(o)return n.replace(t,o[0].toString()).replace(i,o[1].toString()).replace(r,o[2].toString()).replace(s,function(){const u=o[0],c=e.getFullTileRange(u);return ce(c,55),(c.getHeight()-o[2]-1).toString()})}}function up(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=fb(n[r],e);return Hl(i)}function Hl(n){return n.length===1?n[0]:function(e,t,i){if(e){const r=bd(e),s=Pn(r,n.length);return n[s](e,t,i)}else return}}function db(n,e,t){}function cp(n){const e=[];let t=/\{([a-z])-([a-z])\}/.exec(n);if(t){const i=t[1].charCodeAt(0),r=t[2].charCodeAt(0);let s;for(s=i;s<=r;++s)e.push(n.replace(t[0],String.fromCharCode(s)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(n),t){const i=parseInt(t[2],10);for(let r=parseInt(t[1],10);r<=i;r++)e.push(n.replace(t[0],r.toString()));return e}return e.push(n),e}class lx extends Jc{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection});this.generateTileUrlFunction_=this.tileUrlFunction===lx.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const t=e.target,i=oe(t),r=t.getState();let s;r==K.LOADING?(this.tileLoadingKeys_[i]=!0,s=Sa.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==K.ERROR?Sa.TILELOADERROR:r==K.LOADED?Sa.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new s_(s,t))}setTileLoadFunction(e){this.tileCache.clear(),this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,this.tileCache.pruneExceptNewestZ(),typeof t!="undefined"?this.setKey(t):this.changed()}setUrl(e){const t=cp(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;const t=e.join(`
|
127
|
-
`);this.generateTileUrlFunction_?this.setTileUrlFunction(up(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,i){}useTile(e,t,i){const r=Tr(e,t,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)}}var o_=lx;class w5 extends o_{constructor(e){const t=e.projection||"EPSG:3857",i=e.extent||ls(t),r=e.tileGrid||Ra({extent:i,maxResolution:e.maxResolution,maxZoom:e.maxZoom!==void 0?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,opaque:!1,projection:t,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:pb,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,zDirection:e.zDirection===void 0?1:e.zDirection});this.format_=e.format?e.format:null,this.sourceTileCache=new Dc(this.tileCache.highWaterMark),this.overlaps_=e.overlaps==null?!0:e.overlaps,this.tileClass=e.tileClass?e.tileClass:ey,this.tileGrids_={}}getFeaturesInExtent(e){const t=[],i=this.tileCache;if(i.getCount()===0)return t;const r=J0(i.peekFirstKey())[0],s=this.tileGrid;return i.forEach(function(o){if(o.tileCoord[0]!==r||o.getState()!==K.LOADED)return;const a=o.getSourceTiles();for(let l=0,u=a.length;l<u;++l){const c=a[l],h=c.tileCoord;if(dt(e,s.getTileCoordExtent(h))){const f=c.getFeatures();if(f)for(let d=0,p=f.length;d<p;++d){const m=f[d],g=m.getGeometry();dt(e,g.getExtent())&&t.push(m)}}}}),t}getOverlaps(){return this.overlaps_}clear(){this.tileCache.clear(),this.sourceTileCache.clear()}expireCache(e,t){const i=this.getTileCacheForProjection(e),r=Object.keys(t).reduce((s,o)=>{const a=Cw(o);if(i.containsKey(a)){const l=i.get(a).sourceTiles;for(let u=0,c=l.length;u<c;++u)s[l[u].getKey()]=!0}return s},{});super.expireCache(e,t),this.sourceTileCache.expireCache(r)}getSourceTiles(e,t,i){if(i.getState()===K.IDLE){i.setState(K.LOADING);const r=i.wrappedTileCoord,s=this.getTileGridForProjection(t),o=s.getTileCoordExtent(r),a=r[0],l=s.getResolution(a);un(o,-l,o);const u=this.tileGrid,c=u.getExtent();c&&Ai(o,c,o);const h=u.getZForResolution(l,1);u.forEachTileCoord(o,h,f=>{const d=this.tileUrlFunction(f,e,t),p=this.sourceTileCache.containsKey(d)?this.sourceTileCache.get(d):new this.tileClass(f,d?K.IDLE:K.EMPTY,d,this.format_,this.tileLoadFunction);i.sourceTiles.push(p);const m=p.getState();if(m<K.LOADED){const g=v=>{this.handleTileChange(v);const y=p.getState();if(y===K.LOADED||y===K.ERROR){const x=p.getKey();x in i.errorTileKeys?p.getState()===K.LOADED&&delete i.errorTileKeys[x]:i.loadingSourceTiles--,y===K.ERROR?i.errorTileKeys[x]=!0:p.removeEventListener(re.CHANGE,g),i.loadingSourceTiles===0&&i.setState(Wn(i.errorTileKeys)?K.LOADED:K.ERROR)}};p.addEventListener(re.CHANGE,g),i.loadingSourceTiles++}m===K.IDLE&&(p.extent=u.getTileCoordExtent(f),p.projection=t,p.resolution=u.getResolution(f[0]),this.sourceTileCache.set(d,p),p.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(f=>f.getState()===K.ERROR)?K.ERROR:K.LOADED)}return i.sourceTiles}getTile(e,t,i,r,s){const o=Tr(e,t,i),a=this.getKey();let l;if(this.tileCache.containsKey(o)&&(l=this.tileCache.get(o),l.key===a))return l;const u=[e,t,i];let c=this.getTileCoordForTileUrlFunction(u,s);const h=this.getTileGrid().getExtent(),f=this.getTileGridForProjection(s);if(c&&h){const m=f.getTileCoordExtent(c);un(m,-f.getResolution(e),m),dt(h,m)||(c=null)}let d=!0;if(c!==null){const m=this.tileGrid,g=f.getResolution(e),v=m.getZForResolution(g,1),y=f.getTileCoordExtent(c);un(y,-g,y),m.forEachTileCoord(y,v,function(x){d=d&&!this.tileUrlFunction(x,r,s)}.bind(this))}const p=new Q0(u,d?K.EMPTY:K.IDLE,c,this.getSourceTiles.bind(this,r,s));return p.key=a,l?(p.interimTile=l,p.refreshInterimChain(),this.tileCache.replace(o,p)):this.tileCache.set(o,p),p}getTileGridForProjection(e){const t=e.getCode();let i=this.tileGrids_[t];if(!i){const r=this.tileGrid;i=r_(e,void 0,r?r.getTileSize(r.getMinZoom()):void 0),this.tileGrids_[t]=i}return i}getTilePixelRatio(e){return e}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=Tt(r.getTileSize(e),this.tmpSize);return[Math.round(s[0]*t),Math.round(s[1]*t)]}updateCacheSize(e,t){super.updateCacheSize(e*2,t),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(t).highWaterMark}}var a_=w5;function pb(n,e){n.setLoader(function(t,i,r){Z0(e,n.getFormat(),t,i,r,n.onLoad.bind(n),n.onError.bind(n))})}var S5=function(){function n(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}return n.prototype.preventDefault=function(){this.defaultPrevented=!0},n.prototype.stopPropagation=function(){this.propagationStopped=!0},n}(),hp=S5,R5={PROPERTYCHANGE:"propertychange"},b5=function(){function n(){this.disposed=!1}return n.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},n.prototype.disposeInternal=function(){},n}(),I5=b5;function C5(n,e,t){for(var i,r,s=t||ba,o=0,a=n.length,l=!1;o<a;)i=o+(a-o>>1),r=+s(n[i],e),r<0?o=i+1:(a=i,l=!r);return l?o:~o}function ba(n,e){return n>e?1:n<e?-1:0}function L5(n,e,t){var i=n.length;if(n[0]<=e)return 0;if(e<=n[i-1])return i-1;var r=void 0;if(t>0){for(r=1;r<i;++r)if(n[r]<e)return r-1}else if(t<0){for(r=1;r<i;++r)if(n[r]<=e)return r}else for(r=1;r<i;++r){if(n[r]==e)return r;if(n[r]<e)return typeof t=="function"?t(e,n[r-1],n[r])>0?r-1:r:n[r-1]-e<e-n[r]?r-1:r}return i-1}function O5(n,e,t){for(;e<t;){var i=n[e];n[e]=n[t],n[t]=i,++e,--t}}function us(n,e){for(var t=Array.isArray(e)?e:[e],i=t.length,r=0;r<i;r++)n[n.length]=t[r]}function Kl(n,e){var t=n.length;if(t!==e.length)return!1;for(var i=0;i<t;i++)if(n[i]!==e[i])return!1;return!0}function A5(n,e,t){var i=e||ba;return n.every(function(r,s){if(s===0)return!0;var o=i(n[s-1],r);return!(o>0||t&&o===0)})}function gb(){}function P5(n){var e=!1,t,i,r;return function(){var s=Array.prototype.slice.call(arguments);return(!e||this!==r||!Kl(s,i))&&(e=!0,r=this,i=s,t=n.apply(this,arguments)),t}}var Rn=typeof Object.assign=="function"?Object.assign:function(n,e){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),i=1,r=arguments.length;i<r;++i){var s=arguments[i];if(s!=null)for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t};function l_(n){for(var e in n)delete n[e]}function fp(n){var e;for(e in n)return!1;return!e}var M5=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),F5=function(n){M5(e,n);function e(t){var i=n.call(this)||this;return i.eventTarget_=t,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return e.prototype.addEventListener=function(t,i){if(!(!t||!i)){var r=this.listeners_||(this.listeners_={}),s=r[t]||(r[t]=[]);s.indexOf(i)===-1&&s.push(i)}},e.prototype.dispatchEvent=function(t){var i=typeof t=="string",r=i?t:t.type,s=this.listeners_&&this.listeners_[r];if(!!s){var o=i?new hp(t):t;o.target||(o.target=this.eventTarget_||this);var a=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});r in a||(a[r]=0,l[r]=0),++a[r];for(var u,c=0,h=s.length;c<h;++c)if("handleEvent"in s[c]?u=s[c].handleEvent(o):u=s[c].call(this,o),u===!1||o.propagationStopped){u=!1;break}if(--a[r]===0){var f=l[r];for(delete l[r];f--;)this.removeEventListener(r,gb);delete a[r]}return u}},e.prototype.disposeInternal=function(){this.listeners_&&l_(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1},e.prototype.removeEventListener=function(t,i){var r=this.listeners_&&this.listeners_[t];if(r){var s=r.indexOf(i);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[s]=gb,++this.pendingRemovals_[t]):(r.splice(s,1),r.length===0&&delete this.listeners_[t]))}},e}(I5),Qc=F5,Si={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function Cr(n,e,t,i,r){if(i&&i!==n&&(t=t.bind(i)),r){var s=t;t=function(){n.removeEventListener(e,t),s.apply(this,arguments)}}var o={target:n,type:e,listener:t};return n.addEventListener(e,t),o}function dp(n,e,t,i){return Cr(n,e,t,i,!0)}function Lr(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),l_(n))}var N5=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),eh=function(n){N5(e,n);function e(){var t=n.call(this)||this;return t.on=t.onInternal,t.once=t.onceInternal,t.un=t.unInternal,t.revision_=0,t}return e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Si.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,i){if(Array.isArray(t)){for(var r=t.length,s=new Array(r),o=0;o<r;++o)s[o]=Cr(this,t[o],i);return s}else return Cr(this,t,i)},e.prototype.onceInternal=function(t,i){var r;if(Array.isArray(t)){var s=t.length;r=new Array(s);for(var o=0;o<s;++o)r[o]=dp(this,t[o],i)}else r=dp(this,t,i);return i.ol_key=r,r},e.prototype.unInternal=function(t,i){var r=i.ol_key;if(r)u_(r);else if(Array.isArray(t))for(var s=0,o=t.length;s<o;++s)this.removeEventListener(t[s],i);else this.removeEventListener(t,i)},e}(Qc);eh.prototype.on,eh.prototype.once,eh.prototype.un;function u_(n){if(Array.isArray(n))for(var e=0,t=n.length;e<t;++e)Lr(n[e]);else Lr(n)}function Re(){return function(){throw new Error("Unimplemented abstract method.")}()}var $5=0;function gt(n){return n.ol_uid||(n.ol_uid=String(++$5))}var D5="6.13.0",mb=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),yb=function(n){mb(e,n);function e(t,i,r){var s=n.call(this,t)||this;return s.key=i,s.oldValue=r,s}return e}(hp),k5=function(n){mb(e,n);function e(t){var i=n.call(this)||this;return i.on,i.once,i.un,gt(i),i.values_=null,t!==void 0&&i.setProperties(t),i}return e.prototype.get=function(t){var i;return this.values_&&this.values_.hasOwnProperty(t)&&(i=this.values_[t]),i},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&Rn({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,i){var r;r="change:".concat(t),this.hasListener(r)&&this.dispatchEvent(new yb(r,t,i)),r=R5.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new yb(r,t,i))},e.prototype.addChangeListener=function(t,i){this.addEventListener("change:".concat(t),i)},e.prototype.removeChangeListener=function(t,i){this.removeEventListener("change:".concat(t),i)},e.prototype.set=function(t,i,r){var s=this.values_||(this.values_={});if(r)s[t]=i;else{var o=s[t];s[t]=i,o!==i&&this.notify(t,o)}},e.prototype.setProperties=function(t,i){for(var r in t)this.set(r,t[r],i)},e.prototype.applyProperties=function(t){!t.values_||Rn(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,i){if(this.values_&&t in this.values_){var r=this.values_[t];delete this.values_[t],fp(this.values_)&&(this.values_=null),i||this.notify(t,r)}},e}(eh),th=k5,G5=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),U5=function(n){G5(e,n);function e(t){var i=this,r="v"+D5.split("-")[0],s="Assertion failed. See https://openlayers.org/en/"+r+"/doc/errors/#"+t+" for details.";return i=n.call(this,s)||this,i.code=t,i.name="AssertionError",i.message=s,i}return e}(Error),z5=U5;function It(n,e){if(!n)throw new z5(e)}var B5=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),j5=function(n){B5(e,n);function e(t){var i=n.call(this)||this;if(i.on,i.once,i.un,i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addChangeListener(i.geometryName_,i.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){var r=t;i.setGeometry(r)}else{var s=t;i.setProperties(s)}return i}return e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var r=this.getStyle();return r&&t.setStyle(r),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Lr(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Cr(t,Si.CHANGE,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?Y5(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(th);function Y5(n){if(typeof n=="function")return n;var e;if(Array.isArray(n))e=n;else{It(typeof n.getZIndex=="function",41);var t=n;e=[t]}return function(){return e}}var X5=j5,ql={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},cs={};cs[ql.RADIANS]=6370997/(2*Math.PI),cs[ql.DEGREES]=2*Math.PI*6370997/360,cs[ql.FEET]=.3048,cs[ql.METERS]=1,cs[ql.USFEET]=1200/3937;var hs=ql,Jl=typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"?navigator.userAgent.toLowerCase():"";Jl.indexOf("firefox"),Jl.indexOf("safari")!==-1&&Jl.indexOf("chrom")==-1,Jl.indexOf("webkit")!==-1&&Jl.indexOf("edge")==-1,Jl.indexOf("macintosh");var pp=typeof WorkerGlobalScope!="undefined"&&typeof OffscreenCanvas!="undefined"&&self instanceof WorkerGlobalScope,V5=typeof Image!="undefined"&&Image.prototype.decode;(function(){var n=!1;try{var e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return n})();var _b=new Array(6);function Or(){return[1,0,0,1,0,0]}function vb(n){return gp(n,1,0,0,1,0,0)}function c_(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=e[0],u=e[1],c=e[2],h=e[3],f=e[4],d=e[5];return n[0]=t*l+r*u,n[1]=i*l+s*u,n[2]=t*c+r*h,n[3]=i*c+s*h,n[4]=t*f+r*d+o,n[5]=i*f+s*d+a,n}function gp(n,e,t,i,r,s,o){return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n[4]=s,n[5]=o,n}function W5(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function mi(n,e){var t=e[0],i=e[1];return e[0]=n[0]*t+n[2]*i+n[4],e[1]=n[1]*t+n[3]*i+n[5],e}function h_(n,e,t){return c_(n,gp(_b,e,0,0,t,0,0))}function Z5(n,e,t){return gp(n,e,0,0,t,0,0)}function H5(n,e,t){return c_(n,gp(_b,1,0,0,1,e,t))}function fs(n,e,t,i,r,s,o,a){var l=Math.sin(s),u=Math.cos(s);return n[0]=i*u,n[1]=r*l,n[2]=-i*l,n[3]=r*u,n[4]=o*i*u-a*i*l+e,n[5]=o*r*l+a*r*u+t,n}function xb(n,e){var t=K5(e);It(t!==0,32);var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5];return n[0]=o/t,n[1]=-r/t,n[2]=-s/t,n[3]=i/t,n[4]=(s*l-o*a)/t,n[5]=-(i*l-r*a)/t,n}function K5(n){return n[0]*n[3]-n[1]*n[2]}var Eb;function Tb(n){var e="matrix("+n.join(", ")+")";if(pp)return e;var t=Eb||(Eb=document.createElement("div"));return t.style.transform=e,t.style.transform}var ih={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Ri={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function f_(n){for(var e=kn(),t=0,i=n.length;t<i;++t)rh(e,n[t]);return e}function q5(n,e,t){var i=Math.min.apply(null,n),r=Math.min.apply(null,e),s=Math.max.apply(null,n),o=Math.max.apply(null,e);return lo(i,r,s,o,t)}function ao(n,e,t){return t?(t[0]=n[0]-e,t[1]=n[1]-e,t[2]=n[2]+e,t[3]=n[3]+e,t):[n[0]-e,n[1]-e,n[2]+e,n[3]+e]}function J5(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function Ia(n,e,t){var i,r;return e<n[0]?i=n[0]-e:n[2]<e?i=e-n[2]:i=0,t<n[1]?r=n[1]-t:n[3]<t?r=t-n[3]:r=0,i*i+r*r}function nh(n,e){return d_(n,e[0],e[1])}function Ql(n,e){return n[0]<=e[0]&&e[2]<=n[2]&&n[1]<=e[1]&&e[3]<=n[3]}function d_(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function p_(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=e[0],a=e[1],l=Ri.UNKNOWN;return o<t?l=l|Ri.LEFT:o>r&&(l=l|Ri.RIGHT),a<i?l=l|Ri.BELOW:a>s&&(l=l|Ri.ABOVE),l===Ri.UNKNOWN&&(l=Ri.INTERSECTING),l}function kn(){return[1/0,1/0,-1/0,-1/0]}function lo(n,e,t,i,r){return r?(r[0]=n,r[1]=e,r[2]=t,r[3]=i,r):[n,e,t,i]}function mp(n){return lo(1/0,1/0,-1/0,-1/0,n)}function wb(n,e){var t=n[0],i=n[1];return lo(t,i,t,i,e)}function g_(n,e,t,i,r){var s=mp(r);return bb(s,n,e,t,i)}function Sb(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function Rb(n,e){return e[0]<n[0]&&(n[0]=e[0]),e[2]>n[2]&&(n[2]=e[2]),e[1]<n[1]&&(n[1]=e[1]),e[3]>n[3]&&(n[3]=e[3]),n}function rh(n,e){e[0]<n[0]&&(n[0]=e[0]),e[0]>n[2]&&(n[2]=e[0]),e[1]<n[1]&&(n[1]=e[1]),e[1]>n[3]&&(n[3]=e[1])}function bb(n,e,t,i,r){for(;t<i;t+=r)Q5(n,e[t],e[t+1]);return n}function Q5(n,e,t){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}function Ib(n,e){var t;return t=e(yp(n)),t||(t=e(_p(n)),t)||(t=e(vp(n)),t)||(t=e(uo(n)),t)?t:!1}function m_(n){var e=0;return t4(n)||(e=bi(n)*Ar(n)),e}function yp(n){return[n[0],n[1]]}function _p(n){return[n[2],n[1]]}function eu(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function e4(n,e){var t;return e===ih.BOTTOM_LEFT?t=yp(n):e===ih.BOTTOM_RIGHT?t=_p(n):e===ih.TOP_LEFT?t=uo(n):e===ih.TOP_RIGHT?t=vp(n):It(!1,13),t}function Ar(n){return n[3]-n[1]}function tu(n,e,t){var i=t||kn();return Qt(n,e)?(n[0]>e[0]?i[0]=n[0]:i[0]=e[0],n[1]>e[1]?i[1]=n[1]:i[1]=e[1],n[2]<e[2]?i[2]=n[2]:i[2]=e[2],n[3]<e[3]?i[3]=n[3]:i[3]=e[3]):mp(i),i}function uo(n){return[n[0],n[3]]}function vp(n){return[n[2],n[3]]}function bi(n){return n[2]-n[0]}function Qt(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function t4(n){return n[2]<n[0]||n[3]<n[1]}function i4(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function n4(n,e,t){var i=!1,r=p_(n,e),s=p_(n,t);if(r===Ri.INTERSECTING||s===Ri.INTERSECTING)i=!0;else{var o=n[0],a=n[1],l=n[2],u=n[3],c=e[0],h=e[1],f=t[0],d=t[1],p=(d-h)/(f-c),m=void 0,g=void 0;!!(s&Ri.ABOVE)&&!(r&Ri.ABOVE)&&(m=f-(d-u)/p,i=m>=o&&m<=l),!i&&!!(s&Ri.RIGHT)&&!(r&Ri.RIGHT)&&(g=d-(f-l)*p,i=g>=a&&g<=u),!i&&!!(s&Ri.BELOW)&&!(r&Ri.BELOW)&&(m=f-(d-a)/p,i=m>=o&&m<=l),!i&&!!(s&Ri.LEFT)&&!(r&Ri.LEFT)&&(g=d-(f-o)*p,i=g>=a&&g<=u)}return i}function r4(n,e,t,i){var r=[];if(i>1)for(var s=n[2]-n[0],o=n[3]-n[1],a=0;a<i;++a)r.push(n[0]+s*a/i,n[1],n[2],n[1]+o*a/i,n[2]-s*a/i,n[3],n[0],n[3]-o*a/i);else r=[n[0],n[1],n[2],n[1],n[2],n[3],n[0],n[3]];e(r,r,2);for(var l=[],u=[],a=0,c=r.length;a<c;a+=2)l.push(r[a]),u.push(r[a+1]);return q5(l,u,t)}function s4(n,e){var t=e.getExtent(),i=eu(n);if(e.canWrapX()&&(i[0]<t[0]||i[0]>=t[2])){var r=bi(t),s=Math.floor((i[0]-t[0])/r),o=s*r;n[0]-=o,n[2]-=o}return n}var o4=function(){function n(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}return n.prototype.canWrapX=function(){return this.canWrapX_},n.prototype.getCode=function(){return this.code_},n.prototype.getExtent=function(){return this.extent_},n.prototype.getUnits=function(){return this.units_},n.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||cs[this.units_]},n.prototype.getWorldExtent=function(){return this.worldExtent_},n.prototype.getAxisOrientation=function(){return this.axisOrientation_},n.prototype.isGlobal=function(){return this.global_},n.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)},n.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},n.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},n.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)},n.prototype.setWorldExtent=function(e){this.worldExtent_=e},n.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},n.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},n}(),y_=o4;function Pr(n,e,t){return Math.min(Math.max(n,e),t)}var a4=function(){var n;return"cosh"in Math?n=Math.cosh:n=function(e){var t=Math.exp(e);return(t+1/t)/2},n}(),l4=function(){var n;return"log2"in Math?n=Math.log2:n=function(e){return Math.log(e)*Math.LOG2E},n}();function u4(n,e,t,i,r,s){var o=r-t,a=s-i;if(o!==0||a!==0){var l=((n-t)*o+(e-i)*a)/(o*o+a*a);l>1?(t=r,i=s):l>0&&(t+=o*l,i+=a*l)}return Ca(n,e,t,i)}function Ca(n,e,t,i){var r=t-n,s=i-e;return r*r+s*s}function c4(n){for(var e=n.length,t=0;t<e;t++){for(var i=t,r=Math.abs(n[t][t]),s=t+1;s<e;s++){var o=Math.abs(n[s][t]);o>r&&(r=o,i=s)}if(r===0)return null;var a=n[i];n[i]=n[t],n[t]=a;for(var l=t+1;l<e;l++)for(var u=-n[l][t]/n[t][t],c=t;c<e+1;c++)t==c?n[l][c]=0:n[l][c]+=u*n[t][c]}for(var h=new Array(e),f=e-1;f>=0;f--){h[f]=n[f][e]/n[f][f];for(var d=f-1;d>=0;d--)n[d][e]-=n[d][f]*h[f]}return h}function __(n){return n*Math.PI/180}function xp(n,e){var t=n%e;return t*e<0?t+e:t}function ds(n,e,t){return n+t*(e-n)}function Cb(n,e){var t=Math.pow(10,e);return Math.round(n*t)/t}function Ep(n,e){return Math.floor(Cb(n,e))}function Tp(n,e){return Math.ceil(Cb(n,e))}var h4=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),sh=6378137,iu=Math.PI*sh,f4=[-iu,-iu,iu,iu],d4=[-180,-85,180,85],wp=sh*Math.log(Math.tan(Math.PI/2)),nu=function(n){h4(e,n);function e(t){return n.call(this,{code:t,units:hs.METERS,extent:f4,global:!0,worldExtent:d4,getPointResolution:function(i,r){return i/a4(r[1]/sh)}})||this}return e}(y_),Lb=[new nu("EPSG:3857"),new nu("EPSG:102100"),new nu("EPSG:102113"),new nu("EPSG:900913"),new nu("http://www.opengis.net/def/crs/EPSG/0/3857"),new nu("http://www.opengis.net/gml/srs/epsg.xml#3857")];function p4(n,e,t){var i=n.length,r=t>1?t:2,s=e;s===void 0&&(r>2?s=n.slice():s=new Array(i));for(var o=0;o<i;o+=r){s[o]=iu*n[o]/180;var a=sh*Math.log(Math.tan(Math.PI*(+n[o+1]+90)/360));a>wp?a=wp:a<-wp&&(a=-wp),s[o+1]=a}return s}function g4(n,e,t){var i=n.length,r=t>1?t:2,s=e;s===void 0&&(r>2?s=n.slice():s=new Array(i));for(var o=0;o<i;o+=r)s[o]=180*n[o]/iu,s[o+1]=360*Math.atan(Math.exp(n[o+1]/sh))/Math.PI-90;return s}var m4=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),y4=6378137,Ob=[-180,-90,180,90],_4=Math.PI*y4/180,La=function(n){m4(e,n);function e(t,i){return n.call(this,{code:t,units:hs.DEGREES,extent:Ob,axisOrientation:i,global:!0,metersPerUnit:_4,worldExtent:Ob})||this}return e}(y_),Ab=[new La("CRS:84"),new La("EPSG:4326","neu"),new La("urn:ogc:def:crs:OGC:1.3:CRS84"),new La("urn:ogc:def:crs:OGC:2:84"),new La("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new La("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new La("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],v_={};function v4(n){return v_[n]||v_[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function x4(n,e){v_[n]=e}var ru={};function Sp(n,e,t){var i=n.getCode(),r=e.getCode();i in ru||(ru[i]={}),ru[i][r]=t}function E4(n,e){var t;return n in ru&&e in ru[n]&&(t=ru[n][e]),t}function Pb(n,e){if(e.canWrapX()){var t=bi(e.getExtent()),i=T4(n,e,t);i&&(n[0]-=i*t)}return n}function T4(n,e,t){var i=e.getExtent(),r=0;if(e.canWrapX()&&(n[0]<i[0]||n[0]>i[2])){var s=t||bi(i);r=Math.floor((n[0]-i[0])/s)}return r}var le={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},w4=63710088e-1;function Mb(n,e,t){var i=t||w4,r=__(n[1]),s=__(e[1]),o=(s-r)/2,a=__(e[0]-n[0])/2,l=Math.sin(o)*Math.sin(o)+Math.sin(a)*Math.sin(a)*Math.cos(r)*Math.cos(s);return 2*i*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function x_(n,e,t){var i;if(e!==void 0){for(var r=0,s=n.length;r<s;++r)e[r]=n[r];i=e}else i=n.slice();return i}function Fb(n,e,t){if(e!==void 0&&n!==e){for(var i=0,r=n.length;i<r;++i)e[i]=n[i];n=e}return n}function S4(n){x4(n.getCode(),n),Sp(n,n,x_)}function R4(n){n.forEach(S4)}function ei(n){return typeof n=="string"?v4(n):n||null}function Nb(n,e,t,i){n=ei(n);var r,s=n.getPointResolutionFunc();if(s){if(r=s(e,t),i&&i!==n.getUnits()){var o=n.getMetersPerUnit();o&&(r=r*o/cs[i])}}else{var a=n.getUnits();if(a==hs.DEGREES&&!i||i==hs.DEGREES)r=e;else{var l=Rp(n,ei("EPSG:4326"));if(l===Fb&&a!==hs.DEGREES)r=e*n.getMetersPerUnit();else{var u=[t[0]-e/2,t[1],t[0]+e/2,t[1],t[0],t[1]-e/2,t[0],t[1]+e/2];u=l(u,u,2);var c=Mb(u.slice(0,2),u.slice(2,4)),h=Mb(u.slice(4,6),u.slice(6,8));r=(c+h)/2}var o=i?cs[i]:n.getMetersPerUnit();o!==void 0&&(r/=o)}}return r}function $b(n){R4(n),n.forEach(function(e){n.forEach(function(t){e!==t&&Sp(e,t,x_)})})}function b4(n,e,t,i){n.forEach(function(r){e.forEach(function(s){Sp(r,s,t),Sp(s,r,i)})})}function Db(n,e){return kb(n,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function Oa(n,e){if(n===e)return!0;var t=n.getUnits()===e.getUnits();if(n.getCode()===e.getCode())return t;var i=Rp(n,e);return i===x_&&t}function Rp(n,e){var t=n.getCode(),i=e.getCode(),r=E4(t,i);return r||(r=Fb),r}function bp(n,e){var t=ei(n),i=ei(e);return Rp(t,i)}function kb(n,e,t){var i=bp(e,t);return i(n,void 0,n.length)}function I4(n,e){return n}function E_(n,e){return n}function C4(){$b(Lb),$b(Ab),b4(Ab,Lb,p4,g4)}C4();function co(n,e,t,i,r,s){for(var o=s||[],a=0,l=e;l<t;l+=i){var u=n[l],c=n[l+1];o[a++]=r[0]*u+r[2]*c+r[4],o[a++]=r[1]*u+r[3]*c+r[5]}return s&&o.length!=a&&(o.length=a),o}function Gb(n,e,t,i,r,s,o){for(var a=o||[],l=Math.cos(r),u=Math.sin(r),c=s[0],h=s[1],f=0,d=e;d<t;d+=i){var p=n[d]-c,m=n[d+1]-h;a[f++]=c+p*l-m*u,a[f++]=h+p*u+m*l;for(var g=d+2;g<d+i;++g)a[f++]=n[g]}return o&&a.length!=f&&(a.length=f),a}function L4(n,e,t,i,r,s,o,a){for(var l=a||[],u=o[0],c=o[1],h=0,f=e;f<t;f+=i){var d=n[f]-u,p=n[f+1]-c;l[h++]=u+r*d,l[h++]=c+s*p;for(var m=f+2;m<f+i;++m)l[h++]=n[m]}return a&&l.length!=h&&(l.length=h),l}function O4(n,e,t,i,r,s,o){for(var a=o||[],l=0,u=e;u<t;u+=i){a[l++]=n[u]+r,a[l++]=n[u+1]+s;for(var c=u+2;c<u+i;++c)a[l++]=n[c]}return o&&a.length!=l&&(a.length=l),a}var A4=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Ub=Or(),P4=function(n){A4(e,n);function e(){var t=n.call(this)||this;return t.extent_=kn(),t.extentRevision_=-1,t.simplifiedGeometryMaxMinSquaredTolerance=0,t.simplifiedGeometryRevision=0,t.simplifyTransformedInternal=P5(function(i,r,s){if(!s)return this.getSimplifiedGeometry(r);var o=this.clone();return o.applyTransform(s),o.getSimplifiedGeometry(r)}),t}return e.prototype.simplifyTransformed=function(t,i){return this.simplifyTransformedInternal(this.getRevision(),t,i)},e.prototype.clone=function(){return Re()},e.prototype.closestPointXY=function(t,i,r,s){return Re()},e.prototype.containsXY=function(t,i){var r=this.getClosestPoint([t,i]);return r[0]===t&&r[1]===i},e.prototype.getClosestPoint=function(t,i){var r=i||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Re()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var i=this.computeExtent(this.extent_);(isNaN(i[0])||isNaN(i[1]))&&mp(i),this.extentRevision_=this.getRevision()}return i4(this.extent_,t)},e.prototype.rotate=function(t,i){Re()},e.prototype.scale=function(t,i,r){Re()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Re()},e.prototype.getType=function(){return Re()},e.prototype.applyTransform=function(t){Re()},e.prototype.intersectsExtent=function(t){return Re()},e.prototype.translate=function(t,i){Re()},e.prototype.transform=function(t,i){var r=ei(t),s=r.getUnits()==hs.TILE_PIXELS?function(o,a,l){var u=r.getExtent(),c=r.getWorldExtent(),h=Ar(c)/Ar(u);return fs(Ub,c[0],c[3],h,-h,0,0,0),co(o,0,o.length,l,Ub,a),bp(r,i)(o,a,l)}:bp(r,i);return this.applyTransform(s),this},e}(th),zb=P4,M4=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),F4=function(n){M4(e,n);function e(t){var i=n.call(this)||this;return i.geometries_=t||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Lr),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(!!this.geometries_)for(var t=0,i=this.geometries_.length;t<i;++t)this.changeEventsKeys_.push(Cr(this.geometries_[t],Si.CHANGE,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,i,r,s){if(s<Ia(this.getExtent(),t,i))return s;for(var o=this.geometries_,a=0,l=o.length;a<l;++a)s=o[a].closestPointXY(t,i,r,s);return s},e.prototype.containsXY=function(t,i){for(var r=this.geometries_,s=0,o=r.length;s<o;++s)if(r[s].containsXY(t,i))return!0;return!1},e.prototype.computeExtent=function(t){mp(t);for(var i=this.geometries_,r=0,s=i.length;r<s;++r)Rb(t,i[r].getExtent());return t},e.prototype.getGeometries=function(){return Bb(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],i=this.geometries_,r=0,s=i.length;r<s;++r)i[r].getType()===this.getType()?t=t.concat(i[r].getGeometriesArrayRecursive()):t.push(i[r]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var i=[],r=this.geometries_,s=!1,o=0,a=r.length;o<a;++o){var l=r[o],u=l.getSimplifiedGeometry(t);i.push(u),u!==l&&(s=!0)}if(s){var c=new e(null);return c.setGeometriesArray(i),c}else return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return le.GEOMETRY_COLLECTION},e.prototype.intersectsExtent=function(t){for(var i=this.geometries_,r=0,s=i.length;r<s;++r)if(i[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return this.geometries_.length===0},e.prototype.rotate=function(t,i){for(var r=this.geometries_,s=0,o=r.length;s<o;++s)r[s].rotate(t,i);this.changed()},e.prototype.scale=function(t,i,r){var s=r;s||(s=eu(this.getExtent()));for(var o=this.geometries_,a=0,l=o.length;a<l;++a)o[a].scale(t,i,s);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Bb(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var i=this.geometries_,r=0,s=i.length;r<s;++r)i[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,i){for(var r=this.geometries_,s=0,o=r.length;s<o;++s)r[s].translate(t,i);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),n.prototype.disposeInternal.call(this)},e}(zb);function Bb(n){for(var e=[],t=0,i=n.length;t<i;++t)e.push(n[t].clone());return e}var N4=F4,$4=function(){function n(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return n.prototype.getReadOptions=function(e,t){var i;if(t){var r=t.dataProjection?ei(t.dataProjection):this.readProjection(e);t.extent&&r&&r.getUnits()===hs.TILE_PIXELS&&(r=ei(r),r.setWorldExtent(t.extent)),i={dataProjection:r,featureProjection:t.featureProjection}}return this.adaptOptions(i)},n.prototype.adaptOptions=function(e){return Rn({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)},n.prototype.getType=function(){return Re()},n.prototype.readFeature=function(e,t){return Re()},n.prototype.readFeatures=function(e,t){return Re()},n.prototype.readGeometry=function(e,t){return Re()},n.prototype.readProjection=function(e){return Re()},n.prototype.writeFeature=function(e,t){return Re()},n.prototype.writeFeatures=function(e,t){return Re()},n.prototype.writeGeometry=function(e,t){return Re()},n}(),jb=$4;function T_(n,e,t){var i=t?ei(t.featureProjection):null,r=t?ei(t.dataProjection):null,s;if(i&&r&&!Oa(i,r)?s=(e?n.clone():n).transform(e?i:r,e?r:i):s=n,e&&t&&t.decimals!==void 0){var o=Math.pow(10,t.decimals),a=function(l){for(var u=0,c=l.length;u<c;++u)l[u]=Math.round(l[u]*o)/o;return l};s===n&&(s=n.clone()),s.applyTransform(a)}return s}var Aa={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"},D4=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),k4=function(n){D4(e,n);function e(){return n.call(this)||this}return e.prototype.getType=function(){return Aa.JSON},e.prototype.readFeature=function(t,i){return this.readFeatureFromObject(Ip(t),this.getReadOptions(t,i))},e.prototype.readFeatures=function(t,i){return this.readFeaturesFromObject(Ip(t),this.getReadOptions(t,i))},e.prototype.readFeatureFromObject=function(t,i){return Re()},e.prototype.readFeaturesFromObject=function(t,i){return Re()},e.prototype.readGeometry=function(t,i){return this.readGeometryFromObject(Ip(t),this.getReadOptions(t,i))},e.prototype.readGeometryFromObject=function(t,i){return Re()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(Ip(t))},e.prototype.readProjectionFromObject=function(t){return Re()},e.prototype.writeFeature=function(t,i){return JSON.stringify(this.writeFeatureObject(t,i))},e.prototype.writeFeatureObject=function(t,i){return Re()},e.prototype.writeFeatures=function(t,i){return JSON.stringify(this.writeFeaturesObject(t,i))},e.prototype.writeFeaturesObject=function(t,i){return Re()},e.prototype.writeGeometry=function(t,i){return JSON.stringify(this.writeGeometryObject(t,i))},e.prototype.writeGeometryObject=function(t,i){return Re()},e}(jb);function Ip(n){if(typeof n=="string"){var e=JSON.parse(n);return e||null}else return n!==null?n:null}var G4=k4,vt={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},U4=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),z4=function(n){U4(e,n);function e(){var t=n.call(this)||this;return t.layout=vt.XY,t.stride=2,t.flatCoordinates=null,t}return e.prototype.computeExtent=function(t){return g_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Re()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var i=this.getSimplifiedGeometryInternal(t),r=i.getFlatCoordinates();return r.length<this.flatCoordinates.length?i:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,i){this.stride=Yb(t),this.layout=t,this.flatCoordinates=i},e.prototype.setCoordinates=function(t,i){Re()},e.prototype.setLayout=function(t,i,r){var s;if(t)s=Yb(t);else{for(var o=0;o<r;++o)if(i.length===0){this.layout=vt.XY,this.stride=2;return}else i=i[0];s=i.length,t=B4(s)}this.layout=t,this.stride=s},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,i){var r=this.getFlatCoordinates();if(r){var s=this.getStride();Gb(r,0,r.length,s,t,i,r),this.changed()}},e.prototype.scale=function(t,i,r){var s=i;s===void 0&&(s=t);var o=r;o||(o=eu(this.getExtent()));var a=this.getFlatCoordinates();if(a){var l=this.getStride();L4(a,0,a.length,l,t,s,o,a),this.changed()}},e.prototype.translate=function(t,i){var r=this.getFlatCoordinates();if(r){var s=this.getStride();O4(r,0,r.length,s,t,i,r),this.changed()}},e}(zb);function B4(n){var e;return n==2?e=vt.XY:n==3?e=vt.XYZ:n==4&&(e=vt.XYZM),e}function Yb(n){var e;return n==vt.XY?e=2:n==vt.XYZ||n==vt.XYM?e=3:n==vt.XYZM&&(e=4),e}function j4(n,e,t){var i=n.getFlatCoordinates();if(i){var r=n.getStride();return co(i,0,i.length,r,e,t)}else return null}var Pa=z4;function Xb(n,e,t,i,r,s,o){var a=n[e],l=n[e+1],u=n[t]-a,c=n[t+1]-l,h;if(u===0&&c===0)h=e;else{var f=((r-a)*u+(s-l)*c)/(u*u+c*c);if(f>1)h=t;else if(f>0){for(var d=0;d<i;++d)o[d]=ds(n[e+d],n[t+d],f);o.length=i;return}else h=e}for(var d=0;d<i;++d)o[d]=n[h+d];o.length=i}function w_(n,e,t,i,r){var s=n[e],o=n[e+1];for(e+=i;e<t;e+=i){var a=n[e],l=n[e+1],u=Ca(s,o,a,l);u>r&&(r=u),s=a,o=l}return r}function S_(n,e,t,i,r){for(var s=0,o=t.length;s<o;++s){var a=t[s];r=w_(n,e,a,i,r),e=a}return r}function Y4(n,e,t,i,r){for(var s=0,o=t.length;s<o;++s){var a=t[s];r=S_(n,e,a,i,r),e=a[a.length-1]}return r}function R_(n,e,t,i,r,s,o,a,l,u,c){if(e==t)return u;var h,f;if(r===0)if(f=Ca(o,a,n[e],n[e+1]),f<u){for(h=0;h<i;++h)l[h]=n[e+h];return l.length=i,f}else return u;for(var d=c||[NaN,NaN],p=e+i;p<t;)if(Xb(n,p-i,p,i,o,a,d),f=Ca(o,a,d[0],d[1]),f<u){for(u=f,h=0;h<i;++h)l[h]=d[h];l.length=i,p+=i}else p+=i*Math.max((Math.sqrt(f)-Math.sqrt(u))/r|0,1);if(s&&(Xb(n,t-i,e,i,o,a,d),f=Ca(o,a,d[0],d[1]),f<u)){for(u=f,h=0;h<i;++h)l[h]=d[h];l.length=i}return u}function b_(n,e,t,i,r,s,o,a,l,u,c){for(var h=c||[NaN,NaN],f=0,d=t.length;f<d;++f){var p=t[f];u=R_(n,e,p,i,r,s,o,a,l,u,h),e=p}return u}function X4(n,e,t,i,r,s,o,a,l,u,c){for(var h=c||[NaN,NaN],f=0,d=t.length;f<d;++f){var p=t[f];u=b_(n,e,p,i,r,s,o,a,l,u,h),e=p[p.length-1]}return u}function V4(n,e,t,i){for(var r=0,s=t.length;r<s;++r)n[e++]=t[r];return e}function Cp(n,e,t,i){for(var r=0,s=t.length;r<s;++r)for(var o=t[r],a=0;a<i;++a)n[e++]=o[a];return e}function I_(n,e,t,i,r){for(var s=r||[],o=0,a=0,l=t.length;a<l;++a){var u=Cp(n,e,t[a],i);s[o++]=u,e=u}return s.length=o,s}function W4(n,e,t,i,r){for(var s=r||[],o=0,a=0,l=t.length;a<l;++a){var u=I_(n,e,t[a],i,s[o]);s[o++]=u,e=u[u.length-1]}return s.length=o,s}function C_(n,e,t,i,r,s,o){var a=(t-e)/i;if(a<3){for(;e<t;e+=i)s[o++]=n[e],s[o++]=n[e+1];return o}var l=new Array(a);l[0]=1,l[a-1]=1;for(var u=[e,t-i],c=0;u.length>0;){for(var h=u.pop(),f=u.pop(),d=0,p=n[f],m=n[f+1],g=n[h],v=n[h+1],y=f+i;y<h;y+=i){var x=n[y],_=n[y+1],E=u4(x,_,p,m,g,v);E>d&&(c=y,d=E)}d>r&&(l[(c-e)/i]=1,f+i<c&&u.push(f,c),c+i<h&&u.push(c,h))}for(var y=0;y<a;++y)l[y]&&(s[o++]=n[e+y*i],s[o++]=n[e+y*i+1]);return o}function Z4(n,e,t,i,r,s,o,a){for(var l=0,u=t.length;l<u;++l){var c=t[l];o=C_(n,e,c,i,r,s,o),a.push(o),e=c}return o}function Ma(n,e){return e*Math.round(n/e)}function H4(n,e,t,i,r,s,o){if(e==t)return o;var a=Ma(n[e],r),l=Ma(n[e+1],r);e+=i,s[o++]=a,s[o++]=l;var u,c;do if(u=Ma(n[e],r),c=Ma(n[e+1],r),e+=i,e==t)return s[o++]=u,s[o++]=c,o;while(u==a&&c==l);for(;e<t;){var h=Ma(n[e],r),f=Ma(n[e+1],r);if(e+=i,!(h==u&&f==c)){var d=u-a,p=c-l,m=h-a,g=f-l;if(d*g==p*m&&(d<0&&m<d||d==m||d>0&&m>d)&&(p<0&&g<p||p==g||p>0&&g>p)){u=h,c=f;continue}s[o++]=u,s[o++]=c,a=u,l=c,u=h,c=f}}return s[o++]=u,s[o++]=c,o}function Vb(n,e,t,i,r,s,o,a){for(var l=0,u=t.length;l<u;++l){var c=t[l];o=H4(n,e,c,i,r,s,o),a.push(o),e=c}return o}function K4(n,e,t,i,r,s,o,a){for(var l=0,u=t.length;l<u;++l){var c=t[l],h=[];o=Vb(n,e,c,i,r,s,o,h),a.push(h),e=c[c.length-1]}return o}function Wb(n,e,t,i,r){var s;for(e+=i;e<t;e+=i)if(s=r(n.slice(e-i,e),n.slice(e,e+i)),s)return s;return!1}function ho(n,e,t,i,r){for(var s=r!==void 0?r:[],o=0,a=e;a<t;a+=i)s[o++]=n.slice(a,a+i);return s.length=o,s}function oh(n,e,t,i,r){for(var s=r!==void 0?r:[],o=0,a=0,l=t.length;a<l;++a){var u=t[a];s[o++]=ho(n,e,u,i,s[o]),e=u}return s.length=o,s}function L_(n,e,t,i,r){for(var s=r!==void 0?r:[],o=0,a=0,l=t.length;a<l;++a){var u=t[a];s[o++]=oh(n,e,u,i,s[o]),e=u[u.length-1]}return s.length=o,s}function Lp(n,e,t,i,r,s,o){var a,l,u=(t-e)/i;if(u===1)a=e;else if(u===2)a=e,l=r;else if(u!==0){for(var c=n[e],h=n[e+1],f=0,d=[0],p=e+i;p<t;p+=i){var m=n[p],g=n[p+1];f+=Math.sqrt((m-c)*(m-c)+(g-h)*(g-h)),d.push(f),c=m,h=g}var v=r*f,y=C5(d,v);y<0?(l=(v-d[-y-2])/(d[-y-1]-d[-y-2]),a=e+(-y-2)*i):a=e+y*i}for(var x=o>1?o:2,_=s||new Array(x),p=0;p<x;++p)_[p]=a===void 0?NaN:l===void 0?n[a+p]:ds(n[a+p],n[a+i+p],l);return _}function O_(n,e,t,i,r,s){if(t==e)return null;var o;if(r<n[e+i-1])return s?(o=n.slice(e,e+i),o[i-1]=r,o):null;if(n[t-1]<r)return s?(o=n.slice(t-i,t),o[i-1]=r,o):null;if(r==n[e+i-1])return n.slice(e,e+i);for(var a=e/i,l=t/i;a<l;){var u=a+l>>1;r<n[(u+1)*i-1]?l=u:a=u+1}var c=n[a*i-1];if(r==c)return n.slice((a-1)*i,(a-1)*i+i);var h=n[(a+1)*i-1],f=(r-c)/(h-c);o=[];for(var d=0;d<i-1;++d)o.push(ds(n[(a-1)*i+d],n[a*i+d],f));return o.push(r),o}function q4(n,e,t,i,r,s,o){if(o)return O_(n,e,t[t.length-1],i,r,s);var a;if(r<n[i-1])return s?(a=n.slice(0,i),a[i-1]=r,a):null;if(n[n.length-1]<r)return s?(a=n.slice(n.length-i),a[i-1]=r,a):null;for(var l=0,u=t.length;l<u;++l){var c=t[l];if(e!=c){if(r<n[e+i-1])return null;if(r<=n[c-1])return O_(n,e,c,i,r,!1);e=c}}return null}function J4(n,e,t,i,r){var s=Ib(r,function(o){return!Fa(n,e,t,i,o[0],o[1])});return!s}function Fa(n,e,t,i,r,s){for(var o=0,a=n[t-i],l=n[t-i+1];e<t;e+=i){var u=n[e],c=n[e+1];l<=s?c>s&&(u-a)*(s-l)-(r-a)*(c-l)>0&&o++:c<=s&&(u-a)*(s-l)-(r-a)*(c-l)<0&&o--,a=u,l=c}return o!==0}function A_(n,e,t,i,r,s){if(t.length===0||!Fa(n,e,t[0],i,r,s))return!1;for(var o=1,a=t.length;o<a;++o)if(Fa(n,t[o-1],t[o],i,r,s))return!1;return!0}function Q4(n,e,t,i,r,s){if(t.length===0)return!1;for(var o=0,a=t.length;o<a;++o){var l=t[o];if(A_(n,e,l,i,r,s))return!0;e=l[l.length-1]}return!1}function Op(n,e,t,i,r){var s=bb(kn(),n,e,t,i);return Qt(r,s)?Ql(r,s)||s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Wb(n,e,t,i,function(o,a){return n4(r,o,a)}):!1}function ez(n,e,t,i,r){for(var s=0,o=t.length;s<o;++s){if(Op(n,e,t[s],i,r))return!0;e=t[s]}return!1}function tz(n,e,t,i,r){return!!(Op(n,e,t,i,r)||Fa(n,e,t,i,r[0],r[1])||Fa(n,e,t,i,r[0],r[3])||Fa(n,e,t,i,r[2],r[1])||Fa(n,e,t,i,r[2],r[3]))}function Zb(n,e,t,i,r){if(!tz(n,e,t[0],i,r))return!1;if(t.length===1)return!0;for(var s=1,o=t.length;s<o;++s)if(J4(n,t[s-1],t[s],i,r)&&!Op(n,t[s-1],t[s],i,r))return!1;return!0}function iz(n,e,t,i,r){for(var s=0,o=t.length;s<o;++s){var a=t[s];if(Zb(n,e,a,i,r))return!0;e=a[a.length-1]}return!1}function Hb(n,e,t,i){for(var r=n[e],s=n[e+1],o=0,a=e+i;a<t;a+=i){var l=n[a],u=n[a+1];o+=Math.sqrt((l-r)*(l-r)+(u-s)*(u-s)),r=l,s=u}return o}var nz=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),rz=function(n){nz(e,n);function e(t,i){var r=n.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,i!==void 0&&!Array.isArray(t[0])?r.setFlatCoordinates(i,t):r.setCoordinates(t,i),r}return e.prototype.appendCoordinate=function(t){this.flatCoordinates?us(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,i,r,s){return s<Ia(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(w_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),R_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,i,r,s))},e.prototype.forEachSegment=function(t){return Wb(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,i){if(this.layout!=vt.XYM&&this.layout!=vt.XYZM)return null;var r=i!==void 0?i:!1;return O_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},e.prototype.getCoordinates=function(){return ho(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,i){return Lp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,this.stride)},e.prototype.getLength=function(){return Hb(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=C_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,vt.XY)},e.prototype.getType=function(){return le.LINE_STRING},e.prototype.intersectsExtent=function(t){return Op(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,i){this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Cp(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Pa),Ap=rz,sz=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),oz=function(n){sz(e,n);function e(t,i,r){var s=n.call(this)||this;if(s.ends_=[],s.maxDelta_=-1,s.maxDeltaRevision_=-1,Array.isArray(t[0]))s.setCoordinates(t,i);else if(i!==void 0&&r)s.setFlatCoordinates(i,t),s.ends_=r;else{for(var o=s.getLayout(),a=t,l=[],u=[],c=0,h=a.length;c<h;++c){var f=a[c];c===0&&(o=f.getLayout()),us(l,f.getFlatCoordinates()),u.push(l.length)}s.setFlatCoordinates(o,l),s.ends_=u}return s}return e.prototype.appendLineString=function(t){this.flatCoordinates?us(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,i,r,s){return s<Ia(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(S_(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),b_(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,i,r,s))},e.prototype.getCoordinateAtM=function(t,i,r){if(this.layout!=vt.XYM&&this.layout!=vt.XYZM||this.flatCoordinates.length===0)return null;var s=i!==void 0?i:!1,o=r!==void 0?r:!1;return q4(this.flatCoordinates,0,this.ends_,this.stride,t,s,o)},e.prototype.getCoordinates=function(){return oh(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Ap(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,i=this.ends_,r=this.layout,s=[],o=0,a=0,l=i.length;a<l;++a){var u=i[a],c=new Ap(t.slice(o,u),r);s.push(c),o=u}return s},e.prototype.getFlatMidpoints=function(){for(var t=[],i=this.flatCoordinates,r=0,s=this.ends_,o=this.stride,a=0,l=s.length;a<l;++a){var u=s[a],c=Lp(i,r,u,o,.5);us(t,c),r=u}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=Z4(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,r),new e(i,vt.XY,r)},e.prototype.getType=function(){return le.MULTI_LINE_STRING},e.prototype.intersectsExtent=function(t){return ez(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,i){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=I_(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()},e}(Pa),Kb=oz,az=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),lz=function(n){az(e,n);function e(t,i){var r=n.call(this)||this;return r.setCoordinates(t,i),r}return e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,i,r,s){var o=this.flatCoordinates,a=Ca(t,i,o[0],o[1]);if(a<s){for(var l=this.stride,u=0;u<l;++u)r[u]=o[u];return r.length=l,a}else return s},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return wb(this.flatCoordinates,t)},e.prototype.getType=function(){return le.POINT},e.prototype.intersectsExtent=function(t){return d_(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=V4(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Pa),ah=lz,uz=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),cz=function(n){uz(e,n);function e(t,i){var r=n.call(this)||this;return i&&!Array.isArray(t[0])?r.setFlatCoordinates(i,t):r.setCoordinates(t,i),r}return e.prototype.appendPoint=function(t){this.flatCoordinates?us(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,i,r,s){if(s<Ia(this.getExtent(),t,i))return s;for(var o=this.flatCoordinates,a=this.stride,l=0,u=o.length;l<u;l+=a){var c=Ca(t,i,o[l],o[l+1]);if(c<s){s=c;for(var h=0;h<a;++h)r[h]=o[l+h];r.length=a}}return s},e.prototype.getCoordinates=function(){return ho(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var i=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||i<=t?null:new ah(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,i=this.layout,r=this.stride,s=[],o=0,a=t.length;o<a;o+=r){var l=new ah(t.slice(o,o+r),i);s.push(l)}return s},e.prototype.getType=function(){return le.MULTI_POINT},e.prototype.intersectsExtent=function(t){for(var i=this.flatCoordinates,r=this.stride,s=0,o=i.length;s<o;s+=r){var a=i[s],l=i[s+1];if(d_(t,a,l))return!0}return!1},e.prototype.setCoordinates=function(t,i){this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Cp(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Pa),P_=cz;function qb(n,e,t,i){for(var r=0,s=n[t-i],o=n[t-i+1];e<t;e+=i){var a=n[e],l=n[e+1];r+=o*a-s*l,s=a,o=l}return r/2}function Jb(n,e,t,i){for(var r=0,s=0,o=t.length;s<o;++s){var a=t[s];r+=qb(n,e,a,i),e=a}return r}function hz(n,e,t,i){for(var r=0,s=0,o=t.length;s<o;++s){var a=t[s];r+=Jb(n,e,a,i),e=a[a.length-1]}return r}var fz=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),dz=function(n){fz(e,n);function e(t,i){var r=n.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,i!==void 0&&!Array.isArray(t[0])?r.setFlatCoordinates(i,t):r.setCoordinates(t,i),r}return e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,i,r,s){return s<Ia(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(w_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),R_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,i,r,s))},e.prototype.getArea=function(){return qb(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return ho(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=C_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,vt.XY)},e.prototype.getType=function(){return le.LINEAR_RING},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,i){this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Cp(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Pa),Qb=dz;function M_(n,e,t,i,r,s,o){for(var a,l,u,c,h,f,d,p=r[s+1],m=[],g=0,v=t.length;g<v;++g){var y=t[g];for(c=n[y-i],f=n[y-i+1],a=e;a<y;a+=i)h=n[a],d=n[a+1],(p<=f&&d<=p||f<=p&&p<=d)&&(u=(p-f)/(d-f)*(h-c)+c,m.push(u)),c=h,f=d}var x=NaN,_=-1/0;for(m.sort(ba),c=m[0],a=1,l=m.length;a<l;++a){h=m[a];var E=Math.abs(h-c);E>_&&(u=(c+h)/2,A_(n,e,t,i,u,p)&&(x=u,_=E)),c=h}return isNaN(x)&&(x=r[s]),o?(o.push(x,p,_),o):[x,p,_]}function eI(n,e,t,i,r){for(var s=[],o=0,a=t.length;o<a;++o){var l=t[o];s=M_(n,e,l,i,r,2*o,s),e=l[l.length-1]}return s}function pz(n,e,t,i){for(;e<t-i;){for(var r=0;r<i;++r){var s=n[e+r];n[e+r]=n[t-i+r],n[t-i+r]=s}e+=i,t-=i}}function F_(n,e,t,i){for(var r=0,s=n[t-i],o=n[t-i+1];e<t;e+=i){var a=n[e],l=n[e+1];r+=(a-s)*(l+o),s=a,o=l}return r===0?void 0:r>0}function tI(n,e,t,i,r){for(var s=r!==void 0?r:!1,o=0,a=t.length;o<a;++o){var l=t[o],u=F_(n,e,l,i);if(o===0){if(s&&u||!s&&!u)return!1}else if(s&&!u||!s&&u)return!1;e=l}return!0}function gz(n,e,t,i,r){for(var s=0,o=t.length;s<o;++s){var a=t[s];if(!tI(n,e,a,i,r))return!1;a.length&&(e=a[a.length-1])}return!0}function N_(n,e,t,i,r){for(var s=r!==void 0?r:!1,o=0,a=t.length;o<a;++o){var l=t[o],u=F_(n,e,l,i),c=o===0?s&&u||!s&&!u:s&&!u||!s&&u;c&&pz(n,e,l,i),e=l}return e}function iI(n,e,t,i,r){for(var s=0,o=t.length;s<o;++s)e=N_(n,e,t[s],i,r);return e}function mz(n,e){for(var t=[],i=0,r=0,s=0,o=e.length;s<o;++s){var a=e[s];if(!F_(n,i,a,2))t.push(e.slice(r,s+1));else{if(t.length===0)continue;t[t.length-1].push(e[r])}r=s+1,i=a}return t}var yz=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),_z=function(n){yz(e,n);function e(t,i,r){var s=n.call(this)||this;return s.ends_=[],s.flatInteriorPointRevision_=-1,s.flatInteriorPoint_=null,s.maxDelta_=-1,s.maxDeltaRevision_=-1,s.orientedRevision_=-1,s.orientedFlatCoordinates_=null,i!==void 0&&r?(s.setFlatCoordinates(i,t),s.ends_=r):s.setCoordinates(t,i),s}return e.prototype.appendLinearRing=function(t){this.flatCoordinates?us(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,i,r,s){return s<Ia(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(S_(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),b_(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,i,r,s))},e.prototype.containsXY=function(t,i){return A_(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)},e.prototype.getArea=function(){return Jb(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var i;return t!==void 0?(i=this.getOrientedFlatCoordinates().slice(),N_(i,0,this.ends_,this.stride,t)):i=this.flatCoordinates,oh(i,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=eu(this.getExtent());this.flatInteriorPoint_=M_(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new ah(this.getFlatInteriorPoint(),vt.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new Qb(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,i=this.flatCoordinates,r=this.ends_,s=[],o=0,a=0,l=r.length;a<l;++a){var u=r[a],c=new Qb(i.slice(o,u),t);s.push(c),o=u}return s},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;tI(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=N_(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=Vb(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,r),new e(i,vt.XY,r)},e.prototype.getType=function(){return le.POLYGON},e.prototype.intersectsExtent=function(t){return Zb(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,i){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=I_(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()},e}(Pa),lh=_z;function nI(n,e,t,i){for(var r=[],s=kn(),o=0,a=t.length;o<a;++o){var l=t[o];s=g_(n,e,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=l[l.length-1]}return r}var vz=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),xz=function(n){vz(e,n);function e(t,i,r){var s=n.call(this)||this;if(s.endss_=[],s.flatInteriorPointsRevision_=-1,s.flatInteriorPoints_=null,s.maxDelta_=-1,s.maxDeltaRevision_=-1,s.orientedRevision_=-1,s.orientedFlatCoordinates_=null,!r&&!Array.isArray(t[0])){for(var o=s.getLayout(),a=t,l=[],u=[],c=0,h=a.length;c<h;++c){var f=a[c];c===0&&(o=f.getLayout());for(var d=l.length,p=f.getEnds(),m=0,g=p.length;m<g;++m)p[m]+=d;us(l,f.getFlatCoordinates()),u.push(p)}i=o,t=l,r=u}return i!==void 0&&r?(s.setFlatCoordinates(i,t),s.endss_=r):s.setCoordinates(t,i),s}return e.prototype.appendPolygon=function(t){var i;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),i=t.getEnds().slice(),this.endss_.push();else{var r=this.flatCoordinates.length;us(this.flatCoordinates,t.getFlatCoordinates()),i=t.getEnds().slice();for(var s=0,o=i.length;s<o;++s)i[s]+=r}this.endss_.push(i),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),r=0;r<t;++r)i[r]=this.endss_[r].slice();var s=new e(this.flatCoordinates.slice(),this.layout,i);return s.applyProperties(this),s},e.prototype.closestPointXY=function(t,i,r,s){return s<Ia(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Y4(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),X4(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,i,r,s))},e.prototype.containsXY=function(t,i){return Q4(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,i)},e.prototype.getArea=function(){return hz(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var i;return t!==void 0?(i=this.getOrientedFlatCoordinates().slice(),iI(i,0,this.endss_,this.stride,t)):i=this.flatCoordinates,L_(i,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=nI(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=eI(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new P_(this.getFlatInteriorPoints().slice(),vt.XYM)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;gz(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=iI(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=K4(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,r),new e(i,vt.XY,r)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var i;if(t===0)i=0;else{var r=this.endss_[t-1];i=r[r.length-1]}var s=this.endss_[t].slice(),o=s[s.length-1];if(i!==0)for(var a=0,l=s.length;a<l;++a)s[a]-=i;return new lh(this.flatCoordinates.slice(i,o),this.layout,s)},e.prototype.getPolygons=function(){for(var t=this.layout,i=this.flatCoordinates,r=this.endss_,s=[],o=0,a=0,l=r.length;a<l;++a){var u=r[a].slice(),c=u[u.length-1];if(o!==0)for(var h=0,f=u.length;h<f;++h)u[h]-=o;var d=new lh(i.slice(o,c),t,u);s.push(d),o=c}return s},e.prototype.getType=function(){return le.MULTI_POLYGON},e.prototype.intersectsExtent=function(t){return iz(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,i){this.setLayout(i,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var r=W4(this.flatCoordinates,0,t,this.stride,this.endss_);if(r.length===0)this.flatCoordinates.length=0;else{var s=r[r.length-1];this.flatCoordinates.length=s.length===0?0:s[s.length-1]}this.changed()},e}(Pa),rI=xz,Ez=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Tz=function(n){Ez(e,n);function e(t){var i=this,r=t||{};return i=n.call(this)||this,i.dataProjection=ei(r.dataProjection?r.dataProjection:"EPSG:4326"),r.featureProjection&&(i.defaultFeatureProjection=ei(r.featureProjection)),i.geometryName_=r.geometryName,i.extractGeometryName_=r.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return e.prototype.readFeatureFromObject=function(t,i){var r=null;t.type==="Feature"?r=t:r={type:"Feature",geometry:t,properties:null};var s=$_(r.geometry,i),o=new X5;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&o.setGeometryName(r.geometry_name),o.setGeometry(s),"id"in r&&o.setId(r.id),r.properties&&o.setProperties(r.properties,!0),o},e.prototype.readFeaturesFromObject=function(t,i){var r=t,s=null;if(r.type==="FeatureCollection"){var o=t;s=[];for(var a=o.features,l=0,u=a.length;l<u;++l)s.push(this.readFeatureFromObject(a[l],i))}else s=[this.readFeatureFromObject(t,i)];return s},e.prototype.readGeometryFromObject=function(t,i){return $_(t,i)},e.prototype.readProjectionFromObject=function(t){var i=t.crs,r;return i?i.type=="name"?r=ei(i.properties.name):i.type==="EPSG"?r=ei("EPSG:"+i.properties.code):It(!1,36):r=this.dataProjection,r},e.prototype.writeFeatureObject=function(t,i){i=this.adaptOptions(i);var r={type:"Feature",geometry:null,properties:null},s=t.getId();if(s!==void 0&&(r.id=s),!t.hasProperties())return r;var o=t.getProperties(),a=t.getGeometry();return a&&(r.geometry=D_(a,i),delete o[t.getGeometryName()]),fp(o)||(r.properties=o),r},e.prototype.writeFeaturesObject=function(t,i){i=this.adaptOptions(i);for(var r=[],s=0,o=t.length;s<o;++s)r.push(this.writeFeatureObject(t[s],i));return{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,i){return D_(t,this.adaptOptions(i))},e}(G4);function $_(n,e){if(!n)return null;var t;switch(n.type){case le.POINT:{t=Sz(n);break}case le.LINE_STRING:{t=Rz(n);break}case le.POLYGON:{t=Lz(n);break}case le.MULTI_POINT:{t=Iz(n);break}case le.MULTI_LINE_STRING:{t=bz(n);break}case le.MULTI_POLYGON:{t=Cz(n);break}case le.GEOMETRY_COLLECTION:{t=wz(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return T_(t,!1,e)}function wz(n,e){var t=n.geometries.map(function(i){return $_(i,e)});return new N4(t)}function Sz(n){return new ah(n.coordinates)}function Rz(n){return new Ap(n.coordinates)}function bz(n){return new Kb(n.coordinates)}function Iz(n){return new P_(n.coordinates)}function Cz(n){return new rI(n.coordinates)}function Lz(n){return new lh(n.coordinates)}function D_(n,e){n=T_(n,!0,e);var t=n.getType(),i;switch(t){case le.POINT:{i=Nz(n);break}case le.LINE_STRING:{i=Az(n);break}case le.POLYGON:{i=$z(n,e);break}case le.MULTI_POINT:{i=Mz(n);break}case le.MULTI_LINE_STRING:{i=Pz(n);break}case le.MULTI_POLYGON:{i=Fz(n,e);break}case le.GEOMETRY_COLLECTION:{i=Oz(n,e);break}case le.CIRCLE:{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return i}function Oz(n,e){var t=n.getGeometriesArray().map(function(i){var r=Rn({},e);return delete r.featureProjection,D_(i,r)});return{type:"GeometryCollection",geometries:t}}function Az(n,e){return{type:"LineString",coordinates:n.getCoordinates()}}function Pz(n,e){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function Mz(n,e){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function Fz(n,e){var t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(t)}}function Nz(n,e){return{type:"Point",coordinates:n.getCoordinates()}}function $z(n,e){var t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(t)}}var Dz=Tz,sI=Or(),uh=function(){function n(e,t,i,r,s){this.styleFunction,this.extent_,this.id_=s,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r}return n.prototype.get=function(e){return this.properties_[e]},n.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===le.POINT?wb(this.flatCoordinates_):g_(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},n.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var e=eu(this.getExtent());this.flatInteriorPoints_=M_(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_},n.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var e=nI(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=eI(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_},n.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Lp(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},n.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var e=this.flatCoordinates_,t=0,i=this.ends_,r=0,s=i.length;r<s;++r){var o=i[r],a=Lp(e,t,o,2,.5);us(this.flatMidpoints_,a),t=o}}return this.flatMidpoints_},n.prototype.getId=function(){return this.id_},n.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},n.prototype.getGeometry=function(){return this},n.prototype.getSimplifiedGeometry=function(e){return this},n.prototype.simplifyTransformed=function(e,t){return this},n.prototype.getProperties=function(){return this.properties_},n.prototype.getStride=function(){return 2},n.prototype.getStyleFunction=function(){return this.styleFunction},n.prototype.getType=function(){return this.type_},n.prototype.transform=function(e){e=ei(e);var t=e.getExtent(),i=e.getWorldExtent();if(t&&i){var r=Ar(i)/Ar(t);fs(sI,i[0],i[3],r,-r,0,0,0),co(this.flatCoordinates_,0,this.flatCoordinates_.length,2,sI,this.flatCoordinates_)}},n.prototype.getEnds=function(){return this.ends_},n}();uh.prototype.getEndss=uh.prototype.getEnds,uh.prototype.getFlatCoordinates=uh.prototype.getOrientedFlatCoordinates;var k_=uh,kz=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Gz=function(n){kz(e,n);function e(t){var i=n.call(this)||this,r=t||{};return i.dataProjection=new y_({code:"",units:hs.TILE_PIXELS}),i.featureClass_=r.featureClass?r.featureClass:k_,i.geometryName_=r.geometryName,i.layerName_=r.layerName?r.layerName:"layer",i.layers_=r.layers?r.layers:null,i.idProperty_=r.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return e.prototype.readRawGeometry_=function(t,i,r,s){t.pos=i.geometry;for(var o=t.readVarint()+t.pos,a=1,l=0,u=0,c=0,h=0,f=0;t.pos<o;){if(!l){var d=t.readVarint();a=d&7,l=d>>3}l--,a===1||a===2?(u+=t.readSVarint(),c+=t.readSVarint(),a===1&&h>f&&(s.push(h),f=h),r.push(u,c),h+=2):a===7?h>f&&(r.push(r[f],r[f+1]),h+=2):It(!1,59)}h>f&&(s.push(h),f=h)},e.prototype.createFeature_=function(t,i,r){var s=i.type;if(s===0)return null;var o,a=i.properties,l;this.idProperty_?(l=a[this.idProperty_],delete a[this.idProperty_]):l=i.id,a[this.layerName_]=i.layer.name;var u=[],c=[];this.readRawGeometry_(t,i,u,c);var h=Yz(s,c.length);if(this.featureClass_===k_)o=new this.featureClass_(h,u,c,a,l),o.transform(r.dataProjection);else{var f=void 0;if(h==le.POLYGON){var d=mz(u,c);f=d.length>1?new rI(u,vt.XY,d):new lh(u,vt.XY,c)}else f=h===le.POINT?new ah(u,vt.XY):h===le.LINE_STRING?new Ap(u,vt.XY):h===le.POLYGON?new lh(u,vt.XY,c):h===le.MULTI_POINT?new P_(u,vt.XY):h===le.MULTI_LINE_STRING?new Kb(u,vt.XY,c):null;var p=this.featureClass_;o=new p,this.geometryName_&&o.setGeometryName(this.geometryName_);var m=T_(f,!1,r);o.setGeometry(m),l!==void 0&&o.setId(l),o.setProperties(a,!0)}return o},e.prototype.getType=function(){return Aa.ARRAY_BUFFER},e.prototype.readFeatures=function(t,i){var r=this.layers_,s=this.adaptOptions(i),o=ei(s.dataProjection);o.setWorldExtent(s.extent),s.dataProjection=o;var a=new pS(t),l=a.readFields(Uz,{}),u=[];for(var c in l)if(!(r&&r.indexOf(c)==-1)){var h=l[c],f=h?[0,0,h.extent,h.extent]:null;o.setExtent(f);for(var d=0,p=h.length;d<p;++d){var m=jz(a,h,d),g=this.createFeature_(a,m,s);g!==null&&u.push(g)}}return u},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(jb);function Uz(n,e,t){if(n===3){var i={keys:[],values:[],features:[]},r=t.readVarint()+t.pos;t.readFields(zz,i,r),i.length=i.features.length,i.length&&(e[i.name]=i)}}function zz(n,e,t){if(n===15)e.version=t.readVarint();else if(n===1)e.name=t.readString();else if(n===5)e.extent=t.readVarint();else if(n===2)e.features.push(t.pos);else if(n===3)e.keys.push(t.readString());else if(n===4){for(var i=null,r=t.readVarint()+t.pos;t.pos<r;)n=t.readVarint()>>3,i=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null;e.values.push(i)}}function Bz(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2)for(var i=t.readVarint()+t.pos;t.pos<i;){var r=e.layer.keys[t.readVarint()],s=e.layer.values[t.readVarint()];e.properties[r]=s}else n==3?e.type=t.readVarint():n==4&&(e.geometry=t.pos)}function jz(n,e,t){n.pos=e.features[t];var i=n.readVarint()+n.pos,r={layer:e,type:0,properties:{}};return n.readFields(Bz,r,i),r}function Yz(n,e){var t;return n===1?t=e===1?le.POINT:le.MULTI_POINT:n===2?t=e===1?le.LINE_STRING:le.MULTI_LINE_STRING:n===3&&(t=le.POLYGON),t}var Xz=Gz,Vz=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Wz=/^([a-z]*)$|^hsla?\(.*\)$/i;function oI(n){return typeof n=="string"?n:lI(n)}function Zz(n){var e=document.createElement("div");if(e.style.color=n,e.style.color!==""){document.body.appendChild(e);var t=getComputedStyle(e).color;return document.body.removeChild(e),t}else return""}var Hz=function(){var n=1024,e={},t=0;return function(i){var r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=n){var s=0;for(var o in e)(s++&3)===0&&(delete e[o],--t)}r=Kz(i),e[i]=r,++t}return r}}();function Pp(n){return Array.isArray(n)?n:Hz(n)}function Kz(n){var e,t,i,r,s;if(Wz.exec(n)&&(n=Zz(n)),Vz.exec(n)){var o=n.length-1,a=void 0;o<=4?a=1:a=2;var l=o===4||o===8;e=parseInt(n.substr(1+0*a,a),16),t=parseInt(n.substr(1+1*a,a),16),i=parseInt(n.substr(1+2*a,a),16),l?r=parseInt(n.substr(1+3*a,a),16):r=255,a==1&&(e=(e<<4)+e,t=(t<<4)+t,i=(i<<4)+i,l&&(r=(r<<4)+r)),s=[e,t,i,r/255]}else n.indexOf("rgba(")==0?(s=n.slice(5,-1).split(",").map(Number),aI(s)):n.indexOf("rgb(")==0?(s=n.slice(4,-1).split(",").map(Number),s.push(1),aI(s)):It(!1,14);return s}function aI(n){return n[0]=Pr(n[0]+.5|0,0,255),n[1]=Pr(n[1]+.5|0,0,255),n[2]=Pr(n[2]+.5|0,0,255),n[3]=Pr(n[3],0,1),n}function lI(n){var e=n[0];e!=(e|0)&&(e=e+.5|0);var t=n[1];t!=(t|0)&&(t=t+.5|0);var i=n[2];i!=(i|0)&&(i=i+.5|0);var r=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+e+","+t+","+i+","+r+")"}var qz=function(){function n(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return n.prototype.clear=function(){this.cache_={},this.cacheSize_=0},n.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},n.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var t in this.cache_){var i=this.cache_[t];(e++&3)===0&&!i.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}},n.prototype.get=function(e,t,i){var r=uI(e,t,i);return r in this.cache_?this.cache_[r]:null},n.prototype.set=function(e,t,i,r){var s=uI(e,t,i);this.cache_[s]=r,++this.cacheSize_},n.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},n}();function uI(n,e,t){var i=t?oI(t):"null";return e+":"+n+":"+i}var cI=new qz,mt={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"},Jz=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Qz=function(n){Jz(e,n);function e(t){var i=n.call(this)||this;i.on,i.once,i.un,i.background_=t.background;var r=Rn({},t);return typeof t.properties=="object"&&(delete r.properties,Rn(r,t.properties)),r[mt.OPACITY]=t.opacity!==void 0?t.opacity:1,It(typeof r[mt.OPACITY]=="number",64),r[mt.VISIBLE]=t.visible!==void 0?t.visible:!0,r[mt.Z_INDEX]=t.zIndex,r[mt.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,r[mt.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,r[mt.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,r[mt.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,i.className_=r.className!==void 0?r.className:"ol-layer",delete r.className,i.setProperties(r),i.state_=null,i}return e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var i=this.state_||{layer:this,managed:t===void 0?!0:t},r=this.getZIndex();return i.opacity=Pr(Math.round(this.getOpacity()*100)/100,0,1),i.visible=this.getVisible(),i.extent=this.getExtent(),i.zIndex=r===void 0&&!i.managed?1/0:r,i.maxResolution=this.getMaxResolution(),i.minResolution=Math.max(this.getMinResolution(),0),i.minZoom=this.getMinZoom(),i.maxZoom=this.getMaxZoom(),this.state_=i,i},e.prototype.getLayersArray=function(t){return Re()},e.prototype.getLayerStatesArray=function(t){return Re()},e.prototype.getExtent=function(){return this.get(mt.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(mt.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(mt.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(mt.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(mt.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(mt.OPACITY)},e.prototype.getSourceState=function(){return Re()},e.prototype.getVisible=function(){return this.get(mt.VISIBLE)},e.prototype.getZIndex=function(){return this.get(mt.Z_INDEX)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(mt.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(mt.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(mt.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(mt.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(mt.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){It(typeof t=="number",64),this.set(mt.OPACITY,t)},e.prototype.setVisible=function(t){this.set(mt.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(mt.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),n.prototype.disposeInternal.call(this)},e}(th),eB=Qz,G_={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},su={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"},tB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),iB=function(n){tB(e,n);function e(t){var i=this,r=Rn({},t);delete r.source,i=n.call(this,r)||this,i.on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,i.rendered=!1,t.render&&(i.render=t.render),t.map&&i.setMap(t.map),i.addChangeListener(mt.SOURCE,i.handleSourcePropertyChange_);var s=t.source?t.source:null;return i.setSource(s),i}return e.prototype.getLayersArray=function(t){var i=t||[];return i.push(this),i},e.prototype.getLayerStatesArray=function(t){var i=t||[];return i.push(this.getLayerState()),i},e.prototype.getSource=function(){return this.get(mt.SOURCE)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():su.UNDEFINED},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Lr(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Cr(t,Si.CHANGE,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise(function(i){return i([])})},e.prototype.getData=function(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)},e.prototype.render=function(t,i){var r=this.getRenderer();if(r.prepareFrame(t))return this.rendered=!0,r.renderFrame(t,i)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(mt.MAP,t)},e.prototype.getMapInternal=function(){return this.get(mt.MAP)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Lr(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Lr(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Cr(t,G_.PRECOMPOSE,function(i){var r=i,s=r.frameState.layerStatesArray,o=this.getLayerState(!1);It(!s.some(function(a){return a.layer===o.layer}),67),s.push(o)},this),this.mapRenderKey_=Cr(this,Si.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(mt.SOURCE,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),n.prototype.disposeInternal.call(this)},e}(eB),nB=iB,rB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),sB=function(n){rB(e,n);function e(t,i,r,s){var o=n.call(this,t)||this;return o.inversePixelTransform=i,o.frameState=r,o.context=s,o}return e}(hp),oB=sB,aB=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),hI=["style","variant","weight","size","lineHeight","family"],fI=function(n){var e=n.match(aB);if(!e)return null;for(var t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},i=0,r=hI.length;i<r;++i){var s=e[i+1];s!==void 0&&(t[hI[i]]=s)}return t.families=t.family.split(/,\s?/),t};function dI(n){return n===1?"":String(Math.round(n*100)/100)}function bn(n,e,t,i){var r;return t&&t.length?r=t.shift():pp?r=new OffscreenCanvas(n||300,e||300):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("2d",i)}var pI="10px sans-serif",ps="#000",Mp="round",ch=[],hh=0,ou="round",fh=10,dh="#000",ph="center",Fp="middle",Na=[0,0,0,0],gh=1,fo=new th,U_=new Qc;U_.setSize=function(){console.warn("labelCache is deprecated.")};var au=null,z_,B_={},lB=function(){var n=100,e="32px ",t=["monospace","serif"],i=t.length,r="wmytzilWMYTZIL@#/&?$%10\uF013",s,o;function a(u,c,h){for(var f=!0,d=0;d<i;++d){var p=t[d];if(o=Np(u+" "+c+" "+e+p,r),h!=p){var m=Np(u+" "+c+" "+e+h+","+p,r);f=f&&m!=o}}return!!f}function l(){for(var u=!0,c=fo.getKeys(),h=0,f=c.length;h<f;++h){var d=c[h];fo.get(d)<n&&(a.apply(this,d.split(`
|
128
|
-
`))?(l_(B_),au=null,z_=void 0,fo.set(d,n)):(fo.set(d,fo.get(d)+1,!0),u=!1))}u&&(clearInterval(s),s=void 0)}return function(u){var c=fI(u);if(!!c)for(var h=c.families,f=0,d=h.length;f<d;++f){var p=h[f],m=c.style+`
|
129
|
-
`+c.weight+`
|
130
|
-
`+p;fo.get(m)===void 0&&(fo.set(m,n,!0),a(c.style,c.weight,p)||(fo.set(m,0,!0),s===void 0&&(s=setInterval(l,32))))}}}(),uB=function(){var n;return function(e){var t=B_[e];if(t==null){if(pp){var i=fI(e),r=gI(e,"\u017Dg"),s=isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight);t=s*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=e,document.body.appendChild(n),t=n.offsetHeight,document.body.removeChild(n);B_[e]=t}return t}}();function gI(n,e){return au||(au=bn(1,1)),n!=z_&&(au.font=n,z_=au.font),au.measureText(e)}function Np(n,e){return gI(n,e).width}function mI(n,e,t){if(e in t)return t[e];var i=Np(n,e);return t[e]=i,i}function cB(n,e){for(var t=[],i=[],r=[],s=0,o=0,a=0,l=0,u=0,c=e.length;u<=c;u+=2){var h=e[u];if(h===`
|
131
|
-
`||u===c){s=Math.max(s,o),r.push(o),o=0,a+=l;continue}var f=e[u+1]||n.font,d=Np(f,h);t.push(d),o+=d;var p=uB(f);i.push(p),l=Math.max(l,p)}return{width:s,height:a,widths:t,heights:i,lineWidths:r}}function hB(n,e,t,i,r,s,o,a,l,u,c){n.save(),t!==1&&(n.globalAlpha*=t),e&&n.setTransform.apply(n,e),i.contextInstructions?(n.translate(l,u),n.scale(c[0],c[1]),fB(i,n)):c[0]<0||c[1]<0?(n.translate(l,u),n.scale(c[0],c[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,l,u,o*c[0],a*c[1]),n.restore()}function fB(n,e){for(var t=n.contextInstructions,i=0,r=t.length;i<r;i+=2)Array.isArray(t[i+1])?e[t[i]].apply(e,t[i+1]):e[t[i]]=t[i+1]}var ue={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},Mr={ANIMATING:0,INTERACTING:1},dB=42,yI=256;function pB(n){return Math.pow(n,3)}function gB(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]*e+.5|0,t[1]=n[1]*e+.5|0,t}function en(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}var wt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},mB=function(){function n(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=en(e.scale),this.displacement_=e.displacement}return n.prototype.clone=function(){var e=this.getScale();return new n({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},n.prototype.getOpacity=function(){return this.opacity_},n.prototype.getRotateWithView=function(){return this.rotateWithView_},n.prototype.getRotation=function(){return this.rotation_},n.prototype.getScale=function(){return this.scale_},n.prototype.getScaleArray=function(){return this.scaleArray_},n.prototype.getDisplacement=function(){return this.displacement_},n.prototype.getAnchor=function(){return Re()},n.prototype.getImage=function(e){return Re()},n.prototype.getHitDetectionImage=function(){return Re()},n.prototype.getPixelRatio=function(e){return 1},n.prototype.getImageState=function(){return Re()},n.prototype.getImageSize=function(){return Re()},n.prototype.getOrigin=function(){return Re()},n.prototype.getSize=function(){return Re()},n.prototype.setDisplacement=function(e){this.displacement_=e},n.prototype.setOpacity=function(e){this.opacity_=e},n.prototype.setRotateWithView=function(e){this.rotateWithView_=e},n.prototype.setRotation=function(e){this.rotation_=e},n.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=en(e)},n.prototype.listenImageChange=function(e){Re()},n.prototype.load=function(){Re()},n.prototype.unlistenImageChange=function(e){Re()},n}(),_I=mB;function Fr(n){return Array.isArray(n)?lI(n):n}var yB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),_B=function(n){yB(e,n);function e(t){var i=this,r=t.rotateWithView!==void 0?t.rotateWithView:!1;return i=n.call(this,{opacity:1,rotateWithView:r,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0]})||this,i.canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=t.fill!==void 0?t.fill:null,i.origin_=[0,0],i.points_=t.points,i.radius_=t.radius!==void 0?t.radius:t.radius1,i.radius2_=t.radius2,i.angle_=t.angle!==void 0?t.angle:0,i.stroke_=t.stroke!==void 0?t.stroke:null,i.size_=null,i.renderOptions_=null,i.render(),i}return e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var i=this.getDisplacement();return[t[0]/2-i[0],t[1]/2+i[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var i=this.canvas_[t];if(!i){var r=this.renderOptions_,s=bn(r.size*t,r.size*t);this.draw_(r,s,t),i=s.canvas,this.canvas_[t]=i}return i},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return wt.LOADED},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,i,r){if(i===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return i;var s=this.radius_,o=this.radius2_===void 0?s:this.radius2_;if(s<o){var a=s;s=o,o=a}var l=this.radius2_===void 0?this.points_:this.points_*2,u=2*Math.PI/l,c=o*Math.sin(u),h=Math.sqrt(o*o-c*c),f=s-h,d=Math.sqrt(c*c+f*f),p=d/c;if(t==="miter"&&p<=r)return p*i;var m=i/2/p,g=i/2*(f/d),v=Math.sqrt((s+m)*(s+m)+g*g),y=v-s;if(this.radius2_===void 0||t==="bevel")return y*2;var x=s*Math.sin(u),_=Math.sqrt(s*s-x*x),E=o-_,T=Math.sqrt(x*x+E*E),w=T/x;if(w<=r){var S=w*i/2-o-s;return 2*Math.max(y,S)}return y*2},e.prototype.createRenderOptions=function(){var t=ou,i=0,r=null,s=0,o,a=0;this.stroke_&&(o=this.stroke_.getColor(),o===null&&(o=dh),o=Fr(o),a=this.stroke_.getWidth(),a===void 0&&(a=gh),r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),t=this.stroke_.getLineJoin(),t===void 0&&(t=ou),i=this.stroke_.getMiterLimit(),i===void 0&&(i=fh));var l=this.calculateLineJoinSize_(t,a,i),u=Math.max(this.radius_,this.radius2_||0),c=Math.ceil(2*u+l);return{strokeStyle:o,strokeWidth:a,size:c,lineDash:r,lineDashOffset:s,lineJoin:t,miterLimit:i}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,i,r){if(i.scale(r,r),i.translate(t.size/2,t.size/2),this.createPath_(i),this.fill_){var s=this.fill_.getColor();s===null&&(s=ps),i.fillStyle=Fr(s),i.fill()}this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,i.setLineDash&&t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var i=this.fill_.getColor(),r=0;if(typeof i=="string"&&(i=Pp(i)),i===null?r=1:Array.isArray(i)&&(r=i.length===4?i[3]:1),r===0){var s=bn(t.size,t.size);this.hitDetectionCanvas_=s.canvas,this.drawHitDetectionCanvas_(t,s)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var i=this.points_,r=this.radius_;if(i===1/0)t.arc(0,0,r,0,2*Math.PI);else{var s=this.radius2_===void 0?r:this.radius2_;this.radius2_!==void 0&&(i*=2);for(var o=this.angle_-Math.PI/2,a=2*Math.PI/i,l=0;l<i;l++){var u=o+l*a,c=l%2===0?r:s;t.lineTo(c*Math.cos(u),c*Math.sin(u))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,i){i.translate(t.size/2,t.size/2),this.createPath_(i),i.fillStyle=ps,i.fill(),this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke())},e}(_I),vB=_B,xB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),EB=function(n){xB(e,n);function e(t){var i=t||{};return n.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:i.scale!==void 0?i.scale:1,rotation:i.rotation!==void 0?i.rotation:0,rotateWithView:i.rotateWithView!==void 0?i.rotateWithView:!1,displacement:i.displacement!==void 0?i.displacement:[0,0]})||this}return e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(vB),vI=EB,TB=function(){function n(e){var t=e||{};this.color_=t.color!==void 0?t.color:null}return n.prototype.clone=function(){var e=this.getColor();return new n({color:Array.isArray(e)?e.slice():e||void 0})},n.prototype.getColor=function(){return this.color_},n.prototype.setColor=function(e){this.color_=e},n}(),lu=TB,wB=function(){function n(e){var t=e||{};this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}return n.prototype.clone=function(){var e=this.getColor();return new n({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},n.prototype.getColor=function(){return this.color_},n.prototype.getLineCap=function(){return this.lineCap_},n.prototype.getLineDash=function(){return this.lineDash_},n.prototype.getLineDashOffset=function(){return this.lineDashOffset_},n.prototype.getLineJoin=function(){return this.lineJoin_},n.prototype.getMiterLimit=function(){return this.miterLimit_},n.prototype.getWidth=function(){return this.width_},n.prototype.setColor=function(e){this.color_=e},n.prototype.setLineCap=function(e){this.lineCap_=e},n.prototype.setLineDash=function(e){this.lineDash_=e},n.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e},n.prototype.setLineJoin=function(e){this.lineJoin_=e},n.prototype.setMiterLimit=function(e){this.miterLimit_=e},n.prototype.setWidth=function(e){this.width_=e},n}(),mh=wB,$a=function(){function n(e){var t=e||{};this.geometry_=null,this.geometryFunction_=xI,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}return n.prototype.clone=function(){var e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new n({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},n.prototype.getRenderer=function(){return this.renderer_},n.prototype.setRenderer=function(e){this.renderer_=e},n.prototype.setHitDetectionRenderer=function(e){this.hitDetectionRenderer_=e},n.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},n.prototype.getGeometry=function(){return this.geometry_},n.prototype.getGeometryFunction=function(){return this.geometryFunction_},n.prototype.getFill=function(){return this.fill_},n.prototype.setFill=function(e){this.fill_=e},n.prototype.getImage=function(){return this.image_},n.prototype.setImage=function(e){this.image_=e},n.prototype.getStroke=function(){return this.stroke_},n.prototype.setStroke=function(e){this.stroke_=e},n.prototype.getText=function(){return this.text_},n.prototype.setText=function(e){this.text_=e},n.prototype.getZIndex=function(){return this.zIndex_},n.prototype.setGeometry=function(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=xI,this.geometry_=e},n.prototype.setZIndex=function(e){this.zIndex_=e},n}();function SB(n){var e;if(typeof n=="function")e=n;else{var t;if(Array.isArray(n))t=n;else{It(typeof n.getZIndex=="function",41);var i=n;t=[i]}e=function(){return t}}return e}var j_=null;function RB(n,e){if(!j_){var t=new lu({color:"rgba(255,255,255,0.4)"}),i=new mh({color:"#3399CC",width:1.25});j_=[new $a({image:new vI({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return j_}function xI(n){return n.getGeometry()}var bB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),EI={RENDER_ORDER:"renderOrder"},IB=function(n){bB(e,n);function e(t){var i=this,r=t||{},s=Rn({},r);return delete s.style,delete s.renderBuffer,delete s.updateWhileAnimating,delete s.updateWhileInteracting,i=n.call(this,s)||this,i.declutter_=r.declutter!==void 0?r.declutter:!1,i.renderBuffer_=r.renderBuffer!==void 0?r.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(r.style),i.updateWhileAnimating_=r.updateWhileAnimating!==void 0?r.updateWhileAnimating:!1,i.updateWhileInteracting_=r.updateWhileInteracting!==void 0?r.updateWhileInteracting:!1,i}return e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(t){return n.prototype.getFeatures.call(this,t)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(EI.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new dd(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(EI.RENDER_ORDER,t)},e.prototype.setStyle=function(t){this.style_=t!==void 0?t:RB,this.styleFunction_=t===null?void 0:SB(this.style_),this.changed()},e}(nB),TI=IB,yh={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},$p=[yh.FILL],po=[yh.STROKE],Da=[yh.BEGIN_PATH],wI=[yh.CLOSE_PATH],we=yh,CB=function(){function n(){}return n.prototype.drawCustom=function(e,t,i,r){},n.prototype.drawGeometry=function(e){},n.prototype.setStyle=function(e){},n.prototype.drawCircle=function(e,t){},n.prototype.drawFeature=function(e,t){},n.prototype.drawGeometryCollection=function(e,t){},n.prototype.drawLineString=function(e,t){},n.prototype.drawMultiLineString=function(e,t){},n.prototype.drawMultiPoint=function(e,t){},n.prototype.drawMultiPolygon=function(e,t){},n.prototype.drawPoint=function(e,t){},n.prototype.drawPolygon=function(e,t){},n.prototype.drawText=function(e,t){},n.prototype.setFillStrokeStyle=function(e,t){},n.prototype.setImageStyle=function(e,t){},n.prototype.setTextStyle=function(e,t){},n}(),SI=CB,LB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),OB=function(n){LB(e,n);function e(t,i,r,s){var o=n.call(this)||this;return o.tolerance=t,o.maxExtent=i,o.pixelRatio=s,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return e.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return i==1?t:t.map(function(r){return r*i})},e.prototype.appendFlatPointCoordinates=function(t,i){for(var r=this.getBufferedMaxExtent(),s=this.tmpCoordinate_,o=this.coordinates,a=o.length,l=0,u=t.length;l<u;l+=i)s[0]=t[l],s[1]=t[l+1],nh(r,s)&&(o[a++]=s[0],o[a++]=s[1]);return a},e.prototype.appendFlatLineCoordinates=function(t,i,r,s,o,a){var l=this.coordinates,u=l.length,c=this.getBufferedMaxExtent();a&&(i+=s);var h=t[i],f=t[i+1],d=this.tmpCoordinate_,p=!0,m,g,v;for(m=i+s;m<r;m+=s)d[0]=t[m],d[1]=t[m+1],v=p_(c,d),v!==g?(p&&(l[u++]=h,l[u++]=f,p=!1),l[u++]=d[0],l[u++]=d[1]):v===Ri.INTERSECTING?(l[u++]=d[0],l[u++]=d[1],p=!1):p=!0,h=d[0],f=d[1],g=v;return(o&&p||m===i+s)&&(l[u++]=h,l[u++]=f),u},e.prototype.drawCustomCoordinates_=function(t,i,r,s,o){for(var a=0,l=r.length;a<l;++a){var u=r[a],c=this.appendFlatLineCoordinates(t,i,u,s,!1,!1);o.push(c),i=u}return i},e.prototype.drawCustom=function(t,i,r,s){this.beginGeometry(t,i);var o=t.getType(),a=t.getStride(),l=this.coordinates.length,u,c,h,f,d;switch(o){case le.MULTI_POLYGON:u=t.getOrientedFlatCoordinates(),f=[];var p=t.getEndss();d=0;for(var m=0,g=p.length;m<g;++m){var v=[];d=this.drawCustomCoordinates_(u,d,p[m],a,v),f.push(v)}this.instructions.push([we.CUSTOM,l,f,t,r,L_]),this.hitDetectionInstructions.push([we.CUSTOM,l,f,t,s||r,L_]);break;case le.POLYGON:case le.MULTI_LINE_STRING:h=[],u=o==le.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),d=this.drawCustomCoordinates_(u,0,t.getEnds(),a,h),this.instructions.push([we.CUSTOM,l,h,t,r,oh]),this.hitDetectionInstructions.push([we.CUSTOM,l,h,t,s||r,oh]);break;case le.LINE_STRING:case le.CIRCLE:u=t.getFlatCoordinates(),c=this.appendFlatLineCoordinates(u,0,u.length,a,!1,!1),this.instructions.push([we.CUSTOM,l,c,t,r,ho]),this.hitDetectionInstructions.push([we.CUSTOM,l,c,t,s||r,ho]);break;case le.MULTI_POINT:u=t.getFlatCoordinates(),c=this.appendFlatPointCoordinates(u,a),c>l&&(this.instructions.push([we.CUSTOM,l,c,t,r,ho]),this.hitDetectionInstructions.push([we.CUSTOM,l,c,t,s||r,ho]));break;case le.POINT:u=t.getFlatCoordinates(),this.coordinates.push(u[0],u[1]),c=this.coordinates.length,this.instructions.push([we.CUSTOM,l,c,t,r]),this.hitDetectionInstructions.push([we.CUSTOM,l,c,t,s||r]);break}this.endGeometry(i)},e.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[we.BEGIN_GEOMETRY,i,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[we.BEGIN_GEOMETRY,i,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var i,r=t.length,s,o,a=-1;for(i=0;i<r;++i)s=t[i],o=s[0],o==we.END_GEOMETRY?a=i:o==we.BEGIN_GEOMETRY&&(s[2]=i,O5(this.hitDetectionInstructions,a,i),a=-1)},e.prototype.setFillStrokeStyle=function(t,i){var r=this.state;if(t){var s=t.getColor();r.fillStyle=Fr(s||ps)}else r.fillStyle=void 0;if(i){var o=i.getColor();r.strokeStyle=Fr(o||dh);var a=i.getLineCap();r.lineCap=a!==void 0?a:Mp;var l=i.getLineDash();r.lineDash=l?l.slice():ch;var u=i.getLineDashOffset();r.lineDashOffset=u||hh;var c=i.getLineJoin();r.lineJoin=c!==void 0?c:ou;var h=i.getWidth();r.lineWidth=h!==void 0?h:gh;var f=i.getMiterLimit();r.miterLimit=f!==void 0?f:fh,r.lineWidth>this.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var i=t.fillStyle,r=[we.SET_FILL_STYLE,i];return typeof i!="string"&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[we.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,i){var r=t.fillStyle;(typeof r!="string"||t.currentFillStyle!=r)&&(r!==void 0&&this.instructions.push(i.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,i){var r=t.strokeStyle,s=t.lineCap,o=t.lineDash,a=t.lineDashOffset,l=t.lineJoin,u=t.lineWidth,c=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=s||o!=t.currentLineDash&&!Kl(t.currentLineDash,o)||t.currentLineDashOffset!=a||t.currentLineJoin!=l||t.currentLineWidth!=u||t.currentMiterLimit!=c)&&(r!==void 0&&i.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=s,t.currentLineDash=o,t.currentLineDashOffset=a,t.currentLineJoin=l,t.currentLineWidth=u,t.currentMiterLimit=c)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[we.END_GEOMETRY,t];this.instructions.push(i),this.hitDetectionInstructions.push(i)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=J5(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;ao(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(SI),_h=OB,AB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),PB=function(n){AB(e,n);function e(t,i,r,s){var o=n.call(this,t,i,r,s)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return e.prototype.drawPoint=function(t,i){if(!!this.image_){this.beginGeometry(t,i);var r=t.getFlatCoordinates(),s=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(r,s);this.instructions.push([we.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([we.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(i)}},e.prototype.drawMultiPoint=function(t,i){if(!!this.image_){this.beginGeometry(t,i);var r=t.getFlatCoordinates(),s=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(r,s);this.instructions.push([we.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([we.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(i)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,n.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,i){var r=t.getAnchor(),s=t.getSize(),o=t.getHitDetectionImage(),a=t.getImage(this.pixelRatio),l=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=o,this.image_=a,this.height_=s[1],this.opacity_=t.getOpacity(),this.originX_=l[0]*this.imagePixelRatio_,this.originY_=l[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=s[0],this.declutterImageWithText_=i},e}(_h),MB=PB,FB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),NB=function(n){FB(e,n);function e(t,i,r,s){return n.call(this,t,i,r,s)||this}return e.prototype.drawFlatCoordinates_=function(t,i,r,s){var o=this.coordinates.length,a=this.appendFlatLineCoordinates(t,i,r,s,!1,!1),l=[we.MOVE_TO_LINE_TO,o,a];return this.instructions.push(l),this.hitDetectionInstructions.push(l),r},e.prototype.drawLineString=function(t,i){var r=this.state,s=r.strokeStyle,o=r.lineWidth;if(!(s===void 0||o===void 0)){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([we.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ch,hh],Da);var a=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(po),this.endGeometry(i)}},e.prototype.drawMultiLineString=function(t,i){var r=this.state,s=r.strokeStyle,o=r.lineWidth;if(!(s===void 0||o===void 0)){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([we.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Da);for(var a=t.getEnds(),l=t.getFlatCoordinates(),u=t.getStride(),c=0,h=0,f=a.length;h<f;++h)c=this.drawFlatCoordinates_(l,c,a[h],u);this.hitDetectionInstructions.push(po),this.endGeometry(i)}},e.prototype.finish=function(){var t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(po),this.reverseHitDetectionInstructions(),this.state=null,n.prototype.finish.call(this)},e.prototype.applyStroke=function(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(po),t.lastStroke=this.coordinates.length),t.lastStroke=0,n.prototype.applyStroke.call(this,t),this.instructions.push(Da)},e}(_h),$B=NB,DB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),kB=function(n){DB(e,n);function e(t,i,r,s){return n.call(this,t,i,r,s)||this}return e.prototype.drawFlatCoordinatess_=function(t,i,r,s){var o=this.state,a=o.fillStyle!==void 0,l=o.strokeStyle!==void 0,u=r.length;this.instructions.push(Da),this.hitDetectionInstructions.push(Da);for(var c=0;c<u;++c){var h=r[c],f=this.coordinates.length,d=this.appendFlatLineCoordinates(t,i,h,s,!0,!l),p=[we.MOVE_TO_LINE_TO,f,d];this.instructions.push(p),this.hitDetectionInstructions.push(p),l&&(this.instructions.push(wI),this.hitDetectionInstructions.push(wI)),i=h}return a&&(this.instructions.push($p),this.hitDetectionInstructions.push($p)),l&&(this.instructions.push(po),this.hitDetectionInstructions.push(po)),i},e.prototype.drawCircle=function(t,i){var r=this.state,s=r.fillStyle,o=r.strokeStyle;if(!(s===void 0&&o===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([we.SET_FILL_STYLE,ps]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([we.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var a=t.getFlatCoordinates(),l=t.getStride(),u=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,l,!1,!1);var c=[we.CIRCLE,u];this.instructions.push(Da,c),this.hitDetectionInstructions.push(Da,c),r.fillStyle!==void 0&&(this.instructions.push($p),this.hitDetectionInstructions.push($p)),r.strokeStyle!==void 0&&(this.instructions.push(po),this.hitDetectionInstructions.push(po)),this.endGeometry(i)}},e.prototype.drawPolygon=function(t,i){var r=this.state,s=r.fillStyle,o=r.strokeStyle;if(!(s===void 0&&o===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([we.SET_FILL_STYLE,ps]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([we.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var a=t.getEnds(),l=t.getOrientedFlatCoordinates(),u=t.getStride();this.drawFlatCoordinatess_(l,0,a,u),this.endGeometry(i)}},e.prototype.drawMultiPolygon=function(t,i){var r=this.state,s=r.fillStyle,o=r.strokeStyle;if(!(s===void 0&&o===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([we.SET_FILL_STYLE,ps]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([we.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var a=t.getEndss(),l=t.getOrientedFlatCoordinates(),u=t.getStride(),c=0,h=0,f=a.length;h<f;++h)c=this.drawFlatCoordinatess_(l,c,a[h],u);this.endGeometry(i)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(t!==0)for(var i=this.coordinates,r=0,s=i.length;r<s;++r)i[r]=Ma(i[r],t);return n.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state,i=t.fillStyle;i!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)},e}(_h),RI=kB,bI={POINT:"point",LINE:"line"};function GB(n,e,t,i,r){var s=t,o=t,a=0,l=0,u=t,c,h,f,d,p,m,g,v,y,x;for(h=t;h<i;h+=r){var _=e[h],E=e[h+1];p!==void 0&&(y=_-p,x=E-m,d=Math.sqrt(y*y+x*x),g!==void 0&&(l+=f,c=Math.acos((g*y+v*x)/(f*d)),c>n&&(l>a&&(a=l,s=u,o=h),l=0,u=h-r)),f=d,g=y,v=x),p=_,m=E}return l+=d,l>a?[u,h]:[s,o]}var UB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Dp={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},zB=function(n){UB(e,n);function e(t,i,r,s){var o=n.call(this,t,i,r,s)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return e.prototype.finish=function(){var t=n.prototype.finish.call(this);return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t},e.prototype.drawText=function(t,i){var r=this.textFillState_,s=this.textStrokeState_,o=this.textState_;if(!(this.text_===""||!o||!r&&!s)){var a=this.coordinates,l=a.length,u=t.getType(),c=null,h=t.getStride();if(o.placement===bI.LINE&&(u==le.LINE_STRING||u==le.MULTI_LINE_STRING||u==le.POLYGON||u==le.MULTI_POLYGON)){if(!Qt(this.getBufferedMaxExtent(),t.getExtent()))return;var f=void 0;if(c=t.getFlatCoordinates(),u==le.LINE_STRING)f=[c.length];else if(u==le.MULTI_LINE_STRING)f=t.getEnds();else if(u==le.POLYGON)f=t.getEnds().slice(0,1);else if(u==le.MULTI_POLYGON){var d=t.getEndss();f=[];for(var p=0,m=d.length;p<m;++p)f.push(d[p][0])}this.beginGeometry(t,i);for(var g=o.textAlign,v=0,y=void 0,x=0,_=f.length;x<_;++x){if(g==null){var E=GB(o.maxAngle,c,v,f[x],h);v=E[0],y=E[1]}else y=f[x];for(var p=v;p<y;p+=h)a.push(c[p],c[p+1]);var T=a.length;v=f[x],this.drawChars_(l,T),l=T}this.endGeometry(i)}else{var w=o.overflow?null:[];switch(u){case le.POINT:case le.MULTI_POINT:c=t.getFlatCoordinates();break;case le.LINE_STRING:c=t.getFlatMidpoint();break;case le.CIRCLE:c=t.getCenter();break;case le.MULTI_LINE_STRING:c=t.getFlatMidpoints(),h=2;break;case le.POLYGON:c=t.getFlatInteriorPoint(),o.overflow||w.push(c[2]/this.resolution),h=3;break;case le.MULTI_POLYGON:var S=t.getFlatInteriorPoints();c=[];for(var p=0,m=S.length;p<m;p+=3)o.overflow||w.push(S[p+2]/this.resolution),c.push(S[p],S[p+1]);if(c.length===0)return;h=2;break}var T=this.appendFlatPointCoordinates(c,h);if(T===l)return;if(w&&(T-l)/2!==c.length/h){var R=l/2;w=w.filter(function(U,G){var $=a[(R+G)*2]===c[G*h]&&a[(R+G)*2+1]===c[G*h+1];return $||--R,$})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,i);var b=o.padding;if(b!=Na&&(o.scale[0]<0||o.scale[1]<0)){var I=o.padding[0],O=o.padding[1],P=o.padding[2],B=o.padding[3];o.scale[0]<0&&(O=-O,B=-B),o.scale[1]<0&&(I=-I,P=-P),b=[I,O,P,B]}var A=this.pixelRatio;this.instructions.push([we.DRAW_IMAGE,l,T,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,b==Na?Na:b.map(function(U){return U*A}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]);var L=1/A;this.hitDetectionInstructions.push([we.DRAW_IMAGE,l,T,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[L,L],NaN,this.declutterImageWithText_,b,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]),this.endGeometry(i)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,i=this.textState_,r=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var o=this.textKey_;o in this.textStates||(this.textStates[o]={font:i.font,textAlign:i.textAlign||ph,textBaseline:i.textBaseline||Fp,scale:i.scale});var a=this.fillKey_;r&&(a in this.fillStates||(this.fillStates[a]={fillStyle:r.fillStyle}))},e.prototype.drawChars_=function(t,i){var r=this.textStrokeState_,s=this.textState_,o=this.strokeKey_,a=this.textKey_,l=this.fillKey_;this.saveTextStates_();var u=this.pixelRatio,c=Dp[s.textBaseline],h=this.textOffsetY_*u,f=this.text_,d=r?r.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([we.DRAW_CHARS,t,i,c,s.overflow,l,s.maxAngle,u,h,o,d*u,f,a,1]),this.hitDetectionInstructions.push([we.DRAW_CHARS,t,i,c,s.overflow,l,s.maxAngle,1,h,o,d,f,a,1/u])},e.prototype.setTextStyle=function(t,i){var r,s,o;if(!t)this.text_="";else{var a=t.getFill();a?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=Fr(a.getColor()||ps)):(s=null,this.textFillState_=s);var l=t.getStroke();if(!l)o=null,this.textStrokeState_=o;else{o=this.textStrokeState_,o||(o={},this.textStrokeState_=o);var u=l.getLineDash(),c=l.getLineDashOffset(),h=l.getWidth(),f=l.getMiterLimit();o.lineCap=l.getLineCap()||Mp,o.lineDash=u?u.slice():ch,o.lineDashOffset=c===void 0?hh:c,o.lineJoin=l.getLineJoin()||ou,o.lineWidth=h===void 0?gh:h,o.miterLimit=f===void 0?fh:f,o.strokeStyle=Fr(l.getColor()||dh)}r=this.textState_;var d=t.getFont()||pI;lB(d);var p=t.getScaleArray();r.overflow=t.getOverflow(),r.font=d,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.textBaseline=t.getTextBaseline()||Fp,r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||Na,r.scale=p===void 0?[1,1]:p;var m=t.getOffsetX(),g=t.getOffsetY(),v=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=m===void 0?0:m,this.textOffsetY_=g===void 0?0:g,this.textRotateWithView_=v===void 0?!1:v,this.textRotation_=y===void 0?0:y,this.strokeKey_=o?(typeof o.strokeStyle=="string"?o.strokeStyle:gt(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.textBaseline||"?"),this.fillKey_=s?typeof s.fillStyle=="string"?s.fillStyle:"|"+gt(s.fillStyle):""}this.declutterImageWithText_=i},e}(_h),BB=zB,jB={Circle:RI,Default:_h,Image:MB,LineString:$B,Polygon:RI,Text:BB},YB=function(){function n(e,t,i,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}return n.prototype.finish=function(){var e={};for(var t in this.buildersByZIndex_){e[t]=e[t]||{};var i=this.buildersByZIndex_[t];for(var r in i){var s=i[r].finish();e[t][r]=s}}return e},n.prototype.getBuilder=function(e,t){var i=e!==void 0?e.toString():"0",r=this.buildersByZIndex_[i];r===void 0&&(r={},this.buildersByZIndex_[i]=r);var s=r[t];if(s===void 0){var o=jB[t];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=s}return s},n}(),kp=YB,XB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),VB=function(n){XB(e,n);function e(t){var i=n.call(this)||this;return i.ready=!0,i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=t,i.declutterExecutorGroup=null,i}return e.prototype.getFeatures=function(t){return Re()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return Re()},e.prototype.renderFrame=function(t,i){return Re()},e.prototype.loadedTileCallback=function(t,i,r){t[i]||(t[i]={}),t[i][r.tileCoord.toString()]=r},e.prototype.createLoadedTileFinder=function(t,i,r){return function(s,o){var a=this.loadedTileCallback.bind(this,r,s);return t.forEachLoadedTile(i,s,o,a)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,i,r,s,o){},e.prototype.getDataAtPixel=function(t,i,r){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){var i=t.target;i.getState()===wt.LOADED&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var i=t.getState();return i!=wt.LOADED&&i!=wt.ERROR&&t.addEventListener(Si.CHANGE,this.boundHandleImageChange_),i==wt.IDLE&&(t.load(),i=t.getState()),i==wt.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==su.READY&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,n.prototype.disposeInternal.call(this)},e}(eh),WB=VB,ZB=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),vh=null;function HB(){var n=document.createElement("canvas");n.width=1,n.height=1,vh=n.getContext("2d")}var KB=function(n){ZB(e,n);function e(t){var i=n.call(this,t)||this;return i.container=null,i.renderedResolution,i.tempTransform=Or(),i.pixelTransform=Or(),i.inversePixelTransform=Or(),i.context=null,i.containerReused=!1,i.pixelContext_=null,i.frameState=null,i}return e.prototype.getImageData=function(t,i,r){vh||HB(),vh.clearRect(0,0,1,1);var s;try{vh.drawImage(t,i,r,1,1,0,0,1,1),s=vh.getImageData(0,0,1,1).data}catch{return null}return s},e.prototype.getBackground=function(t){var i=this.getLayer(),r=i.getBackground();return typeof r=="function"&&(r=r(t.viewState.resolution)),r||void 0},e.prototype.useContainer=function(t,i,r,s){var o=this.getLayer().getClassName(),a,l;if(t&&t.className===o&&t.style.opacity===""&&r===1&&(!s||t.style.backgroundColor&&Kl(Pp(t.style.backgroundColor),Pp(s)))){var u=t.firstElementChild;u instanceof HTMLCanvasElement&&(l=u.getContext("2d"))}if(l&&l.canvas.style.transform===i?(this.container=t,this.context=l,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){a=document.createElement("div"),a.className=o;var c=a.style;c.position="absolute",c.width="100%",c.height="100%",s&&(c.backgroundColor=s),l=bn();var u=l.canvas;a.appendChild(u),c=u.style,c.position="absolute",c.left="0",c.transformOrigin="top left",this.container=a,this.context=l}},e.prototype.clipUnrotated=function(t,i,r){var s=uo(r),o=vp(r),a=_p(r),l=yp(r);mi(i.coordinateToPixelTransform,s),mi(i.coordinateToPixelTransform,o),mi(i.coordinateToPixelTransform,a),mi(i.coordinateToPixelTransform,l);var u=this.inversePixelTransform;mi(u,s),mi(u,o),mi(u,a),mi(u,l),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(l[0]),Math.round(l[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,i,r){var s=this.getLayer();if(s.hasListener(t)){var o=new oB(t,this.inversePixelTransform,r,i);s.dispatchEvent(o)}},e.prototype.preRender=function(t,i){this.frameState=i,this.dispatchRenderEvent_(G_.PRERENDER,t,i)},e.prototype.postRender=function(t,i){this.dispatchRenderEvent_(G_.POSTRENDER,t,i)},e.prototype.getRenderTransform=function(t,i,r,s,o,a,l){var u=o/2,c=a/2,h=s/i,f=-h,d=-t[0]+l,p=-t[1];return fs(this.tempTransform,u,c,h,f,-r,d,p)},e.prototype.getDataAtPixel=function(t,i,r){var s=mi(this.inversePixelTransform,t.slice()),o=this.context,a=this.getLayer(),l=a.getExtent();if(l){var u=mi(i.pixelToCoordinateTransform,t.slice());if(!nh(l,u))return null}var c=Math.round(s[0]),h=Math.round(s[1]),f=this.pixelContext_;if(!f){var d=document.createElement("canvas");d.width=1,d.height=1,f=d.getContext("2d"),this.pixelContext_=f}f.clearRect(0,0,1,1);var p;try{f.drawImage(o.canvas,c,h,1,1,0,0,1,1),p=f.getImageData(0,0,1,1).data}catch(m){return m.name==="SecurityError"?(this.pixelContext_=null,new Uint8Array):p}return p[3]===0?null:p},e.prototype.disposeInternal=function(){delete this.frameState,n.prototype.disposeInternal.call(this)},e}(WB),II=KB,Be={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function qB(n,e,t,i,r,s,o,a,l,u,c,h){var f=n[e],d=n[e+1],p=0,m=0,g=0,v=0;function y(){p=f,m=d,e+=i,f=n[e],d=n[e+1],v+=g,g=Math.sqrt((f-p)*(f-p)+(d-m)*(d-m))}do y();while(e<t-i&&v+g<s);for(var x=g===0?0:(s-v)/g,_=ds(p,f,x),E=ds(m,d,x),T=e-i,w=v,S=s+a*l(u,r,c);e<t-i&&v+g<S;)y();x=g===0?0:(S-v)/g;var R=ds(p,f,x),b=ds(m,d,x),I;if(h){var O=[_,E,R,b];Gb(O,0,4,2,h,O,O),I=O[0]>O[2]}else I=_>R;var P=Math.PI,B=[],A=T+i===e;e=T,g=0,v=w,f=n[e],d=n[e+1];var L;if(A){y(),L=Math.atan2(d-m,f-p),I&&(L+=L>0?-P:P);var D=(R+_)/2,U=(b+E)/2;return B[0]=[D,U,(S-s)/2,L,r],B}for(var G=0,$=r.length;G<$;){y();var k=Math.atan2(d-m,f-p);if(I&&(k+=k>0?-P:P),L!==void 0){var C=k-L;if(C+=C>P?-2*P:C<-P?2*P:0,Math.abs(C)>o)return null}L=k;for(var Z=G,z=0;G<$;++G){var j=I?$-G-1:G,V=a*l(u,r[j],c);if(e+i<t&&v+g<s+z+V/2)break;z+=V}if(G!==Z){var te=I?r.substring($-Z,$-G):r.substring(Z,G);x=g===0?0:(s+z/2-v)/g;var D=ds(p,f,x),U=ds(m,d,x);B.push([D,U,z/2,k,te]),s+=z}}return B}var uu=kn(),go=[],gs=[],ms=[],mo=[];function CI(n){return n[3].declutterBox}var JB=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function LI(n,e){return(e==="start"||e==="end")&&!JB.test(n)&&(e=e==="start"?"left":"right"),Dp[e]}function QB(n,e,t){return t>0&&n.push(`
|
132
|
-
`,""),n.push(e,""),n}var ej=function(){function n(e,t,i,r){this.overlaps=i,this.pixelRatio=t,this.resolution=e,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=Or(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}return n.prototype.createLabel=function(e,t,i,r){var s=e+t+i+r;if(this.labels_[s])return this.labels_[s];var o=r?this.strokeStates[r]:null,a=i?this.fillStates[i]:null,l=this.textStates[t],u=this.pixelRatio,c=[l.scale[0]*u,l.scale[1]*u],h=Array.isArray(e),f=LI(h?e[0]:e,l.textAlign||ph),d=r&&o.lineWidth?o.lineWidth:0,p=h?e:e.split(`
|
133
|
-
`).reduce(QB,[]),m=cB(l,p),g=m.width,v=m.height,y=m.widths,x=m.heights,_=m.lineWidths,E=g+d,T=[],w=(E+2)*c[0],S=(v+d)*c[1],R={width:w<0?Math.floor(w):Math.ceil(w),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:T};if((c[0]!=1||c[1]!=1)&&T.push("scale",c),r){T.push("strokeStyle",o.strokeStyle),T.push("lineWidth",d),T.push("lineCap",o.lineCap),T.push("lineJoin",o.lineJoin),T.push("miterLimit",o.miterLimit);var b=pp?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;b.prototype.setLineDash&&(T.push("setLineDash",[o.lineDash]),T.push("lineDashOffset",o.lineDashOffset))}i&&T.push("fillStyle",a.fillStyle),T.push("textBaseline","middle"),T.push("textAlign","center");for(var I=.5-f,O=f*E+I*d,P=[],B=[],A=0,L=0,D=0,U=0,G,$=0,k=p.length;$<k;$+=2){var C=p[$];if(C===`
|
134
|
-
`){L+=A,A=0,O=f*E+I*d,++U;continue}var Z=p[$+1]||l.font;Z!==G&&(r&&P.push("font",Z),i&&B.push("font",Z),G=Z),A=Math.max(A,x[D]);var z=[C,O+I*y[D]+f*(y[D]-_[U]),.5*(d+A)+L];O+=y[D],r&&P.push("strokeText",z),i&&B.push("fillText",z),++D}return Array.prototype.push.apply(T,P),Array.prototype.push.apply(T,B),this.labels_[s]=R,R},n.prototype.replayTextBackground_=function(e,t,i,r,s,o,a){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,s),e.lineTo.apply(e,t),o&&(this.alignFill_=o[2],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())},n.prototype.calculateImageOrLabelDimensions_=function(e,t,i,r,s,o,a,l,u,c,h,f,d,p,m,g){a*=f[0],l*=f[1];var v=i-a,y=r-l,x=s+u>e?e-u:s,_=o+c>t?t-c:o,E=p[3]+x*f[0]+p[1],T=p[0]+_*f[1]+p[2],w=v-p[3],S=y-p[0];(m||h!==0)&&(go[0]=w,mo[0]=w,go[1]=S,gs[1]=S,gs[0]=w+E,ms[0]=gs[0],ms[1]=S+T,mo[1]=ms[1]);var R;return h!==0?(R=fs(Or(),i,r,1,1,h,-i,-r),mi(R,go),mi(R,gs),mi(R,ms),mi(R,mo),lo(Math.min(go[0],gs[0],ms[0],mo[0]),Math.min(go[1],gs[1],ms[1],mo[1]),Math.max(go[0],gs[0],ms[0],mo[0]),Math.max(go[1],gs[1],ms[1],mo[1]),uu)):lo(Math.min(w,w+E),Math.min(S,S+T),Math.max(w,w+E),Math.max(S,S+T),uu),d&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:_,originX:u,originY:c,declutterBox:{minX:uu[0],minY:uu[1],maxX:uu[2],maxY:uu[3],value:g},canvasTransform:R,scale:f}},n.prototype.replayImageOrLabel_=function(e,t,i,r,s,o,a){var l=!!(o||a),u=r.declutterBox,c=e.canvas,h=a?a[2]*r.scale[0]/2:0,f=u.minX-h<=c.width/t&&u.maxX+h>=0&&u.minY-h<=c.height/t&&u.maxY+h>=0;return f&&(l&&this.replayTextBackground_(e,go,gs,ms,mo,o,a),hB(e,r.canvasTransform,s,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},n.prototype.fill_=function(e){if(this.alignFill_){var t=mi(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;e.save(),e.translate(t[0]%i,t[1]%i),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()},n.prototype.setStrokeStyle_=function(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.setLineDash&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))},n.prototype.drawLabelWithPointPlacement_=function(e,t,i,r){var s=this.textStates[t],o=this.createLabel(e,t,r,i),a=this.strokeStates[i],l=this.pixelRatio,u=LI(Array.isArray(e)?e[0]:e,s.textAlign||ph),c=Dp[s.textBaseline||Fp],h=a&&a.lineWidth?a.lineWidth:0,f=o.width/l-2*s.scale[0],d=u*f+2*(.5-u)*h,p=c*o.height/l+2*(.5-c)*h;return{label:o,anchorX:d,anchorY:p}},n.prototype.execute_=function(e,t,i,r,s,o,a,l){var u;this.pixelCoordinates_&&Kl(i,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=co(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),W5(this.renderedTransform_,i));for(var c=0,h=r.length,f=0,d,p,m,g,v,y,x,_,E,T,w,S,R=0,b=0,I=null,O=null,P=this.coordinateCache_,B=this.viewRotation_,A=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,L={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:B},D=this.instructions!=r||this.overlaps?0:200,U,G,$,k;c<h;){var C=r[c],Z=C[0];switch(Z){case we.BEGIN_GEOMETRY:U=C[1],k=C[3],U.getGeometry()?a!==void 0&&!Qt(a,k.getExtent())?c=C[2]+1:++c:c=C[2];break;case we.BEGIN_PATH:R>D&&(this.fill_(e),R=0),b>D&&(e.stroke(),b=0),!R&&!b&&(e.beginPath(),g=NaN,v=NaN),++c;break;case we.CIRCLE:f=C[1];var z=u[f],j=u[f+1],V=u[f+2],te=u[f+3],J=V-z,X=te-j,Se=Math.sqrt(J*J+X*X);e.moveTo(z+Se,j),e.arc(z,j,Se,0,2*Math.PI,!0),++c;break;case we.CLOSE_PATH:e.closePath(),++c;break;case we.CUSTOM:f=C[1],d=C[2];var _e=C[3],be=C[4],ht=C.length==6?C[5]:void 0;L.geometry=_e,L.feature=U,c in P||(P[c]=[]);var Ce=P[c];ht?ht(u,f,d,2,Ce):(Ce[0]=u[f],Ce[1]=u[f+1],Ce.length=2),be(Ce,L),++c;break;case we.DRAW_IMAGE:f=C[1],d=C[2],_=C[3],p=C[4],m=C[5];var De=C[6],Xe=C[7],Mt=C[8],Ut=C[9],Q=C[10],Ft=C[11],zt=C[12],Rt=C[13],nt=C[14];if(!_&&C.length>=19){E=C[18],T=C[19],w=C[20],S=C[21];var Zt=this.drawLabelWithPointPlacement_(E,T,w,S);_=Zt.label,C[3]=_;var Bt=C[22];p=(Zt.anchorX-Bt)*this.pixelRatio,C[4]=p;var Yi=C[23];m=(Zt.anchorY-Yi)*this.pixelRatio,C[5]=m,De=_.height,C[6]=De,Rt=_.width,C[13]=Rt}var Li=void 0;C.length>24&&(Li=C[24]);var ai=void 0,Nt=void 0,Ze=void 0;C.length>16?(ai=C[15],Nt=C[16],Ze=C[17]):(ai=Na,Nt=!1,Ze=!1),Q&&A?Ft+=B:!Q&&!A&&(Ft-=B);for(var bt=0;f<d;f+=2)if(!(Li&&Li[bt++]<Rt/this.pixelRatio)){var Ht=this.calculateImageOrLabelDimensions_(_.width,_.height,u[f],u[f+1],Rt,De,p,m,Mt,Ut,Ft,zt,s,ai,Nt||Ze,U),Kt=[e,t,_,Ht,Xe,Nt?I:null,Ze?O:null],Ct=void 0,nn=void 0;if(l&&nt){var Xi=d-f;if(!nt[Xi]){nt[Xi]=Kt;continue}if(Ct=nt[Xi],delete nt[Xi],nn=CI(Ct),l.collides(nn))continue}l&&l.collides(Ht.declutterBox)||(Ct&&(l&&l.insert(nn),this.replayImageOrLabel_.apply(this,Ct)),l&&l.insert(Ht.declutterBox),this.replayImageOrLabel_.apply(this,Kt))}++c;break;case we.DRAW_CHARS:var Cs=C[1],Vi=C[2],rn=C[3],Yr=C[4];S=C[5];var sn=C[6],Yn=C[7],fr=C[8];w=C[9];var jt=C[10];E=C[11],T=C[12];var Di=[C[13],C[13]],vi=this.textStates[T],li=vi.font,$t=[vi.scale[0]*Yn,vi.scale[1]*Yn],on=void 0;li in this.widths_?on=this.widths_[li]:(on={},this.widths_[li]=on);var Xn=Hb(u,Cs,Vi,2),ui=Math.abs($t[0])*mI(li,E,on);if(Yr||ui<=Xn){var ki=this.textStates[T].textAlign,En=(Xn-ui)*Dp[ki],Xr=qB(u,Cs,Vi,2,E,En,sn,Math.abs($t[0]),mI,li,on,A?0:this.viewRotation_);e:if(Xr){var Ls=[],xi=void 0,Vn=void 0,No=void 0,Ei=void 0,Gi=void 0;if(w)for(xi=0,Vn=Xr.length;xi<Vn;++xi){Gi=Xr[xi],No=Gi[4],Ei=this.createLabel(No,T,"",w),p=Gi[2]+($t[0]<0?-jt:jt),m=rn*Ei.height+(.5-rn)*2*jt*$t[1]/$t[0]-fr;var Ht=this.calculateImageOrLabelDimensions_(Ei.width,Ei.height,Gi[0],Gi[1],Ei.width,Ei.height,p,m,0,0,Gi[3],Di,!1,Na,!1,U);if(l&&l.collides(Ht.declutterBox))break e;Ls.push([e,t,Ei,Ht,1,null,null])}if(S)for(xi=0,Vn=Xr.length;xi<Vn;++xi){Gi=Xr[xi],No=Gi[4],Ei=this.createLabel(No,T,S,""),p=Gi[2],m=rn*Ei.height-fr;var Ht=this.calculateImageOrLabelDimensions_(Ei.width,Ei.height,Gi[0],Gi[1],Ei.width,Ei.height,p,m,0,0,Gi[3],Di,!1,Na,!1,U);if(l&&l.collides(Ht.declutterBox))break e;Ls.push([e,t,Ei,Ht,1,null,null])}l&&l.load(Ls.map(CI));for(var $o=0,ff=Ls.length;$o<ff;++$o)this.replayImageOrLabel_.apply(this,Ls[$o])}}++c;break;case we.END_GEOMETRY:if(o!==void 0){U=C[1];var ii=o(U,k);if(ii)return ii}++c;break;case we.FILL:D?R++:this.fill_(e),++c;break;case we.MOVE_TO_LINE_TO:for(f=C[1],d=C[2],G=u[f],$=u[f+1],y=G+.5|0,x=$+.5|0,(y!==g||x!==v)&&(e.moveTo(G,$),g=y,v=x),f+=2;f<d;f+=2)G=u[f],$=u[f+1],y=G+.5|0,x=$+.5|0,(f==d-2||y!==g||x!==v)&&(e.lineTo(G,$),g=y,v=x);++c;break;case we.SET_FILL_STYLE:I=C,this.alignFill_=C[2],R&&(this.fill_(e),R=0,b&&(e.stroke(),b=0)),e.fillStyle=C[1],++c;break;case we.SET_STROKE_STYLE:O=C,b&&(e.stroke(),b=0),this.setStrokeStyle_(e,C),++c;break;case we.STROKE:D?b++:e.stroke(),++c;break;default:++c;break}}R&&this.fill_(e),b&&e.stroke()},n.prototype.execute=function(e,t,i,r,s,o){this.viewRotation_=r,this.execute_(e,t,i,this.instructions,s,void 0,void 0,o)},n.prototype.executeHitDetection=function(e,t,i,r,s){return this.viewRotation_=i,this.execute_(e,1,t,this.hitDetectionInstructions,!0,r,s)},n}(),tj=ej,Y_=[Be.POLYGON,Be.CIRCLE,Be.LINE_STRING,Be.IMAGE,Be.TEXT,Be.DEFAULT],ij=function(){function n(e,t,i,r,s,o){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=t,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Or(),this.createExecutors_(s)}return n.prototype.clip=function(e,t){var i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()},n.prototype.createExecutors_=function(e){for(var t in e){var i=this.executorsByZIndex_[t];i===void 0&&(i={},this.executorsByZIndex_[t]=i);var r=e[t];for(var s in r){var o=r[s];i[s]=new tj(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},n.prototype.hasExecutors=function(e){for(var t in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[t],r=0,s=e.length;r<s;++r)if(e[r]in i)return!0;return!1},n.prototype.forEachFeatureAtCoordinate=function(e,t,i,r,s,o){r=Math.round(r);var a=r*2+1,l=fs(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),u=!this.hitDetectionContext_;u&&(this.hitDetectionContext_=bn(a,a));var c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):u||c.clearRect(0,0,a,a);var h;this.renderBuffer_!==void 0&&(h=kn(),rh(h,e),ao(h,t*(this.renderBuffer_+r),h));var f=nj(r),d;function p(T,w){for(var S=c.getImageData(0,0,a,a).data,R=0,b=f.length;R<b;R++)if(S[f[R]]>0){if(!o||d!==Be.IMAGE&&d!==Be.TEXT||o.indexOf(T)!==-1){var I=(f[R]-3)/4,O=r-I%a,P=r-(I/a|0),B=s(T,w,O*O+P*P);if(B)return B}c.clearRect(0,0,a,a);break}}var m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(ba);var g,v,y,x,_;for(g=m.length-1;g>=0;--g){var E=m[g].toString();for(y=this.executorsByZIndex_[E],v=Y_.length-1;v>=0;--v)if(d=Y_[v],x=y[d],x!==void 0&&(_=x.executeHitDetection(c,l,i,p,h),_))return _}},n.prototype.getClipCoords=function(e){var t=this.maxExtent_;if(!t)return null;var i=t[0],r=t[1],s=t[2],o=t[3],a=[i,r,i,o,s,o,s,r];return co(a,0,8,2,e,a),a},n.prototype.isEmpty=function(){return fp(this.executorsByZIndex_)},n.prototype.execute=function(e,t,i,r,s,o,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(ba),this.maxExtent_&&(e.save(),this.clip(e,i));var u=o||Y_,c,h,f,d,p,m;for(a&&l.reverse(),c=0,h=l.length;c<h;++c){var g=l[c].toString();for(p=this.executorsByZIndex_[g],f=0,d=u.length;f<d;++f){var v=u[f];m=p[v],m!==void 0&&m.execute(e,t,i,r,s,a)}}this.maxExtent_&&e.restore()},n}(),X_={};function nj(n){if(X_[n]!==void 0)return X_[n];for(var e=n*2+1,t=n*n,i=new Array(t+1),r=0;r<=n;++r)for(var s=0;s<=n;++s){var o=r*r+s*s;if(o>t)break;var a=i[o];a||(a=[],i[o]=a),a.push(((n+r)*e+(n+s))*4+3),r>0&&a.push(((n-r)*e+(n+s))*4+3),s>0&&(a.push(((n+r)*e+(n-s))*4+3),r>0&&a.push(((n-r)*e+(n-s))*4+3))}for(var l=[],r=0,u=i.length;r<u;++r)i[r]&&l.push.apply(l,i[r]);return X_[n]=l,l}var Gp=ij,rj=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),sj=function(n){rj(e,n);function e(t,i,r,s,o,a,l){var u=n.call(this)||this;return u.context_=t,u.pixelRatio_=i,u.extent_=r,u.transform_=s,u.viewRotation_=o,u.squaredTolerance_=a,u.userTransform_=l,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=[0,0],u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=[0,0],u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=Or(),u}return e.prototype.drawImages_=function(t,i,r,s){if(!!this.image_){var o=co(t,i,r,s,this.transform_,this.pixelCoordinates_),a=this.context_,l=this.tmpLocalTransform_,u=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=u*this.imageOpacity_);var c=this.imageRotation_;this.imageRotateWithView_&&(c+=this.viewRotation_);for(var h=0,f=o.length;h<f;h+=2){var d=o[h]-this.imageAnchorX_,p=o[h+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){var m=d+this.imageAnchorX_,g=p+this.imageAnchorY_;fs(l,m,g,1,1,c,-m,-g),a.setTransform.apply(a,l),a.translate(m,g),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.setTransform(1,0,0,1,0,0)}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,p,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=u)}},e.prototype.drawText_=function(t,i,r,s){if(!(!this.textState_||this.text_==="")){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=co(t,i,r,s,this.transform_,this.pixelCoordinates_),a=this.context_,l=this.textRotation_;for(this.textRotateWithView_&&(l+=this.viewRotation_);i<r;i+=s){var u=o[i]+this.textOffsetX_,c=o[i+1]+this.textOffsetY_;if(l!==0||this.textScale_[0]!=1||this.textScale_[1]!=1){var h=fs(this.tmpLocalTransform_,u,c,1,1,l,-u,-c);a.setTransform.apply(a,h),a.translate(u,c),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&a.strokeText(this.text_,u,c),this.textFillState_&&a.fillText(this.text_,u,c)}}},e.prototype.moveToLineTo_=function(t,i,r,s,o){var a=this.context_,l=co(t,i,r,s,this.transform_,this.pixelCoordinates_);a.moveTo(l[0],l[1]);var u=l.length;o&&(u-=2);for(var c=2;c<u;c+=2)a.lineTo(l[c],l[c+1]);return o&&a.closePath(),r},e.prototype.drawRings_=function(t,i,r,s){for(var o=0,a=r.length;o<a;++o)i=this.moveToLineTo_(t,i,r[o],s,!0);return i},e.prototype.drawCircle=function(t){if(!!Qt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=j4(t,this.transform_,this.pixelCoordinates_),r=i[2]-i[0],s=i[3]-i[1],o=Math.sqrt(r*r+s*s),a=this.context_;a.beginPath(),a.arc(i[0],i[1],o,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){var i=t.getType();switch(i){case le.POINT:this.drawPoint(t);break;case le.LINE_STRING:this.drawLineString(t);break;case le.POLYGON:this.drawPolygon(t);break;case le.MULTI_POINT:this.drawMultiPoint(t);break;case le.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case le.MULTI_POLYGON:this.drawMultiPolygon(t);break;case le.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case le.CIRCLE:this.drawCircle(t);break}},e.prototype.drawFeature=function(t,i){var r=i.getGeometryFunction()(t);!r||!Qt(this.extent_,r.getExtent())||(this.setStyle(i),this.drawGeometry(r))},e.prototype.drawGeometryCollection=function(t){for(var i=t.getGeometriesArray(),r=0,s=i.length;r<s;++r)this.drawGeometry(i[r])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var i=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(i,0,i.length,r),this.text_!==""&&this.drawText_(i,0,i.length,r)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var i=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(i,0,i.length,r),this.text_!==""&&this.drawText_(i,0,i.length,r)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Qt(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,r=t.getFlatCoordinates();i.beginPath(),this.moveToLineTo_(r,0,r.length,t.getStride(),!1),i.stroke()}if(this.text_!==""){var s=t.getFlatMidpoint();this.drawText_(s,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var i=t.getExtent();if(!!Qt(this.extent_,i)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,s=t.getFlatCoordinates(),o=0,a=t.getEnds(),l=t.getStride();r.beginPath();for(var u=0,c=a.length;u<c;++u)o=this.moveToLineTo_(s,o,a[u],l,!1);r.stroke()}if(this.text_!==""){var h=t.getFlatMidpoints();this.drawText_(h,0,h.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Qt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=this.context_;i.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&i.fill(),this.strokeState_&&i.stroke()}if(this.text_!==""){var r=t.getFlatInteriorPoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Qt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=this.context_,r=t.getOrientedFlatCoordinates(),s=0,o=t.getEndss(),a=t.getStride();i.beginPath();for(var l=0,u=o.length;l<u;++l){var c=o[l];s=this.drawRings_(r,s,c,a)}this.fillState_&&i.fill(),this.strokeState_&&i.stroke()}if(this.text_!==""){var h=t.getFlatInteriorPoints();this.drawText_(h,0,h.length,2)}}},e.prototype.setContextFillState_=function(t){var i=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.fillStyle=t.fillStyle,i.fillStyle=t.fillStyle):(i.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var i=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,i.lineCap=t.lineCap),i.setLineDash&&(Kl(r.lineDash,t.lineDash)||i.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,i.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,i.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,i.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,i.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.strokeStyle=t.strokeStyle,i.strokeStyle=t.strokeStyle)):(i.lineCap=t.lineCap,i.setLineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineJoin=t.lineJoin,i.lineWidth=t.lineWidth,i.miterLimit=t.miterLimit,i.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var i=this.context_,r=this.contextTextState_,s=t.textAlign?t.textAlign:ph;r?(r.font!=t.font&&(r.font=t.font,i.font=t.font),r.textAlign!=s&&(r.textAlign=s,i.textAlign=s),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,i.textBaseline=t.textBaseline)):(i.font=t.font,i.textAlign=s,i.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:s,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,i){var r=this;if(!t)this.fillState_=null;else{var s=t.getColor();this.fillState_={fillStyle:Fr(s||ps)}}if(!i)this.strokeState_=null;else{var o=i.getColor(),a=i.getLineCap(),l=i.getLineDash(),u=i.getLineDashOffset(),c=i.getLineJoin(),h=i.getWidth(),f=i.getMiterLimit(),d=l||ch;this.strokeState_={lineCap:a!==void 0?a:Mp,lineDash:this.pixelRatio_===1?d:d.map(function(p){return p*r.pixelRatio_}),lineDashOffset:(u||hh)*this.pixelRatio_,lineJoin:c!==void 0?c:ou,lineWidth:(h!==void 0?h:gh)*this.pixelRatio_,miterLimit:f!==void 0?f:fh,strokeStyle:Fr(o||dh)}}},e.prototype.setImageStyle=function(t){var i;if(!t||!(i=t.getSize())){this.image_=null;return}var r=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*this.pixelRatio_,this.imageAnchorY_=r[1]*this.pixelRatio_,this.imageHeight_=i[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=i[0]*this.pixelRatio_},e.prototype.setTextStyle=function(t){if(!t)this.text_="";else{var i=t.getFill();if(!i)this.textFillState_=null;else{var r=i.getColor();this.textFillState_={fillStyle:Fr(r||ps)}}var s=t.getStroke();if(!s)this.textStrokeState_=null;else{var o=s.getColor(),a=s.getLineCap(),l=s.getLineDash(),u=s.getLineDashOffset(),c=s.getLineJoin(),h=s.getWidth(),f=s.getMiterLimit();this.textStrokeState_={lineCap:a!==void 0?a:Mp,lineDash:l||ch,lineDashOffset:u||hh,lineJoin:c!==void 0?c:ou,lineWidth:h!==void 0?h:gh,miterLimit:f!==void 0?f:fh,strokeStyle:Fr(o||dh)}}var d=t.getFont(),p=t.getOffsetX(),m=t.getOffsetY(),g=t.getRotateWithView(),v=t.getRotation(),y=t.getScaleArray(),x=t.getText(),_=t.getTextAlign(),E=t.getTextBaseline();this.textState_={font:d!==void 0?d:pI,textAlign:_!==void 0?_:ph,textBaseline:E!==void 0?E:Fp},this.text_=x!==void 0?Array.isArray(x)?x.reduce(function(T,w,S){return T+=S%2?" ":w},""):x:"",this.textOffsetX_=p!==void 0?this.pixelRatio_*p:0,this.textOffsetY_=m!==void 0?this.pixelRatio_*m:0,this.textRotateWithView_=g!==void 0?g:!1,this.textRotation_=v!==void 0?v:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}},e}(SI),oj=sj,yo={FRACTION:"fraction",PIXELS:"pixels"},Gn={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},aj=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),lj=function(n){aj(e,n);function e(t,i,r,s){var o=n.call(this)||this;return o.extent=t,o.pixelRatio_=r,o.resolution=i,o.state=s,o}return e.prototype.changed=function(){this.dispatchEvent(Si.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Re()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){Re()},e}(Qc),uj=lj,cj=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();(function(n){cj(e,n);function e(t,i,r,s,o,a){var l=n.call(this,t,i,r,wt.IDLE)||this;return l.src_=s,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.state=wt.IDLE,l.imageLoadFunction_=a,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=wt.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Ar(this.extent)/this.image_.height),this.state=wt.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==wt.IDLE||this.state==wt.ERROR)&&(this.state=wt.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=V_(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Ar(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(uj);function V_(n,e,t){var i=n,r=!0,s=!1,o=!1,a=[dp(i,Si.LOAD,function(){o=!0,s||e()})];return i.src&&V5?(s=!0,i.decode().then(function(){r&&e()}).catch(function(l){r&&(o?e():t())})):a.push(dp(i,Si.ERROR,t)),function(){r=!1,a.forEach(Lr)}}var hj=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),xh=null,fj=function(n){hj(e,n);function e(t,i,r,s,o,a){var l=n.call(this)||this;return l.hitDetectionImage_=null,l.image_=t||new Image,s!==null&&(l.image_.crossOrigin=s),l.canvas_={},l.color_=a,l.unlisten_=null,l.imageState_=o,l.size_=r,l.src_=i,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===wt.LOADED){xh||(xh=bn(1,1)),xh.drawImage(this.image_,0,0);try{xh.getImageData(0,0,1,1),this.tainted_=!1}catch{xh=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Si.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=wt.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=wt.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],i=this.size_[1],r=bn(t,i);r.fillRect(0,0,t,i),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==wt.IDLE){this.imageState_=wt.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=V_(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(!(!this.color_||this.canvas_[t]||this.imageState_!==wt.LOADED)){var i=document.createElement("canvas");this.canvas_[t]=i,i.width=Math.ceil(this.image_.width*t),i.height=Math.ceil(this.image_.height*t);var r=i.getContext("2d");if(r.scale(t,t),r.drawImage(this.image_,0,0),r.globalCompositeOperation="multiply",r.globalCompositeOperation==="multiply"||this.isTainted_())r.fillStyle=oI(this.color_),r.fillRect(0,0,i.width/t,i.height/t),r.globalCompositeOperation="destination-in",r.drawImage(this.image_,0,0);else{for(var s=r.getImageData(0,0,i.width,i.height),o=s.data,a=this.color_[0]/255,l=this.color_[1]/255,u=this.color_[2]/255,c=this.color_[3],h=0,f=o.length;h<f;h+=4)o[h]*=a,o[h+1]*=l,o[h+2]*=u,o[h+3]*=c;r.putImageData(s,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Qc);function dj(n,e,t,i,r,s){var o=cI.get(e,i,s);return o||(o=new fj(n,e,t,i,r,s),cI.set(e,i,s,o)),o}var pj=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),gj=function(n){pj(e,n);function e(t){var i=this,r=t||{},s=r.opacity!==void 0?r.opacity:1,o=r.rotation!==void 0?r.rotation:0,a=r.scale!==void 0?r.scale:1,l=r.rotateWithView!==void 0?r.rotateWithView:!1;i=n.call(this,{opacity:s,rotation:o,scale:a,displacement:r.displacement!==void 0?r.displacement:[0,0],rotateWithView:l})||this,i.anchor_=r.anchor!==void 0?r.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=r.anchorOrigin!==void 0?r.anchorOrigin:Gn.TOP_LEFT,i.anchorXUnits_=r.anchorXUnits!==void 0?r.anchorXUnits:yo.FRACTION,i.anchorYUnits_=r.anchorYUnits!==void 0?r.anchorYUnits:yo.FRACTION,i.crossOrigin_=r.crossOrigin!==void 0?r.crossOrigin:null;var u=r.img!==void 0?r.img:null;i.imgSize_=r.imgSize;var c=r.src;It(!(c!==void 0&&u),4),It(!u||u&&i.imgSize_,5),(c===void 0||c.length===0)&&u&&(c=u.src||gt(u)),It(c!==void 0&&c.length>0,6);var h=r.src!==void 0?wt.IDLE:wt.LOADED;return i.color_=r.color!==void 0?Pp(r.color):null,i.iconImage_=dj(u,c,i.imgSize_!==void 0?i.imgSize_:null,i.crossOrigin_,h,i.color_),i.offset_=r.offset!==void 0?r.offset:[0,0],i.offsetOrigin_=r.offsetOrigin!==void 0?r.offsetOrigin:Gn.TOP_LEFT,i.origin_=null,i.size_=r.size!==void 0?r.size:null,i}return e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var i=this.getSize();if(this.anchorXUnits_==yo.FRACTION||this.anchorYUnits_==yo.FRACTION){if(!i)return null;t=this.anchor_.slice(),this.anchorXUnits_==yo.FRACTION&&(t[0]*=i[0]),this.anchorYUnits_==yo.FRACTION&&(t[1]*=i[1])}if(this.anchorOrigin_!=Gn.TOP_LEFT){if(!i)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_==Gn.TOP_RIGHT||this.anchorOrigin_==Gn.BOTTOM_RIGHT)&&(t[0]=-t[0]+i[0]),(this.anchorOrigin_==Gn.BOTTOM_LEFT||this.anchorOrigin_==Gn.BOTTOM_RIGHT)&&(t[1]=-t[1]+i[1])}this.normalizedAnchor_=t}var r=this.getDisplacement();return[t[0]-r[0],t[1]+r[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Gn.TOP_LEFT){var i=this.getSize(),r=this.iconImage_.getSize();if(!i||!r)return null;t=t.slice(),(this.offsetOrigin_==Gn.TOP_RIGHT||this.offsetOrigin_==Gn.BOTTOM_RIGHT)&&(t[0]=r[0]-i[0]-t[0]),(this.offsetOrigin_==Gn.BOTTOM_LEFT||this.offsetOrigin_==Gn.BOTTOM_RIGHT)&&(t[1]=r[1]-i[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Si.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Si.CHANGE,t)},e}(_I),OI=gj,mj="#333",yj=function(){function n(e){var t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=en(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new lu({color:mj}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:bI.POINT,this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}return n.prototype.clone=function(){var e=this.getScale();return new n({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},n.prototype.getOverflow=function(){return this.overflow_},n.prototype.getFont=function(){return this.font_},n.prototype.getMaxAngle=function(){return this.maxAngle_},n.prototype.getPlacement=function(){return this.placement_},n.prototype.getOffsetX=function(){return this.offsetX_},n.prototype.getOffsetY=function(){return this.offsetY_},n.prototype.getFill=function(){return this.fill_},n.prototype.getRotateWithView=function(){return this.rotateWithView_},n.prototype.getRotation=function(){return this.rotation_},n.prototype.getScale=function(){return this.scale_},n.prototype.getScaleArray=function(){return this.scaleArray_},n.prototype.getStroke=function(){return this.stroke_},n.prototype.getText=function(){return this.text_},n.prototype.getTextAlign=function(){return this.textAlign_},n.prototype.getTextBaseline=function(){return this.textBaseline_},n.prototype.getBackgroundFill=function(){return this.backgroundFill_},n.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},n.prototype.getPadding=function(){return this.padding_},n.prototype.setOverflow=function(e){this.overflow_=e},n.prototype.setFont=function(e){this.font_=e},n.prototype.setMaxAngle=function(e){this.maxAngle_=e},n.prototype.setOffsetX=function(e){this.offsetX_=e},n.prototype.setOffsetY=function(e){this.offsetY_=e},n.prototype.setPlacement=function(e){this.placement_=e},n.prototype.setRotateWithView=function(e){this.rotateWithView_=e},n.prototype.setFill=function(e){this.fill_=e},n.prototype.setRotation=function(e){this.rotation_=e},n.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=en(e!==void 0?e:1)},n.prototype.setStroke=function(e){this.stroke_=e},n.prototype.setText=function(e){this.text_=e},n.prototype.setTextAlign=function(e){this.textAlign_=e},n.prototype.setTextBaseline=function(e){this.textBaseline_=e},n.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},n.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},n.prototype.setPadding=function(e){this.padding_=e},n}(),_j=yj,In=.5;function AI(n,e,t,i,r,s,o){var a=n[0]*In,l=n[1]*In,u=bn(a,l);u.imageSmoothingEnabled=!1;for(var c=u.canvas,h=new oj(u,In,r,null,o),f=t.length,d=Math.floor((256*256*256-1)/f),p={},m=1;m<=f;++m){var g=t[m-1],v=g.getStyleFunction()||i;if(!!i){var y=v(g,s);if(!!y){Array.isArray(y)||(y=[y]);for(var x=m*d,_="#"+("000000"+x.toString(16)).slice(-6),E=0,T=y.length;E<T;++E){var w=y[E],S=w.getGeometryFunction()(g);if(!(!S||!Qt(r,S.getExtent()))){var R=w.clone(),b=R.getFill();b&&b.setColor(_);var I=R.getStroke();I&&(I.setColor(_),I.setLineDash(null)),R.setText(void 0);var O=w.getImage();if(O&&O.getOpacity()!==0){var P=O.getImageSize();if(!P)continue;var B=bn(P[0],P[1],void 0,{alpha:!1}),A=B.canvas;B.fillStyle=_,B.fillRect(0,0,A.width,A.height),R.setImage(new OI({img:A,imgSize:P,anchor:O.getAnchor(),anchorXUnits:yo.PIXELS,anchorYUnits:yo.PIXELS,offset:O.getOrigin(),opacity:1,size:O.getSize(),scale:O.getScale(),rotation:O.getRotation(),rotateWithView:O.getRotateWithView()}))}var L=R.getZIndex()||0,D=p[L];D||(D={},p[L]=D,D[le.POLYGON]=[],D[le.CIRCLE]=[],D[le.LINE_STRING]=[],D[le.POINT]=[]),D[S.getType().replace("Multi","")].push(S,R)}}}}}for(var U=Object.keys(p).map(Number).sort(ba),m=0,G=U.length;m<G;++m){var D=p[U[m]];for(var $ in D)for(var k=D[$],E=0,T=k.length;E<T;E+=2){h.setStyle(k[E+1]);for(var C=0,Z=e.length;C<Z;++C)h.setTransform(e[C]),h.drawGeometry(k[E])}}return u.getImageData(0,0,c.width,c.height)}function PI(n,e,t){var i=[];if(t){var r=Math.floor(Math.round(n[0])*In),s=Math.floor(Math.round(n[1])*In),o=(Pr(r,0,t.width-1)+Pr(s,0,t.height-1)*t.width)*4,a=t.data[o],l=t.data[o+1],u=t.data[o+2],c=u+256*(l+256*a),h=Math.floor((256*256*256-1)/e.length);c&&c%h===0&&i.push(e[c/h-1])}return i}var vj=.5,MI={Point:Ij,LineString:Sj,Polygon:Lj,MultiPoint:Cj,MultiLineString:Rj,MultiPolygon:bj,GeometryCollection:wj,Circle:Ej};function xj(n,e){return parseInt(gt(n),10)-parseInt(gt(e),10)}function FI(n,e){var t=W_(n,e);return t*t}function W_(n,e){return vj*n/e}function Ej(n,e,t,i,r){var s=t.getFill(),o=t.getStroke();if(s||o){var a=n.getBuilder(t.getZIndex(),Be.CIRCLE);a.setFillStrokeStyle(s,o),a.drawCircle(e,i)}var l=t.getText();if(l&&l.getText()){var u=(r||n).getBuilder(t.getZIndex(),Be.TEXT);u.setTextStyle(l),u.drawText(e,i)}}function Up(n,e,t,i,r,s,o){var a=!1,l=t.getImage();if(l){var u=l.getImageState();u==wt.LOADED||u==wt.ERROR?l.unlistenImageChange(r):(u==wt.IDLE&&l.load(),u=l.getImageState(),l.listenImageChange(r),a=!0)}return Tj(n,e,t,i,s,o),a}function Tj(n,e,t,i,r,s){var o=t.getGeometryFunction()(e);if(!!o){var a=o.simplifyTransformed(i,r),l=t.getRenderer();if(l)NI(n,a,t,e);else{var u=MI[a.getType()];u(n,a,t,e,s)}}}function NI(n,e,t,i){if(e.getType()==le.GEOMETRY_COLLECTION){for(var r=e.getGeometries(),s=0,o=r.length;s<o;++s)NI(n,r[s],t,i);return}var a=n.getBuilder(t.getZIndex(),Be.DEFAULT);a.drawCustom(e,i,t.getRenderer(),t.getHitDetectionRenderer())}function wj(n,e,t,i,r){var s=e.getGeometriesArray(),o,a;for(o=0,a=s.length;o<a;++o){var l=MI[s[o].getType()];l(n,s[o],t,i,r)}}function Sj(n,e,t,i,r){var s=t.getStroke();if(s){var o=n.getBuilder(t.getZIndex(),Be.LINE_STRING);o.setFillStrokeStyle(null,s),o.drawLineString(e,i)}var a=t.getText();if(a&&a.getText()){var l=(r||n).getBuilder(t.getZIndex(),Be.TEXT);l.setTextStyle(a),l.drawText(e,i)}}function Rj(n,e,t,i,r){var s=t.getStroke();if(s){var o=n.getBuilder(t.getZIndex(),Be.LINE_STRING);o.setFillStrokeStyle(null,s),o.drawMultiLineString(e,i)}var a=t.getText();if(a&&a.getText()){var l=(r||n).getBuilder(t.getZIndex(),Be.TEXT);l.setTextStyle(a),l.drawText(e,i)}}function bj(n,e,t,i,r){var s=t.getFill(),o=t.getStroke();if(o||s){var a=n.getBuilder(t.getZIndex(),Be.POLYGON);a.setFillStrokeStyle(s,o),a.drawMultiPolygon(e,i)}var l=t.getText();if(l&&l.getText()){var u=(r||n).getBuilder(t.getZIndex(),Be.TEXT);u.setTextStyle(l),u.drawText(e,i)}}function Ij(n,e,t,i,r){var s=t.getImage(),o=t.getText(),a;if(r&&(n=r,a=s&&o&&o.getText()?{}:void 0),s){if(s.getImageState()!=wt.LOADED)return;var l=n.getBuilder(t.getZIndex(),Be.IMAGE);l.setImageStyle(s,a),l.drawPoint(e,i)}if(o&&o.getText()){var u=n.getBuilder(t.getZIndex(),Be.TEXT);u.setTextStyle(o,a),u.drawText(e,i)}}function Cj(n,e,t,i,r){var s=t.getImage(),o=t.getText(),a;if(r&&(n=r,a=s&&o&&o.getText()?{}:void 0),s){if(s.getImageState()!=wt.LOADED)return;var l=n.getBuilder(t.getZIndex(),Be.IMAGE);l.setImageStyle(s,a),l.drawMultiPoint(e,i)}if(o&&o.getText()){var u=(r||n).getBuilder(t.getZIndex(),Be.TEXT);u.setTextStyle(o,a),u.drawText(e,i)}}function Lj(n,e,t,i,r){var s=t.getFill(),o=t.getStroke();if(s||o){var a=n.getBuilder(t.getZIndex(),Be.POLYGON);a.setFillStrokeStyle(s,o),a.drawPolygon(e,i)}var l=t.getText();if(l&&l.getText()){var u=(r||n).getBuilder(t.getZIndex(),Be.TEXT);u.setTextStyle(l),u.drawText(e,i)}}var Oj=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Aj=function(n){Oj(e,n);function e(t){var i=n.call(this,t)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=kn(),i.wrappedRenderedExtent_=kn(),i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return e.prototype.renderWorlds=function(t,i,r){var s=i.extent,o=i.viewState,a=o.center,l=o.resolution,u=o.projection,c=o.rotation,h=u.getExtent(),f=this.getLayer().getSource(),d=i.pixelRatio,p=i.viewHints,m=!(p[Mr.ANIMATING]||p[Mr.INTERACTING]),g=this.context,v=Math.round(i.size[0]*d),y=Math.round(i.size[1]*d),x=f.getWrapX()&&u.canWrapX(),_=x?bi(h):null,E=x?Math.ceil((s[2]-h[2])/_)+1:1,T=x?Math.floor((s[0]-h[0])/_):0;do{var w=this.getRenderTransform(a,l,c,d,v,y,T*_);t.execute(g,1,w,c,m,void 0,r)}while(++T<E)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,i){var r=t.pixelRatio,s=t.layerStatesArray[t.layerIndex];Z5(this.pixelTransform,1/r,1/r),xb(this.inversePixelTransform,this.pixelTransform);var o=Tb(this.pixelTransform);this.useContainer(i,o,s.opacity,this.getBackground(t));var a=this.context,l=a.canvas,u=this.replayGroup_,c=this.declutterExecutorGroup;if((!u||u.isEmpty())&&(!c||c.isEmpty()))return null;var h=Math.round(t.size[0]*r),f=Math.round(t.size[1]*r);l.width!=h||l.height!=f?(l.width=h,l.height=f,l.style.transform!==o&&(l.style.transform=o)):this.containerReused||a.clearRect(0,0,h,f),this.preRender(a,t);var d=t.viewState;d.projection;var p=!1,m=!0;if(s.extent&&this.clipping){var g=E_(s.extent);m=Qt(g,t.extent),p=m&&!Ql(g,t.extent),p&&this.clipUnrotated(a,t,g)}m&&this.renderWorlds(u,t),p&&a.restore(),this.postRender(a,t);var v=dI(s.opacity),y=this.container;return v!==y.style.opacity&&(y.style.opacity=v),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(i){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var r=[this.context.canvas.width,this.context.canvas.height];mi(this.pixelTransform,r);var s=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,l=this.renderedProjection_,u=this.wrappedRenderedExtent_,c=this.getLayer(),h=[],f=r[0]*In,d=r[1]*In;h.push(this.getRenderTransform(s,o,a,In,f,d,0).slice());var p=c.getSource(),m=l.getExtent();if(p.getWrapX()&&l.canWrapX()&&!Ql(m,u)){for(var g=u[0],v=bi(m),y=0,x=void 0;g<m[0];)--y,x=v*y,h.push(this.getRenderTransform(s,o,a,In,f,d,x).slice()),g+=v;for(y=0,g=u[2];g>m[2];)++y,x=v*y,h.push(this.getRenderTransform(s,o,a,In,f,d,x).slice()),g-=v}this.hitDetectionImageData_=AI(r,h,this.renderedFeatures_,c.getStyleFunction(),u,o,a)}i(PI(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,i,r,s,o){var a=this;if(!!this.replayGroup_){var l=i.viewState.resolution,u=i.viewState.rotation,c=this.getLayer(),h={},f=function(m,g,v){var y=gt(m),x=h[y];if(x){if(x!==!0&&v<x.distanceSq){if(v===0)return h[y]=!0,o.splice(o.lastIndexOf(x),1),s(m,c,g);x.geometry=g,x.distanceSq=v}}else{if(v===0)return h[y]=!0,s(m,c,g);o.push(h[y]={feature:m,layer:c,geometry:g,distanceSq:v,callback:s})}},d,p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some(function(m){return d=m.forEachFeatureAtCoordinate(t,l,u,r,f,m===a.declutterExecutorGroup&&i.declutterTree?i.declutterTree.all().map(function(g){return g.value}):null)}),d}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var i=this.getLayer(),r=i.getSource();if(!r)return!1;var s=t.viewHints[Mr.ANIMATING],o=t.viewHints[Mr.INTERACTING],a=i.getUpdateWhileAnimating(),l=i.getUpdateWhileInteracting();if(!this.dirty_&&!a&&s||!l&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var u=t.extent,c=t.viewState,h=c.projection,f=c.resolution,d=t.pixelRatio,p=i.getRevision(),m=i.getRenderBuffer(),g=i.getRenderOrder();g===void 0&&(g=xj);var v=c.center.slice(),y=ao(u,m*f),x=y.slice(),_=[y.slice()],E=h.getExtent();if(r.getWrapX()&&h.canWrapX()&&!Ql(E,t.extent)){var T=bi(E),w=Math.max(bi(y)/2,T);y[0]=E[0]-w,y[2]=E[2]+w,Pb(v,h);var S=s4(_[0],h);S[0]<E[0]&&S[2]<E[2]?_.push([S[0]+T,S[1],S[2]+T,S[3]]):S[0]>E[0]&&S[2]>E[2]&&_.push([S[0]-T,S[1],S[2]-T,S[3]])}if(!this.dirty_&&this.renderedResolution_==f&&this.renderedRevision_==p&&this.renderedRenderOrder_==g&&Ql(this.wrappedRenderedExtent_,y))return Kl(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var R=new kp(W_(f,d),y,f,d),b;this.getLayer().getDeclutter()&&(b=new kp(W_(f,d),y,f,d));for(var I,O,P,O=0,P=_.length;O<P;++O)r.loadFeatures(_[O],f,h);var B=FI(f,d),A=function($){var k,C=$.getStyleFunction()||i.getStyleFunction();if(C&&(k=C($,f)),k){var Z=this.renderFeature($,B,k,R,I,b);this.dirty_=this.dirty_||Z}}.bind(this),L=I4(y),D=r.getFeaturesInExtent(L);g&&D.sort(g);for(var O=0,P=D.length;O<P;++O)A(D[O]);this.renderedFeatures_=D;var U=R.finish(),G=new Gp(y,f,d,r.getOverlaps(),U,i.getRenderBuffer());return b&&(this.declutterExecutorGroup=new Gp(y,f,d,r.getOverlaps(),b.finish(),i.getRenderBuffer())),this.renderedResolution_=f,this.renderedRevision_=p,this.renderedRenderOrder_=g,this.renderedExtent_=x,this.wrappedRenderedExtent_=y,this.renderedCenter_=v,this.renderedProjection_=h,this.replayGroup_=G,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,i,r,s,o,a){if(!r)return!1;var l=!1;if(Array.isArray(r))for(var u=0,c=r.length;u<c;++u)l=Up(s,t,r[u],i,this.boundHandleStyleImageChange_,o,a)||l;else l=Up(s,t,r,i,this.boundHandleStyleImageChange_,o,a);return l},e}(II),Pj=Aj,Mj=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Fj=function(n){Mj(e,n);function e(t){return n.call(this,t)||this}return e.prototype.createRenderer=function(){return new Pj(this)},e}(TI),Nj=Fj,$j=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Dj=function(n){$j(e,n);function e(t){var i=n.call(this)||this;i.projection=ei(t.projection),i.attributions_=$I(t.attributions),i.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,i.loading=!1,i.state_=t.state!==void 0?t.state:su.READY,i.wrapX_=t.wrapX!==void 0?t.wrapX:!1,i.interpolate_=!!t.interpolate,i.viewResolver=null,i.viewRejector=null;var r=i;return i.viewPromise_=new Promise(function(s,o){r.viewResolver=s,r.viewRejector=o}),i}return e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return Re()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=$I(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(th);function $I(n){return n?Array.isArray(n)?function(e){return n}:typeof n=="function"?n:function(e){return[n]}:null}var kj=Dj,Gj=!1;function Uj(n,e,t,i,r,s,o){var a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(t,i,r):n,!0),e.getType()==Aa.ARRAY_BUFFER&&(a.responseType="arraybuffer"),a.withCredentials=Gj,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){var u=e.getType(),c=void 0;u==Aa.JSON||u==Aa.TEXT?c=a.responseText:u==Aa.XML?(c=a.responseXML,c||(c=new DOMParser().parseFromString(a.responseText,"application/xml"))):u==Aa.ARRAY_BUFFER&&(c=a.response),c?s(e.readFeatures(c,{extent:t,featureProjection:r}),e.readProjection(c)):o()}else o()},a.onerror=o,a.send()}var DI=function(){function n(e,t,i,r){this.minX=e,this.maxX=t,this.minY=i,this.maxY=r}return n.prototype.contains=function(e){return this.containsXY(e[1],e[2])},n.prototype.containsTileRange=function(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY},n.prototype.containsXY=function(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY},n.prototype.equals=function(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY},n.prototype.extend=function(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)},n.prototype.getHeight=function(){return this.maxY-this.minY+1},n.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},n.prototype.getWidth=function(){return this.maxX-this.minX+1},n.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},n}();function cu(n,e,t,i,r){return r!==void 0?(r.minX=n,r.maxX=e,r.minY=t,r.maxY=i,r):new DI(n,e,t,i)}var kI=DI;function GI(n,e,t,i){return i!==void 0?(i[0]=n,i[1]=e,i[2]=t,i):[n,e,t]}function hu(n,e,t){return n+"/"+e+"/"+t}function UI(n){return hu(n[0],n[1],n[2])}function zj(n){var e=n.substring(n.lastIndexOf("/")+1,n.length).split(",").map(Number),t=e[0],i=e[1],r=e[2];return hu(t,i,r)}function zI(n){return n.split("/").map(Number)}function Bj(n){return(n[1]<<n[0])+n[2]}function jj(n,e){var t=n[0],i=n[1],r=n[2];if(e.getMinZoom()>t||t>e.getMaxZoom())return!1;var s=e.getFullTileRange(t);return s?s.containsXY(i,r):!0}var Yj=[0,0,0],_o=5,Xj=function(){function n(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,It(A5(this.resolutions_,function(o,a){return a-o},!0),17);var t;if(!e.origins){for(var i=0,r=this.resolutions_.length-1;i<r;++i)if(!t)t=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,It(this.origins_.length==this.resolutions_.length,20));var s=e.extent;s!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=uo(s)),It(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,It(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:yI,It(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=s!==void 0?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map(function(o,a){var l=new kI(Math.min(0,o[0]),Math.max(o[0]-1,-1),Math.min(0,o[1]),Math.max(o[1]-1,-1));if(s){var u=this.getTileRangeForExtentAndZ(s,a);l.minX=Math.max(u.minX,l.minX),l.maxX=Math.min(u.maxX,l.maxX),l.minY=Math.max(u.minY,l.minY),l.maxY=Math.min(u.maxY,l.maxY)}return l},this):s&&this.calculateTileRanges_(s)}return n.prototype.forEachTileCoord=function(e,t,i){for(var r=this.getTileRangeForExtentAndZ(e,t),s=r.minX,o=r.maxX;s<=o;++s)for(var a=r.minY,l=r.maxY;a<=l;++a)i([t,s,a])},n.prototype.forEachTileCoordParentTileRange=function(e,t,i,r){var s,o,a,l=null,u=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):l=this.getTileCoordExtent(e,r);u>=this.minZoom;){if(this.zoomFactor_===2?(o=Math.floor(o/2),a=Math.floor(a/2),s=cu(o,o,a,a,i)):s=this.getTileRangeForExtentAndZ(l,u,i),t(u,s))return!0;--u}return!1},n.prototype.getExtent=function(){return this.extent_},n.prototype.getMaxZoom=function(){return this.maxZoom},n.prototype.getMinZoom=function(){return this.minZoom},n.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},n.prototype.getResolution=function(e){return this.resolutions_[e]},n.prototype.getResolutions=function(){return this.resolutions_},n.prototype.getTileCoordChildTileRange=function(e,t,i){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){var r=e[1]*2,s=e[2]*2;return cu(r,r+1,s,s+1,t)}var o=this.getTileCoordExtent(e,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,e[0]+1,t)}return null},n.prototype.getTileRangeForTileCoordAndZ=function(e,t,i){if(t>this.maxZoom||t<this.minZoom)return null;var r=e[0],s=e[1],o=e[2];if(t===r)return cu(s,o,s,o,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,t-r),l=Math.floor(s*a),u=Math.floor(o*a);if(t<r)return cu(l,l,u,u,i);var c=Math.floor(a*(s+1))-1,h=Math.floor(a*(o+1))-1;return cu(l,c,u,h,i)}var f=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(f,t,i)},n.prototype.getTileRangeExtent=function(e,t,i){var r=this.getOrigin(e),s=this.getResolution(e),o=en(this.getTileSize(e),this.tmpSize_),a=r[0]+t.minX*o[0]*s,l=r[0]+(t.maxX+1)*o[0]*s,u=r[1]+t.minY*o[1]*s,c=r[1]+(t.maxY+1)*o[1]*s;return lo(a,u,l,c,i)},n.prototype.getTileRangeForExtentAndZ=function(e,t,i){var r=Yj;this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,r);var s=r[1],o=r[2];return this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,r),cu(s,r[1],o,r[2],i)},n.prototype.getTileCoordCenter=function(e){var t=this.getOrigin(e[0]),i=this.getResolution(e[0]),r=en(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*i,t[1]-(e[2]+.5)*r[1]*i]},n.prototype.getTileCoordExtent=function(e,t){var i=this.getOrigin(e[0]),r=this.getResolution(e[0]),s=en(this.getTileSize(e[0]),this.tmpSize_),o=i[0]+e[1]*s[0]*r,a=i[1]-(e[2]+1)*s[1]*r,l=o+s[0]*r,u=a+s[1]*r;return lo(o,a,l,u,t)},n.prototype.getTileCoordForCoordAndResolution=function(e,t,i){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,i)},n.prototype.getTileCoordForXYAndResolution_=function(e,t,i,r,s){var o=this.getZForResolution(i),a=i/this.getResolution(o),l=this.getOrigin(o),u=en(this.getTileSize(o),this.tmpSize_),c=a*(e-l[0])/i/u[0],h=a*(l[1]-t)/i/u[1];return r?(c=Tp(c,_o)-1,h=Tp(h,_o)-1):(c=Ep(c,_o),h=Ep(h,_o)),GI(o,c,h,s)},n.prototype.getTileCoordForXYAndZ_=function(e,t,i,r,s){var o=this.getOrigin(i),a=this.getResolution(i),l=en(this.getTileSize(i),this.tmpSize_),u=(e-o[0])/a/l[0],c=(o[1]-t)/a/l[1];return r?(u=Tp(u,_o)-1,c=Tp(c,_o)-1):(u=Ep(u,_o),c=Ep(c,_o)),GI(i,u,c,s)},n.prototype.getTileCoordForCoordAndZ=function(e,t,i){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,i)},n.prototype.getTileCoordResolution=function(e){return this.resolutions_[e[0]]},n.prototype.getTileSize=function(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]},n.prototype.getFullTileRange=function(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null},n.prototype.getZForResolution=function(e,t){var i=L5(this.resolutions_,e,t||0);return Pr(i,this.minZoom,this.maxZoom)},n.prototype.calculateTileRanges_=function(e){for(var t=this.resolutions_.length,i=new Array(t),r=this.minZoom;r<t;++r)i[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=i},n}(),Z_=Xj,Vj=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Wj=function(n){Vj(e,n);function e(t,i,r){var s=n.call(this)||this,o=r||{};return s.tileCoord=t,s.state=i,s.interimTile=null,s.key="",s.transition_=o.transition===void 0?250:o.transition,s.transitionStarts_={},s.interpolate=!!o.interpolate,s}return e.prototype.changed=function(){this.dispatchEvent(Si.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==ue.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(!!this.interimTile){var t=this.interimTile,i=this;do{if(t.getState()==ue.LOADED){t.interimTile=null;break}else t.getState()==ue.LOADING?i=t:t.getState()==ue.IDLE?i.interimTile=t.interimTile:i=t;t=i.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==ue.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Re()},e.prototype.getAlpha=function(t,i){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(!r)r=i,this.transitionStarts_[t]=r;else if(r===-1)return 1;var s=i-r+1e3/60;return s>=this.transition_?1:pB(s/this.transition_)},e.prototype.inTransition=function(t){return this.transition_?this.transitionStarts_[t]!==-1:!1},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(Qc),zp=Wj,Zj=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),Hj=function(n){Zj(e,n);function e(t,i,r,s,o,a){var l=n.call(this,t,i,a)||this;return l.crossOrigin_=s,l.src_=r,l.key=r,l.image_=new Image,s!==null&&(l.image_.crossOrigin=s),l.unlisten_=null,l.tileLoadFunction_=o,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=ue.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=ue.ERROR,this.unlistenImage_(),this.image_=Kj(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=ue.LOADED:this.state=ue.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==ue.ERROR&&(this.state=ue.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==ue.IDLE&&(this.state=ue.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=V_(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(zp);function Kj(){var n=bn(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}var BI=Hj,qj=.5,ys=!0,Jj=10,jI=.25,Qj=function(){function n(e,t,i,r,s,o){this.sourceProj_=e,this.targetProj_=t;var a={},l=bp(this.targetProj_,this.sourceProj_);this.transformInv_=function(x){var _=x[0]+"/"+x[1];return a[_]||(a[_]=l(x)),a[_]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&bi(r)==bi(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?bi(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?bi(this.targetProj_.getExtent()):null;var u=uo(i),c=vp(i),h=_p(i),f=yp(i),d=this.transformInv_(u),p=this.transformInv_(c),m=this.transformInv_(h),g=this.transformInv_(f),v=Jj+(o?Math.max(0,Math.ceil(l4(m_(i)/(o*o*256*256)))):0);if(this.addQuad_(u,c,h,f,d,p,m,g,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(x,_,E){y=Math.min(y,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(function(x){if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-y>this.sourceWorldWidth_/2){var _=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];_[0][0]-y>this.sourceWorldWidth_/2&&(_[0][0]-=this.sourceWorldWidth_),_[1][0]-y>this.sourceWorldWidth_/2&&(_[1][0]-=this.sourceWorldWidth_),_[2][0]-y>this.sourceWorldWidth_/2&&(_[2][0]-=this.sourceWorldWidth_);var E=Math.min(_[0][0],_[1][0],_[2][0]),T=Math.max(_[0][0],_[1][0],_[2][0]);T-E<this.sourceWorldWidth_/2&&(x.source=_)}}.bind(this))}a={}}return n.prototype.addTriangle_=function(e,t,i,r,s,o){this.triangles_.push({source:[r,s,o],target:[e,t,i]})},n.prototype.addQuad_=function(e,t,i,r,s,o,a,l,u){var c=f_([s,o,a,l]),h=this.sourceWorldWidth_?bi(c)/this.sourceWorldWidth_:null,f=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&h>.5&&h<1,p=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var m=f_([e,t,i,r]),g=bi(m)/this.targetWorldWidth_;p=g>jI||p}!d&&this.sourceProj_.isGlobal()&&h&&(p=h>jI||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!Qt(c,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(u>0)p=!0;else if(v=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),v!=1&&v!=2&&v!=4&&v!=8)return}if(u>0){if(!p){var y=[(e[0]+i[0])/2,(e[1]+i[1])/2],x=this.transformInv_(y),_=void 0;if(d){var E=(xp(s[0],f)+xp(a[0],f))/2;_=E-xp(x[0],f)}else _=(s[0]+a[0])/2-x[0];var T=(s[1]+a[1])/2-x[1],w=_*_+T*T;p=w>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){var S=[(t[0]+i[0])/2,(t[1]+i[1])/2],R=this.transformInv_(S),b=[(r[0]+e[0])/2,(r[1]+e[1])/2],I=this.transformInv_(b);this.addQuad_(e,t,S,b,s,o,R,I,u-1),this.addQuad_(b,S,i,r,I,R,a,l,u-1)}else{var O=[(e[0]+t[0])/2,(e[1]+t[1])/2],P=this.transformInv_(O),B=[(i[0]+r[0])/2,(i[1]+r[1])/2],A=this.transformInv_(B);this.addQuad_(e,O,B,r,s,P,A,l,u-1),this.addQuad_(O,t,i,B,P,o,a,A,u-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(v&11)==0&&this.addTriangle_(e,i,r,s,a,l),(v&14)==0&&this.addTriangle_(e,i,t,s,a,o),v&&((v&13)==0&&this.addTriangle_(t,r,e,o,l,s),(v&7)==0&&this.addTriangle_(t,r,i,o,l,a))}},n.prototype.calculateSourceExtent=function(){var e=kn();return this.triangles_.forEach(function(t,i,r){var s=t.source;rh(e,s[0]),rh(e,s[1]),rh(e,s[2])}),e},n.prototype.getTriangles=function(){return this.triangles_},n}(),e8=Qj,H_={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},t8={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},K_;function YI(n,e,t,i,r){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(i,r),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,i)+1,Math.max(t,r)),n.restore()}function q_(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function i8(){if(K_===void 0){var n=document.createElement("canvas").getContext("2d");n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",YI(n,4,5,4,0),YI(n,4,5,0,5);var e=n.getImageData(0,0,3,3).data;K_=q_(e,0)||q_(e,4)||q_(e,8)}return K_}function XI(n,e,t,i){var r=kb(t,e,n),s=Nb(e,i,t),o=e.getMetersPerUnit();o!==void 0&&(s*=o);var a=n.getMetersPerUnit();a!==void 0&&(s/=a);var l=n.getExtent();if(!l||nh(l,r)){var u=Nb(n,s,r)/s;isFinite(u)&&u>0&&(s/=u)}return s}function n8(n,e,t,i){var r=eu(t),s=XI(n,e,r,i);return(!isFinite(s)||s<=0)&&Ib(t,function(o){return s=XI(n,e,o,i),isFinite(s)&&s>0}),s}function r8(n,e,t,i,r,s,o,a,l,u,c,h){var f=bn(Math.round(t*n),Math.round(t*e));if(h||Rn(f,H_),l.length===0)return f.canvas;f.scale(t,t);function d(_){return Math.round(_*t)/t}f.globalCompositeOperation="lighter";var p=kn();l.forEach(function(_,E,T){Rb(p,_.extent)});var m=bi(p),g=Ar(p),v=bn(Math.round(t*m/i),Math.round(t*g/i));h||Rn(v,H_);var y=t/i;l.forEach(function(_,E,T){var w=_.extent[0]-p[0],S=-(_.extent[3]-p[3]),R=bi(_.extent),b=Ar(_.extent);_.image.width>0&&_.image.height>0&&v.drawImage(_.image,u,u,_.image.width-2*u,_.image.height-2*u,w*y,S*y,R*y,b*y)});var x=uo(o);return a.getTriangles().forEach(function(_,E,T){var w=_.source,S=_.target,R=w[0][0],b=w[0][1],I=w[1][0],O=w[1][1],P=w[2][0],B=w[2][1],A=d((S[0][0]-x[0])/s),L=d(-(S[0][1]-x[1])/s),D=d((S[1][0]-x[0])/s),U=d(-(S[1][1]-x[1])/s),G=d((S[2][0]-x[0])/s),$=d(-(S[2][1]-x[1])/s),k=R,C=b;R=0,b=0,I-=k,O-=C,P-=k,B-=C;var Z=[[I,O,0,0,D-A],[P,B,0,0,G-A],[0,0,I,O,U-L],[0,0,P,B,$-L]],z=c4(Z);if(!!z){if(f.save(),f.beginPath(),i8()||!h){f.moveTo(D,U);for(var j=4,V=A-D,te=L-U,J=0;J<j;J++)f.lineTo(D+d((J+1)*V/j),U+d(J*te/(j-1))),J!=j-1&&f.lineTo(D+d((J+1)*V/j),U+d((J+1)*te/(j-1)));f.lineTo(G,$)}else f.moveTo(D,U),f.lineTo(A,L),f.lineTo(G,$);f.clip(),f.transform(z[0],z[2],z[1],z[3],A,L),f.translate(p[0]-k,p[3]-C),f.scale(i/t,-i/t),f.drawImage(v.canvas,0,0),f.restore()}}),c&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(_,E,T){var w=_.target,S=(w[0][0]-x[0])/s,R=-(w[0][1]-x[1])/s,b=(w[1][0]-x[0])/s,I=-(w[1][1]-x[1])/s,O=(w[2][0]-x[0])/s,P=-(w[2][1]-x[1])/s;f.beginPath(),f.moveTo(b,I),f.lineTo(S,R),f.lineTo(O,P),f.closePath(),f.stroke()}),f.restore()),f.canvas}var s8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),o8=function(n){s8(e,n);function e(t,i,r,s,o,a,l,u,c,h,f,d){var p=n.call(this,o,ue.IDLE,{interpolate:!!d})||this;p.renderEdges_=f!==void 0?f:!1,p.pixelRatio_=l,p.gutter_=u,p.canvas_=null,p.sourceTileGrid_=i,p.targetTileGrid_=s,p.wrappedTileCoord_=a||o,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var m=s.getTileCoordExtent(p.wrappedTileCoord_),g=p.targetTileGrid_.getExtent(),v=p.sourceTileGrid_.getExtent(),y=g?tu(m,g):m;if(m_(y)===0)return p.state=ue.EMPTY,p;var x=t.getExtent();x&&(v?v=tu(v,x):v=x);var _=s.getResolution(p.wrappedTileCoord_[0]),E=n8(t,r,y,_);if(!isFinite(E)||E<=0)return p.state=ue.EMPTY,p;var T=h!==void 0?h:qj;if(p.triangulation_=new e8(t,r,y,v,E*T,_),p.triangulation_.getTriangles().length===0)return p.state=ue.EMPTY,p;p.sourceZ_=i.getZForResolution(E);var w=p.triangulation_.calculateSourceExtent();if(v&&(t.canWrapX()?(w[1]=Pr(w[1],v[1],v[3]),w[3]=Pr(w[3],v[1],v[3])):w=tu(w,v)),!m_(w))p.state=ue.EMPTY;else{for(var S=i.getTileRangeForExtentAndZ(w,p.sourceZ_),R=S.minX;R<=S.maxX;R++)for(var b=S.minY;b<=S.maxY;b++){var I=c(p.sourceZ_,R,b,l);I&&p.sourceTiles_.push(I)}p.sourceTiles_.length===0&&(p.state=ue.EMPTY)}return p}return e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(c,h,f){c&&c.getState()==ue.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(c.tileCoord),image:c.getImage()})}.bind(this)),this.sourceTiles_.length=0,t.length===0)this.state=ue.ERROR;else{var i=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(i),s=typeof r=="number"?r:r[0],o=typeof r=="number"?r:r[1],a=this.targetTileGrid_.getResolution(i),l=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=r8(s,o,this.pixelRatio_,l,this.sourceTileGrid_.getExtent(),a,u,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=ue.LOADED}this.changed()},e.prototype.load=function(){if(this.state==ue.IDLE){this.state=ue.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(i,r,s){var o=i.getState();if(o==ue.IDLE||o==ue.LOADING){t++;var a=Cr(i,Si.CHANGE,function(l){var u=i.getState();(u==ue.LOADED||u==ue.ERROR||u==ue.EMPTY)&&(Lr(a),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(a)}}.bind(this)),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(i,r,s){var o=i.getState();o==ue.IDLE&&i.load()})}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Lr),this.sourcesListenerKeys_=null},e}(zp),VI=o8,a8=function(){function n(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return n.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},n.prototype.expireCache=function(e){for(;this.canExpireCache();)this.pop()},n.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},n.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},n.prototype.forEach=function(e){for(var t=this.oldest_;t;)e(t.value_,t.key_,this),t=t.newer},n.prototype.get=function(e,t){var i=this.entries_[e];return It(i!==void 0,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},n.prototype.remove=function(e){var t=this.entries_[e];return It(t!==void 0,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},n.prototype.getCount=function(){return this.count_},n.prototype.getKeys=function(){var e=new Array(this.count_),t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.key_;return e},n.prototype.getValues=function(){var e=new Array(this.count_),t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.value_;return e},n.prototype.peekLast=function(){return this.oldest_.value_},n.prototype.peekLastKey=function(){return this.oldest_.key_},n.prototype.peekFirstKey=function(){return this.newest_.key_},n.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},n.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},n.prototype.set=function(e,t){It(!(e in this.entries_),16);var i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_},n.prototype.setSize=function(e){this.highWaterMark=e},n}(),l8=a8,u8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),c8=function(n){u8(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.expireCache=function(t){for(;this.canExpireCache();){var i=this.peekLast();if(i.getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var t=this.peekFirstKey(),i=zI(t),r=i[0];this.forEach(function(s){s.tileCoord[0]!==r&&(this.remove(UI(s.tileCoord)),s.release())}.bind(this))}},e}(l8),J_=c8,Q_={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};function WI(n){var e=n.getDefaultTileGrid();return e||(e=KI(n),n.setDefaultTileGrid(e)),e}function h8(n,e,t){var i=e[0],r=n.getTileCoordCenter(e),s=Bp(t);if(nh(s,r))return e;var o=bi(s),a=Math.ceil((s[0]-r[0])/o);return r[0]+=o*a,n.getTileCoordForCoordAndZ(r,i)}function f8(n,e,t,i){var r=i!==void 0?i:ih.TOP_LEFT,s=HI(n,e,t);return new Z_({extent:n,origin:e4(n,r),resolutions:s,tileSize:t})}function ZI(n){var e=n||{},t=e.extent||ei("EPSG:3857").getExtent(),i={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:HI(t,e.maxZoom,e.tileSize,e.maxResolution)};return new Z_(i)}function HI(n,e,t,i){for(var r=e!==void 0?e:dB,s=Ar(n),o=bi(n),a=en(t!==void 0?t:yI),l=i>0?i:Math.max(o/a[0],s/a[1]),u=r+1,c=new Array(u),h=0;h<u;++h)c[h]=l/Math.pow(2,h);return c}function KI(n,e,t,i){var r=Bp(n);return f8(r,e,t,i)}function Bp(n){n=ei(n);var e=n.getExtent();if(!e){var t=180*cs[hs.DEGREES]/n.getMetersPerUnit();e=lo(-t,-t,t,t)}return e}var qI=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),d8=function(n){qI(e,n);function e(t){var i=n.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate})||this;i.on,i.once,i.un,i.opaque_=t.opaque!==void 0?t.opaque:!1,i.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,i.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;var r=[256,256];return i.tileGrid&&en(i.tileGrid.getTileSize(i.tileGrid.getMinZoom()),r),i.tileCache=new J_(t.cacheSize||0),i.tmpSize=[0,0],i.key_=t.key||"",i.tileOptions={transition:t.transition,interpolate:t.interpolate},i.zDirection=t.zDirection?t.zDirection:0,i}return e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,i){var r=this.getTileCacheForProjection(t);r&&r.expireCache(i)},e.prototype.forEachLoadedTile=function(t,i,r,s){var o=this.getTileCacheForProjection(t);if(!o)return!1;for(var a=!0,l,u,c,h=r.minX;h<=r.maxX;++h)for(var f=r.minY;f<=r.maxY;++f)u=hu(i,h,f),c=!1,o.containsKey(u)&&(l=o.get(u),c=l.getState()===ue.LOADED,c&&(c=s(l)!==!1)),c||(a=!1);return a},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,i,r,s,o){return Re()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:WI(t)},e.prototype.getTileCacheForProjection=function(t){return It(Oa(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,i,r){var s=this.getTileGridForProjection(r),o=this.getTilePixelRatio(i),a=en(s.getTileSize(t),this.tmpSize);return o==1?a:gB(a,o,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,i){var r=i!==void 0?i:this.getProjection(),s=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=h8(s,t,r)),jj(t,s)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),n.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,i){var r=this.getTileCacheForProjection(i);t>r.highWaterMark&&(r.highWaterMark=t)},e.prototype.useTile=function(t,i,r,s){},e}(kj),p8=function(n){qI(e,n);function e(t,i){var r=n.call(this,t)||this;return r.tile=i,r}return e}(hp),g8=d8;function m8(n,e){var t=/\{z\}/g,i=/\{x\}/g,r=/\{y\}/g,s=/\{-y\}/g;return function(o,a,l){if(o)return n.replace(t,o[0].toString()).replace(i,o[1].toString()).replace(r,o[2].toString()).replace(s,function(){var u=o[0],c=e.getFullTileRange(u);It(c,55);var h=c.getHeight()-o[2]-1;return h.toString()})}}function JI(n,e){for(var t=n.length,i=new Array(t),r=0;r<t;++r)i[r]=m8(n[r],e);return y8(i)}function y8(n){return n.length===1?n[0]:function(e,t,i){if(e){var r=Bj(e),s=xp(r,n.length);return n[s](e,t,i)}else return}}function _8(n){var e=[],t=/\{([a-z])-([a-z])\}/.exec(n);if(t){var i=t[1].charCodeAt(0),r=t[2].charCodeAt(0),s=void 0;for(s=i;s<=r;++s)e.push(n.replace(t[0],String.fromCharCode(s)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(n),t){for(var o=parseInt(t[2],10),a=parseInt(t[1],10);a<=o;a++)e.push(n.replace(t[0],a.toString()));return e}return e.push(n),e}var v8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),x8=function(n){v8(e,n);function e(t){var i=n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this;return i.generateTileUrlFunction_=i.tileUrlFunction===e.prototype.tileUrlFunction,i.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(i.tileUrlFunction=t.tileUrlFunction),i.urls=null,t.urls?i.setUrls(t.urls):t.url&&i.setUrl(t.url),i.tileLoadingKeys_={},i}return e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var i=t.target,r=gt(i),s=i.getState(),o;s==ue.LOADING?(this.tileLoadingKeys_[r]=!0,o=Q_.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],o=s==ue.ERROR?Q_.TILELOADERROR:s==ue.LOADED?Q_.TILELOADEND:void 0),o!=null&&this.dispatchEvent(new p8(o,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),typeof i!="undefined"?this.setKey(i):this.changed()},e.prototype.setUrl=function(t){var i=_8(t);this.urls=i,this.setUrls(i)},e.prototype.setUrls=function(t){this.urls=t;var i=t.join(`
|
135
|
-
`);this.generateTileUrlFunction_?this.setTileUrlFunction(JI(t,this.tileGrid),i):this.setKey(i)},e.prototype.tileUrlFunction=function(t,i,r){},e.prototype.useTile=function(t,i,r){var s=hu(t,i,r);this.tileCache.containsKey(s)&&this.tileCache.get(s)},e}(g8),QI=x8,E8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),T8=function(n){E8(e,n);function e(t){var i=this,r=t.imageSmoothing!==void 0?t.imageSmoothing:!0;return t.interpolate!==void 0&&(r=t.interpolate),i=n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:w8,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:r,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this,i.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,i.tileClass=t.tileClass!==void 0?t.tileClass:BI,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,i.renderReprojectionEdges_=!1,i}return e.prototype.canExpireCache=function(){if(!ys)return n.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,i){if(!ys){n.prototype.expireCache.call(this,t,i);return}var r=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==r?i:{});for(var s in this.tileCacheForProjection){var o=this.tileCacheForProjection[s];o.expireCache(o==r?i:{})}},e.prototype.getGutterForProjection=function(t){return ys&&this.getProjection()&&t&&!Oa(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var t=n.prototype.getKey.call(this);return this.getInterpolate()||(t+=":disable-interpolation"),t},e.prototype.getOpaque=function(t){return ys&&this.getProjection()&&t&&!Oa(this.getProjection(),t)?!1:n.prototype.getOpaque.call(this,t)},e.prototype.getTileGridForProjection=function(t){if(!ys)return n.prototype.getTileGridForProjection.call(this,t);var i=this.getProjection();if(this.tileGrid&&(!i||Oa(i,t)))return this.tileGrid;var r=gt(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=WI(t)),this.tileGridForProjection[r]},e.prototype.getTileCacheForProjection=function(t){if(!ys)return n.prototype.getTileCacheForProjection.call(this,t);var i=this.getProjection();if(!i||Oa(i,t))return this.tileCache;var r=gt(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new J_(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,i,r,s,o,a){var l=[t,i,r],u=this.getTileCoordForTileUrlFunction(l,o),c=u?this.tileUrlFunction(u,s,o):void 0,h=new this.tileClass(l,c!==void 0?ue.IDLE:ue.EMPTY,c!==void 0?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=a,h.addEventListener(Si.CHANGE,this.handleTileChange.bind(this)),h},e.prototype.getTile=function(t,i,r,s,o){var a=this.getProjection();if(!ys||!a||!o||Oa(a,o))return this.getTileInternal(t,i,r,s,a||o);var l=this.getTileCacheForProjection(o),u=[t,i,r],c=void 0,h=UI(u);l.containsKey(h)&&(c=l.get(h));var f=this.getKey();if(c&&c.key==f)return c;var d=this.getTileGridForProjection(a),p=this.getTileGridForProjection(o),m=this.getTileCoordForTileUrlFunction(u,o),g=new VI(a,d,o,p,u,m,this.getTilePixelRatio(s),this.getGutter(),function(v,y,x,_){return this.getTileInternal(v,y,x,_,a)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return g.key=f,c?(g.interimTile=c,g.refreshInterimChain(),l.replace(h,g)):l.set(h,g),g},e.prototype.getTileInternal=function(t,i,r,s,o){var a=null,l=hu(t,i,r),u=this.getKey();if(!this.tileCache.containsKey(l))a=this.createTile_(t,i,r,s,o,u),this.tileCache.set(l,a);else if(a=this.tileCache.get(l),a.key!=u){var c=a;a=this.createTile_(t,i,r,s,o,u),c.getState()==ue.IDLE?a.interimTile=c.interimTile:a.interimTile=c,a.refreshInterimChain(),this.tileCache.replace(l,a)}return a},e.prototype.setRenderReprojectionEdges=function(t){if(!(!ys||this.renderReprojectionEdges_==t)){this.renderReprojectionEdges_=t;for(var i in this.tileCacheForProjection)this.tileCacheForProjection[i].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,i){if(ys){var r=ei(t);if(r){var s=gt(r);s in this.tileGridForProjection||(this.tileGridForProjection[s]=i)}}},e}(QI);function w8(n,e){n.getImage().src=e}var S8=T8,eC=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();function R8(n,e,t,i){var r=document.createElement("script"),s="olc_"+gt(e);function o(){delete window[s],r.parentNode.removeChild(r)}r.async=!0,r.src=n+(n.indexOf("?")==-1?"?":"&")+(i||"callback")+"="+s;var a=setTimeout(function(){o(),t&&t()},1e4);window[s]=function(l){clearTimeout(a),o(),e(l)},document.getElementsByTagName("head")[0].appendChild(r)}(function(n){eC(e,n);function e(t){var i=this,r="Unexpected response status: "+t.status;return i=n.call(this,r)||this,i.name="ResponseError",i.response=t,i}return e})(Error),function(n){eC(e,n);function e(t){var i=n.call(this,"Failed to issue request")||this;return i.name="ClientError",i.client=t,i}return e}(Error);var b8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),I8=function(n){b8(e,n);function e(t){var i=this,r=t.imageSmoothing!==void 0?t.imageSmoothing:!0;if(t.interpolate!==void 0&&(r=t.interpolate),i=n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:r,projection:ei("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:su.LOADING,tileLoadFunction:t.tileLoadFunction,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection})||this,i.tileJSON_=null,i.tileSize_=t.tileSize,t.url)if(t.jsonp)R8(t.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var s=new XMLHttpRequest;s.addEventListener("load",i.onXHRLoad_.bind(i)),s.addEventListener("error",i.onXHRError_.bind(i)),s.open("GET",t.url),s.send()}else t.tileJSON?i.handleTileJSONResponse(t.tileJSON):It(!1,51);return i}return e.prototype.onXHRLoad_=function(t){var i=t.target;if(!i.status||i.status>=200&&i.status<300){var r=void 0;try{r=JSON.parse(i.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var i=ei("EPSG:4326"),r=this.getProjection(),s;if(t.bounds!==void 0){var o=Rp(i,r);s=r4(t.bounds,o)}var a=Bp(r),l=t.minzoom||0,u=t.maxzoom||22,c=ZI({extent:a,maxZoom:u,minZoom:l,tileSize:this.tileSize_});if(this.tileGrid=c,this.tileUrlFunction=JI(t.tiles,c),t.attribution!==void 0&&!this.getAttributions()){var h=s!==void 0?s:a;this.setAttributions(function(f){return Qt(h,f.extent)?[t.attribution]:null})}this.tileJSON_=t,this.setState(su.READY)},e.prototype.handleTileJSONError=function(){this.setState(su.ERROR)},e}(S8),C8=I8,jp={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"},L8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),O8=function(n){L8(e,n);function e(t){var i=n.call(this,t)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=kn(),i.tmpTileRange_=new kI(0,0,0,0),i}return e.prototype.isDrawableTile=function(t){var i=this.getLayer(),r=t.getState(),s=i.getUseInterimTilesOnError();return r==ue.LOADED||r==ue.EMPTY||r==ue.ERROR&&!s},e.prototype.getTile=function(t,i,r,s){var o=s.pixelRatio,a=s.viewState.projection,l=this.getLayer(),u=l.getSource(),c=u.getTile(t,i,r,o,a);return c.getState()==ue.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):c.setState(ue.LOADED)),this.isDrawableTile(c)||(c=c.getInterimTile()),c},e.prototype.getData=function(t){var i=this.frameState;if(!i)return null;var r=this.getLayer(),s=mi(i.pixelToCoordinateTransform,t.slice()),o=r.getExtent();if(o&&!nh(o,s))return null;for(var a=i.pixelRatio,l=i.viewState.projection,u=i.viewState,c=r.getRenderSource(),h=c.getTileGridForProjection(u.projection),f=c.getTilePixelRatio(i.pixelRatio),d=h.getZForResolution(u.resolution);d>=h.getMinZoom();--d){var p=h.getTileCoordForCoordAndZ(s,d),m=c.getTile(d,p[1],p[2],a,l);if(!(m instanceof BI||m instanceof VI))return null;if(m.getState()===ue.LOADED){var g=h.getOrigin(d),v=en(h.getTileSize(d)),y=h.getResolution(d),x=Math.floor(f*((s[0]-g[0])/y-p[1]*v[0])),_=Math.floor(f*((g[1]-s[1])/y-p[2]*v[1]));return this.getImageData(m.getImage(),x,_)}}return null},e.prototype.loadedTileCallback=function(t,i,r){return this.isDrawableTile(r)?n.prototype.loadedTileCallback.call(this,t,i,r):!1},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,i){var r=t.layerStatesArray[t.layerIndex],s=t.viewState,o=s.projection,a=s.resolution,l=s.center,u=s.rotation,c=t.pixelRatio,h=this.getLayer(),f=h.getSource(),d=f.getRevision(),p=f.getTileGridForProjection(o),m=p.getZForResolution(a,f.zDirection),g=p.getResolution(m),v=t.extent,y=r.extent&&E_(r.extent);y&&(v=tu(v,E_(r.extent)));var x=f.getTilePixelRatio(c),_=Math.round(t.size[0]*x),E=Math.round(t.size[1]*x);if(u){var T=Math.round(Math.sqrt(_*_+E*E));_=T,E=T}var w=g*_/2/x,S=g*E/2/x,R=[l[0]-w,l[1]-S,l[0]+w,l[1]+S],b=p.getTileRangeForExtentAndZ(v,m),I={};I[m]={};var O=this.createLoadedTileFinder(f,o,I),P=this.tmpExtent,B=this.tmpTileRange_;this.newTiles_=!1;for(var A=b.minX;A<=b.maxX;++A)for(var L=b.minY;L<=b.maxY;++L){var D=this.getTile(m,A,L,t);if(this.isDrawableTile(D)){var U=gt(this);if(D.getState()==ue.LOADED){I[m][D.tileCoord.toString()]=D;var G=D.inTransition(U);!this.newTiles_&&(G||this.renderedTiles.indexOf(D)===-1)&&(this.newTiles_=!0)}if(D.getAlpha(U,t.time)===1)continue}var $=p.getTileCoordChildTileRange(D.tileCoord,B,P),k=!1;$&&(k=O(m+1,$)),k||p.forEachTileCoordParentTileRange(D.tileCoord,O,B,P)}var C=g/a;fs(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/x,1/x,u,-_/2,-E/2);var Z=Tb(this.pixelTransform);this.useContainer(i,Z,r.opacity,this.getBackground(t));var z=this.context,j=z.canvas;xb(this.inversePixelTransform,this.pixelTransform),fs(this.tempTransform,_/2,E/2,C,C,0,-_/2,-E/2),j.width!=_||j.height!=E?(j.width=_,j.height=E):this.containerReused||z.clearRect(0,0,_,E),y&&this.clipUnrotated(z,t,y),f.getInterpolate()||Rn(z,H_),this.preRender(z,t),this.renderedTiles.length=0;var V=Object.keys(I).map(Number);V.sort(ba);var te,J,X;r.opacity===1&&(!this.containerReused||f.getOpaque(t.viewState.projection))?V=V.reverse():(te=[],J=[]);for(var Se=V.length-1;Se>=0;--Se){var _e=V[Se],be=f.getTilePixelSize(_e,c,o),ht=p.getResolution(_e),Ce=ht/g,De=be[0]*Ce*C,Xe=be[1]*Ce*C,Mt=p.getTileCoordForCoordAndZ(uo(R),_e),Ut=p.getTileCoordExtent(Mt),Q=mi(this.tempTransform,[x*(Ut[0]-R[0])/g,x*(R[3]-Ut[3])/g]),Ft=x*f.getGutterForProjection(o),zt=I[_e];for(var Rt in zt){var D=zt[Rt],nt=D.tileCoord,Zt=Mt[1]-nt[1],Bt=Math.round(Q[0]-(Zt-1)*De),Yi=Mt[2]-nt[2],Li=Math.round(Q[1]-(Yi-1)*Xe),A=Math.round(Q[0]-Zt*De),L=Math.round(Q[1]-Yi*Xe),ai=Bt-A,Nt=Li-L,Ze=m===_e,G=Ze&&D.getAlpha(gt(this),t.time)!==1,bt=!1;if(!G)if(te){X=[A,L,A+ai,L,A+ai,L+Nt,A,L+Nt];for(var Ht=0,Kt=te.length;Ht<Kt;++Ht)if(m!==_e&&_e<J[Ht]){var Ct=te[Ht];Qt([A,L,A+ai,L+Nt],[Ct[0],Ct[3],Ct[4],Ct[7]])&&(bt||(z.save(),bt=!0),z.beginPath(),z.moveTo(X[0],X[1]),z.lineTo(X[2],X[3]),z.lineTo(X[4],X[5]),z.lineTo(X[6],X[7]),z.moveTo(Ct[6],Ct[7]),z.lineTo(Ct[4],Ct[5]),z.lineTo(Ct[2],Ct[3]),z.lineTo(Ct[0],Ct[1]),z.clip())}te.push(X),J.push(_e)}else z.clearRect(A,L,ai,Nt);this.drawTileImage(D,t,A,L,ai,Nt,Ft,Ze),te&&!G?(bt&&z.restore(),this.renderedTiles.unshift(D)):this.renderedTiles.push(D),this.updateUsedTiles(t.usedTiles,f,D)}}this.renderedRevision=d,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!Sb(this.renderedExtent_,R),this.renderedExtent_=R,this.renderedPixelRatio=c,this.renderedProjection=o,this.manageTilePyramid(t,f,p,c,o,v,m,h.getPreload()),this.scheduleExpireCache(t,f),this.postRender(z,t),r.extent&&z.restore(),Rn(z,t8),Z!==j.style.transform&&(j.style.transform=Z);var nn=dI(r.opacity),Xi=this.container;return nn!==Xi.style.opacity&&(Xi.style.opacity=nn),this.container},e.prototype.drawTileImage=function(t,i,r,s,o,a,l,u){var c=this.getTileImage(t);if(!!c){var h=gt(this),f=u?t.getAlpha(h,i.time):1,d=f!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=f),this.context.drawImage(c,l,l,c.width-2*l,c.height-2*l,r,s,o,a),d&&this.context.restore(),f!==1?i.animate=!0:u&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var r=function(s,o,a){var l=gt(s);l in a.usedTiles&&s.expireCache(a.viewState.projection,a.usedTiles[l])}.bind(null,i);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,i,r){var s=gt(i);s in t||(t[s]={}),t[s][r.getKey()]=!0},e.prototype.manageTilePyramid=function(t,i,r,s,o,a,l,u,c){var h=gt(i);h in t.wantedTiles||(t.wantedTiles[h]={});var f=t.wantedTiles[h],d=t.tileQueue,p=r.getMinZoom(),m=0,g,v,y,x,_,E;for(E=p;E<=l;++E)for(v=r.getTileRangeForExtentAndZ(a,E,v),y=r.getResolution(E),x=v.minX;x<=v.maxX;++x)for(_=v.minY;_<=v.maxY;++_)l-E<=u?(++m,g=i.getTile(E,x,_,s,o),g.getState()==ue.IDLE&&(f[g.getKey()]=!0,d.isKeyQueued(g.getKey())||d.enqueue([g,h,r.getTileCoordCenter(g.tileCoord),y])),c!==void 0&&c(g)):i.useTile(E,x,_,o);i.updateCacheSize(m,o)},e}(II),A8=O8,vo={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"},P8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),M8={image:[Be.POLYGON,Be.CIRCLE,Be.LINE_STRING,Be.IMAGE,Be.TEXT],hybrid:[Be.POLYGON,Be.LINE_STRING],vector:[]},F8={hybrid:[Be.IMAGE,Be.TEXT,Be.DEFAULT],vector:[Be.POLYGON,Be.CIRCLE,Be.LINE_STRING,Be.IMAGE,Be.TEXT,Be.DEFAULT]},N8=function(n){P8(e,n);function e(t){var i=n.call(this,t)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.tmpTransform_=Or(),i}return e.prototype.prepareTile=function(t,i,r){var s,o=t.getState();return(o===ue.LOADED||o===ue.ERROR)&&(this.updateExecutorGroup_(t,i,r),this.tileImageNeedsRender_(t)&&(s=!0)),s},e.prototype.getTile=function(t,i,r,s){var o=s.pixelRatio,a=s.viewState,l=a.resolution,u=a.projection,c=this.getLayer(),h=c.getSource().getTile(t,i,r,o,u),f=s.viewHints,d=!(f[Mr.ANIMATING]||f[Mr.INTERACTING]);(d||!h.wantedResolution)&&(h.wantedResolution=l);var p=this.prepareTile(h,o,u);return p&&(d||Date.now()-s.time<8)&&c.getRenderMode()!==vo.VECTOR&&this.renderTileImage_(h,s),n.prototype.getTile.call(this,t,i,r,s)},e.prototype.isDrawableTile=function(t){var i=this.getLayer();return n.prototype.isDrawableTile.call(this,t)&&(i.getRenderMode()===vo.VECTOR?gt(i)in t.executorGroups:t.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(t){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,n.prototype.prepareFrame.call(this,t)},e.prototype.updateExecutorGroup_=function(t,i,r){var s=this.getLayer(),o=s.getRevision(),a=s.getRenderOrder()||null,l=t.wantedResolution,u=t.getReplayState(s);if(!(!u.dirty&&u.renderedResolution===l&&u.renderedRevision==o&&u.renderedRenderOrder==a)){var c=s.getSource(),h=s.getDeclutter(),f=c.getTileGrid(),d=c.getTileGridForProjection(r),p=d.getTileCoordExtent(t.wrappedTileCoord),m=c.getSourceTiles(i,r,t),g=gt(s);delete t.hitDetectionImageData[g],t.executorGroups[g]=[],h&&(t.declutterExecutorGroups[g]=[]);for(var v=function(E,T){var w=m[E];if(w.getState()!=ue.LOADED)return"continue";var S=w.tileCoord,R=f.getTileCoordExtent(S),b=tu(p,R),I=ao(b,s.getRenderBuffer()*l,y.tmpExtent),O=Sb(R,b)?null:I;u.dirty=!1;var P=new kp(0,I,l,i),B=h?new kp(0,b,l,i):void 0,A=FI(l,i),L=function(j){var V,te=j.getStyleFunction()||s.getStyleFunction();if(te&&(V=te(j,l)),V){var J=this.renderFeature(j,A,V,P,B);this.dirty_=this.dirty_||J,u.dirty=u.dirty||J}},D=w.getFeatures();a&&a!==u.renderedRenderOrder&&D.sort(a);for(var U=0,G=D.length;U<G;++U){var $=D[U];(!O||Qt(O,$.getGeometry().getExtent()))&&L.call(y,$)}var k=P.finish(),C=s.getRenderMode()!==vo.VECTOR&&h&&m.length===1?null:b,Z=new Gp(C,l,i,c.getOverlaps(),k,s.getRenderBuffer());if(t.executorGroups[g].push(Z),B){var z=new Gp(null,l,i,c.getOverlaps(),B.finish(),s.getRenderBuffer());t.declutterExecutorGroups[g].push(z)}},y=this,x=0,_=m.length;x<_;++x)v(x);u.renderedRevision=o,u.renderedRenderOrder=a,u.renderedResolution=l}},e.prototype.forEachFeatureAtCoordinate=function(t,i,r,s,o){var a=i.viewState.resolution,l=i.viewState.rotation;r=r==null?0:r;var u=this.getLayer(),c=u.getSource(),h=c.getTileGridForProjection(i.viewState.projection),f=f_([t]);ao(f,a*r,f);for(var d={},p=function(_,E,T){var w=_.getId();w===void 0&&(w=gt(_));var S=d[w];if(S){if(S!==!0&&T<S.distanceSq){if(T===0)return d[w]=!0,o.splice(o.lastIndexOf(S),1),s(_,u,E);S.geometry=E,S.distanceSq=T}}else{if(T===0)return d[w]=!0,s(_,u,E);o.push(d[w]={feature:_,layer:u,geometry:E,distanceSq:T,callback:s})}},m=this.renderedTiles,g,v=function(_,E){var T=m[_],w=h.getTileCoordExtent(T.wrappedTileCoord);if(!Qt(w,f))return"continue";var S=gt(u),R=[T.executorGroups[S]],b=T.declutterExecutorGroups[S];b&&R.push(b),R.some(function(I){for(var O=I===b?i.declutterTree.all().map(function(L){return L.value}):null,P=0,B=I.length;P<B;++P){var A=I[P];if(g=A.forEachFeatureAtCoordinate(t,a,l,r,p,O),g)return!0}})},y=0,x=m.length;!g&&y<x;++y)v(y);return g},e.prototype.getFeatures=function(t){return new Promise(function(i,r){for(var s=this.getLayer(),o=gt(s),a=s.getSource(),l=this.renderedProjection,u=l.getExtent(),c=this.renderedResolution,h=a.getTileGridForProjection(l),f=mi(this.renderedPixelToCoordinateTransform_,t.slice()),d=h.getTileCoordForCoordAndResolution(f,c),p,m=0,g=this.renderedTiles.length;m<g;++m)if(d.toString()===this.renderedTiles[m].tileCoord.toString()){if(p=this.renderedTiles[m],p.getState()===ue.LOADED){var v=h.getTileCoordExtent(p.tileCoord);a.getWrapX()&&l.canWrapX()&&!Ql(u,v)&&Pb(f,l);break}p=void 0}if(!p||p.loadingSourceTiles>0){i([]);return}var y=h.getTileCoordExtent(p.wrappedTileCoord),x=uo(y),_=[(f[0]-x[0])/c,(x[1]-f[1])/c],E=p.getSourceTiles().reduce(function(b,I){return b.concat(I.getFeatures())},[]),T=p.hitDetectionImageData[o];if(!T&&!this.animatingOrInteracting_){var w=en(h.getTileSize(h.getZForResolution(c))),S=this.renderedRotation_,R=[this.getRenderTransform(h.getTileCoordCenter(p.wrappedTileCoord),c,0,In,w[0]*In,w[1]*In,0)];T=AI(w,R,E,s.getStyleFunction(),h.getTileCoordExtent(p.wrappedTileCoord),p.getReplayState(s).renderedResolution,S),p.hitDetectionImageData[o]=T}i(PI(_,E,T))}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.renderedLayerRevision_!==void 0&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var i=this.context,r=i.globalAlpha;i.globalAlpha=this.getLayer().getOpacity();for(var s=t.viewHints,o=!(s[Mr.ANIMATING]||s[Mr.INTERACTING]),a=this.renderedTiles,l=0,u=a.length;l<u;++l){var c=a[l],h=c.declutterExecutorGroups[gt(this.getLayer())];if(h)for(var f=h.length-1;f>=0;--f)h[f].execute(this.context,1,this.getTileRenderTransform(c,t),t.viewState.rotation,o,void 0,t.declutterTree)}i.globalAlpha=r},e.prototype.getTileRenderTransform=function(t,i){var r=i.pixelRatio,s=i.viewState,o=s.center,a=s.resolution,l=s.rotation,u=i.size,c=Math.round(u[0]*r),h=Math.round(u[1]*r),f=this.getLayer().getSource(),d=f.getTileGridForProjection(i.viewState.projection),p=t.tileCoord,m=d.getTileCoordExtent(t.wrappedTileCoord),g=d.getTileCoordExtent(p,this.tmpExtent)[0]-m[0],v=c_(h_(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(o,a,l,r,c,h,g));return v},e.prototype.renderFrame=function(t,i){var r=t.viewHints,s=!(r[Mr.ANIMATING]||r[Mr.INTERACTING]);n.prototype.renderFrame.call(this,t,i),this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation;var o=this.getLayer(),a=o.getRenderMode(),l=this.context,u=l.globalAlpha;l.globalAlpha=o.getOpacity();for(var c=F8[a],h=t.viewState,f=h.rotation,d=o.getSource(),p=d.getTileGridForProjection(h.projection),m=p.getZForResolution(h.resolution,d.zDirection),g=this.renderedTiles,v=[],y=[],x=g.length-1;x>=0;--x){var _=g[x],E=_.executorGroups[gt(o)].filter(function(L){return L.hasExecutors(c)});if(E.length!==0){for(var T=this.getTileRenderTransform(_,t),w=_.tileCoord[0],S=!1,R=E[0].getClipCoords(T),b=0,I=v.length;b<I;++b)if(m!==w&&w<y[b]){var O=v[b];Qt([R[0],R[3],R[4],R[7]],[O[0],O[3],O[4],O[7]])&&(S||(l.save(),S=!0),l.beginPath(),l.moveTo(R[0],R[1]),l.lineTo(R[2],R[3]),l.lineTo(R[4],R[5]),l.lineTo(R[6],R[7]),l.moveTo(O[6],O[7]),l.lineTo(O[4],O[5]),l.lineTo(O[2],O[3]),l.lineTo(O[0],O[1]),l.clip())}v.push(R),y.push(w);for(var P=0,B=E.length;P<B;++P){var A=E[P];A.execute(l,1,T,f,s,c)}S&&l.restore()}}return l.globalAlpha=u,this.container},e.prototype.renderFeature=function(t,i,r,s,o){if(!r)return!1;var a=!1;if(Array.isArray(r))for(var l=0,u=r.length;l<u;++l)a=Up(s,t,r[l],i,this.boundHandleStyleImageChange_,void 0,o)||a;else a=Up(s,t,r,i,this.boundHandleStyleImageChange_,void 0,o);return a},e.prototype.tileImageNeedsRender_=function(t){var i=this.getLayer();if(i.getRenderMode()===vo.VECTOR)return!1;var r=t.getReplayState(i),s=i.getRevision(),o=t.wantedResolution;return r.renderedTileResolution!==o||r.renderedTileRevision!==s},e.prototype.renderTileImage_=function(t,i){var r=this.getLayer(),s=t.getReplayState(r),o=r.getRevision(),a=t.executorGroups[gt(r)];s.renderedTileRevision=o;var l=t.wrappedTileCoord,u=l[0],c=r.getSource(),h=i.pixelRatio,f=i.viewState,d=f.projection,p=c.getTileGridForProjection(d),m=p.getResolution(t.tileCoord[0]),g=i.pixelRatio/t.wantedResolution*m,v=p.getResolution(u),y=t.getContext(r);h=Math.round(Math.max(h,g/h));var x=c.getTilePixelSize(u,h,d);y.canvas.width=x[0],y.canvas.height=x[1];var _=h/g;if(_!==1){var E=vb(this.tmpTransform_);h_(E,_,_),y.setTransform.apply(y,E)}var T=p.getTileCoordExtent(l,this.tmpExtent),w=g/v,S=vb(this.tmpTransform_);h_(S,w,-w),H5(S,-T[0],-T[3]);for(var R=0,b=a.length;R<b;++R){var I=a[R];I.execute(y,_,S,0,!0,M8[r.getRenderMode()])}s.renderedTileResolution=t.wantedResolution},e}(A8),$8=N8,D8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),k8=function(n){D8(e,n);function e(t){var i=this,r=t||{},s=Rn({},r);delete s.preload,delete s.useInterimTilesOnError,i=n.call(this,s)||this,i.on,i.once,i.un,r.renderMode===vo.IMAGE&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),r.renderMode=void 0);var o=r.renderMode||vo.HYBRID;return It(o==vo.HYBRID||o==vo.VECTOR,28),i.renderMode_=o,i.setPreload(r.preload?r.preload:0),i.setUseInterimTilesOnError(r.useInterimTilesOnError!==void 0?r.useInterimTilesOnError:!0),i.getBackground,i.setBackground,i}return e.prototype.createRenderer=function(){return new $8(this)},e.prototype.getFeatures=function(t){return n.prototype.getFeatures.call(this,t)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(jp.PRELOAD)},e.prototype.getUseInterimTilesOnError=function(){return this.get(jp.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setPreload=function(t){this.set(jp.PRELOAD,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(jp.USE_INTERIM_TILES_ON_ERROR,t)},e}(TI),G8=k8,U8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),z8=function(n){U8(e,n);function e(t,i,r,s,o,a){var l=n.call(this,t,i,a)||this;return l.extent=null,l.format_=s,l.features_=null,l.loader_,l.projection=null,l.resolution,l.tileLoadFunction_=o,l.url_=r,l.key=r,l}return e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==ue.IDLE&&(this.setState(ue.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,i){this.setFeatures(t)},e.prototype.onError=function(){this.setState(ue.ERROR)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(ue.LOADED)},e.prototype.setLoader=function(t){this.loader_=t},e}(zp),B8=z8,j8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),tC=[],Y8=function(n){j8(e,n);function e(t,i,r,s){var o=n.call(this,t,i,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=s.bind(void 0,o),o.wrappedTileCoord=r,o}return e.prototype.getContext=function(t){var i=gt(t);return i in this.context_||(this.context_[i]=bn(1,1,tC)),this.context_[i]},e.prototype.hasContext=function(t){return gt(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var i=gt(t);return i in this.replayState_||(this.replayState_[i]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[i]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var t in this.context_)tC.push(this.context_[t].canvas),delete this.context_[t];n.prototype.release.call(this)},e}(zp),X8=Y8,V8=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),W8=function(n){V8(e,n);function e(t){var i=this,r=t.projection||"EPSG:3857",s=t.extent||Bp(r),o=t.tileGrid||ZI({extent:s,maxResolution:t.maxResolution,maxZoom:t.maxZoom!==void 0?t.maxZoom:22,minZoom:t.minZoom,tileSize:t.tileSize||512});return i=n.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,interpolate:!0,opaque:!1,projection:r,state:t.state,tileGrid:o,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:H8,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX===void 0?!0:t.wrapX,transition:t.transition,zDirection:t.zDirection===void 0?1:t.zDirection})||this,i.format_=t.format?t.format:null,i.sourceTileCache=new J_(i.tileCache.highWaterMark),i.overlaps_=t.overlaps==null?!0:t.overlaps,i.tileClass=t.tileClass?t.tileClass:B8,i.tileGrids_={},i}return e.prototype.getFeaturesInExtent=function(t){var i=[],r=this.tileCache;if(r.getCount()===0)return i;var s=zI(r.peekFirstKey())[0],o=this.tileGrid;return r.forEach(function(a){if(!(a.tileCoord[0]!==s||a.getState()!==ue.LOADED))for(var l=a.getSourceTiles(),u=0,c=l.length;u<c;++u){var h=l[u],f=h.tileCoord;if(Qt(t,o.getTileCoordExtent(f))){var d=h.getFeatures();if(d)for(var p=0,m=d.length;p<m;++p){var g=d[p],v=g.getGeometry();Qt(t,v.getExtent())&&i.push(g)}}}}),i},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(t,i){var r=this.getTileCacheForProjection(t),s=Object.keys(i).reduce(function(o,a){var l=zj(a);if(r.containsKey(l))for(var u=r.get(l).sourceTiles,c=0,h=u.length;c<h;++c)o[u[c].getKey()]=!0;return o},{});n.prototype.expireCache.call(this,t,i),this.sourceTileCache.expireCache(s)},e.prototype.getSourceTiles=function(t,i,r){var s=this;if(r.getState()===ue.IDLE){r.setState(ue.LOADING);var o=r.wrappedTileCoord,a=this.getTileGridForProjection(i),l=a.getTileCoordExtent(o),u=o[0],c=a.getResolution(u);ao(l,-c,l);var h=this.tileGrid,f=h.getExtent();f&&tu(l,f,l);var d=h.getZForResolution(c,1);h.forEachTileCoord(l,d,function(p){var m=s.tileUrlFunction(p,t,i),g=s.sourceTileCache.containsKey(m)?s.sourceTileCache.get(m):new s.tileClass(p,m?ue.IDLE:ue.EMPTY,m,s.format_,s.tileLoadFunction);r.sourceTiles.push(g);var v=g.getState();if(v<ue.LOADED){var y=function(x){s.handleTileChange(x);var _=g.getState();if(_===ue.LOADED||_===ue.ERROR){var E=g.getKey();E in r.errorTileKeys?g.getState()===ue.LOADED&&delete r.errorTileKeys[E]:r.loadingSourceTiles--,_===ue.ERROR?r.errorTileKeys[E]=!0:g.removeEventListener(Si.CHANGE,y),r.loadingSourceTiles===0&&r.setState(fp(r.errorTileKeys)?ue.LOADED:ue.ERROR)}};g.addEventListener(Si.CHANGE,y),r.loadingSourceTiles++}v===ue.IDLE&&(g.extent=h.getTileCoordExtent(p),g.projection=i,g.resolution=h.getResolution(p[0]),s.sourceTileCache.set(m,g),g.load())}),r.loadingSourceTiles||r.setState(r.sourceTiles.some(function(p){return p.getState()===ue.ERROR})?ue.ERROR:ue.LOADED)}return r.sourceTiles},e.prototype.getTile=function(t,i,r,s,o){var a=hu(t,i,r),l=this.getKey(),u;if(this.tileCache.containsKey(a)&&(u=this.tileCache.get(a),u.key===l))return u;var c=[t,i,r],h=this.getTileCoordForTileUrlFunction(c,o),f=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(o);if(h&&f){var p=d.getTileCoordExtent(h);ao(p,-d.getResolution(t),p),Qt(f,p)||(h=null)}var m=!0;if(h!==null){var g=this.tileGrid,v=d.getResolution(t),y=g.getZForResolution(v,1),x=d.getTileCoordExtent(h);ao(x,-v,x),g.forEachTileCoord(x,y,function(E){m=m&&!this.tileUrlFunction(E,s,o)}.bind(this))}var _=new X8(c,m?ue.EMPTY:ue.IDLE,h,this.getSourceTiles.bind(this,s,o));return _.key=l,u?(_.interimTile=u,_.refreshInterimChain(),this.tileCache.replace(a,_)):this.tileCache.set(a,_),_},e.prototype.getTileGridForProjection=function(t){var i=t.getCode(),r=this.tileGrids_[i];if(!r){var s=this.tileGrid;r=KI(t,void 0,s?s.getTileSize(s.getMinZoom()):void 0),this.tileGrids_[i]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,i,r){var s=this.getTileGridForProjection(r),o=en(s.getTileSize(t),this.tmpSize);return[Math.round(o[0]*i),Math.round(o[1]*i)]},e.prototype.updateCacheSize=function(t,i){n.prototype.updateCacheSize.call(this,t*2,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(QI),Z8=W8;function H8(n,e){n.setLoader(function(t,i,r){Uj(e,n.getFormat(),t,i,r,n.onLoad.bind(n),n.onError.bind(n))})}var iC={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},Eh=" ",nC=/(italic|oblique)$/i,rC={},ev=function(n,e,t){var i=rC[n];if(!i){Array.isArray(n)||(n=[n]);for(var r=400,s="normal",o=[],a,l,u=0,c=n.length;u<c;++u){var h=n[u],f=h.split(" "),d=f[f.length-1].toLowerCase();d=="normal"||d=="italic"||d=="oblique"?(s=l?s:d,f.pop(),d=f[f.length-1].toLowerCase()):nC.test(d)&&(d=d.replace(nC,""),s=l?s:f[f.length-1].replace(d,""));for(var p in iC){var m=f.length>1?f[f.length-2].toLowerCase():"";if(d==p||d==p.replace("-","")||m+"-"+d==p){r=a?r:iC[p],f.pop(),m&&p.startsWith(m)&&f.pop();break}}!a&&typeof d=="number"&&(r=d);var g=f.join(Eh).replace("Klokantech Noto Sans","Noto Sans");g.indexOf(Eh)!==-1&&(g='"'+g+'"'),o.push(g)}i=rC[n]=[s,r,o]}return i[0]+Eh+i[1]+Eh+e+"px"+(t?"/"+t:"")+Eh+i[2]},K8=8,q8={version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90\xB0 orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Supported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},J8={"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},Q8=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],e6={type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},t6={type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},i6={type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},n6={type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) \u2014 it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},r6={type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},s6={type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},o6={id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},a6=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],l6={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},u6={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},c6={"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},h6={"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},f6={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},d6={"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},p6={"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn\u2019t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},g6={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},m6={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},y6={type:"array",value:"*",doc:"A filter selects specific features from a layer."},_6={type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},v6={type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},x6={type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},E6={type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},T6={type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},w6={type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] \u2260 value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] \u2265 value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] \u2264 value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] \u2208 {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] \u2209 {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 \u2227 ... \u2227 fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 \u2228 ... \u2228 fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `\xACf0 \u2227 ... \u2227 \xACfn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},S6={type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},R6={type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},b6={type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},I6={doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},C6={range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},L6={anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0\xB0 (0\xB0 when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0\xB0 when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0\xB0, directly above, to 180\xB0, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},O6={name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carr\xE9e projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},A6={source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},P6=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],M6={"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},F6={"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},N6={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},$6={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},D6={"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},k6={"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},G6={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},U6={"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},z6={"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0\xB0 north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0\xB0 is directly above, at zenith, and 90\xB0 at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0\xB0 north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0\xB0 is directly above, at zenith, and 90\xB0 at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},B6={duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},j6={"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}},sC={$version:K8,$root:q8,sources:J8,source:Q8,source_vector:e6,source_raster:t6,source_raster_dem:i6,source_geojson:n6,source_video:r6,source_image:s6,layer:o6,layout:a6,layout_background:l6,layout_sky:u6,layout_fill:c6,layout_circle:h6,layout_heatmap:f6,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:d6,layout_symbol:p6,layout_raster:g6,layout_hillshade:m6,filter:y6,filter_symbol:_6,filter_fill:v6,filter_line:x6,filter_circle:E6,"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:T6,filter_operator:w6,geometry_type:S6,function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:`A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:
|
136
|
-
* In categorical functions, when the feature value does not match any of the stop domain values.
|
137
|
-
* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.
|
138
|
-
* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a \`circle-color\` property but the feature property value is not a string or not a valid color).
|
139
|
-
* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.
|
140
|
-
If no default is provided, the style property's default is used in these circumstances.`}},function_stop:R6,expression:b6,expression_name:I6,fog:C6,light:L6,projection:O6,terrain:A6,paint:P6,paint_fill:M6,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:F6,paint_circle:N6,paint_heatmap:$6,paint_symbol:D6,paint_raster:k6,paint_hillshade:G6,paint_background:U6,paint_sky:z6,transition:B6,"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:j6},tv=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Yp(n){var e={exports:{}};return n(e,e.exports),e.exports}function Y6(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}/*! https://mths.be/punycode v1.3.2 by @mathias */Yp(function(n,e){(function(t){var i=e&&!e.nodeType&&e,r=n&&!n.nodeType&&n,s=typeof tv=="object"&&tv;(s.global===s||s.window===s||s.self===s)&&(t=s);var o,a=2147483647,l=36,u=1,c=26,h=38,f=700,d=72,p=128,m="-",g=/^xn--/,v=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=l-u,E=Math.floor,T=String.fromCharCode,w;function S($){throw RangeError(x[$])}function R($,k){for(var C=$.length,Z=[];C--;)Z[C]=k($[C]);return Z}function b($,k){var C=$.split("@"),Z="";C.length>1&&(Z=C[0]+"@",$=C[1]),$=$.replace(y,".");var z=$.split("."),j=R(z,k).join(".");return Z+j}function I($){for(var k=[],C=0,Z=$.length,z,j;C<Z;)z=$.charCodeAt(C++),z>=55296&&z<=56319&&C<Z?(j=$.charCodeAt(C++),(j&64512)==56320?k.push(((z&1023)<<10)+(j&1023)+65536):(k.push(z),C--)):k.push(z);return k}function O($){return R($,function(k){var C="";return k>65535&&(k-=65536,C+=T(k>>>10&1023|55296),k=56320|k&1023),C+=T(k),C}).join("")}function P($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:l}function B($,k){return $+22+75*($<26)-((k!=0)<<5)}function A($,k,C){var Z=0;for($=C?E($/f):$>>1,$+=E($/k);$>_*c>>1;Z+=l)$=E($/_);return E(Z+(_+1)*$/($+h))}function L($){var k=[],C=$.length,Z,z=0,j=p,V=d,te,J,X,Se,_e,be,ht,Ce,De;for(te=$.lastIndexOf(m),te<0&&(te=0),J=0;J<te;++J)$.charCodeAt(J)>=128&&S("not-basic"),k.push($.charCodeAt(J));for(X=te>0?te+1:0;X<C;){for(Se=z,_e=1,be=l;X>=C&&S("invalid-input"),ht=P($.charCodeAt(X++)),(ht>=l||ht>E((a-z)/_e))&&S("overflow"),z+=ht*_e,Ce=be<=V?u:be>=V+c?c:be-V,!(ht<Ce);be+=l)De=l-Ce,_e>E(a/De)&&S("overflow"),_e*=De;Z=k.length+1,V=A(z-Se,Z,Se==0),E(z/Z)>a-j&&S("overflow"),j+=E(z/Z),z%=Z,k.splice(z++,0,j)}return O(k)}function D($){var k,C,Z,z,j,V,te,J,X,Se,_e,be=[],ht,Ce,De,Xe;for($=I($),ht=$.length,k=p,C=0,j=d,V=0;V<ht;++V)_e=$[V],_e<128&&be.push(T(_e));for(Z=z=be.length,z&&be.push(m);Z<ht;){for(te=a,V=0;V<ht;++V)_e=$[V],_e>=k&&_e<te&&(te=_e);for(Ce=Z+1,te-k>E((a-C)/Ce)&&S("overflow"),C+=(te-k)*Ce,k=te,V=0;V<ht;++V)if(_e=$[V],_e<k&&++C>a&&S("overflow"),_e==k){for(J=C,X=l;Se=X<=j?u:X>=j+c?c:X-j,!(J<Se);X+=l)Xe=J-Se,De=l-Se,be.push(T(B(Se+Xe%De,0))),J=E(Xe/De);be.push(T(B(J,0))),j=A(C,Ce,Z==z),C=0,++Z}++C,++k}return be.join("")}function U($){return b($,function(k){return g.test(k)?L(k.slice(4).toLowerCase()):k})}function G($){return b($,function(k){return v.test(k)?"xn--"+D(k):k})}if(o={version:"1.3.2",ucs2:{decode:I,encode:O},decode:L,encode:D,toASCII:G,toUnicode:U},i&&r)if(n.exports==i)r.exports=o;else for(w in o)o.hasOwnProperty(w)&&(i[w]=o[w]);else t.punycode=o})(tv)});function X6(n,e){return Object.prototype.hasOwnProperty.call(n,e)}var V6=function(n,e,t,i){e=e||"&",t=t||"=";var r={};if(typeof n!="string"||n.length===0)return r;var s=/\+/g;n=n.split(e);var o=1e3;i&&typeof i.maxKeys=="number"&&(o=i.maxKeys);var a=n.length;o>0&&a>o&&(a=o);for(var l=0;l<a;++l){var u=n[l].replace(s,"%20"),c=u.indexOf(t),h,f,d,p;c>=0?(h=u.substr(0,c),f=u.substr(c+1)):(h=u,f=""),d=decodeURIComponent(h),p=decodeURIComponent(f),X6(r,d)?Array.isArray(r[d])?r[d].push(p):r[d]=[r[d],p]:r[d]=p}return r},Th=function(n){switch(typeof n){case"string":return n;case"boolean":return n?"true":"false";case"number":return isFinite(n)?n:"";default:return""}},W6=function(n,e,t,i){return e=e||"&",t=t||"=",n===null&&(n=void 0),typeof n=="object"?Object.keys(n).map(function(r){var s=encodeURIComponent(Th(r))+t;return Array.isArray(n[r])?n[r].map(function(o){return s+encodeURIComponent(Th(o))}).join(e):s+encodeURIComponent(Th(n[r]))}).join(e):i?encodeURIComponent(Th(i))+t+encodeURIComponent(Th(n)):""};Yp(function(n,e){e.decode=e.parse=V6,e.encode=e.stringify=W6});function oC(n,...e){for(const t of e)for(const i in t)n[i]=t[i];return n}class Nr extends Error{constructor(e,t){super(t);this.message=t,this.key=e}}class ux{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[i,r]of t)this.bindings[i]=r}concat(e){return new ux(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}}const Xp={kind:"null"},ee={kind:"number"},je={kind:"string"},Fe={kind:"boolean"},_s={kind:"color"},fu={kind:"object"},Ne={kind:"value"},Z6={kind:"error"},Vp={kind:"collator"},Wp={kind:"formatted"},wh={kind:"resolvedImage"};function Un(n,e){return{kind:"array",itemType:n,N:e}}function At(n){if(n.kind==="array"){const e=At(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}else return n.kind}const H6=[Xp,ee,je,Fe,_s,Wp,fu,Un(Ne),wh];function Sh(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Sh(n.itemType,e.itemType))&&(typeof n.N!="number"||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if(n.kind==="value"){for(const t of H6)if(!Sh(t,e))return null}}return`Expected ${At(n)} but found ${At(e)} instead.`}function iv(n,e){return e.some(t=>t.kind===n.kind)}function Rh(n,e){return e.some(t=>t==="null"?n===null:t==="array"?Array.isArray(n):t==="object"?n&&!Array.isArray(n)&&typeof n=="object":t===typeof n)}var K6=Yp(function(n,e){var t={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function i(u){return u=Math.round(u),u<0?0:u>255?255:u}function r(u){return u<0?0:u>1?1:u}function s(u){return u[u.length-1]==="%"?i(parseFloat(u)/100*255):i(parseInt(u))}function o(u){return u[u.length-1]==="%"?r(parseFloat(u)/100):r(parseFloat(u))}function a(u,c,h){return h<0?h+=1:h>1&&(h-=1),h*6<1?u+(c-u)*h*6:h*2<1?c:h*3<2?u+(c-u)*(2/3-h)*6:u}function l(u){var c=u.replace(/ /g,"").toLowerCase();if(c in t)return t[c].slice();if(c[0]==="#"){if(c.length===4){var h=parseInt(c.substr(1),16);return h>=0&&h<=4095?[(h&3840)>>4|(h&3840)>>8,h&240|(h&240)>>4,h&15|(h&15)<<4,1]:null}else if(c.length===7){var h=parseInt(c.substr(1),16);return h>=0&&h<=16777215?[(h&16711680)>>16,(h&65280)>>8,h&255,1]:null}return null}var f=c.indexOf("("),d=c.indexOf(")");if(f!==-1&&d+1===c.length){var p=c.substr(0,f),m=c.substr(f+1,d-(f+1)).split(","),g=1;switch(p){case"rgba":if(m.length!==4)return null;g=o(m.pop());case"rgb":return m.length!==3?null:[s(m[0]),s(m[1]),s(m[2]),g];case"hsla":if(m.length!==4)return null;g=o(m.pop());case"hsl":if(m.length!==3)return null;var v=(parseFloat(m[0])%360+360)%360/360,y=o(m[1]),x=o(m[2]),_=x<=.5?x*(y+1):x+y-x*y,E=x*2-_;return[i(a(E,_,v+1/3)*255),i(a(E,_,v)*255),i(a(E,_,v-1/3)*255),g];default:return null}}return null}try{e.parseCSSColor=l}catch{}});class it{constructor(e,t,i,r=1){this.r=e,this.g=t,this.b=i,this.a=r}static parse(e){if(!e)return;if(e instanceof it)return e;if(typeof e!="string")return;const t=K6.parseCSSColor(e);if(!!t)return new it(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}toString(){const[e,t,i,r]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(i)},${r})`}toArray(){const{r:e,g:t,b:i,a:r}=this;return r===0?[0,0,0,0]:[e*255/r,t*255/r,i*255/r,r]}}it.black=new it(0,0,0,1),it.white=new it(1,1,1,1),it.transparent=new it(0,0,0,0),it.red=new it(1,0,0,1),it.blue=new it(0,0,1,1);class nv{constructor(e,t,i){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class rv{constructor(e,t,i,r,s){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=s}}class cr{constructor(e){this.sections=e}static fromString(e){return new cr([new rv(e,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof cr?e:cr.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.name]);continue}e.push(t.text);const i={};t.fontStack&&(i["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(i["font-scale"]=t.scale),t.textColor&&(i["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(i)}return e}}class Is{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Is({name:e,available:!1}):null}serialize(){return["image",this.name]}}function aC(n,e,t,i){return typeof n=="number"&&n>=0&&n<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255?typeof i=="undefined"||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[n,e,t,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[n,e,t,i]:[n,e,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Zp(n){if(n===null)return!0;if(typeof n=="string")return!0;if(typeof n=="boolean")return!0;if(typeof n=="number")return!0;if(n instanceof it)return!0;if(n instanceof nv)return!0;if(n instanceof cr)return!0;if(n instanceof Is)return!0;if(Array.isArray(n)){for(const e of n)if(!Zp(e))return!1;return!0}else if(typeof n=="object"){for(const e in n)if(!Zp(n[e]))return!1;return!0}else return!1}function yi(n){if(n===null)return Xp;if(typeof n=="string")return je;if(typeof n=="boolean")return Fe;if(typeof n=="number")return ee;if(n instanceof it)return _s;if(n instanceof nv)return Vp;if(n instanceof cr)return Wp;if(n instanceof Is)return wh;if(Array.isArray(n)){const e=n.length;let t;for(const i of n){const r=yi(i);if(!t)t=r;else{if(t===r)continue;t=Ne;break}}return Un(t||Ne,e)}else return fu}function bh(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof it||n instanceof cr||n instanceof Is?n.toString():JSON.stringify(n)}class Mu{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Zp(e[1]))return t.error("invalid value");const i=e[1];let r=yi(i);const s=t.expectedType;return r.kind==="array"&&r.N===0&&s&&s.kind==="array"&&(typeof s.N!="number"||s.N===0)&&(r=s),new Mu(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof it?["rgba"].concat(this.value.toArray()):this.value instanceof cr?this.value.serialize():this.value}}class Fi{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const sv={string:je,number:ee,boolean:Fe,object:fu};class ur{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=1,r;const s=e[0];if(s==="array"){let a;if(e.length>2){const u=e[1];if(typeof u!="string"||!(u in sv)||u==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=sv[u],i++}else a=Ne;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);l=e[2],i++}r=Un(a,l)}else r=sv[s];const o=[];for(;i<e.length;i++){const a=t.parse(e[i],i,Ne);if(!a)return null;o.push(a)}return new ur(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(Sh(this.type,yi(i))){if(t===this.args.length-1)throw new Fi(`Expected value to be of type ${At(this.type)}, but found ${At(yi(i))} instead.`)}else return i}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,t=[e.kind];if(e.kind==="array"){const i=e.itemType;if(i.kind==="string"||i.kind==="number"||i.kind==="boolean"){t.push(i.kind);const r=e.N;(typeof r=="number"||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map(i=>i.serialize()))}}class jg{constructor(e){this.type=Wp,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[1];if(!Array.isArray(i)&&typeof i=="object")return t.error("First argument must be an image or text section.");const r=[];let s=!1;for(let o=1;o<=e.length-1;++o){const a=e[o];if(s&&typeof a=="object"&&!Array.isArray(a)){s=!1;let l=null;if(a["font-scale"]&&(l=t.parse(a["font-scale"],1,ee),!l))return null;let u=null;if(a["text-font"]&&(u=t.parse(a["text-font"],1,Un(je)),!u))return null;let c=null;if(a["text-color"]&&(c=t.parse(a["text-color"],1,_s),!c))return null;const h=r[r.length-1];h.scale=l,h.font=u,h.textColor=c}else{const l=t.parse(e[o],1,Ne);if(!l)return null;const u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=!0,r.push({content:l,scale:null,font:null,textColor:null})}}return new jg(r)}evaluate(e){const t=i=>{const r=i.content.evaluate(e);return yi(r)===wh?new rv("",r,null,null,null):new rv(bh(r),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)};return new cr(this.sections.map(t))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const i={};t.scale&&(i["font-scale"]=t.scale.serialize()),t.font&&(i["text-font"]=t.font.serialize()),t.textColor&&(i["text-color"]=t.textColor.serialize()),e.push(i)}return e}}class Yg{constructor(e){this.type=wh,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const i=t.parse(e[1],1,je);return i?new Yg(i):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),i=Is.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const q6={"to-boolean":Fe,"to-color":_s,"to-number":ee,"to-string":je};class Fo{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[0];if((i==="to-boolean"||i==="to-string")&&e.length!==2)return t.error("Expected one argument.");const r=q6[i],s=[];for(let o=1;o<e.length;o++){const a=t.parse(e[o],o,Ne);if(!a)return null;s.push(a)}return new Fo(r,s)}evaluate(e){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(e));if(this.type.kind==="color"){let t,i;for(const r of this.args){if(t=r.evaluate(e),i=null,t instanceof it)return t;if(typeof t=="string"){const s=e.parseColor(t);if(s)return s}else if(Array.isArray(t)&&(t.length<3||t.length>4?i=`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:i=aC(t[0],t[1],t[2],t[3]),!i))return new it(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Fi(i||`Could not parse color from value '${typeof t=="string"?t:String(JSON.stringify(t))}'`)}else if(this.type.kind==="number"){let t=null;for(const i of this.args){if(t=i.evaluate(e),t===null)return 0;const r=Number(t);if(!isNaN(r))return r}throw new Fi(`Could not convert ${JSON.stringify(t)} to number.`)}else return this.type.kind==="formatted"?cr.fromString(bh(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Is.fromString(bh(this.args[0].evaluate(e))):bh(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new jg([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Yg(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(t=>{e.push(t.serialize())}),e}}const J6=["Unknown","Point","LineString","Polygon"];class lC{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?J6[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:r}=this.featureTileCoord,s=i*t-e[0],o=r*t-e[1],a=this.featureDistanceData.bearing[0],l=this.featureDistanceData.bearing[1];return a*s+l*o}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=it.parse(e)),t}}class hr{constructor(e,t,i,r){this.name=e,this.type=t,this._evaluate=i,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,t){const i=e[0],r=hr.definitions[i];if(!r)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const s=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter(([u])=>!Array.isArray(u)||u.length===e.length-1);let l=null;for(const[u,c]of a){l=new Wg(t.registry,t.path,null,t.scope);const h=[];let f=!1;for(let d=1;d<e.length;d++){const p=e[d],m=Array.isArray(u)?u[d-1]:u.type,g=l.parse(p,1+h.length,m);if(!g){f=!0;break}h.push(g)}if(!f){if(Array.isArray(u)&&u.length!==h.length){l.error(`Expected ${u.length} arguments, but found ${h.length} instead.`);continue}for(let d=0;d<h.length;d++){const p=Array.isArray(u)?u[d]:u.type,m=h[d];l.concat(d+1).checkSubtype(p,m.type)}if(l.errors.length===0)return new hr(i,s,c,h)}}if(a.length===1)t.errors.push(...l.errors);else{const c=(a.length?a:o).map(([f])=>Q6(f)).join(" | "),h=[];for(let f=1;f<e.length;f++){const d=t.parse(e[f],1+h.length);if(!d)return null;h.push(At(d.type))}t.error(`Expected arguments of type ${c}, but found (${h.join(", ")}) instead.`)}return null}static register(e,t){hr.definitions=t;for(const i in t)e[i]=hr}}function Q6(n){return Array.isArray(n)?`(${n.map(At).join(", ")})`:`(${At(n.type)}...)`}class Xg{constructor(e,t,i){this.type=Vp,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error("Expected one argument.");const i=e[1];if(typeof i!="object"||Array.isArray(i))return t.error("Collator options argument must be an object.");const r=t.parse(i["case-sensitive"]===void 0?!1:i["case-sensitive"],1,Fe);if(!r)return null;const s=t.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,Fe);if(!s)return null;let o=null;return i.locale&&(o=t.parse(i.locale,1,je),!o)?null:new Xg(r,s,o)}evaluate(e){return new nv(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}const xo=8192;function ov(n,e){n[0]=Math.min(n[0],e[0]),n[1]=Math.min(n[1],e[1]),n[2]=Math.max(n[2],e[0]),n[3]=Math.max(n[3],e[1])}function eY(n){return(180+n)/360}function tY(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function Hp(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function iY(n,e){const t=eY(n[0]),i=tY(n[1]),r=Math.pow(2,e.z);return[Math.round(t*r*xo),Math.round(i*r*xo)]}function nY(n,e,t){const i=n[0]-e[0],r=n[1]-e[1],s=n[0]-t[0],o=n[1]-t[1];return i*o-s*r===0&&i*s<=0&&r*o<=0}function rY(n,e,t){return e[1]>n[1]!=t[1]>n[1]&&n[0]<(t[0]-e[0])*(n[1]-e[1])/(t[1]-e[1])+e[0]}function av(n,e){let t=!1;for(let i=0,r=e.length;i<r;i++){const s=e[i];for(let o=0,a=s.length;o<a-1;o++){if(nY(n,s[o],s[o+1]))return!1;rY(n,s[o],s[o+1])&&(t=!t)}}return t}function sY(n,e){for(let t=0;t<e.length;t++)if(av(n,e[t]))return!0;return!1}function oY(n,e){return n[0]*e[1]-n[1]*e[0]}function uC(n,e,t,i){const r=n[0]-t[0],s=n[1]-t[1],o=e[0]-t[0],a=e[1]-t[1],l=i[0]-t[0],u=i[1]-t[1],c=r*u-l*s,h=o*u-l*a;return c>0&&h<0||c<0&&h>0}function aY(n,e,t,i){const r=[e[0]-n[0],e[1]-n[1]],s=[i[0]-t[0],i[1]-t[1]];return oY(s,r)===0?!1:!!(uC(n,e,t,i)&&uC(t,i,n,e))}function lY(n,e,t){for(const i of t)for(let r=0;r<i.length-1;++r)if(aY(n,e,i[r],i[r+1]))return!0;return!1}function cC(n,e){for(let t=0;t<n.length;++t)if(!av(n[t],e))return!1;for(let t=0;t<n.length-1;++t)if(lY(n[t],n[t+1],e))return!1;return!0}function uY(n,e){for(let t=0;t<e.length;t++)if(cC(n,e[t]))return!0;return!1}function lv(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=[];for(let o=0;o<n[r].length;o++){const a=iY(n[r][o],t);ov(e,a),s.push(a)}i.push(s)}return i}function hC(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=lv(n[r],e,t);i.push(s)}return i}function fC(n,e,t,i){if(n[0]<t[0]||n[0]>t[2]){const r=i*.5;let s=n[0]-t[0]>r?-i:t[0]-n[0]>r?i:0;s===0&&(s=n[0]-t[2]>r?-i:t[2]-n[0]>r?i:0),n[0]+=s}ov(e,n)}function cY(n){n[0]=n[1]=1/0,n[2]=n[3]=-1/0}function dC(n,e,t,i){const r=Math.pow(2,i.z)*xo,s=[i.x*xo,i.y*xo],o=[];for(const a of n)for(const l of a){const u=[l.x+s[0],l.y+s[1]];fC(u,e,t,r),o.push(u)}return o}function pC(n,e,t,i){const r=Math.pow(2,i.z)*xo,s=[i.x*xo,i.y*xo],o=[];for(const a of n){const l=[];for(const u of a){const c=[u.x+s[0],u.y+s[1]];ov(e,c),l.push(c)}o.push(l)}if(e[2]-e[0]<=r/2){cY(e);for(const a of o)for(const l of a)fC(l,e,t,r)}return o}function hY(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=lv(e.coordinates,i,r),o=dC(n.geometry(),t,i,r);if(!Hp(t,i))return!1;for(const a of o)if(!av(a,s))return!1}if(e.type==="MultiPolygon"){const s=hC(e.coordinates,i,r),o=dC(n.geometry(),t,i,r);if(!Hp(t,i))return!1;for(const a of o)if(!sY(a,s))return!1}return!0}function fY(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=lv(e.coordinates,i,r),o=pC(n.geometry(),t,i,r);if(!Hp(t,i))return!1;for(const a of o)if(!cC(a,s))return!1}if(e.type==="MultiPolygon"){const s=hC(e.coordinates,i,r),o=pC(n.geometry(),t,i,r);if(!Hp(t,i))return!1;for(const a of o)if(!uY(a,s))return!1}return!0}class Ja{constructor(e,t){this.type=Fe,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Zp(e[1])){const i=e[1];if(i.type==="FeatureCollection")for(let r=0;r<i.features.length;++r){const s=i.features[r].geometry.type;if(s==="Polygon"||s==="MultiPolygon")return new Ja(i,i.features[r].geometry)}else if(i.type==="Feature"){const r=i.geometry.type;if(r==="Polygon"||r==="MultiPolygon")return new Ja(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new Ja(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return hY(e,this.geometries);if(e.geometryType()==="LineString")return fY(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Kp(n){if(n instanceof hr){if(n.name==="get"&&n.args.length===1)return!1;if(n.name==="feature-state")return!1;if(n.name==="has"&&n.args.length===1)return!1;if(n.name==="properties"||n.name==="geometry-type"||n.name==="id")return!1;if(/^filter-/.test(n.name))return!1}if(n instanceof Ja)return!1;let e=!0;return n.eachChild(t=>{e&&!Kp(t)&&(e=!1)}),e}function uv(n){if(n instanceof hr&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(t=>{e&&!uv(t)&&(e=!1)}),e}function cv(n,e){if(n instanceof hr&&e.indexOf(n.name)>=0)return!1;let t=!0;return n.eachChild(i=>{t&&!cv(i,e)&&(t=!1)}),t}class Vg{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");const i=e[1];return t.scope.has(i)?new Vg(i,t.scope.get(i)):t.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Wg{constructor(e,t=[],i,r=new ux,s=[]){this.registry=e,this.path=t,this.key=t.map(o=>`[${o}]`).join(""),this.scope=r,this.errors=s,this.expectedType=i}parse(e,t,i,r,s={}){return t?this.concat(t,i,r)._parse(e,s):this._parse(e,s)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function i(r,s,o){return o==="assert"?new ur(s,[r]):o==="coerce"?new Fo(s,[r]):r}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=e[0];if(typeof r!="string")return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[r];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){const a=this.expectedType,l=o.type;if((a.kind==="string"||a.kind==="number"||a.kind==="boolean"||a.kind==="object"||a.kind==="array")&&l.kind==="value")o=i(o,a,t.typeAnnotation||"assert");else if((a.kind==="color"||a.kind==="formatted"||a.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))o=i(o,a,t.typeAnnotation||"coerce");else if(this.checkSubtype(a,l))return null}if(!(o instanceof Mu)&&o.type.kind!=="resolvedImage"&&hv(o)){const a=new lC;try{o=new Mu(o.type,o.evaluate(a))}catch(l){return this.error(l.message),null}}return o}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e=="undefined"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,i){const r=typeof e=="number"?this.path.concat(e):this.path,s=i?this.scope.concat(i):this.scope;return new Wg(this.registry,r,t||null,s,this.errors)}error(e,...t){const i=`${this.key}${t.map(r=>`[${r}]`).join("")}`;this.errors.push(new Nr(i,e))}checkSubtype(e,t){const i=Sh(e,t);return i&&this.error(i),i}}function hv(n){if(n instanceof Vg)return hv(n.boundExpression);if(n instanceof hr&&n.name==="error")return!1;if(n instanceof Xg)return!1;if(n instanceof Ja)return!1;const e=n instanceof Fo||n instanceof ur;let t=!0;return n.eachChild(i=>{e?t=t&&hv(i):t=t&&i instanceof Mu}),t?Kp(n)&&cv(n,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]):!1}function qp(n,e){const t=n.length-1;let i=0,r=t,s=0,o,a;for(;i<=r;)if(s=Math.floor((i+r)/2),o=n[s],a=n[s+1],o<=e){if(s===t||e<a)return s;i=s+1}else if(o>e)r=s-1;else throw new Fi("Input is not a number.");return 0}class Zg{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[r,s]of i)this.labels.push(r),this.outputs.push(s)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");const i=t.parse(e[1],1,ee);if(!i)return null;const r=[];let s=null;t.expectedType&&t.expectedType.kind!=="value"&&(s=t.expectedType);for(let o=1;o<e.length;o+=2){const a=o===1?-1/0:e[o],l=e[o+1],u=o,c=o+1;if(typeof a!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(r.length&&r[r.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);const h=t.parse(l,c,s);if(!h)return null;s=s||h.type,r.push([a,h])}return new Zg(s,i,r)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=qp(t,r);return i[o].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}var dY=du;function du(n,e,t,i){this.cx=3*n,this.bx=3*(t-n)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=n,this.p1y=i,this.p2x=t,this.p2y=i}du.prototype.sampleCurveX=function(n){return((this.ax*n+this.bx)*n+this.cx)*n},du.prototype.sampleCurveY=function(n){return((this.ay*n+this.by)*n+this.cy)*n},du.prototype.sampleCurveDerivativeX=function(n){return(3*this.ax*n+2*this.bx)*n+this.cx},du.prototype.solveCurveX=function(n,e){typeof e=="undefined"&&(e=1e-6);var t,i,r,s,o;for(r=n,o=0;o<8;o++){if(s=this.sampleCurveX(r)-n,Math.abs(s)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r=r-s/a}if(t=0,i=1,r=n,r<t)return t;if(r>i)return i;for(;t<i;){if(s=this.sampleCurveX(r),Math.abs(s-n)<e)return r;n>s?t=r:i=r,r=(i-t)*.5+t}return r},du.prototype.solve=function(n,e){return this.sampleCurveY(this.solveCurveX(n,e))};function Cn(n,e,t){return n*(1-t)+e*t}function pY(n,e,t){return new it(Cn(n.r,e.r,t),Cn(n.g,e.g,t),Cn(n.b,e.b,t),Cn(n.a,e.a,t))}function gY(n,e,t){return n.map((i,r)=>Cn(i,e[r],t))}var gC=Object.freeze({__proto__:null,number:Cn,color:pY,array:gY});const mC=.95047,yC=1,_C=1.08883,vC=4/29,pu=6/29,xC=3*pu*pu,mY=pu*pu*pu,yY=Math.PI/180,_Y=180/Math.PI;function fv(n){return n>mY?Math.pow(n,1/3):n/xC+vC}function dv(n){return n>pu?n*n*n:xC*(n-vC)}function pv(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function gv(n){return n/=255,n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function EC(n){const e=gv(n.r),t=gv(n.g),i=gv(n.b),r=fv((.4124564*e+.3575761*t+.1804375*i)/mC),s=fv((.2126729*e+.7151522*t+.072175*i)/yC),o=fv((.0193339*e+.119192*t+.9503041*i)/_C);return{l:116*s-16,a:500*(r-s),b:200*(s-o),alpha:n.a}}function TC(n){let e=(n.l+16)/116,t=isNaN(n.a)?e:e+n.a/500,i=isNaN(n.b)?e:e-n.b/200;return e=yC*dv(e),t=mC*dv(t),i=_C*dv(i),new it(pv(3.2404542*t-1.5371385*e-.4985314*i),pv(-.969266*t+1.8760108*e+.041556*i),pv(.0556434*t-.2040259*e+1.0572252*i),n.alpha)}function vY(n,e,t){return{l:Cn(n.l,e.l,t),a:Cn(n.a,e.a,t),b:Cn(n.b,e.b,t),alpha:Cn(n.alpha,e.alpha,t)}}function xY(n){const{l:e,a:t,b:i}=EC(n),r=Math.atan2(i,t)*_Y;return{h:r<0?r+360:r,c:Math.sqrt(t*t+i*i),l:e,alpha:n.a}}function EY(n){const e=n.h*yY,t=n.c,i=n.l;return TC({l:i,a:Math.cos(e)*t,b:Math.sin(e)*t,alpha:n.alpha})}function TY(n,e,t){const i=e-n;return n+t*(i>180||i<-180?i-360*Math.round(i/360):i)}function wY(n,e,t){return{h:TY(n.h,e.h,t),c:Cn(n.c,e.c,t),l:Cn(n.l,e.l,t),alpha:Cn(n.alpha,e.alpha,t)}}const Ih={forward:EC,reverse:TC,interpolate:vY},Ch={forward:xY,reverse:EY,interpolate:wY};var wC=Object.freeze({__proto__:null,lab:Ih,hcl:Ch});class jn{constructor(e,t,i,r,s){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[o,a]of s)this.labels.push(o),this.outputs.push(a)}static interpolationFactor(e,t,i,r){let s=0;if(e.name==="exponential")s=mv(t,e.base,i,r);else if(e.name==="linear")s=mv(t,1,i,r);else if(e.name==="cubic-bezier"){const o=e.controlPoints;s=new dY(o[0],o[1],o[2],o[3]).solve(mv(t,1,i,r))}return s}static parse(e,t){let[i,r,s,...o]=e;if(!Array.isArray(r)||r.length===0)return t.error("Expected an interpolation type expression.",1);if(r[0]==="linear")r={name:"linear"};else if(r[0]==="exponential"){const u=r[1];if(typeof u!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:u}}else if(r[0]==="cubic-bezier"){const u=r.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:u}}else return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(s=t.parse(s,2,ee),!s)return null;const a=[];let l=null;i==="interpolate-hcl"||i==="interpolate-lab"?l=_s:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let u=0;u<o.length;u+=2){const c=o[u],h=o[u+1],f=u+3,d=u+4;if(typeof c!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(a.length&&a[a.length-1][0]>=c)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);const p=t.parse(h,d,l);if(!p)return null;l=l||p.type,a.push([c,p])}return l.kind!=="number"&&l.kind!=="color"&&!(l.kind==="array"&&l.itemType.kind==="number"&&typeof l.N=="number")?t.error(`Type ${At(l)} is not interpolatable.`):new jn(l,i,r,s,a)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=qp(t,r),a=t[o],l=t[o+1],u=jn.interpolationFactor(this.interpolation,r,a,l),c=i[o].evaluate(e),h=i[o+1].evaluate(e);return this.operator==="interpolate"?gC[this.type.kind.toLowerCase()](c,h,u):this.operator==="interpolate-hcl"?Ch.reverse(Ch.interpolate(Ch.forward(c),Ch.forward(h),u)):Ih.reverse(Ih.interpolate(Ih.forward(c),Ih.forward(h),u))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;this.interpolation.name==="linear"?e=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?e=["linear"]:e=["exponential",this.interpolation.base]:e=["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let i=0;i<this.labels.length;i++)t.push(this.labels[i],this.outputs[i].serialize());return t}}function mv(n,e,t,i){const r=i-t,s=n-t;return r===0?0:e===1?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}class hf{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let i=null;const r=t.expectedType;r&&r.kind!=="value"&&(i=r);const s=[];for(const a of e.slice(1)){const l=t.parse(a,1+s.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,s.push(l)}return r&&s.some(a=>Sh(r,a.type))?new hf(Ne,s):new hf(i,s)}evaluate(e){let t=null,i=0,r;for(const s of this.args){if(i++,t=s.evaluate(e),t&&t instanceof Is&&!t.available&&(r||(r=t),t=null,i===this.args.length))return r;if(t!==null)break}return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(t=>{e.push(t.serialize())}),e}}class Hg{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const i=[];for(let s=1;s<e.length-1;s+=2){const o=e[s];if(typeof o!="string")return t.error(`Expected string, but found ${typeof o} instead.`,s);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",s);const a=t.parse(e[s+1],s+1);if(!a)return null;i.push([o,a])}const r=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return r?new Hg(i,r):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,i]of this.bindings)e.push(t,i.serialize());return e.push(this.result.serialize()),e}}class cx{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,ee),r=t.parse(e[2],2,Un(t.expectedType||Ne));if(!i||!r)return null;const s=r.type;return new cx(s.itemType,i,r)}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new Fi(`Array index out of bounds: ${t} < 0.`);if(t>=i.length)throw new Fi(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new Fi(`Array index must be an integer, but found ${t} instead.`);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class hx{constructor(e,t){this.type=Fe,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,Ne),r=t.parse(e[2],2,Ne);return!i||!r?null:iv(i.type,[Fe,je,ee,Xp,Ne])?new hx(i,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${At(i.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!Rh(t,["boolean","string","number","null"]))throw new Fi(`Expected first argument to be of type boolean, string, number or null, but found ${At(yi(t))} instead.`);if(!Rh(i,["string","array"]))throw new Fi(`Expected second argument to be of type array or string, but found ${At(yi(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Kg{constructor(e,t,i){this.type=ee,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,Ne),r=t.parse(e[2],2,Ne);if(!i||!r)return null;if(!iv(i.type,[Fe,je,ee,Xp,Ne]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${At(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,ee);return s?new Kg(i,r,s):null}else return new Kg(i,r)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!Rh(t,["boolean","string","number","null"]))throw new Fi(`Expected first argument to be of type boolean, string, number or null, but found ${At(yi(t))} instead.`);if(!Rh(i,["string","array"]))throw new Fi(`Expected second argument to be of type array or string, but found ${At(yi(i))} instead.`);if(this.fromIndex){const r=this.fromIndex.evaluate(e);return i.indexOf(t,r)}return i.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class fx{constructor(e,t,i,r,s,o){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=s,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return t.error("Expected an even number of arguments.");let i,r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);const s={},o=[];for(let u=2;u<e.length-1;u+=2){let c=e[u];const h=e[u+1];Array.isArray(c)||(c=[c]);const f=t.concat(u);if(c.length===0)return f.error("Expected at least one branch label.");for(const p of c){if(typeof p!="number"&&typeof p!="string")return f.error("Branch labels must be numbers or strings.");if(typeof p=="number"&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return f.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof p=="number"&&Math.floor(p)!==p)return f.error("Numeric branch labels must be integer values.");if(!i)i=yi(p);else if(f.checkSubtype(i,yi(p)))return null;if(typeof s[String(p)]!="undefined")return f.error("Branch labels must be unique.");s[String(p)]=o.length}const d=t.parse(h,u,r);if(!d)return null;r=r||d.type,o.push(d)}const a=t.parse(e[1],1,Ne);if(!a)return null;const l=t.parse(e[e.length-1],e.length-1,r);return!l||a.type.kind!=="value"&&t.concat(1).checkSubtype(i,a.type)?null:new fx(i,r,a,s,o,l)}evaluate(e){const t=this.input.evaluate(e);return(yi(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),i=[],r={};for(const o of t){const a=r[this.cases[o]];a===void 0?(r[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[a][1].push(o)}const s=o=>this.inputType.kind==="number"?Number(o):o;for(const[o,a]of i)a.length===1?e.push(s(a[0])):e.push(a.map(s)),e.push(this.outputs[o].serialize());return e.push(this.otherwise.serialize()),e}}class dx{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);const r=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,Fe);if(!a)return null;const l=t.parse(e[o+1],o+1,i);if(!l)return null;r.push([a,l]),i=i||l.type}const s=t.parse(e[e.length-1],e.length-1,i);return s?new dx(i,r,s):null}evaluate(e){for(const[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(t=>{e.push(t.serialize())}),e}}class qg{constructor(e,t,i,r){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,Ne),r=t.parse(e[2],2,ee);if(!i||!r)return null;if(!iv(i.type,[Un(Ne),je,Ne]))return t.error(`Expected first argument to be of type array or string, but found ${At(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,ee);return s?new qg(i.type,i,r,s):null}else return new qg(i.type,i,r)}evaluate(e){const t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!Rh(t,["string","array"]))throw new Fi(`Expected first argument to be of type array or string, but found ${At(yi(t))} instead.`);if(this.endIndex){const r=this.endIndex.evaluate(e);return t.slice(i,r)}return t.slice(i)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function SC(n,e){return n==="=="||n==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function SY(n,e,t){return e===t}function RY(n,e,t){return e!==t}function bY(n,e,t){return e<t}function IY(n,e,t){return e>t}function CY(n,e,t){return e<=t}function LY(n,e,t){return e>=t}function RC(n,e,t,i){return i.compare(e,t)===0}function OY(n,e,t,i){return!RC(n,e,t,i)}function AY(n,e,t,i){return i.compare(e,t)<0}function PY(n,e,t,i){return i.compare(e,t)>0}function MY(n,e,t,i){return i.compare(e,t)<=0}function FY(n,e,t,i){return i.compare(e,t)>=0}function gu(n,e,t){const i=n!=="=="&&n!=="!=";return class $O{constructor(s,o,a){this.type=Fe,this.lhs=s,this.rhs=o,this.collator=a,this.hasUntypedArgument=s.type.kind==="value"||o.type.kind==="value"}static parse(s,o){if(s.length!==3&&s.length!==4)return o.error("Expected two or three arguments.");const a=s[0];let l=o.parse(s[1],1,Ne);if(!l)return null;if(!SC(a,l.type))return o.concat(1).error(`"${a}" comparisons are not supported for type '${At(l.type)}'.`);let u=o.parse(s[2],2,Ne);if(!u)return null;if(!SC(a,u.type))return o.concat(2).error(`"${a}" comparisons are not supported for type '${At(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error(`Cannot compare types '${At(l.type)}' and '${At(u.type)}'.`);i&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new ur(u.type,[l]):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new ur(l.type,[u])));let c=null;if(s.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(c=o.parse(s[3],3,Vp),!c)return null}return new $O(l,u,c)}evaluate(s){const o=this.lhs.evaluate(s),a=this.rhs.evaluate(s);if(i&&this.hasUntypedArgument){const l=yi(o),u=yi(a);if(l.kind!==u.kind||!(l.kind==="string"||l.kind==="number"))throw new Fi(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const l=yi(o),u=yi(a);if(l.kind!=="string"||u.kind!=="string")return e(s,o,a)}return this.collator?t(s,o,a,this.collator.evaluate(s)):e(s,o,a)}eachChild(s){s(this.lhs),s(this.rhs),this.collator&&s(this.collator)}outputDefined(){return!0}serialize(){const s=[n];return this.eachChild(o=>{s.push(o.serialize())}),s}}}const NY=gu("==",SY,RC),$Y=gu("!=",RY,OY),DY=gu("<",bY,AY),kY=gu(">",IY,PY),GY=gu("<=",CY,MY),UY=gu(">=",LY,FY);class px{constructor(e,t,i,r,s){this.type=je,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=s}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const i=t.parse(e[1],1,ee);if(!i)return null;const r=e[2];if(typeof r!="object"||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");let s=null;if(r.locale&&(s=t.parse(r.locale,1,je),!s))return null;let o=null;if(r.currency&&(o=t.parse(r.currency,1,je),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=t.parse(r["min-fraction-digits"],1,ee),!a))return null;let l=null;return r["max-fraction-digits"]&&(l=t.parse(r["max-fraction-digits"],1,ee),!l)?null:new px(i,s,o,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class gx{constructor(e){this.type=ee,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=t.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${At(i.type)} instead.`):new gx(i):null}evaluate(e){const t=this.input.evaluate(e);if(typeof t=="string")return t.length;if(Array.isArray(t))return t.length;throw new Fi(`Expected value to be of type string or array, but found ${At(yi(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(t=>{e.push(t.serialize())}),e}}const yv={"==":NY,"!=":$Y,">":kY,"<":DY,">=":UY,"<=":GY,array:ur,at:cx,boolean:ur,case:dx,coalesce:hf,collator:Xg,format:jg,image:Yg,in:hx,"index-of":Kg,interpolate:jn,"interpolate-hcl":jn,"interpolate-lab":jn,length:gx,let:Hg,literal:Mu,match:fx,number:ur,"number-format":px,object:ur,slice:qg,step:Zg,string:ur,"to-boolean":Fo,"to-color":Fo,"to-number":Fo,"to-string":Fo,var:Vg,within:Ja};function bC(n,[e,t,i,r]){e=e.evaluate(n),t=t.evaluate(n),i=i.evaluate(n);const s=r?r.evaluate(n):1,o=aC(e,t,i,s);if(o)throw new Fi(o);return new it(e/255*s,t/255*s,i/255*s,s)}function IC(n,e){return n in e}function _v(n,e){const t=e[n];return typeof t=="undefined"?null:t}function zY(n,e,t,i){for(;t<=i;){const r=t+i>>1;if(e[r]===n)return!0;e[r]>n?i=r-1:t=r+1}return!1}function ka(n){return{type:n}}hr.register(yv,{error:[Z6,[je],(n,[e])=>{throw new Fi(e.evaluate(n))}],typeof:[je,[Ne],(n,[e])=>At(yi(e.evaluate(n)))],"to-rgba":[Un(ee,4),[_s],(n,[e])=>e.evaluate(n).toArray()],rgb:[_s,[ee,ee,ee],bC],rgba:[_s,[ee,ee,ee,ee],bC],has:{type:Fe,overloads:[[[je],(n,[e])=>IC(e.evaluate(n),n.properties())],[[je,fu],(n,[e,t])=>IC(e.evaluate(n),t.evaluate(n))]]},get:{type:Ne,overloads:[[[je],(n,[e])=>_v(e.evaluate(n),n.properties())],[[je,fu],(n,[e,t])=>_v(e.evaluate(n),t.evaluate(n))]]},"feature-state":[Ne,[je],(n,[e])=>_v(e.evaluate(n),n.featureState||{})],properties:[fu,[],n=>n.properties()],"geometry-type":[je,[],n=>n.geometryType()],id:[Ne,[],n=>n.id()],zoom:[ee,[],n=>n.globals.zoom],pitch:[ee,[],n=>n.globals.pitch||0],"distance-from-center":[ee,[],n=>n.distanceFromCenter()],"heatmap-density":[ee,[],n=>n.globals.heatmapDensity||0],"line-progress":[ee,[],n=>n.globals.lineProgress||0],"sky-radial-progress":[ee,[],n=>n.globals.skyRadialProgress||0],accumulated:[Ne,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[ee,ka(ee),(n,e)=>{let t=0;for(const i of e)t+=i.evaluate(n);return t}],"*":[ee,ka(ee),(n,e)=>{let t=1;for(const i of e)t*=i.evaluate(n);return t}],"-":{type:ee,overloads:[[[ee,ee],(n,[e,t])=>e.evaluate(n)-t.evaluate(n)],[[ee],(n,[e])=>-e.evaluate(n)]]},"/":[ee,[ee,ee],(n,[e,t])=>e.evaluate(n)/t.evaluate(n)],"%":[ee,[ee,ee],(n,[e,t])=>e.evaluate(n)%t.evaluate(n)],ln2:[ee,[],()=>Math.LN2],pi:[ee,[],()=>Math.PI],e:[ee,[],()=>Math.E],"^":[ee,[ee,ee],(n,[e,t])=>Math.pow(e.evaluate(n),t.evaluate(n))],sqrt:[ee,[ee],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[ee,[ee],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[ee,[ee],(n,[e])=>Math.log(e.evaluate(n))],log2:[ee,[ee],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[ee,[ee],(n,[e])=>Math.sin(e.evaluate(n))],cos:[ee,[ee],(n,[e])=>Math.cos(e.evaluate(n))],tan:[ee,[ee],(n,[e])=>Math.tan(e.evaluate(n))],asin:[ee,[ee],(n,[e])=>Math.asin(e.evaluate(n))],acos:[ee,[ee],(n,[e])=>Math.acos(e.evaluate(n))],atan:[ee,[ee],(n,[e])=>Math.atan(e.evaluate(n))],min:[ee,ka(ee),(n,e)=>Math.min(...e.map(t=>t.evaluate(n)))],max:[ee,ka(ee),(n,e)=>Math.max(...e.map(t=>t.evaluate(n)))],abs:[ee,[ee],(n,[e])=>Math.abs(e.evaluate(n))],round:[ee,[ee],(n,[e])=>{const t=e.evaluate(n);return t<0?-Math.round(-t):Math.round(t)}],floor:[ee,[ee],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[ee,[ee],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[Fe,[je,Ne],(n,[e,t])=>n.properties()[e.value]===t.value],"filter-id-==":[Fe,[Ne],(n,[e])=>n.id()===e.value],"filter-type-==":[Fe,[je],(n,[e])=>n.geometryType()===e.value],"filter-<":[Fe,[je,Ne],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<r}],"filter-id-<":[Fe,[Ne],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<i}],"filter->":[Fe,[je,Ne],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>r}],"filter-id->":[Fe,[Ne],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>i}],"filter-<=":[Fe,[je,Ne],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[Fe,[Ne],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<=i}],"filter->=":[Fe,[je,Ne],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[Fe,[Ne],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>=i}],"filter-has":[Fe,[Ne],(n,[e])=>e.value in n.properties()],"filter-has-id":[Fe,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[Fe,[Un(je)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[Fe,[Un(Ne)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[Fe,[je,Un(Ne)],(n,[e,t])=>t.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[Fe,[je,Un(Ne)],(n,[e,t])=>zY(n.properties()[e.value],t.value,0,t.value.length-1)],all:{type:Fe,overloads:[[[Fe,Fe],(n,[e,t])=>e.evaluate(n)&&t.evaluate(n)],[ka(Fe),(n,e)=>{for(const t of e)if(!t.evaluate(n))return!1;return!0}]]},any:{type:Fe,overloads:[[[Fe,Fe],(n,[e,t])=>e.evaluate(n)||t.evaluate(n)],[ka(Fe),(n,e)=>{for(const t of e)if(t.evaluate(n))return!0;return!1}]]},"!":[Fe,[Fe],(n,[e])=>!e.evaluate(n)],"is-supported-script":[Fe,[je],(n,[e])=>{const t=n.globals&&n.globals.isSupportedScript;return t?t(e.evaluate(n)):!0}],upcase:[je,[je],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[je,[je],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[je,ka(Ne),(n,e)=>e.map(t=>bh(t.evaluate(n))).join("")],"resolved-locale":[je,[Vp],(n,[e])=>e.evaluate(n).resolvedLocale()]});function vv(n){return{result:"success",value:n}}function mu(n){return{result:"error",value:n}}function BY(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function jY(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function CC(n){return!!n.expression&&n.expression.interpolated}function xv(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":n===null?"null":typeof n}function Ev(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function YY(n){return n}function Tv(n,e){const t=e.type==="color",i=n.stops&&typeof n.stops[0][0]=="object",r=i||n.property!==void 0,s=i||!r,o=n.type||(CC(e)?"exponential":"interval");if(t&&(n=oC({},n),n.stops&&(n.stops=n.stops.map(c=>[c[0],it.parse(c[1])])),n.default?n.default=it.parse(n.default):n.default=it.parse(e.default)),n.colorSpace&&n.colorSpace!=="rgb"&&!wC[n.colorSpace])throw new Error(`Unknown color space: ${n.colorSpace}`);let a,l,u;if(o==="exponential")a=LC;else if(o==="interval")a=VY;else if(o==="categorical"){a=XY,l=Object.create(null);for(const c of n.stops)l[c[0]]=c[1];u=typeof n.stops[0][0]}else if(o==="identity")a=WY;else throw new Error(`Unknown function type "${o}"`);if(i){const c={},h=[];for(let p=0;p<n.stops.length;p++){const m=n.stops[p],g=m[0].zoom;c[g]===void 0&&(c[g]={zoom:g,type:n.type,property:n.property,default:n.default,stops:[]},h.push(g)),c[g].stops.push([m[0].value,m[1]])}const f=[];for(const p of h)f.push([c[p].zoom,Tv(c[p],e)]);const d={name:"linear"};return{kind:"composite",interpolationType:d,interpolationFactor:jn.interpolationFactor.bind(void 0,d),zoomStops:f.map(p=>p[0]),evaluate({zoom:p},m){return LC({stops:f,base:n.base},e,p).evaluate(p,m)}}}else if(s){const c=o==="exponential"?{name:"exponential",base:n.base!==void 0?n.base:1}:null;return{kind:"camera",interpolationType:c,interpolationFactor:jn.interpolationFactor.bind(void 0,c),zoomStops:n.stops.map(h=>h[0]),evaluate:({zoom:h})=>a(n,e,h,l,u)}}else return{kind:"source",evaluate(c,h){const f=h&&h.properties?h.properties[n.property]:void 0;return f===void 0?Lh(n.default,e.default):a(n,e,f,l,u)}}}function Lh(n,e,t){if(n!==void 0)return n;if(e!==void 0)return e;if(t!==void 0)return t}function XY(n,e,t,i,r){const s=typeof t===r?i[t]:void 0;return Lh(s,n.default,e.default)}function VY(n,e,t){if(xv(t)!=="number")return Lh(n.default,e.default);const i=n.stops.length;if(i===1||t<=n.stops[0][0])return n.stops[0][1];if(t>=n.stops[i-1][0])return n.stops[i-1][1];const r=qp(n.stops.map(s=>s[0]),t);return n.stops[r][1]}function LC(n,e,t){const i=n.base!==void 0?n.base:1;if(xv(t)!=="number")return Lh(n.default,e.default);const r=n.stops.length;if(r===1||t<=n.stops[0][0])return n.stops[0][1];if(t>=n.stops[r-1][0])return n.stops[r-1][1];const s=qp(n.stops.map(c=>c[0]),t),o=ZY(t,i,n.stops[s][0],n.stops[s+1][0]),a=n.stops[s][1],l=n.stops[s+1][1];let u=gC[e.type]||YY;if(n.colorSpace&&n.colorSpace!=="rgb"){const c=wC[n.colorSpace];u=(h,f)=>c.reverse(c.interpolate(c.forward(h),c.forward(f),o))}return typeof a.evaluate=="function"?{evaluate(...c){const h=a.evaluate.apply(void 0,c),f=l.evaluate.apply(void 0,c);if(!(h===void 0||f===void 0))return u(h,f,o)}}:u(a,l,o)}function WY(n,e,t){return e.type==="color"?t=it.parse(t):e.type==="formatted"?t=cr.fromString(t.toString()):e.type==="resolvedImage"?t=Is.fromString(t.toString()):xv(t)!==e.type&&(e.type!=="enum"||!e.values[t])&&(t=void 0),Lh(t,n.default,e.default)}function ZY(n,e,t,i){const r=i-t,s=n-t;return r===0?0:e===1?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}class OC{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new lC,this._defaultValue=t?qY(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,i,r,s,o,a,l){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=l||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,i,r,s,o,a,l){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=l||null;try{const u=this.expression.evaluate(this._evaluator);if(u==null||typeof u=="number"&&u!==u)return this._defaultValue;if(this._enumValues&&!(u in this._enumValues))throw new Fi(`Expected value to be one of ${Object.keys(this._enumValues).map(c=>JSON.stringify(c)).join(", ")}, but found ${JSON.stringify(u)} instead.`);return u}catch(u){return this._warningHistory[u.message]||(this._warningHistory[u.message]=!0,typeof console!="undefined"&&console.warn(u.message)),this._defaultValue}}}function AC(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in yv}function Jp(n,e){const t=new Wg(yv,[],e?KY(e):void 0),i=t.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return i?vv(new OC(i,e)):mu(t.errors)}class wv{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!uv(t.expression)}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}}class Sv{constructor(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!uv(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}interpolationFactor(e,t,i){return this.interpolationType?jn.interpolationFactor(this.interpolationType,e,t,i):0}}function PC(n,e){if(n=Jp(n,e),n.result==="error")return n;const t=n.value.expression,i=Kp(t);if(!i&&!BY(e))return mu([new Nr("","data expressions not supported")]);const r=cv(t,["zoom","pitch","distance-from-center"]);if(!r&&!jY(e))return mu([new Nr("","zoom expressions not supported")]);const s=Qp(t);if(!s&&!r)return mu([new Nr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Nr)return mu([s]);if(s instanceof jn&&!CC(e))return mu([new Nr("",'"interpolate" expressions cannot be used with this property')]);if(!s)return vv(i?new wv("constant",n.value):new wv("source",n.value));const o=s instanceof jn?s.interpolation:void 0;return vv(i?new Sv("camera",n.value,s.labels,o):new Sv("composite",n.value,s.labels,o))}class Jg{constructor(e,t){this._parameters=e,this._specification=t,oC(this,Tv(this._parameters,this._specification))}static deserialize(e){return new Jg(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function HY(n,e){if(Ev(n))return new Jg(n,e);if(AC(n)){const t=PC(n,e);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return t.value}else{let t=n;return typeof n=="string"&&e.type==="color"&&(t=it.parse(n)),{kind:"constant",evaluate:()=>t}}}function Qp(n){let e=null;if(n instanceof Hg)e=Qp(n.result);else if(n instanceof hf){for(const t of n.args)if(e=Qp(t),e)break}else(n instanceof Zg||n instanceof jn)&&n.input instanceof hr&&n.input.name==="zoom"&&(e=n);return e instanceof Nr||n.eachChild(t=>{const i=Qp(t);i instanceof Nr?e=i:!e&&i?e=new Nr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Nr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function KY(n){const e={color:_s,string:je,number:ee,enum:je,boolean:Fe,formatted:Wp,resolvedImage:wh};return n.type==="array"?Un(e[n.value]||Ne,n.length):e[n.type]}function qY(n){return n.type==="color"&&Ev(n.default)?new it(0,0,0,0):n.type==="color"?it.parse(n.default)||null:n.default===void 0?null:n.default}function Oh(n){return typeof n=="object"?["literal",n]:n}function JY(n,e){let t=n.stops;if(!t)return QY(n,e);const i=t&&typeof t[0][0]=="object",r=i||n.property!==void 0,s=i||!r;return t=t.map(o=>!r&&e.tokens&&typeof o[1]=="string"?[o[0],nX(o[1])]:[o[0],Oh(o[1])]),i?eX(n,e,t):s?iX(n,e,t):bv(n,e,t)}function QY(n,e){const t=["get",n.property];if(n.default===void 0)return e.type==="string"?["string",t]:t;if(e.type==="enum")return["match",t,Object.keys(e.values),t,n.default];{const i=[e.type==="color"?"to-color":e.type,t,Oh(n.default)];return e.type==="array"&&i.splice(1,0,e.value,e.length||null),i}}function Rv(n){switch(n.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function eX(n,e,t){const i={},r={},s=[];for(let a=0;a<t.length;a++){const l=t[a],u=l[0].zoom;i[u]===void 0&&(i[u]={zoom:u,type:n.type,property:n.property,default:n.default},r[u]=[],s.push(u)),r[u].push([l[0].value,l[1]])}if(Cv({},e)==="exponential"){const a=[Rv(n),["linear"],["zoom"]];for(const l of s){const u=bv(i[l],e,r[l]);yu(a,l,u,!1)}return a}else{const a=["step",["zoom"]];for(const l of s){const u=bv(i[l],e,r[l]);yu(a,l,u,!0)}return Iv(a),a}}function tX(n,e){if(n!==void 0)return n;if(e!==void 0)return e}function MC(n,e){const t=Oh(tX(n.default,e.default));return t===void 0&&e.type==="resolvedImage"?"":t}function bv(n,e,t){const i=Cv(n,e),r=["get",n.property];if(i==="categorical"&&typeof t[0][0]=="boolean"){const s=["case"];for(const o of t)s.push(["==",r,o[0]],o[1]);return s.push(MC(n,e)),s}else if(i==="categorical"){const s=["match",r];for(const o of t)yu(s,o[0],o[1],!1);return s.push(MC(n,e)),s}else if(i==="interval"){const s=["step",["number",r]];for(const o of t)yu(s,o[0],o[1],!0);return Iv(s),n.default===void 0?s:["case",["==",["typeof",r],"number"],s,Oh(n.default)]}else if(i==="exponential"){const s=n.base!==void 0?n.base:1,o=[Rv(n),s===1?["linear"]:["exponential",s],["number",r]];for(const a of t)yu(o,a[0],a[1],!1);return n.default===void 0?o:["case",["==",["typeof",r],"number"],o,Oh(n.default)]}else throw new Error(`Unknown property function type ${i}`)}function iX(n,e,t,i=["zoom"]){const r=Cv(n,e);let s,o=!1;if(r==="interval")s=["step",i],o=!0;else if(r==="exponential"){const a=n.base!==void 0?n.base:1;s=[Rv(n),a===1?["linear"]:["exponential",a],i]}else throw new Error(`Unknown zoom function type "${r}"`);for(const a of t)yu(s,a[0],a[1],o);return Iv(s),s}function Iv(n){n[0]==="step"&&n.length===3&&(n.push(0),n.push(n[3]))}function yu(n,e,t,i){n.length>3&&e===n[n.length-2]||(i&&n.length===2||n.push(e),n.push(t))}function Cv(n,e){return n.type?n.type:e.expression.interpolated?"exponential":"interval"}function nX(n){const e=["concat"],t=/{([^{}]+)}/g;let i=0;for(let r=t.exec(n);r!==null;r=t.exec(n)){const s=n.slice(i,t.lastIndex-r[0].length);i=t.lastIndex,s.length>0&&e.push(s),e.push(["get",r[1]])}if(e.length===1)return n;if(i<n.length)e.push(n.slice(i));else if(e.length===2)return["to-string",e[1]];return e}function rX(n){return n instanceof Number||n instanceof String||n instanceof Boolean?n.valueOf():n}function Lv(n){if(Array.isArray(n))return n.map(Lv);if(n instanceof Object&&!(n instanceof Number||n instanceof String||n instanceof Boolean)){const e={};for(const t in n)e[t]=Lv(n[t]);return e}return rX(n)}function Ov(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!Ov(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function sX(n,e="fill"){if(n==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Ov(n)||(n=eg(n));const t=n;let i=!0;try{i=oX(t)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
|
141
|
-
This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
|
142
|
-
and paste the contents of this message in the report.
|
143
|
-
Thank you!
|
144
|
-
Filter Expression:
|
145
|
-
${JSON.stringify(t,null,2)}
|
146
|
-
`)}const r=sC[`filter_${e}`],s=Jp(i,r);let o=null;if(s.result==="error")throw new Error(s.value.map(c=>`${c.key}: ${c.message}`).join(", "));o=(c,h,f)=>s.value.evaluate(c,h,{},f);let a=null,l=null;if(i!==t){const c=Jp(t,r);if(c.result==="error")throw new Error(c.value.map(h=>`${h.key}: ${h.message}`).join(", "));a=(h,f,d,p,m)=>c.value.evaluate(h,f,{},d,void 0,void 0,p,m),l=!Kp(c.value.expression)}o=o;const u=$C(i);return{filter:o,dynamicFilter:a||void 0,needGeometry:u,needFeature:!!l}}function oX(n){if(!_u(n))return n;let e=Lv(n);return NC(e),e=FC(e),e}function FC(n){if(!Array.isArray(n))return n;const e=uX(n);return e===!0?e:e.map(t=>FC(t))}function NC(n){let e=!1;const t=[];if(n[0]==="case"){for(let i=1;i<n.length-1;i+=2)e=e||_u(n[i]),t.push(n[i+1]);t.push(n[n.length-1])}else if(n[0]==="match"){e=e||_u(n[1]);for(let i=2;i<n.length-1;i+=2)t.push(n[i+1]);t.push(n[n.length-1])}else if(n[0]==="step"){e=e||_u(n[1]);for(let i=1;i<n.length-1;i+=2)t.push(n[i+1])}e&&(n.length=0,n.push("any",...t));for(let i=1;i<n.length;i++)NC(n[i])}function _u(n){if(!Array.isArray(n))return!1;if(aX(n[0]))return!0;for(let e=1;e<n.length;e++){const t=n[e];if(_u(t))return!0}return!1}function aX(n){return n==="pitch"||n==="distance-from-center"}const lX=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function uX(n){if(lX.has(n[0]))for(let e=1;e<n.length;e++){const t=n[e];if(_u(t))return!0}return n}function cX(n,e){return n<e?-1:n>e?1:0}function $C(n){if(!Array.isArray(n))return!1;if(n[0]==="within")return!0;for(let e=1;e<n.length;e++)if($C(n[e]))return!0;return!1}function eg(n){if(!n)return!0;const e=n[0];return n.length<=1?e!=="any":e==="=="?Av(n[1],n[2],"=="):e==="!="?tg(Av(n[1],n[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Av(n[1],n[2],e):e==="any"?hX(n.slice(1)):e==="all"?["all"].concat(n.slice(1).map(eg)):e==="none"?["all"].concat(n.slice(1).map(eg).map(tg)):e==="in"?DC(n[1],n.slice(2)):e==="!in"?tg(DC(n[1],n.slice(2))):e==="has"?kC(n[1]):e==="!has"?tg(kC(n[1])):e==="within"?n:!0}function Av(n,e,t){switch(n){case"$type":return[`filter-type-${t}`,e];case"$id":return[`filter-id-${t}`,e];default:return[`filter-${t}`,n,e]}}function hX(n){return["any"].concat(n.map(eg))}function DC(n,e){if(e.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",n,["literal",e.sort(cX)]]:["filter-in-small",n,["literal",e]]}}function kC(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function tg(n){return["!",n]}var fX=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function dX(n,e){const t={};for(const i in n)i!=="ref"&&(t[i]=n[i]);return fX.forEach(i=>{i in e&&(t[i]=e[i])}),t}function pX(n){n=n.slice();const e=Object.create(null);for(let t=0;t<n.length;t++)e[n[t].id]=n[t];for(let t=0;t<n.length;t++)"ref"in n[t]&&(n[t]=dX(n[t],e[n[t].ref]));return n}Yp(function(n,e){var t=function(){var i=function(v,y,x,_){for(x=x||{},_=v.length;_--;x[v[_]]=y);return x},r=[1,12],s=[1,13],o=[1,9],a=[1,10],l=[1,11],u=[1,14],c=[1,15],h=[14,18,22,24],f=[18,22],d=[22,24],p={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(y,x,_,E,T,w,S){var R=w.length-1;switch(T){case 1:this.$=new String(y.replace(/\\(\\|")/g,"$1").replace(/\\n/g,`
|
147
|
-
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(y),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=w[R-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=w[R-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[w[R-2],w[R]];break;case 16:this.$={},this.$[w[R][0]]=w[R][1];break;case 17:this.$=w[R-2],w[R-2][w[R][0]]=w[R][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[w[R]];break;case 21:this.$=w[R-2],w[R-2].push(w[R]);break}},table:[{3:5,4:r,5:6,6:s,7:3,8:o,9:4,10:a,11:l,12:1,13:2,15:7,16:8,17:u,23:c},{1:[3]},{14:[1,16]},i(h,[2,7]),i(h,[2,8]),i(h,[2,9]),i(h,[2,10]),i(h,[2,11]),i(h,[2,12]),i(h,[2,3]),i(h,[2,4]),i(h,[2,5]),i([14,18,21,22,24],[2,1]),i(h,[2,2]),{3:20,4:r,18:[1,17],19:18,20:19},{3:5,4:r,5:6,6:s,7:3,8:o,9:4,10:a,11:l,13:23,15:7,16:8,17:u,23:c,24:[1,21],25:22},{1:[2,6]},i(h,[2,13]),{18:[1,24],22:[1,25]},i(f,[2,16]),{21:[1,26]},i(h,[2,18]),{22:[1,28],24:[1,27]},i(d,[2,20]),i(h,[2,14]),{3:20,4:r,20:29},{3:5,4:r,5:6,6:s,7:3,8:o,9:4,10:a,11:l,13:30,15:7,16:8,17:u,23:c},i(h,[2,19]),{3:5,4:r,5:6,6:s,7:3,8:o,9:4,10:a,11:l,13:31,15:7,16:8,17:u,23:c},i(f,[2,17]),i(f,[2,15]),i(d,[2,21])],defaultActions:{16:[2,6]},parseError:function(y,x){if(x.recoverable)this.trace(y);else throw new Error(y)},parse:function(y){var x=this,_=[0],E=[null],T=[],w=this.table,S="",R=0,b=0,I=2,O=1,P=T.slice.call(arguments,1),B=Object.create(this.lexer),A={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&(A.yy[L]=this.yy[L]);B.setInput(y,A.yy),A.yy.lexer=B,A.yy.parser=this,typeof B.yylloc=="undefined"&&(B.yylloc={});var D=B.yylloc;T.push(D);var U=B.options&&B.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(){var Se;return Se=B.lex()||O,typeof Se!="number"&&(Se=x.symbols_[Se]||Se),Se}for(var $,k,C,Z,z={},j,V,te,J;;){if(k=_[_.length-1],this.defaultActions[k]?C=this.defaultActions[k]:(($===null||typeof $=="undefined")&&($=G()),C=w[k]&&w[k][$]),typeof C=="undefined"||!C.length||!C[0]){var X="";J=[];for(j in w[k])this.terminals_[j]&&j>I&&J.push("'"+this.terminals_[j]+"'");B.showPosition?X="Parse error on line "+(R+1)+`:
|
148
|
-
`+B.showPosition()+`
|
149
|
-
Expecting `+J.join(", ")+", got '"+(this.terminals_[$]||$)+"'":X="Parse error on line "+(R+1)+": Unexpected "+($==O?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(X,{text:B.match,token:this.terminals_[$]||$,line:B.yylineno,loc:D,expected:J})}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+$);switch(C[0]){case 1:_.push($),E.push(B.yytext),T.push(B.yylloc),_.push(C[1]),$=null,b=B.yyleng,S=B.yytext,R=B.yylineno,D=B.yylloc;break;case 2:if(V=this.productions_[C[1]][1],z.$=E[E.length-V],z._$={first_line:T[T.length-(V||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(V||1)].first_column,last_column:T[T.length-1].last_column},U&&(z._$.range=[T[T.length-(V||1)].range[0],T[T.length-1].range[1]]),Z=this.performAction.apply(z,[S,b,R,A.yy,C[1],E,T].concat(P)),typeof Z!="undefined")return Z;V&&(_=_.slice(0,-1*V*2),E=E.slice(0,-1*V),T=T.slice(0,-1*V)),_.push(this.productions_[C[1]][0]),E.push(z.$),T.push(z._$),te=w[_[_.length-2]][_[_.length-1]],_.push(te);break;case 3:return!0}}return!0}},m=function(){var v={EOF:1,parseError:function(x,_){if(this.yy.parser)this.yy.parser.parseError(x,_);else throw new Error(x)},setInput:function(y,x){return this.yy=x||this.yy||{},this._input=y,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var y=this._input[0];this.yytext+=y,this.yyleng++,this.offset++,this.match+=y,this.matched+=y;var x=y.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),y},unput:function(y){var x=y.length,_=y.split(/(?:\r\n?|\n)/g);this._input=y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var E=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),_.length-1&&(this.yylineno-=_.length-1);var T=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_?(_.length===E.length?this.yylloc.first_column:0)+E[E.length-_.length].length-_[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[T[0],T[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
150
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(y){this.unput(this.match.slice(y))},pastInput:function(){var y=this.matched.substr(0,this.matched.length-this.match.length);return(y.length>20?"...":"")+y.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var y=this.match;return y.length<20&&(y+=this._input.substr(0,20-y.length)),(y.substr(0,20)+(y.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var y=this.pastInput(),x=new Array(y.length+1).join("-");return y+this.upcomingInput()+`
|
151
|
-
`+x+"^"},test_match:function(y,x){var _,E,T;if(this.options.backtrack_lexer&&(T={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(T.yylloc.range=this.yylloc.range.slice(0))),E=y[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+y[0].length},this.yytext+=y[0],this.match+=y[0],this.matches=y,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(y[0].length),this.matched+=y[0],_=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_)return _;if(this._backtrack){for(var w in T)this[w]=T[w];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var y,x,_,E;this._more||(this.yytext="",this.match="");for(var T=this._currentRules(),w=0;w<T.length;w++)if(_=this._input.match(this.rules[T[w]]),_&&(!x||_[0].length>x[0].length)){if(x=_,E=w,this.options.backtrack_lexer){if(y=this.test_match(_,T[w]),y!==!1)return y;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(y=this.test_match(x,T[E]),y!==!1?y:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
152
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var x=this.next();return x||this.lex()},begin:function(x){this.conditionStack.push(x)},popState:function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},pushState:function(x){this.begin(x)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(x,_,E,T){switch(E){case 0:break;case 1:return 6;case 2:return _.yytext=_.yytext.substr(1,_.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return v}();p.lexer=m;function g(){this.yy={}}return g.prototype=p,p.Parser=g,new g}();typeof Y6!="undefined"&&(e.parser=t,e.Parser=t.Parser,e.parse=function(){return t.parse.apply(t,arguments)})});const GC={StyleExpression:OC,isExpression:AC,isExpressionFilter:Ov,createExpression:Jp,createPropertyExpression:PC,normalizePropertyExpression:HY,ZoomConstantExpression:wv,ZoomDependentExpression:Sv,StylePropertyFunction:Jg},UC={convertFunction:JY,createFunction:Tv,isFunction:Ev};var gX=typeof Object.assign=="function"?Object.assign:function(n,e){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),i=1,r=arguments.length;i<r;++i){var s=arguments[i];if(s!=null)for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t};function Pv(n){return n*Math.PI/180}var zC=function(){for(var n=[],e=78271.51696402048;n.length<=24;e/=2)n.push(e);return n}();function BC(n,e){if(typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas!="undefined")return new OffscreenCanvas(n,e);var t=document.createElement("canvas");return t.width=n,t.height=e,t}function mX(n,e){for(var t=0,i=e.length;t<i;++t){var r=e[t];if(r<n&&t+1<i){var s=e[t]/e[t+1];return t+Math.log(e[t]/n)/Math.log(s)}}return i-1}var yX=Array(256).join("\u200A");function Mv(n,e){if(e>=.05){for(var t="",i=n.split(`
|
153
|
-
`),r=yX.slice(0,Math.round(e/.1)),s=0,o=i.length;s<o;++s)s>0&&(t+=`
|
154
|
-
`),t+=i[s].split("").join(r);return t}return n}var Fv;function jC(){return Fv||(Fv=BC(1,1).getContext("2d")),Fv}function Ga(n,e){return jC().measureText(n).width+(n.length-1)*e}var Nv={};U_&&Cr(U_,Si.CLEAR,function(){Nv={}});function $v(n,e,t,i){if(n.indexOf(`
|
155
|
-
`)!==-1){for(var r=n.split(`
|
156
|
-
`),s=[],o=0,a=r.length;o<a;++o)s.push($v(r[o],e,t,i));return s.join(`
|
157
|
-
`)}var l=t+","+e+","+n+","+i,u=Nv[l];if(!u){var c=n.split(" ");if(c.length>1){var h=jC();h.font=e;for(var f=h.measureText("M").width,d=f*t,p="",s=[],o=0,a=c.length;o<a;++o){var m=c[o],g=p+(p?" ":"")+m;Ga(g,i)<=d?p=g:(p&&s.push(p),p=m)}p&&s.push(p);for(var o=0,a=s.length;o<a&&a>1;++o){var v=s[o];if(Ga(v,i)<d*.35){var y=o>0?Ga(s[o-1],i):1/0,x=o<a-1?Ga(s[o+1],i):1/0;s.splice(o,1),a-=1,y<x?(s[o-1]+=" "+v,o-=1):s[o]=v+" "+s[o]}}for(var o=0,a=s.length-1;o<a;++o){var _=s[o],E=s[o+1];if(Ga(_,i)>d*.7&&Ga(E,i)<d*.6){var T=_.split(" "),w=T.pop();Ga(w,i)<d*.2&&(s[o]=T.join(" "),s[o+1]=w+" "+E),a-=1}}u=s.join(`
|
158
|
-
`)}else u=n;u=Mv(u,i),Nv[l]=u}return u}var _X=UC.isFunction,vX=UC.convertFunction,xX=GC.isExpression,EX=GC.createPropertyExpression,TX={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},wX={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},SX=function(n,e){var t=EX(n,e);if(t.result==="error")throw new Error(t.value.map(function(i){return"".concat(i.key,": ").concat(i.message)}).join(", "));return t.value},Dv={},ig={zoom:0},ng,kv;function Le(n,e,t,i,r,s){var o=n.id;s||(s={},console.warn("No functionCache provided to getValue()")),s[o]||(s[o]={});var a=s[o];if(!a[t]){var l=(n[e]||Dv)[t],u=sC["".concat(e,"_").concat(n.type)][t];l===void 0&&(l=u.default);var c=xX(l);if(!c&&_X(l)&&(l=vX(l,u),c=!0),c){var h=SX(l,u);a[t]=h.evaluate.bind(h)}else u.type=="color"&&(l=it.parse(l)),a[t]=function(){return l}}return ig.zoom=i,a[t](ig,r)}function RX(n,e,t,i,r){return r||console.warn("No filterCache provided to evaluateFilter()"),n in r||(r[n]=sX(e).filter),ig.zoom=i,r[n](ig,t)}function Eo(n,e){if(n){if(n.a===0||e===0)return;var t=n.a;return e=e===void 0?1:e,t===0?"transparent":"rgba("+Math.round(n.r*255/t)+","+Math.round(n.g*255/t)+","+Math.round(n.b*255/t)+","+t*e+")"}return n}var bX=/^([^]*)\{(.*)\}([^]*)$/;function Gv(n,e){var t;do if(t=n.match(bX),t){var i=e[t[2]]||"";n=t[1]+i+t[3]}while(t);return n}function IX(n,e,t,i,r,s,o){if(i===void 0&&(i=zC),typeof e=="string"&&(e=JSON.parse(e)),e.version!=8)throw new Error("glStyle version 8 required.");var a,l;if(s){if(typeof Image!="undefined"){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){a=u,l=[u.width,u.height],n.changed(),u.onload=null},u.src=s}else if(typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope){var c=self;c.postMessage({action:"loadImage",src:s}),c.addEventListener("message",function(L){L.data.action==="imageLoaded"&&L.data.src===s&&(a=L.data.image,l=[a.width,a.height])})}}for(var h=pX(e.layers),f={},d=[],p={},m={},g={},v={},y,x=0,_=h.length;x<_;++x){var E=h[x],T=E.id;if(typeof t=="string"&&E.source==t||t.indexOf(T)!==-1){var w=E["source-layer"];if(!y){y=E.source;var S=e.sources[y];if(!S)throw new Error('Source "'.concat(y,'" is not defined'));var R=S.type;if(R!=="vector"&&R!=="geojson")throw new Error('Source "'.concat(y,'" is not of type "vector" or "geojson", but "').concat(R,'"'))}var b=f[w];b||(b=[],f[w]=b),b.push({layer:E,index:x}),d.push(T)}}var I=new mh,O=new lu,P=[],B=function(A,L){var D=A.getProperties(),U=f[D.layer];if(!!U){var G=i.indexOf(L);G==-1&&(G=mX(L,i));for(var $=TX[A.getGeometry().getType()],k={properties:D,type:$},C=-1,Z=function(V,te){var J=U[V],X=J.layer,Se=X.id,_e=X.layout||Dv,be=X.paint||Dv;if(_e.visibility==="none"||"minzoom"in X&&G<X.minzoom||"maxzoom"in X&&G>=X.maxzoom)return"continue";var ht=X.filter;if(!ht||RX(Se,ht,k,G,v)){var Ce=void 0,De=void 0,Xe=void 0,Mt=void 0,Ut=void 0,Q=void 0,Ft=J.index;if($==3&&(X.type=="fill"||X.type=="fill-extrusion"))if(De=Le(X,"paint",X.type+"-opacity",G,k,g),X.type+"-pattern"in be){var zt=Le(X,"paint",X.type+"-pattern",G,k,g);if(zt){var Rt=typeof zt=="string"?Gv(zt,D):zt.toString();if(a&&r&&r[Rt]){++C,Q=P[C],(!Q||!Q.getFill()||Q.getStroke()||Q.getText())&&(Q=new $a({fill:new lu}),P[C]=Q),Xe=Q.getFill(),Q.setZIndex(Ft);var nt=Rt+"."+De,Zt=m[nt];if(!Zt){var Bt=r[Rt],Yi=BC(Bt.width,Bt.height),Li=Yi.getContext("2d");Li.globalAlpha=De,Li.drawImage(a,Bt.x,Bt.y,Bt.width,Bt.height,0,0,Bt.width,Bt.height),Zt=Li.createPattern(Yi,"repeat"),m[nt]=Zt}Xe.setColor(Zt)}}}else Ce=Eo(Le(X,"paint",X.type+"-color",G,k,g),De),X.type+"-outline-color"in be&&(Ut=Eo(Le(X,"paint",X.type+"-outline-color",G,k,g),De)),Ut||(Ut=Ce),(Ce||Ut)&&(++C,Q=P[C],(!Q||Ce&&!Q.getFill()||!Ce&&Q.getFill()||Ut&&!Q.getStroke()||!Ut&&Q.getStroke()||Q.getText())&&(Q=new $a({fill:Ce?new lu:void 0,stroke:Ut?new mh:void 0}),P[C]=Q),Ce&&(Xe=Q.getFill(),Xe.setColor(Ce)),Ut&&(Mt=Q.getStroke(),Mt.setColor(Ut),Mt.setWidth(.5)),Q.setZIndex(Ft));if($!=1&&X.type=="line"){Ce=!("line-pattern"in be)&&"line-color"in be?Eo(Le(X,"paint","line-color",G,k,g),Le(X,"paint","line-opacity",G,k,g)):void 0;var ai=Le(X,"paint","line-width",G,k,g);Ce&&ai>0&&(++C,Q=P[C],(!Q||!Q.getStroke()||Q.getFill()||Q.getText())&&(Q=new $a({stroke:new mh}),P[C]=Q),Mt=Q.getStroke(),Mt.setLineCap(Le(X,"layout","line-cap",G,k,g)),Mt.setLineJoin(Le(X,"layout","line-join",G,k,g)),Mt.setMiterLimit(Le(X,"layout","line-miter-limit",G,k,g)),Mt.setColor(Ce),Mt.setWidth(ai),Mt.setLineDash(be["line-dasharray"]?Le(X,"paint","line-dasharray",G,k,g).map(function(As){return As*ai}):null),Q.setZIndex(Ft))}var Nt=!1,Ze=null,bt=0,Ht=void 0,Kt=void 0,Ct=void 0;if(($==1||$==2)&&"icon-image"in _e){var nn=Le(X,"layout","icon-image",G,k,g);if(nn){Ht=typeof nn=="string"?Gv(nn,D):nn.toString();var Xi=void 0;if(a&&r&&r[Ht]){var Cs=Le(X,"layout","icon-rotation-alignment",G,k,g);if($==2){var Vi=A.getGeometry();if(Vi.getFlatMidpoint||Vi.getFlatMidpoints){var rn=Vi.getExtent(),Yr=Math.sqrt(Math.max(Math.pow((rn[2]-rn[0])/L,2),Math.pow((rn[3]-rn[1])/L,2)));if(Yr>150){var sn=Vi.getType()==="MultiLineString"?Vi.getFlatMidpoints():Vi.getFlatMidpoint();kv||(ng=[NaN,NaN],kv=new k_("Point",ng,[],{},null)),Xi=kv,ng[0]=sn[0],ng[1]=sn[1];var Yn=Le(X,"layout","symbol-placement",G,k,g);if(Yn==="line"&&Cs==="map")for(var fr=Vi.getStride(),jt=Vi.getFlatCoordinates(),Di=0,vi=jt.length-fr;Di<vi;Di+=fr){var li=jt[Di],$t=jt[Di+1],on=jt[Di+fr],Xn=jt[Di+fr+1],ui=Math.min(li,on),ki=Math.min($t,Xn),En=Math.max(li,on),Xr=Math.max($t,Xn);if(sn[0]>=ui&&sn[0]<=En&&sn[1]>=ki&&sn[1]<=Xr){bt=Math.atan2($t-Xn,on-li);break}}}}}if($!==2||Xi){var Ls=Le(X,"layout","icon-size",G,k,g),xi=be["icon-color"]!==void 0?Le(X,"paint","icon-color",G,k,g):null;if(!xi||xi.a!==0){var nt=Ht+"."+Ls;if(xi!==null&&(nt+="."+xi),Kt=p[nt],!Kt){var Vn=r[Ht];Kt=new OI({color:xi?[xi.r*255,xi.g*255,xi.b*255,xi.a]:void 0,img:a,imgSize:l,size:[Vn.width,Vn.height],offset:[Vn.x,Vn.y],rotateWithView:Cs==="map",scale:Ls/Vn.pixelRatio,displacement:"icon-offset"in _e?Le(X,"layout","icon-offset",G,k,g).map(function(On){return-On*Vn.pixelRatio}):void 0}),p[nt]=Kt}}Kt&&(++C,Q=P[C],(!Q||!Q.getImage()||Q.getFill()||Q.getStroke())&&(Q=new $a,P[C]=Q),Q.setGeometry(Xi),Kt.setRotation(bt+Pv(Le(X,"layout","icon-rotate",G,k,g))),Kt.setOpacity(Le(X,"paint","icon-opacity",G,k,g)),Kt.setAnchor(wX[Le(X,"layout","icon-anchor",G,k,g)]),Q.setImage(Kt),Ze=Q.getText(),Q.setText(void 0),Q.setZIndex(Ft),Nt=!0,Ct=!1)}else Ct=!0}}}if($==1&&X.type==="circle"){++C,Q=P[C],(!Q||!Q.getImage()||Q.getFill()||Q.getStroke())&&(Q=new $a,P[C]=Q);var No="circle-radius"in be?Le(X,"paint","circle-radius",G,k,g):5,Ei=Eo(Le(X,"paint","circle-stroke-color",G,k,g),Le(X,"paint","circle-stroke-opacity",G,k,g)),Gi=Eo(Le(X,"paint","circle-color",G,k,g),Le(X,"paint","circle-opacity",G,k,g)),$o=Le(X,"paint","circle-stroke-width",G,k,g),ff=No+"."+Ei+"."+Gi+"."+$o;Kt=p[ff],Kt||(Kt=new vI({radius:No,stroke:Ei&&$o>0?new mh({width:$o,color:Ei}):void 0,fill:Gi?new lu({color:Gi}):void 0}),p[ff]=Kt),Q.setImage(Kt),Ze=Q.getText(),Q.setText(void 0),Q.setGeometry(void 0),Q.setZIndex(Ft),Nt=!0}var ii=void 0,Qg=void 0,Nu,Os,$u,em;if("text-field"in _e){Os=Math.round(Le(X,"layout","text-size",G,k,g));var tm=Le(X,"layout","text-font",G,k,g);Nu=Le(X,"layout","text-line-height",G,k,g),Qg=ev(o?o(tm):tm,Os,Nu),$u=Le(X,"layout","text-letter-spacing",G,k,g),em=Le(X,"layout","text-max-width",G,k,g);var Qa=Le(X,"layout","text-field",G,k,g);typeof Qa=="object"&&Qa.sections?Qa.sections.length===1?ii=Qa.toString():ii=Qa.sections.reduce(function(As,On,pf){var Tx=On.fontStack?On.fontStack.split(","):tm,om=ev(o?o(Tx):Tx,Os*(On.scale||1),Nu),el=On.text;if(el===`
|
159
|
-
`)return As.push(`
|
160
|
-
`,""),As;if($==2){As.push(Mv(el,$u),om);return}el=$v(el,om,em,$u).split(`
|
161
|
-
`);for(var gf=0,kO=el.length;gf<kO;++gf)gf>0&&As.push(`
|
162
|
-
`,""),As.push(el[gf],om);return As},[]):ii=Gv(Qa,D).trim(),De=Le(X,"paint","text-opacity",G,k,g)}if(ii&&De&&!Ct){Nt||(++C,Q=P[C],(!Q||!Q.getText()||Q.getFill()||Q.getStroke())&&(Q=new $a,P[C]=Q),Q.setImage(void 0),Q.setGeometry(void 0)),Q.getText()||Q.setText(Ze||new _j({padding:[2,2,2,2]})),Ze=Q.getText();var mx=_e["text-transform"];mx=="uppercase"?ii=Array.isArray(ii)?ii.map(function(On,pf){return pf%2?On:On.toUpperCase()}):ii.toUpperCase():mx=="lowercase"&&(ii=Array.isArray(ii)?ii.map(function(On,pf){return pf%2?On:On.toLowerCase()}):ii.toLowerCase());var yx=Array.isArray(ii)?ii:$==2?Mv(ii,$u):$v(ii,Qg,em,$u);Ze.setText(yx),Ze.setFont(Qg),Ze.setRotation(Pv(Le(X,"layout","text-rotate",G,k,g)));var df=Le(X,"layout","text-anchor",G,k,g),Yn=Nt||$==1?"point":Le(X,"layout","symbol-placement",G,k,g);Ze.setPlacement(Yn),Ze.setOverflow(Yn==="point");var Do=Le(X,"paint","text-halo-width",G,k,g),_x=Le(X,"layout","text-offset",G,k,g),vx=Le(X,"paint","text-translate",G,k,g),im=0,nm=0;if(Yn=="point"){var rm="center";df.indexOf("left")!==-1?(rm="left",nm=Do):df.indexOf("right")!==-1&&(rm="right",nm=-Do),Ze.setTextAlign(rm);var DO=Le(X,"layout","text-rotation-alignment",G,k,g);Ze.setRotateWithView(DO=="map")}else Ze.setMaxAngle(Pv(Le(X,"layout","text-max-angle",G,k,g))*ii.length/yx.length),Ze.setTextAlign(),Ze.setRotateWithView(!1);var sm="middle";df.indexOf("bottom")==0?(sm="bottom",im=-Do-.5*(Nu-1)*Os):df.indexOf("top")==0&&(sm="top",im=Do+.5*(Nu-1)*Os),Ze.setTextBaseline(sm),Ze.setOffsetX(_x[0]*Os+nm+vx[0]),Ze.setOffsetY(_x[1]*Os+im+vx[1]),O.setColor(Eo(Le(X,"paint","text-color",G,k,g),De)),Ze.setFill(O);var xx=Eo(Le(X,"paint","text-halo-color",G,k,g),De);if(xx){I.setColor(xx),Do*=2;var Ex=.5*Os;I.setWidth(Do<=Ex?Do:Ex),Ze.setStroke(I)}else Ze.setStroke(void 0);var Du=Le(X,"layout","text-padding",G,k,g),ku=Ze.getPadding();Du!==ku[0]&&(ku[0]=Du,ku[1]=Du,ku[2]=Du,ku[3]=Du),Q.setZIndex(Ft)}}},z=0,j=U.length;z<j;++z)Z(z);if(C>-1)return P.length=C+1,P}};return n.setStyle(B),n.set("mapbox-source",y),n.set("mapbox-layers",d),B}var YC={exports:{}};(function(){var n;YC.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return n},getLink:function(e){return"https://fonts.google.com/specimen/"+e.replace(/( )/g,"+")},normalizeName:function(e){return e}},n=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call($D);var CX=YC.exports,XC={},LX=/font-family: ?([^;]*);/,OX=/("|')/g,rg;function AX(n){if(!rg){rg={};for(var e=document.styleSheets,t=0,i=e.length;t<i;++t){var r=e[t];try{var s=r.rules||r.cssRules;if(s)for(var o=0,a=s.length;o<a;++o){var l=s[o];if(l.type==5){var u=l.cssText.match(LX);rg[u[1].replace(OX,"")]=!0}}}catch{}}}return n in rg}var VC={},PX=CX.getNames();function MX(n){var e=n.toString();if(e in VC)return n;for(var t=n.map(function(u){var c=ev(u,1).split(" ");return[c.slice(3).join(" ").replace(/"/g,""),c[1]+c[0]]}),i=0,r=t.length;i<r;++i){var s=t[i],o=s[0];if(!AX(o)&&PX.indexOf(o)!==-1){var a="https://fonts.googleapis.com/css?family="+o.replace(/ /g,"+")+":"+s[1];if(!document.querySelector('link[href="'+a+'"]')){var l=document.createElement("link");l.href=a,l.rel="stylesheet",document.head.appendChild(l)}}}return VC[e]=!0,n}var FX=/^(.*)(\?.*)$/;function NX(n,e){return e&&n.indexOf(".")===0&&(n=e+n),n}function Uv(n,e,t){n=NX(n,e);var i=n.match(FX);return i?i[1]+t+(i.length>2?i[2]:""):n+t}function WC(n,e,t,i,r){return new Promise(function(s,o){if(typeof e!="object"&&(e=JSON.parse(e)),e.version!=8)return o(new Error("glStyle version 8 required."));if(!(n instanceof Nj||n instanceof G8))return o(new Error("Can only apply to VectorLayer or VectorTileLayer"));var a,l,u,c;function h(){!c&&(!e.sprite||l)?(c=IX(n,e,t,r,l,u,MX),n.getStyle()?s():o(new Error("Nothing to show for source [".concat(t,"]")))):c?(n.setStyle(c),s()):o(new Error("Something went wrong trying to apply style."))}if(e.sprite){a=window.devicePixelRatio>=1.5?.5:1;var f=a==.5?"@2x":"",d=Uv(e.sprite,i,f+".json");fetch(d,{credentials:"same-origin"}).then(function(p){return!p.ok&&f!==""?(d=Uv(e.sprite,i,".json"),fetch(d,{credentials:"same-origin"})):p}).then(function(p){if(p.ok)return p.json();o(new Error("Problem fetching sprite from ".concat(d,": ").concat(p.statusText)))}).then(function(p){if(p===void 0)return o(new Error("No sprites found."));l=p,u=Uv(e.sprite,i,f+".png"),h()}).catch(function(p){o(new Error("Sprites cannot be loaded: ".concat(d,": ").concat(p.message)))})}else h()})}var ZC={};function $X(n,e){var t={id:e.id,type:e.type},i={};function r(s){var o=e.layout||{},a=e.paint||{};t.paint=a;var l=typeof n.getSource=="function"?n.getSource().getTileGrid().getZForResolution(s):n.getView().getZoom(),u=typeof n.getTargetElement=="function"?n.getTargetElement():void 0,c,h;if(a["background-color"]!==void 0&&(c=Le(t,"paint","background-color",l,ZC,i),u&&(u.style.background=it.parse(c).toString())),a["background-opacity"]!==void 0&&(h=Le(t,"paint","background-opacity",l,ZC,i),u&&(u.style.opacity=h)),o.visibility=="none"){u&&(u.style.backgroundColor="",u.style.opacity="");return}return Eo(c,h)}if(typeof n.getTargetElement=="function")n.getTargetElement()&&r(),n.on(["change:resolution","change:target"],r);else if(typeof n.setBackground=="function")n.setBackground(r);else throw new Error("Unable to apply background.")}function DX(n,e){e.layers.some(function(t){if(t.type=="background")return $X(n,t),!0})}function kX(n){var e=n.bounds;if(e){var t=Db([e[0],e[1]]),i=Db([e[2],e[3]]);return[t[0],t[1],i[0],i[1]]}}function GX(n,e){n=gX({},n);var t=[e,JSON.stringify(n)].toString(),i=XC[t];return i||(i=new C8({url:n.tiles?void 0:e,tileJSON:n.tiles?n:void 0}),XC[t]=i),new Promise(function(r){var s=i.on("change",function(){var o=i.getState();if(o==="ready"){var a=i.getTileJSON(),l=Array.isArray(a.tiles)?a.tiles:[a.tiles];if(e)for(var u=0,c=l.length;u<c;++u)l[u]=decodeURI(new URL(l[u],e).href);var h=i.getTileGrid(),f=kX(a),d=a.minzoom||0,p=a.maxzoom||22,m=i.get("ol-source");m===void 0&&(m=new Z8({attributions:i.getAttributions(),format:new Xz,tileGrid:new Z_({origin:h.getOrigin(0),extent:f||h.getExtent(),minZoom:d,resolutions:zC.slice(0,p+1),tileSize:512}),urls:l}),i.set("ol-source",m)),u_(s),r(m)}else o==="error"&&(i.set("ol-source",null),u_(s),r(void 0))});i.getState()==="ready"&&i.changed()})}new Dz;const zv="https://api.mapbox.com";function Ah(n){const e="mapbox://";return n.indexOf(e)!==0?"":n.slice(e.length)}function HC(n,e,t){const i=Ah(n);if(!i)return decodeURI(new URL(n,t).href);const r="sprites/";if(i.indexOf(r)!==0)throw new Error(`unexpected sprites url: ${n}`);const s=i.slice(r.length);return`${zv}/styles/v1/${s}/sprite?access_token=${e}`}function KC(n,e,t){const i=Ah(n);if(!i)return decodeURI(new URL(n,t).href);const r="fonts/";if(i.indexOf(r)!==0)throw new Error(`unexpected fonts url: ${n}`);const s=i.slice(r.length);return`${zv}/fonts/v1/${s}/0-255.pbf?access_token=${e}`}function qC(n,e){const t=Ah(n);if(!t)return decodeURI(new URL(n,location.href).href);const i="styles/";if(t.indexOf(i)!==0)throw new Error(`unexpected style url: ${n}`);const r=t.slice(i.length);return`${zv}/styles/v1/${r}?&access_token=${e}`}function sg(n,e,t,i){const r=new URL(n,i),s=Ah(n);return s?`https://{a-d}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`:(e&&r.searchParams.set(t,e),decodeURI(r.href))}class UX extends ni{constructor(e){super(re.ERROR);this.error=e}}const zX={VECTOR:"vector"};class BX extends lb{constructor(e){const t="declutter"in e?e.declutter:!0,i=new a_({state:Ge.LOADING,format:new ES});super({source:i,background:e.background,declutter:t,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError,properties:e.properties});this.setMaxResolutionFromTileGrid_=e.maxResolution===void 0&&e.minZoom===void 0,this.sourceId=e.source,this.layers=e.layers,e.accessToken?this.accessToken=e.accessToken:new URL(e.styleUrl,location.href).searchParams.forEach((s,o)=>{this.accessToken=s,this.accessTokenParam_=o}),this.fetchStyle(e.styleUrl)}fetchStyle(e){const t=qC(e,this.accessToken);fetch(t).then(i=>{if(!i.ok)throw new Error(`unexpected response when fetching style: ${i.status}`);return i.json()}).then(i=>{this.onStyleLoad(i,t.startsWith("data:")?location.href:t)}).catch(i=>{this.handleError(i)})}onStyleLoad(e,t){let i,r;if(this.layers){const a={};for(let u=0;u<e.layers.length;++u){const c=e.layers[u];c.source&&(a[c.id]=c.source)}let l;for(let u=0;u<this.layers.length;++u){const c=a[this.layers[u]];if(!c){this.handleError(new Error(`could not find source for ${this.layers[u]}`));return}if(!l)l=c;else if(l!==c){this.handleError(new Error(`layers can only use a single source, found ${l} and ${c}`));return}}i=l,r=this.layers}else i=this.sourceId,r=i;r||(i=Object.keys(e.sources)[0],r=i),e.sprite&&(e.sprite=HC(e.sprite,this.accessToken,t)),e.glyphs&&(e.glyphs=KC(e.glyphs,this.accessToken,t));const s=e.sources[i];if(s.type!==zX.VECTOR){this.handleError(new Error(`only works for vector sources, found ${s.type}`));return}const o=this.getSource();s.url&&s.url.indexOf("mapbox://")===0?(o.setUrl(sg(s.url,this.accessToken,this.accessTokenParam_,t)),WC(this,e,r).then(()=>{this.configureSource(o,e)}).catch(a=>{this.handleError(a)})):(s.tiles&&(s.tiles=s.tiles.map(a=>sg(a,this.accessToken,this.accessTokenParam_,t))),GX(s,s.url?sg(s.url,this.accessToken,this.accessTokenParam_,t):void 0).then(a=>{WC(this,e,r).then(()=>{this.configureSource(a,e)}).catch(l=>{this.configureSource(a,e),this.handleError(l)})}))}configureSource(e,t){const i=this.getSource();if(e!==i&&(i.setAttributions(e.getAttributions()),i.setTileUrlFunction(e.getTileUrlFunction()),i.setTileLoadFunction(e.getTileLoadFunction()),i.tileGrid=e.tileGrid),this.getBackground()===void 0&&DX(this,t),this.setMaxResolutionFromTileGrid_){const r=i.getTileGrid();this.setMaxResolution(r.getResolution(r.getMinZoom()))}i.setState(Ge.READY)}handleError(e){this.dispatchEvent(new UX(e)),this.getSource().setState(Ge.ERROR)}}var jX=BX;class YX extends zy{constructor(e){super(e)}createRenderer(){return new i_(this)}}var JC=YX;class XX extends qy{constructor(e){super(e);this.vectorRenderer_=new W0(e),this.layerImageRatio_=e.getImageRatio(),this.coordinateToVectorPixelTransform_=xt(),this.renderedPixelToCoordinateTransform_=null}disposeInternal(){this.vectorRenderer_.dispose(),super.disposeInternal()}getFeatures(e){if(!this.vectorRenderer_)return new Promise(i=>i([]));const t=rt(this.coordinateToVectorPixelTransform_,rt(this.renderedPixelToCoordinateTransform_,e.slice()));return this.vectorRenderer_.getFeatures(t)}handleFontsChanged(){this.vectorRenderer_.handleFontsChanged()}prepareFrame(e){const t=e.pixelRatio,i=e.viewState,r=i.resolution,s=e.viewHints,o=this.vectorRenderer_;let a=e.extent;this.layerImageRatio_!==1&&(a=a.slice(0),Vu(a,this.layerImageRatio_));const l=Ae(a)/r,u=ft(a)/r;if(!s[pt.ANIMATING]&&!s[pt.INTERACTING]&&!zs(a)){o.useContainer(null,null,1);const c=o.context,h=ie({},e,{declutterTree:new dd(9),extent:a,size:[l,u],viewState:ie({},e.viewState,{rotation:0})});let f=!0;const d=new ac(a,r,t,c.canvas,function(p){o.prepareFrame(h)&&o.replayGroupChanged&&(o.clipping=!1,o.renderFrame(h,null)&&(o.renderDeclutter(h),f=!1),p())});d.addEventListener(re.CHANGE,function(){if(d.getState()!==ye.LOADED)return;this.image_=f?null:d;const p=d.getResolution(),m=d.getPixelRatio(),g=p*t/m;this.renderedResolution=g,this.coordinateToVectorPixelTransform_=Ti(this.coordinateToVectorPixelTransform_,l/2,u/2,1/g,-1/g,0,-i.center[0],-i.center[1])}.bind(this)),d.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice()),!!this.image_}preRender(){}postRender(){}renderDeclutter(){}forEachFeatureAtCoordinate(e,t,i,r,s){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,t,i,r,s):super.forEachFeatureAtCoordinate(e,t,i,r,s)}}var QC=XX;class VX extends Cl{constructor(e){const t=e||{},i=ie({},t);delete i.imageRatio;super(i);this.imageRatio_=t.imageRatio!==void 0?t.imageRatio:1}getImageRatio(){return this.imageRatio_}createRenderer(){return new QC(this)}}var WX=VX;class ZX{constructor(e,t){this.name=e,this.data=t,this.texture_=null}getTexture(e){if(!this.texture_){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.data.length/4,1,0,e.RGBA,e.UNSIGNED_BYTE,this.data),this.texture_=t}return this.texture_}}var eL=ZX;function tL(n,e,t){const i=t?n.LINEAR:n.NEAREST;n.bindTexture(n.TEXTURE_2D,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,i),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,i)}function HX(n,e,t,i){tL(n,e,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)}function iL(n,e,t,i,r,s){const o=n.getGL();tL(o,e,s);const a=t.byteLength/i[1];let l=1;a%8===0?l=8:a%4===0?l=4:a%2===0&&(l=2);let u;switch(r){case 1:{u=o.LUMINANCE;break}case 2:{u=o.LUMINANCE_ALPHA;break}case 3:{u=o.RGB;break}case 4:{u=o.RGBA;break}default:throw new Error(`Unsupported number of bands: ${r}`)}let c;t instanceof Float32Array?(c=o.FLOAT,n.getExtension("OES_texture_float"),n.getExtension("OES_texture_float_linear")):c=o.UNSIGNED_BYTE;const h=o.getParameter(o.UNPACK_ALIGNMENT);o.pixelStorei(o.UNPACK_ALIGNMENT,l),o.texImage2D(o.TEXTURE_2D,0,u,i[0],i[1],0,u,c,t),o.pixelStorei(o.UNPACK_ALIGNMENT,h)}let Ph=null;function KX(){const n=document.createElement("canvas");n.width=1,n.height=1,Ph=n.getContext("2d")}class qX extends $s{constructor(e){super();this.tile,this.textures=[],this.handleTileChange_=this.handleTileChange_.bind(this),this.size=Tt(e.grid.getTileSize(e.tile.tileCoord[0])),this.tilePixelRatio_=e.tilePixelRatio||1,this.gutter_=e.gutter||0,this.bandCount=NaN,this.helper_=e.helper;const t=new Wl(Vl,ip);t.fromArray([0,1,1,1,1,0,0,0]),this.helper_.flushBufferData(t),this.coords=t,this.setTile(e.tile)}setTile(e){if(e!==this.tile)if(this.tile&&this.tile.removeEventListener(re.CHANGE,this.handleTileChange_),this.tile=e,this.textures.length=0,this.loaded=e.getState()===K.LOADED,this.loaded)this.uploadTile_();else{if(e instanceof ia){const t=e.getImage();t instanceof Image&&!t.crossOrigin&&(t.crossOrigin="anonymous")}e.addEventListener(re.CHANGE,this.handleTileChange_)}}uploadTile_(){const e=this.helper_,t=e.getGL(),i=this.tile;if(i instanceof ia||i instanceof lp){let g=i.getImage();if(this.gutter_!==0){const y=this.tilePixelRatio_*this.gutter_,x=Math.round(g.width-2*y),_=Math.round(g.height-2*y),E=Yt(x,_);i.interpolate||ie(E,wa),E.drawImage(g,y,y,x,_,0,0,x,_),g=E.canvas}const v=t.createTexture();this.textures.push(v),this.bandCount=4,HX(t,v,g,i.interpolate);return}const r=[this.size[0]*this.tilePixelRatio_,this.size[1]*this.tilePixelRatio_],s=i.getData(),o=s instanceof Float32Array,a=r[0]*r[1],l=o?Float32Array:Uint8Array,u=l.BYTES_PER_ELEMENT,c=s.byteLength/r[1];this.bandCount=Math.floor(c/u/r[0]);const h=Math.ceil(this.bandCount/4);if(h===1){const g=t.createTexture();this.textures.push(g),iL(e,g,s,r,this.bandCount,i.interpolate);return}const f=new Array(h);for(let g=0;g<h;++g){const v=t.createTexture();this.textures.push(v);const y=g<h-1?4:this.bandCount%4;f[g]=new l(a*y)}let d=0,p=0;const m=r[0]*this.bandCount;for(let g=0;g<r[1];++g){for(let v=0;v<m;++v){const y=s[p+v],x=Math.floor(d/this.bandCount),_=v%this.bandCount,E=Math.floor(_/4),T=f[E],w=T.length/a,S=_%4;T[x*w+S]=y,++d}p+=c/u}for(let g=0;g<h;++g){const v=this.textures[g],y=f[g],x=y.length/a;iL(e,v,y,r,x,i.interpolate)}}handleTileChange_(){this.tile.getState()===K.LOADED&&(this.loaded=!0,this.uploadTile_(),this.dispatchEvent(re.CHANGE))}disposeInternal(){const e=this.helper_.getGL();this.helper_.deleteBuffer(this.coords);for(let t=0;t<this.textures.length;++t)e.deleteTexture(this.textures[t]);this.tile.removeEventListener(re.CHANGE,this.handleTileChange_)}getPixelData(e,t){if(!this.loaded)return null;if(e=Math.floor(this.tilePixelRatio_*e),t=Math.floor(this.tilePixelRatio_*t),this.tile instanceof um){const s=this.tile.getData(),o=Math.floor(this.tilePixelRatio_*this.size[0]);if(s instanceof DataView){const l=s.byteLength/(this.size[0]*this.size[1]),u=t*o*l+e*l,c=s.buffer.slice(u,u+l);return new DataView(c)}const a=t*o*this.bandCount+e*this.bandCount;return s.slice(a,a+this.bandCount)}Ph||KX(),Ph.clearRect(0,0,1,1);let i;const r=this.tile.getImage();try{Ph.drawImage(r,e,t,1,1,0,0,1,1),i=Ph.getImageData(0,0,1,1).data}catch{return null}return i}}var nL=qX;const Oe={TILE_TEXTURE_ARRAY:"u_tileTextures",TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY",RENDER_EXTENT:"u_renderExtent",RESOLUTION:"u_resolution",ZOOM:"u_zoom"},Mh={TEXTURE_COORD:"a_textureCoord"},JX=[{name:Mh.TEXTURE_COORD,size:2,type:Sn.FLOAT}],QX={};function eV(n){return 2*(1-1/(n+1))-1}function rL(n,e,t){t in n||(n[t]=[]),n[t].push(e)}function Bv(n,e){const t=n.layerStatesArray[n.layerIndex];t.extent&&(e=Ai(e,pn(t.extent,n.viewState.projection)));const i=t.layer.getRenderSource();if(!i.getWrapX()){const r=i.getTileGridForProjection(n.viewState.projection).getExtent();r&&(e=Ai(e,r))}return e}function jv(n,e){return`${n.getKey()},${Nl(e)}`}class tV extends Wy{constructor(e,t){super(e,{uniforms:t.uniforms});this.renderComplete=!1,this.tileTransform_=xt(),this.tempMat4_=Xy(),this.tempTileRange_=new kc(0,0,0,0),this.tempTileCoord_=Fl(0,0,0),this.tempSize_=[0,0],this.program_,this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.indices_=new Wl(Zc,ip),this.indices_.fromArray([0,1,3,1,2,3]);const i=t.cacheSize!==void 0?t.cacheSize:512;this.tileTextureCache_=new Rd(i),this.paletteTextures_=t.paletteTextures||[],this.frameState_=null}reset(e){super.reset({uniforms:e.uniforms}),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.paletteTextures_=e.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)}isDrawableTile_(e){const t=this.getLayer(),i=e.getState(),r=t.getUseInterimTilesOnError();return i==K.LOADED||i==K.EMPTY||i==K.ERROR&&!r}prepareFrameInternal(e){const i=this.getLayer().getRenderSource();return!i||zs(Bv(e,e.extent))?!1:i.getState()===Ge.READY}enqueueTiles(e,t,i,r){const s=e.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(s.projection),u=a.getTilePixelRatio(e.pixelRatio),c=a.getGutterForProjection(s.projection),h=oe(a);h in e.wantedTiles||(e.wantedTiles[h]={});const f=e.wantedTiles[h],d=this.tileTextureCache_,p=Math.max(i-o.getPreload(),l.getMinZoom(),o.getMinZoom());for(let m=i;m>=p;--m){const g=l.getTileRangeForExtentAndZ(t,m,this.tempTileRange_),v=l.getResolution(m);for(let y=g.minX;y<=g.maxX;++y)for(let x=g.minY;x<=g.maxY;++x){const _=Fl(m,y,x,this.tempTileCoord_),E=jv(a,_);let T,w;if(d.containsKey(E)&&(T=d.get(E),w=T.tile),!T||T.tile.key!==a.getKey())if(w=a.getTile(m,y,x,e.pixelRatio,s.projection),!T)T=new nL({tile:w,grid:l,helper:this.helper,tilePixelRatio:u,gutter:c}),d.set(E,T);else if(this.isDrawableTile_(w))T.setTile(w);else{const R=w.getInterimTile();T.setTile(R)}rL(r,T,m);const S=w.getKey();f[S]=!0,w.getState()===K.IDLE&&(e.tileQueue.isKeyQueued(S)||e.tileQueue.enqueue([w,h,l.getTileCoordCenter(_),v]))}}}renderFrame(e){this.frameState_=e,this.renderComplete=!0;const t=this.helper.getGL();this.preRender(t,e);const i=e.viewState,s=this.getLayer().getRenderSource(),o=s.getTileGridForProjection(i.projection),a=Bv(e,e.extent),l=o.getZForResolution(i.resolution,s.zDirection),u={};if(e.nextExtent){const E=o.getZForResolution(i.nextResolution,s.zDirection),T=Bv(e,e.nextExtent);this.enqueueTiles(e,T,E,u)}this.enqueueTiles(e,a,l,u);const c={},h=oe(this),f=e.time;let d=!1;const p=u[l];for(let E=0,T=p.length;E<T;++E){const w=p[E],S=w.tile,R=S.tileCoord;if(w.loaded){const O=S.getAlpha(h,f);if(O===1){S.endTransition(h);continue}d=!0;const P=Nl(R);c[P]=O}if(this.renderComplete=!1,this.findAltTiles_(o,R,l+1,u))continue;const I=o.getMinZoom();for(let O=l-1;O>=I&&!this.findAltTiles_(o,R,O,u);--O);}this.helper.useProgram(this.program_),this.helper.prepareDraw(e,!d);const m=Object.keys(u).map(Number).sort(Vr),g=i.center[0],v=i.center[1];for(let E=0,T=m.length;E<T;++E){const w=m[E],S=o.getResolution(w),R=Tt(o.getTileSize(w),this.tempSize_),b=o.getOrigin(w),I=(g-b[0])/(R[0]*S),O=(b[1]-v)/(R[1]*S),P=i.resolution/S,B=eV(w),A=u[w];for(let L=0,D=A.length;L<D;++L){const U=A[L];if(!U.loaded)continue;const $=U.tile.tileCoord,k=Nl($),C=$[1],Z=$[2];Ti(this.tileTransform_,0,0,2/(e.size[0]*P/R[0]),-2/(e.size[1]*P/R[1]),i.rotation,-(I-C),-(O-Z)),this.helper.setUniformMatrixValue(Oe.TILE_TRANSFORM,qc(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(U.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(JX);let z=0;for(;z<U.textures.length;){const V="TEXTURE"+z,te=`${Oe.TILE_TEXTURE_ARRAY}[${z}]`;t.activeTexture(t[V]),t.bindTexture(t.TEXTURE_2D,U.textures[z]),t.uniform1i(this.helper.getUniformLocation(te),z),++z}for(let V=0;V<this.paletteTextures_.length;++V){const te=this.paletteTextures_[V];t.activeTexture(t["TEXTURE"+z]);const J=te.getTexture(t);t.bindTexture(t.TEXTURE_2D,J),t.uniform1i(this.helper.getUniformLocation(te.name),z),++z}const j=k in c?c[k]:1;j<1&&(e.animate=!0),this.helper.setUniformFloatValue(Oe.TRANSITION_ALPHA,j),this.helper.setUniformFloatValue(Oe.DEPTH,B),this.helper.setUniformFloatValue(Oe.TEXTURE_PIXEL_WIDTH,R[0]),this.helper.setUniformFloatValue(Oe.TEXTURE_PIXEL_HEIGHT,R[1]),this.helper.setUniformFloatValue(Oe.TEXTURE_RESOLUTION,S),this.helper.setUniformFloatValue(Oe.TEXTURE_ORIGIN_X,b[0]+C*R[0]*S),this.helper.setUniformFloatValue(Oe.TEXTURE_ORIGIN_Y,b[1]-Z*R[1]*S),this.helper.setUniformFloatVec4(Oe.RENDER_EXTENT,a),this.helper.setUniformFloatValue(Oe.RESOLUTION,i.resolution),this.helper.setUniformFloatValue(Oe.ZOOM,i.zoom),this.helper.drawElements(0,this.indices_.getSize())}}this.helper.finalizeDraw(e,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const y=this.helper.getCanvas(),x=this.tileTextureCache_;for(;x.canExpireCache();)x.pop().dispose();const _=function(E,T){s.expireCache(T.viewState.projection,QX)};return e.postRenderFunctions.push(_),this.postRender(t,e),y}getData(e){if(!this.helper.getGL())return null;const i=this.frameState_;if(!i)return null;const r=this.getLayer(),s=rt(i.pixelToCoordinateTransform,e.slice()),o=i.viewState,a=r.getExtent();if(a&&!cn(pn(a,o.projection),s))return null;const l=r.getRenderSource(),u=l.getTileGridForProjection(o.projection);if(!l.getWrapX()){const h=u.getExtent();if(h&&!cn(h,s))return null}const c=this.tileTextureCache_;for(let h=u.getZForResolution(o.resolution);h>=u.getMinZoom();--h){const f=u.getTileCoordForCoordAndZ(s,h),d=jv(l,f);if(!c.containsKey(d))continue;const p=c.get(d);if(!p.loaded)continue;const m=u.getOrigin(h),g=Tt(u.getTileSize(h)),v=u.getResolution(h),y=(s[0]-m[0])/v-f[1]*g[0],x=(m[1]-s[1])/v-f[2]*g[1];return p.getPixelData(y,x)}return null}findAltTiles_(e,t,i,r){const s=e.getTileRangeForTileCoordAndZ(t,i,this.tempTileRange_);if(!s)return!1;let o=!0;const a=this.tileTextureCache_,l=this.getLayer().getRenderSource();for(let u=s.minX;u<=s.maxX;++u)for(let c=s.minY;c<=s.maxY;++c){const h=jv(l,[i,u,c]);let f=!1;if(a.containsKey(h)){const d=a.get(h);d.loaded&&(rL(r,d,i),f=!0)}f||(o=!1)}return o}removeHelper(){if(this.helper){const e=this.tileTextureCache_;e.forEach(t=>t.dispose()),e.clear()}super.removeHelper()}disposeInternal(){const e=this.helper;e&&(e.getGL().deleteProgram(this.program_),delete this.program_,e.deleteBuffer(this.indices_)),super.disposeInternal(),delete this.indices_,delete this.tileTextureCache_,delete this.frameState_}}var sL=tV;const ne={NUMBER:1,STRING:2,COLOR:4,BOOLEAN:8,NUMBER_ARRAY:16,ANY:31,NONE:0},$e={};function or(n){if(typeof n=="number")return ne.NUMBER;if(typeof n=="boolean")return ne.BOOLEAN;if(typeof n=="string")return ZE(n)?ne.COLOR|ne.STRING:ne.STRING;if(!Array.isArray(n))throw new Error(`Unhandled value type: ${JSON.stringify(n)}`);const e=n;if(e.every(function(r){return typeof r=="number"}))return e.length===3||e.length===4?ne.COLOR|ne.NUMBER_ARRAY:ne.NUMBER_ARRAY;if(typeof e[0]!="string")throw new Error(`Expected an expression operator but received: ${JSON.stringify(e)}`);const i=$e[e[0]];if(i===void 0)throw new Error(`Unrecognized expression operator: ${JSON.stringify(e)}`);return i.getReturnType(e.slice(1))}function oL(n){return vm(n)%1===0}function Fh(n){const e=n.toString();return e.indexOf(".")===-1?e+".0":e}function Yv(n){if(n.length<2||n.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${n.length}(${n.map(Fh).join(", ")})`}function aL(n){const e=na(n).slice();return e.length<4&&e.push(1),Yv(e.map(function(t,i){return i<3?t/255:t}))}function Nh(n,e){return n.stringLiteralsMap[e]===void 0&&(n.stringLiteralsMap[e]=Object.keys(n.stringLiteralsMap).length),n.stringLiteralsMap[e]}function lL(n,e){return Fh(Nh(n,e))}function ae(n,e,t){if(Array.isArray(e)&&typeof e[0]=="string"){const r=$e[e[0]];if(r===void 0)throw new Error(`Unrecognized expression operator: ${JSON.stringify(e)}`);return r.toGlsl(n,e.slice(1),t)}const i=or(e);if((i&ne.NUMBER)>0)return Fh(e);if((i&ne.BOOLEAN)>0)return e.toString();if((i&ne.STRING)>0&&(t===void 0||t==ne.STRING))return lL(n,e.toString());if((i&ne.COLOR)>0&&(t===void 0||t==ne.COLOR))return aL(e);if((i&ne.NUMBER_ARRAY)>0)return Yv(e);throw new Error(`Unexpected expression ${e} (expected type ${t})`)}function uL(n){if(!(or(n)&ne.NUMBER))throw new Error(`A numeric value was expected, got ${JSON.stringify(n)} instead`)}function ti(n){for(let e=0;e<n.length;e++)uL(n[e])}function cL(n){if(!(or(n)&ne.STRING))throw new Error(`A string value was expected, got ${JSON.stringify(n)} instead`)}function Xv(n){if(!(or(n)&ne.BOOLEAN))throw new Error(`A boolean value was expected, got ${JSON.stringify(n)} instead`)}function St(n,e){if(n.length!==e)throw new Error(`Exactly ${e} arguments were expected, got ${n.length} instead`)}function To(n,e){if(n.length<e)throw new Error(`At least ${e} arguments were expected, got ${n.length} instead`)}function og(n,e){if(n.length>e)throw new Error(`At most ${e} arguments were expected, got ${n.length} instead`)}function hL(n){if(n.length%2!==0)throw new Error(`An even amount of arguments was expected, got ${n} instead`)}function iV(n){if(n.length%2===0)throw new Error(`An odd amount of arguments was expected, got ${n} instead`)}function Vv(n,e){if(!oL(e))throw new Error(`Could not infer only one type from the following expression: ${JSON.stringify(n)}`)}$e.get={getReturnType:function(n){return ne.ANY},toGlsl:function(n,e){St(e,1),cL(e[0]);const t=e[0].toString();return n.attributes.indexOf(t)===-1&&n.attributes.push(t),(n.inFragmentShader?"v_":"a_")+t}};function ag(n){return"u_var_"+n}$e.var={getReturnType:function(n){return ne.ANY},toGlsl:function(n,e){St(e,1),cL(e[0]);const t=e[0].toString();return n.variables.indexOf(t)===-1&&n.variables.push(t),ag(t)}};const Wv="u_paletteTextures";$e.palette={getReturnType:function(n){return ne.COLOR},toGlsl:function(n,e){St(e,2),uL(e[0]);const t=ae(n,e[0]),i=e[1];if(!Array.isArray(i))throw new Error("The second argument of palette must be an array");const r=i.length,s=new Uint8Array(r*4);for(let l=0;l<r;l++){const u=i[l];let c;if(typeof u=="string")c=Jm(u);else{if(!Array.isArray(u))throw new Error("The second argument of palette must be an array of strings or colors");const f=u.length;if(f===4)c=u;else{if(f!==3)throw new Error(`Expected palette color to have 3 or 4 values, got ${f}`);c=[u[0],u[1],u[2],1]}}const h=l*4;s[h]=c[0],s[h+1]=c[1],s[h+2]=c[2],s[h+3]=c[3]*255}n.paletteTextures||(n.paletteTextures=[]);const o=`${Wv}[${n.paletteTextures.length}]`,a=new eL(o,s);return n.paletteTextures.push(a),`texture2D(${o}, vec2((${t} + 0.5) / ${r}.0, 0.5))`}};const Zv="getBandValue";$e.band={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){To(e,1),og(e,3);const t=e[0];if(!(Zv in n.functions)){let o="";const a=n.bandCount||1;for(let l=0;l<a;l++){const u=Math.floor(l/4);let c=l%4;c===a-1&&c===1&&(c=3);const h=`${Oe.TILE_TEXTURE_ARRAY}[${u}]`;o+=`
|
163
|
-
if (band == ${l+1}.0) {
|
164
|
-
return texture2D(${h}, v_textureCoord + vec2(dx, dy))[${c}];
|
165
|
-
}
|
166
|
-
`}n.functions[Zv]=`
|
167
|
-
float getBandValue(float band, float xOffset, float yOffset) {
|
168
|
-
float dx = xOffset / ${Oe.TEXTURE_PIXEL_WIDTH};
|
169
|
-
float dy = yOffset / ${Oe.TEXTURE_PIXEL_HEIGHT};
|
170
|
-
${o}
|
171
|
-
}
|
172
|
-
`}const i=ae(n,t),r=ae(n,e[1]||0),s=ae(n,e[2]||0);return`${Zv}(${i}, ${r}, ${s})`}},$e.time={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,0),"u_time"}},$e.zoom={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,0),"u_zoom"}},$e.resolution={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,0),"u_resolution"}},$e["*"]={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,2),ti(e),`(${ae(n,e[0])} * ${ae(n,e[1])})`}},$e["/"]={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,2),ti(e),`(${ae(n,e[0])} / ${ae(n,e[1])})`}},$e["+"]={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,2),ti(e),`(${ae(n,e[0])} + ${ae(n,e[1])})`}},$e["-"]={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,2),ti(e),`(${ae(n,e[0])} - ${ae(n,e[1])})`}},$e.clamp={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){St(e,3),ti(e);const t=ae(n,e[1]),i=ae(n,e[2]);return`clamp(${ae(n,e[0])}, ${t}, ${i})`}},$e["%"]={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,2),ti(e),`mod(${ae(n,e[0])}, ${ae(n,e[1])})`}},$e["^"]={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,2),ti(e),`pow(${ae(n,e[0])}, ${ae(n,e[1])})`}},$e.abs={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,1),ti(e),`abs(${ae(n,e[0])})`}},$e.floor={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,1),ti(e),`floor(${ae(n,e[0])})`}},$e.round={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,1),ti(e),`floor(${ae(n,e[0])} + 0.5)`}},$e.ceil={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,1),ti(e),`ceil(${ae(n,e[0])})`}},$e.sin={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,1),ti(e),`sin(${ae(n,e[0])})`}},$e.cos={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return St(e,1),ti(e),`cos(${ae(n,e[0])})`}},$e.atan={getReturnType:function(n){return ne.NUMBER},toGlsl:function(n,e){return To(e,1),og(e,2),ti(e),e.length===2?`atan(${ae(n,e[0])}, ${ae(n,e[1])})`:`atan(${ae(n,e[0])})`}},$e[">"]={getReturnType:function(n){return ne.BOOLEAN},toGlsl:function(n,e){return St(e,2),ti(e),`(${ae(n,e[0])} > ${ae(n,e[1])})`}},$e[">="]={getReturnType:function(n){return ne.BOOLEAN},toGlsl:function(n,e){return St(e,2),ti(e),`(${ae(n,e[0])} >= ${ae(n,e[1])})`}},$e["<"]={getReturnType:function(n){return ne.BOOLEAN},toGlsl:function(n,e){return St(e,2),ti(e),`(${ae(n,e[0])} < ${ae(n,e[1])})`}},$e["<="]={getReturnType:function(n){return ne.BOOLEAN},toGlsl:function(n,e){return St(e,2),ti(e),`(${ae(n,e[0])} <= ${ae(n,e[1])})`}};function fL(n){return{getReturnType:function(e){return ne.BOOLEAN},toGlsl:function(e,t){St(t,2);let i=ne.ANY;for(let r=0;r<t.length;r++)i&=or(t[r]);if(i===ne.NONE)throw new Error(`All arguments should be of compatible type, got ${JSON.stringify(t)} instead`);return i&=~ne.COLOR,`(${ae(e,t[0],i)} ${n} ${ae(e,t[1],i)})`}}}$e["=="]=fL("=="),$e["!="]=fL("!="),$e["!"]={getReturnType:function(n){return ne.BOOLEAN},toGlsl:function(n,e){return St(e,1),Xv(e[0]),`(!${ae(n,e[0])})`}};function dL(n){return{getReturnType:function(e){return ne.BOOLEAN},toGlsl:function(e,t){To(t,2);for(let r=0;r<t.length;r++)Xv(t[r]);let i="";return i=t.map(r=>ae(e,r)).join(` ${n} `),i=`(${i})`,i}}}$e.all=dL("&&"),$e.any=dL("||"),$e.between={getReturnType:function(n){return ne.BOOLEAN},toGlsl:function(n,e){St(e,3),ti(e);const t=ae(n,e[1]),i=ae(n,e[2]),r=ae(n,e[0]);return`(${r} >= ${t} && ${r} <= ${i})`}},$e.array={getReturnType:function(n){return ne.NUMBER_ARRAY},toGlsl:function(n,e){To(e,2),og(e,4),ti(e);const t=e.map(function(i){return ae(n,i,ne.NUMBER)});return`vec${e.length}(${t.join(", ")})`}},$e.color={getReturnType:function(n){return ne.COLOR},toGlsl:function(n,e){To(e,3),og(e,4),ti(e);const t=e;e.length===3&&t.push(1);const i=e.map(function(r,s){return ae(n,r,ne.NUMBER)+(s<3?" / 255.0":"")});return`vec${e.length}(${i.join(", ")})`}},$e.interpolate={getReturnType:function(n){let e=ne.COLOR|ne.NUMBER;for(let t=3;t<n.length;t+=2)e=e&or(n[t]);return e},toGlsl:function(n,e,t){hL(e),To(e,6);const i=e[0];let r;switch(i[0]){case"linear":r=1;break;case"exponential":r=i[1];break;default:r=null}if(!r)throw new Error(`Invalid interpolation type for "interpolate" operator, received: ${JSON.stringify(i)}`);const s=t!==void 0?t:ne.ANY,o=$e.interpolate.getReturnType(e)&s;Vv(e,o);const a=ae(n,e[1]),l=Fh(r);let u="";for(let c=2;c<e.length-2;c+=2){const h=ae(n,e[c]),f=u||ae(n,e[c+1],o),d=ae(n,e[c+2]),p=ae(n,e[c+3],o);u=`mix(${f}, ${p}, pow(clamp((${a} - ${h}) / (${d} - ${h}), 0.0, 1.0), ${l}))`}return u}},$e.match={getReturnType:function(n){let e=ne.ANY;for(let t=2;t<n.length;t+=2)e=e&or(n[t]);return e=e&or(n[n.length-1]),e},toGlsl:function(n,e,t){hL(e),To(e,4);const i=t!==void 0?t:ne.ANY,r=$e.match.getReturnType(e)&i;Vv(e,r);const s=ae(n,e[0]),o=ae(n,e[e.length-1],r);let a=null;for(let l=e.length-3;l>=1;l-=2){const u=ae(n,e[l]),c=ae(n,e[l+1],r);a=`(${s} == ${u} ? ${c} : ${a||o})`}return a}},$e.case={getReturnType:function(n){let e=ne.ANY;for(let t=1;t<n.length;t+=2)e=e&or(n[t]);return e=e&or(n[n.length-1]),e},toGlsl:function(n,e,t){iV(e),To(e,3);const i=t!==void 0?t:ne.ANY,r=$e.case.getReturnType(e)&i;Vv(e,r);for(let a=0;a<e.length-1;a+=2)Xv(e[a]);const s=ae(n,e[e.length-1],r);let o=null;for(let a=e.length-3;a>=0;a-=2){const l=ae(n,e[a]),u=ae(n,e[a+1],r);o=`(${l} ? ${u} : ${o||s})`}return o}};class pL{constructor(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}addUniform(e){return this.uniforms.push(e),this}addAttribute(e){return this.attributes.push(e),this}addVarying(e,t,i){return this.varyings.push({name:e,type:t,expression:i}),this}setSizeExpression(e){return this.sizeExpression=e,this}setRotationExpression(e){return this.rotationExpression=e,this}setSymbolOffsetExpression(e){return this.offsetExpression=e,this}setColorExpression(e){return this.colorExpression=e,this}setTextureCoordinateExpression(e){return this.texCoordExpression=e,this}setFragmentDiscardExpression(e){return this.discardExpression=e,this}setSymbolRotateWithView(e){return this.rotateWithView=e,this}getSizeExpression(){return this.sizeExpression}getOffsetExpression(){return this.offsetExpression}getColorExpression(){return this.colorExpression}getTextureCoordinateExpression(){return this.texCoordExpression}getFragmentDiscardExpression(){return this.discardExpression}getSymbolVertexShader(e){const t=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix";let i=this.attributes,r=this.varyings;return e&&(i=i.concat("vec4 a_hitColor"),r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),`precision mediump float;
|
173
|
-
uniform mat4 u_projectionMatrix;
|
174
|
-
uniform mat4 u_offsetScaleMatrix;
|
175
|
-
uniform mat4 u_offsetRotateMatrix;
|
176
|
-
uniform float u_time;
|
177
|
-
uniform float u_zoom;
|
178
|
-
uniform float u_resolution;
|
179
|
-
${this.uniforms.map(function(s){return"uniform "+s+";"}).join(`
|
180
|
-
`)}
|
181
|
-
attribute vec2 a_position;
|
182
|
-
attribute float a_index;
|
183
|
-
${i.map(function(s){return"attribute "+s+";"}).join(`
|
184
|
-
`)}
|
185
|
-
varying vec2 v_texCoord;
|
186
|
-
varying vec2 v_quadCoord;
|
187
|
-
${r.map(function(s){return"varying "+s.type+" "+s.name+";"}).join(`
|
188
|
-
`)}
|
189
|
-
void main(void) {
|
190
|
-
mat4 offsetMatrix = ${t};
|
191
|
-
vec2 halfSize = ${this.sizeExpression} * 0.5;
|
192
|
-
vec2 offset = ${this.offsetExpression};
|
193
|
-
float angle = ${this.rotationExpression};
|
194
|
-
float offsetX;
|
195
|
-
float offsetY;
|
196
|
-
if (a_index == 0.0) {
|
197
|
-
offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);
|
198
|
-
offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);
|
199
|
-
} else if (a_index == 1.0) {
|
200
|
-
offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);
|
201
|
-
offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);
|
202
|
-
} else if (a_index == 2.0) {
|
203
|
-
offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);
|
204
|
-
offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);
|
205
|
-
} else {
|
206
|
-
offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);
|
207
|
-
offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);
|
208
|
-
}
|
209
|
-
vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);
|
210
|
-
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;
|
211
|
-
vec4 texCoord = ${this.texCoordExpression};
|
212
|
-
float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;
|
213
|
-
float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;
|
214
|
-
v_texCoord = vec2(u, v);
|
215
|
-
u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;
|
216
|
-
v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;
|
217
|
-
v_quadCoord = vec2(u, v);
|
218
|
-
${r.map(function(s){return" "+s.name+" = "+s.expression+";"}).join(`
|
219
|
-
`)}
|
220
|
-
}`}getSymbolFragmentShader(e){const t=e?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"";let i=this.varyings;return e&&(i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),`precision mediump float;
|
221
|
-
uniform float u_time;
|
222
|
-
uniform float u_zoom;
|
223
|
-
uniform float u_resolution;
|
224
|
-
${this.uniforms.map(function(r){return"uniform "+r+";"}).join(`
|
225
|
-
`)}
|
226
|
-
varying vec2 v_texCoord;
|
227
|
-
varying vec2 v_quadCoord;
|
228
|
-
${i.map(function(r){return"varying "+r.type+" "+r.name+";"}).join(`
|
229
|
-
`)}
|
230
|
-
void main(void) {
|
231
|
-
if (${this.discardExpression}) { discard; }
|
232
|
-
gl_FragColor = ${this.colorExpression};
|
233
|
-
gl_FragColor.rgb *= gl_FragColor.a;
|
234
|
-
${t}
|
235
|
-
}`}}function gL(n){const e=n.symbol,t=e.size!==void 0?e.size:1,i=e.color||"white",r=e.textureCoord||[0,0,1,1],s=e.offset||[0,0],o=e.opacity!==void 0?e.opacity:1,a=e.rotation!==void 0?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},u=ae(l,t,ne.NUMBER_ARRAY|ne.NUMBER),c=ae(l,s,ne.NUMBER_ARRAY),h=ae(l,r,ne.NUMBER_ARRAY),f=ae(l,a,ne.NUMBER),d={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap,functions:{}},p=ae(d,i,ne.COLOR),m=ae(d,o,ne.NUMBER);let g="1.0";const v=`vec2(${ae(d,t,ne.NUMBER_ARRAY|ne.NUMBER)}).x`;switch(e.symbolType){case"square":break;case"image":break;case"circle":g=`(1.0-smoothstep(1.-4./${v},1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))`;break;case"triangle":const _="(v_quadCoord*2.-1.)",E=`(atan(${_}.x,${_}.y))`;g=`(1.0-smoothstep(.5-3./${v},.5,cos(floor(.5+${E}/2.094395102)*2.094395102-${E})*length(${_})))`;break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}const y=new pL().setSizeExpression(`vec2(${u})`).setRotationExpression(f).setSymbolOffsetExpression(c).setTextureCoordinateExpression(h).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression(`vec4(${p}.rgb, ${p}.a * ${m} * ${g})`);if(n.filter){const _=ae(d,n.filter,ne.BOOLEAN);y.setFragmentDiscardExpression(`!${_}`)}const x={};if(d.variables.forEach(function(_){const E=ag(_);y.addUniform(`float ${E}`),x[E]=function(){if(!n.variables||n.variables[_]===void 0)throw new Error(`The following variable is missing from the style: ${_}`);let T=n.variables[_];return typeof T=="string"&&(T=Nh(l,T)),T!==void 0?T:-9999999}}),e.symbolType==="image"&&e.src){const _=new Image;_.crossOrigin=e.crossOrigin===void 0?"anonymous":e.crossOrigin,_.src=e.src,y.addUniform("sampler2D u_texture").setColorExpression(y.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),x.u_texture=_}return d.attributes.forEach(function(_){l.attributes.indexOf(_)===-1&&l.attributes.push(_),y.addVarying(`v_${_}`,"float",`a_${_}`)}),l.attributes.forEach(function(_){y.addAttribute(`float a_${_}`)}),{builder:y,attributes:l.attributes.map(function(_){return{name:_,callback:function(E,T){let w=T[_];return typeof w=="string"&&(w=Nh(l,w)),w!==void 0?w:-9999999}}}),uniforms:x}}class nV extends ra{constructor(e){const t=ie({},e);super(t);this.parseResult_=gL(e.style),this.styleVariables_=e.style.variables||{},this.hitDetectionDisabled_=!!e.disableHitDetection}createRenderer(){return new Zy(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})}updateStyleVariables(e){ie(this.styleVariables_,e),this.changed()}}var rV=nV;function mL(n,e){const t=`
|
236
|
-
attribute vec2 ${Mh.TEXTURE_COORD};
|
237
|
-
uniform mat4 ${Oe.TILE_TRANSFORM};
|
238
|
-
uniform float ${Oe.TEXTURE_PIXEL_WIDTH};
|
239
|
-
uniform float ${Oe.TEXTURE_PIXEL_HEIGHT};
|
240
|
-
uniform float ${Oe.TEXTURE_RESOLUTION};
|
241
|
-
uniform float ${Oe.TEXTURE_ORIGIN_X};
|
242
|
-
uniform float ${Oe.TEXTURE_ORIGIN_Y};
|
243
|
-
uniform float ${Oe.DEPTH};
|
244
|
-
|
245
|
-
varying vec2 v_textureCoord;
|
246
|
-
varying vec2 v_mapCoord;
|
247
|
-
|
248
|
-
void main() {
|
249
|
-
v_textureCoord = ${Mh.TEXTURE_COORD};
|
250
|
-
v_mapCoord = vec2(
|
251
|
-
${Oe.TEXTURE_ORIGIN_X} + ${Oe.TEXTURE_RESOLUTION} * ${Oe.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0],
|
252
|
-
${Oe.TEXTURE_ORIGIN_Y} - ${Oe.TEXTURE_RESOLUTION} * ${Oe.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1]
|
253
|
-
);
|
254
|
-
gl_Position = ${Oe.TILE_TRANSFORM} * vec4(${Mh.TEXTURE_COORD}, ${Oe.DEPTH}, 1.0);
|
255
|
-
}
|
256
|
-
`,i={inFragmentShader:!0,variables:[],attributes:[],stringLiteralsMap:{},functions:{},bandCount:e},r=[];if(n.color!==void 0){const h=ae(i,n.color,ne.COLOR);r.push(`color = ${h};`)}if(n.contrast!==void 0){const h=ae(i,n.contrast,ne.NUMBER);r.push(`color.rgb = clamp((${h} + 1.0) * color.rgb - (${h} / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(n.exposure!==void 0){const h=ae(i,n.exposure,ne.NUMBER);r.push(`color.rgb = clamp((${h} + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(n.saturation!==void 0){const h=ae(i,n.saturation,ne.NUMBER);r.push(`
|
257
|
-
float saturation = ${h} + 1.0;
|
258
|
-
float sr = (1.0 - saturation) * 0.2126;
|
259
|
-
float sg = (1.0 - saturation) * 0.7152;
|
260
|
-
float sb = (1.0 - saturation) * 0.0722;
|
261
|
-
mat3 saturationMatrix = mat3(
|
262
|
-
sr + saturation, sr, sr,
|
263
|
-
sg, sg + saturation, sg,
|
264
|
-
sb, sb, sb + saturation
|
265
|
-
);
|
266
|
-
color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));
|
267
|
-
`)}if(n.gamma!==void 0){const h=ae(i,n.gamma,ne.NUMBER);r.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${h}));`)}if(n.brightness!==void 0){const h=ae(i,n.brightness,ne.NUMBER);r.push(`color.rgb = clamp(color.rgb + ${h}, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}const s={},o=i.variables.length;if(o>1&&!n.variables)throw new Error(`Missing variables in style (expected ${i.variables})`);for(let h=0;h<o;++h){const f=i.variables[h];if(!(f in n.variables))throw new Error(`Missing '${f}' in style variables`);const d=ag(f);s[d]=function(){let p=n.variables[f];return typeof p=="string"&&(p=Nh(i,p)),p!==void 0?p:-9999999}}const a=Object.keys(s).map(function(h){return`uniform float ${h};`}),l=Math.ceil(e/4);a.push(`uniform sampler2D ${Oe.TILE_TEXTURE_ARRAY}[${l}];`),i.paletteTextures&&a.push(`uniform sampler2D ${Wv}[${i.paletteTextures.length}];`);const u=Object.keys(i.functions).map(function(h){return i.functions[h]}),c=`
|
268
|
-
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
269
|
-
precision highp float;
|
270
|
-
#else
|
271
|
-
precision mediump float;
|
272
|
-
#endif
|
273
|
-
|
274
|
-
varying vec2 v_textureCoord;
|
275
|
-
varying vec2 v_mapCoord;
|
276
|
-
uniform vec4 ${Oe.RENDER_EXTENT};
|
277
|
-
uniform float ${Oe.TRANSITION_ALPHA};
|
278
|
-
uniform float ${Oe.TEXTURE_PIXEL_WIDTH};
|
279
|
-
uniform float ${Oe.TEXTURE_PIXEL_HEIGHT};
|
280
|
-
uniform float ${Oe.RESOLUTION};
|
281
|
-
uniform float ${Oe.ZOOM};
|
282
|
-
|
283
|
-
${a.join(`
|
284
|
-
`)}
|
285
|
-
|
286
|
-
${u.join(`
|
287
|
-
`)}
|
288
|
-
|
289
|
-
void main() {
|
290
|
-
if (
|
291
|
-
v_mapCoord[0] < ${Oe.RENDER_EXTENT}[0] ||
|
292
|
-
v_mapCoord[1] < ${Oe.RENDER_EXTENT}[1] ||
|
293
|
-
v_mapCoord[0] > ${Oe.RENDER_EXTENT}[2] ||
|
294
|
-
v_mapCoord[1] > ${Oe.RENDER_EXTENT}[3]
|
295
|
-
) {
|
296
|
-
discard;
|
297
|
-
}
|
298
|
-
|
299
|
-
vec4 color = texture2D(${Oe.TILE_TEXTURE_ARRAY}[0], v_textureCoord);
|
300
|
-
|
301
|
-
${r.join(`
|
302
|
-
`)}
|
303
|
-
|
304
|
-
if (color.a == 0.0) {
|
305
|
-
discard;
|
306
|
-
}
|
307
|
-
|
308
|
-
gl_FragColor = color;
|
309
|
-
gl_FragColor.rgb *= gl_FragColor.a;
|
310
|
-
gl_FragColor *= ${Oe.TRANSITION_ALPHA};
|
311
|
-
}`;return{vertexShader:t,fragmentShader:c,uniforms:s,paletteTextures:i.paletteTextures}}class yL extends zy{constructor(e){const t=e?ie({},e):{},i=t.style||{};delete t.style;const r=t.cacheSize;delete t.cacheSize;super(t);this.sources_=t.sources,this.renderedResolution_=NaN,this.style_=i,this.cacheSize_=r,this.styleVariables_=this.style_.variables||{},this.addChangeListener(Qe.SOURCE,this.handleSourceUpdate_)}getSources(e,t){const i=this.getSource();return this.sources_?typeof this.sources_=="function"?this.sources_(e,t):this.sources_:i?[i]:[]}getRenderSource(){return this.getLayerState().source||this.getSource()}getSourceState(){const e=this.getRenderSource();return e?e.getState():Ge.UNDEFINED}handleSourceUpdate_(){this.getSource()&&this.setStyle(this.style_)}getSourceBandCount_(){const e=this.getSource();return e&&"bandCount"in e?e.bandCount:4}createRenderer(){const e=mL(this.style_,this.getSourceBandCount_());return new sL(this,{vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,cacheSize:this.cacheSize_,paletteTextures:e.paletteTextures})}renderSources(e,t){const i=this.getRenderer();let r;for(let s=0,o=t.length;s<o;++s)this.getLayerState().source=t[s],i.prepareFrame(e)&&(r=i.renderFrame(e));return r}render(e,t){this.rendered=!0;const i=e.viewState,r=this.getSources(e.extent,i.resolution);let s=!0;for(let a=0,l=r.length;a<l;++a){const u=r[a],c=u.getState();if(c==Ge.LOADING){const h=()=>{u.getState()==Ge.READY&&(u.removeEventListener("change",h),this.changed())};u.addEventListener("change",h)}s=s&&c==Ge.READY}const o=this.renderSources(e,r);if(this.getRenderer().renderComplete&&s)return this.renderedResolution_=i.resolution,o;if(this.renderedResolution_>.5*i.resolution){const a=this.getSources(e.extent,this.renderedResolution_).filter(l=>!r.includes(l));if(a.length>0)return this.renderSources(e,a)}return o}setStyle(e){this.styleVariables_=e.variables||{},this.style_=e;const t=mL(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,paletteTextures:t.paletteTextures}),this.changed()}updateStyleVariables(e){ie(this.styleVariables_,e),this.changed()}}yL.prototype.dispose;var sV=yL;function $h(n,e,t,i){const r=document.createElement("script"),s="olc_"+oe(e);function o(){delete window[s],r.parentNode.removeChild(r)}r.async=!0,r.src=n+(n.indexOf("?")==-1?"?":"&")+(i||"callback")+"="+s;const a=setTimeout(function(){o(),t&&t()},1e4);window[s]=function(l){clearTimeout(a),o(),e(l)},document.getElementsByTagName("head")[0].appendChild(r)}class _L extends Error{constructor(e){const t="Unexpected response status: "+e.status;super(t);this.name="ResponseError",this.response=e}}class vL extends Error{constructor(e){super("Failed to issue request");this.name="ClientError",this.client=e}}function Hv(n){return new Promise(function(e,t){function i(o){const a=o.target;if(!a.status||a.status>=200&&a.status<300){let l;try{l=JSON.parse(a.responseText)}catch(u){const c="Error parsing response text as JSON: "+u.message;t(new Error(c));return}e(l);return}t(new _L(a))}function r(o){t(new vL(o.target))}const s=new XMLHttpRequest;s.addEventListener("load",i),s.addEventListener("error",r),s.open("GET",n),s.setRequestHeader("Accept","application/json"),s.send()})}function Kv(n,e){return e.indexOf("://")>=0?e:new URL(e,n).href}let xL;function oV(n){typeof XMLHttpRequest!="undefined"&&(xL=XMLHttpRequest),global.XMLHttpRequest=n}function aV(){global.XMLHttpRequest=xL}let lV;function uV(n){const e=Object.keys(n.defs),t=e.length;let i,r;for(i=0;i<t;++i){const s=e[i];if(!se(s)){const o=n.defs(s);let a=o.units;!a&&o.projName==="longlat"&&(a=Ui.DEGREES),Mm(new Ho({code:s,axisOrientation:o.axis,metersPerUnit:o.to_meter,units:a}))}}for(i=0;i<t;++i){const s=e[i],o=se(s);for(r=0;r<t;++r){const a=e[r],l=se(a);if(!Rm(s,a))if(n.defs[s]===n.defs[a])$f([o,l]);else{const u=n(s,a);yE(o,l,Nm(o,l,u.forward),Nm(l,o,u.inverse))}}}}class cV extends oc{constructor(e,t,i,r,s,o,a){const l=e.getExtent(),u=t.getExtent(),c=u?Ai(i,u):i,h=fi(c),f=Zl(e,t,h,r),d=Hy,p=new Jy(e,t,c,l,f*d,r),m=p.calculateSourceExtent(),g=o(m,f,s),v=g?ye.IDLE:ye.EMPTY,y=g?g.getPixelRatio():1;super(i,r,y,v);this.targetProj_=t,this.maxSourceExtent_=l,this.triangulation_=p,this.targetResolution_=r,this.targetExtent_=i,this.sourceImage_=g,this.sourcePixelRatio_=y,this.interpolate_=a,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==ye.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const e=this.sourceImage_.getState();if(e==ye.LOADED){const t=Ae(this.targetExtent_)/this.targetResolution_,i=ft(this.targetExtent_)/this.targetResolution_;this.canvas_=t_(t,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=e,this.changed()}load(){if(this.state==ye.IDLE){this.state=ye.LOADING,this.changed();const e=this.sourceImage_.getState();e==ye.LOADED||e==ye.ERROR?this.reproject_():(this.sourceListenerKey_=ge(this.sourceImage_,re.CHANGE,function(t){const i=this.sourceImage_.getState();(i==ye.LOADED||i==ye.ERROR)&&(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}}unlistenSource_(){He(this.sourceListenerKey_),this.sourceListenerKey_=null}}var EL=cV;class hV extends o_{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate);super({attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:fV,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:t,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection});this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:ia,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const e in this.tileCacheForProjection)if(this.tileCacheForProjection[e].canExpireCache())return!0;return!1}expireCache(e,t){const i=this.getTileCacheForProjection(e);this.tileCache.expireCache(this.tileCache==i?t:{});for(const r in this.tileCacheForProjection){const s=this.tileCacheForProjection[r];s.expireCache(s==i?t:{})}}getGutterForProjection(e){return this.getProjection()&&e&&!dn(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getOpaque(e){return this.getProjection()&&e&&!dn(this.getProjection(),e)?!1:super.getOpaque(e)}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||dn(t,e)))return this.tileGrid;{const i=oe(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=n_(e)),this.tileGridForProjection[i]}}getTileCacheForProjection(e){const t=this.getProjection();if(!t||dn(t,e))return this.tileCache;{const i=oe(e);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Dc(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]}}createTile_(e,t,i,r,s,o){const a=[e,t,i],l=this.getTileCoordForTileUrlFunction(a,s),u=l?this.tileUrlFunction(l,r,s):void 0,c=new this.tileClass(a,u!==void 0?K.IDLE:K.EMPTY,u!==void 0?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,c.addEventListener(re.CHANGE,this.handleTileChange.bind(this)),c}getTile(e,t,i,r,s){const o=this.getProjection();if(!o||!s||dn(o,s))return this.getTileInternal(e,t,i,r,o||s);{const a=this.getTileCacheForProjection(s),l=[e,t,i];let u;const c=Nl(l);a.containsKey(c)&&(u=a.get(c));const h=this.getKey();if(u&&u.key==h)return u;{const f=this.getTileGridForProjection(o),d=this.getTileGridForProjection(s),p=this.getTileCoordForTileUrlFunction(l,s),m=new lp(o,f,s,d,l,p,this.getTilePixelRatio(r),this.getGutter(),function(g,v,y,x){return this.getTileInternal(g,v,y,x,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return m.key=h,u?(m.interimTile=u,m.refreshInterimChain(),a.replace(c,m)):a.set(c,m),m}}}getTileInternal(e,t,i,r,s){let o=null;const a=Tr(e,t,i),l=this.getKey();if(!this.tileCache.containsKey(a))o=this.createTile_(e,t,i,r,s,l),this.tileCache.set(a,o);else if(o=this.tileCache.get(a),o.key!=l){const u=o;o=this.createTile_(e,t,i,r,s,l),u.getState()==K.IDLE?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(a,o)}return o}setRenderReprojectionEdges(e){if(this.renderReprojectionEdges_!=e){this.renderReprojectionEdges_=e;for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}}setTileGridForProjection(e,t){{const i=se(e);if(i){const r=oe(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}}}function fV(n,e){n.getImage().src=e}var $r=hV;function TL(n){const e=n[0],t=new Array(e);let i=1<<e-1,r,s;for(r=0;r<e;++r)s=48,n[1]&i&&(s+=1),n[2]&i&&(s+=2),t[r]=String.fromCharCode(s),i>>=1;return t.join("")}const dV='<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>';class pV extends $r{constructor(e){const t=e.hidpi!==void 0?e.hidpi:!1;let i=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(i=e.interpolate);super({cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:i,opaque:!0,projection:se("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Ge.LOADING,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:t?2:1,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,zDirection:e.zDirection});this.hidpi_=t,this.culture_=e.culture!==void 0?e.culture:"en-us",this.maxZoom_=e.maxZoom!==void 0?e.maxZoom:-1,this.apiKey_=e.key,this.imagerySet_=e.imagerySet;const r="https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+this.apiKey_+"&c="+this.culture_;$h(r,this.handleImageryMetadataResponse.bind(this),void 0,"jsonp")}getApiKey(){return this.apiKey_}getImagerySet(){return this.imagerySet_}handleImageryMetadataResponse(e){if(e.statusCode!=200||e.statusDescription!="OK"||e.authenticationResultCode!="ValidCredentials"||e.resourceSets.length!=1||e.resourceSets[0].resources.length!=1){this.setState(Ge.ERROR);return}const t=e.resourceSets[0].resources[0],i=this.maxZoom_==-1?t.zoomMax:this.maxZoom_,r=this.getProjection(),s=ls(r),o=this.hidpi_?2:1,a=t.imageWidth==t.imageHeight?t.imageWidth/o:[t.imageWidth/o,t.imageHeight/o],l=Ra({extent:s,minZoom:t.zoomMin,maxZoom:i,tileSize:a});this.tileGrid=l;const u=this.culture_,c=this.hidpi_;if(this.tileUrlFunction=Hl(t.imageUrlSubdomains.map(function(h){const f=[0,0,0],d=t.imageUrl.replace("{subdomain}",h).replace("{culture}",u);return function(p,m,g){if(p){Fl(p[0],p[1],p[2],f);let v=d;return c&&(v+="&dpi=d1&device=mobile"),v.replace("{quadkey}",TL(f))}else return}})),t.imageryProviders){const h=wn(se("EPSG:4326"),this.getProjection());this.setAttributions(function(f){const d=[],p=f.viewState,m=this.getTileGrid(),g=m.getZForResolution(p.resolution,this.zDirection),y=m.getTileCoordForCoordAndZ(p.center,g)[0];return t.imageryProviders.map(function(x){let _=!1;const E=x.coverageAreas;for(let T=0,w=E.length;T<w;++T){const S=E[T];if(y>=S.zoomMin&&y<=S.zoomMax){const R=S.bbox,b=[R[1],R[0],R[3],R[2]],I=Zo(b,h);if(dt(I,f.extent)){_=!0;break}}}_&&d.push(x.attribution)}),d.push(dV),d}.bind(this))}this.setState(Ge.READY)}}var gV=pV;class mV extends $r{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);const r=t.projection!==void 0?t.projection:"EPSG:3857",s=t.tileGrid!==void 0?t.tileGrid:Ra({extent:ls(r),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,opaque:t.opaque,projection:r,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})}}var Dh=mV;class yV extends Dh{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,maxZoom:e.maxZoom!==void 0?e.maxZoom:18,minZoom:e.minZoom,projection:e.projection,transition:e.transition,wrapX:e.wrapX,zDirection:e.zDirection});this.account_=e.account,this.mapId_=e.map||"",this.config_=e.config||{},this.templateCache_={},this.initializeMap_()}getConfig(){return this.config_}updateConfig(e){ie(this.config_,e),this.initializeMap_()}setConfig(e){this.config_=e||{},this.initializeMap_()}initializeMap_(){const e=JSON.stringify(this.config_);if(this.templateCache_[e]){this.applyTemplate_(this.templateCache_[e]);return}let t="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(t+="/named/"+this.mapId_);const i=new XMLHttpRequest;i.addEventListener("load",this.handleInitResponse_.bind(this,e)),i.addEventListener("error",this.handleInitError_.bind(this)),i.open("POST",t),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.config_))}handleInitResponse_(e,t){const i=t.target;if(!i.status||i.status>=200&&i.status<300){let r;try{r=JSON.parse(i.responseText)}catch{this.setState(Ge.ERROR);return}this.applyTemplate_(r),this.templateCache_[e]=r,this.setState(Ge.READY)}else this.setState(Ge.ERROR)}handleInitError_(e){this.setState(Ge.ERROR)}applyTemplate_(e){const t="https://"+e.cdn_url.https+"/"+this.account_+"/api/v1/map/"+e.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(t)}}var _V=yV;class vV extends ca{constructor(e){super({attributions:e.attributions,wrapX:e.wrapX});this.resolution=void 0,this.distance=e.distance!==void 0?e.distance:20,this.minDistance=e.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=e.geometryFunction||function(t){const i=t.getGeometry();return ce(i.getType()==M.POINT,10),i},this.createCustomCluster_=e.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(e.source||null)}clear(e){this.features.length=0,super.clear(e)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(e,t,i){this.source.loadFeatures(e,t,i),t!==this.resolution&&(this.resolution=t,this.refresh())}setDistance(e){this.updateDistance(e,this.minDistance)}setMinDistance(e){this.updateDistance(this.distance,e)}getMinDistance(){return this.minDistance}setSource(e){this.source&&this.source.removeEventListener(re.CHANGE,this.boundRefresh_),this.source=e,e&&e.addEventListener(re.CHANGE,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(e,t){const i=e===0?0:Math.min(t,e)/e,r=e!==this.distance||this.interpolationRatio!==i;this.distance=e,this.minDistance=t,this.interpolationRatio=i,r&&this.refresh()}cluster(){if(this.resolution===void 0||!this.source)return;const e=wi(),t=this.distance*this.resolution,i=this.source.getFeatures(),r={};for(let s=0,o=i.length;s<o;s++){const a=i[s];if(!(oe(a)in r)){const l=this.geometryFunction(a);if(l){const u=l.getCoordinates();jo(u,e),un(e,t,e);const c=this.source.getFeaturesInExtent(e).filter(function(h){const f=oe(h);return f in r?!1:(r[f]=!0,!0)});this.features.push(this.createCluster(c,e))}}}}createCluster(e,t){const i=[0,0];for(let a=e.length-1;a>=0;--a){const l=this.geometryFunction(e[a]);l?Im(i,l.getCoordinates()):e.splice(a,1)}Cm(i,1/e.length);const r=fi(t),s=this.interpolationRatio,o=new Et([i[0]*(1-s)+r[0]*s,i[1]*(1-s)+r[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(o,e):new lt({geometry:o,features:e})}}var xV=vV;class EV extends Jc{constructor(e){const t=e.projection===void 0?"EPSG:3857":e.projection;let i=e.tileGrid;i===void 0&&t&&(i=Ra({extent:ls(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize}));super({cacheSize:.1,attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:t,tileGrid:i,opaque:e.opaque,state:e.state,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate});this.tileLoadingKeys_={},this.loader_=e.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=e.bandCount===void 0?4:e.bandCount}setLoader(e){this.loader_=e}getTile(e,t,i,r,s){const o=Tr(e,t,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);const a=this.loader_;function l(){return Ax(function(){return a(e,t,i)})}const u=new um(ie({tileCoord:[e,t,i],loader:l},this.tileOptions));return u.key=this.getKey(),u.addEventListener(re.CHANGE,this.handleTileChange_),this.tileCache.set(o,u),u}handleTileChange_(e){const t=e.target,i=oe(t),r=t.getState();let s;r==K.LOADING?(this.tileLoadingKeys_[i]=!0,s=Sa.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==K.ERROR?Sa.TILELOADERROR:r==K.LOADED?Sa.TILELOADEND:void 0),s&&this.dispatchEvent(new s_(s,t))}}var wL=EV;function Ni(n){return(e,...t)=>TV(n,e,t)}function vu(n,e){return Ni(SL(n,e).get)}const{apply:TV,construct:vq,defineProperty:xq,get:Eq,getOwnPropertyDescriptor:SL,getPrototypeOf:qv,has:Tq,ownKeys:wV,set:wq,setPrototypeOf:Sq}=Reflect,{iterator:kh,species:Rq,toStringTag:SV,for:bq}=Symbol,RV=Object,{create:Jv,defineProperty:bV,freeze:Iq,is:Cq}=RV,IV=Array,CV=IV.prototype,RL=CV[kh],LV=Ni(RL),bL=ArrayBuffer,OV=bL.prototype;vu(OV,"byteLength");const IL=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:null;IL&&vu(IL.prototype,"byteLength");const CL=qv(Uint8Array);CL.from;const tn=CL.prototype;tn[kh],Ni(tn.keys),Ni(tn.values),Ni(tn.entries),Ni(tn.set),Ni(tn.reverse),Ni(tn.fill),Ni(tn.copyWithin),Ni(tn.sort),Ni(tn.slice),Ni(tn.subarray),vu(tn,"buffer"),vu(tn,"byteOffset"),vu(tn,"length"),vu(tn,SV);const xu=Uint32Array,AV=Float32Array,lg=qv([][kh]()),PV=Ni(lg.next),MV=Ni(function*(){}().next),FV=qv(lg),NV=DataView.prototype,$V=Ni(NV.getUint16),Qv=WeakMap,LL=Qv.prototype,OL=Ni(LL.get),DV=Ni(LL.set),AL=new Qv,kV=Jv(null,{next:{value:function(){const e=OL(AL,this);return PV(e)}},[kh]:{value:function(){return this}}});function GV(n){if(n[kh]===RL)return n;const e=Jv(kV);return DV(AL,e,LV(n)),e}const UV=new Qv,zV=Jv(FV,{next:{value:function(){const e=OL(UV,this);return MV(e)},writable:!0,configurable:!0}});for(const n of wV(lg))n!=="next"&&bV(zV,n,SL(lg,n));const PL=new bL(4),BV=new AV(PL),jV=new xu(PL),Dr=new xu(512),kr=new xu(512);for(let n=0;n<256;++n){const e=n-127;e<-27?(Dr[n]=0,Dr[n|256]=32768,kr[n]=24,kr[n|256]=24):e<-14?(Dr[n]=1024>>-e-14,Dr[n|256]=1024>>-e-14|32768,kr[n]=-e-1,kr[n|256]=-e-1):e<=15?(Dr[n]=e+15<<10,Dr[n|256]=e+15<<10|32768,kr[n]=13,kr[n|256]=13):e<128?(Dr[n]=31744,Dr[n|256]=64512,kr[n]=24,kr[n|256]=24):(Dr[n]=31744,Dr[n|256]=64512,kr[n]=13,kr[n|256]=13)}const e1=new xu(2048),Eu=new xu(64),ML=new xu(64);for(let n=1;n<1024;++n){let e=n<<13,t=0;for(;(e&8388608)===0;)e<<=1,t-=8388608;e&=-8388609,t+=947912704,e1[n]=e|t}for(let n=1024;n<2048;++n)e1[n]=939524096+(n-1024<<13);for(let n=1;n<31;++n)Eu[n]=n<<23;Eu[31]=1199570944,Eu[32]=2147483648;for(let n=33;n<63;++n)Eu[n]=2147483648+(n-32<<23);Eu[63]=3347054592;for(let n=1;n<64;++n)n!==32&&(ML[n]=1024);function YV(n){const e=n>>10;return jV[0]=e1[ML[e]+(n&1023)]+Eu[e],BV[0]}function FL(n,e,...t){return YV($V(n,e,...GV(t)))}function XV(n,e,t){const i=t&&t.debug||!1;i&&console.log("getting "+e+" in "+n);const r=typeof n=="object"?n.outer:n,s=`${e}\\="([^"]*)"`;i&&console.log("pattern:",s);const a=new RegExp(s).exec(r);if(i&&console.log("match:",a),a)return a[1]}var t1=XV;function VV(n,e,t){const r=new RegExp(e).exec(n.slice(t));return r?t+r.index:-1}var WV=VV;const i1=WV;function ZV(n,e,t){const i=t&&t.debug||!1,r=t&&t.startIndex||0;i&&console.log("starting findTagByName with",e," and ",t);const s=i1(n,`<${e}[ >]`,r);if(i&&console.log("start:",s),s===-1)return;const o=n.slice(s+e.length);let a=i1(o,"[ /]"+e+">",0);const l=a===-1;l&&(a=i1(o,"[ /]>",0));const u=s+e.length+a+1+(l?0:e.length)+1;if(i&&console.log("end:",u),u===-1)return;const c=n.slice(s,u);let h;return l?h=null:h=c.slice(c.indexOf(">")+1,c.lastIndexOf("<")),{inner:h,outer:c,start:s,end:u}}var HV=ZV;const KV=HV;function qV(n,e,t){const i=[],r=t&&t.debug||!1;let s=t&&t.startIndex||0,o;for(;o=KV(n,e,{debug:r,startIndex:s});)s=o.end,i.push(o);return r&&console.log("findTagsByName found",i.length,"tags"),i}var JV=qV;const Gh={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Gr={};for(const n in Gh)Gh.hasOwnProperty(n)&&(Gr[Gh[n]]=parseInt(n,10));const QV=[Gr.BitsPerSample,Gr.ExtraSamples,Gr.SampleFormat,Gr.StripByteCounts,Gr.StripOffsets,Gr.StripRowCounts,Gr.TileByteCounts,Gr.TileOffsets,Gr.SubIFDs],n1={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ke={};for(const n in n1)n1.hasOwnProperty(n)&&(ke[n1[n]]=parseInt(n,10));const Ln={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},eW={Unspecified:0,Assocalpha:1,Unassalpha:2},tW={Version:0,AddCompression:1},NL={None:0,Deflate:1},ug={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},iW={};for(const n in ug)ug.hasOwnProperty(n)&&(iW[ug[n]]=parseInt(n,10));function nW(n,e){const{width:t,height:i}=n,r=new Uint8Array(t*i*3);let s;for(let o=0,a=0;o<n.length;++o,a+=3)s=256-n[o]/e*256,r[a]=s,r[a+1]=s,r[a+2]=s;return r}function rW(n,e){const{width:t,height:i}=n,r=new Uint8Array(t*i*3);let s;for(let o=0,a=0;o<n.length;++o,a+=3)s=n[o]/e*256,r[a]=s,r[a+1]=s,r[a+2]=s;return r}function sW(n,e){const{width:t,height:i}=n,r=new Uint8Array(t*i*3),s=e.length/3,o=e.length/3*2;for(let a=0,l=0;a<n.length;++a,l+=3){const u=n[a];r[l]=e[u]/65536*256,r[l+1]=e[u+s]/65536*256,r[l+2]=e[u+o]/65536*256}return r}function oW(n){const{width:e,height:t}=n,i=new Uint8Array(e*t*3);for(let r=0,s=0;r<n.length;r+=4,s+=3){const o=n[r],a=n[r+1],l=n[r+2],u=n[r+3];i[s]=255*((255-o)/256)*((255-u)/256),i[s+1]=255*((255-a)/256)*((255-u)/256),i[s+2]=255*((255-l)/256)*((255-u)/256)}return i}function aW(n){const{width:e,height:t}=n,i=new Uint8ClampedArray(e*t*3);for(let r=0,s=0;r<n.length;r+=3,s+=3){const o=n[r],a=n[r+1],l=n[r+2];i[s]=o+1.402*(l-128),i[s+1]=o-.34414*(a-128)-.71414*(l-128),i[s+2]=o+1.772*(a-128)}return i}const lW=.95047,uW=1,cW=1.08883;function hW(n){const{width:e,height:t}=n,i=new Uint8Array(e*t*3);for(let r=0,s=0;r<n.length;r+=3,s+=3){const o=n[r+0],a=n[r+1]<<24>>24,l=n[r+2]<<24>>24;let u=(o+16)/116,c=a/500+u,h=u-l/200,f,d,p;c=lW*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),u=uW*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),h=cW*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),f=c*3.2406+u*-1.5372+h*-.4986,d=c*-.9689+u*1.8758+h*.0415,p=c*.0557+u*-.204+h*1.057,f=f>.0031308?1.055*f**(1/2.4)-.055:12.92*f,d=d>.0031308?1.055*d**(1/2.4)-.055:12.92*d,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,i[s]=Math.max(0,Math.min(1,f))*255,i[s+1]=Math.max(0,Math.min(1,d))*255,i[s+2]=Math.max(0,Math.min(1,p))*255}return i}const $L=new Map;function wo(n,e){Array.isArray(n)||(n=[n]),n.forEach(t=>$L.set(t,e))}async function DL(n){const e=$L.get(n.Compression);if(!e)throw new Error(`Unknown compression method identifier: ${n.Compression}`);const t=await e();return new t(n)}wo([void 0,1],()=>Promise.resolve().then(function(){return _H}).then(n=>n.default)),wo(5,()=>Promise.resolve().then(function(){return wH}).then(n=>n.default)),wo(6,()=>{throw new Error("old style JPEG compression is not supported.")}),wo(7,()=>Promise.resolve().then(function(){return CH}).then(n=>n.default)),wo([8,32946],()=>Promise.resolve().then(function(){return aq}).then(n=>n.default)),wo(32773,()=>Promise.resolve().then(function(){return uq}).then(n=>n.default)),wo(34887,()=>Promise.resolve().then(function(){return fq}).then(n=>n.default)),wo(50001,()=>Promise.resolve().then(function(){return pq}).then(n=>n.default));function cg(n,e,t,i=1){return new(Object.getPrototypeOf(n)).constructor(e*t*i)}function fW(n,e,t,i,r){const s=e/i,o=t/r;return n.map(a=>{const l=cg(a,i,r);for(let u=0;u<r;++u){const c=Math.min(Math.round(o*u),t-1);for(let h=0;h<i;++h){const f=Math.min(Math.round(s*h),e-1),d=a[c*e+f];l[u*i+h]=d}}return l})}function Tu(n,e,t){return(1-t)*n+t*e}function dW(n,e,t,i,r){const s=e/i,o=t/r;return n.map(a=>{const l=cg(a,i,r);for(let u=0;u<r;++u){const c=o*u,h=Math.floor(c),f=Math.min(Math.ceil(c),t-1);for(let d=0;d<i;++d){const p=s*d,m=p%1,g=Math.floor(p),v=Math.min(Math.ceil(p),e-1),y=a[h*e+g],x=a[h*e+v],_=a[f*e+g],E=a[f*e+v],T=Tu(Tu(y,x,m),Tu(_,E,m),c%1);l[u*i+d]=T}}return l})}function pW(n,e,t,i,r,s="nearest"){switch(s.toLowerCase()){case"nearest":return fW(n,e,t,i,r);case"bilinear":case"linear":return dW(n,e,t,i,r);default:throw new Error(`Unsupported resampling method: '${s}'`)}}function gW(n,e,t,i,r,s){const o=e/i,a=t/r,l=cg(n,i,r,s);for(let u=0;u<r;++u){const c=Math.min(Math.round(a*u),t-1);for(let h=0;h<i;++h){const f=Math.min(Math.round(o*h),e-1);for(let d=0;d<s;++d){const p=n[c*e*s+f*s+d];l[u*i*s+h*s+d]=p}}}return l}function mW(n,e,t,i,r,s){const o=e/i,a=t/r,l=cg(n,i,r,s);for(let u=0;u<r;++u){const c=a*u,h=Math.floor(c),f=Math.min(Math.ceil(c),t-1);for(let d=0;d<i;++d){const p=o*d,m=p%1,g=Math.floor(p),v=Math.min(Math.ceil(p),e-1);for(let y=0;y<s;++y){const x=n[h*e*s+g*s+y],_=n[h*e*s+v*s+y],E=n[f*e*s+g*s+y],T=n[f*e*s+v*s+y],w=Tu(Tu(x,_,m),Tu(E,T,m),c%1);l[u*i*s+d*s+y]=w}}}return l}function yW(n,e,t,i,r,s,o="nearest"){switch(o.toLowerCase()){case"nearest":return gW(n,e,t,i,r,s);case"bilinear":case"linear":return mW(n,e,t,i,r,s);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function _W(n,e,t){let i=0;for(let r=e;r<t;++r)i+=n[r];return i}function r1(n,e,t){switch(n){case 1:if(e<=8)return new Uint8Array(t);if(e<=16)return new Uint16Array(t);if(e<=32)return new Uint32Array(t);break;case 2:if(e===8)return new Int8Array(t);if(e===16)return new Int16Array(t);if(e===32)return new Int32Array(t);break;case 3:switch(e){case 16:case 32:return new Float32Array(t);case 64:return new Float64Array(t)}break}throw Error("Unsupported data format/bitsPerSample")}function vW(n,e){return(n===1||n===2)&&e<=32&&e%8===0?!1:!(n===3&&(e===16||e===32||e===64))}function xW(n,e,t,i,r,s,o){const a=new DataView(n),l=t===2?o*s:o*s*i,u=t===2?1:i,c=r1(e,r,l),h=parseInt("1".repeat(r),2);if(e===1){let f;t===1?f=i*r:f=r;let d=s*f;(d&7)!==0&&(d=d+7&-8);for(let p=0;p<o;++p){const m=p*d;for(let g=0;g<s;++g){const v=m+g*u*r;for(let y=0;y<u;++y){const x=v+y*r,_=(p*s+g)*u+y,E=Math.floor(x/8),T=x%8;if(T+r<=8)c[_]=a.getUint8(E)>>8-r-T&h;else if(T+r<=16)c[_]=a.getUint16(E)>>16-r-T&h;else if(T+r<=24){const w=a.getUint16(E)<<8|a.getUint8(E+2);c[_]=w>>24-r-T&h}else c[_]=a.getUint32(E)>>32-r-T&h}}}}return c.buffer}class EW{constructor(e,t,i,r,s,o){this.fileDirectory=e,this.geoKeys=t,this.dataView=i,this.littleEndian=r,this.tiles=s?{}:null,this.isTiled=!e.StripOffsets;const a=e.PlanarConfiguration;if(this.planarConfiguration=typeof a=="undefined"?1:a,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel!="undefined"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip!="undefined"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}getBytesPerPixel(){let e=0;for(let t=0;t<this.fileDirectory.BitsPerSample.length;++t)e+=this.getSampleByteSize(t);return e}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}getReaderForSample(e){const t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,i=this.fileDirectory.BitsPerSample[e];switch(t){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(r,s){return FL(this,r,s)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(e=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}getBitsPerSample(e=0){return this.fileDirectory.BitsPerSample[e]}getArrayForSample(e,t){const i=this.getSampleFormat(e),r=this.getBitsPerSample(e);return r1(i,r,t)}async getTileOrStrip(e,t,i,r,s){const o=Math.ceil(this.getWidth()/this.getTileWidth()),a=Math.ceil(this.getHeight()/this.getTileHeight());let l;const{tiles:u}=this;this.planarConfiguration===1?l=t*o+e:this.planarConfiguration===2&&(l=i*o*a+t*o+e);let c,h;this.isTiled?(c=this.fileDirectory.TileOffsets[l],h=this.fileDirectory.TileByteCounts[l]):(c=this.fileDirectory.StripOffsets[l],h=this.fileDirectory.StripByteCounts[l]);const f=(await this.source.fetch([{offset:c,length:h}],s))[0];let d;return u===null||!u[l]?(d=(async()=>{let p=await r.decode(this.fileDirectory,f);const m=this.getSampleFormat(),g=this.getBitsPerSample();return vW(m,g)&&(p=xW(p,m,this.planarConfiguration,this.getSamplesPerPixel(),g,this.getTileWidth(),this.getBlockHeight(t))),p})(),u!==null&&(u[l]=d)):d=u[l],{x:e,y:t,sample:i,data:await d}}async _readRaster(e,t,i,r,s,o,a,l,u){const c=this.getTileWidth(),h=this.getTileHeight(),f=this.getWidth(),d=this.getHeight(),p=Math.max(Math.floor(e[0]/c),0),m=Math.min(Math.ceil(e[2]/c),Math.ceil(f/c)),g=Math.max(Math.floor(e[1]/h),0),v=Math.min(Math.ceil(e[3]/h),Math.ceil(d/h)),y=e[2]-e[0];let x=this.getBytesPerPixel();const _=[],E=[];for(let S=0;S<t.length;++S)this.planarConfiguration===1?_.push(_W(this.fileDirectory.BitsPerSample,0,t[S])/8):_.push(0),E.push(this.getReaderForSample(t[S]));const T=[],{littleEndian:w}=this;for(let S=g;S<v;++S)for(let R=p;R<m;++R)for(let b=0;b<t.length;++b){const I=b,O=t[b];this.planarConfiguration===2&&(x=this.getSampleByteSize(b));const P=this.getTileOrStrip(R,S,O,s,u);T.push(P),P.then(B=>{const A=B.data,L=new DataView(A),D=this.getBlockHeight(B.y),U=B.y*h,G=B.x*c,$=U+D,k=(B.x+1)*c,C=E[I],Z=Math.min(D,D-($-e[3]),d-U),z=Math.min(c,c-(k-e[2]),f-G);for(let j=Math.max(0,e[1]-U);j<Z;++j)for(let V=Math.max(0,e[0]-G);V<z;++V){const te=(j*c+V)*x,J=C.call(L,te+_[I],w);let X;r?(X=(j+U-e[1])*y*t.length+(V+G-e[0])*t.length+I,i[X]=J):(X=(j+U-e[1])*y+V+G-e[0],i[I][X]=J)}})}if(await Promise.all(T),o&&e[2]-e[0]!==o||a&&e[3]-e[1]!==a){let S;return r?S=yW(i,e[2]-e[0],e[3]-e[1],o,a,t.length,l):S=pW(i,e[2]-e[0],e[3]-e[1],o,a,l),S.width=o,S.height=a,S}return i.width=o||e[2]-e[0],i.height=a||e[3]-e[1],i}async readRasters({window:e,samples:t=[],interleave:i,pool:r=null,width:s,height:o,resampleMethod:a,fillValue:l,signal:u}={}){const c=e||[0,0,this.getWidth(),this.getHeight()];if(c[0]>c[2]||c[1]>c[3])throw new Error("Invalid subsets");const h=c[2]-c[0],f=c[3]-c[1],d=h*f,p=this.getSamplesPerPixel();if(!t||!t.length)for(let y=0;y<p;++y)t.push(y);else for(let y=0;y<t.length;++y)if(t[y]>=p)return Promise.reject(new RangeError(`Invalid sample index '${t[y]}'.`));let m;if(i){const y=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,x=Math.max.apply(null,this.fileDirectory.BitsPerSample);m=r1(y,x,d*t.length),l&&m.fill(l)}else{m=[];for(let y=0;y<t.length;++y){const x=this.getArrayForSample(t[y],d);Array.isArray(l)&&y<l.length?x.fill(l[y]):l&&!Array.isArray(l)&&x.fill(l),m.push(x)}}const g=r||await DL(this.fileDirectory);return await this._readRaster(c,t,m,i,g,s,o,a,u)}async readRGB({window:e,interleave:t=!0,pool:i=null,width:r,height:s,resampleMethod:o,enableAlpha:a=!1,signal:l}={}){const u=e||[0,0,this.getWidth(),this.getHeight()];if(u[0]>u[2]||u[1]>u[3])throw new Error("Invalid subsets");const c=this.fileDirectory.PhotometricInterpretation;if(c===Ln.RGB){let v=[0,1,2];if(this.fileDirectory.ExtraSamples!==eW.Unspecified&&a){v=[];for(let y=0;y<this.fileDirectory.BitsPerSample.length;y+=1)v.push(y)}return this.readRasters({window:e,interleave:t,samples:v,pool:i,width:r,height:s,resampleMethod:o,signal:l})}let h;switch(c){case Ln.WhiteIsZero:case Ln.BlackIsZero:case Ln.Palette:h=[0];break;case Ln.CMYK:h=[0,1,2,3];break;case Ln.YCbCr:case Ln.CIELab:h=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const f={window:u,interleave:!0,samples:h,pool:i,width:r,height:s,resampleMethod:o,signal:l},{fileDirectory:d}=this,p=await this.readRasters(f),m=2**this.fileDirectory.BitsPerSample[0];let g;switch(c){case Ln.WhiteIsZero:g=nW(p,m);break;case Ln.BlackIsZero:g=rW(p,m);break;case Ln.Palette:g=sW(p,d.ColorMap);break;case Ln.CMYK:g=oW(p);break;case Ln.YCbCr:g=aW(p);break;case Ln.CIELab:g=hW(p);break;default:throw new Error("Unsupported photometric interpretation.")}if(!t){const v=new Uint8Array(g.length/3),y=new Uint8Array(g.length/3),x=new Uint8Array(g.length/3);for(let _=0,E=0;_<g.length;_+=3,++E)v[E]=g[_],y[E]=g[_+1],x[E]=g[_+2];g=[v,y,x]}return g.width=p.width,g.height=p.height,g}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let t=0;t<this.fileDirectory.ModelTiepoint.length;t+=6)e.push({i:this.fileDirectory.ModelTiepoint[t],j:this.fileDirectory.ModelTiepoint[t+1],k:this.fileDirectory.ModelTiepoint[t+2],x:this.fileDirectory.ModelTiepoint[t+3],y:this.fileDirectory.ModelTiepoint[t+4],z:this.fileDirectory.ModelTiepoint[t+5]});return e}getGDALMetadata(e=null){const t={};if(!this.fileDirectory.GDAL_METADATA)return null;const i=this.fileDirectory.GDAL_METADATA;let r=JV(i,"Item");e===null?r=r.filter(s=>t1(s,"sample")===void 0):r=r.filter(s=>Number(t1(s,"sample"))===e);for(let s=0;s<r.length;++s){const o=r[s];t[t1(o,"name")]=o.inner}return t}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,t=this.fileDirectory.ModelTransformation;if(e&&e.length===6)return[e[3],e[4],e[5]];if(t)return[t[3],t[7],t[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const t=this.fileDirectory.ModelPixelScale,i=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(i)return[i[0],i[5],i[10]];if(e){const[r,s,o]=e.getResolution();return[r*e.getWidth()/this.getWidth(),s*e.getHeight()/this.getHeight(),o*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return this.geoKeys.GTRasterTypeGeoKey===1}getBoundingBox(){const e=this.getOrigin(),t=this.getResolution(),i=e[0],r=e[1],s=i+t[0]*this.getWidth(),o=r+t[1]*this.getHeight();return[Math.min(i,s),Math.min(r,o),Math.max(i,s),Math.max(r,o)]}}var kL=EW;class TW{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,t){const i=this.getUint32(e,t),r=this.getUint32(e+4,t);let s;if(t){if(s=i+2**32*r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*i+r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}getInt64(e,t){let i=0;const r=(this._dataView.getUint8(e+(t?7:0))&128)>0;let s=!0;for(let o=0;o<8;o++){let a=this._dataView.getUint8(e+(t?o:7-o));r&&(s?a!==0&&(a=~(a-1)&255,s=!1):a=~a&255),i+=a*256**o}return r&&(i=-i),i}getUint8(e,t){return this._dataView.getUint8(e,t)}getInt8(e,t){return this._dataView.getInt8(e,t)}getUint16(e,t){return this._dataView.getUint16(e,t)}getInt16(e,t){return this._dataView.getInt16(e,t)}getUint32(e,t){return this._dataView.getUint32(e,t)}getInt32(e,t){return this._dataView.getInt32(e,t)}getFloat16(e,t){return FL(this._dataView,e,t)}getFloat32(e,t){return this._dataView.getFloat32(e,t)}getFloat64(e,t){return this._dataView.getFloat64(e,t)}}class wW{constructor(e,t,i,r){this._dataView=new DataView(e),this._sliceOffset=t,this._littleEndian=i,this._bigTiff=r}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const t=this.readUint32(e),i=this.readUint32(e+4);let r;if(this._littleEndian){if(r=t+2**32*i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*t+i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}readInt64(e){let t=0;const i=(this._dataView.getUint8(e+(this._littleEndian?7:0))&128)>0;let r=!0;for(let s=0;s<8;s++){let o=this._dataView.getUint8(e+(this._littleEndian?s:7-s));i&&(r?o!==0&&(o=~(o-1)&255,r=!1):o=~o&255),t+=o*256**s}return i&&(t=-t),t}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}const SW=typeof navigator!="undefined"&&navigator.hardwareConcurrency||2;class RW{constructor(e=SW,t){this.workers=null,this._awaitingDecoder=null,this.size=e,this.messageId=0,e&&(this._awaitingDecoder=t?Promise.resolve(t):new Promise(i=>{Promise.resolve().then(function(){return yq}).then(r=>{i(r.create)})}),this._awaitingDecoder.then(i=>{this._awaitingDecoder=null,this.workers=[];for(let r=0;r<e;r++)this.workers.push({worker:i(),idle:!0})}))}async decode(e,t){return this._awaitingDecoder&&await this._awaitingDecoder,this.size===0?DL(e).then(i=>i.decode(e,t)):new Promise(i=>{const r=this.workers.find(a=>a.idle)||this.workers[Math.floor(Math.random()*this.size)];r.idle=!1;const s=this.messageId++,o=a=>{a.data.id===s&&(r.idle=!0,i(a.data.decoded),r.worker.removeEventListener("message",o))};r.worker.addEventListener("message",o),r.worker.postMessage({fileDirectory:e,buffer:t,id:s},[t])})}destroy(){this.workers&&(this.workers.forEach(e=>{e.worker.terminate()}),this.workers=null)}}var bW=RW;const GL=`\r
|
312
|
-
\r
|
313
|
-
`;function UL(n){if(typeof Object.fromEntries!="undefined")return Object.fromEntries(n);const e={};for(const[t,i]of n)e[t.toLowerCase()]=i;return e}function IW(n){const e=n.split(`\r
|
314
|
-
`).map(t=>{const i=t.split(":").map(r=>r.trim());return i[0]=i[0].toLowerCase(),i});return UL(e)}function CW(n){const[e,...t]=n.split(";").map(r=>r.trim()),i=t.map(r=>r.split("="));return{type:e,params:UL(i)}}function s1(n){let e,t,i;return n&&([,e,t,i]=n.match(/bytes (\d+)-(\d+)\/(\d+)/),e=parseInt(e,10),t=parseInt(t,10),i=parseInt(i,10)),{start:e,end:t,total:i}}function LW(n,e){let t=null;const i=new TextDecoder("ascii"),r=[],s=`--${e}`,o=`${s}--`;for(let a=0;a<10;++a)i.decode(new Uint8Array(n,a,s.length))===s&&(t=a);if(t===null)throw new Error("Could not find initial boundary");for(;t<n.byteLength;){const a=i.decode(new Uint8Array(n,t,Math.min(s.length+1024,n.byteLength-t)));if(a.length===0||a.startsWith(o))break;if(!a.startsWith(s))throw new Error("Part does not start with boundary");const l=a.substr(s.length+2);if(l.length===0)break;const u=l.indexOf(GL),c=IW(l.substr(0,u)),{start:h,end:f,total:d}=s1(c["content-range"]),p=t+s.length+u+GL.length,m=parseInt(f,10)+1-parseInt(h,10);r.push({headers:c,data:n.slice(p,p+m),offset:h,length:m,fileSize:d}),t=p+m+4}return r}class zL{async fetch(e,t=void 0){return Promise.all(e.map(i=>this.fetchSlice(i,t)))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}var OW=et;et.Node=Ua,et.create=et;function et(n){var e=this;if(e instanceof et||(e=new et),e.tail=null,e.head=null,e.length=0,n&&typeof n.forEach=="function")n.forEach(function(r){e.push(r)});else if(arguments.length>0)for(var t=0,i=arguments.length;t<i;t++)e.push(arguments[t]);return e}et.prototype.removeNode=function(n){if(n.list!==this)throw new Error("removing node which does not belong to this list");var e=n.next,t=n.prev;return e&&(e.prev=t),t&&(t.next=e),n===this.head&&(this.head=e),n===this.tail&&(this.tail=t),n.list.length--,n.next=null,n.prev=null,n.list=null,e},et.prototype.unshiftNode=function(n){if(n!==this.head){n.list&&n.list.removeNode(n);var e=this.head;n.list=this,n.next=e,e&&(e.prev=n),this.head=n,this.tail||(this.tail=n),this.length++}},et.prototype.pushNode=function(n){if(n!==this.tail){n.list&&n.list.removeNode(n);var e=this.tail;n.list=this,n.prev=e,e&&(e.next=n),this.tail=n,this.head||(this.head=n),this.length++}},et.prototype.push=function(){for(var n=0,e=arguments.length;n<e;n++)PW(this,arguments[n]);return this.length},et.prototype.unshift=function(){for(var n=0,e=arguments.length;n<e;n++)MW(this,arguments[n]);return this.length},et.prototype.pop=function(){if(!!this.tail){var n=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,n}},et.prototype.shift=function(){if(!!this.head){var n=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,n}},et.prototype.forEach=function(n,e){e=e||this;for(var t=this.head,i=0;t!==null;i++)n.call(e,t.value,i,this),t=t.next},et.prototype.forEachReverse=function(n,e){e=e||this;for(var t=this.tail,i=this.length-1;t!==null;i--)n.call(e,t.value,i,this),t=t.prev},et.prototype.get=function(n){for(var e=0,t=this.head;t!==null&&e<n;e++)t=t.next;if(e===n&&t!==null)return t.value},et.prototype.getReverse=function(n){for(var e=0,t=this.tail;t!==null&&e<n;e++)t=t.prev;if(e===n&&t!==null)return t.value},et.prototype.map=function(n,e){e=e||this;for(var t=new et,i=this.head;i!==null;)t.push(n.call(e,i.value,this)),i=i.next;return t},et.prototype.mapReverse=function(n,e){e=e||this;for(var t=new et,i=this.tail;i!==null;)t.push(n.call(e,i.value,this)),i=i.prev;return t},et.prototype.reduce=function(n,e){var t,i=this.head;if(arguments.length>1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=0;i!==null;r++)t=n(t,i.value,r),i=i.next;return t},et.prototype.reduceReverse=function(n,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=this.length-1;i!==null;r--)t=n(t,i.value,r),i=i.prev;return t},et.prototype.toArray=function(){for(var n=new Array(this.length),e=0,t=this.head;t!==null;e++)n[e]=t.value,t=t.next;return n},et.prototype.toArrayReverse=function(){for(var n=new Array(this.length),e=0,t=this.tail;t!==null;e++)n[e]=t.value,t=t.prev;return n},et.prototype.slice=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new et;if(e<n||e<0)return t;n<0&&(n=0),e>this.length&&(e=this.length);for(var i=0,r=this.head;r!==null&&i<n;i++)r=r.next;for(;r!==null&&i<e;i++,r=r.next)t.push(r.value);return t},et.prototype.sliceReverse=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new et;if(e<n||e<0)return t;n<0&&(n=0),e>this.length&&(e=this.length);for(var i=this.length,r=this.tail;r!==null&&i>e;i--)r=r.prev;for(;r!==null&&i>n;i--,r=r.prev)t.push(r.value);return t},et.prototype.splice=function(n,e,...t){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var i=0,r=this.head;r!==null&&i<n;i++)r=r.next;for(var s=[],i=0;r&&i<e;i++)s.push(r.value),r=this.removeNode(r);r===null&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(var i=0;i<t.length;i++)r=AW(this,r,t[i]);return s},et.prototype.reverse=function(){for(var n=this.head,e=this.tail,t=n;t!==null;t=t.prev){var i=t.prev;t.prev=t.next,t.next=i}return this.head=e,this.tail=n,this};function AW(n,e,t){var i=e===n.head?new Ua(t,null,e,n):new Ua(t,e,e.next,n);return i.next===null&&(n.tail=i),i.prev===null&&(n.head=i),n.length++,i}function PW(n,e){n.tail=new Ua(e,n.tail,null,n),n.head||(n.head=n.tail),n.length++}function MW(n,e){n.head=new Ua(e,null,n.head,n),n.tail||(n.tail=n.head),n.length++}function Ua(n,e,t,i){if(!(this instanceof Ua))return new Ua(n,e,t,i);this.list=i,this.value=n,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{require("./iterator.js")(et)}catch{}const FW=OW,za=Symbol("max"),vs=Symbol("length"),wu=Symbol("lengthCalculator"),Uh=Symbol("allowStale"),Ba=Symbol("maxAge"),xs=Symbol("dispose"),BL=Symbol("noDisposeOnSet"),Ii=Symbol("lruList"),ar=Symbol("cache"),jL=Symbol("updateAgeOnGet"),o1=()=>1;class NW{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[za]=e.max||1/0;const t=e.length||o1;if(this[wu]=typeof t!="function"?o1:t,this[Uh]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Ba]=e.maxAge||0,this[xs]=e.dispose,this[BL]=e.noDisposeOnSet||!1,this[jL]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[za]=e||1/0,zh(this)}get max(){return this[za]}set allowStale(e){this[Uh]=!!e}get allowStale(){return this[Uh]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Ba]=e,zh(this)}get maxAge(){return this[Ba]}set lengthCalculator(e){typeof e!="function"&&(e=o1),e!==this[wu]&&(this[wu]=e,this[vs]=0,this[Ii].forEach(t=>{t.length=this[wu](t.value,t.key),this[vs]+=t.length})),zh(this)}get lengthCalculator(){return this[wu]}get length(){return this[vs]}get itemCount(){return this[Ii].length}rforEach(e,t){t=t||this;for(let i=this[Ii].tail;i!==null;){const r=i.prev;YL(this,e,i,t),i=r}}forEach(e,t){t=t||this;for(let i=this[Ii].head;i!==null;){const r=i.next;YL(this,e,i,t),i=r}}keys(){return this[Ii].toArray().map(e=>e.key)}values(){return this[Ii].toArray().map(e=>e.value)}reset(){this[xs]&&this[Ii]&&this[Ii].length&&this[Ii].forEach(e=>this[xs](e.key,e.value)),this[ar]=new Map,this[Ii]=new FW,this[vs]=0}dump(){return this[Ii].map(e=>hg(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Ii]}set(e,t,i){if(i=i||this[Ba],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const r=i?Date.now():0,s=this[wu](t,e);if(this[ar].has(e)){if(s>this[za])return Su(this,this[ar].get(e)),!1;const l=this[ar].get(e).value;return this[xs]&&(this[BL]||this[xs](e,l.value)),l.now=r,l.maxAge=i,l.value=t,this[vs]+=s-l.length,l.length=s,this.get(e),zh(this),!0}const o=new $W(e,t,s,r,i);return o.length>this[za]?(this[xs]&&this[xs](e,t),!1):(this[vs]+=o.length,this[Ii].unshift(o),this[ar].set(e,this[Ii].head),zh(this),!0)}has(e){if(!this[ar].has(e))return!1;const t=this[ar].get(e).value;return!hg(this,t)}get(e){return a1(this,e,!0)}peek(e){return a1(this,e,!1)}pop(){const e=this[Ii].tail;return e?(Su(this,e),e.value):null}del(e){Su(this,this[ar].get(e))}load(e){this.reset();const t=Date.now();for(let i=e.length-1;i>=0;i--){const r=e[i],s=r.e||0;if(s===0)this.set(r.k,r.v);else{const o=s-t;o>0&&this.set(r.k,r.v,o)}}}prune(){this[ar].forEach((e,t)=>a1(this,t,!1))}}const a1=(n,e,t)=>{const i=n[ar].get(e);if(i){const r=i.value;if(hg(n,r)){if(Su(n,i),!n[Uh])return}else t&&(n[jL]&&(i.value.now=Date.now()),n[Ii].unshiftNode(i));return r.value}},hg=(n,e)=>{if(!e||!e.maxAge&&!n[Ba])return!1;const t=Date.now()-e.now;return e.maxAge?t>e.maxAge:n[Ba]&&t>n[Ba]},zh=n=>{if(n[vs]>n[za])for(let e=n[Ii].tail;n[vs]>n[za]&&e!==null;){const t=e.prev;Su(n,e),e=t}},Su=(n,e)=>{if(e){const t=e.value;n[xs]&&n[xs](t.key,t.value),n[vs]-=t.length,n[ar].delete(t.key),n[Ii].removeNode(e)}};class $W{constructor(e,t,i,r,s){this.key=e,this.value=t,this.length=i,this.now=r,this.maxAge=s||0}}const YL=(n,e,t,i)=>{let r=t.value;hg(n,r)&&(Su(n,t),n[Uh]||(r=void 0)),r&&e.call(i,r.value,r.key,n)};var DW=NW;async function kW(n){return new Promise(e=>setTimeout(e,n))}function XL(n,e){const t=Array.isArray(n)?n:Array.from(n),i=Array.isArray(e)?e:Array.from(e);return t.map((r,s)=>[r,i[s]])}class Fu extends Error{constructor(e){super(e);Error.captureStackTrace&&Error.captureStackTrace(this,Fu),this.name="AbortError"}}class GW extends Error{constructor(e,t){super(t);this.errors=e,this.message=t,this.name="AggregateError"}}const UW=GW;class zW{constructor(e,t,i=null){this.offset=e,this.length=t,this.data=i}get top(){return this.offset+this.length}}class VL{constructor(e,t,i){this.offset=e,this.length=t,this.blockIds=i}}class BW extends zL{constructor(e,{blockSize:t=65536,cacheSize:i=100}={}){super();this.source=e,this.blockSize=t,this.blockCache=new DW({max:i}),this.blockRequests=new Map,this.blockIdsToFetch=new Set}get fileSize(){return this.source.fileSize}async fetch(e,t){const i=new Map,r=new Map,s=new Set;for(const{offset:u,length:c}of e){let h=u+c;const{fileSize:f}=this;f!==null&&(h=Math.min(h,f));const d=Math.floor(u/this.blockSize)*this.blockSize;for(let p=d;p<h;p+=this.blockSize){const m=Math.floor(p/this.blockSize);this.blockCache.has(m)?i.set(m,this.blockCache.get(m)):this.blockRequests.has(m)?r.set(m,this.blockRequests.get(m)):(this.blockIdsToFetch.has(m)||this.blockIdsToFetch.add(m),s.add(m))}}await kW(),this.fetchBlocks(t);for(const u of s){const c=this.blockRequests.get(u),h=this.blockCache.get(u);if(c)r.set(u,c);else if(h)i.set(u,h);else throw new Error(`Block ${u} is not in the block requests`)}let o=await Promise.allSettled(Array.from(r.values()));if(o.some(u=>u.status==="rejected")){const u=new Set;for(const[c,h]of XL(r.keys(),o)){const{rejected:f,reason:d}=h;f&&d.name==="AbortError"&&d.signal!==t&&(this.blockIdsToFetch.add(c),u.add(c))}if(this.blockIdsToFetch.length>0){this.fetchBlocks(t);for(const c of u){const h=this.blockRequests.get(c);if(!h)throw new Error(`Block ${c} is not in the block requests`);r.set(c,h)}o=await Promise.allSettled(Array.from(r.values()))}}if(o.some(u=>u.status==="rejected"))throw t&&t.aborted?new Fu("Request was aborted"):new UW(o.filter(u=>u.status==="rejected").map(u=>u.reason),"Request failed");const a=o.map(u=>u.value),l=new Map(XL(Array.from(r.keys()),a));for(const[u,c]of i)l.set(u,c);return this.readSliceData(e,l)}fetchBlocks(e){if(this.blockIdsToFetch.size>0){const t=this.groupBlocks(this.blockIdsToFetch),i=this.source.fetch(t,e);for(let r=0;r<t.length;++r){const s=t[r];for(const o of s.blockIds){const a=(async()=>{try{const l=(await i)[r],u=o*this.blockSize,c=u-l.offset,h=Math.min(c+this.blockSize,l.data.byteLength),f=l.data.slice(c,h),d=new zW(u,f.byteLength,f);return this.blockCache.set(o,d),d}catch(l){throw l.name==="AbortError"&&(l.signal=e),l}finally{this.blockRequests.delete(o)}})();this.blockRequests.set(o,a)}}this.blockIdsToFetch.clear()}}groupBlocks(e){const t=Array.from(e).sort((o,a)=>o-a);if(t.length===0)return[];let i=[],r=null;const s=[];for(const o of t)r===null||r+1===o?(i.push(o),r=o):(s.push(new VL(i[0]*this.blockSize,i.length*this.blockSize,i)),i=[o],r=o);return s.push(new VL(i[0]*this.blockSize,i.length*this.blockSize,i)),s}readSliceData(e,t){return e.map(i=>{const r=i.offset+i.length,s=Math.floor(i.offset/this.blockSize),o=Math.floor((i.offset+i.length)/this.blockSize),a=new ArrayBuffer(i.length),l=new Uint8Array(a);for(let u=s;u<=o;++u){const c=t.get(u),h=c.offset-i.offset,f=c.top-r;let d=0,p=0,m;h<0?d=-h:h>0&&(p=h),f<0?m=c.length-d:m=r-c.offset-d;const g=new Uint8Array(c.data,d,m);l.set(g,p)}return a})}}class l1{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(e){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class u1{constructor(e){this.url=e}async request({headers:e,credentials:t,signal:i}={}){throw new Error("request is not implemented")}}class jW extends l1{constructor(e){super();this.response=e}get status(){return this.response.status}getHeader(e){return this.response.headers.get(e)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class YW extends u1{constructor(e,t){super(e);this.credentials=t}async request({headers:e,credentials:t,signal:i}={}){const r=await fetch(this.url,{headers:e,credentials:t,signal:i});return new jW(r)}}class XW extends l1{constructor(e,t){super();this.xhr=e,this.data=t}get status(){return this.xhr.status}getHeader(e){return this.xhr.getResponseHeader(e)}async getData(){return this.data}}class VW extends u1{constructRequest(e,t){return new Promise((i,r)=>{const s=new XMLHttpRequest;s.open("GET",this.url),s.responseType="arraybuffer";for(const[o,a]of Object.entries(e))s.setRequestHeader(o,a);s.onload=()=>{const o=s.response;i(new XW(s,o))},s.onerror=r,s.onabort=()=>r(new Fu("Request aborted")),s.send(),t&&(t.aborted&&s.abort(),t.addEventListener("abort",()=>s.abort()))})}async request({headers:e,signal:t}={}){return await this.constructRequest(e,t)}}var c1={};class WW extends l1{constructor(e,t){super();this.response=e,this.dataPromise=t}get status(){return this.response.statusCode}getHeader(e){return this.response.headers[e]}async getData(){return await this.dataPromise}}class ZW extends u1{constructor(e){super(e);this.parsedUrl=c1.parse(this.url),this.httpApi=(this.parsedUrl.protocol==="http:",c1)}constructRequest(e,t){return new Promise((i,r)=>{const s=this.httpApi.get(Uu(Gu({},this.parsedUrl),{headers:e}),o=>{const a=new Promise(l=>{const u=[];o.on("data",c=>{u.push(c)}),o.on("end",()=>{const c=Buffer.concat(u).buffer;l(c)}),o.on("error",r)});i(new WW(o,a))});s.on("error",r),t&&(t.aborted&&s.destroy(new Fu("Request aborted")),t.addEventListener("abort",()=>s.destroy(new Fu("Request aborted"))))})}async request({headers:e,signal:t}={}){return await this.constructRequest(e,t)}}class h1 extends zL{constructor(e,t,i,r){super();this.client=e,this.headers=t,this.maxRanges=i,this.allowFullFile=r,this._fileSize=null}async fetch(e,t){return this.maxRanges>=e.length?this.fetchSlices(e,t):(this.maxRanges>0&&e.length>1,Promise.all(e.map(i=>this.fetchSlice(i,t))))}async fetchSlices(e,t){const i=await this.client.request({headers:Uu(Gu({},this.headers),{Range:`bytes=${e.map(({offset:r,length:s})=>`${r}-${r+s}`).join(",")}`}),signal:t});if(i.ok)if(i.status===206){const{type:r,params:s}=CW(i.getHeader("content-type"));if(r==="multipart/byteranges"){const h=LW(await i.getData(),s.boundary);return this._fileSize=h[0].fileSize||null,h}const o=await i.getData(),{start:a,end:l,total:u}=s1(i.getHeader("content-range"));this._fileSize=u||null;const c=[{data:o,offset:a,length:l-a}];if(e.length>1){const h=await Promise.all(e.slice(1).map(f=>this.fetchSlice(f,t)));return c.concat(h)}return c}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const r=await i.getData();return this._fileSize=r.byteLength,[{data:r,offset:0,length:r.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(e,t){const{offset:i,length:r}=e,s=await this.client.request({headers:Uu(Gu({},this.headers),{Range:`bytes=${i}-${i+r}`}),signal:t});if(s.ok)if(s.status===206){const o=await s.getData(),{total:a}=s1(s.getHeader("content-range"));return this._fileSize=a||null,{data:o,offset:i,length:r}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const o=await s.getData();return this._fileSize=o.byteLength,{data:o,offset:0,length:o.byteLength}}else throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function f1(n,{blockSize:e,cacheSize:t}){return e===null?n:new BW(n,e,t)}function HW(n,o={}){var a=o,{headers:e={},credentials:t,maxRanges:i=0,allowFullFile:r=!1}=a,s=zu(a,["headers","credentials","maxRanges","allowFullFile"]);const l=new YW(n,t),u=new h1(l,e,i,r);return f1(u,s)}function KW(n,s={}){var o=s,{headers:e={},maxRanges:t=0,allowFullFile:i=!1}=o,r=zu(o,["headers","maxRanges","allowFullFile"]);const a=new VW(n),l=new h1(a,e,t,i);return f1(l,r)}function qW(n,s={}){var o=s,{headers:e={},maxRanges:t=0,allowFullFile:i=!1}=o,r=zu(o,["headers","maxRanges","allowFullFile"]);const a=new ZW(n),l=new h1(a,e,t,i);return f1(l,r)}function d1(n,i={}){var r=i,{forceXHR:e=!1}=r,t=zu(r,["forceXHR"]);return typeof fetch=="function"&&!e?HW(n,t):typeof XMLHttpRequest!="undefined"?KW(n,t):qW(n,t)}function p1(n){switch(n){case ke.BYTE:case ke.ASCII:case ke.SBYTE:case ke.UNDEFINED:return 1;case ke.SHORT:case ke.SSHORT:return 2;case ke.LONG:case ke.SLONG:case ke.FLOAT:case ke.IFD:return 4;case ke.RATIONAL:case ke.SRATIONAL:case ke.DOUBLE:case ke.LONG8:case ke.SLONG8:case ke.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${n}`)}}function JW(n){const e=n.GeoKeyDirectory;if(!e)return null;const t={};for(let i=4;i<=e[3]*4;i+=4){const r=ug[e[i]],s=e[i+1]?Gh[e[i+1]]:null,o=e[i+2],a=e[i+3];let l=null;if(!s)l=a;else{if(l=n[s],typeof l=="undefined"||l===null)throw new Error(`Could not get value of geoKey '${r}'.`);typeof l=="string"?l=l.substring(a,a+o-1):l.subarray&&(l=l.subarray(a,a+o),o===1&&(l=l[0]))}t[r]=l}return t}function Ru(n,e,t,i){let r=null,s=null;const o=p1(e);switch(e){case ke.BYTE:case ke.ASCII:case ke.UNDEFINED:r=new Uint8Array(t),s=n.readUint8;break;case ke.SBYTE:r=new Int8Array(t),s=n.readInt8;break;case ke.SHORT:r=new Uint16Array(t),s=n.readUint16;break;case ke.SSHORT:r=new Int16Array(t),s=n.readInt16;break;case ke.LONG:case ke.IFD:r=new Uint32Array(t),s=n.readUint32;break;case ke.SLONG:r=new Int32Array(t),s=n.readInt32;break;case ke.LONG8:case ke.IFD8:r=new Array(t),s=n.readUint64;break;case ke.SLONG8:r=new Array(t),s=n.readInt64;break;case ke.RATIONAL:r=new Uint32Array(t*2),s=n.readUint32;break;case ke.SRATIONAL:r=new Int32Array(t*2),s=n.readInt32;break;case ke.FLOAT:r=new Float32Array(t),s=n.readFloat32;break;case ke.DOUBLE:r=new Float64Array(t),s=n.readFloat64;break;default:throw new RangeError(`Invalid field type: ${e}`)}if(e===ke.RATIONAL||e===ke.SRATIONAL)for(let a=0;a<t;a+=2)r[a]=s.call(n,i+a*o),r[a+1]=s.call(n,i+(a*o+4));else for(let a=0;a<t;++a)r[a]=s.call(n,i+a*o);return e===ke.ASCII?new TextDecoder("utf-8").decode(r):r}class QW{constructor(e,t,i){this.fileDirectory=e,this.geoKeyDirectory=t,this.nextIFDByteOffset=i}}class fg extends Error{constructor(e){super(`No image at index ${e}`);this.index=e}}class WL{async readRasters(e={}){const{window:t,width:i,height:r}=e;let{resX:s,resY:o,bbox:a}=e;const l=await this.getImage();let u=l;const c=await this.getImageCount(),h=l.getBoundingBox();if(t&&a)throw new Error('Both "bbox" and "window" passed.');if(i||r){if(t){const[p,m]=l.getOrigin(),[g,v]=l.getResolution();a=[p+t[0]*g,m+t[1]*v,p+t[2]*g,m+t[3]*v]}const d=a||h;if(i){if(s)throw new Error("Both width and resX passed");s=(d[2]-d[0])/i}if(r){if(o)throw new Error("Both width and resY passed");o=(d[3]-d[1])/r}}if(s||o){const d=[];for(let p=0;p<c;++p){const m=await this.getImage(p),{SubfileType:g,NewSubfileType:v}=m.fileDirectory;(p===0||g===2||v&1)&&d.push(m)}d.sort((p,m)=>p.getWidth()-m.getWidth());for(let p=0;p<d.length;++p){const m=d[p],g=(h[2]-h[0])/m.getWidth(),v=(h[3]-h[1])/m.getHeight();if(u=m,s&&s>g||o&&o>v)break}}let f=t;if(a){const[d,p]=l.getOrigin(),[m,g]=u.getResolution(l);f=[Math.round((a[0]-d)/m),Math.round((a[1]-p)/g),Math.round((a[2]-d)/m),Math.round((a[3]-p)/g)],f=[Math.min(f[0],f[2]),Math.min(f[1],f[3]),Math.max(f[0],f[2]),Math.max(f[1],f[3])]}return u.readRasters(Uu(Gu({},e),{window:f}))}}class cf extends WL{constructor(e,t,i,r,s={}){super();this.source=e,this.littleEndian=t,this.bigTiff=i,this.firstIFDOffset=r,this.cache=s.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,t){const i=this.bigTiff?4048:1024;return new wW((await this.source.fetch([{offset:e,length:typeof t!="undefined"?t:i}]))[0],e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const t=this.bigTiff?20:12,i=this.bigTiff?8:2;let r=await this.getSlice(e);const s=this.bigTiff?r.readUint64(e):r.readUint16(e),o=s*t+(this.bigTiff?16:6);r.covers(e,o)||(r=await this.getSlice(e,o));const a={};let l=e+(this.bigTiff?8:2);for(let h=0;h<s;l+=t,++h){const f=r.readUint16(l),d=r.readUint16(l+2),p=this.bigTiff?r.readUint64(l+4):r.readUint32(l+4);let m,g;const v=p1(d),y=l+(this.bigTiff?12:8);if(v*p<=(this.bigTiff?8:4))m=Ru(r,d,p,y);else{const x=r.readOffset(y),_=p1(d)*p;if(r.covers(x,_))m=Ru(r,d,p,x);else{const E=await this.getSlice(x,_);m=Ru(E,d,p,x)}}p===1&&QV.indexOf(f)===-1&&!(d===ke.RATIONAL||d===ke.SRATIONAL)?g=m[0]:g=m,a[Gh[f]]=g}const u=JW(a),c=r.readOffset(e+i+t*s);return new QW(a,u,c)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(e===0)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(t){throw t instanceof fg?new fg(e):t}return this.ifdRequests[e]=(async()=>{const t=await this.ifdRequests[e-1];if(t.nextIFDByteOffset===0)throw new fg(e);return this.parseFileDirectoryAt(t.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const t=await this.requestIFD(e);return new kL(t.fileDirectory,t.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,t=!0;for(;t;)try{await this.requestIFD(e),++e}catch(i){if(i instanceof fg)t=!1;else throw i}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const t="GDAL_STRUCTURAL_METADATA_SIZE=",i=t.length+100;let r=await this.getSlice(e,i);if(t===Ru(r,ke.ASCII,t.length,e)){const o=Ru(r,ke.ASCII,i,e).split(`
|
315
|
-
`)[0],a=Number(o.split("=")[1].split(" ")[0])+o.length;a>i&&(r=await this.getSlice(e,a));const l=Ru(r,ke.ASCII,a,e);this.ghostValues={},l.split(`
|
316
|
-
`).filter(u=>u.length>0).map(u=>u.split("=")).forEach(([u,c])=>{this.ghostValues[u]=c})}return this.ghostValues}static async fromSource(e,t,i){const r=(await e.fetch([{offset:0,length:1024}],i))[0],s=new TW(r),o=s.getUint16(0,0);let a;if(o===18761)a=!0;else if(o===19789)a=!1;else throw new TypeError("Invalid byte order value.");const l=s.getUint16(2,a);let u;if(l===42)u=!1;else if(l===43){if(u=!0,s.getUint16(4,a)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const c=u?s.getUint64(8,a):s.getUint32(4,a);return new cf(e,a,u,c,t)}close(){return typeof this.source.close=="function"?this.source.close():!1}}class eZ extends WL{constructor(e,t){super();this.mainFile=e,this.overviewFiles=t,this.imageFiles=[e].concat(t),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const e=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map(t=>t.parseFileDirectoryAt(t.firstIFDOffset)));return this.fileDirectoriesPerFile=await Promise.all(e),this.fileDirectoriesPerFile}async getImage(e=0){await this.getImageCount(),await this.parseFileDirectoriesPerFile();let t=0,i=0;for(let r=0;r<this.imageFiles.length;r++){const s=this.imageFiles[r];for(let o=0;o<this.imageCounts[r];o++){if(e===t){const a=await s.requestIFD(i);return new kL(a.fileDirectory,a.geoKeyDirectory,s.dataView,s.littleEndian,s.cache,s.source)}t++,i++}i=0}throw new RangeError("Invalid image index")}async getImageCount(){if(this.imageCount!==null)return this.imageCount;const e=[this.mainFile.getImageCount()].concat(this.overviewFiles.map(t=>t.getImageCount()));return this.imageCounts=await Promise.all(e),this.imageCount=this.imageCounts.reduce((t,i)=>t+i,0),this.imageCount}}async function tZ(n,e={},t){return cf.fromSource(d1(n,e),t)}async function iZ(n,e=[],t={},i){const r=await cf.fromSource(d1(n,t),i),s=await Promise.all(e.map(o=>cf.fromSource(d1(o,t))));return new eZ(r,s)}const ZL="STATISTICS_MAXIMUM",HL="STATISTICS_MINIMUM";let g1;function nZ(){return g1||(g1=new bW),g1}function rZ(n){try{return n.getBoundingBox()}catch{const t=n.fileDirectory;return[0,0,t.ImageWidth,t.ImageLength]}}function sZ(n){try{return n.getOrigin().slice(0,2)}catch{return[0,n.fileDirectory.ImageLength]}}function oZ(n,e){try{return n.getResolution(e)[0]}catch{return e.fileDirectory.ImageWidth/n.fileDirectory.ImageWidth}}function aZ(n){const e=n.geoKeys;if(!e)return null;if(e.ProjectedCSTypeGeoKey){const t="EPSG:"+e.ProjectedCSTypeGeoKey;let i=se(t);if(!i){const r=cm(e.ProjLinearUnitsGeoKey);r&&(i=new Ho({code:t,units:r}))}return i}if(e.GeographicTypeGeoKey){const t="EPSG:"+e.GeographicTypeGeoKey;let i=se(t);if(!i){const r=cm(e.GeogAngularUnitsGeoKey);r&&(i=new Ho({code:t,units:r}))}return i}return null}function lZ(n){return n.getImageCount().then(function(e){const t=new Array(e);for(let i=0;i<e;++i)t[i]=n.getImage(i);return Promise.all(t)})}function uZ(n,e){let t;return n.overviews?t=iZ(n.url,n.overviews,e):t=tZ(n.url,e),t.then(lZ)}function dg(n,e,t,i,r){if(Array.isArray(n)){const s=n.length;if(!Array.isArray(e)||s!=e.length){const o=new Error(i);throw r(o),o}for(let o=0;o<s;++o)dg(n[o],e[o],t,i,r);return}if(e=e,Math.abs(n-e)>t*n)throw new Error(i)}function cZ(n){return n instanceof Int8Array?-128:n instanceof Int16Array?-32768:n instanceof Int32Array?-2147483648:n instanceof Float32Array?12e-39:0}function hZ(n){return n instanceof Int8Array?127:n instanceof Uint8Array||n instanceof Uint8ClampedArray?255:n instanceof Int16Array?32767:n instanceof Uint16Array?65535:n instanceof Int32Array?2147483647:n instanceof Uint32Array?4294967295:n instanceof Float32Array?34e37:255}class KL extends wL{constructor(e){super({state:Ge.LOADING,tileGrid:null,projection:null,opaque:e.opaque,transition:e.transition,interpolate:e.interpolate!==!1,wrapX:e.wrapX});this.sourceInfo_=e.sources;const t=this.sourceInfo_.length;this.sourceOptions_=e.sourceOptions,this.sourceImagery_=new Array(t),this.resolutionFactors_=new Array(t),this.samplesPerPixel_,this.nodataValues_,this.metadata_,this.normalize_=e.normalize!==!1,this.addAlpha_=!1,this.error_=null,this.readMethod_=e.convertToRGB?"readRGB":"readRasters",this.setKey(this.sourceInfo_.map(s=>s.url).join(","));const i=this,r=new Array(t);for(let s=0;s<t;++s)r[s]=uZ(this.sourceInfo_[s],this.sourceOptions_);Promise.all(r).then(function(s){i.configure_(s)}).catch(function(s){console.error(s),i.error_=s,i.setState(Ge.ERROR)})}getError(){return this.error_}configure_(e){let t,i,r,s;const o=new Array(e.length),a=new Array(e.length),l=new Array(e.length);let u=0;const c=e.length;for(let d=0;d<c;++d){const p=e[d],m=p.length;let g,v;const y=new Array(m),x=new Array(m);a[d]=new Array(m),l[d]=new Array(m);for(let _=0;_<m;++_){const E=p[_],T=E.getGDALNoData();l[d][_]=E.getGDALMetadata(0),a[d][_]=T===null?NaN:T;const w=this.sourceInfo_[d].bands;o[d]=w?w.length:E.getSamplesPerPixel();const S=m-(_+1);g||(g=rZ(E)),v||(v=sZ(E)),x[S]=oZ(E,p[0]),y[S]=[E.getTileWidth(),E.getTileHeight()]}if(t?Ai(t,g,t):t=g,!i)i=v;else{const _=`Origin mismatch for source ${d}, got [${v}] but expected [${i}]`;dg(i,v,0,_,this.viewRejector)}if(!s)s=x,this.resolutionFactors_[d]=1;else{s.length-u>x.length&&(u=s.length-x.length);const _=s[s.length-1]/x[x.length-1];this.resolutionFactors_[d]=_;const E=x.map(w=>w*=_),T=`Resolution mismatch for source ${d}, got [${E}] but expected [${s}]`;dg(s.slice(u,s.length),E,.02,T,this.viewRejector)}r?dg(r.slice(u,r.length),y,0,`Tile size mismatch for source ${d}`,this.viewRejector):r=y,this.sourceImagery_[d]=p.reverse()}for(let d=0,p=this.sourceImagery_.length;d<p;++d){const m=this.sourceImagery_[d];for(;m.length<s.length;)m.unshift(void 0)}if(!this.getProjection()){const d=e[0];for(let p=d.length-1;p>=0;--p){const m=d[p],g=aZ(m);if(g){this.projection=g;break}}}this.samplesPerPixel_=o,this.nodataValues_=a,this.metadata_=l;e:for(let d=0;d<c;++d){if(this.sourceInfo_[d].nodata!==void 0){this.addAlpha_=!0;break}const p=a[d],m=this.sourceInfo_[d].bands;if(m){for(let g=0;g<m.length;++g)if(!isNaN(p[m[g]-1])){this.addAlpha_=!0;break e}continue}for(let g=0;g<p.length;++g)if(!isNaN(p[g])){this.addAlpha_=!0;break e}}const h=this.addAlpha_?1:0;this.bandCount=o.reduce((d,p)=>(d+=p,d),0)+h;const f=new oo({extent:t,minZoom:u,origin:i,resolutions:s,tileSizes:r});this.tileGrid=f,this.setLoader(this.loadTile_.bind(this)),this.setState(Ge.READY),this.viewResolver({projection:this.projection,resolutions:s,center:Hr(fi(t),this.projection),extent:Ys(t,this.projection),zoom:0})}loadTile_(e,t,i){const r=Tt(this.tileGrid.getTileSize(e)),s=this.sourceImagery_.length,o=new Array(s),a=this.addAlpha_,l=this.bandCount,u=this.samplesPerPixel_,c=this.nodataValues_,h=this.sourceInfo_;for(let g=0;g<s;++g){const v=h[g],y=this.resolutionFactors_[g],x=[Math.round(t*(r[0]*y)),Math.round(i*(r[1]*y)),Math.round((t+1)*(r[0]*y)),Math.round((i+1)*(r[1]*y))],_=this.sourceImagery_[g][e];let E;v.bands&&(E=v.bands.map(function(w){return w-1}));let T;isNaN(v.nodata)?E?T=E.map(function(w){return c[g][w]}):T=c[g]:T=v.nodata,o[g]=_[this.readMethod_]({window:x,width:r[0],height:r[1],samples:E,fillValue:T,pool:nZ(),interleave:!1})}const f=r[0]*r[1],d=f*l,p=this.normalize_,m=this.metadata_;return Promise.all(o).then(function(g){let v;p?v=new Uint8Array(d):v=new Float32Array(d);let y=0;for(let x=0;x<f;++x){let _=a;for(let E=0;E<s;++E){const T=h[E];let w=T.min,S=T.max,R,b;if(p){const I=m[E][0];w===void 0&&(I&&HL in I?w=parseFloat(I[HL]):w=cZ(g[E][0])),S===void 0&&(I&&ZL in I?S=parseFloat(I[ZL]):S=hZ(g[E][0])),R=255/(S-w),b=-w*R}for(let I=0;I<u[E];++I){const O=g[E][I][x];let P;if(p?P=Ie(R*O+b,0,255):P=O,!a)v[y]=P;else{let B=T.nodata;if(B===void 0){let A;T.bands?A=T.bands[I]-1:A=I,B=c[E][A]}O!==B&&(_=!1,v[y]=P)}y++}}a&&(_||(v[y]=255),y++)}return v})}}KL.prototype.getView;var fZ=KL;const m1={DEFAULT:"default",TRUNCATED:"truncated"};class y1 extends ia{constructor(e,t,i,r,s,o,a){super(t,i,r,s,o,a);this.zoomifyImage_=null,this.tileSize_=e}getImage(){if(this.zoomifyImage_)return this.zoomifyImage_;const e=super.getImage();if(this.state==K.LOADED){const t=this.tileSize_;if(e.width==t[0]&&e.height==t[1])return this.zoomifyImage_=e,e;{const i=Yt(t[0],t[1]);return i.drawImage(e,0,0),this.zoomifyImage_=i.canvas,i.canvas}}else return e}}class dZ extends $r{constructor(e){const t=e;let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);const r=t.size,s=t.tierSizeCalculation!==void 0?t.tierSizeCalculation:m1.DEFAULT,o=t.tilePixelRatio||1,a=r[0],l=r[1],u=[],c=t.tileSize||aa;let h=c*o;switch(s){case m1.DEFAULT:for(;a>h||l>h;)u.push([Math.ceil(a/h),Math.ceil(l/h)]),h+=h;break;case m1.TRUNCATED:let S=a,R=l;for(;S>h||R>h;)u.push([Math.ceil(S/h),Math.ceil(R/h)]),S>>=1,R>>=1;break;default:ce(!1,53);break}u.push([1,1]),u.reverse();const f=[o],d=[0];for(let S=1,R=u.length;S<R;S++)f.push(o<<S),d.push(u[S-1][0]*u[S-1][1]+d[S-1]);f.reverse();const p=new oo({tileSize:c,extent:t.extent||[0,-l,a,0],resolutions:f});let m=t.url;m&&m.indexOf("{TileGroup}")==-1&&m.indexOf("{tileIndex}")==-1&&(m+="{TileGroup}/{z}-{x}-{y}.jpg");const g=cp(m);let v=c*o;function y(S){return function(R,b,I){if(R){const O=R[0],P=R[1],B=R[2],A=P+B*u[O][0],L=(A+d[O])/v|0,D={z:O,x:P,y:B,tileIndex:A,TileGroup:"TileGroup"+L};return S.replace(/\{(\w+?)\}/g,function(U,G){return D[G]})}else return}}const x=Hl(g.map(y)),_=y1.bind(null,Tt(c*o));super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,projection:t.projection,tilePixelRatio:o,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:_,tileGrid:p,tileUrlFunction:x,transition:t.transition});this.zDirection=t.zDirection;const E=p.getTileCoordForCoordAndResolution(fi(p.getExtent()),f[f.length-1]),T=x(E,1,null),w=new Image;w.addEventListener("error",function(){v=c,this.changed()}.bind(this)),w.src=T}}var pZ=dZ;function Bh(n){return n.toLocaleString("en",{maximumFractionDigits:10})}class gZ extends $r{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);let r=t.url||"";r=r+(r.lastIndexOf("/")===r.length-1||r===""?"":"/");const s=t.version||Jt.VERSION2,o=t.sizes||[],a=t.size;ce(a!=null&&Array.isArray(a)&&a.length==2&&!isNaN(a[0])&&a[0]>0&&!isNaN(a[1])&&a[1]>0,60);const l=a[0],u=a[1],c=t.tileSize,h=t.tilePixelRatio||1,f=t.format||"jpg",d=t.quality||(t.version==Jt.VERSION1?"native":"default");let p=t.resolutions||[];const m=t.supports||[],g=t.extent||[0,-u,l,0],v=o!=null&&Array.isArray(o)&&o.length>0,y=c!==void 0&&(typeof c=="number"&&Number.isInteger(c)&&c>0||Array.isArray(c)&&c.length>0),x=m!=null&&Array.isArray(m)&&(Ye(m,"regionByPx")||Ye(m,"regionByPct"))&&(Ye(m,"sizeByWh")||Ye(m,"sizeByH")||Ye(m,"sizeByW")||Ye(m,"sizeByPct"));let _,E,T;if(p.sort(function(b,I){return I-b}),y||x)if(c!=null&&(typeof c=="number"&&Number.isInteger(c)&&c>0?(_=c,E=c):Array.isArray(c)&&c.length>0&&((c.length==1||c[1]==null&&Number.isInteger(c[0]))&&(_=c[0],E=c[0]),c.length==2&&(Number.isInteger(c[0])&&Number.isInteger(c[1])?(_=c[0],E=c[1]):c[0]==null&&Number.isInteger(c[1])&&(_=c[1],E=c[1])))),(_===void 0||E===void 0)&&(_=aa,E=aa),p.length==0){T=Math.max(Math.ceil(Math.log(l/_)/Math.LN2),Math.ceil(Math.log(u/E)/Math.LN2));for(let b=T;b>=0;b--)p.push(Math.pow(2,b))}else{const b=Math.max(...p);T=Math.round(Math.log(b)/Math.LN2)}else if(_=l,E=u,p=[],v){o.sort(function(I,O){return I[0]-O[0]}),T=-1;const b=[];for(let I=0;I<o.length;I++){const O=l/o[I][0];if(p.length>0&&p[p.length-1]==O){b.push(I);continue}p.push(O),T++}if(b.length>0)for(let I=0;I<b.length;I++)o.splice(b[I]-I,1)}else p.push(1),o.push([l,u]),T=0;const w=new oo({tileSize:[_,E],extent:g,origin:An(g),resolutions:p}),S=function(b,I,O){let P,B;const A=b[0];if(A>T)return;const L=b[1],D=b[2],U=p[A];if(!(L===void 0||D===void 0||U===void 0||L<0||Math.ceil(l/U/_)<=L||D<0||Math.ceil(u/U/E)<=D)){if(x||y){const G=L*_*U,$=D*E*U;let k=_*U,C=E*U,Z=_,z=E;if(G+k>l&&(k=l-G),$+C>u&&(C=u-$),G+_*U>l&&(Z=Math.floor((l-G+U-1)/U)),$+E*U>u&&(z=Math.floor((u-$+U-1)/U)),G==0&&k==l&&$==0&&C==u)P="full";else if(!x||Ye(m,"regionByPx"))P=G+","+$+","+k+","+C;else if(Ye(m,"regionByPct")){const j=Bh(G/l*100),V=Bh($/u*100),te=Bh(k/l*100),J=Bh(C/u*100);P="pct:"+j+","+V+","+te+","+J}s==Jt.VERSION3&&(!x||Ye(m,"sizeByWh"))?B=Z+","+z:!x||Ye(m,"sizeByW")?B=Z+",":Ye(m,"sizeByH")?B=","+z:Ye(m,"sizeByWh")?B=Z+","+z:Ye(m,"sizeByPct")&&(B="pct:"+Bh(100/U))}else if(P="full",v){const G=o[A][0],$=o[A][1];s==Jt.VERSION3?G==l&&$==u?B="max":B=G+","+$:G==l?B="full":B=G+","}else B=s==Jt.VERSION3?"max":"full";return r+P+"/"+B+"/0/"+d+"."+f}},R=y1.bind(null,Tt(c||256).map(function(b){return b*h}));super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:t.state,tileClass:R,tileGrid:w,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:S,transition:t.transition});this.zDirection=t.zDirection}}var mZ=gZ;const pg={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class qL extends ni{constructor(e,t){super(e);this.image=t}}class yZ extends Al{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate);super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:t});this.on,this.once,this.un,this.resolutions_=e.resolutions!==void 0?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0}getResolutions(){return this.resolutions_}findNearestResolution(e){if(this.resolutions_){const t=Bu(this.resolutions_,e,0);e=this.resolutions_[t]}return e}getImage(e,t,i,r){const s=this.getProjection();if(!s||!r||dn(s,r))return s&&(r=s),this.getImageInternal(e,t,i,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&dn(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&Tn(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new EL(s,r,e,t,i,function(o,a,l){return this.getImageInternal(o,a,l,s)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,i,r){return fe()}handleImageChange(e){const t=e.target;let i;switch(t.getState()){case ye.LOADING:this.loading=!0,i=pg.IMAGELOADSTART;break;case ye.LOADED:this.loading=!1,i=pg.IMAGELOADEND;break;case ye.ERROR:this.loading=!1,i=pg.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new qL(i,t))}}function jh(n,e){n.getImage().src=e}var So=yZ;function Ur(n,e){const t=[];Object.keys(e).forEach(function(r){e[r]!==null&&e[r]!==void 0&&t.push(r+"="+encodeURIComponent(e[r]))});const i=t.join("&");return n=n.replace(/[?&]$/,""),n=n.indexOf("?")===-1?n+"?":n+"&",n+i}class _Z extends So{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);super({attributions:t.attributions,interpolate:i,projection:t.projection,resolutions:t.resolutions});this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:jh,this.params_=t.params||{},this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5}getParams(){return this.params_}getImageInternal(e,t,i,r){if(this.url_===void 0)return null;t=this.findNearestResolution(t),i=this.hidpi_?i:1;const s=this.image_;if(s&&this.renderedRevision_==this.getRevision()&&s.getResolution()==t&&s.getPixelRatio()==i&&hi(s.getExtent(),e))return s;const o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};ie(o,this.params_),e=e.slice();const a=(e[0]+e[2])/2,l=(e[1]+e[3])/2;if(this.ratio_!=1){const d=this.ratio_*Ae(e)/2,p=this.ratio_*ft(e)/2;e[0]=a-d,e[1]=l-p,e[2]=a+d,e[3]=l+p}const u=t/i,c=Math.ceil(Ae(e)/u),h=Math.ceil(ft(e)/u);e[0]=a-u*c/2,e[2]=a+u*c/2,e[1]=l-u*h/2,e[3]=l+u*h/2,this.imageSize_[0]=c,this.imageSize_[1]=h;const f=this.getRequestUrl_(e,this.imageSize_,i,r,o);return this.image_=new pl(e,t,i,f,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(re.CHANGE,this.handleImageChange.bind(this)),this.image_}getImageLoadFunction(){return this.imageLoadFunction_}getRequestUrl_(e,t,i,r,s){const o=r.getCode().split(/:(?=\d+$)/).pop();s.SIZE=t[0]+","+t[1],s.BBOX=e.join(","),s.BBOXSR=o,s.IMAGESR=o,s.DPI=Math.round(90*i);const a=this.url_,l=a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return l==a&&ce(!1,50),Ur(l,s)}getUrl(){return this.url_}setImageLoadFunction(e){this.image_=null,this.imageLoadFunction_=e,this.changed()}setUrl(e){e!=this.url_&&(this.url_=e,this.image_=null,this.changed())}updateParams(e){ie(this.params_,e),this.image_=null,this.changed()}}var vZ=_Z;class xZ extends So{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);super({attributions:t.attributions,interpolate:i,projection:t.projection,resolutions:t.resolutions,state:t.state});this.canvasFunction_=t.canvasFunction,this.canvas_=null,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5}getImageInternal(e,t,i,r){t=this.findNearestResolution(t);let s=this.canvas_;if(s&&this.renderedRevision_==this.getRevision()&&s.getResolution()==t&&s.getPixelRatio()==i&&hi(s.getExtent(),e))return s;e=e.slice(),Vu(e,this.ratio_);const o=Ae(e)/t,a=ft(e)/t,l=[o*i,a*i],u=this.canvasFunction_.call(this,e,t,i,l,r);return u&&(s=new ac(e,t,i,u)),this.canvas_=s,this.renderedRevision_=this.getRevision(),s}}var EZ=xZ;class TZ extends So{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate);super({interpolate:t,projection:e.projection,resolutions:e.resolutions});this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null,this.displayDpi_=e.displayDpi!==void 0?e.displayDpi:96,this.params_=e.params||{},this.url_=e.url,this.imageLoadFunction_=e.imageLoadFunction!==void 0?e.imageLoadFunction:jh,this.hidpi_=e.hidpi!==void 0?e.hidpi:!0,this.metersPerUnit_=e.metersPerUnit!==void 0?e.metersPerUnit:1,this.ratio_=e.ratio!==void 0?e.ratio:1,this.useOverlay_=e.useOverlay!==void 0?e.useOverlay:!1,this.image_=null,this.renderedRevision_=0}getParams(){return this.params_}getImageInternal(e,t,i,r){t=this.findNearestResolution(t),i=this.hidpi_?i:1;let s=this.image_;if(s&&this.renderedRevision_==this.getRevision()&&s.getResolution()==t&&s.getPixelRatio()==i&&hi(s.getExtent(),e))return s;this.ratio_!=1&&(e=e.slice(),Vu(e,this.ratio_));const o=Ae(e)/t,a=ft(e)/t,l=[o*i,a*i];if(this.url_!==void 0){const u=this.getUrl(this.url_,this.params_,e,l,r);s=new pl(e,t,i,u,this.crossOrigin_,this.imageLoadFunction_),s.addEventListener(re.CHANGE,this.handleImageChange.bind(this))}else s=null;return this.image_=s,this.renderedRevision_=this.getRevision(),s}getImageLoadFunction(){return this.imageLoadFunction_}updateParams(e){ie(this.params_,e),this.changed()}getUrl(e,t,i,r,s){const o=wZ(i,r,this.metersPerUnit_,this.displayDpi_),a=fi(i),l={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:a[0],SETVIEWCENTERY:a[1]};return ie(l,t),Ur(e,l)}setImageLoadFunction(e){this.image_=null,this.imageLoadFunction_=e,this.changed()}}function wZ(n,e,t,i){const r=Ae(n),s=ft(n),o=e[0],a=e[1],l=.0254/i;return a*r>o*s?r*t/(o*l):s*t/(a*l)}var SZ=TZ;class RZ extends So{constructor(e){const t=e.crossOrigin!==void 0?e.crossOrigin:null,i=e.imageLoadFunction!==void 0?e.imageLoadFunction:jh;let r=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(r=e.interpolate);super({attributions:e.attributions,interpolate:r,projection:se(e.projection)});this.url_=e.url,this.imageExtent_=e.imageExtent,this.image_=new pl(this.imageExtent_,void 0,1,this.url_,t,i),this.imageSize_=e.imageSize?e.imageSize:null,this.image_.addEventListener(re.CHANGE,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(e,t,i,r){return dt(e,this.image_.getExtent())?this.image_:null}getUrl(){return this.url_}handleImageChange(e){if(this.image_.getState()==ye.LOADED){const t=this.image_.getExtent(),i=this.image_.getImage();let r,s;this.imageSize_?(r=this.imageSize_[0],s=this.imageSize_[1]):(r=i.width,s=i.height);const o=Ae(t),a=ft(t),l=o/r,u=a/s;let c=r,h=s;if(l>u?c=Math.round(o/u):h=Math.round(a/l),c!==r||h!==s){const f=Yt(c,h);this.getInterpolate()||ie(f,wa);const d=f.canvas;f.drawImage(i,0,0,r,s,0,0,d.width,d.height),this.image_.setImage(d)}}super.handleImageChange(e)}}var bZ=RZ;const Es="1.3.0";var Ts={CARMENTA_SERVER:"carmentaserver",GEOSERVER:"geoserver",MAPSERVER:"mapserver",QGIS:"qgis"};const Ro=4,JL=[101,101];class IZ extends So{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);super({attributions:t.attributions,interpolate:i,projection:t.projection,resolutions:t.resolutions});this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:jh,this.params_=t.params||{},this.v13_=!0,this.updateV13_(),this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5}getFeatureInfoUrl(e,t,i,r){if(this.url_===void 0)return;const s=se(i),o=this.getProjection();o&&o!==s&&(t=Zl(o,s,e,t),e=js(e,s,o));const a=Wo(e,t,0,JL),l={SERVICE:"WMS",VERSION:Es,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};ie(l,this.params_,r);const u=Ko((e[0]-a[0])/t,Ro),c=Ko((a[3]-e[1])/t,Ro);return l[this.v13_?"I":"X"]=u,l[this.v13_?"J":"Y"]=c,this.getRequestUrl_(a,JL,1,o||s,l)}getLegendUrl(e,t){if(this.url_===void 0)return;const i={SERVICE:"WMS",VERSION:Es,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(t===void 0||t.LAYER===void 0){const r=this.params_.LAYERS;if(!(!Array.isArray(r)||r.length===1))return;i.LAYER=r}if(e!==void 0){const r=this.getProjection()?this.getProjection().getMetersPerUnit():1,s=28e-5;i.SCALE=e*r/s}return ie(i,t),Ur(this.url_,i)}getParams(){return this.params_}getImageInternal(e,t,i,r){if(this.url_===void 0)return null;t=this.findNearestResolution(t),i!=1&&(!this.hidpi_||this.serverType_===void 0)&&(i=1);const s=t/i,o=fi(e),a=Zr(Ae(e)/s,Ro),l=Zr(ft(e)/s,Ro),u=Wo(o,s,0,[a,l]),c=Zr(this.ratio_*Ae(e)/s,Ro),h=Zr(this.ratio_*ft(e)/s,Ro),f=Wo(o,s,0,[c,h]),d=this.image_;if(d&&this.renderedRevision_==this.getRevision()&&d.getResolution()==t&&d.getPixelRatio()==i&&hi(d.getExtent(),u))return d;const p={SERVICE:"WMS",VERSION:Es,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};ie(p,this.params_),this.imageSize_[0]=Em(Ae(f)/s,Ro),this.imageSize_[1]=Em(ft(f)/s,Ro);const m=this.getRequestUrl_(f,this.imageSize_,i,r,p);return this.image_=new pl(f,t,i,m,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(re.CHANGE,this.handleImageChange.bind(this)),this.image_}getImageLoadFunction(){return this.imageLoadFunction_}getRequestUrl_(e,t,i,r,s){if(ce(this.url_!==void 0,9),s[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(s.STYLES=""),i!=1)switch(this.serverType_){case Ts.GEOSERVER:const l=90*i+.5|0;"FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+=";dpi:"+l:s.FORMAT_OPTIONS="dpi:"+l;break;case Ts.MAPSERVER:s.MAP_RESOLUTION=90*i;break;case Ts.CARMENTA_SERVER:case Ts.QGIS:s.DPI=90*i;break;default:ce(!1,8);break}s.WIDTH=t[0],s.HEIGHT=t[1];const o=r.getAxisOrientation();let a;return this.v13_&&o.substr(0,2)=="ne"?a=[e[1],e[0],e[3],e[2]]:a=e,s.BBOX=a.join(","),Ur(this.url_,s)}getUrl(){return this.url_}setImageLoadFunction(e){this.image_=null,this.imageLoadFunction_=e,this.changed()}setUrl(e){e!=this.url_&&(this.url_=e,this.image_=null,this.changed())}updateParams(e){ie(this.params_,e),this.updateV13_(),this.image_=null,this.changed()}updateV13_(){const e=this.params_.VERSION||Es;this.v13_=bm(e,"1.3")>=0}}var CZ=IZ;const LZ={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},OZ={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function QL(n,e){let t,i;for(let r=0;r<n.length;++r){const s=n[r];if(s.rel==="item"){if(s.type===e){t=s.href;break}(LZ[s.type]||!i&&s.type.indexOf("image/")===0)&&(i=s.href)}}if(!t)if(i)t=i;else throw new Error('Could not find "item" link');return t}function e2(n,e,t){let i,r;const s={};for(let o=0;o<n.length;++o){const a=n[o];if(s[a.type]=a.href,a.rel==="item"){if(a.type===e){i=a.href;break}OZ[a.type]&&(r=a.href)}}if(!i&&t)for(let o=0;o<t.length;++o){const a=t[o];if(s[a]){i=s[a];break}}if(!i)if(r)i=r;else throw new Error('Could not find "item" link');return i}function t2(n,e,t,i){let r=n.projection;if(!r&&(r=se(e.crs),!r))throw new Error(`Unsupported CRS: ${e.crs}`);const s=r.getAxisOrientation().substr(0,2)!=="en",o=e.tileMatrices,a={};for(let _=0;_<o.length;++_){const E=o[_];a[E.id]=E}const l={},u=[];if(i)for(let _=0;_<i.length;++_){const E=i[_],T=E.tileMatrix;u.push(T),l[T]=E}else for(let _=0;_<o.length;++_){const E=o[_].id;u.push(E)}const c=u.length,h=new Array(c),f=new Array(c),d=new Array(c),p=new Array(c),m=[-1/0,-1/0,1/0,1/0];for(let _=0;_<c;++_){const E=u[_],T=a[E],w=T.pointOfOrigin;s?h[_]=[w[1],w[0]]:h[_]=w,f[_]=T.cellSize,d[_]=[T.matrixWidth,T.matrixHeight],p[_]=[T.tileWidth,T.tileHeight];const S=l[E];if(S){const R=T.cellSize*T.tileWidth,b=h[_][0]+S.minTileCol*R,I=h[_][0]+(S.maxTileCol+1)*R,O=T.cellSize*T.tileHeight,P=T.cornerOfOrigin==="bottomLeft";let B,A;P?(B=h[_][1]+S.minTileRow*O,A=h[_][1]+(S.maxTileRow+1)*O):(B=h[_][1]-(S.maxTileRow+1)*O,A=h[_][1]-S.minTileRow*O),Ai(m,[b,B,I,A],m)}}const g=new oo({origins:h,resolutions:f,sizes:d,tileSizes:p,extent:i?m:void 0}),v=n.context,y=n.url;function x(_,E,T){if(!_)return;const w=u[_[0]],S=a[w],R=S.cornerOfOrigin==="bottomLeft",b={tileMatrix:w,tileCol:_[1],tileRow:R?-_[2]-1:_[2]};if(i){const O=l[S.id];if(b.tileCol<O.minTileCol||b.tileCol>O.maxTileCol||b.tileRow<O.minTileRow||b.tileRow>O.maxTileRow)return}ie(b,v);const I=t.replace(/\{(\w+?)\}/g,function(O,P){return b[P]});return Kv(y,I)}return{grid:g,urlTemplate:t,urlFunction:x}}function AZ(n,e){const t=e.tileMatrixSetLimits;let i;if(e.dataType==="map")i=QL(e.links,n.mediaType);else if(e.dataType==="vector")i=e2(e.links,n.mediaType,n.supportedMediaTypes);else throw new Error('Expected tileset data type to be "map" or "vector"');if(e.tileMatrixSet)return t2(n,e.tileMatrixSet,i,t);const r=e.links.find(a=>a.rel==="http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme");if(!r)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");const s=r.href,o=Kv(n.url,s);return Hv(o).then(function(a){return t2(n,a,i,t)})}function _1(n){return Hv(n.url).then(function(e){return AZ(n,e)})}class PZ extends $r{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate);super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:t,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Ge.LOADING,tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition});const i={url:e.url,projection:this.getProjection(),mediaType:e.mediaType,context:e.context||null};_1(i).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(e){this.tileGrid=e.grid,this.setTileUrlFunction(e.urlFunction,e.urlTemplate),this.setState(Ge.READY)}handleError_(e){console.error(e),this.setState(Ge.ERROR)}}var MZ=PZ;class FZ extends a_{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,format:e.format,overlaps:e.overlaps,projection:e.projection,tileClass:e.tileClass,transition:e.transition,wrapX:e.wrapX,zDirection:e.zDirection,state:Ge.LOADING});const t={url:e.url,projection:this.getProjection(),mediaType:e.mediaType,supportedMediaTypes:e.format.supportedMediaTypes,context:e.context||null};_1(t).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(e){this.tileGrid=e.grid,this.setTileUrlFunction(e.urlFunction,e.urlTemplate),this.setState(Ge.READY)}handleError_(e){console.error(e),this.setState(Ge.ERROR)}}var NZ=FZ;const v1='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class $Z extends Dh{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);let r;t.attributions!==void 0?r=t.attributions:r=[v1];const s=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",o=t.url!==void 0?t.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:r,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:s,interpolate:i,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:o,wrapX:t.wrapX,zDirection:t.zDirection})}}var DZ=$Z;let i2=!0;try{new ImageData(10,10)}catch{i2=!1}let x1;function n2(n,e,t){if(i2)return new ImageData(n,e,t);x1||(x1=document.createElement("canvas").getContext("2d"));const i=x1.createImageData(e,t);return i.data.set(n),i}function r2(n){let e=!0;try{new ImageData(10,10)}catch{e=!1}function t(i,r,s){return e?new ImageData(i,r,s):{data:i,width:r,height:s}}return function(i){const r=i.buffers,s=i.meta,o=i.imageOps,a=i.width,l=i.height,u=r.length,c=r[0].byteLength;if(o){const p=new Array(u);for(let g=0;g<u;++g)p[g]=t(new Uint8ClampedArray(r[g]),a,l);return n(p,s).data.buffer}const h=new Uint8ClampedArray(c),f=new Array(u),d=new Array(u);for(let p=0;p<u;++p)f[p]=new Uint8ClampedArray(r[p]),d[p]=[0,0,0,0];for(let p=0;p<c;p+=4){for(let g=0;g<u;++g){const v=f[g];d[g][0]=v[p],d[g][1]=v[p+1],d[g][2]=v[p+2],d[g][3]=v[p+3]}const m=n(d,s);h[p]=m[0],h[p+1]=m[1],h[p+2]=m[2],h[p+3]=m[3]}return h.buffer}}function kZ(n,e){const i=Object.keys(n.lib||{}).map(function(s){return"var "+s+" = "+n.lib[s].toString()+";"}).concat(["var __minion__ = ("+r2.toString()+")(",n.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Worker(typeof Blob=="undefined"?"data:text/javascript;base64,"+Buffer.from(i.join(`
|
317
|
-
`),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",e),r}function GZ(n,e){const t=r2(n.operation);let i=!1;return{postMessage:function(r){setTimeout(function(){i||e({data:{buffer:t(r),meta:r.meta}})},0)},terminate:function(){i=!0}}}class s2 extends ko{constructor(e){super();this._imageOps=!!e.imageOps;let t;e.threads===0?t=0:this._imageOps?t=1:t=e.threads||1;const i=new Array(t);if(t)for(let r=0;r<t;++r)i[r]=kZ(e,this._onWorkerMessage.bind(this,r));else i[0]=GZ(e,this._onWorkerMessage.bind(this,0));this._workers=i,this._queue=[],this._maxQueueLength=e.queue||1/0,this._running=0,this._dataLookup={},this._job=null}process(e,t,i){this._enqueue({inputs:e,meta:t,callback:i}),this._dispatch()}_enqueue(e){for(this._queue.push(e);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)}_dispatch(){if(this._running||this._queue.length===0)return;const e=this._queue.shift();this._job=e;const t=e.inputs[0].width,i=e.inputs[0].height,r=e.inputs.map(function(l){return l.data.buffer}),s=this._workers.length;if(this._running=s,s===1){this._workers[0].postMessage({buffers:r,meta:e.meta,imageOps:this._imageOps,width:t,height:i},r);return}const o=e.inputs[0].data.length,a=4*Math.ceil(o/4/s);for(let l=0;l<s;++l){const u=l*a,c=[];for(let h=0,f=r.length;h<f;++h)c.push(r[h].slice(u,u+a));this._workers[l].postMessage({buffers:c,meta:e.meta,imageOps:this._imageOps,width:t,height:i},c)}}_onWorkerMessage(e,t){this.disposed||(this._dataLookup[e]=t.data,--this._running,this._running===0&&this._resolveJob())}_resolveJob(){const e=this._job,t=this._workers.length;let i,r;if(t===1)i=new Uint8ClampedArray(this._dataLookup[0].buffer),r=this._dataLookup[0].meta;else{const s=e.inputs[0].data.length;i=new Uint8ClampedArray(s),r=new Array(t);const o=4*Math.ceil(s/4/t);for(let a=0;a<t;++a){const l=this._dataLookup[a].buffer,u=a*o;i.set(new Uint8ClampedArray(l),u),r[a]=this._dataLookup[a].meta}}this._job=null,this._dataLookup={},e.callback(null,n2(i,e.inputs[0].width,e.inputs[0].height),r),this._dispatch()}disposeInternal(){for(let e=0;e<this._workers.length;++e)this._workers[e].terminate();this._workers.length=0}}const o2={BEFOREOPERATIONS:"beforeoperations",AFTEROPERATIONS:"afteroperations"},a2={PIXEL:"pixel",IMAGE:"image"};class E1 extends ni{constructor(e,t,i){super(e);this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=i}}class l2 extends So{constructor(e){super({projection:null});this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType!==void 0?e.operationType:a2.PIXEL,this.threads_=e.threads!==void 0?e.threads:1,this.layers_=BZ(e.sources);const t=this.changed.bind(this);for(let i=0,r=this.layers_.length;i<r;++i)this.layers_[i].addEventListener(re.CHANGE,t);this.tileQueue_=new Jf(function(){return 1},this.changed.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:xt(),declutterTree:null,extent:null,index:0,layerIndex:0,layerStatesArray:zZ(this.layers_),pixelRatio:1,pixelToCoordinateTransform:xt(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:oe(this),renderTargets:{}},this.setAttributions(function(i){const r=[];for(let s=0,o=e.sources.length;s<o;++s){const a=e.sources[s],u=(a instanceof Al?a:a.getSource()).getAttributions();if(typeof u=="function"){const c=u(i);r.push.apply(r,c)}}return r.length!==0?r:null}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new s2({operation:e,imageOps:this.operationType_===a2.IMAGE,queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,i){const r=ie({},this.frameState_);r.viewState=ie({},r.viewState);const s=fi(e);r.extent=e.slice(),r.size[0]=Math.round(Ae(e)/t),r.size[1]=Math.round(ft(e)/t),r.time=Date.now();const o=r.viewState;return o.center=s,o.projection=i,o.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let i=0,r=this.layers_.length;i<r;++i)if(t=this.layers_[i].getSource(),t.getState()!==Ge.READY){e=!1;break}return e}getImage(e,t,i,r){if(!this.allSourcesReady_())return null;const s=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=s,this.renderedImageCanvas_){const o=this.renderedImageCanvas_.getResolution(),a=this.renderedImageCanvas_.getExtent();(t!==o||!Tn(e,a))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),s.tileQueue.loadMoreTiles(16,16),s.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){const e=this.requestedFrameState_,t=this.layers_.length,i=new Array(t);for(let s=0;s<t;++s){e.layerIndex=s;const o=UZ(this.layers_[s],e);if(o)i[s]=o;else return}const r={};this.dispatchEvent(new E1(o2.BEFOREOPERATIONS,e,r)),this.processor_.process(i,r,this.onWorkerComplete_.bind(this,e))}onWorkerComplete_(e,t,i,r){if(t||!i)return;const s=e.extent,o=e.viewState.resolution;if(o!==this.requestedFrameState_.viewState.resolution||!Tn(s,this.requestedFrameState_.extent))return;let a;if(this.renderedImageCanvas_)a=this.renderedImageCanvas_.getImage().getContext("2d");else{const l=Math.round(Ae(s)/o),u=Math.round(ft(s)/o);a=Yt(l,u),this.renderedImageCanvas_=new ac(s,o,1,a.canvas)}a.putImageData(i,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new E1(o2.AFTEROPERATIONS,e,r)),e.animate&&requestAnimationFrame(this.changed.bind(this))}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}}l2.prototype.dispose;let ja=null;function UZ(n,e){const t=n.getRenderer();if(!t)throw new Error("Unsupported layer type: "+n);if(!t.prepareFrame(e))return null;const i=e.size[0],r=e.size[1];if(i===0||r===0)return null;const s=t.renderFrame(e,null);let o;if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===i&&o.height===r)return o.getContext("2d").getImageData(0,0,i,r)}if(!ja)ja=Yt(i,r);else{const a=ja.canvas;a.width!==i||a.height!==r?ja=Yt(i,r):ja.clearRect(0,0,i,r)}return ja.drawImage(o,0,0,i,r),ja.getImageData(0,0,i,r)}function zZ(n){return n.map(function(e){return e.getLayerState()})}function BZ(n){const e=n.length,t=new Array(e);for(let i=0;i<e;++i)t[i]=jZ(n[i]);return t}function jZ(n){let e;return n instanceof Al?n instanceof Jc?e=new JC({source:n}):n instanceof So&&(e=new nb({source:n})):e=n,e}var YZ=l2;const XZ=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',v1],VZ={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},WZ={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}};class ZZ extends Dh{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate);const i=e.layer.indexOf("-"),r=i==-1?e.layer:e.layer.slice(0,i),s=WZ[r],o=VZ[e.layer],a=e.url!==void 0?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;super({attributions:XZ,cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:t,maxZoom:e.maxZoom!=null?e.maxZoom:s.maxZoom,minZoom:e.minZoom!=null?e.minZoom:s.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:a,wrapX:e.wrapX,zDirection:e.zDirection})}}var HZ=ZZ;class KZ extends $r{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection});this.params_=t.params||{},this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=wi(),this.setKey(this.getKeyForParams_())}getKeyForParams_(){let e=0;const t=[];for(const i in this.params_)t[e++]=i+"-"+this.params_[i];return t.join("/")}getParams(){return this.params_}getRequestUrl_(e,t,i,r,s,o){const a=this.urls;if(!a)return;const l=s.getCode().split(/:(?=\d+$)/).pop();o.SIZE=t[0]+","+t[1],o.BBOX=i.join(","),o.BBOXSR=l,o.IMAGESR=l,o.DPI=Math.round(o.DPI?o.DPI*r:90*r);let u;if(a.length==1)u=a[0];else{const h=Pn(bd(e),a.length);u=a[h]}const c=u.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return Ur(c,o)}getTilePixelRatio(e){return this.hidpi_?e:1}updateParams(e){ie(this.params_,e),this.setKey(this.getKeyForParams_())}tileUrlFunction(e,t,i){let r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),r.getResolutions().length<=e[0])return;t!=1&&!this.hidpi_&&(t=1);const s=r.getTileCoordExtent(e,this.tmpExtent_);let o=Tt(r.getTileSize(e[0]),this.tmpSize);t!=1&&(o=td(o,t,this.tmpSize));const a={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return ie(a,this.params_),this.getRequestUrl_(e,o,s,t,i,a)}}var qZ=KZ;class JZ extends Dh{constructor(e){const t=e||{};super({opaque:!1,projection:t.projection,tileGrid:t.tileGrid,wrapX:t.wrapX!==void 0?t.wrapX:!0,zDirection:t.zDirection,url:t.template||"z:{z} x:{x} y:{y}",tileLoadFunction:(i,r)=>{const s=i.getTileCoord()[0],o=Tt(this.tileGrid.getTileSize(s)),a=Yt(o[0],o[1]);a.strokeStyle="grey",a.strokeRect(.5,.5,o[0]+.5,o[1]+.5),a.fillStyle="grey",a.strokeStyle="white",a.textAlign="center",a.textBaseline="middle",a.font="24px sans-serif",a.lineWidth=4,a.strokeText(r,o[0]/2,o[1]/2,o[0]),a.fillText(r,o[0]/2,o[1]/2,o[0]),i.setImage(a.canvas)}})}}var QZ=JZ;class eH extends $r{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate);super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:t,projection:se("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Ge.LOADING,tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,zDirection:e.zDirection});if(this.tileJSON_=null,this.tileSize_=e.tileSize,e.url)if(e.jsonp)$h(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const i=new XMLHttpRequest;i.addEventListener("load",this.onXHRLoad_.bind(this)),i.addEventListener("error",this.onXHRError_.bind(this)),i.open("GET",e.url),i.send()}else e.tileJSON?this.handleTileJSONResponse(e.tileJSON):ce(!1,51)}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let i;try{i=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(i)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){const t=se("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const u=wn(t,i);r=Zo(e.bounds,u)}const s=ls(i),o=e.minzoom||0,a=e.maxzoom||22,l=Ra({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=up(e.tiles,l),e.attribution!==void 0&&!this.getAttributions()){const u=r!==void 0?r:s;this.setAttributions(function(c){return dt(u,c.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState(Ge.READY)}handleTileJSONError(){this.setState(Ge.ERROR)}}var tH=eH;class iH extends $r{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);const r=t.params||{},s="TRANSPARENT"in r?r.TRANSPARENT:!0;super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,opaque:!s,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection});this.gutter_=t.gutter!==void 0?t.gutter:0,this.params_=r,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=wi(),this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(e,t,i,r){const s=se(i),o=this.getProjection();let a=this.getTileGrid();a||(a=this.getTileGridForProjection(s));const l=a.getZForResolution(t,this.zDirection),u=a.getTileCoordForCoordAndZ(e,l);if(a.getResolutions().length<=u[0])return;let c=a.getResolution(u[0]),h=a.getTileCoordExtent(u,this.tmpExtent_),f=Tt(a.getTileSize(u[0]),this.tmpSize);const d=this.gutter_;d!==0&&(f=_0(f,d,this.tmpSize),h=un(h,c*d,h)),o&&o!==s&&(c=Zl(o,s,e,c),h=cl(h,s,o),e=js(e,s,o));const p={SERVICE:"WMS",VERSION:Es,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};ie(p,this.params_,r);const m=Math.floor((e[0]-h[0])/c),g=Math.floor((h[3]-e[1])/c);return p[this.v13_?"I":"X"]=m,p[this.v13_?"J":"Y"]=g,this.getRequestUrl_(u,f,h,1,o||s,p)}getLegendUrl(e,t){if(this.urls[0]===void 0)return;const i={SERVICE:"WMS",VERSION:Es,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(t===void 0||t.LAYER===void 0){const r=this.params_.LAYERS;if(!(!Array.isArray(r)||r.length===1))return;i.LAYER=r}if(e!==void 0){const r=this.getProjection()?this.getProjection().getMetersPerUnit():1,s=28e-5;i.SCALE=e*r/s}return ie(i,t),Ur(this.urls[0],i)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(e,t,i,r,s,o){const a=this.urls;if(!a)return;if(o.WIDTH=t[0],o.HEIGHT=t[1],o[this.v13_?"CRS":"SRS"]=s.getCode(),"STYLES"in this.params_||(o.STYLES=""),r!=1)switch(this.serverType_){case Ts.GEOSERVER:const h=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+h:o.FORMAT_OPTIONS="dpi:"+h;break;case Ts.MAPSERVER:o.MAP_RESOLUTION=90*r;break;case Ts.CARMENTA_SERVER:case Ts.QGIS:o.DPI=90*r;break;default:ce(!1,52);break}const l=s.getAxisOrientation(),u=i;if(this.v13_&&l.substr(0,2)=="ne"){let h;h=i[0],u[0]=i[1],u[1]=h,h=i[2],u[2]=i[3],u[3]=h}o.BBOX=u.join(",");let c;if(a.length==1)c=a[0];else{const h=Pn(bd(e),a.length);c=a[h]}return Ur(c,o)}getTilePixelRatio(e){return!this.hidpi_||this.serverType_===void 0?1:e}getKeyForParams_(){let e=0;const t=[];for(const i in this.params_)t[e++]=i+"-"+this.params_[i];return t.join("/")}updateParams(e){ie(this.params_,e),this.updateV13_(),this.setKey(this.getKeyForParams_())}updateV13_(){const e=this.params_.VERSION||Es;this.v13_=bm(e,"1.3")>=0}tileUrlFunction(e,t,i){let r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),r.getResolutions().length<=e[0])return;t!=1&&(!this.hidpi_||this.serverType_===void 0)&&(t=1);const s=r.getResolution(e[0]);let o=r.getTileCoordExtent(e,this.tmpExtent_),a=Tt(r.getTileSize(e[0]),this.tmpSize);const l=this.gutter_;l!==0&&(a=_0(a,l,this.tmpSize),o=un(o,s*l,o)),t!=1&&(a=td(a,t,this.tmpSize));const u={SERVICE:"WMS",VERSION:Es,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return ie(u,this.params_),this.getRequestUrl_(e,a,o,t,i,u)}}var nH=iH;class u2 extends ks{constructor(e,t,i,r,s,o){super(e,t);this.src_=i,this.extent_=r,this.preemptive_=s,this.grid_=null,this.keys_=null,this.data_=null,this.jsonp_=o}getImage(){return null}getData(e){if(!this.grid_||!this.keys_)return null;const t=(e[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),i=(e[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),r=this.grid_[Math.floor((1-i)*this.grid_.length)];if(typeof r!="string")return null;let s=r.charCodeAt(Math.floor(t*r.length));s>=93&&s--,s>=35&&s--,s-=32;let o=null;if(s in this.keys_){const a=this.keys_[s];this.data_&&a in this.data_?o=this.data_[a]:o=a}return o}forDataAtCoordinate(e,t,i){this.state==K.EMPTY&&i===!0?(this.state=K.IDLE,Uo(this,re.CHANGE,function(r){t(this.getData(e))},this),this.loadInternal_()):i===!0?setTimeout(function(){t(this.getData(e))}.bind(this),0):t(this.getData(e))}getKey(){return this.src_}handleError_(){this.state=K.ERROR,this.changed()}handleLoad_(e){this.grid_=e.grid,this.keys_=e.keys,this.data_=e.data,this.state=K.LOADED,this.changed()}loadInternal_(){if(this.state==K.IDLE)if(this.state=K.LOADING,this.jsonp_)$h(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",this.src_),e.send()}}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let i;try{i=JSON.parse(t.responseText)}catch{this.handleError_();return}this.handleLoad_(i)}else this.handleError_()}onXHRError_(e){this.handleError_()}load(){this.preemptive_?this.loadInternal_():this.setState(K.EMPTY)}}class rH extends Jc{constructor(e){super({projection:se("EPSG:3857"),state:Ge.LOADING,zDirection:e.zDirection});if(this.preemptive_=e.preemptive!==void 0?e.preemptive:!0,this.tileUrlFunction_=db,this.template_=void 0,this.jsonp_=e.jsonp||!1,e.url)if(this.jsonp_)$h(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",e.url),t.send()}else e.tileJSON?this.handleTileJSONResponse(e.tileJSON):ce(!1,51)}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let i;try{i=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(i)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTemplate(){return this.template_}forDataAtCoordinateAndResolution(e,t,i,r){if(this.tileGrid){const s=this.tileGrid.getZForResolution(t,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(e,s);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(e,i,r)}else r===!0?setTimeout(function(){i(null)},0):i(null)}handleTileJSONError(){this.setState(Ge.ERROR)}handleTileJSONResponse(e){const t=se("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const c=wn(t,i);r=Zo(e.bounds,c)}const s=ls(i),o=e.minzoom||0,a=e.maxzoom||22,l=Ra({extent:s,maxZoom:a,minZoom:o});this.tileGrid=l,this.template_=e.template;const u=e.grids;if(!u){this.setState(Ge.ERROR);return}if(this.tileUrlFunction_=up(u,l),e.attribution!==void 0){const c=r!==void 0?r:s;this.setAttributions(function(h){return dt(c,h.extent)?[e.attribution]:null})}this.setState(Ge.READY)}getTile(e,t,i,r,s){const o=Tr(e,t,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);{const a=[e,t,i],l=this.getTileCoordForTileUrlFunction(a,s),u=this.tileUrlFunction_(l,r,s),c=new u2(a,u!==void 0?K.IDLE:K.EMPTY,u!==void 0?u:"",this.tileGrid.getTileCoordExtent(a),this.preemptive_,this.jsonp_);return this.tileCache.set(o,c),c}}useTile(e,t,i){const r=Tr(e,t,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)}}var sH=rH,ws={KVP:"KVP",REST:"REST"};class c2 extends oo{constructor(e){super({extent:e.extent,origin:e.origin,origins:e.origins,resolutions:e.resolutions,tileSize:e.tileSize,tileSizes:e.tileSizes,sizes:e.sizes});this.matrixIds_=e.matrixIds}getMatrixId(e){return this.matrixIds_[e]}getMatrixIds(){return this.matrixIds_}}var oH=c2;function h2(n,e,t){const i=[],r=[],s=[],o=[],a=[],l=t!==void 0?t:[],u="SupportedCRS",c="TileMatrix",h="Identifier",f="ScaleDenominator",d="TopLeftCorner",p="TileWidth",m="TileHeight",g=n[u],v=se(g),y=v.getMetersPerUnit(),x=v.getAxisOrientation().substr(0,2)=="ne";return n[c].sort(function(_,E){return E[f]-_[f]}),n[c].forEach(function(_){let E;if(l.length>0?E=Go(l,function(T){return _[h]==T[c]?!0:_[h].indexOf(":")===-1?n[h]+":"+_[h]===T[c]:!1}):E=!0,E){r.push(_[h]);const T=_[f]*28e-5/y,w=_[p],S=_[m];x?s.push([_[d][1],_[d][0]]):s.push(_[d]),i.push(T),o.push(w==S?w:[w,S]),a.push([_.MatrixWidth,_.MatrixHeight])}}),new c2({extent:e,origins:s,resolutions:i,matrixIds:r,tileSizes:o,sizes:a})}class aH extends $r{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate);const i=e.requestEncoding!==void 0?e.requestEncoding:ws.KVP,r=e.tileGrid;let s=e.urls;s===void 0&&e.url!==void 0&&(s=cp(e.url));super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:t,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:e.tileClass,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,urls:s,wrapX:e.wrapX!==void 0?e.wrapX:!1,transition:e.transition,zDirection:e.zDirection});this.version_=e.version!==void 0?e.version:"1.0.0",this.format_=e.format!==void 0?e.format:"image/jpeg",this.dimensions_=e.dimensions!==void 0?e.dimensions:{},this.layer_=e.layer,this.matrixSet_=e.matrixSet,this.style_=e.style,this.requestEncoding_=i,this.setKey(this.getKeyForDimensions_()),s&&s.length>0&&(this.tileUrlFunction=Hl(s.map(this.createFromWMTSTemplate.bind(this))))}setUrls(e){this.urls=e;const t=e.join(`
|
318
|
-
`);this.setTileUrlFunction(Hl(e.map(this.createFromWMTSTemplate.bind(this))),t)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){let e=0;const t=[];for(const i in this.dimensions_)t[e++]=i+"-"+this.dimensions_[i];return t.join("/")}updateDimensions(e){ie(this.dimensions_,e),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(e){const t=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};t==ws.KVP&&ie(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),e=t==ws.KVP?Ur(e,i):e.replace(/\{(\w+?)\}/g,function(o,a){return a.toLowerCase()in i?i[a.toLowerCase()]:o});const r=this.tileGrid,s=this.dimensions_;return function(o,a,l){if(o){const u={TileMatrix:r.getMatrixId(o[0]),TileCol:o[1],TileRow:o[2]};ie(u,s);let c=e;return t==ws.KVP?c=Ur(c,u):c=c.replace(/\{(\w+?)\}/g,function(h,f){return u[f]}),c}else return}}}var lH=aH;function uH(n,e){const t=n.Contents.Layer,i=Go(t,function(O,P,B){return O.Identifier==e.layer});if(i===null)return null;const r=n.Contents.TileMatrixSet;let s;i.TileMatrixSetLink.length>1?"projection"in e?s=vf(i.TileMatrixSetLink,function(O,P,B){const L=Go(r,function(G){return G.Identifier==O.TileMatrixSet}).SupportedCRS,D=se(L),U=se(e.projection);return D&&U?dn(D,U):L==e.projection}):s=vf(i.TileMatrixSetLink,function(O,P,B){return O.TileMatrixSet==e.matrixSet}):s=0,s<0&&(s=0);const o=i.TileMatrixSetLink[s].TileMatrixSet,a=i.TileMatrixSetLink[s].TileMatrixSetLimits;let l=i.Format[0];"format"in e&&(l=e.format),s=vf(i.Style,function(O,P,B){return"style"in e?O.Title==e.style:O.isDefault}),s<0&&(s=0);const u=i.Style[s].Identifier,c={};"Dimension"in i&&i.Dimension.forEach(function(O,P,B){const A=O.Identifier;let L=O.Default;L===void 0&&(L=O.Value[0]),c[A]=L});const h=n.Contents.TileMatrixSet,f=Go(h,function(O,P,B){return O.Identifier==o});let d;const p=f.SupportedCRS;if(p&&(d=se(p)),"projection"in e){const O=se(e.projection);O&&(!d||dn(O,d))&&(d=O)}let m=!1;const g=d.getAxisOrientation().substr(0,2)=="ne";let v=f.TileMatrix[0],y={MinTileCol:0,MinTileRow:0,MaxTileCol:v.MatrixWidth-1,MaxTileRow:v.MatrixHeight-1};if(a){y=a[a.length-1];const O=Go(f.TileMatrix,P=>P.Identifier===y.TileMatrix||f.Identifier+":"+P.Identifier===y.TileMatrix);O&&(v=O)}const x=v.ScaleDenominator*28e-5/d.getMetersPerUnit(),_=g?[v.TopLeftCorner[1],v.TopLeftCorner[0]]:v.TopLeftCorner,E=v.TileWidth*x,T=v.TileHeight*x,w=f.BoundingBox;let S=[_[0]+E*y.MinTileCol,_[1]-T*(1+y.MaxTileRow),_[0]+E*(1+y.MaxTileCol),_[1]-T*y.MinTileRow];if(w!==void 0&&!hi(w,S)){const O=i.WGS84BoundingBox,P=se("EPSG:4326").getExtent();if(S=w,O)m=O[0]===P[0]&&O[2]===P[2];else{const B=cl(w,f.SupportedCRS,"EPSG:4326");m=B[0]-1e-10<=P[0]&&B[2]+1e-10>=P[2]}}const R=h2(f,S,a),b=[];let I=e.requestEncoding;if(I=I!==void 0?I:"","OperationsMetadata"in n&&"GetTile"in n.OperationsMetadata){const O=n.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let P=0,B=O.length;P<B;++P)if(O[P].Constraint){const L=Go(O[P].Constraint,function(D){return D.name=="GetEncoding"}).AllowedValues.Value;if(I===""&&(I=L[0]),I===ws.KVP)Ye(L,ws.KVP)&&b.push(O[P].href);else break}else O[P].href&&(I=ws.KVP,b.push(O[P].href))}return b.length===0&&(I=ws.REST,i.ResourceURL.forEach(function(O){O.resourceType==="tile"&&(l=O.format,b.push(O.template))})),{urls:b,layer:e.layer,matrixSet:o,format:l,projection:d,requestEncoding:I,tileGrid:R,style:u,dimensions:c,wrapX:m,crossOrigin:e.crossOrigin}}function cH(n,e){const t=new Rd(32),i=n.getExtent();return function(r,s){t.expireCache(),i&&(r=Ai(i,r));const o=n.getZForResolution(s),a=[];return n.forEachTileCoord(r,o,l=>{const u=l.toString();if(!t.containsKey(u)){const c=e(l);t.set(u,c)}a.push(t.get(u))}),a}}class hH{constructor(e){this.first_,this.last_,this.head_,this.circular_=e===void 0?!0:e,this.length_=0}insertItem(e){const t={prev:void 0,next:void 0,data:e},i=this.head_;if(!i)this.first_=t,this.last_=t,this.circular_&&(t.next=t,t.prev=t);else{const r=i.next;t.prev=i,t.next=r,i.next=t,r&&(r.prev=t),i===this.last_&&(this.last_=t)}this.head_=t,this.length_++}removeItem(){const e=this.head_;if(e){const t=e.next,i=e.prev;t&&(t.prev=i),i&&(i.next=t),this.head_=t||i,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===e?this.first_=this.head_:this.last_===e&&(this.last_=i?this.head_.prev:this.head_),this.length_--}}firstItem(){if(this.head_=this.first_,this.head_)return this.head_.data}lastItem(){if(this.head_=this.last_,this.head_)return this.head_.data}nextItem(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data}getNextItem(){if(this.head_&&this.head_.next)return this.head_.next.data}prevItem(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data}getPrevItem(){if(this.head_&&this.head_.prev)return this.head_.prev.data}getCurrItem(){if(this.head_)return this.head_.data}setFirstItem(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)}concat(e){if(e.head_){if(this.head_){const t=this.head_.next;this.head_.next=e.first_,e.first_.prev=this.head_,t.prev=e.last_,e.last_.next=t,this.length_+=e.length_}else this.head_=e.head_,this.first_=e.first_,this.last_=e.last_,this.length_=e.length_;e.head_=void 0,e.first_=void 0,e.last_=void 0,e.length_=0}}getLength(){return this.length_}}var fH=hH;const dH={CIRCLE:"circle",SQUARE:"square",TRIANGLE:"triangle",IMAGE:"image"};function pH(n,e){let t=n.length-e,i=0;do{for(let r=e;r>0;r--)n[i+e]+=n[i],i++;t-=e}while(t>0)}function gH(n,e,t){let i=0,r=n.length;const s=r/t;for(;r>e;){for(let a=e;a>0;--a)n[i+e]+=n[i],++i;r-=e}const o=n.slice();for(let a=0;a<s;++a)for(let l=0;l<t;++l)n[t*a+l]=o[(t-l-1)*s+a]}function mH(n,e,t,i,r,s){if(!e||e===1)return n;for(let l=0;l<r.length;++l){if(r[l]%8!==0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(r[l]!==r[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const o=r[0]/8,a=s===2?1:r.length;for(let l=0;l<i&&!(l*a*t*o>=n.byteLength);++l){let u;if(e===2){switch(r[0]){case 8:u=new Uint8Array(n,l*a*t*o,a*t*o);break;case 16:u=new Uint16Array(n,l*a*t*o,a*t*o/2);break;case 32:u=new Uint32Array(n,l*a*t*o,a*t*o/4);break;default:throw new Error(`Predictor 2 not allowed with ${r[0]} bits per sample.`)}pH(u,a)}else e===3&&(u=new Uint8Array(n,l*a*t*o,a*t*o),gH(u,a,o))}return n}class Ya{async decode(e,t){const i=await this.decodeBlock(t),r=e.Predictor||1;if(r!==1){const s=!e.StripOffsets,o=s?e.TileWidth:e.ImageWidth,a=s?e.TileLength:e.RowsPerStrip||e.ImageLength;return mH(i,r,o,a,e.BitsPerSample,e.PlanarConfiguration)}return i}}class yH extends Ya{decodeBlock(e){return e}}var _H=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:yH});const f2=9,T1=256,w1=257,vH=12;function xH(n,e,t){const i=e%8,r=Math.floor(e/8),s=8-i,o=e+t-(r+1)*8;let a=8*(r+2)-(e+t);const l=(r+2)*8-e;if(a=Math.max(0,a),r>=n.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),w1;let u=n[r]&2**(8-i)-1;u<<=t-s;let c=u;if(r+1<n.length){let h=n[r+1]>>>a;h<<=Math.max(0,t-l),c+=h}if(o>8&&r+2<n.length){const h=(r+3)*8-(e+t);c+=n[r+2]>>>h}return c}function S1(n,e){for(let t=e.length-1;t>=0;t--)n.push(e[t]);return n}function EH(n){const e=new Uint16Array(4093),t=new Uint8Array(4093);for(let p=0;p<=257;p++)e[p]=4096,t[p]=p;let i=258,r=f2,s=0;function o(){i=258,r=f2}function a(p){const m=xH(p,s,r);return s+=r,m}function l(p,m){return t[i]=m,e[i]=p,i++,i-1}function u(p){const m=[];for(let g=p;g!==4096;g=e[g])m.push(t[g]);return m}const c=[];o();const h=new Uint8Array(n);let f=a(h),d;for(;f!==w1;){if(f===T1){for(o(),f=a(h);f===T1;)f=a(h);if(f===w1)break;if(f>T1)throw new Error(`corrupted code at scanline ${f}`);{const p=u(f);S1(c,p),d=f}}else if(f<i){const p=u(f);S1(c,p),l(d,p[p.length-1]),d=f}else{const p=u(d);if(!p)throw new Error(`Bogus entry. Not in dictionary, ${d} / ${i}, position: ${s}`);S1(c,p),c.push(p[p.length-1]),l(d,p[p.length-1]),d=f}i+1>=2**r&&(r===vH?d=void 0:r++),f=a(h)}return new Uint8Array(c)}class TH extends Ya{decodeBlock(e){return EH(e).buffer}}var wH=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:TH});const Yh=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),gg=4017,mg=799,yg=3406,_g=2276,vg=1567,xg=3784,bu=5793,Eg=2896;function d2(n,e){let t=0;const i=[];let r=16;for(;r>0&&!n[r-1];)--r;i.push({children:[],index:0});let s=i[0],o;for(let a=0;a<r;a++){for(let l=0;l<n[a];l++){for(s=i.pop(),s.children[s.index]=e[t];s.index>0;)s=i.pop();for(s.index++,i.push(s);i.length<=a;)i.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;t++}a+1<r&&(i.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return i[0].children}function SH(n,e,t,i,r,s,o,a,l){const{mcusPerLine:u,progressive:c}=t,h=e;let f=e,d=0,p=0;function m(){if(p>0)return p--,d>>p&1;if(d=n[f++],d===255){const z=n[f++];if(z)throw new Error(`unexpected marker: ${(d<<8|z).toString(16)}`)}return p=7,d>>>7}function g(z){let j=z,V;for(;(V=m())!==null;){if(j=j[V],typeof j=="number")return j;if(typeof j!="object")throw new Error("invalid huffman sequence")}return null}function v(z){let j=z,V=0;for(;j>0;){const te=m();if(te===null)return;V=V<<1|te,--j}return V}function y(z){const j=v(z);return j>=1<<z-1?j:j+(-1<<z)+1}function x(z,j){const V=g(z.huffmanTableDC),te=V===0?0:y(V);z.pred+=te,j[0]=z.pred;let J=1;for(;J<64;){const X=g(z.huffmanTableAC),Se=X&15,_e=X>>4;if(Se===0){if(_e<15)break;J+=16}else{J+=_e;const be=Yh[J];j[be]=y(Se),J++}}}function _(z,j){const V=g(z.huffmanTableDC),te=V===0?0:y(V)<<l;z.pred+=te,j[0]=z.pred}function E(z,j){j[0]|=m()<<l}let T=0;function w(z,j){if(T>0){T--;return}let V=s;const te=o;for(;V<=te;){const J=g(z.huffmanTableAC),X=J&15,Se=J>>4;if(X===0){if(Se<15){T=v(Se)+(1<<Se)-1;break}V+=16}else{V+=Se;const _e=Yh[V];j[_e]=y(X)*(1<<l),V++}}}let S=0,R;function b(z,j){let V=s;const te=o;let J=0;for(;V<=te;){const X=Yh[V],Se=j[X]<0?-1:1;switch(S){case 0:{const _e=g(z.huffmanTableAC),be=_e&15;if(J=_e>>4,be===0)J<15?(T=v(J)+(1<<J),S=4):(J=16,S=1);else{if(be!==1)throw new Error("invalid ACn encoding");R=y(be),S=J?2:3}continue}case 1:case 2:j[X]?j[X]+=(m()<<l)*Se:(J--,J===0&&(S=S===2?3:0));break;case 3:j[X]?j[X]+=(m()<<l)*Se:(j[X]=R<<l,S=0);break;case 4:j[X]&&(j[X]+=(m()<<l)*Se);break}V++}S===4&&(T--,T===0&&(S=0))}function I(z,j,V,te,J){const X=V/u|0,Se=V%u,_e=X*z.v+te,be=Se*z.h+J;j(z,z.blocks[_e][be])}function O(z,j,V){const te=V/z.blocksPerLine|0,J=V%z.blocksPerLine;j(z,z.blocks[te][J])}const P=i.length;let B,A,L,D,U,G;c?s===0?G=a===0?_:E:G=a===0?w:b:G=x;let $=0,k,C;P===1?C=i[0].blocksPerLine*i[0].blocksPerColumn:C=u*t.mcusPerColumn;const Z=r||C;for(;$<C;){for(A=0;A<P;A++)i[A].pred=0;if(T=0,P===1)for(B=i[0],U=0;U<Z;U++)O(B,G,$),$++;else for(U=0;U<Z;U++){for(A=0;A<P;A++){B=i[A];const{h:z,v:j}=B;for(L=0;L<j;L++)for(D=0;D<z;D++)I(B,G,$,L,D)}if($++,$===C)break}if(p=0,k=n[f]<<8|n[f+1],k<65280)throw new Error("marker was not found");if(k>=65488&&k<=65495)f+=2;else break}return f-h}function RH(n,e){const t=[],{blocksPerLine:i,blocksPerColumn:r}=e,s=i<<3,o=new Int32Array(64),a=new Uint8Array(64);function l(u,c,h){const f=e.quantizationTable;let d,p,m,g,v,y,x,_,E;const T=h;let w;for(w=0;w<64;w++)T[w]=u[w]*f[w];for(w=0;w<8;++w){const S=8*w;if(T[1+S]===0&&T[2+S]===0&&T[3+S]===0&&T[4+S]===0&&T[5+S]===0&&T[6+S]===0&&T[7+S]===0){E=bu*T[0+S]+512>>10,T[0+S]=E,T[1+S]=E,T[2+S]=E,T[3+S]=E,T[4+S]=E,T[5+S]=E,T[6+S]=E,T[7+S]=E;continue}d=bu*T[0+S]+128>>8,p=bu*T[4+S]+128>>8,m=T[2+S],g=T[6+S],v=Eg*(T[1+S]-T[7+S])+128>>8,_=Eg*(T[1+S]+T[7+S])+128>>8,y=T[3+S]<<4,x=T[5+S]<<4,E=d-p+1>>1,d=d+p+1>>1,p=E,E=m*xg+g*vg+128>>8,m=m*vg-g*xg+128>>8,g=E,E=v-x+1>>1,v=v+x+1>>1,x=E,E=_+y+1>>1,y=_-y+1>>1,_=E,E=d-g+1>>1,d=d+g+1>>1,g=E,E=p-m+1>>1,p=p+m+1>>1,m=E,E=v*_g+_*yg+2048>>12,v=v*yg-_*_g+2048>>12,_=E,E=y*mg+x*gg+2048>>12,y=y*gg-x*mg+2048>>12,x=E,T[0+S]=d+_,T[7+S]=d-_,T[1+S]=p+x,T[6+S]=p-x,T[2+S]=m+y,T[5+S]=m-y,T[3+S]=g+v,T[4+S]=g-v}for(w=0;w<8;++w){const S=w;if(T[1*8+S]===0&&T[2*8+S]===0&&T[3*8+S]===0&&T[4*8+S]===0&&T[5*8+S]===0&&T[6*8+S]===0&&T[7*8+S]===0){E=bu*h[w+0]+8192>>14,T[0*8+S]=E,T[1*8+S]=E,T[2*8+S]=E,T[3*8+S]=E,T[4*8+S]=E,T[5*8+S]=E,T[6*8+S]=E,T[7*8+S]=E;continue}d=bu*T[0*8+S]+2048>>12,p=bu*T[4*8+S]+2048>>12,m=T[2*8+S],g=T[6*8+S],v=Eg*(T[1*8+S]-T[7*8+S])+2048>>12,_=Eg*(T[1*8+S]+T[7*8+S])+2048>>12,y=T[3*8+S],x=T[5*8+S],E=d-p+1>>1,d=d+p+1>>1,p=E,E=m*xg+g*vg+2048>>12,m=m*vg-g*xg+2048>>12,g=E,E=v-x+1>>1,v=v+x+1>>1,x=E,E=_+y+1>>1,y=_-y+1>>1,_=E,E=d-g+1>>1,d=d+g+1>>1,g=E,E=p-m+1>>1,p=p+m+1>>1,m=E,E=v*_g+_*yg+2048>>12,v=v*yg-_*_g+2048>>12,_=E,E=y*mg+x*gg+2048>>12,y=y*gg-x*mg+2048>>12,x=E,T[0*8+S]=d+_,T[7*8+S]=d-_,T[1*8+S]=p+x,T[6*8+S]=p-x,T[2*8+S]=m+y,T[5*8+S]=m-y,T[3*8+S]=g+v,T[4*8+S]=g-v}for(w=0;w<64;++w){const S=128+(T[w]+8>>4);S<0?c[w]=0:S>255?c[w]=255:c[w]=S}}for(let u=0;u<r;u++){const c=u<<3;for(let h=0;h<8;h++)t.push(new Uint8Array(s));for(let h=0;h<i;h++){l(e.blocks[u][h],a,o);let f=0;const d=h<<3;for(let p=0;p<8;p++){const m=t[c+p];for(let g=0;g<8;g++)m[d+g]=a[f++]}}}return t}class bH{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let t=0;function i(){const a=e[t]<<8|e[t+1];return t+=2,a}function r(){const a=i(),l=e.subarray(t,t+a-2);return t+=l.length,l}function s(a){let l=0,u=0,c,h;for(h in a.components)a.components.hasOwnProperty(h)&&(c=a.components[h],l<c.h&&(l=c.h),u<c.v&&(u=c.v));const f=Math.ceil(a.samplesPerLine/8/l),d=Math.ceil(a.scanLines/8/u);for(h in a.components)if(a.components.hasOwnProperty(h)){c=a.components[h];const p=Math.ceil(Math.ceil(a.samplesPerLine/8)*c.h/l),m=Math.ceil(Math.ceil(a.scanLines/8)*c.v/u),g=f*c.h,v=d*c.v,y=[];for(let x=0;x<v;x++){const _=[];for(let E=0;E<g;E++)_.push(new Int32Array(64));y.push(_)}c.blocksPerLine=p,c.blocksPerColumn=m,c.blocks=y}a.maxH=l,a.maxV=u,a.mcusPerLine=f,a.mcusPerColumn=d}let o=i();if(o!==65496)throw new Error("SOI not found");for(o=i();o!==65497;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const a=r();o===65504&&a[0]===74&&a[1]===70&&a[2]===73&&a[3]===70&&a[4]===0&&(this.jfif={version:{major:a[5],minor:a[6]},densityUnits:a[7],xDensity:a[8]<<8|a[9],yDensity:a[10]<<8|a[11],thumbWidth:a[12],thumbHeight:a[13],thumbData:a.subarray(14,14+3*a[12]*a[13])}),o===65518&&a[0]===65&&a[1]===100&&a[2]===111&&a[3]===98&&a[4]===101&&a[5]===0&&(this.adobe={version:a[6],flags0:a[7]<<8|a[8],flags1:a[9]<<8|a[10],transformCode:a[11]});break}case 65499:{const l=i()+t-2;for(;t<l;){const u=e[t++],c=new Int32Array(64);if(u>>4===0)for(let h=0;h<64;h++){const f=Yh[h];c[f]=e[t++]}else if(u>>4===1)for(let h=0;h<64;h++){const f=Yh[h];c[f]=i()}else throw new Error("DQT: invalid table spec");this.quantizationTables[u&15]=c}break}case 65472:case 65473:case 65474:{i();const a={extended:o===65473,progressive:o===65474,precision:e[t++],scanLines:i(),samplesPerLine:i(),components:{},componentsOrder:[]},l=e[t++];let u;for(let c=0;c<l;c++){u=e[t];const h=e[t+1]>>4,f=e[t+1]&15,d=e[t+2];a.componentsOrder.push(u),a.components[u]={h,v:f,quantizationIdx:d},t+=3}s(a),this.frames.push(a);break}case 65476:{const a=i();for(let l=2;l<a;){const u=e[t++],c=new Uint8Array(16);let h=0;for(let d=0;d<16;d++,t++)c[d]=e[t],h+=c[d];const f=new Uint8Array(h);for(let d=0;d<h;d++,t++)f[d]=e[t];l+=17+h,u>>4===0?this.huffmanTablesDC[u&15]=d2(c,f):this.huffmanTablesAC[u&15]=d2(c,f)}break}case 65501:i(),this.resetInterval=i();break;case 65498:{i();const a=e[t++],l=[],u=this.frames[0];for(let p=0;p<a;p++){const m=u.components[e[t++]],g=e[t++];m.huffmanTableDC=this.huffmanTablesDC[g>>4],m.huffmanTableAC=this.huffmanTablesAC[g&15],l.push(m)}const c=e[t++],h=e[t++],f=e[t++];t+=SH(e,t,u,l,this.resetInterval,c,h,f>>4,f&15);break}case 65535:e[t]!==255&&t--;break;default:if(e[t-3]===255&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error(`unknown JPEG marker ${o.toString(16)}`)}o=i()}}getResult(){const{frames:e}=this;if(this.frames.length===0)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let c=0;c<this.frames.length;c++){const h=this.frames[c].components;for(const f of Object.keys(h))h[f].quantizationTable=this.quantizationTables[h[f].quantizationIdx],delete h[f].quantizationIdx}const t=e[0],{components:i,componentsOrder:r}=t,s=[],o=t.samplesPerLine,a=t.scanLines;for(let c=0;c<r.length;c++){const h=i[r[c]];s.push({lines:RH(t,h),scaleX:h.h/t.maxH,scaleY:h.v/t.maxV})}const l=new Uint8Array(o*a*s.length);let u=0;for(let c=0;c<a;++c)for(let h=0;h<o;++h)for(let f=0;f<s.length;++f){const d=s[f];l[u]=d.lines[0|c*d.scaleY][0|h*d.scaleX],++u}return l}}class IH extends Ya{constructor(e){super();this.reader=new bH,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}var CH=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:IH});/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */const LH=4,p2=0,g2=1,OH=2;function Iu(n){let e=n.length;for(;--e>=0;)n[e]=0}const AH=0,m2=1,PH=2,MH=3,FH=258,R1=29,Xh=256,Vh=Xh+1+R1,Cu=30,b1=19,y2=2*Vh+1,Xa=15,I1=16,NH=7,C1=256,_2=16,v2=17,x2=18,L1=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Tg=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),$H=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),E2=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DH=512,Ss=new Array((Vh+2)*2);Iu(Ss);const Wh=new Array(Cu*2);Iu(Wh);const Zh=new Array(DH);Iu(Zh);const Hh=new Array(FH-MH+1);Iu(Hh);const O1=new Array(R1);Iu(O1);const wg=new Array(Cu);Iu(wg);function A1(n,e,t,i,r){this.static_tree=n,this.extra_bits=e,this.extra_base=t,this.elems=i,this.max_length=r,this.has_stree=n&&n.length}let T2,w2,S2;function P1(n,e){this.dyn_tree=n,this.max_code=0,this.stat_desc=e}const R2=n=>n<256?Zh[n]:Zh[256+(n>>>7)],Kh=(n,e)=>{n.pending_buf[n.pending++]=e&255,n.pending_buf[n.pending++]=e>>>8&255},xn=(n,e,t)=>{n.bi_valid>I1-t?(n.bi_buf|=e<<n.bi_valid&65535,Kh(n,n.bi_buf),n.bi_buf=e>>I1-n.bi_valid,n.bi_valid+=t-I1):(n.bi_buf|=e<<n.bi_valid&65535,n.bi_valid+=t)},zr=(n,e,t)=>{xn(n,t[e*2],t[e*2+1])},b2=(n,e)=>{let t=0;do t|=n&1,n>>>=1,t<<=1;while(--e>0);return t>>>1},kH=n=>{n.bi_valid===16?(Kh(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},GH=(n,e)=>{const t=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,c,h,f,d,p,m=0;for(f=0;f<=Xa;f++)n.bl_count[f]=0;for(t[n.heap[n.heap_max]*2+1]=0,u=n.heap_max+1;u<y2;u++)c=n.heap[u],f=t[t[c*2+1]*2+1]+1,f>l&&(f=l,m++),t[c*2+1]=f,!(c>i)&&(n.bl_count[f]++,d=0,c>=a&&(d=o[c-a]),p=t[c*2],n.opt_len+=p*(f+d),s&&(n.static_len+=p*(r[c*2+1]+d)));if(m!==0){do{for(f=l-1;n.bl_count[f]===0;)f--;n.bl_count[f]--,n.bl_count[f+1]+=2,n.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(c=n.bl_count[f];c!==0;)h=n.heap[--u],!(h>i)&&(t[h*2+1]!==f&&(n.opt_len+=(f-t[h*2+1])*t[h*2],t[h*2+1]=f),c--)}},I2=(n,e,t)=>{const i=new Array(Xa+1);let r=0,s,o;for(s=1;s<=Xa;s++)i[s]=r=r+t[s-1]<<1;for(o=0;o<=e;o++){let a=n[o*2+1];a!==0&&(n[o*2]=b2(i[a]++,a))}},UH=()=>{let n,e,t,i,r;const s=new Array(Xa+1);for(t=0,i=0;i<R1-1;i++)for(O1[i]=t,n=0;n<1<<L1[i];n++)Hh[t++]=i;for(Hh[t-1]=i,r=0,i=0;i<16;i++)for(wg[i]=r,n=0;n<1<<Tg[i];n++)Zh[r++]=i;for(r>>=7;i<Cu;i++)for(wg[i]=r<<7,n=0;n<1<<Tg[i]-7;n++)Zh[256+r++]=i;for(e=0;e<=Xa;e++)s[e]=0;for(n=0;n<=143;)Ss[n*2+1]=8,n++,s[8]++;for(;n<=255;)Ss[n*2+1]=9,n++,s[9]++;for(;n<=279;)Ss[n*2+1]=7,n++,s[7]++;for(;n<=287;)Ss[n*2+1]=8,n++,s[8]++;for(I2(Ss,Vh+1,s),n=0;n<Cu;n++)Wh[n*2+1]=5,Wh[n*2]=b2(n,5);T2=new A1(Ss,L1,Xh+1,Vh,Xa),w2=new A1(Wh,Tg,0,Cu,Xa),S2=new A1(new Array(0),$H,0,b1,NH)},C2=n=>{let e;for(e=0;e<Vh;e++)n.dyn_ltree[e*2]=0;for(e=0;e<Cu;e++)n.dyn_dtree[e*2]=0;for(e=0;e<b1;e++)n.bl_tree[e*2]=0;n.dyn_ltree[C1*2]=1,n.opt_len=n.static_len=0,n.last_lit=n.matches=0},L2=n=>{n.bi_valid>8?Kh(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},zH=(n,e,t,i)=>{L2(n),i&&(Kh(n,t),Kh(n,~t)),n.pending_buf.set(n.window.subarray(e,e+t),n.pending),n.pending+=t},O2=(n,e,t,i)=>{const r=e*2,s=t*2;return n[r]<n[s]||n[r]===n[s]&&i[e]<=i[t]},M1=(n,e,t)=>{const i=n.heap[t];let r=t<<1;for(;r<=n.heap_len&&(r<n.heap_len&&O2(e,n.heap[r+1],n.heap[r],n.depth)&&r++,!O2(e,i,n.heap[r],n.depth));)n.heap[t]=n.heap[r],t=r,r<<=1;n.heap[t]=i},A2=(n,e,t)=>{let i,r,s=0,o,a;if(n.last_lit!==0)do i=n.pending_buf[n.d_buf+s*2]<<8|n.pending_buf[n.d_buf+s*2+1],r=n.pending_buf[n.l_buf+s],s++,i===0?zr(n,r,e):(o=Hh[r],zr(n,o+Xh+1,e),a=L1[o],a!==0&&(r-=O1[o],xn(n,r,a)),i--,o=R2(i),zr(n,o,t),a=Tg[o],a!==0&&(i-=wg[o],xn(n,i,a)));while(s<n.last_lit);zr(n,C1,e)},F1=(n,e)=>{const t=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,a,l=-1,u;for(n.heap_len=0,n.heap_max=y2,o=0;o<s;o++)t[o*2]!==0?(n.heap[++n.heap_len]=l=o,n.depth[o]=0):t[o*2+1]=0;for(;n.heap_len<2;)u=n.heap[++n.heap_len]=l<2?++l:0,t[u*2]=1,n.depth[u]=0,n.opt_len--,r&&(n.static_len-=i[u*2+1]);for(e.max_code=l,o=n.heap_len>>1;o>=1;o--)M1(n,t,o);u=s;do o=n.heap[1],n.heap[1]=n.heap[n.heap_len--],M1(n,t,1),a=n.heap[1],n.heap[--n.heap_max]=o,n.heap[--n.heap_max]=a,t[u*2]=t[o*2]+t[a*2],n.depth[u]=(n.depth[o]>=n.depth[a]?n.depth[o]:n.depth[a])+1,t[o*2+1]=t[a*2+1]=u,n.heap[1]=u++,M1(n,t,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],GH(n,e),I2(t,l,n.bl_count)},P2=(n,e,t)=>{let i,r=-1,s,o=e[0*2+1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),e[(t+1)*2+1]=65535,i=0;i<=t;i++)s=o,o=e[(i+1)*2+1],!(++a<l&&s===o)&&(a<u?n.bl_tree[s*2]+=a:s!==0?(s!==r&&n.bl_tree[s*2]++,n.bl_tree[_2*2]++):a<=10?n.bl_tree[v2*2]++:n.bl_tree[x2*2]++,a=0,r=s,o===0?(l=138,u=3):s===o?(l=6,u=3):(l=7,u=4))},M2=(n,e,t)=>{let i,r=-1,s,o=e[0*2+1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),i=0;i<=t;i++)if(s=o,o=e[(i+1)*2+1],!(++a<l&&s===o)){if(a<u)do zr(n,s,n.bl_tree);while(--a!==0);else s!==0?(s!==r&&(zr(n,s,n.bl_tree),a--),zr(n,_2,n.bl_tree),xn(n,a-3,2)):a<=10?(zr(n,v2,n.bl_tree),xn(n,a-3,3)):(zr(n,x2,n.bl_tree),xn(n,a-11,7));a=0,r=s,o===0?(l=138,u=3):s===o?(l=6,u=3):(l=7,u=4)}},BH=n=>{let e;for(P2(n,n.dyn_ltree,n.l_desc.max_code),P2(n,n.dyn_dtree,n.d_desc.max_code),F1(n,n.bl_desc),e=b1-1;e>=3&&n.bl_tree[E2[e]*2+1]===0;e--);return n.opt_len+=3*(e+1)+5+5+4,e},jH=(n,e,t,i)=>{let r;for(xn(n,e-257,5),xn(n,t-1,5),xn(n,i-4,4),r=0;r<i;r++)xn(n,n.bl_tree[E2[r]*2+1],3);M2(n,n.dyn_ltree,e-1),M2(n,n.dyn_dtree,t-1)},YH=n=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&n.dyn_ltree[t*2]!==0)return p2;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return g2;for(t=32;t<Xh;t++)if(n.dyn_ltree[t*2]!==0)return g2;return p2};let F2=!1;const XH=n=>{F2||(UH(),F2=!0),n.l_desc=new P1(n.dyn_ltree,T2),n.d_desc=new P1(n.dyn_dtree,w2),n.bl_desc=new P1(n.bl_tree,S2),n.bi_buf=0,n.bi_valid=0,C2(n)},N2=(n,e,t,i)=>{xn(n,(AH<<1)+(i?1:0),3),zH(n,e,t,!0)},VH=n=>{xn(n,m2<<1,3),zr(n,C1,Ss),kH(n)},WH=(n,e,t,i)=>{let r,s,o=0;n.level>0?(n.strm.data_type===OH&&(n.strm.data_type=YH(n)),F1(n,n.l_desc),F1(n,n.d_desc),o=BH(n),r=n.opt_len+3+7>>>3,s=n.static_len+3+7>>>3,s<=r&&(r=s)):r=s=t+5,t+4<=r&&e!==-1?N2(n,e,t,i):n.strategy===LH||s===r?(xn(n,(m2<<1)+(i?1:0),3),A2(n,Ss,Wh)):(xn(n,(PH<<1)+(i?1:0),3),jH(n,n.l_desc.max_code+1,n.d_desc.max_code+1,o+1),A2(n,n.dyn_ltree,n.dyn_dtree)),C2(n),i&&L2(n)},ZH=(n,e,t)=>(n.pending_buf[n.d_buf+n.last_lit*2]=e>>>8&255,n.pending_buf[n.d_buf+n.last_lit*2+1]=e&255,n.pending_buf[n.l_buf+n.last_lit]=t&255,n.last_lit++,e===0?n.dyn_ltree[t*2]++:(n.matches++,e--,n.dyn_ltree[(Hh[t]+Xh+1)*2]++,n.dyn_dtree[R2(e)*2]++),n.last_lit===n.lit_bufsize-1);var HH=XH,KH=N2,qH=WH,JH=ZH,QH=VH,eK={_tr_init:HH,_tr_stored_block:KH,_tr_flush_block:qH,_tr_tally:JH,_tr_align:QH};const tK=(n,e,t,i)=>{let r=n&65535|0,s=n>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do r=r+e[i++]|0,s=s+r|0;while(--o);r%=65521,s%=65521}return r|s<<16|0};var qh=tK;const iK=()=>{let n,e=[];for(var t=0;t<256;t++){n=t;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e},nK=new Uint32Array(iK()),rK=(n,e,t,i)=>{const r=nK,s=i+t;n^=-1;for(let o=i;o<s;o++)n=n>>>8^r[(n^e[o])&255];return n^-1};var Ci=rK,Lu={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Jh={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:sK,_tr_stored_block:oK,_tr_flush_block:aK,_tr_tally:bo,_tr_align:lK}=eK,{Z_NO_FLUSH:Va,Z_PARTIAL_FLUSH:uK,Z_FULL_FLUSH:cK,Z_FINISH:Io,Z_BLOCK:$2,Z_OK:Br,Z_STREAM_END:D2,Z_STREAM_ERROR:zn,Z_DATA_ERROR:hK,Z_BUF_ERROR:N1,Z_DEFAULT_COMPRESSION:fK,Z_FILTERED:dK,Z_HUFFMAN_ONLY:Sg,Z_RLE:pK,Z_FIXED:gK,Z_DEFAULT_STRATEGY:mK,Z_UNKNOWN:yK,Z_DEFLATED:Rg}=Jh,_K=9,vK=15,xK=8,EK=29,TK=256,$1=TK+1+EK,wK=30,SK=19,RK=2*$1+1,bK=15,We=3,Co=258,lr=Co+We+1,IK=32,bg=42,D1=69,Ig=73,Cg=91,Lg=103,Wa=113,Qh=666,_i=1,ef=2,Za=3,Ou=4,CK=3,Lo=(n,e)=>(n.msg=Lu[e],e),k2=n=>(n<<1)-(n>4?9:0),Oo=n=>{let e=n.length;for(;--e>=0;)n[e]=0};let LK=(n,e,t)=>(e<<n.hash_shift^t)&n.hash_mask,Ao=LK;const Po=n=>{const e=n.state;let t=e.pending;t>n.avail_out&&(t=n.avail_out),t!==0&&(n.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),n.next_out),n.next_out+=t,e.pending_out+=t,n.total_out+=t,n.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},$i=(n,e)=>{aK(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,e),n.block_start=n.strstart,Po(n.strm)},tt=(n,e)=>{n.pending_buf[n.pending++]=e},tf=(n,e)=>{n.pending_buf[n.pending++]=e>>>8&255,n.pending_buf[n.pending++]=e&255},OK=(n,e,t,i)=>{let r=n.avail_in;return r>i&&(r=i),r===0?0:(n.avail_in-=r,e.set(n.input.subarray(n.next_in,n.next_in+r),t),n.state.wrap===1?n.adler=qh(n.adler,e,r,t):n.state.wrap===2&&(n.adler=Ci(n.adler,e,r,t)),n.next_in+=r,n.total_in+=r,r)},G2=(n,e)=>{let t=n.max_chain_length,i=n.strstart,r,s,o=n.prev_length,a=n.nice_match;const l=n.strstart>n.w_size-lr?n.strstart-(n.w_size-lr):0,u=n.window,c=n.w_mask,h=n.prev,f=n.strstart+Co;let d=u[i+o-1],p=u[i+o];n.prev_length>=n.good_match&&(t>>=2),a>n.lookahead&&(a=n.lookahead);do if(r=e,!(u[r+o]!==p||u[r+o-1]!==d||u[r]!==u[i]||u[++r]!==u[i+1])){i+=2,r++;do;while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&i<f);if(s=Co-(f-i),i=f-Co,s>o){if(n.match_start=e,o=s,s>=a)break;d=u[i+o-1],p=u[i+o]}}while((e=h[e&c])>l&&--t!==0);return o<=n.lookahead?o:n.lookahead},Ha=n=>{const e=n.w_size;let t,i,r,s,o;do{if(s=n.window_size-n.lookahead-n.strstart,n.strstart>=e+(e-lr)){n.window.set(n.window.subarray(e,e+e),0),n.match_start-=e,n.strstart-=e,n.block_start-=e,i=n.hash_size,t=i;do r=n.head[--t],n.head[t]=r>=e?r-e:0;while(--i);i=e,t=i;do r=n.prev[--t],n.prev[t]=r>=e?r-e:0;while(--i);s+=e}if(n.strm.avail_in===0)break;if(i=OK(n.strm,n.window,n.strstart+n.lookahead,s),n.lookahead+=i,n.lookahead+n.insert>=We)for(o=n.strstart-n.insert,n.ins_h=n.window[o],n.ins_h=Ao(n,n.ins_h,n.window[o+1]);n.insert&&(n.ins_h=Ao(n,n.ins_h,n.window[o+We-1]),n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++,n.insert--,!(n.lookahead+n.insert<We)););}while(n.lookahead<lr&&n.strm.avail_in!==0)},AK=(n,e)=>{let t=65535;for(t>n.pending_buf_size-5&&(t=n.pending_buf_size-5);;){if(n.lookahead<=1){if(Ha(n),n.lookahead===0&&e===Va)return _i;if(n.lookahead===0)break}n.strstart+=n.lookahead,n.lookahead=0;const i=n.block_start+t;if((n.strstart===0||n.strstart>=i)&&(n.lookahead=n.strstart-i,n.strstart=i,$i(n,!1),n.strm.avail_out===0)||n.strstart-n.block_start>=n.w_size-lr&&($i(n,!1),n.strm.avail_out===0))return _i}return n.insert=0,e===Io?($i(n,!0),n.strm.avail_out===0?Za:Ou):(n.strstart>n.block_start&&($i(n,!1),n.strm.avail_out===0),_i)},k1=(n,e)=>{let t,i;for(;;){if(n.lookahead<lr){if(Ha(n),n.lookahead<lr&&e===Va)return _i;if(n.lookahead===0)break}if(t=0,n.lookahead>=We&&(n.ins_h=Ao(n,n.ins_h,n.window[n.strstart+We-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),t!==0&&n.strstart-t<=n.w_size-lr&&(n.match_length=G2(n,t)),n.match_length>=We)if(i=bo(n,n.strstart-n.match_start,n.match_length-We),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=We){n.match_length--;do n.strstart++,n.ins_h=Ao(n,n.ins_h,n.window[n.strstart+We-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=Ao(n,n.ins_h,n.window[n.strstart+1]);else i=bo(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&($i(n,!1),n.strm.avail_out===0))return _i}return n.insert=n.strstart<We-1?n.strstart:We-1,e===Io?($i(n,!0),n.strm.avail_out===0?Za:Ou):n.last_lit&&($i(n,!1),n.strm.avail_out===0)?_i:ef},Au=(n,e)=>{let t,i,r;for(;;){if(n.lookahead<lr){if(Ha(n),n.lookahead<lr&&e===Va)return _i;if(n.lookahead===0)break}if(t=0,n.lookahead>=We&&(n.ins_h=Ao(n,n.ins_h,n.window[n.strstart+We-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=We-1,t!==0&&n.prev_length<n.max_lazy_match&&n.strstart-t<=n.w_size-lr&&(n.match_length=G2(n,t),n.match_length<=5&&(n.strategy===dK||n.match_length===We&&n.strstart-n.match_start>4096)&&(n.match_length=We-1)),n.prev_length>=We&&n.match_length<=n.prev_length){r=n.strstart+n.lookahead-We,i=bo(n,n.strstart-1-n.prev_match,n.prev_length-We),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=r&&(n.ins_h=Ao(n,n.ins_h,n.window[n.strstart+We-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=We-1,n.strstart++,i&&($i(n,!1),n.strm.avail_out===0))return _i}else if(n.match_available){if(i=bo(n,0,n.window[n.strstart-1]),i&&$i(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return _i}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=bo(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart<We-1?n.strstart:We-1,e===Io?($i(n,!0),n.strm.avail_out===0?Za:Ou):n.last_lit&&($i(n,!1),n.strm.avail_out===0)?_i:ef},PK=(n,e)=>{let t,i,r,s;const o=n.window;for(;;){if(n.lookahead<=Co){if(Ha(n),n.lookahead<=Co&&e===Va)return _i;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=We&&n.strstart>0&&(r=n.strstart-1,i=o[r],i===o[++r]&&i===o[++r]&&i===o[++r])){s=n.strstart+Co;do;while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&r<s);n.match_length=Co-(s-r),n.match_length>n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=We?(t=bo(n,1,n.match_length-We),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(t=bo(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),t&&($i(n,!1),n.strm.avail_out===0))return _i}return n.insert=0,e===Io?($i(n,!0),n.strm.avail_out===0?Za:Ou):n.last_lit&&($i(n,!1),n.strm.avail_out===0)?_i:ef},MK=(n,e)=>{let t;for(;;){if(n.lookahead===0&&(Ha(n),n.lookahead===0)){if(e===Va)return _i;break}if(n.match_length=0,t=bo(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,t&&($i(n,!1),n.strm.avail_out===0))return _i}return n.insert=0,e===Io?($i(n,!0),n.strm.avail_out===0?Za:Ou):n.last_lit&&($i(n,!1),n.strm.avail_out===0)?_i:ef};function jr(n,e,t,i,r){this.good_length=n,this.max_lazy=e,this.nice_length=t,this.max_chain=i,this.func=r}const nf=[new jr(0,0,0,0,AK),new jr(4,4,8,4,k1),new jr(4,5,16,8,k1),new jr(4,6,32,32,k1),new jr(4,4,16,16,Au),new jr(8,16,32,32,Au),new jr(8,16,128,128,Au),new jr(8,32,128,256,Au),new jr(32,128,258,1024,Au),new jr(32,258,258,4096,Au)],FK=n=>{n.window_size=2*n.w_size,Oo(n.head),n.max_lazy_match=nf[n.level].max_lazy,n.good_match=nf[n.level].good_length,n.nice_match=nf[n.level].nice_length,n.max_chain_length=nf[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=We-1,n.match_available=0,n.ins_h=0};function NK(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Rg,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(RK*2),this.dyn_dtree=new Uint16Array((2*wK+1)*2),this.bl_tree=new Uint16Array((2*SK+1)*2),Oo(this.dyn_ltree),Oo(this.dyn_dtree),Oo(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(bK+1),this.heap=new Uint16Array(2*$1+1),Oo(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*$1+1),Oo(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const U2=n=>{if(!n||!n.state)return Lo(n,zn);n.total_in=n.total_out=0,n.data_type=yK;const e=n.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?bg:Wa,n.adler=e.wrap===2?0:1,e.last_flush=Va,sK(e),Br},z2=n=>{const e=U2(n);return e===Br&&FK(n.state),e},$K=(n,e)=>!n||!n.state||n.state.wrap!==2?zn:(n.state.gzhead=e,Br),B2=(n,e,t,i,r,s)=>{if(!n)return zn;let o=1;if(e===fK&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),r<1||r>_K||t!==Rg||i<8||i>15||e<0||e>9||s<0||s>gK)return Lo(n,zn);i===8&&(i=9);const a=new NK;return n.state=a,a.strm=n,a.wrap=o,a.gzhead=null,a.w_bits=i,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=r+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+We-1)/We),a.window=new Uint8Array(a.w_size*2),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<r+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new Uint8Array(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=e,a.strategy=s,a.method=t,z2(n)},DK=(n,e)=>B2(n,e,Rg,vK,xK,mK),kK=(n,e)=>{let t,i;if(!n||!n.state||e>$2||e<0)return n?Lo(n,zn):zn;const r=n.state;if(!n.output||!n.input&&n.avail_in!==0||r.status===Qh&&e!==Io)return Lo(n,n.avail_out===0?N1:zn);r.strm=n;const s=r.last_flush;if(r.last_flush=e,r.status===bg)if(r.wrap===2)n.adler=0,tt(r,31),tt(r,139),tt(r,8),r.gzhead?(tt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),tt(r,r.gzhead.time&255),tt(r,r.gzhead.time>>8&255),tt(r,r.gzhead.time>>16&255),tt(r,r.gzhead.time>>24&255),tt(r,r.level===9?2:r.strategy>=Sg||r.level<2?4:0),tt(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(tt(r,r.gzhead.extra.length&255),tt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(n.adler=Ci(n.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=D1):(tt(r,0),tt(r,0),tt(r,0),tt(r,0),tt(r,0),tt(r,r.level===9?2:r.strategy>=Sg||r.level<2?4:0),tt(r,CK),r.status=Wa);else{let o=Rg+(r.w_bits-8<<4)<<8,a=-1;r.strategy>=Sg||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,o|=a<<6,r.strstart!==0&&(o|=IK),o+=31-o%31,r.status=Wa,tf(r,o),r.strstart!==0&&(tf(r,n.adler>>>16),tf(r,n.adler&65535)),n.adler=1}if(r.status===D1)if(r.gzhead.extra){for(t=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>t&&(n.adler=Ci(n.adler,r.pending_buf,r.pending-t,t)),Po(n),t=r.pending,r.pending===r.pending_buf_size));)tt(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>t&&(n.adler=Ci(n.adler,r.pending_buf,r.pending-t,t)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Ig)}else r.status=Ig;if(r.status===Ig)if(r.gzhead.name){t=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>t&&(n.adler=Ci(n.adler,r.pending_buf,r.pending-t,t)),Po(n),t=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.name.length?i=r.gzhead.name.charCodeAt(r.gzindex++)&255:i=0,tt(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>t&&(n.adler=Ci(n.adler,r.pending_buf,r.pending-t,t)),i===0&&(r.gzindex=0,r.status=Cg)}else r.status=Cg;if(r.status===Cg)if(r.gzhead.comment){t=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>t&&(n.adler=Ci(n.adler,r.pending_buf,r.pending-t,t)),Po(n),t=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.comment.length?i=r.gzhead.comment.charCodeAt(r.gzindex++)&255:i=0,tt(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>t&&(n.adler=Ci(n.adler,r.pending_buf,r.pending-t,t)),i===0&&(r.status=Lg)}else r.status=Lg;if(r.status===Lg&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Po(n),r.pending+2<=r.pending_buf_size&&(tt(r,n.adler&255),tt(r,n.adler>>8&255),n.adler=0,r.status=Wa)):r.status=Wa),r.pending!==0){if(Po(n),n.avail_out===0)return r.last_flush=-1,Br}else if(n.avail_in===0&&k2(e)<=k2(s)&&e!==Io)return Lo(n,N1);if(r.status===Qh&&n.avail_in!==0)return Lo(n,N1);if(n.avail_in!==0||r.lookahead!==0||e!==Va&&r.status!==Qh){let o=r.strategy===Sg?MK(r,e):r.strategy===pK?PK(r,e):nf[r.level].func(r,e);if((o===Za||o===Ou)&&(r.status=Qh),o===_i||o===Za)return n.avail_out===0&&(r.last_flush=-1),Br;if(o===ef&&(e===uK?lK(r):e!==$2&&(oK(r,0,0,!1),e===cK&&(Oo(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Po(n),n.avail_out===0))return r.last_flush=-1,Br}return e!==Io?Br:r.wrap<=0?D2:(r.wrap===2?(tt(r,n.adler&255),tt(r,n.adler>>8&255),tt(r,n.adler>>16&255),tt(r,n.adler>>24&255),tt(r,n.total_in&255),tt(r,n.total_in>>8&255),tt(r,n.total_in>>16&255),tt(r,n.total_in>>24&255)):(tf(r,n.adler>>>16),tf(r,n.adler&65535)),Po(n),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Br:D2)},GK=n=>{if(!n||!n.state)return zn;const e=n.state.status;return e!==bg&&e!==D1&&e!==Ig&&e!==Cg&&e!==Lg&&e!==Wa&&e!==Qh?Lo(n,zn):(n.state=null,e===Wa?Lo(n,hK):Br)},UK=(n,e)=>{let t=e.length;if(!n||!n.state)return zn;const i=n.state,r=i.wrap;if(r===2||r===1&&i.status!==bg||i.lookahead)return zn;if(r===1&&(n.adler=qh(n.adler,e,t,0)),i.wrap=0,t>=i.w_size){r===0&&(Oo(i.head),i.strstart=0,i.block_start=0,i.insert=0);let l=new Uint8Array(i.w_size);l.set(e.subarray(t-i.w_size,t),0),e=l,t=i.w_size}const s=n.avail_in,o=n.next_in,a=n.input;for(n.avail_in=t,n.next_in=0,n.input=e,Ha(i);i.lookahead>=We;){let l=i.strstart,u=i.lookahead-(We-1);do i.ins_h=Ao(i,i.ins_h,i.window[l+We-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++;while(--u);i.strstart=l,i.lookahead=We-1,Ha(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=We-1,i.match_available=0,n.next_in=o,n.input=a,n.avail_in=s,i.wrap=r,Br};var zK=DK,BK=B2,jK=z2,YK=U2,XK=$K,VK=kK,WK=GK,ZK=UK,HK="pako deflate (from Nodeca project)",rf={deflateInit:zK,deflateInit2:BK,deflateReset:jK,deflateResetKeep:YK,deflateSetHeader:XK,deflate:VK,deflateEnd:WK,deflateSetDictionary:ZK,deflateInfo:HK};const KK=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var qK=function(n){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(!!t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)KK(t,i)&&(n[i]=t[i])}}return n},JK=n=>{let e=0;for(let i=0,r=n.length;i<r;i++)e+=n[i].length;const t=new Uint8Array(e);for(let i=0,r=0,s=n.length;i<s;i++){let o=n[i];t.set(o,r),r+=o.length}return t},Og={assign:qK,flattenChunks:JK};let j2=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{j2=!1}const sf=new Uint8Array(256);for(let n=0;n<256;n++)sf[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;sf[254]=sf[254]=1;var QK=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let e,t,i,r,s,o=n.length,a=0;for(r=0;r<o;r++)t=n.charCodeAt(r),(t&64512)===55296&&r+1<o&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),r++)),a+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(a),s=0,r=0;s<a;r++)t=n.charCodeAt(r),(t&64512)===55296&&r+1<o&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),r++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const e7=(n,e)=>{if(e<65534&&n.subarray&&j2)return String.fromCharCode.apply(null,n.length===e?n:n.subarray(0,e));let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(n[i]);return t};var t7=(n,e)=>{const t=e||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,e));let i,r;const s=new Array(t*2);for(r=0,i=0;i<t;){let o=n[i++];if(o<128){s[r++]=o;continue}let a=sf[o];if(a>4){s[r++]=65533,i+=a-1;continue}for(o&=a===2?31:a===3?15:7;a>1&&i<t;)o=o<<6|n[i++]&63,a--;if(a>1){s[r++]=65533;continue}o<65536?s[r++]=o:(o-=65536,s[r++]=55296|o>>10&1023,s[r++]=56320|o&1023)}return e7(s,r)},i7=(n,e)=>{e=e||n.length,e>n.length&&(e=n.length);let t=e-1;for(;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+sf[n[t]]>e?t:e},of={string2buf:QK,buf2string:t7,utf8border:i7};function n7(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Y2=n7;const X2=Object.prototype.toString,{Z_NO_FLUSH:r7,Z_SYNC_FLUSH:s7,Z_FULL_FLUSH:o7,Z_FINISH:a7,Z_OK:Ag,Z_STREAM_END:l7,Z_DEFAULT_COMPRESSION:u7,Z_DEFAULT_STRATEGY:c7,Z_DEFLATED:h7}=Jh;function G1(n){this.options=Og.assign({level:u7,method:h7,chunkSize:16384,windowBits:15,memLevel:8,strategy:c7},n||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Y2,this.strm.avail_out=0;let t=rf.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Ag)throw new Error(Lu[t]);if(e.header&&rf.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=of.string2buf(e.dictionary):X2.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,t=rf.deflateSetDictionary(this.strm,i),t!==Ag)throw new Error(Lu[t]);this._dict_set=!0}}G1.prototype.push=function(n,e){const t=this.strm,i=this.options.chunkSize;let r,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?a7:r7,typeof n=="string"?t.input=of.string2buf(n):X2.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(s===s7||s===o7)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(r=rf.deflate(t,s),r===l7)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),r=rf.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Ag;if(t.avail_out===0){this.onData(t.output);continue}if(s>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},G1.prototype.onData=function(n){this.chunks.push(n)},G1.prototype.onEnd=function(n){n===Ag&&(this.result=Og.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};const Pg=30,f7=12;var d7=function(e,t){let i,r,s,o,a,l,u,c,h,f,d,p,m,g,v,y,x,_,E,T,w,S,R,b;const I=e.state;i=e.next_in,R=e.input,r=i+(e.avail_in-5),s=e.next_out,b=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),l=I.dmax,u=I.wsize,c=I.whave,h=I.wnext,f=I.window,d=I.hold,p=I.bits,m=I.lencode,g=I.distcode,v=(1<<I.lenbits)-1,y=(1<<I.distbits)-1;e:do{p<15&&(d+=R[i++]<<p,p+=8,d+=R[i++]<<p,p+=8),x=m[d&v];t:for(;;){if(_=x>>>24,d>>>=_,p-=_,_=x>>>16&255,_===0)b[s++]=x&65535;else if(_&16){E=x&65535,_&=15,_&&(p<_&&(d+=R[i++]<<p,p+=8),E+=d&(1<<_)-1,d>>>=_,p-=_),p<15&&(d+=R[i++]<<p,p+=8,d+=R[i++]<<p,p+=8),x=g[d&y];i:for(;;){if(_=x>>>24,d>>>=_,p-=_,_=x>>>16&255,_&16){if(T=x&65535,_&=15,p<_&&(d+=R[i++]<<p,p+=8,p<_&&(d+=R[i++]<<p,p+=8)),T+=d&(1<<_)-1,T>l){e.msg="invalid distance too far back",I.mode=Pg;break e}if(d>>>=_,p-=_,_=s-o,T>_){if(_=T-_,_>c&&I.sane){e.msg="invalid distance too far back",I.mode=Pg;break e}if(w=0,S=f,h===0){if(w+=u-_,_<E){E-=_;do b[s++]=f[w++];while(--_);w=s-T,S=b}}else if(h<_){if(w+=u+h-_,_-=h,_<E){E-=_;do b[s++]=f[w++];while(--_);if(w=0,h<E){_=h,E-=_;do b[s++]=f[w++];while(--_);w=s-T,S=b}}}else if(w+=h-_,_<E){E-=_;do b[s++]=f[w++];while(--_);w=s-T,S=b}for(;E>2;)b[s++]=S[w++],b[s++]=S[w++],b[s++]=S[w++],E-=3;E&&(b[s++]=S[w++],E>1&&(b[s++]=S[w++]))}else{w=s-T;do b[s++]=b[w++],b[s++]=b[w++],b[s++]=b[w++],E-=3;while(E>2);E&&(b[s++]=b[w++],E>1&&(b[s++]=b[w++]))}}else if((_&64)===0){x=g[(x&65535)+(d&(1<<_)-1)];continue i}else{e.msg="invalid distance code",I.mode=Pg;break e}break}}else if((_&64)===0){x=m[(x&65535)+(d&(1<<_)-1)];continue t}else if(_&32){I.mode=f7;break e}else{e.msg="invalid literal/length code",I.mode=Pg;break e}break}}while(i<r&&s<a);E=p>>3,i-=E,p-=E<<3,d&=(1<<p)-1,e.next_in=i,e.next_out=s,e.avail_in=i<r?5+(r-i):5-(i-r),e.avail_out=s<a?257+(a-s):257-(s-a),I.hold=d,I.bits=p};const Pu=15,V2=852,W2=592,Z2=0,U1=1,H2=2,p7=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),g7=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),m7=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),y7=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),_7=(n,e,t,i,r,s,o,a)=>{const l=a.bits;let u=0,c=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,y=0,x,_,E,T,w,S=null,R=0,b;const I=new Uint16Array(Pu+1),O=new Uint16Array(Pu+1);let P=null,B=0,A,L,D;for(u=0;u<=Pu;u++)I[u]=0;for(c=0;c<i;c++)I[e[t+c]]++;for(d=l,f=Pu;f>=1&&I[f]===0;f--);if(d>f&&(d=f),f===0)return r[s++]=1<<24|64<<16|0,r[s++]=1<<24|64<<16|0,a.bits=1,0;for(h=1;h<f&&I[h]===0;h++);for(d<h&&(d=h),g=1,u=1;u<=Pu;u++)if(g<<=1,g-=I[u],g<0)return-1;if(g>0&&(n===Z2||f!==1))return-1;for(O[1]=0,u=1;u<Pu;u++)O[u+1]=O[u]+I[u];for(c=0;c<i;c++)e[t+c]!==0&&(o[O[e[t+c]]++]=c);if(n===Z2?(S=P=o,b=19):n===U1?(S=p7,R-=257,P=g7,B-=257,b=256):(S=m7,P=y7,b=-1),y=0,c=0,u=h,w=s,p=d,m=0,E=-1,v=1<<d,T=v-1,n===U1&&v>V2||n===H2&&v>W2)return 1;for(;;){A=u-m,o[c]<b?(L=0,D=o[c]):o[c]>b?(L=P[B+o[c]],D=S[R+o[c]]):(L=32+64,D=0),x=1<<u-m,_=1<<p,h=_;do _-=x,r[w+(y>>m)+_]=A<<24|L<<16|D|0;while(_!==0);for(x=1<<u-1;y&x;)x>>=1;if(x!==0?(y&=x-1,y+=x):y=0,c++,--I[u]===0){if(u===f)break;u=e[t+o[c]]}if(u>d&&(y&T)!==E){for(m===0&&(m=d),w+=h,p=u-m,g=1<<p;p+m<f&&(g-=I[p+m],!(g<=0));)p++,g<<=1;if(v+=1<<p,n===U1&&v>V2||n===H2&&v>W2)return 1;E=y&T,r[E]=d<<24|p<<16|w-s|0}}return y!==0&&(r[w+y]=u-m<<24|64<<16|0),a.bits=d,0};var af=_7;const v7=0,K2=1,q2=2,{Z_FINISH:J2,Z_BLOCK:x7,Z_TREES:Mg,Z_OK:Ka,Z_STREAM_END:E7,Z_NEED_DICT:T7,Z_STREAM_ERROR:Bn,Z_DATA_ERROR:Q2,Z_MEM_ERROR:eO,Z_BUF_ERROR:w7,Z_DEFLATED:tO}=Jh,iO=1,nO=2,rO=3,sO=4,oO=5,aO=6,lO=7,uO=8,cO=9,hO=10,Fg=11,Rs=12,z1=13,fO=14,B1=15,dO=16,pO=17,gO=18,mO=19,Ng=20,$g=21,yO=22,_O=23,vO=24,xO=25,EO=26,j1=27,TO=28,wO=29,Pt=30,SO=31,S7=32,R7=852,b7=592,I7=15,C7=I7,RO=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function L7(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const bO=n=>{if(!n||!n.state)return Bn;const e=n.state;return n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=iO,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(R7),e.distcode=e.distdyn=new Int32Array(b7),e.sane=1,e.back=-1,Ka},IO=n=>{if(!n||!n.state)return Bn;const e=n.state;return e.wsize=0,e.whave=0,e.wnext=0,bO(n)},CO=(n,e)=>{let t;if(!n||!n.state)return Bn;const i=n.state;return e<0?(t=0,e=-e):(t=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?Bn:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,IO(n))},LO=(n,e)=>{if(!n)return Bn;const t=new L7;n.state=t,t.window=null;const i=CO(n,e);return i!==Ka&&(n.state=null),i},O7=n=>LO(n,C7);let OO=!0,Y1,X1;const A7=n=>{if(OO){Y1=new Int32Array(512),X1=new Int32Array(32);let e=0;for(;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(af(K2,n.lens,0,288,Y1,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;af(q2,n.lens,0,32,X1,0,n.work,{bits:5}),OO=!1}n.lencode=Y1,n.lenbits=9,n.distcode=X1,n.distbits=5},AO=(n,e,t,i)=>{let r;const s=n.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),s.window.set(e.subarray(t-i,t-i+r),s.wnext),i-=r,i?(s.window.set(e.subarray(t-i,t),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0},P7=(n,e)=>{let t,i,r,s,o,a,l,u,c,h,f,d,p,m,g=0,v,y,x,_,E,T,w,S;const R=new Uint8Array(4);let b,I;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!n||!n.state||!n.output||!n.input&&n.avail_in!==0)return Bn;t=n.state,t.mode===Rs&&(t.mode=z1),o=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,a=n.avail_in,u=t.hold,c=t.bits,h=a,f=l,S=Ka;e:for(;;)switch(t.mode){case iO:if(t.wrap===0){t.mode=z1;break}for(;c<16;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if(t.wrap&2&&u===35615){t.check=0,R[0]=u&255,R[1]=u>>>8&255,t.check=Ci(t.check,R,2,0),u=0,c=0,t.mode=nO;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){n.msg="incorrect header check",t.mode=Pt;break}if((u&15)!==tO){n.msg="unknown compression method",t.mode=Pt;break}if(u>>>=4,c-=4,w=(u&15)+8,t.wbits===0)t.wbits=w;else if(w>t.wbits){n.msg="invalid window size",t.mode=Pt;break}t.dmax=1<<t.wbits,n.adler=t.check=1,t.mode=u&512?hO:Rs,u=0,c=0;break;case nO:for(;c<16;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if(t.flags=u,(t.flags&255)!==tO){n.msg="unknown compression method",t.mode=Pt;break}if(t.flags&57344){n.msg="unknown header flags set",t.mode=Pt;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&(R[0]=u&255,R[1]=u>>>8&255,t.check=Ci(t.check,R,2,0)),u=0,c=0,t.mode=rO;case rO:for(;c<32;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}t.head&&(t.head.time=u),t.flags&512&&(R[0]=u&255,R[1]=u>>>8&255,R[2]=u>>>16&255,R[3]=u>>>24&255,t.check=Ci(t.check,R,4,0)),u=0,c=0,t.mode=sO;case sO:for(;c<16;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&(R[0]=u&255,R[1]=u>>>8&255,t.check=Ci(t.check,R,2,0)),u=0,c=0,t.mode=oO;case oO:if(t.flags&1024){for(;c<16;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&(R[0]=u&255,R[1]=u>>>8&255,t.check=Ci(t.check,R,2,0)),u=0,c=0}else t.head&&(t.head.extra=null);t.mode=aO;case aO:if(t.flags&1024&&(d=t.length,d>a&&(d=a),d&&(t.head&&(w=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(s,s+d),w)),t.flags&512&&(t.check=Ci(t.check,i,d,s)),a-=d,s+=d,t.length-=d),t.length))break e;t.length=0,t.mode=lO;case lO:if(t.flags&2048){if(a===0)break e;d=0;do w=i[s+d++],t.head&&w&&t.length<65536&&(t.head.name+=String.fromCharCode(w));while(w&&d<a);if(t.flags&512&&(t.check=Ci(t.check,i,d,s)),a-=d,s+=d,w)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=uO;case uO:if(t.flags&4096){if(a===0)break e;d=0;do w=i[s+d++],t.head&&w&&t.length<65536&&(t.head.comment+=String.fromCharCode(w));while(w&&d<a);if(t.flags&512&&(t.check=Ci(t.check,i,d,s)),a-=d,s+=d,w)break e}else t.head&&(t.head.comment=null);t.mode=cO;case cO:if(t.flags&512){for(;c<16;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if(u!==(t.check&65535)){n.msg="header crc mismatch",t.mode=Pt;break}u=0,c=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=Rs;break;case hO:for(;c<32;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}n.adler=t.check=RO(u),u=0,c=0,t.mode=Fg;case Fg:if(t.havedict===0)return n.next_out=o,n.avail_out=l,n.next_in=s,n.avail_in=a,t.hold=u,t.bits=c,T7;n.adler=t.check=1,t.mode=Rs;case Rs:if(e===x7||e===Mg)break e;case z1:if(t.last){u>>>=c&7,c-=c&7,t.mode=j1;break}for(;c<3;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}switch(t.last=u&1,u>>>=1,c-=1,u&3){case 0:t.mode=fO;break;case 1:if(A7(t),t.mode=Ng,e===Mg){u>>>=2,c-=2;break e}break;case 2:t.mode=pO;break;case 3:n.msg="invalid block type",t.mode=Pt}u>>>=2,c-=2;break;case fO:for(u>>>=c&7,c-=c&7;c<32;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if((u&65535)!==(u>>>16^65535)){n.msg="invalid stored block lengths",t.mode=Pt;break}if(t.length=u&65535,u=0,c=0,t.mode=B1,e===Mg)break e;case B1:t.mode=dO;case dO:if(d=t.length,d){if(d>a&&(d=a),d>l&&(d=l),d===0)break e;r.set(i.subarray(s,s+d),o),a-=d,s+=d,l-=d,o+=d,t.length-=d;break}t.mode=Rs;break;case pO:for(;c<14;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if(t.nlen=(u&31)+257,u>>>=5,c-=5,t.ndist=(u&31)+1,u>>>=5,c-=5,t.ncode=(u&15)+4,u>>>=4,c-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=Pt;break}t.have=0,t.mode=gO;case gO:for(;t.have<t.ncode;){for(;c<3;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}t.lens[O[t.have++]]=u&7,u>>>=3,c-=3}for(;t.have<19;)t.lens[O[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,b={bits:t.lenbits},S=af(v7,t.lens,0,19,t.lencode,0,t.work,b),t.lenbits=b.bits,S){n.msg="invalid code lengths set",t.mode=Pt;break}t.have=0,t.mode=mO;case mO:for(;t.have<t.nlen+t.ndist;){for(;g=t.lencode[u&(1<<t.lenbits)-1],v=g>>>24,y=g>>>16&255,x=g&65535,!(v<=c);){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if(x<16)u>>>=v,c-=v,t.lens[t.have++]=x;else{if(x===16){for(I=v+2;c<I;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if(u>>>=v,c-=v,t.have===0){n.msg="invalid bit length repeat",t.mode=Pt;break}w=t.lens[t.have-1],d=3+(u&3),u>>>=2,c-=2}else if(x===17){for(I=v+3;c<I;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}u>>>=v,c-=v,w=0,d=3+(u&7),u>>>=3,c-=3}else{for(I=v+7;c<I;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}u>>>=v,c-=v,w=0,d=11+(u&127),u>>>=7,c-=7}if(t.have+d>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=Pt;break}for(;d--;)t.lens[t.have++]=w}}if(t.mode===Pt)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=Pt;break}if(t.lenbits=9,b={bits:t.lenbits},S=af(K2,t.lens,0,t.nlen,t.lencode,0,t.work,b),t.lenbits=b.bits,S){n.msg="invalid literal/lengths set",t.mode=Pt;break}if(t.distbits=6,t.distcode=t.distdyn,b={bits:t.distbits},S=af(q2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,b),t.distbits=b.bits,S){n.msg="invalid distances set",t.mode=Pt;break}if(t.mode=Ng,e===Mg)break e;case Ng:t.mode=$g;case $g:if(a>=6&&l>=258){n.next_out=o,n.avail_out=l,n.next_in=s,n.avail_in=a,t.hold=u,t.bits=c,d7(n,f),o=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,a=n.avail_in,u=t.hold,c=t.bits,t.mode===Rs&&(t.back=-1);break}for(t.back=0;g=t.lencode[u&(1<<t.lenbits)-1],v=g>>>24,y=g>>>16&255,x=g&65535,!(v<=c);){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if(y&&(y&240)===0){for(_=v,E=y,T=x;g=t.lencode[T+((u&(1<<_+E)-1)>>_)],v=g>>>24,y=g>>>16&255,x=g&65535,!(_+v<=c);){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}u>>>=_,c-=_,t.back+=_}if(u>>>=v,c-=v,t.back+=v,t.length=x,y===0){t.mode=EO;break}if(y&32){t.back=-1,t.mode=Rs;break}if(y&64){n.msg="invalid literal/length code",t.mode=Pt;break}t.extra=y&15,t.mode=yO;case yO:if(t.extra){for(I=t.extra;c<I;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}t.length+=u&(1<<t.extra)-1,u>>>=t.extra,c-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=_O;case _O:for(;g=t.distcode[u&(1<<t.distbits)-1],v=g>>>24,y=g>>>16&255,x=g&65535,!(v<=c);){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if((y&240)===0){for(_=v,E=y,T=x;g=t.distcode[T+((u&(1<<_+E)-1)>>_)],v=g>>>24,y=g>>>16&255,x=g&65535,!(_+v<=c);){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}u>>>=_,c-=_,t.back+=_}if(u>>>=v,c-=v,t.back+=v,y&64){n.msg="invalid distance code",t.mode=Pt;break}t.offset=x,t.extra=y&15,t.mode=vO;case vO:if(t.extra){for(I=t.extra;c<I;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}t.offset+=u&(1<<t.extra)-1,u>>>=t.extra,c-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=Pt;break}t.mode=xO;case xO:if(l===0)break e;if(d=f-l,t.offset>d){if(d=t.offset-d,d>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=Pt;break}d>t.wnext?(d-=t.wnext,p=t.wsize-d):p=t.wnext-d,d>t.length&&(d=t.length),m=t.window}else m=r,p=o-t.offset,d=t.length;d>l&&(d=l),l-=d,t.length-=d;do r[o++]=m[p++];while(--d);t.length===0&&(t.mode=$g);break;case EO:if(l===0)break e;r[o++]=t.length,l--,t.mode=$g;break;case j1:if(t.wrap){for(;c<32;){if(a===0)break e;a--,u|=i[s++]<<c,c+=8}if(f-=l,n.total_out+=f,t.total+=f,f&&(n.adler=t.check=t.flags?Ci(t.check,r,f,o-f):qh(t.check,r,f,o-f)),f=l,(t.flags?u:RO(u))!==t.check){n.msg="incorrect data check",t.mode=Pt;break}u=0,c=0}t.mode=TO;case TO:if(t.wrap&&t.flags){for(;c<32;){if(a===0)break e;a--,u+=i[s++]<<c,c+=8}if(u!==(t.total&4294967295)){n.msg="incorrect length check",t.mode=Pt;break}u=0,c=0}t.mode=wO;case wO:S=E7;break e;case Pt:S=Q2;break e;case SO:return eO;case S7:default:return Bn}return n.next_out=o,n.avail_out=l,n.next_in=s,n.avail_in=a,t.hold=u,t.bits=c,(t.wsize||f!==n.avail_out&&t.mode<Pt&&(t.mode<j1||e!==J2))&&AO(n,n.output,n.next_out,f-n.avail_out),h-=n.avail_in,f-=n.avail_out,n.total_in+=h,n.total_out+=f,t.total+=f,t.wrap&&f&&(n.adler=t.check=t.flags?Ci(t.check,r,f,n.next_out-f):qh(t.check,r,f,n.next_out-f)),n.data_type=t.bits+(t.last?64:0)+(t.mode===Rs?128:0)+(t.mode===Ng||t.mode===B1?256:0),(h===0&&f===0||e===J2)&&S===Ka&&(S=w7),S},M7=n=>{if(!n||!n.state)return Bn;let e=n.state;return e.window&&(e.window=null),n.state=null,Ka},F7=(n,e)=>{if(!n||!n.state)return Bn;const t=n.state;return(t.wrap&2)===0?Bn:(t.head=e,e.done=!1,Ka)},N7=(n,e)=>{const t=e.length;let i,r,s;return!n||!n.state||(i=n.state,i.wrap!==0&&i.mode!==Fg)?Bn:i.mode===Fg&&(r=1,r=qh(r,e,t,0),r!==i.check)?Q2:(s=AO(n,e,t,t),s?(i.mode=SO,eO):(i.havedict=1,Ka))};var $7=IO,D7=CO,k7=bO,G7=O7,U7=LO,z7=P7,B7=M7,j7=F7,Y7=N7,X7="pako inflate (from Nodeca project)",bs={inflateReset:$7,inflateReset2:D7,inflateResetKeep:k7,inflateInit:G7,inflateInit2:U7,inflate:z7,inflateEnd:B7,inflateGetHeader:j7,inflateSetDictionary:Y7,inflateInfo:X7};function V7(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var W7=V7;const PO=Object.prototype.toString,{Z_NO_FLUSH:Z7,Z_FINISH:H7,Z_OK:lf,Z_STREAM_END:V1,Z_NEED_DICT:W1,Z_STREAM_ERROR:K7,Z_DATA_ERROR:MO,Z_MEM_ERROR:q7}=Jh;function uf(n){this.options=Og.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Y2,this.strm.avail_out=0;let t=bs.inflateInit2(this.strm,e.windowBits);if(t!==lf)throw new Error(Lu[t]);if(this.header=new W7,bs.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=of.string2buf(e.dictionary):PO.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=bs.inflateSetDictionary(this.strm,e.dictionary),t!==lf)))throw new Error(Lu[t])}uf.prototype.push=function(n,e){const t=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?H7:Z7,PO.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),s=bs.inflate(t,o),s===W1&&r&&(s=bs.inflateSetDictionary(t,r),s===lf?s=bs.inflate(t,o):s===MO&&(s=W1));t.avail_in>0&&s===V1&&t.state.wrap>0&&n[t.next_in]!==0;)bs.inflateReset(t),s=bs.inflate(t,o);switch(s){case K7:case MO:case W1:case q7:return this.onEnd(s),this.ended=!0,!1}if(a=t.avail_out,t.next_out&&(t.avail_out===0||s===V1))if(this.options.to==="string"){let l=of.utf8border(t.output,t.next_out),u=t.next_out-l,c=of.buf2string(t.output,l);t.next_out=u,t.avail_out=i-u,u&&t.output.set(t.output.subarray(l,l+u),0),this.onData(c)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===lf&&a===0)){if(s===V1)return s=bs.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},uf.prototype.onData=function(n){this.chunks.push(n)},uf.prototype.onEnd=function(n){n===lf&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Og.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Z1(n,e){const t=new uf(e);if(t.push(n),t.err)throw t.msg||Lu[t.err];return t.result}function J7(n,e){return e=e||{},e.raw=!0,Z1(n,e)}var Q7=uf,eq=Z1,tq=J7,iq=Z1,nq=Jh,rq={Inflate:Q7,inflate:eq,inflateRaw:tq,ungzip:iq,constants:nq};const{Inflate:Lq,inflate:sq,inflateRaw:Oq,ungzip:Aq}=rq;var FO=sq;class oq extends Ya{decodeBlock(e){return FO(new Uint8Array(e)).buffer}}var aq=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:oq});class lq extends Ya{decodeBlock(e){const t=new DataView(e),i=[];for(let r=0;r<e.byteLength;++r){let s=t.getInt8(r);if(s<0){const o=t.getUint8(r+1);s=-s;for(let a=0;a<=s;++a)i.push(o);r+=1}else{for(let o=0;o<=s;++o)i.push(t.getUint8(r+o+1));r+=s+1}}return new Uint8Array(i).buffer}}var uq=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:lq}),NO={exports:{}};(function(n){/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var s={};s.defaultNoDataValue=-34027999387901484e22,s.decode=function(h,f){f=f||{};var d=f.encodedMaskData||f.encodedMaskData===null,p=u(h,f.inputOffset||0,d),m=f.noDataValue!==null?f.noDataValue:s.defaultNoDataValue,g=o(p,f.pixelType||Float32Array,f.encodedMaskData,m,f.returnMask),v={width:p.width,height:p.height,pixelData:g.resultPixels,minValue:g.minValue,maxValue:p.pixels.maxValue,noDataValue:m};return g.resultMask&&(v.maskData=g.resultMask),f.returnEncodedMask&&p.mask&&(v.encodedMaskData=p.mask.bitset?p.mask.bitset:null),f.returnFileInfo&&(v.fileInfo=a(p),f.computeUsedBitDepths&&(v.fileInfo.bitDepths=l(p))),v};var o=function(h,f,d,p,m){var g=0,v=h.pixels.numBlocksX,y=h.pixels.numBlocksY,x=Math.floor(h.width/v),_=Math.floor(h.height/y),E=2*h.maxZError,T=Number.MAX_VALUE,w;d=d||(h.mask?h.mask.bitset:null);var S,R;S=new f(h.width*h.height),m&&d&&(R=new Uint8Array(h.width*h.height));for(var b=new Float32Array(x*_),I,O,P=0;P<=y;P++){var B=P!==y?_:h.height%y;if(B!==0)for(var A=0;A<=v;A++){var L=A!==v?x:h.width%v;if(L!==0){var D=P*h.width*_+A*x,U=h.width-L,G=h.pixels.blocks[g],$,k,C;G.encoding<2?(G.encoding===0?$=G.rawData:(c(G.stuffedData,G.bitsPerPixel,G.numValidPixels,G.offset,E,b,h.pixels.maxValue),$=b),k=0):G.encoding===2?C=0:C=G.offset;var Z;if(d)for(O=0;O<B;O++){for(D&7&&(Z=d[D>>3],Z<<=D&7),I=0;I<L;I++)D&7||(Z=d[D>>3]),Z&128?(R&&(R[D]=1),w=G.encoding<2?$[k++]:C,T=T>w?w:T,S[D++]=w):(R&&(R[D]=0),S[D++]=p),Z<<=1;D+=U}else if(G.encoding<2)for(O=0;O<B;O++){for(I=0;I<L;I++)w=$[k++],T=T>w?w:T,S[D++]=w;D+=U}else for(T=T>C?C:T,O=0;O<B;O++){for(I=0;I<L;I++)S[D++]=C;D+=U}if(G.encoding===1&&k!==G.numValidPixels)throw"Block and Mask do not match";g++}}}return{resultPixels:S,resultMask:R,minValue:T}},a=function(h){return{fileIdentifierString:h.fileIdentifierString,fileVersion:h.fileVersion,imageType:h.imageType,height:h.height,width:h.width,maxZError:h.maxZError,eofOffset:h.eofOffset,mask:h.mask?{numBlocksX:h.mask.numBlocksX,numBlocksY:h.mask.numBlocksY,numBytes:h.mask.numBytes,maxValue:h.mask.maxValue}:null,pixels:{numBlocksX:h.pixels.numBlocksX,numBlocksY:h.pixels.numBlocksY,numBytes:h.pixels.numBytes,maxValue:h.pixels.maxValue,noDataValue:h.noDataValue}}},l=function(h){for(var f=h.pixels.numBlocksX*h.pixels.numBlocksY,d={},p=0;p<f;p++){var m=h.pixels.blocks[p];m.encoding===0?d.float32=!0:m.encoding===1?d[m.bitsPerPixel]=!0:d[0]=!0}return Object.keys(d)},u=function(h,f,d){var p={},m=new Uint8Array(h,f,10);if(p.fileIdentifierString=String.fromCharCode.apply(null,m),p.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+p.fileIdentifierString;f+=10;var g=new DataView(h,f,24);if(p.fileVersion=g.getInt32(0,!0),p.imageType=g.getInt32(4,!0),p.height=g.getUint32(8,!0),p.width=g.getUint32(12,!0),p.maxZError=g.getFloat64(16,!0),f+=24,!d)if(g=new DataView(h,f,16),p.mask={},p.mask.numBlocksY=g.getUint32(0,!0),p.mask.numBlocksX=g.getUint32(4,!0),p.mask.numBytes=g.getUint32(8,!0),p.mask.maxValue=g.getFloat32(12,!0),f+=16,p.mask.numBytes>0){var v=new Uint8Array(Math.ceil(p.width*p.height/8));g=new DataView(h,f,p.mask.numBytes);var y=g.getInt16(0,!0),x=2,_=0;do{if(y>0)for(;y--;)v[_++]=g.getUint8(x++);else{var E=g.getUint8(x++);for(y=-y;y--;)v[_++]=E}y=g.getInt16(x,!0),x+=2}while(x<p.mask.numBytes);if(y!==-32768||_<v.length)throw"Unexpected end of mask RLE encoding";p.mask.bitset=v,f+=p.mask.numBytes}else(p.mask.numBytes|p.mask.numBlocksY|p.mask.maxValue)===0&&(p.mask.bitset=new Uint8Array(Math.ceil(p.width*p.height/8)));g=new DataView(h,f,16),p.pixels={},p.pixels.numBlocksY=g.getUint32(0,!0),p.pixels.numBlocksX=g.getUint32(4,!0),p.pixels.numBytes=g.getUint32(8,!0),p.pixels.maxValue=g.getFloat32(12,!0),f+=16;var T=p.pixels.numBlocksX,w=p.pixels.numBlocksY,S=T+(p.width%T>0?1:0),R=w+(p.height%w>0?1:0);p.pixels.blocks=new Array(S*R);for(var b=0,I=0;I<R;I++)for(var O=0;O<S;O++){var P=0,B=h.byteLength-f;g=new DataView(h,f,Math.min(10,B));var A={};p.pixels.blocks[b++]=A;var L=g.getUint8(0);if(P++,A.encoding=L&63,A.encoding>3)throw"Invalid block encoding ("+A.encoding+")";if(A.encoding===2){f++;continue}if(L!==0&&L!==2){if(L>>=6,A.offsetType=L,L===2)A.offset=g.getInt8(1),P++;else if(L===1)A.offset=g.getInt16(1,!0),P+=2;else if(L===0)A.offset=g.getFloat32(1,!0),P+=4;else throw"Invalid block offset type";if(A.encoding===1)if(L=g.getUint8(P),P++,A.bitsPerPixel=L&63,L>>=6,A.numValidPixelsType=L,L===2)A.numValidPixels=g.getUint8(P),P++;else if(L===1)A.numValidPixels=g.getUint16(P,!0),P+=2;else if(L===0)A.numValidPixels=g.getUint32(P,!0),P+=4;else throw"Invalid valid pixel count type"}if(f+=P,A.encoding!==3){var D,U;if(A.encoding===0){var G=(p.pixels.numBytes-1)/4;if(G!==Math.floor(G))throw"uncompressed block has invalid length";D=new ArrayBuffer(G*4),U=new Uint8Array(D),U.set(new Uint8Array(h,f,G*4));var $=new Float32Array(D);A.rawData=$,f+=G*4}else if(A.encoding===1){var k=Math.ceil(A.numValidPixels*A.bitsPerPixel/8),C=Math.ceil(k/4);D=new ArrayBuffer(C*4),U=new Uint8Array(D),U.set(new Uint8Array(h,f,k)),A.stuffedData=new Uint32Array(D),f+=k}}}return p.eofOffset=f,p},c=function(h,f,d,p,m,g,v){var y=(1<<f)-1,x=0,_,E=0,T,w,S=Math.ceil((v-p)/m),R=h.length*4-Math.ceil(f*d/8);for(h[h.length-1]<<=8*R,_=0;_<d;_++){if(E===0&&(w=h[x++],E=32),E>=f)T=w>>>E-f&y,E-=f;else{var b=f-E;T=(w&y)<<b&y,w=h[x++],E=32-b,T+=w>>>E}g[_]=T<S?p+T*m:v}return g};return s}(),t=function(){var s={unstuff:function(u,c,h,f,d,p,m,g){var v=(1<<h)-1,y=0,x,_=0,E,T,w,S,R=u.length*4-Math.ceil(h*f/8);if(u[u.length-1]<<=8*R,d)for(x=0;x<f;x++)_===0&&(T=u[y++],_=32),_>=h?(E=T>>>_-h&v,_-=h):(w=h-_,E=(T&v)<<w&v,T=u[y++],_=32-w,E+=T>>>_),c[x]=d[E];else for(S=Math.ceil((g-p)/m),x=0;x<f;x++)_===0&&(T=u[y++],_=32),_>=h?(E=T>>>_-h&v,_-=h):(w=h-_,E=(T&v)<<w&v,T=u[y++],_=32-w,E+=T>>>_),c[x]=E<S?p+E*m:g},unstuffLUT:function(u,c,h,f,d,p){var m=(1<<c)-1,g=0,v=0,y=0,x=0,_=0,E,T=[],w=u.length*4-Math.ceil(c*h/8);u[u.length-1]<<=8*w;var S=Math.ceil((p-f)/d);for(v=0;v<h;v++)x===0&&(E=u[g++],x=32),x>=c?(_=E>>>x-c&m,x-=c):(y=c-x,_=(E&m)<<y&m,E=u[g++],x=32-y,_+=E>>>x),T[v]=_<S?f+_*d:p;return T.unshift(f),T},unstuff2:function(u,c,h,f,d,p,m,g){var v=(1<<h)-1,y=0,x,_=0,E=0,T,w,S;if(d)for(x=0;x<f;x++)_===0&&(w=u[y++],_=32,E=0),_>=h?(T=w>>>E&v,_-=h,E+=h):(S=h-_,T=w>>>E&v,w=u[y++],_=32-S,T|=(w&(1<<S)-1)<<h-S,E=S),c[x]=d[T];else{var R=Math.ceil((g-p)/m);for(x=0;x<f;x++)_===0&&(w=u[y++],_=32,E=0),_>=h?(T=w>>>E&v,_-=h,E+=h):(S=h-_,T=w>>>E&v,w=u[y++],_=32-S,T|=(w&(1<<S)-1)<<h-S,E=S),c[x]=T<R?p+T*m:g}return c},unstuffLUT2:function(u,c,h,f,d,p){var m=(1<<c)-1,g=0,v=0,y=0,x=0,_=0,E=0,T,w=[],S=Math.ceil((p-f)/d);for(v=0;v<h;v++)x===0&&(T=u[g++],x=32,E=0),x>=c?(_=T>>>E&m,x-=c,E+=c):(y=c-x,_=T>>>E&m,T=u[g++],x=32-y,_|=(T&(1<<y)-1)<<c-y,E=y),w[v]=_<S?f+_*d:p;return w.unshift(f),w},originalUnstuff:function(u,c,h,f){var d=(1<<h)-1,p=0,m,g=0,v,y,x,_=u.length*4-Math.ceil(h*f/8);for(u[u.length-1]<<=8*_,m=0;m<f;m++)g===0&&(y=u[p++],g=32),g>=h?(v=y>>>g-h&d,g-=h):(x=h-g,v=(y&d)<<x&d,y=u[p++],g=32-x,v+=y>>>g),c[m]=v;return c},originalUnstuff2:function(u,c,h,f){var d=(1<<h)-1,p=0,m,g=0,v=0,y,x,_;for(m=0;m<f;m++)g===0&&(x=u[p++],g=32,v=0),g>=h?(y=x>>>v&d,g-=h,v+=h):(_=h-g,y=x>>>v&d,x=u[p++],g=32-_,y|=(x&(1<<_)-1)<<h-_,v=_),c[m]=y;return c}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(u){for(var c=65535,h=65535,f=u.length,d=Math.floor(f/2),p=0;d;){var m=d>=359?359:d;d-=m;do c+=u[p++]<<8,h+=c+=u[p++];while(--m);c=(c&65535)+(c>>>16),h=(h&65535)+(h>>>16)}return f&1&&(h+=c+=u[p]<<8),c=(c&65535)+(c>>>16),h=(h&65535)+(h>>>16),(h<<16|c)>>>0},readHeaderInfo:function(u,c){var h=c.ptr,f=new Uint8Array(u,h,6),d={};if(d.fileIdentifierString=String.fromCharCode.apply(null,f),d.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+d.fileIdentifierString;h+=6;var p=new DataView(u,h,8),m=p.getInt32(0,!0);d.fileVersion=m,h+=4,m>=3&&(d.checksum=p.getUint32(4,!0),h+=4),p=new DataView(u,h,12),d.height=p.getUint32(0,!0),d.width=p.getUint32(4,!0),h+=8,m>=4?(d.numDims=p.getUint32(8,!0),h+=4):d.numDims=1,p=new DataView(u,h,40),d.numValidPixel=p.getUint32(0,!0),d.microBlockSize=p.getInt32(4,!0),d.blobSize=p.getInt32(8,!0),d.imageType=p.getInt32(12,!0),d.maxZError=p.getFloat64(16,!0),d.zMin=p.getFloat64(24,!0),d.zMax=p.getFloat64(32,!0),h+=40,c.headerInfo=d,c.ptr=h;var g,v;if(m>=3&&(v=m>=4?52:48,g=this.computeChecksumFletcher32(new Uint8Array(u,h-v,d.blobSize-14)),g!==d.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(u,c){var h=c.headerInfo,f=this.getDataTypeArray(h.imageType),d=h.numDims*this.getDataTypeSize(h.imageType),p=this.readSubArray(u,c.ptr,f,d),m=this.readSubArray(u,c.ptr+d,f,d);c.ptr+=2*d;var g,v=!0;for(g=0;g<h.numDims;g++)if(p[g]!==m[g]){v=!1;break}return h.minValues=p,h.maxValues=m,v},readSubArray:function(u,c,h,f){var d;if(h===Uint8Array)d=new Uint8Array(u,c,f);else{var p=new ArrayBuffer(f),m=new Uint8Array(p);m.set(new Uint8Array(u,c,f)),d=new h(p)}return d},readMask:function(u,c){var h=c.ptr,f=c.headerInfo,d=f.width*f.height,p=f.numValidPixel,m=new DataView(u,h,4),g={};if(g.numBytes=m.getUint32(0,!0),h+=4,(p===0||d===p)&&g.numBytes!==0)throw"invalid mask";var v,y;if(p===0)v=new Uint8Array(Math.ceil(d/8)),g.bitset=v,y=new Uint8Array(d),c.pixels.resultMask=y,h+=g.numBytes;else if(g.numBytes>0){v=new Uint8Array(Math.ceil(d/8)),m=new DataView(u,h,g.numBytes);var x=m.getInt16(0,!0),_=2,E=0,T=0;do{if(x>0)for(;x--;)v[E++]=m.getUint8(_++);else for(T=m.getUint8(_++),x=-x;x--;)v[E++]=T;x=m.getInt16(_,!0),_+=2}while(_<g.numBytes);if(x!==-32768||E<v.length)throw"Unexpected end of mask RLE encoding";y=new Uint8Array(d);var w=0,S=0;for(S=0;S<d;S++)S&7?(w=v[S>>3],w<<=S&7):w=v[S>>3],w&128&&(y[S]=1);c.pixels.resultMask=y,g.bitset=v,h+=g.numBytes}return c.ptr=h,c.mask=g,!0},readDataOneSweep:function(u,c,h,f){var d=c.ptr,p=c.headerInfo,m=p.numDims,g=p.width*p.height,v=p.imageType,y=p.numValidPixel*o.getDataTypeSize(v)*m,x,_=c.pixels.resultMask;if(h===Uint8Array)x=new Uint8Array(u,d,y);else{var E=new ArrayBuffer(y),T=new Uint8Array(E);T.set(new Uint8Array(u,d,y)),x=new h(E)}if(x.length===g*m)f?c.pixels.resultPixels=o.swapDimensionOrder(x,g,m,h,!0):c.pixels.resultPixels=x;else{c.pixels.resultPixels=new h(g*m);var w=0,S=0,R=0,b=0;if(m>1){if(f){for(S=0;S<g;S++)if(_[S])for(b=S,R=0;R<m;R++,b+=g)c.pixels.resultPixels[b]=x[w++]}else for(S=0;S<g;S++)if(_[S])for(b=S*m,R=0;R<m;R++)c.pixels.resultPixels[b+R]=x[w++]}else for(S=0;S<g;S++)_[S]&&(c.pixels.resultPixels[S]=x[w++])}return d+=y,c.ptr=d,!0},readHuffmanTree:function(u,c){var h=this.HUFFMAN_LUT_BITS_MAX,f=new DataView(u,c.ptr,16);c.ptr+=16;var d=f.getInt32(0,!0);if(d<2)throw"unsupported Huffman version";var p=f.getInt32(4,!0),m=f.getInt32(8,!0),g=f.getInt32(12,!0);if(m>=g)return!1;var v=new Uint32Array(g-m);o.decodeBits(u,c,v);var y=[],x,_,E,T;for(x=m;x<g;x++)_=x-(x<p?0:p),y[_]={first:v[x-m],second:null};var w=u.byteLength-c.ptr,S=Math.ceil(w/4),R=new ArrayBuffer(S*4),b=new Uint8Array(R);b.set(new Uint8Array(u,c.ptr,w));var I=new Uint32Array(R),O=0,P,B=0;for(P=I[0],x=m;x<g;x++)_=x-(x<p?0:p),T=y[_].first,T>0&&(y[_].second=P<<O>>>32-T,32-O>=T?(O+=T,O===32&&(O=0,B++,P=I[B])):(O+=T-32,B++,P=I[B],y[_].second|=P>>>32-O));var A=0,L=0,D=new a;for(x=0;x<y.length;x++)y[x]!==void 0&&(A=Math.max(A,y[x].first));A>=h?L=h:L=A;var U=[],G,$,k,C,Z,z;for(x=m;x<g;x++)if(_=x-(x<p?0:p),T=y[_].first,T>0)if(G=[T,_],T<=L)for($=y[_].second<<L-T,k=1<<L-T,E=0;E<k;E++)U[$|E]=G;else for($=y[_].second,z=D,C=T-1;C>=0;C--)Z=$>>>C&1,Z?(z.right||(z.right=new a),z=z.right):(z.left||(z.left=new a),z=z.left),C===0&&!z.val&&(z.val=G[1]);return{decodeLut:U,numBitsLUTQick:L,numBitsLUT:A,tree:D,stuffedData:I,srcPtr:B,bitPos:O}},readHuffman:function(u,c,h,f){var d=c.headerInfo,p=d.numDims,m=c.headerInfo.height,g=c.headerInfo.width,v=g*m,y=this.readHuffmanTree(u,c),x=y.decodeLut,_=y.tree,E=y.stuffedData,T=y.srcPtr,w=y.bitPos,S=y.numBitsLUTQick,R=y.numBitsLUT,b=c.headerInfo.imageType===0?128:0,I,O,P,B=c.pixels.resultMask,A,L,D,U,G,$,k,C=0;w>0&&(T++,w=0);var Z=E[T],z=c.encodeMode===1,j=new h(v*p),V=j,te;if(p<2||z){for(te=0;te<p;te++)if(p>1&&(V=new h(j.buffer,v*te,v),C=0),c.headerInfo.numValidPixel===g*m)for($=0,U=0;U<m;U++)for(G=0;G<g;G++,$++){if(O=0,A=Z<<w>>>32-S,L=A,32-w<S&&(A|=E[T+1]>>>64-w-S,L=A),x[L])O=x[L][1],w+=x[L][0];else for(A=Z<<w>>>32-R,L=A,32-w<R&&(A|=E[T+1]>>>64-w-R,L=A),I=_,k=0;k<R;k++)if(D=A>>>R-k-1&1,I=D?I.right:I.left,!(I.left||I.right)){O=I.val,w=w+k+1;break}w>=32&&(w-=32,T++,Z=E[T]),P=O-b,z?(G>0?P+=C:U>0?P+=V[$-g]:P+=C,P&=255,V[$]=P,C=P):V[$]=P}else for($=0,U=0;U<m;U++)for(G=0;G<g;G++,$++)if(B[$]){if(O=0,A=Z<<w>>>32-S,L=A,32-w<S&&(A|=E[T+1]>>>64-w-S,L=A),x[L])O=x[L][1],w+=x[L][0];else for(A=Z<<w>>>32-R,L=A,32-w<R&&(A|=E[T+1]>>>64-w-R,L=A),I=_,k=0;k<R;k++)if(D=A>>>R-k-1&1,I=D?I.right:I.left,!(I.left||I.right)){O=I.val,w=w+k+1;break}w>=32&&(w-=32,T++,Z=E[T]),P=O-b,z?(G>0&&B[$-1]?P+=C:U>0&&B[$-g]?P+=V[$-g]:P+=C,P&=255,V[$]=P,C=P):V[$]=P}}else for($=0,U=0;U<m;U++)for(G=0;G<g;G++)if($=U*g+G,!B||B[$])for(te=0;te<p;te++,$+=v){if(O=0,A=Z<<w>>>32-S,L=A,32-w<S&&(A|=E[T+1]>>>64-w-S,L=A),x[L])O=x[L][1],w+=x[L][0];else for(A=Z<<w>>>32-R,L=A,32-w<R&&(A|=E[T+1]>>>64-w-R,L=A),I=_,k=0;k<R;k++)if(D=A>>>R-k-1&1,I=D?I.right:I.left,!(I.left||I.right)){O=I.val,w=w+k+1;break}w>=32&&(w-=32,T++,Z=E[T]),P=O-b,V[$]=P}c.ptr=c.ptr+(T+1)*4+(w>0?4:0),c.pixels.resultPixels=j,p>1&&!f&&(c.pixels.resultPixels=o.swapDimensionOrder(j,v,p,h))},decodeBits:function(u,c,h,f,d){{var p=c.headerInfo,m=p.fileVersion,g=0,v=u.byteLength-c.ptr>=5?5:u.byteLength-c.ptr,y=new DataView(u,c.ptr,v),x=y.getUint8(0);g++;var _=x>>6,E=_===0?4:3-_,T=(x&32)>0,w=x&31,S=0;if(E===1)S=y.getUint8(g),g++;else if(E===2)S=y.getUint16(g,!0),g+=2;else if(E===4)S=y.getUint32(g,!0),g+=4;else throw"Invalid valid pixel count type";var R=2*p.maxZError,b,I,O,P,B,A,L,D,U,G=p.numDims>1?p.maxValues[d]:p.zMax;if(T){for(c.counter.lut++,D=y.getUint8(g),g++,P=Math.ceil((D-1)*w/8),B=Math.ceil(P/4),I=new ArrayBuffer(B*4),O=new Uint8Array(I),c.ptr+=g,O.set(new Uint8Array(u,c.ptr,P)),L=new Uint32Array(I),c.ptr+=P,U=0;D-1>>>U;)U++;P=Math.ceil(S*U/8),B=Math.ceil(P/4),I=new ArrayBuffer(B*4),O=new Uint8Array(I),O.set(new Uint8Array(u,c.ptr,P)),b=new Uint32Array(I),c.ptr+=P,m>=3?A=s.unstuffLUT2(L,w,D-1,f,R,G):A=s.unstuffLUT(L,w,D-1,f,R,G),m>=3?s.unstuff2(b,h,U,S,A):s.unstuff(b,h,U,S,A)}else c.counter.bitstuffer++,U=w,c.ptr+=g,U>0&&(P=Math.ceil(S*U/8),B=Math.ceil(P/4),I=new ArrayBuffer(B*4),O=new Uint8Array(I),O.set(new Uint8Array(u,c.ptr,P)),b=new Uint32Array(I),c.ptr+=P,m>=3?f==null?s.originalUnstuff2(b,h,U,S):s.unstuff2(b,h,U,S,!1,f,R,G):f==null?s.originalUnstuff(b,h,U,S):s.unstuff(b,h,U,S,!1,f,R,G))}},readTiles:function(u,c,h,f){var d=c.headerInfo,p=d.width,m=d.height,g=p*m,v=d.microBlockSize,y=d.imageType,x=o.getDataTypeSize(y),_=Math.ceil(p/v),E=Math.ceil(m/v);c.pixels.numBlocksY=E,c.pixels.numBlocksX=_,c.pixels.ptr=0;var T=0,w=0,S=0,R=0,b=0,I=0,O=0,P=0,B=0,A=0,L=0,D=0,U=0,G=0,$=0,k=0,C,Z,z,j,V,te,J=new h(v*v),X=m%v||v,Se=p%v||v,_e,be,ht=d.numDims,Ce,De=c.pixels.resultMask,Xe=c.pixels.resultPixels,Mt=d.fileVersion,Ut=Mt>=5?14:15,Q,Ft=d.zMax,zt;for(S=0;S<E;S++)for(b=S!==E-1?v:X,R=0;R<_;R++)for(I=R!==_-1?v:Se,L=S*p*v+R*v,D=p-I,Ce=0;Ce<ht;Ce++){if(ht>1?(zt=Xe,L=S*p*v+R*v,Xe=new h(c.pixels.resultPixels.buffer,g*Ce*x,g),Ft=d.maxValues[Ce]):zt=null,O=u.byteLength-c.ptr,C=new DataView(u,c.ptr,Math.min(10,O)),Z={},k=0,P=C.getUint8(0),k++,Q=d.fileVersion>=5?P&4:0,B=P>>6&255,A=P>>2&Ut,A!==(R*v>>3&Ut)||Q&&Ce===0)throw"integrity issue";if(te=P&3,te>3)throw c.ptr+=k,"Invalid block encoding ("+te+")";if(te===2){if(Q)if(De)for(T=0;T<b;T++)for(w=0;w<I;w++)De[L]&&(Xe[L]=zt[L]),L++;else for(T=0;T<b;T++)for(w=0;w<I;w++)Xe[L]=zt[L],L++;c.counter.constant++,c.ptr+=k;continue}else if(te===0){if(Q)throw"integrity issue";if(c.counter.uncompressed++,c.ptr+=k,U=b*I*x,G=u.byteLength-c.ptr,U=U<G?U:G,z=new ArrayBuffer(U%x===0?U:U+x-U%x),j=new Uint8Array(z),j.set(new Uint8Array(u,c.ptr,U)),V=new h(z),$=0,De)for(T=0;T<b;T++){for(w=0;w<I;w++)De[L]&&(Xe[L]=V[$++]),L++;L+=D}else for(T=0;T<b;T++){for(w=0;w<I;w++)Xe[L++]=V[$++];L+=D}c.ptr+=$*x}else if(_e=o.getDataTypeUsed(Q&&y<6?4:y,B),be=o.getOnePixel(Z,k,_e,C),k+=o.getDataTypeSize(_e),te===3)if(c.ptr+=k,c.counter.constantoffset++,De)for(T=0;T<b;T++){for(w=0;w<I;w++)De[L]&&(Xe[L]=Q?Math.min(Ft,zt[L]+be):be),L++;L+=D}else for(T=0;T<b;T++){for(w=0;w<I;w++)Xe[L]=Q?Math.min(Ft,zt[L]+be):be,L++;L+=D}else if(c.ptr+=k,o.decodeBits(u,c,J,be,Ce),k=0,Q)if(De)for(T=0;T<b;T++){for(w=0;w<I;w++)De[L]&&(Xe[L]=J[k++]+zt[L]),L++;L+=D}else for(T=0;T<b;T++){for(w=0;w<I;w++)Xe[L]=J[k++]+zt[L],L++;L+=D}else if(De)for(T=0;T<b;T++){for(w=0;w<I;w++)De[L]&&(Xe[L]=J[k++]),L++;L+=D}else for(T=0;T<b;T++){for(w=0;w<I;w++)Xe[L++]=J[k++];L+=D}}ht>1&&!f&&(c.pixels.resultPixels=o.swapDimensionOrder(c.pixels.resultPixels,g,ht,h))},formatFileInfo:function(u){return{fileIdentifierString:u.headerInfo.fileIdentifierString,fileVersion:u.headerInfo.fileVersion,imageType:u.headerInfo.imageType,height:u.headerInfo.height,width:u.headerInfo.width,numValidPixel:u.headerInfo.numValidPixel,microBlockSize:u.headerInfo.microBlockSize,blobSize:u.headerInfo.blobSize,maxZError:u.headerInfo.maxZError,pixelType:o.getPixelType(u.headerInfo.imageType),eofOffset:u.eofOffset,mask:u.mask?{numBytes:u.mask.numBytes}:null,pixels:{numBlocksX:u.pixels.numBlocksX,numBlocksY:u.pixels.numBlocksY,maxValue:u.headerInfo.zMax,minValue:u.headerInfo.zMin,noDataValue:u.noDataValue}}},constructConstantSurface:function(u,c){var h=u.headerInfo.zMax,f=u.headerInfo.zMin,d=u.headerInfo.maxValues,p=u.headerInfo.numDims,m=u.headerInfo.height*u.headerInfo.width,g=0,v=0,y=0,x=u.pixels.resultMask,_=u.pixels.resultPixels;if(x)if(p>1){if(c)for(g=0;g<p;g++)for(y=g*m,h=d[g],v=0;v<m;v++)x[v]&&(_[y+v]=h);else for(v=0;v<m;v++)if(x[v])for(y=v*p,g=0;g<p;g++)_[y+p]=d[g]}else for(v=0;v<m;v++)x[v]&&(_[v]=h);else if(p>1&&f!==h)if(c)for(g=0;g<p;g++)for(y=g*m,h=d[g],v=0;v<m;v++)_[y+v]=h;else for(v=0;v<m;v++)for(y=v*p,g=0;g<p;g++)_[y+g]=d[g];else for(v=0;v<m*p;v++)_[v]=h},getDataTypeArray:function(u){var c;switch(u){case 0:c=Int8Array;break;case 1:c=Uint8Array;break;case 2:c=Int16Array;break;case 3:c=Uint16Array;break;case 4:c=Int32Array;break;case 5:c=Uint32Array;break;case 6:c=Float32Array;break;case 7:c=Float64Array;break;default:c=Float32Array}return c},getPixelType:function(u){var c;switch(u){case 0:c="S8";break;case 1:c="U8";break;case 2:c="S16";break;case 3:c="U16";break;case 4:c="S32";break;case 5:c="U32";break;case 6:c="F32";break;case 7:c="F64";break;default:c="F32"}return c},isValidPixelValue:function(u,c){if(c==null)return!1;var h;switch(u){case 0:h=c>=-128&&c<=127;break;case 1:h=c>=0&&c<=255;break;case 2:h=c>=-32768&&c<=32767;break;case 3:h=c>=0&&c<=65536;break;case 4:h=c>=-2147483648&&c<=2147483647;break;case 5:h=c>=0&&c<=4294967296;break;case 6:h=c>=-34027999387901484e22&&c<=34027999387901484e22;break;case 7:h=c>=-17976931348623157e292&&c<=17976931348623157e292;break;default:h=!1}return h},getDataTypeSize:function(u){var c=0;switch(u){case 0:case 1:c=1;break;case 2:case 3:c=2;break;case 4:case 5:case 6:c=4;break;case 7:c=8;break;default:c=u}return c},getDataTypeUsed:function(u,c){var h=u;switch(u){case 2:case 4:h=u-c;break;case 3:case 5:h=u-2*c;break;case 6:c===0?h=u:c===1?h=2:h=1;break;case 7:c===0?h=u:h=u-2*c+1;break;default:h=u;break}return h},getOnePixel:function(u,c,h,f){var d=0;switch(h){case 0:d=f.getInt8(c);break;case 1:d=f.getUint8(c);break;case 2:d=f.getInt16(c,!0);break;case 3:d=f.getUint16(c,!0);break;case 4:d=f.getInt32(c,!0);break;case 5:d=f.getUInt32(c,!0);break;case 6:d=f.getFloat32(c,!0);break;case 7:d=f.getFloat64(c,!0);break;default:throw"the decoder does not understand this pixel type"}return d},swapDimensionOrder:function(u,c,h,f,d){var p=0,m=0,g=0,v=0,y=u;if(h>1)if(y=new f(c*h),d)for(p=0;p<c;p++)for(v=p,g=0;g<h;g++,v+=c)y[v]=u[m++];else for(p=0;p<c;p++)for(v=p,g=0;g<h;g++,v+=c)y[m++]=u[v];return y}},a=function(u,c,h){this.val=u,this.left=c,this.right=h},l={decode:function(u,c){c=c||{};var h=c.noDataValue,f=0,d={};d.ptr=c.inputOffset||0,d.pixels={},!o.readHeaderInfo(u,d);var p=d.headerInfo,m=p.fileVersion,g=o.getDataTypeArray(p.imageType);if(m>5)throw"unsupported lerc version 2."+m;o.readMask(u,d),p.numValidPixel!==p.width*p.height&&!d.pixels.resultMask&&(d.pixels.resultMask=c.maskData);var v=p.width*p.height;d.pixels.resultPixels=new g(v*p.numDims),d.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var y=!c.returnPixelInterleavedDims;if(p.numValidPixel!==0)if(p.zMax===p.zMin)o.constructConstantSurface(d,y);else if(m>=4&&o.checkMinMaxRanges(u,d))o.constructConstantSurface(d,y);else{var x=new DataView(u,d.ptr,2),_=x.getUint8(0);if(d.ptr++,_)o.readDataOneSweep(u,d,g,y);else if(m>1&&p.imageType<=1&&Math.abs(p.maxZError-.5)<1e-5){var E=x.getUint8(1);if(d.ptr++,d.encodeMode=E,E>2||m<4&&E>1)throw"Invalid Huffman flag "+E;E?o.readHuffman(u,d,g,y):o.readTiles(u,d,g,y)}else o.readTiles(u,d,g,y)}d.eofOffset=d.ptr;var T;c.inputOffset?(T=d.headerInfo.blobSize+c.inputOffset-d.ptr,Math.abs(T)>=1&&(d.eofOffset=c.inputOffset+d.headerInfo.blobSize)):(T=d.headerInfo.blobSize-d.ptr,Math.abs(T)>=1&&(d.eofOffset=d.headerInfo.blobSize));var w={width:p.width,height:p.height,pixelData:d.pixels.resultPixels,minValue:p.zMin,maxValue:p.zMax,validPixelCount:p.numValidPixel,dimCount:p.numDims,dimStats:{minValues:p.minValues,maxValues:p.maxValues},maskData:d.pixels.resultMask};if(d.pixels.resultMask&&o.isValidPixelValue(p.imageType,h)){var S=d.pixels.resultMask;for(f=0;f<v;f++)S[f]||(w.pixelData[f]=h);w.noDataValue=h}return d.noDataValue=h,c.returnFileInfo&&(w.fileInfo=o.formatFileInfo(d)),w},getBandCount:function(u){var c=0,h=0,f={};for(f.ptr=0,f.pixels={};h<u.byteLength-58;)o.readHeaderInfo(u,f),h+=f.headerInfo.blobSize,c++,f.ptr=h;return c}};return l}(),i=function(){var s=new ArrayBuffer(4),o=new Uint8Array(s),a=new Uint32Array(s);return a[0]=1,o[0]===1}(),r={decode:function(s,o){if(!i)throw"Big endian system is not supported.";o=o||{};var a=o.inputOffset||0,l=new Uint8Array(s,a,10),u=String.fromCharCode.apply(null,l),c,h;if(u.trim()==="CntZImage")c=e,h=1;else if(u.substring(0,5)==="Lerc2")c=t,h=2;else throw"Unexpected file identifier string: "+u;for(var f=0,d=s.byteLength-10,p,m=[],g,v,y={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]},x=0;a<d;){var _=c.decode(s,{inputOffset:a,encodedMaskData:p,maskData:v,returnMask:f===0,returnEncodedMask:f===0,returnFileInfo:!0,returnPixelInterleavedDims:o.returnPixelInterleavedDims,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});a=_.fileInfo.eofOffset,v=_.maskData,f===0&&(p=_.encodedMaskData,y.width=_.width,y.height=_.height,y.dimCount=_.dimCount||1,y.pixelType=_.pixelType||_.fileInfo.pixelType,y.mask=v),h>1&&(v&&m.push(v),_.fileInfo.mask&&_.fileInfo.mask.numBytes>0&&x++),f++,y.pixels.push(_.pixelData),y.statistics.push({minValue:_.minValue,maxValue:_.maxValue,noDataValue:_.noDataValue,dimStats:_.dimStats})}var E,T,w;if(h>1&&x>1){for(w=y.width*y.height,y.bandMasks=m,v=new Uint8Array(w),v.set(m[0]),E=1;E<m.length;E++)for(g=m[E],T=0;T<w;T++)v[T]=v[T]&g[T];y.maskData=v}return y}};n.exports?n.exports=r:this.Lerc=r})()})(NO);var cq=NO.exports;class hq extends Ya{constructor(e){super();this.planarConfiguration=typeof e.PlanarConfiguration!="undefined"?e.PlanarConfiguration:1,this.samplesPerPixel=typeof e.SamplesPerPixel!="undefined"?e.SamplesPerPixel:1,this.addCompression=e.LercParameters[tW.AddCompression]}decodeBlock(e){switch(this.addCompression){case NL.None:break;case NL.Deflate:e=FO(new Uint8Array(e)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return cq.decode(e,{returnPixelInterleavedDims:this.planarConfiguration===1}).pixels[0].buffer}}var fq=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:hq});class dq extends Ya{constructor(){super();if(typeof createImageBitmap=="undefined")throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if(typeof document=="undefined"&&typeof OffscreenCanvas=="undefined")throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(e,t){const i=new Blob([t]),r=await createImageBitmap(i);let s;typeof document!="undefined"?(s=document.createElement("canvas"),s.width=r.width,s.height=r.height):s=new OffscreenCanvas(r.width,r.height);const o=s.getContext("2d");return o.drawImage(r,0,0),o.getImageData(0,0,r.width,r.height).data.buffer}}var pq=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:dq}),gq=Worker;function mq(){const n='function e(e,t,r,n,i,a,o){try{var s=e[a](o),f=s.value}catch(e){return void r(e)}s.done?t(f):Promise.resolve(f).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,f,"next",t)}function f(t){e(o,i,a,s,f,"throw",t)}s(void 0)}))}}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var n={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new T(n||[]);return a._invoke=function(e,t,r){var n=h;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===m){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=I(o,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var f=c(e,t,r);if("normal"===f.type){if(n=r.done?m:d,f.arg===v)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n=m,r.method="throw",r.arg=f.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function w(){}function g(){}var b={};l(b,o,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(D([])));x&&x!==n&&i.call(x,o)&&(b=x);var _=g.prototype=y.prototype=Object.create(b);function A(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(a,o,s,f){var l=c(e[a],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"===r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,f)}),(function(e){n("throw",e,s,f)})):t.resolve(h).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,f)}))}f(l.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}}function I(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a \'throw\' method")}return v}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function U(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,this),this.reset(!0)}function D(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:E}}function E(){return{value:t,done:!0}}return w.prototype=g,l(_,"constructor",g),l(g,"constructor",w),w.displayName=l(g,f,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,f,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},A(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new P(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},A(_),l(_,f,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var f=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(f&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(n);var i=n.exports,a=new Map;function o(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){return a.set(e,t)}))}function s(e){return f.apply(this,arguments)}function f(){return(f=t(i.mark((function e(t){var r,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.get(t.Compression)){e.next=3;break}throw new Error("Unknown compression method identifier: ".concat(t.Compression));case 3:return e.next=5,r();case 5:return n=e.sent,e.abrupt("return",new n(t));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}o([void 0,1],(function(){return Promise.resolve().then((function(){return _})).then((function(e){return e.default}))})),o(5,(function(){return Promise.resolve().then((function(){return S})).then((function(e){return e.default}))})),o(6,(function(){throw new Error("old style JPEG compression is not supported.")})),o(7,(function(){return Promise.resolve().then((function(){return L})).then((function(e){return e.default}))})),o([8,32946],(function(){return Promise.resolve().then((function(){return Ne})).then((function(e){return e.default}))})),o(32773,(function(){return Promise.resolve().then((function(){return Ye})).then((function(e){return e.default}))})),o(34887,(function(){return Promise.resolve().then((function(){return ut})).then((function(e){return e.default}))})),o(50001,(function(){return Promise.resolve().then((function(){return dt})).then((function(e){return e.default}))}));var l=globalThis;function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function m(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function y(e,t){var r=e.length-t,n=0;do{for(var i=t;i>0;i--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function w(e,t,r){for(var n=0,i=e.length,a=i/r;i>t;){for(var o=t;o>0;--o)e[n+t]+=e[n],++n;i-=t}for(var s=e.slice(),f=0;f<a;++f)for(var l=0;l<r;++l)e[r*f+l]=s[(r-l-1)*a+f]}function g(e,t,r,n,i,a){if(!t||1===t)return e;for(var o=0;o<i.length;++o){if(i[o]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[o]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var s=i[0]/8,f=2===a?1:i.length,l=0;l<n&&!(l*f*r*s>=e.byteLength);++l){var u=void 0;if(2===t){switch(i[0]){case 8:u=new Uint8Array(e,l*f*r*s,f*r*s);break;case 16:u=new Uint16Array(e,l*f*r*s,f*r*s/2);break;case 32:u=new Uint32Array(e,l*f*r*s,f*r*s/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(i[0]," bits per sample."))}y(u,f)}else 3===t&&w(u=new Uint8Array(e,l*f*r*s,f*r*s),f,s)}return e}l.addEventListener("message",function(){var e=t(i.mark((function e(t){var r,n,a,o,f,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.data,n=r.id,a=r.fileDirectory,o=r.buffer,e.next=3,s(a);case 3:return f=e.sent,e.next=6,f.decode(a,o);case 6:u=e.sent,l.postMessage({decoded:u,id:n},[u]);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var b=function(){function e(){u(this,e)}var r;return h(e,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(r);case 2:if(n=e.sent,1===(a=t.Predictor||1)){e.next=9;break}return o=!t.StripOffsets,s=o?t.TileWidth:t.ImageWidth,f=o?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt("return",g(n,a,s,f,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var x=function(e){p(r,b);var t=k(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return e}}]),r}(),_=Object.freeze({__proto__:null,default:x});function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}function P(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function I(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var i=258,a=9,o=0;function s(){i=258,a=9}function f(e){var t=function(e,t,r){var n=t%8,i=Math.floor(t/8),a=8-n,o=t+r-8*(i+1),s=8*(i+2)-(t+r),f=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var l=e[i]&Math.pow(2,8-n)-1,u=l<<=r-a;if(i+1<e.length){var c=e[i+1]>>>s;u+=c<<=Math.max(0,r-f)}if(o>8&&i+2<e.length){var h=8*(i+3)-(t+r);u+=e[i+2]>>>h}return u}(e,o,a);return o+=a,t}function l(e,n){return r[i]=n,t[i]=e,++i-1}function u(e){for(var n=[],i=e;4096!==i;i=t[i])n.push(r[i]);return n}var c=[];s();for(var h,d=new Uint8Array(e),p=f(d);257!==p;){if(256===p){for(s(),p=f(d);256===p;)p=f(d);if(257===p)break;if(p>256)throw new Error("corrupted code at scanline ".concat(p));P(c,u(p)),h=p}else if(p<i){var m=u(p);P(c,m),l(h,m[m.length-1]),h=p}else{var v=u(h);if(!v)throw new Error("Bogus entry. Not in dictionary, ".concat(h," / ").concat(i,", position: ").concat(o));P(c,v),c.push(v[v.length-1]),l(h,v[v.length-1]),h=p}i+1>=Math.pow(2,a)&&(12===a?h=void 0:a++),p=f(d)}return new Uint8Array(c)}var U=function(e){p(r,b);var t=A(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return I(e).buffer}}]),r}(),S=Object.freeze({__proto__:null,default:U});function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var D=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function E(e,t){for(var r=0,n=[],i=16;i>0&&!e[i-1];)--i;n.push({children:[],index:0});for(var a,o=n[0],s=0;s<i;s++){for(var f=0;f<e[s];f++){for((o=n.pop()).children[o.index]=t[r];o.index>0;)o=n.pop();for(o.index++,n.push(o);n.length<=s;)n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a;r++}s+1<i&&(n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a)}return n[0].children}function B(e,t,n,i,a,o,s,f,l){var u=n.mcusPerLine,c=n.progressive,h=t,d=t,p=0,m=0;function v(){if(m>0)return m--,p>>m&1;if(255===(p=e[d++])){var t=e[d++];if(t)throw new Error("unexpected marker: ".concat((p<<8|t).toString(16)))}return m=7,p>>>7}function y(e){for(var t,n=e;null!==(t=v());){if("number"==typeof(n=n[t]))return n;if("object"!==r(n))throw new Error("invalid huffman sequence")}return null}function w(e){for(var t=e,r=0;t>0;){var n=v();if(null===n)return;r=r<<1|n,--t}return r}function g(e){var t=w(e);return t>=1<<e-1?t:t+(-1<<e)+1}var b=0;var k,x=0;function _(e,t,r,n,i){var a=r%u,o=(r/u|0)*e.v+n,s=a*e.h+i;t(e,e.blocks[o][s])}function A(e,t,r){var n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}var P,I,U,S,T,E,B=i.length;E=c?0===o?0===f?function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r)<<l;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=v()<<l}:0===f?function(e,t){if(b>0)b--;else for(var r=o,n=s;r<=n;){var i=y(e.huffmanTableAC),a=15&i,f=i>>4;if(0===a){if(f<15){b=w(f)+(1<<f)-1;break}r+=16}else t[D[r+=f]]=g(a)*(1<<l),r++}}:function(e,t){for(var r=o,n=s,i=0;r<=n;){var a=D[r],f=t[a]<0?-1:1;switch(x){case 0:var u=y(e.huffmanTableAC),c=15&u;if(i=u>>4,0===c)i<15?(b=w(i)+(1<<i),x=4):(i=16,x=1);else{if(1!==c)throw new Error("invalid ACn encoding");k=g(c),x=i?2:3}continue;case 1:case 2:t[a]?t[a]+=(v()<<l)*f:0==--i&&(x=2===x?3:0);break;case 3:t[a]?t[a]+=(v()<<l)*f:(t[a]=k<<l,x=0);break;case 4:t[a]&&(t[a]+=(v()<<l)*f)}r++}4===x&&0==--b&&(x=0)}:function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r);e.pred+=n,t[0]=e.pred;for(var i=1;i<64;){var a=y(e.huffmanTableAC),o=15&a,s=a>>4;if(0===o){if(s<15)break;i+=16}else t[D[i+=s]]=g(o),i++}};var O,M,C=0;M=1===B?i[0].blocksPerLine*i[0].blocksPerColumn:u*n.mcusPerColumn;for(var L=a||M;C<M;){for(I=0;I<B;I++)i[I].pred=0;if(b=0,1===B)for(P=i[0],T=0;T<L;T++)A(P,E,C),C++;else for(T=0;T<L;T++){for(I=0;I<B;I++){var R=P=i[I],V=R.h,G=R.v;for(U=0;U<G;U++)for(S=0;S<V;S++)_(P,E,C,U,S)}if(++C===M)break}if(m=0,(O=e[d]<<8|e[d+1])<65280)throw new Error("marker was not found");if(!(O>=65488&&O<=65495))break;d+=2}return d-h}function O(e,t){var r=[],n=t.blocksPerLine,i=t.blocksPerColumn,a=n<<3,o=new Int32Array(64),s=new Uint8Array(64);function f(e,r,n){var i,a,o,s,f,l,u,c,h,d,p=t.quantizationTable,m=n;for(d=0;d<64;d++)m[d]=e[d]*p[d];for(d=0;d<8;++d){var v=8*d;0!==m[1+v]||0!==m[2+v]||0!==m[3+v]||0!==m[4+v]||0!==m[5+v]||0!==m[6+v]||0!==m[7+v]?(i=5793*m[0+v]+128>>8,a=5793*m[4+v]+128>>8,o=m[2+v],s=m[6+v],f=2896*(m[1+v]-m[7+v])+128>>8,c=2896*(m[1+v]+m[7+v])+128>>8,l=m[3+v]<<4,h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+128>>8,o=1567*o-3784*s+128>>8,s=h,h=f-(u=m[5+v]<<4)+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+v]=i+c,m[7+v]=i-c,m[1+v]=a+u,m[6+v]=a-u,m[2+v]=o+l,m[5+v]=o-l,m[3+v]=s+f,m[4+v]=s-f):(h=5793*m[0+v]+512>>10,m[0+v]=h,m[1+v]=h,m[2+v]=h,m[3+v]=h,m[4+v]=h,m[5+v]=h,m[6+v]=h,m[7+v]=h)}for(d=0;d<8;++d){var y=d;0!==m[8+y]||0!==m[16+y]||0!==m[24+y]||0!==m[32+y]||0!==m[40+y]||0!==m[48+y]||0!==m[56+y]?(i=5793*m[0+y]+2048>>12,a=5793*m[32+y]+2048>>12,o=m[16+y],s=m[48+y],f=2896*(m[8+y]-m[56+y])+2048>>12,c=2896*(m[8+y]+m[56+y])+2048>>12,l=m[24+y],h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+2048>>12,o=1567*o-3784*s+2048>>12,s=h,h=f-(u=m[40+y])+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+y]=i+c,m[56+y]=i-c,m[8+y]=a+u,m[48+y]=a-u,m[16+y]=o+l,m[40+y]=o-l,m[24+y]=s+f,m[32+y]=s-f):(h=5793*n[d+0]+8192>>14,m[0+y]=h,m[8+y]=h,m[16+y]=h,m[24+y]=h,m[32+y]=h,m[40+y]=h,m[48+y]=h,m[56+y]=h)}for(d=0;d<64;++d){var w=128+(m[d]+8>>4);r[d]=w<0?0:w>255?255:w}}for(var l=0;l<i;l++){for(var u=l<<3,c=0;c<8;c++)r.push(new Uint8Array(a));for(var h=0;h<n;h++){f(t.blocks[l][h],s,o);for(var d=0,p=h<<3,m=0;m<8;m++)for(var v=r[u+m],y=0;y<8;y++)v[p+y]=s[d++]}}return r}var M=function(){function e(){u(this,e),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return h(e,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(e){var t=0;function r(){var r=e[t]<<8|e[t+1];return t+=2,r}function n(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i<t.v&&(i=t.v));var a=Math.ceil(e.samplesPerLine/8/n),o=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];for(var s=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),f=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),l=a*t.h,u=o*t.v,c=[],h=0;h<u;h++){for(var d=[],p=0;p<l;p++)d.push(new Int32Array(64));c.push(d)}t.blocksPerLine=s,t.blocksPerColumn=f,t.blocks=c}e.maxH=n,e.maxV=i,e.mcusPerLine=a,e.mcusPerColumn=o}var i,a,o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var s=(i=void 0,a=void 0,i=r(),a=e.subarray(t,t+i-2),t+=a.length,a);65504===o&&74===s[0]&&70===s[1]&&73===s[2]&&70===s[3]&&0===s[4]&&(this.jfif={version:{major:s[5],minor:s[6]},densityUnits:s[7],xDensity:s[8]<<8|s[9],yDensity:s[10]<<8|s[11],thumbWidth:s[12],thumbHeight:s[13],thumbData:s.subarray(14,14+3*s[12]*s[13])}),65518===o&&65===s[0]&&100===s[1]&&111===s[2]&&98===s[3]&&101===s[4]&&0===s[5]&&(this.adobe={version:s[6],flags0:s[7]<<8|s[8],flags1:s[9]<<8|s[10],transformCode:s[11]});break;case 65499:for(var f=r()+t-2;t<f;){var l=e[t++],u=new Int32Array(64);if(l>>4==0)for(var c=0;c<64;c++){u[D[c]]=e[t++]}else{if(l>>4!=1)throw new Error("DQT: invalid table spec");for(var h=0;h<64;h++){u[D[h]]=r()}}this.quantizationTables[15&l]=u}break;case 65472:case 65473:case 65474:r();for(var d={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},p=e[t++],m=void 0,v=0;v<p;v++){m=e[t];var y=e[t+1]>>4,w=15&e[t+1],g=e[t+2];d.componentsOrder.push(m),d.components[m]={h:y,v:w,quantizationIdx:g},t+=3}n(d),this.frames.push(d);break;case 65476:for(var b=r(),k=2;k<b;){for(var x=e[t++],_=new Uint8Array(16),A=0,P=0;P<16;P++,t++)_[P]=e[t],A+=_[P];for(var I=new Uint8Array(A),U=0;U<A;U++,t++)I[U]=e[t];k+=17+A,x>>4==0?this.huffmanTablesDC[15&x]=E(_,I):this.huffmanTablesAC[15&x]=E(_,I)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var S=e[t++],T=[],O=this.frames[0],M=0;M<S;M++){var C=O.components[e[t++]],L=e[t++];C.huffmanTableDC=this.huffmanTablesDC[L>>4],C.huffmanTableAC=this.huffmanTablesAC[15&L],T.push(C)}var R=e[t++],V=e[t++],G=e[t++],F=B(e,t,O,T,this.resetInterval,R,V,G>>4,15&G);t+=F;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker ".concat(o.toString(16)))}o=r()}}},{key:"getResult",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var t=0;t<this.frames.length;t++)for(var r=this.frames[t].components,n=0,i=Object.keys(r);n<i.length;n++){var a=i[n];r[a].quantizationTable=this.quantizationTables[r[a].quantizationIdx],delete r[a].quantizationIdx}for(var o=e[0],s=o.components,f=o.componentsOrder,l=[],u=o.samplesPerLine,c=o.scanLines,h=0;h<f.length;h++){var d=s[f[h]];l.push({lines:O(0,d),scaleX:d.h/o.maxH,scaleY:d.v/o.maxV})}for(var p=new Uint8Array(u*c*l.length),m=0,v=0;v<c;++v)for(var y=0;y<u;++y)for(var w=0;w<l.length;++w){var g=l[w];p[m]=g.lines[0|v*g.scaleY][0|y*g.scaleX],++m}return p}}]),e}(),C=function(e){p(r,b);var t=T(r);function r(e){var n;return u(this,r),(n=t.call(this)).reader=new M,e.JPEGTables&&n.reader.parse(e.JPEGTables),n}return h(r,[{key:"decodeBlock",value:function(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}]),r}(),L=Object.freeze({__proto__:null,default:C});function R(e){for(var t=e.length;--t>=0;)e[t]=0}R(new Array(576)),R(new Array(60)),R(new Array(512)),R(new Array(256)),R(new Array(29)),R(new Array(30));var V=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0},G=new Uint32Array(function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}()),F=function(e,t,r,n){var i=G,a=n+r;e^=-1;for(var o=n;o<a;o++)e=e>>>8^i[255&(e^t[o])];return-1^e},z={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},N=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Z=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==r(n))throw new TypeError(n+"must be non-object");for(var i in n)N(n,i)&&(e[i]=n[i])}}return e},K=function(e){for(var t=0,r=0,n=e.length;r<n;r++)t+=e[r].length;for(var i=new Uint8Array(t),a=0,o=0,s=e.length;a<s;a++){var f=e[a];i.set(f,o),o+=f.length}return i},H=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){H=!1}for(var Y=new Uint8Array(256),X=0;X<256;X++)Y[X]=X>=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;Y[254]=Y[254]=1;var W=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},q=function(e,t){var r,n,i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var a=new Array(2*i);for(n=0,r=0;r<i;){var o=e[r++];if(o<128)a[n++]=o;else{var s=Y[o];if(s>4)a[n++]=65533,r+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&r<i;)o=o<<6|63&e[r++],s--;s>1?a[n++]=65533:o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&H)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}(a,n)},J=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Y[e[r]]>t?r:t};var Q=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=e.state;r=e.next_in,A=e.input,n=r+(e.avail_in-5),i=e.next_out,P=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=I.dmax,f=I.wsize,l=I.whave,u=I.wnext,c=I.window,h=I.hold,d=I.bits,p=I.lencode,m=I.distcode,v=(1<<I.lenbits)-1,y=(1<<I.distbits)-1;e:do{d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=p[h&v];t:for(;;){if(h>>>=g=w>>>24,d-=g,0===(g=w>>>16&255))P[i++]=65535&w;else{if(!(16&g)){if(0==(64&g)){w=p[(65535&w)+(h&(1<<g)-1)];continue t}if(32&g){I.mode=12;break e}e.msg="invalid literal/length code",I.mode=30;break e}b=65535&w,(g&=15)&&(d<g&&(h+=A[r++]<<d,d+=8),b+=h&(1<<g)-1,h>>>=g,d-=g),d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=m[h&y];r:for(;;){if(h>>>=g=w>>>24,d-=g,!(16&(g=w>>>16&255))){if(0==(64&g)){w=m[(65535&w)+(h&(1<<g)-1)];continue r}e.msg="invalid distance code",I.mode=30;break e}if(k=65535&w,d<(g&=15)&&(h+=A[r++]<<d,(d+=8)<g&&(h+=A[r++]<<d,d+=8)),(k+=h&(1<<g)-1)>s){e.msg="invalid distance too far back",I.mode=30;break e}if(h>>>=g,d-=g,k>(g=i-a)){if((g=k-g)>l&&I.sane){e.msg="invalid distance too far back",I.mode=30;break e}if(x=0,_=c,0===u){if(x+=f-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}else if(u<g){if(x+=f+u-g,(g-=u)<b){b-=g;do{P[i++]=c[x++]}while(--g);if(x=0,u<b){b-=g=u;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}}else if(x+=u-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}for(;b>2;)P[i++]=_[x++],P[i++]=_[x++],P[i++]=_[x++],b-=3;b&&(P[i++]=_[x++],b>1&&(P[i++]=_[x++]))}else{x=i-k;do{P[i++]=P[x++],P[i++]=P[x++],P[i++]=P[x++],b-=3}while(b>2);b&&(P[i++]=P[x++],b>1&&(P[i++]=P[x++]))}break}}break}}while(r<n&&i<o);r-=b=d>>3,h&=(1<<(d-=b<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<o?o-i+257:257-(i-o),I.hold=h,I.bits=d},ee=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),te=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),re=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ne=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ie=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d,p,m,v,y=s.bits,w=0,g=0,b=0,k=0,x=0,_=0,A=0,P=0,I=0,U=0,S=null,T=0,D=new Uint16Array(16),E=new Uint16Array(16),B=null,O=0;for(w=0;w<=15;w++)D[w]=0;for(g=0;g<n;g++)D[t[r+g]]++;for(x=y,k=15;k>=1&&0===D[k];k--);if(x>k&&(x=k),0===k)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(b=1;b<k&&0===D[b];b++);for(x<b&&(x=b),P=1,w=1;w<=15;w++)if(P<<=1,(P-=D[w])<0)return-1;if(P>0&&(0===e||1!==k))return-1;for(E[1]=0,w=1;w<15;w++)E[w+1]=E[w]+D[w];for(g=0;g<n;g++)0!==t[r+g]&&(o[E[t[r+g]]++]=g);if(0===e?(S=B=o,d=19):1===e?(S=ee,T-=257,B=te,O-=257,d=256):(S=re,B=ne,d=-1),U=0,g=0,w=b,h=a,_=x,A=0,u=-1,c=(I=1<<x)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){p=w-A,o[g]<d?(m=0,v=o[g]):o[g]>d?(m=B[O+o[g]],v=S[T+o[g]]):(m=96,v=0),f=1<<w-A,b=l=1<<_;do{i[h+(U>>A)+(l-=f)]=p<<24|m<<16|v|0}while(0!==l);for(f=1<<w-1;U&f;)f>>=1;if(0!==f?(U&=f-1,U+=f):U=0,g++,0==--D[w]){if(w===k)break;w=t[r+o[g]]}if(w>x&&(U&c)!==u){for(0===A&&(A=x),h+=b,P=1<<(_=w-A);_+A<k&&!((P-=D[_+A])<=0);)_++,P<<=1;if(I+=1<<_,1===e&&I>852||2===e&&I>592)return 1;i[u=U&c]=x<<24|_<<16|h-a|0}}return 0!==U&&(i[h+U]=w-A<<24|64<<16|0),s.bits=x,0},ae=j.Z_FINISH,oe=j.Z_BLOCK,se=j.Z_TREES,fe=j.Z_OK,le=j.Z_STREAM_END,ue=j.Z_NEED_DICT,ce=j.Z_STREAM_ERROR,he=j.Z_DATA_ERROR,de=j.Z_MEM_ERROR,pe=j.Z_BUF_ERROR,me=j.Z_DEFLATED,ve=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function ye(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var we,ge,be=function(e){if(!e||!e.state)return ce;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,fe},ke=function(e){if(!e||!e.state)return ce;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,be(e)},xe=function(e,t){var r;if(!e||!e.state)return ce;var n=e.state;return t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ce:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ke(e))},_e=function(e,t){if(!e)return ce;var r=new ye;e.state=r,r.window=null;var n=xe(e,t);return n!==fe&&(e.state=null),n},Ae=!0,Pe=function(e){if(Ae){we=new Int32Array(512),ge=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ie(1,e.lens,0,288,we,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ie(2,e.lens,0,32,ge,0,e.work,{bits:5}),Ae=!1}e.lencode=we,e.lenbits=9,e.distcode=ge,e.distbits=5},Ie=function(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),(n-=i)?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},Ue={inflateReset:ke,inflateReset2:xe,inflateResetKeep:be,inflateInit:function(e){return _e(e,15)},inflateInit2:_e,inflate:function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=0,U=new Uint8Array(4),S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return ce;12===(r=e.state).mode&&(r.mode=13),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,c=s,h=f,_=fe;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(2&r.wrap&&35615===l){r.check=0,U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0),l=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=30;break}if((15&l)!==me){e.msg="unknown compression method",r.mode=30;break}if(u-=4,x=8+(15&(l>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<r.wbits,e.adler=r.check=1,r.mode=512&l?10:12,l=0,u=0;break;case 2:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.flags=l,(255&r.flags)!==me){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.time=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,U[2]=l>>>16&255,U[3]=l>>>24&255,r.check=F(r.check,U,4,0)),l=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+d),x)),512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}l=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}e.adler=r.check=ve(l),l=0,u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,ue;e.adler=r.check=1,r.mode=12;case 12:if(t===oe||t===se)break e;case 13:if(r.last){l>>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}switch(r.last=1&l,u-=1,3&(l>>>=1)){case 0:r.mode=14;break;case 1:if(Pe(r),r.mode=20,t===se){l>>>=2,u-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}l>>>=2,u-=2;break;case 14:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&l,l=0,u=0,r.mode=15,t===se)break e;case 15:r.mode=16;case 16:if(d=r.length){if(d>s&&(d=s),d>f&&(d=f),0===d)break e;i.set(n.subarray(a,a+d),o),s-=d,a+=d,f-=d,o+=d,r.length-=d;break}r.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.nlen=257+(31&l),l>>>=5,u-=5,r.ndist=1+(31&l),l>>>=5,u-=5,r.ncode=4+(15&l),l>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.lens[S[r.have++]]=7&l,l>>>=3,u-=3}for(;r.have<19;)r.lens[S[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},_=ie(0,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(w<16)l>>>=v,u-=v,r.lens[r.have++]=w;else{if(16===w){for(P=v+2;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l>>>=v,u-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}x=r.lens[r.have-1],d=3+(3&l),l>>>=2,u-=2}else if(17===w){for(P=v+3;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=3+(7&(l>>>=v)),l>>>=3,u-=3}else{for(P=v+7;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=11+(127&(l>>>=v)),l>>>=7,u-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=x}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,A={bits:r.lenbits},_=ie(1,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},_=ie(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,_){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,t===se)break e;case 20:r.mode=21;case 21:if(s>=6&&f>=258){e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,$(e,h),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(y&&0==(240&y)){for(g=v,b=y,k=w;y=(I=r.lencode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,r.length=w,0===y){r.mode=26;break}if(32&y){r.back=-1,r.mode=12;break}if(64&y){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&y,r.mode=22;case 22:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;y=(I=r.distcode[l&(1<<r.distbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(0==(240&y)){for(g=v,b=y,k=w;y=(I=r.distcode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,64&y){e.msg="invalid distance code",r.mode=30;break}r.offset=w,r.extra=15&y,r.mode=24;case 24:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(d=h-f,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===f)break e;i[o++]=r.length,f--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===s)break e;s--,l|=n[a++]<<u,u+=8}if(h-=f,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?F(r.check,i,h,o-h):V(r.check,i,h,o-h)),h=f,(r.flags?l:ve(l))!==r.check){e.msg="incorrect data check",r.mode=30;break}l=0,u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}l=0,u=0}r.mode=29;case 29:_=le;break e;case 30:_=he;break e;case 31:return de;default:return ce}return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,(r.wsize||h!==e.avail_out&&r.mode<30&&(r.mode<27||t!==ae))&&Ie(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?F(r.check,i,h,e.next_out-h):V(r.check,i,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===c&&0===h||t===ae)&&_===fe&&(_=pe),_},inflateEnd:function(e){if(!e||!e.state)return ce;var t=e.state;return t.window&&(t.window=null),e.state=null,fe},inflateGetHeader:function(e,t){if(!e||!e.state)return ce;var r=e.state;return 0==(2&r.wrap)?ce:(r.head=t,t.done=!1,fe)},inflateSetDictionary:function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?ce:11===r.mode&&V(1,t,n,0)!==r.check?he:Ie(e,t,n,n)?(r.mode=31,de):(r.havedict=1,fe):ce},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Te=Object.prototype.toString,De=j.Z_NO_FLUSH,Ee=j.Z_FINISH,Be=j.Z_OK,Oe=j.Z_STREAM_END,Me=j.Z_NEED_DICT,Ce=j.Z_STREAM_ERROR,Le=j.Z_DATA_ERROR,Re=j.Z_MEM_ERROR;function Ve(e){this.options=Z({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Q,this.strm.avail_out=0;var r=Ue.inflateInit2(this.strm,t.windowBits);if(r!==Be)throw new Error(z[r]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=W(t.dictionary):"[object ArrayBuffer]"===Te.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Ue.inflateSetDictionary(this.strm,t.dictionary))!==Be))throw new Error(z[r])}function Ge(e,t){var r=new Ve(t);if(r.push(e),r.err)throw r.msg||z[r.err];return r.result}Ve.prototype.push=function(e,t){var r,n,i,a=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Ee:De,"[object ArrayBuffer]"===Te.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(o),a.next_out=0,a.avail_out=o),(r=Ue.inflate(a,n))===Me&&s&&((r=Ue.inflateSetDictionary(a,s))===Be?r=Ue.inflate(a,n):r===Le&&(r=Me));a.avail_in>0&&r===Oe&&a.state.wrap>0&&0!==e[a.next_in];)Ue.inflateReset(a),r=Ue.inflate(a,n);switch(r){case Ce:case Le:case Me:case Re:return this.onEnd(r),this.ended=!0,!1}if(i=a.avail_out,a.next_out&&(0===a.avail_out||r===Oe))if("string"===this.options.to){var f=J(a.output,a.next_out),l=a.next_out-f,u=q(a.output,f);a.next_out=l,a.avail_out=o-l,l&&a.output.set(a.output.subarray(f,f+l),0),this.onData(u)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(r!==Be||0!==i){if(r===Oe)return r=Ue.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Ve.prototype.onData=function(e){this.chunks.push(e)},Ve.prototype.onEnd=function(e){e===Be&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=K(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Fe={Inflate:Ve,inflate:Ge,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Ge(e,t)},ungzip:Ge,constants:j}.inflate;function ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var je=function(e){p(r,b);var t=ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return Fe(new Uint8Array(e)).buffer}}]),r}(),Ne=Object.freeze({__proto__:null,default:je});function Ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var Ke,He=function(e){p(r,b);var t=Ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){for(var t=new DataView(e),r=[],n=0;n<e.byteLength;++n){var i=t.getInt8(n);if(i<0){var a=t.getUint8(n+1);i=-i;for(var o=0;o<=i;++o)r.push(a);n+=1}else{for(var s=0;s<=i;++s)r.push(t.getUint8(n+s+1));n+=i+1}}return new Uint8Array(r).buffer}}]),r}(),Ye=Object.freeze({__proto__:null,default:He}),Xe={exports:{}};Ke=Xe,\n/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */\nfunction(){var e,t,r,n,i,a,o,s,f,l,u,c,h,d,p,m,v=(e={defaultNoDataValue:-34027999387901484e22,decode:function(a,o){var s=(o=o||{}).encodedMaskData||null===o.encodedMaskData,f=i(a,o.inputOffset||0,s),l=null!==o.noDataValue?o.noDataValue:e.defaultNoDataValue,u=t(f,o.pixelType||Float32Array,o.encodedMaskData,l,o.returnMask),c={width:f.width,height:f.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:f.pixels.maxValue,noDataValue:l};return u.resultMask&&(c.maskData=u.resultMask),o.returnEncodedMask&&f.mask&&(c.encodedMaskData=f.mask.bitset?f.mask.bitset:null),o.returnFileInfo&&(c.fileInfo=r(f),o.computeUsedBitDepths&&(c.fileInfo.bitDepths=n(f))),c}},t=function(e,t,r,n,i){var o,s,f,l=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,h=Math.floor(e.width/u),d=Math.floor(e.height/c),p=2*e.maxZError,m=Number.MAX_VALUE;r=r||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),i&&r&&(f=new Uint8Array(e.width*e.height));for(var v,y,w=new Float32Array(h*d),g=0;g<=c;g++){var b=g!==c?d:e.height%c;if(0!==b)for(var k=0;k<=u;k++){var x=k!==u?h:e.width%u;if(0!==x){var _,A,P,I,U=g*e.width*d+k*h,S=e.width-x,T=e.pixels.blocks[l];if(T.encoding<2?(0===T.encoding?_=T.rawData:(a(T.stuffedData,T.bitsPerPixel,T.numValidPixels,T.offset,p,w,e.pixels.maxValue),_=w),A=0):P=2===T.encoding?0:T.offset,r)for(y=0;y<b;y++){for(7&U&&(I=r[U>>3],I<<=7&U),v=0;v<x;v++)7&U||(I=r[U>>3]),128&I?(f&&(f[U]=1),m=m>(o=T.encoding<2?_[A++]:P)?o:m,s[U++]=o):(f&&(f[U]=0),s[U++]=n),I<<=1;U+=S}else if(T.encoding<2)for(y=0;y<b;y++){for(v=0;v<x;v++)m=m>(o=_[A++])?o:m,s[U++]=o;U+=S}else for(m=m>P?P:m,y=0;y<b;y++){for(v=0;v<x;v++)s[U++]=P;U+=S}if(1===T.encoding&&A!==T.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:s,resultMask:f,minValue:m}},r=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},n=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,r={},n=0;n<t;n++){var i=e.pixels.blocks[n];0===i.encoding?r.float32=!0:1===i.encoding?r[i.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},i=function(e,t,r){var n={},i=new Uint8Array(e,t,10);if(n.fileIdentifierString=String.fromCharCode.apply(null,i),"CntZImage"!==n.fileIdentifierString.trim())throw"Unexpected file identifier string: "+n.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(n.fileVersion=a.getInt32(0,!0),n.imageType=a.getInt32(4,!0),n.height=a.getUint32(8,!0),n.width=a.getUint32(12,!0),n.maxZError=a.getFloat64(16,!0),t+=24,!r)if(a=new DataView(e,t,16),n.mask={},n.mask.numBlocksY=a.getUint32(0,!0),n.mask.numBlocksX=a.getUint32(4,!0),n.mask.numBytes=a.getUint32(8,!0),n.mask.maxValue=a.getFloat32(12,!0),t+=16,n.mask.numBytes>0){var o=new Uint8Array(Math.ceil(n.width*n.height/8)),s=(a=new DataView(e,t,n.mask.numBytes)).getInt16(0,!0),f=2,l=0;do{if(s>0)for(;s--;)o[l++]=a.getUint8(f++);else{var u=a.getUint8(f++);for(s=-s;s--;)o[l++]=u}s=a.getInt16(f,!0),f+=2}while(f<n.mask.numBytes);if(-32768!==s||l<o.length)throw"Unexpected end of mask RLE encoding";n.mask.bitset=o,t+=n.mask.numBytes}else 0==(n.mask.numBytes|n.mask.numBlocksY|n.mask.maxValue)&&(n.mask.bitset=new Uint8Array(Math.ceil(n.width*n.height/8)));a=new DataView(e,t,16),n.pixels={},n.pixels.numBlocksY=a.getUint32(0,!0),n.pixels.numBlocksX=a.getUint32(4,!0),n.pixels.numBytes=a.getUint32(8,!0),n.pixels.maxValue=a.getFloat32(12,!0),t+=16;var c=n.pixels.numBlocksX,h=n.pixels.numBlocksY,d=c+(n.width%c>0?1:0),p=h+(n.height%h>0?1:0);n.pixels.blocks=new Array(d*p);for(var m=0,v=0;v<p;v++)for(var y=0;y<d;y++){var w=0,g=e.byteLength-t;a=new DataView(e,t,Math.min(10,g));var b={};n.pixels.blocks[m++]=b;var k=a.getUint8(0);if(w++,b.encoding=63&k,b.encoding>3)throw"Invalid block encoding ("+b.encoding+")";if(2!==b.encoding){if(0!==k&&2!==k){if(k>>=6,b.offsetType=k,2===k)b.offset=a.getInt8(1),w++;else if(1===k)b.offset=a.getInt16(1,!0),w+=2;else{if(0!==k)throw"Invalid block offset type";b.offset=a.getFloat32(1,!0),w+=4}if(1===b.encoding)if(k=a.getUint8(w),w++,b.bitsPerPixel=63&k,k>>=6,b.numValidPixelsType=k,2===k)b.numValidPixels=a.getUint8(w),w++;else if(1===k)b.numValidPixels=a.getUint16(w,!0),w+=2;else{if(0!==k)throw"Invalid valid pixel count type";b.numValidPixels=a.getUint32(w,!0),w+=4}}var x;if(t+=w,3!==b.encoding)if(0===b.encoding){var _=(n.pixels.numBytes-1)/4;if(_!==Math.floor(_))throw"uncompressed block has invalid length";x=new ArrayBuffer(4*_),new Uint8Array(x).set(new Uint8Array(e,t,4*_));var A=new Float32Array(x);b.rawData=A,t+=4*_}else if(1===b.encoding){var P=Math.ceil(b.numValidPixels*b.bitsPerPixel/8),I=Math.ceil(P/4);x=new ArrayBuffer(4*I),new Uint8Array(x).set(new Uint8Array(e,t,P)),b.stuffedData=new Uint32Array(x),t+=P}}else t++}return n.eofOffset=t,n},a=function(e,t,r,n,i,a,o){var s,f,l,u=(1<<t)-1,c=0,h=0,d=Math.ceil((o-n)/i),p=4*e.length-Math.ceil(t*r/8);for(e[e.length-1]<<=8*p,s=0;s<r;s++){if(0===h&&(l=e[c++],h=32),h>=t)f=l>>>h-t&u,h-=t;else{var m=t-h;f=(l&u)<<m&u,f+=(l=e[c++])>>>(h=32-m)}a[s]=f<d?n+f*i:o}return a},e),y=(o=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d=(1<<r)-1,p=0,m=0,v=4*e.length-Math.ceil(r*n/8);if(e[e.length-1]<<=8*v,i)for(f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=i[l];else for(h=Math.ceil((s-a)/o),f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=l<h?a+l*o:s},s=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=[],p=4*e.length-Math.ceil(t*r/8);e[e.length-1]<<=8*p;var m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32),c>=t?(h=o>>>c-t&s,c-=t):(h=(o&s)<<(u=t-c)&s,h+=(o=e[f++])>>>(c=32-u)),d[l]=h<m?n+h*i:a;return d.unshift(n),d},f=function(e,t,r,n,i,a,o,s){var f,l,u,c,h=(1<<r)-1,d=0,p=0,m=0;if(i)for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=i[l];else{var v=Math.ceil((s-a)/o);for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=l<v?a+l*o:s}return t},l=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=0,p=[],m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32,d=0),c>=t?(h=o>>>d&s,c-=t,d+=t):(h=o>>>d&s,c=32-(u=t-c),h|=((o=e[f++])&(1<<u)-1)<<t-u,d=u),p[l]=h<m?n+h*i:a;return p.unshift(n),p},u=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=4*e.length-Math.ceil(r*n/8);for(e[e.length-1]<<=8*c,i=0;i<n;i++)0===u&&(o=e[l++],u=32),u>=r?(a=o>>>u-r&f,u-=r):(a=(o&f)<<(s=r-u)&f,a+=(o=e[l++])>>>(u=32-s)),t[i]=a;return t},c=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=0;for(i=0;i<n;i++)0===u&&(o=e[l++],u=32,c=0),u>=r?(a=o>>>c&f,u-=r,c+=r):(a=o>>>c&f,u=32-(s=r-u),a|=((o=e[l++])&(1<<s)-1)<<r-s,c=s),t[i]=a;return t},h={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,r=65535,n=e.length,i=Math.floor(n/2),a=0;i;){var o=i>=359?359:i;i-=o;do{t+=e[a++]<<8,r+=t+=e[a++]}while(--o);t=(65535&t)+(t>>>16),r=(65535&r)+(r>>>16)}return 1&n&&(r+=t+=e[a]<<8),((r=(65535&r)+(r>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var r=t.ptr,n=new Uint8Array(e,r,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,n),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;r+=6;var a,o=new DataView(e,r,8),s=o.getInt32(0,!0);if(i.fileVersion=s,r+=4,s>=3&&(i.checksum=o.getUint32(4,!0),r+=4),o=new DataView(e,r,12),i.height=o.getUint32(0,!0),i.width=o.getUint32(4,!0),r+=8,s>=4?(i.numDims=o.getUint32(8,!0),r+=4):i.numDims=1,o=new DataView(e,r,40),i.numValidPixel=o.getUint32(0,!0),i.microBlockSize=o.getInt32(4,!0),i.blobSize=o.getInt32(8,!0),i.imageType=o.getInt32(12,!0),i.maxZError=o.getFloat64(16,!0),i.zMin=o.getFloat64(24,!0),i.zMax=o.getFloat64(32,!0),r+=40,t.headerInfo=i,t.ptr=r,s>=3&&(a=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,r-a,i.blobSize-14))!==i.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var r=t.headerInfo,n=this.getDataTypeArray(r.imageType),i=r.numDims*this.getDataTypeSize(r.imageType),a=this.readSubArray(e,t.ptr,n,i),o=this.readSubArray(e,t.ptr+i,n,i);t.ptr+=2*i;var s,f=!0;for(s=0;s<r.numDims;s++)if(a[s]!==o[s]){f=!1;break}return r.minValues=a,r.maxValues=o,f},readSubArray:function(e,t,r,n){var i;if(r===Uint8Array)i=new Uint8Array(e,t,n);else{var a=new ArrayBuffer(n);new Uint8Array(a).set(new Uint8Array(e,t,n)),i=new r(a)}return i},readMask:function(e,t){var r,n,i=t.ptr,a=t.headerInfo,o=a.width*a.height,s=a.numValidPixel,f=new DataView(e,i,4),l={};if(l.numBytes=f.getUint32(0,!0),i+=4,(0===s||o===s)&&0!==l.numBytes)throw"invalid mask";if(0===s)r=new Uint8Array(Math.ceil(o/8)),l.bitset=r,n=new Uint8Array(o),t.pixels.resultMask=n,i+=l.numBytes;else if(l.numBytes>0){r=new Uint8Array(Math.ceil(o/8));var u=(f=new DataView(e,i,l.numBytes)).getInt16(0,!0),c=2,h=0,d=0;do{if(u>0)for(;u--;)r[h++]=f.getUint8(c++);else for(d=f.getUint8(c++),u=-u;u--;)r[h++]=d;u=f.getInt16(c,!0),c+=2}while(c<l.numBytes);if(-32768!==u||h<r.length)throw"Unexpected end of mask RLE encoding";n=new Uint8Array(o);var p=0,m=0;for(m=0;m<o;m++)7&m?(p=r[m>>3],p<<=7&m):p=r[m>>3],128&p&&(n[m]=1);t.pixels.resultMask=n,l.bitset=r,i+=l.numBytes}return t.ptr=i,t.mask=l,!0},readDataOneSweep:function(e,t,r,n){var i,a=t.ptr,o=t.headerInfo,s=o.numDims,f=o.width*o.height,l=o.imageType,u=o.numValidPixel*h.getDataTypeSize(l)*s,c=t.pixels.resultMask;if(r===Uint8Array)i=new Uint8Array(e,a,u);else{var d=new ArrayBuffer(u);new Uint8Array(d).set(new Uint8Array(e,a,u)),i=new r(d)}if(i.length===f*s)t.pixels.resultPixels=n?h.swapDimensionOrder(i,f,s,r,!0):i;else{t.pixels.resultPixels=new r(f*s);var p=0,m=0,v=0,y=0;if(s>1){if(n){for(m=0;m<f;m++)if(c[m])for(y=m,v=0;v<s;v++,y+=f)t.pixels.resultPixels[y]=i[p++]}else for(m=0;m<f;m++)if(c[m])for(y=m*s,v=0;v<s;v++)t.pixels.resultPixels[y+v]=i[p++]}else for(m=0;m<f;m++)c[m]&&(t.pixels.resultPixels[m]=i[p++])}return a+=u,t.ptr=a,!0},readHuffmanTree:function(e,t){var r=this.HUFFMAN_LUT_BITS_MAX,n=new DataView(e,t.ptr,16);if(t.ptr+=16,n.getInt32(0,!0)<2)throw"unsupported Huffman version";var i=n.getInt32(4,!0),a=n.getInt32(8,!0),o=n.getInt32(12,!0);if(a>=o)return!1;var s=new Uint32Array(o-a);h.decodeBits(e,t,s);var f,l,u,c,p=[];for(f=a;f<o;f++)p[l=f-(f<i?0:i)]={first:s[f-a],second:null};var m=e.byteLength-t.ptr,v=Math.ceil(m/4),y=new ArrayBuffer(4*v);new Uint8Array(y).set(new Uint8Array(e,t.ptr,m));var w,g=new Uint32Array(y),b=0,k=0;for(w=g[0],f=a;f<o;f++)(c=p[l=f-(f<i?0:i)].first)>0&&(p[l].second=w<<b>>>32-c,32-b>=c?32===(b+=c)&&(b=0,w=g[++k]):(b+=c-32,w=g[++k],p[l].second|=w>>>32-b));var x=0,_=0,A=new d;for(f=0;f<p.length;f++)void 0!==p[f]&&(x=Math.max(x,p[f].first));_=x>=r?r:x;var P,I,U,S,T,D=[];for(f=a;f<o;f++)if((c=p[l=f-(f<i?0:i)].first)>0)if(P=[c,l],c<=_)for(I=p[l].second<<_-c,U=1<<_-c,u=0;u<U;u++)D[I|u]=P;else for(I=p[l].second,T=A,S=c-1;S>=0;S--)I>>>S&1?(T.right||(T.right=new d),T=T.right):(T.left||(T.left=new d),T=T.left),0!==S||T.val||(T.val=P[1]);return{decodeLut:D,numBitsLUTQick:_,numBitsLUT:x,tree:A,stuffedData:g,srcPtr:k,bitPos:b}},readHuffman:function(e,t,r,n){var i,a,o,s,f,l,u,c,d,p=t.headerInfo.numDims,m=t.headerInfo.height,v=t.headerInfo.width,y=v*m,w=this.readHuffmanTree(e,t),g=w.decodeLut,b=w.tree,k=w.stuffedData,x=w.srcPtr,_=w.bitPos,A=w.numBitsLUTQick,P=w.numBitsLUT,I=0===t.headerInfo.imageType?128:0,U=t.pixels.resultMask,S=0;_>0&&(x++,_=0);var T,D=k[x],E=1===t.encodeMode,B=new r(y*p),O=B;if(p<2||E){for(T=0;T<p;T++)if(p>1&&(O=new r(B.buffer,y*T,y),S=0),t.headerInfo.numValidPixel===v*m)for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(o+=u>0?S:l>0?O[c-v]:S,o&=255,O[c]=o,S=o):O[c]=o}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++)if(U[c]){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(u>0&&U[c-1]?o+=S:l>0&&U[c-v]?o+=O[c-v]:o+=S,o&=255,O[c]=o,S=o):O[c]=o}}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++)if(c=l*v+u,!U||U[c])for(T=0;T<p;T++,c+=y){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,O[c]=o}t.ptr=t.ptr+4*(x+1)+(_>0?4:0),t.pixels.resultPixels=B,p>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(B,y,p,r))},decodeBits:function(e,t,r,n,i){var a=t.headerInfo,h=a.fileVersion,d=0,p=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,m=new DataView(e,t.ptr,p),v=m.getUint8(0);d++;var y=v>>6,w=0===y?4:3-y,g=(32&v)>0,b=31&v,k=0;if(1===w)k=m.getUint8(d),d++;else if(2===w)k=m.getUint16(d,!0),d+=2;else{if(4!==w)throw"Invalid valid pixel count type";k=m.getUint32(d,!0),d+=4}var x,_,A,P,I,U,S,T,D,E=2*a.maxZError,B=a.numDims>1?a.maxValues[i]:a.zMax;if(g){for(t.counter.lut++,T=m.getUint8(d),d++,P=Math.ceil((T-1)*b/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),A=new Uint8Array(_),t.ptr+=d,A.set(new Uint8Array(e,t.ptr,P)),S=new Uint32Array(_),t.ptr+=P,D=0;T-1>>>D;)D++;P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,U=h>=3?l(S,b,T-1,n,E,B):s(S,b,T-1,n,E,B),h>=3?f(x,r,D,k,U):o(x,r,D,k,U)}else t.counter.bitstuffer++,D=b,t.ptr+=d,D>0&&(P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,h>=3?null==n?c(x,r,D,k):f(x,r,D,k,!1,n,E,B):null==n?u(x,r,D,k):o(x,r,D,k,!1,n,E,B))},readTiles:function(e,t,r,n){var i=t.headerInfo,a=i.width,o=i.height,s=a*o,f=i.microBlockSize,l=i.imageType,u=h.getDataTypeSize(l),c=Math.ceil(a/f),d=Math.ceil(o/f);t.pixels.numBlocksY=d,t.pixels.numBlocksX=c,t.pixels.ptr=0;var p,m,v,y,w,g,b,k,x,_,A=0,P=0,I=0,U=0,S=0,T=0,D=0,E=0,B=0,O=0,M=0,C=0,L=0,R=0,V=0,G=new r(f*f),F=o%f||f,z=a%f||f,j=i.numDims,N=t.pixels.resultMask,Z=t.pixels.resultPixels,K=i.fileVersion>=5?14:15,H=i.zMax;for(I=0;I<d;I++)for(S=I!==d-1?f:F,U=0;U<c;U++)for(O=I*a*f+U*f,M=a-(T=U!==c-1?f:z),k=0;k<j;k++){if(j>1?(_=Z,O=I*a*f+U*f,Z=new r(t.pixels.resultPixels.buffer,s*k*u,s),H=i.maxValues[k]):_=null,D=e.byteLength-t.ptr,m={},V=0,E=(p=new DataView(e,t.ptr,Math.min(10,D))).getUint8(0),V++,x=i.fileVersion>=5?4&E:0,B=E>>6&255,(E>>2&K)!=(U*f>>3&K))throw"integrity issue";if(x&&0===k)throw"integrity issue";if((w=3&E)>3)throw t.ptr+=V,"Invalid block encoding ("+w+")";if(2!==w)if(0===w){if(x)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=V,C=(C=S*T*u)<(L=e.byteLength-t.ptr)?C:L,v=new ArrayBuffer(C%u==0?C:C+u-C%u),new Uint8Array(v).set(new Uint8Array(e,t.ptr,C)),y=new r(v),R=0,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=y[R++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=y[R++];O+=M}t.ptr+=R*u}else if(g=h.getDataTypeUsed(x&&l<6?4:l,B),b=h.getOnePixel(m,V,g,p),V+=h.getDataTypeSize(g),3===w)if(t.ptr+=V,t.counter.constantoffset++,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=x?Math.min(H,_[O]+b):b),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=x?Math.min(H,_[O]+b):b,O++;O+=M}else if(t.ptr+=V,h.decodeBits(e,t,G,b,k),V=0,x)if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]+_[O]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=G[V++]+_[O],O++;O+=M}else if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=G[V++];O+=M}else{if(x)if(N)for(A=0;A<S;A++)for(P=0;P<T;P++)N[O]&&(Z[O]=_[O]),O++;else for(A=0;A<S;A++)for(P=0;P<T;P++)Z[O]=_[O],O++;t.counter.constant++,t.ptr+=V}}j>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(t.pixels.resultPixels,s,j,r))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:h.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var r=e.headerInfo.zMax,n=e.headerInfo.zMin,i=e.headerInfo.maxValues,a=e.headerInfo.numDims,o=e.headerInfo.height*e.headerInfo.width,s=0,f=0,l=0,u=e.pixels.resultMask,c=e.pixels.resultPixels;if(u)if(a>1){if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)u[f]&&(c[l+f]=r);else for(f=0;f<o;f++)if(u[f])for(l=f*a,s=0;s<a;s++)c[l+a]=i[s]}else for(f=0;f<o;f++)u[f]&&(c[f]=r);else if(a>1&&n!==r)if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)c[l+f]=r;else for(f=0;f<o;f++)for(l=f*a,s=0;s<a;s++)c[l+s]=i[s];else for(f=0;f<o*a;f++)c[f]=r},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var r;switch(e){case 0:r=t>=-128&&t<=127;break;case 1:r=t>=0&&t<=255;break;case 2:r=t>=-32768&&t<=32767;break;case 3:r=t>=0&&t<=65536;break;case 4:r=t>=-2147483648&&t<=2147483647;break;case 5:r=t>=0&&t<=4294967296;break;case 6:r=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:r=t>=-17976931348623157e292&&t<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var r=e;switch(e){case 2:case 4:r=e-t;break;case 3:case 5:r=e-2*t;break;case 6:r=0===t?e:1===t?2:1;break;case 7:r=0===t?e:e-2*t+1;break;default:r=e}return r},getOnePixel:function(e,t,r,n){var i=0;switch(r){case 0:i=n.getInt8(t);break;case 1:i=n.getUint8(t);break;case 2:i=n.getInt16(t,!0);break;case 3:i=n.getUint16(t,!0);break;case 4:i=n.getInt32(t,!0);break;case 5:i=n.getUInt32(t,!0);break;case 6:i=n.getFloat32(t,!0);break;case 7:i=n.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return i},swapDimensionOrder:function(e,t,r,n,i){var a=0,o=0,s=0,f=0,l=e;if(r>1)if(l=new n(t*r),i)for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[f]=e[o++];else for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[o++]=e[f];return l}},d=function(e,t,r){this.val=e,this.left=t,this.right=r},{decode:function(e,t){var r=(t=t||{}).noDataValue,n=0,i={};i.ptr=t.inputOffset||0,i.pixels={},h.readHeaderInfo(e,i);var a=i.headerInfo,o=a.fileVersion,s=h.getDataTypeArray(a.imageType);if(o>5)throw"unsupported lerc version 2."+o;h.readMask(e,i),a.numValidPixel===a.width*a.height||i.pixels.resultMask||(i.pixels.resultMask=t.maskData);var f=a.width*a.height;i.pixels.resultPixels=new s(f*a.numDims),i.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var l,u=!t.returnPixelInterleavedDims;if(0!==a.numValidPixel)if(a.zMax===a.zMin)h.constructConstantSurface(i,u);else if(o>=4&&h.checkMinMaxRanges(e,i))h.constructConstantSurface(i,u);else{var c=new DataView(e,i.ptr,2),d=c.getUint8(0);if(i.ptr++,d)h.readDataOneSweep(e,i,s,u);else if(o>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var p=c.getUint8(1);if(i.ptr++,i.encodeMode=p,p>2||o<4&&p>1)throw"Invalid Huffman flag "+p;p?h.readHuffman(e,i,s,u):h.readTiles(e,i,s,u)}else h.readTiles(e,i,s,u)}i.eofOffset=i.ptr,t.inputOffset?(l=i.headerInfo.blobSize+t.inputOffset-i.ptr,Math.abs(l)>=1&&(i.eofOffset=t.inputOffset+i.headerInfo.blobSize)):(l=i.headerInfo.blobSize-i.ptr,Math.abs(l)>=1&&(i.eofOffset=i.headerInfo.blobSize));var m={width:a.width,height:a.height,pixelData:i.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:i.pixels.resultMask};if(i.pixels.resultMask&&h.isValidPixelValue(a.imageType,r)){var v=i.pixels.resultMask;for(n=0;n<f;n++)v[n]||(m.pixelData[n]=r);m.noDataValue=r}return i.noDataValue=r,t.returnFileInfo&&(m.fileInfo=h.formatFileInfo(i)),m},getBandCount:function(e){for(var t=0,r=0,n={ptr:0,pixels:{}};r<e.byteLength-58;)h.readHeaderInfo(e,n),r+=n.headerInfo.blobSize,t++,n.ptr=r;return t}}),w=(p=new ArrayBuffer(4),m=new Uint8Array(p),new Uint32Array(p)[0]=1,1===m[0]),g={decode:function(e,t){if(!w)throw"Big endian system is not supported.";var r,n,i=(t=t||{}).inputOffset||0,a=new Uint8Array(e,i,10),o=String.fromCharCode.apply(null,a);if("CntZImage"===o.trim())r=v,n=1;else{if("Lerc2"!==o.substring(0,5))throw"Unexpected file identifier string: "+o;r=y,n=2}for(var s,f,l,u,c,h,d=0,p=e.byteLength-10,m=[],g={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]},b=0;i<p;){var k=r.decode(e,{inputOffset:i,encodedMaskData:s,maskData:l,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,returnPixelInterleavedDims:t.returnPixelInterleavedDims,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});i=k.fileInfo.eofOffset,l=k.maskData,0===d&&(s=k.encodedMaskData,g.width=k.width,g.height=k.height,g.dimCount=k.dimCount||1,g.pixelType=k.pixelType||k.fileInfo.pixelType,g.mask=l),n>1&&(l&&m.push(l),k.fileInfo.mask&&k.fileInfo.mask.numBytes>0&&b++),d++,g.pixels.push(k.pixelData),g.statistics.push({minValue:k.minValue,maxValue:k.maxValue,noDataValue:k.noDataValue,dimStats:k.dimStats})}if(n>1&&b>1){for(h=g.width*g.height,g.bandMasks=m,(l=new Uint8Array(h)).set(m[0]),u=1;u<m.length;u++)for(f=m[u],c=0;c<h;c++)l[c]=l[c]&f[c];g.maskData=l}return g}};Ke.exports?Ke.exports=g:this.Lerc=g}();var We=Xe.exports,qe={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Je={};for(var Qe in qe)qe.hasOwnProperty(Qe)&&(Je[qe[Qe]]=parseInt(Qe,10));Je.BitsPerSample,Je.ExtraSamples,Je.SampleFormat,Je.StripByteCounts,Je.StripOffsets,Je.StripRowCounts,Je.TileByteCounts,Je.TileOffsets,Je.SubIFDs;var $e={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},et={};for(var tt in $e)$e.hasOwnProperty(tt)&&(et[$e[tt]]=parseInt(tt,10));var rt=1,nt=0,it=1,at={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},ot={};for(var st in at)at.hasOwnProperty(st)&&(ot[at[st]]=parseInt(st,10));function ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var lt=function(e){p(r,b);var t=ft(r);function r(e){var n;return u(this,r),(n=t.call(this)).planarConfiguration=void 0!==e.PlanarConfiguration?e.PlanarConfiguration:1,n.samplesPerPixel=void 0!==e.SamplesPerPixel?e.SamplesPerPixel:1,n.addCompression=e.LercParameters[rt],n}return h(r,[{key:"decodeBlock",value:function(e){switch(this.addCompression){case nt:break;case it:e=Fe(new Uint8Array(e)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return We.decode(e,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),r}(),ut=Object.freeze({__proto__:null,default:lt});function ct(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var ht=function(e){p(a,b);var r,n=ct(a);function a(){var e;if(u(this,a),e=n.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return e}return h(a,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Blob([r]),e.next=3,createImageBitmap(n);case 3:return a=e.sent,"undefined"!=typeof document?((o=document.createElement("canvas")).width=a.width,o.height=a.height):o=new OffscreenCanvas(a.width,a.height),(s=o.getContext("2d")).drawImage(a,0,0),e.abrupt("return",s.getImageData(0,0,a.width,a.height).data.buffer);case 8:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})}]),a}(),dt=Object.freeze({__proto__:null,default:ht});';return new gq(typeof Blob=="undefined"?"data:application/javascript;base64,"+Buffer.from(n,"binary").toString("base64"):URL.createObjectURL(new Blob([n],{type:"application/javascript"})))}var yq=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",create:mq});export{_f as AssertionError,qt as Collection,ko as Disposable,lt as Feature,zE as Geolocation,Uy as Graticule,pl as Image,oc as ImageBase,ac as ImageCanvas,ia as ImageTile,Km as Kinetic,Iw as Map,Qn as MapBrowserEvent,c0 as MapBrowserEventHandler,wl as MapEvent,ln as Object,Tf as Observable,E0 as Overlay,id as PluggableMap,ks as Tile,Dc as TileCache,Jf as TileQueue,kc as TileRange,yf as VERSION,Q0 as VectorRenderTile,ey as VectorTile,_r as View,oe as getUid,_f as ol$AssertionError,qt as ol$Collection,ju as ol$Collection$CollectionEvent,Dt as ol$CollectionEventType,um as ol$DataTile,ko as ol$Disposable,lt as ol$Feature,Nx as ol$Feature$createStyleFunction,zE as ol$Geolocation,Uy as ol$Graticule,pl as ol$Image,Kf as ol$Image$listenImage,oc as ol$ImageBase,ac as ol$ImageCanvas,ye as ol$ImageState,ia as ol$ImageTile,Km as ol$Kinetic,Iw as ol$Map,Qn as ol$MapBrowserEvent,c0 as ol$MapBrowserEventHandler,Pe as ol$MapBrowserEventType,wl as ol$MapEvent,oa as ol$MapEventType,Xt as ol$MapProperty,ln as ol$Object,am as ol$Object$ObjectEvent,Ps as ol$ObjectEventType,Tf as ol$Observable,Px as ol$Observable$unByKey,E0 as ol$Overlay,Ki as ol$OverlayPositioning,id as ol$PluggableMap,ks as ol$Tile,Dc as ol$TileCache,Jf as ol$TileQueue,aT as ol$TileQueue$getTilePriority,kc as ol$TileRange,ha as ol$TileRange$createOrUpdate,K as ol$TileState,yf as ol$VERSION,Q0 as ol$VectorRenderTile,ey as ol$VectorTile,_r as ol$View,pT as ol$View$createCenterConstraint,gT as ol$View$createResolutionConstraint,mT as ol$View$createRotationConstraint,yT as ol$View$isNoopAnimation,pt as ol$ViewHint,gn as ol$ViewProperty,Ix as ol$array$binarySearch,dr as ol$array$equals,qe as ol$array$extend,Go as ol$array$find,vf as ol$array$findIndex,Ye as ol$array$includes,Lx as ol$array$isSorted,Bu as ol$array$linearFindNearest,Vr as ol$array$numberSafeCompareFunction,WO as ol$array$remove,Cx as ol$array$reverseSubArray,ZO as ol$array$stableSort,ce as ol$asserts$assert,h0 as ol$centerconstraint$createExtent,uT as ol$centerconstraint$none,na as ol$color$asArray,qm as ol$color$asString,Jm as ol$color$fromString,ZE as ol$color$isStringColor,Qm as ol$color$normalize,e0 as ol$color$toString,tr as ol$colorlike$asColorLike,xT as ol$control$Attribution,vr as ol$control$Control,aP as ol$control$FullScreen,uP as ol$control$MousePosition,dP as ol$control$OverviewMap,ET as ol$control$Rotate,mP as ol$control$ScaleLine,Hs as ol$control$ScaleLine$Units,TT as ol$control$Zoom,_P as ol$control$ZoomSlider,xP as ol$control$ZoomToExtent,LT as ol$control$defaults,Im as ol$coordinate$add,uE as ol$coordinate$closestOnCircle,Hu as ol$coordinate$closestOnSegment,pA as ol$coordinate$createStringXY,Ku as ol$coordinate$degreesToStringHDMS,qu as ol$coordinate$distance,Mn as ol$coordinate$equals,cE as ol$coordinate$format,Lm as ol$coordinate$getWorldsAway,Af as ol$coordinate$rotate,Cm as ol$coordinate$scale,fn as ol$coordinate$squaredDistance,Ju as ol$coordinate$squaredDistanceToSegment,gA as ol$coordinate$toStringHDMS,hE as ol$coordinate$toStringXY,Pf as ol$coordinate$wrapX,fc as ol$css$CLASS_COLLAPSED,Ws as ol$css$CLASS_CONTROL,hc as ol$css$CLASS_HIDDEN,JE as ol$css$CLASS_SELECTABLE,Jn as ol$css$CLASS_UNSELECTABLE,i0 as ol$css$CLASS_UNSUPPORTED,r0 as ol$css$cssOpacity,n0 as ol$css$getFontParameters,Yt as ol$dom$createCanvasContext2D,jE as ol$dom$outerHeight,BE as ol$dom$outerWidth,Hm as ol$dom$removeChildren,lc as ol$dom$removeNode,YE as ol$dom$replaceChildren,ta as ol$dom$replaceNode,lm as ol$easing$easeIn,Ds as ol$easing$easeOut,wf as ol$easing$inAndOut,Fx as ol$easing$linear,JO as ol$easing$upAndDown,ni as ol$events$Event,XO as ol$events$Event$preventDefault,bx as ol$events$Event$stopPropagation,re as ol$events$EventType,qs as ol$events$KeyCode,$s as ol$events$Target,od as ol$events$condition$all,PT as ol$events$condition$altKeyOnly,MT as ol$events$condition$altShiftKeysOnly,Sl as ol$events$condition$always,RP as ol$events$condition$click,IP as ol$events$condition$doubleClick,FT as ol$events$condition$focus,R0 as ol$events$condition$focusWithTabindex,b0 as ol$events$condition$mouseActionButton,la as ol$events$condition$mouseOnly,I0 as ol$events$condition$never,ad as ol$events$condition$noModifierKeys,OP as ol$events$condition$penOnly,CP as ol$events$condition$platformModifierKeyOnly,bP as ol$events$condition$pointerMove,O0 as ol$events$condition$primaryAction,xc as ol$events$condition$shiftKeyOnly,C0 as ol$events$condition$singleClick,L0 as ol$events$condition$targetNotEditable,LP as ol$events$condition$touchOnly,ge as ol$events$listen,Uo as ol$events$listenOnce,He as ol$events$unlistenByKey,sl as ol$extent$Corner,ci as ol$extent$Relationship,Zo as ol$extent$applyTransform,Xx as ol$extent$approximatelyEquals,Lt as ol$extent$boundingExtent,un as ol$extent$buffer,pm as ol$extent$clone,Gs as ol$extent$closestSquaredDistanceXY,cn as ol$extent$containsCoordinate,hi as ol$extent$containsExtent,Rf as ol$extent$containsXY,bf as ol$extent$coordinateRelationship,wi as ol$extent$createEmpty,hn as ol$extent$createOrUpdate,Us as ol$extent$createOrUpdateEmpty,jo as ol$extent$createOrUpdateFromCoordinate,oA as ol$extent$createOrUpdateFromCoordinates,If as ol$extent$createOrUpdateFromFlatCoordinates,aA as ol$extent$createOrUpdateFromRings,Tn as ol$extent$equals,gm as ol$extent$extend,Yo as ol$extent$extendCoordinate,mm as ol$extent$extendCoordinates,ym as ol$extent$extendFlatCoordinates,Vx as ol$extent$extendRings,Wx as ol$extent$extendXY,Cf as ol$extent$forEachCorner,ol as ol$extent$getArea,Xo as ol$extent$getBottomLeft,Vo as ol$extent$getBottomRight,fi as ol$extent$getCenter,Zx as ol$extent$getCorner,lA as ol$extent$getEnlargedArea,Wo as ol$extent$getForViewAndSize,ft as ol$extent$getHeight,Ai as ol$extent$getIntersection,uA as ol$extent$getIntersectionArea,cA as ol$extent$getMargin,hA as ol$extent$getSize,An as ol$extent$getTopLeft,al as ol$extent$getTopRight,Ae as ol$extent$getWidth,dt as ol$extent$intersects,Kx as ol$extent$intersectsSegment,zs as ol$extent$isEmpty,Hx as ol$extent$returnOrUpdate,Vu as ol$extent$scaleFromCenter,_m as ol$extent$wrapX,Z0 as ol$featureloader$loadFeaturesXhr,NM as ol$featureloader$setWithCredentials,H0 as ol$featureloader$xhr,IF as ol$format$EsriJSON,$l as ol$format$Feature,Id as ol$format$Feature$transformExtentWithOptions,yt as ol$format$Feature$transformGeometryWithOptions,mn as ol$format$FormatType,$F as ol$format$GML,ya as ol$format$GML2,Me as ol$format$GML3,Md as ol$format$GML32,ze as ol$format$GMLBase,wr as ol$format$GMLBase$GMLNS,gN as ol$format$GPX,AN as ol$format$GeoJSON,kN as ol$format$IGC,XN as ol$format$IIIFInfo,Jt as ol$format$IIIFInfo$Versions,Ld as ol$format$JSONFeature,ND as ol$format$KML,JN as ol$format$KML$getDefaultFillStyle,QN as ol$format$KML$getDefaultImageStyle,e$ as ol$format$KML$getDefaultStrokeStyle,i$ as ol$format$KML$getDefaultStyle,n$ as ol$format$KML$getDefaultStyleArray,t$ as ol$format$KML$getDefaultTextStyle,_y as ol$format$KML$readFlatCoordinates,ES as ol$format$MVT,pk as ol$format$OSMXML,wS as ol$format$OWS,Wk as ol$format$Polyline,RS as ol$format$Polyline$decodeDeltas,IS as ol$format$Polyline$decodeFloats,LS as ol$format$Polyline$decodeSignedIntegers,AS as ol$format$Polyline$decodeUnsignedIntegers,SS as ol$format$Polyline$encodeDeltas,bS as ol$format$Polyline$encodeFloats,CS as ol$format$Polyline$encodeSignedIntegers,PS as ol$format$Polyline$encodeUnsignedInteger,OS as ol$format$Polyline$encodeUnsignedIntegers,Nd as ol$format$TextFeature,sG as ol$format$TopoJSON,s3 as ol$format$WFS,r3 as ol$format$WFS$writeFilter,c3 as ol$format$WKB,w3 as ol$format$WKT,rU as ol$format$WMSCapabilities,lU as ol$format$WMSGetFeatureInfo,PU as ol$format$WMTSCapabilities,Hd as ol$format$XML,ga as ol$format$XMLFeature,FS as ol$format$filter$And,NS as ol$format$filter$Bbox,jl as ol$format$filter$Comparison,Ea as ol$format$filter$ComparisonBinary,$S as ol$format$filter$Contains,DS as ol$format$filter$DWithin,kS as ol$format$filter$Disjoint,GS as ol$format$filter$During,US as ol$format$filter$EqualTo,xa as ol$format$filter$Filter,zS as ol$format$filter$GreaterThan,BS as ol$format$filter$GreaterThanOrEqualTo,jS as ol$format$filter$Intersects,YS as ol$format$filter$IsBetween,XS as ol$format$filter$IsLike,VS as ol$format$filter$IsNull,WS as ol$format$filter$LessThan,ZS as ol$format$filter$LessThanOrEqualTo,Ly as ol$format$filter$LogicalNary,HS as ol$format$filter$Not,KS as ol$format$filter$NotEqualTo,qS as ol$format$filter$Or,JS as ol$format$filter$ResourceId,Bl as ol$format$filter$Spatial,QS as ol$format$filter$Within,eR as ol$format$filter$and,tR as ol$format$filter$bbox,XG as ol$format$filter$between,MG as ol$format$filter$contains,NG as ol$format$filter$disjoint,WG as ol$format$filter$during,DG as ol$format$filter$dwithin,kG as ol$format$filter$equalTo,BG as ol$format$filter$greaterThan,jG as ol$format$filter$greaterThanOrEqualTo,FG as ol$format$filter$intersects,YG as ol$format$filter$isNull,UG as ol$format$filter$lessThan,zG as ol$format$filter$lessThanOrEqualTo,VG as ol$format$filter$like,PG as ol$format$filter$not,GG as ol$format$filter$notEqualTo,AG as ol$format$filter$or,ZG as ol$format$filter$resourceId,$G as ol$format$filter$within,va as ol$format$xlink$readHref,is as ol$format$xsd$readBoolean,io as ol$format$xsd$readBooleanString,Pd as ol$format$xsd$readDateTime,Ke as ol$format$xsd$readDecimal,Sr as ol$format$xsd$readDecimalString,Rr as ol$format$xsd$readNonNegativeIntegerString,Wt as ol$format$xsd$readPositiveInteger,H as ol$format$xsd$readString,ma as ol$format$xsd$writeBooleanTextNode,$w as ol$format$xsd$writeCDATASection,Dw as ol$format$xsd$writeDateTimeTextNode,Qi as ol$format$xsd$writeDecimalTextNode,Uc as ol$format$xsd$writeNonNegativeIntegerTextNode,ve as ol$format$xsd$writeStringTextNode,Ms as ol$functions$FALSE,an as ol$functions$TRUE,Fs as ol$functions$VOID,Ox as ol$functions$memoizeOne,Ax as ol$functions$toPromise,A0 as ol$geom$Circle,Dm as ol$geom$Geometry,Pi as ol$geom$GeometryCollection,q as ol$geom$GeometryLayout,M as ol$geom$GeometryType,Gt as ol$geom$LineString,dl as ol$geom$LinearRing,yn as ol$geom$MultiLineString,Nn as ol$geom$MultiPoint,$n as ol$geom$MultiPolygon,Et as ol$geom$Point,pi as ol$geom$Polygon,UE as ol$geom$Polygon$circular,sc as ol$geom$Polygon$fromCircle,ea as ol$geom$Polygon$fromExtent,Zm as ol$geom$Polygon$makeRegular,qn as ol$geom$SimpleGeometry,Gf as ol$geom$SimpleGeometry$getStrideForLayout,SE as ol$geom$SimpleGeometry$transformGeom2D,Vf as ol$geom$flat$area$linearRing,zm as ol$geom$flat$area$linearRings,PE as ol$geom$flat$area$linearRingss,P0 as ol$geom$flat$center$linearRingss,zf as ol$geom$flat$closest$arrayMaxSquaredDelta,jf as ol$geom$flat$closest$assignClosestArrayPoint,IE as ol$geom$flat$closest$assignClosestMultiArrayPoint,Bf as ol$geom$flat$closest$assignClosestPoint,Uf as ol$geom$flat$closest$maxSquaredDelta,bE as ol$geom$flat$closest$multiArrayMaxSquaredDelta,ME as ol$geom$flat$contains$linearRingContainsExtent,Vs as ol$geom$flat$contains$linearRingContainsXY,Wf as ol$geom$flat$contains$linearRingsContainsXY,FE as ol$geom$flat$contains$linearRingssContainsXY,km as ol$geom$flat$deflate$deflateCoordinate,hl as ol$geom$flat$deflate$deflateCoordinates,Yf as ol$geom$flat$deflate$deflateCoordinatesArray,CE as ol$geom$flat$deflate$deflateMultiCoordinatesArray,Iy as ol$geom$flat$flip$flipXY,MU as ol$geom$flat$geodesic$greatCircleArc,GR as ol$geom$flat$geodesic$meridian,UR as ol$geom$flat$geodesic$parallel,gr as ol$geom$flat$inflate$inflateCoordinates,fl as ol$geom$flat$inflate$inflateCoordinatesArray,Xf as ol$geom$flat$inflate$inflateMultiCoordinatesArray,Zf as ol$geom$flat$interiorpoint$getInteriorPointOfArray,Bm as ol$geom$flat$interiorpoint$getInteriorPointsOfMultiArray,Ec as ol$geom$flat$interpolate$interpolatePoint,hd as ol$geom$flat$interpolate$lineStringCoordinateAtM,VT as ol$geom$flat$interpolate$lineStringsCoordinateAtM,nc as ol$geom$flat$intersectsextent$intersectsLineString,NE as ol$geom$flat$intersectsextent$intersectsLineStringArray,$E as ol$geom$flat$intersectsextent$intersectsLinearRing,Ym as ol$geom$flat$intersectsextent$intersectsLinearRingArray,DE as ol$geom$flat$intersectsextent$intersectsLinearRingMultiArray,fd as ol$geom$flat$length$lineStringLength,VP as ol$geom$flat$length$linearRingLength,Wm as ol$geom$flat$orient$inflateEnds,rc as ol$geom$flat$orient$linearRingIsClockwise,Xm as ol$geom$flat$orient$linearRingsAreOriented,GE as ol$geom$flat$orient$linearRingssAreOriented,Hf as ol$geom$flat$orient$orientLinearRings,Vm as ol$geom$flat$orient$orientLinearRingsArray,kE as ol$geom$flat$reverse$coordinates,jm as ol$geom$flat$segments$forEach,ic as ol$geom$flat$simplify$douglasPeucker,Gm as ol$geom$flat$simplify$douglasPeuckerArray,bA as ol$geom$flat$simplify$douglasPeuckerMultiArray,OE as ol$geom$flat$simplify$quantize,Um as ol$geom$flat$simplify$quantizeArray,AE as ol$geom$flat$simplify$quantizeMultiArray,LE as ol$geom$flat$simplify$radialDistance,RA as ol$geom$flat$simplify$simplifyLineString,Xs as ol$geom$flat$simplify$snap,iw as ol$geom$flat$straightchunk$matchingChunk,rw as ol$geom$flat$textpath$drawTextOnPath,FU as ol$geom$flat$topology$lineStringIsClosed,kf as ol$geom$flat$transform$rotate,TE as ol$geom$flat$transform$scale,Kr as ol$geom$flat$transform$transform2D,$m as ol$geom$flat$transform$translate,oe as ol$getUid,Sf as ol$has$DEVICE_PIXEL_RATIO,$x as ol$has$FIREFOX,kx as ol$has$IMAGE_DECODE,hm as ol$has$MAC,fm as ol$has$PASSIVE_EVENT_LISTENERS,iA as ol$has$SAFARI,Dx as ol$has$WEBKIT,Yu as ol$has$WORKER_OFFSCREEN_CANVAS,AT as ol$interaction$DoubleClickZoom,jP as ol$interaction$DragAndDrop,XT as ol$interaction$DragAndDrop$DragAndDropEvent,kT as ol$interaction$DragBox,ud as ol$interaction$DragBox$DragBoxEvent,NT as ol$interaction$DragPan,$T as ol$interaction$DragRotate,XP as ol$interaction$DragRotateAndZoom,GT as ol$interaction$DragZoom,BM as ol$interaction$Draw,Nc as ol$interaction$Draw$DrawEvent,UM as ol$interaction$Draw$createBox,GM as ol$interaction$Draw$createRegularPolygon,ZM as ol$interaction$Extent,yw as ol$interaction$Extent$ExtentEvent,Ks as ol$interaction$Interaction,OT as ol$interaction$Interaction$pan,rd as ol$interaction$Interaction$zoomByDelta,UT as ol$interaction$KeyboardPan,zT as ol$interaction$KeyboardZoom,JM as ol$interaction$Modify,Td as ol$interaction$Modify$ModifyEvent,BT as ol$interaction$MouseWheelZoom,cd as ol$interaction$MouseWheelZoom$Mode,jT as ol$interaction$PinchRotate,YT as ol$interaction$PinchZoom,Fn as ol$interaction$Pointer,sd as ol$interaction$Pointer$centroid,vc as ol$interaction$Property,tF as ol$interaction$Select,Sw as ol$interaction$Select$SelectEvent,nF as ol$interaction$Snap,sF as ol$interaction$Translate,Sd as ol$interaction$Translate$TranslateEvent,bw as ol$interaction$defaults,t0 as ol$layer$Base,BR as ol$layer$BaseImage,zy as ol$layer$BaseTile,Cl as ol$layer$BaseVector,Uy as ol$layer$Graticule,mc as ol$layer$Group,qr as ol$layer$Group$GroupEvent,a5 as ol$layer$Heatmap,nb as ol$layer$Image,ra as ol$layer$Layer,cc as ol$layer$Layer$inView,jX as ol$layer$MapboxVector,Ah as ol$layer$MapboxVector$getMapboxPath,KC as ol$layer$MapboxVector$normalizeGlyphsUrl,sg as ol$layer$MapboxVector$normalizeSourceUrl,HC as ol$layer$MapboxVector$normalizeSpriteUrl,qC as ol$layer$MapboxVector$normalizeStyleUrl,Qe as ol$layer$Property,JC as ol$layer$Tile,os as ol$layer$TileProperty,ua as ol$layer$Vector,WX as ol$layer$VectorImage,lb as ol$layer$VectorTile,as as ol$layer$VectorTileRenderType,rV as ol$layer$WebGLPoints,sV as ol$layer$WebGLTile,gw as ol$loadingstrategy$all,MM as ol$loadingstrategy$bbox,FM as ol$loadingstrategy$tile,Zr as ol$math$ceil,Ie as ol$math$clamp,qx as ol$math$cosh,Ko as ol$math$floor,pr as ol$math$lerp,vm as ol$math$log2,Pn as ol$math$modulo,Em as ol$math$round,Jx as ol$math$solveLinearSystem,Wr as ol$math$squaredDistance,xm as ol$math$squaredSegmentDistance,Wu as ol$math$toDegrees,Lf as ol$math$toFixed,di as ol$math$toRadians,vL as ol$net$ClientError,_L as ol$net$ResponseError,Hv as ol$net$getJSON,$h as ol$net$jsonp,oV as ol$net$overrideXHR,Kv as ol$net$resolveUrl,aV as ol$net$restoreXHR,ie as ol$obj$assign,Ns as ol$obj$clear,xf as ol$obj$getValues,Wn as ol$obj$isEmpty,lV as ol$pixel$nothing,er as ol$pointer$EventType,Oi as ol$proj$METERS_PER_UNIT,Ho as ol$proj$Projection,Ui as ol$proj$Units,Oi as ol$proj$Units$METERS_PER_UNIT,cm as ol$proj$Units$fromCode,EE as ol$proj$addCommon,yE as ol$proj$addCoordinateTransforms,$f as ol$proj$addEquivalentProjections,mE as ol$proj$addEquivalentTransforms,Mm as ol$proj$addProjection,gE as ol$proj$addProjections,mA as ol$proj$clearAllProjections,xA as ol$proj$clearUserProjection,Nf as ol$proj$cloneTransform,Df as ol$proj$createProjection,Nm as ol$proj$createSafeCoordinateTransform,Fm as ol$proj$createTransformFromCoordinateTransform,Pm as ol$proj$disableCoordinateWarning,Qx as ol$proj$epsg3857$EXTENT,qo as ol$proj$epsg3857$HALF_SIZE,Zu as ol$proj$epsg3857$MAX_SAFE_Y,Tm as ol$proj$epsg3857$PROJECTIONS,ll as ol$proj$epsg3857$RADIUS,eE as ol$proj$epsg3857$WORLD_EXTENT,tE as ol$proj$epsg3857$fromEPSG4326,iE as ol$proj$epsg3857$toEPSG4326,wm as ol$proj$epsg4326$EXTENT,rE as ol$proj$epsg4326$METERS_PER_UNIT,Sm as ol$proj$epsg4326$PROJECTIONS,nE as ol$proj$epsg4326$RADIUS,dn as ol$proj$equivalent,yA as ol$proj$fromLonLat,ut as ol$proj$fromUserCoordinate,pn as ol$proj$fromUserExtent,xE as ol$proj$fromUserResolution,se as ol$proj$get,tc as ol$proj$getPointResolution,Kn as ol$proj$getTransform,wn as ol$proj$getTransformFromProjections,Zi as ol$proj$getUserProjection,ec as ol$proj$identityTransform,uV as ol$proj$proj4$register,aE as ol$proj$projections$add,sE as ol$proj$projections$clear,oE as ol$proj$projections$get,_E as ol$proj$setUserProjection,_A as ol$proj$toLonLat,Hr as ol$proj$toUserCoordinate,Ys as ol$proj$toUserExtent,vE as ol$proj$toUserResolution,js as ol$proj$transform,cl as ol$proj$transformExtent,vA as ol$proj$transformWithProjections,Qo as ol$proj$transforms$add,lE as ol$proj$transforms$clear,Rm as ol$proj$transforms$get,dA as ol$proj$transforms$remove,EA as ol$proj$useGeographic,DT as ol$render$Box,gl as ol$render$Event,Hi as ol$render$EventType,Ry as ol$render$Feature,ek as ol$render$Feature$toFeature,xS as ol$render$Feature$toGeometry,G0 as ol$render$VectorContext,Ll as ol$render$canvas$Builder,Cc as ol$render$canvas$BuilderGroup,Ue as ol$render$canvas$BuilderType,aw as ol$render$canvas$Executor,Oc as ol$render$canvas$ExecutorGroup,lw as ol$render$canvas$ExecutorGroup$getPixelIndexArray,ew as ol$render$canvas$ImageBuilder,yd as ol$render$canvas$Immediate,xe as ol$render$canvas$Instruction,Js as ol$render$canvas$Instruction$beginPathInstruction,k0 as ol$render$canvas$Instruction$closePathInstruction,bc as ol$render$canvas$Instruction$fillInstruction,Jr as ol$render$canvas$Instruction$strokeInstruction,tw as ol$render$canvas$LineStringBuilder,U0 as ol$render$canvas$PolygonBuilder,nw as ol$render$canvas$TextBuilder,Ic as ol$render$canvas$TextBuilder$TEXT_ALIGN,yr as ol$render$canvas$checkedFonts,mr as ol$render$canvas$defaultFillStyle,s0 as ol$render$canvas$defaultFont,dc as ol$render$canvas$defaultLineCap,ml as ol$render$canvas$defaultLineDash,yl as ol$render$canvas$defaultLineDashOffset,sa as ol$render$canvas$defaultLineJoin,El as ol$render$canvas$defaultLineWidth,_l as ol$render$canvas$defaultMiterLimit,Zs as ol$render$canvas$defaultPadding,vl as ol$render$canvas$defaultStrokeStyle,xl as ol$render$canvas$defaultTextAlign,pc as ol$render$canvas$defaultTextBaseline,sT as ol$render$canvas$drawImageOrLabel,rT as ol$render$canvas$getTextDimensions,_n as ol$render$canvas$hitdetect$HIT_DETECT_RESOLUTION,X0 as ol$render$canvas$hitdetect$createHitDetectionImageData,V0 as ol$render$canvas$hitdetect$hitDetect,eT as ol$render$canvas$labelCache,a0 as ol$render$canvas$measureAndCacheTextWidth,iT as ol$render$canvas$measureTextHeight,gc as ol$render$canvas$measureTextWidth,tT as ol$render$canvas$registerFont,jA as ol$render$canvas$rotateAtOffset,qf as ol$render$canvas$textHeights,$U as ol$render$getRenderPixel,zR as ol$render$getVectorContext,NU as ol$render$toContext,l0 as ol$renderer$Composite,B0 as ol$renderer$Layer,qE as ol$renderer$Map,qy as ol$renderer$canvas$ImageLayer,md as ol$renderer$canvas$Layer,i_ as ol$renderer$canvas$TileLayer,QC as ol$renderer$canvas$VectorImageLayer,W0 as ol$renderer$canvas$VectorLayer,ab as ol$renderer$canvas$VectorTileLayer,wa as ol$renderer$canvas$common$IMAGE_SMOOTHING_DISABLED,Ky as ol$renderer$canvas$common$IMAGE_SMOOTHING_ENABLED,fw as ol$renderer$vector$defaultOrder,vd as ol$renderer$vector$getSquaredTolerance,xd as ol$renderer$vector$getTolerance,Mc as ol$renderer$vector$renderFeature,Wy as ol$renderer$webgl$Layer,op as ol$renderer$webgl$Layer$WebGLWorkerMessageType,tb as ol$renderer$webgl$Layer$colorDecodeId,eb as ol$renderer$webgl$Layer$colorEncodeId,e5 as ol$renderer$webgl$Layer$getBlankImageData,QU as ol$renderer$webgl$Layer$writePointFeatureToBuffers,Zy as ol$renderer$webgl$PointsLayer,sL as ol$renderer$webgl$TileLayer,Mh as ol$renderer$webgl$TileLayer$Attributes,Oe as ol$renderer$webgl$TileLayer$Uniforms,EL as ol$reproj$Image,lp as ol$reproj$Tile,Jy as ol$reproj$Triangulation,ob as ol$reproj$calculateSourceExtentResolution,Zl as ol$reproj$calculateSourceResolution,l5 as ol$reproj$common$ENABLE_RASTER_REPROJECTION,Hy as ol$reproj$common$ERROR_THRESHOLD,t_ as ol$reproj$render,p0 as ol$resolutionconstraint$createMinMaxResolution,hT as ol$resolutionconstraint$createSnapToPower,cT as ol$resolutionconstraint$createSnapToResolutions,fT as ol$rotationconstraint$createSnapToN,dT as ol$rotationconstraint$createSnapToZero,Qf as ol$rotationconstraint$disable,g0 as ol$rotationconstraint$none,_0 as ol$size$buffer,v0 as ol$size$hasArea,td as ol$size$scale,Tt as ol$size$toSize,gV as ol$source$BingMaps,TL as ol$source$BingMaps$quadKey,_V as ol$source$CartoDB,xV as ol$source$Cluster,wL as ol$source$DataTile,fZ as ol$source$GeoTIFF,mZ as ol$source$IIIF,So as ol$source$Image,qL as ol$source$Image$ImageSourceEvent,pg as ol$source$Image$ImageSourceEventType,jh as ol$source$Image$defaultImageLoadFunction,vZ as ol$source$ImageArcGISRest,EZ as ol$source$ImageCanvas,SZ as ol$source$ImageMapGuide,bZ as ol$source$ImageStatic,CZ as ol$source$ImageWMS,MZ as ol$source$OGCMapTile,NZ as ol$source$OGCVectorTile,DZ as ol$source$OSM,v1 as ol$source$OSM$ATTRIBUTION,YZ as ol$source$Raster,s2 as ol$source$Raster$Processor,E1 as ol$source$Raster$RasterSourceEvent,n2 as ol$source$Raster$newImageData,Al as ol$source$Source,HZ as ol$source$Stamen,Ge as ol$source$State,Jc as ol$source$Tile,s_ as ol$source$Tile$TileSourceEvent,qZ as ol$source$TileArcGISRest,QZ as ol$source$TileDebug,Sa as ol$source$TileEventType,$r as ol$source$TileImage,tH as ol$source$TileJSON,nH as ol$source$TileWMS,sH as ol$source$UTFGrid,u2 as ol$source$UTFGrid$CustomTile,o_ as ol$source$UrlTile,ca as ol$source$Vector,ts as ol$source$Vector$VectorSourceEvent,si as ol$source$VectorEventType,a_ as ol$source$VectorTile,pb as ol$source$VectorTile$defaultLoadFunction,Ts as ol$source$WMSServerType,lH as ol$source$WMTS,uH as ol$source$WMTS$optionsFromCapabilities,ws as ol$source$WMTSRequestEncoding,Dh as ol$source$XYZ,pZ as ol$source$Zoomify,y1 as ol$source$Zoomify$CustomTile,Es as ol$source$common$DEFAULT_WMS_VERSION,QL as ol$source$ogcTileUtil$getMapTileUrlTemplate,_1 as ol$source$ogcTileUtil$getTileSetInfo,e2 as ol$source$ogcTileUtil$getVectorTileUrlTemplate,cH as ol$source$sourcesFromTileGrid,Qu as ol$sphere$DEFAULT_RADIUS,dE as ol$sphere$getArea,Mf as ol$sphere$getDistance,fE as ol$sphere$getLength,pE as ol$sphere$offset,bm as ol$string$compareVersions,Bs as ol$string$padNumber,Rd as ol$structs$LRUCache,fH as ol$structs$LinkedList,oT as ol$structs$PriorityQueue,yc as ol$structs$PriorityQueue$DROP,Fc as ol$structs$RBush,$0 as ol$style$Circle,xr as ol$style$Fill,_d as ol$style$Icon,Bi as ol$style$IconAnchorUnits,yM as ol$style$IconImage,cw as ol$style$IconImage$get,$A as ol$style$IconImageCache,uc as ol$style$IconImageCache$shared,ri as ol$style$IconOrigin,N0 as ol$style$Image,HT as ol$style$RegularShape,ir as ol$style$Stroke,Er as ol$style$Style,qT as ol$style$Style$createDefaultStyle,Il as ol$style$Style$createEditingStyle,KT as ol$style$Style$toFunction,Pc as ol$style$Text,z0 as ol$style$TextPlacement,$e as ol$style$expressions$Operators,Wv as ol$style$expressions$PALETTE_TEXTURE_ARRAY,ne as ol$style$expressions$ValueTypes,Yv as ol$style$expressions$arrayToGlsl,aL as ol$style$expressions$colorToGlsl,ae as ol$style$expressions$expressionToGlsl,Nh as ol$style$expressions$getStringNumberEquivalent,or as ol$style$expressions$getValueType,oL as ol$style$expressions$isTypeUnique,Fh as ol$style$expressions$numberToGlsl,lL as ol$style$expressions$stringToGlsl,ag as ol$style$expressions$uniformNameForVariable,dH as ol$style$literal$SymbolType,Fl as ol$tilecoord$createOrUpdate,J0 as ol$tilecoord$fromKey,Cw as ol$tilecoord$getCacheKeyForTileKey,Nl as ol$tilecoord$getKey,Tr as ol$tilecoord$getKeyZXY,bd as ol$tilecoord$hash,Lw as ol$tilecoord$withinExtentAndZ,oo as ol$tilegrid$TileGrid,oH as ol$tilegrid$WMTS,h2 as ol$tilegrid$WMTS$createFromCapabilitiesMatrixSet,lT as ol$tilegrid$common$DEFAULT_MAX_ZOOM,aa as ol$tilegrid$common$DEFAULT_TILE_SIZE,cb as ol$tilegrid$createForExtent,r_ as ol$tilegrid$createForProjection,Ra as ol$tilegrid$createXYZ,ls as ol$tilegrid$extentFromProjection,n_ as ol$tilegrid$getForProjection,ub as ol$tilegrid$wrapX,fb as ol$tileurlfunction$createFromTemplate,up as ol$tileurlfunction$createFromTemplates,Hl as ol$tileurlfunction$createFromTileUrlFunctions,cp as ol$tileurlfunction$expandUrl,db as ol$tileurlfunction$nullTileUrlFunction,rt as ol$transform$apply,Ti as ol$transform$compose,nA as ol$transform$composeCssTransform,xt as ol$transform$create,jx as ol$transform$determinant,rA as ol$transform$invert,Bo as ol$transform$makeInverse,zx as ol$transform$makeScale,zo as ol$transform$multiply,il as ol$transform$reset,Ux as ol$transform$rotate,rl as ol$transform$scale,nl as ol$transform$set,Gx as ol$transform$setFromArray,Xu as ol$transform$toString,Bx as ol$transform$translate,Ur as ol$uri$appendParams,yf as ol$util$VERSION,fe as ol$util$abstract,oe as ol$util$getUid,Xy as ol$vec$mat4$create,qc as ol$vec$mat4$fromTransform,Vl as ol$webgl$ARRAY_BUFFER,Wl as ol$webgl$Buffer,ZR as ol$webgl$Buffer$BufferUsage,rp as ol$webgl$Buffer$getArrayClassForType,Kc as ol$webgl$ContextEventType,Hc as ol$webgl$DYNAMIC_DRAW,Zc as ol$webgl$ELEMENT_ARRAY_BUFFER,By as ol$webgl$FLOAT,QR as ol$webgl$Helper,Sn as ol$webgl$Helper$AttributeType,Ta as ol$webgl$Helper$DefaultUniform,WU as ol$webgl$Helper$ShaderType,qR as ol$webgl$Helper$computeAttributesStride,eL as ol$webgl$PaletteTexture,Yy as ol$webgl$PostProcessingPass,ib as ol$webgl$RenderTarget,ip as ol$webgl$STATIC_DRAW,jR as ol$webgl$STREAM_DRAW,pL as ol$webgl$ShaderBuilder$ShaderBuilder,gL as ol$webgl$ShaderBuilder$parseLiteralStyle,nL as ol$webgl$TileTexture,YR as ol$webgl$UNSIGNED_BYTE,VR as ol$webgl$UNSIGNED_INT,XR as ol$webgl$UNSIGNED_SHORT,np as ol$webgl$getContext,BU as ol$webgl$getSupportedExtensions,gi as ol$xml$OBJECT_PROPERTY_NODE_FACTORY,to as ol$xml$XML_SCHEMA_INSTANCE_URI,Ee as ol$xml$createElementNS,ji as ol$xml$getAllTextContent,ty as ol$xml$getAllTextContent_,Fw as ol$xml$getAttributeNS,pa as ol$xml$getDocument,Nw as ol$xml$getXMLSerializer,nr as ol$xml$isDocument,iy as ol$xml$makeArrayExtender,he as ol$xml$makeArrayPusher,ny as ol$xml$makeArraySerializer,N as ol$xml$makeChildAppender,_t as ol$xml$makeObjectPropertyPusher,F as ol$xml$makeObjectPropertySetter,me as ol$xml$makeReplacer,qi as ol$xml$makeSequence,Ot as ol$xml$makeSimpleNodeFactory,Y as ol$xml$makeStructureNS,rr as ol$xml$parse,Ji as ol$xml$parseNode,W as ol$xml$pushParseAndPop,Te as ol$xml$pushSerializeAndPop,LF as ol$xml$registerDocument,CF as ol$xml$registerXMLSerializer,ry as ol$xml$serialize};
|