mapbox-gl 1.13.2
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/.flowconfig +61 -0
- package/CHANGELOG.md +2485 -0
- package/LICENSE.txt +84 -0
- package/README.md +34 -0
- package/build/banner.js +4 -0
- package/build/check-bundle-size.js +140 -0
- package/build/diff-tarball.js +18 -0
- package/build/generate-access-token-script.js +11 -0
- package/build/generate-flow-typed-style-spec.js +188 -0
- package/build/generate-release-list.js +21 -0
- package/build/generate-struct-arrays.js +243 -0
- package/build/generate-style-code.js +159 -0
- package/build/mapbox-gl.js.flow +3 -0
- package/build/print-release-url.js +6 -0
- package/build/rollup_plugin_minify_style_spec.js +24 -0
- package/build/rollup_plugins.js +80 -0
- package/build/run-node +3 -0
- package/build/run-tap +8 -0
- package/build/test/build-tape.js +19 -0
- package/dist/mapbox-gl-csp-worker.js +2 -0
- package/dist/mapbox-gl-csp-worker.js.map +1 -0
- package/dist/mapbox-gl-csp.js +2 -0
- package/dist/mapbox-gl-csp.js.map +1 -0
- package/dist/mapbox-gl-dev.js +65889 -0
- package/dist/mapbox-gl-dev.js.flow +3 -0
- package/dist/mapbox-gl-unminified.js +42889 -0
- package/dist/mapbox-gl-unminified.js.map +1 -0
- package/dist/mapbox-gl.css +1 -0
- package/dist/mapbox-gl.js +42 -0
- package/dist/mapbox-gl.js.flow +3 -0
- package/dist/mapbox-gl.js.map +1 -0
- package/dist/style-spec/index.es.js +15032 -0
- package/dist/style-spec/index.es.js.map +1 -0
- package/dist/style-spec/index.js +15058 -0
- package/dist/style-spec/index.js.map +1 -0
- package/flow-typed/gl.js +5 -0
- package/flow-typed/jsdom.js +18 -0
- package/flow-typed/mapbox-gl-supported.js +9 -0
- package/flow-typed/mapbox-unitbezier.js +14 -0
- package/flow-typed/offscreen-canvas.js +9 -0
- package/flow-typed/pbf.js +25 -0
- package/flow-typed/point-geometry.js +44 -0
- package/flow-typed/potpack.js +12 -0
- package/flow-typed/sinon.js +28 -0
- package/flow-typed/vector-tile.js +41 -0
- package/package.json +173 -0
- package/src/css/mapbox-gl.css +812 -0
- package/src/css/svg/mapboxgl-ctrl-attrib.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-compass.svg +4 -0
- package/src/css/svg/mapboxgl-ctrl-fullscreen.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-geolocate.svg +5 -0
- package/src/css/svg/mapboxgl-ctrl-logo.svg +20 -0
- package/src/css/svg/mapboxgl-ctrl-shrink.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-zoom-in.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-zoom-out.svg +3 -0
- package/src/data/array_types.js +1135 -0
- package/src/data/bucket/circle_attributes.js +9 -0
- package/src/data/bucket/circle_bucket.js +201 -0
- package/src/data/bucket/fill_attributes.js +9 -0
- package/src/data/bucket/fill_bucket.js +229 -0
- package/src/data/bucket/fill_extrusion_attributes.js +10 -0
- package/src/data/bucket/fill_extrusion_bucket.js +283 -0
- package/src/data/bucket/heatmap_bucket.js +17 -0
- package/src/data/bucket/line_attributes.js +10 -0
- package/src/data/bucket/line_attributes_ext.js +10 -0
- package/src/data/bucket/line_bucket.js +594 -0
- package/src/data/bucket/pattern_attributes.js +12 -0
- package/src/data/bucket/pattern_bucket_features.js +60 -0
- package/src/data/bucket/symbol_attributes.js +117 -0
- package/src/data/bucket/symbol_bucket.js +937 -0
- package/src/data/bucket.js +123 -0
- package/src/data/dem_data.js +125 -0
- package/src/data/evaluation_feature.js +25 -0
- package/src/data/extent.js +18 -0
- package/src/data/feature_index.js +322 -0
- package/src/data/feature_position_map.js +131 -0
- package/src/data/index_array_type.js +16 -0
- package/src/data/load_geometry.js +46 -0
- package/src/data/pos_attributes.js +6 -0
- package/src/data/program_configuration.js +708 -0
- package/src/data/raster_bounds_attributes.js +7 -0
- package/src/data/segment.js +76 -0
- package/src/geo/edge_insets.js +102 -0
- package/src/geo/lng_lat.js +168 -0
- package/src/geo/lng_lat_bounds.js +276 -0
- package/src/geo/mercator_coordinate.js +150 -0
- package/src/geo/transform.js +834 -0
- package/src/gl/color_mode.js +34 -0
- package/src/gl/context.js +302 -0
- package/src/gl/cull_face_mode.js +26 -0
- package/src/gl/depth_mode.js +29 -0
- package/src/gl/framebuffer.js +44 -0
- package/src/gl/index_buffer.js +55 -0
- package/src/gl/stencil_mode.js +30 -0
- package/src/gl/types.js +84 -0
- package/src/gl/value.js +520 -0
- package/src/gl/vertex_buffer.js +119 -0
- package/src/index.js +230 -0
- package/src/render/draw_background.js +57 -0
- package/src/render/draw_circle.js +113 -0
- package/src/render/draw_collision_debug.js +172 -0
- package/src/render/draw_custom.js +49 -0
- package/src/render/draw_debug.js +127 -0
- package/src/render/draw_fill.js +124 -0
- package/src/render/draw_fill_extrusion.js +95 -0
- package/src/render/draw_heatmap.js +133 -0
- package/src/render/draw_hillshade.js +107 -0
- package/src/render/draw_line.js +125 -0
- package/src/render/draw_raster.js +125 -0
- package/src/render/draw_symbol.js +392 -0
- package/src/render/glyph_atlas.js +71 -0
- package/src/render/glyph_manager.js +182 -0
- package/src/render/image_atlas.js +149 -0
- package/src/render/image_manager.js +306 -0
- package/src/render/line_atlas.js +210 -0
- package/src/render/painter.js +654 -0
- package/src/render/program/background_program.js +103 -0
- package/src/render/program/circle_program.js +69 -0
- package/src/render/program/clipping_mask_program.js +20 -0
- package/src/render/program/collision_program.js +76 -0
- package/src/render/program/debug_program.js +35 -0
- package/src/render/program/fill_extrusion_program.js +122 -0
- package/src/render/program/fill_program.js +126 -0
- package/src/render/program/heatmap_program.js +83 -0
- package/src/render/program/hillshade_program.js +119 -0
- package/src/render/program/line_program.js +211 -0
- package/src/render/program/pattern.js +102 -0
- package/src/render/program/program_uniforms.js +42 -0
- package/src/render/program/raster_program.js +92 -0
- package/src/render/program/symbol_program.js +224 -0
- package/src/render/program.js +188 -0
- package/src/render/texture.js +122 -0
- package/src/render/uniform_binding.js +147 -0
- package/src/render/vertex_array_object.js +163 -0
- package/src/shaders/README.md +42 -0
- package/src/shaders/_prelude.fragment.glsl +17 -0
- package/src/shaders/_prelude.vertex.glsl +73 -0
- package/src/shaders/background.fragment.glsl +10 -0
- package/src/shaders/background.vertex.glsl +7 -0
- package/src/shaders/background_pattern.fragment.glsl +28 -0
- package/src/shaders/background_pattern.vertex.glsl +20 -0
- package/src/shaders/circle.fragment.glsl +39 -0
- package/src/shaders/circle.vertex.glsl +64 -0
- package/src/shaders/clipping_mask.fragment.glsl +3 -0
- package/src/shaders/clipping_mask.vertex.glsl +7 -0
- package/src/shaders/collision_box.fragment.glsl +21 -0
- package/src/shaders/collision_box.vertex.glsl +27 -0
- package/src/shaders/collision_circle.fragment.glsl +17 -0
- package/src/shaders/collision_circle.vertex.glsl +59 -0
- package/src/shaders/debug.fragment.glsl +9 -0
- package/src/shaders/debug.vertex.glsl +12 -0
- package/src/shaders/encode_attribute.js +17 -0
- package/src/shaders/fill.fragment.glsl +13 -0
- package/src/shaders/fill.vertex.glsl +13 -0
- package/src/shaders/fill_extrusion.fragment.glsl +9 -0
- package/src/shaders/fill_extrusion.vertex.glsl +66 -0
- package/src/shaders/fill_extrusion_pattern.fragment.glsl +45 -0
- package/src/shaders/fill_extrusion_pattern.vertex.glsl +79 -0
- package/src/shaders/fill_outline.fragment.glsl +17 -0
- package/src/shaders/fill_outline.vertex.glsl +17 -0
- package/src/shaders/fill_outline_pattern.fragment.glsl +43 -0
- package/src/shaders/fill_outline_pattern.vertex.glsl +44 -0
- package/src/shaders/fill_pattern.fragment.glsl +36 -0
- package/src/shaders/fill_pattern.vertex.glsl +39 -0
- package/src/shaders/heatmap.fragment.glsl +22 -0
- package/src/shaders/heatmap.vertex.glsl +54 -0
- package/src/shaders/heatmap_texture.fragment.glsl +14 -0
- package/src/shaders/heatmap_texture.vertex.glsl +11 -0
- package/src/shaders/hillshade.fragment.glsl +52 -0
- package/src/shaders/hillshade.vertex.glsl +11 -0
- package/src/shaders/hillshade_prepare.fragment.glsl +75 -0
- package/src/shaders/hillshade_prepare.vertex.glsl +15 -0
- package/src/shaders/index.js +20 -0
- package/src/shaders/line.fragment.glsl +30 -0
- package/src/shaders/line.vertex.glsl +85 -0
- package/src/shaders/line_gradient.fragment.glsl +34 -0
- package/src/shaders/line_gradient.vertex.glsl +88 -0
- package/src/shaders/line_pattern.fragment.glsl +74 -0
- package/src/shaders/line_pattern.vertex.glsl +99 -0
- package/src/shaders/line_sdf.fragment.glsl +45 -0
- package/src/shaders/line_sdf.vertex.glsl +98 -0
- package/src/shaders/raster.fragment.glsl +52 -0
- package/src/shaders/raster.vertex.glsl +21 -0
- package/src/shaders/shaders.js +185 -0
- package/src/shaders/symbol_icon.fragment.glsl +17 -0
- package/src/shaders/symbol_icon.vertex.glsl +94 -0
- package/src/shaders/symbol_sdf.fragment.glsl +52 -0
- package/src/shaders/symbol_sdf.vertex.glsl +115 -0
- package/src/shaders/symbol_text_and_icon.fragment.glsl +68 -0
- package/src/shaders/symbol_text_and_icon.vertex.glsl +116 -0
- package/src/source/canvas_source.js +238 -0
- package/src/source/geojson_source.js +370 -0
- package/src/source/geojson_worker_source.js +366 -0
- package/src/source/geojson_wrapper.js +94 -0
- package/src/source/image_source.js +307 -0
- package/src/source/load_tilejson.js +39 -0
- package/src/source/pixels_to_tile_units.js +21 -0
- package/src/source/query_features.js +208 -0
- package/src/source/raster_dem_tile_source.js +138 -0
- package/src/source/raster_dem_tile_worker_source.js +62 -0
- package/src/source/raster_tile_source.js +169 -0
- package/src/source/rtl_text_plugin.js +143 -0
- package/src/source/source.js +137 -0
- package/src/source/source_cache.js +953 -0
- package/src/source/source_state.js +159 -0
- package/src/source/tile.js +458 -0
- package/src/source/tile_bounds.js +38 -0
- package/src/source/tile_cache.js +212 -0
- package/src/source/tile_id.js +199 -0
- package/src/source/vector_tile_source.js +259 -0
- package/src/source/vector_tile_worker_source.js +216 -0
- package/src/source/video_source.js +203 -0
- package/src/source/worker.js +240 -0
- package/src/source/worker_source.js +107 -0
- package/src/source/worker_tile.js +224 -0
- package/src/style/create_style_layer.js +36 -0
- package/src/style/evaluation_parameters.js +62 -0
- package/src/style/format_section_override.js +56 -0
- package/src/style/light.js +130 -0
- package/src/style/load_glyph_range.js +38 -0
- package/src/style/load_sprite.js +67 -0
- package/src/style/parse_glyph_pbf.js +44 -0
- package/src/style/pauseable_placement.js +132 -0
- package/src/style/properties.js +753 -0
- package/src/style/query_utils.js +43 -0
- package/src/style/style.js +1374 -0
- package/src/style/style_glyph.js +17 -0
- package/src/style/style_image.js +137 -0
- package/src/style/style_layer/background_style_layer.js +21 -0
- package/src/style/style_layer/background_style_layer_properties.js +40 -0
- package/src/style/style_layer/circle_style_layer.js +98 -0
- package/src/style/style_layer/circle_style_layer_properties.js +63 -0
- package/src/style/style_layer/custom_style_layer.js +223 -0
- package/src/style/style_layer/fill_extrusion_style_layer.js +224 -0
- package/src/style/style_layer/fill_extrusion_style_layer_properties.js +50 -0
- package/src/style/style_layer/fill_style_layer.js +67 -0
- package/src/style/style_layer/fill_style_layer_properties.js +55 -0
- package/src/style/style_layer/heatmap_style_layer.js +73 -0
- package/src/style/style_layer/heatmap_style_layer_properties.js +44 -0
- package/src/style/style_layer/hillshade_style_layer.js +25 -0
- package/src/style/style_layer/hillshade_style_layer_properties.js +46 -0
- package/src/style/style_layer/layer_properties.js.ejs +69 -0
- package/src/style/style_layer/line_style_layer.js +150 -0
- package/src/style/style_layer/line_style_layer_properties.js +71 -0
- package/src/style/style_layer/raster_style_layer.js +21 -0
- package/src/style/style_layer/raster_style_layer_properties.js +50 -0
- package/src/style/style_layer/symbol_style_layer.js +190 -0
- package/src/style/style_layer/symbol_style_layer_properties.js +153 -0
- package/src/style/style_layer/typed_style_layer.js +17 -0
- package/src/style/style_layer.js +283 -0
- package/src/style/style_layer_index.js +80 -0
- package/src/style/validate_style.js +42 -0
- package/src/style/zoom_history.js +44 -0
- package/src/style-spec/.eslintrc +5 -0
- package/src/style-spec/CHANGELOG.md +468 -0
- package/src/style-spec/README.md +59 -0
- package/src/style-spec/bin/gl-style-composite +9 -0
- package/src/style-spec/bin/gl-style-format +22 -0
- package/src/style-spec/bin/gl-style-migrate +9 -0
- package/src/style-spec/bin/gl-style-validate +50 -0
- package/src/style-spec/composite.js +50 -0
- package/src/style-spec/declass.js +42 -0
- package/src/style-spec/deref.js +52 -0
- package/src/style-spec/diff.js +393 -0
- package/src/style-spec/dist/.gitkeep +0 -0
- package/src/style-spec/dist/index.es.js +15032 -0
- package/src/style-spec/dist/index.es.js.map +1 -0
- package/src/style-spec/dist/index.js +15058 -0
- package/src/style-spec/dist/index.js.map +1 -0
- package/src/style-spec/empty.js +29 -0
- package/src/style-spec/error/parsing_error.js +16 -0
- package/src/style-spec/error/validation_error.js +18 -0
- package/src/style-spec/expression/compound_expression.js +162 -0
- package/src/style-spec/expression/definitions/assertion.js +130 -0
- package/src/style-spec/expression/definitions/at.js +70 -0
- package/src/style-spec/expression/definitions/case.js +85 -0
- package/src/style-spec/expression/definitions/coalesce.js +93 -0
- package/src/style-spec/expression/definitions/coercion.js +133 -0
- package/src/style-spec/expression/definitions/collator.js +78 -0
- package/src/style-spec/expression/definitions/comparison.js +184 -0
- package/src/style-spec/expression/definitions/format.js +144 -0
- package/src/style-spec/expression/definitions/image.js +52 -0
- package/src/style-spec/expression/definitions/in.js +72 -0
- package/src/style-spec/expression/definitions/index.js +565 -0
- package/src/style-spec/expression/definitions/index_of.js +89 -0
- package/src/style-spec/expression/definitions/interpolate.js +267 -0
- package/src/style-spec/expression/definitions/length.js +61 -0
- package/src/style-spec/expression/definitions/let.js +72 -0
- package/src/style-spec/expression/definitions/literal.js +77 -0
- package/src/style-spec/expression/definitions/match.js +158 -0
- package/src/style-spec/expression/definitions/number_format.js +142 -0
- package/src/style-spec/expression/definitions/slice.js +86 -0
- package/src/style-spec/expression/definitions/step.js +120 -0
- package/src/style-spec/expression/definitions/var.js +46 -0
- package/src/style-spec/expression/definitions/within.js +342 -0
- package/src/style-spec/expression/evaluation_context.js +59 -0
- package/src/style-spec/expression/expression.js +27 -0
- package/src/style-spec/expression/index.js +392 -0
- package/src/style-spec/expression/is_constant.js +59 -0
- package/src/style-spec/expression/parsing_context.js +233 -0
- package/src/style-spec/expression/parsing_error.js +13 -0
- package/src/style-spec/expression/runtime_error.js +17 -0
- package/src/style-spec/expression/scope.js +36 -0
- package/src/style-spec/expression/stops.js +39 -0
- package/src/style-spec/expression/types/collator.js +61 -0
- package/src/style-spec/expression/types/formatted.js +73 -0
- package/src/style-spec/expression/types/resolved_image.js +29 -0
- package/src/style-spec/expression/types.js +126 -0
- package/src/style-spec/expression/values.js +123 -0
- package/src/style-spec/feature_filter/README.md +55 -0
- package/src/style-spec/feature_filter/convert.js +208 -0
- package/src/style-spec/feature_filter/index.js +175 -0
- package/src/style-spec/format.js +51 -0
- package/src/style-spec/function/convert.js +270 -0
- package/src/style-spec/function/index.js +262 -0
- package/src/style-spec/group_by_layout.js +75 -0
- package/src/style-spec/migrate/expressions.js +39 -0
- package/src/style-spec/migrate/v8.js +203 -0
- package/src/style-spec/migrate/v9.js +26 -0
- package/src/style-spec/migrate.js +36 -0
- package/src/style-spec/package.json +41 -0
- package/src/style-spec/read_style.js +14 -0
- package/src/style-spec/reference/latest.js +3 -0
- package/src/style-spec/reference/v8.json +5914 -0
- package/src/style-spec/rollup.config.js +65 -0
- package/src/style-spec/style-spec.js +124 -0
- package/src/style-spec/types.js +432 -0
- package/src/style-spec/util/color.js +95 -0
- package/src/style-spec/util/color_spaces.js +139 -0
- package/src/style-spec/util/deep_equal.js +28 -0
- package/src/style-spec/util/extend.js +10 -0
- package/src/style-spec/util/get_type.js +17 -0
- package/src/style-spec/util/interpolate.js +22 -0
- package/src/style-spec/util/properties.js +15 -0
- package/src/style-spec/util/ref_properties.js +2 -0
- package/src/style-spec/util/result.js +19 -0
- package/src/style-spec/util/unbundle_jsonlint.js +24 -0
- package/src/style-spec/validate/latest.js +11 -0
- package/src/style-spec/validate/validate.js +75 -0
- package/src/style-spec/validate/validate_array.js +52 -0
- package/src/style-spec/validate/validate_boolean.js +15 -0
- package/src/style-spec/validate/validate_color.js +20 -0
- package/src/style-spec/validate/validate_constants.js +13 -0
- package/src/style-spec/validate/validate_enum.js +21 -0
- package/src/style-spec/validate/validate_expression.js +43 -0
- package/src/style-spec/validate/validate_filter.js +117 -0
- package/src/style-spec/validate/validate_formatted.js +11 -0
- package/src/style-spec/validate/validate_function.js +207 -0
- package/src/style-spec/validate/validate_glyphs_url.js +21 -0
- package/src/style-spec/validate/validate_image.js +11 -0
- package/src/style-spec/validate/validate_layer.js +134 -0
- package/src/style-spec/validate/validate_layout_property.js +6 -0
- package/src/style-spec/validate/validate_light.js +47 -0
- package/src/style-spec/validate/validate_number.js +29 -0
- package/src/style-spec/validate/validate_object.js +61 -0
- package/src/style-spec/validate/validate_paint_property.js +6 -0
- package/src/style-spec/validate/validate_property.js +64 -0
- package/src/style-spec/validate/validate_source.js +111 -0
- package/src/style-spec/validate/validate_string.js +15 -0
- package/src/style-spec/validate_mapbox_api_supported.js +171 -0
- package/src/style-spec/validate_style.js +39 -0
- package/src/style-spec/validate_style.min.js +78 -0
- package/src/style-spec/visit.js +77 -0
- package/src/symbol/anchor.js +26 -0
- package/src/symbol/check_max_angle.js +81 -0
- package/src/symbol/clip_line.js +71 -0
- package/src/symbol/collision_feature.js +109 -0
- package/src/symbol/collision_index.js +373 -0
- package/src/symbol/cross_tile_symbol_index.js +301 -0
- package/src/symbol/get_anchors.js +167 -0
- package/src/symbol/grid_index.js +335 -0
- package/src/symbol/mergelines.js +82 -0
- package/src/symbol/one_em.js +4 -0
- package/src/symbol/opacity_state.js +27 -0
- package/src/symbol/path_interpolator.js +61 -0
- package/src/symbol/placement.js +1124 -0
- package/src/symbol/projection.js +451 -0
- package/src/symbol/quads.js +334 -0
- package/src/symbol/shaping.js +816 -0
- package/src/symbol/symbol_layout.js +796 -0
- package/src/symbol/symbol_size.js +113 -0
- package/src/symbol/transform_text.js +29 -0
- package/src/types/callback.js +17 -0
- package/src/types/cancelable.js +3 -0
- package/src/types/tilejson.js +17 -0
- package/src/types/transferable.js +3 -0
- package/src/types/window.js +172 -0
- package/src/ui/anchor.js +32 -0
- package/src/ui/camera.js +1277 -0
- package/src/ui/control/attribution_control.js +212 -0
- package/src/ui/control/fullscreen_control.js +147 -0
- package/src/ui/control/geolocate_control.js +707 -0
- package/src/ui/control/logo_control.js +92 -0
- package/src/ui/control/navigation_control.js +257 -0
- package/src/ui/control/scale_control.js +142 -0
- package/src/ui/default_locale.js +22 -0
- package/src/ui/events.js +1301 -0
- package/src/ui/handler/box_zoom.js +170 -0
- package/src/ui/handler/click_zoom.js +52 -0
- package/src/ui/handler/handler_util.js +12 -0
- package/src/ui/handler/keyboard.js +208 -0
- package/src/ui/handler/map_event.js +156 -0
- package/src/ui/handler/mouse.js +171 -0
- package/src/ui/handler/scroll_zoom.js +350 -0
- package/src/ui/handler/shim/dblclick_zoom.js +62 -0
- package/src/ui/handler/shim/drag_pan.js +88 -0
- package/src/ui/handler/shim/drag_rotate.js +67 -0
- package/src/ui/handler/shim/touch_zoom_rotate.js +108 -0
- package/src/ui/handler/tap_drag_zoom.js +103 -0
- package/src/ui/handler/tap_recognizer.js +133 -0
- package/src/ui/handler/tap_zoom.js +93 -0
- package/src/ui/handler/touch_pan.js +101 -0
- package/src/ui/handler/touch_zoom_rotate.js +305 -0
- package/src/ui/handler_inertia.js +158 -0
- package/src/ui/handler_manager.js +531 -0
- package/src/ui/hash.js +148 -0
- package/src/ui/map.js +2874 -0
- package/src/ui/marker.js +672 -0
- package/src/ui/popup.js +640 -0
- package/src/util/actor.js +212 -0
- package/src/util/ajax.js +388 -0
- package/src/util/browser/web_worker.js +10 -0
- package/src/util/browser/window.js +6 -0
- package/src/util/browser.js +70 -0
- package/src/util/classify_rings.js +52 -0
- package/src/util/color_ramp.js +61 -0
- package/src/util/config.js +30 -0
- package/src/util/debug.js +28 -0
- package/src/util/dictionary_coder.js +30 -0
- package/src/util/dispatcher.js +70 -0
- package/src/util/dom.js +142 -0
- package/src/util/evented.js +174 -0
- package/src/util/find_pole_of_inaccessibility.js +129 -0
- package/src/util/global_worker_pool.js +35 -0
- package/src/util/image.js +142 -0
- package/src/util/intersection_tests.js +208 -0
- package/src/util/is_char_in_unicode_block.js +311 -0
- package/src/util/mapbox.js +491 -0
- package/src/util/offscreen_canvas_supported.js +14 -0
- package/src/util/performance.js +112 -0
- package/src/util/primitives.js +145 -0
- package/src/util/resolve_tokens.js +16 -0
- package/src/util/script_detection.js +328 -0
- package/src/util/sku_token.js +42 -0
- package/src/util/smart_wrap.js +55 -0
- package/src/util/struct_array.js +243 -0
- package/src/util/struct_array.js.ejs +112 -0
- package/src/util/struct_array_layout.js.ejs +98 -0
- package/src/util/task_queue.js +68 -0
- package/src/util/throttle.js +27 -0
- package/src/util/throttled_invoker.js +46 -0
- package/src/util/tile_request_cache.js +172 -0
- package/src/util/util.js +524 -0
- package/src/util/vectortile_to_geojson.js +50 -0
- package/src/util/verticalize_punctuation.js +114 -0
- package/src/util/web_worker.js +91 -0
- package/src/util/web_worker_transfer.js +266 -0
- package/src/util/webp_supported.js +69 -0
- package/src/util/window.js +102 -0
- package/src/util/worker_pool.js +57 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).mapboxgl=e()}(this,(function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var e=t((function(t){function e(t){return!i(t)}function i(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,i=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(i);try{e=new Worker(r),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(r),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===r[i=t&&t.failIfMajorPerformanceCaveat]&&(r[i]=function(t){var i=function(t){var i=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",r)||i.probablySupportsContext("experimental-webgl",r):i.supportsContext?i.supportsContext("webgl",r)||i.supportsContext("experimental-webgl",r):i.getContext("webgl",r)||i.getContext("experimental-webgl",r)}(t);if(!i)return!1;var r=i.createShader(i.VERTEX_SHADER);return!(!r||i.isContextLost())&&(i.shaderSource(r,"void main() {}"),i.compileShader(r),!0===i.getShaderParameter(r,i.COMPILE_STATUS))}(i)),r[i]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var i}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=i);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),i=r;function r(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=i,this.p2y=r}r.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},r.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},r.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},r.prototype.solveCurveX=function(t,e){var i,r,n,o,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(o=this.sampleCurveX(n)-t,Math.abs(o)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=o/s}if((n=t)<(i=0))return i;if(n>(r=1))return r;for(;i<r;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;t>o?i=n:r=n,n=.5*(r-i)+i}return n},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var n=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),n=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{};function s(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!s(t[i],e[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var r in t)if(!s(t[r],e[r]))return!1;return!0}return t===e}var u=Math.pow(2,53)-1;function l(t,e,r,n){var o=new i(t,e,r,n);return function(t){return o.solve(t)}}var c=l(.25,.1,.25,1);function p(t,e,i){return Math.min(i,Math.max(e,t))}function h(t,e,i){var r=i-e,n=((t-e)%r+r)%r+e;return n===e?i:n}function f(t,e,i){if(!t.length)return i(null,[]);var r=t.length,n=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),n[a]=e,0==--r&&i(o,n)}))}))}function d(t){var e=[];for(var i in t)e.push(t[i]);return e}function m(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];for(var r=0,n=e;r<n.length;r+=1){var o=n[r];for(var a in o)t[a]=o[a]}return t}function y(t,e){for(var i={},r=0;r<e.length;r++){var n=e[r];n in t&&(i[n]=t[n])}return i}var _=1;function g(){return _++}function v(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function x(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function b(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function w(t,e){return-1!==t.indexOf(e,t.length-e.length)}function I(t,e,i){var r={};for(var n in t)r[n]=e.call(i||this,t[n],n,t);return r}function S(t,e,i){var r={};for(var n in t)e.call(i||this,t[n],n,t)&&(r[n]=t[n]);return r}function T(t){return Array.isArray(t)?t.map(T):"object"==typeof t&&t?I(t,T):t}var A={};function z(t){A[t]||("undefined"!=typeof console&&console.warn(t),A[t]=!0)}function E(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function k(t){for(var e=0,i=0,r=t.length,n=r-1,o=void 0,a=void 0;i<r;n=i++)e+=((a=t[n]).x-(o=t[i]).x)*(o.y+a.y);return e}function C(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function P(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,i,r,n){var o=r||n;return e[i]=!o||o.toLowerCase(),""})),e["max-age"]){var i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}var D=null;function M(t){if(null==D){var e=t.navigator?t.navigator.userAgent:null;D=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return D}function L(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var B,R,F=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),O=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,V=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,U={now:F,frame:function(t){var e=O(t);return{cancel:function(){return V(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var i=a.document.createElement("canvas"),r=i.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return i.width=t.width,i.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return B||(B=a.document.createElement("a")),B.href=t,B.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==R&&(R=a.matchMedia("(prefers-reduced-motion: reduce)")),R.matches)}},j={create:function(t,e,i){var r=a.document.createElement(t);return void 0!==e&&(r.className=e),i&&i.appendChild(r),r},createNS:function(t,e){return a.document.createElementNS(t,e)}},N=a.document&&a.document.documentElement.style;function q(t){if(!N)return t[0];for(var e=0;e<t.length;e++)if(t[e]in N)return t[e];return t[0]}var Z,G=q(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);j.disableDrag=function(){N&&G&&(Z=N[G],N[G]="none")},j.enableDrag=function(){N&&G&&(N[G]=Z)};var X=q(["transform","WebkitTransform"]);j.setTransform=function(t,e){t.style[X]=e};var W=!1;try{var H=Object.defineProperty({},"passive",{get:function(){W=!0}});a.addEventListener("test",H,H),a.removeEventListener("test",H,H)}catch(t){W=!1}j.addEventListener=function(t,e,i,r){void 0===r&&(r={}),t.addEventListener(e,i,"passive"in r&&W?r:r.capture)},j.removeEventListener=function(t,e,i,r){void 0===r&&(r={}),t.removeEventListener(e,i,"passive"in r&&W?r:r.capture)};var K=function(t){t.preventDefault(),t.stopPropagation(),a.removeEventListener("click",K,!0)};j.suppressClick=function(){a.addEventListener("click",K,!0),a.setTimeout((function(){a.removeEventListener("click",K,!0)}),0)},j.mousePos=function(t,e){var i=t.getBoundingClientRect();return new n(e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop)},j.touchPos=function(t,e){for(var i=t.getBoundingClientRect(),r=[],o=0;o<e.length;o++)r.push(new n(e[o].clientX-i.left-t.clientLeft,e[o].clientY-i.top-t.clientTop));return r},j.mouseButton=function(t){return void 0!==a.InstallTrigger&&2===t.button&&t.ctrlKey&&a.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button},j.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var Y,J,Q={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},$={supported:!1,testSupport:function(t){!tt&&J&&(et?it(t):Y=t)}},tt=!1,et=!1;function it(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,J),t.isContextLost())return;$.supported=!0}catch(t){}t.deleteTexture(e),tt=!0}a.document&&((J=a.document.createElement("img")).onload=function(){Y&&it(Y),Y=null,et=!0},J.onerror=function(){tt=!0,Y=null},J.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var rt="01",nt=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function ot(t){return 0===t.indexOf("mapbox:")}nt.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",rt,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},nt.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},nt.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},nt.prototype.normalizeStyleURL=function(t,e){if(!ot(t))return t;var i=lt(t);return i.path="/styles/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||e)},nt.prototype.normalizeGlyphsURL=function(t,e){if(!ot(t))return t;var i=lt(t);return i.path="/fonts/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||e)},nt.prototype.normalizeSourceURL=function(t,e){if(!ot(t))return t;var i=lt(t);return i.path="/v4/"+i.authority+".json",i.params.push("secure"),this._makeAPIURL(i,this._customAccessToken||e)},nt.prototype.normalizeSpriteURL=function(t,e,i,r){var n=lt(t);return ot(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+i,this._makeAPIURL(n,this._customAccessToken||r)):(n.path+=""+e+i,ct(n))},nt.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ot(t))return t;var i=lt(t);i.path=i.path.replace(/(\.(png|jpg)\d*)(?=$)/,(U.devicePixelRatio>=2||512===e?"@2x":"")+($.supported?".webp":"$1")),i.path=i.path.replace(/^.+\/v4\//,"/"),i.path="/v4"+i.path;var r=this._customAccessToken||function(t){for(var e=0,i=t;e<i.length;e+=1){var r=i[e].match(/^access_token=(.*)$/);if(r)return r[1]}return null}(i.params)||Q.ACCESS_TOKEN;return Q.REQUIRE_ACCESS_TOKEN&&r&&this._skuToken&&i.params.push("sku="+this._skuToken),this._makeAPIURL(i,r)},nt.prototype.canonicalizeTileURL=function(t,e){var i=lt(t);if(!i.path.match(/(^\/v4\/)/)||!i.path.match(/\.[\w]+$/))return t;var r="mapbox://tiles/";r+=i.path.replace("/v4/","");var n=i.params;return e&&(n=n.filter((function(t){return!t.match(/^access_token=/)}))),n.length&&(r+="?"+n.join("&")),r},nt.prototype.canonicalizeTileset=function(t,e){for(var i=!!e&&ot(e),r=[],n=0,o=t.tiles||[];n<o.length;n+=1){var a=o[n];st(a)?r.push(this.canonicalizeTileURL(a,i)):r.push(a)}return r},nt.prototype._makeAPIURL=function(t,e){var i="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",r=lt(Q.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){var n=t.params.indexOf("secure");n>=0&&t.params.splice(n,1)}if("/"!==r.path&&(t.path=""+r.path+t.path),!Q.REQUIRE_ACCESS_TOKEN)return ct(t);if(!(e=e||Q.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+i);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+i);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),ct(t)};var at=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function st(t){return at.test(t)}var ut=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function lt(t){var e=t.match(ut);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function ct(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function pt(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var ht=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ht.prototype.getStorageKey=function(t){var e,i=pt(Q.ACCESS_TOKEN);return e=i&&i.u?a.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):Q.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},ht.prototype.fetchEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{var r=a.localStorage.getItem(e);r&&(this.eventData=JSON.parse(r));var n=a.localStorage.getItem(i);n&&(this.anonId=n)}catch(t){z("Unable to read from LocalStorage")}},ht.prototype.saveEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(i,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){z("Unable to write to LocalStorage")}},ht.prototype.processRequests=function(t){},ht.prototype.postEvent=function(t,e,i,r){var n=this;if(Q.EVENTS_URL){var o=lt(Q.EVENTS_URL);o.params.push("access_token="+(r||Q.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.2",skuId:rt,userId:this.anonId},s=e?m(a,e):a,u={url:ct(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=Rt(u,(function(t){n.pendingRequest=null,i(t),n.saveEventData(),n.processRequests(r)}))}},ht.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var ft,dt,mt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,i,r){this.skuToken=i,(Q.EVENTS_URL&&r||Q.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return ot(t)||st(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},r)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var i=this.queue.shift(),r=i.id,n=i.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),x(this.anonId)||(this.anonId=v()),this.postEvent(n,{skuToken:this.skuToken},(function(t){t||r&&(e.success[r]=!0)}),t))}},e}(ht),yt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){Q.EVENTS_URL&&Q.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return ot(t)||st(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var i=pt(Q.ACCESS_TOKEN),r=i?i.u:Q.ACCESS_TOKEN,n=r!==this.eventData.tokenU;x(this.anonId)||(this.anonId=v(),n=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;n=n||u>=1||u<-1||a.getDate()!==s.getDate()}else n=!0;if(!n)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=r)}),t)}},e}(ht)),_t=yt.postTurnstileEvent.bind(yt),gt=new mt,vt=gt.postMapLoadEvent.bind(gt),xt=500,bt=50;function wt(){a.caches&&!ft&&(ft=a.caches.open("mapbox-tiles"))}function It(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var St,Tt=1/0;function At(t){++Tt>bt&&(t.getActor().send("enforceCacheSizeLimit",xt),Tt=0)}function zt(){return null==St&&(St=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),St}var Et={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(Et);var kt=function(t){function e(e,i,r){401===i&&st(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=i,this.url=r,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),Ct=C()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href};var Pt,Dt,Mt=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(Ct())&&!/^\w+:/.test(i))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var i,r=new a.AbortController,n=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Ct(),signal:r.signal}),o=!1,s=!1,u=(i=n.url).indexOf("sku=")>0&&st(i);"json"===t.type&&n.headers.set("Accept","application/json");var l=function(i,r,o){if(!s){if(i&&"SecurityError"!==i.message&&z(i),r&&o)return c(r);var l=Date.now();a.fetch(n).then((function(i){if(i.ok){var r=u?i.clone():null;return c(i,r,l)}return e(new kt(i.statusText,i.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(i,r,u){("arrayBuffer"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text()).then((function(t){s||(r&&u&&function(t,e,i){if(wt(),ft){var r={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return r.headers.set(e,t)}));var n=P(e.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&r.headers.set("Expires",new Date(i+1e3*n["max-age"]).toUTCString()),new Date(r.headers.get("Expires")).getTime()-i<42e4||function(t,e){if(void 0===dt)try{new Response(new ReadableStream),dt=!0}catch(t){dt=!1}dt?e(t.body):t.blob().then(e)}(e,(function(e){var i=new a.Response(e,r);wt(),ft&&ft.then((function(e){return e.put(It(t.url),i)})).catch((function(t){return z(t.message)}))})))}}(n,r,u),o=!0,e(null,t,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(wt(),!ft)return e(null);var i=It(t.url);ft.then((function(t){t.match(i).then((function(r){var n=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),i=P(t.headers.get("Cache-Control")||"");return e>Date.now()&&!i["no-cache"]}(r);t.delete(i),n&&t.put(i,r.clone()),e(null,r,n)})).catch(e)})).catch(e)}(n,l):l(null,null),{cancel:function(){s=!0,o||r.abort()}}}(t,e);if(C()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(t,e){var i=new a.XMLHttpRequest;for(var r in i.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(i.responseType="arraybuffer"),t.headers)i.setRequestHeader(r,t.headers[r]);return"json"===t.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===t.credentials,i.onerror=function(){e(new Error(i.statusText))},i.onload=function(){if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){var r=i.response;if("json"===t.type)try{r=JSON.parse(i.response)}catch(t){return e(t)}e(null,r,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else e(new kt(i.statusText,i.status,t.url))},i.send(t.body),{cancel:function(){return i.abort()}}}(t,e)},Lt=function(t,e){return Mt(m(t,{type:"json"}),e)},Bt=function(t,e){return Mt(m(t,{type:"arrayBuffer"}),e)},Rt=function(t,e){return Mt(m(t,{method:"POST"}),e)},Ft="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Pt=[],Dt=0;var Ot=function(t,e){if($.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Dt>=Q.MAX_PARALLEL_IMAGE_REQUESTS){var i={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Pt.push(i),i}Dt++;var r=!1,n=function(){if(!r)for(r=!0,Dt--;Pt.length&&Dt<Q.MAX_PARALLEL_IMAGE_REQUESTS;){var t=Pt.shift();t.cancelled||(t.cancel=Ot(t.requestParameters,t.callback).cancel)}},o=Bt(t,(function(t,i,r,o){n(),t?e(t):i&&(zt()?function(t,e){var i=new a.Blob([new Uint8Array(t)],{type:"image/png"});a.createImageBitmap(i).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(i,e):function(t,e,i,r){var n=new a.Image,o=a.URL;n.onload=function(){e(null,n),o.revokeObjectURL(n.src),n.onload=null,a.requestAnimationFrame((function(){n.src=Ft}))},n.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var s=new a.Blob([new Uint8Array(t)],{type:"image/png"});n.cacheControl=i,n.expires=r,n.src=t.byteLength?o.createObjectURL(s):Ft}(i,e,r,o))}));return{cancel:function(){o.cancel(),n()}}};function Vt(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function Ut(t,e,i){if(i&&i[t]){var r=i[t].indexOf(e);-1!==r&&i[t].splice(r,1)}}var jt=function(t,e){void 0===e&&(e={}),m(this,e),this.type=t},Nt=function(t){function e(e,i){void 0===i&&(i={}),t.call(this,"error",m({error:e},i))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(jt),qt=function(){};qt.prototype.on=function(t,e){return this._listeners=this._listeners||{},Vt(t,e,this._listeners),this},qt.prototype.off=function(t,e){return Ut(t,e,this._listeners),Ut(t,e,this._oneTimeListeners),this},qt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Vt(t,e,this._oneTimeListeners),this},qt.prototype.fire=function(t,e){"string"==typeof t&&(t=new jt(t,e||{}));var i=t.type;if(this.listens(i)){t.target=this;for(var r=0,n=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];r<n.length;r+=1)n[r].call(this,t);for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];o<a.length;o+=1){var s=a[o];Ut(i,s,this._oneTimeListeners),s.call(this,t)}var u=this._eventedParent;u&&(m(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(t))}else t instanceof Nt&&console.error(t.error);return this},qt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},qt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Zt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],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",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!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"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!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",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],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",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],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",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!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",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!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"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],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,requires:["icon-image"],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",requires:["icon-image"],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",requires:["icon-image"],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",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],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,requires:["text-field"],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",requires:["text-field"],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",requires:["text-field"],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",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Gt=function(t,e,i,r){this.message=(t?t+": ":"")+i,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function Xt(t){var e=t.value;return e?[new Gt(t.key,e,"constants have been deprecated as of v8")]:[]}function Wt(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];for(var r=0,n=e;r<n.length;r+=1){var o=n[r];for(var a in o)t[a]=o[a]}return t}function Ht(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Kt(t){if(Array.isArray(t))return t.map(Kt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var i in t)e[i]=Kt(t[i]);return e}return Ht(t)}var Yt=function(t){function e(e,i){t.call(this,i),this.message=i,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Jt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var i=0,r=e;i<r.length;i+=1){var n=r[i];this.bindings[n[0]]=n[1]}};Jt.prototype.concat=function(t){return new Jt(this,t)},Jt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Jt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Qt={kind:"null"},$t={kind:"number"},te={kind:"string"},ee={kind:"boolean"},ie={kind:"color"},re={kind:"object"},ne={kind:"value"},oe={kind:"collator"},ae={kind:"formatted"},se={kind:"resolvedImage"};function ue(t,e){return{kind:"array",itemType:t,N:e}}function le(t){if("array"===t.kind){var e=le(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var ce=[Qt,$t,te,ee,ie,ae,re,ue(ne),se];function pe(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!pe(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var i=0,r=ce;i<r.length;i+=1)if(!pe(r[i],e))return null}return"Expected "+le(t)+" but found "+le(e)+" instead."}function he(t,e){return e.some((function(e){return e.kind===t.kind}))}function fe(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var de=t((function(t,e){var i={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 r(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return r("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in i)return i[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var c=s.substr(0,u),p=s.substr(u+1,l-(u+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=o(p.pop());case"rgb":return 3!==p.length?null:[n(p[0]),n(p[1]),n(p[2]),h];case"hsla":if(4!==p.length)return null;h=o(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=o(p[1]),m=o(p[2]),y=m<=.5?m*(d+1):m+d-m*d,_=2*m-y;return[r(255*a(_,y,f+1/3)),r(255*a(_,y,f)),r(255*a(_,y,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,me=function(t,e,i,r){void 0===r&&(r=1),this.r=t,this.g=e,this.b=i,this.a=r};me.parse=function(t){if(t){if(t instanceof me)return t;if("string"==typeof t){var e=de(t);if(e)return new me(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},me.prototype.toString=function(){var t=this.toArray(),e=t[1],i=t[2],r=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(i)+","+r+")"},me.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},me.black=new me(0,0,0,1),me.white=new me(1,1,1,1),me.transparent=new me(0,0,0,0),me.red=new me(1,0,0,1);var ye=function(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ye.prototype.compare=function(t,e){return this.collator.compare(t,e)},ye.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var _e=function(t,e,i,r,n){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=n},ge=function(t){this.sections=t};ge.fromString=function(t){return new ge([new _e(t,null,null,null,null)])},ge.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ge.factory=function(t){return t instanceof ge?t:ge.fromString(t)},ge.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ge.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var r=i[e];if(r.image)t.push(["image",r.image.name]);else{t.push(r.text);var n={};r.fontStack&&(n["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(n["font-scale"]=r.scale),r.textColor&&(n["text-color"]=["rgba"].concat(r.textColor.toArray())),t.push(n)}}return t};var ve=function(t){this.name=t.name,this.available=t.available};function xe(t,e,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,e,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function be(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof me)return!0;if(t instanceof ye)return!0;if(t instanceof ge)return!0;if(t instanceof ve)return!0;if(Array.isArray(t)){for(var e=0,i=t;e<i.length;e+=1)if(!be(i[e]))return!1;return!0}if("object"==typeof t){for(var r in t)if(!be(t[r]))return!1;return!0}return!1}function we(t){if(null===t)return Qt;if("string"==typeof t)return te;if("boolean"==typeof t)return ee;if("number"==typeof t)return $t;if(t instanceof me)return ie;if(t instanceof ye)return oe;if(t instanceof ge)return ae;if(t instanceof ve)return se;if(Array.isArray(t)){for(var e,i=t.length,r=0,n=t;r<n.length;r+=1){var o=we(n[r]);if(e){if(e===o)continue;e=ne;break}e=o}return ue(e||ne,i)}return re}function Ie(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof me||t instanceof ge||t instanceof ve?t.toString():JSON.stringify(t)}ve.prototype.toString=function(){return this.name},ve.fromString=function(t){return t?new ve({name:t,available:!1}):null},ve.prototype.serialize=function(){return["image",this.name]};var Se=function(t,e){this.type=t,this.value=e};Se.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!be(t[1]))return e.error("invalid value");var i=t[1],r=we(i),n=e.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new Se(r,i)},Se.prototype.evaluate=function(){return this.value},Se.prototype.eachChild=function(){},Se.prototype.outputDefined=function(){return!0},Se.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof me?["rgba"].concat(this.value.toArray()):this.value instanceof ge?this.value.serialize():this.value};var Te=function(t){this.name="ExpressionEvaluationError",this.message=t};Te.prototype.toJSON=function(){return this.message};var Ae={string:te,number:$t,boolean:ee,object:re},ze=function(t,e){this.type=t,this.args=e};ze.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i,r=1,n=t[0];if("array"===n){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in Ae)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=Ae[s],r++}else o=ne;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],r++}i=ue(o,a)}else i=Ae[n];for(var u=[];r<t.length;r++){var l=e.parse(t[r],r,ne);if(!l)return null;u.push(l)}return new ze(i,u)},ze.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var i=this.args[e].evaluate(t);if(!pe(this.type,we(i)))return i;if(e===this.args.length-1)throw new Te("Expected value to be of type "+le(this.type)+", but found "+le(we(i))+" instead.")}return null},ze.prototype.eachChild=function(t){this.args.forEach(t)},ze.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ze.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);var r=t.N;("number"==typeof r||this.args.length>1)&&e.push(r)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Ee=function(t){this.type=ae,this.sections=t};Ee.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");for(var r=[],n=!1,o=1;o<=t.length-1;++o){var a=t[o];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,$t)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,ue(te))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,ie)))return null;var c=r[r.length-1];c.scale=s,c.font=u,c.textColor=l}else{var p=e.parse(t[o],1,ne);if(!p)return null;var h=p.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:p,scale:null,font:null,textColor:null})}}return new Ee(r)},Ee.prototype.evaluate=function(t){return new ge(this.sections.map((function(e){var i=e.content.evaluate(t);return we(i)===se?new _e("",i,null,null,null):new _e(Ie(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Ee.prototype.eachChild=function(t){for(var e=0,i=this.sections;e<i.length;e+=1){var r=i[e];t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}},Ee.prototype.outputDefined=function(){return!1},Ee.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var r=i[e];t.push(r.content.serialize());var n={};r.scale&&(n["font-scale"]=r.scale.serialize()),r.font&&(n["text-font"]=r.font.serialize()),r.textColor&&(n["text-color"]=r.textColor.serialize()),t.push(n)}return t};var ke=function(t){this.type=se,this.input=t};ke.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,te);return i?new ke(i):e.error("No image name provided.")},ke.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=ve.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i},ke.prototype.eachChild=function(t){t(this.input)},ke.prototype.outputDefined=function(){return!1},ke.prototype.serialize=function(){return["image",this.input.serialize()]};var Ce={"to-boolean":ee,"to-color":ie,"to-number":$t,"to-string":te},Pe=function(t,e){this.type=t,this.args=e};Pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");for(var r=Ce[i],n=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,ne);if(!a)return null;n.push(a)}return new Pe(r,n)},Pe.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,i,r=0,n=this.args;r<n.length;r+=1){if(i=null,(e=n[r].evaluate(t))instanceof me)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(i=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":xe(e[0],e[1],e[2],e[3])))return new me(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Te(i||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new Te("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?ge.fromString(Ie(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ve.fromString(Ie(this.args[0].evaluate(t))):Ie(this.args[0].evaluate(t))},Pe.prototype.eachChild=function(t){this.args.forEach(t)},Pe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Pe.prototype.serialize=function(){if("formatted"===this.type.kind)return new Ee([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new ke(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var De=["Unknown","Point","LineString","Polygon"],Me=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Me.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Me.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?De[this.feature.type]:this.feature.type:null},Me.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Me.prototype.canonicalID=function(){return this.canonical},Me.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Me.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=me.parse(t)),e};var Le=function(t,e,i,r){this.name=t,this.type=e,this._evaluate=i,this.args=r};Le.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Le.prototype.eachChild=function(t){this.args.forEach(t)},Le.prototype.outputDefined=function(){return!1},Le.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Le.parse=function(t,e){var i,r=t[0],n=Le.definitions[r];if(!n)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((function(e){var i=e[0];return!Array.isArray(i)||i.length===t.length-1})),u=null,l=0,c=s;l<c.length;l+=1){var p=c[l],h=p[0],f=p[1];u=new ii(e.registry,e.path,null,e.scope);for(var d=[],m=!1,y=1;y<t.length;y++){var _=t[y],g=Array.isArray(h)?h[y-1]:h.type,v=u.parse(_,1+d.length,g);if(!v){m=!0;break}d.push(v)}if(!m)if(Array.isArray(h)&&h.length!==d.length)u.error("Expected "+h.length+" arguments, but found "+d.length+" instead.");else{for(var x=0;x<d.length;x++){var b=Array.isArray(h)?h[x]:h.type,w=d[x];u.concat(x+1).checkSubtype(b,w.type)}if(0===u.errors.length)return new Le(r,o,f,d)}}if(1===s.length)(i=e.errors).push.apply(i,u.errors);else{for(var I=(s.length?s:a).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(le).join(", ")+")":"("+le(e.type)+"...)"})).join(" | "),S=[],T=1;T<t.length;T++){var A=e.parse(t[T],1+S.length);if(!A)return null;S.push(le(A.type))}e.error("Expected arguments of type "+I+", but found ("+S.join(", ")+") instead.")}return null},Le.register=function(t,e){for(var i in Le.definitions=e,e)t[i]=Le};var Be=function(t,e,i){this.type=oe,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e};function Re(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Fe(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Oe(t,e){var i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return[Math.round(i*n*8192),Math.round(r*n*8192)]}function Ve(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function Ue(t,e){for(var i,r,n,o,a,s,u,l=!1,c=0,p=e.length;c<p;c++)for(var h=e[c],f=0,d=h.length;f<d-1;f++){if((o=(i=t)[0]-(r=h[f])[0])*(u=i[1]-(n=h[f+1])[1])-(s=i[0]-n[0])*(a=i[1]-r[1])==0&&o*s<=0&&a*u<=0)return!1;Ve(t,h[f],h[f+1])&&(l=!l)}return l}function je(t,e){for(var i=0;i<e.length;i++)if(Ue(t,e[i]))return!0;return!1}function Ne(t,e,i,r){var n=r[0]-i[0],o=r[1]-i[1],a=(t[0]-i[0])*o-n*(t[1]-i[1]),s=(e[0]-i[0])*o-n*(e[1]-i[1]);return a>0&&s<0||a<0&&s>0}function qe(t,e,i){for(var r=0,n=i;r<n.length;r+=1)for(var o=n[r],a=0;a<o.length-1;++a)if(0!=(p=[(c=o[a+1])[0]-(l=o[a])[0],c[1]-l[1]])[0]*(h=[(u=e)[0]-(s=t)[0],u[1]-s[1]])[1]-p[1]*h[0]&&Ne(s,u,l,c)&&Ne(l,c,s,u))return!0;var s,u,l,c,p,h;return!1}function Ze(t,e){for(var i=0;i<t.length;++i)if(!Ue(t[i],e))return!1;for(var r=0;r<t.length-1;++r)if(qe(t[r],t[r+1],e))return!1;return!0}function Ge(t,e){for(var i=0;i<e.length;i++)if(Ze(t,e[i]))return!0;return!1}function Xe(t,e,i){for(var r=[],n=0;n<t.length;n++){for(var o=[],a=0;a<t[n].length;a++){var s=Oe(t[n][a],i);Re(e,s),o.push(s)}r.push(o)}return r}function We(t,e,i){for(var r=[],n=0;n<t.length;n++){var o=Xe(t[n],e,i);r.push(o)}return r}function He(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){var n=.5*r,o=t[0]-i[0]>n?-r:i[0]-t[0]>n?r:0;0===o&&(o=t[0]-i[2]>n?-r:i[2]-t[0]>n?r:0),t[0]+=o}Re(e,t)}function Ke(t,e,i,r){for(var n=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],a=[],s=0,u=t;s<u.length;s+=1)for(var l=0,c=u[s];l<c.length;l+=1){var p=c[l],h=[p.x+o[0],p.y+o[1]];He(h,e,i,n),a.push(h)}return a}function Ye(t,e,i,r){for(var n,o=8192*Math.pow(2,r.z),a=[8192*r.x,8192*r.y],s=[],u=0,l=t;u<l.length;u+=1){for(var c=[],p=0,h=l[u];p<h.length;p+=1){var f=h[p],d=[f.x+a[0],f.y+a[1]];Re(e,d),c.push(d)}s.push(c)}if(e[2]-e[0]<=o/2){(n=e)[0]=n[1]=1/0,n[2]=n[3]=-1/0;for(var m=0,y=s;m<y.length;m+=1)for(var _=0,g=y[m];_<g.length;_+=1)He(g[_],e,i,o)}return s}Be.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");var r=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,ee);if(!r)return null;var n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,ee);if(!n)return null;var o=null;return i.locale&&!(o=e.parse(i.locale,1,te))?null:new Be(r,n,o)},Be.prototype.evaluate=function(t){return new ye(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Be.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Be.prototype.outputDefined=function(){return!1},Be.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Je=function(t,e){this.type=ee,this.geojson=t,this.geometries=e};function Qe(t){if(t instanceof Le){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Je)return!1;var e=!0;return t.eachChild((function(t){e&&!Qe(t)&&(e=!1)})),e}function $e(t){if(t instanceof Le&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!$e(t)&&(e=!1)})),e}function ti(t,e){if(t instanceof Le&&e.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild((function(t){i&&!ti(t,e)&&(i=!1)})),i}Je.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(be(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var r=0;r<i.features.length;++r){var n=i.features[r].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Je(i,i.features[r].geometry)}else if("Feature"===i.type){var o=i.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Je(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new Je(i,i)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Je.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=Xe(e.coordinates,r,n),a=Ke(t.geometry(),i,r,n);if(!Fe(i,r))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!Ue(u[s],o))return!1}if("MultiPolygon"===e.type){var l=We(e.coordinates,r,n),c=Ke(t.geometry(),i,r,n);if(!Fe(i,r))return!1;for(var p=0,h=c;p<h.length;p+=1)if(!je(h[p],l))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=Xe(e.coordinates,r,n),a=Ye(t.geometry(),i,r,n);if(!Fe(i,r))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!Ze(u[s],o))return!1}if("MultiPolygon"===e.type){var l=We(e.coordinates,r,n),c=Ye(t.geometry(),i,r,n);if(!Fe(i,r))return!1;for(var p=0,h=c;p<h.length;p+=1)if(!Ge(h[p],l))return!1}return!0}(t,this.geometries)}return!1},Je.prototype.eachChild=function(){},Je.prototype.outputDefined=function(){return!0},Je.prototype.serialize=function(){return["within",this.geojson]};var ei=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};ei.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var i=t[1];return e.scope.has(i)?new ei(i,e.scope.get(i)):e.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},ei.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},ei.prototype.eachChild=function(){},ei.prototype.outputDefined=function(){return!1},ei.prototype.serialize=function(){return["var",this.name]};var ii=function(t,e,i,r,n){void 0===e&&(e=[]),void 0===r&&(r=new Jt),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=r,this.errors=n,this.expectedType=i};function ri(t,e){for(var i,r=t.length-1,n=0,o=r,a=0;n<=o;)if((i=t[a=Math.floor((n+o)/2)])<=e){if(a===r||e<t[a+1])return a;n=a+1}else{if(!(i>e))throw new Te("Input is not a number.");o=a-1}return 0}ii.prototype.parse=function(t,e,i,r,n){return void 0===n&&(n={}),e?this.concat(e,i,r)._parse(t,n):this._parse(t,n)},ii.prototype._parse=function(t,e){function i(t,e,i){return"assert"===i?new ze(e,[t]):"coerce"===i?new Pe(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var o=n.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=i(o,a,e.typeAnnotation||"coerce");else o=i(o,a,e.typeAnnotation||"assert")}if(!(o instanceof Se)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof ei)return t(e.boundExpression);if(e instanceof Le&&"error"===e.name)return!1;if(e instanceof Be)return!1;if(e instanceof Je)return!1;var i=e instanceof Pe||e instanceof ze,r=!0;return e.eachChild((function(e){r=i?r&&t(e):r&&e instanceof Se})),!!r&&Qe(e)&&ti(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new Me;try{o=new Se(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},ii.prototype.concat=function(t,e,i){var r="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new ii(this.registry,r,e||null,n,this.errors)},ii.prototype.error=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var r=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Yt(r,t))},ii.prototype.checkSubtype=function(t,e){var i=pe(t,e);return i&&this.error(i),i};var ni=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var r=0,n=i;r<n.length;r+=1){var o=n[r],a=o[1];this.labels.push(o[0]),this.outputs.push(a)}};function oi(t,e,i){return t*(1-i)+e*i}ni.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var i=e.parse(t[1],1,$t);if(!i)return null;var r=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,l=o+1;if("number"!=typeof a)return e.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 e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var c=e.parse(s,l,n);if(!c)return null;n=n||c.type,r.push([a,c])}return new ni(n,i,r)},ni.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);var n=e.length;return r>=e[n-1]?i[n-1].evaluate(t):i[ri(e,r)].evaluate(t)},ni.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},ni.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},ni.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var ai=Object.freeze({__proto__:null,number:oi,color:function(t,e,i){return new me(oi(t.r,e.r,i),oi(t.g,e.g,i),oi(t.b,e.b,i),oi(t.a,e.a,i))},array:function(t,e,i){return t.map((function(t,r){return oi(t,e[r],i)}))}}),si=6/29*3*(6/29),ui=Math.PI/180,li=180/Math.PI;function ci(t){return t>.008856451679035631?Math.pow(t,1/3):t/si+4/29}function pi(t){return t>6/29?t*t*t:si*(t-4/29)}function hi(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function fi(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function di(t){var e=fi(t.r),i=fi(t.g),r=fi(t.b),n=ci((.4124564*e+.3575761*i+.1804375*r)/.95047),o=ci((.2126729*e+.7151522*i+.072175*r)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-ci((.0193339*e+.119192*i+.9503041*r)/1.08883)),alpha:t.a}}function mi(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*pi(e),i=.95047*pi(i),r=1.08883*pi(r),new me(hi(3.2404542*i-1.5371385*e-.4985314*r),hi(-.969266*i+1.8760108*e+.041556*r),hi(.0556434*i-.2040259*e+1.0572252*r),t.alpha)}function yi(t,e,i){var r=e-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}var _i={forward:di,reverse:mi,interpolate:function(t,e,i){return{l:oi(t.l,e.l,i),a:oi(t.a,e.a,i),b:oi(t.b,e.b,i),alpha:oi(t.alpha,e.alpha,i)}}},gi={forward:function(t){var e=di(t),i=e.l,r=e.a,n=e.b,o=Math.atan2(n,r)*li;return{h:o<0?o+360:o,c:Math.sqrt(r*r+n*n),l:i,alpha:t.a}},reverse:function(t){var e=t.h*ui,i=t.c;return mi({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:yi(t.h,e.h,i),c:oi(t.c,e.c,i),l:oi(t.l,e.l,i),alpha:oi(t.alpha,e.alpha,i)}}},vi=Object.freeze({__proto__:null,lab:_i,hcl:gi}),xi=function(t,e,i,r,n){this.type=t,this.operator=e,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=n;o<a.length;o+=1){var s=a[o],u=s[1];this.labels.push(s[0]),this.outputs.push(u)}};function bi(t,e,i,r){var n=r-i,o=t-i;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}xi.interpolationFactor=function(t,e,r,n){var o=0;if("exponential"===t.name)o=bi(e,t.base,r,n);else if("linear"===t.name)o=bi(e,1,r,n);else if("cubic-bezier"===t.name){var a=t.controlPoints;o=new i(a[0],a[1],a[2],a[3]).solve(bi(e,1,r,n))}return o},xi.parse=function(t,e){var i=t[0],r=t[1],n=t[2],o=t.slice(3);if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var a=r[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:a}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);var s=r.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,$t)))return null;var u=[],l=null;"interpolate-hcl"===i||"interpolate-lab"===i?l=ie:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c<o.length;c+=2){var p=o[c],h=o[c+1],f=c+3,d=c+4;if("number"!=typeof p)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(h,d,l);if(!m)return null;l=l||m.type,u.push([p,m])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new xi(l,i,r,n,u):e.error("Type "+le(l)+" is not interpolatable.")},xi.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);var n=e.length;if(r>=e[n-1])return i[n-1].evaluate(t);var o=ri(e,r),a=xi.interpolationFactor(this.interpolation,r,e[o],e[o+1]),s=i[o].evaluate(t),u=i[o+1].evaluate(t);return"interpolate"===this.operator?ai[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?gi.reverse(gi.interpolate(gi.forward(s),gi.forward(u),a)):_i.reverse(_i.interpolate(_i.forward(s),_i.forward(u),a))},xi.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},xi.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},xi.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e};var wi=function(t,e){this.type=t,this.args=e};wi.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var i=null,r=e.expectedType;r&&"value"!==r.kind&&(i=r);for(var n=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=e.parse(a[o],1+n.length,i,void 0,{typeAnnotation:"omit"});if(!s)return null;i=i||s.type,n.push(s)}var u=r&&n.some((function(t){return pe(r,t.type)}));return new wi(u?ne:i,n)},wi.prototype.evaluate=function(t){for(var e,i=null,r=0,n=0,o=this.args;n<o.length&&(r++,(i=o[n].evaluate(t))&&i instanceof ve&&!i.available&&(e||(e=i.name),i=null,r===this.args.length&&(i=e)),null===i);n+=1);return i},wi.prototype.eachChild=function(t){this.args.forEach(t)},wi.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},wi.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ii=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Ii.prototype.evaluate=function(t){return this.result.evaluate(t)},Ii.prototype.eachChild=function(t){for(var e=0,i=this.bindings;e<i.length;e+=1)t(i[e][1]);t(this.result)},Ii.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var i=[],r=1;r<t.length-1;r+=2){var n=t[r];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);var o=e.parse(t[r+1],r+1);if(!o)return null;i.push([n,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return a?new Ii(i,a):null},Ii.prototype.outputDefined=function(){return this.result.outputDefined()},Ii.prototype.serialize=function(){for(var t=["let"],e=0,i=this.bindings;e<i.length;e+=1){var r=i[e];t.push(r[0],r[1].serialize())}return t.push(this.result.serialize()),t};var Si=function(t,e,i){this.type=t,this.index=e,this.input=i};Si.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,$t),r=e.parse(t[2],2,ue(e.expectedType||ne));return i&&r?new Si(r.type.itemType,i,r):null},Si.prototype.evaluate=function(t){var e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Te("Array index out of bounds: "+e+" < 0.");if(e>=i.length)throw new Te("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new Te("Array index must be an integer, but found "+e+" instead.");return i[e]},Si.prototype.eachChild=function(t){t(this.index),t(this.input)},Si.prototype.outputDefined=function(){return!1},Si.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ti=function(t,e){this.type=ee,this.needle=t,this.haystack=e};Ti.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,ne),r=e.parse(t[2],2,ne);return i&&r?he(i.type,[ee,te,$t,Qt,ne])?new Ti(i,r):e.error("Expected first argument to be of type boolean, string, number or null, but found "+le(i.type)+" instead"):null},Ti.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!fe(e,["boolean","string","number","null"]))throw new Te("Expected first argument to be of type boolean, string, number or null, but found "+le(we(e))+" instead.");if(!fe(i,["string","array"]))throw new Te("Expected second argument to be of type array or string, but found "+le(we(i))+" instead.");return i.indexOf(e)>=0},Ti.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Ti.prototype.outputDefined=function(){return!0},Ti.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ai=function(t,e,i){this.type=$t,this.needle=t,this.haystack=e,this.fromIndex=i};Ai.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,ne),r=e.parse(t[2],2,ne);if(!i||!r)return null;if(!he(i.type,[ee,te,$t,Qt,ne]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+le(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,$t);return n?new Ai(i,r,n):null}return new Ai(i,r)},Ai.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!fe(e,["boolean","string","number","null"]))throw new Te("Expected first argument to be of type boolean, string, number or null, but found "+le(we(e))+" instead.");if(!fe(i,["string","array"]))throw new Te("Expected second argument to be of type array or string, but found "+le(we(i))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(t);return i.indexOf(e,r)}return i.indexOf(e)},Ai.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Ai.prototype.outputDefined=function(){return!1},Ai.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var zi=function(t,e,i,r,n,o){this.inputType=t,this.type=e,this.input=i,this.cases=r,this.outputs=n,this.otherwise=o};zi.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var i,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var c=0,p=s;c<p.length;c+=1){var h=p[c];if("number"!=typeof h&&"string"!=typeof h)return l.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(i){if(l.checkSubtype(i,we(h)))return null}else i=we(h);if(void 0!==n[String(h)])return l.error("Branch labels must be unique.");n[String(h)]=o.length}var f=e.parse(u,a,r);if(!f)return null;r=r||f.type,o.push(f)}var d=e.parse(t[1],1,ne);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,r);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(i,d.type)?null:new zi(i,r,d,n,o,m):null},zi.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(we(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},zi.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},zi.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},zi.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],i=[],r={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var a=o[n];void 0===(p=r[this.cases[a]])?(r[this.cases[a]]=i.length,i.push([this.cases[a],[a]])):i[p][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,l=i;u<l.length;u+=1){var c=l[u],p=c[0],h=c[1];e.push(1===h.length?s(h[0]):h.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var Ei=function(t,e,i){this.type=t,this.branches=e,this.otherwise=i};Ei.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var r=[],n=1;n<t.length-1;n+=2){var o=e.parse(t[n],n,ee);if(!o)return null;var a=e.parse(t[n+1],n+1,i);if(!a)return null;r.push([o,a]),i=i||a.type}var s=e.parse(t[t.length-1],t.length-1,i);return s?new Ei(i,r,s):null},Ei.prototype.evaluate=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var r=i[e],n=r[1];if(r[0].evaluate(t))return n.evaluate(t)}return this.otherwise.evaluate(t)},Ei.prototype.eachChild=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var r=i[e],n=r[1];t(r[0]),t(n)}t(this.otherwise)},Ei.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},Ei.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ki=function(t,e,i,r){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=r};function Ci(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Pi(t,e,i,r){return 0===r.compare(e,i)}function Di(t,e,i){var r="=="!==t&&"!="!==t;return function(){function n(t,e,i){this.type=ee,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var i=t[0],o=e.parse(t[1],1,ne);if(!o)return null;if(!Ci(i,o.type))return e.concat(1).error('"'+i+"\" comparisons are not supported for type '"+le(o.type)+"'.");var a=e.parse(t[2],2,ne);if(!a)return null;if(!Ci(i,a.type))return e.concat(2).error('"'+i+"\" comparisons are not supported for type '"+le(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+le(o.type)+"' and '"+le(a.type)+"'.");r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new ze(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new ze(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,oe)))return null}return new n(o,a,s)},n.prototype.evaluate=function(n){var o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){var s=we(o),u=we(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new Te('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!r&&this.hasUntypedArgument){var l=we(o),c=we(a);if("string"!==l.kind||"string"!==c.kind)return e(n,o,a)}return this.collator?i(n,o,a,this.collator.evaluate(n)):e(n,o,a)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n}()}ki.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,ne),r=e.parse(t[2],2,$t);if(!i||!r)return null;if(!he(i.type,[ue(ne),te,ne]))return e.error("Expected first argument to be of type array or string, but found "+le(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,$t);return n?new ki(i.type,i,r,n):null}return new ki(i.type,i,r)},ki.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!fe(e,["string","array"]))throw new Te("Expected first argument to be of type array or string, but found "+le(we(e))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(t);return e.slice(i,r)}return e.slice(i)},ki.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},ki.prototype.outputDefined=function(){return!1},ki.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Mi=Di("==",(function(t,e,i){return e===i}),Pi),Li=Di("!=",(function(t,e,i){return e!==i}),(function(t,e,i,r){return!Pi(0,e,i,r)})),Bi=Di("<",(function(t,e,i){return e<i}),(function(t,e,i,r){return r.compare(e,i)<0})),Ri=Di(">",(function(t,e,i){return e>i}),(function(t,e,i,r){return r.compare(e,i)>0})),Fi=Di("<=",(function(t,e,i){return e<=i}),(function(t,e,i,r){return r.compare(e,i)<=0})),Oi=Di(">=",(function(t,e,i){return e>=i}),(function(t,e,i,r){return r.compare(e,i)>=0})),Vi=function(t,e,i,r,n){this.type=te,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n};Vi.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,$t);if(!i)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");var n=null;if(r.locale&&!(n=e.parse(r.locale,1,te)))return null;var o=null;if(r.currency&&!(o=e.parse(r.currency,1,te)))return null;var a=null;if(r["min-fraction-digits"]&&!(a=e.parse(r["min-fraction-digits"],1,$t)))return null;var s=null;return r["max-fraction-digits"]&&!(s=e.parse(r["max-fraction-digits"],1,$t))?null:new Vi(i,n,o,a,s)},Vi.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Vi.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Vi.prototype.outputDefined=function(){return!1},Vi.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Ui=function(t){this.type=$t,this.input=t};Ui.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+le(i.type)+" instead."):new Ui(i):null},Ui.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Te("Expected value to be of type string or array, but found "+le(we(e))+" instead.")},Ui.prototype.eachChild=function(t){t(this.input)},Ui.prototype.outputDefined=function(){return!1},Ui.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ji={"==":Mi,"!=":Li,">":Ri,"<":Bi,">=":Oi,"<=":Fi,array:ze,at:Si,boolean:ze,case:Ei,coalesce:wi,collator:Be,format:Ee,image:ke,in:Ti,"index-of":Ai,interpolate:xi,"interpolate-hcl":xi,"interpolate-lab":xi,length:Ui,let:Ii,literal:Se,match:zi,number:ze,"number-format":Vi,object:ze,slice:ki,step:ni,string:ze,"to-boolean":Pe,"to-color":Pe,"to-number":Pe,"to-string":Pe,var:ei,within:Je};function Ni(t,e){var i=e[0],r=e[1],n=e[2],o=e[3];i=i.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);var a=o?o.evaluate(t):1,s=xe(i,r,n,a);if(s)throw new Te(s);return new me(i/255*a,r/255*a,n/255*a,a)}function qi(t,e){return t in e}function Zi(t,e){var i=e[t];return void 0===i?null:i}function Gi(t){return{type:t}}function Xi(t){return{result:"success",value:t}}function Wi(t){return{result:"error",value:t}}function Hi(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ki(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Yi(t){return!!t.expression&&t.expression.interpolated}function Ji(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Qi(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function $i(t){return t}function tr(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function er(t,e,i,r,n){return tr(typeof i===n?r[i]:void 0,t.default,e.default)}function ir(t,e,i){if("number"!==Ji(i))return tr(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];var n=ri(t.stops.map((function(t){return t[0]})),i);return t.stops[n][1]}function rr(t,e,i){var r=void 0!==t.base?t.base:1;if("number"!==Ji(i))return tr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];var o=ri(t.stops.map((function(t){return t[0]})),i),a=function(t,e,i,r){var n=r-i,o=t-i;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(i,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=ai[e.type]||$i;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=vi[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var i=s.evaluate.apply(void 0,t),r=u.evaluate.apply(void 0,t);if(void 0!==i&&void 0!==r)return l(i,r,a)}}:l(s,u,a)}function nr(t,e,i){return"color"===e.type?i=me.parse(i):"formatted"===e.type?i=ge.fromString(i.toString()):"resolvedImage"===e.type?i=ve.fromString(i.toString()):Ji(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),tr(i,t.default,e.default)}Le.register(ji,{error:[{kind:"error"},[te],function(t,e){throw new Te(e[0].evaluate(t))}],typeof:[te,[ne],function(t,e){return le(we(e[0].evaluate(t)))}],"to-rgba":[ue($t,4),[ie],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[ie,[$t,$t,$t],Ni],rgba:[ie,[$t,$t,$t,$t],Ni],has:{type:ee,overloads:[[[te],function(t,e){return qi(e[0].evaluate(t),t.properties())}],[[te,re],function(t,e){var i=e[1];return qi(e[0].evaluate(t),i.evaluate(t))}]]},get:{type:ne,overloads:[[[te],function(t,e){return Zi(e[0].evaluate(t),t.properties())}],[[te,re],function(t,e){var i=e[1];return Zi(e[0].evaluate(t),i.evaluate(t))}]]},"feature-state":[ne,[te],function(t,e){return Zi(e[0].evaluate(t),t.featureState||{})}],properties:[re,[],function(t){return t.properties()}],"geometry-type":[te,[],function(t){return t.geometryType()}],id:[ne,[],function(t){return t.id()}],zoom:[$t,[],function(t){return t.globals.zoom}],"heatmap-density":[$t,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[$t,[],function(t){return t.globals.lineProgress||0}],accumulated:[ne,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[$t,Gi($t),function(t,e){for(var i=0,r=0,n=e;r<n.length;r+=1)i+=n[r].evaluate(t);return i}],"*":[$t,Gi($t),function(t,e){for(var i=1,r=0,n=e;r<n.length;r+=1)i*=n[r].evaluate(t);return i}],"-":{type:$t,overloads:[[[$t,$t],function(t,e){var i=e[1];return e[0].evaluate(t)-i.evaluate(t)}],[[$t],function(t,e){return-e[0].evaluate(t)}]]},"/":[$t,[$t,$t],function(t,e){var i=e[1];return e[0].evaluate(t)/i.evaluate(t)}],"%":[$t,[$t,$t],function(t,e){var i=e[1];return e[0].evaluate(t)%i.evaluate(t)}],ln2:[$t,[],function(){return Math.LN2}],pi:[$t,[],function(){return Math.PI}],e:[$t,[],function(){return Math.E}],"^":[$t,[$t,$t],function(t,e){var i=e[1];return Math.pow(e[0].evaluate(t),i.evaluate(t))}],sqrt:[$t,[$t],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[$t,[$t],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[$t,[$t],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[$t,[$t],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[$t,[$t],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[$t,[$t],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[$t,[$t],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[$t,[$t],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[$t,[$t],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[$t,[$t],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[$t,Gi($t),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[$t,Gi($t),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[$t,[$t],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[$t,[$t],function(t,e){var i=e[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[$t,[$t],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[$t,[$t],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[ee,[te,ne],function(t,e){var i=e[0],r=e[1];return t.properties()[i.value]===r.value}],"filter-id-==":[ee,[ne],function(t,e){var i=e[0];return t.id()===i.value}],"filter-type-==":[ee,[te],function(t,e){var i=e[0];return t.geometryType()===i.value}],"filter-<":[ee,[te,ne],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[ee,[ne],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r<n}],"filter->":[ee,[te,ne],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[ee,[ne],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r>n}],"filter-<=":[ee,[te,ne],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[ee,[ne],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r<=n}],"filter->=":[ee,[te,ne],function(t,e){var i=e[0],r=e[1],n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[ee,[ne],function(t,e){var i=e[0],r=t.id(),n=i.value;return typeof r==typeof n&&r>=n}],"filter-has":[ee,[ne],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[ee,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[ee,[ue(te)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[ee,[ue(ne)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[ee,[te,ue(ne)],function(t,e){var i=e[0];return e[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[ee,[te,ue(ne)],function(t,e){var i=e[0],r=e[1];return function(t,e,i,r){for(;i<=r;){var n=i+r>>1;if(e[n]===t)return!0;e[n]>t?r=n-1:i=n+1}return!1}(t.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:ee,overloads:[[[ee,ee],function(t,e){var i=e[1];return e[0].evaluate(t)&&i.evaluate(t)}],[Gi(ee),function(t,e){for(var i=0,r=e;i<r.length;i+=1)if(!r[i].evaluate(t))return!1;return!0}]]},any:{type:ee,overloads:[[[ee,ee],function(t,e){var i=e[1];return e[0].evaluate(t)||i.evaluate(t)}],[Gi(ee),function(t,e){for(var i=0,r=e;i<r.length;i+=1)if(r[i].evaluate(t))return!0;return!1}]]},"!":[ee,[ee],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[ee,[te],function(t,e){var i=t.globals&&t.globals.isSupportedScript;return!i||i(e[0].evaluate(t))}],upcase:[te,[te],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[te,[te],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[te,Gi(ne),function(t,e){return e.map((function(e){return Ie(e.evaluate(t))})).join("")}],"resolved-locale":[te,[oe],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var or=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Me,this._defaultValue=e?function(t){return"color"===t.type&&Qi(t.default)?new me(0,0,0,0):"color"===t.type?me.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function ar(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in ji}function sr(t,e){var i=new ii(ji,[],e?function(t){var e={color:ie,string:te,number:$t,enum:te,boolean:ee,formatted:ae,resolvedImage:se};return"array"===t.type?ue(e[t.value]||ne,t.length):e[t.type]}(e):void 0),r=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?Xi(new or(r,e)):Wi(i.errors)}or.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},or.prototype.evaluate=function(t,e,i,r,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new Te("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ur=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!$e(e.expression)};ur.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,o)},ur.prototype.evaluate=function(t,e,i,r,n,o){return this._styleExpression.evaluate(t,e,i,r,n,o)};var lr=function(t,e,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!$e(e.expression),this.interpolationType=r};function cr(t,e){if("error"===(t=sr(t,e)).result)return t;var i=t.value.expression,r=Qe(i);if(!r&&!Hi(e))return Wi([new Yt("","data expressions not supported")]);var n=ti(i,["zoom"]);if(!n&&!Ki(e))return Wi([new Yt("","zoom expressions not supported")]);var o=function t(e){var i=null;if(e instanceof Ii)i=t(e.result);else if(e instanceof wi)for(var r=0,n=e.args;r<n.length&&!(i=t(n[r]));r+=1);else(e instanceof ni||e instanceof xi)&&e.input instanceof Le&&"zoom"===e.input.name&&(i=e);return i instanceof Yt||e.eachChild((function(e){var r=t(e);r instanceof Yt?i=r:!i&&r?i=new Yt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&r&&i!==r&&(i=new Yt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),i}(i);return o||n?o instanceof Yt?Wi([o]):o instanceof xi&&!Yi(e)?Wi([new Yt("",'"interpolate" expressions cannot be used with this property')]):Xi(o?new lr(r?"camera":"composite",t.value,o.labels,o instanceof xi?o.interpolation:void 0):new ur(r?"constant":"source",t.value)):Wi([new Yt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}lr.prototype.evaluateWithoutErrorHandling=function(t,e,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,o)},lr.prototype.evaluate=function(t,e,i,r,n,o){return this._styleExpression.evaluate(t,e,i,r,n,o)},lr.prototype.interpolationFactor=function(t,e,i){return this.interpolationType?xi.interpolationFactor(this.interpolationType,t,e,i):0};var pr=function(t,e){this._parameters=t,this._specification=e,Wt(this,function t(e,i){var r,n,o,a="color"===i.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||!(s||void 0!==e.property),l=e.type||(Yi(i)?"exponential":"interval");if(a&&((e=Wt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],me.parse(t[1])]}))),e.default=me.parse(e.default?e.default:i.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!vi[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)r=rr;else if("interval"===l)r=ir;else if("categorical"===l){r=er,n=Object.create(null);for(var c=0,p=e.stops;c<p.length;c+=1){var h=p[c];n[h[0]]=h[1]}o=typeof e.stops[0][0]}else{if("identity"!==l)throw new Error('Unknown function type "'+l+'"');r=nr}if(s){for(var f={},d=[],m=0;m<e.stops.length;m++){var y=e.stops[m],_=y[0].zoom;void 0===f[_]&&(f[_]={zoom:_,type:e.type,property:e.property,default:e.default,stops:[]},d.push(_)),f[_].stops.push([y[0].value,y[1]])}for(var g=[],v=0,x=d;v<x.length;v+=1){var b=x[v];g.push([f[b].zoom,t(f[b],i)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:xi.interpolationFactor.bind(void 0,w),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,r){var n=t.zoom;return rr({stops:g,base:e.base},i,n).evaluate(n,r)}}}if(u){var I="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:I,interpolationFactor:xi.interpolationFactor.bind(void 0,I),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return r(e,i,t.zoom,n,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?tr(e.default,i.default):r(e,i,s,n,o)}}}(this._parameters,this._specification))};function hr(t){var e=t.key,i=t.value,r=t.valueSpec||{},n=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=Ji(i);if("object"!==u)return[new Gt(e,i,"object expected, "+u+" found")];for(var l in i){var c=l.split(".")[0],p=r[c]||r["*"],h=void 0;if(n[c])h=n[c];else if(r[c])h=Fr;else if(n["*"])h=n["*"];else{if(!r["*"]){s.push(new Gt(e,i[l],'unknown property "'+l+'"'));continue}h=Fr}s=s.concat(h({key:(e?e+".":e)+l,value:i[l],valueSpec:p,style:o,styleSpec:a,object:i,objectKey:l},i))}for(var f in r)n[f]||r[f].required&&void 0===r[f].default&&void 0===i[f]&&s.push(new Gt(e,i,'missing required property "'+f+'"'));return s}function fr(t){var e=t.value,i=t.valueSpec,r=t.style,n=t.styleSpec,o=t.key,a=t.arrayElementValidator||Fr;if("array"!==Ji(e))return[new Gt(o,e,"array expected, "+Ji(e)+" found")];if(i.length&&e.length!==i.length)return[new Gt(o,e,"array length "+i.length+" expected, length "+e.length+" found")];if(i["min-length"]&&e.length<i["min-length"])return[new Gt(o,e,"array length at least "+i["min-length"]+" expected, length "+e.length+" found")];var s={type:i.value,values:i.values};n.$version<7&&(s.function=i.function),"object"===Ji(i.value)&&(s=i.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:r,styleSpec:n,key:o+"["+l+"]"}));return u}function dr(t){var e=t.key,i=t.value,r=t.valueSpec,n=Ji(i);return"number"===n&&i!=i&&(n="NaN"),"number"!==n?[new Gt(e,i,"number expected, "+n+" found")]:"minimum"in r&&i<r.minimum?[new Gt(e,i,i+" is less than the minimum value "+r.minimum)]:"maximum"in r&&i>r.maximum?[new Gt(e,i,i+" is greater than the maximum value "+r.maximum)]:[]}function mr(t){var e,i,r,n=t.valueSpec,o=Ht(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Ji(t.value.stops)&&"array"===Ji(t.value.stops[0])&&"object"===Ji(t.value.stops[0][0]),c=hr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Gt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],i=t.value;return e=e.concat(fr({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===Ji(i)&&0===i.length&&e.push(new Gt(t.key,i,"array must have at least one stop")),e},default:function(t){return Fr({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new Gt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new Gt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Yi(t.valueSpec)&&c.push(new Gt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Hi(t.valueSpec)?c.push(new Gt(t.key,t.value,"property functions not supported")):s&&!Ki(t.valueSpec)&&c.push(new Gt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new Gt(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],o=t.value,s=t.key;if("array"!==Ji(o))return[new Gt(s,o,"array expected, "+Ji(o)+" found")];if(2!==o.length)return[new Gt(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Ji(o[0]))return[new Gt(s,o,"object expected, "+Ji(o[0])+" found")];if(void 0===o[0].zoom)return[new Gt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Gt(s,o,"object stop key must have value")];if(r&&r>Ht(o[0].zoom))return[new Gt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Ht(o[0].zoom)!==r&&(r=Ht(o[0].zoom),i=void 0,a={}),e=e.concat(hr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:dr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return ar(Kt(o[1]))?e.concat([new Gt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Fr({key:s+"[1]",value:o[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function h(t,r){var s=Ji(t.value),u=Ht(t.value),l=null!==t.value?t.value:r;if(e){if(s!==e)return[new Gt(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Gt(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Hi(n)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Gt(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==i&&u<i?[new Gt(t.key,l,"stop domain values must appear in ascending order")]:(i=u,"categorical"===o&&u in a?[new Gt(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new Gt(t.key,l,"integer expected, found "+u)]}}function yr(t){var e=("property"===t.expressionContext?cr:sr)(Kt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Gt(""+t.key+e.key,t.value,e.message)}));var i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new Gt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!$e(i))return[new Gt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!$e(i))return[new Gt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!ti(i,["zoom","feature-state"]))return[new Gt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Qe(i))return[new Gt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function _r(t){var e=t.key,i=t.value,r=t.valueSpec,n=[];return Array.isArray(r.values)?-1===r.values.indexOf(Ht(i))&&n.push(new Gt(e,i,"expected one of ["+r.values.join(", ")+"], "+JSON.stringify(i)+" found")):-1===Object.keys(r.values).indexOf(Ht(i))&&n.push(new Gt(e,i,"expected one of ["+Object.keys(r.values).join(", ")+"], "+JSON.stringify(i)+" found")),n}function gr(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,i=t.slice(1);e<i.length;e+=1){var r=i[e];if(!gr(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}}pr.deserialize=function(t){return new pr(t._parameters,t._specification)},pr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var vr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function xr(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};gr(t)||(t=wr(t));var e=sr(t,vr);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,i,r){return e.value.evaluate(t,i,{},r)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var i=1;i<e.length;i++)if(t(e[i]))return!0;return!1}(t)}}function br(t,e){return t<e?-1:t>e?1:0}function wr(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?Ir(t[1],t[2],"=="):"!="===i?Ar(Ir(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?Ir(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(wr))):"all"===i?["all"].concat(t.slice(1).map(wr)):"none"===i?["all"].concat(t.slice(1).map(wr).map(Ar)):"in"===i?Sr(t[1],t.slice(2)):"!in"===i?Ar(Sr(t[1],t.slice(2))):"has"===i?Tr(t[1]):"!has"===i?Ar(Tr(t[1])):"within"!==i||t}function Ir(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function Sr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(br)]]:["filter-in-small",t,["literal",e]]}}function Tr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ar(t){return["!",t]}function zr(t){return gr(Kt(t.value))?yr(Wt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var i=e.value,r=e.key;if("array"!==Ji(i))return[new Gt(r,i,"array expected, "+Ji(i)+" found")];var n,o=e.styleSpec,a=[];if(i.length<1)return[new Gt(r,i,"filter array must have at least 1 element")];switch(a=a.concat(_r({key:r+"[0]",value:i[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ht(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===Ht(i[1])&&a.push(new Gt(r,i,'"$type" cannot be use with operator "'+i[0]+'"'));case"==":case"!=":3!==i.length&&a.push(new Gt(r,i,'filter array for operator "'+i[0]+'" must have 3 elements'));case"in":case"!in":i.length>=2&&"string"!==(n=Ji(i[1]))&&a.push(new Gt(r+"[1]",i[1],"string expected, "+n+" found"));for(var s=2;s<i.length;s++)n=Ji(i[s]),"$type"===Ht(i[1])?a=a.concat(_r({key:r+"["+s+"]",value:i[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new Gt(r+"["+s+"]",i[s],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var u=1;u<i.length;u++)a=a.concat(t({key:r+"["+u+"]",value:i[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=Ji(i[1]),2!==i.length?a.push(new Gt(r,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new Gt(r+"[1]",i[1],"string expected, "+n+" found"));break;case"within":n=Ji(i[1]),2!==i.length?a.push(new Gt(r,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"object"!==n&&a.push(new Gt(r+"[1]",i[1],"object expected, "+n+" found"))}return a}(t)}function Er(t,e){var i=t.key,r=t.style,n=t.styleSpec,o=t.value,a=t.objectKey,s=n[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return Fr({key:i,value:o,valueSpec:n.transition,style:r,styleSpec:n});var l,c=t.valueSpec||s[a];if(!c)return[new Gt(i,o,'unknown property "'+a+'"')];if("string"===Ji(o)&&Hi(c)&&!c.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new Gt(i,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var p=[];return"symbol"===t.layerType&&("text-field"===a&&r&&!r.glyphs&&p.push(new Gt(i,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Qi(Kt(o))&&"identity"===Ht(o.type)&&p.push(new Gt(i,o,'"text-font" does not support identity functions'))),p.concat(Fr({key:t.key,value:o,valueSpec:c,style:r,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:a}))}function kr(t){return Er(t,"paint")}function Cr(t){return Er(t,"layout")}function Pr(t){var e=[],i=t.value,r=t.key,n=t.style,o=t.styleSpec;i.type||i.ref||e.push(new Gt(r,i,'either "type" or "ref" is required'));var a,s=Ht(i.type),u=Ht(i.ref);if(i.id)for(var l=Ht(i.id),c=0;c<t.arrayIndex;c++){var p=n.layers[c];Ht(p.id)===l&&e.push(new Gt(r,i.id,'duplicate layer id "'+i.id+'", previously used at line '+p.id.__line__))}if("ref"in i)["type","source","source-layer","filter","layout"].forEach((function(t){t in i&&e.push(new Gt(r,i[t],'"'+t+'" is prohibited for ref layers'))})),n.layers.forEach((function(t){Ht(t.id)===u&&(a=t)})),a?a.ref?e.push(new Gt(r,i.ref,"ref cannot reference another ref layer")):s=Ht(a.type):e.push(new Gt(r,i.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(i.source){var h=n.sources&&n.sources[i.source],f=h&&Ht(h.type);h?"vector"===f&&"raster"===s?e.push(new Gt(r,i.source,'layer "'+i.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Gt(r,i.source,'layer "'+i.id+'" requires a vector source')):"vector"!==f||i["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Gt(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!i.paint||!i.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new Gt(r,i,'layer "'+i.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Gt(r,i,'layer "'+i.id+'" must specify a "source-layer"')):e.push(new Gt(r,i.source,'source "'+i.source+'" not found'))}else e.push(new Gt(r,i,'missing required property "source"'));return e=e.concat(hr({key:r,value:i,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Fr({key:r+".type",value:i.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"})},filter:zr,layout:function(t){return hr({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Cr(Wt({layerType:s},t))}}})},paint:function(t){return hr({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return kr(Wt({layerType:s},t))}}})}}}))}function Dr(t){var e=t.value,i=t.key,r=Ji(e);return"string"!==r?[new Gt(i,e,"string expected, "+r+" found")]:[]}var Mr={promoteId:function(t){var e=t.key,i=t.value;if("string"===Ji(i))return Dr({key:e,value:i});var r=[];for(var n in i)r.push.apply(r,Dr({key:e+"."+n,value:i[n]}));return r}};function Lr(t){var e=t.value,i=t.key,r=t.styleSpec,n=t.style;if(!e.type)return[new Gt(i,e,'"type" is required')];var o,a=Ht(e.type);switch(a){case"vector":case"raster":case"raster-dem":return hr({key:i,value:e,valueSpec:r["source_"+a.replace("-","_")],style:t.style,styleSpec:r,objectElementValidators:Mr});case"geojson":if(o=hr({key:i,value:e,valueSpec:r.source_geojson,style:n,styleSpec:r,objectElementValidators:Mr}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],c="string"==typeof l?[l,["accumulated"],["get",s]]:l;o.push.apply(o,yr({key:i+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),o.push.apply(o,yr({key:i+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return hr({key:i,value:e,valueSpec:r.source_video,style:n,styleSpec:r});case"image":return hr({key:i,value:e,valueSpec:r.source_image,style:n,styleSpec:r});case"canvas":return[new Gt(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return _r({key:i+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:r})}}function Br(t){var e=t.value,i=t.styleSpec,r=i.light,n=t.style,o=[],a=Ji(e);if(void 0===e)return o;if("object"!==a)return o.concat([new Gt("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=o.concat(u&&r[u[1]]&&r[u[1]].transition?Fr({key:s,value:e[s],valueSpec:i.transition,style:n,styleSpec:i}):r[s]?Fr({key:s,value:e[s],valueSpec:r[s],style:n,styleSpec:i}):[new Gt(s,e[s],'unknown property "'+s+'"')])}return o}var Rr={"*":function(){return[]},array:fr,boolean:function(t){var e=t.value,i=t.key,r=Ji(e);return"boolean"!==r?[new Gt(i,e,"boolean expected, "+r+" found")]:[]},number:dr,color:function(t){var e=t.key,i=t.value,r=Ji(i);return"string"!==r?[new Gt(e,i,"color expected, "+r+" found")]:null===de(i)?[new Gt(e,i,'color expected, "'+i+'" found')]:[]},constants:Xt,enum:_r,filter:zr,function:mr,layer:Pr,object:hr,source:Lr,light:Br,string:Dr,formatted:function(t){return 0===Dr(t).length?[]:yr(t)},resolvedImage:function(t){return 0===Dr(t).length?[]:yr(t)}};function Fr(t){var e=t.value,i=t.valueSpec,r=t.styleSpec;return i.expression&&Qi(Ht(e))?mr(t):i.expression&&ar(Kt(e))?yr(t):i.type&&Rr[i.type]?Rr[i.type](t):hr(Wt({},t,{valueSpec:i.type?r[i.type]:i}))}function Or(t){var e=t.value,i=t.key,r=Dr(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new Gt(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new Gt(i,e,'"glyphs" url must include a "{range}" token'))),r}function Vr(t,e){void 0===e&&(e=Zt);var i=[];return i=i.concat(Fr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Or,"*":function(){return[]}}})),t.constants&&(i=i.concat(Xt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Ur(i)}function Ur(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function jr(t){return function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return Ur(t.apply(this,e))}}Vr.source=jr(Lr),Vr.light=jr(Br),Vr.layer=jr(Pr),Vr.filter=jr(zr),Vr.paintProperty=jr(kr),Vr.layoutProperty=jr(Cr);var Nr=Vr,qr=Nr.light,Zr=Nr.paintProperty,Gr=Nr.layoutProperty;function Xr(t,e){var i=!1;if(e&&e.length)for(var r=0,n=e;r<n.length;r+=1)t.fire(new Nt(new Error(n[r].message))),i=!0;return i}var Wr=Hr;function Hr(t,e,i){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(i=n[2]);for(var o=0;o<this.d*this.d;o++){var a=n[3+o],s=n[3+o+1];r.push(a===s?null:n.subarray(a,s))}var u=n[3+r.length+1];this.keys=n.subarray(n[3+r.length],u),this.bboxes=n.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var l=0;l<this.d*this.d;l++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var c=i/e*t;this.min=-c,this.max=t+c}Hr.prototype.insert=function(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)},Hr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Hr.prototype._insertCell=function(t,e,i,r,n,o){this.cells[n].push(o)},Hr.prototype.query=function(t,e,i,r,n){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=i&&a<=r&&!n)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,i,r,this._queryCell,s,{},n),s},Hr.prototype._queryCell=function(t,e,i,r,n,o,a,s){var u=this.cells[n];if(null!==u)for(var l=this.keys,c=this.bboxes,p=0;p<u.length;p++){var h=u[p];if(void 0===a[h]){var f=4*h;(s?s(c[f+0],c[f+1],c[f+2],c[f+3]):t<=c[f+2]&&e<=c[f+3]&&i>=c[f+0]&&r>=c[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},Hr.prototype._forEachCell=function(t,e,i,r,n,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(i),p=this._convertToCellCoord(r),h=u;h<=c;h++)for(var f=l;f<=p;f++){var d=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&n.call(this,t,e,i,r,d,o,a,s))return}},Hr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Hr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Hr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,i=0,r=0;r<this.cells.length;r++)i+=this.cells[r].length;var n=new Int32Array(e+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];n[3+a]=o,n.set(s,o),o+=s.length}return n[3+t.length]=o,n.set(this.keys,o),n[3+t.length+1]=o+=this.keys.length,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer};var Kr=a.ImageData,Yr=a.ImageBitmap,Jr={};function Qr(t,e,i){void 0===i&&(i={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Jr[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}for(var $r in Qr("Object",Object),Wr.serialize=function(t,e){var i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},Wr.deserialize=function(t){return new Wr(t.buffer)},Qr("Grid",Wr),Qr("Color",me),Qr("Error",Error),Qr("ResolvedImage",ve),Qr("StylePropertyFunction",pr),Qr("StyleExpression",or,{omit:["_evaluator"]}),Qr("ZoomDependentExpression",lr),Qr("ZoomConstantExpression",ur),Qr("CompoundExpression",Le,{omit:["_evaluate"]}),ji)ji[$r]._classRegistryKey||Qr("Expression_"+$r,ji[$r]);function tn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function en(t){return Yr&&t instanceof Yr}function rn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(tn(t)||en(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var i=t;return e&&e.push(i.buffer),i}if(t instanceof Kr)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var r=[],n=0,o=t;n<o.length;n+=1)r.push(rn(o[n],e));return r}if("object"==typeof t){var a=t.constructor,s=a._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var u=a.serialize?a.serialize(t,e):{};if(!a.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(Jr[s].omit.indexOf(l)>=0)){var c=t[l];u[l]=Jr[s].shallow.indexOf(l)>=0?c:rn(c,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function nn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||tn(t)||en(t)||ArrayBuffer.isView(t)||t instanceof Kr)return t;if(Array.isArray(t))return t.map(nn);if("object"==typeof t){var e=t.$name||"Object",i=Jr[e].klass;if(!i)throw new Error("can't deserialize unregistered class "+e);if(i.deserialize)return i.deserialize(t);for(var r=Object.create(i.prototype),n=0,o=Object.keys(t);n<o.length;n+=1){var a=o[n];if("$name"!==a){var s=t[a];r[a]=Jr[e].shallow.indexOf(a)>=0?s:nn(s)}}return r}throw new Error("can't deserialize object of type "+typeof t)}var on=function(){this.first=!0};on.prototype.update=function(t,e){var i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))};var an=function(t){return t>=12288&&t<=12351},sn=function(t){return t>=12352&&t<=12447},un=function(t){return t>=12448&&t<=12543},ln=function(t){return t>=19968&&t<=40959},cn=function(t){return t>=44032&&t<=55215},pn=function(t){return t>=65072&&t<=65103},hn=function(t){return t>=65104&&t<=65135},fn=function(t){return t>=65280&&t<=65519};function dn(t){for(var e=0,i=t;e<i.length;e+=1)if(mn(i[e].charCodeAt(0)))return!0;return!1}function mn(t){return!(746!==t&&747!==t&&(t<4352||!(function(t){return t>=12704&&t<=12735}(t)||function(t){return t>=12544&&t<=12591}(t)||pn(t)&&!(t>=65097&&t<=65103)||function(t){return t>=63744&&t<=64255}(t)||function(t){return t>=13056&&t<=13311}(t)||function(t){return t>=11904&&t<=12031}(t)||function(t){return t>=12736&&t<=12783}(t)||!(!an(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||function(t){return t>=13312&&t<=19903}(t)||ln(t)||function(t){return t>=12800&&t<=13055}(t)||function(t){return t>=12592&&t<=12687}(t)||function(t){return t>=43360&&t<=43391}(t)||function(t){return t>=55216&&t<=55295}(t)||function(t){return t>=4352&&t<=4607}(t)||cn(t)||sn(t)||function(t){return t>=12272&&t<=12287}(t)||function(t){return t>=12688&&t<=12703}(t)||function(t){return t>=12032&&t<=12255}(t)||function(t){return t>=12784&&t<=12799}(t)||un(t)&&12540!==t||!(!fn(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!hn(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||function(t){return t>=5120&&t<=5759}(t)||function(t){return t>=6320&&t<=6399}(t)||function(t){return t>=65040&&t<=65055}(t)||function(t){return t>=19904&&t<=19967}(t)||function(t){return t>=40960&&t<=42127}(t)||function(t){return t>=42128&&t<=42191}(t))))}function yn(t){return!(mn(t)||function(t){return!!(function(t){return t>=128&&t<=255}(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||function(t){return t>=8192&&t<=8303}(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||function(t){return t>=8448&&t<=8527}(t)||function(t){return t>=8528&&t<=8591}(t)||function(t){return t>=8960&&t<=9215}(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||function(t){return t>=9216&&t<=9279}(t)&&9251!==t||function(t){return t>=9280&&t<=9311}(t)||function(t){return t>=9312&&t<=9471}(t)||function(t){return t>=9632&&t<=9727}(t)||function(t){return t>=9728&&t<=9983}(t)&&!(t>=9754&&t<=9759)||function(t){return t>=11008&&t<=11263}(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||an(t)||un(t)||function(t){return t>=57344&&t<=63743}(t)||pn(t)||hn(t)||fn(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function _n(t){return t>=1424&&t<=2303||function(t){return t>=64336&&t<=65023}(t)||function(t){return t>=65136&&t<=65279}(t)}function gn(t,e){return!(!e&&_n(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||function(t){return t>=6016&&t<=6143}(t))}function vn(t){for(var e=0,i=t;e<i.length;e+=1)if(_n(i[e].charCodeAt(0)))return!0;return!1}var xn=null,bn="unavailable",wn=null,In=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(bn="error"),xn&&xn(t)};function Sn(){Tn.fire(new jt("pluginStateChange",{pluginStatus:bn,pluginURL:wn}))}var Tn=new qt,An=function(){return bn},zn=function(){if("deferred"!==bn||!wn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");bn="loading",Sn(),wn&&Bt({url:wn},(function(t){t?In(t):(bn="loaded",Sn())}))},En={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===bn||null!=En.applyArabicShaping},isLoading:function(){return"loading"===bn},setState:function(t){bn=t.pluginStatus,wn=t.pluginURL},isParsed:function(){return null!=En.applyArabicShaping&&null!=En.processBidirectionalText&&null!=En.processStyledBidirectionalText},getPluginURL:function(){return wn}},kn=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new on,this.transition={})};kn.prototype.isSupportedScript=function(t){return function(t,e){for(var i=0,r=t;i<r.length;i+=1)if(!gn(r[i].charCodeAt(0),e))return!1;return!0}(t,En.isLoaded())},kn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},kn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}};var Cn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Qi(t))return new pr(t,e);if(ar(t)){var i=cr(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}var r=t;return"string"==typeof t&&"color"===e.type&&(r=me.parse(t)),{kind:"constant",evaluate:function(){return r}}}(void 0===e?t.specification.default:e,t.specification)};Cn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Cn.prototype.possiblyEvaluate=function(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)};var Pn=function(t){this.property=t,this.value=new Cn(t,void 0)};Pn.prototype.transitioned=function(t,e){return new Mn(this.property,this.value,e,m({},t.transition,this.transition),t.now)},Pn.prototype.untransitioned=function(){return new Mn(this.property,this.value,null,{},0)};var Dn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Dn.prototype.getValue=function(t){return T(this._values[t].value.value)},Dn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Pn(this._values[t].property)),this._values[t].value=new Cn(this._values[t].property,null===e?void 0:T(e))},Dn.prototype.getTransition=function(t){return T(this._values[t].transition)},Dn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Pn(this._values[t].property)),this._values[t].transition=T(e)||void 0},Dn.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var r=i[e],n=this.getValue(r);void 0!==n&&(t[r]=n);var o=this.getTransition(r);void 0!==o&&(t[r+"-transition"]=o)}return t},Dn.prototype.transitioned=function(t,e){for(var i=new Ln(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var o=n[r];i._values[o]=this._values[o].transitioned(t,e._values[o])}return i},Dn.prototype.untransitioned=function(){for(var t=new Ln(this._properties),e=0,i=Object.keys(this._values);e<i.length;e+=1){var r=i[e];t._values[r]=this._values[r].untransitioned()}return t};var Mn=function(t,e,i,r,n){this.property=t,this.value=e,this.begin=n+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=i)};Mn.prototype.possiblyEvaluate=function(t,e,i){var r=t.now||0,n=this.value.possiblyEvaluate(t,e,i),o=this.prior;if(o){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r<this.begin)return o.possiblyEvaluate(t,e,i);var a=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,i),n,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}(a))}return n};var Ln=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Ln.prototype.possiblyEvaluate=function(t,e,i){for(var r=new Fn(this._properties),n=0,o=Object.keys(this._values);n<o.length;n+=1){var a=o[n];r._values[a]=this._values[a].possiblyEvaluate(t,e,i)}return r},Ln.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var Bn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Bn.prototype.getValue=function(t){return T(this._values[t].value)},Bn.prototype.setValue=function(t,e){this._values[t]=new Cn(this._values[t].property,null===e?void 0:T(e))},Bn.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var r=i[e],n=this.getValue(r);void 0!==n&&(t[r]=n)}return t},Bn.prototype.possiblyEvaluate=function(t,e,i){for(var r=new Fn(this._properties),n=0,o=Object.keys(this._values);n<o.length;n+=1){var a=o[n];r._values[a]=this._values[a].possiblyEvaluate(t,e,i)}return r};var Rn=function(t,e,i){this.property=t,this.value=e,this.parameters=i};Rn.prototype.isConstant=function(){return"constant"===this.value.kind},Rn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Rn.prototype.evaluate=function(t,e,i,r){return this.property.evaluate(this.value,this.parameters,t,e,i,r)};var Fn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Fn.prototype.get=function(t){return this._values[t]};var On=function(t){this.specification=t};On.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},On.prototype.interpolate=function(t,e,i){var r=ai[this.specification.type];return r?r(t,e,i):t};var Vn=function(t,e){this.specification=t,this.overrides=e};Vn.prototype.possiblyEvaluate=function(t,e,i,r){return new Rn(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,r)}:t.expression,e)},Vn.prototype.interpolate=function(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Rn(this,{kind:"constant",value:void 0},t.parameters);var r=ai[this.specification.type];return r?new Rn(this,{kind:"constant",value:r(t.value.value,e.value.value,i)},t.parameters):t},Vn.prototype.evaluate=function(t,e,i,r,n,o){return"constant"===t.kind?t.value:t.evaluate(e,i,r,n,o)};var Un=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,i,r){if(void 0===t.value)return new Rn(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},i,r),o="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,a=this._calculate(o,o,o,e);return new Rn(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Rn(this,{kind:"constant",value:s},e)}return new Rn(this,t.expression,e)},e.prototype.evaluate=function(t,e,i,r,n,o){if("source"===t.kind){var a=t.evaluate(e,i,r,n,o);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,r),t.evaluate({zoom:Math.floor(e.zoom)},i,r),t.evaluate({zoom:Math.floor(e.zoom)+1},i,r),e):t.value},e.prototype._calculate=function(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},e.prototype.interpolate=function(t){return t},e}(Vn),jn=function(t){this.specification=t};jn.prototype.possiblyEvaluate=function(t,e,i,r){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},i,r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new kn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new kn(Math.floor(e.zoom),e)),t.expression.evaluate(new kn(Math.floor(e.zoom+1),e)),e)}},jn.prototype._calculate=function(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},jn.prototype.interpolate=function(t){return t};var Nn=function(t){this.specification=t};Nn.prototype.possiblyEvaluate=function(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)},Nn.prototype.interpolate=function(){return!1};var qn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var i=t[e];i.specification.overridable&&this.overridableProperties.push(e);var r=this.defaultPropertyValues[e]=new Cn(i,void 0),n=this.defaultTransitionablePropertyValues[e]=new Pn(i);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};Qr("DataDrivenProperty",Vn),Qr("DataConstantProperty",On),Qr("CrossFadedDataDrivenProperty",Un),Qr("CrossFadedProperty",jn),Qr("ColorRampProperty",Nn);var Zn=function(t){function e(e,i){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new Bn(i.layout)),i.paint)){for(var r in this._transitionablePaint=new Dn(i.paint),e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(var n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Fn(i.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,i){void 0===i&&(i={}),null!=e&&this._validate(Gr,"layers."+this.id+".layout."+t,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return w(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,i){if(void 0===i&&(i={}),null!=e&&this._validate(Zr,"layers."+this.id+".paint."+t,t,e,i))return!1;if(w(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var r=this._transitionablePaint._values[t],n="cross-faded-data-driven"===r.property.specification["property-type"],o=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||n||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,i){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),S(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,i,r,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Xr(this,t.call(Nr,{key:e,layerType:this.type,objectKey:i,value:r,styleSpec:Zt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Rn&&Hi(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(qt),Gn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Xn=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Wn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Hn(t,e){void 0===e&&(e=1);var i=0,r=0;return{members:t.map((function(t){var n=Gn[t.type].BYTES_PER_ELEMENT,o=i=Kn(i,Math.max(e,n)),a=t.components||1;return r=Math.max(r,n),i+=n*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Kn(i,Math.max(r,e)),alignment:e}}function Kn(t,e){return Math.ceil(t/e)*e}Wn.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Wn.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Wn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Wn.prototype.clear=function(){this.length=0},Wn.prototype.resize=function(t){this.reserve(t),this.length=t},Wn.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Wn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var r=2*t;return this.int16[r+0]=e,this.int16[r+1]=i,t},e}(Wn);Yn.prototype.bytesPerElement=4,Qr("StructArrayLayout2i4",Yn);var Jn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)},e.prototype.emplace=function(t,e,i,r,n){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=n,t},e}(Wn);Jn.prototype.bytesPerElement=8,Qr("StructArrayLayout4i8",Jn);var Qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)},e.prototype.emplace=function(t,e,i,r,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Wn);Qn.prototype.bytesPerElement=12,Qr("StructArrayLayout2i4i12",Qn);var $n=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)},e.prototype.emplace=function(t,e,i,r,n,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.uint8[u+4]=r,this.uint8[u+5]=n,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Wn);$n.prototype.bytesPerElement=8,Qr("StructArrayLayout2i4ub8",$n);var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var r=2*t;return this.float32[r+0]=e,this.float32[r+1]=i,t},e}(Wn);to.prototype.bytesPerElement=8,Qr("StructArrayLayout2f8",to);var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,i,r,n,o,a,s,u,l)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l,c){var p=10*t;return this.uint16[p+0]=e,this.uint16[p+1]=i,this.uint16[p+2]=r,this.uint16[p+3]=n,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=u,this.uint16[p+8]=l,this.uint16[p+9]=c,t},e}(Wn);eo.prototype.bytesPerElement=20,Qr("StructArrayLayout10ui20",eo);var io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n,o,a,s,u,l,c,p){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,i,r,n,o,a,s,u,l,c,p)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l,c,p,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=i,this.int16[f+2]=r,this.int16[f+3]=n,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=c,this.int16[f+10]=p,this.int16[f+11]=h,t},e}(Wn);io.prototype.bytesPerElement=24,Qr("StructArrayLayout4i4ui4i24",io);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=3*t;return this.float32[n+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t},e}(Wn);ro.prototype.bytesPerElement=12,Qr("StructArrayLayout3f12",ro);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Wn);no.prototype.bytesPerElement=4,Qr("StructArrayLayout1ul4",no);var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,i,r,n,o,a,s,u)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l){var c=10*t,p=5*t;return this.int16[c+0]=e,this.int16[c+1]=i,this.int16[c+2]=r,this.int16[c+3]=n,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[p+3]=s,this.uint16[c+8]=u,this.uint16[c+9]=l,t},e}(Wn);oo.prototype.bytesPerElement=20,Qr("StructArrayLayout6i1ul2ui20",oo);var ao=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)},e.prototype.emplace=function(t,e,i,r,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Wn);ao.prototype.bytesPerElement=12,Qr("StructArrayLayout2i2i2i12",ao);var so=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n)},e.prototype.emplace=function(t,e,i,r,n,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=i,this.float32[a+2]=r,this.int16[s+6]=n,this.int16[s+7]=o,t},e}(Wn);so.prototype.bytesPerElement=16,Qr("StructArrayLayout2f1f2i16",so);var uo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)},e.prototype.emplace=function(t,e,i,r,n){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=i,this.float32[a+1]=r,this.float32[a+2]=n,t},e}(Wn);uo.prototype.bytesPerElement=12,Qr("StructArrayLayout2ub2f12",uo);var lo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,this.uint16[n+2]=r,t},e}(Wn);lo.prototype.bytesPerElement=6,Qr("StructArrayLayout3ui6",lo);var co=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y){var _=this.length;return this.resize(_+1),this.emplace(_,t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y,_){var g=24*t,v=12*t,x=48*t;return this.int16[g+0]=e,this.int16[g+1]=i,this.uint16[g+2]=r,this.uint16[g+3]=n,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=c,this.float32[v+7]=p,this.float32[v+8]=h,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[v+10]=y,this.int16[g+22]=_,t},e}(Wn);co.prototype.bytesPerElement=48,Qr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",co);var po=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y,_,g,v,x,b,w,I,S,T,A,z){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y,_,g,v,x,b,w,I,S,T,A,z)},e.prototype.emplace=function(t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m,y,_,g,v,x,b,w,I,S,T,A,z,E){var k=34*t,C=17*t;return this.int16[k+0]=e,this.int16[k+1]=i,this.int16[k+2]=r,this.int16[k+3]=n,this.int16[k+4]=o,this.int16[k+5]=a,this.int16[k+6]=s,this.int16[k+7]=u,this.uint16[k+8]=l,this.uint16[k+9]=c,this.uint16[k+10]=p,this.uint16[k+11]=h,this.uint16[k+12]=f,this.uint16[k+13]=d,this.uint16[k+14]=m,this.uint16[k+15]=y,this.uint16[k+16]=_,this.uint16[k+17]=g,this.uint16[k+18]=v,this.uint16[k+19]=x,this.uint16[k+20]=b,this.uint16[k+21]=w,this.uint16[k+22]=I,this.uint32[C+12]=S,this.float32[C+13]=T,this.float32[C+14]=A,this.float32[C+15]=z,this.float32[C+16]=E,t},e}(Wn);po.prototype.bytesPerElement=68,Qr("StructArrayLayout8i15ui1ul4f68",po);var ho=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Wn);ho.prototype.bytesPerElement=4,Qr("StructArrayLayout1f4",ho);var fo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=3*t;return this.int16[n+0]=e,this.int16[n+1]=i,this.int16[n+2]=r,t},e}(Wn);fo.prototype.bytesPerElement=6,Qr("StructArrayLayout3i6",fo);var mo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)},e.prototype.emplace=function(t,e,i,r){var n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=i,this.uint16[n+3]=r,t},e}(Wn);mo.prototype.bytesPerElement=8,Qr("StructArrayLayout1ul2ui8",mo);var yo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,t},e}(Wn);yo.prototype.bytesPerElement=4,Qr("StructArrayLayout2ui4",yo);var _o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Wn);_o.prototype.bytesPerElement=2,Qr("StructArrayLayout1ui2",_o);var go=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)},e.prototype.emplace=function(t,e,i,r,n){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=r,this.float32[o+3]=n,t},e}(Wn);go.prototype.bytesPerElement=16,Qr("StructArrayLayout4f16",go);var vo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return i.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},i.x1.get=function(){return this._structArray.int16[this._pos2+2]},i.y1.get=function(){return this._structArray.int16[this._pos2+3]},i.x2.get=function(){return this._structArray.int16[this._pos2+4]},i.y2.get=function(){return this._structArray.int16[this._pos2+5]},i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,i),e}(Xn);vo.prototype.size=20;var xo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new vo(this,t)},e}(oo);Qr("CollisionBoxArray",xo);var bo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},i.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},i.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},i.segment.get=function(){return this._structArray.uint16[this._pos2+10]},i.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},i.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},i.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},i.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},i.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},i.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},i.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},i.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},i.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},i.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,i),e}(Xn);bo.prototype.size=48;var wo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new bo(this,t)},e}(co);Qr("PlacedSymbolArray",wo);var Io=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},i.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},i.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},i.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},i.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},i.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},i.key.get=function(){return this._structArray.uint16[this._pos2+8]},i.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},i.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},i.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},i.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},i.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},i.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},i.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},i.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},i.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},i.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},i.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},i.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},i.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},i.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},i.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},i.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},i.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,i),e}(Xn);Io.prototype.size=68;var So=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Io(this,t)},e}(po);Qr("SymbolInstanceArray",So);var To=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(ho);Qr("GlyphOffsetArray",To);var Ao=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(fo);Qr("SymbolLineVertexArray",Ao);var zo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,i),e}(Xn);zo.prototype.size=8;var Eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new zo(this,t)},e}(mo);Qr("FeatureIndexArray",Eo);var ko=Hn([{name:"a_pos",components:2,type:"Int16"}],4).members,Co=function(t){void 0===t&&(t=[]),this.segments=t};function Po(t,e){return 256*(t=p(Math.floor(t),0,255))+p(Math.floor(e),0,255)}Co.prototype.prepareSegment=function(t,e,i,r){var n=this.segments[this.segments.length-1];return t>Co.MAX_VERTEX_ARRAY_LENGTH&&z("Max vertices per segment is "+Co.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Co.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r)&&(n={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==r&&(n.sortKey=r),this.segments.push(n)),n},Co.prototype.get=function(){return this.segments},Co.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var i=e[t];for(var r in i.vaos)i.vaos[r].destroy()}},Co.simpleSegment=function(t,e,i,r){return new Co([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])},Co.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Qr("SegmentVector",Co);var Do=Hn([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),Mo=t((function(t){t.exports=function(t,e){var i,r,n,o,a,s,u,l;for(r=t.length-(i=3&t.length),n=e,a=3432918353,s=461845907,l=0;l<r;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,n=27492+(65535&(o=5*(65535&(n=(n^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,i){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:n^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}})),Lo=t((function(t){t.exports=function(t,e){for(var i,r=t.length,n=e^r,o=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:n^=(255&t.charCodeAt(o+2))<<16;case 2:n^=(255&t.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}})),Bo=Mo,Ro=Lo;Bo.murmur3=Mo,Bo.murmur2=Ro;var Fo=function(){this.ids=[],this.positions=[],this.indexed=!1};Fo.prototype.add=function(t,e,i,r){this.ids.push(Vo(t)),this.positions.push(e,i,r)},Fo.prototype.getPositions=function(t){for(var e=Vo(t),i=0,r=this.ids.length-1;i<r;){var n=i+r>>1;this.ids[n]>=e?r=n:i=n+1}for(var o=[];this.ids[i]===e;)o.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return o},Fo.serialize=function(t,e){var i=new Float64Array(t.ids),r=new Uint32Array(t.positions);return function t(e,i,r,n){for(;r<n;){for(var o=e[r+n>>1],a=r-1,s=n+1;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;Uo(e,a,s),Uo(i,3*a,3*s),Uo(i,3*a+1,3*s+1),Uo(i,3*a+2,3*s+2)}s-r<n-s?(t(e,i,r,s),r=s+1):(t(e,i,s+1,n),n=s)}}(i,r,0,i.length-1),e&&e.push(i.buffer,r.buffer),{ids:i,positions:r}},Fo.deserialize=function(t){var e=new Fo;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var Oo=Math.pow(2,53)-1;function Vo(t){var e=+t;return!isNaN(e)&&e<=Oo?e:Bo(String(t))}function Uo(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}Qr("FeaturePositionMap",Fo);var jo=function(t,e){this.gl=t.gl,this.location=e},No=function(t){function e(e,i){t.call(this,e,i),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(jo),qo=function(t){function e(e,i){t.call(this,e,i),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(jo),Zo=function(t){function e(e,i){t.call(this,e,i),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(jo),Go=function(t){function e(e,i){t.call(this,e,i),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(jo),Xo=function(t){function e(e,i){t.call(this,e,i),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(jo),Wo=function(t){function e(e,i){t.call(this,e,i),this.current=me.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(jo),Ho=new Float32Array(16),Ko=function(t){function e(e,i){t.call(this,e,i),this.current=Ho}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(jo);function Yo(t){return[Po(255*t.r,255*t.g),Po(255*t.b,255*t.a)]}var Jo=function(t,e,i){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=i};Jo.prototype.setUniform=function(t,e,i){t.set(i.constantOr(this.value))},Jo.prototype.getBinding=function(t,e,i){return"color"===this.type?new Wo(t,e):new qo(t,e)};var Qo=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Qo.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Qo.prototype.setUniform=function(t,e,i,r){var n="u_pattern_to"===r?this.patternTo:"u_pattern_from"===r?this.patternFrom:"u_pixel_ratio_to"===r?this.pixelRatioTo:"u_pixel_ratio_from"===r?this.pixelRatioFrom:null;n&&t.set(n)},Qo.prototype.getBinding=function(t,e,i){return"u_pattern"===i.substr(0,9)?new Xo(t,e):new qo(t,e)};var $o=function(t,e,i,r){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===i?2:1,offset:0}})),this.paintVertexArray=new r};$o.prototype.populatePaintArray=function(t,e,i,r,n){var o=this.paintVertexArray.length,a=this.expression.evaluate(new kn(0),e,{},r,[],n);this.paintVertexArray.resize(t),this._setPaintValue(o,t,a)},$o.prototype.updatePaintArray=function(t,e,i,r){var n=this.expression.evaluate({zoom:0},i,r);this._setPaintValue(t,e,n)},$o.prototype._setPaintValue=function(t,e,i){if("color"===this.type)for(var r=Yo(i),n=t;n<e;n++)this.paintVertexArray.emplace(n,r[0],r[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}},$o.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},$o.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var ta=function(t,e,i,r,n,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=i,this.useIntegerZoom=r,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===i?4:2,offset:0}})),this.paintVertexArray=new o};ta.prototype.populatePaintArray=function(t,e,i,r,n){var o=this.expression.evaluate(new kn(this.zoom),e,{},r,[],n),a=this.expression.evaluate(new kn(this.zoom+1),e,{},r,[],n),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,o,a)},ta.prototype.updatePaintArray=function(t,e,i,r){var n=this.expression.evaluate({zoom:this.zoom},i,r),o=this.expression.evaluate({zoom:this.zoom+1},i,r);this._setPaintValue(t,e,n,o)},ta.prototype._setPaintValue=function(t,e,i,r){if("color"===this.type)for(var n=Yo(i),o=Yo(r),a=t;a<e;a++)this.paintVertexArray.emplace(a,n[0],n[1],o[0],o[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}},ta.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ta.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ta.prototype.setUniform=function(t,e){var i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=p(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(r)},ta.prototype.getBinding=function(t,e,i){return new qo(t,e)};var ea=function(t,e,i,r,n,o){this.expression=t,this.type=e,this.useIntegerZoom=i,this.zoom=r,this.layerId=o,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n};ea.prototype.populatePaintArray=function(t,e,i){var r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,e.patterns&&e.patterns[this.layerId],i)},ea.prototype.updatePaintArray=function(t,e,i,r,n){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],n)},ea.prototype._setPaintValues=function(t,e,i,r){if(r&&i){var n=r[i.min],o=r[i.mid],a=r[i.max];if(n&&o&&a)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],n.tl[0],n.tl[1],n.br[0],n.br[1],o.pixelRatio,n.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],o.pixelRatio,a.pixelRatio)}},ea.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,Do.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Do.members,this.expression.isStateDependent))},ea.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var ia=function(t,e,i){this.binders={},this._buffers=[];var r=[];for(var n in t.paint._values)if(i(n)){var o=t.paint.get(n);if(o instanceof Rn&&Hi(o.property.specification)){var a=na(n,t.type),s=o.value,u=o.property.specification.type,l=o.property.useIntegerZoom,c=o.property.specification["property-type"],p="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===s.kind)this.binders[n]=p?new Qo(s.value,a):new Jo(s.value,a,u),r.push("/u_"+n);else if("source"===s.kind||p){var h=oa(n,u,"source");this.binders[n]=p?new ea(s,u,l,e,h,t.id):new $o(s,a,u,h),r.push("/a_"+n)}else{var f=oa(n,u,"composite");this.binders[n]=new ta(s,a,u,l,e,f),r.push("/z_"+n)}}}this.cacheKey=r.sort().join("")};ia.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof $o||e instanceof ta?e.maxValue:0},ia.prototype.populatePaintArrays=function(t,e,i,r,n){for(var o in this.binders){var a=this.binders[o];(a instanceof $o||a instanceof ta||a instanceof ea)&&a.populatePaintArray(t,e,i,r,n)}},ia.prototype.setConstantPatternPositions=function(t,e){for(var i in this.binders){var r=this.binders[i];r instanceof Qo&&r.setConstantPatternPositions(t,e)}},ia.prototype.updatePaintArrays=function(t,e,i,r,n){var o=!1;for(var a in t)for(var s=0,u=e.getPositions(a);s<u.length;s+=1){var l=u[s],c=i.feature(l.index);for(var p in this.binders){var h=this.binders[p];if((h instanceof $o||h instanceof ta||h instanceof ea)&&!0===h.expression.isStateDependent){var f=r.paint.get(p);h.expression=f.value,h.updatePaintArray(l.start,l.end,c,t[a],n),o=!0}}}return o},ia.prototype.defines=function(){var t=[];for(var e in this.binders){var i=this.binders[e];(i instanceof Jo||i instanceof Qo)&&t.push.apply(t,i.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},ia.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var i=this.binders[e];if(i instanceof $o||i instanceof ta)for(var r=0;r<i.paintVertexAttributes.length;r++)t.push(i.paintVertexAttributes[r].name);else if(i instanceof ea)for(var n=0;n<Do.members.length;n++)t.push(Do.members[n].name)}return t},ia.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var i=this.binders[e];if(i instanceof Jo||i instanceof Qo||i instanceof ta)for(var r=0,n=i.uniformNames;r<n.length;r+=1)t.push(n[r])}return t},ia.prototype.getPaintVertexBuffers=function(){return this._buffers},ia.prototype.getUniforms=function(t,e){var i=[];for(var r in this.binders){var n=this.binders[r];if(n instanceof Jo||n instanceof Qo||n instanceof ta)for(var o=0,a=n.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var u=n.getBinding(t,e[s],s);i.push({name:s,property:r,binding:u})}}}return i},ia.prototype.setUniforms=function(t,e,i,r){for(var n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.name,u=a.property;this.binders[u].setUniform(a.binding,r,i.get(u),s)}},ia.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var i=this.binders[e];if(t&&i instanceof ea){var r=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;r&&this._buffers.push(r)}else(i instanceof $o||i instanceof ta)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}},ia.prototype.upload=function(t){for(var e in this.binders){var i=this.binders[e];(i instanceof $o||i instanceof ta||i instanceof ea)&&i.upload(t)}this.updatePaintBuffers()},ia.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof $o||e instanceof ta||e instanceof ea)&&e.destroy()}};var ra=function(t,e,i){void 0===i&&(i=function(){return!0}),this.programConfigurations={};for(var r=0,n=t;r<n.length;r+=1){var o=n[r];this.programConfigurations[o.id]=new ia(o,e,i)}this.needsUpload=!1,this._featureMap=new Fo,this._bufferOffset=0};function na(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function oa(t,e,i){var r={color:{source:to,composite:go},number:{source:ho,composite:to}},n=function(t){return{"line-pattern":{source:eo,composite:eo},"fill-pattern":{source:eo,composite:eo},"fill-extrusion-pattern":{source:eo,composite:eo}}[t]}(t);return n&&n[i]||r[e][i]}ra.prototype.populatePaintArrays=function(t,e,i,r,n,o){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,r,n,o);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},ra.prototype.updatePaintArrays=function(t,e,i,r){for(var n=0,o=i;n<o.length;n+=1){var a=o[n];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,r)||this.needsUpload}},ra.prototype.get=function(t){return this.programConfigurations[t]},ra.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},ra.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Qr("ConstantBinder",Jo),Qr("CrossFadedConstantBinder",Qo),Qr("SourceExpressionBinder",$o),Qr("CrossFadedCompositeBinder",ea),Qr("CompositeExpressionBinder",ta),Qr("ProgramConfiguration",ia,{omit:["_buffers"]}),Qr("ProgramConfigurationSet",ra);var aa=Math.pow(2,14)-1,sa=-aa-1;function ua(t){for(var e=8192/t.extent,i=t.loadGeometry(),r=0;r<i.length;r++)for(var n=i[r],o=0;o<n.length;o++){var a=n[o],s=Math.round(a.x*e),u=Math.round(a.y*e);a.x=p(s,sa,aa),a.y=p(u,sa,aa),(s<a.x||s>a.x+1||u<a.y||u>a.y+1)&&z("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function la(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ua(t):[]}}function ca(t,e,i,r,n){t.emplaceBack(2*e+(r+1)/2,2*i+(n+1)/2)}var pa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Yn,this.indexArray=new lo,this.segments=new Co,this.programConfigurations=new ra(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ha(t,e){for(var i=0;i<t.length;i++)if(ba(e,t[i]))return!0;for(var r=0;r<e.length;r++)if(ba(t,e[r]))return!0;return!!ya(t,e)}function fa(t,e,i){return!!ba(t,e)||!!ga(e,t,i)}function da(t,e){if(1===t.length)return xa(e,t[0]);for(var i=0;i<e.length;i++)for(var r=e[i],n=0;n<r.length;n++)if(ba(t,r[n]))return!0;for(var o=0;o<t.length;o++)if(xa(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(ya(t,e[a]))return!0;return!1}function ma(t,e,i){if(t.length>1){if(ya(t,e))return!0;for(var r=0;r<e.length;r++)if(ga(e[r],t,i))return!0}for(var n=0;n<t.length;n++)if(ga(t[n],e,i))return!0;return!1}function ya(t,e){if(0===t.length||0===e.length)return!1;for(var i=0;i<t.length-1;i++)for(var r=t[i],n=t[i+1],o=0;o<e.length-1;o++)if(_a(r,n,e[o],e[o+1]))return!0;return!1}function _a(t,e,i,r){return E(t,i,r)!==E(e,i,r)&&E(t,e,i)!==E(t,e,r)}function ga(t,e,i){var r=i*i;if(1===e.length)return t.distSqr(e[0])<r;for(var n=1;n<e.length;n++)if(va(t,e[n-1],e[n])<r)return!0;return!1}function va(t,e,i){var r=e.distSqr(i);if(0===r)return t.distSqr(e);var n=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return t.distSqr(n<0?e:n>1?i:i.sub(e)._mult(n)._add(e))}function xa(t,e){for(var i,r,n,o=!1,a=0;a<t.length;a++)for(var s=0,u=(i=t[a]).length-1;s<i.length;u=s++)(r=i[s]).y>e.y!=(n=i[u]).y>e.y&&e.x<(n.x-r.x)*(e.y-r.y)/(n.y-r.y)+r.x&&(o=!o);return o}function ba(t,e){for(var i=!1,r=0,n=t.length-1;r<t.length;n=r++){var o=t[r],a=t[n];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(i=!i)}return i}function wa(t,e,i){var r=i[0],n=i[2];if(t.x<r.x&&e.x<r.x||t.x>n.x&&e.x>n.x||t.y<r.y&&e.y<r.y||t.y>n.y&&e.y>n.y)return!1;var o=E(t,e,i[0]);return o!==E(t,e,i[1])||o!==E(t,e,i[2])||o!==E(t,e,i[3])}function Ia(t,e,i){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Sa(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ta(t,e,i,r,o){if(!e[0]&&!e[1])return t;var a=n.convert(e)._mult(o);"viewport"===i&&a._rotate(-r);for(var s=[],u=0;u<t.length;u++)s.push(t[u].sub(a));return s}pa.prototype.populate=function(t,e,i){var r=this.layers[0],n=[],o=null;"circle"===r.type&&(o=r.layout.get("circle-sort-key"));for(var a=0,s=t;a<s.length;a+=1){var u=s[a],l=u.feature,c=u.id,p=u.index,h=u.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d=la(l,f);if(this.layers[0]._featureFilter.filter(new kn(this.zoom),d,i)){var m=o?o.evaluate(d,{},i):void 0,y={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:p,geometry:f?d.geometry:ua(l),patterns:{},sortKey:m};n.push(y)}}o&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var _=0,g=n;_<g.length;_+=1){var v=g[_],x=v.geometry,b=v.index,w=v.sourceLayerIndex,I=t[b].feature;this.addFeature(v,x,b,i),e.featureIndex.insert(I,x,b,w,this.index)}},pa.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},pa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},pa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},pa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ko),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},pa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},pa.prototype.addFeature=function(t,e,i,r){for(var n=0,o=e;n<o.length;n+=1)for(var a=0,s=o[n];a<s.length;a+=1){var u=s[a],l=u.x,c=u.y;if(!(l<0||l>=8192||c<0||c>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=p.vertexLength;ca(this.layoutVertexArray,l,c,-1,-1),ca(this.layoutVertexArray,l,c,1,-1),ca(this.layoutVertexArray,l,c,1,1),ca(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},r)},Qr("CircleBucket",pa,{omit:["layers"]});var Aa=new qn({"circle-sort-key":new Vn(Zt.layout_circle["circle-sort-key"])}),za={paint:new qn({"circle-radius":new Vn(Zt.paint_circle["circle-radius"]),"circle-color":new Vn(Zt.paint_circle["circle-color"]),"circle-blur":new Vn(Zt.paint_circle["circle-blur"]),"circle-opacity":new Vn(Zt.paint_circle["circle-opacity"]),"circle-translate":new On(Zt.paint_circle["circle-translate"]),"circle-translate-anchor":new On(Zt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new On(Zt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new On(Zt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Vn(Zt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Vn(Zt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Vn(Zt.paint_circle["circle-stroke-opacity"])}),layout:Aa},Ea="undefined"!=typeof Float32Array?Float32Array:Array;function ka(){var t=new Ea(16);return Ea!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Ca(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Pa(t,e){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],_=e[15],g=i*s-r*a,v=i*u-n*a,x=i*l-o*a,b=r*u-n*s,w=r*l-o*s,I=n*l-o*u,S=c*m-p*d,T=c*y-h*d,A=c*_-f*d,z=p*y-h*m,E=p*_-f*m,k=h*_-f*y,C=g*k-v*E+x*z+b*A-w*T+I*S;return C?(t[0]=(s*k-u*E+l*z)*(C=1/C),t[1]=(n*E-r*k-o*z)*C,t[2]=(m*I-y*w+_*b)*C,t[3]=(h*w-p*I-f*b)*C,t[4]=(u*A-a*k-l*T)*C,t[5]=(i*k-n*A+o*T)*C,t[6]=(y*x-d*I-_*v)*C,t[7]=(c*I-h*x+f*v)*C,t[8]=(a*E-s*A+l*S)*C,t[9]=(r*A-i*E-o*S)*C,t[10]=(d*w-m*x+_*g)*C,t[11]=(p*x-c*w-f*g)*C,t[12]=(s*T-a*z-u*S)*C,t[13]=(i*z-r*T+n*S)*C,t[14]=(m*v-d*b-y*g)*C,t[15]=(c*b-p*v+h*g)*C,t):null}function Da(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],_=e[14],g=e[15],v=i[0],x=i[1],b=i[2],w=i[3];return t[0]=v*r+x*s+b*p+w*m,t[1]=v*n+x*u+b*h+w*y,t[2]=v*o+x*l+b*f+w*_,t[3]=v*a+x*c+b*d+w*g,t[4]=(v=i[4])*r+(x=i[5])*s+(b=i[6])*p+(w=i[7])*m,t[5]=v*n+x*u+b*h+w*y,t[6]=v*o+x*l+b*f+w*_,t[7]=v*a+x*c+b*d+w*g,t[8]=(v=i[8])*r+(x=i[9])*s+(b=i[10])*p+(w=i[11])*m,t[9]=v*n+x*u+b*h+w*y,t[10]=v*o+x*l+b*f+w*_,t[11]=v*a+x*c+b*d+w*g,t[12]=(v=i[12])*r+(x=i[13])*s+(b=i[14])*p+(w=i[15])*m,t[13]=v*n+x*u+b*h+w*y,t[14]=v*o+x*l+b*f+w*_,t[15]=v*a+x*c+b*d+w*g,t}function Ma(t,e,i){var r,n,o,a,s,u,l,c,p,h,f,d,m=i[0],y=i[1],_=i[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*_+e[12],t[13]=e[1]*m+e[5]*y+e[9]*_+e[13],t[14]=e[2]*m+e[6]*y+e[10]*_+e[14],t[15]=e[3]*m+e[7]*y+e[11]*_+e[15]):(n=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=r*m+s*y+p*_+e[12],t[13]=n*m+u*y+h*_+e[13],t[14]=o*m+l*y+f*_+e[14],t[15]=a*m+c*y+d*_+e[15]),t}function La(t,e,i){var r=i[0],n=i[1],o=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ba(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],p=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n+l*r,t[1]=a*n+c*r,t[2]=s*n+p*r,t[3]=u*n+h*r,t[4]=l*n-o*r,t[5]=c*n-a*r,t[6]=p*n-s*r,t[7]=h*n-u*r,t}function Ra(t,e,i,r,n,o,a){var s=1/(e-i),u=1/(r-n),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*s,t[13]=(n+r)*u,t[14]=(a+o)*l,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,i=arguments.length;i--;)e+=t[i]*t[i];return Math.sqrt(e)});var Fa=Da;function Oa(t){var e=new Ea(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}var Va,Ua=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t};function ja(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*o+i[12]*a,t[1]=i[1]*r+i[5]*n+i[9]*o+i[13]*a,t[2]=i[2]*r+i[6]*n+i[10]*o+i[14]*a,t[3]=i[3]*r+i[7]*n+i[11]*o+i[15]*a,t}Va=new Ea(3),Ea!=Float32Array&&(Va[0]=0,Va[1]=0,Va[2]=0),function(){var t=new Ea(4);Ea!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Na=function(t){var e=t[0],i=t[1];return e*e+i*i},qa=(function(){var t=new Ea(2);Ea!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,za)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new pa(t)},e.prototype.queryRadius=function(t){var e=t;return Ia("circle-radius",this,e)+Ia("circle-stroke-width",this,e)+Sa(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,n,o,a,s){for(var u=Ta(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),c="map"===this.paint.get("circle-pitch-alignment"),p=c?u:function(t,e){return t.map((function(t){return Za(t,e)}))}(u,s),h=c?l*a:l,f=0,d=r;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1){var _=y[m],g=c?_:Za(_,s),v=h,x=ja([],[_.x,_.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?v*=x[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(v*=o.cameraToCenterDistance/x[3]),fa(p,g,v))return!0}return!1},e}(Zn));function Za(t,e){var i=ja([],[t.x,t.y,0,1],e);return new n(i[0]/i[3],i[1]/i[3])}var Ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(pa);function Xa(t,e,i,r){var n=e.width,o=e.height;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==n*o*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*o*i);return t.width=n,t.height=o,t.data=r,t}function Wa(t,e,i){var r=e.width,n=e.height;if(r!==t.width||n!==t.height){var o=Xa({},{width:r,height:n},i);Ha(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,n)},i),t.width=r,t.height=n,t.data=o.data}}function Ha(t,e,i,r,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<n.height;u++)for(var l=((i.y+u)*t.width+i.x)*o,c=((r.y+u)*e.width+r.x)*o,p=0;p<n.width*o;p++)s[c+p]=a[l+p];return e}Qr("HeatmapBucket",Ga,{omit:["layers"]});var Ka=function(t,e){Xa(this,t,1,e)};Ka.prototype.resize=function(t){Wa(this,t,1)},Ka.prototype.clone=function(){return new Ka({width:this.width,height:this.height},new Uint8Array(this.data))},Ka.copy=function(t,e,i,r,n){Ha(t,e,i,r,n,1)};var Ya=function(t,e){Xa(this,t,4,e)};Ya.prototype.resize=function(t){Wa(this,t,4)},Ya.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},Ya.prototype.clone=function(){return new Ya({width:this.width,height:this.height},new Uint8Array(this.data))},Ya.copy=function(t,e,i,r,n){Ha(t,e,i,r,n,4)},Qr("AlphaImage",Ka),Qr("RGBAImage",Ya);var Ja={paint:new qn({"heatmap-radius":new Vn(Zt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Vn(Zt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new On(Zt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Nn(Zt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new On(Zt.paint_heatmap["heatmap-opacity"])})};function Qa(t){var e={},i=t.resolution||256,r=t.clips?t.clips.length:1,n=t.image||new Ya({width:i,height:r}),o=function(i,r,o){e[t.evaluationKey]=o;var a=t.expression.evaluate(e);n.data[i+r+0]=Math.floor(255*a.r/a.a),n.data[i+r+1]=Math.floor(255*a.g/a.a),n.data[i+r+2]=Math.floor(255*a.b/a.a),n.data[i+r+3]=Math.floor(255*a.a)};if(t.clips)for(var a=0,s=0;a<r;++a,s+=4*i)for(var u=0,l=0;u<i;u++,l+=4){var c=u/(i-1),p=t.clips[a];o(s,l,p.start*(1-c)+p.end*c)}else for(var h=0,f=0;h<i;h++,f+=4)o(0,f,h/(i-1));return n}var $a=function(t){function e(e){t.call(this,e,Ja),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Ga(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=Qa({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(Zn),ts={paint:new qn({"hillshade-illumination-direction":new On(Zt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new On(Zt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new On(Zt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new On(Zt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new On(Zt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new On(Zt.paint_hillshade["hillshade-accent-color"])})},es=function(t){function e(e){t.call(this,e,ts)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(Zn),is=Hn([{name:"a_pos",components:2,type:"Int16"}],4).members,rs=os,ns=os;function os(t,e,i){i=i||2;var r,n,o,a,s,u,l,c=e&&e.length,p=c?e[0]*i:t.length,h=as(t,0,p,i,!0),f=[];if(!h||h.next===h.prev)return f;if(c&&(h=function(t,e,i,r){var n,o,a,s=[];for(n=0,o=e.length;n<o;n++)(a=as(t,e[n]*r,n<o-1?e[n+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),s.push(_s(a));for(s.sort(fs),n=0;n<s.length;n++)ds(s[n],i),i=ss(i,i.next);return i}(t,e,h,i)),t.length>80*i){r=o=t[0],n=a=t[1];for(var d=i;d<p;d+=i)(s=t[d])<r&&(r=s),(u=t[d+1])<n&&(n=u),s>o&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-r,a-n))?1/l:0}return us(h,f,i,r,n,l),f}function as(t,e,i,r,n){var o,a;if(n===Cs(t,e,i,r)>0)for(o=e;o<i;o+=r)a=zs(o,t[o],t[o+1],a);else for(o=i-r;o>=e;o-=r)a=zs(o,t[o],t[o+1],a);return a&&bs(a,a.next)&&(Es(a),a=a.next),a}function ss(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!bs(r,r.next)&&0!==xs(r.prev,r,r.next))r=r.next;else{if(Es(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function us(t,e,i,r,n,o,a){if(t){!a&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=ys(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,r,n,o,a,s,u,l=1;do{for(i=t,t=null,o=null,a=0;i;){for(a++,r=i,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||i.z<=r.z)?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,u--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,l*=2}while(a>1)}(n)}(t,r,n,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?cs(t,r,n,o):ls(t))e.push(s.i/i),e.push(t.i/i),e.push(u.i/i),Es(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?us(t=ps(ss(t),e,i),e,i,r,n,o,2):2===a&&hs(t,e,i,r,n,o):us(ss(t),e,i,r,n,o,1);break}}}function ls(t){var e=t.prev,i=t,r=t.next;if(xs(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(gs(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&xs(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function cs(t,e,i,r){var n=t.prev,o=t,a=t.next;if(xs(n,o,a)>=0)return!1;for(var s=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,u=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,l=ys(n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,e,i,r),c=ys(s,u,e,i,r),p=t.prevZ,h=t.nextZ;p&&p.z>=l&&h&&h.z<=c;){if(p!==t.prev&&p!==t.next&&gs(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,h!==t.prev&&h!==t.next&&gs(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&xs(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;p&&p.z>=l;){if(p!==t.prev&&p!==t.next&&gs(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;h&&h.z<=c;){if(h!==t.prev&&h!==t.next&&gs(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&xs(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function ps(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!bs(n,o)&&ws(n,r,r.next,o)&&Ts(n,o)&&Ts(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),Es(r),Es(r.next),r=t=o),r=r.next}while(r!==t);return ss(r)}function hs(t,e,i,r,n,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&vs(a,s)){var u=As(a,s);return a=ss(a,a.next),u=ss(u,u.next),us(a,e,i,r,n,o),void us(u,e,i,r,n,o)}s=s.next}a=a.next}while(a!==t)}function fs(t,e){return t.x-e.x}function ds(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!i)return null;if(n===a)return i;var u,l=i,c=i.x,p=i.y,h=1/0;r=i;do{n>=r.x&&r.x>=c&&n!==r.x&&gs(o<p?n:a,o,c,p,o<p?a:n,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(n-r.x),Ts(r,t)&&(u<h||u===h&&(r.x>i.x||r.x===i.x&&ms(i,r)))&&(i=r,h=u)),r=r.next}while(r!==l);return i}(t,e)){var i=As(e,t);ss(e,e.next),ss(i,i.next)}}function ms(t,e){return xs(t.prev,t,e.prev)<0&&xs(e.next,t,t.next)<0}function ys(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function _s(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function gs(t,e,i,r,n,o,a,s){return(n-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(i-a)*(e-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function vs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&ws(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Ts(t,e)&&Ts(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(xs(t.prev,t,e.prev)||xs(t,e.prev,e))||bs(t,e)&&xs(t.prev,t,t.next)>0&&xs(e.prev,e,e.next)>0)}function xs(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function bs(t,e){return t.x===e.x&&t.y===e.y}function ws(t,e,i,r){var n=Ss(xs(t,e,i)),o=Ss(xs(t,e,r)),a=Ss(xs(i,r,t)),s=Ss(xs(i,r,e));return n!==o&&a!==s||!(0!==n||!Is(t,i,e))||!(0!==o||!Is(t,r,e))||!(0!==a||!Is(i,t,r))||!(0!==s||!Is(i,e,r))}function Is(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Ss(t){return t>0?1:t<0?-1:0}function Ts(t,e){return xs(t.prev,t,t.next)<0?xs(t,e,t.next)>=0&&xs(t,t.prev,e)>=0:xs(t,e,t.prev)<0||xs(t,t.next,e)<0}function As(t,e){var i=new ks(t.i,t.x,t.y),r=new ks(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function zs(t,e,i,r){var n=new ks(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function Es(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ks(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cs(t,e,i,r){for(var n=0,o=e,a=i-r;o<i;o+=r)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}function Ps(t,e,i,r,n){!function t(e,i,r,n,o){for(;n>r;){if(n-r>600){var a=n-r+1,s=i-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,i,Math.max(r,Math.floor(i-s*l/a+c)),Math.min(n,Math.floor(i+(a-s)*l/a+c)),o)}var p=e[i],h=r,f=n;for(Ds(e,r,i),o(e[n],p)>0&&Ds(e,r,n);h<f;){for(Ds(e,h,f),h++,f--;o(e[h],p)<0;)h++;for(;o(e[f],p)>0;)f--}0===o(e[r],p)?Ds(e,r,f):Ds(e,++f,n),f<=i&&(r=f+1),i<=f&&(n=f-1)}}(t,e,i||0,r||t.length-1,n||Ms)}function Ds(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function Ms(t,e){return t<e?-1:t>e?1:0}function Ls(t,e){var i=t.length;if(i<=1)return[t];for(var r,n,o=[],a=0;a<i;a++){var s=k(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(r&&o.push(r),r=[t[a]]):r.push(t[a]))}if(r&&o.push(r),e>1)for(var u=0;u<o.length;u++)o[u].length<=e||(Ps(o[u],e,1,o[u].length-1,Bs),o[u]=o[u].slice(0,e));return o}function Bs(t,e){return e.area-t.area}function Rs(t,e,i){for(var r=i.patternDependencies,n=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(n=!0);var u=s.constantOr(null);u&&(n=!0,r[u.to]=!0,r[u.from]=!0)}return n}function Fs(t,e,i,r,n){for(var o=n.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var c=l.evaluate({zoom:r-1},i,{},n.availableImages),p=l.evaluate({zoom:r},i,{},n.availableImages),h=l.evaluate({zoom:r+1},i,{},n.availableImages);p=p&&p.name?p.name:p,h=h&&h.name?h.name:h,o[c=c&&c.name?c.name:c]=!0,o[p]=!0,o[h]=!0,i.patterns[u.id]={min:c,mid:p,max:h}}}return i}os.deviation=function(t,e,i,r){var n=e&&e.length,o=Math.abs(Cs(t,0,n?e[0]*i:t.length,i));if(n)for(var a=0,s=e.length;a<s;a++)o-=Math.abs(Cs(t,e[a]*i,a<s-1?e[a+1]*i:t.length,i));var u=0;for(a=0;a<r.length;a+=3){var l=r[a]*i,c=r[a+1]*i,p=r[a+2]*i;u+=Math.abs((t[l]-t[p])*(t[c+1]-t[l+1])-(t[l]-t[c])*(t[p+1]-t[l+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},os.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var a=0;a<e;a++)i.vertices.push(t[n][o][a]);n>0&&i.holes.push(r+=t[n-1].length)}return i},rs.default=ns;var Os=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Yn,this.indexArray=new lo,this.indexArray2=new yo,this.programConfigurations=new ra(t.layers,t.zoom),this.segments=new Co,this.segments2=new Co,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Os.prototype.populate=function(t,e,i){this.hasPattern=Rs("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.id,c=s.index,p=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f=la(u,h);if(this.layers[0]._featureFilter.filter(new kn(this.zoom),f,i)){var d=r?r.evaluate(f,{},i,e.availableImages):void 0,m={id:l,properties:u.properties,type:u.type,sourceLayerIndex:p,index:c,geometry:h?f.geometry:ua(u),patterns:{},sortKey:d};n.push(m)}}r&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,_=n;y<_.length;y+=1){var g=_[y],v=g.geometry,x=g.index,b=g.sourceLayerIndex;if(this.hasPattern){var w=Fs("fill",this.layers,g,this.zoom,e);this.patternFeatures.push(w)}else this.addFeature(g,v,x,i,{});e.featureIndex.insert(t[x].feature,v,x,b,this.index)}},Os.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},Os.prototype.addFeatures=function(t,e,i){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var o=n[r];this.addFeature(o,o.geometry,o.index,e,i)}},Os.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Os.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Os.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,is),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Os.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Os.prototype.addFeature=function(t,e,i,r,n){for(var o=0,a=Ls(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,c=s;l<c.length;l+=1)u+=c[l].length;for(var p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),h=p.vertexLength,f=[],d=[],m=0,y=s;m<y.length;m+=1){var _=y[m];if(0!==_.length){_!==s[0]&&d.push(f.length/2);var g=this.segments2.prepareSegment(_.length,this.layoutVertexArray,this.indexArray2),v=g.vertexLength;this.layoutVertexArray.emplaceBack(_[0].x,_[0].y),this.indexArray2.emplaceBack(v+_.length-1,v),f.push(_[0].x),f.push(_[0].y);for(var x=1;x<_.length;x++)this.layoutVertexArray.emplaceBack(_[x].x,_[x].y),this.indexArray2.emplaceBack(v+x-1,v+x),f.push(_[x].x),f.push(_[x].y);g.vertexLength+=_.length,g.primitiveLength+=_.length}}for(var b=rs(f,d),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(h+b[w],h+b[w+1],h+b[w+2]);p.vertexLength+=u,p.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)},Qr("FillBucket",Os,{omit:["layers","patternFeatures"]});var Vs=new qn({"fill-sort-key":new Vn(Zt.layout_fill["fill-sort-key"])}),Us={paint:new qn({"fill-antialias":new On(Zt.paint_fill["fill-antialias"]),"fill-opacity":new Vn(Zt.paint_fill["fill-opacity"]),"fill-color":new Vn(Zt.paint_fill["fill-color"]),"fill-outline-color":new Vn(Zt.paint_fill["fill-outline-color"]),"fill-translate":new On(Zt.paint_fill["fill-translate"]),"fill-translate-anchor":new On(Zt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Un(Zt.paint_fill["fill-pattern"])}),layout:Vs},js=function(t){function e(e){t.call(this,e,Us)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,i){t.prototype.recalculate.call(this,e,i);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new Os(t)},e.prototype.queryRadius=function(){return Sa(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,n,o,a){return da(Ta(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),r)},e.prototype.isTileClipped=function(){return!0},e}(Zn),Ns=Hn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,qs=Zs;function Zs(t,e,i,r,n){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=n,t.readFields(Gs,this,e)}function Gs(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var r=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[r]=n}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function Xs(t){for(var e,i,r=0,n=0,o=t.length,a=o-1;n<o;a=n++)r+=((i=t[a]).x-(e=t[n]).x)*(e.y+i.y);return r}Zs.types=["Unknown","Point","LineString","Polygon"],Zs.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,r=1,o=0,a=0,s=0,u=[];t.pos<i;){if(o<=0){var l=t.readVarint();r=7&l,o=l>>3}if(o--,1===r||2===r)a+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&u.push(e),e=[]),e.push(new n(a,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&u.push(e),u},Zs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,n=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(r<=0){var c=t.readVarint();i=7&c,r=c>>3}if(r--,1===i||2===i)(n+=t.readSVarint())<a&&(a=n),n>s&&(s=n),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==i)throw new Error("unknown command "+i)}return[a,u,s,l]},Zs.prototype.toGeoJSON=function(t,e,i){var r,n,o=this.extent*Math.pow(2,i),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Zs.types[this.type];function c(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(r=0;r<u.length;r++)p[r]=u[r][0];c(u=p);break;case 2:for(r=0;r<u.length;r++)c(u[r]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var i,r,n=[],o=0;o<e;o++){var a=Xs(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(i&&n.push(i),i=[t[o]]):i.push(t[o]))}return i&&n.push(i),n}(u),r=0;r<u.length;r++)for(n=0;n<u[r].length;n++)c(u[r][n])}1===u.length?u=u[0]:l="Multi"+l;var h={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return"id"in this&&(h.id=this.id),h};var Ws=Hs;function Hs(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Ks,this,e),this.length=this._features.length}function Ks(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(i))}function Ys(t,e,i){if(3===t){var r=new Ws(i,i.readVarint()+i.pos);r.length&&(e[r.name]=r)}}Hs.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new qs(this._pbf,e,this.extent,this._keys,this._values)};var Js={VectorTile:function(t,e){this.layers=t.readFields(Ys,{},e)},VectorTileFeature:qs,VectorTileLayer:Ws},Qs=Js.VectorTileFeature.types,$s=Math.pow(2,13);function tu(t,e,i,r,n,o,a,s){t.emplaceBack(e,i,2*Math.floor(r*$s)+a,n*$s*2,o*$s*2,Math.round(s))}var eu=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Qn,this.indexArray=new lo,this.programConfigurations=new ra(t.layers,t.zoom),this.segments=new Co,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function iu(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}eu.prototype.populate=function(t,e,i){this.features=[],this.hasPattern=Rs("fill-extrusion",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var o=n[r],a=o.feature,s=o.id,u=o.index,l=o.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,p=la(a,c);if(this.layers[0]._featureFilter.filter(new kn(this.zoom),p,i)){var h={id:s,sourceLayerIndex:l,index:u,geometry:c?p.geometry:ua(a),properties:a.properties,type:a.type,patterns:{}};this.hasPattern?this.features.push(Fs("fill-extrusion",this.layers,h,this.zoom,e)):this.addFeature(h,h.geometry,u,i,{}),e.featureIndex.insert(a,h.geometry,u,l,this.index,!0)}}},eu.prototype.addFeatures=function(t,e,i){for(var r=0,n=this.features;r<n.length;r+=1){var o=n[r];this.addFeature(o,o.geometry,o.index,e,i)}},eu.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},eu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},eu.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},eu.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ns),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},eu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},eu.prototype.addFeature=function(t,e,i,r,n){for(var o=0,a=Ls(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,c=s;l<c.length;l+=1)u+=c[l].length;for(var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,f=s;h<f.length;h+=1){var d=f[h];if(0!==d.length&&!((D=d).every((function(t){return t.x<0}))||D.every((function(t){return t.x>8192}))||D.every((function(t){return t.y<0}))||D.every((function(t){return t.y>8192}))))for(var m=0,y=0;y<d.length;y++){var _=d[y];if(y>=1){var g=d[y-1];if(!iu(_,g)){p.vertexLength+4>Co.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=_.sub(g)._perp()._unit(),x=g.dist(_);m+x>32768&&(m=0),tu(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,0,m),tu(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,1,m),tu(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,0,m+=x),tu(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,1,m);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+u>Co.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===Qs[t.type]){for(var w=[],I=[],S=p.vertexLength,T=0,A=s;T<A.length;T+=1){var z=A[T];if(0!==z.length){z!==s[0]&&I.push(w.length/2);for(var E=0;E<z.length;E++){var k=z[E];tu(this.layoutVertexArray,k.x,k.y,0,0,1,1,0),w.push(k.x),w.push(k.y)}}}for(var C=rs(w,I),P=0;P<C.length;P+=3)this.indexArray.emplaceBack(S+C[P],S+C[P+2],S+C[P+1]);p.primitiveLength+=C.length/3,p.vertexLength+=u}}var D;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)},Qr("FillExtrusionBucket",eu,{omit:["layers","features"]});var ru={paint:new qn({"fill-extrusion-opacity":new On(Zt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Vn(Zt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new On(Zt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new On(Zt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Un(Zt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Vn(Zt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Vn(Zt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new On(Zt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},nu=function(t){function e(e){t.call(this,e,ru)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new eu(t)},e.prototype.queryRadius=function(){return Sa(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,i,r,o,a,s,u){var l=Ta(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,i),p=this.paint.get("fill-extrusion-base").evaluate(e,i),h=function(t,e,i,r){for(var o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=[u.x,u.y,0,1];ja(l,l,e),o.push(new n(l[0]/l[3],l[1]/l[3]))}return o}(l,u),f=function(t,e,i,r){for(var o=[],a=[],s=r[8]*e,u=r[9]*e,l=r[10]*e,c=r[11]*e,p=r[8]*i,h=r[9]*i,f=r[10]*i,d=r[11]*i,m=0,y=t;m<y.length;m+=1){for(var _=[],g=[],v=0,x=y[m];v<x.length;v+=1){var b=x[v],w=b.x,I=b.y,S=r[0]*w+r[4]*I+r[12],T=r[1]*w+r[5]*I+r[13],A=r[2]*w+r[6]*I+r[14],z=r[3]*w+r[7]*I+r[15],E=A+l,k=z+c,C=S+p,P=T+h,D=A+f,M=z+d,L=new n((S+s)/k,(T+u)/k);L.z=E/k,_.push(L);var B=new n(C/M,P/M);B.z=D/M,g.push(B)}o.push(_),a.push(g)}return[o,a]}(r,p,c,u);return function(t,e,i){var r=1/0;da(i,e)&&(r=au(i,e[0]));for(var n=0;n<e.length;n++)for(var o=e[n],a=t[n],s=0;s<o.length-1;s++){var u=o[s],l=[u,o[s+1],a[s+1],a[s],u];ha(i,l)&&(r=Math.min(r,au(i,l)))}return r!==1/0&&r}(f[0],f[1],h)},e}(Zn);function ou(t,e){return t.x*e.x+t.y*e.y}function au(t,e){if(1===t.length){for(var i,r=0,n=e[r++];!i||n.equals(i);)if(!(i=e[r++]))return 1/0;for(;r<e.length;r++){var o=e[r],a=t[0],s=i.sub(n),u=o.sub(n),l=a.sub(n),c=ou(s,s),p=ou(s,u),h=ou(u,u),f=ou(l,s),d=ou(l,u),m=c*h-p*p,y=(h*f-p*d)/m,_=(c*d-p*f)/m,g=n.z*(1-y-_)+i.z*y+o.z*_;if(isFinite(g))return g}return 1/0}for(var v=1/0,x=0,b=e;x<b.length;x+=1)v=Math.min(v,b[x].z);return v}var su=Hn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,uu=Hn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,lu=Js.VectorTileFeature.types,cu=Math.cos(Math.PI/180*37.5),pu=Math.pow(2,14)/.5,hu=function(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new $n,this.layoutVertexArray2=new to,this.indexArray=new lo,this.programConfigurations=new ra(t.layers,t.zoom),this.segments=new Co,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};hu.prototype.populate=function(t,e,i){this.hasPattern=Rs("line",this.layers,e);for(var r=this.layers[0].layout.get("line-sort-key"),n=[],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.id,c=s.index,p=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f=la(u,h);if(this.layers[0]._featureFilter.filter(new kn(this.zoom),f,i)){var d=r?r.evaluate(f,{},i):void 0,m={id:l,properties:u.properties,type:u.type,sourceLayerIndex:p,index:c,geometry:h?f.geometry:ua(u),patterns:{},sortKey:d};n.push(m)}}r&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,_=n;y<_.length;y+=1){var g=_[y],v=g.geometry,x=g.index,b=g.sourceLayerIndex;if(this.hasPattern){var w=Fs("line",this.layers,g,this.zoom,e);this.patternFeatures.push(w)}else this.addFeature(g,v,x,i,{});e.featureIndex.insert(t[x].feature,v,x,b,this.index)}},hu.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},hu.prototype.addFeatures=function(t,e,i){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var o=n[r];this.addFeature(o,o.geometry,o.index,e,i)}},hu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},hu.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},hu.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,uu)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,su),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},hu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},hu.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},hu.prototype.addFeature=function(t,e,i,r,n){var o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),u=o.get("line-miter-limit"),l=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var c=0,p=e;c<p.length;c+=1)this.addLine(p[c],t,a,s,u,l);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)},hu.prototype.addLine=function(t,e,i,r,n,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===lu[e.type],u=t.length;u>=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l<u-1&&t[l].equals(t[l+1]);)l++;if(!(u<(s?3:2))){"bevel"===i&&(n=1.05);var c,p=this.overscaling<=16?122880/(512*this.overscaling):0,h=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray),f=void 0,d=void 0,m=void 0,y=void 0;this.e1=this.e2=-1,s&&(y=t[l].sub(c=t[u-2])._unit()._perp());for(var _=l;_<u;_++)if(!(d=_===u-1?s?t[l+1]:void 0:t[_+1])||!t[_].equals(d)){y&&(m=y),c&&(f=c),c=t[_],y=d?d.sub(c)._unit()._perp():m;var g=(m=m||y).add(y);0===g.x&&0===g.y||g._unit();var v=m.x*y.x+m.y*y.y,x=g.x*y.x+g.y*y.y,b=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),I=x<cu&&f&&d,S=m.x*y.y-m.y*y.x>0;if(I&&_>l){var T=c.dist(f);if(T>2*p){var A=c.sub(c.sub(f)._mult(p/T)._round());this.updateDistance(f,A),this.addCurrentVertex(A,m,0,0,h),f=A}}var z=f&&d,E=z?i:s?"butt":r;if(z&&"round"===E&&(b<o?E="miter":b<=2&&(E="fakeround")),"miter"===E&&b>n&&(E="bevel"),"bevel"===E&&(b>2&&(E="flipbevel"),b<n&&(E="miter")),f&&this.updateDistance(f,c),"miter"===E)g._mult(b),this.addCurrentVertex(c,g,0,0,h);else if("flipbevel"===E){if(b>100)g=y.mult(-1);else{var k=b*m.add(y).mag()/m.sub(y).mag();g._perp()._mult(k*(S?-1:1))}this.addCurrentVertex(c,g,0,0,h),this.addCurrentVertex(c,g.mult(-1),0,0,h)}else if("bevel"===E||"fakeround"===E){var C=-Math.sqrt(b*b-1),P=S?C:0,D=S?0:C;if(f&&this.addCurrentVertex(c,m,P,D,h),"fakeround"===E)for(var M=Math.round(180*w/Math.PI/20),L=1;L<M;L++){var B=L/M;if(.5!==B){var R=B-.5;B+=B*R*(B-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*R*R+(.848013+v*(.215638*v-1.06021)))}var F=y.sub(m)._mult(B)._add(m)._unit()._mult(S?-1:1);this.addHalfVertex(c,F.x,F.y,!1,S,0,h)}d&&this.addCurrentVertex(c,y,-P,-D,h)}else if("butt"===E)this.addCurrentVertex(c,g,0,0,h);else if("square"===E){var O=f?1:-1;this.addCurrentVertex(c,g,O,O,h)}else"round"===E&&(f&&(this.addCurrentVertex(c,m,0,0,h),this.addCurrentVertex(c,m,1,1,h,!0)),d&&(this.addCurrentVertex(c,y,-1,-1,h,!0),this.addCurrentVertex(c,y,0,0,h)));if(I&&_<u-1){var V=c.dist(d);if(V>2*p){var U=c.add(d.sub(c)._mult(p/V)._round());this.updateDistance(c,U),this.addCurrentVertex(U,y,0,0,h),c=U}}}}},hu.prototype.addCurrentVertex=function(t,e,i,r,n,o){void 0===o&&(o=!1);var a=e.y*r-e.x,s=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,o,!1,i,n),this.addHalfVertex(t,a,s,o,!0,-r,n),this.distance>pu/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,i,r,n,o))},hu.prototype.addHalfVertex=function(t,e,i,r,n,o,a){var s=.5*(this.lineClips?this.scaledDistance*(pu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(r?1:0),(t.y<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*i)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),n?this.e2=u:this.e1=u},hu.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},hu.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Qr("LineBucket",hu,{omit:["layers","patternFeatures"]});var fu=new qn({"line-cap":new On(Zt.layout_line["line-cap"]),"line-join":new Vn(Zt.layout_line["line-join"]),"line-miter-limit":new On(Zt.layout_line["line-miter-limit"]),"line-round-limit":new On(Zt.layout_line["line-round-limit"]),"line-sort-key":new Vn(Zt.layout_line["line-sort-key"])}),du={paint:new qn({"line-opacity":new Vn(Zt.paint_line["line-opacity"]),"line-color":new Vn(Zt.paint_line["line-color"]),"line-translate":new On(Zt.paint_line["line-translate"]),"line-translate-anchor":new On(Zt.paint_line["line-translate-anchor"]),"line-width":new Vn(Zt.paint_line["line-width"]),"line-gap-width":new Vn(Zt.paint_line["line-gap-width"]),"line-offset":new Vn(Zt.paint_line["line-offset"]),"line-blur":new Vn(Zt.paint_line["line-blur"]),"line-dasharray":new jn(Zt.paint_line["line-dasharray"]),"line-pattern":new Un(Zt.paint_line["line-pattern"]),"line-gradient":new Nn(Zt.paint_line["line-gradient"])}),layout:fu},mu=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,i){return i=new kn(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),t.prototype.possiblyEvaluate.call(this,e,i)},e.prototype.evaluate=function(e,i,r,n){return i=m({},i,{zoom:Math.floor(i.zoom)}),t.prototype.evaluate.call(this,e,i,r,n)},e}(Vn))(du.paint.properties["line-width"].specification);mu.useIntegerZoom=!0;var yu=function(t){function e(e){t.call(this,e,du),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof ni,this.gradientVersion=(this.gradientVersion+1)%u)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,i){t.prototype.recalculate.call(this,e,i),this.paint._values["line-floorwidth"]=mu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new hu(t)},e.prototype.queryRadius=function(t){var e=t,i=_u(Ia("line-width",this,e),Ia("line-gap-width",this,e)),r=Ia("line-offset",this,e);return i/2+Math.abs(r)+Sa(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,r,o,a,s){var u=Ta(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*_u(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),c=this.paint.get("line-offset").evaluate(e,i);return c&&(r=function(t,e){for(var i=[],r=new n(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],u=0;u<a.length;u++){var l=a[u],c=a[u+1],p=0===u?r:l.sub(a[u-1])._unit()._perp(),h=u===a.length-1?r:c.sub(l)._unit()._perp(),f=p._add(h)._unit();f._mult(1/(f.x*h.x+f.y*h.y)),s.push(f._mult(e)._add(l))}i.push(s)}return i}(r,c*s)),function(t,e,i){for(var r=0;r<e.length;r++){var n=e[r];if(t.length>=3)for(var o=0;o<n.length;o++)if(ba(t,n[o]))return!0;if(ma(t,n,i))return!0}return!1}(u,r,l)},e.prototype.isTileClipped=function(){return!0},e}(Zn);function _u(t,e){return e>0?e+2*t:t}var gu=Hn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),vu=Hn([{name:"a_projected_pos",components:3,type:"Float32"}],4),xu=(Hn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Hn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),bu=(Hn([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Hn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),wu=Hn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Iu(t,e,i){return t.sections.forEach((function(t){t.text=function(t,e,i){var r=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),En.applyArabicShaping&&(t=En.applyArabicShaping(t)),t}(t.text,e,i)})),t}Hn([{name:"triangle",components:3,type:"Uint16"}]),Hn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Hn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Hn([{type:"Float32",name:"offsetX"}]),Hn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Su={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Tu=function(t,e,i,r,n){var o,a,s=8*n-r-1,u=(1<<s)-1,l=u>>1,c=-7,p=i?n-1:0,h=i?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=l}return(f?-1:1)*a*Math.pow(2,o-r)},Au=function(t,e,i,r,n,o){var a,s,u,l=8*o-n-1,c=(1<<l)-1,p=c>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+p>=1?h/u:h*Math.pow(2,1-p))*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*u-1)*Math.pow(2,n),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,n),a=0));n>=8;t[i+f]=255&s,f+=d,s/=256,n-=8);for(a=a<<n|s,l+=n;l>0;t[i+f]=255&a,f+=d,a/=256,l-=8);t[i+f-d]|=128*m},zu=Eu;function Eu(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Eu.Varint=0,Eu.Fixed64=1,Eu.Bytes=2,Eu.Fixed32=5;var ku="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Cu(t){return t.type===Eu.Bytes?t.readVarint()+t.pos:t.pos+1}function Pu(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Du(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function Mu(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Lu(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Bu(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Ru(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Fu(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Ou(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Vu(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Uu(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function ju(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Nu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function qu(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Zu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Gu(t,e,i){1===t&&i.readMessage(Xu,e)}function Xu(t,e,i){if(3===t){var r=i.readMessage(Wu,{}),n=r.width,o=r.height,a=r.left,s=r.top,u=r.advance;e.push({id:r.id,bitmap:new Ka({width:n+6,height:o+6},r.bitmap),metrics:{width:n,height:o,left:a,top:s,advance:u}})}}function Wu(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function Hu(t){for(var e=0,i=0,r=0,n=t;r<n.length;r+=1){var o=n[r];e+=o.w*o.h,i=Math.max(i,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}],s=0,u=0,l=0,c=t;l<c.length;l+=1)for(var p=c[l],h=a.length-1;h>=0;h--){var f=a[h];if(!(p.w>f.w||p.h>f.h)){if(p.x=f.x,p.y=f.y,u=Math.max(u,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===f.w&&p.h===f.h){var d=a.pop();h<a.length&&(a[h]=d)}else p.h===f.h?(f.x+=p.w,f.w-=p.w):p.w===f.w?(f.y+=p.h,f.h-=p.h):(a.push({x:f.x+p.w,y:f.y,w:f.w-p.w,h:p.h}),f.y+=p.h,f.h-=p.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}Eu.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,o=this.pos;this.type=7&r,t(n,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Nu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Zu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Nu(this.buf,this.pos)+4294967296*Nu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Nu(this.buf,this.pos)+4294967296*Zu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Tu(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Tu(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,o=i.buf;if(r=(112&(n=o[i.pos++]))>>4,n<128)return Pu(t,r,e);if(r|=(127&(n=o[i.pos++]))<<3,n<128)return Pu(t,r,e);if(r|=(127&(n=o[i.pos++]))<<10,n<128)return Pu(t,r,e);if(r|=(127&(n=o[i.pos++]))<<17,n<128)return Pu(t,r,e);if(r|=(127&(n=o[i.pos++]))<<24,n<128)return Pu(t,r,e);if(r|=(1&(n=o[i.pos++]))<<31,n<128)return Pu(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&ku?function(t,e,i){return ku.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var r="",n=e;n<i;){var o,a,s,u=t[n],l=null,c=u>239?4:u>223?3:u>191?2:1;if(n+c>i)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[n+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[n+2],128==(192&(o=t[n+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(a=t[n+2],s=t[n+3],128==(192&(o=t[n+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),n+=c}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Eu.Bytes)return t.push(this.readVarint(e));var i=Cu(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Eu.Bytes)return t.push(this.readSVarint());var e=Cu(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Eu.Bytes)return t.push(this.readBoolean());var e=Cu(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Eu.Bytes)return t.push(this.readFloat());var e=Cu(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Eu.Bytes)return t.push(this.readDouble());var e=Cu(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Eu.Bytes)return t.push(this.readFixed32());var e=Cu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Eu.Bytes)return t.push(this.readSFixed32());var e=Cu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Eu.Bytes)return t.push(this.readFixed64());var e=Cu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Eu.Bytes)return t.push(this.readSFixed64());var e=Cu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Eu.Varint)for(;this.buf[this.pos++]>127;);else if(e===Eu.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Eu.Fixed32)this.pos+=4;else{if(e!==Eu.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),qu(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),qu(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),qu(this.buf,-1&t,this.pos),qu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),qu(this.buf,-1&t,this.pos),qu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var r,n,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!n){r>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Du(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Au(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Au(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var r=this.pos-i;r>=128&&Du(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,Eu.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Mu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Lu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Fu,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Bu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ru,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ou,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Vu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Uu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ju,e)},writeBytesField:function(t,e){this.writeTag(t,Eu.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Eu.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Eu.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Eu.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Eu.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Eu.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Eu.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Eu.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Eu.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Eu.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ku=function(t,e){var i=e.pixelRatio,r=e.version,n=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=i,this.stretchX=n,this.stretchY=o,this.content=a,this.version=r},Yu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Yu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Yu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Yu.tlbr.get=function(){return this.tl.concat(this.br)},Yu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ku.prototype,Yu);var Ju=function(t,e){var i={},r={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,i,n),this.addImages(e,r,n);var o=Hu(n),a=new Ya({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=i[s].paddedRect;Ya.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var c in e){var p=e[c],h=r[c].paddedRect,f=h.x+1,d=h.y+1,m=p.data.width,y=p.data.height;Ya.copy(p.data,a,{x:0,y:0},{x:f,y:d},p.data),Ya.copy(p.data,a,{x:0,y:y-1},{x:f,y:d-1},{width:m,height:1}),Ya.copy(p.data,a,{x:0,y:0},{x:f,y:d+y},{width:m,height:1}),Ya.copy(p.data,a,{x:m-1,y:0},{x:f-1,y:d},{width:1,height:y}),Ya.copy(p.data,a,{x:0,y:0},{x:f+m,y:d},{width:1,height:y})}this.image=a,this.iconPositions=i,this.patternPositions=r};Ju.prototype.addImages=function(t,e,i){for(var r in t){var n=t[r],o={x:0,y:0,w:n.data.width+2,h:n.data.height+2};i.push(o),e[r]=new Ku(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},Ju.prototype.patchUpdatedImages=function(t,e){for(var i in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)},Ju.prototype.patchUpdatedImage=function(t,e,i){if(t&&e&&t.version!==e.version){t.version=e.version;var r=t.tl;i.update(e.data,void 0,{x:r[0],y:r[1]})}},Qr("ImagePosition",Ku),Qr("ImageAtlas",Ju);var Qu={horizontal:1,vertical:2,horizontalOnly:3},$u=function(){this.scale=1,this.fontStack="",this.imageName=null};$u.forText=function(t,e){var i=new $u;return i.scale=t||1,i.fontStack=e,i},$u.forImage=function(t){var e=new $u;return e.imageName=t,e};var tl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};tl.fromFeature=function(t,e){for(var i=new tl,r=0;r<t.sections.length;r++){var n=t.sections[r];n.image?i.addImageSection(n):i.addTextSection(n,e)}return i},tl.prototype.length=function(){return this.text.length},tl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},tl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},tl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},tl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",i=0;i<t.length;i++){var r=t.charCodeAt(i+1)||null,n=t.charCodeAt(i-1)||null;e+=r&&yn(r)&&!Su[t[i+1]]||n&&yn(n)&&!Su[t[i-1]]||!Su[t[i]]?t[i]:Su[t[i]]}return e}(this.text)},tl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&el[this.text.charCodeAt(e)];e++)t++;for(var i=this.text.length,r=this.text.length-1;r>=0&&r>=t&&el[this.text.charCodeAt(r)];r--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)},tl.prototype.substring=function(t,e){var i=new tl;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i},tl.prototype.toString=function(){return this.text},tl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,i){return Math.max(e,t.sections[i].scale)}),0)},tl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push($u.forText(t.scale,t.fontStack||e));for(var i=this.sections.length-1,r=0;r<t.text.length;++r)this.sectionIndex.push(i)},tl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push($u.forImage(e)),this.sectionIndex.push(this.sections.length-1)):z("Reached maximum number of images 6401")}else z("Can't add FormattedSection with an empty image.")},tl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var el={};function il(t){var e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function rl(t,e){var i=e.expression;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new kn(t+1))};if("source"===i.kind)return{kind:"source"};for(var r=i.zoomStops,n=i.interpolationType,o=0;o<r.length&&r[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<r.length&&r[a]<t+1;)a++;a=Math.min(r.length-1,a);var s=r[o],u=r[a];return"composite"===i.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:u,minSize:i.evaluate(new kn(s)),maxSize:i.evaluate(new kn(u)),interpolationType:n}}function nl(t,e,i){var r=e.uSize,n=i.lowerSize;return"source"===t.kind?n/128:"composite"===t.kind?oi(n/128,i.upperSize/128,e.uSizeT):r}function ol(t,e){var i=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){var n=t.interpolationType,o=n?p(xi.interpolationFactor(n,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?r=oi(t.minSize,t.maxSize,o):i=o}return{uSizeT:i,uSize:r}}el[9]=!0,el[10]=!0,el[11]=!0,el[12]=!0,el[13]=!0,el[32]=!0,Qr("Anchor",function(t){function e(e,i,r,n){t.call(this,e,i),this.angle=r,void 0!==n&&(this.segment=n)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(n));var al=Object.freeze({__proto__:null,getSizeData:rl,evaluateSizeForFeature:nl,evaluateSizeForZoom:ol,SIZE_PACK_FACTOR:128}),sl=Number.POSITIVE_INFINITY;function ul(t,e){return e[1]!==sl?function(t,e,i){var r=0,n=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":n=i-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-i}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,n]}(t,e[0],e[1]):function(t,e){var i=0,r=0;e<0&&(e=0);var n=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":r=n-7;break;case"bottom-right":case"bottom-left":r=7-n;break;case"bottom":r=7-e;break;case"top":r=e-7}switch(t){case"top-right":case"bottom-right":i=-n;break;case"top-left":case"bottom-left":i=n;break;case"left":i=e;break;case"right":i=-e}return[i,r]}(t,e[0])}var ll=Js.VectorTileFeature.types,cl=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function pl(t,e,i,r,n,o,a,s,u,l,c,p,h){var f=s?Math.min(32640,Math.round(s[0])):0,d=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,i,Math.round(32*r),Math.round(32*n),o,a,(f<<1)+(u?1:0),d,16*l,16*c,256*p,256*h)}function hl(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function fl(t){for(var e=0,i=t.sections;e<i.length;e+=1)if(vn(i[e].text))return!0;return!1}var dl=function(t){this.layoutVertexArray=new io,this.indexArray=new lo,this.programConfigurations=t,this.segments=new Co,this.dynamicLayoutVertexArray=new ro,this.opacityVertexArray=new no,this.placedSymbolArray=new wo};dl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},dl.prototype.upload=function(t,e,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,gu.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,vu.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,cl,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))},dl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Qr("SymbolBuffers",dl);var ml=function(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new Co,this.collisionVertexArray=new uo};ml.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,xu.members,!0)},ml.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Qr("CollisionBuffers",ml);var yl=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Ca([]),this.placementViewportMatrix=Ca([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=rl(this.zoom,e["text-size"]),this.iconSizeData=rl(this.zoom,e["icon-size"]);var i=this.layers[0].layout,r=i.get("symbol-sort-key"),n=i.get("symbol-z-order");this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==n&&void 0!==r.constantOr(1),this.sortFeaturesByY=("viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map((function(t){return Qu[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};yl.prototype.createArrays=function(){this.text=new dl(new ra(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new dl(new ra(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new To,this.lineVertexArray=new Ao,this.symbolInstances=new So},yl.prototype.calculateGlyphDependencies=function(t,e,i,r,n){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(i||r)&&n){var a=Su[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},yl.prototype.populate=function(t,e,i){var r=this.layers[0],n=r.layout,o=n.get("text-font"),a=n.get("text-field"),s=n.get("icon-image"),u=("constant"!==a.value.kind||a.value.value instanceof ge&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=n.get("symbol-sort-key");if(this.features=[],u||l){for(var p=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,d=new kn(this.zoom),m=0,y=t;m<y.length;m+=1){var _=y[m],g=_.feature,v=_.id,x=_.index,b=_.sourceLayerIndex,w=r._featureFilter.needGeometry,I=la(g,w);if(r._featureFilter.filter(d,I,i)){w||(I.geometry=ua(g));var S=void 0;if(u){var T=r.getValueAndResolveTokens("text-field",I,i,f),A=ge.factory(T);fl(A)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===An()||this.hasRTLText&&En.isParsed())&&(S=Iu(A,r,I))}var z=void 0;if(l){var E=r.getValueAndResolveTokens("icon-image",I,i,f);z=E instanceof ve?E:ve.fromString(E)}if(S||z){var k=this.sortFeaturesByKey?c.evaluate(I,{},i):void 0;if(this.features.push({id:v,text:S,icon:z,index:x,sourceLayerIndex:b,geometry:I.geometry,properties:g.properties,type:ll[g.type],sortKey:k}),z&&(p[z.name]=!0),S){var C=o.evaluate(I,{},i).join(","),P="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Qu.vertical)>=0;for(var D=0,M=S.sections;D<M.length;D+=1){var L=M[D];if(L.image)p[L.image.name]=!0;else{var B=dn(S.toString()),R=L.fontStack||C,F=h[R]=h[R]||{};this.calculateGlyphDependencies(L.text,F,P,this.allowVerticalPlacement,B)}}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},i={},r=[],n=0;function o(e){r.push(t[e]),n++}function a(t,e,n){var o=i[t];return delete i[t],i[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(n[0]),o}function s(t,i,n){var o=e[i];return delete e[i],e[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=n[0].concat(r[o].geometry[0]),o}function u(t,e,i){var r=i?e[0][e[0].length-1]:e[0][0];return t+":"+r.x+":"+r.y}for(var l=0;l<t.length;l++){var c=t[l],p=c.geometry,h=c.text?c.text.toString():null;if(h){var f=u(h,p),d=u(h,p,!0);if(f in i&&d in e&&i[f]!==e[d]){var m=s(f,d,p),y=a(f,d,r[m].geometry);delete e[f],delete i[d],i[u(h,r[y].geometry,!0)]=y,r[m].geometry=null}else f in i?a(f,d,p):d in e?s(f,d,p):(o(l),e[f]=n-1,i[d]=n-1)}else o(l)}return r.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},yl.prototype.update=function(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i))},yl.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},yl.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},yl.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},yl.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},yl.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},yl.prototype.addToLineVertexArray=function(t,e){var i=this.lineVertexArray.length;if(void 0!==t.segment){for(var r=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:r},a<e.length-1&&(r+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}},yl.prototype.addSymbols=function(t,e,i,r,n,o,a,s,u,l,c,p){for(var h=t.indexArray,f=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,f,h,this.canOverlap?o.sortKey:void 0),m=this.glyphOffsetArray.length,y=d.vertexLength,_=this.allowVerticalPlacement&&a===Qu.vertical?Math.PI/2:0,g=o.text&&o.text.sections,v=0;v<e.length;v++){var x=e[v],b=x.tl,w=x.tr,I=x.bl,S=x.br,T=x.tex,A=x.pixelOffsetTL,z=x.pixelOffsetBR,E=x.minFontScaleX,k=x.minFontScaleY,C=x.glyphOffset,P=x.isSDF,D=x.sectionIndex,M=d.vertexLength,L=C[1];pl(f,s.x,s.y,b.x,L+b.y,T.x,T.y,i,P,A.x,A.y,E,k),pl(f,s.x,s.y,w.x,L+w.y,T.x+T.w,T.y,i,P,z.x,A.y,E,k),pl(f,s.x,s.y,I.x,L+I.y,T.x,T.y+T.h,i,P,A.x,z.y,E,k),pl(f,s.x,s.y,S.x,L+S.y,T.x+T.w,T.y+T.h,i,P,z.x,z.y,E,k),hl(t.dynamicLayoutVertexArray,s,_),h.emplaceBack(M,M+1,M+2),h.emplaceBack(M+1,M+2,M+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),v!==e.length-1&&D===e[v+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},p,g&&g[D])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,y,u,l,s.segment,i?i[0]:0,i?i[1]:0,r[0],r[1],a,0,!1,0,c)},yl.prototype._addCollisionDebugVertex=function(t,e,i,r,n,o){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,r,n,Math.round(o.x),Math.round(o.y))},yl.prototype.addCollisionDebugVertices=function(t,e,i,r,o,a,s){var u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),l=u.vertexLength,c=o.layoutVertexArray,p=o.collisionVertexArray,h=s.anchorX,f=s.anchorY;this._addCollisionDebugVertex(c,p,a,h,f,new n(t,e)),this._addCollisionDebugVertex(c,p,a,h,f,new n(i,e)),this._addCollisionDebugVertex(c,p,a,h,f,new n(i,r)),this._addCollisionDebugVertex(c,p,a,h,f,new n(t,r)),u.vertexLength+=4;var d=o.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),u.primitiveLength+=4},yl.prototype.addDebugCollisionBoxes=function(t,e,i,r){for(var n=t;n<e;n++){var o=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,r?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,i)}},yl.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ml(ao,bu.members,yo),this.iconCollisionBox=new ml(ao,bu.members,yo);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},yl.prototype._deserializeCollisionBoxesForSymbol=function(t,e,i,r,n,o,a,s,u){for(var l={},c=e;c<i;c++){var p=t.get(c);l.textBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},l.textFeatureIndex=p.featureIndex;break}for(var h=r;h<n;h++){var f=t.get(h);l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}for(var d=o;d<a;d++){var m=t.get(d);l.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},l.iconFeatureIndex=m.featureIndex;break}for(var y=s;y<u;y++){var _=t.get(y);l.verticalIconBox={x1:_.x1,y1:_.y1,x2:_.x2,y2:_.y2,anchorPointX:_.anchorPointX,anchorPointY:_.anchorPointY},l.verticalIconFeatureIndex=_.featureIndex;break}return l},yl.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}},yl.prototype.hasTextData=function(){return this.text.segments.get().length>0},yl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},yl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},yl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},yl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},yl.prototype.addIndicesForPlacedSymbol=function(t,e){for(var i=t.placedSymbolArray.get(e),r=i.vertexStartIndex+4*i.numGlyphs,n=i.vertexStartIndex;n<r;n+=4)t.indexArray.emplaceBack(n,n+1,n+2),t.indexArray.emplaceBack(n+1,n+2,n+3)},yl.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),i=Math.cos(t),r=[],n=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);r.push(0|Math.round(e*s.anchorX+i*s.anchorY)),n.push(s.featureIndex)}return o.sort((function(t,e){return r[t]-r[e]||n[e]-n[t]})),o},yl.prototype.addToSortKeyRanges=function(t,e){var i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},yl.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var i=0,r=this.symbolInstanceIndexes;i<r.length;i+=1){var n=this.symbolInstances.get(r[i]);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t,i,r){t>=0&&r.indexOf(t)===i&&e.addIndicesForPlacedSymbol(e.text,t)})),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Qr("SymbolBucket",yl,{omit:["layers","collisionBoxArray","features","compareText"]}),yl.MAX_GLYPHS=65535,yl.addDynamicAttributes=hl;var _l=new qn({"symbol-placement":new On(Zt.layout_symbol["symbol-placement"]),"symbol-spacing":new On(Zt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new On(Zt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Vn(Zt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new On(Zt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new On(Zt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new On(Zt.layout_symbol["icon-ignore-placement"]),"icon-optional":new On(Zt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new On(Zt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Vn(Zt.layout_symbol["icon-size"]),"icon-text-fit":new On(Zt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new On(Zt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Vn(Zt.layout_symbol["icon-image"]),"icon-rotate":new Vn(Zt.layout_symbol["icon-rotate"]),"icon-padding":new On(Zt.layout_symbol["icon-padding"]),"icon-keep-upright":new On(Zt.layout_symbol["icon-keep-upright"]),"icon-offset":new Vn(Zt.layout_symbol["icon-offset"]),"icon-anchor":new Vn(Zt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new On(Zt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new On(Zt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new On(Zt.layout_symbol["text-rotation-alignment"]),"text-field":new Vn(Zt.layout_symbol["text-field"]),"text-font":new Vn(Zt.layout_symbol["text-font"]),"text-size":new Vn(Zt.layout_symbol["text-size"]),"text-max-width":new Vn(Zt.layout_symbol["text-max-width"]),"text-line-height":new On(Zt.layout_symbol["text-line-height"]),"text-letter-spacing":new Vn(Zt.layout_symbol["text-letter-spacing"]),"text-justify":new Vn(Zt.layout_symbol["text-justify"]),"text-radial-offset":new Vn(Zt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new On(Zt.layout_symbol["text-variable-anchor"]),"text-anchor":new Vn(Zt.layout_symbol["text-anchor"]),"text-max-angle":new On(Zt.layout_symbol["text-max-angle"]),"text-writing-mode":new On(Zt.layout_symbol["text-writing-mode"]),"text-rotate":new Vn(Zt.layout_symbol["text-rotate"]),"text-padding":new On(Zt.layout_symbol["text-padding"]),"text-keep-upright":new On(Zt.layout_symbol["text-keep-upright"]),"text-transform":new Vn(Zt.layout_symbol["text-transform"]),"text-offset":new Vn(Zt.layout_symbol["text-offset"]),"text-allow-overlap":new On(Zt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new On(Zt.layout_symbol["text-ignore-placement"]),"text-optional":new On(Zt.layout_symbol["text-optional"])}),gl={paint:new qn({"icon-opacity":new Vn(Zt.paint_symbol["icon-opacity"]),"icon-color":new Vn(Zt.paint_symbol["icon-color"]),"icon-halo-color":new Vn(Zt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Vn(Zt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Vn(Zt.paint_symbol["icon-halo-blur"]),"icon-translate":new On(Zt.paint_symbol["icon-translate"]),"icon-translate-anchor":new On(Zt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Vn(Zt.paint_symbol["text-opacity"]),"text-color":new Vn(Zt.paint_symbol["text-color"],{runtimeType:ie,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Vn(Zt.paint_symbol["text-halo-color"]),"text-halo-width":new Vn(Zt.paint_symbol["text-halo-width"]),"text-halo-blur":new Vn(Zt.paint_symbol["text-halo-blur"]),"text-translate":new On(Zt.paint_symbol["text-translate"]),"text-translate-anchor":new On(Zt.paint_symbol["text-translate-anchor"])}),layout:_l},vl=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Qt,this.defaultValue=t};vl.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},vl.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},vl.prototype.outputDefined=function(){return!1},vl.prototype.serialize=function(){return null},Qr("FormatSectionOverride",vl,{omit:["defaultValue"]});var xl=function(t){function e(e){t.call(this,e,gl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,i){if(t.prototype.recalculate.call(this,e,i),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var n=[],o=0,a=r;o<a.length;o+=1){var s=a[o];n.indexOf(s)<0&&n.push(s)}this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,i,r){var n=this.layout.get(t).evaluate(e,{},i,r),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||ar(o.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,i){return i in t?String(t[i]):""}))}(e.properties,n)},e.prototype.createBucket=function(t){return new yl(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,i=gl.paint.overridableProperties;t<i.length;t+=1){var r=i[t];if(e.hasPaintOverride(this.layout,r)){var n,o=this.paint.get(r),a=new vl(o),s=new or(a,o.property.specification);n="constant"===o.value.kind||"source"===o.value.kind?new ur("source",s):new lr("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[r]=new Rn(o.property,n,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,i,r){return!(!this.layout||i.isDataDriven()||r.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var i=t.get("text-field"),r=gl.paint.properties[e],n=!1,o=function(t){for(var e=0,i=t;e<i.length;e+=1)if(r.overrides&&r.overrides.hasOverride(i[e]))return void(n=!0)};if("constant"===i.value.kind&&i.value.value instanceof ge)o(i.value.value.sections);else if("source"===i.value.kind){var a=function(t){n||(t instanceof Se&&we(t.value)===ae?o(t.value.sections):t instanceof Ee?o(t.sections):t.eachChild(a))},s=i.value;s._styleExpression&&a(s._styleExpression.expression)}return n},e}(Zn),bl={paint:new qn({"background-color":new On(Zt.paint_background["background-color"]),"background-pattern":new jn(Zt.paint_background["background-pattern"]),"background-opacity":new On(Zt.paint_background["background-opacity"])})},wl=function(t){function e(e){t.call(this,e,bl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Zn),Il={paint:new qn({"raster-opacity":new On(Zt.paint_raster["raster-opacity"]),"raster-hue-rotate":new On(Zt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new On(Zt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new On(Zt.paint_raster["raster-brightness-max"]),"raster-saturation":new On(Zt.paint_raster["raster-saturation"]),"raster-contrast":new On(Zt.paint_raster["raster-contrast"]),"raster-resampling":new On(Zt.paint_raster["raster-resampling"]),"raster-fade-duration":new On(Zt.paint_raster["raster-fade-duration"])})},Sl=function(t){function e(e){t.call(this,e,Il)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Zn),Tl=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(Zn),Al={circle:qa,heatmap:$a,hillshade:es,fill:js,"fill-extrusion":nu,line:yu,symbol:xl,background:wl,raster:Sl};function zl(t){return"custom"===t.type?new Tl(t):new Al[t.type](t)}var El=a.HTMLImageElement,kl=a.HTMLCanvasElement,Cl=a.HTMLVideoElement,Pl=a.ImageData,Dl=a.ImageBitmap,Ml=function(t,e,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,r)};function Ll(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}Ml.prototype.update=function(t,e,i){var r=t.width,n=t.height,o=!(this.size&&this.size[0]===r&&this.size[1]===n||i),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[r,n],t instanceof El||t instanceof kl||t instanceof Cl||t instanceof Pl||Dl&&t instanceof Dl?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,r,n,0,this.format,s.UNSIGNED_BYTE,t.data);else{var u=i||{x:0,y:0},l=u.x,c=u.y;t instanceof El||t instanceof kl||t instanceof Cl||t instanceof Pl||Dl&&t instanceof Dl?s.texSubImage2D(s.TEXTURE_2D,0,l,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,l,c,r,n,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Ml.prototype.bind=function(t,e,i){var r=this.context.gl;r.bindTexture(r.TEXTURE_2D,this.texture),i!==r.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=r.LINEAR),t!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,e),this.wrap=e)},Ml.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Ml.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Bl=function(t){function e(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new Ya({width:1,height:1}),this.dirty=!0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.isLoaded=function(){return this.loaded},e.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e<i.length;e+=1){var r=i[e];this._notify(r.ids,r.callback)}this.requestors=[]}},e.prototype.getImage=function(t){return this.images[t]},e.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},e.prototype._validate=function(t,e){var i=!0;return this._validateStretch(e.stretchX,e.data&&e.data.width)||(this.fire(new Nt(new Error('Image "'+t+'" has invalid "stretchX" value'))),i=!1),this._validateStretch(e.stretchY,e.data&&e.data.height)||(this.fire(new Nt(new Error('Image "'+t+'" has invalid "stretchY" value'))),i=!1),this._validateContent(e.content,e)||(this.fire(new Nt(new Error('Image "'+t+'" has invalid "content" value'))),i=!1),i},e.prototype._validateStretch=function(t,e){if(!t)return!0;for(var i=0,r=0,n=t;r<n.length;r+=1){var o=n[r];if(o[0]<i||o[1]<o[0]||e<o[1])return!1;i=o[1]}return!0},e.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},e.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},e.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},e.prototype.listImages=function(){return Object.keys(this.images)},e.prototype.getImages=function(t,e){var i=!0;if(!this.isLoaded())for(var r=0,n=t;r<n.length;r+=1)this.images[n[r]]||(i=!1);this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e})},e.prototype._notify=function(t,e){for(var i={},r=0,n=t;r<n.length;r+=1){var o=n[r];this.images[o]||this.fire(new jt("styleimagemissing",{id:o}));var a=this.images[o];a?i[o]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf,version:a.version,stretchX:a.stretchX,stretchY:a.stretchY,content:a.content,hasRenderCallback:Boolean(a.userImage&&a.userImage.render)}:z('Image "'+o+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}e(null,i)},e.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},e.prototype.getPattern=function(t){var e=this.patterns[t],i=this.getImage(t);if(!i)return null;if(e&&e.position.version===i.version)return e.position;if(e)e.position.version=i.version;else{var r={w:i.data.width+2,h:i.data.height+2,x:0,y:0},n=new Ku(r,i);this.patterns[t]={bin:r,position:n}}return this._updatePatternAtlas(),this.patterns[t].position},e.prototype.bind=function(t){var e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Ml(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)},e.prototype._updatePatternAtlas=function(){var t=[];for(var e in this.patterns)t.push(this.patterns[e].bin);var i=Hu(t),r=i.w,n=i.h,o=this.atlasImage;for(var a in o.resize({width:r||1,height:n||1}),this.patterns){var s=this.patterns[a].bin,u=s.x+1,l=s.y+1,c=this.images[a].data,p=c.width,h=c.height;Ya.copy(c,o,{x:0,y:0},{x:u,y:l},{width:p,height:h}),Ya.copy(c,o,{x:0,y:h-1},{x:u,y:l-1},{width:p,height:1}),Ya.copy(c,o,{x:0,y:0},{x:u,y:l+h},{width:p,height:1}),Ya.copy(c,o,{x:p-1,y:0},{x:u-1,y:l},{width:1,height:h}),Ya.copy(c,o,{x:0,y:0},{x:u+p,y:l},{width:1,height:h})}this.dirty=!0},e.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},e.prototype.dispatchRenderCallbacks=function(t){for(var e=0,i=t;e<i.length;e+=1){var r=i[e];if(!this.callbackDispatchedThisFrame[r]){this.callbackDispatchedThisFrame[r]=!0;var n=this.images[r];Ll(n)&&this.updateImage(r,n)}}},e}(qt),Rl=Vl,Fl=Vl,Ol=1e20;function Vl(t,e,i,r,n,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=i||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Ul(t,e,i,r,n,o,a){for(var s=0;s<e;s++){for(var u=0;u<i;u++)r[u]=t[u*e+s];for(jl(r,n,o,a,i),u=0;u<i;u++)t[u*e+s]=n[u]}for(u=0;u<i;u++){for(s=0;s<e;s++)r[s]=t[u*e+s];for(jl(r,n,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(n[s])}}function jl(t,e,i,r,n){i[0]=0,r[0]=-Ol,r[1]=+Ol;for(var o=1,a=0;o<n;o++){for(var s=(t[o]+o*o-(t[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);s<=r[a];)a--,s=(t[o]+o*o-(t[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);i[++a]=o,r[a]=s,r[a+1]=+Ol}for(o=0,a=0;o<n;o++){for(;r[a+1]<o;)a++;e[o]=(o-i[a])*(o-i[a])+t[i[a]]}}Vl.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),i=new Uint8ClampedArray(this.size*this.size),r=0;r<this.size*this.size;r++){var n=e.data[4*r+3]/255;this.gridOuter[r]=1===n?0:0===n?Ol:Math.pow(Math.max(0,.5-n),2),this.gridInner[r]=1===n?Ol:0===n?0:Math.pow(Math.max(0,n-.5),2)}for(Ul(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),Ul(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),r=0;r<this.size*this.size;r++)i[r]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[r]-this.gridInner[r])/this.radius+this.cutoff))));return i},Rl.default=Fl;var Nl=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};Nl.prototype.setURL=function(t){this.url=t},Nl.prototype.getGlyphs=function(t,e){var i=this,r=[];for(var n in t)for(var o=0,a=t[n];o<a.length;o+=1)r.push({stack:n,id:a[o]});f(r,(function(t,e){var r=t.stack,n=t.id,o=i.entries[r];o||(o=i.entries[r]={glyphs:{},requests:{},ranges:{}});var a=o.glyphs[n];if(void 0===a){if(a=i._tinySDF(o,r,n))return o.glyphs[n]=a,void e(null,{stack:r,id:n,glyph:a});var s=Math.floor(n/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:n,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],Nl.loadGlyphRange(r,s,i.url,i.requestManager,(function(t,e){if(e){for(var r in e)i._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var n=0,a=u;n<a.length;n+=1)(0,a[n])(t,e);delete o.requests[s]}))),u.push((function(t,i){t?e(t):i&&e(null,{stack:r,id:n,glyph:i[n]||null})}))}}else e(null,{stack:r,id:n,glyph:a})}),(function(t,i){if(t)e(t);else if(i){for(var r={},n=0,o=i;n<o.length;n+=1){var a=o[n],s=a.stack,u=a.id,l=a.glyph;(r[s]||(r[s]={}))[u]=l&&{id:l.id,bitmap:l.bitmap.clone(),metrics:l.metrics}}e(null,r)}}))},Nl.prototype._doesCharSupportLocalGlyph=function(t){return!!this.localIdeographFontFamily&&(ln(t)||cn(t)||sn(t)||un(t))},Nl.prototype._tinySDF=function(t,e,i){var r=this.localIdeographFontFamily;if(r&&this._doesCharSupportLocalGlyph(i)){var n=t.tinySDF;if(!n){var o="400";/bold/i.test(e)?o="900":/medium/i.test(e)?o="500":/light/i.test(e)&&(o="200"),n=t.tinySDF=new Nl.TinySDF(24,3,8,.25,r,o)}return{id:i,bitmap:new Ka({width:30,height:30},n.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},Nl.loadGlyphRange=function(t,e,i,r,n){var o=256*e,a=o+255,s=r.transformRequest(r.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",o+"-"+a),Et.Glyphs);Bt(s,(function(t,e){if(t)n(t);else if(e){for(var i={},r=0,o=function(t){return new zu(t).readFields(Gu,[])}(e);r<o.length;r+=1){var a=o[r];i[a.id]=a}n(null,i)}}))},Nl.TinySDF=Rl;var ql=function(){this.specification=Zt.light.position};ql.prototype.possiblyEvaluate=function(t,e){return r=(i=t.expression.evaluate(e))[0],n=i[1],o=i[2],n+=90,n*=Math.PI/180,o*=Math.PI/180,{x:r*Math.cos(n)*Math.sin(o),y:r*Math.sin(n)*Math.sin(o),z:r*Math.cos(o)};var i,r,n,o},ql.prototype.interpolate=function(t,e,i){return{x:oi(t.x,e.x,i),y:oi(t.y,e.y,i),z:oi(t.z,e.z,i)}};var Zl=new qn({anchor:new On(Zt.light.anchor),position:new ql,color:new On(Zt.light.color),intensity:new On(Zt.light.intensity)}),Gl=function(t){function e(e){t.call(this),this._transitionable=new Dn(Zl),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getLight=function(){return this._transitionable.serialize()},e.prototype.setLight=function(t,e){if(void 0===e&&(e={}),!this._validate(qr,t,e))for(var i in t){var r=t[i];w(i,"-transition")?this._transitionable.setTransition(i.slice(0,-"-transition".length),r):this._transitionable.setValue(i,r)}},e.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},e.prototype.hasTransition=function(){return this._transitioning.hasTransition()},e.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},e.prototype._validate=function(t,e,i){return(!i||!1!==i.validate)&&Xr(this,t.call(Nr,m({value:e,style:{glyphs:!0,sprite:!0},styleSpec:Zt})))},e}(qt),Xl=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};Xl.prototype.getDash=function(t,e){var i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]},Xl.prototype.getDashRanges=function(t,e,i){var r=[],n=t.length%2==1?-t[t.length-1]*i:0,o=t[0]*i,a=!0;r.push({left:n,right:o,isDash:a,zeroLength:0===t[0]});for(var s=t[0],u=1;u<t.length;u++){var l=t[u];r.push({left:n=s*i,right:o=(s+=l)*i,isDash:a=!a,zeroLength:0===l})}return r},Xl.prototype.addRoundDash=function(t,e,i){for(var r=e/2,n=-i;n<=i;n++)for(var o=this.width*(this.nextRow+i+n),a=0,s=t[a],u=0;u<this.width;u++){u/s.right>1&&(s=t[++a]);var l=Math.abs(u-s.left),c=Math.abs(u-s.right),p=Math.min(l,c),h=void 0,f=n/i*(r+1);if(s.isDash){var d=r-Math.abs(f);h=Math.sqrt(p*p+d*d)}else h=r-Math.sqrt(p*p+f*f);this.data[o+u]=Math.max(0,Math.min(255,h+128))}},Xl.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var i=t[e],r=t[e+1];i.zeroLength?t.splice(e,1):r&&r.isDash===i.isDash&&(r.left=i.left,t.splice(e,1))}var n=t[0],o=t[t.length-1];n.isDash===o.isDash&&(n.left=o.left-this.width,o.right=n.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l<this.width;l++){l/u.right>1&&(u=t[++s]);var c=Math.abs(l-u.left),p=Math.abs(l-u.right),h=Math.min(c,p);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?h:-h)+128))}},Xl.prototype.addDash=function(t,e){var i=e?7:0,r=2*i+1;if(this.nextRow+r>this.height)return z("LineAtlas out of space"),null;for(var n=0,o=0;o<t.length;o++)n+=t[o];if(0!==n){var a=this.width/n,s=this.getDashRanges(t,this.width,a);e?this.addRoundDash(s,a,i):this.addRegularDash(s)}var u={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:n};return this.nextRow+=r,this.dirty=!0,u},Xl.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var Wl=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Wl.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},Wl.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Hl=function(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},b(["receive","process"],this),this.invoker=new Wl(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=C()?t:a};Hl.prototype.send=function(t,e,i,r,n){var o=this;void 0===n&&(n=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(this.callbacks[a]=i);var s=M(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!i,targetMapId:r,mustQueue:n,sourceMapId:this.mapId,data:rn(e,s)},s),{cancel:function(){i&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:r,sourceMapId:o.mapId})}}},Hl.prototype.receive=function(t){var e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[i];var r=this.cancelCallbacks[i];delete this.cancelCallbacks[i],r&&r()}else C()||e.mustQueue?(this.tasks[i]=e,this.taskQueue.push(i),this.invoker.trigger()):this.processTask(i,e)},Hl.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Hl.prototype.processTask=function(t,e){var i=this;if("<response>"===e.type){var r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(nn(e.error)):r(null,nn(e.data)))}else{var n=!1,o=M(this.globalScope)?void 0:[],a=e.hasCallback?function(e,r){n=!0,delete i.cancelCallbacks[t],i.target.postMessage({id:t,type:"<response>",sourceMapId:i.mapId,error:e?rn(e):null,data:rn(r,o)},o)}:function(t){n=!0},s=null,u=nn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!n&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Hl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Kl=function t(e,i){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=g();for(var r=this.workerPool.acquire(this.id),n=0;n<r.length;n++){var o=new t.Actor(r[n],i,this.id);o.name="Worker "+n,this.actors.push(o)}};function Yl(t,e,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}Kl.prototype.broadcast=function(t,e,i){f(this.actors,(function(i,r){i.send(t,e,r)}),i=i||function(){})},Kl.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Kl.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},Kl.Actor=Hl;var Jl=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Jl.prototype.setNorthEast=function(t){return this._ne=t instanceof Ql?new Ql(t.lng,t.lat):Ql.convert(t),this},Jl.prototype.setSouthWest=function(t){return this._sw=t instanceof Ql?new Ql(t.lng,t.lat):Ql.convert(t),this},Jl.prototype.extend=function(t){var e,i,r=this._sw,n=this._ne;if(t instanceof Ql)e=t,i=t;else{if(!(t instanceof Jl))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Jl.convert(t)):this.extend(Ql.convert(t)):this;if(i=t._ne,!(e=t._sw)||!i)return this}return r||n?(r.lng=Math.min(e.lng,r.lng),r.lat=Math.min(e.lat,r.lat),n.lng=Math.max(i.lng,n.lng),n.lat=Math.max(i.lat,n.lat)):(this._sw=new Ql(e.lng,e.lat),this._ne=new Ql(i.lng,i.lat)),this},Jl.prototype.getCenter=function(){return new Ql((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Jl.prototype.getSouthWest=function(){return this._sw},Jl.prototype.getNorthEast=function(){return this._ne},Jl.prototype.getNorthWest=function(){return new Ql(this.getWest(),this.getNorth())},Jl.prototype.getSouthEast=function(){return new Ql(this.getEast(),this.getSouth())},Jl.prototype.getWest=function(){return this._sw.lng},Jl.prototype.getSouth=function(){return this._sw.lat},Jl.prototype.getEast=function(){return this._ne.lng},Jl.prototype.getNorth=function(){return this._ne.lat},Jl.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Jl.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Jl.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Jl.prototype.contains=function(t){var e=Ql.convert(t),i=e.lng,r=e.lat,n=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n},Jl.convert=function(t){return!t||t instanceof Jl?t:new Jl(t)};var Ql=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Ql.prototype.wrap=function(){return new Ql(h(this.lng,-180,180),this.lat)},Ql.prototype.toArray=function(){return[this.lng,this.lat]},Ql.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ql.prototype.distanceTo=function(t){var e=Math.PI/180,i=this.lat*e,r=t.lat*e,n=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(n,1))},Ql.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new Jl(new Ql(this.lng-i,this.lat-e),new Ql(this.lng+i,this.lat+e))},Ql.convert=function(t){if(t instanceof Ql)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ql(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ql(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var $l=2*Math.PI*6371008.8;function tc(t){return $l*Math.cos(t*Math.PI/180)}function ec(t){return(180+t)/360}function ic(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function rc(t,e){return t/tc(e)}function nc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var oc=function(t,e,i){void 0===i&&(i=0),this.x=+t,this.y=+e,this.z=+i};oc.fromLngLat=function(t,e){void 0===e&&(e=0);var i=Ql.convert(t);return new oc(ec(i.lng),ic(i.lat),rc(e,i.lat))},oc.prototype.toLngLat=function(){return new Ql(360*this.x-180,nc(this.y))},oc.prototype.toAltitude=function(){return this.z*tc(nc(this.y))},oc.prototype.meterInMercatorCoordinateUnits=function(){return 1/$l*(t=nc(this.y),1/Math.cos(t*Math.PI/180));var t};var ac=function(t,e,i){this.z=t,this.x=e,this.y=i,this.key=lc(0,t,t,e,i)};ac.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},ac.prototype.url=function(t,e){var i,r,n,o,a,s=(r=this.y,n=this.z,o=Yl(256*(i=this.x),256*(r=Math.pow(2,n)-r-1),n),a=Yl(256*(i+1),256*(r+1),n),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,i){for(var r,n="",o=t;o>0;o--)n+=(e&(r=1<<o-1)?1:0)+(i&r?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",u).replace("{bbox-epsg-3857}",s)},ac.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new n(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},ac.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var sc=function(t,e){this.wrap=t,this.canonical=e,this.key=lc(t,e.z,e.z,e.x,e.y)},uc=function(t,e,i,r,n){this.overscaledZ=t,this.wrap=e,this.canonical=new ac(i,+r,+n),this.key=lc(e,t,i,r,n)};function lc(t,e,i,r,n){(t*=2)<0&&(t=-1*t-1);var o=1<<i;return(o*o*t+o*n+r).toString(36)+i.toString(36)+e.toString(36)}function cc(t,e,i){var r=function(r,n){if(r)return i(r);if(n){var o=y(m(n,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);n.vector_layers&&(o.vectorLayers=n.vector_layers,o.vectorLayerIds=o.vectorLayers.map((function(t){return t.id}))),o.tiles=e.canonicalizeTileset(o,t.url),i(null,o)}};return t.url?Lt(e.transformRequest(e.normalizeSourceURL(t.url),Et.Source),r):U.frame((function(){return r(null,t)}))}uc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},uc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new uc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new uc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},uc.prototype.calculateScaledKey=function(t,e){var i=this.canonical.z-t;return t>this.canonical.z?lc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):lc(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)},uc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},uc.prototype.children=function(t){if(this.overscaledZ>=t)return[new uc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new uc(e,this.wrap,e,i,r),new uc(e,this.wrap,e,i+1,r),new uc(e,this.wrap,e,i,r+1),new uc(e,this.wrap,e,i+1,r+1)]},uc.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},uc.prototype.wrapped=function(){return new uc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},uc.prototype.unwrapTo=function(t){return new uc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},uc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},uc.prototype.toUnwrapped=function(){return new sc(this.wrap,this.canonical)},uc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},uc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new oc(t.x-this.wrap,t.y))},Qr("CanonicalTileID",ac),Qr("OverscaledTileID",uc,{omit:["posMatrix"]});var pc=function(t,e,i){this.bounds=Jl.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24};pc.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},pc.prototype.contains=function(t){var e=Math.pow(2,t.z),i=Math.floor(ec(this.bounds.getWest())*e),r=Math.floor(ic(this.bounds.getNorth())*e),n=Math.ceil(ec(this.bounds.getEast())*e),o=Math.ceil(ic(this.bounds.getSouth())*e);return t.x>=i&&t.x<n&&t.y>=r&&t.y<o};var hc=function(t){function e(e,i,r,n){if(t.call(this),this.id=e,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,m(this,y(i,["url","scheme","tileSize","promoteId"])),this._options=m({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new jt("dataloading",{dataType:"source"})),this._tileJSONRequest=cc(this._options,this.map._requestManager,(function(e,i){t._tileJSONRequest=null,t._loaded=!0,e?t.fire(new Nt(e)):i&&(m(t,i),i.bounds&&(t.tileBounds=new pc(i.bounds,t.minzoom,t.maxzoom)),_t(i.tiles,t.map._requestManager._customAccessToken),vt(i.tiles,t.map._getMapId(),t.map._requestManager._skuToken,t.map._requestManager._customAccessToken),t.fire(new jt("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new jt("data",{dataType:"source",sourceDataType:"content"})))}))},e.prototype.loaded=function(){return this._loaded},e.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},e.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},e.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},e.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},e.prototype.serialize=function(){return m({},this._options)},e.prototype.loadTile=function(t,e){var i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),r={request:this.map._requestManager.transformRequest(i,Et.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:U.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function n(i,r){return delete t.request,t.aborted?e(null):i&&404!==i.status?e(i):(r&&r.resourceTiming&&(t.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&t.setExpiryData(r),t.loadVectorData(r,this.map.painter),At(this.dispatcher),e(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}r.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:t.request=t.actor.send("reloadTile",r,n.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",r,n.bind(this)))},e.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},e.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},e.prototype.hasTransition=function(){return!1},e}(qt),fc=function(t){function e(e,i,r,n){t.call(this),this.id=e,this.dispatcher=r,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=m({type:"raster"},i),m(this,y(i,["url","scheme","tileSize"]))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new jt("dataloading",{dataType:"source"})),this._tileJSONRequest=cc(this._options,this.map._requestManager,(function(e,i){t._tileJSONRequest=null,t._loaded=!0,e?t.fire(new Nt(e)):i&&(m(t,i),i.bounds&&(t.tileBounds=new pc(i.bounds,t.minzoom,t.maxzoom)),_t(i.tiles),vt(i.tiles,t.map._getMapId(),t.map._requestManager._skuToken),t.fire(new jt("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new jt("data",{dataType:"source",sourceDataType:"content"})))}))},e.prototype.loaded=function(){return this._loaded},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},e.prototype.serialize=function(){return m({},this._options)},e.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.loadTile=function(t,e){var i=this,r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.request=Ot(this.map._requestManager.transformRequest(r,Et.Tile),(function(r,n){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(r)t.state="errored",e(r);else if(n){i.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var o=i.map.painter.context,a=o.gl;t.texture=i.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new Ml(o,n,a.RGBA,{useMipmap:!0}),t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),t.state="loaded",At(i.dispatcher),e(null)}}))},e.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},e.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},e.prototype.hasTransition=function(){return!1},e}(qt),dc=function(t,e,i){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return z('"'+i+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var r=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=i||"mapbox";for(var n=0;n<r;n++)this.data[this._idx(-1,n)]=this.data[this._idx(0,n)],this.data[this._idx(r,n)]=this.data[this._idx(r-1,n)],this.data[this._idx(n,-1)]=this.data[this._idx(n,0)],this.data[this._idx(n,r)]=this.data[this._idx(n,r-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(r,-1)]=this.data[this._idx(r-1,0)],this.data[this._idx(-1,r)]=this.data[this._idx(0,r-1)],this.data[this._idx(r,r)]=this.data[this._idx(r-1,r-1)]};dc.prototype.get=function(t,e){var i=new Uint8Array(this.data.buffer),r=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(i[r],i[r+1],i[r+2])},dc.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},dc.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},dc.prototype._unpackMapbox=function(t,e,i){return(256*t*256+256*e+i)/10-1e4},dc.prototype._unpackTerrarium=function(t,e,i){return 256*t+e+i/256-32768},dc.prototype.getPixels=function(){return new Ya({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},dc.prototype.backfillBorder=function(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var r=e*this.dim,n=e*this.dim+this.dim,o=i*this.dim,a=i*this.dim+this.dim;switch(e){case-1:r=n-1;break;case 1:n=r+1}switch(i){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-i*this.dim,l=o;l<a;l++)for(var c=r;c<n;c++)this.data[this._idx(c,l)]=t.data[this._idx(c+s,l+u)]},Qr("DEMData",dc);var mc=function(t){function e(e,i,r,n){t.call(this,e,i,r,n),this.type="raster-dem",this.maxzoom=22,this._options=m({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},e.prototype.loadTile=function(t,e){var i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function r(i,r){i&&(t.state="errored",e(i)),r&&(t.dem=r,t.needsHillshadePrepare=!0,t.state="loaded",e(null))}t.request=Ot(this.map._requestManager.transformRequest(i,Et.Tile),function(i,n){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(i)t.state="errored",e(i);else if(n){this.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var o=a.ImageBitmap&&n instanceof a.ImageBitmap&&zt()?n:U.getImageData(n,1),s={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:o,encoding:this.encoding};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",s,r.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)},e.prototype._getNeighboringTiles=function(t){var e=t.canonical,i=Math.pow(2,e.z),r=(e.x-1+i)%i,n=0===e.x?t.wrap-1:t.wrap,o=(e.x+1+i)%i,a=e.x+1===i?t.wrap+1:t.wrap,s={};return s[new uc(t.overscaledZ,n,e.z,r,e.y).key]={backfilled:!1},s[new uc(t.overscaledZ,a,e.z,o,e.y).key]={backfilled:!1},e.y>0&&(s[new uc(t.overscaledZ,n,e.z,r,e.y-1).key]={backfilled:!1},s[new uc(t.overscaledZ,t.wrap,e.z,e.x,e.y-1).key]={backfilled:!1},s[new uc(t.overscaledZ,a,e.z,o,e.y-1).key]={backfilled:!1}),e.y+1<i&&(s[new uc(t.overscaledZ,n,e.z,r,e.y+1).key]={backfilled:!1},s[new uc(t.overscaledZ,t.wrap,e.z,e.x,e.y+1).key]={backfilled:!1},s[new uc(t.overscaledZ,a,e.z,o,e.y+1).key]={backfilled:!1}),s},e.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},e}(fc),yc=function(t){function e(e,i,r,n){t.call(this),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=r.getActor(),this.setEventedParent(n),this._data=i.data,this._options=m({},i),this._collectResourceTiming=i.collectResourceTiming,this._resourceTiming=[],void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;var o=8192/this.tileSize;this.workerOptions=m({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*o,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*o,extent:8192,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?Math.min(i.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:8192,radius:(i.clusterRadius||50)*o,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){var t=this;this.fire(new jt("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)t.fire(new Nt(e));else{var i={dataType:"source",sourceDataType:"metadata"};t._collectResourceTiming&&t._resourceTiming&&t._resourceTiming.length>0&&(i.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new jt("data",i))}}))},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.setData=function(t){var e=this;return this._data=t,this.fire(new jt("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)e.fire(new Nt(t));else{var i={dataType:"source",sourceDataType:"content"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(i.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new jt("data",i))}})),this},e.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},e.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},e.prototype.getClusterLeaves=function(t,e,i,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},r),this},e.prototype._updateWorkerData=function(t){var e=this;this._loaded=!1;var i=m({},this.workerOptions),r=this._data;"string"==typeof r?(i.request=this.map._requestManager.transformRequest(U.resolveURL(r),Et.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(r),this.actor.send(this.type+".loadData",i,(function(r,n){e._removed||n&&n.abandoned||(e._loaded=!0,n&&n.resourceTiming&&n.resourceTiming[e.id]&&(e._resourceTiming=n.resourceTiming[e.id].slice(0)),e.actor.send(e.type+".coalesce",{source:i.source},null),t(r))}))},e.prototype.loaded=function(){return this._loaded},e.prototype.loadTile=function(t,e){var i=this,r=t.actor?"reloadTile":"loadTile";t.actor=this.actor,t.request=this.actor.send(r,{type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:U.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(n,o){return delete t.request,t.unloadVectorData(),t.aborted?e(null):n?e(n):(t.loadVectorData(o,i.map.painter,"reloadTile"===r),e(null))}))},e.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},e.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},e.prototype.serialize=function(){return m({},this._options,{type:this.type,data:this._data})},e.prototype.hasTransition=function(){return!1},e}(qt),_c=Hn([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),gc=function(t){function e(e,i,r,n){t.call(this),this.id=e,this.dispatcher=r,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=i}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(t,e){var i=this;this._loaded=!1,this.fire(new jt("dataloading",{dataType:"source"})),this.url=this.options.url,Ot(this.map._requestManager.transformRequest(this.url,Et.Image),(function(r,n){i._loaded=!0,r?i.fire(new Nt(r)):n&&(i.image=n,t&&(i.coordinates=t),e&&e(),i._finishLoading())}))},e.prototype.loaded=function(){return this._loaded},e.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},e.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new jt("data",{dataType:"source",sourceDataType:"metadata"})))},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.setCoordinates=function(t){var e=this;this.coordinates=t;var i=t.map(oc.fromLngLat);this.tileID=function(t){for(var e=1/0,i=1/0,r=-1/0,n=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),i=Math.min(i,s.y),r=Math.max(r,s.x),n=Math.max(n,s.y)}var u=Math.max(r-e,n-i),l=Math.max(0,Math.floor(-Math.log(u)/Math.LN2)),c=Math.pow(2,l);return new ac(l,Math.floor((e+r)/2*c),Math.floor((i+n)/2*c))}(i),this.minzoom=this.maxzoom=this.tileID.z;var r=i.map((function(t){return e.tileID.getTilePoint(t)._round()}));return this._boundsArray=new Jn,this._boundsArray.emplaceBack(r[0].x,r[0].y,0,0),this._boundsArray.emplaceBack(r[1].x,r[1].y,8192,0),this._boundsArray.emplaceBack(r[3].x,r[3].y,0,8192),this._boundsArray.emplaceBack(r[2].x,r[2].y,8192,8192),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new jt("data",{dataType:"source",sourceDataType:"content"})),this},e.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,e=t.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,_c.members)),this.boundsSegments||(this.boundsSegments=Co.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Ml(t,this.image,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}},e.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},e.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},e.prototype.hasTransition=function(){return!1},e}(qt),vc=function(t){function e(e,i,r,n){t.call(this,e,i,r,n),this.roundZoom=!0,this.type="video",this.options=i}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){var t=this;this._loaded=!1;var e=this.options;this.urls=[];for(var i=0,r=e.urls;i<r.length;i+=1)this.urls.push(this.map._requestManager.transformRequest(r[i],Et.Source).url);!function(e,i){var r,n,o=a.document.createElement("video");o.muted=!0,o.onloadstart=function(){!function(e,i){t._loaded=!0,i&&(t.video=i,t.video.loop=!0,t.video.addEventListener("playing",(function(){t.map.triggerRepaint()})),t.map&&t.video.play(),t._finishLoading())}(0,o)};for(var s=0;s<e.length;s++){var u=a.document.createElement("source");r=e[s],n=void 0,(n=a.document.createElement("a")).href=r,(n.protocol!==a.document.location.protocol||n.host!==a.document.location.host)&&(o.crossOrigin="Anonymous"),u.src=e[s],o.appendChild(u)}}(this.urls)},e.prototype.pause=function(){this.video&&this.video.pause()},e.prototype.play=function(){this.video&&this.video.play()},e.prototype.seek=function(t){if(this.video){var e=this.video.seekable;t<e.start(0)||t>e.end(0)?this.fire(new Nt(new Gt("sources."+this.id,null,"Playback for this video can be set only between the "+e.start(0)+" and "+e.end(0)+"-second mark."))):this.video.currentTime=t}},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,e=t.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,_c.members)),this.boundsSegments||(this.boundsSegments=Co.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE),e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,this.video)):(this.texture=new Ml(t,this.video,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e.prototype.hasTransition=function(){return this.video&&!this.video.paused},e}(gc),xc=function(t){function e(e,i,r,n){t.call(this,e,i,r,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new Nt(new Gt("sources."+e,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Nt(new Gt("sources."+e,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new Nt(new Gt("sources."+e,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof a.HTMLCanvasElement||this.fire(new Nt(new Gt("sources."+e,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new Nt(new Gt("sources."+e,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof a.HTMLCanvasElement?this.options.canvas:a.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new Nt(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},e.prototype.getCanvas=function(){return this.canvas},e.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},e.prototype.onRemove=function(){this.pause()},e.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,_c.members)),this.boundsSegments||(this.boundsSegments=Co.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Ml(e,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[r];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},e.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},e.prototype.hasTransition=function(){return this._playing},e.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var i=e[t];if(isNaN(i)||i<=0)return!0}return!1},e}(gc),bc={vector:hc,raster:fc,"raster-dem":mc,geojson:yc,video:vc,image:gc,canvas:xc};function wc(t,e){var i=Ca([]);return Ma(i,i,[1,1,0]),La(i,i,[.5*t.width,.5*t.height,1]),Da(i,i,t.calculatePosMatrix(e.toUnwrapped()))}function Ic(t,e,i,r,n,o){var a=function(t,e,i){if(t)for(var r=0,n=t;r<n.length;r+=1){var o=e[n[r]];if(o&&o.source===i&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===i&&"fill-extrusion"===s.type)return!0}return!1}(n&&n.layers,e,t.id),s=o.maxPitchScaleFactor(),u=t.tilesIn(r,s,a);u.sort(Sc);for(var l=[],c=0,p=u;c<p.length;c+=1){var h=p[c];l.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,i,t._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,n,o,s,wc(t.transform,h.tileID))})}var f=function(t){for(var e={},i={},r=0,n=t;r<n.length;r+=1){var o=n[r],a=o.queryResults,s=o.wrappedTileID,u=i[s]=i[s]||{};for(var l in a)for(var c=a[l],p=u[l]=u[l]||{},h=e[l]=e[l]||[],f=0,d=c;f<d.length;f+=1){var m=d[f];p[m.featureIndex]||(p[m.featureIndex]=!0,h.push(m))}}return e}(l);for(var d in f)f[d].forEach((function(e){var i=e.feature,r=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r}));return f}function Sc(t,e){var i=t.tileID,r=e.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}var Tc=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}};Tc.prototype.encode=function(t){return this._stringToNumber[t]},Tc.prototype.decode=function(t){return this._numberToString[t]};var Ac=function(t,e,i,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=i,t._y=r,this.properties=t.properties,this.id=n},zc={geometry:{configurable:!0}};zc.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},zc.geometry.set=function(t){this._geometry=t},Ac.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Ac.prototype,zc);var Ec=function(){this.state={},this.stateChanges={},this.deletedStates={}};Ec.prototype.updateState=function(t,e,i){var r=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][r]=this.stateChanges[t][r]||{},m(this.stateChanges[t][r],i),null===this.deletedStates[t])for(var n in this.deletedStates[t]={},this.state[t])n!==r&&(this.deletedStates[t][n]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][r])for(var o in this.deletedStates[t][r]={},this.state[t][r])i[o]||(this.deletedStates[t][r][o]=null);else for(var a in i)this.deletedStates[t]&&this.deletedStates[t][r]&&null===this.deletedStates[t][r][a]&&delete this.deletedStates[t][r][a]},Ec.prototype.removeFeatureState=function(t,e,i){if(null!==this.deletedStates[t]){var r=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][r])for(i in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][i]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}},Ec.prototype.getState=function(t,e){var i=String(e),r=m({},(this.state[t]||{})[i],(this.stateChanges[t]||{})[i]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var n=this.deletedStates[t][e];if(null===n)return{};for(var o in n)delete r[o]}return r},Ec.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Ec.prototype.coalesceChanges=function(t,e){var i={};for(var r in this.stateChanges){this.state[r]=this.state[r]||{};var n={};for(var o in this.stateChanges[r])this.state[r][o]||(this.state[r][o]={}),m(this.state[r][o],this.stateChanges[r][o]),n[o]=this.state[r][o];i[r]=n}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var u in this.state[a])s[u]={},this.state[a][u]={};else for(var l in this.deletedStates[a]){if(null===this.deletedStates[a][l])this.state[a][l]={};else for(var c=0,p=Object.keys(this.deletedStates[a][l]);c<p.length;c+=1)delete this.state[a][l][p[c]];s[l]=this.state[a][l]}i[a]=i[a]||{},m(i[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(var h in t)t[h].setFeatureState(i,e)};var kc=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Wr(8192,16,0),this.grid3D=new Wr(8192,16,0),this.featureIndexArray=new Eo,this.promoteId=e};function Cc(t,e,i,r,n){return I(t,(function(t,o){var a=e instanceof Fn?e.get(o):null;return a&&a.evaluate?a.evaluate(i,r,n):a}))}function Pc(t){for(var e=1/0,i=1/0,r=-1/0,n=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),i=Math.min(i,s.y),r=Math.max(r,s.x),n=Math.max(n,s.y)}return{minX:e,minY:i,maxX:r,maxY:n}}function Dc(t,e){return e-t}kc.prototype.insert=function(t,e,i,r,n,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],c=[1/0,1/0,-1/0,-1/0],p=0;p<l.length;p++){var h=l[p];c[0]=Math.min(c[0],h.x),c[1]=Math.min(c[1],h.y),c[2]=Math.max(c[2],h.x),c[3]=Math.max(c[3],h.y)}c[0]<8192&&c[1]<8192&&c[2]>=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},kc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Js.VectorTile(new zu(this.rawTileData)).layers,this.sourceLayerCoder=new Tc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},kc.prototype.query=function(t,e,i,r){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=xr(a.filter),l=t.queryGeometry,c=t.queryPadding*s,p=Pc(l),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=Pc(t.cameraQueryGeometry),d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,i,r,o){return function(t,e,i,r,o){for(var a=0,s=t;a<s.length;a+=1){var u=s[a];if(e<=u.x&&i<=u.y&&r>=u.x&&o>=u.y)return!0}var l=[new n(e,i),new n(e,o),new n(r,o),new n(r,i)];if(t.length>2)for(var c=0,p=l;c<p.length;c+=1)if(ba(t,p[c]))return!0;for(var h=0;h<t.length-1;h++)if(wa(t[h],t[h+1],l))return!0;return!1}(t.cameraQueryGeometry,e-c,i-c,r+c,o+c)})),m=0,y=d;m<y.length;m+=1)h.push(y[m]);h.sort(Dc);for(var _,g={},v=function(n){var c=h[n];if(c!==_){_=c;var p=o.featureIndexArray.get(c),f=null;o.loadMatchingFeature(g,p.bucketIndex,p.sourceLayerIndex,p.featureIndex,u,a.layers,a.availableImages,e,i,r,(function(e,i,r){return f||(f=ua(e)),i.queryIntersectsFeature(l,e,r,f,o.z,t.transform,s,t.pixelPosMatrix)}))}},x=0;x<h.length;x++)v(x);return g},kc.prototype.loadMatchingFeature=function(t,e,i,r,n,o,a,s,u,l,c){var p=this.bucketLayerIDs[e];if(!o||function(t,e){for(var i=0;i<t.length;i++)if(e.indexOf(t[i])>=0)return!0;return!1}(o,p)){var h=this.sourceLayerCoder.decode(i),f=this.vtLayers[h].feature(r);if(n.needGeometry){var d=la(f,!0);if(!n.filter(new kn(this.tileID.overscaledZ),d,this.tileID.canonical))return}else if(!n.filter(new kn(this.tileID.overscaledZ),f))return;for(var y=this.getId(f,h),_=0;_<p.length;_++){var g=p[_];if(!(o&&o.indexOf(g)<0)){var v=s[g];if(v){var x={};void 0!==y&&l&&(x=l.getState(v.sourceLayer||"_geojsonTileLayer",y));var b=m({},u[g]);b.paint=Cc(b.paint,v.paint,f,x,a),b.layout=Cc(b.layout,v.layout,f,x,a);var w=!c||c(f,v,x);if(w){var I=new Ac(f,this.z,this.x,this.y,y);I.layer=b;var S=t[g];void 0===S&&(S=t[g]=[]),S.push({featureIndex:r,feature:I,intersectionZ:w})}}}}}},kc.prototype.lookupSymbolFeatures=function(t,e,i,r,n,o,a,s){var u={};this.loadVTLayers();for(var l=xr(n),c=0,p=t;c<p.length;c+=1)this.loadMatchingFeature(u,i,r,p[c],l,o,a,s,e);return u},kc.prototype.hasLayer=function(t){for(var e=0,i=this.bucketLayerIDs;e<i.length;e+=1)for(var r=0,n=i[e];r<n.length;r+=1)if(t===n[r])return!0;return!1},kc.prototype.getId=function(t,e){var i=t.id;return this.promoteId&&"boolean"==typeof(i=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(i=Number(i)),i},Qr("FeatureIndex",kc,{omit:["rawTileData","sourceLayerCoder"]});var Mc=function(t,e){this.tileID=t,this.uid=g(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Mc.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<U.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Mc.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Mc.prototype.loadVectorData=function(t,e,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var r in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var i={};if(!e)return i;for(var r=function(){var t=o[n],r=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==r.length){t.layers=r,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return r.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=r;a<s.length;a+=1)i[s[a].id]=t}},n=0,o=t;n<o.length;n+=1)r();return i}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var n=this.buckets[r];if(n instanceof yl){if(this.hasSymbolBuckets=!0,!i)break;n.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var a=this.buckets[o];if(a instanceof yl&&a.hasRTLText){this.hasRTLText=!0,En.isLoading()||En.isLoaded()||"deferred"!==An()||zn();break}}for(var s in this.queryPadding=0,this.buckets){var u=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(u))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new xo},Mc.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Mc.prototype.getBucket=function(t){return this.buckets[t.id]},Mc.prototype.upload=function(t){for(var e in this.buckets){var i=this.buckets[e];i.uploadPending()&&i.upload(t)}var r=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ml(t,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ml(t,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)},Mc.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Mc.prototype.queryRenderedFeatures=function(t,e,i,r,n,o,a,s,u,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:o,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:a,queryPadding:this.queryPadding*u},t,e,i):{}},Mc.prototype.querySourceFeatures=function(t,e){var i=this.latestFeatureIndex;if(i&&i.rawTileData){var r=i.loadVTLayers(),n=e?e.sourceLayer:"",o=r._geojsonTileLayer||r[n];if(o)for(var a=xr(e&&e.filter),s=this.tileID.canonical,u=s.z,l=s.x,c=s.y,p={z:u,x:l,y:c},h=0;h<o.length;h++){var f=o.feature(h);if(a.needGeometry){var d=la(f,!0);if(!a.filter(new kn(this.tileID.overscaledZ),d,this.tileID.canonical))continue}else if(!a.filter(new kn(this.tileID.overscaledZ),f))continue;var m=i.getId(f,n),y=new Ac(f,u,l,c,m);y.tile=p,t.push(y)}}},Mc.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Mc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Mc.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var i=P(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var r=Date.now(),n=!1;if(this.expirationTime>r)n=!1;else if(e)if(this.expirationTime<e)n=!0;else{var o=this.expirationTime-e;o?this.expirationTime=r+Math.max(o,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Mc.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Mc.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var i=this.latestFeatureIndex.loadVTLayers();for(var r in this.buckets)if(e.style.hasLayer(r)){var n=this.buckets[r],o=n.layers[0].sourceLayer||"_geojsonTileLayer",a=i[o],s=t[o];if(a&&s&&0!==Object.keys(s).length){n.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});var u=e&&e.style&&e.style.getLayer(r);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(n)))}}}},Mc.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Mc.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<U.now()},Mc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Mc.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=U.now()+t},Mc.prototype.setDependencies=function(t,e){for(var i={},r=0,n=e;r<n.length;r+=1)i[n[r]]=!0;this.dependencies[t]=i},Mc.prototype.hasDependency=function(t,e){for(var i=0,r=t;i<r.length;i+=1){var n=this.dependencies[r[i]];if(n)for(var o=0,a=e;o<a.length;o+=1)if(n[a[o]])return!0}return!1};var Lc=function(t,e){this.max=t,this.onRemove=e,this.reset()};Lc.prototype.reset=function(){for(var t in this.data)for(var e=0,i=this.data[t];e<i.length;e+=1){var r=i[e];r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value)}return this.data={},this.order=[],this},Lc.prototype.add=function(t,e,i){var r=this,n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);var o={value:e,timeout:void 0};if(void 0!==i&&(o.timeout=setTimeout((function(){r.remove(t,o)}),i)),this.data[n].push(o),this.order.push(n),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},Lc.prototype.has=function(t){return t.wrapped().key in this.data},Lc.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Lc.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},Lc.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},Lc.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Lc.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),n=this.data[i][r];return this.data[i].splice(r,1),n.timeout&&clearTimeout(n.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(n.value),this.order.splice(this.order.indexOf(i),1),this},Lc.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},Lc.prototype.filter=function(t){var e=[];for(var i in this.data)for(var r=0,n=this.data[i];r<n.length;r+=1){var o=n[r];t(o.value)||e.push(o)}for(var a=0,s=e;a<s.length;a+=1){var u=s[a];this.remove(u.value.tileID,u)}};var Bc=function(t,e,i){this.context=t;var r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};Bc.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Bc.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},Bc.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Rc={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Fc=function(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;var n=t.gl;this.buffer=n.createBuffer(),t.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};Fc.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Fc.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},Fc.prototype.enableAttributes=function(t,e){for(var i=0;i<this.attributes.length;i++){var r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r)}},Fc.prototype.setVertexAttribPointers=function(t,e,i){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],o=e.attributes[n.name];void 0!==o&&t.vertexAttribPointer(o,n.components,t[Rc[n.type]],!1,this.itemSize,n.offset+this.itemSize*(i||0))}},Fc.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Oc=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};Oc.prototype.get=function(){return this.current},Oc.prototype.set=function(t){},Oc.prototype.getDefault=function(){return this.default},Oc.prototype.setDefault=function(){this.set(this.default)};var Vc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return me.transparent},e.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},e}(Oc),Uc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(Oc),jc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(Oc),Nc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(Oc),qc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(Oc),Zc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(Oc),Gc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(Oc),Xc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(Oc),Wc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(Oc),Hc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(Oc),Kc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(Oc),Yc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(Oc),Jc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(Oc),Qc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(Oc),$c=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return me.transparent},e.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},e}(Oc),tp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(Oc),ep=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(Oc),ip=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(Oc),rp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(Oc),np=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(Oc),op=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(Oc),ap=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(Oc),sp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(Oc),up=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(Oc),lp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(Oc),cp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(Oc),pp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(Oc),hp=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(Oc),fp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(Oc),dp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(Oc),mp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(Oc),yp=function(t){function e(e,i){t.call(this,e),this.context=e,this.parent=i}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(Oc),_p=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(yp),gp=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(yp),vp=function(t,e,i,r){this.context=t,this.width=e,this.height=i;var n=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new _p(t,n),r&&(this.depthAttachment=new gp(t,n))};vp.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i)}t.deleteFramebuffer(this.framebuffer)};var xp=function(t,e,i){this.func=t,this.mask=e,this.range=i};xp.ReadOnly=!1,xp.ReadWrite=!0,xp.disabled=new xp(519,xp.ReadOnly,[0,1]);var bp=function(t,e,i,r,n,o){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=n,this.pass=o};bp.disabled=new bp({func:519,mask:0},0,0,7680,7680,7680);var wp=function(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i};wp.disabled=new wp(wp.Replace=[1,0],me.transparent,[!1,!1,!1,!1]),wp.unblended=new wp(wp.Replace,me.transparent,[!0,!0,!0,!0]),wp.alphaBlended=new wp([1,771],me.transparent,[!0,!0,!0,!0]);var Ip=function(t,e,i){this.enable=t,this.mode=e,this.frontFace=i};Ip.disabled=new Ip(!1,1029,2305),Ip.backCCW=new Ip(!0,1029,2305);var Sp=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Vc(this),this.clearDepth=new Uc(this),this.clearStencil=new jc(this),this.colorMask=new Nc(this),this.depthMask=new qc(this),this.stencilMask=new Zc(this),this.stencilFunc=new Gc(this),this.stencilOp=new Xc(this),this.stencilTest=new Wc(this),this.depthRange=new Hc(this),this.depthTest=new Kc(this),this.depthFunc=new Yc(this),this.blend=new Jc(this),this.blendFunc=new Qc(this),this.blendColor=new $c(this),this.blendEquation=new tp(this),this.cullFace=new ep(this),this.cullFaceSide=new ip(this),this.frontFace=new rp(this),this.program=new np(this),this.activeTexture=new op(this),this.viewport=new ap(this),this.bindFramebuffer=new sp(this),this.bindRenderbuffer=new up(this),this.bindTexture=new lp(this),this.bindVertexBuffer=new cp(this),this.bindElementBuffer=new pp(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new hp(this),this.pixelStoreUnpack=new fp(this),this.pixelStoreUnpackPremultiplyAlpha=new dp(this),this.pixelStoreUnpackFlipY=new mp(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)};Sp.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Sp.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Sp.prototype.createIndexBuffer=function(t,e){return new Bc(this,t,e)},Sp.prototype.createVertexBuffer=function(t,e,i){return new Fc(this,t,e,i)},Sp.prototype.createRenderbuffer=function(t,e,i){var r=this.gl,n=r.createRenderbuffer();return this.bindRenderbuffer.set(n),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),n},Sp.prototype.createFramebuffer=function(t,e,i){return new vp(this,t,e,i)},Sp.prototype.clear=function(t){var e=t.color,i=t.depth,r=this.gl,n=0;e&&(n|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(n|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),r.clear(n)},Sp.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Sp.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Sp.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Sp.prototype.setColorMode=function(t){s(t.blendFunction,wp.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)},Sp.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Tp=function(t){function e(e,i,r){var n=this;t.call(this),this.id=e,this.dispatcher=r,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(n._sourceLoaded=!0),n._sourceLoaded&&!n._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(n.reload(),n.transform&&n.update(n.transform))})),this.on("error",(function(){n._sourceErrored=!0})),this._source=function(t,e,i,r){var n=new bc[e.type](t,e,i,r);if(n.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+n.id);return b(["load","abort","unload","serialize","prepare"],n),n}(e,i,r,this),this._tiles={},this._cache=new Lc(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ec}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},e.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},e.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},e.prototype.getSource=function(){return this._source},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},e.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},e.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},e.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},e.prototype.serialize=function(){return this._source.serialize()},e.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}},e.prototype.getIds=function(){return d(this._tiles).map((function(t){return t.tileID})).sort(Ap).map((function(t){return t.key}))},e.prototype.getRenderableIds=function(t){var e=this,i=[];for(var r in this._tiles)this._isIdRenderable(r,t)&&i.push(this._tiles[r]);return t?i.sort((function(t,i){var r=t.tileID,o=i.tileID,a=new n(r.canonical.x,r.canonical.y)._rotate(e.transform.angle),s=new n(o.canonical.x,o.canonical.y)._rotate(e.transform.angle);return r.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):i.map((function(t){return t.tileID})).sort(Ap).map((function(t){return t.key}))},e.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},e.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},e.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},e.prototype._reloadTile=function(t,e){var i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)))},e.prototype._tileLoaded=function(t,e,i,r){if(r)return t.state="errored",void(404!==r.status?this._source.fire(new Nt(r,{tile:t})):this.update(this.transform));t.timeAdded=U.now(),"expired"===i&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(e,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new jt("data",{dataType:"source",tile:t,coord:t.tileID}))},e.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),i=0;i<e.length;i++){var r=e[i];if(t.neighboringTiles&&t.neighboringTiles[r]){var n=this.getTileByID(r);o(t,n),o(n,t)}}function o(t,e){t.needsHillshadePrepare=!0;var i=e.tileID.canonical.x-t.tileID.canonical.x,r=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===i&&0===r||Math.abs(r)>1||(Math.abs(i)>1&&(1===Math.abs(i+n)?i+=n:1===Math.abs(i-n)&&(i-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},e.prototype.getTile=function(t){return this.getTileByID(t.key)},e.prototype.getTileByID=function(t){return this._tiles[t]},e.prototype._retainLoadedChildren=function(t,e,i,r){for(var n in this._tiles){var o=this._tiles[n];if(!(r[n]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>i)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){r[a.key]=a;break}}}},e.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(var r=t.overscaledZ-1;r>=e;r--){var n=t.scaledTo(r),o=this._getLoadedTile(n);if(o)return o}},e.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,i=Math.ceil(t.height/this._source.tileSize)+1,r=Math.floor(e*i*5),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},e.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var i={};for(var r in this._tiles){var n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),i[n.tileID.key]=n}for(var o in this._tiles=i,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},e.prototype.update=function(t){var i=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var r;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new uc(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(r=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(r=r.filter((function(t){return i._source.hasTile(t)})))):r=[];var n=t.coveringZoomLevel(this._source),o=Math.max(n-e.maxOverzooming,this._source.minzoom),a=Math.max(n+e.maxUnderzooming,this._source.minzoom),s=this._updateRetainedTiles(r,n);if(zp(this._source.type)){for(var u={},l={},c=0,p=Object.keys(s);c<p.length;c+=1){var h=p[c],f=s[h],d=this._tiles[h];if(d&&!(d.fadeEndTime&&d.fadeEndTime<=U.now())){var m=this.findLoadedParent(f,o);m&&(this._addTile(m.tileID),u[m.tileID.key]=m.tileID),l[h]=f}}for(var y in this._retainLoadedChildren(l,n,a,s),u)s[y]||(this._coveredTiles[y]=!0,s[y]=u[y])}for(var _ in s)this._tiles[_].clearFadeHold();for(var g=0,v=function(t,e){var i=[];for(var r in t)r in e||i.push(r);return i}(this._tiles,s);g<v.length;g+=1){var x=v[g],b=this._tiles[x];b.hasSymbolBuckets&&!b.holdingForFade()?b.setHoldDuration(this.map._fadeDuration):b.hasSymbolBuckets&&!b.symbolFadeFinished()||this._removeTile(x)}this._updateLoadedParentTileCache()}},e.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},e.prototype._updateRetainedTiles=function(t,i){for(var r={},n={},o=Math.max(i-e.maxOverzooming,this._source.minzoom),a=Math.max(i+e.maxUnderzooming,this._source.minzoom),s={},u=0,l=t;u<l.length;u+=1){var c=l[u],p=this._addTile(c);r[c.key]=c,p.hasData()||i<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,i,a,r);for(var h=0,f=t;h<f.length;h+=1){var d=f[h],m=this._tiles[d.key];if(!m.hasData()){if(i+1>this._source.maxzoom){var y=d.children(this._source.maxzoom)[0],_=this.getTile(y);if(_&&_.hasData()){r[y.key]=y;continue}}else{var g=d.children(this._source.maxzoom);if(r[g[0].key]&&r[g[1].key]&&r[g[2].key]&&r[g[3].key])continue}for(var v=m.wasRequested(),x=d.overscaledZ-1;x>=o;--x){var b=d.scaledTo(x);if(n[b.key])break;if(n[b.key]=!0,!(m=this.getTile(b))&&v&&(m=this._addTile(b)),m&&(r[b.key]=b,v=m.wasRequested(),m.hasData()))break}}}return r},e.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],i=void 0,r=this._tiles[t].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}e.push(r.key);var n=r.scaledTo(r.overscaledZ-1);if(i=this._getLoadedTile(n))break;r=n}for(var o=0,a=e;o<a.length;o+=1)this._loadedParentTiles[a[o]]=i}},e.prototype._addTile=function(t){var e=this._tiles[t.key];if(e)return e;(e=this._cache.getAndRemove(t))&&(this._setTileReloadTimer(t.key,e),e.tileID=t,this._state.initializeTileState(e,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,e)));var i=Boolean(e);return i||(e=new Mc(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(e,this._tileLoaded.bind(this,e,t.key,e.state))),e?(e.uses++,this._tiles[t.key]=e,i||this._source.fire(new jt("dataloading",{tile:e,coord:e.tileID,dataType:"source"})),e):null},e.prototype._setTileReloadTimer=function(t,e){var i=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((function(){i._reloadTile(t,"expired"),delete i._timers[t]}),r))},e.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},e.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},e.prototype.tilesIn=function(t,e,i){var r=this,n=[],o=this.transform;if(!o)return n;for(var a=i?o.getCameraQueryGeometry(t):t,s=t.map((function(t){return o.pointCoordinate(t)})),u=a.map((function(t){return o.pointCoordinate(t)})),l=this.getIds(),c=1/0,p=1/0,h=-1/0,f=-1/0,d=0,m=u;d<m.length;d+=1){var y=m[d];c=Math.min(c,y.x),p=Math.min(p,y.y),h=Math.max(h,y.x),f=Math.max(f,y.y)}for(var _=function(t){var i=r._tiles[l[t]];if(!i.holdingForFade()){var a=i.tileID,d=Math.pow(2,o.zoom-i.tileID.overscaledZ),m=e*i.queryPadding*8192/i.tileSize/d,y=[a.getTilePoint(new oc(c,p)),a.getTilePoint(new oc(h,f))];if(y[0].x-m<8192&&y[0].y-m<8192&&y[1].x+m>=0&&y[1].y+m>=0){var _=s.map((function(t){return a.getTilePoint(t)})),g=u.map((function(t){return a.getTilePoint(t)}));n.push({tile:i,tileID:a,queryGeometry:_,cameraQueryGeometry:g,scale:d})}}},g=0;g<l.length;g++)_(g);return n},e.prototype.getVisibleCoordinates=function(t){for(var e=this,i=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),r=0,n=i;r<n.length;r+=1){var o=n[r];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return i},e.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(zp(this._source.type))for(var t in this._tiles){var e=this._tiles[t];if(void 0!==e.fadeEndTime&&e.fadeEndTime>=U.now())return!0}return!1},e.prototype.setFeatureState=function(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)},e.prototype.removeFeatureState=function(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)},e.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},e.prototype.setDependencies=function(t,e,i){var r=this._tiles[t];r&&r.setDependencies(e,i)},e.prototype.reloadTilesForDependencies=function(t,e){for(var i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((function(i){return!i.hasDependency(t,e)}))},e}(qt);function Ap(t,e){var i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function zp(t){return"raster"===t||"image"===t||"video"===t}function Ep(){return new a.Worker(Zm.workerUrl)}Tp.maxOverzooming=10,Tp.maxUnderzooming=3;var kp="mapboxgl_preloaded_worker_pool",Cp=function(){this.active={}};Cp.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Cp.workerCount;)this.workers.push(new Ep);return this.active[t]=!0,this.workers.slice()},Cp.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Cp.prototype.isPreloaded=function(){return!!this.active[kp]},Cp.prototype.numActive=function(){return Object.keys(this.active).length};var Pp,Dp=Math.floor(U.hardwareConcurrency/2);function Mp(){return Pp||(Pp=new Cp),Pp}Cp.workerCount=Math.max(Math.min(Dp,6),1);var Lp=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Bp(t,e){var i={};for(var r in t)"ref"!==r&&(i[r]=t[r]);return Lp.forEach((function(t){t in e&&(i[t]=e[t])})),i}function Rp(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=Bp(t[r],e[t[r].ref]));return t}var Fp={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Op(t,e,i){i.push({command:Fp.addSource,args:[t,e[t]]})}function Vp(t,e,i){e.push({command:Fp.removeSource,args:[t]}),i[t]=!0}function Up(t,e,i,r){Vp(t,i,r),Op(t,e,i)}function jp(t,e,i){var r;for(r in t[i])if(t[i].hasOwnProperty(r)&&"data"!==r&&!s(t[i][r],e[i][r]))return!1;for(r in e[i])if(e[i].hasOwnProperty(r)&&"data"!==r&&!s(t[i][r],e[i][r]))return!1;return!0}function Np(t,e,i,r,n,o){var a;for(a in e=e||{},t=t||{})t.hasOwnProperty(a)&&(s(t[a],e[a])||i.push({command:o,args:[r,a,e[a],n]}));for(a in e)e.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(s(t[a],e[a])||i.push({command:o,args:[r,a,e[a],n]}))}function qp(t){return t.id}function Zp(t,e){return t[e.id]=e,t}var Gp=function(t,e){this.reset(t,e)};Gp.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var i=1;i<this.points.length;i++)this._distances[i]=this._distances[i-1]+this.points[i].dist(this.points[i-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Gp.prototype.lerp=function(t){if(1===this.points.length)return this.points[0];t=p(t,0,1);for(var e=1,i=this._distances[e],r=t*this.paddedLength+this.padding;i<r&&e<this._distances.length;)i=this._distances[++e];var n=e-1,o=this._distances[n],a=i-o,s=a>0?(r-o)/a:0;return this.points[n].mult(1-s).add(this.points[e].mult(s))};var Xp=function(t,e,i){var r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var o=0;o<this.xCellCount*this.yCellCount;o++)r.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Wp(t,e,i,r,n){var o=ka();return e?(La(o,o,[1/n,1/n,1]),i||Ba(o,o,r.angle)):Da(o,r.labelPlaneMatrix,t),o}function Hp(t,e,i,r,n){if(e){var o=function(t){var e=new Ea(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}(t);return La(o,o,[n,n,1]),i||Ba(o,o,-r.angle),o}return r.glCoordMatrix}function Kp(t,e){var i=[t.x,t.y,0,1];ah(i,i,e);var r=i[3];return{point:new n(i[0]/r,i[1]/r),signedDistanceFromCamera:r}}function Yp(t,e){return.5+t/e*.5}function Jp(t,e){var i=t[0]/t[3],r=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&r>=-e[1]&&r<=e[1]}function Qp(t,e,i,r,o,a,s,u){var l=r?t.textSizeData:t.iconSizeData,c=ol(l,i.transform.zoom),p=[256/i.width*2+1,256/i.height*2+1],h=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;h.clear();for(var f=t.lineVertexArray,d=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,m=i.transform.width/i.transform.height,y=!1,_=0;_<d.length;_++){var g=d.get(_);if(g.hidden||g.writingMode===Qu.vertical&&!y)oh(g.numGlyphs,h);else{y=!1;var v=[g.anchorX,g.anchorY,0,1];if(ja(v,v,e),Jp(v,p)){var x=Yp(i.transform.cameraToCenterDistance,v[3]),b=nl(l,c,g),w=s?b/x:b*x,I=new n(g.anchorX,g.anchorY),S=Kp(I,o).point,T={},A=eh(g,w,!1,u,e,o,a,t.glyphOffsetArray,f,h,S,I,T,m);y=A.useVertical,(A.notEnoughRoom||y||A.needsFlipping&&eh(g,w,!0,u,e,o,a,t.glyphOffsetArray,f,h,S,I,T,m).notEnoughRoom)&&oh(g.numGlyphs,h)}else oh(g.numGlyphs,h)}}r?t.text.dynamicLayoutVertexBuffer.updateData(h):t.icon.dynamicLayoutVertexBuffer.updateData(h)}function $p(t,e,i,r,n,o,a,s,u,l,c){var p=s.glyphStartIndex+s.numGlyphs,h=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,d=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(p-1),y=rh(t*d,i,r,n,o,a,s.segment,h,f,u,l,c);if(!y)return null;var _=rh(t*m,i,r,n,o,a,s.segment,h,f,u,l,c);return _?{first:y,last:_}:null}function th(t,e,i,r){return t===Qu.horizontal&&Math.abs(i.y-e.y)>Math.abs(i.x-e.x)*r?{useVertical:!0}:(t===Qu.vertical?e.y<i.y:e.x>i.x)?{needsFlipping:!0}:null}function eh(t,e,i,r,o,a,s,u,l,c,p,h,f,d){var m,y=e/24,_=t.lineOffsetX*y,g=t.lineOffsetY*y;if(t.numGlyphs>1){var v=t.glyphStartIndex+t.numGlyphs,x=t.lineStartIndex,b=t.lineStartIndex+t.lineLength,w=$p(y,u,_,g,i,p,h,t,l,a,f);if(!w)return{notEnoughRoom:!0};var I=Kp(w.first.point,s).point,S=Kp(w.last.point,s).point;if(r&&!i){var T=th(t.writingMode,I,S,d);if(T)return T}m=[w.first];for(var A=t.glyphStartIndex+1;A<v-1;A++)m.push(rh(y*u.getoffsetX(A),_,g,i,p,h,t.segment,x,b,l,a,f));m.push(w.last)}else{if(r&&!i){var z=Kp(h,o).point,E=t.lineStartIndex+t.segment+1,k=new n(l.getx(E),l.gety(E)),C=Kp(k,o),P=C.signedDistanceFromCamera>0?C.point:ih(h,k,z,1,o),D=th(t.writingMode,z,P,d);if(D)return D}var M=rh(y*u.getoffsetX(t.glyphStartIndex),_,g,i,p,h,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,l,a,f);if(!M)return{notEnoughRoom:!0};m=[M]}for(var L=0,B=m;L<B.length;L+=1){var R=B[L];hl(c,R.point,R.angle)}return{}}function ih(t,e,i,r,n){var o=Kp(t.add(t.sub(e)._unit()),n).point,a=i.sub(o);return i.add(a._mult(r/a.mag()))}function rh(t,e,i,r,o,a,s,u,l,c,p,h){var f=r?t-e:t+e,d=f>0?1:-1,m=0;r&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var y=d>0?u+s:u+s+1,_=o,g=o,v=0,x=0,b=Math.abs(f),w=[];v+x<=b;){if((y+=d)<u||y>=l)return null;if(g=_,w.push(_),void 0===(_=h[y])){var I=new n(c.getx(y),c.gety(y)),S=Kp(I,p);if(S.signedDistanceFromCamera>0)_=h[y]=S.point;else{var T=y-d;_=ih(0===v?a:new n(c.getx(T),c.gety(T)),I,g,b-v+1,p)}}v+=x,x=g.dist(_)}var A=(b-v)/x,z=_.sub(g),E=z.mult(A)._add(g);E._add(z._unit()._perp()._mult(i*d));var k=m+Math.atan2(_.y-g.y,_.x-g.x);return w.push(E),{point:E,angle:k,path:w}}Xp.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Xp.prototype.insert=function(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)},Xp.prototype.insertCircle=function(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r)},Xp.prototype._insertBoxCell=function(t,e,i,r,n,o){this.boxCells[n].push(o)},Xp.prototype._insertCircleCell=function(t,e,i,r,n,o){this.circleCells[n].push(o)},Xp.prototype._query=function(t,e,i,r,n,o){if(i<0||t>this.width||r<0||e>this.height)return!n&&[];var a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(n)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var u=0;u<this.circleKeys.length;u++){var l=this.circles[3*u],c=this.circles[3*u+1],p=this.circles[3*u+2];a.push({key:this.circleKeys[u],x1:l-p,y1:c-p,x2:l+p,y2:c+p})}return o?a.filter(o):a}return this._forEachCell(t,e,i,r,this._queryCell,a,{hitTest:n,seenUids:{box:{},circle:{}}},o),n?a.length>0:a},Xp.prototype._queryCircle=function(t,e,i,r,n){var o=t-i,a=t+i,s=e-i,u=e+i;if(a<0||o>this.width||u<0||s>this.height)return!r&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},n),r?l.length>0:l},Xp.prototype.query=function(t,e,i,r,n){return this._query(t,e,i,r,!1,n)},Xp.prototype.hitTest=function(t,e,i,r,n){return this._query(t,e,i,r,!0,n)},Xp.prototype.hitTestCircle=function(t,e,i,r){return this._queryCircle(t,e,i,!0,r)},Xp.prototype._queryCell=function(t,e,i,r,n,o,a,s){var u=a.seenUids,l=this.boxCells[n];if(null!==l)for(var c=this.bboxes,p=0,h=l;p<h.length;p+=1){var f=h[p];if(!u.box[f]){u.box[f]=!0;var d=4*f;if(t<=c[d+2]&&e<=c[d+3]&&i>=c[d+0]&&r>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[n];if(null!==m)for(var y=this.circles,_=0,g=m;_<g.length;_+=1){var v=g[_];if(!u.circle[v]){u.circle[v]=!0;var x=3*v;if(this._circleAndRectCollide(y[x],y[x+1],y[x+2],t,e,i,r)&&(!s||s(this.circleKeys[v]))){if(a.hitTest)return o.push(!0),!0;var b=y[x],w=y[x+1],I=y[x+2];o.push({key:this.circleKeys[v],x1:b-I,y1:w-I,x2:b+I,y2:w+I})}}}},Xp.prototype._queryCellCircle=function(t,e,i,r,n,o,a,s){var u=a.circle,l=a.seenUids,c=this.boxCells[n];if(null!==c)for(var p=this.bboxes,h=0,f=c;h<f.length;h+=1){var d=f[h];if(!l.box[d]){l.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(u.x,u.y,u.radius,p[m+0],p[m+1],p[m+2],p[m+3])&&(!s||s(this.boxKeys[d])))return o.push(!0),!0}}var y=this.circleCells[n];if(null!==y)for(var _=this.circles,g=0,v=y;g<v.length;g+=1){var x=v[g];if(!l.circle[x]){l.circle[x]=!0;var b=3*x;if(this._circlesCollide(_[b],_[b+1],_[b+2],u.x,u.y,u.radius)&&(!s||s(this.circleKeys[x])))return o.push(!0),!0}}},Xp.prototype._forEachCell=function(t,e,i,r,n,o,a,s){for(var u=this._convertToXCellCoord(t),l=this._convertToYCellCoord(e),c=this._convertToXCellCoord(i),p=this._convertToYCellCoord(r),h=u;h<=c;h++)for(var f=l;f<=p;f++)if(n.call(this,t,e,i,r,this.xCellCount*f+h,o,a,s))return},Xp.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Xp.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Xp.prototype._circlesCollide=function(t,e,i,r,n,o){var a=r-t,s=n-e,u=i+o;return u*u>a*a+s*s},Xp.prototype._circleAndRectCollide=function(t,e,i,r,n,o,a){var s=(o-r)/2,u=Math.abs(t-(r+s));if(u>s+i)return!1;var l=(a-n)/2,c=Math.abs(e-(n+l));if(c>l+i)return!1;if(u<=s||c<=l)return!0;var p=u-s,h=c-l;return p*p+h*h<=i*i};var nh=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function oh(t,e){for(var i=0;i<t;i++){var r=e.length;e.resize(r+4),e.float32.set(nh,3*r)}}function ah(t,e,i){var r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t[3]=i[3]*r+i[7]*n+i[15],t}var sh=function(t,e,i){void 0===e&&(e=new Xp(t.width+200,t.height+200,25)),void 0===i&&(i=new Xp(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function uh(t,e,i){return e*(8192/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}sh.prototype.placeCollisionBox=function(t,e,i,r,n){var o=this.projectAndGetPerspectiveRatio(r,t.anchorPointX,t.anchorPointY),a=i*o.perspectiveRatio,s=t.x1*a+o.point.x,u=t.y1*a+o.point.y,l=t.x2*a+o.point.x,c=t.y2*a+o.point.y;return!this.isInsideGrid(s,u,l,c)||!e&&this.grid.hitTest(s,u,l,c,n)?{box:[],offscreen:!1}:{box:[s,u,l,c],offscreen:this.isOffscreen(s,u,l,c)}},sh.prototype.placeCollisionCircles=function(t,e,i,r,o,a,s,u,l,c,p,h,f){var d=[],m=new n(e.anchorX,e.anchorY),y=Kp(m,a),_=Yp(this.transform.cameraToCenterDistance,y.signedDistanceFromCamera),g=(c?o/_:o*_)/24,v=Kp(m,s).point,x=$p(g,r,e.lineOffsetX*g,e.lineOffsetY*g,!1,v,m,e,i,s,{}),b=!1,w=!1,I=!0;if(x){for(var S=.5*h*_+f,T=new n(-100,-100),A=new n(this.screenRightBoundary,this.screenBottomBoundary),z=new Gp,E=x.first,k=x.last,C=[],P=E.path.length-1;P>=1;P--)C.push(E.path[P]);for(var D=1;D<k.path.length;D++)C.push(k.path[D]);var M=2.5*S;if(u){var L=C.map((function(t){return Kp(t,u)}));C=L.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:L.map((function(t){return t.point}))}var B=[];if(C.length>0){for(var R=C[0].clone(),F=C[0].clone(),O=1;O<C.length;O++)R.x=Math.min(R.x,C[O].x),R.y=Math.min(R.y,C[O].y),F.x=Math.max(F.x,C[O].x),F.y=Math.max(F.y,C[O].y);B=R.x>=T.x&&F.x<=A.x&&R.y>=T.y&&F.y<=A.y?[C]:F.x<T.x||R.x>A.x||F.y<T.y||R.y>A.y?[]:function(t,e,i,r,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,c=0;c<u.length-1;c++){var p=u[c],h=u[c+1];p.x<e&&h.x<e||(p.x<e?p=new n(e,p.y+(e-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x<e&&(h=new n(e,p.y+(e-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y<i&&h.y<i||(p.y<i?p=new n(p.x+(i-p.y)/(h.y-p.y)*(h.x-p.x),i)._round():h.y<i&&(h=new n(p.x+(i-p.y)/(h.y-p.y)*(h.x-p.x),i)._round()),p.x>=r&&h.x>=r||(p.x>=r?p=new n(r,p.y+(r-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x>=r&&(h=new n(r,p.y+(r-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new n(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round():h.y>=o&&(h=new n(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round()),l&&p.equals(l[l.length-1])||a.push(l=[p]),l.push(h)))))}return a}([C],T.x,T.y,A.x,A.y)}for(var V=0,U=B;V<U.length;V+=1){var j;z.reset(U[V],.25*S),j=z.length<=.5*S?1:Math.ceil(z.paddedLength/M)+1;for(var N=0;N<j;N++){var q=N/Math.max(j-1,1),Z=z.lerp(q),G=Z.x+100,X=Z.y+100;d.push(G,X,S,0);var W=G-S,H=X-S,K=G+S,Y=X+S;if(I=I&&this.isOffscreen(W,H,K,Y),w=w||this.isInsideGrid(W,H,K,Y),!t&&this.grid.hitTestCircle(G,X,S,p)&&(b=!0,!l))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!l&&b||!w?[]:d,offscreen:I,collisionDetected:b}},sh.prototype.queryRenderedSymbols=function(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var e=[],i=1/0,r=1/0,o=-1/0,a=-1/0,s=0,u=t;s<u.length;s+=1){var l=u[s],c=new n(l.x+100,l.y+100);i=Math.min(i,c.x),r=Math.min(r,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y),e.push(c)}for(var p={},h={},f=0,d=this.grid.query(i,r,o,a).concat(this.ignoredGrid.query(i,r,o,a));f<d.length;f+=1){var m=d[f],y=m.key;void 0===p[y.bucketInstanceId]&&(p[y.bucketInstanceId]={}),p[y.bucketInstanceId][y.featureIndex]||ha(e,[new n(m.x1,m.y1),new n(m.x2,m.y1),new n(m.x2,m.y2),new n(m.x1,m.y2)])&&(p[y.bucketInstanceId][y.featureIndex]=!0,void 0===h[y.bucketInstanceId]&&(h[y.bucketInstanceId]=[]),h[y.bucketInstanceId].push(y.featureIndex))}return h},sh.prototype.insertCollisionBox=function(t,e,i,r,n){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:r,collisionGroupID:n},t[0],t[1],t[2],t[3])},sh.prototype.insertCollisionCircles=function(t,e,i,r,n){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:i,featureIndex:r,collisionGroupID:n},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},sh.prototype.projectAndGetPerspectiveRatio=function(t,e,i){var r=[e,i,0,1];return ah(r,r,t),{point:new n((r[0]/r[3]+1)/2*this.transform.width+100,(-r[1]/r[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5}},sh.prototype.isOffscreen=function(t,e,i,r){return i<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},sh.prototype.isInsideGrid=function(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary},sh.prototype.getViewportMatrix=function(){var t=Ca([]);return Ma(t,t,[-100,-100,0]),t};var lh=function(t,e,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&i?1:0,this.placed=i};lh.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var ch=function(t,e,i,r,n){this.text=new lh(t?t.text:null,e,i,n),this.icon=new lh(t?t.icon:null,e,r,n)};ch.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var ph=function(t,e,i){this.text=t,this.icon=e,this.skipFade=i},hh=function(){this.invProjMatrix=ka(),this.viewportMatrix=ka(),this.circles=[]},fh=function(t,e,i,r,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=n},dh=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function mh(t,e,i,r,o){var a=il(t),s=-(a.horizontalAlign-.5)*e,u=-(a.verticalAlign-.5)*i,l=ul(t,r);return new n(s+l[0]*o,u+l[1]*o)}function yh(t,e,i,r,o,a){var s=t.x1,u=t.x2,l=t.y1,c=t.y2,p=t.anchorPointX,h=t.anchorPointY,f=new n(e,i);return r&&f._rotate(o?a:-a),{x1:s+f.x,y1:l+f.y,x2:u+f.x,y2:c+f.y,anchorPointX:p,anchorPointY:h}}dh.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var _h=function(t,e,i,r){this.transform=t.clone(),this.collisionIndex=new sh(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new dh(i),this.collisionCircleArrays={},this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}};function gh(t,e,i,r,n){t.emplaceBack(e?1:0,i?1:0,r||0,n||0),t.emplaceBack(e?1:0,i?1:0,r||0,n||0),t.emplaceBack(e?1:0,i?1:0,r||0,n||0),t.emplaceBack(e?1:0,i?1:0,r||0,n||0)}_h.prototype.getBucketParts=function(t,e,i,r){var n=i.getBucket(e),o=i.latestFeatureIndex;if(n&&o&&e.id===n.layerIds[0]){var a=i.collisionBoxArray,s=n.layers[0].layout,u=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),l=i.tileSize/8192,c=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),p="map"===s.get("text-pitch-alignment"),h="map"===s.get("text-rotation-alignment"),f=uh(i,1,this.transform.zoom),d=Wp(c,p,h,this.transform,f),m=null;if(p){var y=Hp(c,p,h,this.transform,f);m=Da([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[n.bucketInstanceId]=new fh(n.bucketInstanceId,o,n.sourceLayerIndex,n.index,i.tileID);var _={bucket:n,layout:s,posMatrix:c,textLabelPlaneMatrix:d,labelToScreenMatrix:m,scale:u,textPixelRatio:l,holdingForFade:i.holdingForFade(),collisionBoxArray:a,partiallyEvaluatedTextSize:ol(n.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(n.sourceID)};if(r)for(var g=0,v=n.sortKeyRanges;g<v.length;g+=1){var x=v[g];t.push({sortKey:x.sortKey,symbolInstanceStart:x.symbolInstanceStart,symbolInstanceEnd:x.symbolInstanceEnd,parameters:_})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:n.symbolInstances.length,parameters:_})}},_h.prototype.attemptAnchorPlacement=function(t,e,i,r,n,o,a,s,u,l,c,p,h,f,d){var m,y=[p.textOffset0,p.textOffset1],_=mh(t,i,r,y,n),g=this.collisionIndex.placeCollisionBox(yh(e,_.x,_.y,o,a,this.transform.angle),c,s,u,l.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(yh(d,_.x,_.y,o,a,this.transform.angle),c,s,u,l.predicate).box.length)return g.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(m=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={textOffset:y,width:i,height:r,anchor:t,textBoxScale:n,prevAnchor:m},this.markUsedJustification(h,t,p,f),h.allowVerticalPlacement&&(this.markUsedOrientation(h,f,p),this.placedOrientations[p.crossTileID]=f),{shift:_,placedGlyphBoxes:g}):void 0},_h.prototype.placeLayerBucketPart=function(t,e,i){var r=this,n=t.parameters,o=n.bucket,a=n.layout,s=n.posMatrix,u=n.textLabelPlaneMatrix,l=n.labelToScreenMatrix,c=n.textPixelRatio,p=n.holdingForFade,h=n.collisionBoxArray,f=n.partiallyEvaluatedTextSize,d=n.collisionGroup,m=a.get("text-optional"),y=a.get("icon-optional"),_=a.get("text-allow-overlap"),g=a.get("icon-allow-overlap"),v="map"===a.get("text-rotation-alignment"),x="map"===a.get("text-pitch-alignment"),b="none"!==a.get("icon-text-fit"),w="viewport-y"===a.get("symbol-z-order"),I=_&&(g||!o.hasIconData()||y),S=g&&(_||!o.hasTextData()||m);!o.collisionArrays&&h&&o.deserializeCollisionBoxes(h);var T=function(t,n){if(!e[t.crossTileID])if(p)r.placements[t.crossTileID]=new ph(!1,!1,!1);else{var h,w=!1,T=!1,A=!0,z=null,E={box:null,offscreen:null},k={box:null,offscreen:null},C=null,P=null,D=0,M=0,L=0;n.textFeatureIndex?D=n.textFeatureIndex:t.useRuntimeCollisionCircles&&(D=t.featureIndex),n.verticalTextFeatureIndex&&(M=n.verticalTextFeatureIndex);var B=n.textBox;if(B){var R=function(e){var i=Qu.horizontal;if(o.allowVerticalPlacement&&!e&&r.prevPlacement){var n=r.prevPlacement.placedOrientations[t.crossTileID];n&&(r.placedOrientations[t.crossTileID]=n,r.markUsedOrientation(o,i=n,t))}return i},F=function(e,i){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&n.verticalTextBox)for(var r=0,a=o.writingModes;r<a.length&&(a[r]===Qu.vertical?(E=i(),k=E):E=e(),!(E&&E.box&&E.box.length));r+=1);else E=e()};if(a.get("text-variable-anchor")){var O=a.get("text-variable-anchor");if(r.prevPlacement&&r.prevPlacement.variableOffsets[t.crossTileID]){var V=r.prevPlacement.variableOffsets[t.crossTileID];O.indexOf(V.anchor)>0&&(O=O.filter((function(t){return t!==V.anchor}))).unshift(V.anchor)}var U=function(e,i,n){for(var a=e.x2-e.x1,u=e.y2-e.y1,l=t.textBoxScale,p=b&&!g?i:null,h={box:[],offscreen:!1},f=_?2*O.length:O.length,m=0;m<f;++m){var y=r.attemptAnchorPlacement(O[m%O.length],e,a,u,l,v,x,c,s,d,m>=O.length,t,o,n,p);if(y&&(h=y.placedGlyphBoxes)&&h.box&&h.box.length){w=!0,z=y.shift;break}}return h};F((function(){return U(B,n.iconBox,Qu.horizontal)}),(function(){var e=n.verticalTextBox;return o.allowVerticalPlacement&&!(E&&E.box&&E.box.length)&&t.numVerticalGlyphVertices>0&&e?U(e,n.verticalIconBox,Qu.vertical):{box:null,offscreen:null}})),E&&(w=E.box,A=E.offscreen);var j=R(E&&E.box);if(!w&&r.prevPlacement){var N=r.prevPlacement.variableOffsets[t.crossTileID];N&&(r.variableOffsets[t.crossTileID]=N,r.markUsedJustification(o,N.anchor,t,j))}}else{var q=function(e,i){var n=r.collisionIndex.placeCollisionBox(e,_,c,s,d.predicate);return n&&n.box&&n.box.length&&(r.markUsedOrientation(o,i,t),r.placedOrientations[t.crossTileID]=i),n};F((function(){return q(B,Qu.horizontal)}),(function(){var e=n.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&e?q(e,Qu.vertical):{box:null,offscreen:null}})),R(E&&E.box&&E.box.length)}}if(w=(h=E)&&h.box&&h.box.length>0,A=h&&h.offscreen,t.useRuntimeCollisionCircles){var Z=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),G=nl(o.textSizeData,f,Z),X=a.get("text-padding");C=r.collisionIndex.placeCollisionCircles(_,Z,o.lineVertexArray,o.glyphOffsetArray,G,s,u,l,i,x,d.predicate,t.collisionCircleDiameter,X),w=_||C.circles.length>0&&!C.collisionDetected,A=A&&C.offscreen}if(n.iconFeatureIndex&&(L=n.iconFeatureIndex),n.iconBox){var W=function(t){var e=b&&z?yh(t,z.x,z.y,v,x,r.transform.angle):t;return r.collisionIndex.placeCollisionBox(e,g,c,s,d.predicate)};T=k&&k.box&&k.box.length&&n.verticalIconBox?(P=W(n.verticalIconBox)).box.length>0:(P=W(n.iconBox)).box.length>0,A=A&&P.offscreen}var H=m||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,K=y||0===t.numIconVertices;if(H||K?K?H||(T=T&&w):w=T&&w:T=w=T&&w,w&&h&&h.box&&r.collisionIndex.insertCollisionBox(h.box,a.get("text-ignore-placement"),o.bucketInstanceId,k&&k.box&&M?M:D,d.ID),T&&P&&r.collisionIndex.insertCollisionBox(P.box,a.get("icon-ignore-placement"),o.bucketInstanceId,L,d.ID),C&&(w&&r.collisionIndex.insertCollisionCircles(C.circles,a.get("text-ignore-placement"),o.bucketInstanceId,D,d.ID),i)){var Y=o.bucketInstanceId,J=r.collisionCircleArrays[Y];void 0===J&&(J=r.collisionCircleArrays[Y]=new hh);for(var Q=0;Q<C.circles.length;Q+=4)J.circles.push(C.circles[Q+0]),J.circles.push(C.circles[Q+1]),J.circles.push(C.circles[Q+2]),J.circles.push(C.collisionDetected?1:0)}r.placements[t.crossTileID]=new ph(w||I,T||S,A||o.justReloaded),e[t.crossTileID]=!0}};if(w)for(var A=o.getSortedSymbolIndexes(this.transform.angle),z=A.length-1;z>=0;--z){var E=A[z];T(o.symbolInstances.get(E),o.collisionArrays[E])}else for(var k=t.symbolInstanceStart;k<t.symbolInstanceEnd;k++)T(o.symbolInstances.get(k),o.collisionArrays[k]);if(i&&o.bucketInstanceId in this.collisionCircleArrays){var C=this.collisionCircleArrays[o.bucketInstanceId];Pa(C.invProjMatrix,s),C.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1},_h.prototype.markUsedJustification=function(t,e,i,r){var n;n=r===Qu.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[function(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}(e)];for(var o=0,a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];o<a.length;o+=1){var s=a[o];s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=n>=0&&s!==n?0:i.crossTileID)}},_h.prototype.markUsedOrientation=function(t,e,i){for(var r=e===Qu.horizontal||e===Qu.horizontalOnly?e:0,n=e===Qu.vertical?e:0,o=0,a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];o<a.length;o+=1)t.text.placedSymbolArray.get(a[o]).placedOrientation=r;i.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=n)},_h.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var r=e?e.symbolFadeChange(t):1,n=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var u=this.placements[s],l=n[s];l?(this.opacities[s]=new ch(l,r,u.text,u.icon),i=i||u.text!==l.text.placed||u.icon!==l.icon.placed):(this.opacities[s]=new ch(null,r,u.text,u.icon,u.skipFade),i=i||u.text||u.icon)}for(var c in n){var p=n[c];if(!this.opacities[c]){var h=new ch(p,r,!1,!1);h.isHidden()||(this.opacities[c]=h,i=i||p.text.placed||p.icon.placed)}}for(var f in o)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=o[f]);for(var d in a)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=a[d]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},_h.prototype.updateLayerOpacities=function(t,e){for(var i={},r=0,n=e;r<n.length;r+=1){var o=n[r],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,i,o.collisionBoxArray)}},_h.prototype.updateBucketOpacities=function(t,e,i){var r=this;t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();var o=t.layers[0].layout,a=new ch(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),l=o.get("text-variable-anchor"),c="map"===o.get("text-rotation-alignment"),p="map"===o.get("text-pitch-alignment"),h="none"!==o.get("icon-text-fit"),f=new ch(null,0,s&&(u||!t.hasIconData()||o.get("icon-optional")),u&&(s||!t.hasTextData()||o.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);for(var d=function(t,e,i){for(var r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i)},m=function(i){var o=t.symbolInstances.get(i),s=o.numHorizontalGlyphVertices,u=o.numVerticalGlyphVertices,m=o.crossTileID,y=r.opacities[m];e[m]?y=a:y||(r.opacities[m]=y=f),e[m]=!0;var _=o.numIconVertices>0,g=r.placedOrientations[o.crossTileID],v=g===Qu.vertical,x=g===Qu.horizontal||g===Qu.horizontalOnly;if(s>0||u>0){var b=Ah(y.text);d(t.text,s,v?zh:b),d(t.text,u,x?zh:b);var w=y.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=w||v?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var I=r.variableOffsets[o.crossTileID];I&&r.markUsedJustification(t,I.anchor,o,g);var S=r.placedOrientations[o.crossTileID];S&&(r.markUsedJustification(t,"left",o,S),r.markUsedOrientation(t,S,o))}if(_){var T=Ah(y.icon),A=!(h&&o.verticalPlacedIconSymbolIndex&&v);o.placedIconSymbolIndex>=0&&(d(t.icon,o.numIconVertices,A?T:zh),t.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=y.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(t.icon,o.numVerticalIconVertices,A?zh:T),t.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var z=t.collisionArrays[i];if(z){var E=new n(0,0);if(z.textBox||z.verticalTextBox){var k=!0;if(l){var C=r.variableOffsets[m];C?(E=mh(C.anchor,C.width,C.height,C.textOffset,C.textBoxScale),c&&E._rotate(p?r.transform.angle:-r.transform.angle)):k=!1}z.textBox&&gh(t.textCollisionBox.collisionVertexArray,y.text.placed,!k||v,E.x,E.y),z.verticalTextBox&&gh(t.textCollisionBox.collisionVertexArray,y.text.placed,!k||x,E.x,E.y)}var P=Boolean(!x&&z.verticalIconBox);z.iconBox&&gh(t.iconCollisionBox.collisionVertexArray,y.icon.placed,P,h?E.x:0,h?E.y:0),z.verticalIconBox&&gh(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!P,h?E.x:0,h?E.y:0)}}},y=0;y<t.symbolInstances.length;y++)m(y);if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){var _=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=_.invProjMatrix,t.placementViewportMatrix=_.viewportMatrix,t.collisionCircleArray=_.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}},_h.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},_h.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},_h.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},_h.prototype.stillRecent=function(t,e){var i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t},_h.prototype.setStale=function(){this.stale=!0};var vh=Math.pow(2,25),xh=Math.pow(2,24),bh=Math.pow(2,17),wh=Math.pow(2,16),Ih=Math.pow(2,9),Sh=Math.pow(2,8),Th=Math.pow(2,1);function Ah(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*vh+e*xh+i*bh+e*wh+i*Ih+e*Sh+i*Th+e}var zh=0,Eh=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Eh.prototype.continuePlacement=function(t,e,i,r,n){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,n())return!0;return!1};var kh=function(t,e,i,r,n,o,a){this.placement=new _h(t,n,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=r,this._done=!1};kh.prototype.isDone=function(){return this._done},kh.prototype.continuePlacement=function(t,e,i){for(var r=this,n=U.now(),o=function(){var t=U.now()-n;return!r._forceFullPlacement&&t>2};this._currentPlacementIndex>=0;){var a=e[t[this._currentPlacementIndex]],s=this.placement.collisionIndex.transform.zoom;if("symbol"===a.type&&(!a.minzoom||a.minzoom<=s)&&(!a.maxzoom||a.maxzoom>s)){if(this._inProgressLayer||(this._inProgressLayer=new Eh(a)),this._inProgressLayer.continuePlacement(i[a.source],this.placement,this._showCollisionBoxes,a,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},kh.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Ch=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var r=0;r<e.length;r++){var n=e.get(r),o=n.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:n.crossTileID,coord:this.getScaledCoordinates(n,t)})}};Ch.prototype.getScaledCoordinates=function(t,e){var i=.03125/Math.pow(2,e.canonical.z-this.tileID.canonical.z);return{x:Math.floor((8192*e.canonical.x+t.anchorX)*i),y:Math.floor((8192*e.canonical.y+t.anchorY)*i)}},Ch.prototype.findMatches=function(t,e,i){for(var r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),n=0;n<t.length;n++){var o=t.get(n);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),u=0,l=a;u<l.length;u+=1){var c=l[u];if(Math.abs(c.coord.x-s.x)<=r&&Math.abs(c.coord.y-s.y)<=r&&!i[c.crossTileID]){i[c.crossTileID]=!0,o.crossTileID=c.crossTileID;break}}}}};var Ph=function(){this.maxCrossTileID=0};Ph.prototype.generate=function(){return++this.maxCrossTileID};var Dh=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Dh.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var i in this.indexes){var r=this.indexes[i],n={};for(var o in r){var a=r[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),n[a.tileID.key]=a}this.indexes[i]=n}this.lng=t},Dh.prototype.addBucket=function(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var r=0;r<e.symbolInstances.length;r++)e.symbolInstances.get(r).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var n=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var a=this.indexes[o];if(Number(o)>t.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,n)}else{var l=a[t.scaledTo(Number(o)).key];l&&l.findMatches(e.symbolInstances,t,n)}}for(var c=0;c<e.symbolInstances.length;c++){var p=e.symbolInstances.get(c);p.crossTileID||(p.crossTileID=i.generate(),n[p.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ch(t,e.symbolInstances,e.bucketInstanceId),!0},Dh.prototype.removeBucketCrossTileIDs=function(t,e){for(var i in e.indexedSymbolInstances)for(var r=0,n=e.indexedSymbolInstances[i];r<n.length;r+=1)delete this.usedCrossTileIDs[t][n[r].crossTileID]},Dh.prototype.removeStaleBuckets=function(t){var e=!1;for(var i in this.indexes){var r=this.indexes[i];for(var n in r)t[r[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[n]),delete r[n],e=!0)}return e};var Mh=function(){this.layerIndexes={},this.crossTileIDs=new Ph,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Mh.prototype.addLayer=function(t,e,i){var r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new Dh);var n=!1,o={};r.handleWrapJump(i);for(var a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.getBucket(t);l&&t.id===l.layerIds[0]&&(l.bucketInstanceId||(l.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(u.tileID,l,this.crossTileIDs)&&(n=!0),o[l.bucketInstanceId]=!0)}return r.removeStaleBuckets(o)&&(n=!0),n},Mh.prototype.pruneUnusedLayers=function(t){var e={};for(var i in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[i]||delete this.layerIndexes[i]};var Lh=function(t,e){return Xr(t,e&&e.filter((function(t){return"source.canvas"!==t.identifier})))},Bh=y(Fp,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Rh=y(Fp,["setCenter","setZoom","setBearing","setPitch"]),Fh=function(){var t={},e=Zt.$version;for(var i in Zt.$root){var r,n=Zt.$root[i];if(n.required)null!=(r="version"===i?e:"array"===n.type?[]:{})&&(t[i]=r)}return t}(),Oh=function(t){function e(i,r){var n=this;void 0===r&&(r={}),t.call(this),this.map=i,this.dispatcher=new Kl(Mp(),this),this.imageManager=new Bl,this.imageManager.setEventedParent(this),this.glyphManager=new Nl(i._requestManager,r.localIdeographFontFamily),this.lineAtlas=new Xl(256,512),this.crossTileSymbolIndex=new Mh,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new on,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",Ct());var o=this;this._rtlTextPluginCallback=e.registerForPluginStateChange((function(t){o.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},(function(t,e){if(In(t),e&&e.every((function(t){return t})))for(var i in o.sourceCaches)o.sourceCaches[i].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=n.sourceCaches[t.sourceId];if(e){var i=e.getSource();if(i&&i.vectorLayerIds)for(var r in n._layers){var o=n._layers[r];o.source===i.id&&n._validateLayer(o)}}}}))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.loadURL=function(t,e){var i=this;void 0===e&&(e={}),this.fire(new jt("dataloading",{dataType:"style"}));var r="boolean"==typeof e.validate?e.validate:!ot(t);t=this.map._requestManager.normalizeStyleURL(t,e.accessToken);var n=this.map._requestManager.transformRequest(t,Et.Style);this._request=Lt(n,(function(t,e){i._request=null,t?i.fire(new Nt(t)):e&&i._load(e,r)}))},e.prototype.loadJSON=function(t,e){var i=this;void 0===e&&(e={}),this.fire(new jt("dataloading",{dataType:"style"})),this._request=U.frame((function(){i._request=null,i._load(t,!1!==e.validate)}))},e.prototype.loadEmpty=function(){this.fire(new jt("dataloading",{dataType:"style"})),this._load(Fh,!1)},e.prototype._load=function(t,e){if(!e||!Lh(this,Nr(t))){for(var i in this._loaded=!0,this.stylesheet=t,t.sources)this.addSource(i,t.sources[i],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var r=Rp(this.stylesheet.layers);this._order=r.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var n=0,o=r;n<o.length;n+=1){var a=o[n];(a=zl(a)).setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=a,this._serializedLayers[a.id]=a.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Gl(this.stylesheet.light),this.fire(new jt("data",{dataType:"style"})),this.fire(new jt("style.load"))}},e.prototype._loadSprite=function(t){var e=this;this._spriteRequest=function(t,e,i){var r,n,o,a=U.devicePixelRatio>1?"@2x":"",s=Lt(e.transformRequest(e.normalizeSpriteURL(t,a,".json"),Et.SpriteJSON),(function(t,e){s=null,o||(o=t,r=e,l())})),u=Ot(e.transformRequest(e.normalizeSpriteURL(t,a,".png"),Et.SpriteImage),(function(t,e){u=null,o||(o=t,n=e,l())}));function l(){if(o)i(o);else if(r&&n){var t=U.getImageData(n),e={};for(var a in r){var s=r[a],u=s.width,l=s.height,c=s.x,p=s.y,h=s.sdf,f=s.pixelRatio,d=s.stretchX,m=s.stretchY,y=s.content,_=new Ya({width:u,height:l});Ya.copy(t,_,{x:c,y:p},{x:0,y:0},{width:u,height:l}),e[a]={data:_,pixelRatio:f,sdf:h,stretchX:d,stretchY:m,content:y}}i(null,e)}}return{cancel:function(){s&&(s.cancel(),s=null),u&&(u.cancel(),u=null)}}}(t,this.map._requestManager,(function(t,i){if(e._spriteRequest=null,t)e.fire(new Nt(t));else if(i)for(var r in i)e.imageManager.addImage(r,i[r]);e.imageManager.setLoaded(!0),e._availableImages=e.imageManager.listImages(),e.dispatcher.broadcast("setImages",e._availableImages),e.fire(new jt("data",{dataType:"style"}))}))},e.prototype._validateLayer=function(t){var e=this.sourceCaches[t.source];if(e){var i=t.sourceLayer;if(i){var r=e.getSource();("geojson"===r.type||r.vectorLayerIds&&-1===r.vectorLayerIds.indexOf(i))&&this.fire(new Nt(new Error('Source layer "'+i+'" does not exist on source "'+r.id+'" as specified by style layer "'+t.id+'"')))}}},e.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},e.prototype._serializeLayers=function(t){for(var e=[],i=0,r=t;i<r.length;i+=1){var n=this._layers[r[i]];"custom"!==n.type&&e.push(n.serialize())}return e},e.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t){if(this._loaded){var e=this._changed;if(this._changed){var i=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);for(var n in(i.length||r.length)&&this._updateWorkerLayers(i,r),this._updatedSources){var o=this._updatedSources[n];"reload"===o?this._reloadSource(n):"clear"===o&&this._clearSource(n)}for(var a in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[a].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}var s={};for(var u in this.sourceCaches){var l=this.sourceCaches[u];s[u]=l.used,l.used=!1}for(var c=0,p=this._order;c<p.length;c+=1){var h=this._layers[p[c]];h.recalculate(t,this._availableImages),!h.isHidden(t.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}for(var f in s){var d=this.sourceCaches[f];s[f]!==d.used&&d.fire(new jt("data",{sourceDataType:"visibility",dataType:"source",sourceId:f}))}this.light.recalculate(t),this.z=t.zoom,e&&this.fire(new jt("data",{dataType:"style"}))}},e.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},e.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),Lh(this,Nr(t)))return!1;(t=T(t)).layers=Rp(t.layers);var i=function(t,e){if(!t)return[{command:Fp.setStyle,args:[e]}];var i=[];try{if(!s(t.version,e.version))return[{command:Fp.setStyle,args:[e]}];s(t.center,e.center)||i.push({command:Fp.setCenter,args:[e.center]}),s(t.zoom,e.zoom)||i.push({command:Fp.setZoom,args:[e.zoom]}),s(t.bearing,e.bearing)||i.push({command:Fp.setBearing,args:[e.bearing]}),s(t.pitch,e.pitch)||i.push({command:Fp.setPitch,args:[e.pitch]}),s(t.sprite,e.sprite)||i.push({command:Fp.setSprite,args:[e.sprite]}),s(t.glyphs,e.glyphs)||i.push({command:Fp.setGlyphs,args:[e.glyphs]}),s(t.transition,e.transition)||i.push({command:Fp.setTransition,args:[e.transition]}),s(t.light,e.light)||i.push({command:Fp.setLight,args:[e.light]});var r={},n=[];!function(t,e,i,r){var n;for(n in e=e||{},t=t||{})t.hasOwnProperty(n)&&(e.hasOwnProperty(n)||Vp(n,i,r));for(n in e)e.hasOwnProperty(n)&&(t.hasOwnProperty(n)?s(t[n],e[n])||("geojson"===t[n].type&&"geojson"===e[n].type&&jp(t,e,n)?i.push({command:Fp.setGeoJSONSourceData,args:[n,e[n].data]}):Up(n,e,i,r)):Op(n,e,i))}(t.sources,e.sources,n,r);var o=[];t.layers&&t.layers.forEach((function(t){r[t.source]?i.push({command:Fp.removeLayer,args:[t.id]}):o.push(t)})),i=i.concat(n),function(t,e,i){e=e||[];var r,n,o,a,u,l,c,p=(t=t||[]).map(qp),h=e.map(qp),f=t.reduce(Zp,{}),d=e.reduce(Zp,{}),m=p.slice(),y=Object.create(null);for(r=0,n=0;r<p.length;r++)d.hasOwnProperty(o=p[r])?n++:(i.push({command:Fp.removeLayer,args:[o]}),m.splice(m.indexOf(o,n),1));for(r=0,n=0;r<h.length;r++)m[m.length-1-r]!==(o=h[h.length-1-r])&&(f.hasOwnProperty(o)?(i.push({command:Fp.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-n),1)):n++,i.push({command:Fp.addLayer,args:[d[o],l=m[m.length-r]]}),m.splice(m.length-r,0,o),y[o]=!0);for(r=0;r<h.length;r++)if(a=f[o=h[r]],u=d[o],!y[o]&&!s(a,u))if(s(a.source,u.source)&&s(a["source-layer"],u["source-layer"])&&s(a.type,u.type)){for(c in Np(a.layout,u.layout,i,o,null,Fp.setLayoutProperty),Np(a.paint,u.paint,i,o,null,Fp.setPaintProperty),s(a.filter,u.filter)||i.push({command:Fp.setFilter,args:[o,u.filter]}),s(a.minzoom,u.minzoom)&&s(a.maxzoom,u.maxzoom)||i.push({command:Fp.setLayerZoomRange,args:[o,u.minzoom,u.maxzoom]}),a)a.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Np(a[c],u[c],i,o,c.slice(6),Fp.setPaintProperty):s(a[c],u[c])||i.push({command:Fp.setLayerProperty,args:[o,c,u[c]]}));for(c in u)u.hasOwnProperty(c)&&!a.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Np(a[c],u[c],i,o,c.slice(6),Fp.setPaintProperty):s(a[c],u[c])||i.push({command:Fp.setLayerProperty,args:[o,c,u[c]]}))}else i.push({command:Fp.removeLayer,args:[o]}),l=m[m.lastIndexOf(o)+1],i.push({command:Fp.addLayer,args:[u,l]})}(o,e.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:Fp.setStyle,args:[e]}]}return i}(this.serialize(),t).filter((function(t){return!(t.command in Rh)}));if(0===i.length)return!1;var r=i.filter((function(t){return!(t.command in Bh)}));if(r.length>0)throw new Error("Unimplemented: "+r.map((function(t){return t.command})).join(", ")+".");return i.forEach((function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)})),this.stylesheet=t,!0},e.prototype.addImage=function(t,e){if(this.getImage(t))return this.fire(new Nt(new Error("An image with this name already exists.")));this.imageManager.addImage(t,e),this._afterImageUpdated(t)},e.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},e.prototype.getImage=function(t){return this.imageManager.getImage(t)},e.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new Nt(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._afterImageUpdated(t)},e.prototype._afterImageUpdated=function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new jt("data",{dataType:"style"}))},e.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},e.prototype.addSource=function(t,e,i){var r=this;if(void 0===i&&(i={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(e).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(e.type)>=0&&this._validate(Nr.source,"sources."+t,e,null,i))){this.map&&this.map._collectResourceTiming&&(e.collectResourceTiming=!0);var n=this.sourceCaches[t]=new Tp(t,e,this.dispatcher);n.style=this,n.setEventedParent(this,(function(){return{isSourceLoaded:r.loaded(),source:n.serialize(),sourceId:t}})),n.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var e in this._layers)if(this._layers[e].source===t)return this.fire(new Nt(new Error('Source "'+t+'" cannot be removed while layer "'+e+'" is using it.')));var i=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],i.fire(new jt("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},e.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,i){void 0===i&&(i={}),this._checkLoaded();var r=t.id;if(this.getLayer(r))this.fire(new Nt(new Error('Layer with id "'+r+'" already exists on this map')));else{var n;if("custom"===t.type){if(Lh(this,function(t){var e=[],i=t.id;return void 0===i&&e.push({message:"layers."+i+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+i+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+i+': property "renderingMode" must be either "2d" or "3d"'}),e}(t)))return;n=zl(t)}else{if("object"==typeof t.source&&(this.addSource(r,t.source),t=m(t=T(t),{source:r})),this._validate(Nr.layer,"layers."+r,t,{arrayIndex:-1},i))return;n=zl(t),this._validateLayer(n),n.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[n.id]=n.serialize()}var o=e?this._order.indexOf(e):this._order.length;if(e&&-1===o)this.fire(new Nt(new Error('Layer with id "'+e+'" does not exist on this map.')));else{if(this._order.splice(o,0,r),this._layerOrderChanged=!0,this._layers[r]=n,this._removedLayers[r]&&n.source&&"custom"!==n.type){var a=this._removedLayers[r];delete this._removedLayers[r],a.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause())}this._updateLayer(n),n.onAdd&&n.onAdd(this.map)}}},e.prototype.moveLayer=function(t,e){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==e){var i=this._order.indexOf(t);this._order.splice(i,1);var r=e?this._order.indexOf(e):this._order.length;e&&-1===r?this.fire(new Nt(new Error('Layer with id "'+e+'" does not exist on this map.'))):(this._order.splice(r,0,t),this._layerOrderChanged=!0)}}else this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(e){e.setEventedParent(null);var i=this._order.indexOf(t);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],e.onRemove&&e.onRemove(this.map)}else this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.hasLayer=function(t){return t in this._layers},e.prototype.setLayerZoomRange=function(t,e,i){this._checkLoaded();var r=this.getLayer(t);r?r.minzoom===e&&r.maxzoom===i||(null!=e&&(r.minzoom=e),null!=i&&(r.maxzoom=i),this._updateLayer(r)):this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},e.prototype.setFilter=function(t,e,i){void 0===i&&(i={}),this._checkLoaded();var r=this.getLayer(t);if(r){if(!s(r.filter,e))return null==e?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(Nr.filter,"layers."+r.id+".filter",e,null,i)||(r.filter=T(e),this._updateLayer(r)))}else this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},e.prototype.getFilter=function(t){return T(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,i,r){void 0===r&&(r={}),this._checkLoaded();var n=this.getLayer(t);n?s(n.getLayoutProperty(e),i)||(n.setLayoutProperty(e,i,r),this._updateLayer(n)):this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},e.prototype.getLayoutProperty=function(t,e){var i=this.getLayer(t);if(i)return i.getLayoutProperty(e);this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style.")))},e.prototype.setPaintProperty=function(t,e,i,r){void 0===r&&(r={}),this._checkLoaded();var n=this.getLayer(t);n?s(n.getPaintProperty(e),i)||(n.setPaintProperty(e,i,r)&&this._updateLayer(n),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new Nt(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},e.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},e.prototype.setFeatureState=function(t,e){this._checkLoaded();var i=t.source,r=t.sourceLayer,n=this.sourceCaches[i];if(void 0!==n){var o=n.getSource().type;"geojson"===o&&r?this.fire(new Nt(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||r?(void 0===t.id&&this.fire(new Nt(new Error("The feature id parameter must be provided."))),n.setFeatureState(r,t.id,e)):this.fire(new Nt(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Nt(new Error("The source '"+i+"' does not exist in the map's style.")))},e.prototype.removeFeatureState=function(t,e){this._checkLoaded();var i=t.source,r=this.sourceCaches[i];if(void 0!==r){var n=r.getSource().type,o="vector"===n?t.sourceLayer:void 0;"vector"!==n||o?e&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new Nt(new Error("A feature id is required to remove its specific state property."))):r.removeFeatureState(o,t.id,e):this.fire(new Nt(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Nt(new Error("The source '"+i+"' does not exist in the map's style.")))},e.prototype.getFeatureState=function(t){this._checkLoaded();var e=t.source,i=t.sourceLayer,r=this.sourceCaches[e];if(void 0!==r){if("vector"!==r.getSource().type||i)return void 0===t.id&&this.fire(new Nt(new Error("The feature id parameter must be provided."))),r.getFeatureState(i,t.id);this.fire(new Nt(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Nt(new Error("The source '"+e+"' does not exist in the map's style.")))},e.prototype.getTransition=function(){return m({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.serialize=function(){return S({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:I(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},e.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return"fill-extrusion"===e._layers[t].type},r={},n=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(i(a)){r[a]=o;for(var s=0,u=t;s<u.length;s+=1){var l=u[s][a];if(l)for(var c=0,p=l;c<p.length;c+=1)n.push(p[c])}}}n.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var h=[],f=this._order.length-1;f>=0;f--){var d=this._order[f];if(i(d))for(var m=n.length-1;m>=0;m--){var y=n[m].feature;if(r[y.layer.id]<f)break;h.push(y),n.pop()}else for(var _=0,g=t;_<g.length;_+=1){var v=g[_][d];if(v)for(var x=0,b=v;x<b.length;x+=1)h.push(b[x].feature)}}return h},e.prototype.queryRenderedFeatures=function(t,e,i){e&&e.filter&&this._validate(Nr.filter,"queryRenderedFeatures.filter",e.filter,null,e);var r={};if(e&&e.layers){if(!Array.isArray(e.layers))return this.fire(new Nt(new Error("parameters.layers must be an Array."))),[];for(var n=0,o=e.layers;n<o.length;n+=1){var a=o[n],s=this._layers[a];if(!s)return this.fire(new Nt(new Error("The layer '"+a+"' does not exist in the map's style and cannot be queried for features."))),[];r[s.source]=!0}}var u=[];for(var l in e.availableImages=this._availableImages,this.sourceCaches)e.layers&&!r[l]||u.push(Ic(this.sourceCaches[l],this._layers,this._serializedLayers,t,e,i));return this.placement&&u.push(function(t,e,i,r,n,o,a){for(var s={},u=o.queryRenderedSymbols(r),l=[],c=0,p=Object.keys(u).map(Number);c<p.length;c+=1)l.push(a[p[c]]);l.sort(Sc);for(var h=function(){var i=d[f],r=i.featureIndex.lookupSymbolFeatures(u[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,n.filter,n.layers,n.availableImages,t);for(var o in r){var a=s[o]=s[o]||[],l=r[o];l.sort((function(t,e){var r=i.featureSortOrder;if(r){var n=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-n}return e.featureIndex-t.featureIndex}));for(var c=0,p=l;c<p.length;c+=1)a.push(p[c])}},f=0,d=l;f<d.length;f+=1)h();var m=function(e){s[e].forEach((function(r){var n=r.feature,o=i[t[e].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=o}))};for(var y in s)m(y);return s}(this._layers,this._serializedLayers,this.sourceCaches,t,e,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)},e.prototype.querySourceFeatures=function(t,e){e&&e.filter&&this._validate(Nr.filter,"querySourceFeatures.filter",e.filter,null,e);var i=this.sourceCaches[t];return i?function(t,e){for(var i=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),r=[],n={},o=0;o<i.length;o++){var a=i[o],s=a.tileID.canonical.key;n[s]||(n[s]=!0,a.querySourceFeatures(r,e))}return r}(i,e):[]},e.prototype.addSourceType=function(t,i,r){return e.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(e.setSourceType(t,i),i.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:i.workerSourceURL},r):r(null,null))},e.prototype.getLight=function(){return this.light.getLight()},e.prototype.setLight=function(t,e){void 0===e&&(e={}),this._checkLoaded();var i=this.light.getLight(),r=!1;for(var n in t)if(!s(t[n],i[n])){r=!0;break}if(r){var o={now:U.now(),transition:m({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,e),this.light.updateTransitions(o)}},e.prototype._validate=function(t,e,i,r,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Lh(this,t.call(Nr,m({key:e,style:this.serialize(),value:i,styleSpec:Zt},r)))},e.prototype._remove=function(){for(var t in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),Tn.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[t].setEventedParent(null);for(var e in this.sourceCaches)this.sourceCaches[e].clearTiles(),this.sourceCaches[e].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},e.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},e.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},e.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},e.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},e.prototype._updatePlacement=function(t,e,i,r,n){void 0===n&&(n=!1);for(var o=!1,a=!1,s={},u=0,l=this._order;u<l.length;u+=1){var c=this._layers[l[u]];if("symbol"===c.type){if(!s[c.source]){var p=this.sourceCaches[c.source];s[c.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var h=this.crossTileSymbolIndex.addLayer(c,s[c.source],t.center.lng);o=o||h}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(U.now(),t.zoom))&&(this.pauseablePlacement=new kh(t,this._order,n,e,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(U.now()),a=!0),o&&this.pauseablePlacement.placement.setStale()),a||o)for(var f=0,d=this._order;f<d.length;f+=1){var m=this._layers[d[f]];"symbol"===m.type&&this.placement.updateLayerOpacities(m,s[m.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(U.now())},e.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},e.prototype.getImages=function(t,e,i){this.imageManager.getImages(e.icons,i),this._updateTilesForChangedImages();var r=this.sourceCaches[e.source];r&&r.setDependencies(e.tileID.key,e.type,e.icons)},e.prototype.getGlyphs=function(t,e,i){this.glyphManager.getGlyphs(e.stacks,i)},e.prototype.getResource=function(t,e,i){return Mt(e,i)},e}(qt);Oh.getSourceType=function(t){return bc[t]},Oh.setSourceType=function(t,e){bc[t]=e},Oh.registerForPluginStateChange=function(t){return t({pluginStatus:bn,pluginURL:wn}),Tn.on("pluginStateChange",t),t};var Vh=Hn([{name:"a_pos",type:"Int16",components:2}]),Uh=ff("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),jh=ff("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Nh=ff("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),qh=ff("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Zh=ff("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Gh=ff("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),Xh=ff("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Wh=ff("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Hh=ff("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),Kh=ff("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),Yh=ff("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),Jh=ff("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Qh=ff("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),$h=ff("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),tf=ff("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ef=ff("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),rf=ff("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),nf=ff("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),of=ff("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),af=ff("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),sf=ff("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),uf=ff("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),lf=ff("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),cf=ff("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),pf=ff("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),hf=ff("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function ff(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/attribute ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(n):n,s={};return{fragmentSource:t=t.replace(i,(function(t,e,i,r,n){return s[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nvarying "+i+" "+r+" "+n+";\n#else\nuniform "+i+" "+r+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n"})),vertexSource:e=e.replace(i,(function(t,e,i,r,n){var o="float"===r?"vec2":"vec4",a=n.match(/color/)?"color":o;return s[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+o+" a_"+n+";\nvarying "+i+" "+r+" "+n+";\n#else\nuniform "+i+" "+r+" u_"+n+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+a+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+o+" a_"+n+";\n#else\nuniform "+i+" "+r+" u_"+n+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+r+" "+n+" = a_"+n+";\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+r+" "+n+" = unpack_mix_"+a+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+r+" "+n+" = u_"+n+";\n#endif\n"})),staticAttributes:r,staticUniforms:a}}var df=Object.freeze({__proto__:null,prelude:Uh,background:jh,backgroundPattern:Nh,circle:qh,clippingMask:Zh,heatmap:Gh,heatmapTexture:Xh,collisionBox:Wh,collisionCircle:Hh,debug:Kh,fill:Yh,fillOutline:Jh,fillOutlinePattern:Qh,fillPattern:$h,fillExtrusion:tf,fillExtrusionPattern:ef,hillshadePrepare:rf,hillshade:nf,line:of,lineGradient:af,linePattern:sf,lineSDF:uf,raster:lf,symbolIcon:cf,symbolSDF:pf,symbolTextAndIcon:hf}),mf=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function yf(t){for(var e=[],i=0;i<t.length;i++)if(null!==t[i]){var r=t[i].split(" ");e.push(r.pop())}return e}mf.prototype.bind=function(t,e,i,r,n,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==r.length,l=0;!u&&l<r.length;l++)this.boundPaintVertexBuffers[l]!==r[l]&&(u=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===i&&!u&&this.boundIndexBuffer===n&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind()):this.freshBind(e,i,r,n,o,a,s)},mf.prototype.freshBind=function(t,e,i,r,n,o,a){var s,u=t.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=l.currentNumAttributes||0;for(var p=u;p<s;p++)c.disableVertexAttribArray(p)}e.enableAttributes(c,t);for(var h=0,f=i;h<f.length;h+=1)f[h].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,n);for(var d=0,m=i;d<m.length;d+=1){var y=m[d];y.bind(),y.setVertexAttribPointers(c,t,n)}o&&(o.bind(),o.setVertexAttribPointers(c,t,n)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,n)),l.currentNumAttributes=u},mf.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var _f=function(t,e,i,r,n,o){var a=t.gl;this.program=a.createProgram();for(var s=yf(i.staticAttributes),u=r?r.getBinderAttributes():[],l=s.concat(u),c=i.staticUniforms?yf(i.staticUniforms):[],p=r?r.getBinderUniforms():[],h=[],f=0,d=c.concat(p);f<d.length;f+=1){var m=d[f];h.indexOf(m)<0&&h.push(m)}var y=r?r.defines():[];o&&y.push("#define OVERDRAW_INSPECTOR;");var _=y.concat(Uh.fragmentSource,i.fragmentSource).join("\n"),g=y.concat(Uh.vertexSource,i.vertexSource).join("\n"),v=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(v,_),a.compileShader(v),a.attachShader(this.program,v);var x=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(x,g),a.compileShader(x),a.attachShader(this.program,x),this.attributes={};var b={};this.numAttributes=l.length;for(var w=0;w<this.numAttributes;w++)l[w]&&(a.bindAttribLocation(this.program,w,l[w]),this.attributes[l[w]]=w);a.linkProgram(this.program),a.deleteShader(x),a.deleteShader(v);for(var I=0;I<h.length;I++){var S=h[I];if(S&&!b[S]){var T=a.getUniformLocation(this.program,S);T&&(b[S]=T)}}this.fixedUniforms=n(t,b),this.binderUniforms=r?r.getUniforms(t,b):[]}}};function gf(t,e,i){var r=1/uh(i,1,e.transform.tileZoom),n=Math.pow(2,i.tileID.overscaledZ),o=i.tileSize*Math.pow(2,e.transform.tileZoom)/n,a=o*(i.tileID.canonical.x+i.tileID.wrap*n),s=o*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}_f.prototype.draw=function(t,e,i,r,n,o,a,s,u,l,c,p,h,f,d,m){var y,_=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(n),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[g].set(a[g]);f&&f.setUniforms(t,this.binderUniforms,p,{zoom:h});for(var v=(y={},y[_.LINES]=2,y[_.TRIANGLES]=3,y[_.LINE_STRIP]=1,y)[e],x=0,b=c.get();x<b.length;x+=1){var w=b[x],I=w.vaos||(w.vaos={});(I[s]||(I[s]=new mf)).bind(t,this,u,f?f.getPaintVertexBuffers():[],l,w.vertexOffset,d,m),_.drawElements(e,w.primitiveLength*v,_.UNSIGNED_SHORT,w.primitiveOffset*v*2)}}};var vf=function(t,e,i,r){var n=e.style.light,o=n.properties.get("position"),a=[o.x,o.y,o.z],s=function(){var t=new Ea(9);return Ea!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}();"viewport"===n.properties.get("anchor")&&function(t,e){var i=Math.sin(e),r=Math.cos(e);t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(s,-e.transform.angle),function(t,e,i){var r=e[0],n=e[1],o=e[2];t[0]=r*i[0]+n*i[3]+o*i[6],t[1]=r*i[1]+n*i[4]+o*i[7],t[2]=r*i[2]+n*i[5]+o*i[8]}(a,a,s);var u=n.properties.get("color");return{u_matrix:t,u_lightpos:a,u_lightintensity:n.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+i,u_opacity:r}},xf=function(t,e,i,r,n,o,a){return m(vf(t,e,i,r),gf(o,e,a),{u_height_factor:-Math.pow(2,n.overscaledZ)/a.tileSize/8})},bf=function(t){return{u_matrix:t}},wf=function(t,e,i,r){return m(bf(t),gf(i,e,r))},If=function(t,e){return{u_matrix:t,u_world:e}},Sf=function(t,e,i,r,n){return m(wf(t,e,i,r),{u_world:n})},Tf=function(t,e,i,r){var n,o,a=t.transform;if("map"===r.paint.get("circle-pitch-alignment")){var s=uh(i,1,a.zoom);n=!0,o=[s,s]}else n=!1,o=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,i,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_pitch_with_map:+n,u_device_pixel_ratio:U.devicePixelRatio,u_extrude_scale:o}},Af=function(t,e,i){var r=uh(i,1,e.zoom),n=Math.pow(2,e.zoom-i.tileID.overscaledZ),o=i.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:r,u_extrude_scale:[e.pixelsToGLUnits[0]/(r*n),e.pixelsToGLUnits[1]/(r*n)],u_overscale_factor:o}},zf=function(t,e,i){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:i.cameraToCenterDistance,u_viewport_size:[i.width,i.height]}},Ef=function(t,e,i){return void 0===i&&(i=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}},kf=function(t){return{u_matrix:t}},Cf=function(t,e,i,r){return{u_matrix:t,u_extrude_scale:uh(e,1,i),u_intensity:r}},Pf=function(t,e,i){var r=t.transform;return{u_matrix:Rf(t,e,i),u_ratio:1/uh(e,1,r.zoom),u_device_pixel_ratio:U.devicePixelRatio,u_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},Df=function(t,e,i,r){return m(Pf(t,e,i),{u_image:0,u_image_height:r})},Mf=function(t,e,i,r){var n=t.transform,o=Bf(e,n);return{u_matrix:Rf(t,e,i),u_texsize:e.imageAtlasTexture.size,u_ratio:1/uh(e,1,n.zoom),u_device_pixel_ratio:U.devicePixelRatio,u_image:0,u_scale:[o,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},Lf=function(t,e,i,r,n){var o=t.lineAtlas,a=Bf(e,t.transform),s="round"===i.layout.get("line-cap"),u=o.getDash(r.from,s),l=o.getDash(r.to,s),c=u.width*n.fromScale,p=l.width*n.toScale;return m(Pf(t,e,i),{u_patternscale_a:[a/c,-u.height/2],u_patternscale_b:[a/p,-l.height/2],u_sdfgamma:o.width/(256*Math.min(c,p)*U.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:l.y,u_mix:n.t})};function Bf(t,e){return 1/uh(t,1,e.tileZoom)}function Rf(t,e,i){return t.translatePosMatrix(e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}var Ff=function(t,e,i,r,n){return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:(a=n.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=n.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Of(n.paint.get("raster-hue-rotate"))};var o,a};function Of(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}var Vf,Uf=function(t,e,i,r,n,o,a,s,u,l){var c=n.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:c.width/c.height,u_fade_change:n.options.fadeDuration?n.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+r,u_texsize:l,u_texture:0}},jf=function(t,e,i,r,n,o,a,s,u,l,c){var p=n.transform;return m(Uf(t,e,i,r,n,o,a,s,u,l),{u_gamma_scale:r?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:U.devicePixelRatio,u_is_halo:+c})},Nf=function(t,e,i,r,n,o,a,s,u,l){return m(jf(t,e,i,r,n,o,a,s,!0,u,!0),{u_texsize_icon:l,u_texture_icon:1})},qf=function(t,e,i){return{u_matrix:t,u_opacity:e,u_color:i}},Zf=function(t,e,i,r,n,o){return m(function(t,e,i,r){var n=i.imageManager.getPattern(t.from.toString()),o=i.imageManager.getPattern(t.to.toString()),a=i.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,r.tileID.overscaledZ),c=r.tileSize*Math.pow(2,i.transform.tileZoom)/l,p=c*(r.tileID.canonical.x+r.tileID.wrap*l),h=c*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:n.tl,u_pattern_br_a:n.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/uh(r,1,i.transform.tileZoom),u_pixel_coord_upper:[p>>16,h>>16],u_pixel_coord_lower:[65535&p,65535&h]}}(r,o,i,n),{u_matrix:t,u_opacity:e})},Gf={fillExtrusion:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_lightpos:new Go(t,e.u_lightpos),u_lightintensity:new qo(t,e.u_lightintensity),u_lightcolor:new Go(t,e.u_lightcolor),u_vertical_gradient:new qo(t,e.u_vertical_gradient),u_opacity:new qo(t,e.u_opacity)}},fillExtrusionPattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_lightpos:new Go(t,e.u_lightpos),u_lightintensity:new qo(t,e.u_lightintensity),u_lightcolor:new Go(t,e.u_lightcolor),u_vertical_gradient:new qo(t,e.u_vertical_gradient),u_height_factor:new qo(t,e.u_height_factor),u_image:new No(t,e.u_image),u_texsize:new Zo(t,e.u_texsize),u_pixel_coord_upper:new Zo(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Zo(t,e.u_pixel_coord_lower),u_scale:new Go(t,e.u_scale),u_fade:new qo(t,e.u_fade),u_opacity:new qo(t,e.u_opacity)}},fill:function(t,e){return{u_matrix:new Ko(t,e.u_matrix)}},fillPattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_image:new No(t,e.u_image),u_texsize:new Zo(t,e.u_texsize),u_pixel_coord_upper:new Zo(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Zo(t,e.u_pixel_coord_lower),u_scale:new Go(t,e.u_scale),u_fade:new qo(t,e.u_fade)}},fillOutline:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_world:new Zo(t,e.u_world)}},fillOutlinePattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_world:new Zo(t,e.u_world),u_image:new No(t,e.u_image),u_texsize:new Zo(t,e.u_texsize),u_pixel_coord_upper:new Zo(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Zo(t,e.u_pixel_coord_lower),u_scale:new Go(t,e.u_scale),u_fade:new qo(t,e.u_fade)}},circle:function(t,e){return{u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_scale_with_map:new No(t,e.u_scale_with_map),u_pitch_with_map:new No(t,e.u_pitch_with_map),u_extrude_scale:new Zo(t,e.u_extrude_scale),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_matrix:new Ko(t,e.u_matrix)}},collisionBox:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_pixels_to_tile_units:new qo(t,e.u_pixels_to_tile_units),u_extrude_scale:new Zo(t,e.u_extrude_scale),u_overscale_factor:new qo(t,e.u_overscale_factor)}},collisionCircle:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_inv_matrix:new Ko(t,e.u_inv_matrix),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_viewport_size:new Zo(t,e.u_viewport_size)}},debug:function(t,e){return{u_color:new Wo(t,e.u_color),u_matrix:new Ko(t,e.u_matrix),u_overlay:new No(t,e.u_overlay),u_overlay_scale:new qo(t,e.u_overlay_scale)}},clippingMask:function(t,e){return{u_matrix:new Ko(t,e.u_matrix)}},heatmap:function(t,e){return{u_extrude_scale:new qo(t,e.u_extrude_scale),u_intensity:new qo(t,e.u_intensity),u_matrix:new Ko(t,e.u_matrix)}},heatmapTexture:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_world:new Zo(t,e.u_world),u_image:new No(t,e.u_image),u_color_ramp:new No(t,e.u_color_ramp),u_opacity:new qo(t,e.u_opacity)}},hillshade:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_image:new No(t,e.u_image),u_latrange:new Zo(t,e.u_latrange),u_light:new Zo(t,e.u_light),u_shadow:new Wo(t,e.u_shadow),u_highlight:new Wo(t,e.u_highlight),u_accent:new Wo(t,e.u_accent)}},hillshadePrepare:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_image:new No(t,e.u_image),u_dimension:new Zo(t,e.u_dimension),u_zoom:new qo(t,e.u_zoom),u_unpack:new Xo(t,e.u_unpack)}},line:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_ratio:new qo(t,e.u_ratio),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_units_to_pixels:new Zo(t,e.u_units_to_pixels)}},lineGradient:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_ratio:new qo(t,e.u_ratio),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_units_to_pixels:new Zo(t,e.u_units_to_pixels),u_image:new No(t,e.u_image),u_image_height:new qo(t,e.u_image_height)}},linePattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_texsize:new Zo(t,e.u_texsize),u_ratio:new qo(t,e.u_ratio),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_image:new No(t,e.u_image),u_units_to_pixels:new Zo(t,e.u_units_to_pixels),u_scale:new Go(t,e.u_scale),u_fade:new qo(t,e.u_fade)}},lineSDF:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_ratio:new qo(t,e.u_ratio),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_units_to_pixels:new Zo(t,e.u_units_to_pixels),u_patternscale_a:new Zo(t,e.u_patternscale_a),u_patternscale_b:new Zo(t,e.u_patternscale_b),u_sdfgamma:new qo(t,e.u_sdfgamma),u_image:new No(t,e.u_image),u_tex_y_a:new qo(t,e.u_tex_y_a),u_tex_y_b:new qo(t,e.u_tex_y_b),u_mix:new qo(t,e.u_mix)}},raster:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_tl_parent:new Zo(t,e.u_tl_parent),u_scale_parent:new qo(t,e.u_scale_parent),u_buffer_scale:new qo(t,e.u_buffer_scale),u_fade_t:new qo(t,e.u_fade_t),u_opacity:new qo(t,e.u_opacity),u_image0:new No(t,e.u_image0),u_image1:new No(t,e.u_image1),u_brightness_low:new qo(t,e.u_brightness_low),u_brightness_high:new qo(t,e.u_brightness_high),u_saturation_factor:new qo(t,e.u_saturation_factor),u_contrast_factor:new qo(t,e.u_contrast_factor),u_spin_weights:new Go(t,e.u_spin_weights)}},symbolIcon:function(t,e){return{u_is_size_zoom_constant:new No(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new No(t,e.u_is_size_feature_constant),u_size_t:new qo(t,e.u_size_t),u_size:new qo(t,e.u_size),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_pitch:new qo(t,e.u_pitch),u_rotate_symbol:new No(t,e.u_rotate_symbol),u_aspect_ratio:new qo(t,e.u_aspect_ratio),u_fade_change:new qo(t,e.u_fade_change),u_matrix:new Ko(t,e.u_matrix),u_label_plane_matrix:new Ko(t,e.u_label_plane_matrix),u_coord_matrix:new Ko(t,e.u_coord_matrix),u_is_text:new No(t,e.u_is_text),u_pitch_with_map:new No(t,e.u_pitch_with_map),u_texsize:new Zo(t,e.u_texsize),u_texture:new No(t,e.u_texture)}},symbolSDF:function(t,e){return{u_is_size_zoom_constant:new No(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new No(t,e.u_is_size_feature_constant),u_size_t:new qo(t,e.u_size_t),u_size:new qo(t,e.u_size),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_pitch:new qo(t,e.u_pitch),u_rotate_symbol:new No(t,e.u_rotate_symbol),u_aspect_ratio:new qo(t,e.u_aspect_ratio),u_fade_change:new qo(t,e.u_fade_change),u_matrix:new Ko(t,e.u_matrix),u_label_plane_matrix:new Ko(t,e.u_label_plane_matrix),u_coord_matrix:new Ko(t,e.u_coord_matrix),u_is_text:new No(t,e.u_is_text),u_pitch_with_map:new No(t,e.u_pitch_with_map),u_texsize:new Zo(t,e.u_texsize),u_texture:new No(t,e.u_texture),u_gamma_scale:new qo(t,e.u_gamma_scale),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_is_halo:new No(t,e.u_is_halo)}},symbolTextAndIcon:function(t,e){return{u_is_size_zoom_constant:new No(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new No(t,e.u_is_size_feature_constant),u_size_t:new qo(t,e.u_size_t),u_size:new qo(t,e.u_size),u_camera_to_center_distance:new qo(t,e.u_camera_to_center_distance),u_pitch:new qo(t,e.u_pitch),u_rotate_symbol:new No(t,e.u_rotate_symbol),u_aspect_ratio:new qo(t,e.u_aspect_ratio),u_fade_change:new qo(t,e.u_fade_change),u_matrix:new Ko(t,e.u_matrix),u_label_plane_matrix:new Ko(t,e.u_label_plane_matrix),u_coord_matrix:new Ko(t,e.u_coord_matrix),u_is_text:new No(t,e.u_is_text),u_pitch_with_map:new No(t,e.u_pitch_with_map),u_texsize:new Zo(t,e.u_texsize),u_texsize_icon:new Zo(t,e.u_texsize_icon),u_texture:new No(t,e.u_texture),u_texture_icon:new No(t,e.u_texture_icon),u_gamma_scale:new qo(t,e.u_gamma_scale),u_device_pixel_ratio:new qo(t,e.u_device_pixel_ratio),u_is_halo:new No(t,e.u_is_halo)}},background:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_opacity:new qo(t,e.u_opacity),u_color:new Wo(t,e.u_color)}},backgroundPattern:function(t,e){return{u_matrix:new Ko(t,e.u_matrix),u_opacity:new qo(t,e.u_opacity),u_image:new No(t,e.u_image),u_pattern_tl_a:new Zo(t,e.u_pattern_tl_a),u_pattern_br_a:new Zo(t,e.u_pattern_br_a),u_pattern_tl_b:new Zo(t,e.u_pattern_tl_b),u_pattern_br_b:new Zo(t,e.u_pattern_br_b),u_texsize:new Zo(t,e.u_texsize),u_mix:new qo(t,e.u_mix),u_pattern_size_a:new Zo(t,e.u_pattern_size_a),u_pattern_size_b:new Zo(t,e.u_pattern_size_b),u_scale_a:new qo(t,e.u_scale_a),u_scale_b:new qo(t,e.u_scale_b),u_pixel_coord_upper:new Zo(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new Zo(t,e.u_pixel_coord_lower),u_tile_units_to_pixels:new qo(t,e.u_tile_units_to_pixels)}}};function Xf(t,e,i,r,n,o,a){for(var s=t.context,u=s.gl,l=t.useProgram("collisionBox"),c=[],p=0,h=0,f=0;f<r.length;f++){var d=r[f],m=e.getTile(d),y=m.getBucket(i);if(y){var _=d.posMatrix;0===n[0]&&0===n[1]||(_=t.translatePosMatrix(d.posMatrix,m,n,o));var g=a?y.textCollisionBox:y.iconCollisionBox,v=y.collisionCircleArray;if(v.length>0){var x=ka(),b=_;Fa(x,y.placementInvProjMatrix,t.transform.glCoordMatrix),Fa(x,x,y.placementViewportMatrix),c.push({circleArray:v,circleOffset:h,transform:b,invTransform:x}),h=p+=v.length/4}g&&l.draw(s,u.LINES,xp.disabled,bp.disabled,t.colorModeForRenderPass(),Ip.disabled,Af(_,t.transform,m),i.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,null,t.transform.zoom,null,null,g.collisionVertexBuffer)}}if(a&&c.length){var w=t.useProgram("collisionCircle"),I=new so;I.resize(4*p),I._trim();for(var S=0,T=0,A=c;T<A.length;T+=1)for(var z=A[T],E=0;E<z.circleArray.length/4;E++){var k=4*E,C=z.circleArray[k+0],P=z.circleArray[k+1],D=z.circleArray[k+2],M=z.circleArray[k+3];I.emplace(S++,C,P,D,M,0),I.emplace(S++,C,P,D,M,1),I.emplace(S++,C,P,D,M,2),I.emplace(S++,C,P,D,M,3)}(!Vf||Vf.length<2*p)&&(Vf=function(t){var e=2*t,i=new lo;i.resize(e),i._trim();for(var r=0;r<e;r++){var n=6*r;i.uint16[n+0]=4*r+0,i.uint16[n+1]=4*r+1,i.uint16[n+2]=4*r+2,i.uint16[n+3]=4*r+2,i.uint16[n+4]=4*r+3,i.uint16[n+5]=4*r+0}return i}(p));for(var L=s.createIndexBuffer(Vf,!0),B=s.createVertexBuffer(I,wu.members,!0),R=0,F=c;R<F.length;R+=1){var O=F[R],V=zf(O.transform,O.invTransform,t.transform);w.draw(s,u.TRIANGLES,xp.disabled,bp.disabled,t.colorModeForRenderPass(),Ip.disabled,V,i.id,B,L,Co.simpleSegment(0,2*O.circleOffset,O.circleArray.length,O.circleArray.length/2),null,t.transform.zoom,null,null,null)}B.destroy(),L.destroy()}}var Wf=Ca(new Float32Array(16));function Hf(t,e,i,r,o,a){var s=il(t),u=-(s.horizontalAlign-.5)*e,l=-(s.verticalAlign-.5)*i,c=ul(t,r);return new n((u/o+c[0])*a,(l/o+c[1])*a)}function Kf(t,e,i,r,o,a,s,u,l,c,p){var h=t.text.placedSymbolArray,f=t.text.dynamicLayoutVertexArray,d=t.icon.dynamicLayoutVertexArray,m={};f.clear();for(var y=0;y<h.length;y++){var _=h.get(y),g=_.hidden||!_.crossTileID||t.allowVerticalPlacement&&!_.placedOrientation?null:r[_.crossTileID];if(g){var v=new n(_.anchorX,_.anchorY),x=Kp(v,i?u:s),b=Yp(a.cameraToCenterDistance,x.signedDistanceFromCamera),w=o.evaluateSizeForFeature(t.textSizeData,c,_)*b/24;i&&(w*=t.tilePixelRatio/l);for(var I=Hf(g.anchor,g.width,g.height,g.textOffset,g.textBoxScale,w),S=i?Kp(v.add(I),s).point:x.point.add(e?I.rotate(-a.angle):I),T=t.allowVerticalPlacement&&_.placedOrientation===Qu.vertical?Math.PI/2:0,A=0;A<_.numGlyphs;A++)hl(f,S,T);p&&_.associatedIconIndex>=0&&(m[_.associatedIconIndex]={shiftedAnchor:S,angle:T})}else oh(_.numGlyphs,f)}if(p){d.clear();for(var z=t.icon.placedSymbolArray,E=0;E<z.length;E++){var k=z.get(E);if(k.hidden)oh(k.numGlyphs,d);else{var C=m[E];if(C)for(var P=0;P<k.numGlyphs;P++)hl(d,C.shiftedAnchor,C.angle);else oh(k.numGlyphs,d)}}t.icon.dynamicLayoutVertexBuffer.updateData(d)}t.text.dynamicLayoutVertexBuffer.updateData(f)}function Yf(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Jf(t,e,i,r,n,o,a,s,u,l,c,p){for(var h=t.context,f=h.gl,d=t.transform,m="map"===s,y="map"===u,_=m&&"point"!==i.layout.get("symbol-placement"),g=m&&!y&&!_,v=void 0!==i.layout.get("symbol-sort-key").constantOr(1),x=!1,b=t.depthModeForSublayer(0,xp.ReadOnly),w=i.layout.get("text-variable-anchor"),I=[],S=0,T=r;S<T.length;S+=1){var A=T[S],z=e.getTile(A),E=z.getBucket(i);if(E){var k=n?E.text:E.icon;if(k&&k.segments.get().length){var C=k.programConfigurations.get(i.id),P=n||E.sdfIcons,D=n?E.textSizeData:E.iconSizeData,M=y||0!==d.pitch,L=t.useProgram(Yf(P,n,E),C),B=ol(D,d.zoom),R=void 0,F=[0,0],O=void 0,V=void 0,U=null,j=void 0;if(n)O=z.glyphAtlasTexture,V=f.LINEAR,R=z.glyphAtlasTexture.size,E.iconsInText&&(F=z.imageAtlasTexture.size,U=z.imageAtlasTexture,j=M||t.options.rotating||t.options.zooming||"composite"===D.kind||"camera"===D.kind?f.LINEAR:f.NEAREST);else{var N=1!==i.layout.get("icon-size").constantOr(0)||E.iconsNeedLinear;O=z.imageAtlasTexture,V=P||t.options.rotating||t.options.zooming||N||M?f.LINEAR:f.NEAREST,R=z.imageAtlasTexture.size}var q=uh(z,1,t.transform.zoom),Z=Wp(A.posMatrix,y,m,t.transform,q),G=Hp(A.posMatrix,y,m,t.transform,q),X=w&&E.hasTextData(),W="none"!==i.layout.get("icon-text-fit")&&X&&E.hasIconData();_&&Qp(E,A.posMatrix,t,n,Z,G,y,l);var H=t.translatePosMatrix(A.posMatrix,z,o,a),K=_||n&&w||W?Wf:Z,Y=t.translatePosMatrix(G,z,o,a,!0),J=P&&0!==i.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1),Q={program:L,buffers:k,uniformValues:P?E.iconsInText?Nf(D.kind,B,g,y,t,H,K,Y,R,F):jf(D.kind,B,g,y,t,H,K,Y,n,R,!0):Uf(D.kind,B,g,y,t,H,K,Y,n,R),atlasTexture:O,atlasTextureIcon:U,atlasInterpolation:V,atlasInterpolationIcon:j,isSDF:P,hasHalo:J};if(v&&E.canOverlap){x=!0;for(var $=0,tt=k.segments.get();$<tt.length;$+=1){var et=tt[$];I.push({segments:new Co([et]),sortKey:et.sortKey,state:Q})}}else I.push({segments:k.segments,sortKey:0,state:Q})}}}x&&I.sort((function(t,e){return t.sortKey-e.sortKey}));for(var it=0,rt=I;it<rt.length;it+=1){var nt=rt[it],ot=nt.state;if(h.activeTexture.set(f.TEXTURE0),ot.atlasTexture.bind(ot.atlasInterpolation,f.CLAMP_TO_EDGE),ot.atlasTextureIcon&&(h.activeTexture.set(f.TEXTURE1),ot.atlasTextureIcon&&ot.atlasTextureIcon.bind(ot.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),ot.isSDF){var at=ot.uniformValues;ot.hasHalo&&(at.u_is_halo=1,Qf(ot.buffers,nt.segments,i,t,ot.program,b,c,p,at)),at.u_is_halo=0}Qf(ot.buffers,nt.segments,i,t,ot.program,b,c,p,ot.uniformValues)}}function Qf(t,e,i,r,n,o,a,s,u){var l=r.context;n.draw(l,l.gl.TRIANGLES,o,a,s,Ip.disabled,u,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function $f(t,e,i,r,n,o,a){var s,u,l,c,p,h=t.context.gl,f=i.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=i.getCrossfadeParameters();a?(u=d&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(u=d?"fillPattern":"fill",s=h.TRIANGLES);for(var y=0,_=r;y<_.length;y+=1){var g=_[y],v=e.getTile(g);if(!d||v.patternsLoaded()){var x=v.getBucket(i);if(x){var b=x.programConfigurations.get(i.id),w=t.useProgram(u,b);d&&(t.context.activeTexture.set(h.TEXTURE0),v.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),b.updatePaintBuffers(m));var I=f.constantOr(null);if(I&&v.imageAtlas){var S=v.imageAtlas,T=S.patternPositions[I.to.toString()],A=S.patternPositions[I.from.toString()];T&&A&&b.setConstantPatternPositions(T,A)}var z=t.translatePosMatrix(g.posMatrix,v,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(a){c=x.indexBuffer2,p=x.segments2;var E=[h.drawingBufferWidth,h.drawingBufferHeight];l="fillOutlinePattern"===u&&d?Sf(z,t,m,v,E):If(z,E)}else c=x.indexBuffer,p=x.segments,l=d?wf(z,t,m,v):bf(z);w.draw(t.context,s,n,t.stencilModeForClipping(g),o,Ip.disabled,l,i.id,x.layoutVertexBuffer,c,p,i.paint,t.transform.zoom,b)}}}}function td(t,e,i,r,n,o,a){for(var s=t.context,u=s.gl,l=i.paint.get("fill-extrusion-pattern"),c=l.constantOr(1),p=i.getCrossfadeParameters(),h=i.paint.get("fill-extrusion-opacity"),f=0,d=r;f<d.length;f+=1){var m=d[f],y=e.getTile(m),_=y.getBucket(i);if(_){var g=_.programConfigurations.get(i.id),v=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",g);c&&(t.context.activeTexture.set(u.TEXTURE0),y.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),g.updatePaintBuffers(p));var x=l.constantOr(null);if(x&&y.imageAtlas){var b=y.imageAtlas,w=b.patternPositions[x.to.toString()],I=b.patternPositions[x.from.toString()];w&&I&&g.setConstantPatternPositions(w,I)}var S=t.translatePosMatrix(m.posMatrix,y,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),T=i.paint.get("fill-extrusion-vertical-gradient"),A=c?xf(S,t,T,h,m,p,y):vf(S,t,T,h);v.draw(s,s.gl.TRIANGLES,n,o,a,Ip.backCCW,A,i.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,i.paint,t.transform.zoom,g)}}}function ed(t,e,i,r,n,o){var a=t.context,s=a.gl,u=e.fbo;if(u){var l=t.useProgram("hillshade");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u.colorAttachment.get());var c=function(t,e,i){var r=i.paint.get("hillshade-shadow-color"),n=i.paint.get("hillshade-highlight-color"),o=i.paint.get("hillshade-accent-color"),a=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(a-=t.transform.angle);var s,u,l,c=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),c),u_image:0,u_latrange:(s=e.tileID,u=Math.pow(2,s.canonical.z),l=s.canonical.y,[new oc(0,l/u).toLngLat().lat,new oc(0,(l+1)/u).toLngLat().lat]),u_light:[i.paint.get("hillshade-exaggeration"),a],u_shadow:r,u_highlight:n,u_accent:o}}(t,e,i);l.draw(a,s.TRIANGLES,r,n,o,Ip.disabled,c,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function id(t,e,i,r,n,o){var a=t.context,s=a.gl,u=e.dem;if(u&&u.data){var l=u.dim,c=u.stride,p=u.getPixels();if(a.activeTexture.set(s.TEXTURE1),a.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||t.getTileTexture(c),e.demTexture){var h=e.demTexture;h.update(p,{premultiply:!1}),h.bind(s.NEAREST,s.CLAMP_TO_EDGE)}else e.demTexture=new Ml(a,p,s.RGBA,{premultiply:!1}),e.demTexture.bind(s.NEAREST,s.CLAMP_TO_EDGE);a.activeTexture.set(s.TEXTURE0);var f=e.fbo;if(!f){var d=new Ml(a,{width:l,height:l,data:null},s.RGBA);d.bind(s.LINEAR,s.CLAMP_TO_EDGE),(f=e.fbo=a.createFramebuffer(l,l,!0)).colorAttachment.set(d.texture)}a.bindFramebuffer.set(f.framebuffer),a.viewport.set([0,0,l,l]),t.useProgram("hillshadePrepare").draw(a,s.TRIANGLES,r,n,o,Ip.disabled,function(t,e){var i=e.stride,r=ka();return Ra(r,0,8192,-8192,0,0,1),Ma(r,r,[0,-8192,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_unpack:e.getUnpackVector()}}(e.tileID,u),i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function rd(t,e,i,r,n){var o=r.paint.get("raster-fade-duration");if(o>0){var a=U.now(),s=(a-t.timeAdded)/o,u=e?(a-e.timeAdded)/o:-1,l=i.getSource(),c=n.coveringZoomLevel({tileSize:l.tileSize,roundZoom:l.roundZoom}),h=!e||Math.abs(e.tileID.overscaledZ-c)>Math.abs(t.tileID.overscaledZ-c),f=h&&t.refreshedUponExpiration?1:p(h?s:1-u,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),e?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var nd=new me(1,0,0,1),od=new me(0,1,0,1),ad=new me(0,0,1,1),sd=new me(1,0,1,1),ud=new me(0,1,1,1);function ld(t,e,i,r){pd(t,0,e+i/2,t.transform.width,i,r)}function cd(t,e,i,r){pd(t,e-i/2,0,i,t.transform.height,r)}function pd(t,e,i,r,n,o){var a=t.context,s=a.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*U.devicePixelRatio,i*U.devicePixelRatio,r*U.devicePixelRatio,n*U.devicePixelRatio),a.clear({color:o}),s.disable(s.SCISSOR_TEST)}function hd(t,e,i){var r=t.context,n=r.gl,o=i.posMatrix,a=t.useProgram("debug"),s=xp.disabled,u=bp.disabled,l=t.colorModeForRenderPass();r.activeTexture.set(n.TEXTURE0),t.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE),a.draw(r,n.LINE_STRIP,s,u,l,Ip.disabled,Ef(o,me.red),"$debug",t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);var c=e.getTileByID(i.key).latestRawTileData,p=Math.floor((c&&c.byteLength||0)/1024),h=e.getTile(i).tileSize,f=512/Math.min(h,512)*(i.overscaledZ/t.transform.zoom)*.5,d=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(d+=" => "+i.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var i=t.debugOverlayCanvas,r=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,i.width,i.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,d+" "+p+"kb"),a.draw(r,n.TRIANGLES,s,u,wp.alphaBlended,Ip.disabled,Ef(o,me.transparent,f),"$debug",t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}var fd={symbol:function(t,e,i,r,n){if("translucent"===t.renderPass){var o=bp.disabled,a=t.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(t,e,i,r,n,o,a){for(var s=e.transform,u="map"===n,l="map"===o,c=0,p=t;c<p.length;c+=1){var h=p[c],f=r.getTile(h),d=f.getBucket(i);if(d&&d.text&&d.text.segments.get().length){var m=ol(d.textSizeData,s.zoom),y=uh(f,1,e.transform.zoom),_=Wp(h.posMatrix,l,u,e.transform,y),g="none"!==i.layout.get("icon-text-fit")&&d.hasIconData();if(m){var v=Math.pow(2,s.zoom-f.tileID.overscaledZ);Kf(d,u,l,a,al,s,_,h.posMatrix,v,m,g)}}}}(r,t,i,e,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),n),0!==i.paint.get("icon-opacity").constantOr(1)&&Jf(t,e,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),o,a),0!==i.paint.get("text-opacity").constantOr(1)&&Jf(t,e,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),o,a),e.map.showCollisionBoxes&&(Xf(t,e,i,r,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),Xf(t,e,i,r,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))}},circle:function(t,e,i,r){if("translucent"===t.renderPass){var n=i.paint.get("circle-opacity"),o=i.paint.get("circle-stroke-width"),a=i.paint.get("circle-stroke-opacity"),s=void 0!==i.layout.get("circle-sort-key").constantOr(1);if(0!==n.constantOr(1)||0!==o.constantOr(1)&&0!==a.constantOr(1)){for(var u=t.context,l=u.gl,c=t.depthModeForSublayer(0,xp.ReadOnly),p=bp.disabled,h=t.colorModeForRenderPass(),f=[],d=0;d<r.length;d++){var m=r[d],y=e.getTile(m),_=y.getBucket(i);if(_){var g=_.programConfigurations.get(i.id),v={programConfiguration:g,program:t.useProgram("circle",g),layoutVertexBuffer:_.layoutVertexBuffer,indexBuffer:_.indexBuffer,uniformValues:Tf(t,m,y,i)};if(s)for(var x=0,b=_.segments.get();x<b.length;x+=1){var w=b[x];f.push({segments:new Co([w]),sortKey:w.sortKey,state:v})}else f.push({segments:_.segments,sortKey:0,state:v})}}s&&f.sort((function(t,e){return t.sortKey-e.sortKey}));for(var I=0,S=f;I<S.length;I+=1){var T=S[I],A=T.state;A.program.draw(u,l.TRIANGLES,c,p,h,Ip.disabled,A.uniformValues,i.id,A.layoutVertexBuffer,A.indexBuffer,T.segments,i.paint,t.transform.zoom,A.programConfiguration)}}}},heatmap:function(t,e,i,r){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var n=t.context,o=n.gl,a=bp.disabled,s=new wp([o.ONE,o.ONE],me.transparent,[!0,!0,!0,!0]);!function(t,e,i){var r=t.gl;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var n=i.heatmapFbo;if(n)r.bindTexture(r.TEXTURE_2D,n.colorAttachment.get()),t.bindFramebuffer.set(n.framebuffer);else{var o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o),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),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),n=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,i,r){var n=t.gl;n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e.width/4,e.height/4,0,n.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:n.UNSIGNED_BYTE,null),r.colorAttachment.set(i)}(t,e,o,n)}}(n,t,i),n.clear({color:me.transparent});for(var u=0;u<r.length;u++){var l=r[u];if(!e.hasRenderableParent(l)){var c=e.getTile(l),p=c.getBucket(i);if(p){var h=p.programConfigurations.get(i.id);t.useProgram("heatmap",h).draw(n,o.TRIANGLES,xp.disabled,a,s,Ip.disabled,Cf(l.posMatrix,c,t.transform.zoom,i.paint.get("heatmap-intensity")),i.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,i.paint,t.transform.zoom,h)}}}n.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,e){var i=t.context,r=i.gl,n=e.heatmapFbo;if(n){i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1);var o=e.colorRampTexture;o||(o=e.colorRampTexture=new Ml(i,e.colorRamp,r.RGBA)),o.bind(r.LINEAR,r.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(i,r.TRIANGLES,xp.disabled,bp.disabled,t.colorModeForRenderPass(),Ip.disabled,function(t,e,i,r){var n=ka();Ra(n,0,t.width,t.height,0,0,1);var o=t.context.gl;return{u_matrix:n,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:e.paint.get("heatmap-opacity")}}(t,e),e.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,e.paint,t.transform.zoom)}}(t,i))},line:function(t,e,i,r){if("translucent"===t.renderPass){var n=i.paint.get("line-opacity"),o=i.paint.get("line-width");if(0!==n.constantOr(1)&&0!==o.constantOr(1))for(var a,s=t.depthModeForSublayer(0,xp.ReadOnly),u=t.colorModeForRenderPass(),l=i.paint.get("line-dasharray"),c=i.paint.get("line-pattern"),h=c.constantOr(1),f=i.paint.get("line-gradient"),d=i.getCrossfadeParameters(),m=h?"linePattern":l?"lineSDF":f?"lineGradient":"line",y=t.context,_=y.gl,g=!0,v=0,x=r;v<x.length;v+=1){var b=x[v],w=e.getTile(b);if(!h||w.patternsLoaded()){var I=w.getBucket(i);if(I){var S=I.programConfigurations.get(i.id),T=t.context.program.get(),A=t.useProgram(m,S),z=g||A.program!==T,E=c.constantOr(null);if(E&&w.imageAtlas){var k=w.imageAtlas,C=k.patternPositions[E.to.toString()],P=k.patternPositions[E.from.toString()];C&&P&&S.setConstantPatternPositions(C,P)}var D=h?Mf(t,w,i,d):l?Lf(t,w,i,l,d):f?Df(t,w,i,I.lineClipsArray.length):Pf(t,w,i);if(h)y.activeTexture.set(_.TEXTURE0),w.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),S.updatePaintBuffers(d);else if(l&&(z||t.lineAtlas.dirty))y.activeTexture.set(_.TEXTURE0),t.lineAtlas.bind(y);else if(f){var M=I.gradients[i.id],L=M.texture;if(i.gradientVersion!==M.version){var B=256;if(i.stepInterpolant){var R=e.getSource().maxzoom,F=b.canonical.z===R?Math.ceil(1<<t.transform.maxZoom-b.canonical.z):1;B=p((a=I.maxLineLength/8192*1024*F)<=1?1:Math.pow(2,Math.ceil(Math.log(a)/Math.LN2)),256,y.maxTextureSize)}M.gradient=Qa({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:B,image:M.gradient||void 0,clips:I.lineClipsArray}),M.texture?M.texture.update(M.gradient):M.texture=new Ml(y,M.gradient,_.RGBA),M.version=i.gradientVersion,L=M.texture}y.activeTexture.set(_.TEXTURE0),L.bind(i.stepInterpolant?_.NEAREST:_.LINEAR,_.CLAMP_TO_EDGE)}A.draw(y,_.TRIANGLES,s,t.stencilModeForClipping(b),u,Ip.disabled,D,i.id,I.layoutVertexBuffer,I.indexBuffer,I.segments,i.paint,t.transform.zoom,S,I.layoutVertexBuffer2),g=!1}}}}},fill:function(t,e,i,r){var n=i.paint.get("fill-color"),o=i.paint.get("fill-opacity");if(0!==o.constantOr(1)){var a=t.colorModeForRenderPass(),s=i.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!s.constantOr(1)&&1===n.constantOr(me.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===u){var l=t.depthModeForSublayer(1,"opaque"===t.renderPass?xp.ReadWrite:xp.ReadOnly);$f(t,e,i,r,l,a,!1)}if("translucent"===t.renderPass&&i.paint.get("fill-antialias")){var c=t.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,xp.ReadOnly);$f(t,e,i,r,c,a,!0)}}},"fill-extrusion":function(t,e,i,r){var n=i.paint.get("fill-extrusion-opacity");if(0!==n&&"translucent"===t.renderPass){var o=new xp(t.context.gl.LEQUAL,xp.ReadWrite,t.depthRangeFor3D);if(1!==n||i.paint.get("fill-extrusion-pattern").constantOr(1))td(t,e,i,r,o,bp.disabled,wp.disabled),td(t,e,i,r,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();td(t,e,i,r,o,bp.disabled,a)}}},hillshade:function(t,e,i,r){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var n=t.context,o=t.depthModeForSublayer(0,xp.ReadOnly),a=t.colorModeForRenderPass(),s="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r],u=s[0],l=0,c=s[1];l<c.length;l+=1){var p=c[l],h=e.getTile(p);h.needsHillshadePrepare&&"offscreen"===t.renderPass?id(t,h,i,o,bp.disabled,a):"translucent"===t.renderPass&&ed(t,h,i,o,u[p.overscaledZ],a)}n.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,i,r){if("translucent"===t.renderPass&&0!==i.paint.get("raster-opacity")&&r.length)for(var n=t.context,o=n.gl,a=e.getSource(),s=t.useProgram("raster"),u=t.colorModeForRenderPass(),l=a instanceof gc?[{},r]:t.stencilConfigForOverlap(r),c=l[0],p=l[1],h=p[p.length-1].overscaledZ,f=!t.options.moving,d=0,m=p;d<m.length;d+=1){var y=m[d],_=t.depthModeForSublayer(y.overscaledZ-h,1===i.paint.get("raster-opacity")?xp.ReadWrite:xp.ReadOnly,o.LESS),g=e.getTile(y),v=t.transform.calculatePosMatrix(y.toUnwrapped(),f);g.registerFadeDuration(i.paint.get("raster-fade-duration"));var x=e.findLoadedParent(y,0),b=rd(g,x,e,i,t.transform),w=void 0,I=void 0,S="nearest"===i.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;n.activeTexture.set(o.TEXTURE0),g.texture.bind(S,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),n.activeTexture.set(o.TEXTURE1),x?(x.texture.bind(S,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,x.tileID.overscaledZ-g.tileID.overscaledZ),I=[g.tileID.canonical.x*w%1,g.tileID.canonical.y*w%1]):g.texture.bind(S,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var T=Ff(v,I||[0,0],w||1,b,i);a instanceof gc?s.draw(n,o.TRIANGLES,_,bp.disabled,u,Ip.disabled,T,i.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(n,o.TRIANGLES,_,c[y.overscaledZ],u,Ip.disabled,T,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,i){var r=i.paint.get("background-color"),n=i.paint.get("background-opacity");if(0!==n){var o=t.context,a=o.gl,s=t.transform,u=s.tileSize,l=i.paint.get("background-pattern");if(!t.isPatternMissing(l)){var c=!l&&1===r.a&&1===n&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var p=bp.disabled,h=t.depthModeForSublayer(0,"opaque"===c?xp.ReadWrite:xp.ReadOnly),f=t.colorModeForRenderPass(),d=t.useProgram(l?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:u});l&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var y=i.getCrossfadeParameters(),_=0,g=m;_<g.length;_+=1){var v=g[_],x=t.transform.calculatePosMatrix(v.toUnwrapped()),b=l?Zf(x,n,t,l,{tileID:v,tileSize:u},y):qf(x,n,r);d.draw(o,a.TRIANGLES,h,p,f,Ip.disabled,b,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,i){for(var r=0;r<i.length;r++)hd(t,e,i[r])},custom:function(t,e,i){var r=t.context,n=i.implementation;if("offscreen"===t.renderPass){var o=n.prerender;o&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),o.call(n,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(bp.disabled);var a="3d"===n.renderingMode?new xp(t.context.gl.LEQUAL,xp.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,xp.ReadOnly);r.setDepthMode(a),n.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)}}},dd=function(t,e){this.context=new Sp(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Tp.maxUnderzooming+Tp.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Mh,this.gpuTimers={}};dd.prototype.resize=function(t,e){if(this.width=t*U.devicePixelRatio,this.height=e*U.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,r=this.style._order;i<r.length;i+=1)this.style._layers[r[i]].resize()},dd.prototype.setup=function(){var t=this.context,e=new Yn;e.emplaceBack(0,0),e.emplaceBack(8192,0),e.emplaceBack(0,8192),e.emplaceBack(8192,8192),this.tileExtentBuffer=t.createVertexBuffer(e,Vh.members),this.tileExtentSegments=Co.simpleSegment(0,0,4,2);var i=new Yn;i.emplaceBack(0,0),i.emplaceBack(8192,0),i.emplaceBack(0,8192),i.emplaceBack(8192,8192),this.debugBuffer=t.createVertexBuffer(i,Vh.members),this.debugSegments=Co.simpleSegment(0,0,4,5);var r=new Jn;r.emplaceBack(0,0,0,0),r.emplaceBack(8192,0,8192,0),r.emplaceBack(0,8192,0,8192),r.emplaceBack(8192,8192,8192,8192),this.rasterBoundsBuffer=t.createVertexBuffer(r,_c.members),this.rasterBoundsSegments=Co.simpleSegment(0,0,4,2);var n=new Yn;n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(n,Vh.members),this.viewportSegments=Co.simpleSegment(0,0,4,2);var o=new _o;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);var a=new lo;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(a),this.emptyTexture=new Ml(t,{width:1,height:1,data:new Uint8Array([0,0,0,0])},t.gl.RGBA);var s=this.context.gl;this.stencilClearMode=new bp({func:s.ALWAYS,mask:0},0,255,s.ZERO,s.ZERO,s.ZERO)},dd.prototype.clearStencil=function(){var t=this.context,e=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=ka();Ra(i,0,this.width,this.height,0,0,1),La(i,i,[e.drawingBufferWidth,e.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,e.TRIANGLES,xp.disabled,this.stencilClearMode,wp.disabled,Ip.disabled,kf(i),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},dd.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var i=this.context,r=i.gl;this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(wp.disabled),i.setDepthMode(xp.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],u=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;n.draw(i,r.TRIANGLES,xp.disabled,new bp({func:r.ALWAYS,mask:0},u,255,r.KEEP,r.KEEP,r.REPLACE),wp.disabled,Ip.disabled,kf(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},dd.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new bp({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},dd.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new bp({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},dd.prototype.stencilConfigForOverlap=function(t){var e,i=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),n=r[r.length-1].overscaledZ,o=r[0].overscaledZ-n+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s<o;s++)a[s+n]=new bp({func:i.GEQUAL,mask:255},s+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=o,[a,r]}return[(e={},e[n]=bp.disabled,e),r]},dd.prototype.colorModeForRenderPass=function(){var t=this.context.gl;return this._showOverdrawInspector?new wp([t.CONSTANT_COLOR,t.ONE],new me(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?wp.unblended:wp.alphaBlended},dd.prototype.depthModeForSublayer=function(t,e,i){if(!this.opaquePassEnabledForLayer())return xp.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new xp(i||this.context.gl.LEQUAL,e,[r,r])},dd.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},dd.prototype.render=function(t,e){var i=this;this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(U.now()),this.imageManager.beginFrame();var r=this.style._order,n=this.style.sourceCaches;for(var o in n){var a=n[o];a.used&&a.prepare(this.context)}var s,u,l={},c={},p={};for(var h in n){var f=n[h];l[h]=f.getVisibleCoordinates(),c[h]=l[h].slice().reverse(),p[h]=f.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<r.length;m++)if(this.style._layers[r[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var y=0,_=r;y<_.length;y+=1){var g=this.style._layers[_[y]];if(g.hasOffscreenPass()&&!g.isHidden(this.transform.zoom)){var v=c[g.source];("custom"===g.type||v.length)&&this.renderLayer(this,n[g.source],g,v)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:e.showOverdrawInspector?me.black:me.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=e.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){var x=this.style._layers[r[this.currentLayer]],b=n[x.source],w=l[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){var I=this.style._layers[r[this.currentLayer]],S=n[I.source],T=("symbol"===I.type?p:c)[I.source];this._renderTileClippingMasks(I,l[I.source]),this.renderLayer(this,S,I,T)}this.options.showTileBoundaries&&(d(this.style._layers).forEach((function(t){t.source&&!t.isHidden(i.transform.zoom)&&(t.source!==(u&&u.id)&&(u=i.style.sourceCaches[t.source]),(!s||s.getSource().maxzoom<u.getSource().maxzoom)&&(s=u))})),s&&fd.debug(this,s,s.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;ld(t,t.transform.height-(e.top||0),3,nd),ld(t,e.bottom||0,3,od),cd(t,e.left||0,3,ad),cd(t,t.transform.width-(e.right||0),3,sd);var i=t.transform.centerPoint;!function(t,e,i,r){pd(t,e-1,i-10,2,20,r),pd(t,e-10,i-1,20,2,r)}(t,i.x,t.transform.height-i.y,ud)}(this),this.context.setDefault()},dd.prototype.renderLayer=function(t,e,i,r){i.isHidden(this.transform.zoom)||("background"===i.type||"custom"===i.type||r.length)&&(this.id=i.id,this.gpuTimingStart(i),fd[i.type](t,e,i,r,this.style.placement.variableOffsets),this.gpuTimingEnd())},dd.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,i=this.gpuTimers[t.id];i||(i=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),i.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i.query)}},dd.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},dd.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},dd.prototype.queryGpuTimers=function(t){var e={};for(var i in t){var r=t[i],n=this.context.extTimerQuery,o=n.getQueryObjectEXT(r.query,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(r.query),e[i]=o}return e},dd.prototype.translatePosMatrix=function(t,e,i,r,n){if(!i[0]&&!i[1])return t;var o=n?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(o){var a=Math.sin(o),s=Math.cos(o);i=[i[0]*s-i[1]*a,i[0]*a+i[1]*s]}var u=[n?i[0]:uh(e,i[0],this.transform.zoom),n?i[1]:uh(e,i[1],this.transform.zoom),0],l=new Float32Array(16);return Ma(l,t,u),l},dd.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},dd.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},dd.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i},dd.prototype.useProgram=function(t,e){this.cache=this.cache||{};var i=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new _f(this.context,t,df[t],e,Gf[t],this._showOverdrawInspector)),this.cache[i]},dd.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},dd.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},dd.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=a.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ml(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},dd.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var md=function(t,e){this.points=t,this.planes=e};md.fromInvProjectionMatrix=function(t,e,i){var r=Math.pow(2,i),n=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(e){return ja([],e,t)})).map((function(t){return function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}([],t,1/t[3]/e*r)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var e,i,r=function(t,e){var i=e[0],r=e[1],n=e[2],o=i*i+r*r+n*n;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}([],function(t,e,i){var r=e[0],n=e[1],o=e[2],a=i[0],s=i[1],u=i[2];return t[0]=n*u-o*s,t[1]=o*a-r*u,t[2]=r*s-n*a,t}([],Ua([],n[t[0]],n[t[1]]),Ua([],n[t[2]],n[t[1]]))),o=-((e=r)[0]*(i=n[t[1]])[0]+e[1]*i[1]+e[2]*i[2]);return r.concat(o)}));return new md(n,o)};var yd=function(t,e){this.min=t,this.max=e,this.center=function(t,e,i){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}([],this.min,this.max))};yd.prototype.quadrant=function(t){for(var e=[t%2==0,t<2],i=Oa(this.min),r=Oa(this.max),n=0;n<e.length;n++)i[n]=e[n]?this.min[n]:this.center[n],r[n]=e[n]?this.center[n]:this.max[n];return r[2]=this.max[2],new yd(i,r)},yd.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},yd.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},yd.prototype.intersects=function(t){for(var e,i,r=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,o=0;o<t.planes.length;o++){for(var a=t.planes[o],s=0,u=0;u<r.length;u++)s+=(e=a)[0]*(i=r[u])[0]+e[1]*i[1]+e[2]*i[2]+e[3]*i[3]>=0;if(0===s)return 0;s!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,p=-Number.MAX_VALUE,h=0;h<t.points.length;h++){var f=t.points[h][l]-this.min[l];c=Math.min(c,f),p=Math.max(p,f)}if(p<0||c>this.max[l]-this.min[l])return 0}return 1};var _d=function(t,e,i,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r};_d.prototype.interpolate=function(t,e,i){return null!=e.top&&null!=t.top&&(this.top=oi(t.top,e.top,i)),null!=e.bottom&&null!=t.bottom&&(this.bottom=oi(t.bottom,e.bottom,i)),null!=e.left&&null!=t.left&&(this.left=oi(t.left,e.left,i)),null!=e.right&&null!=t.right&&(this.right=oi(t.right,e.right,i)),this},_d.prototype.getCenter=function(t,e){var i=p((this.left+t-this.right)/2,0,t),r=p((this.top+e-this.bottom)/2,0,e);return new n(i,r)},_d.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},_d.prototype.clone=function(){return new _d(this.top,this.bottom,this.left,this.right)},_d.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var gd=function(t,e,i,r,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=t||0,this._maxZoom=e||22,this._minPitch=null==i?0:i,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new Ql(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new _d,this._posMatrixCache={},this._alignedPosMatrixCache={}},vd={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};gd.prototype.clone=function(){var t=new gd(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},vd.minZoom.get=function(){return this._minZoom},vd.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},vd.maxZoom.get=function(){return this._maxZoom},vd.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},vd.minPitch.get=function(){return this._minPitch},vd.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},vd.maxPitch.get=function(){return this._maxPitch},vd.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},vd.renderWorldCopies.get=function(){return this._renderWorldCopies},vd.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},vd.worldSize.get=function(){return this.tileSize*this.scale},vd.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},vd.size.get=function(){return new n(this.width,this.height)},vd.bearing.get=function(){return-this.angle/Math.PI*180},vd.bearing.set=function(t){var e=-h(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=function(){var t=new Ea(4);return Ea!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}(),function(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=Math.sin(i),u=Math.cos(i);t[0]=r*u+o*s,t[1]=n*u+a*s,t[2]=r*-s+o*u,t[3]=n*-s+a*u}(this.rotationMatrix,this.rotationMatrix,this.angle))},vd.pitch.get=function(){return this._pitch/Math.PI*180},vd.pitch.set=function(t){var e=p(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},vd.fov.get=function(){return this._fov/Math.PI*180},vd.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},vd.zoom.get=function(){return this._zoom},vd.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},vd.center.get=function(){return this._center},vd.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},vd.padding.get=function(){return this._edgeInsets.toJSON()},vd.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},vd.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},gd.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},gd.prototype.interpolatePadding=function(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()},gd.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},gd.prototype.getVisibleUnwrappedCoordinates=function(t){var e=[new sc(0,t)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new n(0,0)),r=this.pointCoordinate(new n(this.width,0)),o=this.pointCoordinate(new n(this.width,this.height)),a=this.pointCoordinate(new n(0,this.height)),s=Math.floor(Math.min(i.x,r.x,o.x,a.x)),u=Math.floor(Math.max(i.x,r.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&e.push(new sc(l,t));return e},gd.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),i=e;if(void 0!==t.minzoom&&e<t.minzoom)return[];void 0!==t.maxzoom&&e>t.maxzoom&&(e=t.maxzoom);var r=oc.fromLngLat(this.center),n=Math.pow(2,e),o=[n*r.x,n*r.y,0],a=md.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,e),s=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(s=e);var u=function(t){return{aabb:new yd([t*n,0,0],[(t+1)*n,n,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},l=[],c=[],p=e,h=t.reparseOverscaled?i:e;if(this._renderWorldCopies)for(var f=1;f<=3;f++)l.push(u(-f)),l.push(u(f));for(l.push(u(0));l.length>0;){var d=l.pop(),m=d.x,y=d.y,_=d.fullyVisible;if(!_){var g=d.aabb.intersects(a);if(0===g)continue;_=2===g}var v=d.aabb.distanceX(o),x=d.aabb.distanceY(o),b=Math.max(Math.abs(v),Math.abs(x));if(d.zoom===p||b>3+(1<<p-d.zoom)-2&&d.zoom>=s)c.push({tileID:new uc(d.zoom===p?h:d.zoom,d.wrap,d.zoom,m,y),distanceSq:Na([o[0]-.5-m,o[1]-.5-y])});else for(var w=0;w<4;w++){var I=(m<<1)+w%2,S=(y<<1)+(w>>1);l.push({aabb:d.aabb.quadrant(w),zoom:d.zoom+1,x:I,y:S,wrap:d.wrap,fullyVisible:_})}}return c.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},gd.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},vd.unmodified.get=function(){return this._unmodified},gd.prototype.zoomScale=function(t){return Math.pow(2,t)},gd.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},gd.prototype.project=function(t){var e=p(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new n(ec(t.lng)*this.worldSize,ic(e)*this.worldSize)},gd.prototype.unproject=function(t){return new oc(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},vd.point.get=function(){return this.project(this.center)},gd.prototype.setLocationAtPoint=function(t,e){var i=this.pointCoordinate(e),r=this.pointCoordinate(this.centerPoint),n=this.locationCoordinate(t),o=new oc(n.x-(i.x-r.x),n.y-(i.y-r.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},gd.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},gd.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},gd.prototype.locationCoordinate=function(t){return oc.fromLngLat(t)},gd.prototype.coordinateLocation=function(t){return t.toLngLat()},gd.prototype.pointCoordinate=function(t){var e=[t.x,t.y,0,1],i=[t.x,t.y,1,1];ja(e,e,this.pixelMatrixInverse),ja(i,i,this.pixelMatrixInverse);var r=e[3],n=i[3],o=e[1]/r,a=i[1]/n,s=e[2]/r,u=i[2]/n,l=s===u?0:(0-s)/(u-s);return new oc(oi(e[0]/r,i[0]/n,l)/this.worldSize,oi(o,a,l)/this.worldSize)},gd.prototype.coordinatePoint=function(t){var e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return ja(e,e,this.pixelMatrix),new n(e[0]/e[3],e[1]/e[3])},gd.prototype.getBounds=function(){return(new Jl).extend(this.pointLocation(new n(0,0))).extend(this.pointLocation(new n(this.width,0))).extend(this.pointLocation(new n(this.width,this.height))).extend(this.pointLocation(new n(0,this.height)))},gd.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new Jl([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},gd.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},gd.prototype.calculatePosMatrix=function(t,e){void 0===e&&(e=!1);var i=t.key,r=e?this._alignedPosMatrixCache:this._posMatrixCache;if(r[i])return r[i];var n=t.canonical,o=this.worldSize/this.zoomScale(n.z),a=n.x+Math.pow(2,n.z)*t.wrap,s=Ca(new Float64Array(16));return Ma(s,s,[a*o,n.y*o,0]),La(s,s,[o/8192,o/8192,1]),Da(s,e?this.alignedProjMatrix:this.projMatrix,s),r[i]=new Float32Array(s),r[i]},gd.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},gd.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,i,r,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;o=ic(p[1])*this.worldSize,t=(a=ic(p[0])*this.worldSize)-o<l.y?l.y/(a-o):0}if(this.lngRange){var h=this.lngRange;s=ec(h[0])*this.worldSize,e=(u=ec(h[1])*this.worldSize)-s<l.x?l.x/(u-s):0}var f=this.point,d=Math.max(e||0,t||0);if(d)return this.center=this.unproject(new n(e?(u+s)/2:f.x,t?(a+o)/2:f.y)),this.zoom+=this.scaleZoom(d),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=f.y,y=l.y/2;m-y<o&&(r=o+y),m+y>a&&(r=a-y)}if(this.lngRange){var _=f.x,g=l.x/2;_-g<s&&(i=s+g),_+g>u&&(i=u-g)}void 0===i&&void 0===r||(this.center=this.unproject(new n(void 0!==i?i:f.x,void 0!==r?r:f.y))),this._unmodified=c,this._constraining=!1}},gd.prototype._calcMatrices=function(){if(this.height){var t=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=Math.PI/2+this._pitch,i=this._fov*(.5+t.y/this.height),r=Math.sin(i)*this.cameraToCenterDistance/Math.sin(p(Math.PI-e-i,.01,Math.PI-.01)),n=this.point,o=n.x,a=n.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),u=this.height/50,l=new Float64Array(16);!function(t,e,i,r,n){var o,a=1/Math.tan(e/2);t[0]=a/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(t[10]=(n+r)*(o=1/(r-n)),t[14]=2*n*r*o):(t[10]=-1,t[14]=-2*r)}(l,this._fov,this.width/this.height,u,s),l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,La(l,l,[1,-1,1]),Ma(l,l,[0,0,-this.cameraToCenterDistance]),function(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],p=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+l*r,t[5]=a*n+c*r,t[6]=s*n+p*r,t[7]=u*n+h*r,t[8]=l*n-o*r,t[9]=c*n-a*r,t[10]=p*n-s*r,t[11]=h*n-u*r}(l,l,this._pitch),Ba(l,l,this.angle),Ma(l,l,[-o,-a,0]),this.mercatorMatrix=La([],l,[this.worldSize,this.worldSize,this.worldSize]),La(l,l,[1,1,rc(1,this.center.lat)*this.worldSize,1]),this.projMatrix=l,this.invProjMatrix=Pa([],this.projMatrix);var c=this.width%2/2,h=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),m=o-Math.round(o)+f*c+d*h,y=a-Math.round(a)+f*h+d*c,_=new Float64Array(l);if(Ma(_,_,[m>.5?m-1:m,y>.5?y-1:y,0]),this.alignedProjMatrix=_,La(l=ka(),l,[this.width/2,-this.height/2,1]),Ma(l,l,[1,-1,0]),this.labelPlaneMatrix=l,La(l=ka(),l,[1,-1,1]),Ma(l,l,[-1,-1,0]),La(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l,this.pixelMatrix=Da(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(l=Pa(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}},gd.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new n(0,0)),e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return ja(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance},gd.prototype.getCameraPoint=function(){var t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n(0,t))},gd.prototype.getCameraQueryGeometry=function(t){var e=this.getCameraPoint();if(1===t.length)return[t[0],e];for(var i=e.x,r=e.y,o=e.x,a=e.y,s=0,u=t;s<u.length;s+=1){var l=u[s];i=Math.min(i,l.x),r=Math.min(r,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y)}return[new n(i,r),new n(o,r),new n(o,a),new n(i,a),new n(i,r)]},Object.defineProperties(gd.prototype,vd);var xd=function(t){var e,i,r,n;this._hashName=t&&encodeURIComponent(t),b(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),i=!1,r=null,n=function(){r=null,i&&(e(),r=setTimeout(n,300),i=!1)},function(){return i=!0,r||n(),r})};xd.prototype.addTo=function(t){return this._map=t,a.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},xd.prototype.remove=function(){return a.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},xd.prototype.getHashString=function(t){var e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,r),o=Math.round(e.lng*n)/n,s=Math.round(e.lat*n)/n,u=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=t?"/"+o+"/"+s+"/"+i:i+"/"+s+"/"+o,(u||l)&&(c+="/"+Math.round(10*u)/10),l&&(c+="/"+Math.round(l)),this._hashName){var p=this._hashName,h=!1,f=a.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===p?(h=!0,e+"="+c):t})).filter((function(t){return t}));return h||f.push(p+"="+c),"#"+f.join("&")}return"#"+c},xd.prototype._getCurrentHash=function(){var t,e=this,i=a.location.hash.replace("#","");return this._hashName?(i.split("&").map((function(t){return t.split("=")})).forEach((function(i){i[0]===e._hashName&&(t=i)})),(t&&t[1]||"").split("/")):i.split("/")},xd.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},xd.prototype._updateHashUnthrottled=function(){var t=a.location.href.replace(/(#.+)?$/,this.getHashString());try{a.history.replaceState(a.history.state,null,t)}catch(t){}};var bd={linearity:.3,easing:l(0,0,.3,1)},wd=m({deceleration:2500,maxSpeed:1400},bd),Id=m({deceleration:20,maxSpeed:1400},bd),Sd=m({deceleration:1e3,maxSpeed:360},bd),Td=m({deceleration:1e3,maxSpeed:90},bd),Ad=function(t){this._map=t,this.clear()};function zd(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Ed(t,e,i){var r=i.maxSpeed,n=i.linearity,o=i.deceleration,a=p(t*n/(e/1e3),-r,r),s=Math.abs(a)/(o*n);return{easing:i.easing,duration:1e3*s,amount:a*(s/2)}}Ad.prototype.clear=function(){this._inertiaBuffer=[]},Ad.prototype.record=function(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:U.now(),settings:t})},Ad.prototype._drainInertiaBuffer=function(){for(var t=this._inertiaBuffer,e=U.now();t.length>0&&e-t[0].time>160;)t.shift()},Ad.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var e={zoom:0,bearing:0,pitch:0,pan:new n(0,0),pinchAround:void 0,around:void 0},i=0,r=this._inertiaBuffer;i<r.length;i+=1){var o=r[i].settings;e.zoom+=o.zoomDelta||0,e.bearing+=o.bearingDelta||0,e.pitch+=o.pitchDelta||0,o.panDelta&&e.pan._add(o.panDelta),o.around&&(e.around=o.around),o.pinchAround&&(e.pinchAround=o.pinchAround)}var a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(e.pan.mag()){var u=Ed(e.pan.mag(),a,m({},wd,t||{}));s.offset=e.pan.mult(u.amount/e.pan.mag()),s.center=this._map.transform.center,zd(s,u)}if(e.zoom){var l=Ed(e.zoom,a,Id);s.zoom=this._map.transform.zoom+l.amount,zd(s,l)}if(e.bearing){var c=Ed(e.bearing,a,Sd);s.bearing=this._map.transform.bearing+p(c.amount,-179,179),zd(s,c)}if(e.pitch){var h=Ed(e.pitch,a,Td);s.pitch=this._map.transform.pitch+h.amount,zd(s,h)}if(s.zoom||s.bearing){var f=void 0===e.pinchAround?e.around:e.pinchAround;s.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),m(s,{noMoveStart:!0})}};var kd=function(t){function e(e,i,r,n){void 0===n&&(n={});var o=j.mousePos(i.getCanvasContainer(),r),a=i.unproject(o);t.call(this,e,m({point:o,lngLat:a,originalEvent:r},n)),this._defaultPrevented=!1,this.target=i}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,i),e}(jt),Cd=function(t){function e(e,i,r){var o="touchend"===e?r.changedTouches:r.touches,a=j.touchPos(i.getCanvasContainer(),o),s=a.map((function(t){return i.unproject(t)})),u=a.reduce((function(t,e,i,r){return t.add(e.div(r.length))}),new n(0,0)),l=i.unproject(u);t.call(this,e,{points:a,point:u,lngLats:s,lngLat:l,originalEvent:r}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,i),e}(jt),Pd=function(t){function e(e,i,r){t.call(this,e,{originalEvent:r}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,i),e}(jt),Dd=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Dd.prototype.reset=function(){delete this._mousedownPos},Dd.prototype.wheel=function(t){return this._firePreventable(new Pd(t.type,this._map,t))},Dd.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new kd(t.type,this._map,t))},Dd.prototype.mouseup=function(t){this._map.fire(new kd(t.type,this._map,t))},Dd.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new kd(t.type,this._map,t))},Dd.prototype.dblclick=function(t){return this._firePreventable(new kd(t.type,this._map,t))},Dd.prototype.mouseover=function(t){this._map.fire(new kd(t.type,this._map,t))},Dd.prototype.mouseout=function(t){this._map.fire(new kd(t.type,this._map,t))},Dd.prototype.touchstart=function(t){return this._firePreventable(new Cd(t.type,this._map,t))},Dd.prototype.touchmove=function(t){this._map.fire(new Cd(t.type,this._map,t))},Dd.prototype.touchend=function(t){this._map.fire(new Cd(t.type,this._map,t))},Dd.prototype.touchcancel=function(t){this._map.fire(new Cd(t.type,this._map,t))},Dd.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Dd.prototype.isEnabled=function(){return!0},Dd.prototype.isActive=function(){return!1},Dd.prototype.enable=function(){},Dd.prototype.disable=function(){};var Md=function(t){this._map=t};Md.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Md.prototype.mousemove=function(t){this._map.fire(new kd(t.type,this._map,t))},Md.prototype.mousedown=function(){this._delayContextMenu=!0},Md.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new kd("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Md.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new kd(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Md.prototype.isEnabled=function(){return!0},Md.prototype.isActive=function(){return!1},Md.prototype.enable=function(){},Md.prototype.disable=function(){};var Ld=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Bd(t,e){for(var i={},r=0;r<t.length;r++)i[t[r].identifier]=e[r];return i}Ld.prototype.isEnabled=function(){return!!this._enabled},Ld.prototype.isActive=function(){return!!this._active},Ld.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Ld.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ld.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(j.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Ld.prototype.mousemoveWindow=function(t,e){if(this._active){var i=e;if(!(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=i,this._box||(this._box=j.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(r.x,i.x),o=Math.max(r.x,i.x),a=Math.min(r.y,i.y),s=Math.max(r.y,i.y);j.setTransform(this._box,"translate("+n+"px,"+a+"px)"),this._box.style.width=o-n+"px",this._box.style.height=s-a+"px"}}},Ld.prototype.mouseupWindow=function(t,e){var i=this;if(this._active&&0===t.button){var r=this._startPos,n=e;if(this.reset(),j.suppressClick(),r.x!==n.x||r.y!==n.y)return this._map.fire(new jt("boxzoomend",{originalEvent:t})),{cameraAnimation:function(t){return t.fitScreenCoordinates(r,n,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",t)}},Ld.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Ld.prototype.blur=function(){this.reset()},Ld.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(j.remove(this._box),this._box=null),j.enableDrag(),delete this._startPos,delete this._lastPos},Ld.prototype._fireEvent=function(t,e){return this._map.fire(new jt(t,{originalEvent:e}))};var Rd=function(t){this.reset(),this.numTouches=t.numTouches};Rd.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Rd.prototype.touchstart=function(t,e,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=function(t){for(var e=new n(0,0),i=0,r=t;i<r.length;i+=1)e._add(r[i]);return e.div(t.length)}(e),this.touches=Bd(i,e)))},Rd.prototype.touchmove=function(t,e,i){if(!this.aborted&&this.centroid){var r=Bd(i,e);for(var n in this.touches){var o=r[n];(!o||o.dist(this.touches[n])>30)&&(this.aborted=!0)}}},Rd.prototype.touchend=function(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}};var Fd=function(t){this.singleTap=new Rd(t),this.numTaps=t.numTaps,this.reset()};Fd.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Fd.prototype.touchstart=function(t,e,i){this.singleTap.touchstart(t,e,i)},Fd.prototype.touchmove=function(t,e,i){this.singleTap.touchmove(t,e,i)},Fd.prototype.touchend=function(t,e,i){var r=this.singleTap.touchend(t,e,i);if(r){var n=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(r)<30;if(n&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}};var Od=function(){this._zoomIn=new Fd({numTouches:1,numTaps:2}),this._zoomOut=new Fd({numTouches:2,numTaps:1}),this.reset()};Od.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Od.prototype.touchstart=function(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)},Od.prototype.touchmove=function(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)},Od.prototype.touchend=function(t,e,i){var r=this,n=this._zoomIn.touchend(t,e,i),o=this._zoomOut.touchend(t,e,i);return n?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(n)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},Od.prototype.touchcancel=function(){this.reset()},Od.prototype.enable=function(){this._enabled=!0},Od.prototype.disable=function(){this._enabled=!1,this.reset()},Od.prototype.isEnabled=function(){return this._enabled},Od.prototype.isActive=function(){return this._active};var Vd={0:1,2:2},Ud=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Ud.prototype.blur=function(){this.reset()},Ud.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Ud.prototype._correctButton=function(t,e){return!1},Ud.prototype._move=function(t,e){return{}},Ud.prototype.mousedown=function(t,e){if(!this._lastPoint){var i=j.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}},Ud.prototype.mousemoveWindow=function(t,e){var i=this._lastPoint;if(i)if(t.preventDefault(),function(t,e){var i=Vd[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(i,e)},Ud.prototype.mouseupWindow=function(t){this._lastPoint&&j.mouseButton(t)===this._eventButton&&(this._moved&&j.suppressClick(),this.reset())},Ud.prototype.enable=function(){this._enabled=!0},Ud.prototype.disable=function(){this._enabled=!1,this.reset()},Ud.prototype.isEnabled=function(){return this._enabled},Ud.prototype.isActive=function(){return this._active};var jd=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.mousedown=function(e,i){t.prototype.mousedown.call(this,e,i),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}(Ud),Nd=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var i=.8*(e.x-t.x);if(i)return this._active=!0,{bearingDelta:i}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Ud),qd=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var i=-.5*(e.y-t.y);if(i)return this._active=!0,{pitchDelta:i}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Ud),Zd=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};Zd.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new n(0,0)},Zd.prototype.touchstart=function(t,e,i){return this._calculateTransform(t,e,i)},Zd.prototype.touchmove=function(t,e,i){if(this._active&&!(i.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,i)},Zd.prototype.touchend=function(t,e,i){this._calculateTransform(t,e,i),this._active&&i.length<this._minTouches&&this.reset()},Zd.prototype.touchcancel=function(){this.reset()},Zd.prototype._calculateTransform=function(t,e,i){i.length>0&&(this._active=!0);var r=Bd(i,e),o=new n(0,0),a=new n(0,0),s=0;for(var u in r){var l=r[u],c=this._touches[u];c&&(o._add(l),a._add(l.sub(c)),s++,r[u]=l)}if(this._touches=r,!(s<this._minTouches)&&a.mag()){var p=a.div(s);if(this._sum._add(p),!(this._sum.mag()<this._clickTolerance))return{around:o.div(s),panDelta:p}}},Zd.prototype.enable=function(){this._enabled=!0},Zd.prototype.disable=function(){this._enabled=!1,this.reset()},Zd.prototype.isEnabled=function(){return this._enabled},Zd.prototype.isActive=function(){return this._active};var Gd=function(){this.reset()};function Xd(t,e,i){for(var r=0;r<t.length;r++)if(t[r].identifier===i)return e[r]}function Wd(t,e){return Math.log(t/e)/Math.LN2}Gd.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Gd.prototype._start=function(t){},Gd.prototype._move=function(t,e,i){return{}},Gd.prototype.touchstart=function(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))},Gd.prototype.touchmove=function(t,e,i){if(this._firstTwoTouches){t.preventDefault();var r=this._firstTwoTouches,n=r[1],o=Xd(i,e,r[0]),a=Xd(i,e,n);if(o&&a){var s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,t)}}},Gd.prototype.touchend=function(t,e,i){if(this._firstTwoTouches){var r=this._firstTwoTouches,n=r[1],o=Xd(i,e,r[0]),a=Xd(i,e,n);o&&a||(this._active&&j.suppressClick(),this.reset())}},Gd.prototype.touchcancel=function(){this.reset()},Gd.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Gd.prototype.disable=function(){this._enabled=!1,this.reset()},Gd.prototype.isEnabled=function(){return this._enabled},Gd.prototype.isActive=function(){return this._active};var Hd=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Wd(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Wd(this._distance,i),pinchAround:e}},e}(Gd);function Kd(t,e){return 180*t.angleWith(e)/Math.PI}var Yd=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var i=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Kd(this._vector,i),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,i=Kd(t,this._startVector);return Math.abs(i)<e},e}(Gd);function Jd(t){return Math.abs(t.y)>Math.abs(t.x)}var Qd=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,Jd(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,i){var r=t[0].sub(this._lastPoints[0]),n=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,n,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+n.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,i){if(void 0!==this._valid)return this._valid;var r=t.mag()>=2,n=e.mag()>=2;if(r||n){if(!r||!n)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return Jd(t)&&Jd(e)&&o}},e}(Gd),$d={panStep:100,bearingStep:15,pitchStep:10},tm=function(){var t=$d;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function em(t){return t*(2-t)}tm.prototype.blur=function(){this.reset()},tm.prototype.reset=function(){this._active=!1},tm.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var i=0,r=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:em,zoom:i?Math.round(u)+i*(t.shiftKey?2:1):u,bearing:s.getBearing()+r*e._bearingStep,pitch:s.getPitch()+n*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},tm.prototype.enable=function(){this._enabled=!0},tm.prototype.disable=function(){this._enabled=!1,this.reset()},tm.prototype.isEnabled=function(){return this._enabled},tm.prototype.isActive=function(){return this._active},tm.prototype.disableRotation=function(){this._rotationDisabled=!0},tm.prototype.enableRotation=function(){this._rotationDisabled=!1};var im=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._handler=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,b(["_onTimeout"],this)};im.prototype.setZoomRate=function(t){this._defaultZoomRate=t},im.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},im.prototype.isEnabled=function(){return!!this._enabled},im.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},im.prototype.isZooming=function(){return!!this._zooming},im.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},im.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},im.prototype.wheel=function(t){if(this.isEnabled()){var e=t.deltaMode===a.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=U.now(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}},im.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},im.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var e=j.mousePos(this._el,t);this._around=Ql.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(e)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},im.prototype.renderFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var e=this._map.transform;if(0!==this._delta){var i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);var n="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,a="number"==typeof this._targetZoom?this._targetZoom:e.zoom,s=this._startZoom,u=this._easing,l=!1;if("wheel"===this._type&&s&&u){var c=Math.min((U.now()-this._lastWheelEventTime)/200,1);o=oi(s,a,u(c)),c<1?this._frameId||(this._frameId=!0):l=!0}else o=a,l=!0;return this._active=!0,l&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!l,zoomDelta:o-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},im.prototype._smoothOutEasing=function(t){var e=c;if(this._prevEase){var i=this._prevEase,r=(U.now()-i.start)/i.duration,n=i.easing(r+.01)-i.easing(r),o=.27/Math.sqrt(n*n+1e-4)*.01;e=l(o,Math.sqrt(.0729-o*o),.25,1)}return this._prevEase={start:U.now(),duration:t,easing:e},e},im.prototype.blur=function(){this.reset()},im.prototype.reset=function(){this._active=!1};var rm=function(t,e){this._clickZoom=t,this._tapZoom=e};rm.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},rm.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},rm.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},rm.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var nm=function(){this.reset()};nm.prototype.reset=function(){this._active=!1},nm.prototype.blur=function(){this.reset()},nm.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(i){i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t})}}},nm.prototype.enable=function(){this._enabled=!0},nm.prototype.disable=function(){this._enabled=!1,this.reset()},nm.prototype.isEnabled=function(){return this._enabled},nm.prototype.isActive=function(){return this._active};var om=function(){this._tap=new Fd({numTouches:1,numTaps:1}),this.reset()};om.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},om.prototype.touchstart=function(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i))},om.prototype.touchmove=function(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;var r=e[0],n=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(t,e,i)},om.prototype.touchend=function(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp)},om.prototype.touchcancel=function(){this.reset()},om.prototype.enable=function(){this._enabled=!0},om.prototype.disable=function(){this._enabled=!1,this.reset()},om.prototype.isEnabled=function(){return this._enabled},om.prototype.isActive=function(){return this._active};var am=function(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i};am.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},am.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},am.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},am.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var sm=function(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i};sm.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},sm.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},sm.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},sm.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var um=function(t,e,i,r){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0};um.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},um.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},um.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},um.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},um.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},um.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var lm=function(t){return t.zoom||t.drag||t.pitch||t.rotate},cm=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(jt);function pm(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var hm=function(t,e){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ad(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e),b(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[a.document,"mousemove",{capture:!0}],[a.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[a,"blur",void 0]];for(var r=0,n=this._listeners;r<n.length;r+=1){var o=n[r],s=o[0];j.addEventListener(s,o[1],s===a.document?this.handleWindowEvent:this.handleEvent,o[2])}};hm.prototype.destroy=function(){for(var t=0,e=this._listeners;t<e.length;t+=1){var i=e[t],r=i[0];j.removeEventListener(r,i[1],r===a.document?this.handleWindowEvent:this.handleEvent,i[2])}},hm.prototype._addDefaultHandlers=function(t){var e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new Dd(e,t));var r=e.boxZoom=new Ld(e,t);this._add("boxZoom",r);var n=new Od,o=new nm;e.doubleClickZoom=new rm(o,n),this._add("tapZoom",n),this._add("clickZoom",o);var a=new om;this._add("tapDragZoom",a);var s=e.touchPitch=new Qd;this._add("touchPitch",s);var u=new Nd(t),l=new qd(t);e.dragRotate=new sm(t,u,l),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",l,["mouseRotate"]);var c=new jd(t),p=new Zd(t);e.dragPan=new am(i,c,p),this._add("mousePan",c),this._add("touchPan",p,["touchZoom","touchRotate"]);var h=new Yd,f=new Hd;e.touchZoomRotate=new um(i,f,h,a),this._add("touchRotate",h,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]);var d=e.scrollZoom=new im(e,this);this._add("scrollZoom",d,["mousePan"]);var m=e.keyboard=new tm;this._add("keyboard",m),this._add("blockableMapEvent",new Md(e));for(var y=0,_=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];y<_.length;y+=1){var g=_[y];t.interactive&&t[g]&&e[g].enable(t[g])}},hm.prototype._add=function(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e},hm.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,i=this._handlers;e<i.length;e+=1)i[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},hm.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},hm.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},hm.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},hm.prototype.isMoving=function(){return Boolean(lm(this._eventsInProgress))||this.isZooming()},hm.prototype._blockedByActive=function(t,e,i){for(var r in t)if(r!==i&&(!e||e.indexOf(r)<0))return!0;return!1},hm.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},hm.prototype._getMapTouches=function(t){for(var e=[],i=0,r=t;i<r.length;i+=1){var n=r[i];this._el.contains(n.target)&&e.push(n)}return e},hm.prototype.handleEvent=function(t,e){this._updatingCamera=!0;for(var i="renderFrame"===t.type?void 0:t,r={needsRenderFrame:!1},n={},o={},a=t.touches?this._getMapTouches(t.touches):void 0,s=a?j.touchPos(this._el,a):j.mousePos(this._el,t),u=0,l=this._handlers;u<l.length;u+=1){var c=l[u],p=c.handlerName,h=c.handler,f=c.allowed;if(h.isEnabled()){var d=void 0;this._blockedByActive(o,f,p)?h.reset():h[e||t.type]&&(d=h[e||t.type](t,s,a),this.mergeHandlerResult(r,n,d,p,i),d&&d.needsRenderFrame&&this._triggerRenderFrame()),(d||h.isActive())&&(o[p]=h)}}var m={};for(var y in this._previousActiveHandlers)o[y]||(m[y]=i);this._previousActiveHandlers=o,(Object.keys(m).length||pm(r))&&(this._changes.push([r,n,m]),this._triggerRenderFrame()),(Object.keys(o).length||pm(r))&&this._map._stop(!0),this._updatingCamera=!1;var _=r.cameraAnimation;_&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],_(this._map))},hm.prototype.mergeHandlerResult=function(t,e,i,r,n){if(i){m(t,i);var o={handlerName:r,originalEvent:i.originalEvent||n};void 0!==i.zoomDelta&&(e.zoom=o),void 0!==i.panDelta&&(e.drag=o),void 0!==i.pitchDelta&&(e.pitch=o),void 0!==i.bearingDelta&&(e.rotate=o)}},hm.prototype._applyChanges=function(){for(var t={},e={},i={},r=0,o=this._changes;r<o.length;r+=1){var a=o[r],s=a[0],u=a[1],l=a[2];s.panDelta&&(t.panDelta=(t.panDelta||new n(0,0))._add(s.panDelta)),s.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(t.around=s.around),void 0!==s.pinchAround&&(t.pinchAround=s.pinchAround),s.noInertia&&(t.noInertia=s.noInertia),m(e,u),m(i,l)}this._updateMapTransform(t,e,i),this._changes=[]},hm.prototype._updateMapTransform=function(t,e,i){var r=this._map,n=r.transform;if(!pm(t))return this._fireEvents(e,i,!0);var o=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,u=t.pitchDelta,l=t.around,c=t.pinchAround;void 0!==c&&(l=c),r._stop(!0),l=l||r.transform.centerPoint;var p=n.pointLocation(o?l.sub(o):l);s&&(n.bearing+=s),u&&(n.pitch+=u),a&&(n.zoom+=a),n.setLocationAtPoint(p,l),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)},hm.prototype._fireEvents=function(t,e,i){var r=this,n=lm(this._eventsInProgress),o=lm(t),a={};for(var s in t)this._eventsInProgress[s]||(a[s+"start"]=t[s].originalEvent),this._eventsInProgress[s]=t[s];for(var u in!n&&o&&this._fireEvent("movestart",o.originalEvent),a)this._fireEvent(u,a[u]);for(var l in o&&this._fireEvent("move",o.originalEvent),t)this._fireEvent(l,t[l].originalEvent);var c,p={};for(var h in this._eventsInProgress){var f=this._eventsInProgress[h],d=f.handlerName,m=f.originalEvent;this._handlersById[d].isActive()||(delete this._eventsInProgress[h],p[h+"end"]=c=e[d]||m)}for(var y in p)this._fireEvent(y,p[y]);var _=lm(this._eventsInProgress);if(i&&(n||o)&&!_){this._updatingCamera=!0;var g=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),v=function(t){return 0!==t&&-r._bearingSnap<t&&t<r._bearingSnap};g?(v(g.bearing||this._map.getBearing())&&(g.bearing=0),this._map.easeTo(g,{originalEvent:c})):(this._map.fire(new jt("moveend",{originalEvent:c})),v(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},hm.prototype._fireEvent=function(t,e){this._map.fire(new jt(t,e?{originalEvent:e}:{}))},hm.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new cm("renderFrame",{timeStamp:e})),t._applyChanges()}))},hm.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var fm=function(t){function e(e,i){t.call(this),this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=i.bearingSnap,b(["_renderFrameCallback"],this)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCenter=function(){return new Ql(this.transform.center.lng,this.transform.center.lat)},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},e.prototype.panBy=function(t,e,i){return t=n.convert(t).mult(-1),this.panTo(this.transform.center,m({offset:t},e),i)},e.prototype.panTo=function(t,e,i){return this.easeTo(m({center:t},e),i)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,i){return this.easeTo(m({zoom:t},e),i)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.getPadding=function(){return this.transform.padding},e.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},e.prototype.rotateTo=function(t,e,i){return this.easeTo(m({bearing:t},e),i)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,m({duration:1e3},t),e),this},e.prototype.resetNorthPitch=function(t,e){return this.easeTo(m({bearing:0,pitch:0,duration:1e3},t),e),this},e.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},e.prototype.getPitch=function(){return this.transform.pitch},e.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},e.prototype.cameraForBounds=function(t,e){t=Jl.convert(t);var i=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,e)},e.prototype._cameraForBoxAndBearing=function(t,e,i,r){var o={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=m({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){var a=r.padding;r.padding={top:a,bottom:a,right:a,left:a}}r.padding=m(o,r.padding);var s=this.transform,u=s.padding,l=s.project(Ql.convert(t)),c=s.project(Ql.convert(e)),p=l.rotate(-i*Math.PI/180),h=c.rotate(-i*Math.PI/180),f=new n(Math.max(p.x,h.x),Math.max(p.y,h.y)),d=new n(Math.min(p.x,h.x),Math.min(p.y,h.y)),y=f.sub(d),_=(s.width-(u.left+u.right+r.padding.left+r.padding.right))/y.x,g=(s.height-(u.top+u.bottom+r.padding.top+r.padding.bottom))/y.y;if(!(g<0||_<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(_,g)),r.maxZoom),x="number"==typeof r.offset.x?new n(r.offset.x,r.offset.y):n.convert(r.offset),b=new n((r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2).rotate(i*Math.PI/180),w=x.add(b).mult(s.scale/s.zoomScale(v));return{center:s.unproject(l.add(c).div(2).sub(w)),zoom:v,bearing:i}}z("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},e.prototype.fitBounds=function(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)},e.prototype.fitScreenCoordinates=function(t,e,i,r,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(n.convert(t)),this.transform.pointLocation(n.convert(e)),i,r),r,o)},e.prototype._fitInternal=function(t,e,i){return t?(delete(e=m(t,e)).padding,e.linear?this.easeTo(e,i):this.flyTo(e,i)):this},e.prototype.jumpTo=function(t,e){this.stop();var i=this.transform,r=!1,n=!1,o=!1;return"zoom"in t&&i.zoom!==+t.zoom&&(r=!0,i.zoom=+t.zoom),void 0!==t.center&&(i.center=Ql.convert(t.center)),"bearing"in t&&i.bearing!==+t.bearing&&(n=!0,i.bearing=+t.bearing),"pitch"in t&&i.pitch!==+t.pitch&&(o=!0,i.pitch=+t.pitch),null==t.padding||i.isPaddingEqual(t.padding)||(i.padding=t.padding),this.fire(new jt("movestart",e)).fire(new jt("move",e)),r&&this.fire(new jt("zoomstart",e)).fire(new jt("zoom",e)).fire(new jt("zoomend",e)),n&&this.fire(new jt("rotatestart",e)).fire(new jt("rotate",e)).fire(new jt("rotateend",e)),o&&this.fire(new jt("pitchstart",e)).fire(new jt("pitch",e)).fire(new jt("pitchend",e)),this.fire(new jt("moveend",e))},e.prototype.easeTo=function(t,e){var i=this;this._stop(!1,t.easeId),(!1===(t=m({offset:[0,0],duration:500,easing:c},t)).animate||!t.essential&&U.prefersReducedMotion)&&(t.duration=0);var r=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u=this.getPadding(),l="zoom"in t?+t.zoom:o,p="bearing"in t?this._normalizeBearing(t.bearing,a):a,h="pitch"in t?+t.pitch:s,f="padding"in t?t.padding:r.padding,d=n.convert(t.offset),y=r.centerPoint.add(d),_=r.pointLocation(y),g=Ql.convert(t.center||_);this._normalizeCenter(g);var v,x,b=r.project(_),w=r.project(g).sub(b),I=r.zoomScale(l-o);t.around&&(v=Ql.convert(t.around),x=r.locationPoint(v));var S={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||l!==o,this._rotating=this._rotating||a!==p,this._pitching=this._pitching||h!==s,this._padding=!r.isPaddingEqual(f),this._easeId=t.easeId,this._prepareEase(e,t.noMoveStart,S),this._ease((function(t){if(i._zooming&&(r.zoom=oi(o,l,t)),i._rotating&&(r.bearing=oi(a,p,t)),i._pitching&&(r.pitch=oi(s,h,t)),i._padding&&(r.interpolatePadding(u,f,t),y=r.centerPoint.add(d)),v)r.setLocationAtPoint(v,x);else{var n=r.zoomScale(r.zoom-o),c=l>o?Math.min(2,I):Math.max(.5,I),m=Math.pow(c,1-t),_=r.unproject(b.add(w.mult(t*m)).mult(n));r.setLocationAtPoint(r.renderWorldCopies?_.wrap():_,y)}i._fireMoveEvents(e)}),(function(t){i._afterEase(e,t)}),t),this},e.prototype._prepareEase=function(t,e,i){void 0===i&&(i={}),this._moving=!0,e||i.moving||this.fire(new jt("movestart",t)),this._zooming&&!i.zooming&&this.fire(new jt("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new jt("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new jt("pitchstart",t))},e.prototype._fireMoveEvents=function(t){this.fire(new jt("move",t)),this._zooming&&this.fire(new jt("zoom",t)),this._rotating&&this.fire(new jt("rotate",t)),this._pitching&&this.fire(new jt("pitch",t))},e.prototype._afterEase=function(t,e){if(!this._easeId||!e||this._easeId!==e){delete this._easeId;var i=this._zooming,r=this._rotating,n=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new jt("zoomend",t)),r&&this.fire(new jt("rotateend",t)),n&&this.fire(new jt("pitchend",t)),this.fire(new jt("moveend",t))}},e.prototype.flyTo=function(t,e){var i=this;if(!t.essential&&U.prefersReducedMotion){var r=y(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,e)}this.stop(),t=m({offset:[0,0],speed:1.2,curve:1.42,easing:c},t);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),h="zoom"in t?p(+t.zoom,o.minZoom,o.maxZoom):a,f="bearing"in t?this._normalizeBearing(t.bearing,s):s,d="pitch"in t?+t.pitch:u,_="padding"in t?t.padding:o.padding,g=o.zoomScale(h-a),v=n.convert(t.offset),x=o.centerPoint.add(v),b=o.pointLocation(x),w=Ql.convert(t.center||b);this._normalizeCenter(w);var I=o.project(b),S=o.project(w).sub(I),T=t.curve,A=Math.max(o.width,o.height),z=A/g,E=S.mag();if("minZoom"in t){var k=p(Math.min(t.minZoom,a,h),o.minZoom,o.maxZoom),C=A/o.zoomScale(k-a);T=Math.sqrt(C/E*2)}var P=T*T;function D(t){var e=(z*z-A*A+(t?-1:1)*P*P*E*E)/(2*(t?z:A)*P*E);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function L(t){return(Math.exp(t)+Math.exp(-t))/2}var B=D(0),R=function(t){return L(B)/L(B+T*t)},F=function(t){return A*((L(B)*(M(e=B+T*t)/L(e))-M(B))/P)/E;var e},O=(D(1)-B)/T;if(Math.abs(E)<1e-6||!isFinite(O)){if(Math.abs(A-z)<1e-6)return this.easeTo(t,e);var V=z<A?-1:1;O=Math.abs(Math.log(z/A))/T,F=function(){return 0},R=function(t){return Math.exp(V*T*t)}}return t.duration="duration"in t?+t.duration:1e3*O/("screenSpeed"in t?+t.screenSpeed/T:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==f,this._pitching=d!==u,this._padding=!o.isPaddingEqual(_),this._prepareEase(e,!1),this._ease((function(t){var r=t*O,n=1/R(r);o.zoom=1===t?h:a+o.scaleZoom(n),i._rotating&&(o.bearing=oi(s,f,t)),i._pitching&&(o.pitch=oi(u,d,t)),i._padding&&(o.interpolatePadding(l,_,t),x=o.centerPoint.add(v));var c=1===t?w:o.unproject(I.add(S.mult(F(r))).mult(n));o.setLocationAtPoint(o.renderWorldCopies?c.wrap():c,x),i._fireMoveEvents(e)}),(function(){return i._afterEase(e)}),t),this},e.prototype.isEasing=function(){return!!this._easeFrameId},e.prototype.stop=function(){return this._stop()},e.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var i=this._onEaseEnd;delete this._onEaseEnd,i.call(this,e)}if(!t){var r=this.handlers;r&&r.stop(!1)}return this},e.prototype._ease=function(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=U.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},e.prototype._renderFrameCallback=function(){var t=Math.min((U.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},e.prototype._normalizeBearing=function(t,e){t=h(t,-180,180);var i=Math.abs(t-e);return Math.abs(t-360-e)<i&&(t-=360),Math.abs(t+360-e)<i&&(t+=360),t},e.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0}},e}(qt),dm=function(t){void 0===t&&(t={}),this.options=t,b(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};dm.prototype.getDefaultPosition=function(){return"bottom-right"},dm.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=j.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=j.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=j.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},dm.prototype.onRemove=function(){j.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},dm.prototype._setElementTitle=function(t,e){var i=this._map._getUIString("AttributionControl."+e);t.title=i,t.setAttribute("aria-label",i)},dm.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},dm.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||Q.ACCESS_TOKEN}];if(t){var i=e.reduce((function(t,i,r){return i.value&&(t+=i.key+"="+i.value+(r<e.length-1?"&":"")),t}),"?");t.href=Q.FEEDBACK_URL+"/"+i+(this._map._hash?this._map._hash.getHashString(!0):""),t.rel="noopener nofollow",this._setElementTitle(t,"MapFeedback")}},dm.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},dm.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var i=this._map.style.sourceCaches;for(var r in i){var n=i[r];if(n.used){var o=n.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,i){for(var r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},dm.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var mm=function(){b(["_updateLogo"],this),b(["_updateCompact"],this)};mm.prototype.onAdd=function(t){this._map=t,this._container=j.create("div","mapboxgl-ctrl");var e=j.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},mm.prototype.onRemove=function(){j.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},mm.prototype.getDefaultPosition=function(){return"bottom-left"},mm.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},mm.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},mm.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var ym=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};ym.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},ym.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,r=e?this._queue.concat(e):this._queue;i<r.length;i+=1){var n=r[i];if(n.id===t)return void(n.cancelled=!0)}},ym.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var i=0,r=e;i<r.length;i+=1){var n=r[i];if(!n.cancelled&&(n.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},ym.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var _m={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},gm=a.HTMLImageElement,vm=a.HTMLElement,xm=a.ImageBitmap,bm={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},wm=function(t){function i(e){var i=this;if(null!=(e=m({},bm,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var r=new gd(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(t.call(this,r,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new ym,this._controls=[],this._mapId=g(),this._locale=m({},_m,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new nt(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=a.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof vm))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),b(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return i._update(!1)})),this.on("moveend",(function(){return i._update(!1)})),this.on("zoom",(function(){return i._update(!0)})),void 0!==a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1),a.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new hm(this,e),this._hash=e.hash&&new xd("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,m({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new dm({customAttribution:e.customAttribution})),this.addControl(new mm,e.logoPosition),this.on("style.load",(function(){i.transform.unmodified&&i.jumpTo(i.style.stylesheet)})),this.on("data",(function(t){i._update("style"===t.dataType),i.fire(new jt(t.dataType+"data",t))})),this.on("dataloading",(function(t){i.fire(new jt(t.dataType+"dataloading",t))}))}t&&(i.__proto__=t),(i.prototype=Object.create(t&&t.prototype)).constructor=i;var r={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,e){if(void 0===e&&(e=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new Nt(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=t.onAdd(this);this._controls.push(t);var r=this._controlPositions[e];return-1!==e.indexOf("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new Nt(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var e=this._controls.indexOf(t);return e>-1&&this._controls.splice(e,1),t.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(t){var e=this._containerDimensions(),i=e[0],r=e[1];if(i===this.transform.width&&r===this.transform.height)return this;this._resizeCanvas(i,r),this.transform.resize(i,r),this.painter.resize(i,r);var n=!this._moving;return n&&this.fire(new jt("movestart",t)).fire(new jt("move",t)),this.fire(new jt("resize",t)),n&&this.fire(new jt("moveend",t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(Jl.convert(t)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(Ql.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(n.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,i){var r,n=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:i,delegates:{mousemove:function(r){var a=n.getLayer(e)?n.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?o||(o=!0,i.call(n,new kd(t,n,r.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:i,delegates:{mousemove:function(r){(n.getLayer(e)?n.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,i.call(n,new kd(t,n,r.originalEvent)))},mouseout:function(e){a&&(a=!1,i.call(n,new kd(t,n,e.originalEvent)))}}}}return{layer:e,listener:i,delegates:(r={},r[t]=function(t){var r=n.getLayer(e)?n.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,i.call(n,t),delete t.features)},r)}},i.prototype.on=function(e,i,r){if(void 0===r)return t.prototype.on.call(this,e,i);var n=this._createDelegatedListener(e,i,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(n),n.delegates)this.on(o,n.delegates[o]);return this},i.prototype.once=function(e,i,r){if(void 0===r)return t.prototype.once.call(this,e,i);var n=this._createDelegatedListener(e,i,r);for(var o in n.delegates)this.once(o,n.delegates[o]);return this},i.prototype.off=function(e,i,r){var n=this;return void 0===r?t.prototype.off.call(this,e,i):(this._delegatedListeners&&this._delegatedListeners[e]&&function(t){for(var o=t[e],a=0;a<o.length;a++){var s=o[a];if(s.layer===i&&s.listener===r){for(var u in s.delegates)n.off(u,s.delegates[u]);return o.splice(a,1),n}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(t,e){if(!this.style)return[];var i;if(void 0!==e||void 0===t||t instanceof n||Array.isArray(t)||(e=t,t=void 0),e=e||{},(t=t||[[0,0],[this.transform.width,this.transform.height]])instanceof n||"number"==typeof t[0])i=[n.convert(t)];else{var r=n.convert(t[0]),o=n.convert(t[1]);i=[r,new n(o.x,r.y),o,new n(r.x,o.y),r]}return this.style.queryRenderedFeatures(i,e,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.prototype.setStyle=function(t,e){return!1!==(e=m({},{localIdeographFontFamily:this._localIdeographFontFamily},e)).diff&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(t,e))},i.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},i.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Oh(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},i.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Oh(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(t,e){var i=this;if("string"==typeof t){var r=this._requestManager.normalizeStyleURL(t),n=this._requestManager.transformRequest(r,Et.Style);Lt(n,(function(t,r){t?i.fire(new Nt(t)):r&&i._updateDiff(r,e)}))}else"object"==typeof t&&this._updateDiff(t,e)},i.prototype._updateDiff=function(t,e){try{this.style.setState(t)&&this._update(!0)}catch(i){z("Unable to perform style diff: "+(i.message||i.error||i)+". Rebuilding the style from scratch."),this._updateStyle(t,e)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():z("There is no style added to the map.")},i.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},i.prototype.isSourceLoaded=function(t){var e=this.style&&this.style.sourceCaches[t];if(void 0!==e)return e.loaded();this.fire(new Nt(new Error("There is no source with ID '"+t+"'")))},i.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var i=t[e]._tiles;for(var r in i){var n=i[r];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,i){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)},i.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},i.prototype.getSource=function(t){return this.style.getSource(t)},i.prototype.addImage=function(t,e,i){void 0===i&&(i={});var r=i.pixelRatio;void 0===r&&(r=1);var n=i.sdf;void 0===n&&(n=!1);var o=i.stretchX,a=i.stretchY,s=i.content;if(this._lazyInitEmptyStyle(),e instanceof gm||xm&&e instanceof xm){var u=U.getImageData(e);this.style.addImage(t,{data:new Ya({width:u.width,height:u.height},u.data),pixelRatio:r,stretchX:o,stretchY:a,content:s,sdf:n,version:0})}else{if(void 0===e.width||void 0===e.height)return this.fire(new Nt(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var l=e;this.style.addImage(t,{data:new Ya({width:e.width,height:e.height},new Uint8Array(e.data)),pixelRatio:r,stretchX:o,stretchY:a,content:s,sdf:n,version:0,userImage:l}),l.onAdd&&l.onAdd(this,t)}},i.prototype.updateImage=function(t,e){var i=this.style.getImage(t);if(!i)return this.fire(new Nt(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var r=e instanceof gm||xm&&e instanceof xm?U.getImageData(e):e,n=r.width,o=r.height,a=r.data;return void 0===n||void 0===o?this.fire(new Nt(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):n!==i.data.width||o!==i.data.height?this.fire(new Nt(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(i.data.replace(a,!(e instanceof gm||xm&&e instanceof xm)),void this.style.updateImage(t,i))},i.prototype.hasImage=function(t){return t?!!this.style.getImage(t):(this.fire(new Nt(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(t){this.style.removeImage(t)},i.prototype.loadImage=function(t,e){Ot(this._requestManager.transformRequest(t,Et.Image),e)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},i.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},i.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},i.prototype.getLayer=function(t){return this.style.getLayer(t)},i.prototype.setLayerZoomRange=function(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)},i.prototype.setFilter=function(t,e,i){return void 0===i&&(i={}),this.style.setFilter(t,e,i),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,i,r){return void 0===r&&(r={}),this.style.setPaintProperty(t,e,i,r),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,i,r){return void 0===r&&(r={}),this.style.setLayoutProperty(t,e,i,r),this._update(!0)},i.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},i.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},i.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},i.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},i.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==a.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&z("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},i.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=j.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=j.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=j.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);var r=this._controlContainer=j.create("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){n[t]=j.create("div","mapboxgl-ctrl-"+t,r)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},i.prototype._resizeCanvas=function(t,e){var i=U.devicePixelRatio||1;this._canvas.width=i*t,this._canvas.height=i*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},i.prototype._setupPainter=function(){var t=m({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);i?(this.painter=new dd(i,this.transform),$.testSupport(i)):this.fire(new Nt(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new jt("webglcontextlost",{originalEvent:t}))},i.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire(new jt("webglcontextrestored",{originalEvent:t}))},i.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},i.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},i.prototype._render=function(t){var e,i=this,r=0,n=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(e=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,e),r=U.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),!this._removed){var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var a=this.transform.zoom,s=U.now();this.style.zoomHistory.update(a,s);var u=new kn(a,{now:s,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),l=u.crossFadingFactor();1===l&&l===this._crossFadingFactor||(o=!0,this._crossFadingFactor=l),this.style.update(u)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new jt("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new jt("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var c=U.now()-r;n.endQueryEXT(n.TIME_ELAPSED_EXT,e),setTimeout((function(){var t=n.getQueryObjectEXT(e,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(e),i.fire(new jt("gpu-timing-frame",{cpuTime:c,gpuTime:t}))}),50)}if(this.listens("gpu-timing-layer")){var p=this.painter.collectGpuTimers();setTimeout((function(){var t=i.painter.queryGpuTimers(p);i.fire(new jt("gpu-timing-layer",{layerTimes:t}))}),50)}var h=this._sourcesDirty||this._styleDirty||this._placementDirty;return h||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new jt("idle")),!this._loaded||this._fullyLoaded||h||(this._fullyLoaded=!0),this}},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var t=0,e=this._controls;t<e.length;t+=1)e[t].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==a&&(a.removeEventListener("resize",this._onWindowResize,!1),a.removeEventListener("orientationchange",this._onWindowResize,!1),a.removeEventListener("online",this._onWindowOnline,!1));var i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),Im(this._canvasContainer),Im(this._controlContainer),Im(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new jt("remove"))},i.prototype.triggerRepaint=function(){var t=this;this.style&&!this._frame&&(this._frame=U.frame((function(e){t._frame=null,t._render(e)})))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},r.showTileBoundaries.get=function(){return!!this._showTileBoundaries},r.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},r.showPadding.get=function(){return!!this._showPadding},r.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},r.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},r.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},r.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},r.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},r.repaint.get=function(){return!!this._repaint},r.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},r.vertices.get=function(){return!!this._vertices},r.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(t,e){!function(t,e){xt=t,bt=e}(t,e)},r.version.get=function(){return"1.13.2"},Object.defineProperties(i.prototype,r),i}(fm);function Im(t){t.parentNode&&t.parentNode.removeChild(t)}var Sm={showCompass:!0,showZoom:!0,visualizePitch:!1},Tm=function(t){var e=this;this.options=m({},Sm,t),this._container=j.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(b(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return e._map.zoomIn({},{originalEvent:t})})),j.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return e._map.zoomOut({},{originalEvent:t})})),j.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(b(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){e.options.visualizePitch?e._map.resetNorthPitch({},{originalEvent:t}):e._map.resetNorth({},{originalEvent:t})})),this._compassIcon=j.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Tm.prototype._updateZoomButtons=function(){var t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},Tm.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Tm.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Am(this._map,this._compass,this.options.visualizePitch)),this._container},Tm.prototype.onRemove=function(){j.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Tm.prototype._createButton=function(t,e){var i=j.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i},Tm.prototype._setButtonTitle=function(t,e){var i=this._map._getUIString("NavigationControl."+e);t.title=i,t.setAttribute("aria-label",i)};var Am=function(t,e,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=e,this.mouseRotate=new Nd({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,i&&(this.mousePitch=new qd({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),b(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),j.addEventListener(e,"mousedown",this.mousedown),j.addEventListener(e,"touchstart",this.touchstart,{passive:!1}),j.addEventListener(e,"touchmove",this.touchmove),j.addEventListener(e,"touchend",this.touchend),j.addEventListener(e,"touchcancel",this.reset)};function zm(t,e,i){if(t=new Ql(t.lng,t.lat),e){var r=new Ql(t.lng-360,t.lat),n=new Ql(t.lng+360,t.lat),o=i.locationPoint(t).distSqr(e);i.locationPoint(r).distSqr(e)<o?t=r:i.locationPoint(n).distSqr(e)<o&&(t=n)}for(;Math.abs(t.lng-i.center.lng)>180;){var a=i.locationPoint(t);if(a.x>=0&&a.y>=0&&a.x<=i.width&&a.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t}Am.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),j.disableDrag()},Am.prototype.move=function(t,e){var i=this.map,r=this.mouseRotate.mousemoveWindow(t,e);if(r&&r.bearingDelta&&i.setBearing(i.getBearing()+r.bearingDelta),this.mousePitch){var n=this.mousePitch.mousemoveWindow(t,e);n&&n.pitchDelta&&i.setPitch(i.getPitch()+n.pitchDelta)}},Am.prototype.off=function(){var t=this.element;j.removeEventListener(t,"mousedown",this.mousedown),j.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),j.removeEventListener(t,"touchmove",this.touchmove),j.removeEventListener(t,"touchend",this.touchend),j.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Am.prototype.offTemp=function(){j.enableDrag(),j.removeEventListener(a,"mousemove",this.mousemove),j.removeEventListener(a,"mouseup",this.mouseup)},Am.prototype.mousedown=function(t){this.down(m({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),j.mousePos(this.element,t)),j.addEventListener(a,"mousemove",this.mousemove),j.addEventListener(a,"mouseup",this.mouseup)},Am.prototype.mousemove=function(t){this.move(t,j.mousePos(this.element,t))},Am.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Am.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=j.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Am.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=j.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Am.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Am.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Em={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function km(t,e,i){var r=t.classList;for(var n in Em)r.remove("mapboxgl-"+i+"-anchor-"+n);r.add("mapboxgl-"+i+"-anchor-"+e)}var Cm,Pm=function(t){function e(e,i){if(t.call(this),(e instanceof a.HTMLElement||i)&&(e=m({element:e},i)),b(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,e&&e.element)this._element=e.element,this._offset=n.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=j.create("div"),this._element.setAttribute("aria-label","Map marker");var r=j.createNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height","41px"),r.setAttributeNS(null,"width","27px"),r.setAttributeNS(null,"viewBox","0 0 27 41");var o=j.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var s=j.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var u=j.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(3.0, 29.0)"),u.setAttributeNS(null,"fill","#000000");for(var l=0,c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];l<c.length;l+=1){var p=c[l],h=j.createNS("http://www.w3.org/2000/svg","ellipse");h.setAttributeNS(null,"opacity","0.04"),h.setAttributeNS(null,"cx","10.5"),h.setAttributeNS(null,"cy","5.80029008"),h.setAttributeNS(null,"rx",p.rx),h.setAttributeNS(null,"ry",p.ry),u.appendChild(h)}var f=j.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill",this._color);var d=j.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),f.appendChild(d);var y=j.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"opacity","0.25"),y.setAttributeNS(null,"fill","#000000");var _=j.createNS("http://www.w3.org/2000/svg","path");_.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),y.appendChild(_);var g=j.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(6.0, 7.0)"),g.setAttributeNS(null,"fill","#FFFFFF");var v=j.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=j.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var w=j.createNS("http://www.w3.org/2000/svg","circle");w.setAttributeNS(null,"fill","#FFFFFF"),w.setAttributeNS(null,"cx","5.5"),w.setAttributeNS(null,"cy","5.5"),w.setAttributeNS(null,"r","5.4999962"),v.appendChild(x),v.appendChild(w),s.appendChild(u),s.appendChild(f),s.appendChild(y),s.appendChild(g),s.appendChild(v),r.appendChild(s),r.setAttributeNS(null,"height",41*this._scale+"px"),r.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(r),this._offset=n.convert(e&&e.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),km(this._element,this._anchor,"marker"),this._popup=null}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},e.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),j.remove(this._element),this._popup&&this._popup.remove(),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=Ql.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},e.prototype.getElement=function(){return this._element},e.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},e.prototype._onKeyPress=function(t){var e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},e.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},e.prototype.getPopup=function(){return this._popup},e.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},e.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=zm(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),j.setTransform(this._element,Em[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+i+" "+e)}},e.prototype.getOffset=function(){return this._offset},e.prototype.setOffset=function(t){return this._offset=n.convert(t),this._update(),this},e.prototype._onMove=function(t){if(!this._isDragging){var e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new jt("dragstart"))),this.fire(new jt("drag")))},e.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new jt("dragend")),this._state="inactive"},e.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},e.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},e.prototype.isDraggable=function(){return this._draggable},e.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},e.prototype.getRotation=function(){return this._rotation},e.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},e.prototype.getRotationAlignment=function(){return this._rotationAlignment},e.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},e.prototype.getPitchAlignment=function(){return this._pitchAlignment},e}(qt),Dm={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Mm=0,Lm=!1,Bm=function(t){function e(e){t.call(this),this.options=m({},Dm,e),b(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.onAdd=function(t){var e;return this._map=t,this._container=j.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),e=this._setupUI,void 0!==Cm?e(Cm):void 0!==a.navigator.permissions?a.navigator.permissions.query({name:"geolocation"}).then((function(t){e(Cm="denied"!==t.state)})):e(Cm=!!a.navigator.geolocation),this._container},e.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(a.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),j.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Mm=0,Lm=!1},e.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())},e.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},e.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new jt("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new jt("geolocate",t)),this._finish()}},e.prototype._updateCamera=function(t){var e=new Ql(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,r=m({bearing:this._map.getBearing()},this.options.fitBoundsOptions);this._map.fitBounds(e.toBounds(i),r,{geolocateSource:!0})},e.prototype._updateMarker=function(t){if(t){var e=new Ql(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(e).addTo(this._map),this._userLocationDotMarker.setLngLat(e).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},e.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([1,t]),r=e.distanceTo(i),n=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=n+"px",this._circleElement.style.height=n+"px"},e.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},e.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Lm)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new jt("error",t)),this._finish()}},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){var e=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=j.create("button","mapboxgl-ctrl-geolocate",this._container),j.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){z("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=j.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Pm(this._dotElement),this._circleElement=j.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Pm({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){t.geolocateSource||"ACTIVE_LOCK"!==e._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(e._watchState="BACKGROUND",e._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),e._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),e.fire(new jt("trackuserlocationend")))}))},e.prototype.trigger=function(){if(!this._setup)return z("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new jt("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Mm--,Lm=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new jt("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new jt("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Mm>1?(t={maximumAge:6e5,timeout:0},Lm=!0):(t=this.options.positionOptions,Lm=!1),this._geolocationWatchID=a.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else a.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},e.prototype._clearWatch=function(){a.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},e}(qt),Rm={maxWidth:100,unit:"metric"},Fm=function(t){this.options=m({},Rm,t),b(["_onMove","setUnit"],this)};function Om(t,e,i){var r=i&&i.maxWidth||100,n=t._container.clientHeight/2,o=t.unproject([0,n]),a=t.unproject([r,n]),s=o.distanceTo(a);if(i&&"imperial"===i.unit){var u=3.2808*s;u>5280?Vm(e,r,u/5280,t._getUIString("ScaleControl.Miles")):Vm(e,r,u,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?Vm(e,r,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Vm(e,r,s/1e3,t._getUIString("ScaleControl.Kilometers")):Vm(e,r,s,t._getUIString("ScaleControl.Meters"))}function Vm(t,e,i,r){var n,o,a,s=(n=i,(o=Math.pow(10,(""+Math.floor(n)).length-1))*(a=(a=n/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/i)+"px",t.innerHTML=s+" "+r}Fm.prototype.getDefaultPosition=function(){return"bottom-left"},Fm.prototype._onMove=function(){Om(this._map,this._container,this.options)},Fm.prototype.onAdd=function(t){return this._map=t,this._container=j.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Fm.prototype.onRemove=function(){j.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Fm.prototype.setUnit=function(t){this.options.unit=t,Om(this._map,this._container,this.options)};var Um=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof a.HTMLElement?this._container=t.container:z("Full screen control 'container' must be a DOM element.")),b(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in a.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in a.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in a.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in a.document&&(this._fullscreenchange="MSFullscreenChange")};Um.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=j.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",z("This device does not support fullscreen mode.")),this._controlContainer},Um.prototype.onRemove=function(){j.remove(this._controlContainer),this._map=null,a.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Um.prototype._checkFullscreenSupport=function(){return!!(a.document.fullscreenEnabled||a.document.mozFullScreenEnabled||a.document.msFullscreenEnabled||a.document.webkitFullscreenEnabled)},Um.prototype._setupUI=function(){var t=this._fullscreenButton=j.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);j.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),a.document.addEventListener(this._fullscreenchange,this._changeIcon)},Um.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Um.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Um.prototype._isFullscreen=function(){return this._fullscreen},Um.prototype._changeIcon=function(){(a.document.fullscreenElement||a.document.mozFullScreenElement||a.document.webkitFullscreenElement||a.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Um.prototype._onClickFullscreen=function(){this._isFullscreen()?a.document.exitFullscreen?a.document.exitFullscreen():a.document.mozCancelFullScreen?a.document.mozCancelFullScreen():a.document.msExitFullscreen?a.document.msExitFullscreen():a.document.webkitCancelFullScreen&&a.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var jm={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Nm=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),qm=function(t){function e(e){t.call(this),this.options=m(Object.create(jm),e),b(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new jt("open")),this},e.prototype.isOpen=function(){return!!this._map},e.prototype.remove=function(){return this._content&&j.remove(this._content),this._container&&(j.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new jt("close")),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=Ql.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},e.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},e.prototype.getElement=function(){return this._container},e.prototype.setText=function(t){return this.setDOMContent(a.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,i=a.document.createDocumentFragment(),r=a.document.createElement("body");for(r.innerHTML=t;e=r.firstChild;)i.appendChild(e);return this.setDOMContent(i)},e.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},e.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},e.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=j.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},e.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},e.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},e.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},e.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},e.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=j.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},e.prototype._onMouseUp=function(t){this._update(t.point)},e.prototype._onMouseMove=function(t){this._update(t.point)},e.prototype._onDrag=function(t){this._update(t.point)},e.prototype._update=function(t){var e=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=j.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=j.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return e._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=zm(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),r=this.options.anchor,o=function t(e){if(e){if("number"==typeof e){var i=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new n(0,0),top:new n(0,e),"top-left":new n(i,i),"top-right":new n(-i,i),bottom:new n(0,-e),"bottom-left":new n(i,-i),"bottom-right":new n(-i,-i),left:new n(e,0),right:new n(-e,0)}}if(e instanceof n||Array.isArray(e)){var r=n.convert(e);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:n.convert(e.center||[0,0]),top:n.convert(e.top||[0,0]),"top-left":n.convert(e["top-left"]||[0,0]),"top-right":n.convert(e["top-right"]||[0,0]),bottom:n.convert(e.bottom||[0,0]),"bottom-left":n.convert(e["bottom-left"]||[0,0]),"bottom-right":n.convert(e["bottom-right"]||[0,0]),left:n.convert(e.left||[0,0]),right:n.convert(e.right||[0,0])}}return t(new n(0,0))}(this.options.offset);if(!r){var a,s=this._container.offsetWidth,u=this._container.offsetHeight;a=i.y+o.bottom.y<u?["top"]:i.y>this._map.transform.height-u?["bottom"]:[],i.x<s/2?a.push("left"):i.x>this._map.transform.width-s/2&&a.push("right"),r=0===a.length?"bottom":a.join("-")}var l=i.add(o[r]).round();j.setTransform(this._container,Em[r]+" translate("+l.x+"px,"+l.y+"px)"),km(this._container,r,"popup")}},e.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Nm);t&&t.focus()}},e.prototype._onClose=function(){this.remove()},e}(qt),Zm={version:"1.13.2",supported:e,setRTLTextPlugin:function(t,e,i){if(void 0===i&&(i=!1),"deferred"===bn||"loading"===bn||"loaded"===bn)throw new Error("setRTLTextPlugin cannot be called multiple times.");wn=U.resolveURL(t),bn="deferred",xn=e,Sn(),i||zn()},getRTLTextPluginStatus:An,Map:wm,NavigationControl:Tm,GeolocateControl:Bm,AttributionControl:dm,ScaleControl:Fm,FullscreenControl:Um,Popup:qm,Marker:Pm,Style:Oh,LngLat:Ql,LngLatBounds:Jl,Point:n,MercatorCoordinate:oc,Evented:qt,config:Q,prewarm:function(){Mp().acquire(kp)},clearPrewarmedResources:function(){var t=Pp;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(kp),Pp=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return Q.ACCESS_TOKEN},set accessToken(t){Q.ACCESS_TOKEN=t},get baseApiUrl(){return Q.API_URL},set baseApiUrl(t){Q.API_URL=t},get workerCount(){return Cp.workerCount},set workerCount(t){Cp.workerCount=t},get maxParallelImageRequests(){return Q.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){Q.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){!function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))}(t)},workerUrl:""};return Zm}));
|
|
2
|
+
//# sourceMappingURL=mapbox-gl-csp.js.map
|