@mapgis/mapbox-gl 16.0.0 → 16.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/dist/mapbox-gl.js +4 -4
  2. package/dist/mapbox-gl.js.map +1 -1
  3. package/package.json +4 -5
  4. package/.flowconfig +0 -61
  5. package/LICENSE.txt +0 -84
  6. package/README.md +0 -34
  7. package/build/banner.js +0 -4
  8. package/build/check-bundle-size.js +0 -140
  9. package/build/generate-access-token-script.js +0 -11
  10. package/build/generate-flow-typed-style-spec.js +0 -188
  11. package/build/generate-release-list.js +0 -21
  12. package/build/generate-struct-arrays.js +0 -237
  13. package/build/generate-style-code.js +0 -159
  14. package/build/mapbox-gl.js.flow +0 -3
  15. package/build/print-release-url.js +0 -6
  16. package/build/rollup_plugin_minify_style_spec.js +0 -20
  17. package/build/rollup_plugins.js +0 -80
  18. package/build/run-node +0 -3
  19. package/build/run-tap +0 -8
  20. package/build/test/build-tape.js +0 -19
  21. package/dist/mapbox-gl-csp-worker.js +0 -2
  22. package/dist/mapbox-gl-csp-worker.js.map +0 -1
  23. package/dist/mapbox-gl-csp.js +0 -2
  24. package/dist/mapbox-gl-csp.js.map +0 -1
  25. package/dist/mapbox-gl-dev.js +0 -68798
  26. package/dist/mapbox-gl-unminified.js +0 -45076
  27. package/dist/mapbox-gl-unminified.js.map +0 -1
  28. package/flow-typed/gl.js +0 -5
  29. package/flow-typed/jsdom.js +0 -18
  30. package/flow-typed/mapbox-gl-supported.js +0 -9
  31. package/flow-typed/mapbox-unitbezier.js +0 -14
  32. package/flow-typed/offscreen-canvas.js +0 -9
  33. package/flow-typed/pbf.js +0 -25
  34. package/flow-typed/point-geometry.js +0 -44
  35. package/flow-typed/potpack.js +0 -12
  36. package/flow-typed/sinon.js +0 -28
  37. package/flow-typed/vector-tile.js +0 -41
  38. package/src/css/mapbox-gl.css +0 -798
  39. package/src/css/svg/mapboxgl-ctrl-attrib.svg +0 -3
  40. package/src/css/svg/mapboxgl-ctrl-compass.svg +0 -4
  41. package/src/css/svg/mapboxgl-ctrl-fullscreen.svg +0 -3
  42. package/src/css/svg/mapboxgl-ctrl-geolocate.svg +0 -5
  43. package/src/css/svg/mapboxgl-ctrl-logo.svg +0 -20
  44. package/src/css/svg/mapboxgl-ctrl-shrink.svg +0 -3
  45. package/src/css/svg/mapboxgl-ctrl-zoom-in.svg +0 -3
  46. package/src/css/svg/mapboxgl-ctrl-zoom-out.svg +0 -3
  47. package/src/data/array_types.js +0 -1095
  48. package/src/data/bucket/circle_attributes.js +0 -9
  49. package/src/data/bucket/circle_bucket.js +0 -204
  50. package/src/data/bucket/fill_attributes.js +0 -9
  51. package/src/data/bucket/fill_bucket.js +0 -233
  52. package/src/data/bucket/fill_extrusion_attributes.js +0 -10
  53. package/src/data/bucket/fill_extrusion_bucket.js +0 -289
  54. package/src/data/bucket/heatmap_bucket.js +0 -17
  55. package/src/data/bucket/line_attributes.js +0 -10
  56. package/src/data/bucket/line_bucket.js +0 -556
  57. package/src/data/bucket/pattern_attributes.js +0 -10
  58. package/src/data/bucket/pattern_bucket_features.js +0 -60
  59. package/src/data/bucket/symbol_attributes.js +0 -117
  60. package/src/data/bucket/symbol_bucket.js +0 -972
  61. package/src/data/bucket.js +0 -123
  62. package/src/data/dem_data.js +0 -125
  63. package/src/data/extent.js +0 -18
  64. package/src/data/feature_index.js +0 -321
  65. package/src/data/feature_position_map.js +0 -125
  66. package/src/data/index_array_type.js +0 -16
  67. package/src/data/load_geometry.js +0 -48
  68. package/src/data/pos_attributes.js +0 -6
  69. package/src/data/program_configuration.js +0 -687
  70. package/src/data/raster_bounds_attributes.js +0 -7
  71. package/src/data/segment.js +0 -76
  72. package/src/geo/edge_insets.js +0 -102
  73. package/src/geo/lng_lat.js +0 -165
  74. package/src/geo/lng_lat_bounds.js +0 -267
  75. package/src/geo/mercator_coordinate.js +0 -153
  76. package/src/geo/transform.js +0 -864
  77. package/src/gl/color_mode.js +0 -34
  78. package/src/gl/context.js +0 -298
  79. package/src/gl/cull_face_mode.js +0 -26
  80. package/src/gl/depth_mode.js +0 -29
  81. package/src/gl/framebuffer.js +0 -44
  82. package/src/gl/index_buffer.js +0 -55
  83. package/src/gl/stencil_mode.js +0 -30
  84. package/src/gl/types.js +0 -84
  85. package/src/gl/value.js +0 -520
  86. package/src/gl/vertex_buffer.js +0 -119
  87. package/src/index.js +0 -201
  88. package/src/render/draw_background.js +0 -57
  89. package/src/render/draw_circle.js +0 -113
  90. package/src/render/draw_collision_debug.js +0 -49
  91. package/src/render/draw_custom.js +0 -49
  92. package/src/render/draw_debug.js +0 -127
  93. package/src/render/draw_fill.js +0 -126
  94. package/src/render/draw_fill_extrusion.js +0 -96
  95. package/src/render/draw_heatmap.js +0 -140
  96. package/src/render/draw_hillshade.js +0 -108
  97. package/src/render/draw_line.js +0 -98
  98. package/src/render/draw_raster.js +0 -125
  99. package/src/render/draw_symbol.js +0 -394
  100. package/src/render/glyph_atlas.js +0 -71
  101. package/src/render/glyph_manager.js +0 -182
  102. package/src/render/image_atlas.js +0 -149
  103. package/src/render/image_manager.js +0 -306
  104. package/src/render/line_atlas.js +0 -210
  105. package/src/render/painter.js +0 -653
  106. package/src/render/program/background_program.js +0 -103
  107. package/src/render/program/circle_program.js +0 -69
  108. package/src/render/program/clipping_mask_program.js +0 -20
  109. package/src/render/program/collision_program.js +0 -49
  110. package/src/render/program/debug_program.js +0 -35
  111. package/src/render/program/fill_extrusion_program.js +0 -122
  112. package/src/render/program/fill_program.js +0 -126
  113. package/src/render/program/heatmap_program.js +0 -83
  114. package/src/render/program/hillshade_program.js +0 -122
  115. package/src/render/program/line_program.js +0 -207
  116. package/src/render/program/pattern.js +0 -102
  117. package/src/render/program/program_uniforms.js +0 -42
  118. package/src/render/program/raster_program.js +0 -92
  119. package/src/render/program/symbol_program.js +0 -224
  120. package/src/render/program.js +0 -168
  121. package/src/render/texture.js +0 -122
  122. package/src/render/uniform_binding.js +0 -147
  123. package/src/render/vertex_array_object.js +0 -163
  124. package/src/shaders/README.md +0 -42
  125. package/src/shaders/_prelude.fragment.glsl +0 -17
  126. package/src/shaders/_prelude.vertex.glsl +0 -73
  127. package/src/shaders/background.fragment.glsl +0 -10
  128. package/src/shaders/background.vertex.glsl +0 -7
  129. package/src/shaders/background_pattern.fragment.glsl +0 -28
  130. package/src/shaders/background_pattern.vertex.glsl +0 -20
  131. package/src/shaders/circle.fragment.glsl +0 -39
  132. package/src/shaders/circle.vertex.glsl +0 -64
  133. package/src/shaders/clipping_mask.fragment.glsl +0 -3
  134. package/src/shaders/clipping_mask.vertex.glsl +0 -7
  135. package/src/shaders/collision_box.fragment.glsl +0 -21
  136. package/src/shaders/collision_box.vertex.glsl +0 -27
  137. package/src/shaders/collision_circle.fragment.glsl +0 -34
  138. package/src/shaders/collision_circle.vertex.glsl +0 -36
  139. package/src/shaders/debug.fragment.glsl +0 -9
  140. package/src/shaders/debug.vertex.glsl +0 -12
  141. package/src/shaders/encode_attribute.js +0 -17
  142. package/src/shaders/fill.fragment.glsl +0 -13
  143. package/src/shaders/fill.vertex.glsl +0 -13
  144. package/src/shaders/fill_extrusion.fragment.glsl +0 -9
  145. package/src/shaders/fill_extrusion.vertex.glsl +0 -66
  146. package/src/shaders/fill_extrusion_pattern.fragment.glsl +0 -45
  147. package/src/shaders/fill_extrusion_pattern.vertex.glsl +0 -79
  148. package/src/shaders/fill_outline.fragment.glsl +0 -17
  149. package/src/shaders/fill_outline.vertex.glsl +0 -17
  150. package/src/shaders/fill_outline_pattern.fragment.glsl +0 -43
  151. package/src/shaders/fill_outline_pattern.vertex.glsl +0 -44
  152. package/src/shaders/fill_pattern.fragment.glsl +0 -36
  153. package/src/shaders/fill_pattern.vertex.glsl +0 -39
  154. package/src/shaders/heatmap.fragment.glsl +0 -22
  155. package/src/shaders/heatmap.vertex.glsl +0 -54
  156. package/src/shaders/heatmap_texture.fragment.glsl +0 -14
  157. package/src/shaders/heatmap_texture.vertex.glsl +0 -11
  158. package/src/shaders/hillshade.fragment.glsl +0 -52
  159. package/src/shaders/hillshade.vertex.glsl +0 -11
  160. package/src/shaders/hillshade_prepare.fragment.glsl +0 -74
  161. package/src/shaders/hillshade_prepare.vertex.glsl +0 -15
  162. package/src/shaders/index.js +0 -20
  163. package/src/shaders/line.fragment.glsl +0 -30
  164. package/src/shaders/line.vertex.glsl +0 -85
  165. package/src/shaders/line_gradient.fragment.glsl +0 -34
  166. package/src/shaders/line_gradient.vertex.glsl +0 -87
  167. package/src/shaders/line_pattern.fragment.glsl +0 -74
  168. package/src/shaders/line_pattern.vertex.glsl +0 -99
  169. package/src/shaders/line_sdf.fragment.glsl +0 -45
  170. package/src/shaders/line_sdf.vertex.glsl +0 -98
  171. package/src/shaders/raster.fragment.glsl +0 -52
  172. package/src/shaders/raster.vertex.glsl +0 -21
  173. package/src/shaders/shaders.js +0 -180
  174. package/src/shaders/symbol_icon.fragment.glsl +0 -17
  175. package/src/shaders/symbol_icon.vertex.glsl +0 -94
  176. package/src/shaders/symbol_sdf.fragment.glsl +0 -52
  177. package/src/shaders/symbol_sdf.vertex.glsl +0 -115
  178. package/src/shaders/symbol_text_and_icon.fragment.glsl +0 -68
  179. package/src/shaders/symbol_text_and_icon.vertex.glsl +0 -116
  180. package/src/source/canvas_source.js +0 -238
  181. package/src/source/geojson_helper.js +0 -92
  182. package/src/source/geojson_source.js +0 -374
  183. package/src/source/geojson_worker_source.js +0 -357
  184. package/src/source/geojson_wrapper.js +0 -94
  185. package/src/source/image_source.js +0 -307
  186. package/src/source/load_tilejson.js +0 -39
  187. package/src/source/mbtiles_source.js +0 -115
  188. package/src/source/offline_database.js +0 -61
  189. package/src/source/offline_database_root.js +0 -62
  190. package/src/source/pixels_to_tile_units.js +0 -21
  191. package/src/source/query_features.js +0 -208
  192. package/src/source/raster_dem_tile_source.js +0 -138
  193. package/src/source/raster_dem_tile_worker_source.js +0 -62
  194. package/src/source/raster_tile_offline_source.js +0 -136
  195. package/src/source/raster_tile_source.js +0 -177
  196. package/src/source/rtl_text_plugin.js +0 -138
  197. package/src/source/source.js +0 -137
  198. package/src/source/source_cache.js +0 -957
  199. package/src/source/source_state.js +0 -159
  200. package/src/source/tile.js +0 -465
  201. package/src/source/tile_bounds.js +0 -38
  202. package/src/source/tile_cache.js +0 -212
  203. package/src/source/tile_id.js +0 -402
  204. package/src/source/vector_tile_source.js +0 -192
  205. package/src/source/vector_tile_worker_source.js +0 -216
  206. package/src/source/video_source.js +0 -203
  207. package/src/source/worker.js +0 -237
  208. package/src/source/worker_source.js +0 -106
  209. package/src/source/worker_tile.js +0 -224
  210. package/src/style/create_style_layer.js +0 -36
  211. package/src/style/evaluation_parameters.js +0 -62
  212. package/src/style/light.js +0 -130
  213. package/src/style/load_glyph_range.js +0 -38
  214. package/src/style/load_sprite.js +0 -67
  215. package/src/style/parse_glyph_pbf.js +0 -44
  216. package/src/style/pauseable_placement.js +0 -132
  217. package/src/style/properties.js +0 -753
  218. package/src/style/query_utils.js +0 -43
  219. package/src/style/style.js +0 -1361
  220. package/src/style/style_glyph.js +0 -17
  221. package/src/style/style_image.js +0 -137
  222. package/src/style/style_layer/background_style_layer.js +0 -21
  223. package/src/style/style_layer/background_style_layer_properties.js +0 -40
  224. package/src/style/style_layer/circle_style_layer.js +0 -98
  225. package/src/style/style_layer/circle_style_layer_properties.js +0 -63
  226. package/src/style/style_layer/custom_style_layer.js +0 -223
  227. package/src/style/style_layer/fill_extrusion_style_layer.js +0 -224
  228. package/src/style/style_layer/fill_extrusion_style_layer_properties.js +0 -50
  229. package/src/style/style_layer/fill_style_layer.js +0 -67
  230. package/src/style/style_layer/fill_style_layer_properties.js +0 -55
  231. package/src/style/style_layer/heatmap_style_layer.js +0 -69
  232. package/src/style/style_layer/heatmap_style_layer_properties.js +0 -44
  233. package/src/style/style_layer/hillshade_style_layer.js +0 -25
  234. package/src/style/style_layer/hillshade_style_layer_properties.js +0 -46
  235. package/src/style/style_layer/layer_properties.js.ejs +0 -69
  236. package/src/style/style_layer/line_style_layer.js +0 -151
  237. package/src/style/style_layer/line_style_layer_properties.js +0 -71
  238. package/src/style/style_layer/raster_style_layer.js +0 -21
  239. package/src/style/style_layer/raster_style_layer_properties.js +0 -50
  240. package/src/style/style_layer/symbol_style_layer.js +0 -190
  241. package/src/style/style_layer/symbol_style_layer_properties.js +0 -153
  242. package/src/style/style_layer/typed_style_layer.js +0 -17
  243. package/src/style/style_layer.js +0 -281
  244. package/src/style/style_layer_index.js +0 -80
  245. package/src/style/validate_style.js +0 -42
  246. package/src/style/zoom_history.js +0 -44
  247. package/src/style-spec/.eslintrc +0 -5
  248. package/src/style-spec/CHANGELOG.md +0 -438
  249. package/src/style-spec/README.md +0 -59
  250. package/src/style-spec/bin/gl-style-composite +0 -9
  251. package/src/style-spec/bin/gl-style-format +0 -22
  252. package/src/style-spec/bin/gl-style-migrate +0 -9
  253. package/src/style-spec/bin/gl-style-validate +0 -50
  254. package/src/style-spec/composite.js +0 -50
  255. package/src/style-spec/declass.js +0 -42
  256. package/src/style-spec/deref.js +0 -52
  257. package/src/style-spec/diff.js +0 -393
  258. package/src/style-spec/dist/.gitkeep +0 -0
  259. package/src/style-spec/empty.js +0 -29
  260. package/src/style-spec/error/parsing_error.js +0 -16
  261. package/src/style-spec/error/validation_error.js +0 -18
  262. package/src/style-spec/expression/compound_expression.js +0 -162
  263. package/src/style-spec/expression/definitions/assertion.js +0 -130
  264. package/src/style-spec/expression/definitions/at.js +0 -70
  265. package/src/style-spec/expression/definitions/case.js +0 -85
  266. package/src/style-spec/expression/definitions/coalesce.js +0 -93
  267. package/src/style-spec/expression/definitions/coercion.js +0 -133
  268. package/src/style-spec/expression/definitions/collator.js +0 -78
  269. package/src/style-spec/expression/definitions/comparison.js +0 -184
  270. package/src/style-spec/expression/definitions/format.js +0 -144
  271. package/src/style-spec/expression/definitions/format_section_override.js +0 -54
  272. package/src/style-spec/expression/definitions/image.js +0 -52
  273. package/src/style-spec/expression/definitions/in.js +0 -92
  274. package/src/style-spec/expression/definitions/index.js +0 -561
  275. package/src/style-spec/expression/definitions/interpolate.js +0 -267
  276. package/src/style-spec/expression/definitions/length.js +0 -61
  277. package/src/style-spec/expression/definitions/let.js +0 -72
  278. package/src/style-spec/expression/definitions/literal.js +0 -77
  279. package/src/style-spec/expression/definitions/match.js +0 -158
  280. package/src/style-spec/expression/definitions/number_format.js +0 -142
  281. package/src/style-spec/expression/definitions/step.js +0 -120
  282. package/src/style-spec/expression/definitions/var.js +0 -46
  283. package/src/style-spec/expression/definitions/within.js +0 -333
  284. package/src/style-spec/expression/evaluation_context.js +0 -59
  285. package/src/style-spec/expression/expression.js +0 -27
  286. package/src/style-spec/expression/index.js +0 -392
  287. package/src/style-spec/expression/is_constant.js +0 -59
  288. package/src/style-spec/expression/parsing_context.js +0 -233
  289. package/src/style-spec/expression/parsing_error.js +0 -13
  290. package/src/style-spec/expression/runtime_error.js +0 -17
  291. package/src/style-spec/expression/scope.js +0 -36
  292. package/src/style-spec/expression/stops.js +0 -39
  293. package/src/style-spec/expression/types/collator.js +0 -61
  294. package/src/style-spec/expression/types/formatted.js +0 -73
  295. package/src/style-spec/expression/types/resolved_image.js +0 -29
  296. package/src/style-spec/expression/types.js +0 -106
  297. package/src/style-spec/expression/values.js +0 -123
  298. package/src/style-spec/feature_filter/README.md +0 -55
  299. package/src/style-spec/feature_filter/convert.js +0 -208
  300. package/src/style-spec/feature_filter/index.js +0 -165
  301. package/src/style-spec/format.js +0 -51
  302. package/src/style-spec/function/convert.js +0 -254
  303. package/src/style-spec/function/index.js +0 -262
  304. package/src/style-spec/group_by_layout.js +0 -75
  305. package/src/style-spec/migrate/expressions.js +0 -39
  306. package/src/style-spec/migrate/v8.js +0 -203
  307. package/src/style-spec/migrate/v9.js +0 -26
  308. package/src/style-spec/migrate.js +0 -36
  309. package/src/style-spec/package.json +0 -41
  310. package/src/style-spec/read_style.js +0 -14
  311. package/src/style-spec/reference/latest.js +0 -3
  312. package/src/style-spec/reference/v8.json +0 -5808
  313. package/src/style-spec/rollup.config.js +0 -45
  314. package/src/style-spec/style-spec.js +0 -122
  315. package/src/style-spec/types.js +0 -438
  316. package/src/style-spec/util/color.js +0 -95
  317. package/src/style-spec/util/color_spaces.js +0 -139
  318. package/src/style-spec/util/deep_equal.js +0 -28
  319. package/src/style-spec/util/extend.js +0 -10
  320. package/src/style-spec/util/get_type.js +0 -17
  321. package/src/style-spec/util/interpolate.js +0 -22
  322. package/src/style-spec/util/properties.js +0 -15
  323. package/src/style-spec/util/ref_properties.js +0 -2
  324. package/src/style-spec/util/result.js +0 -19
  325. package/src/style-spec/util/unbundle_jsonlint.js +0 -24
  326. package/src/style-spec/validate/latest.js +0 -11
  327. package/src/style-spec/validate/validate.js +0 -75
  328. package/src/style-spec/validate/validate_array.js +0 -52
  329. package/src/style-spec/validate/validate_boolean.js +0 -15
  330. package/src/style-spec/validate/validate_color.js +0 -20
  331. package/src/style-spec/validate/validate_constants.js +0 -13
  332. package/src/style-spec/validate/validate_enum.js +0 -21
  333. package/src/style-spec/validate/validate_expression.js +0 -43
  334. package/src/style-spec/validate/validate_filter.js +0 -111
  335. package/src/style-spec/validate/validate_formatted.js +0 -11
  336. package/src/style-spec/validate/validate_function.js +0 -207
  337. package/src/style-spec/validate/validate_glyphs_url.js +0 -21
  338. package/src/style-spec/validate/validate_image.js +0 -11
  339. package/src/style-spec/validate/validate_layer.js +0 -134
  340. package/src/style-spec/validate/validate_layout_property.js +0 -6
  341. package/src/style-spec/validate/validate_light.js +0 -47
  342. package/src/style-spec/validate/validate_number.js +0 -29
  343. package/src/style-spec/validate/validate_object.js +0 -61
  344. package/src/style-spec/validate/validate_paint_property.js +0 -6
  345. package/src/style-spec/validate/validate_property.js +0 -64
  346. package/src/style-spec/validate/validate_source.js +0 -111
  347. package/src/style-spec/validate/validate_string.js +0 -15
  348. package/src/style-spec/validate_mapbox_api_supported.js +0 -171
  349. package/src/style-spec/validate_style.js +0 -39
  350. package/src/style-spec/validate_style.min.js +0 -78
  351. package/src/style-spec/visit.js +0 -77
  352. package/src/symbol/anchor.js +0 -26
  353. package/src/symbol/check_max_angle.js +0 -81
  354. package/src/symbol/clip_line.js +0 -71
  355. package/src/symbol/collision_feature.js +0 -217
  356. package/src/symbol/collision_index.js +0 -372
  357. package/src/symbol/cross_tile_symbol_index.js +0 -301
  358. package/src/symbol/get_anchors.js +0 -167
  359. package/src/symbol/grid_index.js +0 -335
  360. package/src/symbol/mergelines.js +0 -82
  361. package/src/symbol/one_em.js +0 -4
  362. package/src/symbol/opacity_state.js +0 -27
  363. package/src/symbol/placement.js +0 -1062
  364. package/src/symbol/projection.js +0 -450
  365. package/src/symbol/quads.js +0 -334
  366. package/src/symbol/shaping.js +0 -816
  367. package/src/symbol/symbol_layout.js +0 -772
  368. package/src/symbol/symbol_size.js +0 -113
  369. package/src/symbol/transform_text.js +0 -29
  370. package/src/types/callback.js +0 -17
  371. package/src/types/cancelable.js +0 -3
  372. package/src/types/tilejson.js +0 -17
  373. package/src/types/transferable.js +0 -3
  374. package/src/types/window.js +0 -172
  375. package/src/ui/anchor.js +0 -32
  376. package/src/ui/bind_handlers.js +0 -202
  377. package/src/ui/camera.js +0 -1152
  378. package/src/ui/control/attribution_control.js +0 -189
  379. package/src/ui/control/fps_control.js +0 -185
  380. package/src/ui/control/fullscreen_control.js +0 -147
  381. package/src/ui/control/geolocate_control.js +0 -594
  382. package/src/ui/control/logo_control.js +0 -92
  383. package/src/ui/control/navigation_control.js +0 -148
  384. package/src/ui/control/scale_control.js +0 -142
  385. package/src/ui/crs.js +0 -64
  386. package/src/ui/default_locale.js +0 -20
  387. package/src/ui/events.js +0 -806
  388. package/src/ui/handler/box_zoom.js +0 -175
  389. package/src/ui/handler/dblclick_zoom.js +0 -139
  390. package/src/ui/handler/drag_pan.js +0 -416
  391. package/src/ui/handler/drag_rotate.js +0 -378
  392. package/src/ui/handler/keyboard.js +0 -161
  393. package/src/ui/handler/scroll_zoom.js +0 -333
  394. package/src/ui/handler/touch_zoom_rotate.js +0 -293
  395. package/src/ui/hash.js +0 -147
  396. package/src/ui/map.js +0 -2883
  397. package/src/ui/marker.js +0 -607
  398. package/src/ui/offline_map.js +0 -91
  399. package/src/ui/popup.js +0 -530
  400. package/src/util/actor.js +0 -212
  401. package/src/util/ajax.js +0 -371
  402. package/src/util/browser/web_worker.js +0 -10
  403. package/src/util/browser/window.js +0 -5
  404. package/src/util/browser.js +0 -70
  405. package/src/util/classify_rings.js +0 -52
  406. package/src/util/color_ramp.js +0 -28
  407. package/src/util/config.js +0 -30
  408. package/src/util/debug.js +0 -12
  409. package/src/util/dictionary_coder.js +0 -30
  410. package/src/util/dispatcher.js +0 -70
  411. package/src/util/dom.js +0 -144
  412. package/src/util/evented.js +0 -174
  413. package/src/util/find_pole_of_inaccessibility.js +0 -129
  414. package/src/util/global_worker_pool.js +0 -17
  415. package/src/util/image.js +0 -142
  416. package/src/util/intersection_tests.js +0 -208
  417. package/src/util/is_char_in_unicode_block.js +0 -311
  418. package/src/util/mapbox.js +0 -486
  419. package/src/util/offscreen_canvas_supported.js +0 -14
  420. package/src/util/performance.js +0 -112
  421. package/src/util/primitives.js +0 -145
  422. package/src/util/resolve_tokens.js +0 -16
  423. package/src/util/script_detection.js +0 -328
  424. package/src/util/sku_token.js +0 -42
  425. package/src/util/smart_wrap.js +0 -55
  426. package/src/util/struct_array.js +0 -243
  427. package/src/util/struct_array.js.ejs +0 -112
  428. package/src/util/struct_array_layout.js.ejs +0 -98
  429. package/src/util/task_queue.js +0 -68
  430. package/src/util/throttle.js +0 -28
  431. package/src/util/throttled_invoker.js +0 -46
  432. package/src/util/tile_cover.js +0 -101
  433. package/src/util/tile_request_cache.js +0 -172
  434. package/src/util/util.js +0 -504
  435. package/src/util/vectortile_to_geojson.js +0 -54
  436. package/src/util/verticalize_punctuation.js +0 -114
  437. package/src/util/web_worker.js +0 -91
  438. package/src/util/web_worker_transfer.js +0 -266
  439. package/src/util/webp_supported.js +0 -69
  440. package/src/util/window.js +0 -102
  441. package/src/util/worker_pool.js +0 -47
@@ -1,2 +0,0 @@
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!r(t)}function r(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,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{e=new Worker(i),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(i),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 r=e.getImageData(0,0,1,1);return r&&r.width===t.width}()?(void 0===i[r=t&&t.failIfMajorPerformanceCaveat]&&(i[r]=function(t){var r=function(t){var r=document.createElement("canvas"),i=Object.create(e.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",i)||r.probablySupportsContext("experimental-webgl",i):r.supportsContext?r.supportsContext("webgl",i)||r.supportsContext("experimental-webgl",i):r.getContext("webgl",i)||r.getContext("experimental-webgl",i)}(t);if(!r)return!1;var i=r.createShader(r.VERTEX_SHADER);return!(!i||r.isContextLost())&&(r.shaderSource(i,"void main() {}"),r.compileShader(i),!0===r.getShaderParameter(i,r.COMPILE_STATUS))}(r)),i[r]?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 r}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=r);var i={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r=i;function i(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,i,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)<(r=0))return r;if(n>(i=1))return i;for(;r<i;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;t>o?r=n:i=n,n=.5*(i-r)+r}return n},i.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}function a(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!a(t[r],e[r]))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 i in t)if(!a(t[i],e[i]))return!1;return!0}return t===e}function s(t,e,i,n){var o=new r(t,e,i,n);return function(t){return o.solve(t)}}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,r=t.y-this.y;return e*e+r*r},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),r=Math.sin(t),i=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-i*(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 l=s(.25,.1,.25,1);function u(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function p(t,e,r){if(!t.length)return r(null,[]);var i=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==--i&&r(o,n)}))}))}function h(t){var e=[];for(var r in t)e.push(t[r]);return e}function f(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o=n[i];for(var a in o)t[a]=o[a]}return t}function d(t,e){for(var r={},i=0;i<e.length;i++){var n=e[i];n in t&&(r[n]=t[n])}return r}var m=1;function y(){return m++}function _(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function g(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 v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function x(t,e){return-1!==t.indexOf(e,t.length-e.length)}function b(t,e,r){var i={};for(var n in t)i[n]=e.call(r||this,t[n],n,t);return i}function w(t,e,r){var i={};for(var n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function S(t){return Array.isArray(t)?t.map(S):"object"==typeof t&&t?b(t,S):t}var T={};function I(t){T[t]||("undefined"!=typeof console&&console.warn(t),T[t]=!0)}function E(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function A(t){for(var e=0,r=0,i=t.length,n=i-1,o=void 0,a=void 0;r<i;n=r++)e+=((a=t[n]).x-(o=t[r]).x)*(o.y+a.y);return e}function k(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function z(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,i,n){var o=i||n;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var C=null;function P(t){if(null==C){var e=t.navigator?t.navigator.userAgent:null;C=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return C}function M(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var D,L,R=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),B=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,F=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,O={now:R,frame:function(t){var e=B(t);return{cancel:function(){return F(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return D||(D=self.document.createElement("a")),D.href=t,D.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==L&&(L=self.matchMedia("(prefers-reduced-motion: reduce)")),L.matches)}},V={create:function(t,e,r){var i=self.document.createElement(t);return void 0!==e&&(i.className=e),r&&r.appendChild(i),i},createNS:function(t,e){return self.document.createElementNS(t,e)}},U=self.document.documentElement.style;function N(t){if(!U)return t[0];for(var e=0;e<t.length;e++)if(t[e]in U)return t[e];return t[0]}var j,q=N(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);V.disableDrag=function(){U&&q&&(j=U[q],U[q]="none")},V.enableDrag=function(){U&&q&&(U[q]=j)};var Z=N(["transform","WebkitTransform"]);V.setTransform=function(t,e){t.style[Z]=e};var G=!1;try{var X=Object.defineProperty({},"passive",{get:function(){G=!0}});self.addEventListener("test",X,X),self.removeEventListener("test",X,X)}catch(t){G=!1}V.addEventListener=function(t,e,r,i){void 0===i&&(i={}),t.addEventListener(e,r,"passive"in i&&G?i:i.capture)},V.removeEventListener=function(t,e,r,i){void 0===i&&(i={}),t.removeEventListener(e,r,"passive"in i&&G?i:i.capture)};var W=function(t){t.preventDefault(),t.stopPropagation(),self.removeEventListener("click",W,!0)};V.suppressClick=function(){self.addEventListener("click",W,!0),self.setTimeout((function(){self.removeEventListener("click",W,!0)}),0)},V.mousePos=function(t,e){var r=t.getBoundingClientRect(),i=self.TouchEvent&&e instanceof self.TouchEvent?e.touches[0]:e;return new n(i.clientX-r.left-t.clientLeft,i.clientY-r.top-t.clientTop)},V.touchPos=function(t,e){for(var r=t.getBoundingClientRect(),i=[],o="touchend"===e.type?e.changedTouches:e.touches,a=0;a<o.length;a++)i.push(new n(o[a].clientX-r.left-t.clientLeft,o[a].clientY-r.top-t.clientTop));return i},V.mouseButton=function(t){return void 0!==self.InstallTrigger&&2===t.button&&t.ctrlKey&&self.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button},V.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var H,K,Y={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},J={supported:!1,testSupport:function(t){!Q&&K&&($?tt(t):H=t)}},Q=!1,$=!1;function tt(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,K),t.isContextLost())return;J.supported=!0}catch(t){}t.deleteTexture(e),Q=!0}self.document&&((K=self.document.createElement("img")).onload=function(){H&&tt(H),H=null,$=!0},K.onerror=function(){Q=!0,H=null},K.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var et="01",rt=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function it(t){return 0===t.indexOf("mapbox:")}rt.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",et,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},rt.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},rt.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},rt.prototype.normalizeStyleURL=function(t,e){if(!it(t))return t;var r=st(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},rt.prototype.normalizeGlyphsURL=function(t,e){if(!it(t))return t;var r=st(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},rt.prototype.normalizeSourceURL=function(t,e){if(!it(t))return t;var r=st(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},rt.prototype.normalizeSpriteURL=function(t,e,r,i){var n=st(t);return it(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+r,this._makeAPIURL(n,this._customAccessToken||i)):(n.path+=""+e+r,lt(n))},rt.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!it(t))return t;var r=st(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(O.devicePixelRatio>=2||512===e?"@2x":"")+(J.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var i=r[e].match(/^access_token=(.*)$/);if(i)return i[1]}return null}(r.params)||Y.ACCESS_TOKEN;return Y.REQUIRE_ACCESS_TOKEN&&i&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,i)},rt.prototype.canonicalizeTileURL=function(t,e){var r=st(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var i="mapbox://tiles/";i+=r.path.replace("/v4/","");var n=r.params;return e&&(n=n.filter((function(t){return!t.match(/^access_token=/)}))),n.length&&(i+="?"+n.join("&")),i},rt.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&it(e),i=[],n=0,o=t.tiles||[];n<o.length;n+=1){var a=o[n];ot(a)?i.push(this.canonicalizeTileURL(a,r)):i.push(a)}return i},rt.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",i=st(Y.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"/"!==i.path&&(t.path=""+i.path+t.path),!Y.REQUIRE_ACCESS_TOKEN)return lt(t);if(!(e=e||Y.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),lt(t)};var nt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ot(t){return nt.test(t)}var at=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function st(t){var e=t.match(at);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 lt(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function ut(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(self.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var ct=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ct.prototype.getStorageKey=function(t){var e,r=ut(Y.ACCESS_TOKEN);return e=r&&r.u?self.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):Y.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},ct.prototype.fetchEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var i=self.localStorage.getItem(e);i&&(this.eventData=JSON.parse(i));var n=self.localStorage.getItem(r);n&&(this.anonId=n)}catch(t){I("Unable to read from LocalStorage")}},ct.prototype.saveEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){I("Unable to write to LocalStorage")}},ct.prototype.processRequests=function(t){},ct.prototype.postEvent=function(t,e,r,i){var n=this;if(Y.EVENTS_URL){var o=st(Y.EVENTS_URL);o.params.push("access_token="+(i||Y.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"16.0.0",skuId:et,userId:this.anonId},s=e?f(a,e):a,l={url:lt(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=Lt(l,(function(t){n.pendingRequest=null,r(t),n.saveEventData(),n.processRequests(i)}))}},ct.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var pt,ht,ft=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,r,i){this.skuToken=r,(Y.EVENTS_URL&&i||Y.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return it(t)||ot(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),i=r.id,n=r.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),g(this.anonId)||(this.anonId=_()),this.postEvent(n,{skuToken:this.skuToken},(function(t){t||i&&(e.success[i]=!0)}),t))}},e}(ct),dt=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){Y.EVENTS_URL&&Y.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return it(t)||ot(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 r=ut(Y.ACCESS_TOKEN),i=r?r.u:Y.ACCESS_TOKEN,n=i!==this.eventData.tokenU;g(this.anonId)||(this.anonId=_(),n=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),l=(o-this.eventData.lastSuccess)/864e5;n=n||l>=1||l<-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=i)}),t)}},e}(ct)),mt=dt.postTurnstileEvent.bind(dt),yt=new ft,_t=yt.postMapLoadEvent.bind(yt),gt=500,vt=50;function xt(){self.caches&&!pt&&(pt=self.caches.open("mapbox-tiles"))}function bt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var wt,St=1/0;function Tt(t){++St>vt&&(t.getActor().send("enforceCacheSizeLimit",gt),St=0)}function It(){return null==wt&&(wt=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),wt}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 At=function(t){function e(e,r,i){401===r&&ot(i)&&(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=r,this.url=i,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),kt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};var zt,Ct,Pt=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(kt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,i=new self.AbortController,n=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:kt(),signal:i.signal}),o=!1,a=!1,s=(r=n.url).indexOf("sku=")>0&&ot(r);"json"===t.type&&n.headers.set("Accept","application/json");var l=function(r,i,o){if(!a){if(r&&"SecurityError"!==r.message&&I(r),i&&o)return u(i);var l=Date.now();self.fetch(n).then((function(r){if(r.ok){var i=s?r.clone():null;return u(r,i,l)}return e(new At(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(r,i,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(i&&s&&function(t,e,r){if(xt(),pt){var i={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return i.headers.set(e,t)}));var n=z(e.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===ht)try{new Response(new ReadableStream),ht=!0}catch(t){ht=!1}ht?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,i);xt(),pt&&pt.then((function(e){return e.put(bt(t.url),r)})).catch((function(t){return I(t.message)}))})))}}(n,i,s),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){a||e(new Error(t.message))}))};return s?function(t,e){if(xt(),!pt)return e(null);var r=bt(t.url);pt.then((function(t){t.match(r).then((function(i){var n=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=z(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(i);t.delete(r),n&&t.put(r,i.clone()),e(null,i,n)})).catch(e)})).catch(e)}(n,l):l(null,null),{cancel:function(){a=!0,o||i.abort()}}}(t,e);if(k()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var i in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(i,t.headers[i]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var i=r.response;if("json"===t.type)try{i=JSON.parse(r.response)}catch(t){return e(t)}e(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new At(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Mt=function(t,e){return Pt(f(t,{type:"json"}),e)},Dt=function(t,e){return Pt(f(t,{type:"arrayBuffer"}),e)},Lt=function(t,e){return Pt(f(t,{method:"POST"}),e)};zt=[],Ct=0;var Rt=function(t,e){if(J.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Ct>=Y.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return zt.push(r),r}Ct++;var i=!1,n=function(){if(!i)for(i=!0,Ct--;zt.length&&Ct<Y.MAX_PARALLEL_IMAGE_REQUESTS;){var t=zt.shift();t.cancelled||(t.cancel=Rt(t.requestParameters,t.callback).cancel)}},o=Dt(t,(function(t,r,i,o){n(),t?e(t):r&&(It()?function(t,e){var r=new self.Blob([new Uint8Array(t)],{type:"image/png"});self.createImageBitmap(r).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."))}))}(r,e):function(t,e,r,i){var n=new self.Image,o=self.URL;n.onload=function(){e(null,n),o.revokeObjectURL(n.src)},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 a=new self.Blob([new Uint8Array(t)],{type:"image/png"});n.cacheControl=r,n.expires=i,n.src=t.byteLength?o.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}(r,e,i,o))}));return{cancel:function(){o.cancel(),n()}}};function Bt(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Ft(t,e,r){if(r&&r[t]){var i=r[t].indexOf(e);-1!==i&&r[t].splice(i,1)}}var Ot=function(t,e){void 0===e&&(e={}),f(this,e),this.type=t},Vt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",f({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Ot),Ut=function(){};Ut.prototype.on=function(t,e){return this._listeners=this._listeners||{},Bt(t,e,this._listeners),this},Ut.prototype.off=function(t,e){return Ft(t,e,this._listeners),Ft(t,e,this._oneTimeListeners),this},Ut.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Bt(t,e,this._oneTimeListeners),this},Ut.prototype.fire=function(t,e){"string"==typeof t&&(t=new Ot(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var i=0,n=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];i<n.length;i+=1)n[i].call(this,t);for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<a.length;o+=1){var s=a[o];Ft(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(f(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Vt&&console.error(t.error);return this},Ut.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)},Ut.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Nt={$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"},"*":{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"},"*":{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"},"*":{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},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{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:["宋体","宋体"],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":{}}},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},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},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:"#1890ff",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",default:"#ffffff",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:"#4F4F4F",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"}}},jt=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)};function qt(t){var e=t.value;return e?[new jt(t.key,e,"constants have been deprecated as of v8")]:[]}function Zt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o=n[i];for(var a in o)t[a]=o[a]}return t}function Gt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Xt(t){if(Array.isArray(t))return t.map(Xt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Xt(t[r]);return e}return Gt(t)}var Wt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Ht=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,i=e;r<i.length;r+=1){var n=i[r];this.bindings[n[0]]=n[1]}};Ht.prototype.concat=function(t){return new Ht(this,t)},Ht.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.")},Ht.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Kt={kind:"null"},Yt={kind:"number"},Jt={kind:"string"},Qt={kind:"boolean"},$t={kind:"color"},te={kind:"object"},ee={kind:"value"},re={kind:"collator"},ie={kind:"formatted"},ne={kind:"resolvedImage"};function oe(t,e){return{kind:"array",itemType:t,N:e}}function ae(t){if("array"===t.kind){var e=ae(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var se=[Kt,Yt,Jt,Qt,$t,ie,te,oe(ee),ne];function le(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!le(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 r=0,i=se;r<i.length;r+=1)if(!le(i[r],e))return null}return"Expected "+ae(t)+" but found "+ae(e)+" instead."}var ue=t((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function i(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return i("%"===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,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[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 l=s.indexOf("("),u=s.indexOf(")");if(-1!==l&&u+1===s.length){var c=s.substr(0,l),p=s.substr(l+1,u-(l+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[i(255*a(_,y,f+1/3)),i(255*a(_,y,f)),i(255*a(_,y,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,ce=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};ce.parse=function(t){if(t){if(t instanceof ce)return t;if("string"==typeof t){var e=ue(t);if(e)return new ce(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ce.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],i=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+i+")"},ce.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]},ce.black=new ce(0,0,0,1),ce.white=new ce(1,1,1,1),ce.transparent=new ce(0,0,0,0),ce.red=new ce(1,0,0,1);var pe=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};pe.prototype.compare=function(t,e){return this.collator.compare(t,e)},pe.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var he=function(t,e,r,i,n){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n},fe=function(t){this.sections=t};fe.fromString=function(t){return new fe([new he(t,null,null,null,null)])},fe.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}))},fe.factory=function(t){return t instanceof fe?t:fe.fromString(t)},fe.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},fe.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];if(i.image)t.push(["image",i.image.name]);else{t.push(i.text);var n={};i.fontStack&&(n["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(n["font-scale"]=i.scale),i.textColor&&(n["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(n)}}return t};var de=function(t){this.name=t.name,this.available=t.available};function me(t,e,r,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ye(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 ce)return!0;if(t instanceof pe)return!0;if(t instanceof fe)return!0;if(t instanceof de)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!ye(r[e]))return!1;return!0}if("object"==typeof t){for(var i in t)if(!ye(t[i]))return!1;return!0}return!1}function _e(t){if(null===t)return Kt;if("string"==typeof t)return Jt;if("boolean"==typeof t)return Qt;if("number"==typeof t)return Yt;if(t instanceof ce)return $t;if(t instanceof pe)return re;if(t instanceof fe)return ie;if(t instanceof de)return ne;if(Array.isArray(t)){for(var e,r=t.length,i=0,n=t;i<n.length;i+=1){var o=_e(n[i]);if(e){if(e===o)continue;e=ee;break}e=o}return oe(e||ee,r)}return te}function ge(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ce||t instanceof fe||t instanceof de?t.toString():JSON.stringify(t)}de.prototype.toString=function(){return this.name},de.fromString=function(t){return t?new de({name:t,available:!1}):null},de.prototype.serialize=function(){return["image",this.name]};var ve=function(t,e){this.type=t,this.value=e};ve.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ye(t[1]))return e.error("invalid value");var r=t[1],i=_e(r),n=e.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new ve(i,r)},ve.prototype.evaluate=function(){return this.value},ve.prototype.eachChild=function(){},ve.prototype.outputDefined=function(){return!0},ve.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ce?["rgba"].concat(this.value.toArray()):this.value instanceof fe?this.value.serialize():this.value};var xe=function(t){this.name="ExpressionEvaluationError",this.message=t};xe.prototype.toJSON=function(){return this.message};var be={string:Jt,number:Yt,boolean:Qt,object:te},we=function(t,e){this.type=t,this.args=e};we.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,i=1,n=t[0];if("array"===n){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in be)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=be[s],i++}else o=ee;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],i++}r=oe(o,a)}else r=be[n];for(var l=[];i<t.length;i++){var u=e.parse(t[i],i,ee);if(!u)return null;l.push(u)}return new we(r,l)},we.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!le(this.type,_e(r)))return r;if(e===this.args.length-1)throw new xe("Expected value to be of type "+ae(this.type)+", but found "+ae(_e(r))+" instead.")}return null},we.prototype.eachChild=function(t){this.args.forEach(t)},we.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},we.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Se=function(t){this.type=ie,this.sections=t};Se.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var i=[],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,Yt)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,oe(Jt))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,$t)))return null;var c=i[i.length-1];c.scale=s,c.font=l,c.textColor=u}else{var p=e.parse(t[o],1,ee);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,i.push({content:p,scale:null,font:null,textColor:null})}}return new Se(i)},Se.prototype.evaluate=function(t){return new fe(this.sections.map((function(e){var r=e.content.evaluate(t);return _e(r)===ne?new he("",r,null,null,null):new he(ge(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Se.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}},Se.prototype.outputDefined=function(){return!1},Se.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t.push(i.content.serialize());var n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),t.push(n)}return t};var Te=function(t){this.type=ne,this.input=t};Te.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Jt);return r?new Te(r):e.error("No image name provided.")},Te.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=de.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},Te.prototype.eachChild=function(t){t(this.input)},Te.prototype.outputDefined=function(){return!1},Te.prototype.serialize=function(){return["image",this.input.serialize()]};var Ie={"to-boolean":Qt,"to-color":$t,"to-number":Yt,"to-string":Jt},Ee=function(t,e){this.type=t,this.args=e};Ee.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var i=Ie[r],n=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,ee);if(!a)return null;n.push(a)}return new Ee(i,n)},Ee.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,i=0,n=this.args;i<n.length;i+=1){if(r=null,(e=n[i].evaluate(t))instanceof ce)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":me(e[0],e[1],e[2],e[3])))return new ce(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new xe(r||"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,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new xe("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?fe.fromString(ge(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?de.fromString(ge(this.args[0].evaluate(t))):ge(this.args[0].evaluate(t))},Ee.prototype.eachChild=function(t){this.args.forEach(t)},Ee.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Ee.prototype.serialize=function(){if("formatted"===this.type.kind)return new Se([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Te(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ae=["Unknown","Point","LineString","Polygon"],ke=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ke.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ke.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Ae[this.feature.type]:this.feature.type:null},ke.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ke.prototype.canonicalID=function(){return this.canonical},ke.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ke.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ce.parse(t)),e};var ze=function(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i};ze.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ze.prototype.eachChild=function(t){this.args.forEach(t)},ze.prototype.outputDefined=function(){return!1},ze.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ze.parse=function(t,e){var r,i=t[0],n=ze.definitions[i];if(!n)return e.error('Unknown expression "'+i+'". 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 r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,u=0,c=s;u<c.length;u+=1){var p=c[u],h=p[0],f=p[1];l=new ar(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=l.parse(_,1+d.length,g);if(!v){m=!0;break}d.push(v)}if(!m)if(Array.isArray(h)&&h.length!==d.length)l.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];l.concat(x+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new ze(i,o,f,d)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var S=(s.length?s:a).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(ae).join(", ")+")":"("+ae(e.type)+"...)"})).join(" | "),T=[],I=1;I<t.length;I++){var E=e.parse(t[I],1+T.length);if(!E)return null;T.push(ae(E.type))}e.error("Expected arguments of type "+S+", but found ("+T.join(", ")+") instead.")}return null},ze.register=function(t,e){for(var r in ze.definitions=e,e)t[r]=ze};var Ce=function(t,e,r){this.type=re,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};Ce.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var i=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Qt);if(!i)return null;var n=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Qt);if(!n)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,Jt))?null:new Ce(i,n,o)},Ce.prototype.evaluate=function(t){return new pe(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Ce.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Ce.prototype.outputDefined=function(){return!1},Ce.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 Pe=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]))};Pe.prototype.setNorthEast=function(t){return this._ne=t instanceof Me?new Me(t.lng,t.lat):Me.convert(t),this},Pe.prototype.setSouthWest=function(t){return this._sw=t instanceof Me?new Me(t.lng,t.lat):Me.convert(t),this},Pe.prototype.extend=function(t){var e,r,i=this._sw,n=this._ne;if(t instanceof Me)e=t,r=t;else{if(!(t instanceof Pe))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Pe.convert(t)):this.extend(Me.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return i||n?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new Me(e.lng,e.lat),this._ne=new Me(r.lng,r.lat)),this},Pe.prototype.getCenter=function(){return new Me((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Pe.prototype.getSouthWest=function(){return this._sw},Pe.prototype.getNorthEast=function(){return this._ne},Pe.prototype.getNorthWest=function(){return new Me(this.getWest(),this.getNorth())},Pe.prototype.getSouthEast=function(){return new Me(this.getEast(),this.getSouth())},Pe.prototype.getWest=function(){return this._sw.lng},Pe.prototype.getSouth=function(){return this._sw.lat},Pe.prototype.getEast=function(){return this._ne.lng},Pe.prototype.getNorth=function(){return this._ne.lat},Pe.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Pe.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Pe.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Pe.prototype.contains=function(t){var e=Me.convert(t),r=e.lng,i=e.lat,n=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n},Pe.convert=function(t){return!t||t instanceof Pe?t:new Pe(t)};var Me=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")};Me.prototype.wrap=function(){return new Me(c(this.lng,-180,180),this.lat)},Me.prototype.toArray=function(){return[this.lng,this.lat]},Me.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Me.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,i=t.lat*e,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(n,1))},Me.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Pe(new Me(this.lng-r,this.lat-e),new Me(this.lng+r,this.lat+e))},Me.convert=function(t){if(t instanceof Me)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Me(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Me(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 De=2*Math.PI*6371008.8;function Le(t){return De*Math.cos(t*Math.PI/180)}function Re(t){return(180+t)/360}function Be(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Fe(t,e){return t/Le(e)}function Oe(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Ve=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};function Ue(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 Ne(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function je(t,e){var r=Ve.fromLngLat({lng:t[0],lat:t[1]},0),i=Math.pow(2,e.z);return[Math.round(r.x*i*8192),Math.round(r.y*i*8192)]}function qe(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Ze(t,e){for(var r,i,n,o,a,s,l,u=!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=(r=t)[0]-(i=h[f])[0])*(l=r[1]-(n=h[f+1])[1])-(s=r[0]-n[0])*(a=r[1]-i[1])==0&&o*s<=0&&a*l<=0)return!1;qe(t,h[f],h[f+1])&&(u=!u)}return u}function Ge(t,e){for(var r=0;r<e.length;r++)if(Ze(t,e[r]))return!0;return!1}function Xe(t,e,r,i){var n=i[0]-r[0],o=i[1]-r[1],a=(t[0]-r[0])*o-n*(t[1]-r[1]),s=(e[0]-r[0])*o-n*(e[1]-r[1]);return a>0&&s<0||a<0&&s>0}function We(t,e,r){for(var i=0,n=r;i<n.length;i+=1)for(var o=n[i],a=0;a<o.length-1;++a)if(0!=(p=[(c=o[a+1])[0]-(u=o[a])[0],c[1]-u[1]])[0]*(h=[(l=e)[0]-(s=t)[0],l[1]-s[1]])[1]-p[1]*h[0]&&Xe(s,l,u,c)&&Xe(u,c,s,l))return!0;var s,l,u,c,p,h;return!1}function He(t,e){for(var r=0;r<t.length;++r)if(!Ze(t[r],e))return!1;for(var i=0;i<t.length-1;++i)if(We(t[i],t[i+1],e))return!1;return!0}function Ke(t,e){for(var r=0;r<e.length;r++)if(He(t,e[r]))return!0;return!1}function Ye(t,e,r){for(var i=[],n=0;n<t.length;n++){for(var o=[],a=0;a<t[n].length;a++){var s=je(t[n][a],r);Ue(e,s),o.push(s)}i.push(o)}return i}function Je(t,e,r){for(var i=[],n=0;n<t.length;n++){var o=Ye(t[n],e,r);i.push(o)}return i}function Qe(t,e,r,i){if(t[0]<r[0]||t[0]>r[2]){var n=.5*i,o=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;0===o&&(o=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=o}Ue(e,t)}function $e(t,e,r,i){for(var n=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],a=[],s=0,l=t;s<l.length;s+=1)for(var u=0,c=l[s];u<c.length;u+=1){var p=c[u],h=[p.x+o[0],p.y+o[1]];Qe(h,e,r,n),a.push(h)}return a}function tr(t,e,r,i){for(var n,o=8192*Math.pow(2,i.z),a=[8192*i.x,8192*i.y],s=[],l=0,u=t;l<u.length;l+=1){for(var c=[],p=0,h=u[l];p<h.length;p+=1){var f=h[p],d=[f.x+a[0],f.y+a[1]];Ue(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)Qe(g[_],e,r,o)}return s}Ve.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Me.convert(t);return new Ve(Re(r.lng),Be(r.lat),Fe(e,r.lat))},Ve.prototype.toLngLat=function(){return new Me(360*this.x-180,Oe(this.y))},Ve.prototype.toAltitude=function(){return this.z*Le(Oe(this.y))},Ve.prototype.meterInMercatorCoordinateUnits=function(){return 1/De*(t=Oe(this.y),1/Math.cos(t*Math.PI/180));var t};var er=function(t,e){this.type=Qt,this.geojson=t,this.geometries=e};function rr(t){if(t instanceof ze){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 er)return!1;var e=!0;return t.eachChild((function(t){e&&!rr(t)&&(e=!1)})),e}function ir(t){if(t instanceof ze&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!ir(t)&&(e=!1)})),e}function nr(t,e){if(t instanceof ze&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!nr(t,e)&&(r=!1)})),r}er.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ye(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;i<r.features.length;++i){var n=r.features[i].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new er(r,r.features[i].geometry)}else if("Feature"===r.type){var o=r.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new er(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new er(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},er.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=Ye(e.coordinates,i,n),a=$e(t.geometry(),r,i,n);if(!Ne(r,i))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Ze(l[s],o))return!1}if("MultiPolygon"===e.type){var u=Je(e.coordinates,i,n),c=$e(t.geometry(),r,i,n);if(!Ne(r,i))return!1;for(var p=0,h=c;p<h.length;p+=1)if(!Ge(h[p],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=Ye(e.coordinates,i,n),a=tr(t.geometry(),r,i,n);if(!Ne(r,i))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!He(l[s],o))return!1}if("MultiPolygon"===e.type){var u=Je(e.coordinates,i,n),c=tr(t.geometry(),r,i,n);if(!Ne(r,i))return!1;for(var p=0,h=c;p<h.length;p+=1)if(!Ke(h[p],u))return!1}return!0}(t,this.geometries)}return!1},er.prototype.eachChild=function(){},er.prototype.outputDefined=function(){return!0},er.prototype.serialize=function(){return["within",this.geojson]};var or=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};or.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new or(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},or.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},or.prototype.eachChild=function(){},or.prototype.outputDefined=function(){return!1},or.prototype.serialize=function(){return["var",this.name]};var ar=function(t,e,r,i,n){void 0===e&&(e=[]),void 0===i&&(i=new Ht),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=i,this.errors=n,this.expectedType=r};function sr(t,e){for(var r,i=t.length-1,n=0,o=i,a=0;n<=o;)if((r=t[a=Math.floor((n+o)/2)])<=e){if(a===i||e<t[a+1])return a;n=a+1}else{if(!(r>e))throw new xe("Input is not a number.");o=a-1}return 0}ar.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)},ar.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new we(e,[t]):"coerce"===r?new Ee(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 i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[i];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=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof ve)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof or)return t(e.boundExpression);if(e instanceof ze&&"error"===e.name)return!1;if(e instanceof Ce)return!1;if(e instanceof er)return!1;var r=e instanceof Ee||e instanceof we,i=!0;return e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof ve})),!!i&&rr(e)&&nr(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var l=new ke;try{o=new ve(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+i+'". 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.")},ar.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new ar(this.registry,i,e||null,n,this.errors)},ar.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Wt(i,t))},ar.prototype.checkSubtype=function(t,e){var r=le(t,e);return r&&this.error(r),r};var lr=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i<n.length;i+=1){var o=n[i],a=o[1];this.labels.push(o[0]),this.outputs.push(a)}};function ur(t,e,r){return t*(1-r)+e*r}lr.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 r=e.parse(t[1],1,Yt);if(!r)return null;var i=[],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],l=o,u=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.',l);if(i.length&&i[i.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,n);if(!c)return null;n=n||c.type,i.push([a,c])}return new lr(n,r,i)},lr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[sr(e,i)].evaluate(t)},lr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},lr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},lr.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 cr=Object.freeze({__proto__:null,number:ur,color:function(t,e,r){return new ce(ur(t.r,e.r,r),ur(t.g,e.g,r),ur(t.b,e.b,r),ur(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return ur(t,e[i],r)}))}}),pr=6/29*3*(6/29),hr=Math.PI/180,fr=180/Math.PI;function dr(t){return t>.008856451679035631?Math.pow(t,1/3):t/pr+4/29}function mr(t){return t>6/29?t*t*t:pr*(t-4/29)}function yr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function _r(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function gr(t){var e=_r(t.r),r=_r(t.g),i=_r(t.b),n=dr((.4124564*e+.3575761*r+.1804375*i)/.95047),o=dr((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-dr((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function vr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*mr(e),r=.95047*mr(r),i=1.08883*mr(i),new ce(yr(3.2404542*r-1.5371385*e-.4985314*i),yr(-.969266*r+1.8760108*e+.041556*i),yr(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function xr(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var br={forward:gr,reverse:vr,interpolate:function(t,e,r){return{l:ur(t.l,e.l,r),a:ur(t.a,e.a,r),b:ur(t.b,e.b,r),alpha:ur(t.alpha,e.alpha,r)}}},wr={forward:function(t){var e=gr(t),r=e.l,i=e.a,n=e.b,o=Math.atan2(n,i)*fr;return{h:o<0?o+360:o,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*hr,r=t.c;return vr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:xr(t.h,e.h,r),c:ur(t.c,e.c,r),l:ur(t.l,e.l,r),alpha:ur(t.alpha,e.alpha,r)}}},Sr=Object.freeze({__proto__:null,lab:br,hcl:wr}),Tr=function(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var o=0,a=n;o<a.length;o+=1){var s=a[o],l=s[1];this.labels.push(s[0]),this.outputs.push(l)}};function Ir(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}Tr.interpolationFactor=function(t,e,i,n){var o=0;if("exponential"===t.name)o=Ir(e,t.base,i,n);else if("linear"===t.name)o=Ir(e,1,i,n);else if("cubic-bezier"===t.name){var a=t.controlPoints;o=new r(a[0],a[1],a[2],a[3]).solve(Ir(e,1,i,n))}return o},Tr.parse=function(t,e){var r=t[0],i=t[1],n=t[2],o=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var a=i[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:a}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);var s=i.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);i={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,Yt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=$t:e.expectedType&&"value"!==e.expectedType.kind&&(u=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(l.length&&l[l.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,u);if(!m)return null;u=u||m.type,l.push([p,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Tr(u,r,i,n,l):e.error("Type "+ae(u)+" is not interpolatable.")},Tr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);var o=sr(e,i),a=Tr.interpolationFactor(this.interpolation,i,e[o],e[o+1]),s=r[o].evaluate(t),l=r[o+1].evaluate(t);return"interpolate"===this.operator?cr[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?wr.reverse(wr.interpolate(wr.forward(s),wr.forward(l),a)):br.reverse(br.interpolate(br.forward(s),br.forward(l),a))},Tr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Tr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Tr.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()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var Er=function(t,e){this.type=t,this.args=e};Er.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,i=e.expectedType;i&&"value"!==i.kind&&(r=i);for(var n=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=e.parse(a[o],1+n.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,n.push(s)}var l=i&&n.some((function(t){return le(i,t.type)}));return new Er(l?ee:r,n)},Er.prototype.evaluate=function(t){for(var e,r=null,i=0,n=0,o=this.args;n<o.length&&(i++,(r=o[n].evaluate(t))&&r instanceof de&&!r.available&&(e||(e=r.name),r=null,i===this.args.length&&(r=e)),null===r);n+=1);return r},Er.prototype.eachChild=function(t){this.args.forEach(t)},Er.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Er.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ar=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Ar.prototype.evaluate=function(t){return this.result.evaluate(t)},Ar.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},Ar.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],i=1;i<t.length-1;i+=2){var n=t[i];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",i);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var o=e.parse(t[i+1],i+1);if(!o)return null;r.push([n,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new Ar(r,a):null},Ar.prototype.outputDefined=function(){return this.result.outputDefined()},Ar.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var i=r[e];t.push(i[0],i[1].serialize())}return t.push(this.result.serialize()),t};var kr=function(t,e,r){this.type=t,this.index=e,this.input=r};kr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Yt),i=e.parse(t[2],2,oe(e.expectedType||ee));return r&&i?new kr(i.type.itemType,r,i):null},kr.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new xe("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new xe("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new xe("Array index must be an integer, but found "+e+" instead.");return r[e]},kr.prototype.eachChild=function(t){t(this.index),t(this.input)},kr.prototype.outputDefined=function(){return!1},kr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var zr=function(t,e){this.type=Qt,this.needle=t,this.haystack=e};zr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r,i=e.parse(t[1],1,ee),n=e.parse(t[2],2,ee);return i&&n?"boolean"!==(r=i.type).kind&&"string"!==r.kind&&"number"!==r.kind&&"null"!==r.kind&&"value"!==r.kind?e.error("Expected first argument to be of type boolean, string, number or null, but found "+ae(i.type)+" instead"):new zr(i,n):null},zr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==e||!r)return!1;if(!function(t){return"boolean"==typeof t||"string"==typeof t||"number"==typeof t}(e))throw new xe("Expected first argument to be of type boolean, string or number, but found "+ae(_e(e))+" instead.");if(!function(t){return Array.isArray(t)||"string"==typeof t}(r))throw new xe("Expected second argument to be of type array or string, but found "+ae(_e(r))+" instead.");return r.indexOf(e)>=0},zr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},zr.prototype.outputDefined=function(){return!0},zr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Cr=function(t,e,r,i,n,o){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o};Cr.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 r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.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 u.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,_e(h)))return null}else r=_e(h);if(void 0!==n[String(h)])return u.error("Branch labels must be unique.");n[String(h)]=o.length}var f=e.parse(l,a,i);if(!f)return null;i=i||f.type,o.push(f)}var d=e.parse(t[1],1,ee);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,i);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Cr(r,i,d,n,o,m):null},Cr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(_e(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Cr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Cr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Cr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var a=o[n];void 0===(p=i[this.cases[a]])?(i[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[p][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var c=u[l],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 Pr=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};function Mr(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 Dr(t,e,r,i){return 0===i.compare(e,r)}function Lr(t,e,r){var i="=="!==t&&"!="!==t;return function(){function n(t,e,r){this.type=Qt,this.lhs=t,this.rhs=e,this.collator=r,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 r=t[0],o=e.parse(t[1],1,ee);if(!o)return null;if(!Mr(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+ae(o.type)+"'.");var a=e.parse(t[2],2,ee);if(!a)return null;if(!Mr(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+ae(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+ae(o.type)+"' and '"+ae(a.type)+"'.");i&&("value"===o.type.kind&&"value"!==a.type.kind?o=new we(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new we(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,re)))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(i&&this.hasUntypedArgument){var s=_e(o),l=_e(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new xe('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!i&&this.hasUntypedArgument){var u=_e(o),c=_e(a);if("string"!==u.kind||"string"!==c.kind)return e(n,o,a)}return this.collator?r(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}()}Pr.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 r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i=[],n=1;n<t.length-1;n+=2){var o=e.parse(t[n],n,Qt);if(!o)return null;var a=e.parse(t[n+1],n+1,r);if(!a)return null;i.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new Pr(r,i,s):null},Pr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[1];if(i[0].evaluate(t))return n.evaluate(t)}return this.otherwise.evaluate(t)},Pr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[1];t(i[0]),t(n)}t(this.otherwise)},Pr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},Pr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Rr=Lr("==",(function(t,e,r){return e===r}),Dr),Br=Lr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!Dr(0,e,r,i)})),Fr=Lr("<",(function(t,e,r){return e<r}),(function(t,e,r,i){return i.compare(e,r)<0})),Or=Lr(">",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),Vr=Lr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),Ur=Lr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0})),Nr=function(t,e,r,i,n){this.type=Jt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n};Nr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Yt);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var n=null;if(i.locale&&!(n=e.parse(i.locale,1,Jt)))return null;var o=null;if(i.currency&&!(o=e.parse(i.currency,1,Jt)))return null;var a=null;if(i["min-fraction-digits"]&&!(a=e.parse(i["min-fraction-digits"],1,Yt)))return null;var s=null;return i["max-fraction-digits"]&&!(s=e.parse(i["max-fraction-digits"],1,Yt))?null:new Nr(r,n,o,a,s)},Nr.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))},Nr.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)},Nr.prototype.outputDefined=function(){return!1},Nr.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 jr=function(t){this.type=Yt,this.input=t};jr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+ae(r.type)+" instead."):new jr(r):null},jr.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 xe("Expected value to be of type string or array, but found "+ae(_e(e))+" instead.")},jr.prototype.eachChild=function(t){t(this.input)},jr.prototype.outputDefined=function(){return!1},jr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var qr={"==":Rr,"!=":Br,">":Or,"<":Fr,">=":Ur,"<=":Vr,array:we,at:kr,boolean:we,case:Pr,coalesce:Er,collator:Ce,format:Se,image:Te,in:zr,interpolate:Tr,"interpolate-hcl":Tr,"interpolate-lab":Tr,length:jr,let:Ar,literal:ve,match:Cr,number:we,"number-format":Nr,object:we,step:lr,string:we,"to-boolean":Ee,"to-color":Ee,"to-number":Ee,"to-string":Ee,var:or,within:er};function Zr(t,e){var r=e[0],i=e[1],n=e[2],o=e[3];r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);var a=o?o.evaluate(t):1,s=me(r,i,n,a);if(s)throw new xe(s);return new ce(r/255*a,i/255*a,n/255*a,a)}function Gr(t,e){return t in e}function Xr(t,e){var r=e[t];return void 0===r?null:r}function Wr(t){return{type:t}}function Hr(t){return{result:"success",value:t}}function Kr(t){return{result:"error",value:t}}function Yr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Jr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Qr(t){return!!t.expression&&t.expression.interpolated}function $r(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function ti(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function ei(t){return t}function ri(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function ii(t,e,r,i,n){return ri(typeof r===n?i[r]:void 0,t.default,e.default)}function ni(t,e,r){if("number"!==$r(r))return ri(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var n=sr(t.stops.map((function(t){return t[0]})),r);return t.stops[n][1]}function oi(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==$r(r))return ri(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var o=sr(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],u=cr[e.type]||ei;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=Sr[t.colorSpace];u=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 r=s.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return u(r,i,a)}}:u(s,l,a)}function ai(t,e,r){return"color"===e.type?r=ce.parse(r):"formatted"===e.type?r=fe.fromString(r.toString()):"resolvedImage"===e.type?r=de.fromString(r.toString()):$r(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ri(r,t.default,e.default)}ze.register(qr,{error:[{kind:"error"},[Jt],function(t,e){throw new xe(e[0].evaluate(t))}],typeof:[Jt,[ee],function(t,e){return ae(_e(e[0].evaluate(t)))}],"to-rgba":[oe(Yt,4),[$t],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[$t,[Yt,Yt,Yt],Zr],rgba:[$t,[Yt,Yt,Yt,Yt],Zr],has:{type:Qt,overloads:[[[Jt],function(t,e){return Gr(e[0].evaluate(t),t.properties())}],[[Jt,te],function(t,e){var r=e[1];return Gr(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:ee,overloads:[[[Jt],function(t,e){return Xr(e[0].evaluate(t),t.properties())}],[[Jt,te],function(t,e){var r=e[1];return Xr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[ee,[Jt],function(t,e){return Xr(e[0].evaluate(t),t.featureState||{})}],properties:[te,[],function(t){return t.properties()}],"geometry-type":[Jt,[],function(t){return t.geometryType()}],id:[ee,[],function(t){return t.id()}],zoom:[Yt,[],function(t){return t.globals.zoom}],"heatmap-density":[Yt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Yt,[],function(t){return t.globals.lineProgress||0}],accumulated:[ee,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Yt,Wr(Yt),function(t,e){for(var r=0,i=0,n=e;i<n.length;i+=1)r+=n[i].evaluate(t);return r}],"*":[Yt,Wr(Yt),function(t,e){for(var r=1,i=0,n=e;i<n.length;i+=1)r*=n[i].evaluate(t);return r}],"-":{type:Yt,overloads:[[[Yt,Yt],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[Yt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Yt,[Yt,Yt],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[Yt,[Yt,Yt],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[Yt,[],function(){return Math.LN2}],pi:[Yt,[],function(){return Math.PI}],e:[Yt,[],function(){return Math.E}],"^":[Yt,[Yt,Yt],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[Yt,[Yt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Yt,[Yt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Yt,[Yt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Yt,[Yt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Yt,[Yt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Yt,[Yt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Yt,[Yt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Yt,[Yt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Yt,[Yt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Yt,[Yt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Yt,Wr(Yt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Yt,Wr(Yt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Yt,[Yt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Yt,[Yt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Yt,[Yt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Yt,[Yt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Qt,[Jt,ee],function(t,e){var r=e[0],i=e[1];return t.properties()[r.value]===i.value}],"filter-id-==":[Qt,[ee],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Qt,[Jt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Qt,[Jt,ee],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<o}],"filter-id-<":[Qt,[ee],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<n}],"filter->":[Qt,[Jt,ee],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>o}],"filter-id->":[Qt,[ee],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[Qt,[Jt,ee],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[Qt,[ee],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[Qt,[Jt,ee],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[Qt,[ee],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[Qt,[ee],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Qt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Qt,[oe(Jt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Qt,[oe(ee)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Qt,[Jt,oe(ee)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Qt,[Jt,oe(ee)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:Qt,overloads:[[[Qt,Qt],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Wr(Qt),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(!i[r].evaluate(t))return!1;return!0}]]},any:{type:Qt,overloads:[[[Qt,Qt],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Wr(Qt),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(i[r].evaluate(t))return!0;return!1}]]},"!":[Qt,[Qt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Qt,[Jt],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[Jt,[Jt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Jt,[Jt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Jt,Wr(ee),function(t,e){return e.map((function(e){return ge(e.evaluate(t))})).join("")}],"resolved-locale":[Jt,[re],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var si=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ke,this._defaultValue=e?function(t){return"color"===t.type&&ti(t.default)?new ce(0,0,0,0):"color"===t.type?ce.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function li(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in qr}function ui(t,e){var r=new ar(qr,[],e?function(t){var e={color:$t,string:Jt,number:Yt,enum:Jt,boolean:Qt,formatted:ie,resolvedImage:ne};return"array"===t.type?oe(e[t.value]||ee,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Hr(new si(i,e)):Kr(r.errors)}si.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},si.prototype.evaluate=function(t,e,r,i,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,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 xe("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 ci=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ir(e.expression)};ci.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},ci.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)};var pi=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ir(e.expression),this.interpolationType=i};function hi(t,e){if("error"===(t=ui(t,e)).result)return t;var r=t.value.expression,i=rr(r);if(!i&&!Yr(e))return Kr([new Wt("","data expressions not supported")]);var n=nr(r,["zoom"]);if(!n&&!Jr(e))return Kr([new Wt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof Ar)r=t(e.result);else if(e instanceof Er)for(var i=0,n=e.args;i<n.length&&!(r=t(n[i]));i+=1);else(e instanceof lr||e instanceof Tr)&&e.input instanceof ze&&"zoom"===e.input.name&&(r=e);return r instanceof Wt||e.eachChild((function(e){var i=t(e);i instanceof Wt?r=i:!r&&i?r=new Wt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new Wt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);return o||n?o instanceof Wt?Kr([o]):o instanceof Tr&&!Qr(e)?Kr([new Wt("",'"interpolate" expressions cannot be used with this property')]):Hr(o?new pi(i?"camera":"composite",t.value,o.labels,o instanceof Tr?o.interpolation:void 0):new ci(i?"constant":"source",t.value)):Kr([new Wt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}pi.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},pi.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)},pi.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?Tr.interpolationFactor(this.interpolationType,t,e,r):0};var fi=function(t,e){this._parameters=t,this._specification=e,Zt(this,function t(e,r){var i,n,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||!(s||void 0!==e.property),u=e.type||(Qr(r)?"exponential":"interval");if(a&&((e=Zt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],ce.parse(t[1])]}))),e.default=ce.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Sr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)i=oi;else if("interval"===u)i=ni;else if("categorical"===u){i=ii,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"!==u)throw new Error('Unknown function type "'+u+'"');i=ai}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],r)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:Tr.interpolationFactor.bind(void 0,w),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,i){var n=t.zoom;return oi({stops:g,base:e.base},r,n).evaluate(n,i)}}}if(l){var S="exponential"===u?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:S,interpolationFactor:Tr.interpolationFactor.bind(void 0,S),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return i(e,r,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?ri(e.default,r.default):i(e,r,s,n,o)}}}(this._parameters,this._specification))};function di(t){var e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],l=$r(r);if("object"!==l)return[new jt(e,r,"object expected, "+l+" found")];for(var u in r){var c=u.split(".")[0],p=i[c]||i["*"],h=void 0;if(n[c])h=n[c];else if(i[c])h=Vi;else if(n["*"])h=n["*"];else{if(!i["*"]){s.push(new jt(e,r[u],'unknown property "'+u+'"'));continue}h=Vi}s=s.concat(h({key:(e?e+".":e)+u,value:r[u],valueSpec:p,style:o,styleSpec:a,object:r,objectKey:u},r))}for(var f in i)n[f]||i[f].required&&void 0===i[f].default&&void 0===r[f]&&s.push(new jt(e,r,'missing required property "'+f+'"'));return s}function mi(t){var e=t.value,r=t.valueSpec,i=t.style,n=t.styleSpec,o=t.key,a=t.arrayElementValidator||Vi;if("array"!==$r(e))return[new jt(o,e,"array expected, "+$r(e)+" found")];if(r.length&&e.length!==r.length)return[new jt(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new jt(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};n.$version<7&&(s.function=r.function),"object"===$r(r.value)&&(s=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(a({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:i,styleSpec:n,key:o+"["+u+"]"}));return l}function yi(t){var e=t.key,r=t.value,i=t.valueSpec,n=$r(r);return"number"===n&&r!=r&&(n="NaN"),"number"!==n?[new jt(e,r,"number expected, "+n+" found")]:"minimum"in i&&r<i.minimum?[new jt(e,r,r+" is less than the minimum value "+i.minimum)]:"maximum"in i&&r>i.maximum?[new jt(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function _i(t){var e,r,i,n=t.valueSpec,o=Gt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,l=!s,u="array"===$r(t.value.stops)&&"array"===$r(t.value.stops[0])&&"object"===$r(t.value.stops[0][0]),c=di({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 jt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(mi({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===$r(r)&&0===r.length&&e.push(new jt(t.key,r,"array must have at least one stop")),e},default:function(t){return Vi({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new jt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new jt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Qr(t.valueSpec)&&c.push(new jt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Yr(t.valueSpec)?c.push(new jt(t.key,t.value,"property functions not supported")):s&&!Jr(t.valueSpec)&&c.push(new jt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!u||void 0!==t.value.property||c.push(new jt(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],o=t.value,s=t.key;if("array"!==$r(o))return[new jt(s,o,"array expected, "+$r(o)+" found")];if(2!==o.length)return[new jt(s,o,"array length 2 expected, length "+o.length+" found")];if(u){if("object"!==$r(o[0]))return[new jt(s,o,"object expected, "+$r(o[0])+" found")];if(void 0===o[0].zoom)return[new jt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new jt(s,o,"object stop key must have value")];if(i&&i>Gt(o[0].zoom))return[new jt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Gt(o[0].zoom)!==i&&(i=Gt(o[0].zoom),r=void 0,a={}),e=e.concat(di({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:yi,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return li(Xt(o[1]))?e.concat([new jt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Vi({key:s+"[1]",value:o[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function h(t,i){var s=$r(t.value),l=Gt(t.value),u=null!==t.value?t.value:i;if(e){if(s!==e)return[new jt(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new jt(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Yr(n)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new jt(t.key,u,c)]}return"categorical"!==o||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===s&&void 0!==r&&l<r?[new jt(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===o&&l in a?[new jt(t.key,u,"stop domain values must be unique")]:(a[l]=!0,[])):[new jt(t.key,u,"integer expected, found "+l)]}}function gi(t){var e=("property"===t.expressionContext?hi:ui)(Xt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new jt(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new jt(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&&!ir(r))return[new jt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ir(r))return[new jt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!nr(r,["zoom","feature-state"]))return[new jt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!rr(r))return[new jt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function vi(t){var e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(Gt(r))&&n.push(new jt(e,r,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(i.values).indexOf(Gt(r))&&n.push(new jt(e,r,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(r)+" found")),n}function xi(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,r=t.slice(1);e<r.length;e+=1){var i=r[e];if(!xi(i)&&"boolean"!=typeof i)return!1}return!0;default:return!0}}fi.deserialize=function(t){return new fi(t._parameters,t._specification)},fi.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var bi={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function wi(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};xi(t)||(t=Ti(t));var e=ui(t,bi);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,i){return e.value.evaluate(t,r,{},i)},needGeometry:Array.isArray(t)&&0!==t.length&&"within"===t[0]}}function Si(t,e){return t<e?-1:t>e?1:0}function Ti(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Ii(t[1],t[2],"=="):"!="===r?ki(Ii(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Ii(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Ti))):"all"===r?["all"].concat(t.slice(1).map(Ti)):"none"===r?["all"].concat(t.slice(1).map(Ti).map(ki)):"in"===r?Ei(t[1],t.slice(2)):"!in"===r?ki(Ei(t[1],t.slice(2))):"has"===r?Ai(t[1]):"!has"!==r||ki(Ai(t[1]))}function Ii(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Ei(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(Si)]]:["filter-in-small",t,["literal",e]]}}function Ai(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function ki(t){return["!",t]}function zi(t){return xi(Xt(t.value))?gi(Zt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,i=e.key;if("array"!==$r(r))return[new jt(i,r,"array expected, "+$r(r)+" found")];var n,o=e.styleSpec,a=[];if(r.length<1)return[new jt(i,r,"filter array must have at least 1 element")];switch(a=a.concat(vi({key:i+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Gt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Gt(r[1])&&a.push(new jt(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new jt(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(n=$r(r[1]))&&a.push(new jt(i+"[1]",r[1],"string expected, "+n+" found"));for(var s=2;s<r.length;s++)n=$r(r[s]),"$type"===Gt(r[1])?a=a.concat(vi({key:i+"["+s+"]",value:r[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new jt(i+"["+s+"]",r[s],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)a=a.concat(t({key:i+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=$r(r[1]),2!==r.length?a.push(new jt(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new jt(i+"[1]",r[1],"string expected, "+n+" found"))}return a}(t)}function Ci(t,e){var r=t.key,i=t.style,n=t.styleSpec,o=t.value,a=t.objectKey,s=n[e+"_"+t.layerType];if(!s)return[];var l=a.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return Vi({key:r,value:o,valueSpec:n.transition,style:i,styleSpec:n});var u,c=t.valueSpec||s[a];if(!c)return[new jt(r,o,'unknown property "'+a+'"')];if("string"===$r(o)&&Yr(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new jt(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var p=[];return"symbol"===t.layerType&&("text-field"===a&&i&&!i.glyphs&&p.push(new jt(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&ti(Xt(o))&&"identity"===Gt(o.type)&&p.push(new jt(r,o,'"text-font" does not support identity functions'))),p.concat(Vi({key:t.key,value:o,valueSpec:c,style:i,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:a}))}function Pi(t){return Ci(t,"paint")}function Mi(t){return Ci(t,"layout")}function Di(t){var e=[],r=t.value,i=t.key,n=t.style,o=t.styleSpec;r.type||r.ref||e.push(new jt(i,r,'either "type" or "ref" is required'));var a,s=Gt(r.type),l=Gt(r.ref);if(r.id)for(var u=Gt(r.id),c=0;c<t.arrayIndex;c++){var p=n.layers[c];Gt(p.id)===u&&e.push(new jt(i,r.id,'duplicate layer id "'+r.id+'", previously used at line '+p.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new jt(i,r[t],'"'+t+'" is prohibited for ref layers'))})),n.layers.forEach((function(t){Gt(t.id)===l&&(a=t)})),a?a.ref?e.push(new jt(i,r.ref,"ref cannot reference another ref layer")):s=Gt(a.type):e.push(new jt(i,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var h=n.sources&&n.sources[r.source],f=h&&Gt(h.type);h?"vector"===f&&"raster"===s?e.push(new jt(i,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new jt(i,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new jt(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new jt(i,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new jt(i,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new jt(i,r.source,'source "'+r.source+'" not found'))}else e.push(new jt(i,r,'missing required property "source"'));return e=e.concat(di({key:i,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Vi({key:i+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:zi,layout:function(t){return di({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Mi(Zt({layerType:s},t))}}})},paint:function(t){return di({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Pi(Zt({layerType:s},t))}}})}}}))}function Li(t){var e=t.value,r=t.key,i=$r(e);return"string"!==i?[new jt(r,e,"string expected, "+i+" found")]:[]}var Ri={promoteId:function(t){var e=t.key,r=t.value;if("string"===$r(r))return Li({key:e,value:r});var i=[];for(var n in r)i.push.apply(i,Li({key:e+"."+n,value:r[n]}));return i}};function Bi(t){var e=t.value,r=t.key,i=t.styleSpec,n=t.style;if(!e.type)return[new jt(r,e,'"type" is required')];var o,a=Gt(e.type);switch(a){case"vector":case"raster":case"raster-dem":return di({key:r,value:e,valueSpec:i["source_"+a.replace("-","_")],style:t.style,styleSpec:i,objectElementValidators:Ri});case"geojson":if(o=di({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,objectElementValidators:Ri}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],u=l[0],c="string"==typeof u?[u,["accumulated"],["get",s]]:u;o.push.apply(o,gi({key:r+"."+s+".map",value:l[1],expressionContext:"cluster-map"})),o.push.apply(o,gi({key:r+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return di({key:r,value:e,valueSpec:i.source_video,style:n,styleSpec:i});case"image":return di({key:r,value:e,valueSpec:i.source_image,style:n,styleSpec:i});case"canvas":return[new jt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return vi({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:i})}}function Fi(t){var e=t.value,r=t.styleSpec,i=r.light,n=t.style,o=[],a=$r(e);if(void 0===e)return o;if("object"!==a)return o.concat([new jt("light",e,"object expected, "+a+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);o=o.concat(l&&i[l[1]]&&i[l[1]].transition?Vi({key:s,value:e[s],valueSpec:r.transition,style:n,styleSpec:r}):i[s]?Vi({key:s,value:e[s],valueSpec:i[s],style:n,styleSpec:r}):[new jt(s,e[s],'unknown property "'+s+'"')])}return o}var Oi={"*":function(){return[]},array:mi,boolean:function(t){var e=t.value,r=t.key,i=$r(e);return"boolean"!==i?[new jt(r,e,"boolean expected, "+i+" found")]:[]},number:yi,color:function(t){var e=t.key,r=t.value,i=$r(r);return"string"!==i?[new jt(e,r,"color expected, "+i+" found")]:null===ue(r)?[new jt(e,r,'color expected, "'+r+'" found')]:[]},constants:qt,enum:vi,filter:zi,function:_i,layer:Di,object:di,source:Bi,light:Fi,string:Li,formatted:function(t){return 0===Li(t).length?[]:gi(t)},resolvedImage:function(t){return 0===Li(t).length?[]:gi(t)}};function Vi(t){var e=t.value,r=t.valueSpec,i=t.styleSpec;return r.expression&&ti(Gt(e))?_i(t):r.expression&&li(Xt(e))?gi(t):r.type&&Oi[r.type]?Oi[r.type](t):di(Zt({},t,{valueSpec:r.type?i[r.type]:r}))}function Ui(t){var e=t.value,r=t.key,i=Li(t);return i.length||(-1===e.indexOf("{fontstack}")&&i.push(new jt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&i.push(new jt(r,e,'"glyphs" url must include a "{range}" token'))),i}function Ni(t,e){void 0===e&&(e=Nt);var r=[];return r=r.concat(Vi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Ui,"*":function(){return[]}}})),t.constants&&(r=r.concat(qt({key:"constants",value:t.constants,style:t,styleSpec:e}))),ji(r)}function ji(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function qi(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return ji(t.apply(this,e))}}Ni.source=qi(Bi),Ni.light=qi(Fi),Ni.layer=qi(Di),Ni.filter=qi(zi),Ni.paintProperty=qi(Pi),Ni.layoutProperty=qi(Mi);var Zi=Ni,Gi=Zi.light,Xi=Zi.paintProperty,Wi=Zi.layoutProperty;function Hi(t,e){var r=!1;if(e&&e.length)for(var i=0,n=e;i<n.length;i+=1)t.fire(new Vt(new Error(n[i].message))),r=!0;return r}var Ki=Yi;function Yi(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(r=n[2]);for(var o=0;o<this.d*this.d;o++){var a=n[3+o],s=n[3+o+1];i.push(a===s?null:n.subarray(a,s))}var l=n[3+i.length+1];this.keys=n.subarray(n[3+i.length],l),this.bboxes=n.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var u=0;u<this.d*this.d;u++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var c=r/e*t;this.min=-c,this.max=t+c}Yi.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},Yi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Yi.prototype._insertCell=function(t,e,r,i,n,o){this.cells[n].push(o)},Yi.prototype.query=function(t,e,r,i,n){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=r&&a<=i&&!n)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,i,this._queryCell,s,{},n),s},Yi.prototype._queryCell=function(t,e,r,i,n,o,a,s){var l=this.cells[n];if(null!==l)for(var u=this.keys,c=this.bboxes,p=0;p<l.length;p++){var h=l[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]&&r>=c[f+0]&&i>=c[f+1])?(a[h]=!0,o.push(u[h])):a[h]=!1}}},Yi.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(i),h=l;h<=c;h++)for(var f=u;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,r,i,d,o,a,s))return}},Yi.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Yi.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Yi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var n=new Int32Array(e+r+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 Ji=self.ImageData,Qi=self.ImageBitmap,$i={};function tn(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),$i[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var en in tn("Object",Object),Ki.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},Ki.deserialize=function(t){return new Ki(t.buffer)},tn("Grid",Ki),tn("Color",ce),tn("Error",Error),tn("ResolvedImage",de),tn("StylePropertyFunction",fi),tn("StyleExpression",si,{omit:["_evaluator"]}),tn("ZoomDependentExpression",pi),tn("ZoomConstantExpression",ci),tn("CompoundExpression",ze,{omit:["_evaluate"]}),qr)qr[en]._classRegistryKey||tn("Expression_"+en,qr[en]);function rn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function nn(t){return Qi&&t instanceof Qi}function on(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(rn(t)||nn(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Ji)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var i=[],n=0,o=t;n<o.length;n+=1)i.push(on(o[n],e));return i}if("object"==typeof t){var a=t.constructor,s=a._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var l=a.serialize?a.serialize(t,e):{};if(!a.serialize){for(var u in t)if(t.hasOwnProperty(u)&&!($i[s].omit.indexOf(u)>=0)){var c=t[u];l[u]=$i[s].shallow.indexOf(u)>=0?c:on(c,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof t)}function an(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||rn(t)||nn(t)||ArrayBuffer.isView(t)||t instanceof Ji)return t;if(Array.isArray(t))return t.map(an);if("object"==typeof t){var e=t.$name||"Object",r=$i[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),n=0,o=Object.keys(t);n<o.length;n+=1){var a=o[n];if("$name"!==a){var s=t[a];i[a]=$i[e].shallow.indexOf(a)>=0?s:an(s)}}return i}throw new Error("can't deserialize object of type "+typeof t)}var sn=function(){this.first=!0};sn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var ln=function(t){return t>=12288&&t<=12351},un=function(t){return t>=12352&&t<=12447},cn=function(t){return t>=12448&&t<=12543},pn=function(t){return t>=19968&&t<=40959},hn=function(t){return t>=44032&&t<=55215},fn=function(t){return t>=65072&&t<=65103},dn=function(t){return t>=65104&&t<=65135},mn=function(t){return t>=65280&&t<=65519};function yn(t){for(var e=0,r=t;e<r.length;e+=1)if(_n(r[e].charCodeAt(0)))return!0;return!1}function _n(t){return!(746!==t&&747!==t&&(t<4352||!(function(t){return t>=12704&&t<=12735}(t)||function(t){return t>=12544&&t<=12591}(t)||fn(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)||!(!ln(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||function(t){return t>=13312&&t<=19903}(t)||pn(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)||hn(t)||un(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)||cn(t)&&12540!==t||!(!mn(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)||!(!dn(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 gn(t){return!(_n(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)||ln(t)||cn(t)||function(t){return t>=57344&&t<=63743}(t)||fn(t)||dn(t)||mn(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function vn(t){return t>=1424&&t<=2303||function(t){return t>=64336&&t<=65023}(t)||function(t){return t>=65136&&t<=65279}(t)}function xn(t,e){return!(!e&&vn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||function(t){return t>=6016&&t<=6143}(t))}function bn(t){for(var e=0,r=t;e<r.length;e+=1)if(vn(r[e].charCodeAt(0)))return!0;return!1}var wn=null,Sn="unavailable",Tn=null,In=function(t){wn&&wn(t)};function En(){An.fire(new Ot("pluginStateChange",{pluginStatus:Sn,pluginURL:Tn}))}var An=new Ut,kn=function(){return Sn},zn=function(){if("deferred"!==Sn||!Tn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Sn="loading",En(),Tn&&Dt({url:Tn},(function(t){t?In(t):(Sn="loaded",En())}))},Cn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Sn||null!=Cn.applyArabicShaping},isLoading:function(){return"loading"===Sn},setState:function(t){Sn=t.pluginStatus,Tn=t.pluginURL},isParsed:function(){return null!=Cn.applyArabicShaping&&null!=Cn.processBidirectionalText&&null!=Cn.processStyledBidirectionalText},getPluginURL:function(){return Tn}},Pn=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 sn,this.transition={})};Pn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,i=t;r<i.length;r+=1)if(!xn(i[r].charCodeAt(0),e))return!1;return!0}(t,Cn.isLoaded())},Pn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Pn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Mn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(ti(t))return new fi(t,e);if(li(t)){var r=hi(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=ce.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification)};Mn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Mn.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Dn=function(t){this.property=t,this.value=new Mn(t,void 0)};Dn.prototype.transitioned=function(t,e){return new Rn(this.property,this.value,e,f({},t.transition,this.transition),t.now)},Dn.prototype.untransitioned=function(){return new Rn(this.property,this.value,null,{},0)};var Ln=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Ln.prototype.getValue=function(t){return S(this._values[t].value.value)},Ln.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Dn(this._values[t].property)),this._values[t].value=new Mn(this._values[t].property,null===e?void 0:S(e))},Ln.prototype.getTransition=function(t){return S(this._values[t].transition)},Ln.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Dn(this._values[t].property)),this._values[t].transition=S(e)||void 0},Ln.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n);var o=this.getTransition(i);void 0!==o&&(t[i+"-transition"]=o)}return t},Ln.prototype.transitioned=function(t,e){for(var r=new Bn(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},Ln.prototype.untransitioned=function(){for(var t=new Bn(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e];t._values[i]=this._values[i].untransitioned()}return t};var Rn=function(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)};Rn.prototype.possiblyEvaluate=function(t,e,r){var i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),o=this.prior;if(o){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return o.possiblyEvaluate(t,e,r);var a=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,r),n,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return n};var Bn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Bn.prototype.possiblyEvaluate=function(t,e){for(var r=new Vn(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];r._values[o]=this._values[o].possiblyEvaluate(t,e)}return r},Bn.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 Fn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Fn.prototype.getValue=function(t){return S(this._values[t].value)},Fn.prototype.setValue=function(t,e){this._values[t]=new Mn(this._values[t].property,null===e?void 0:S(e))},Fn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n)}return t},Fn.prototype.possiblyEvaluate=function(t,e){for(var r=new Vn(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];r._values[o]=this._values[o].possiblyEvaluate(t,e)}return r};var On=function(t,e,r){this.property=t,this.value=e,this.parameters=r};On.prototype.isConstant=function(){return"constant"===this.value.kind},On.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},On.prototype.evaluate=function(t,e,r,i){return this.property.evaluate(this.value,this.parameters,t,e,r,i)};var Vn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Vn.prototype.get=function(t){return this._values[t]};var Un=function(t){this.specification=t};Un.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Un.prototype.interpolate=function(t,e,r){var i=cr[this.specification.type];return i?i(t,e,r):t};var Nn=function(t,e){this.specification=t,this.overrides=e};Nn.prototype.possiblyEvaluate=function(t,e,r,i){return new On(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,i)}:t.expression,e)},Nn.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new On(this,{kind:"constant",value:void 0},t.parameters);var i=cr[this.specification.type];return i?new On(this,{kind:"constant",value:i(t.value.value,e.value.value,r)},t.parameters):t},Nn.prototype.evaluate=function(t,e,r,i,n,o){return"constant"===t.kind?t.value:t.evaluate(e,r,i,n,o)};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.possiblyEvaluate=function(t,e,r,i){if(void 0===t.value)return new On(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r,i),o="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,a=this._calculate(o,o,o,e);return new On(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 On(this,{kind:"constant",value:s},e)}return new On(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,i,n,o){if("source"===t.kind){var a=t.evaluate(e,r,i,n,o);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value},e.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Nn),qn=function(t){this.specification=t};qn.prototype.possiblyEvaluate=function(t,e,r,i){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new Pn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Pn(Math.floor(e.zoom),e)),t.expression.evaluate(new Pn(Math.floor(e.zoom+1),e)),e)}},qn.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},qn.prototype.interpolate=function(t){return t};var Zn=function(t){this.specification=t};Zn.prototype.possiblyEvaluate=function(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)},Zn.prototype.interpolate=function(){return!1};var Gn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var i=this.defaultPropertyValues[e]=new Mn(r,void 0),n=this.defaultTransitionablePropertyValues[e]=new Dn(r);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}};tn("DataDrivenProperty",Nn),tn("DataConstantProperty",Un),tn("CrossFadedDataDrivenProperty",jn),tn("CrossFadedProperty",qn),tn("ColorRampProperty",Zn);var Xn=function(t){function e(e,r){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),r.layout&&(this._unevaluatedLayout=new Fn(r.layout)),r.paint)){for(var i in this._transitionablePaint=new Ln(r.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}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,r){void 0===r&&(r={}),null!=e&&this._validate(Wi,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return x(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Xi,"layers."+this.id+".paint."+t,t,e,r))return!1;if(x(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],n="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),a=i.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,r){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,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,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),w(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,r,i,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Hi(this,t.call(Zi,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:Nt,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 On&&Yr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Ut),Wn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Hn=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},Kn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Yn(t,e){void 0===e&&(e=1);var r=0,i=0;return{members:t.map((function(t){var n=Wn[t.type].BYTES_PER_ELEMENT,o=r=Jn(r,Math.max(e,n)),a=t.components||1;return i=Math.max(i,n),r+=n*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Jn(r,Math.max(i,e)),alignment:e}}function Jn(t,e){return Math.ceil(t/e)*e}Kn.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Kn.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},Kn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Kn.prototype.clear=function(){this.length=0},Kn.prototype.resize=function(t){this.reserve(t),this.length=t},Kn.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)}},Kn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};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){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.int16[i+0]=e,this.int16[i+1]=r,t},e}(Kn);Qn.prototype.bytesPerElement=4,tn("StructArrayLayout2i4",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,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,t},e}(Kn);$n.prototype.bytesPerElement=8,tn("StructArrayLayout4i8",$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.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},e.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Kn);to.prototype.bytesPerElement=12,tn("StructArrayLayout2i4i12",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.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},e.prototype.emplace=function(t,e,r,i,n,o,a){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=o,this.uint8[l+7]=a,t},e}(Kn);eo.prototype.bytesPerElement=8,tn("StructArrayLayout2i4ub8",eo);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.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,o,a,s,l,u)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c){var p=9*t,h=18*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=i,this.uint16[p+3]=n,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=l,this.uint8[h+16]=u,this.uint8[h+17]=c,t},e}(Kn);ro.prototype.bytesPerElement=18,tn("StructArrayLayout8ui2ub18",ro);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,r,i,n,o,a,s,l,u,c,p){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,o,a,s,l,u,c,p)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c,p,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=i,this.int16[f+3]=n,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=p,this.int16[f+11]=h,t},e}(Kn);io.prototype.bytesPerElement=24,tn("StructArrayLayout4i4ui4i24",io);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.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t},e}(Kn);no.prototype.bytesPerElement=12,tn("StructArrayLayout3f12",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.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}(Kn);oo.prototype.bytesPerElement=4,tn("StructArrayLayout1ul4",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),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,l,u,c){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,i,n,o,a,s,l,u,c)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c,p){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=o,this.int16[h+5]=a,this.uint32[f+3]=s,this.uint16[h+8]=l,this.uint16[h+9]=u,this.int16[h+10]=c,this.int16[h+11]=p,t},e}(Kn);ao.prototype.bytesPerElement=24,tn("StructArrayLayout6i1ul2ui2i24",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.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},e.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Kn);so.prototype.bytesPerElement=12,tn("StructArrayLayout2i2i2i12",so);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.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=i,this.float32[a+2]=n,t},e}(Kn);lo.prototype.bytesPerElement=12,tn("StructArrayLayout2ub2f12",lo);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.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,r,i,n,o,a,s,l,u,c,p,h,f,d,m,y){var _=this.length;return this.resize(_+1),this.emplace(_,t,e,r,i,n,o,a,s,l,u,c,p,h,f,d,m,y)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,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]=r,this.uint16[g+2]=i,this.uint16[g+3]=n,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=u,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}(Kn);uo.prototype.bytesPerElement=48,tn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",uo);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,r,i,n,o,a,s,l,u,c,p,h,f,d,m,y,_,g,v,x,b,w,S,T,I){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,i,n,o,a,s,l,u,c,p,h,f,d,m,y,_,g,v,x,b,w,S,T,I)},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c,p,h,f,d,m,y,_,g,v,x,b,w,S,T,I,E){var A=30*t,k=15*t;return this.int16[A+0]=e,this.int16[A+1]=r,this.int16[A+2]=i,this.int16[A+3]=n,this.int16[A+4]=o,this.int16[A+5]=a,this.int16[A+6]=s,this.int16[A+7]=l,this.uint16[A+8]=u,this.uint16[A+9]=c,this.uint16[A+10]=p,this.uint16[A+11]=h,this.uint16[A+12]=f,this.uint16[A+13]=d,this.uint16[A+14]=m,this.uint16[A+15]=y,this.uint16[A+16]=_,this.uint16[A+17]=g,this.uint16[A+18]=v,this.uint16[A+19]=x,this.uint16[A+20]=b,this.uint16[A+21]=w,this.uint32[k+11]=S,this.float32[k+12]=T,this.float32[k+13]=I,this.float32[k+14]=E,t},e}(Kn);co.prototype.bytesPerElement=60,tn("StructArrayLayout8i14ui1ul3f60",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.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}(Kn);po.prototype.bytesPerElement=4,tn("StructArrayLayout1f4",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.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t},e}(Kn);ho.prototype.bytesPerElement=6,tn("StructArrayLayout3i6",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.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=r,this.uint16[n+3]=i,t},e}(Kn);fo.prototype.bytesPerElement=8,tn("StructArrayLayout1ul2ui8",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.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t},e}(Kn);mo.prototype.bytesPerElement=6,tn("StructArrayLayout3ui6",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 r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,t},e}(Kn);yo.prototype.bytesPerElement=4,tn("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}(Kn);_o.prototype.bytesPerElement=2,tn("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){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var i=2*t;return this.float32[i+0]=e,this.float32[i+1]=r,t},e}(Kn);go.prototype.bytesPerElement=8,tn("StructArrayLayout2f8",go);var vo=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,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=i,this.float32[o+3]=n,t},e}(Kn);vo.prototype.bytesPerElement=16,tn("StructArrayLayout4f16",vo);var xo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={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},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Hn);xo.prototype.size=24;var bo=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 xo(this,t)},e}(ao);tn("CollisionBoxArray",bo);var wo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={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 r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Hn);wo.prototype.size=48;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 wo(this,t)},e}(uo);tn("PlacedSymbolArray",So);var To=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={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},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+11]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},Object.defineProperties(e.prototype,r),e}(Hn);To.prototype.size=60;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.get=function(t){return new To(this,t)},e}(co);tn("SymbolInstanceArray",Io);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.getoffsetX=function(t){return this.float32[1*t+0]},e}(po);tn("GlyphOffsetArray",Eo);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}(ho);tn("SymbolLineVertexArray",Ao);var ko=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Hn);ko.prototype.size=8;var zo=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 ko(this,t)},e}(fo);tn("FeatureIndexArray",zo);var Co=Yn([{name:"a_pos",components:2,type:"Int16"}],4).members,Po=function(t){void 0===t&&(t=[]),this.segments=t};function Mo(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}Po.prototype.prepareSegment=function(t,e,r,i){var n=this.segments[this.segments.length-1];return t>Po.MAX_VERTEX_ARRAY_LENGTH&&I("Max vertices per segment is "+Po.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Po.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n},Po.prototype.get=function(){return this.segments},Po.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var i in r.vaos)r.vaos[i].destroy()}},Po.simpleSegment=function(t,e,r,i){return new Po([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])},Po.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,tn("SegmentVector",Po);var Do=t((function(t){t.exports=function(t,e){var r,i,n,o,a,s,l,u;for(i=t.length-(r=3&t.length),n=e,a=3432918353,s=461845907,u=0;u<i;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,n=27492+(65535&(o=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>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 r,i=t.length,n=e^i,o=0;i>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++o;switch(i){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}})),Ro=Do,Bo=Lo;Ro.murmur3=Do,Ro.murmur2=Bo;var Fo=function(){this.ids=[],this.positions=[],this.indexed=!1};Fo.prototype.add=function(t,e,r,i){this.ids.push(Vo(t)),this.positions.push(e,r,i)},Fo.prototype.getPositions=function(t){for(var e=Vo(t),r=0,i=this.ids.length-1;r<i;){var n=r+i>>1;this.ids[n]>=e?i=n:r=n+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},Fo.serialize=function(t,e){var r=new Float64Array(t.ids),i=new Uint32Array(t.positions);return function t(e,r,i,n){if(!(i>=n)){for(var o=e[i+n>>1],a=i-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(r,3*a,3*s),Uo(r,3*a+1,3*s+1),Uo(r,3*a+2,3*s+2)}t(e,r,i,s),t(e,r,s+1,n)}}(r,i,0,r.length-1),e&&e.push(r.buffer,i.buffer),{ids:r,positions:i}},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:Ro(String(t))}function Uo(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}tn("FeaturePositionMap",Fo);var No=function(t,e){this.gl=t.gl,this.location=e},jo=function(t){function e(e,r){t.call(this,e,r),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}(No),qo=function(t){function e(e,r){t.call(this,e,r),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}(No),Zo=function(t){function e(e,r){t.call(this,e,r),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}(No),Go=function(t){function e(e,r){t.call(this,e,r),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}(No),Xo=function(t){function e(e,r){t.call(this,e,r),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}(No),Wo=function(t){function e(e,r){t.call(this,e,r),this.current=ce.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}(No),Ho=new Float32Array(16),Ko=function(t){function e(e,r){t.call(this,e,r),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}(No);function Yo(t){return[Mo(255*t.r,255*t.g),Mo(255*t.b,255*t.a)]}var Jo=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r};Jo.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},Jo.prototype.getBinding=function(t,e,r){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,r,i){var n="u_pattern_to"===i?this.patternTo:"u_pattern_from"===i?this.patternFrom:"u_pixel_ratio_to"===i?this.pixelRatioTo:"u_pixel_ratio_from"===i?this.pixelRatioFrom:null;n&&t.set(n)},Qo.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new Xo(t,e):new qo(t,e)};var $o=function(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new i};$o.prototype.populatePaintArray=function(t,e,r,i,n){var o=this.paintVertexArray.length,a=this.expression.evaluate(new Pn(0),e,{},i,[],n);this.paintVertexArray.resize(t),this._setPaintValue(o,t,a)},$o.prototype.updatePaintArray=function(t,e,r,i){var n=this.expression.evaluate({zoom:0},r,i);this._setPaintValue(t,e,n)},$o.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var i=Yo(r),n=t;n<e;n++)this.paintVertexArray.emplace(n,i[0],i[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},$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,r,i,n,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new o};ta.prototype.populatePaintArray=function(t,e,r,i,n){var o=this.expression.evaluate(new Pn(this.zoom),e,{},i,[],n),a=this.expression.evaluate(new Pn(this.zoom+1),e,{},i,[],n),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,o,a)},ta.prototype.updatePaintArray=function(t,e,r,i){var n=this.expression.evaluate({zoom:this.zoom},r,i),o=this.expression.evaluate({zoom:this.zoom+1},r,i);this._setPaintValue(t,e,n,o)},ta.prototype._setPaintValue=function(t,e,r,i){if("color"===this.type)for(var n=Yo(r),o=Yo(i),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,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}},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 r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,i=u(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(i)},ta.prototype.getBinding=function(t,e,r){return new qo(t,e)};var ea=function(t,e,r,i,n,o,a){this.expression=t,this.type=r,this.useIntegerZoom=i,this.zoom=n,this.layerId=a,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};ea.prototype.populatePaintArray=function(t,e,r){var i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,e.patterns&&e.patterns[this.layerId],r)},ea.prototype.updatePaintArray=function(t,e,r,i,n){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],n)},ea.prototype._setPaintValues=function(t,e,r,i){if(i&&r){var n=i[r.min],o=i[r.mid],a=i[r.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,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ea.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var ra=function(t,e,r,i){this.binders={},this.layoutAttributes=i,this._buffers=[];var n=[];for(var o in t.paint._values)if(r(o)){var a=t.paint.get(o);if(a instanceof On&&Yr(a.property.specification)){var s=na(o,t.type),l=a.value,u=a.property.specification.type,c=a.property.useIntegerZoom,p=a.property.specification["property-type"],h="cross-faded"===p||"cross-faded-data-driven"===p;if("constant"===l.kind)this.binders[o]=h?new Qo(l.value,s):new Jo(l.value,s,u),n.push("/u_"+o);else if("source"===l.kind||h){var f=oa(o,u,"source");this.binders[o]=h?new ea(l,s,u,c,e,f,t.id):new $o(l,s,u,f),n.push("/a_"+o)}else{var d=oa(o,u,"composite");this.binders[o]=new ta(l,s,u,c,e,d),n.push("/z_"+o)}}}this.cacheKey=n.sort().join("")};ra.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof $o||e instanceof ta?e.maxValue:0},ra.prototype.populatePaintArrays=function(t,e,r,i,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,r,i,n)}},ra.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var i=this.binders[r];i instanceof Qo&&i.setConstantPatternPositions(t,e)}},ra.prototype.updatePaintArrays=function(t,e,r,i,n){var o=!1;for(var a in t)for(var s=0,l=e.getPositions(a);s<l.length;s+=1){var u=l[s],c=r.feature(u.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=i.paint.get(p);h.expression=f.value,h.updatePaintArray(u.start,u.end,c,t[a],n),o=!0}}}return o},ra.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof Jo||r instanceof Qo)&&t.push.apply(t,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},ra.prototype.getPaintVertexBuffers=function(){return this._buffers},ra.prototype.getUniforms=function(t,e){var r=[];for(var i in this.binders){var n=this.binders[i];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 l=n.getBinding(t,e[s],s);r.push({name:s,property:i,binding:l})}}}return r},ra.prototype.setUniforms=function(t,e,r,i){for(var n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.name,l=a.property;this.binders[l].setUniform(a.binding,i,r.get(l),s)}},ra.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof ea){var i=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof $o||r instanceof ta)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},ra.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof $o||r instanceof ta||r instanceof ea)&&r.upload(t)}this.updatePaintBuffers()},ra.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 ia=function(t,e,r,i){void 0===i&&(i=function(){return!0}),this.programConfigurations={};for(var n=0,o=e;n<o.length;n+=1){var a=o[n];this.programConfigurations[a.id]=new ra(a,r,i,t)}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,r){var i={color:{source:go,composite:vo},number:{source:po,composite:go}},n=function(t){return{"line-pattern":{source:ro,composite:ro},"fill-pattern":{source:ro,composite:ro},"fill-extrusion-pattern":{source:ro,composite:ro}}[t]}(t);return n&&n[r]||i[e][r]}ia.prototype.populatePaintArrays=function(t,e,r,i,n,o){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,i,n,o);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},ia.prototype.updatePaintArrays=function(t,e,r,i){for(var n=0,o=r;n<o.length;n+=1){var a=o[n];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,i)||this.needsUpload}},ia.prototype.get=function(t){return this.programConfigurations[t]},ia.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},ia.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},tn("ConstantBinder",Jo),tn("CrossFadedConstantBinder",Qo),tn("SourceExpressionBinder",$o),tn("CrossFadedCompositeBinder",ea),tn("CompositeExpressionBinder",ta),tn("ProgramConfiguration",ra,{omit:["_buffers"]}),tn("ProgramConfigurationSet",ia);var aa={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function sa(t){for(var e=8192/t.extent,r=t.loadGeometry(),i=0;i<r.length;i++)for(var n=r[i],o=0;o<n.length;o++){var a=n[o];a.x=Math.round(a.x*e),a.y=Math.round(a.y*e),(a.x<aa.min||a.x>aa.max||a.y<aa.min||a.y>aa.max)&&(I("Geometry exceeds allowed extent, reduce your vector tile buffer size"),a.x=u(a.x,aa.min,aa.max),a.y=u(a.y,aa.min,aa.max))}return r}function la(t,e,r,i,n){t.emplaceBack(2*e+(i+1)/2,2*r+(n+1)/2)}var ua=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 mo,this.segments=new Po,this.programConfigurations=new ia(Co,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ca(t,e){for(var r=0;r<t.length;r++)if(va(e,t[r]))return!0;for(var i=0;i<e.length;i++)if(va(t,e[i]))return!0;return!!da(t,e)}function pa(t,e,r){return!!va(t,e)||!!ya(e,t,r)}function ha(t,e){if(1===t.length)return ga(e,t[0]);for(var r=0;r<e.length;r++)for(var i=e[r],n=0;n<i.length;n++)if(va(t,i[n]))return!0;for(var o=0;o<t.length;o++)if(ga(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(da(t,e[a]))return!0;return!1}function fa(t,e,r){if(t.length>1){if(da(t,e))return!0;for(var i=0;i<e.length;i++)if(ya(e[i],t,r))return!0}for(var n=0;n<t.length;n++)if(ya(t[n],e,r))return!0;return!1}function da(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var i=t[r],n=t[r+1],o=0;o<e.length-1;o++)if(ma(i,n,e[o],e[o+1]))return!0;return!1}function ma(t,e,r,i){return E(t,r,i)!==E(e,r,i)&&E(t,e,r)!==E(t,e,i)}function ya(t,e,r){var i=r*r;if(1===e.length)return t.distSqr(e[0])<i;for(var n=1;n<e.length;n++)if(_a(t,e[n-1],e[n])<i)return!0;return!1}function _a(t,e,r){var i=e.distSqr(r);if(0===i)return t.distSqr(e);var n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;return t.distSqr(n<0?e:n>1?r:r.sub(e)._mult(n)._add(e))}function ga(t,e){for(var r,i,n,o=!1,a=0;a<t.length;a++)for(var s=0,l=(r=t[a]).length-1;s<r.length;l=s++)(i=r[s]).y>e.y!=(n=r[l]).y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(o=!o);return o}function va(t,e){for(var r=!1,i=0,n=t.length-1;i<t.length;n=i++){var o=t[i],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&&(r=!r)}return r}function xa(t,e,r){var i=r[0],n=r[2];if(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y)return!1;var o=E(t,e,r[0]);return o!==E(t,e,r[1])||o!==E(t,e,r[2])||o!==E(t,e,r[3])}function ba(t,e,r){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function wa(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Sa(t,e,r,i,o){if(!e[0]&&!e[1])return t;var a=n.convert(e)._mult(o);"viewport"===r&&a._rotate(-i);for(var s=[],l=0;l<t.length;l++)s.push(t[l].sub(a));return s}ua.prototype.populate=function(t,e,r){var i=this.layers[0],n=[],o=null;"circle"===i.type&&(o=i.layout.get("circle-sort-key"));for(var a=0,s=t;a<s.length;a+=1){var l=s[a],u=l.feature,c=l.id,p=l.index,h=l.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d={type:u.type,id:c,properties:u.properties,geometry:f?sa(u):[]};if(this.layers[0]._featureFilter.filter(new Pn(this.zoom),d,r)){f||(d.geometry=sa(u));var m=o?o.evaluate(d,{},r):void 0;n.push({id:c,properties:u.properties,type:u.type,sourceLayerIndex:h,index:p,geometry:d.geometry,patterns:{},sortKey:m})}}o&&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,w=t[x].feature;this.addFeature(g,v,x,r),e.featureIndex.insert(w,v,x,b,this.index)}},ua.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ua.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ua.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ua.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Co),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},ua.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ua.prototype.addFeature=function(t,e,r,i){for(var n=0,o=e;n<o.length;n+=1)for(var a=0,s=o[n];a<s.length;a+=1){var l=s[a],u=l.x,c=l.y;if(!(u<0||u>=8192||c<0||c>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=p.vertexLength;la(this.layoutVertexArray,u,c,-1,-1),la(this.layoutVertexArray,u,c,1,-1),la(this.layoutVertexArray,u,c,1,1),la(this.layoutVertexArray,u,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,r,{},i)},tn("CircleBucket",ua,{omit:["layers"]});var Ta=new Gn({"circle-sort-key":new Nn(Nt.layout_circle["circle-sort-key"])}),Ia={paint:new Gn({"circle-radius":new Nn(Nt.paint_circle["circle-radius"]),"circle-color":new Nn(Nt.paint_circle["circle-color"]),"circle-blur":new Nn(Nt.paint_circle["circle-blur"]),"circle-opacity":new Nn(Nt.paint_circle["circle-opacity"]),"circle-translate":new Un(Nt.paint_circle["circle-translate"]),"circle-translate-anchor":new Un(Nt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Un(Nt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Un(Nt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Nn(Nt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Nn(Nt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Nn(Nt.paint_circle["circle-stroke-opacity"])}),layout:Ta},Ea="undefined"!=typeof Float32Array?Float32Array:Array;function Aa(){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 ka(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 za(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=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=r*s-i*a,v=r*l-n*a,x=r*u-o*a,b=i*l-n*s,w=i*u-o*s,S=n*u-o*l,T=c*m-p*d,I=c*y-h*d,E=c*_-f*d,A=p*y-h*m,k=p*_-f*m,z=h*_-f*y,C=g*z-v*k+x*A+b*E-w*I+S*T;return C?(t[0]=(s*z-l*k+u*A)*(C=1/C),t[1]=(n*k-i*z-o*A)*C,t[2]=(m*S-y*w+_*b)*C,t[3]=(h*w-p*S-f*b)*C,t[4]=(l*E-a*z-u*I)*C,t[5]=(r*z-n*E+o*I)*C,t[6]=(y*x-d*S-_*v)*C,t[7]=(c*S-h*x+f*v)*C,t[8]=(a*k-s*E+u*T)*C,t[9]=(i*E-r*k-o*T)*C,t[10]=(d*w-m*x+_*g)*C,t[11]=(p*x-c*w-f*g)*C,t[12]=(s*I-a*A-l*T)*C,t[13]=(r*A-i*I+n*T)*C,t[14]=(m*v-d*b-y*g)*C,t[15]=(c*b-p*v+h*g)*C,t):null}function Ca(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=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=r[0],x=r[1],b=r[2],w=r[3];return t[0]=v*i+x*s+b*p+w*m,t[1]=v*n+x*l+b*h+w*y,t[2]=v*o+x*u+b*f+w*_,t[3]=v*a+x*c+b*d+w*g,t[4]=(v=r[4])*i+(x=r[5])*s+(b=r[6])*p+(w=r[7])*m,t[5]=v*n+x*l+b*h+w*y,t[6]=v*o+x*u+b*f+w*_,t[7]=v*a+x*c+b*d+w*g,t[8]=(v=r[8])*i+(x=r[9])*s+(b=r[10])*p+(w=r[11])*m,t[9]=v*n+x*l+b*h+w*y,t[10]=v*o+x*u+b*f+w*_,t[11]=v*a+x*c+b*d+w*g,t[12]=(v=r[12])*i+(x=r[13])*s+(b=r[14])*p+(w=r[15])*m,t[13]=v*n+x*l+b*h+w*y,t[14]=v*o+x*u+b*f+w*_,t[15]=v*a+x*c+b*d+w*g,t}function Pa(t,e,r){var i,n,o,a,s,l,u,c,p,h,f,d,m=r[0],y=r[1],_=r[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],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],t[0]=i=e[0],t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=i*m+s*y+p*_+e[12],t[13]=n*m+l*y+h*_+e[13],t[14]=o*m+u*y+f*_+e[14],t[15]=a*m+c*y+d*_+e[15]),t}function Ma(t,e,r){var i=r[0],n=r[1],o=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,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 Da(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=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+u*i,t[1]=a*n+c*i,t[2]=s*n+p*i,t[3]=l*n+h*i,t[4]=u*n-o*i,t[5]=c*n-a*i,t[6]=p*n-s*i,t[7]=h*n-l*i,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var La=function(t,e,r,i,n,o,a){var s=1/(e-r),l=1/(i-n),u=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(n+i)*l,t[14]=(a+o)*u,t[15]=1,t};function Ra(t){var e=new Ea(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}var Ba,Fa=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};function Oa(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*a,t[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*a,t[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*a,t[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*a,t}Ba=new Ea(3),Ea!=Float32Array&&(Ba[0]=0,Ba[1]=0,Ba[2]=0),function(){var t=new Ea(4);Ea!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Va=function(t){var e=t[0],r=t[1];return e*e+r*r},Ua=(function(){var t=new Ea(2);Ea!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,Ia)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new ua(t)},e.prototype.queryRadius=function(t){var e=t;return ba("circle-radius",this,e)+ba("circle-stroke-width",this,e)+wa(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a,s){for(var l=Sa(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),p=c?l:function(t,e){return t.map((function(t){return Na(t,e)}))}(l,s),h=c?u*a:u,f=0,d=i;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1){var _=y[m],g=c?_:Na(_,s),v=h,x=Oa([],[_.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]),pa(p,g,v))return!0}return!1},e}(Xn));function Na(t,e){var r=Oa([],[t.x,t.y,0,1],e);return new n(r[0]/r[3],r[1]/r[3])}var ja=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(ua);function qa(t,e,r,i){var n=e.width,o=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==n*o*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*o*r);return t.width=n,t.height=o,t.data=i,t}function Za(t,e,r){var i=e.width,n=e.height;if(i!==t.width||n!==t.height){var o=qa({},{width:i,height:n},r);Ga(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,n)},r),t.width=i,t.height=n,t.data=o.data}}function Ga(t,e,r,i,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.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||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,l=0;l<n.height;l++)for(var u=((r.y+l)*t.width+r.x)*o,c=((i.y+l)*e.width+i.x)*o,p=0;p<n.width*o;p++)s[c+p]=a[u+p];return e}tn("HeatmapBucket",ja,{omit:["layers"]});var Xa=function(t,e){qa(this,t,1,e)};Xa.prototype.resize=function(t){Za(this,t,1)},Xa.prototype.clone=function(){return new Xa({width:this.width,height:this.height},new Uint8Array(this.data))},Xa.copy=function(t,e,r,i,n){Ga(t,e,r,i,n,1)};var Wa=function(t,e){qa(this,t,4,e)};Wa.prototype.resize=function(t){Za(this,t,4)},Wa.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},Wa.prototype.clone=function(){return new Wa({width:this.width,height:this.height},new Uint8Array(this.data))},Wa.copy=function(t,e,r,i,n){Ga(t,e,r,i,n,4)},tn("AlphaImage",Xa),tn("RGBAImage",Wa);var Ha={paint:new Gn({"heatmap-radius":new Nn(Nt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Nn(Nt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Un(Nt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Zn(Nt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Un(Nt.paint_heatmap["heatmap-opacity"])})};function Ka(t,e){for(var r=new Uint8Array(1024),i={},n=0,o=0;n<256;n++,o+=4){i[e]=n/255;var a=t.evaluate(i);r[o+0]=Math.floor(255*a.r/a.a),r[o+1]=Math.floor(255*a.g/a.a),r[o+2]=Math.floor(255*a.b/a.a),r[o+3]=Math.floor(255*a.a)}return new Wa({width:256,height:1},r)}var Ya=function(t){function e(e){t.call(this,e,Ha),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new ja(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=Ka(this._transitionablePaint._values["heatmap-color"].value.expression,"heatmapDensity"),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}(Xn),Ja={paint:new Gn({"hillshade-illumination-direction":new Un(Nt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Un(Nt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Un(Nt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Un(Nt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Un(Nt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Un(Nt.paint_hillshade["hillshade-accent-color"])})},Qa=function(t){function e(e){t.call(this,e,Ja)}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}(Xn),$a=Yn([{name:"a_pos",components:2,type:"Int16"}],4).members,ts=rs,es=rs;function rs(t,e,r){r=r||2;var i,n,o,a,s,l,u,c=e&&e.length,p=c?e[0]*r:t.length,h=is(t,0,p,r,!0),f=[];if(!h||h.next===h.prev)return f;if(c&&(h=function(t,e,r,i){var n,o,a,s=[];for(n=0,o=e.length;n<o;n++)(a=is(t,e[n]*i,n<o-1?e[n+1]*i:t.length,i,!1))===a.next&&(a.steiner=!0),s.push(ds(a));for(s.sort(cs),n=0;n<s.length;n++)r=ps(s[n],r);return r}(t,e,h,r)),t.length>80*r){i=o=t[0],n=a=t[1];for(var d=r;d<p;d+=r)(s=t[d])<i&&(i=s),(l=t[d+1])<n&&(n=l),s>o&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-i,a-n))?32767/u:0}return os(h,f,r,i,n,u,0),f}function is(t,e,r,i,n){var o,a;if(n===As(t,e,r,i)>0)for(o=e;o<r;o+=i)a=Ts(o,t[o],t[o+1],a);else for(o=r-i;o>=e;o-=i)a=Ts(o,t[o],t[o+1],a);return a&&gs(a,a.next)&&(Is(a),a=a.next),a}function ns(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!gs(i,i.next)&&0!==_s(i.prev,i,i.next))i=i.next;else{if(Is(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function os(t,e,r,i,n,o,a){if(t){!a&&o&&function(t,e,r,i){var n=t;do{0===n.z&&(n.z=fs(n.x,n.y,e,r,i)),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,r,i,n,o,a,s,l,u=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,i=r,s=0,e=0;e<u&&(s++,i=i.nextZ);e++);for(l=u;s>0||l>0&&i;)0!==s&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(a>1)}(n)}(t,i,n,o);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?ss(t,i,n,o):as(t))e.push(s.i/r|0),e.push(t.i/r|0),e.push(l.i/r|0),Is(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?os(t=ls(ns(t),e,r),e,r,i,n,o,2):2===a&&us(t,e,r,i,n,o):os(ns(t),e,r,i,n,o,1);break}}}function as(t){var e=t.prev,r=t,i=t.next;if(_s(e,r,i)>=0)return!1;for(var n=e.x,o=r.x,a=i.x,s=e.y,l=r.y,u=i.y,c=n<o?n<a?n:a:o<a?o:a,p=s<l?s<u?s:u:l<u?l:u,h=n>o?n>a?n:a:o>a?o:a,f=s>l?s>u?s:u:l>u?l:u,d=i.next;d!==e;){if(d.x>=c&&d.x<=h&&d.y>=p&&d.y<=f&&ms(n,s,o,l,a,u,d.x,d.y)&&_s(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function ss(t,e,r,i){var n=t.prev,o=t,a=t.next;if(_s(n,o,a)>=0)return!1;for(var s=n.x,l=o.x,u=a.x,c=n.y,p=o.y,h=a.y,f=s<l?s<u?s:u:l<u?l:u,d=c<p?c<h?c:h:p<h?p:h,m=s>l?s>u?s:u:l>u?l:u,y=c>p?c>h?c:h:p>h?p:h,_=fs(f,d,e,r,i),g=fs(m,y,e,r,i),v=t.prevZ,x=t.nextZ;v&&v.z>=_&&x&&x.z<=g;){if(v.x>=f&&v.x<=m&&v.y>=d&&v.y<=y&&v!==n&&v!==a&&ms(s,c,l,p,u,h,v.x,v.y)&&_s(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=f&&x.x<=m&&x.y>=d&&x.y<=y&&x!==n&&x!==a&&ms(s,c,l,p,u,h,x.x,x.y)&&_s(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=_;){if(v.x>=f&&v.x<=m&&v.y>=d&&v.y<=y&&v!==n&&v!==a&&ms(s,c,l,p,u,h,v.x,v.y)&&_s(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=g;){if(x.x>=f&&x.x<=m&&x.y>=d&&x.y<=y&&x!==n&&x!==a&&ms(s,c,l,p,u,h,x.x,x.y)&&_s(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function ls(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!gs(n,o)&&vs(n,i,i.next,o)&&ws(n,o)&&ws(o,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(o.i/r|0),Is(i),Is(i.next),i=t=o),i=i.next}while(i!==t);return ns(i)}function us(t,e,r,i,n,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ys(a,s)){var l=Ss(a,s);return a=ns(a,a.next),l=ns(l,l.next),os(a,e,r,i,n,o,0),void os(l,e,r,i,n,o,0)}s=s.next}a=a.next}while(a!==t)}function cs(t,e){return t.x-e.x}function ps(t,e){var r=function(t,e){var r,i=e,n=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a&&(a=s,r=i.x<i.next.x?i:i.next,s===n))return r}i=i.next}while(i!==e);if(!r)return null;var l,u=r,c=r.x,p=r.y,h=1/0;i=r;do{n>=i.x&&i.x>=c&&n!==i.x&&ms(o<p?n:a,o,c,p,o<p?a:n,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(n-i.x),ws(i,t)&&(l<h||l===h&&(i.x>r.x||i.x===r.x&&hs(r,i)))&&(r=i,h=l)),i=i.next}while(i!==u);return r}(t,e);if(!r)return e;var i=Ss(r,t);return ns(i,i.next),ns(r,r.next)}function hs(t,e){return _s(t.prev,t,e.prev)<0&&_s(e.next,t,t.next)<0}function fs(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ds(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function ms(t,e,r,i,n,o,a,s){return(n-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(i-s)>=(r-a)*(e-s)&&(r-a)*(o-s)>=(n-a)*(i-s)}function ys(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&vs(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ws(t,e)&&ws(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(_s(t.prev,t,e.prev)||_s(t,e.prev,e))||gs(t,e)&&_s(t.prev,t,t.next)>0&&_s(e.prev,e,e.next)>0)}function _s(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function gs(t,e){return t.x===e.x&&t.y===e.y}function vs(t,e,r,i){var n=bs(_s(t,e,r)),o=bs(_s(t,e,i)),a=bs(_s(r,i,t)),s=bs(_s(r,i,e));return n!==o&&a!==s||!(0!==n||!xs(t,r,e))||!(0!==o||!xs(t,i,e))||!(0!==a||!xs(r,t,i))||!(0!==s||!xs(r,e,i))}function xs(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function bs(t){return t>0?1:t<0?-1:0}function ws(t,e){return _s(t.prev,t,t.next)<0?_s(t,e,t.next)>=0&&_s(t,t.prev,e)>=0:_s(t,e,t.prev)<0||_s(t,t.next,e)<0}function Ss(t,e){var r=new Es(t.i,t.x,t.y),i=new Es(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function Ts(t,e,r,i){var n=new Es(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Is(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 Es(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function As(t,e,r,i){for(var n=0,o=e,a=r-i;o<r;o+=i)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}function ks(t,e,r,i,n){!function t(e,r,i,n,o){for(;n>i;){if(n-i>600){var a=n-i+1,s=r-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(i,Math.floor(r-s*u/a+c)),Math.min(n,Math.floor(r+(a-s)*u/a+c)),o)}var p=e[r],h=i,f=n;for(zs(e,i,r),o(e[n],p)>0&&zs(e,i,n);h<f;){for(zs(e,h,f),h++,f--;o(e[h],p)<0;)h++;for(;o(e[f],p)>0;)f--}0===o(e[i],p)?zs(e,i,f):zs(e,++f,n),f<=r&&(i=f+1),r<=f&&(n=f-1)}}(t,e,r||0,i||t.length-1,n||Cs)}function zs(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function Cs(t,e){return t<e?-1:t>e?1:0}function Ps(t,e){var r=t.length;if(r<=1)return[t];for(var i,n,o=[],a=0;a<r;a++){var s=A(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(i&&o.push(i),i=[t[a]]):i.push(t[a]))}if(i&&o.push(i),e>1)for(var l=0;l<o.length;l++)o[l].length<=e||(ks(o[l],e,1,o[l].length-1,Ms),o[l]=o[l].slice(0,e));return o}function Ms(t,e){return e.area-t.area}function Ds(t,e,r){for(var i=r.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 l=s.constantOr(null);l&&(n=!0,i[l.to]=!0,i[l.from]=!0)}return n}function Ls(t,e,r,i,n){for(var o=n.patternDependencies,a=0,s=e;a<s.length;a+=1){var l=s[a],u=l.paint.get(t+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:i-1},r,{},n.availableImages),p=u.evaluate({zoom:i},r,{},n.availableImages),h=u.evaluate({zoom:i+1},r,{},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,r.patterns[l.id]={min:c,mid:p,max:h}}}return r}rs.deviation=function(t,e,r,i){var n=e&&e.length,o=Math.abs(As(t,0,n?e[0]*r:t.length,r));if(n)for(var a=0,s=e.length;a<s;a++)o-=Math.abs(As(t,e[a]*r,a<s-1?e[a+1]*r:t.length,r));var l=0;for(a=0;a<i.length;a+=3){var u=i[a]*r,c=i[a+1]*r,p=i[a+2]*r;l+=Math.abs((t[u]-t[p])*(t[c+1]-t[u+1])-(t[u]-t[c])*(t[p+1]-t[u+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},rs.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[n][o][a]);n>0&&r.holes.push(i+=t[n-1].length)}return r},ts.default=es;var Rs=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 Qn,this.indexArray=new mo,this.indexArray2=new yo,this.programConfigurations=new ia($a,t.layers,t.zoom),this.segments=new Po,this.segments2=new Po,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Rs.prototype.populate=function(t,e,r){this.hasPattern=Ds("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),n=[],o=0,a=t;o<a.length;o+=1){var s=a[o],l=s.feature,u=s.id,c=s.index,p=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:l.type,id:u,properties:l.properties,geometry:h?sa(l):[]};if(this.layers[0]._featureFilter.filter(new Pn(this.zoom),f,r)){h||(f.geometry=sa(l));var d=i?i.evaluate(f,{},r,e.availableImages):void 0;n.push({id:u,properties:l.properties,type:l.type,sourceLayerIndex:p,index:c,geometry:f.geometry,patterns:{},sortKey:d})}}i&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,y=n;m<y.length;m+=1){var _=y[m],g=_.geometry,v=_.index,x=_.sourceLayerIndex;if(this.hasPattern){var b=Ls("fill",this.layers,_,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(_,g,v,r,{});e.featureIndex.insert(t[v].feature,g,v,x,this.index)}},Rs.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Rs.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.patternFeatures;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},Rs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Rs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Rs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,$a),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Rs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Rs.prototype.addFeature=function(t,e,r,i,n){for(var o=0,a=Ps(e,500);o<a.length;o+=1){for(var s=a[o],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].length;for(var p=this.segments.prepareSegment(l,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=ts(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+=l,p.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},tn("FillBucket",Rs,{omit:["layers","patternFeatures"]});var Bs=new Gn({"fill-sort-key":new Nn(Nt.layout_fill["fill-sort-key"])}),Fs={paint:new Gn({"fill-antialias":new Un(Nt.paint_fill["fill-antialias"]),"fill-opacity":new Nn(Nt.paint_fill["fill-opacity"]),"fill-color":new Nn(Nt.paint_fill["fill-color"]),"fill-outline-color":new Nn(Nt.paint_fill["fill-outline-color"]),"fill-translate":new Un(Nt.paint_fill["fill-translate"]),"fill-translate-anchor":new Un(Nt.paint_fill["fill-translate-anchor"]),"fill-pattern":new jn(Nt.paint_fill["fill-pattern"])}),layout:Bs},Os=function(t){function e(e){t.call(this,e,Fs)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new Rs(t)},e.prototype.queryRadius=function(){return wa(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a){return ha(Sa(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),i)},e.prototype.isTileClipped=function(){return!0},e}(Xn),Vs=Yn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Us=Ns;function Ns(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(js,this,e)}function js(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function qs(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n<o;a=n++)i+=((r=t[a]).x-(e=t[n]).x)*(e.y+r.y);return i}Ns.types=["Unknown","Point","LineString","Polygon"],Ns.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,i=1,o=0,a=0,s=0,l=[];t.pos<r;){if(o<=0){var u=t.readVarint();i=7&u,o=u>>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&l.push(e),e=[]),e.push(new n(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&l.push(e),l},Ns.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(i<=0){var c=t.readVarint();r=7&c,i=c>>3}if(i--,1===r||2===r)(n+=t.readSVarint())<a&&(a=n),n>s&&(s=n),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,u]},Ns.prototype.toGeoJSON=function(t,e,r){var i,n,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=Ns.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(i=0;i<l.length;i++)p[i]=l[i][0];c(l=p);break;case 2:for(i=0;i<l.length;i++)c(l[i]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,i,n=[],o=0;o<e;o++){var a=qs(t[o]);0!==a&&(void 0===i&&(i=a<0),i===a<0?(r&&n.push(r),r=[t[o]]):r.push(t[o]))}return r&&n.push(r),n}(l),i=0;i<l.length;i++)for(n=0;n<l[i].length;n++)c(l[i][n])}1===l.length?l=l[0]:u="Multi"+u;var h={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(h.id=this.id),h};var Zs=Gs;function Gs(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(Xs,this,e),this.length=this._features.length}function Xs(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}function Ws(t,e,r){if(3===t){var i=new Zs(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}Gs.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 Us(this._pbf,e,this.extent,this._keys,this._values)};var Hs={VectorTile:function(t,e){this.layers=t.readFields(Ws,{},e)},VectorTileFeature:Us,VectorTileLayer:Zs},Ks=Hs.VectorTileFeature.types,Ys=Math.pow(2,13);function Js(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,2*Math.floor(i*Ys)+a,n*Ys*2,o*Ys*2,Math.round(s))}var Qs=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 to,this.indexArray=new mo,this.programConfigurations=new ia(Vs,t.layers,t.zoom),this.segments=new Po,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function $s(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Qs.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Ds("fill-extrusion",this.layers,e);for(var i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.feature,s=o.id,l=o.index,u=o.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,p={type:a.type,id:s,properties:a.properties,geometry:c?sa(a):[]};if(this.layers[0]._featureFilter.filter(new Pn(this.zoom),p,r)){var h={id:s,sourceLayerIndex:u,index:l,geometry:c?p.geometry:sa(a),properties:a.properties,type:a.type,patterns:{}};void 0!==a.id&&(h.id=a.id),this.hasPattern?this.features.push(Ls("fill-extrusion",this.layers,h,this.zoom,e)):this.addFeature(h,h.geometry,l,r,{}),e.featureIndex.insert(a,h.geometry,l,u,this.index,!0)}}},Qs.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.features;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},Qs.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Qs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Qs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Qs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Vs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Qs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Qs.prototype.addFeature=function(t,e,r,i,n){for(var o=0,a=Ps(e,500);o<a.length;o+=1){for(var s=a[o],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].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&&!((M=d).every((function(t){return t.x<0}))||M.every((function(t){return t.x>8192}))||M.every((function(t){return t.y<0}))||M.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(!$s(_,g)){p.vertexLength+4>Po.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),Js(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,0,m),Js(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,1,m),Js(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,0,m+=x),Js(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+l>Po.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Ks[t.type]){for(var w=[],S=[],T=p.vertexLength,I=0,E=s;I<E.length;I+=1){var A=E[I];if(0!==A.length){A!==s[0]&&S.push(w.length/2);for(var k=0;k<A.length;k++){var z=A[k];Js(this.layoutVertexArray,z.x,z.y,0,0,1,1,0),w.push(z.x),w.push(z.y)}}}for(var C=ts(w,S),P=0;P<C.length;P+=3)this.indexArray.emplaceBack(T+C[P],T+C[P+2],T+C[P+1]);p.primitiveLength+=C.length/3,p.vertexLength+=l}}var M;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},tn("FillExtrusionBucket",Qs,{omit:["layers","features"]});var tl={paint:new Gn({"fill-extrusion-opacity":new Un(Nt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Nn(Nt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Un(Nt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Un(Nt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new jn(Nt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Nn(Nt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Nn(Nt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Un(Nt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},el=function(t){function e(e){t.call(this,e,tl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Qs(t)},e.prototype.queryRadius=function(){return wa(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s,l){var u=Sa(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,r),p=this.paint.get("fill-extrusion-base").evaluate(e,r),h=function(t,e,r,i){for(var o=[],a=0,s=t;a<s.length;a+=1){var l=s[a],u=[l.x,l.y,0,1];Oa(u,u,e),o.push(new n(u[0]/u[3],u[1]/u[3]))}return o}(u,l),f=function(t,e,r,i){for(var o=[],a=[],s=i[8]*e,l=i[9]*e,u=i[10]*e,c=i[11]*e,p=i[8]*r,h=i[9]*r,f=i[10]*r,d=i[11]*r,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,S=b.y,T=i[0]*w+i[4]*S+i[12],I=i[1]*w+i[5]*S+i[13],E=i[2]*w+i[6]*S+i[14],A=i[3]*w+i[7]*S+i[15],k=E+u,z=A+c,C=T+p,P=I+h,M=E+f,D=A+d,L=new n((T+s)/z,(I+l)/z);L.z=k/z,_.push(L);var R=new n(C/D,P/D);R.z=M/D,g.push(R)}o.push(_),a.push(g)}return[o,a]}(i,p,c,l);return function(t,e,r){var i=1/0;ha(r,e)&&(i=il(r,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 l=o[s],u=[l,o[s+1],a[s+1],a[s],l];ca(r,u)&&(i=Math.min(i,il(r,u)))}return i!==1/0&&i}(f[0],f[1],h)},e}(Xn);function rl(t,e){return t.x*e.x+t.y*e.y}function il(t,e){if(1===t.length){for(var r,i=0,n=e[i++];!r||n.equals(r);)if(!(r=e[i++]))return 1/0;for(;i<e.length;i++){var o=e[i],a=t[0],s=r.sub(n),l=o.sub(n),u=a.sub(n),c=rl(s,s),p=rl(s,l),h=rl(l,l),f=rl(u,s),d=rl(u,l),m=c*h-p*p,y=(h*f-p*d)/m,_=(c*d-p*f)/m,g=n.z*(1-y-_)+r.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 nl=Yn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,ol=Hs.VectorTileFeature.types,al=Math.cos(Math.PI/180*37.5),sl=Math.pow(2,14)/.5,ll=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 eo,this.indexArray=new mo,this.programConfigurations=new ia(nl,t.layers,t.zoom),this.segments=new Po,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ll.prototype.populate=function(t,e,r){this.hasPattern=Ds("line",this.layers,e);for(var i=this.layers[0].layout.get("line-sort-key"),n=[],o=0,a=t;o<a.length;o+=1){var s=a[o],l=s.feature,u=s.id,c=s.index,p=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:l.type,id:u,properties:l.properties,geometry:h?sa(l):[]};if(this.layers[0]._featureFilter.filter(new Pn(this.zoom),f,r)){h||(f.geometry=sa(l));var d=i?i.evaluate(f,{},r):void 0;n.push({id:u,properties:l.properties,type:l.type,sourceLayerIndex:p,index:c,geometry:f.geometry,patterns:{},sortKey:d})}}i&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,y=n;m<y.length;m+=1){var _=y[m],g=_.geometry,v=_.index,x=_.sourceLayerIndex;if(this.hasPattern){var b=Ls("line",this.layers,_,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(_,g,v,r,{});e.featureIndex.insert(t[v].feature,g,v,x,this.index)}},ll.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ll.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.patternFeatures;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},ll.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ll.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ll.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,nl),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},ll.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ll.prototype.addFeature=function(t,e,r,i,n){for(var o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),l=o.get("line-miter-limit"),u=o.get("line-round-limit"),c=0,p=e;c<p.length;c+=1)this.addLine(p[c],t,a,s,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},ll.prototype.addLine=function(t,e,r,i,n,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance()}for(var s="Polygon"===ol[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u<l-1&&t[u].equals(t[u+1]);)u++;if(!(l<(s?3:2))){"bevel"===r&&(n=1.05);var c,p=this.overscaling<=16?122880/(512*this.overscaling):0,h=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),f=void 0,d=void 0,m=void 0,y=void 0;this.e1=this.e2=-1,s&&(y=t[u].sub(c=t[l-2])._unit()._perp());for(var _=u;_<l;_++)if(!(d=_===l-1?s?t[u+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),S=x<al&&f&&d,T=m.x*y.y-m.y*y.x>0;if(S&&_>u){var I=c.dist(f);if(I>2*p){var E=c.sub(c.sub(f)._mult(p/I)._round());this.updateDistance(f,E),this.addCurrentVertex(E,m,0,0,h),f=E}}var A=f&&d,k=A?r:s?"butt":i;if(A&&"round"===k&&(b<o?k="miter":b<=2&&(k="fakeround")),"miter"===k&&b>n&&(k="bevel"),"bevel"===k&&(b>2&&(k="flipbevel"),b<n&&(k="miter")),f&&this.updateDistance(f,c),"miter"===k)g._mult(b),this.addCurrentVertex(c,g,0,0,h);else if("flipbevel"===k){if(b>100)g=y.mult(-1);else{var z=b*m.add(y).mag()/m.sub(y).mag();g._perp()._mult(z*(T?-1:1))}this.addCurrentVertex(c,g,0,0,h),this.addCurrentVertex(c,g.mult(-1),0,0,h)}else if("bevel"===k||"fakeround"===k){var C=-Math.sqrt(b*b-1),P=T?C:0,M=T?0:C;if(f&&this.addCurrentVertex(c,m,P,M,h),"fakeround"===k)for(var D=Math.round(180*w/Math.PI/20),L=1;L<D;L++){var R=L/D;if(.5!==R){var B=R-.5;R+=R*B*(R-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*B*B+(.848013+v*(.215638*v-1.06021)))}var F=y.sub(m)._mult(R)._add(m)._unit()._mult(T?-1:1);this.addHalfVertex(c,F.x,F.y,!1,T,0,h)}d&&this.addCurrentVertex(c,y,-P,-M,h)}else if("butt"===k)this.addCurrentVertex(c,g,0,0,h);else if("square"===k){var O=f?1:-1;this.addCurrentVertex(c,g,O,O,h)}else"round"===k&&(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(S&&_<l-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}}}}},ll.prototype.addCurrentVertex=function(t,e,r,i,n,o){void 0===o&&(o=!1);var a=e.y*i-e.x,s=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,n),this.addHalfVertex(t,a,s,o,!0,-i,n),this.distance>sl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,i,n,o))},ll.prototype.addHalfVertex=function(t,e,r,i,n,o,a){var s=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6);var l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),n?this.e2=l:this.e1=l},ll.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(sl-1):this.distance},ll.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},tn("LineBucket",ll,{omit:["layers","patternFeatures"]});var ul=new Gn({"line-cap":new Un(Nt.layout_line["line-cap"]),"line-join":new Nn(Nt.layout_line["line-join"]),"line-miter-limit":new Un(Nt.layout_line["line-miter-limit"]),"line-round-limit":new Un(Nt.layout_line["line-round-limit"]),"line-sort-key":new Nn(Nt.layout_line["line-sort-key"])}),cl={paint:new Gn({"line-opacity":new Nn(Nt.paint_line["line-opacity"]),"line-color":new Nn(Nt.paint_line["line-color"]),"line-translate":new Un(Nt.paint_line["line-translate"]),"line-translate-anchor":new Un(Nt.paint_line["line-translate-anchor"]),"line-width":new Nn(Nt.paint_line["line-width"]),"line-gap-width":new Nn(Nt.paint_line["line-gap-width"]),"line-offset":new Nn(Nt.paint_line["line-offset"]),"line-blur":new Nn(Nt.paint_line["line-blur"]),"line-dasharray":new qn(Nt.paint_line["line-dasharray"]),"line-pattern":new jn(Nt.paint_line["line-pattern"]),"line-gradient":new Zn(Nt.paint_line["line-gradient"])}),layout:ul},pl=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,r){return r=new Pn(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,i,n){return r=f({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,i,n)},e}(Nn))(cl.paint.properties["line-width"].specification);pl.useIntegerZoom=!0;var hl=function(t){function e(e){t.call(this,e,cl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){this.gradient=Ka(this._transitionablePaint._values["line-gradient"].value.expression,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=pl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new ll(t)},e.prototype.queryRadius=function(t){var e=t,r=fl(ba("line-width",this,e),ba("line-gap-width",this,e)),i=ba("line-offset",this,e);return r/2+Math.abs(i)+wa(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s){var l=Sa(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),u=s/2*fl(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(i=function(t,e){for(var r=[],i=new n(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],l=0;l<a.length;l++){var u=a[l],c=a[l+1],p=0===l?i:u.sub(a[l-1])._unit()._perp(),h=l===a.length-1?i:c.sub(u)._unit()._perp(),f=p._add(h)._unit();f._mult(1/(f.x*h.x+f.y*h.y)),s.push(f._mult(e)._add(u))}r.push(s)}return r}(i,c*s)),function(t,e,r){for(var i=0;i<e.length;i++){var n=e[i];if(t.length>=3)for(var o=0;o<n.length;o++)if(va(t,n[o]))return!0;if(fa(t,n,r))return!0}return!1}(l,i,u)},e.prototype.isTileClipped=function(){return!0},e}(Xn);function fl(t,e){return e>0?e+2*t:t}var dl=Yn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),ml=Yn([{name:"a_projected_pos",components:3,type:"Float32"}],4),yl=(Yn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Yn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),_l=(Yn([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Yn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),gl=Yn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function vl(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var i=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),Cn.applyArabicShaping&&(t=Cn.applyArabicShaping(t)),t}(t.text,e,r)})),t}Yn([{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"}]),Yn([{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:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),Yn([{type:"Float32",name:"offsetX"}]),Yn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var xl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},bl=function(t,e,r,i,n){var o,a,s=8*n-i-1,l=(1<<s)-1,u=l>>1,c=-7,p=r?n-1:0,h=r?-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+=i;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=u}return(f?-1:1)*a*Math.pow(2,o-i)},wl=function(t,e,r,i,n,o){var a,s,l,u=8*o-n-1,c=(1<<u)-1,p=c>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=i?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*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+p>=1?h/l:h*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*l-1)*Math.pow(2,n),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,n),a=0));n>=8;t[r+f]=255&s,f+=d,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*m},Sl=Tl;function Tl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Tl.Varint=0,Tl.Fixed64=1,Tl.Bytes=2,Tl.Fixed32=5;var Il="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function El(t){return t.type===Tl.Bytes?t.readVarint()+t.pos:t.pos+1}function Al(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function kl(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function zl(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Cl(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Pl(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Ml(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Dl(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Ll(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Rl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Bl(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Fl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Ol(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Vl(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Ul(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Nl(t,e,r){1===t&&r.readMessage(jl,e)}function jl(t,e,r){if(3===t){var i=r.readMessage(ql,{}),n=i.width,o=i.height,a=i.left,s=i.top,l=i.advance;e.push({id:i.id,bitmap:new Xa({width:n+6,height:o+6},i.bitmap),metrics:{width:n,height:o,left:a,top:s,advance:l}})}}function ql(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function Zl(t){for(var e=0,r=0,i=0,n=t;i<n.length;i+=1){var o=n[i];e+=o.w*o.h,r=Math.max(r,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)),r),h:1/0}],s=0,l=0,u=0,c=t;u<c.length;u+=1)for(var p=c[u],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,l=Math.max(l,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:l,fill:e/(s*l)||0}}Tl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ol(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ul(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ol(this.buf,this.pos)+4294967296*Ol(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ol(this.buf,this.pos)+4294967296*Ul(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=bl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=bl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,o=r.buf;if(i=(112&(n=o[r.pos++]))>>4,n<128)return Al(t,i,e);if(i|=(127&(n=o[r.pos++]))<<3,n<128)return Al(t,i,e);if(i|=(127&(n=o[r.pos++]))<<10,n<128)return Al(t,i,e);if(i|=(127&(n=o[r.pos++]))<<17,n<128)return Al(t,i,e);if(i|=(127&(n=o[r.pos++]))<<24,n<128)return Al(t,i,e);if(i|=(1&(n=o[r.pos++]))<<31,n<128)return Al(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[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&&Il?function(t,e,r){return Il.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",n=e;n<r;){var o,a,s,l=t[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(o=t[n+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===c?(a=t[n+2],128==(192&(o=t[n+1]))&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[n+2],s=t[n+3],128==(192&(o=t[n+1]))&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),n+=c}return i}(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!==Tl.Bytes)return t.push(this.readVarint(e));var r=El(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Tl.Bytes)return t.push(this.readSVarint());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Tl.Bytes)return t.push(this.readBoolean());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Tl.Bytes)return t.push(this.readFloat());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Tl.Bytes)return t.push(this.readDouble());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Tl.Bytes)return t.push(this.readFixed32());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Tl.Bytes)return t.push(this.readSFixed32());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Tl.Bytes)return t.push(this.readFixed64());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Tl.Bytes)return t.push(this.readSFixed64());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Tl.Varint)for(;this.buf[this.pos++]>127;);else if(e===Tl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Tl.Fixed32)this.pos+=4;else{if(e!==Tl.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 r=new Uint8Array(e);r.set(this.buf),this.buf=r,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),Vl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Vl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Vl(this.buf,-1&t,this.pos),Vl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Vl(this.buf,-1&t,this.pos),Vl(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 r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((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)))))}(i,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,r){for(var i,n,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!n){i>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&kl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),wl(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),wl(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 r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var i=this.pos-r;i>=128&&kl(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,Tl.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,zl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Dl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Pl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ml,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ll,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Rl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Bl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Fl,e)},writeBytesField:function(t,e){this.writeTag(t,Tl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Tl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Tl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Tl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Tl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Tl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Tl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Tl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Tl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Tl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Gl=function(t,e){var r=e.pixelRatio,i=e.version,n=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=n,this.stretchY=o,this.content=a,this.version=i},Xl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Xl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Xl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Xl.tlbr.get=function(){return this.tl.concat(this.br)},Xl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Gl.prototype,Xl);var Wl=function(t,e){var r={},i={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,r,n),this.addImages(e,i,n);var o=Zl(n),a=new Wa({width:o.w||1,height:o.h||1});for(var s in t){var l=t[s],u=r[s].paddedRect;Wa.copy(l.data,a,{x:0,y:0},{x:u.x+1,y:u.y+1},l.data)}for(var c in e){var p=e[c],h=i[c].paddedRect,f=h.x+1,d=h.y+1,m=p.data.width,y=p.data.height;Wa.copy(p.data,a,{x:0,y:0},{x:f,y:d},p.data),Wa.copy(p.data,a,{x:0,y:y-1},{x:f,y:d-1},{width:m,height:1}),Wa.copy(p.data,a,{x:0,y:0},{x:f,y:d+y},{width:m,height:1}),Wa.copy(p.data,a,{x:m-1,y:0},{x:f-1,y:d},{width:1,height:y}),Wa.copy(p.data,a,{x:0,y:0},{x:f+m,y:d},{width:1,height:y})}this.image=a,this.iconPositions=r,this.patternPositions=i};Wl.prototype.addImages=function(t,e,r){for(var i in t){var n=t[i],o={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(o),e[i]=new Gl(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}},Wl.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},Wl.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var i=t.tl;r.update(e.data,void 0,{x:i[0],y:i[1]})}},tn("ImagePosition",Gl),tn("ImageAtlas",Wl);var Hl={horizontal:1,vertical:2,horizontalOnly:3},Kl=function(){this.scale=1,this.fontStack="",this.imageName=null};Kl.forText=function(t,e){var r=new Kl;return r.scale=t||1,r.fontStack=e,r},Kl.forImage=function(t){var e=new Kl;return e.imageName=t,e};var Yl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};Yl.fromFeature=function(t,e){for(var r=new Yl,i=0;i<t.sections.length;i++){var n=t.sections[i];n.image?r.addImageSection(n):r.addTextSection(n,e)}return r},Yl.prototype.length=function(){return this.text.length},Yl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},Yl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},Yl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},Yl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var i=t.charCodeAt(r+1)||null,n=t.charCodeAt(r-1)||null;e+=i&&gn(i)&&!xl[t[r+1]]||n&&gn(n)&&!xl[t[r-1]]||!xl[t[r]]?t[r]:xl[t[r]]}return e}(this.text)},Yl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Jl[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,i=this.text.length-1;i>=0&&i>=t&&Jl[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Yl.prototype.substring=function(t,e){var r=new Yl;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Yl.prototype.toString=function(){return this.text},Yl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Yl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Kl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,i=0;i<t.text.length;++i)this.sectionIndex.push(r)},Yl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Kl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):I("Reached maximum number of images 6401")}else I("Can't add FormattedSection with an empty image.")},Yl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Jl={};function Ql(t){var e=.5,r=.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":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function $l(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Pn(t+1))};if("source"===r.kind)return{kind:"source"};for(var i=r.zoomStops,n=r.interpolationType,o=0;o<i.length&&i[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<i.length&&i[a]<t+1;)a++;a=Math.min(i.length-1,a);var s=i[o],l=i[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new Pn(s)),maxSize:r.evaluate(new Pn(l)),interpolationType:n}}function tu(t,e,r){var i=e.uSize,n=r.lowerSize;return"source"===t.kind?n/128:"composite"===t.kind?ur(n/128,r.upperSize/128,e.uSizeT):i}function eu(t,e){var r=0,i=0;if("constant"===t.kind)i=t.layoutSize;else if("source"!==t.kind){var n=t.interpolationType,o=n?u(Tr.interpolationFactor(n,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?i=ur(t.minSize,t.maxSize,o):r=o}return{uSizeT:r,uSize:i}}Jl[9]=!0,Jl[10]=!0,Jl[11]=!0,Jl[12]=!0,Jl[13]=!0,Jl[32]=!0,tn("Anchor",function(t){function e(e,r,i,n){t.call(this,e,r),this.angle=i,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 ru=Object.freeze({__proto__:null,getSizeData:$l,evaluateSizeForFeature:tu,evaluateSizeForZoom:eu,SIZE_PACK_FACTOR:128}),iu=Number.POSITIVE_INFINITY;function nu(t,e){return e[1]!==iu?function(t,e,r){var i=0,n=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e}return[i,n]}(t,e[0],e[1]):function(t,e){var r=0,i=0;e<0&&(e=0);var n=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-e;break;case"top":i=e-7}switch(t){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=e;break;case"right":r=-e}return[r,i]}(t,e[0])}var ou=Hs.VectorTileFeature.types,au=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function su(t,e,r,i,n,o,a,s,l,u,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,r,Math.round(32*i),Math.round(32*n),o,a,(f<<1)+(l?1:0),d,16*u,16*c,256*p,256*h)}function lu(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function uu(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(bn(r[e].text))return!0;return!1}var cu=function(t){this.layoutVertexArray=new io,this.indexArray=new mo,this.programConfigurations=t,this.segments=new Po,this.dynamicLayoutVertexArray=new no,this.opacityVertexArray=new oo,this.placedSymbolArray=new So};cu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},cu.prototype.upload=function(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,dl.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,ml.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,au,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))},cu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},tn("SymbolBuffers",cu);var pu=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Po,this.collisionVertexArray=new lo};pu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,yl.members,!0)},pu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},tn("CollisionBuffers",pu);var hu=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=[];var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=$l(this.zoom,e["text-size"]),this.iconSizeData=$l(this.zoom,e["icon-size"]);var r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==n&&void 0!==i.constantOr(1),this.sortFeaturesByY=("viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey)&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return Hl[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};hu.prototype.createArrays=function(){this.text=new cu(new ia(dl.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new cu(new ia(dl.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new Eo,this.lineVertexArray=new Ao,this.symbolInstances=new Io},hu.prototype.calculateGlyphDependencies=function(t,e,r,i,n){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(r||i)&&n){var a=xl[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},hu.prototype.populate=function(t,e,r){var i=this.layers[0],n=i.layout,o=n.get("text-font"),a=n.get("text-field"),s=n.get("icon-image"),l=("constant"!==a.value.kind||a.value.value instanceof fe&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=n.get("symbol-sort-key");if(this.features=[],l||u){for(var p=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,d=new Pn(this.zoom),m=0,y=t;m<y.length;m+=1){var _=y[m],g=_.feature,v=_.id,x=_.index,b=_.sourceLayerIndex,w=i._featureFilter.needGeometry,S={type:g.type,id:v,properties:g.properties,geometry:w?sa(g):[]};if(i._featureFilter.filter(d,S,r)){w||(S.geometry=sa(g));var T=void 0;if(l){var I=i.getValueAndResolveTokens("text-field",S,r,f),E=fe.factory(I);uu(E)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===kn()||this.hasRTLText&&Cn.isParsed())&&(T=vl(E,i,S))}var A=void 0;if(u){var k=i.getValueAndResolveTokens("icon-image",S,r,f);A=k instanceof de?k:de.fromString(k)}if(T||A){var z=this.sortFeaturesByKey?c.evaluate(S,{},r):void 0,C={id:v,text:T,icon:A,index:x,sourceLayerIndex:b,geometry:sa(g),properties:g.properties,type:ou[g.type],sortKey:z};if(this.features.push(C),A&&(p[A.name]=!0),T){var P=o.evaluate(S,{},r).join(","),M="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Hl.vertical)>=0;for(var D=0,L=T.sections;D<L.length;D+=1){var R=L[D];if(R.image)p[R.image.name]=!0;else{var B=yn(T.toString()),F=R.fontStack||P,O=h[F]=h[F]||{};this.calculateGlyphDependencies(R.text,O,M,this.allowVerticalPlacement,B)}}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},i=[],n=0;function o(e){i.push(t[e]),n++}function a(t,e,n){var o=r[t];return delete r[t],r[e]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(n[0]),o}function s(t,r,n){var o=e[r];return delete e[r],e[t]=o,i[o].geometry[0].shift(),i[o].geometry[0]=n[0].concat(i[o].geometry[0]),o}function l(t,e,r){var i=r?e[0][e[0].length-1]:e[0][0];return t+":"+i.x+":"+i.y}for(var u=0;u<t.length;u++){var c=t[u],p=c.geometry,h=c.text?c.text.toString():null;if(h){var f=l(h,p),d=l(h,p,!0);if(f in r&&d in e&&r[f]!==e[d]){var m=s(f,d,p),y=a(f,d,i[m].geometry);delete e[f],delete r[d],r[l(h,i[y].geometry,!0)]=y,i[m].geometry=null}else f in r?a(f,d,p):d in e?s(f,d,p):(o(u),e[f]=n-1,r[d]=n-1)}else o(u)}return i.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},hu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},hu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},hu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},hu.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t),this.textCollisionCircle.upload(t),this.iconCollisionCircle.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},hu.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy()},hu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},hu.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var i=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:i},a<e.length-1&&(i+=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 l=0;l<e.length;l++){var u=o[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},hu.prototype.addSymbols=function(t,e,r,i,n,o,a,s,l,u,c,p){for(var h=t.indexArray,f=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,f,h,o.sortKey),m=this.glyphOffsetArray.length,y=d.vertexLength,_=this.allowVerticalPlacement&&a===Hl.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,S=x.bl,T=x.br,I=x.tex,E=x.pixelOffsetTL,A=x.pixelOffsetBR,k=x.minFontScaleX,z=x.minFontScaleY,C=x.glyphOffset,P=x.isSDF,M=x.sectionIndex,D=d.vertexLength,L=C[1];su(f,s.x,s.y,b.x,L+b.y,I.x,I.y,r,P,E.x,E.y,k,z),su(f,s.x,s.y,w.x,L+w.y,I.x+I.w,I.y,r,P,A.x,E.y,k,z),su(f,s.x,s.y,S.x,L+S.y,I.x,I.y+I.h,r,P,E.x,A.y,k,z),su(f,s.x,s.y,T.x,L+T.y,I.x+I.w,I.y+I.h,r,P,A.x,A.y,k,z),lu(t.dynamicLayoutVertexArray,s,_),h.emplaceBack(D,D+1,D+2),h.emplaceBack(D+1,D+2,D+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),v!==e.length-1&&M===e[v+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},p,g&&g[M])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,y,l,u,s.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],a,0,!1,0,c)},hu.prototype._addCollisionDebugVertex=function(t,e,r,i,n,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,n,Math.round(o.x),Math.round(o.y))},hu.prototype.addCollisionDebugVertices=function(t,e,r,i,o,a,s,l){var u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=u.vertexLength,p=o.layoutVertexArray,h=o.collisionVertexArray,f=s.anchorX,d=s.anchorY;if(this._addCollisionDebugVertex(p,h,a,f,d,new n(t,e)),this._addCollisionDebugVertex(p,h,a,f,d,new n(r,e)),this._addCollisionDebugVertex(p,h,a,f,d,new n(r,i)),this._addCollisionDebugVertex(p,h,a,f,d,new n(t,i)),u.vertexLength+=4,l){var m=o.indexArray;m.emplaceBack(c,c+1,c+2),m.emplaceBack(c,c+2,c+3),u.primitiveLength+=2}else{var y=o.indexArray;y.emplaceBack(c,c+1),y.emplaceBack(c+1,c+2),y.emplaceBack(c+2,c+3),y.emplaceBack(c+3,c),u.primitiveLength+=4}},hu.prototype.addDebugCollisionBoxes=function(t,e,r,i){for(var n=t;n<e;n++){var o=this.collisionBoxArray.get(n),a=o.radius>0;this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,a?i?this.textCollisionCircle:this.iconCollisionCircle:i?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,r,a)}},hu.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new pu(so,_l.members,yo),this.iconCollisionBox=new pu(so,_l.members,yo),this.textCollisionCircle=new pu(so,gl.members,mo),this.iconCollisionCircle=new pu(so,gl.members,mo);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)}},hu.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,i,n,o,a,s,l){for(var u={},c=e;c<r;c++){var p=t.get(c);if(0===p.radius){u.textBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},u.textFeatureIndex=p.featureIndex;break}u.textCircles||(u.textCircles=[],u.textFeatureIndex=p.featureIndex),u.textCircles.push(p.anchorPointX,p.anchorPointY,p.radius,p.signedDistanceFromAnchor,1)}for(var h=i;h<n;h++){var f=t.get(h);if(0===f.radius){u.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},u.verticalTextFeatureIndex=f.featureIndex;break}}for(var d=o;d<a;d++){var m=t.get(d);if(0===m.radius){u.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},u.iconFeatureIndex=m.featureIndex;break}}for(var y=s;y<l;y++){var _=t.get(y);if(0===_.radius){u.verticalIconBox={x1:_.x1,y1:_.y1,x2:_.x2,y2:_.y2,anchorPointX:_.anchorPointX,anchorPointY:_.anchorPointY},u.verticalIconFeatureIndex=_.featureIndex;break}}return u},hu.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},hu.prototype.hasTextData=function(){return this.text.segments.get().length>0},hu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},hu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox&&this.textCollisionCircle&&this.iconCollisionCircle},hu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},hu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},hu.prototype.hasTextCollisionCircleData=function(){return this.hasDebugData()&&this.textCollisionCircle.segments.get().length>0},hu.prototype.hasIconCollisionCircleData=function(){return this.hasDebugData()&&this.iconCollisionCircle.segments.get().length>0},hu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+4*r.numGlyphs,n=r.vertexStartIndex;n<i;n+=4)t.indexArray.emplaceBack(n,n+1,n+2),t.indexArray.emplaceBack(n+1,n+2,n+3)},hu.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),i=[],n=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);i.push(0|Math.round(e*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return o.sort((function(t,e){return i[t]-i[e]||n[e]-n[t]})),o},hu.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},hu.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 r=0,i=this.symbolInstanceIndexes;r<i.length;r+=1){var n=this.symbolInstances.get(i[r]);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t,r,i){t>=0&&i.indexOf(t)===r&&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)}},tn("SymbolBucket",hu,{omit:["layers","collisionBoxArray","features","compareText"]}),hu.MAX_GLYPHS=65535,hu.addDynamicAttributes=lu;var fu=new Gn({"symbol-placement":new Un(Nt.layout_symbol["symbol-placement"]),"symbol-spacing":new Un(Nt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Un(Nt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Nn(Nt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Un(Nt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Un(Nt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Un(Nt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Un(Nt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Un(Nt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Nn(Nt.layout_symbol["icon-size"]),"icon-text-fit":new Un(Nt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Un(Nt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Nn(Nt.layout_symbol["icon-image"]),"icon-rotate":new Nn(Nt.layout_symbol["icon-rotate"]),"icon-padding":new Un(Nt.layout_symbol["icon-padding"]),"icon-keep-upright":new Un(Nt.layout_symbol["icon-keep-upright"]),"icon-offset":new Nn(Nt.layout_symbol["icon-offset"]),"icon-anchor":new Nn(Nt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Un(Nt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Un(Nt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Un(Nt.layout_symbol["text-rotation-alignment"]),"text-field":new Nn(Nt.layout_symbol["text-field"]),"text-font":new Nn(Nt.layout_symbol["text-font"]),"text-size":new Nn(Nt.layout_symbol["text-size"]),"text-max-width":new Nn(Nt.layout_symbol["text-max-width"]),"text-line-height":new Un(Nt.layout_symbol["text-line-height"]),"text-letter-spacing":new Nn(Nt.layout_symbol["text-letter-spacing"]),"text-justify":new Nn(Nt.layout_symbol["text-justify"]),"text-radial-offset":new Nn(Nt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Un(Nt.layout_symbol["text-variable-anchor"]),"text-anchor":new Nn(Nt.layout_symbol["text-anchor"]),"text-max-angle":new Un(Nt.layout_symbol["text-max-angle"]),"text-writing-mode":new Un(Nt.layout_symbol["text-writing-mode"]),"text-rotate":new Nn(Nt.layout_symbol["text-rotate"]),"text-padding":new Un(Nt.layout_symbol["text-padding"]),"text-keep-upright":new Un(Nt.layout_symbol["text-keep-upright"]),"text-transform":new Nn(Nt.layout_symbol["text-transform"]),"text-offset":new Nn(Nt.layout_symbol["text-offset"]),"text-allow-overlap":new Un(Nt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Un(Nt.layout_symbol["text-ignore-placement"]),"text-optional":new Un(Nt.layout_symbol["text-optional"])}),du={paint:new Gn({"icon-opacity":new Nn(Nt.paint_symbol["icon-opacity"]),"icon-color":new Nn(Nt.paint_symbol["icon-color"]),"icon-halo-color":new Nn(Nt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Nn(Nt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Nn(Nt.paint_symbol["icon-halo-blur"]),"icon-translate":new Un(Nt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Un(Nt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Nn(Nt.paint_symbol["text-opacity"]),"text-color":new Nn(Nt.paint_symbol["text-color"],{runtimeType:$t,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Nn(Nt.paint_symbol["text-halo-color"]),"text-halo-width":new Nn(Nt.paint_symbol["text-halo-width"]),"text-halo-blur":new Nn(Nt.paint_symbol["text-halo-blur"]),"text-translate":new Un(Nt.paint_symbol["text-translate"]),"text-translate-anchor":new Un(Nt.paint_symbol["text-translate-anchor"])}),layout:fu},mu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Kt,this.defaultValue=t};mu.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},mu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},mu.prototype.outputDefined=function(){return!1},mu.prototype.serialize=function(){return null},tn("FormatSectionOverride",mu,{omit:["defaultValue"]});var yu=function(t){function e(e){t.call(this,e,du)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"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 i=this.layout.get("text-writing-mode");if(i){for(var n=[],o=0,a=i;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,r,i){var n=this.layout.get(t).evaluate(e,{},r,i),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||li(o.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,n)},e.prototype.createBucket=function(t){return new hu(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=du.paint.overridableProperties;t<r.length;t+=1){var i=r[t];if(e.hasPaintOverride(this.layout,i)){var n,o=this.paint.get(i),a=new mu(o),s=new si(a,o.property.specification);n="constant"===o.value.kind||"source"===o.value.kind?new ci("source",s):new pi("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[i]=new On(o.property,n,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),i=du.paint.properties[e],n=!1,o=function(t){for(var e=0,r=t;e<r.length;e+=1)if(i.overrides&&i.overrides.hasOverride(r[e]))return void(n=!0)};if("constant"===r.value.kind&&r.value.value instanceof fe)o(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){n||(t instanceof ve&&_e(t.value)===ie?o(t.value.sections):t instanceof Se?o(t.sections):t.eachChild(a))},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return n},e}(Xn),_u={paint:new Gn({"background-color":new Un(Nt.paint_background["background-color"]),"background-pattern":new qn(Nt.paint_background["background-pattern"]),"background-opacity":new Un(Nt.paint_background["background-opacity"])})},gu=function(t){function e(e){t.call(this,e,_u)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Xn),vu={paint:new Gn({"raster-opacity":new Un(Nt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Un(Nt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Un(Nt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Un(Nt.paint_raster["raster-brightness-max"]),"raster-saturation":new Un(Nt.paint_raster["raster-saturation"]),"raster-contrast":new Un(Nt.paint_raster["raster-contrast"]),"raster-resampling":new Un(Nt.paint_raster["raster-resampling"]),"raster-fade-duration":new Un(Nt.paint_raster["raster-fade-duration"])})},xu=function(t){function e(e){t.call(this,e,vu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Xn),bu=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}(Xn),wu={circle:Ua,heatmap:Ya,hillshade:Qa,fill:Os,"fill-extrusion":el,line:hl,symbol:yu,background:gu,raster:xu};function Su(t){return"custom"===t.type?new bu(t):new wu[t.type](t)}var Tu=self.HTMLImageElement,Iu=self.HTMLCanvasElement,Eu=self.HTMLVideoElement,Au=self.ImageData,ku=self.ImageBitmap,zu=function(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,i)};function Cu(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}zu.prototype.update=function(t,e,r){var i=t.width,n=t.height,o=!(this.size&&this.size[0]===i&&this.size[1]===n||r),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=[i,n],t instanceof Tu||t instanceof Iu||t instanceof Eu||t instanceof Au||ku&&t instanceof ku?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,i,n,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=r||{x:0,y:0},u=l.x,c=l.y;t instanceof Tu||t instanceof Iu||t instanceof Eu||t instanceof Au||ku&&t instanceof ku?s.texSubImage2D(s.TEXTURE_2D,0,u,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,u,c,i,n,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},zu.prototype.bind=function(t,e,r){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)},zu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},zu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Pu=function(t){function e(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new Wa({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,r=this.requestors;e<r.length;e+=1){var i=r[e];this._notify(i.ids,i.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 r=!0;return this._validateStretch(e.stretchX,e.data&&e.data.width)||(this.fire(new Vt(new Error('Image "'+t+'" has invalid "stretchX" value'))),r=!1),this._validateStretch(e.stretchY,e.data&&e.data.height)||(this.fire(new Vt(new Error('Image "'+t+'" has invalid "stretchY" value'))),r=!1),this._validateContent(e.content,e)||(this.fire(new Vt(new Error('Image "'+t+'" has invalid "content" value'))),r=!1),r},e.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,i=0,n=t;i<n.length;i+=1){var o=n[i];if(o[0]<r||o[1]<o[0]||e<o[1])return!1;r=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 r=!0;if(!this.isLoaded())for(var i=0,n=t;i<n.length;i+=1)this.images[n[i]]||(r=!1);this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},e.prototype._notify=function(t,e){for(var r={},i=0,n=t;i<n.length;i+=1){var o=n[i];this.images[o]||this.fire(new Ot("styleimagemissing",{id:o}));var a=this.images[o];a?r[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)}:I('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,r)},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],r=this.getImage(t);if(!r)return null;if(e&&e.position.version===r.version)return e.position;if(e)e.position.version=r.version;else{var i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},n=new Gl(i,r);this.patterns[t]={bin:i,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 zu(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 r=Zl(t),i=r.w,n=r.h,o=this.atlasImage;for(var a in o.resize({width:i||1,height:n||1}),this.patterns){var s=this.patterns[a].bin,l=s.x+1,u=s.y+1,c=this.images[a].data,p=c.width,h=c.height;Wa.copy(c,o,{x:0,y:0},{x:l,y:u},{width:p,height:h}),Wa.copy(c,o,{x:0,y:h-1},{x:l,y:u-1},{width:p,height:1}),Wa.copy(c,o,{x:0,y:0},{x:l,y:u+h},{width:p,height:1}),Wa.copy(c,o,{x:p-1,y:0},{x:l-1,y:u},{width:1,height:h}),Wa.copy(c,o,{x:0,y:0},{x:l+p,y:u},{width:1,height:h})}this.dirty=!0},e.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},e.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var i=r[e];if(!this.callbackDispatchedThisFrame[i]){this.callbackDispatchedThisFrame[i]=!0;var n=this.images[i];Cu(n)&&this.updateImage(i,n)}}},e}(Ut),Mu=Ru,Du=Ru,Lu=1e20;function Ru(t,e,r,i,n,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer,s=a+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.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Bu(t,e,r,i,n,o){for(var a=0;a<e;a++)Fu(t,a,e,r,i,n,o);for(var s=0;s<r;s++)Fu(t,s*e,1,e,i,n,o)}function Fu(t,e,r,i,n,o,a){var s,l,u,c;for(o[0]=0,a[0]=-Lu,a[1]=Lu,s=0;s<i;s++)n[s]=t[e+s*r];for(s=1,l=0,u=0;s<i;s++){do{u=(n[s]-n[c=o[l]]+s*s-c*c)/(s-c)/2}while(u<=a[l]&&--l>-1);o[++l]=s,a[l]=u,a[l+1]=Lu}for(s=0,l=0;s<i;s++){for(;a[l+1]<s;)l++;t[e+s*r]=n[c=o[l]]+(s-c)*(s-c)}}Ru.prototype._draw=function(t,e){var r,i,n,o,a,s,l,u,c,p=this.ctx.measureText(t),h=p.width,f=2*this.buffer;e&&this.useMetrics?(a=Math.floor(p.actualBoundingBoxAscent),u=this.buffer+Math.ceil(p.actualBoundingBoxAscent),s=this.buffer,l=this.buffer,r=(i=Math.min(this.size,Math.ceil(p.actualBoundingBoxRight-p.actualBoundingBoxLeft)))+f,n=(o=Math.min(this.size-s,Math.ceil(p.actualBoundingBoxAscent+p.actualBoundingBoxDescent)))+f,this.ctx.textBaseline="alphabetic"):(r=i=this.size,n=o=this.size,a=19*this.fontSize/24,s=l=0,u=this.middle,this.ctx.textBaseline="middle"),i&&o&&(this.ctx.clearRect(l,s,i,o),this.ctx.fillText(t,this.buffer,u),c=this.ctx.getImageData(l,s,i,o));var d=new Uint8ClampedArray(r*n);return function(t,e,r,i,n,o,a){o.fill(Lu,0,e*r),a.fill(0,0,e*r);for(var s=(e-i)/2,l=0;l<n;l++)for(var u=0;u<i;u++){var c=(l+s)*e+u+s,p=t.data[4*(l*i+u)+3]/255;if(1===p)o[c]=0,a[c]=Lu;else if(0===p)o[c]=Lu,a[c]=0;else{var h=Math.max(0,.5-p),f=Math.max(0,p-.5);o[c]=h*h,a[c]=f*f}}}(c,r,n,i,o,this.gridOuter,this.gridInner),Bu(this.gridOuter,r,n,this.f,this.v,this.z),Bu(this.gridInner,r,n,this.f,this.v,this.z),function(t,e,r,i,n,o,a){for(var s=0;s<e*r;s++){var l=Math.sqrt(i[s])-Math.sqrt(n[s]);t[s]=Math.round(255-255*(l/o+a))}}(d,r,n,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:d,metrics:{width:i,height:o,sdfWidth:r,sdfHeight:n,top:a,left:0,advance:h}}},Ru.prototype.draw=function(t){return this._draw(t,!1).data},Ru.prototype.drawWithMetrics=function(t){return this._draw(t,!0)},Mu.default=Du;var Ou=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};Ou.prototype.setURL=function(t){this.url=t},Ou.prototype.getGlyphs=function(t,e){var r=this,i=[];for(var n in t)for(var o=0,a=t[n];o<a.length;o+=1)i.push({stack:n,id:a[o]});p(i,(function(t,e){var i=t.stack,n=t.id,o=r.entries[i];o||(o=r.entries[i]={glyphs:{},requests:{},ranges:{}});var a=o.glyphs[n];if(void 0===a){if(a=r._tinySDF(o,i,n))return o.glyphs[n]=a,void e(null,{stack:i,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:i,id:n,glyph:a});else{var l=o.requests[s];l||(l=o.requests[s]=[],Ou.loadGlyphRange(i,s,r.url,r.requestManager,(function(t,e){if(e){for(var i in e)r._doesCharSupportLocalGlyph(+i)||(o.glyphs[+i]=e[+i]);o.ranges[s]=!0}for(var n=0,a=l;n<a.length;n+=1)(0,a[n])(t,e);delete o.requests[s]}))),l.push((function(t,r){t?e(t):r&&e(null,{stack:i,id:n,glyph:r[n]||null})}))}}else e(null,{stack:i,id:n,glyph:a})}),(function(t,r){if(t)e(t);else if(r){for(var i={},n=0,o=r;n<o.length;n+=1){var a=o[n],s=a.stack,l=a.id,u=a.glyph;(i[s]||(i[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}e(null,i)}}))},Ou.prototype._doesCharSupportLocalGlyph=function(t){return!!this.localIdeographFontFamily&&(pn(t)||hn(t)||un(t)||cn(t))},Ou.prototype._tinySDF=function(t,e,r){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(r)){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 Ou.TinySDF(24,3,8,.25,i,o)}return{id:r,bitmap:new Xa({width:30,height:30},n.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},Ou.loadGlyphRange=function(t,e,r,i,n){var o=256*e,a=o+255,s=i.transformRequest(i.normalizeGlyphsURL(r).replace("{fontstack}",t).replace("{range}",o+"-"+a),Et.Glyphs);Dt(s,(function(t,e){if(t)n(t);else if(e){for(var r={},i=0,o=function(t){return new Sl(t).readFields(Nl,[])}(e);i<o.length;i+=1){var a=o[i];r[a.id]=a}n(null,r)}}))},Ou.TinySDF=Mu;var Vu=function(){this.specification=Nt.light.position};Vu.prototype.possiblyEvaluate=function(t,e){return i=(r=t.expression.evaluate(e))[0],n=r[1],o=r[2],n+=90,n*=Math.PI/180,o*=Math.PI/180,{x:i*Math.cos(n)*Math.sin(o),y:i*Math.sin(n)*Math.sin(o),z:i*Math.cos(o)};var r,i,n,o},Vu.prototype.interpolate=function(t,e,r){return{x:ur(t.x,e.x,r),y:ur(t.y,e.y,r),z:ur(t.z,e.z,r)}};var Uu=new Gn({anchor:new Un(Nt.light.anchor),position:new Vu,color:new Un(Nt.light.color),intensity:new Un(Nt.light.intensity)}),Nu=function(t){function e(e){t.call(this),this._transitionable=new Ln(Uu),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(Gi,t,e))for(var r in t){var i=t[r];x(r,"-transition")?this._transitionable.setTransition(r.slice(0,-"-transition".length),i):this._transitionable.setValue(r,i)}},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,r){return(!r||!1!==r.validate)&&Hi(this,t.call(Zi,f({value:e,style:{glyphs:!0,sprite:!0},styleSpec:Nt})))},e}(Ut),ju=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};ju.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]},ju.prototype.getDashRanges=function(t,e,r){var i=[],n=t.length%2==1?-t[t.length-1]*r:0,o=t[0]*r,a=!0;i.push({left:n,right:o,isDash:a,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){var u=t[l];i.push({left:n=s*r,right:o=(s+=u)*r,isDash:a=!a,zeroLength:0===u})}return i},ju.prototype.addRoundDash=function(t,e,r){for(var i=e/2,n=-r;n<=r;n++)for(var o=this.width*(this.nextRow+r+n),a=0,s=t[a],l=0;l<this.width;l++){l/s.right>1&&(s=t[++a]);var u=Math.abs(l-s.left),c=Math.abs(l-s.right),p=Math.min(u,c),h=void 0,f=n/r*(i+1);if(s.isDash){var d=i-Math.abs(f);h=Math.sqrt(p*p+d*d)}else h=i-Math.sqrt(p*p+f*f);this.data[o+l]=Math.max(0,Math.min(255,h+128))}},ju.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],i=t[e+1];r.zeroLength?t.splice(e,1):i&&i.isDash===r.isDash&&(i.left=r.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,l=t[s],u=0;u<this.width;u++){u/l.right>1&&(l=t[++s]);var c=Math.abs(u-l.left),p=Math.abs(u-l.right),h=Math.min(c,p);this.data[a+u]=Math.max(0,Math.min(255,(l.isDash?h:-h)+128))}},ju.prototype.addDash=function(t,e){var r=e?7:0,i=2*r+1;if(this.nextRow+i>this.height)return I("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,r):this.addRegularDash(s)}var l={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:n};return this.nextRow+=i,this.dirty=!0,l},ju.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 qu=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()})};qu.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))},qu.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Zu=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},v(["receive","process"],this),this.invoker=new qu(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=k()?t:self};Zu.prototype.send=function(t,e,r,i,n){var o=this;void 0===n&&(n=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=P(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:i,mustQueue:n,sourceMapId:this.mapId,data:on(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:i,sourceMapId:o.mapId})}}},Zu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var i=this.cancelCallbacks[r];delete this.cancelCallbacks[r],i&&i()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Zu.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)}},Zu.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(an(e.error)):i(null,an(e.data)))}else{var n=!1,o=P(this.globalScope)?void 0:[],a=e.hasCallback?function(e,i){n=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?on(e):null,data:on(i,o)},o)}:function(t){n=!0},s=null,l=an(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,a);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,a)}else a(new Error("Could not find function "+e.type));!n&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Zu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Gu=function t(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=y();for(var i=this.workerPool.acquire(this.id),n=0;n<i.length;n++){var o=new t.Actor(i[n],r,this.id);o.name="Worker "+n,this.actors.push(o)}};function Xu(t,e,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[t*i-2*Math.PI*6378137/2,e*i-2*Math.PI*6378137/2]}Gu.prototype.broadcast=function(t,e,r){p(this.actors,(function(r,i){r.send(t,e,i)}),r=r||function(){})},Gu.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Gu.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},Gu.Actor=Zu;var Wu=function t(e,r,i){this.epsgCode=e,this.extent=r,this.unit=i||"degree",t.set(this)};Wu.prototype.getExtent=function(){if(!this._rectifyExtent){var t=this.extent[2]-this.extent[0],e=this.extent[3]-this.extent[1];if(t===e)this._rectifyExtent=[this.extent[0],this.extent[1],this.extent[2],this.extent[3]];else{var r=Math.max(t,e);this._rectifyExtent=[this.extent[0],this.extent[3]-r,this.extent[0]+r,this.extent[3]]}}return this._rectifyExtent},Wu.prototype.getOrigin=function(){return[this.extent[0],this.extent[3]]},Wu.prototype.getEpsgCode=function(){return this.epsgCode},Wu.prototype.getUnit=function(){return this.unit},Wu.get=function(t){for(var e in Wu)if(Wu.hasOwnProperty(e)&&Wu[e].getEpsgCode&&Wu[e].getEpsgCode()===t)return Wu[e];return null},Wu.set=function(t){var e=t.getEpsgCode().replace(":","").toUpperCase();Wu[e]=t},Wu.EPSG4326=new Wu("EPSG:4326",[-180,-90,180,90]),Wu.EPSG4214=new Wu("EPSG:4214",[-180,-90,180,90]),Wu.EPSG4490=new Wu("EPSG:4490",[-180,-90,180,90]),Wu.EPSG4610=new Wu("EPSG:4610",[-180,-90,180,90]),Wu.EPSG3857=new Wu("EPSG:3857",[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]);var Hu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Ju(0,t,t,e,r),this.z_replace=void 0,this.x_replace=void 0,this.y_replace=void 0};Hu.prototype.offsetZ=function(t){t&&(this.z+=t)},Hu.prototype.replaceX=function(t){this.x_replace=t},Hu.prototype.replaceY=function(t){this.y_replace=t},Hu.prototype.replaceZ=function(t){this.z_replace=t},Hu.prototype.format=function(t,e){var r=t.length;if(r>=e)t=t.substring(r-e,r);else{for(var i="",n=0;n<e;n++)i+="0";t=i.substring(0,i.length-r)+t}return t},Hu.prototype.replaceRule=function(t,e){var r=t.fixlength,i=t.prefix,n=t.postfix,o=e;switch(t.type){case"hex":o=e.toString(16).toUpperCase();break;case"dec":o=e.toString(10).toUpperCase();break;case"oct":o=e.toString(8).toUpperCase();break;case"bin":o=e.toString(2).toUpperCase()}return r&&(o=this.format(o,r)),i&&(o=i+o),n&&(o+=n),o},Hu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Hu.prototype.url=function(t,e){var r=this.x_replace,i=this.y_replace,n=this.z_replace,o=t[(this.x+this.y)%t.length],a=o.indexOf("reversebbox=true")>=0,s=this.getTileBBox(this.x,this.y,this.z);if(a){var l=s.split(",");s=l[1]+","+l[0]+","+l[3]+","+l[2],console.warn("reverse",s)}var u=function(t,e,r){for(var i,n="",o=t;o>0;o--)n+=(e&(i=1<<o-1)?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y),c=this.z,p=this.x,h=this.y;return(r||i||n)&&(n&&(c=this.replaceRule(n,this.z)),r&&(p=this.replaceRule(r,this.x)),i&&(h=this.replaceRule(i,this.y))),o.replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(c)).replace("{x}",String(p)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:h)).replace("{quadkey}",u).replace("{bbox}",s)},Hu.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))},Hu.prototype.getTileBBox=function(t,e,r){return function(t,e,r){var i=Xu(256*t,256*(e=Math.pow(2,r)-e-1),r),n=Xu(256*(t+1),256*(e+1),r);return i[0]+","+i[1]+","+n[0]+","+n[1]}(t,e,r)},Hu.prototype.getCRS=function(){return Wu.EPSG3857},Hu.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Ku=function(t,e){this.wrap=t,this.canonical=e,this.key=Ju(t,e.z,e.z,e.x,e.y)},Yu=function(t,e,r,i,n){this.overscaledZ=t,this.wrap=e,this.canonical=new Hu(r,+i,+n),this.key=Ju(e,t,r,i,n)};function Ju(t,e,r,i,n){(t*=2)<0&&(t=-1*t-1);var o=1<<r;return(o*o*t+o*n+i).toString(36)+r.toString(36)+e.toString(36)}function Qu(t,e,r){var i=function(i,n){if(i)return r(i);if(n){var o=d(f(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),r(null,o)}};return t.url?Mt(e.transformRequest(e.normalizeSourceURL(t.url),Et.Source),i):O.frame((function(){return i(null,t)}))}Yu.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Yu.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Yu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Yu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Yu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Ju(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Ju(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Yu.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},Yu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Yu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new Yu(e,this.wrap,e,r,i),new Yu(e,this.wrap,e,r+1,i),new Yu(e,this.wrap,e,r,i+1),new Yu(e,this.wrap,e,r+1,i+1)]},Yu.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))},Yu.prototype.wrapped=function(){return new Yu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Yu.prototype.unwrapTo=function(t){return new Yu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Yu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Yu.prototype.toUnwrapped=function(){return new Ku(this.wrap,this.canonical)},Yu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Yu.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Ve(t.x-this.wrap,t.y))},tn("CanonicalTileID",Hu),tn("OverscaledTileID",Yu,{omit:["posMatrix"]});var $u=function(t,e,r){this.bounds=Pe.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24};$u.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]},$u.prototype.contains=function(t){var e=Math.pow(2,t.z),r=Math.floor(Re(this.bounds.getWest())*e),i=Math.floor(Be(this.bounds.getNorth())*e),n=Math.ceil(Re(this.bounds.getEast())*e),o=Math.ceil(Be(this.bounds.getSouth())*e);return t.x>=r&&t.x<n&&t.y>=i&&t.y<o};var tc=function(t){function e(e,r,i,n){if(t.call(this),this.id=e,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,f(this,d(r,["url","scheme","tileSize","promoteId"])),this._options=f({type:"vector"},r),this._collectResourceTiming=r.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 Ot("dataloading",{dataType:"source"})),this._tileJSONRequest=Qu(this._options,this.map._requestManager,(function(e,r){t._tileJSONRequest=null,t._loaded=!0,e?t.fire(new Vt(e)):r&&(f(t,r),r.bounds&&(t.tileBounds=new $u(r.bounds,t.minzoom,t.maxzoom)),mt(r.tiles,t.map._requestManager._customAccessToken),_t(r.tiles,t.map._getMapId(),t.map._requestManager._skuToken,t.map._requestManager._customAccessToken),t.fire(new Ot("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new Ot("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.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},e.prototype.serialize=function(){return f({},this._options)},e.prototype.loadTile=function(t,e){var r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(r,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:O.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function n(r,i){return delete t.request,t.aborted?e(null):r&&404!==r.status?e(r):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),Tt(this.dispatcher),e(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:t.request=t.actor.send("reloadTile",i,n.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",i,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}(Ut),ec=function(t){function e(e,r,i,n){t.call(this),this.id=e,this.dispatcher=i,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=f({type:"raster"},r),f(this,d(r,["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 Ot("dataloading",{dataType:"source"})),this._tileJSONRequest=Qu(this._options,this.map._requestManager,(function(e,r){t._tileJSONRequest=null,t._loaded=!0,e?t.fire(new Vt(e)):r&&(f(t,r),r.bounds&&(t.tileBounds=new $u(r.bounds,t.minzoom,t.maxzoom)),mt(r.tiles),_t(r.tiles,t.map._getMapId(),t.map._requestManager._skuToken),t.fire(new Ot("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new Ot("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 f({},this._options)},e.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.loadTile=function(t,e){var r=this,i=this._options.tileUrlReplace;i&&i.length>=3&&(t.tileID.canonical.replaceX(i[0]),t.tileID.canonical.replaceY(i[1]),t.tileID.canonical.replaceZ(i[2])),t.tileID.canonical.offsetZ(this._options.mapgisOffset);var n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.tileID.canonical.offsetZ(0-this._options.mapgisOffset),t.request=Rt(this.map._requestManager.transformRequest(n,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){r.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var o=r.map.painter.context,a=o.gl;t.texture=r.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new zu(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",Tt(r.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}(Ut),rc=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return I('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var i=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var n=0;n<i;n++)this.data[this._idx(-1,n)]=this.data[this._idx(0,n)],this.data[this._idx(i,n)]=this.data[this._idx(i-1,n)],this.data[this._idx(n,-1)]=this.data[this._idx(n,0)],this.data[this._idx(n,i)]=this.data[this._idx(n,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)]};rc.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),i=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[i],r[i+1],r[i+2])},rc.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},rc.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)},rc.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},rc.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},rc.prototype.getPixels=function(){return new Wa({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},rc.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,n=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,l=-r*this.dim,u=o;u<a;u++)for(var c=i;c<n;c++)this.data[this._idx(c,u)]=t.data[this._idx(c+s,u+l)]},tn("DEMData",rc);var ic=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.type="raster-dem",this.maxzoom=22,this._options=f({type:"raster-dem"},r),this.encoding=r.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 r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function i(r,i){r&&(t.state="errored",e(r)),i&&(t.dem=i,t.needsHillshadePrepare=!0,t.state="loaded",e(null))}t.request=Rt(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){this.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var o=self.ImageBitmap&&n instanceof self.ImageBitmap&&It()?n:O.getImageData(n,1),a={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",a,i.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)},e.prototype._getNeighboringTiles=function(t){var e=t.canonical,r=Math.pow(2,e.z),i=(e.x-1+r)%r,n=0===e.x?t.wrap-1:t.wrap,o=(e.x+1+r)%r,a=e.x+1===r?t.wrap+1:t.wrap,s={};return s[new Yu(t.overscaledZ,n,e.z,i,e.y).key]={backfilled:!1},s[new Yu(t.overscaledZ,a,e.z,o,e.y).key]={backfilled:!1},e.y>0&&(s[new Yu(t.overscaledZ,n,e.z,i,e.y-1).key]={backfilled:!1},s[new Yu(t.overscaledZ,t.wrap,e.z,e.x,e.y-1).key]={backfilled:!1},s[new Yu(t.overscaledZ,a,e.z,o,e.y-1).key]={backfilled:!1}),e.y+1<r&&(s[new Yu(t.overscaledZ,n,e.z,i,e.y+1).key]={backfilled:!1},s[new Yu(t.overscaledZ,t.wrap,e.z,e.x,e.y+1).key]={backfilled:!1},s[new Yu(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}(ec);function nc(t){var e=(90+t)/180*90;return e||45+e/2}function oc(t){return t.geometry.coordinates=t.geometry.coordinates.map((function(t){return t[1]=nc(t[1]),t})),t}function ac(t){return t.geometry.coordinates=t.geometry.coordinates.map((function(t){return t.map((function(t){return t[1]=nc(t[1]),t}))})),t}function sc(t){return t.geometry.coordinates=t.geometry.coordinates.map((function(t){return t.map((function(t){return t.map((function(t){return t[1]=nc(t[1]),t}))})),t})),t}var lc=function(t){function e(e,r,i,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=i.getActor(),this.setEventedParent(n),this.crs=this.getCrs(),this._data=r.data,this._options=f({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;var o=8192/this.tileSize;this.workerOptions=f({crs:this.crs,source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*o,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*o,extent:8192,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1,crs:this.getCrs()},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:8192,radius:(r.clusterRadius||50)*o,log:!1,generateId:r.generateId||!1,crs:this.getCrs()},clusterProperties:r.clusterProperties},r.workerOptions)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrs=function(){return"EPSG:3857"},e.prototype.fixCrsData=function(t){return this.getCrs()!==Wu.EPSG3857.getEpsgCode()&&(t=function(t,e){return"FeatureCollection"===t.type?t=function(t){return t.features=t.features.map((function(e){var r;return"Point"===e.geometry.type?((r=e).geometry.coordinates[1]=nc(r.geometry.coordinates[1]),e=r):"LineString"===e.geometry.type||"MultiPoint"===t.type?e=oc(e):"Polygon"===e.geometry.type||"MultiLineString"===t.type?e=ac(e):"MultiPolygon"===e.geometry.type&&(e=sc(e)),e})),t}(t):"Point"===t.type?t=oopPoint(t):"LineString"===t.type||"MultiPoint"===t.type?t=oc(t):"Polygon"===t.type||"MultiLineString"===t.type?t=ac(t):"MultiPolygon"===t.type&&(t=sc(t)),console.log("loopdata",t),t}(t)),t},e.prototype.load=function(){var t=this;this.fire(new Ot("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)t.fire(new Vt(e));else{var r={dataType:"source",sourceDataType:"metadata"};t._collectResourceTiming&&t._resourceTiming&&t._resourceTiming.length>0&&(r.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new Ot("data",r))}}))},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 Ot("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)e.fire(new Vt(t));else{var r={dataType:"source",sourceDataType:"content"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new Ot("data",r))}})),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,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},i),this},e.prototype._updateWorkerData=function(t){var e=this;this._loaded=!1;var r=f({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._requestManager.transformRequest(O.resolveURL(i),Et.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.actor.send(this.type+".loadData",r,(function(i,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:r.source},null),t(i))}))},e.prototype.loaded=function(){return this._loaded},e.prototype.loadTile=function(t,e){var r=this,i=t.actor?"reloadTile":"loadTile";t.actor=this.actor,t.request=this.actor.send(i,{type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:O.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,r.map.painter,"reloadTile"===i),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 f({},this._options,{type:this.type,data:this._data})},e.prototype.hasTransition=function(){return!1},e}(Ut),uc=Yn([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),cc=function(t){function e(e,r,i,n){t.call(this),this.id=e,this.dispatcher=i,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(t,e){var r=this;this._loaded=!1,this.fire(new Ot("dataloading",{dataType:"source"})),this.url=this.options.url,Rt(this.map._requestManager.transformRequest(this.url,Et.Image),(function(i,n){r._loaded=!0,i?r.fire(new Vt(i)):n&&(r.image=n,t&&(r.coordinates=t),e&&e(),r._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 Ot("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 r=t.map(Ve.fromLngLat);this.tileID=function(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),i=Math.max(i,s.x),n=Math.max(n,s.y)}var l=Math.max(i-e,n-r),u=Math.max(0,Math.floor(-Math.log(l)/Math.LN2)),c=Math.pow(2,u);return new Hu(u,Math.floor((e+i)/2*c),Math.floor((r+n)/2*c))}(r),this.minzoom=this.maxzoom=this.tileID.z;var i=r.map((function(t){return e.tileID.getTilePoint(t)._round()}));return this._boundsArray=new $n,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,8192,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,8192),this._boundsArray.emplaceBack(i[2].x,i[2].y,8192,8192),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new Ot("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 r in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,uc.members)),this.boundsSegments||(this.boundsSegments=Po.simpleSegment(0,0,4,2)),this.texture||(this.texture=new zu(t,this.image,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.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}(Ut),pc=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.roundZoom=!0,this.type="video",this.options=r}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 r=0,i=e.urls;r<i.length;r+=1)this.urls.push(this.map._requestManager.transformRequest(i[r],Et.Source).url);!function(e,r){var i,n,o=self.document.createElement("video");o.muted=!0,o.onloadstart=function(){!function(e,r){t._loaded=!0,r&&(t.video=r,t.video.loop=!0,t.video.addEventListener("playing",(function(){t.map.triggerRepaint()})),t.map&&t.video.play(),t._finishLoading())}(0,o)};for(var a=0;a<e.length;a++){var s=self.document.createElement("source");i=e[a],n=void 0,(n=self.document.createElement("a")).href=i,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(o.crossOrigin="Anonymous"),s.src=e[a],o.appendChild(s)}}(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 Vt(new jt("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 r in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,uc.members)),this.boundsSegments||(this.boundsSegments=Po.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 zu(t,this.video,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.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}(cc),hc=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new Vt(new jt("sources."+e,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Vt(new jt("sources."+e,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new Vt(new jt("sources."+e,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof self.HTMLCanvasElement||this.fire(new Vt(new jt("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 Vt(new jt("sources."+e,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.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 self.HTMLCanvasElement?this.options.canvas:self.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new Vt(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,r=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,uc.members)),this.boundsSegments||(this.boundsSegments=Po.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new zu(e,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[i];"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 r=e[t];if(isNaN(r)||r<=0)return!0}return!1},e}(cc),fc={vector:tc,raster:ec,"raster-dem":ic,geojson:lc,video:pc,image:cc,canvas:hc};function dc(t,e){var r=ka([]);return Pa(r,r,[1,1,0]),Ma(r,r,[.5*t.width,.5*t.height,1]),Ca(r,r,t.calculatePosMatrix(e.toUnwrapped()))}function mc(t,e,r,i,n,o){var a=function(t,e,r){if(t)for(var i=0,n=t;i<n.length;i+=1){var o=e[n[i]];if(o&&o.source===r&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(n&&n.layers,e,t.id),s=o.maxPitchScaleFactor(),l=t.tilesIn(i,s,a);l.sort(yc);for(var u=[],c=0,p=l;c<p.length;c+=1){var h=p[c];u.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,r,t._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,n,o,s,dc(t.transform,h.tileID))})}var f=function(t){for(var e={},r={},i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.queryResults,s=o.wrappedTileID,l=r[s]=r[s]||{};for(var u in a)for(var c=a[u],p=l[u]=l[u]||{},h=e[u]=e[u]||[],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}(u);for(var d in f)f[d].forEach((function(e){var r=e.feature,i=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=i}));return f}function yc(t,e){var r=t.tileID,i=e.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}var _c=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};_c.prototype.encode=function(t){return this._stringToNumber[t]},_c.prototype.decode=function(t){return this._numberToString[t]};var gc=function(t,e,r,i,n,o){this.epsg=o||"EPSG:3857",this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=i,this.properties=t.properties,this.id=n},vc={geometry:{configurable:!0}};vc.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z,this.epsg).geometry),this._geometry},vc.geometry.set=function(t){this._geometry=t},gc.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(gc.prototype,vc);var xc=function(){this.state={},this.stateChanges={},this.deletedStates={}};xc.prototype.updateState=function(t,e,r){var i=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},f(this.stateChanges[t][i],r),null===this.deletedStates[t])for(var n in this.deletedStates[t]={},this.state[t])n!==i&&(this.deletedStates[t][n]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][i])for(var o in this.deletedStates[t][i]={},this.state[t][i])r[o]||(this.deletedStates[t][i][o]=null);else for(var a in r)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][a]&&delete this.deletedStates[t][i][a]},xc.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var i=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][i]&&(this.deletedStates[t][i]=this.deletedStates[t][i]||{},this.deletedStates[t][i][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][i])for(r in this.deletedStates[t][i]={},this.stateChanges[t][i])this.deletedStates[t][i][r]=null;else this.deletedStates[t][i]=null;else this.deletedStates[t]=null}},xc.prototype.getState=function(t,e){var r=String(e),i=f({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);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 i[o]}return i},xc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},xc.prototype.coalesceChanges=function(t,e){var r={};for(var i in this.stateChanges){this.state[i]=this.state[i]||{};var n={};for(var o in this.stateChanges[i])this.state[i][o]||(this.state[i][o]={}),f(this.state[i][o],this.stateChanges[i][o]),n[o]=this.state[i][o];r[i]=n}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var l in this.state[a])s[l]={},this.state[a][l]={};else for(var u in this.deletedStates[a]){if(null===this.deletedStates[a][u])this.state[a][u]={};else for(var c=0,p=Object.keys(this.deletedStates[a][u]);c<p.length;c+=1)delete this.state[a][u][p[c]];s[u]=this.state[a][u]}r[a]=r[a]||{},f(r[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var h in t)t[h].setFeatureState(r,e)};var bc=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ki(8192,16,0),this.grid3D=new Ki(8192,16,0),this.featureIndexArray=new zo,this.promoteId=e};function wc(t,e,r,i,n){return b(t,(function(t,o){var a=e instanceof Vn?e.get(o):null;return a&&a.evaluate?a.evaluate(r,i,n):a}))}function Sc(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),i=Math.max(i,s.x),n=Math.max(n,s.y)}return{minX:e,minY:r,maxX:i,maxY:n}}function Tc(t,e){return e-t}bc.prototype.insert=function(t,e,r,i,n,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);for(var s=o?this.grid3D:this.grid,l=0;l<e.length;l++){for(var u=e[l],c=[1/0,1/0,-1/0,-1/0],p=0;p<u.length;p++){var h=u[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])}},bc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Hs.VectorTile(new Sl(this.rawTileData)).layers,this.sourceLayerCoder=new _c(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},bc.prototype.query=function(t,e,r,i){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,l=wi(a.filter),u=t.queryGeometry,c=t.queryPadding*s,p=Sc(u),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=Sc(t.cameraQueryGeometry),d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,i,o){return function(t,e,r,i,o){for(var a=0,s=t;a<s.length;a+=1){var l=s[a];if(e<=l.x&&r<=l.y&&i>=l.x&&o>=l.y)return!0}var u=[new n(e,r),new n(e,o),new n(i,o),new n(i,r)];if(t.length>2)for(var c=0,p=u;c<p.length;c+=1)if(va(t,p[c]))return!0;for(var h=0;h<t.length-1;h++)if(xa(t[h],t[h+1],u))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,i+c,o+c)})),m=0,y=d;m<y.length;m+=1)h.push(y[m]);h.sort(Tc);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,l,a.layers,a.availableImages,e,r,i,(function(e,r,i){return f||(f=sa(e)),r.queryIntersectsFeature(u,e,i,f,o.z,t.transform,s,t.pixelPosMatrix)}))}},x=0;x<h.length;x++)v(x);return g},bc.prototype.loadMatchingFeature=function(t,e,r,i,n,o,a,s,l,u,c){var p=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(o,p)){var h=this.sourceLayerCoder.decode(r),f=this.vtLayers[h].feature(i);if(n.filter(new Pn(this.tileID.overscaledZ),f))for(var d=this.getId(f,h),m=new Hu(0,0,0),y=0;y<p.length;y++){var _=p[y];if(!(o&&o.indexOf(_)<0)){var g=s[_];if(g){var v={};void 0!==d&&u&&(v=u.getState(g.sourceLayer||"_geojsonTileLayer",d));var x=l[_];x.paint=wc(x.paint,g.paint,f,v,a),x.layout=wc(x.layout,g.layout,f,v,a);var b=!c||c(f,g,v);if(b){var w=new gc(f,this.z,this.x,this.y,d,m.getCRS().getEpsgCode());w.layer=x;var S=t[_];void 0===S&&(S=t[_]=[]),S.push({featureIndex:i,feature:w,intersectionZ:b})}}}}}},bc.prototype.lookupSymbolFeatures=function(t,e,r,i,n,o,a,s){var l={};this.loadVTLayers();for(var u=wi(n),c=0,p=t;c<p.length;c+=1)this.loadMatchingFeature(l,r,i,p[c],u,o,a,s,e);return l},bc.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var i=0,n=r[e];i<n.length;i+=1)if(t===n[i])return!0;return!1},bc.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},tn("FeatureIndex",bc,{omit:["rawTileData","sourceLayerCoder"]});var Ic=function(t,e){this.tileID=t,this.uid=y(),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"};Ic.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<O.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Ic.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Ic.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var i 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 r={};if(!e)return r;for(var i=function(){var t=o[n],i=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==i.length){t.layers=i,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return i.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=i;a<s.length;a+=1)r[s[a].id]=t}},n=0,o=t;n<o.length;n+=1)i();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var n=this.buckets[i];if(n instanceof hu){if(this.hasSymbolBuckets=!0,!r)break;n.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var a=this.buckets[o];if(a instanceof hu&&a.hasRTLText){this.hasRTLText=!0,Cn.isLoading()||Cn.isLoaded()||"deferred"!==kn()||zn();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new bo},Ic.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"},Ic.prototype.getBucket=function(t){return this.buckets[t.id]},Ic.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new zu(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new zu(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},Ic.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Ic.prototype.queryRenderedFeatures=function(t,e,r,i,n,o,a,s,l,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:o,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:a,queryPadding:this.queryPadding*l},t,e,r):{}},Ic.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var i=r.loadVTLayers(),n=e?e.sourceLayer:"",o=i._geojsonTileLayer||i[n];if(o)for(var a=wi(e&&e.filter),s=this.tileID.canonical,l=s.z,u=s.x,c=s.y,p={z:l,x:u,y:c},h=0;h<o.length;h++){var f=o.feature(h);if(a.filter(new Pn(this.tileID.overscaledZ),f)){var d=r.getId(f,n),m=new gc(f,l,u,c,d);m.tile=p,t.push(m)}}}},Ic.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Ic.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Ic.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=z(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var i=Date.now(),n=!1;if(this.expirationTime>i)n=!1;else if(e)if(this.expirationTime<e)n=!0;else{var o=this.expirationTime-e;o?this.expirationTime=i+Math.max(o,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Ic.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)},Ic.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var i in this.buckets)if(e.style.hasLayer(i)){var n=this.buckets[i],o=n.layers[0].sourceLayer||"_geojsonTileLayer",a=r[o],s=t[o];if(a&&s&&0!==Object.keys(s).length){n.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(i);l&&l.paint&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(n)))}}}},Ic.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Ic.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<O.now()},Ic.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Ic.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=O.now()+t},Ic.prototype.setDependencies=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1)r[n[i]]=!0;this.dependencies[t]=r},Ic.prototype.hasDependency=function(t,e){for(var r=0,i=t;r<i.length;r+=1){var n=this.dependencies[i[r]];if(n)for(var o=0,a=e;o<a.length;o+=1)if(n[a[o]])return!0}return!1};var Ec=function(t,e){this.max=t,this.onRemove=e,this.reset()};Ec.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var i=r[e];i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}return this.data={},this.order=[],this},Ec.prototype.add=function(t,e,r){var i=this,n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);var o={value:e,timeout:void 0};if(void 0!==r&&(o.timeout=setTimeout((function(){i.remove(t,o)}),r)),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},Ec.prototype.has=function(t){return t.wrapped().key in this.data},Ec.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Ec.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},Ec.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},Ec.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Ec.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,i=void 0===e?0:this.data[r].indexOf(e),n=this.data[r][i];return this.data[r].splice(i,1),n.timeout&&clearTimeout(n.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(n.value),this.order.splice(this.order.indexOf(r),1),this},Ec.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},Ec.prototype.filter=function(t){var e=[];for(var r in this.data)for(var i=0,n=this.data[r];i<n.length;i+=1){var o=n[i];t(o.value)||e.push(o)}for(var a=0,s=e;a<s.length;a+=1){var l=s[a];this.remove(l.value.tileID,l)}};var Ac=function(t,e,r){this.context=t;var i=t.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};Ac.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Ac.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},Ac.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var kc={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},zc=function(t,e,r,i){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,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};zc.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},zc.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},zc.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var i=e.attributes[this.attributes[r].name];void 0!==i&&t.enableVertexAttribArray(i)}},zc.prototype.setVertexAttribPointers=function(t,e,r){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],o=e.attributes[n.name];void 0!==o&&t.vertexAttribPointer(o,n.components,t[kc[n.type]],!1,this.itemSize,n.offset+this.itemSize*(r||0))}},zc.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Cc=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};Cc.prototype.get=function(){return this.current},Cc.prototype.set=function(t){},Cc.prototype.getDefault=function(){return this.default},Cc.prototype.setDefault=function(){this.set(this.default)};var Pc=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 ce.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}(Cc),Mc=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}(Cc),Dc=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}(Cc),Lc=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}(Cc),Rc=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}(Cc),Bc=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}(Cc),Fc=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}(Cc),Oc=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}(Cc),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!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}(Cc),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[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}(Cc),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!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}(Cc),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 this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(Cc),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!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}(Cc),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(){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}(Cc),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 ce.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}(Cc),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(){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}(Cc),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.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(Cc),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 this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(Cc),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 this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(Cc),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 null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(Cc),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 this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(Cc),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[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}(Cc),$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 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}(Cc),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 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}(Cc),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 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}(Cc),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 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}(Cc),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 null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(Cc),np=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}(Cc),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 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}(Cc),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(){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}(Cc),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!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}(Cc),lp=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(Cc),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.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}(lp),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.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}(lp),pp=function(t,e,r,i){this.context=t,this.width=e,this.height=r;var n=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new up(t,n),i&&(this.depthAttachment=new cp(t,n))};pp.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r)}t.deleteFramebuffer(this.framebuffer)};var hp=function(t,e,r){this.func=t,this.mask=e,this.range=r};hp.ReadOnly=!1,hp.ReadWrite=!0,hp.disabled=new hp(519,hp.ReadOnly,[0,1]);var fp=function(t,e,r,i,n,o){this.test=t,this.ref=e,this.mask=r,this.fail=i,this.depthFail=n,this.pass=o};fp.disabled=new fp({func:519,mask:0},0,0,7680,7680,7680);var dp=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};dp.disabled=new dp(dp.Replace=[1,0],ce.transparent,[!1,!1,!1,!1]),dp.unblended=new dp(dp.Replace,ce.transparent,[!0,!0,!0,!0]),dp.alphaBlended=new dp([1,771],ce.transparent,[!0,!0,!0,!0]);var mp=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};mp.disabled=new mp(!1,1029,2305),mp.backCCW=new mp(!0,1029,2305);var yp=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Pc(this),this.clearDepth=new Mc(this),this.clearStencil=new Dc(this),this.colorMask=new Lc(this),this.depthMask=new Rc(this),this.stencilMask=new Bc(this),this.stencilFunc=new Fc(this),this.stencilOp=new Oc(this),this.stencilTest=new Vc(this),this.depthRange=new Uc(this),this.depthTest=new Nc(this),this.depthFunc=new jc(this),this.blend=new qc(this),this.blendFunc=new Zc(this),this.blendColor=new Gc(this),this.blendEquation=new Xc(this),this.cullFace=new Wc(this),this.cullFaceSide=new Hc(this),this.frontFace=new Kc(this),this.program=new Yc(this),this.activeTexture=new Jc(this),this.viewport=new Qc(this),this.bindFramebuffer=new $c(this),this.bindRenderbuffer=new tp(this),this.bindTexture=new ep(this),this.bindVertexBuffer=new rp(this),this.bindElementBuffer=new ip(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new np(this),this.pixelStoreUnpack=new op(this),this.pixelStoreUnpackPremultiplyAlpha=new ap(this),this.pixelStoreUnpackFlipY=new sp(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.extTimerQuery=t.getExtension("EXT_disjoint_timer_query")};yp.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()},yp.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},yp.prototype.createIndexBuffer=function(t,e){return new Ac(this,t,e)},yp.prototype.createVertexBuffer=function(t,e,r){return new zc(this,t,e,r)},yp.prototype.createRenderbuffer=function(t,e,r){var i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),n},yp.prototype.createFramebuffer=function(t,e,r){return new pp(this,t,e,r)},yp.prototype.clear=function(t){var e=t.color,r=t.depth,i=this.gl,n=0;e&&(n|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(n|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),i.clear(n)},yp.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))},yp.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)},yp.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)},yp.prototype.setColorMode=function(t){a(t.blendFunction,dp.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)},yp.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var _p=function(t){function e(e,r,i){var n=this;t.call(this),this.id=e,this.dispatcher=i,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,r,i){var n=new fc[e.type](t,e,r,i);if(n.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+n.id);return v(["load","abort","unload","serialize","prepare"],n),n}(e,r,i,this),this._tiles={},this._cache=new Ec(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new xc}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 r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},e.prototype.getIds=function(){return h(this._tiles).map((function(t){return t.tileID})).sort(gp).map((function(t){return t.key}))},e.prototype.getRenderableIds=function(t){var e=this,r=[];for(var i in this._tiles)this._isIdRenderable(i,t)&&r.push(this._tiles[i]);return t?r.sort((function(t,r){var i=t.tileID,o=r.tileID,a=new n(i.canonical.x,i.canonical.y)._rotate(e.transform.angle),s=new n(o.canonical.x,o.canonical.y)._rotate(e.transform.angle);return i.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):r.map((function(t){return t.tileID})).sort(gp).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 r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},e.prototype._tileLoaded=function(t,e,r,i){if(i)return t.state="errored",void(404!==i.status?this._source.fire(new Vt(i,{tile:t})):this.update(this.transform));t.timeAdded=O.now(),"expired"===r&&(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 Ot("data",{dataType:"source",tile:t,coord:t.tileID}))},e.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var i=e[r];if(t.neighboringTiles&&t.neighboringTiles[i]){var n=this.getTileByID(i);o(t,n),o(n,t)}}function o(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,i=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===r&&0===i||Math.abs(i)>1||(Math.abs(r)>1&&(1===Math.abs(r+n)?r+=n:1===Math.abs(r-n)&&(r-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,i),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,r,i){for(var n in this._tiles){var o=this._tiles[n];if(!(i[n]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){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 l=a;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){i[a.key]=a;break}}}},e.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var i=t.overscaledZ-1;i>=e;i--){var n=t.scaledTo(i),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,r=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(e*r*5),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;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 r={};for(var i in this._tiles){var n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),r[n.tileID.key]=n}for(var o in this._tiles=r,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 r=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new Yu(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(i=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&&(i=i.filter((function(t){return r._source.hasTile(t)})))):i=[];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(i,n);if(vp(this._source.type)){for(var l={},u={},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<=O.now())){var m=this.findLoadedParent(f,o);m&&(this._addTile(m.tileID),l[m.tileID.key]=m.tileID),u[h]=f}}for(var y in this._retainLoadedChildren(u,n,a,s),l)s[y]||(this._coveredTiles[y]=!0,s[y]=l[y])}for(var _ in s)this._tiles[_].clearFadeHold();for(var g=0,v=function(t,e){var r=[];for(var i in t)i in e||r.push(i);return r}(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,r){for(var i={},n={},o=Math.max(r-e.maxOverzooming,this._source.minzoom),a=Math.max(r+e.maxUnderzooming,this._source.minzoom),s={},l=0,u=t;l<u.length;l+=1){var c=u[l],p=this._addTile(c);i[c.key]=c,p.hasData()||r<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,r,a,i);for(var h=0,f=t;h<f.length;h+=1){var d=f[h],m=this._tiles[d.key];if(!m.hasData()){if(r+1>this._source.maxzoom){var y=d.children(this._source.maxzoom)[0],_=this.getTile(y);if(_&&_.hasData()){i[y.key]=y;continue}}else{var g=d.children(this._source.maxzoom);if(i[g[0].key]&&i[g[1].key]&&i[g[2].key]&&i[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&&(i[b.key]=b,v=m.wasRequested(),m.hasData()))break}}}return i},e.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,i=this._tiles[t].tileID;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){r=this._loadedParentTiles[i.key];break}e.push(i.key);var n=i.scaledTo(i.overscaledZ-1);if(r=this._getLoadedTile(n))break;i=n}for(var o=0,a=e;o<a.length;o+=1)this._loadedParentTiles[a[o]]=r}},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 r=Boolean(e);return r||(e=new Ic(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,r||this._source.fire(new Ot("dataloading",{tile:e,coord:e.tileID,dataType:"source"})),e):null},e.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),i))},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,r){var i=this,n=[],o=this.transform;if(!o)return n;for(var a=r?o.getCameraQueryGeometry(t):t,s=t.map((function(t){return o.pointCoordinate(t)})),l=a.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),c=1/0,p=1/0,h=-1/0,f=-1/0,d=0,m=l;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 r=i._tiles[u[t]];if(!r.holdingForFade()){var a=r.tileID,d=Math.pow(2,o.zoom-r.tileID.overscaledZ),m=e*r.queryPadding*8192/r.tileSize/d,y=[a.getTilePoint(new Ve(c,p)),a.getTilePoint(new Ve(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=l.map((function(t){return a.getTilePoint(t)}));n.push({tile:r,tileID:a,queryGeometry:_,cameraQueryGeometry:g,scale:d})}}},g=0;g<u.length;g++)_(g);return n},e.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),i=0,n=r;i<n.length;i+=1){var o=n[i];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return r},e.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(vp(this._source.type))for(var t in this._tiles){var e=this._tiles[t];if(void 0!==e.fadeEndTime&&e.fadeEndTime>=O.now())return!0}return!1},e.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},e.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},e.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},e.prototype.setDependencies=function(t,e,r){var i=this._tiles[t];i&&i.setDependencies(e,r)},e.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},e}(Ut);function gp(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),i=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||i-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function vp(t){return"raster"===t||"image"===t||"video"===t}function xp(){return new self.Worker(hy.workerUrl)}_p.maxOverzooming=10,_p.maxUnderzooming=3;var bp=function(){this.active={}};bp.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<bp.workerCount;)this.workers.push(new xp);return this.active[t]=!0,this.workers.slice()},bp.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)};var wp,Sp=Math.floor(O.hardwareConcurrency/2);bp.workerCount=Math.max(Math.min(Sp,6),1);var Tp=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ip(t,e){var r={};for(var i in t)"ref"!==i&&(r[i]=t[i]);return Tp.forEach((function(t){t in e&&(r[t]=e[t])})),r}function Ep(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=Ip(t[i],e[t[i].ref]));return t}var Ap={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 kp(t,e,r){r.push({command:Ap.addSource,args:[t,e[t]]})}function zp(t,e,r){e.push({command:Ap.removeSource,args:[t]}),r[t]=!0}function Cp(t,e,r,i){zp(t,r,i),kp(t,e,r)}function Pp(t,e,r){var i;for(i in t[r])if(t[r].hasOwnProperty(i)&&"data"!==i&&!a(t[r][i],e[r][i]))return!1;for(i in e[r])if(e[r].hasOwnProperty(i)&&"data"!==i&&!a(t[r][i],e[r][i]))return!1;return!0}function Mp(t,e,r,i,n,o){var s;for(s in e=e||{},t=t||{})t.hasOwnProperty(s)&&(a(t[s],e[s])||r.push({command:o,args:[i,s,e[s],n]}));for(s in e)e.hasOwnProperty(s)&&!t.hasOwnProperty(s)&&(a(t[s],e[s])||r.push({command:o,args:[i,s,e[s],n]}))}function Dp(t){return t.id}function Lp(t,e){return t[e.id]=e,t}var Rp=function(t,e,r){var i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.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 Bp(t,e,r,i,n){var o=Aa();return e?(Ma(o,o,[1/n,1/n,1]),r||Da(o,o,i.angle)):Ca(o,i.labelPlaneMatrix,t),o}function Fp(t,e,r,i,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 Ma(o,o,[n,n,1]),r||Da(o,o,-i.angle),o}return i.glCoordMatrix}function Op(t,e){var r=[t.x,t.y,0,1];Hp(r,r,e);var i=r[3];return{point:new n(r[0]/i,r[1]/i),signedDistanceFromCamera:i}}function Vp(t,e){var r=t[0]/t[3],i=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&i>=-e[1]&&i<=e[1]}function Up(t,e,r,i,o,a,s,l){var u=i?t.textSizeData:t.iconSizeData,c=eu(u,r.transform.zoom),p=[256/r.width*2+1,256/r.height*2+1],h=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;h.clear();for(var f=t.lineVertexArray,d=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,m=r.transform.width/r.transform.height,y=!1,_=0;_<d.length;_++){var g=d.get(_);if(g.hidden||g.writingMode===Hl.vertical&&!y)Wp(g.numGlyphs,h);else{y=!1;var v=[g.anchorX,g.anchorY,0,1];if(Oa(v,v,e),Vp(v,p)){var x=.5+v[3]/r.transform.cameraToCenterDistance*.5,b=tu(u,c,g),w=s?b*x:b/x,S=new n(g.anchorX,g.anchorY),T=Op(S,o).point,I={},E=qp(g,w,!1,l,e,o,a,t.glyphOffsetArray,f,h,T,S,I,m);y=E.useVertical,(E.notEnoughRoom||y||E.needsFlipping&&qp(g,w,!0,l,e,o,a,t.glyphOffsetArray,f,h,T,S,I,m).notEnoughRoom)&&Wp(g.numGlyphs,h)}else Wp(g.numGlyphs,h)}}i?t.text.dynamicLayoutVertexBuffer.updateData(h):t.icon.dynamicLayoutVertexBuffer.updateData(h)}function Np(t,e,r,i,n,o,a,s,l,u,c,p){var h=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,m=e.getoffsetX(s.glyphStartIndex),y=e.getoffsetX(h-1),_=Gp(t*m,r,i,n,o,a,s.segment,f,d,l,u,c,p);if(!_)return null;var g=Gp(t*y,r,i,n,o,a,s.segment,f,d,l,u,c,p);return g?{first:_,last:g}:null}function jp(t,e,r,i){return t===Hl.horizontal&&Math.abs(r.y-e.y)>Math.abs(r.x-e.x)*i?{useVertical:!0}:(t===Hl.vertical?e.y<r.y:e.x>r.x)?{needsFlipping:!0}:null}function qp(t,e,r,i,o,a,s,l,u,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=Np(y,l,_,g,r,p,h,t,u,a,f,!1);if(!w)return{notEnoughRoom:!0};var S=Op(w.first.point,s).point,T=Op(w.last.point,s).point;if(i&&!r){var I=jp(t.writingMode,S,T,d);if(I)return I}m=[w.first];for(var E=t.glyphStartIndex+1;E<v-1;E++)m.push(Gp(y*l.getoffsetX(E),_,g,r,p,h,t.segment,x,b,u,a,f,!1));m.push(w.last)}else{if(i&&!r){var A=Op(h,o).point,k=t.lineStartIndex+t.segment+1,z=new n(u.getx(k),u.gety(k)),C=Op(z,o),P=C.signedDistanceFromCamera>0?C.point:Zp(h,z,A,1,o),M=jp(t.writingMode,A,P,d);if(M)return M}var D=Gp(y*l.getoffsetX(t.glyphStartIndex),_,g,r,p,h,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,u,a,f,!1);if(!D)return{notEnoughRoom:!0};m=[D]}for(var L=0,R=m;L<R.length;L+=1){var B=R[L];lu(c,B.point,B.angle)}return{}}function Zp(t,e,r,i,n){var o=Op(t.add(t.sub(e)._unit()),n).point,a=r.sub(o);return r.add(a._mult(i/a.mag()))}function Gp(t,e,r,i,o,a,s,l,u,c,p,h,f){var d=i?t-e:t+e,m=d>0?1:-1,y=0;i&&(m*=-1,y=Math.PI),m<0&&(y+=Math.PI);for(var _=m>0?l+s:l+s+1,g=_,v=o,x=o,b=0,w=0,S=Math.abs(d);b+w<=S;){if((_+=m)<l||_>=u)return null;if(x=v,void 0===(v=h[_])){var T=new n(c.getx(_),c.gety(_)),I=Op(T,p);if(I.signedDistanceFromCamera>0)v=h[_]=I.point;else{var E=_-m;v=Zp(0===b?a:new n(c.getx(E),c.gety(E)),T,x,S-b+1,p)}}b+=w,w=x.dist(v)}var A=(S-b)/w,k=v.sub(x),z=k.mult(A)._add(x);return z._add(k._unit()._perp()._mult(r*m)),{point:z,angle:y+Math.atan2(v.y-x.y,v.x-x.x),tileDistance:f?{prevTileDistance:_-m===g?0:c.gettileUnitDistanceFromAnchor(_-m),lastSegmentViewportDistance:S-b}:null}}Rp.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Rp.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},Rp.prototype.insertCircle=function(t,e,r,i){this._forEachCell(e-i,r-i,e+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(i)},Rp.prototype._insertBoxCell=function(t,e,r,i,n,o){this.boxCells[n].push(o)},Rp.prototype._insertCircleCell=function(t,e,r,i,n,o){this.circleCells[n].push(o)},Rp.prototype._query=function(t,e,r,i,n,o){if(r<0||t>this.width||i<0||e>this.height)return!n&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i){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 l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],c=this.circles[3*l+1],p=this.circles[3*l+2];a.push({key:this.circleKeys[l],x1:u-p,y1:c-p,x2:u+p,y2:c+p})}return o?a.filter(o):a}return this._forEachCell(t,e,r,i,this._queryCell,a,{hitTest:n,seenUids:{box:{},circle:{}}},o),n?a.length>0:a},Rp.prototype._queryCircle=function(t,e,r,i,n){var o=t-r,a=t+r,s=e-r,l=e+r;if(a<0||o>this.width||l<0||s>this.height)return!i&&[];var u=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,u,{hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},n),i?u.length>0:u},Rp.prototype.query=function(t,e,r,i,n){return this._query(t,e,r,i,!1,n)},Rp.prototype.hitTest=function(t,e,r,i,n){return this._query(t,e,r,i,!0,n)},Rp.prototype.hitTestCircle=function(t,e,r,i){return this._queryCircle(t,e,r,!0,i)},Rp.prototype._queryCell=function(t,e,r,i,n,o,a,s){var l=a.seenUids,u=this.boxCells[n];if(null!==u)for(var c=this.bboxes,p=0,h=u;p<h.length;p+=1){var f=h[p];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(t<=c[d+2]&&e<=c[d+3]&&r>=c[d+0]&&i>=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(!l.circle[v]){l.circle[v]=!0;var x=3*v;if(this._circleAndRectCollide(y[x],y[x+1],y[x+2],t,e,r,i)&&(!s||s(this.circleKeys[v]))){if(a.hitTest)return o.push(!0),!0;var b=y[x],w=y[x+1],S=y[x+2];o.push({key:this.circleKeys[v],x1:b-S,y1:w-S,x2:b+S,y2:w+S})}}}},Rp.prototype._queryCellCircle=function(t,e,r,i,n,o,a,s){var l=a.circle,u=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(!u.box[d]){u.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(l.x,l.y,l.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(!u.circle[x]){u.circle[x]=!0;var b=3*x;if(this._circlesCollide(_[b],_[b+1],_[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return o.push(!0),!0}}},Rp.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),p=this._convertToYCellCoord(i),h=l;h<=c;h++)for(var f=u;f<=p;f++)if(n.call(this,t,e,r,i,this.xCellCount*f+h,o,a,s))return},Rp.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Rp.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Rp.prototype._circlesCollide=function(t,e,r,i,n,o){var a=i-t,s=n-e,l=r+o;return l*l>a*a+s*s},Rp.prototype._circleAndRectCollide=function(t,e,r,i,n,o,a){var s=(o-i)/2,l=Math.abs(t-(i+s));if(l>s+r)return!1;var u=(a-n)/2,c=Math.abs(e-(n+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var p=l-s,h=c-u;return p*p+h*h<=r*r};var Xp=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Wp(t,e){for(var r=0;r<t;r++){var i=e.length;e.resize(i+4),e.float32.set(Xp,3*i)}}function Hp(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t[3]=r[3]*i+r[7]*n+r[15],t}var Kp=function(t,e,r){void 0===e&&(e=new Rp(t.width+200,t.height+200,25)),void 0===r&&(r=new Rp(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,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 Yp(t,e,r){t[e+4]=r?1:0}function Jp(t,e,r){return e*(8192/(t.tileSize*Math.pow(2,r-t.tileID.overscaledZ)))}Kp.prototype.placeCollisionBox=function(t,e,r,i,n){var o=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY),a=r*o.perspectiveRatio,s=t.x1*a+o.point.x,l=t.y1*a+o.point.y,u=t.x2*a+o.point.x,c=t.y2*a+o.point.y;return!this.isInsideGrid(s,l,u,c)||!e&&this.grid.hitTest(s,l,u,c,n)?{box:[],offscreen:!1}:{box:[s,l,u,c],offscreen:this.isOffscreen(s,l,u,c)}},Kp.prototype.approximateTileDistance=function(t,e,r,i,n){var o=t.lastSegmentViewportDistance*r;return t.prevTileDistance+o+((n?1:i/this.pitchfactor)-1)*o*Math.abs(Math.sin(e))},Kp.prototype.placeCollisionCircles=function(t,e,r,i,o,a,s,l,u,c,p,h,f){var d=[],m=this.projectAnchor(u,o.anchorX,o.anchorY),y=l/24,_=o.lineOffsetX*l,g=o.lineOffsetY*l,v=new n(o.anchorX,o.anchorY),x=Np(y,s,_,g,!1,Op(v,c).point,v,o,a,c,{},!0),b=!1,w=!1,S=!0,T=m.perspectiveRatio*i,I=1/(i*r),E=0,A=0;x&&(E=this.approximateTileDistance(x.first.tileDistance,x.first.angle,I,m.cameraDistance,h),A=this.approximateTileDistance(x.last.tileDistance,x.last.angle,I,m.cameraDistance,h));for(var k=0;k<t.length;k+=5){var z=t[k],C=t[k+1],P=t[k+2],M=t[k+3];if(!x||M<-E||M>A)Yp(t,k,!1);else{var D=this.projectPoint(u,z,C),L=P*T;if(d.length>0){var R=D.x-d[d.length-4],B=D.y-d[d.length-3];if(L*L*2>R*R+B*B&&k+8<t.length){var F=t[k+8];if(F>-E&&F<A){Yp(t,k,!1);continue}}}d.push(D.x,D.y,L,k/5),Yp(t,k,!0);var O=D.x-L,V=D.y-L,U=D.x+L,N=D.y+L;if(S=S&&this.isOffscreen(O,V,U,N),w=w||this.isInsideGrid(O,V,U,N),!e&&this.grid.hitTestCircle(D.x,D.y,L,f)){if(!p)return{circles:[],offscreen:!1};b=!0}}}return{circles:b||!w?[]:d,offscreen:S}},Kp.prototype.queryRenderedSymbols=function(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var e=[],r=1/0,i=1/0,o=-1/0,a=-1/0,s=0,l=t;s<l.length;s+=1){var u=l[s],c=new n(u.x+100,u.y+100);r=Math.min(r,c.x),i=Math.min(i,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(r,i,o,a).concat(this.ignoredGrid.query(r,i,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]||ca(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},Kp.prototype.insertCollisionBox=function(t,e,r,i,n){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:i,collisionGroupID:n},t[0],t[1],t[2],t[3])},Kp.prototype.insertCollisionCircles=function(t,e,r,i,n){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:i,collisionGroupID:n},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},Kp.prototype.projectAnchor=function(t,e,r){var i=[e,r,0,1];return Hp(i,i,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5,cameraDistance:i[3]}},Kp.prototype.projectPoint=function(t,e,r){var i=[e,r,0,1];return Hp(i,i,t),new n((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100)},Kp.prototype.projectAndGetPerspectiveRatio=function(t,e,r){var i=[e,r,0,1];return Hp(i,i,t),{point:new n((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},Kp.prototype.isOffscreen=function(t,e,r,i){return r<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},Kp.prototype.isInsideGrid=function(t,e,r,i){return r>=0&&t<this.gridRightBoundary&&i>=0&&e<this.gridBottomBoundary};var Qp=function(t,e,r,i){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):i&&r?1:0,this.placed=r};Qp.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var $p=function(t,e,r,i,n){this.text=new Qp(t?t.text:null,e,r,n),this.icon=new Qp(t?t.icon:null,e,i,n)};$p.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var th=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},eh=function(t,e,r,i,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n},rh=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function ih(t,e,r,i,o){var a=Ql(t),s=-(a.horizontalAlign-.5)*e,l=-(a.verticalAlign-.5)*r,u=nu(t,i);return new n(s+u[0]*o,l+u[1]*o)}function nh(t,e,r,i,o,a){var s=t.x1,l=t.x2,u=t.y1,c=t.y2,p=t.anchorPointX,h=t.anchorPointY,f=new n(e,r);return i&&f._rotate(o?a:-a),{x1:s+f.x,y1:u+f.y,x2:l+f.x,y2:c+f.y,anchorPointX:p,anchorPointY:h}}rh.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 oh=function(t,e,r,i){this.transform=t.clone(),this.collisionIndex=new Kp(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new rh(r),this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}};function ah(t,e,r,i,n){t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0)}oh.prototype.getBucketParts=function(t,e,r,i){var n=r.getBucket(e),o=r.latestFeatureIndex;if(n&&o&&e.id===n.layerIds[0]){var a=r.collisionBoxArray,s=n.layers[0].layout,l=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),u=r.tileSize/8192,c=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),p=Bp(c,"map"===s.get("text-pitch-alignment"),"map"===s.get("text-rotation-alignment"),this.transform,Jp(r,1,this.transform.zoom));this.retainedQueryData[n.bucketInstanceId]=new eh(n.bucketInstanceId,o,n.sourceLayerIndex,n.index,r.tileID);var h={bucket:n,layout:s,posMatrix:c,textLabelPlaneMatrix:p,scale:l,textPixelRatio:u,holdingForFade:r.holdingForFade(),collisionBoxArray:a,partiallyEvaluatedTextSize:eu(n.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(n.sourceID)};if(i)for(var f=0,d=n.sortKeyRanges;f<d.length;f+=1){var m=d[f];t.push({sortKey:m.sortKey,symbolInstanceStart:m.symbolInstanceStart,symbolInstanceEnd:m.symbolInstanceEnd,parameters:h})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:n.symbolInstances.length,parameters:h})}},oh.prototype.attemptAnchorPlacement=function(t,e,r,i,n,o,a,s,l,u,c,p,h,f,d){var m,y=[p.textOffset0,p.textOffset1],_=ih(t,r,i,y,n),g=this.collisionIndex.placeCollisionBox(nh(e,_.x,_.y,o,a,this.transform.angle),c,s,l,u.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(nh(d,_.x,_.y,o,a,this.transform.angle),c,s,l,u.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:r,height:i,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},oh.prototype.placeLayerBucketPart=function(t,e,r){var i=this,n=t.parameters,o=n.bucket,a=n.layout,s=n.posMatrix,l=n.textLabelPlaneMatrix,u=n.scale,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"),S=_&&(g||!o.hasIconData()||y),T=g&&(_||!o.hasTextData()||m);!o.collisionArrays&&h&&o.deserializeCollisionBoxes(h);var I=function(t,n){if(!e[t.crossTileID])if(p)i.placements[t.crossTileID]=new th(!1,!1,!1);else{var h,w=!1,I=!1,E=!0,A=null,k={box:null,offscreen:null},z={box:null,offscreen:null},C=null,P=null,M=0,D=0,L=0;n.textFeatureIndex&&(M=n.textFeatureIndex),n.verticalTextFeatureIndex&&(D=n.verticalTextFeatureIndex);var R=n.textBox;if(R){var B=function(e){var r=Hl.horizontal;if(o.allowVerticalPlacement&&!e&&i.prevPlacement){var n=i.prevPlacement.placedOrientations[t.crossTileID];n&&(i.placedOrientations[t.crossTileID]=n,i.markUsedOrientation(o,r=n,t))}return r},F=function(e,r){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&n.verticalTextBox)for(var i=0,a=o.writingModes;i<a.length&&(a[i]===Hl.vertical?(k=r(),z=k):k=e(),!(k&&k.box&&k.box.length));i+=1);else k=e()};if(a.get("text-variable-anchor")){var O=a.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[t.crossTileID]){var V=i.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,r,n){for(var a=e.x2-e.x1,l=e.y2-e.y1,u=t.textBoxScale,p=b&&!g?r:null,h={box:[],offscreen:!1},f=_?2*O.length:O.length,m=0;m<f;++m){var y=i.attemptAnchorPlacement(O[m%O.length],e,a,l,u,v,x,c,s,d,m>=O.length,t,o,n,p);if(y&&(h=y.placedGlyphBoxes)&&h.box&&h.box.length){w=!0,A=y.shift;break}}return h};F((function(){return U(R,n.iconBox,Hl.horizontal)}),(function(){var e=n.verticalTextBox;return o.allowVerticalPlacement&&!(k&&k.box&&k.box.length)&&t.numVerticalGlyphVertices>0&&e?U(e,n.verticalIconBox,Hl.vertical):{box:null,offscreen:null}})),k&&(w=k.box,E=k.offscreen);var N=B(k&&k.box);if(!w&&i.prevPlacement){var j=i.prevPlacement.variableOffsets[t.crossTileID];j&&(i.variableOffsets[t.crossTileID]=j,i.markUsedJustification(o,j.anchor,t,N))}}else{var q=function(e,r){var n=i.collisionIndex.placeCollisionBox(e,_,c,s,d.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,t),i.placedOrientations[t.crossTileID]=r),n};F((function(){return q(R,Hl.horizontal)}),(function(){var e=n.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&e?q(e,Hl.vertical):{box:null,offscreen:null}})),B(k&&k.box&&k.box.length)}}w=(h=k)&&h.box&&h.box.length>0,E=h&&h.offscreen;var Z=n.textCircles;if(Z){var G=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),X=tu(o.textSizeData,f,G);C=i.collisionIndex.placeCollisionCircles(Z,_,u,c,G,o.lineVertexArray,o.glyphOffsetArray,X,s,l,r,x,d.predicate),w=_||C.circles.length>0,E=E&&C.offscreen}if(n.iconFeatureIndex&&(L=n.iconFeatureIndex),n.iconBox){var W=function(t){var e=b&&A?nh(t,A.x,A.y,v,x,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,g,c,s,d.predicate)};I=z&&z.box&&z.box.length&&n.verticalIconBox?(P=W(n.verticalIconBox)).box.length>0:(P=W(n.iconBox)).box.length>0,E=E&&P.offscreen}var H=m||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,K=y||0===t.numIconVertices;H||K?K?H||(I=I&&w):w=I&&w:I=w=I&&w,w&&h&&h.box&&i.collisionIndex.insertCollisionBox(h.box,a.get("text-ignore-placement"),o.bucketInstanceId,z&&z.box&&D?D:M,d.ID),I&&P&&i.collisionIndex.insertCollisionBox(P.box,a.get("icon-ignore-placement"),o.bucketInstanceId,L,d.ID),w&&C&&i.collisionIndex.insertCollisionCircles(C.circles,a.get("text-ignore-placement"),o.bucketInstanceId,M,d.ID),i.placements[t.crossTileID]=new th(w||S,I||T,E||o.justReloaded),e[t.crossTileID]=!0}};if(w)for(var E=o.getSortedSymbolIndexes(this.transform.angle),A=E.length-1;A>=0;--A){var k=E[A];I(o.symbolInstances.get(k),o.collisionArrays[k])}else for(var z=t.symbolInstanceStart;z<t.symbolInstanceEnd;z++)I(o.symbolInstances.get(z),o.collisionArrays[z]);o.justReloaded=!1},oh.prototype.markUsedJustification=function(t,e,r,i){var n;n=i===Hl.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.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=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];o<a.length;o+=1){var s=a[o];s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=n>=0&&s!==n?0:r.crossTileID)}},oh.prototype.markUsedOrientation=function(t,e,r){for(var i=e===Hl.horizontal||e===Hl.horizontalOnly?e:0,n=e===Hl.vertical?e:0,o=0,a=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];o<a.length;o+=1)t.text.placedSymbolArray.get(a[o]).placedOrientation=i;r.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=n)},oh.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var i=e?e.symbolFadeChange(t):1,n=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],u=n[s];u?(this.opacities[s]=new $p(u,i,l.text,l.icon),r=r||l.text!==u.text.placed||l.icon!==u.icon.placed):(this.opacities[s]=new $p(null,i,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var c in n){var p=n[c];if(!this.opacities[c]){var h=new $p(p,i,!1,!1);h.isHidden()||(this.opacities[c]=h,r=r||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]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},oh.prototype.updateLayerOpacities=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1){var o=n[i],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r,o.collisionBoxArray)}},oh.prototype.updateBucketOpacities=function(t,e,r){var i=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(),t.hasIconCollisionCircleData()&&t.iconCollisionCircle.collisionVertexArray.clear(),t.hasTextCollisionCircleData()&&t.textCollisionCircle.collisionVertexArray.clear();var o=t.layers[0].layout,a=new $p(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),l=o.get("icon-allow-overlap"),u=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 $p(null,0,s&&(l||!t.hasIconData()||o.get("icon-optional")),l&&(s||!t.hasTextData()||o.get("text-optional")),!0);!t.collisionArrays&&r&&(t.hasIconCollisionBoxData()||t.hasIconCollisionCircleData()||t.hasTextCollisionBoxData()||t.hasTextCollisionCircleData())&&t.deserializeCollisionBoxes(r);for(var d=function(t,e,r){for(var i=0;i<e/4;i++)t.opacityVertexArray.emplaceBack(r)},m=function(r){var o=t.symbolInstances.get(r),s=o.numHorizontalGlyphVertices,l=o.numVerticalGlyphVertices,m=o.crossTileID,y=e[m],_=i.opacities[m];y?_=a:_||(i.opacities[m]=_=f),e[m]=!0;var g=o.numIconVertices>0,v=i.placedOrientations[o.crossTileID],x=v===Hl.vertical,b=v===Hl.horizontal||v===Hl.horizontalOnly;if(s>0||l>0){var w=dh(_.text);d(t.text,s,x?mh:w),d(t.text,l,b?mh:w);var S=_.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=S||x?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=S||b?1:0);var T=i.variableOffsets[o.crossTileID];T&&i.markUsedJustification(t,T.anchor,o,v);var I=i.placedOrientations[o.crossTileID];I&&(i.markUsedJustification(t,"left",o,I),i.markUsedOrientation(t,I,o))}if(g){var E=dh(_.icon),A=!(h&&o.verticalPlacedIconSymbolIndex&&x);o.placedIconSymbolIndex>=0&&(d(t.icon,o.numIconVertices,A?E:mh),t.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=_.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(t.icon,o.numVerticalIconVertices,A?mh:E),t.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=_.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasIconCollisionCircleData()||t.hasTextCollisionBoxData()||t.hasTextCollisionCircleData()){var k=t.collisionArrays[r];if(k){var z=new n(0,0);if(k.textBox||k.verticalTextBox){var C=!0;if(u){var P=i.variableOffsets[m];P?(z=ih(P.anchor,P.width,P.height,P.textOffset,P.textBoxScale),c&&z._rotate(p?i.transform.angle:-i.transform.angle)):C=!1}k.textBox&&ah(t.textCollisionBox.collisionVertexArray,_.text.placed,!C||x,z.x,z.y),k.verticalTextBox&&ah(t.textCollisionBox.collisionVertexArray,_.text.placed,!C||b,z.x,z.y)}var M=Boolean(!b&&k.verticalIconBox);k.iconBox&&ah(t.iconCollisionBox.collisionVertexArray,_.icon.placed,M,h?z.x:0,h?z.y:0),k.verticalIconBox&&ah(t.iconCollisionBox.collisionVertexArray,_.icon.placed,!M,h?z.x:0,h?z.y:0);var D=k.textCircles;if(D&&t.hasTextCollisionCircleData())for(var L=0;L<D.length;L+=5)ah(t.textCollisionCircle.collisionVertexArray,_.text.placed,y||0===D[L+4])}}},y=0;y<t.symbolInstances.length;y++)m(y);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.hasIconCollisionCircleData()&&t.iconCollisionCircle.collisionVertexBuffer&&t.iconCollisionCircle.collisionVertexBuffer.updateData(t.iconCollisionCircle.collisionVertexArray),t.hasTextCollisionCircleData()&&t.textCollisionCircle.collisionVertexBuffer&&t.textCollisionCircle.collisionVertexBuffer.updateData(t.textCollisionCircle.collisionVertexArray)},oh.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},oh.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},oh.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},oh.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},oh.prototype.setStale=function(){this.stale=!0};var sh=Math.pow(2,25),lh=Math.pow(2,24),uh=Math.pow(2,17),ch=Math.pow(2,16),ph=Math.pow(2,9),hh=Math.pow(2,8),fh=Math.pow(2,1);function dh(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*sh+e*lh+r*uh+e*ch+r*ph+e*hh+r*fh+e}var mh=0,yh=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=[]};yh.prototype.continuePlacement=function(t,e,r,i,n){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,i,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,r),this._currentPartIndex++,n())return!0;return!1};var _h=function(t,e,r,i,n,o,a){this.placement=new oh(t,n,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1};_h.prototype.isDone=function(){return this._done},_h.prototype.continuePlacement=function(t,e,r){for(var i=this,n=O.now(),o=function(){var t=O.now()-n;return!i._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 yh(a)),this._inProgressLayer.continuePlacement(r[a.source],this.placement,this._showCollisionBoxes,a,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},_h.prototype.commit=function(t){return this.placement.commit(t),this.placement};var gh=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var i=0;i<e.length;i++){var n=e.get(i),o=n.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:n.crossTileID,coord:this.getScaledCoordinates(n,t)})}};gh.prototype.getScaledCoordinates=function(t,e){var r=.03125/Math.pow(2,e.canonical.z-this.tileID.canonical.z);return{x:Math.floor((8192*e.canonical.x+t.anchorX)*r),y:Math.floor((8192*e.canonical.y+t.anchorY)*r)}},gh.prototype.findMatches=function(t,e,r){for(var i=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),l=0,u=a;l<u.length;l+=1){var c=u[l];if(Math.abs(c.coord.x-s.x)<=i&&Math.abs(c.coord.y-s.y)<=i&&!r[c.crossTileID]){r[c.crossTileID]=!0,o.crossTileID=c.crossTileID;break}}}}};var vh=function(){this.maxCrossTileID=0};vh.prototype.generate=function(){return++this.maxCrossTileID};var xh=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};xh.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var i=this.indexes[r],n={};for(var o in i){var a=i[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),n[a.tileID.key]=a}this.indexes[r]=n}this.lng=t},xh.prototype.addBucket=function(t,e,r){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 i=0;i<e.symbolInstances.length;i++)e.symbolInstances.get(i).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 l=a[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,n)}else{var u=a[t.scaledTo(Number(o)).key];u&&u.findMatches(e.symbolInstances,t,n)}}for(var c=0;c<e.symbolInstances.length;c++){var p=e.symbolInstances.get(c);p.crossTileID||(p.crossTileID=r.generate(),n[p.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new gh(t,e.symbolInstances,e.bucketInstanceId),!0},xh.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var i=0,n=e.indexedSymbolInstances[r];i<n.length;i+=1)delete this.usedCrossTileIDs[t][n[i].crossTileID]},xh.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var i=this.indexes[r];for(var n in i)t[i[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,i[n]),delete i[n],e=!0)}return e};var bh=function(){this.layerIndexes={},this.crossTileIDs=new vh,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};bh.prototype.addLayer=function(t,e,r){var i=this.layerIndexes[t.id];void 0===i&&(i=this.layerIndexes[t.id]=new xh);var n=!1,o={};i.handleWrapJump(r);for(var a=0,s=e;a<s.length;a+=1){var l=s[a],u=l.getBucket(t);u&&t.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(l.tileID,u,this.crossTileIDs)&&(n=!0),o[u.bucketInstanceId]=!0)}return i.removeStaleBuckets(o)&&(n=!0),n},bh.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var wh=function(t,e){return Hi(t,e&&e.filter((function(t){return"source.canvas"!==t.identifier})))},Sh=d(Ap,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Th=d(Ap,["setCenter","setZoom","setBearing","setPitch"]),Ih=function(){var t={},e=Nt.$version;for(var r in Nt.$root){var i,n=Nt.$root[r];if(n.required)null!=(i="version"===r?e:"array"===n.type?[]:{})&&(t[r]=i)}return t}(),Eh=function(t){function e(r,i){var n=this;void 0===i&&(i={}),t.call(this),this.map=r,this.dispatcher=new Gu((wp||(wp=new bp),wp),this),this.imageManager=new Pu,this.imageManager.setEventedParent(this),this.glyphManager=new Ou(r._requestManager,i.localIdeographFontFamily),this.lineAtlas=new ju(256,512),this.crossTileSymbolIndex=new bh,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new sn,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",kt());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 r in o.sourceCaches)o.sourceCaches[r].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=n.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var i in n._layers){var o=n._layers[i];o.source===r.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 r=this;void 0===e&&(e={}),this.fire(new Ot("dataloading",{dataType:"style"}));var i="boolean"==typeof e.validate?e.validate:!it(t);t=this.map._requestManager.normalizeStyleURL(t,e.accessToken);var n=this.map._requestManager.transformRequest(t,Et.Style);this._request=Mt(n,(function(t,e){r._request=null,t?r.fire(new Vt(t)):e&&r._load(e,i)}))},e.prototype.loadJSON=function(t,e){var r=this;void 0===e&&(e={}),this.fire(new Ot("dataloading",{dataType:"style"})),this._request=O.frame((function(){r._request=null,r._load(t,!1!==e.validate)}))},e.prototype.loadEmpty=function(){this.fire(new Ot("dataloading",{dataType:"style"})),this._load(Ih,!1)},e.prototype._load=function(t,e){if(!e||!wh(this,Zi(t))){for(var r in this._loaded=!0,this.stylesheet=t,t.sources)this.addSource(r,t.sources[r],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var i=Ep(this.stylesheet.layers);this._order=i.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var n=0,o=i;n<o.length;n+=1){var a=o[n];(a=Su(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 Nu(this.stylesheet.light),this.fire(new Ot("data",{dataType:"style"})),this.fire(new Ot("style.load"))}},e.prototype._loadSprite=function(t){var e=this;this._spriteRequest=function(t,e,r){var i,n,o,a=O.devicePixelRatio>1?"@2x":"",s=Mt(e.transformRequest(e.normalizeSpriteURL(t,a,".json"),Et.SpriteJSON),(function(t,e){s=null,o||(o=t,i=e,u())})),l=Rt(e.transformRequest(e.normalizeSpriteURL(t,a,".png"),Et.SpriteImage),(function(t,e){l=null,o||(o=t,n=e,u())}));function u(){if(o)r(o);else if(i&&n){var t=O.getImageData(n),e={};for(var a in i){var s=i[a],l=s.width,u=s.height,c=s.x,p=s.y,h=s.sdf,f=s.pixelRatio,d=s.stretchX,m=s.stretchY,y=s.content,_=new Wa({width:l,height:u});Wa.copy(t,_,{x:c,y:p},{x:0,y:0},{width:l,height:u}),e[a]={data:_,pixelRatio:f,sdf:h,stretchX:d,stretchY:m,content:y}}r(null,e)}}return{cancel:function(){s&&(s.cancel(),s=null),l&&(l.cancel(),l=null)}}}(t,this.map._requestManager,(function(t,r){if(e._spriteRequest=null,t)e.fire(new Vt(t));else if(r)for(var i in r)e.imageManager.addImage(i,r[i]);e.imageManager.setLoaded(!0),e._availableImages=e.imageManager.listImages(),e.dispatcher.broadcast("setImages",e._availableImages),e.fire(new Ot("data",{dataType:"style"}))}))},e.prototype._validateLayer=function(t){var e=this.sourceCaches[t.source];if(e){var r=t.sourceLayer;if(r){var i=e.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire(new Vt(new Error('Source layer "'+r+'" does not exist on source "'+i.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=[],r=0,i=t;r<i.length;r+=1){var n=this._layers[i[r]];"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 r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var n in(r.length||i.length)&&this._updateWorkerLayers(r,i),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()}for(var s in this.sourceCaches)this.sourceCaches[s].used=!1;for(var l=0,u=this._order;l<u.length;l+=1){var c=this._layers[u[l]];c.recalculate(t,this._availableImages),!c.isHidden(t.zoom)&&c.source&&(this.sourceCaches[c.source].used=!0)}this.light.recalculate(t),this.z=t.zoom,e&&this.fire(new Ot("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(),wh(this,Zi(t)))return!1;(t=S(t)).layers=Ep(t.layers);var r=function(t,e){if(!t)return[{command:Ap.setStyle,args:[e]}];var r=[];try{if(!a(t.version,e.version))return[{command:Ap.setStyle,args:[e]}];a(t.center,e.center)||r.push({command:Ap.setCenter,args:[e.center]}),a(t.zoom,e.zoom)||r.push({command:Ap.setZoom,args:[e.zoom]}),a(t.bearing,e.bearing)||r.push({command:Ap.setBearing,args:[e.bearing]}),a(t.pitch,e.pitch)||r.push({command:Ap.setPitch,args:[e.pitch]}),a(t.sprite,e.sprite)||r.push({command:Ap.setSprite,args:[e.sprite]}),a(t.glyphs,e.glyphs)||r.push({command:Ap.setGlyphs,args:[e.glyphs]}),a(t.transition,e.transition)||r.push({command:Ap.setTransition,args:[e.transition]}),a(t.light,e.light)||r.push({command:Ap.setLight,args:[e.light]});var i={},n=[];!function(t,e,r,i){var n;for(n in e=e||{},t=t||{})t.hasOwnProperty(n)&&(e.hasOwnProperty(n)||zp(n,r,i));for(n in e)e.hasOwnProperty(n)&&(t.hasOwnProperty(n)?a(t[n],e[n])||("geojson"===t[n].type&&"geojson"===e[n].type&&Pp(t,e,n)?r.push({command:Ap.setGeoJSONSourceData,args:[n,e[n].data]}):Cp(n,e,r,i)):kp(n,e,r))}(t.sources,e.sources,n,i);var o=[];t.layers&&t.layers.forEach((function(t){i[t.source]?r.push({command:Ap.removeLayer,args:[t.id]}):o.push(t)})),r=r.concat(n),function(t,e,r){e=e||[];var i,n,o,s,l,u,c,p=(t=t||[]).map(Dp),h=e.map(Dp),f=t.reduce(Lp,{}),d=e.reduce(Lp,{}),m=p.slice(),y=Object.create(null);for(i=0,n=0;i<p.length;i++)d.hasOwnProperty(o=p[i])?n++:(r.push({command:Ap.removeLayer,args:[o]}),m.splice(m.indexOf(o,n),1));for(i=0,n=0;i<h.length;i++)m[m.length-1-i]!==(o=h[h.length-1-i])&&(f.hasOwnProperty(o)?(r.push({command:Ap.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-n),1)):n++,r.push({command:Ap.addLayer,args:[d[o],u=m[m.length-i]]}),m.splice(m.length-i,0,o),y[o]=!0);for(i=0;i<h.length;i++)if(s=f[o=h[i]],l=d[o],!y[o]&&!a(s,l))if(a(s.source,l.source)&&a(s["source-layer"],l["source-layer"])&&a(s.type,l.type)){for(c in Mp(s.layout,l.layout,r,o,null,Ap.setLayoutProperty),Mp(s.paint,l.paint,r,o,null,Ap.setPaintProperty),a(s.filter,l.filter)||r.push({command:Ap.setFilter,args:[o,l.filter]}),a(s.minzoom,l.minzoom)&&a(s.maxzoom,l.maxzoom)||r.push({command:Ap.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Mp(s[c],l[c],r,o,c.slice(6),Ap.setPaintProperty):a(s[c],l[c])||r.push({command:Ap.setLayerProperty,args:[o,c,l[c]]}));for(c in l)l.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Mp(s[c],l[c],r,o,c.slice(6),Ap.setPaintProperty):a(s[c],l[c])||r.push({command:Ap.setLayerProperty,args:[o,c,l[c]]}))}else r.push({command:Ap.removeLayer,args:[o]}),u=m[m.lastIndexOf(o)+1],r.push({command:Ap.addLayer,args:[l,u]})}(o,e.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Ap.setStyle,args:[e]}]}return r}(this.serialize(),t).filter((function(t){return!(t.command in Th)}));if(0===r.length)return!1;var i=r.filter((function(t){return!(t.command in Sh)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return r.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 Vt(new Error("An image with this name already exists.")));this.imageManager.addImage(t,e),this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.fire(new Ot("data",{dataType:"style"}))},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 Vt(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.fire(new Ot("data",{dataType:"style"}))},e.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},e.prototype.addSource=function(t,e,r){var i=this;if(void 0===r&&(r={}),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 the only the following properties were given: "+Object.keys(e).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(e.type)>=0&&this._validate(Zi.source,"sources."+t,e,null,r))){this.map&&this.map._collectResourceTiming&&(e.collectResourceTiming=!0);var n=this.sourceCaches[t]=new _p(t,e,this.dispatcher);n.style=this,n.setEventedParent(this,(function(){return{isSourceLoaded:i.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 Vt(new Error('Source "'+t+'" cannot be removed while layer "'+e+'" is using it.')));var r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new Ot("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.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,r){void 0===r&&(r={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new Vt(new Error('Layer with id "'+i+'" already exists on this map')));else{var n;if("custom"===t.type){if(wh(this,function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e}(t)))return;n=Su(t)}else{if("object"==typeof t.source&&(this.addSource(i,t.source),t=f(t=S(t),{source:i})),this._validate(Zi.layer,"layers."+i,t,{arrayIndex:-1},r))return;n=Su(t),this._validateLayer(n),n.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[n.id]=n.serialize()}var o=e?this._order.indexOf(e):this._order.length;if(e&&-1===o)this.fire(new Vt(new Error('Layer with id "'+e+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=n,this._removedLayers[i]&&n.source&&"custom"!==n.type){var a=this._removedLayers[i];delete this._removedLayers[i],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 r=this._order.indexOf(t);this._order.splice(r,1);var i=e?this._order.indexOf(e):this._order.length;e&&-1===i?this.fire(new Vt(new Error('Layer with id "'+e+'" does not exist on this map.'))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new Vt(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 r=this._order.indexOf(t);this._order.splice(r,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 Vt(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,r){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===e&&i.maxzoom===r||(null!=e&&(i.minzoom=e),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new Vt(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},e.prototype.setFilter=function(t,e,r){void 0===r&&(r={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!a(i.filter,e))return null==e?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(Zi.filter,"layers."+i.id+".filter",e,null,r)||(i.filter=S(e),this._updateLayer(i)))}else this.fire(new Vt(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},e.prototype.getFilter=function(t){return S(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r,i){void 0===i&&(i={}),this._checkLoaded();var n=this.getLayer(t);n?a(n.getLayoutProperty(e),r)||(n.setLayoutProperty(e,r,i),this._updateLayer(n)):this.fire(new Vt(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},e.prototype.getLayoutProperty=function(t,e){var r=this.getLayer(t);if(r)return r.getLayoutProperty(e);this.fire(new Vt(new Error("The layer '"+t+"' does not exist in the map's style.")))},e.prototype.setPaintProperty=function(t,e,r,i){void 0===i&&(i={}),this._checkLoaded();var n=this.getLayer(t);n?a(n.getPaintProperty(e),r)||(n.setPaintProperty(e,r,i)&&this._updateLayer(n),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new Vt(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 r=t.source,i=t.sourceLayer,n=this.sourceCaches[r];if(void 0!==n){var o=n.getSource().type;"geojson"===o&&i?this.fire(new Vt(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new Vt(new Error("The feature id parameter must be provided."))),n.setFeatureState(i,t.id,e)):this.fire(new Vt(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Vt(new Error("The source '"+r+"' does not exist in the map's style.")))},e.prototype.removeFeatureState=function(t,e){this._checkLoaded();var r=t.source,i=this.sourceCaches[r];if(void 0!==i){var n=i.getSource().type,o="vector"===n?t.sourceLayer:void 0;"vector"!==n||o?e&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new Vt(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,t.id,e):this.fire(new Vt(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Vt(new Error("The source '"+r+"' does not exist in the map's style.")))},e.prototype.getFeatureState=function(t){this._checkLoaded();var e=t.source,r=t.sourceLayer,i=this.sourceCaches[e];if(void 0!==i){if("vector"!==i.getSource().type||r)return void 0===t.id&&this.fire(new Vt(new Error("The feature id parameter must be provided."))),i.getFeatureState(r,t.id);this.fire(new Vt(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new Vt(new Error("The source '"+e+"' does not exist in the map's style.")))},e.prototype.getTransition=function(){return f({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.serialize=function(){return w({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:b(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,r=function(t){return"fill-extrusion"===e._layers[t].type},i={},n=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){i[a]=o;for(var s=0,l=t;s<l.length;s+=1){var u=l[s][a];if(u)for(var c=0,p=u;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(r(d))for(var m=n.length-1;m>=0;m--){var y=n[m].feature;if(i[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,r){e&&e.filter&&this._validate(Zi.filter,"queryRenderedFeatures.filter",e.filter,null,e);var i={};if(e&&e.layers){if(!Array.isArray(e.layers))return this.fire(new Vt(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 Vt(new Error("The layer '"+a+"' does not exist in the map's style and cannot be queried for features."))),[];i[s.source]=!0}}var l=[];for(var u in e.availableImages=this._availableImages,this.sourceCaches)e.layers&&!i[u]||l.push(mc(this.sourceCaches[u],this._layers,this._serializedLayers,t,e,r));return this.placement&&l.push(function(t,e,r,i,n,o,a){for(var s={},l=o.queryRenderedSymbols(i),u=[],c=0,p=Object.keys(l).map(Number);c<p.length;c+=1)u.push(a[p[c]]);u.sort(yc);for(var h=function(){var r=d[f],i=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],e,r.bucketIndex,r.sourceLayerIndex,n.filter,n.layers,n.availableImages,t);for(var o in i){var a=s[o]=s[o]||[],u=i[o];u.sort((function(t,e){var i=r.featureSortOrder;if(i){var n=i.indexOf(t.featureIndex);return i.indexOf(e.featureIndex)-n}return e.featureIndex-t.featureIndex}));for(var c=0,p=u;c<p.length;c+=1)a.push(p[c])}},f=0,d=u;f<d.length;f+=1)h();var m=function(e){s[e].forEach((function(i){var n=i.feature,o=r[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(l)},e.prototype.querySourceFeatures=function(t,e){e&&e.filter&&this._validate(Zi.filter,"querySourceFeatures.filter",e.filter,null,e);var r=this.sourceCaches[t];return r?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),i=[],n={},o=0;o<r.length;o++){var a=r[o],s=a.tileID.canonical.key;n[s]||(n[s]=!0,a.querySourceFeatures(i,e))}return i}(r,e):[]},e.prototype.addSourceType=function(t,r,i){return e.getSourceType(t)?i(new Error('A source type called "'+t+'" already exists.')):(e.setSourceType(t,r),r.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:r.workerSourceURL},i):i(null,null))},e.prototype.getLight=function(){return this.light.getLight()},e.prototype.setLight=function(t,e){void 0===e&&(e={}),this._checkLoaded();var r=this.light.getLight(),i=!1;for(var n in t)if(!a(t[n],r[n])){i=!0;break}if(i){var o={now:O.now(),transition:f({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,e),this.light.updateTransitions(o)}},e.prototype._validate=function(t,e,r,i,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&wh(this,t.call(Zi,f({key:e,style:this.serialize(),value:r,styleSpec:Nt},i)))},e.prototype._remove=function(){for(var t in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),An.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,r,i,n){void 0===n&&(n=!1);for(var o=!1,a=!1,s={},l=0,u=this._order;l<u.length;l+=1){var c=this._layers[u[l]];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===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(O.now(),t.zoom))&&(this.pauseablePlacement=new _h(t,this._order,n,e,r,i,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(O.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(O.now())},e.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},e.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages();var i=this.sourceCaches[e.source];i&&i.setDependencies(e.tileID.key,e.type,e.icons)},e.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},e.prototype.getResource=function(t,e,r){return Pt(e,r)},e}(Ut);Eh.getSourceType=function(t){return fc[t]},Eh.setSourceType=function(t,e){fc[t]=e},Eh.registerForPluginStateChange=function(t){return t({pluginStatus:Sn,pluginURL:Tn}),An.on("pluginStateChange",t),t};var Ah=Yn([{name:"a_pos",type:"Int16",components:2}]),kh=tf("#ifdef GL_ES\r\nprecision mediump float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif","#ifdef GL_ES\r\nprecision highp float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif\nvec2 unpack_float(const float packedValue) {\r\nint packedIntValue=int(packedValue);\r\nint v0=packedIntValue/256;\r\nreturn vec2(v0,packedIntValue-v0*256);\r\n}\r\nvec2 unpack_opacity(const float packedOpacity) {\r\nint intOpacity=int(packedOpacity)/2;\r\nreturn vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));\r\n}vec4 decode_color(const vec2 encodedColor) {\r\nreturn vec4(\r\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\r\n);\r\n}float unpack_mix_vec2(const vec2 packedValue,const float t) {\r\nreturn mix(packedValue[0],packedValue[1],t);\r\n}vec4 unpack_mix_color(const vec4 packedColors,const float t) {\r\nvec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));\r\nvec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));\r\nreturn mix(minColor,maxColor,t);\r\n}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) {\r\nvec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);\r\nreturn (tile_units_to_pixels*pos+offset)/pattern_size;\r\n}"),zh=tf("uniform vec4 u_color;\r\nuniform float u_opacity;\r\nvoid main() {\r\ngl_FragColor=u_color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),Ch=tf("uniform vec2 u_pattern_tl_a;\r\nuniform vec2 u_pattern_br_a;\r\nuniform vec2 u_pattern_tl_b;\r\nuniform vec2 u_pattern_br_b;\r\nuniform vec2 u_texsize;\r\nuniform float u_mix;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_mix)*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pattern_size_a;\r\nuniform vec2 u_pattern_size_b;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_scale_a;\r\nuniform float u_scale_b;\r\nuniform float u_tile_units_to_pixels;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_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);\r\nv_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);\r\n}"),Ph=tf("varying vec3 v_data;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\n#pragma mapbox: initialize lowp float stroke_opacity\r\nvec2 extrude=v_data.xy;\r\nfloat extrude_length=length(extrude);\r\nlowp float antialiasblur=v_data.z;\r\nfloat antialiased_blur=-max(blur,antialiasblur);\r\nfloat opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);\r\nfloat color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\r\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\r\n);\r\ngl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform bool u_scale_with_map;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_extrude_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nattribute vec2 a_pos;\r\nvarying vec3 v_data;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\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);\r\nif (u_pitch_with_map) {\r\nvec2 corner_position=circle_center;\r\nif (u_scale_with_map) {\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale;\r\n} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);\r\n}\r\ngl_Position=u_matrix*vec4(corner_position,0,1);\r\n} else {\r\ngl_Position=u_matrix*vec4(circle_center,0,1);\r\nif (u_scale_with_map) {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;\r\n} else {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;\r\n}\r\n}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);\r\nv_data=vec3(extrude.x,extrude.y,antialiasblur);\r\n}"),Mh=tf("void main() {\r\ngl_FragColor=vec4(1.0);\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),Dh=tf("uniform highp float u_intensity;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main() {\r\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);\r\nfloat val=weight*u_intensity*GAUSS_COEF*exp(d);\r\ngl_FragColor=vec4(val,1.0,1.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform float u_extrude_scale;\r\nuniform float u_opacity;\r\nuniform float u_intensity;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\r\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp float weight\r\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);\r\ngl_Position=u_matrix*pos;\r\n}"),Lh=tf("uniform sampler2D u_image;\r\nuniform sampler2D u_color_ramp;\r\nuniform float u_opacity;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\nfloat t=texture2D(u_image,v_pos).r;\r\nvec4 color=texture2D(u_color_ramp,vec2(t,0.5));\r\ngl_FragColor=color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(0.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos*u_world,0,1);\r\nv_pos.x=a_pos.x;\r\nv_pos.y=1.0-a_pos.y;\r\n}"),Rh=tf("varying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nfloat alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {\r\ngl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {gl_FragColor*=.1;\r\n}\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nattribute vec2 a_shift;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\ngl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\n}"),Bh=tf("uniform float u_overscale_factor;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nfloat alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {\r\ncolor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {color*=.2;\r\n}\r\nfloat extrude_scale_length=length(v_extrude_scale);\r\nfloat extrude_length=length(v_extrude)*extrude_scale_length;\r\nfloat stroke_width=15.0*extrude_scale_length/u_overscale_factor;\r\nfloat radius=v_radius*extrude_scale_length;\r\nfloat distance_to_edge=abs(extrude_length-radius);\r\nfloat opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);\r\ngl_FragColor=opacity_t*color;\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\nhighp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\nv_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;\r\nv_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;\r\n}"),Fh=tf("uniform highp vec4 u_color;\r\nuniform sampler2D u_overlay;\r\nvarying vec2 v_uv;\r\nvoid main() {\r\nvec4 overlay_color=texture2D(u_overlay,v_uv);\r\ngl_FragColor=mix(u_color,overlay_color,overlay_color.a);\r\n}","attribute vec2 a_pos;\r\nvarying vec2 v_uv;\r\nuniform mat4 u_matrix;\r\nuniform float u_overlay_scale;\r\nvoid main() {v_uv=a_pos/8192.0;\r\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);\r\n}"),Oh=tf("#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_FragColor=color*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),Vh=tf("varying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\nfloat dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=outline_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),Uh=tf("uniform vec2 u_texsize;\r\nuniform sampler2D u_image;\r\nuniform float u_fade;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),Nh=tf("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_fade)*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\r\n}"),jh=tf("varying vec4 v_color;\r\nvoid main() {\r\ngl_FragColor=v_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec4 v_color;\r\n#pragma mapbox: define highp float base\r\n#pragma mapbox: define highp float height\r\n#pragma mapbox: define highp vec4 color\r\nvoid main() {\r\n#pragma mapbox: initialize highp float base\r\n#pragma mapbox: initialize highp float height\r\n#pragma mapbox: initialize highp vec4 color\r\nvec3 normal=a_normal_ed.xyz;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\ngl_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;\r\nv_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);\r\ncolor+=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*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);\r\nv_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);\r\nv_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);\r\nv_color*=u_opacity;\r\n}"),qh=tf("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 mixedColor=mix(color1,color2,u_fade);\r\ngl_FragColor=mixedColor*v_lighting;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_height_factor;\r\nuniform vec3 u_scale;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec3 normal=a_normal_ed.xyz;\r\nfloat edgedistance=a_normal_ed.w;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\nfloat z=t > 0.0 ? height : base;\r\ngl_Position=u_matrix*vec4(a_pos,z,1);\r\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\r\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);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);\r\nv_lighting=vec4(0.0,0.0,0.0,1.0);\r\nfloat directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);\r\ndirectional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);\r\nif (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}\r\nv_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\r\nv_lighting*=u_opacity;\r\n}"),Zh=tf("#ifdef GL_ES\r\nprecision highp float;\r\n#endif\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_dimension;\r\nuniform float u_zoom;\r\nuniform float u_maxzoom;\r\nuniform vec4 u_unpack;\r\nfloat getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;\r\ndata.a=-1.0;\r\nreturn dot(data,u_unpack)/4.0;\r\n}\r\nvoid main() {\r\nvec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);\r\nfloat b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);\r\nfloat c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);\r\nfloat d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);\r\nfloat e=getElevation(v_pos,0.0);\r\nfloat f=getElevation(v_pos+vec2(epsilon.x,0),0.0);\r\nfloat g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);\r\nfloat h=getElevation(v_pos+vec2(0,epsilon.y),0.0);\r\nfloat i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\r\nvec2 deriv=vec2(\r\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\r\n)/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);\r\ngl_FragColor=clamp(vec4(\r\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_dimension;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nhighp vec2 epsilon=1.0/u_dimension;\r\nfloat scale=(u_dimension.x-2.0)/u_dimension.x;\r\nv_pos=(a_texture_pos/8192.0)*scale+epsilon;\r\n}"),Gh=tf("uniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_latrange;\r\nuniform vec2 u_light;\r\nuniform vec4 u_shadow;\r\nuniform vec4 u_highlight;\r\nuniform vec4 u_accent;\r\n#define PI 3.141592653589793\r\nvoid main() {\r\nvec4 pixel=texture2D(u_image,v_pos);\r\nvec2 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);\r\nfloat aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);\r\nfloat intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;\r\nfloat maxValue=0.5*PI;\r\nfloat 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);\r\nfloat shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);\r\nvec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);\r\ngl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=a_texture_pos/8192.0;\r\n}"),Xh=tf("uniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\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;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_linesofar;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),Wh=tf("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\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;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),Hh=tf("uniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec3 u_scale;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nvec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);\r\nvec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);\r\nfloat aspect_a=display_size_a.y/v_width;\r\nfloat 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;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);\r\nfloat y=0.5*v_normal.y+0.5;\r\nvec2 texel_size=1.0/u_texsize;\r\nvec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));\r\nvec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));\r\nvec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\r\ngl_FragColor=color*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_units_to_pixels;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat 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;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_linesofar=a_linesofar;\r\nv_width2=vec2(outset,inset);\r\nv_width=floorwidth;\r\n}"),Kh=tf("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nuniform float u_sdfgamma;\r\nuniform float u_mix;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float width\r\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;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat sdfdist_a=texture2D(u_image,v_tex_a).a;\r\nfloat sdfdist_b=texture2D(u_image,v_tex_b).a;\r\nfloat sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);\r\nalpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_patternscale_a;\r\nuniform float u_tex_y_a;\r\nuniform vec2 u_patternscale_b;\r\nuniform float u_tex_y_b;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);\r\nv_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);\r\nv_width2=vec2(outset,inset);\r\n}"),Yh=tf("uniform float u_fade_t;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image0;\r\nuniform sampler2D u_image1;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nuniform float u_brightness_low;\r\nuniform float u_brightness_high;\r\nuniform float u_saturation_factor;\r\nuniform float u_contrast_factor;\r\nuniform vec3 u_spin_weights;\r\nvoid main() {vec4 color0=texture2D(u_image0,v_pos0);\r\nvec4 color1=texture2D(u_image1,v_pos1);\r\nif (color0.a > 0.0) {\r\ncolor0.rgb=color0.rgb/color0.a;\r\n}\r\nif (color1.a > 0.0) {\r\ncolor1.rgb=color1.rgb/color1.a;\r\n}\r\nvec4 color=mix(color0,color1,u_fade_t);\r\ncolor.a*=u_opacity;\r\nvec3 rgb=color.rgb;rgb=vec3(\r\ndot(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;\r\nrgb+=(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);\r\nvec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);\r\ngl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_tl_parent;\r\nuniform float u_scale_parent;\r\nuniform float u_buffer_scale;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;\r\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\r\n}"),Jh=tf("uniform sampler2D u_texture;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nlowp float alpha=opacity*v_fade_opacity;\r\ngl_FragColor=texture2D(u_texture,v_tex)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;\r\nuniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform float u_fade_change;\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nvec2 a_minFontScale=a_pixeloffset.zw/256.0;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_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);\r\nv_tex=a_tex/u_texsize;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nv_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\n}"),Qh=tf("#define SDF_PX 8.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform bool u_is_text;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nvec2 tex=v_data0.xy;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fade_opacity=v_data1[2];\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0=a_tex/u_texsize;\r\nv_data1=vec3(gamma_scale,size,interpolated_fade_opacity);\r\n}"),$h=tf("#define SDF_PX 8.0\r\n#define SDF 1.0\r\n#define ICON 0.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform sampler2D u_texture_icon;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat fade_opacity=v_data1[2];\r\nif (v_data1.w==ICON) {\r\nvec2 tex_icon=v_data0.zw;\r\nlowp float alpha=opacity*fade_opacity;\r\ngl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\nreturn;\r\n}\r\nvec2 tex=v_data0.xy;\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fontScale=size/24.0;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nuniform vec2 u_texsize_icon;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nfloat is_sdf=a_size[0]-2.0*a_size_min;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=size/24.0;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0.xy=a_tex/u_texsize;\r\nv_data0.zw=a_tex/u_texsize_icon;\r\nv_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);\r\n}");function tf(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,o){return i[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+r+" "+n+" "+o+";\n#else\nuniform "+r+" "+n+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,o){var a="float"===n?"vec2":"vec4",s=o.match(/color/)?"color":a;return i[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+a+" a_"+o+";\nvarying "+r+" "+n+" "+o+";\n#else\nuniform "+r+" "+n+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+a+" a_"+o+";\n#else\nuniform "+r+" "+n+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+n+" "+o+" = a_"+o+";\n#else\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+n+" "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+n+" "+o+" = u_"+o+";\n#endif\n"}))}}var ef=Object.freeze({__proto__:null,prelude:kh,background:zh,backgroundPattern:Ch,circle:Ph,clippingMask:Mh,heatmap:Dh,heatmapTexture:Lh,collisionBox:Rh,collisionCircle:Bh,debug:Fh,fill:Oh,fillOutline:Vh,fillOutlinePattern:Uh,fillPattern:Nh,fillExtrusion:jh,fillExtrusionPattern:qh,hillshadePrepare:Zh,hillshade:Gh,line:Xh,lineGradient:Wh,linePattern:Hh,lineSDF:Kh,raster:Yh,symbolIcon:Jh,symbolSDF:Qh,symbolTextAndIcon:$h}),rf=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};rf.prototype.bind=function(t,e,r,i,n,o,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==i.length,u=0;!l&&u<i.length;u++)this.boundPaintVertexBuffers[u]!==i[u]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===r&&!l&&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,r,i,n,o,a,s)},rf.prototype.freshBind=function(t,e,r,i,n,o,a){var s,l=t.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=u.currentNumAttributes||0;for(var p=l;p<s;p++)c.disableVertexAttribArray(p)}e.enableAttributes(c,t);for(var h=0,f=r;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=r;d<m.length;d+=1){var y=m[d];y.bind(),y.setVertexAttribPointers(c,t,n)}o&&(o.bind(),o.setVertexAttribPointers(c,t,n)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,n)),u.currentNumAttributes=l},rf.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var nf=function(t,e,r,i,n){var o=t.gl;this.program=o.createProgram();var a=r?r.defines():[];n&&a.push("#define OVERDRAW_INSPECTOR;");var s=a.concat(kh.fragmentSource,e.fragmentSource).join("\n"),l=a.concat(kh.vertexSource,e.vertexSource).join("\n"),u=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(u,s),o.compileShader(u),o.attachShader(this.program,u);var c=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(c,l),o.compileShader(c),o.attachShader(this.program,c);for(var p=r?r.layoutAttributes:[],h=0;h<p.length;h++)o.bindAttribLocation(this.program,h,p[h].name);o.linkProgram(this.program),this.numAttributes=o.getProgramParameter(this.program,o.ACTIVE_ATTRIBUTES),this.attributes={};for(var f={},d=0;d<this.numAttributes;d++){var m=o.getActiveAttrib(this.program,d);m&&(this.attributes[m.name]=o.getAttribLocation(this.program,m.name))}for(var y=o.getProgramParameter(this.program,o.ACTIVE_UNIFORMS),_=0;_<y;_++){var g=o.getActiveUniform(this.program,_);g&&(f[g.name]=o.getUniformLocation(this.program,g.name))}this.fixedUniforms=i(t,f),this.binderUniforms=r?r.getUniforms(t,f):[]}}};function of(t,e,r){var i=1/Jp(r,1,e.transform.tileZoom),n=Math.pow(2,r.tileID.overscaledZ),o=r.tileSize*Math.pow(2,e.transform.tileZoom)/n,a=o*(r.tileID.canonical.x+r.tileID.wrap*n),s=o*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}nf.prototype.draw=function(t,e,r,i,n,o,a,s,l,u,c,p,h,f,d,m){var y,_=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(i),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],S=w.vaos||(w.vaos={});(S[s]||(S[s]=new rf)).bind(t,this,l,f?f.getPaintVertexBuffers():[],u,w.vertexOffset,d,m),_.drawElements(e,w.primitiveLength*v,_.UNSIGNED_SHORT,w.primitiveOffset*v*2)}}};var af=function(t,e,r,i){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 r=Math.sin(e),i=Math.cos(e);t[0]=i,t[1]=r,t[2]=0,t[3]=-r,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(s,-e.transform.angle),function(t,e,r){var i=e[0],n=e[1],o=e[2];t[0]=i*r[0]+n*r[3]+o*r[6],t[1]=i*r[1]+n*r[4]+o*r[7],t[2]=i*r[2]+n*r[5]+o*r[8]}(a,a,s);var l=n.properties.get("color");return{u_matrix:t,u_lightpos:a,u_lightintensity:n.properties.get("intensity"),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+r,u_opacity:i}},sf=function(t,e,r,i,n,o,a){return f(af(t,e,r,i),of(o,e,a),{u_height_factor:-Math.pow(2,n.overscaledZ)/a.tileSize/8})},lf=function(t){return{u_matrix:t}},uf=function(t,e,r,i){return f(lf(t),of(r,e,i))},cf=function(t,e){return{u_matrix:t,u_world:e}},pf=function(t,e,r,i,n){return f(uf(t,e,r,i),{u_world:n})},hf=function(t,e,r,i){var n,o,a=t.transform;if("map"===i.paint.get("circle-pitch-alignment")){var s=Jp(r,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"===i.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,r,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+n,u_device_pixel_ratio:O.devicePixelRatio,u_extrude_scale:o}},ff=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)}},df=function(t,e,r){var i=Jp(r,1,e.zoom),n=Math.pow(2,e.zoom-r.tileID.overscaledZ),o=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[e.pixelsToGLUnits[0]/(i*n),e.pixelsToGLUnits[1]/(i*n)],u_overscale_factor:o}},mf=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},yf=function(t){return{u_matrix:t}},_f=function(t,e,r,i){return{u_matrix:t,u_extrude_scale:Jp(e,1,r),u_intensity:i}},gf=function(t,e,r){var i=t.transform;return{u_matrix:Sf(t,e,r),u_ratio:1/Jp(e,1,i.zoom),u_device_pixel_ratio:O.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},vf=function(t,e,r){return f(gf(t,e,r),{u_image:0})},xf=function(t,e,r,i){var n=t.transform,o=wf(e,n);return{u_matrix:Sf(t,e,r),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Jp(e,1,n.zoom),u_device_pixel_ratio:O.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},bf=function(t,e,r,i,n){var o=t.lineAtlas,a=wf(e,t.transform),s="round"===r.layout.get("line-cap"),l=o.getDash(i.from,s),u=o.getDash(i.to,s),c=l.width*n.fromScale,p=u.width*n.toScale;return f(gf(t,e,r),{u_patternscale_a:[a/c,-l.height/2],u_patternscale_b:[a/p,-u.height/2],u_sdfgamma:o.width/(256*Math.min(c,p)*O.devicePixelRatio)/2,u_image:0,u_tex_y_a:l.y,u_tex_y_b:u.y,u_mix:n.t})};function wf(t,e){return 1/Jp(t,1,e.tileZoom)}function Sf(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Tf=function(t,e,r,i,n){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.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:If(n.paint.get("raster-hue-rotate"))};var o,a};function If(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Ef=function(t,e,r,i,n,o,a,s,l,u){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:+r,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:+l,u_pitch_with_map:+i,u_texsize:u,u_texture:0}},Af=function(t,e,r,i,n,o,a,s,l,u,c){var p=n.transform;return f(Ef(t,e,r,i,n,o,a,s,l,u),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:O.devicePixelRatio,u_is_halo:+c})},kf=function(t,e,r,i,n,o,a,s,l,u){return f(Af(t,e,r,i,n,o,a,s,!0,l,!0),{u_texsize_icon:u,u_texture_icon:1})},zf=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Cf=function(t,e,r,i,n,o){return f(function(t,e,r,i){var n=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,l=a.height,u=Math.pow(2,i.tileID.overscaledZ),c=i.tileSize*Math.pow(2,r.transform.tileZoom)/u,p=c*(i.tileID.canonical.x+i.tileID.wrap*u),h=c*i.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,l],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/Jp(i,1,r.transform.tileZoom),u_pixel_coord_upper:[p>>16,h>>16],u_pixel_coord_lower:[65535&p,65535&h]}}(i,o,r,n),{u_matrix:t,u_opacity:e})},Pf={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 jo(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 jo(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 jo(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 jo(t,e.u_scale_with_map),u_pitch_with_map:new jo(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:ff,collisionCircle:ff,debug:function(t,e){return{u_color:new Wo(t,e.u_color),u_matrix:new Ko(t,e.u_matrix),u_overlay:new jo(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 jo(t,e.u_image),u_color_ramp:new jo(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 jo(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 jo(t,e.u_image),u_dimension:new Zo(t,e.u_dimension),u_zoom:new qo(t,e.u_zoom),u_maxzoom:new qo(t,e.u_maxzoom),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 jo(t,e.u_image)}},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 jo(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 jo(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 jo(t,e.u_image0),u_image1:new jo(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 jo(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new jo(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 jo(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 jo(t,e.u_is_text),u_pitch_with_map:new jo(t,e.u_pitch_with_map),u_texsize:new Zo(t,e.u_texsize),u_texture:new jo(t,e.u_texture)}},symbolSDF:function(t,e){return{u_is_size_zoom_constant:new jo(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new jo(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 jo(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 jo(t,e.u_is_text),u_pitch_with_map:new jo(t,e.u_pitch_with_map),u_texsize:new Zo(t,e.u_texsize),u_texture:new jo(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 jo(t,e.u_is_halo)}},symbolTextAndIcon:function(t,e){return{u_is_size_zoom_constant:new jo(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new jo(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 jo(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 jo(t,e.u_is_text),u_pitch_with_map:new jo(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 jo(t,e.u_texture),u_texture_icon:new jo(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 jo(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 jo(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 Mf(t,e,r,i,n,o,a,s){for(var l=t.context,u=l.gl,c=t.useProgram(n?"collisionCircle":"collisionBox"),p=0;p<i.length;p++){var h=i[p],f=e.getTile(h),d=f.getBucket(r);if(d){var m=n?s?d.textCollisionCircle:d.iconCollisionCircle:s?d.textCollisionBox:d.iconCollisionBox;if(m){var y=h.posMatrix;0===o[0]&&0===o[1]||(y=t.translatePosMatrix(h.posMatrix,f,o,a)),c.draw(l,n?u.TRIANGLES:u.LINES,hp.disabled,fp.disabled,t.colorModeForRenderPass(),mp.disabled,df(y,t.transform,f),r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,t.transform.zoom,null,null,m.collisionVertexBuffer)}}}}function Df(t,e,r,i,n,o,a){Mf(t,e,r,i,!1,n,o,a),Mf(t,e,r,i,!0,n,o,a)}var Lf=ka(new Float32Array(16));function Rf(t,e,r,i,o,a){var s=Ql(t),l=-(s.horizontalAlign-.5)*e,u=-(s.verticalAlign-.5)*r,c=nu(t,i);return new n((l/o+c[0])*a,(u/o+c[1])*a)}function Bf(t,e,r,i,o,a,s,l,u,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:i[_.crossTileID];if(g){var v=new n(_.anchorX,_.anchorY),x=Op(v,r?l:s),b=.5+a.cameraToCenterDistance/x.signedDistanceFromCamera*.5,w=o.evaluateSizeForFeature(t.textSizeData,c,_)*b/24;r&&(w*=t.tilePixelRatio/u);for(var S=Rf(g.anchor,g.width,g.height,g.textOffset,g.textBoxScale,w),T=r?Op(v.add(S),s).point:x.point.add(e?S.rotate(-a.angle):S),I=t.allowVerticalPlacement&&_.placedOrientation===Hl.vertical?Math.PI/2:0,E=0;E<_.numGlyphs;E++)lu(f,T,I);p&&_.associatedIconIndex>=0&&(m[_.associatedIconIndex]={shiftedAnchor:T,angle:I})}else Wp(_.numGlyphs,f)}if(p){d.clear();for(var A=t.icon.placedSymbolArray,k=0;k<A.length;k++){var z=A.get(k);if(z.hidden)Wp(z.numGlyphs,d);else{var C=m[k];if(C)for(var P=0;P<z.numGlyphs;P++)lu(d,C.shiftedAnchor,C.angle);else Wp(z.numGlyphs,d)}}t.icon.dynamicLayoutVertexBuffer.updateData(d)}t.text.dynamicLayoutVertexBuffer.updateData(f)}function Ff(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Of(t,e,r,i,n,o,a,s,l,u,c,p){for(var h,f,d=t.context,m=d.gl,y=t.transform,_="map"===s,g="map"===l,v=_&&"point"!==r.layout.get("symbol-placement"),x=_&&!g&&!v,b=void 0!==r.layout.get("symbol-sort-key").constantOr(1),w=t.depthModeForSublayer(0,hp.ReadOnly),S=r.layout.get("text-variable-anchor"),T=[],I=0,E=i;I<E.length;I+=1){var A=E[I],k=e.getTile(A),z=k.getBucket(r);if(z){var C=n?z.text:z.icon;if(C&&C.segments.get().length){var P=C.programConfigurations.get(r.id),M=n||z.sdfIcons,D=n?z.textSizeData:z.iconSizeData,L=g||0!==y.pitch;h||(h=t.useProgram(Ff(M,n,z),P),f=eu(D,y.zoom));var R=void 0,B=[0,0],F=void 0,O=void 0,V=null,U=void 0;if(n)F=k.glyphAtlasTexture,O=m.LINEAR,R=k.glyphAtlasTexture.size,z.iconsInText&&(B=k.imageAtlasTexture.size,V=k.imageAtlasTexture,U=L||t.options.rotating||t.options.zooming||"composite"===D.kind||"camera"===D.kind?m.LINEAR:m.NEAREST);else{var N=1!==r.layout.get("icon-size").constantOr(0)||z.iconsNeedLinear;F=k.imageAtlasTexture,O=M||t.options.rotating||t.options.zooming||N||L?m.LINEAR:m.NEAREST,R=k.imageAtlasTexture.size}var j=Jp(k,1,t.transform.zoom),q=Bp(A.posMatrix,g,_,t.transform,j),Z=Fp(A.posMatrix,g,_,t.transform,j),G=S&&z.hasTextData(),X="none"!==r.layout.get("icon-text-fit")&&G&&z.hasIconData();v&&Up(z,A.posMatrix,t,n,q,Z,g,u);var W=t.translatePosMatrix(A.posMatrix,k,o,a),H=v||n&&S||X?Lf:q,K=t.translatePosMatrix(Z,k,o,a,!0),Y=M&&0!==r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1),J={program:h,buffers:C,uniformValues:M?z.iconsInText?kf(D.kind,f,x,g,t,W,H,K,R,B):Af(D.kind,f,x,g,t,W,H,K,n,R,!0):Ef(D.kind,f,x,g,t,W,H,K,n,R),atlasTexture:F,atlasTextureIcon:V,atlasInterpolation:O,atlasInterpolationIcon:U,isSDF:M,hasHalo:Y};if(b)for(var Q=0,$=C.segments.get();Q<$.length;Q+=1){var tt=$[Q];T.push({segments:new Po([tt]),sortKey:tt.sortKey,state:J})}else T.push({segments:C.segments,sortKey:0,state:J})}}}b&&T.sort((function(t,e){return t.sortKey-e.sortKey}));for(var et=0,rt=T;et<rt.length;et+=1){var it=rt[et],nt=it.state;if(d.activeTexture.set(m.TEXTURE0),nt.atlasTexture.bind(nt.atlasInterpolation,m.CLAMP_TO_EDGE),nt.atlasTextureIcon&&(d.activeTexture.set(m.TEXTURE1),nt.atlasTextureIcon&&nt.atlasTextureIcon.bind(nt.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),nt.isSDF){var ot=nt.uniformValues;nt.hasHalo&&(ot.u_is_halo=1,Vf(nt.buffers,it.segments,r,t,nt.program,w,c,p,ot)),ot.u_is_halo=0}Vf(nt.buffers,it.segments,r,t,nt.program,w,c,p,nt.uniformValues)}}function Vf(t,e,r,i,n,o,a,s,l){var u=i.context;n.draw(u,u.gl.TRIANGLES,o,a,s,mp.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,i.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Uf(t,e,r,i,n,o,a){var s,l,u,c,p,h=t.context.gl,f=r.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=r.getCrossfadeParameters();a?(l=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(l=d?"fillPattern":"fill",s=h.TRIANGLES);for(var y=0,_=i;y<_.length;y+=1){var g=_[y],v=e.getTile(g);if(!d||v.patternsLoaded()){var x=v.getBucket(r);if(x){var b=x.programConfigurations.get(r.id),w=t.useProgram(l,b);d&&(t.context.activeTexture.set(h.TEXTURE0),v.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),b.updatePaintBuffers(m));var S=f.constantOr(null);if(S&&v.imageAtlas){var T=v.imageAtlas,I=T.patternPositions[S.to.toString()],E=T.patternPositions[S.from.toString()];I&&E&&b.setConstantPatternPositions(I,E)}var A=t.translatePosMatrix(g.posMatrix,v,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(a){c=x.indexBuffer2,p=x.segments2;var k=[h.drawingBufferWidth,h.drawingBufferHeight];u="fillOutlinePattern"===l&&d?pf(A,t,m,v,k):cf(A,k)}else c=x.indexBuffer,p=x.segments,u=d?uf(A,t,m,v):lf(A);w.draw(t.context,s,n,t.stencilModeForClipping(g),o,mp.disabled,u,r.id,x.layoutVertexBuffer,c,p,r.paint,t.transform.zoom,b)}}}}function Nf(t,e,r,i,n,o,a){for(var s=t.context,l=s.gl,u=r.paint.get("fill-extrusion-pattern"),c=u.constantOr(1),p=r.getCrossfadeParameters(),h=r.paint.get("fill-extrusion-opacity"),f=0,d=i;f<d.length;f+=1){var m=d[f],y=e.getTile(m),_=y.getBucket(r);if(_){var g=_.programConfigurations.get(r.id),v=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",g);c&&(t.context.activeTexture.set(l.TEXTURE0),y.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),g.updatePaintBuffers(p));var x=u.constantOr(null);if(x&&y.imageAtlas){var b=y.imageAtlas,w=b.patternPositions[x.to.toString()],S=b.patternPositions[x.from.toString()];w&&S&&g.setConstantPatternPositions(w,S)}var T=t.translatePosMatrix(m.posMatrix,y,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),I=r.paint.get("fill-extrusion-vertical-gradient"),E=c?sf(T,t,I,h,m,p,y):af(T,t,I,h);v.draw(s,s.gl.TRIANGLES,n,o,a,mp.backCCW,E,r.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,r.paint,t.transform.zoom,g)}}}function jf(t,e,r,i,n,o){var a=t.context,s=a.gl,l=e.fbo;if(l){var u=t.useProgram("hillshade");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var c=function(t,e,r){var i=r.paint.get("hillshade-shadow-color"),n=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color"),a=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(a-=t.transform.angle);var s,l,u,c=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),c),u_image:0,u_latrange:(s=e.tileID,l=Math.pow(2,s.canonical.z),u=s.canonical.y,[new Ve(0,u/l).toLngLat().lat,new Ve(0,(u+1)/l).toLngLat().lat]),u_light:[r.paint.get("hillshade-exaggeration"),a],u_shadow:i,u_highlight:n,u_accent:o}}(t,e,r);u.draw(a,s.TRIANGLES,i,n,o,mp.disabled,c,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function qf(t,e,r,i,n,o,a){var s=t.context,l=s.gl,u=e.dem;if(u&&u.data){var c=u.dim,p=u.stride,h=u.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||t.getTileTexture(p),e.demTexture){var f=e.demTexture;f.update(h,{premultiply:!1}),f.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else e.demTexture=new zu(s,h,l.RGBA,{premultiply:!1}),e.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);var d=e.fbo;if(!d){var m=new zu(s,{width:c,height:c,data:null},l.RGBA);m.bind(l.LINEAR,l.CLAMP_TO_EDGE),(d=e.fbo=s.createFramebuffer(c,c,!0)).colorAttachment.set(m.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,c,c]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,n,o,a,mp.disabled,function(t,e,r){var i=e.stride,n=Aa();return La(n,0,8192,-8192,0,0,1),Pa(n,n,[0,-8192,0]),{u_matrix:n,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_maxzoom:r,u_unpack:e.getUnpackVector()}}(e.tileID,u,i),r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function Zf(t,e,r,i,n){var o=i.paint.get("raster-fade-duration");if(o>0){var a=O.now(),s=(a-t.timeAdded)/o,l=e?(a-e.timeAdded)/o:-1,c=r.getSource(),p=n.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!e||Math.abs(e.tileID.overscaledZ-p)>Math.abs(t.tileID.overscaledZ-p),f=h&&t.refreshedUponExpiration?1:u(h?s:1-l,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 Gf=new ce(1,0,0,1),Xf=new ce(0,1,0,1),Wf=new ce(0,0,1,1),Hf=new ce(1,0,1,1),Kf=new ce(0,1,1,1);function Yf(t,e,r,i){Qf(t,0,e+r/2,t.transform.width,r,i)}function Jf(t,e,r,i){Qf(t,e-r/2,0,r,t.transform.height,i)}function Qf(t,e,r,i,n,o){var a=t.context,s=a.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*O.devicePixelRatio,r*O.devicePixelRatio,i*O.devicePixelRatio,n*O.devicePixelRatio),a.clear({color:o}),s.disable(s.SCISSOR_TEST)}function $f(t,e,r){var i=t.context,n=i.gl,o=r.posMatrix,a=t.useProgram("debug"),s=hp.disabled,l=fp.disabled,u=t.colorModeForRenderPass();i.activeTexture.set(n.TEXTURE0),t.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE),a.draw(i,n.LINE_STRIP,s,l,u,mp.disabled,mf(o,ce.red),"$debug",t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);var c=e.getTileByID(r.key).latestRawTileData,p=Math.floor((c&&c.byteLength||0)/1024),h=e.getTile(r).tileSize,f=512/Math.min(h,512)*(r.overscaledZ/t.transform.zoom)*.5,d=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(d+=" => "+r.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,i=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,r.width,r.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(r),t.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(t,d+" "+p+"kb"),a.draw(i,n.TRIANGLES,s,l,dp.alphaBlended,mp.disabled,mf(o,ce.transparent,f),"$debug",t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}var td={symbol:function(t,e,r,i,n){if("translucent"===t.renderPass){var o=fp.disabled,a=t.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(t,e,r,i,n,o,a){for(var s=e.transform,l="map"===n,u="map"===o,c=0,p=t;c<p.length;c+=1){var h=p[c],f=i.getTile(h),d=f.getBucket(r);if(d&&d.text&&d.text.segments.get().length){var m=eu(d.textSizeData,s.zoom),y=Jp(f,1,e.transform.zoom),_=Bp(h.posMatrix,u,l,e.transform,y),g="none"!==r.layout.get("icon-text-fit")&&d.hasIconData();if(m){var v=Math.pow(2,s.zoom-f.tileID.overscaledZ);Bf(d,l,u,a,ru,s,_,h.posMatrix,v,m,g)}}}}(i,t,r,e,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),n),0!==r.paint.get("icon-opacity").constantOr(1)&&Of(t,e,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),o,a),0!==r.paint.get("text-opacity").constantOr(1)&&Of(t,e,r,i,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),o,a),e.map.showCollisionBoxes&&(Df(t,e,r,i,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),Df(t,e,r,i,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1))}},circle:function(t,e,r,i){if("translucent"===t.renderPass){var n=r.paint.get("circle-opacity"),o=r.paint.get("circle-stroke-width"),a=r.paint.get("circle-stroke-opacity"),s=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0!==n.constantOr(1)||0!==o.constantOr(1)&&0!==a.constantOr(1)){for(var l=t.context,u=l.gl,c=t.depthModeForSublayer(0,hp.ReadOnly),p=fp.disabled,h=t.colorModeForRenderPass(),f=[],d=0;d<i.length;d++){var m=i[d],y=e.getTile(m),_=y.getBucket(r);if(_){var g=_.programConfigurations.get(r.id),v={programConfiguration:g,program:t.useProgram("circle",g),layoutVertexBuffer:_.layoutVertexBuffer,indexBuffer:_.indexBuffer,uniformValues:hf(t,m,y,r)};if(s)for(var x=0,b=_.segments.get();x<b.length;x+=1){var w=b[x];f.push({segments:new Po([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 S=0,T=f;S<T.length;S+=1){var I=T[S],E=I.state;E.program.draw(l,u.TRIANGLES,c,p,h,mp.disabled,E.uniformValues,r.id,E.layoutVertexBuffer,E.indexBuffer,I.segments,r.paint,t.transform.zoom,E.programConfiguration)}}}},heatmap:function(t,e,r,i){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var n=t.context,o=n.gl,a=fp.disabled,s=new dp([o.ONE,o.ONE],ce.transparent,[!0,!0,!0,!0]);!function(t,e,r){var i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var n=r.heatmapFbo;if(n)i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),t.bindFramebuffer.set(n.framebuffer);else{var o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),n=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function t(e,r,i,n){var o=e.gl;o.texImage2D(o.TEXTURE_2D,0,o.RGBA,r.width/4,r.height/4,0,o.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:o.UNSIGNED_BYTE,null),n.colorAttachment.set(i),e.extTextureHalfFloat&&o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,n.colorAttachment.setDirty(),t(e,r,i,n))}(t,e,o,n)}}(n,t,r),n.clear({color:ce.transparent});for(var l=0;l<i.length;l++){var u=i[l];if(!e.hasRenderableParent(u)){var c=e.getTile(u),p=c.getBucket(r);if(p){var h=p.programConfigurations.get(r.id);t.useProgram("heatmap",h).draw(n,o.TRIANGLES,hp.disabled,a,s,mp.disabled,_f(u.posMatrix,c,t.transform.zoom,r.paint.get("heatmap-intensity")),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.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 r=t.context,i=r.gl,n=e.heatmapFbo;if(n){r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1);var o=e.colorRampTexture;o||(o=e.colorRampTexture=new zu(r,e.colorRamp,i.RGBA)),o.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,i.TRIANGLES,hp.disabled,fp.disabled,t.colorModeForRenderPass(),mp.disabled,function(t,e,r,i){var n=Aa();La(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,r))},line:function(t,e,r,i){if("translucent"===t.renderPass){var n=r.paint.get("line-opacity"),o=r.paint.get("line-width");if(0!==n.constantOr(1)&&0!==o.constantOr(1)){var a=t.depthModeForSublayer(0,hp.ReadOnly),s=t.colorModeForRenderPass(),l=r.paint.get("line-dasharray"),u=r.paint.get("line-pattern"),c=u.constantOr(1),p=r.paint.get("line-gradient"),h=r.getCrossfadeParameters(),f=c?"linePattern":l?"lineSDF":p?"lineGradient":"line",d=t.context,m=d.gl,y=!0;if(p){d.activeTexture.set(m.TEXTURE0);var _=r.gradientTexture;if(!r.gradient)return;_||(_=r.gradientTexture=new zu(d,r.gradient,m.RGBA)),_.bind(m.LINEAR,m.CLAMP_TO_EDGE)}for(var g=0,v=i;g<v.length;g+=1){var x=v[g],b=e.getTile(x);if(!c||b.patternsLoaded()){var w=b.getBucket(r);if(w){var S=w.programConfigurations.get(r.id),T=t.context.program.get(),I=t.useProgram(f,S),E=y||I.program!==T,A=u.constantOr(null);if(A&&b.imageAtlas){var k=b.imageAtlas,z=k.patternPositions[A.to.toString()],C=k.patternPositions[A.from.toString()];z&&C&&S.setConstantPatternPositions(z,C)}var P=c?xf(t,b,r,h):l?bf(t,b,r,l,h):p?vf(t,b,r):gf(t,b,r);c?(d.activeTexture.set(m.TEXTURE0),b.imageAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),S.updatePaintBuffers(h)):l&&(E||t.lineAtlas.dirty)&&(d.activeTexture.set(m.TEXTURE0),t.lineAtlas.bind(d)),I.draw(d,m.TRIANGLES,a,t.stencilModeForClipping(x),s,mp.disabled,P,r.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,r.paint,t.transform.zoom,S),y=!1}}}}}},fill:function(t,e,r,i){var n=r.paint.get("fill-color"),o=r.paint.get("fill-opacity");if(0!==o.constantOr(1)){var a=t.colorModeForRenderPass(),s=r.paint.get("fill-pattern"),l=t.opaquePassEnabledForLayer()&&!s.constantOr(1)&&1===n.constantOr(ce.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===l){var u=t.depthModeForSublayer(1,"opaque"===t.renderPass?hp.ReadWrite:hp.ReadOnly);Uf(t,e,r,i,u,a,!1)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){var c=t.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,hp.ReadOnly);Uf(t,e,r,i,c,a,!0)}}},"fill-extrusion":function(t,e,r,i){var n=r.paint.get("fill-extrusion-opacity");if(0!==n&&"translucent"===t.renderPass){var o=new hp(t.context.gl.LEQUAL,hp.ReadWrite,t.depthRangeFor3D);if(1!==n||r.paint.get("fill-extrusion-pattern").constantOr(1))Nf(t,e,r,i,o,fp.disabled,dp.disabled),Nf(t,e,r,i,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();Nf(t,e,r,i,o,fp.disabled,a)}}},hillshade:function(t,e,r,i){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var n=t.context,o=e.getSource().maxzoom,a=t.depthModeForSublayer(0,hp.ReadOnly),s=t.colorModeForRenderPass(),l="translucent"===t.renderPass?t.stencilConfigForOverlap(i):[{},i],u=l[0],c=0,p=l[1];c<p.length;c+=1){var h=p[c],f=e.getTile(h);f.needsHillshadePrepare&&"offscreen"===t.renderPass?qf(t,f,r,o,a,fp.disabled,s):"translucent"===t.renderPass&&jf(t,f,r,a,u[h.overscaledZ],s)}n.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,i){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity")&&i.length)for(var n=t.context,o=n.gl,a=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),u=a instanceof cc?[{},i]:t.stencilConfigForOverlap(i),c=u[0],p=u[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===r.paint.get("raster-opacity")?hp.ReadWrite:hp.ReadOnly,o.LESS),g=e.getTile(y),v=t.transform.calculatePosMatrix(y.toUnwrapped(),f);g.registerFadeDuration(r.paint.get("raster-fade-duration"));var x=e.findLoadedParent(y,0),b=Zf(g,x,e,r,t.transform),w=void 0,S=void 0,T="nearest"===r.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;n.activeTexture.set(o.TEXTURE0),g.texture.bind(T,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),n.activeTexture.set(o.TEXTURE1),x?(x.texture.bind(T,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,x.tileID.overscaledZ-g.tileID.overscaledZ),S=[g.tileID.canonical.x*w%1,g.tileID.canonical.y*w%1]):g.texture.bind(T,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var I=Tf(v,S||[0,0],w||1,b,r);a instanceof cc?s.draw(n,o.TRIANGLES,_,fp.disabled,l,mp.disabled,I,r.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(n,o.TRIANGLES,_,c[y.overscaledZ],l,mp.disabled,I,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var i=r.paint.get("background-color"),n=r.paint.get("background-opacity");if(0!==n){var o=t.context,a=o.gl,s=t.transform,l=s.tileSize,u=r.paint.get("background-pattern");if(!t.isPatternMissing(u)){var c=!u&&1===i.a&&1===n&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var p=fp.disabled,h=t.depthModeForSublayer(0,"opaque"===c?hp.ReadWrite:hp.ReadOnly),f=t.colorModeForRenderPass(),d=t.useProgram(u?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});u&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var y=r.getCrossfadeParameters(),_=0,g=m;_<g.length;_+=1){var v=g[_],x=t.transform.calculatePosMatrix(v.toUnwrapped()),b=u?Cf(x,n,t,u,{tileID:v,tileSize:l},y):zf(x,n,i);d.draw(o,a.TRIANGLES,h,p,f,mp.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var i=0;i<r.length;i++)$f(t,e,r[i])},custom:function(t,e,r){var i=t.context,n=r.implementation;if("offscreen"===t.renderPass){var o=n.prerender;o&&(t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),o.call(n,i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),i.setStencilMode(fp.disabled);var a="3d"===n.renderingMode?new hp(t.context.gl.LEQUAL,hp.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,hp.ReadOnly);i.setDepthMode(a),n.render(i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState(),i.bindFramebuffer.set(null)}}},ed=function(t,e){this.context=new yp(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=_p.maxUnderzooming+_p.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new bh,this.gpuTimers={}};ed.prototype.resize=function(t,e){if(this.width=t*O.devicePixelRatio,this.height=e*O.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var r=0,i=this.style._order;r<i.length;r+=1)this.style._layers[i[r]].resize()},ed.prototype.setup=function(){var t=this.context,e=new Qn;e.emplaceBack(0,0),e.emplaceBack(8192,0),e.emplaceBack(0,8192),e.emplaceBack(8192,8192),this.tileExtentBuffer=t.createVertexBuffer(e,Ah.members),this.tileExtentSegments=Po.simpleSegment(0,0,4,2);var r=new Qn;r.emplaceBack(0,0),r.emplaceBack(8192,0),r.emplaceBack(0,8192),r.emplaceBack(8192,8192),this.debugBuffer=t.createVertexBuffer(r,Ah.members),this.debugSegments=Po.simpleSegment(0,0,4,5);var i=new $n;i.emplaceBack(0,0,0,0),i.emplaceBack(8192,0,8192,0),i.emplaceBack(0,8192,0,8192),i.emplaceBack(8192,8192,8192,8192),this.rasterBoundsBuffer=t.createVertexBuffer(i,uc.members),this.rasterBoundsSegments=Po.simpleSegment(0,0,4,2);var n=new Qn;n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(n,Ah.members),this.viewportSegments=Po.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 mo;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(a),this.emptyTexture=new zu(t,{width:1,height:1,data:new Uint8Array([0,0,0,0])},t.gl.RGBA);var s=this.context.gl;this.stencilClearMode=new fp({func:s.ALWAYS,mask:0},0,255,s.ZERO,s.ZERO,s.ZERO)},ed.prototype.clearStencil=function(){var t=this.context,e=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var r=Aa();La(r,0,this.width,this.height,0,0,1),Ma(r,r,[e.drawingBufferWidth,e.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,e.TRIANGLES,hp.disabled,this.stencilClearMode,dp.disabled,mp.disabled,yf(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},ed.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,i=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(dp.disabled),r.setDepthMode(hp.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;n.draw(r,i.TRIANGLES,hp.disabled,new fp({func:i.ALWAYS,mask:0},l,255,i.KEEP,i.KEEP,i.REPLACE),dp.disabled,mp.disabled,yf(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},ed.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new fp({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},ed.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new fp({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},ed.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,i=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),n=i[i.length-1].overscaledZ,o=i[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 fp({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=o,[a,i]}return[(e={},e[n]=fp.disabled,e),i]},ed.prototype.colorModeForRenderPass=function(){var t=this.context.gl;return this._showOverdrawInspector?new dp([t.CONSTANT_COLOR,t.ONE],new ce(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?dp.unblended:dp.alphaBlended},ed.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return hp.disabled;var i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new hp(r||this.context.gl.LEQUAL,e,[i,i])},ed.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},ed.prototype.render=function(t,e){var r=this;this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(O.now()),this.imageManager.beginFrame();var i=this.style._order,n=this.style.sourceCaches;for(var o in n){var a=n[o];a.used&&a.prepare(this.context)}var s,l,u={},c={},p={};for(var f in n){var d=n[f];u[f]=d.getVisibleCoordinates(),c[f]=u[f].slice().reverse(),p[f]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<i.length;m++)if(this.style._layers[i[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var y=0,_=i;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?ce.black:ce.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=i.length-1;this.currentLayer>=0;this.currentLayer--){var x=this.style._layers[i[this.currentLayer]],b=n[x.source],w=u[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var S=this.style._layers[i[this.currentLayer]],T=n[S.source],I=("symbol"===S.type?p:c)[S.source];this._renderTileClippingMasks(S,u[S.source]),this.renderLayer(this,T,S,I)}this.options.showTileBoundaries&&(h(this.style._layers).forEach((function(t){t.source&&!t.isHidden(r.transform.zoom)&&(t.source!==(l&&l.id)&&(l=r.style.sourceCaches[t.source]),(!s||s.getSource().maxzoom<l.getSource().maxzoom)&&(s=l))})),s&&td.debug(this,s,s.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;Yf(t,t.transform.height-(e.top||0),3,Gf),Yf(t,e.bottom||0,3,Xf),Jf(t,e.left||0,3,Wf),Jf(t,t.transform.width-(e.right||0),3,Hf);var r=t.transform.centerPoint;!function(t,e,r,i){Qf(t,e-1,r-10,2,20,i),Qf(t,e-10,r-1,20,2,i)}(t,r.x,t.transform.height-r.y,Kf)}(this),this.context.setDefault()},ed.prototype.renderLayer=function(t,e,r,i){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||i.length)&&(this.id=r.id,this.gpuTimingStart(r),td[r.type](t,e,r,i,this.style.placement.variableOffsets),this.gpuTimingEnd())},ed.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,r=this.gpuTimers[t.id];r||(r=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),r.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query)}},ed.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},ed.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},ed.prototype.queryGpuTimers=function(t){var e={};for(var r in t){var i=t[r],n=this.context.extTimerQuery,o=n.getQueryObjectEXT(i.query,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i.query),e[r]=o}return e},ed.prototype.translatePosMatrix=function(t,e,r,i,n){if(!r[0]&&!r[1])return t;var o=n?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){var a=Math.sin(o),s=Math.cos(o);r=[r[0]*s-r[1]*a,r[0]*a+r[1]*s]}var l=[n?r[0]:Jp(e,r[0],this.transform.zoom),n?r[1]:Jp(e,r[1],this.transform.zoom),0],u=new Float32Array(16);return Pa(u,t,l),u},ed.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},ed.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},ed.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},ed.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new nf(this.context,ef[t],e,Pf[t],this._showOverdrawInspector)),this.cache[r]},ed.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()},ed.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)},ed.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=self.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new zu(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},ed.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var rd=function(t,e){this.points=t,this.planes=e};rd.fromInvProjectionMatrix=function(t,e,r){var i=Math.pow(2,r),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 Oa([],e,t)})).map((function(t){return function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}([],t,1/t[3]/e*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var e,r,i=function(t,e){var r=e[0],i=e[1],n=e[2],o=r*r+i*i+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,r){var i=e[0],n=e[1],o=e[2],a=r[0],s=r[1],l=r[2];return t[0]=n*l-o*s,t[1]=o*a-i*l,t[2]=i*s-n*a,t}([],Fa([],n[t[0]],n[t[1]]),Fa([],n[t[2]],n[t[1]]))),o=-((e=i)[0]*(r=n[t[1]])[0]+e[1]*r[1]+e[2]*r[2]);return i.concat(o)}));return new rd(n,o)};var id=function(t,e){this.min=t,this.max=e,this.center=function(t,e,r){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}([],this.min,this.max))};id.prototype.quadrant=function(t){for(var e=[t%2==0,t<2],r=Ra(this.min),i=Ra(this.max),n=0;n<e.length;n++)r[n]=e[n]?this.min[n]:this.center[n],i[n]=e[n]?this.center[n]:this.max[n];return i[2]=this.max[2],new id(r,i)},id.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},id.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},id.prototype.intersects=function(t){for(var e,r,i=[[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,l=0;l<i.length;l++)s+=(e=a)[0]*(r=i[l])[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]>=0;if(0===s)return 0;s!==i.length&&(n=!1)}if(n)return 2;for(var u=0;u<3;u++){for(var c=Number.MAX_VALUE,p=-Number.MAX_VALUE,h=0;h<t.points.length;h++){var f=t.points[h][u]-this.min[u];c=Math.min(c,f),p=Math.max(p,f)}if(p<0||c>this.max[u]-this.min[u])return 0}return 1};var nd=function(t,e,r,i){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(i)||i<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=r,this.right=i};nd.prototype.interpolate=function(t,e,r){return null!=e.top&&null!=t.top&&(this.top=ur(t.top,e.top,r)),null!=e.bottom&&null!=t.bottom&&(this.bottom=ur(t.bottom,e.bottom,r)),null!=e.left&&null!=t.left&&(this.left=ur(t.left,e.left,r)),null!=e.right&&null!=t.right&&(this.right=ur(t.right,e.right,r)),this},nd.prototype.getCenter=function(t,e){var r=u((this.left+t-this.right)/2,0,t),i=u((this.top+e-this.bottom)/2,0,e);return new n(r,i)},nd.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},nd.prototype.clone=function(){return new nd(this.top,this.bottom,this.left,this.right)},nd.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var od=function(t,e,r,i,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==r?0:r,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new Me(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new nd,this._posMatrixCache={},this._alignedPosMatrixCache={}},ad={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}};od.prototype.clone=function(){var t=new od(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},ad.minZoom.get=function(){return this._minZoom},ad.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},ad.maxZoom.get=function(){return this._maxZoom},ad.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},ad.minPitch.get=function(){return this._minPitch},ad.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},ad.maxPitch.get=function(){return this._maxPitch},ad.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},ad.renderWorldCopies.get=function(){return this._renderWorldCopies},ad.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},ad.worldSize.get=function(){return this.tileSize*this.scale},ad.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},ad.size.get=function(){return new n(this.width,this.height)},ad.bearing.get=function(){return-this.angle/Math.PI*180},ad.bearing.set=function(t){var e=-c(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,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=Math.sin(r),l=Math.cos(r);t[0]=i*l+o*s,t[1]=n*l+a*s,t[2]=i*-s+o*l,t[3]=n*-s+a*l}(this.rotationMatrix,this.rotationMatrix,this.angle))},ad.pitch.get=function(){return this._pitch/Math.PI*180},ad.pitch.set=function(t){var e=u(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},ad.fov.get=function(){return this._fov/Math.PI*180},ad.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())},ad.zoom.get=function(){return this._zoom},ad.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())},ad.center.get=function(){return this._center},ad.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},ad.padding.get=function(){return this._edgeInsets.toJSON()},ad.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},ad.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},od.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},od.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},od.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},od.prototype.getVisibleUnwrappedCoordinates=function(t){var e=[new Ku(0,t)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new n(0,0)),i=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(r.x,i.x,o.x,a.x)),l=Math.floor(Math.max(r.x,i.x,o.x,a.x)),u=s-1;u<=l+1;u++)0!==u&&e.push(new Ku(u,t));return e},od.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(void 0!==t.minzoom&&e<t.minzoom)return[];void 0!==t.maxzoom&&e>t.maxzoom&&(e=t.maxzoom);var i=Ve.fromLngLat(this.center),n=Math.pow(2,e),o=[n*i.x,n*i.y,0],a=rd.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,e),s=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(s=e);var l=function(t){return{aabb:new id([t*n,0,0],[(t+1)*n,n,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],c=[],p=e,h=t.reparseOverscaled?r:e;if(this._renderWorldCopies)for(var f=1;f<=3;f++)u.push(l(-f)),u.push(l(f));for(u.push(l(0));u.length>0;){var d=u.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 Yu(d.zoom===p?h:d.zoom,d.wrap,d.zoom,m,y),distanceSq:Va([o[0]-.5-m,o[1]-.5-y])});else for(var w=0;w<4;w++){var S=(m<<1)+w%2,T=(y<<1)+(w>>1);u.push({aabb:d.aabb.quadrant(w),zoom:d.zoom+1,x:S,y:T,wrap:d.wrap,fullyVisible:_})}}return c.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},od.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},ad.unmodified.get=function(){return this._unmodified},od.prototype.zoomScale=function(t){return Math.pow(2,t)},od.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},od.prototype.project=function(t){var e=u(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new n(this.lngX(t.lng),this.latY(e))},od.prototype.unproject=function(t){return new Me(this.xLng(t.x),this.yLat(t.y))},ad.point.get=function(){return this.project(this.center)},od.prototype.lngX=function(t){return(180+t)*this.worldSize/360},od.prototype.latY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*this.worldSize/360},od.prototype.xLng=function(t){return 360*t/this.worldSize-180},od.prototype.yLat=function(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t/this.worldSize)*Math.PI/180))-90},od.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),n=this.locationCoordinate(t),o=new Ve(n.x-(r.x-i.x),n.y-(r.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},od.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},od.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},od.prototype.locationCoordinate=function(t){return Ve.fromLngLat(t)},od.prototype.coordinateLocation=function(t){return t.toLngLat()},od.prototype.pointCoordinate=function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];Oa(e,e,this.pixelMatrixInverse),Oa(r,r,this.pixelMatrixInverse);var i=e[3],n=r[3],o=e[1]/i,a=r[1]/n,s=e[2]/i,l=r[2]/n,u=s===l?0:(0-s)/(l-s);return new Ve(ur(e[0]/i,r[0]/n,u)/this.worldSize,ur(o,a,u)/this.worldSize)},od.prototype.coordinatePoint=function(t){var e=[t.x*this.worldSize,t.y*this.worldSize,0,1];return Oa(e,e,this.pixelMatrix),new n(e[0]/e[3],e[1]/e[3])},od.prototype.getBounds=function(){return(new Pe).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)))},od.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new Pe([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},od.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])},od.prototype.calculatePosMatrix=function(t,e){void 0===e&&(e=!1);var r=t.key,i=e?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];var n=t.canonical,o=this.worldSize/this.zoomScale(n.z),a=n.x+Math.pow(2,n.z)*t.wrap,s=ka(new Float64Array(16));return Pa(s,s,[a*o,n.y*o,0]),Ma(s,s,[o/8192,o/8192,1]),Ca(s,e?this.alignedProjMatrix:this.projMatrix,s),i[r]=new Float32Array(s),i[r]},od.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},od.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,i,o=-90,a=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;o=this.latY(p[1]),t=(a=this.latY(p[0]))-o<u.y?u.y/(a-o):0}if(this.lngRange){var h=this.lngRange;s=this.lngX(h[0]),e=(l=this.lngX(h[1]))-s<u.x?u.x/(l-s):0}var f=this.point,d=Math.max(e||0,t||0);if(d)return this.center=this.unproject(new n(e?(l+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=u.y/2;m-y<o&&(i=o+y),m+y>a&&(i=a-y)}if(this.lngRange){var _=f.x,g=u.x/2;_-g<s&&(r=s+g),_+g>l&&(r=l-g)}void 0===r&&void 0===i||(this.center=this.unproject(new n(void 0!==r?r:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},od.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,r=this._fov*(.5+t.y/this.height),i=Math.sin(r)*this.cameraToCenterDistance/Math.sin(u(Math.PI-e-r,.01,Math.PI-.01)),n=this.point,o=n.x,a=n.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);(function(t,e,r,i,n){var o,a=1/Math.tan(e/2);t[0]=a/r,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+i)*(o=1/(i-n)),t[14]=2*n*i*o):(t[10]=-1,t[14]=-2*i)})(c,this._fov,this.width/this.height,l,s),c[8]=2*-t.x/this.width,c[9]=2*t.y/this.height,Ma(c,c,[1,-1,1]),Pa(c,c,[0,0,-this.cameraToCenterDistance]),function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[4],a=e[5],s=e[6],l=e[7],u=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+u*i,t[5]=a*n+c*i,t[6]=s*n+p*i,t[7]=l*n+h*i,t[8]=u*n-o*i,t[9]=c*n-a*i,t[10]=p*n-s*i,t[11]=h*n-l*i}(c,c,this._pitch),Da(c,c,this.angle),Pa(c,c,[-o,-a,0]),this.mercatorMatrix=Ma([],c,[this.worldSize,this.worldSize,this.worldSize]);var p=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));"m"===this.units&&(p=this.worldSize/(this.latRange[1]-this.latRange[0])),Ma(c,c,[1,1,p,1]),this.projMatrix=c,this.invProjMatrix=za([],this.projMatrix);var h=this.width%2/2,f=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),y=o-Math.round(o)+d*h+m*f,_=a-Math.round(a)+d*f+m*h,g=new Float64Array(c);if(Pa(g,g,[y>.5?y-1:y,_>.5?_-1:_,0]),this.alignedProjMatrix=g,Ma(c=Aa(),c,[this.width/2,-this.height/2,1]),Pa(c,c,[1,-1,0]),this.labelPlaneMatrix=c,Ma(c=Aa(),c,[1,-1,1]),Pa(c,c,[-1,-1,0]),Ma(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=Ca(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=za(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},od.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 Oa(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance},od.prototype.getCameraPoint=function(){var t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n(0,t))},od.prototype.getCameraQueryGeometry=function(t){var e=this.getCameraPoint();if(1===t.length)return[t[0],e];for(var r=e.x,i=e.y,o=e.x,a=e.y,s=0,l=t;s<l.length;s+=1){var u=l[s];r=Math.min(r,u.x),i=Math.min(i,u.y),o=Math.max(o,u.x),a=Math.max(a,u.y)}return[new n(r,i),new n(o,i),new n(o,a),new n(r,a),new n(r,i)]},Object.defineProperties(od.prototype,ad);var sd=function(t){var e,r,i,n;this._hashName=t&&encodeURIComponent(t),v(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),r=!1,i=null,n=function(){i=null,r&&(e(),i=setTimeout(n,300),r=!1)},function(){return r=!0,i||n(),i})};sd.prototype.addTo=function(t){return this._map=t,self.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},sd.prototype.remove=function(){return self.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},sd.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,i),o=Math.round(e.lng*n)/n,a=Math.round(e.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";if(u+=t?"/"+o+"/"+a+"/"+r:r+"/"+a+"/"+o,(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+="/"+Math.round(l)),this._hashName){var c=this._hashName,p=!1,h=self.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===c?(p=!0,e+"="+u):t})).filter((function(t){return t}));return p||h.push(c+"="+u),"#"+h.join("&")}return"#"+u},sd.prototype._getCurrentHash=function(){var t,e=this,r=self.location.hash.replace("#","");return this._hashName?(r.split("&").map((function(t){return t.split("=")})).forEach((function(r){r[0]===e._hashName&&(t=r)})),(t&&t[1]||"").split("/")):r.split("/")},sd.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},sd.prototype._updateHashUnthrottled=function(){var t=this.getHashString();try{self.history.replaceState(self.history.state,"",t)}catch(t){}};var ld=function(t){function e(e,r,i,n){void 0===n&&(n={});var o=V.mousePos(r.getCanvasContainer(),i),a=r.unproject(o);t.call(this,e,f({point:o,lngLat:a,originalEvent:i},n)),this._defaultPrevented=!1,this.target=r}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(Ot),ud=function(t){function e(e,r,i){var o=V.touchPos(r.getCanvasContainer(),i),a=o.map((function(t){return r.unproject(t)})),s=o.reduce((function(t,e,r,i){return t.add(e.div(i.length))}),new n(0,0)),l=r.unproject(s);t.call(this,e,{points:o,point:s,lngLats:a,lngLat:l,originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(Ot),cd=function(t){function e(e,r,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(Ot),pd=function(t){this._map=t,this._el=t.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,v(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};pd.prototype.setZoomRate=function(t){this._defaultZoomRate=t},pd.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},pd.prototype.isEnabled=function(){return!!this._enabled},pd.prototype.isActive=function(){return!!this._active},pd.prototype.isZooming=function(){return!!this._zooming},pd.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},pd.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},pd.prototype.onWheel=function(t){if(this.isEnabled()){var e=t.deltaMode===self.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,r=O.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*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.isActive()||this._start(t)),t.preventDefault()}},pd.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},pd.prototype._start=function(t){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new Ot("movestart",{originalEvent:t})),this._map.fire(new Ot("zoomstart",{originalEvent:t}))),this._finishTimeout&&clearTimeout(this._finishTimeout);var e=V.mousePos(this._el,t);this._around=Me.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(e)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},pd.prototype._onScrollFrame=function(){var t=this;if(this._frameId=null,this.isActive()){var e=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);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*i))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o="number"==typeof this._targetZoom?this._targetZoom:e.zoom,a=this._startZoom,s=this._easing,l=!1;if("wheel"===this._type&&a&&s){var u=Math.min((O.now()-this._lastWheelEventTime)/200,1),c=s(u);e.zoom=ur(a,o,c),u<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):l=!0}else e.zoom=o,l=!0;e.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new Ot("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new Ot("zoom",{originalEvent:this._lastWheelEvent})),l&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._map.fire(new Ot("zoomend",{originalEvent:t._lastWheelEvent})),t._map.fire(new Ot("moveend",{originalEvent:t._lastWheelEvent})),delete t._targetZoom}),200))}},pd.prototype._smoothOutEasing=function(t){var e=l;if(this._prevEase){var r=this._prevEase,i=(O.now()-r.start)/r.duration,n=r.easing(i+.01)-r.easing(i),o=.27/Math.sqrt(n*n+1e-4)*.01;e=s(o,Math.sqrt(.0729-o*o),.25,1)}return this._prevEase={start:O.now(),duration:t,easing:e},e};var hd=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1,v(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};hd.prototype.isEnabled=function(){return!!this._enabled},hd.prototype.isActive=function(){return!!this._active},hd.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},hd.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},hd.prototype.onMouseDown=function(t){this.isEnabled()&&t.shiftKey&&0===t.button&&(self.document.addEventListener("mousemove",this._onMouseMove,!1),self.document.addEventListener("keydown",this._onKeyDown,!1),self.document.addEventListener("mouseup",this._onMouseUp,!1),V.disableDrag(),this._startPos=this._lastPos=V.mousePos(this._el,t),this._active=!0)},hd.prototype._onMouseMove=function(t){var e=V.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=e,this._box||(this._box=V.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(r.x,e.x),n=Math.max(r.x,e.x),o=Math.min(r.y,e.y),a=Math.max(r.y,e.y);V.setTransform(this._box,"translate("+i+"px,"+o+"px)"),this._box.style.width=n-i+"px",this._box.style.height=a-o+"px"}},hd.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=V.mousePos(this._el,t);this._finish(),V.suppressClick(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitScreenCoordinates(e,r,this._map.getBearing(),{linear:!0}).fire(new Ot("boxzoomend",{originalEvent:t}))}},hd.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},hd.prototype._finish=function(){this._active=!1,self.document.removeEventListener("mousemove",this._onMouseMove,!1),self.document.removeEventListener("keydown",this._onKeyDown,!1),self.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(V.remove(this._box),this._box=null),V.enableDrag(),delete this._startPos,delete this._lastPos},hd.prototype._fireEvent=function(t,e){return this._map.fire(new Ot(t,{originalEvent:e}))};var fd=s(0,0,.25,1),dd=function(t,e){this._map=t,this._el=e.element||t.getCanvasContainer(),this._state="disabled",this._button=e.button||"right",this._bearingSnap=e.bearingSnap||0,this._pitchWithRotate=!1!==e.pitchWithRotate,this._clickTolerance=e.clickTolerance||1,v(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};dd.prototype.isEnabled=function(){return"disabled"!==this._state},dd.prototype.isActive=function(){return"active"===this._state},dd.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},dd.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},dd.prototype.onMouseDown=function(t){if("enabled"===this._state){var e="touchstart"===t.type;if(e)this._startTime=Date.now();else if("right"===this._button){if(this._eventButton=V.mouseButton(t),t.altKey||t.metaKey)return;if(this._eventButton!==(t.ctrlKey?0:2))return}else{if(t.ctrlKey||0!==V.mouseButton(t))return;this._eventButton=0}V.disableDrag(),e?(self.document.addEventListener("touchmove",this._onMouseMove,{capture:!0}),self.document.addEventListener("touchend",this._onMouseUp)):(self.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),self.document.addEventListener("mouseup",this._onMouseUp)),self.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[O.now(),this._map.getBearing()]],this._startPos=this._prevPos=this._lastPos=V.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault()}},dd.prototype._onMouseMove=function(t){var e=V.mousePos(this._el,t);this._lastPos.equals(e)||"pending"===this._state&&e.dist(this._startPos)<this._clickTolerance||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},dd.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform,r=this._prevPos,i=this._lastPos,n=e.bearing-.8*(r.x-i.x),o=e.pitch- -.5*(r.y-i.y),a=this._inertia,s=a[a.length-1];this._drainInertiaBuffer(),a.push([O.now(),this._map._normalizeBearing(n,s[1])]);var l=e.bearing;if(e.bearing=n,this._pitchWithRotate){var u=e.pitch;e.pitch=o,e.pitch!==u&&this._fireEvent("pitch",t)}e.bearing!==l&&this._fireEvent("rotate",t),this._fireEvent("move",t),delete this._lastMoveEvent,this._prevPos=this._lastPos}},dd.prototype._onMouseUp=function(t){var e="touchend"===t.type;if(e&&this._startPos===this._lastPos&&Date.now()-this._startTime<300&&this._el.click(),e||V.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",V.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},dd.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},dd.prototype._unbind=function(){self.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),self.document.removeEventListener("mouseup",this._onMouseUp),self.document.removeEventListener("touchmove",this._onMouseMove,{capture:!0}),self.document.removeEventListener("touchend",this._onMouseUp),self.removeEventListener("blur",this._onBlur),V.enableDrag()},dd.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._lastPos},dd.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,i=r.getBearing(),n=this._inertia,o=function(){Math.abs(i)<e._bearingSnap?r.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(n.length<2)o();else{var a=n[0],s=n[n.length-1],l=r._normalizeBearing(i,n[n.length-2][1]),u=s[1]-a[1],c=u<0?-1:1,p=(s[0]-a[0])/1e3;if(0!==u&&0!==p){var h=Math.abs(u*(.25/p));h>180&&(h=180);var f=h/180;l+=c*h*(f/2),Math.abs(r._normalizeBearing(l,0))<this._bearingSnap&&(l=r._normalizeBearing(0,l)),r.rotateTo(l,{duration:1e3*f,easing:fd,noMoveStart:!0},{originalEvent:t})}else o()}},dd.prototype._fireEvent=function(t,e){return this._map.fire(new Ot(t,e?{originalEvent:e}:{}))},dd.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=O.now();t.length>0&&e-t[0][0]>160;)t.shift()};var md={linearity:.3,easing:s(0,0,.3,1),maxSpeed:1400,deceleration:2500},yd=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._state="disabled",this._clickTolerance=e.clickTolerance||1,this._inertiaOptions=md,v(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};yd.prototype.isEnabled=function(){return"disabled"!==this._state},yd.prototype.isActive=function(){return"active"===this._state},yd.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled",this._inertiaOptions=f(md,t))},yd.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},yd.prototype.onMouseDown=function(t){"enabled"===this._state&&(t.ctrlKey||0!==V.mouseButton(t)||(V.addEventListener(self.document,"mousemove",this._onMove,{capture:!0}),V.addEventListener(self.document,"mouseup",this._onMouseUp),this._start(t)))},yd.prototype.onTouchStart=function(t){this.isEnabled()&&(t.touches&&t.touches.length>1&&("pending"===this._state||"active"===this._state)||(V.addEventListener(self.document,"touchmove",this._onMove,{capture:!0,passive:!1}),V.addEventListener(self.document,"touchend",this._onTouchEnd),this._start(t)))},yd.prototype._start=function(t){self.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=V.mousePos(this._el,t),this._startTouch=this._lastTouch=self.TouchEvent&&t instanceof self.TouchEvent?V.touchPos(this._el,t):null,this._inertia=[[O.now(),this._startPos]]},yd.prototype._touchesMatch=function(t,e){return!(!t||!e||t.length!==e.length)&&t.every((function(t,r){return e[r]===t}))},yd.prototype._onMove=function(t){t.preventDefault();var e=self.TouchEvent&&t instanceof self.TouchEvent?V.touchPos(this._el,t):null,r=V.mousePos(this._el,t);(e?this._touchesMatch(this._lastTouch,e):this._lastPos.equals(r))||"pending"===this._state&&r.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=t,this._lastPos=r,this._lastTouch=e,this._drainInertiaBuffer(),this._inertia.push([O.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._shouldStart=!0),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},yd.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t)if(this._map.touchZoomRotate.isActive())this._abort(t);else if(this._shouldStart&&(this._fireEvent("dragstart",t),this._fireEvent("movestart",t),this._shouldStart=!1),this.isActive()){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._prevPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._prevPos=this._lastPos,delete this._lastMoveEvent}},yd.prototype._onMouseUp=function(t){if(0===V.mouseButton(t))switch(this._state){case"active":this._state="enabled",V.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},yd.prototype._onTouchEnd=function(t){if(t.touches&&0!==t.touches.length)switch(this._state){case"pending":case"active":break;case"enabled":this.onTouchStart(t)}else switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind()}},yd.prototype._abort=function(t){switch(this._state){case"active":this._state="enabled",this._shouldStart||(this._fireEvent("dragend",t),this._fireEvent("moveend",t)),this._unbind(),this._deactivate(),self.TouchEvent&&t instanceof self.TouchEvent&&t.touches.length>1&&V.addEventListener(self.document,"touchend",this._onTouchEnd);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind()}},yd.prototype._onBlur=function(t){this._abort(t)},yd.prototype._unbind=function(){V.removeEventListener(self.document,"touchmove",this._onMove,{capture:!0,passive:!1}),V.removeEventListener(self.document,"touchend",this._onTouchEnd),V.removeEventListener(self.document,"mousemove",this._onMove,{capture:!0}),V.removeEventListener(self.document,"mouseup",this._onMouseUp),V.removeEventListener(self,"blur",this._onBlur)},yd.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._mouseDownPos,delete this._lastPos,delete this._startTouch,delete this._lastTouch,delete this._shouldStart},yd.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var r=e[e.length-1],i=e[0],n=r[1].sub(i[1]),o=(r[0]-i[0])/1e3;if(0===o||r[1].equals(i[1]))this._fireEvent("moveend",t);else{var a=this._inertiaOptions,s=a.linearity,l=a.easing,u=a.maxSpeed,c=a.deceleration,p=n.mult(s/o),h=p.mag();h>u&&(h=u,p._unit()._mult(h));var f=h/(c*s),d=p.mult(-f/2);this._map.panBy(d,{duration:1e3*f,easing:l,noMoveStart:!0},{originalEvent:t})}}},yd.prototype._fireEvent=function(t,e){return this._map.fire(new Ot(t,e?{originalEvent:e}:{}))},yd.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=O.now();t.length>0&&e-t[0][0]>160;)t.shift()};var _d=function(t){this._map=t,this._el=t.getCanvasContainer(),v(["_onKeyDown"],this)};function gd(t){return t*(2-t)}_d.prototype.isEnabled=function(){return!!this._enabled},_d.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},_d.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_d.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,i=0,n=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),n=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),n=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(o=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),l={duration:300,delayEndEvents:500,easing:gd,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*r,pitch:a.getPitch()+10*i,offset:[100*-n,100*-o],center:a.getCenter()};a.easeTo(l,{originalEvent:t})}};var vd=function(t){this._map=t,v(["_onDblClick","_onZoomEnd"],this)};vd.prototype.isEnabled=function(){return!!this._enabled},vd.prototype.isActive=function(){return!!this._active},vd.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},vd.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},vd.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var r=this._tappedPoint;if(r&&r.dist(t.points[0])<=30){t.originalEvent.preventDefault();var i=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",n),e._resetTapped()},n=function(){e._map.off("touchend",i),e._resetTapped()};this._map.once("touchend",i),this._map.once("touchcancel",n)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout((function(){e._tapped=null,e._tappedPoint=null}),300)},vd.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},vd.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},vd.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},vd.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var xd=s(0,0,.15,1),bd=function(t){this._map=t,this._el=t.getCanvasContainer(),v(["_onMove","_onEnd","_onTouchFrame"],this)};bd.prototype.isEnabled=function(){return!!this._enabled},bd.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},bd.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},bd.prototype.disableRotation=function(){this._rotationDisabled=!0},bd.prototype.enableRotation=function(){this._rotationDisabled=!1},bd.prototype.isActive=function(){return this.isEnabled()&&!!this._gestureIntent},bd.prototype.onStart=function(t){if(this.isEnabled()&&2===t.touches.length){var e=V.mousePos(this._el,t.touches[0]),r=V.mousePos(this._el,t.touches[1]),i=e.add(r).div(2);this._startVec=e.sub(r),this._startAround=this._map.transform.pointLocation(i),this._gestureIntent=void 0,this._inertia=[],V.addEventListener(self.document,"touchmove",this._onMove,{passive:!1}),V.addEventListener(self.document,"touchend",this._onEnd)}},bd.prototype._getTouchEventData=function(t){var e=V.mousePos(this._el,t.touches[0]),r=V.mousePos(this._el,t.touches[1]),i=e.sub(r);return{vec:i,center:e.add(r).div(2),scale:i.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*i.angleWith(this._startVec)/Math.PI}},bd.prototype._onMove=function(t){if(2===t.touches.length){var e=this._getTouchEventData(t),r=e.vec,i=e.scale,n=e.bearing;if(!this._gestureIntent){var o=this._rotationDisabled&&1!==i||Math.abs(1-i)>.15;Math.abs(n)>10?this._gestureIntent="rotate":o&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new Ot(this._gestureIntent+"start",{originalEvent:t})),this._map.fire(new Ot("movestart",{originalEvent:t})),this._startVec=r)}this._lastTouchEvent=t,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),t.preventDefault()}},bd.prototype._onTouchFrame=function(){this._frameId=null;var t=this._gestureIntent;if(t){var e=this._map.transform;this._startScale||(this._startScale=e.scale,this._startBearing=e.bearing);var r=this._getTouchEventData(this._lastTouchEvent),i=r.center,n=r.bearing,o=r.scale,a=e.pointLocation(i),s=e.locationPoint(a);"rotate"===t&&(e.bearing=this._startBearing+n),e.zoom=e.scaleZoom(this._startScale*o),e.setLocationAtPoint(this._startAround,s),this._map.fire(new Ot(t,{originalEvent:this._lastTouchEvent})),this._map.fire(new Ot("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([O.now(),o,i])}},bd.prototype._onEnd=function(t){V.removeEventListener(self.document,"touchmove",this._onMove,{passive:!1}),V.removeEventListener(self.document,"touchend",this._onEnd);var e=this._gestureIntent,r=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,e){this._map.fire(new Ot(e+"end",{originalEvent:t})),this._drainInertiaBuffer();var i=this._inertia,n=this._map;if(i.length<2)n.snapToNorth({},{originalEvent:t});else{var o=i[i.length-1],a=i[0],s=n.transform.scaleZoom(r*o[1]),l=n.transform.scaleZoom(r*a[1]),u=(o[0]-a[0])/1e3,c=o[2];if(0!==u&&s!==l){var p=.15*(s-l)/u;Math.abs(p)>2.5&&(p=p>0?2.5:-2.5);var h=1e3*Math.abs(p/(12*.15));n.easeTo({zoom:s+p*h/2e3,duration:h,easing:xd,around:this._aroundCenter?n.getCenter():n.unproject(c),noMoveStart:!0},{originalEvent:t})}else n.snapToNorth({},{originalEvent:t})}}},bd.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=O.now();t.length>2&&e-t[0][0]>160;)t.shift()};var wd={scrollZoom:pd,boxZoom:hd,dragRotate:dd,dragPan:yd,keyboard:_d,doubleClickZoom:vd,touchZoomRotate:bd},Sd=function(t){function e(e,r){t.call(this),this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=r.bearingSnap,v(["_renderFrameCallback"],this)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCenter=function(){return new Me(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,r){return t=n.convert(t).mult(-1),this.panTo(this.transform.center,f({offset:t},e),r)},e.prototype.panTo=function(t,e,r){return this.easeTo(f({center:t},e),r)},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,r){return this.easeTo(f({zoom:t},e),r)},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,r){return this.easeTo(f({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,f({duration:1e3},t),e),this},e.prototype.resetNorthPitch=function(t,e){return this.easeTo(f({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){return t=Pe.convert(t),this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),0,e)},e.prototype._cameraForBoxAndBearing=function(t,e,r,i){var o={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=f({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var a=i.padding;i.padding={top:a,bottom:a,right:a,left:a}}i.padding=f(o,i.padding);var s=this.transform,l=s.padding,u=s.project(Me.convert(t)),c=s.project(Me.convert(e)),p=u.rotate(-r*Math.PI/180),h=c.rotate(-r*Math.PI/180),d=new n(Math.max(p.x,h.x),Math.max(p.y,h.y)),m=new n(Math.min(p.x,h.x),Math.min(p.y,h.y)),y=d.sub(m),_=(s.width-(l.left+l.right+i.padding.left+i.padding.right))/y.x,g=(s.height-(l.top+l.bottom+i.padding.top+i.padding.bottom))/y.y;if(!(g<0||_<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(_,g)),i.maxZoom),x=n.convert(i.offset),b=new n(x.x+(i.padding.left-i.padding.right)/2,x.y+(i.padding.top-i.padding.bottom)/2).mult(s.scale/s.zoomScale(v));return{center:s.unproject(u.add(c).div(2).sub(b)),zoom:v,bearing:r}}I("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},e.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},e.prototype.fitScreenCoordinates=function(t,e,r,i,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(n.convert(t)),this.transform.pointLocation(n.convert(e)),r,i),i,o)},e.prototype._fitInternal=function(t,e,r){return t?(e=f(t,e)).linear?this.easeTo(e,r):this.flyTo(e,r):this},e.prototype.jumpTo=function(t,e){this.stop();var r=this.transform,i=!1,n=!1,o=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(i=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=Me.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(n=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.pitch=+t.pitch),null==t.padding||r.isPaddingEqual(t.padding)||(r.padding=t.padding),this.fire(new Ot("movestart",e)).fire(new Ot("move",e)),i&&this.fire(new Ot("zoomstart",e)).fire(new Ot("zoom",e)).fire(new Ot("zoomend",e)),n&&this.fire(new Ot("rotatestart",e)).fire(new Ot("rotate",e)).fire(new Ot("rotateend",e)),o&&this.fire(new Ot("pitchstart",e)).fire(new Ot("pitch",e)).fire(new Ot("pitchend",e)),this.fire(new Ot("moveend",e))},e.prototype.easeTo=function(t,e){var r=this;this.stop(),(!1===(t=f({offset:[0,0],duration:500,easing:l},t)).animate||!t.essential&&O.prefersReducedMotion)&&(t.duration=0);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u=this.getPadding(),c="zoom"in t?+t.zoom:o,p="bearing"in t?this._normalizeBearing(t.bearing,a):a,h="pitch"in t?+t.pitch:s,d="padding"in t?t.padding:i.padding,m=n.convert(t.offset),y=i.centerPoint.add(m),_=i.pointLocation(y),g=Me.convert(t.center||_);this._normalizeCenter(g);var v,x,b=i.project(_),w=i.project(g).sub(b),S=i.zoomScale(c-o);return t.around&&(v=Me.convert(t.around),x=i.locationPoint(v)),this._zooming=c!==o,this._rotating=a!==p,this._pitching=h!==s,this._padding=!i.isPaddingEqual(d),this._prepareEase(e,t.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(t){if(r._zooming&&(i.zoom=ur(o,c,t)),r._rotating&&(i.bearing=ur(a,p,t)),r._pitching&&(i.pitch=ur(s,h,t)),r._padding&&(i.interpolatePadding(u,d,t),y=i.centerPoint.add(m)),v)i.setLocationAtPoint(v,x);else{var n=i.zoomScale(i.zoom-o),l=c>o?Math.min(2,S):Math.max(.5,S),f=Math.pow(l,1-t),_=i.unproject(b.add(w.mult(t*f)).mult(n));i.setLocationAtPoint(i.renderWorldCopies?_.wrap():_,y)}r._fireMoveEvents(e)}),(function(){t.delayEndEvents?r._easeEndTimeoutID=setTimeout((function(){return r._afterEase(e)}),t.delayEndEvents):r._afterEase(e)}),t),this},e.prototype._prepareEase=function(t,e){this._moving=!0,e||this.fire(new Ot("movestart",t)),this._zooming&&this.fire(new Ot("zoomstart",t)),this._rotating&&this.fire(new Ot("rotatestart",t)),this._pitching&&this.fire(new Ot("pitchstart",t))},e.prototype._fireMoveEvents=function(t){this.fire(new Ot("move",t)),this._zooming&&this.fire(new Ot("zoom",t)),this._rotating&&this.fire(new Ot("rotate",t)),this._pitching&&this.fire(new Ot("pitch",t))},e.prototype._afterEase=function(t){var e=this._zooming,r=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,e&&this.fire(new Ot("zoomend",t)),r&&this.fire(new Ot("rotateend",t)),i&&this.fire(new Ot("pitchend",t)),this.fire(new Ot("moveend",t))},e.prototype.flyTo=function(t,e){var r=this;if(!t.essential&&O.prefersReducedMotion){var i=d(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,e)}this.stop(),t=f({offset:[0,0],speed:1.2,curve:1.42,easing:l},t);var o=this.transform,a=this.getZoom(),s=this.getBearing(),c=this.getPitch(),p=this.getPadding(),h="zoom"in t?u(+t.zoom,o.minZoom,o.maxZoom):a,m="bearing"in t?this._normalizeBearing(t.bearing,s):s,y="pitch"in t?+t.pitch:c,_="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);t.center&&t.center.length>=2&&(0==t.center[0]&&(t.center[0]=1e-6),0==t.center[1]&&(t.center[1]=1e-6));var w=Me.convert(t.center||b);this._normalizeCenter(w);var S=o.project(b),T=o.project(w).sub(S),I=t.curve,E=Math.max(o.width,o.height),A=E/g,k=T.mag();if("minZoom"in t){var z=u(Math.min(t.minZoom,a,h),o.minZoom,o.maxZoom),C=E/o.zoomScale(z-a);I=Math.sqrt(C/k*2)}var P=I*I;function M(t){var e=(A*A-E*E+(t?-1:1)*P*P*k*k)/(2*(t?A:E)*P*k);return Math.log(Math.sqrt(e*e+1)-e)}function D(t){return(Math.exp(t)-Math.exp(-t))/2}function L(t){return(Math.exp(t)+Math.exp(-t))/2}var R=M(0),B=function(t){return L(R)/L(R+I*t)},F=function(t){return E*((L(R)*(D(e=R+I*t)/L(e))-D(R))/P)/k;var e},V=(M(1)-R)/I;if(Math.abs(k)<1e-6||!isFinite(V)){if(Math.abs(E-A)<1e-6)return this.easeTo(t,e);var U=A<E?-1:1;V=Math.abs(Math.log(A/E))/I,F=function(){return 0},B=function(t){return Math.exp(U*I*t)}}return t.duration="duration"in t?+t.duration:1e3*V/("screenSpeed"in t?+t.screenSpeed/I:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==m,this._pitching=y!==c,this._padding=!o.isPaddingEqual(_),this._prepareEase(e,!1),this._ease((function(t){var i=t*V,n=1/B(i);o.zoom=1===t?h:a+o.scaleZoom(n),r._rotating&&(o.bearing=ur(s,m,t)),r._pitching&&(o.pitch=ur(c,y,t)),r._padding&&(o.interpolatePadding(p,_,t),x=o.centerPoint.add(v));var l=1===t?w:o.unproject(S.add(T.mult(F(i))).mult(n));o.setLocationAtPoint(o.renderWorldCopies?l.wrap():l,x),r._fireMoveEvents(e)}),(function(){return r._afterEase(e)}),t),this},e.prototype.isEasing=function(){return!!this._easeFrameId},e.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},e.prototype._ease=function(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=O.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},e.prototype._renderFrameCallback=function(){var t=Math.min((O.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=c(t,-180,180);var r=Math.abs(t-e);return Math.abs(t-360-e)<r&&(t-=360),Math.abs(t+360-e)<r&&(t+=360),t},e.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},e}(Ut),Td=function(t){void 0===t&&(t={}),this.options=t,v(["_updateEditLink","_updateData","_updateCompact"],this)};Td.prototype.getDefaultPosition=function(){return"bottom-right"},Td.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=V.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=V.create("div","mapboxgl-ctrl-attrib-inner",this._container),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},Td.prototype.onRemove=function(){V.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},Td.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||Y.ACCESS_TOKEN}];if(t){var r=e.reduce((function(t,r,i){return r.value&&(t+=r.key+"="+r.value+(i<e.length-1?"&":"")),t}),"?");t.href=Y.FEEDBACK_URL+"/"+r+(this._map._hash?this._map._hash.getHashString(!0):""),t.rel="noopener nofollow"}},Td.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Td.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 r=this._map.style.sourceCaches;for(var i in r){var n=r[i];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,r){for(var i=r+1;i<t.length;i++)if(t[i].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)}},Td.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Id=function(){v(["_updateLogo"],this),v(["_updateCompact"],this)};Id.prototype.onAdd=function(t){this._map=t,this._container=V.create("div","mapboxgl-ctrl");var e=V.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},Id.prototype.onRemove=function(){V.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Id.prototype.getDefaultPosition=function(){return"bottom-left"},Id.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Id.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}},Id.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 Ed=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ed.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Ed.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,i=e?this._queue.concat(e):this._queue;r<i.length;r+=1){var n=i[r];if(n.id===t)return void(n.cancelled=!0)}},Ed.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,r=t;e<r.length;e+=1){var i=r[e];if(!i.cancelled&&(i.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Ed.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Ad={"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"},kd=self.HTMLImageElement,zd=self.HTMLElement,Cd=self.ImageBitmap,Pd={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,bearingSnap:7,clickTolerance:3,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},Md=function(t){function r(e){var r=this;if(null!=(e=f({},Pd,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 i=new od(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(t.call(this,i,e),this.crs=this.initCRS(e.crs),this.setCRS(this.crs),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 Ed,this._controls=[],this._mapId=y(),this._locale=f({},Ad,e.locale),this._requestManager=new rt(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=self.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof zd))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),v(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),"undefined"!=typeof self&&(self.addEventListener("online",this._onWindowOnline,!1),self.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),i=null,n=!1,o=null;for(var a in wd)t[a]=new wd[a](t,e),e.interactive&&e[a]&&t[a].enable(e[a]);V.addEventListener(r,"mouseout",(function(e){t.fire(new ld("mouseout",t,e))})),V.addEventListener(r,"mousedown",(function(i){n=!0,o=V.mousePos(r,i);var a=new ld("mousedown",t,i);t.fire(a),a.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(i),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(i),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(i))})),V.addEventListener(r,"mouseup",(function(e){var r=t.dragRotate.isActive();i&&!r&&t.fire(new ld("contextmenu",t,i)),i=null,n=!1,t.fire(new ld("mouseup",t,e))})),V.addEventListener(r,"mousemove",(function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new ld("mousemove",t,e))}})),V.addEventListener(r,"mouseover",(function(e){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new ld("mouseover",t,e))})),V.addEventListener(r,"touchstart",(function(r){var i=new ud("touchstart",t,r);t.fire(i),i.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r),t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(i))}),{passive:!1}),V.addEventListener(r,"touchmove",(function(e){t.fire(new ud("touchmove",t,e))}),{passive:!1}),V.addEventListener(r,"touchend",(function(e){t.fire(new ud("touchend",t,e))})),V.addEventListener(r,"touchcancel",(function(e){t.fire(new ud("touchcancel",t,e))})),V.addEventListener(r,"click",(function(i){var n=V.mousePos(r,i);(!o||n.equals(o)||n.dist(o)<e.clickTolerance)&&t.fire(new ld("click",t,i))})),V.addEventListener(r,"dblclick",(function(e){var r=new ld("dblclick",t,e);t.fire(r),r.defaultPrevented||t.doubleClickZoom.onDblClick(r)})),V.addEventListener(r,"contextmenu",(function(e){var r=t.dragRotate.isActive();n||r?n&&(i=e):t.fire(new ld("contextmenu",t,e)),(t.dragRotate.isEnabled()||t.listens("contextmenu"))&&e.preventDefault()})),V.addEventListener(r,"wheel",(function(r){e.interactive&&t.stop();var i=new cd("wheel",t,r);t.fire(i),i.defaultPrevented||t.scrollZoom.onWheel(r)}),{passive:!1})}(this,e),this._hash=e.hash&&new sd("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,f({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Td({customAttribution:e.customAttribution})),this.addControl(new Id,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new Ot(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new Ot(t.dataType+"dataloading",t))})),this.overlayLayersManager={}}t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.prototype)).constructor=r;var i={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return r.prototype._getMapId=function(){return this._mapId},r.prototype.addControl=function(t,e){if(void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right"),!t||!t.onAdd)return this.fire(new Vt(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var r=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[e];return-1!==e.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this},r.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new Vt(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},r.prototype.resize=function(t){var e=this._containerDimensions(),r=e[0],i=e[1];return this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i),this.fire(new Ot("movestart",t)).fire(new Ot("move",t)).fire(new Ot("resize",t)).fire(new Ot("moveend",t)),this},r.prototype.getBounds=function(){return this.transform.getBounds()},r.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},r.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(Pe.convert(t)),this._update()},r.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")},r.prototype.getMinZoom=function(){return this.transform.minZoom},r.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")},r.prototype.getMaxZoom=function(){return this.transform.maxZoom},r.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")},r.prototype.getMinPitch=function(){return this.transform.minPitch},r.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")},r.prototype.getMaxPitch=function(){return this.transform.maxPitch},r.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},r.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},r.prototype.project=function(t){return this.transform.locationPoint(Me.convert(t))},r.prototype.unproject=function(t){return this.transform.pointLocation(n.convert(t))},r.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},r.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},r.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},r.prototype._createDelegatedListener=function(t,e,r){var i,n=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){var a=n.getLayer(e)?n.queryRenderedFeatures(i.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(n,new ld(t,n,i.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){(n.getLayer(e)?n.queryRenderedFeatures(i.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(n,new ld(t,n,i.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(n,new ld(t,n,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(i={},i[t]=function(t){var i=n.getLayer(e)?n.queryRenderedFeatures(t.point,{layers:[e]}):[];i.length&&(t.features=i,r.call(n,t),delete t.features)},i)}},r.prototype.on=function(e,r,i){if(void 0===i)return t.prototype.on.call(this,e,r);var n=this._createDelegatedListener(e,r,i);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},r.prototype.once=function(e,r,i){if(void 0===i)return t.prototype.once.call(this,e,r);var n=this._createDelegatedListener(e,r,i);for(var o in n.delegates)this.once(o,n.delegates[o]);return this},r.prototype.off=function(e,r,i){var n=this;return void 0===i?t.prototype.off.call(this,e,r):(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===r&&s.listener===i){for(var l in s.delegates)n.off(l,s.delegates[l]);return o.splice(a,1),n}}}(this._delegatedListeners),this)},r.prototype.queryRenderedFeatures=function(t,e){if(!this.style)return[];var r;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])r=[n.convert(t)];else{var i=n.convert(t[0]),o=n.convert(t[1]);r=[i,new n(o.x,i.y),o,new n(i.x,o.y),i]}return this.style.queryRenderedFeatures(r,e,this.transform)},r.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},r.prototype.setStyle=function(t,e){return!1!==(e=f({},{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))},r.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},r.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Eh(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)},r.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Eh(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},r.prototype._diffStyle=function(t,e){var r=this;if("string"==typeof t){var i=this._requestManager.normalizeStyleURL(t),n=this._requestManager.transformRequest(i,Et.Style);Mt(n,(function(t,i){t?r.fire(new Vt(t)):i&&r._updateDiff(i,e)}))}else"object"==typeof t&&this._updateDiff(t,e)},r.prototype._updateDiff=function(t,e){try{this.style.setState(t)&&this._update(!0)}catch(r){I("Unable to perform style diff: "+(r.message||r.error||r)+". Rebuilding the style from scratch."),this._updateStyle(t,e)}},r.prototype.getStyle=function(){if(this.style)return this.style.serialize()},r.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():I("There is no style added to the map.")},r.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},r.prototype.isSourceLoaded=function(t){var e=this.style&&this.style.sourceCaches[t];if(void 0!==e)return e.loaded();this.fire(new Vt(new Error("There is no source with ID '"+t+"'")))},r.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var i in r){var n=r[i];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0},r.prototype.addSourceType=function(t,e,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,r)},r.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},r.prototype.getSource=function(t){return this.style.getSource(t)},r.prototype.addImage=function(t,e,r){void 0===r&&(r={});var i=r.pixelRatio;void 0===i&&(i=1);var n=r.sdf;void 0===n&&(n=!1);var o=r.stretchX,a=r.stretchY,s=r.content;if(this._lazyInitEmptyStyle(),e instanceof kd||Cd&&e instanceof Cd){var l=O.getImageData(e);this.style.addImage(t,{data:new Wa({width:l.width,height:l.height},l.data),pixelRatio:i,stretchX:o,stretchY:a,content:s,sdf:n,version:0})}else{if(void 0===e.width||void 0===e.height)return this.fire(new Vt(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 u=e;this.style.addImage(t,{data:new Wa({width:e.width,height:e.height},new Uint8Array(e.data)),pixelRatio:i,stretchX:o,stretchY:a,content:s,sdf:n,version:0,userImage:u}),u.onAdd&&u.onAdd(this,t)}},r.prototype.updateImage=function(t,e){var r=this.style.getImage(t);if(!r)return this.fire(new Vt(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=e instanceof kd||Cd&&e instanceof Cd?O.getImageData(e):e,n=i.width,o=i.height,a=i.data;return void 0===n||void 0===o?this.fire(new Vt(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!==r.data.width||o!==r.data.height?this.fire(new Vt(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(r.data.replace(a,!(e instanceof kd||Cd&&e instanceof Cd)),void this.style.updateImage(t,r))},r.prototype.hasImage=function(t){return t?!!this.style.getImage(t):(this.fire(new Vt(new Error("Missing required image id"))),!1)},r.prototype.removeImage=function(t){this.style.removeImage(t)},r.prototype.loadImage=function(t,e){Rt(this._requestManager.transformRequest(t,Et.Image),e)},r.prototype.listImages=function(){return this.style.listImages()},r.prototype.addLayerBak=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},r.prototype._addLayer=function(t,e){t.onAdd&&t.onAdd(e)},r.prototype._removeLayer=function(t){t.removeFromMap&&t.removeFromMap()},r.prototype._setVisibility=function(t,e){t.setVisibility&&t.setVisibility(e)},r.prototype._moveLayer=function(t,e){var r=document.getElementById(t);if(e){var i=document.getElementById(e);i||self.mapboxgl.Evented.prototype.fire("error",{error:new Error('Layer with id "'+e+'" does not exist on this document.')})}r&&i?i.parentNode.insertBefore(r,i):r.parentNode.appendChild(r)},r.prototype.addLayer=function(t,e){return t.source||"custom"===t.type||"background"===t.type?(this.addLayerBak(t,e),this):this.overlayLayersManager[t.id]||this.style._layers[t.id]?void this.fire("error",{error:new Error("A layer with this id already exists.")}):(this._addLayer(t,this),this.overlayLayersManager[t.id]=t,this)},r.prototype.moveLayer=function(t,e){return this.overlayLayersManager[t]?(this._moveLayer(t,e),this):this.style._layers[t]?(this.style.moveLayer(t,e),this._update(!0),this):void 0},r.prototype.removeLayer=function(t){return this.overlayLayersManager[t]?(this._removeLayer(this.overlayLayersManager[t]),delete this.overlayLayersManager[t],this):(this.style.removeLayer(t),this._update(!0),this)},r.prototype.getLayer=function(t){return this.overlayLayersManager[t]?this.overlayLayersManager[t]:this.style.getLayer(t)},r.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},r.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},r.prototype.getFilter=function(t){return this.style.getFilter(t)},r.prototype.setPaintProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setPaintProperty(t,e,r,i),this._update(!0)},r.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},r.prototype.setLayoutProperty=function(t,e,r,i){return void 0===i&&(i={}),this.overlayLayersManager[t]?("visibility"===e&&(this._setVisibility(this.overlayLayersManager[t],r="visible"===r),this.style.fire("data",{dataType:"style"})),this):(this.style.setLayoutProperty(t,e,r,i),this._update(!0),this)},r.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},r.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},r.prototype.getLight=function(){return this.style.getLight()},r.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},r.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},r.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},r.prototype.getContainer=function(){return this._container},r.prototype.getCanvasContainer=function(){return this._canvasContainer},r.prototype.getCanvas=function(){return this._canvas},r.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},r.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==self.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&I("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/.")},r.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=V.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=V.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=V.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");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var i=this._controlContainer=V.create("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){n[t]=V.create("div","mapboxgl-ctrl-"+t,i)}))},r.prototype._resizeCanvas=function(t,e){var r=O.devicePixelRatio||1;this._canvas.width=r*t,this._canvas.height=r*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},r.prototype._setupPainter=function(){var t=f({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);r?(this.painter=new ed(r,this.transform),J.testSupport(r)):this.fire(new Vt(new Error("Failed to initialize WebGL")))},r.prototype._contextLost=function(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new Ot("webglcontextlost",{originalEvent:t}))},r.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire(new Ot("webglcontextrestored",{originalEvent:t}))},r.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},r.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},r.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},r.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},r.prototype._render=function(){var t,e=this,r=0,i=this.painter.context.extTimerQuery;this.listens("gpu-timing-frame")&&(t=i.createQueryEXT(),i.beginQueryEXT(i.TIME_ELAPSED_EXT,t),r=O.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var o=this.transform.zoom,a=O.now();this.style.zoomHistory.update(o,a);var s=new Pn(o,{now:a,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),l=s.crossFadingFactor();1===l&&l===this._crossFadingFactor||(n=!0,this._crossFadingFactor=l),this.style.update(s)}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 Ot("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new Ot("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var u=O.now()-r;i.endQueryEXT(i.TIME_ELAPSED_EXT,t),setTimeout((function(){var r=i.getQueryObjectEXT(t,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(t),e.fire(new Ot("gpu-timing-frame",{cpuTime:u,gpuTime:r}))}),50)}if(this.listens("gpu-timing-layer")){var c=this.painter.collectGpuTimers();setTimeout((function(){var t=e.painter.queryGpuTimers(c);e.fire(new Ot("gpu-timing-layer",{layerTimes:t}))}),50)}return this._sourcesDirty||this._styleDirty||this._placementDirty||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&(this._fullyLoaded||(this._fullyLoaded=!0),this.fire(new Ot("idle"))),this},r.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.setStyle(null),"undefined"!=typeof self&&(self.removeEventListener("resize",this._onWindowResize,!1),self.removeEventListener("online",this._onWindowOnline,!1));var r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),Dd(this._canvasContainer),Dd(this._controlContainer),Dd(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new Ot("remove"))},r.prototype.triggerRepaint=function(){var t=this;this.style&&!this._frame&&(this._frame=O.frame((function(e){t._frame=null,t._render()})))},r.prototype._onWindowOnline=function(){this._update()},r.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},i.showTileBoundaries.get=function(){return!!this._showTileBoundaries},i.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},i.showPadding.get=function(){return!!this._showPadding},i.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},i.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},i.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},i.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},i.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},i.repaint.get=function(){return!!this._repaint},i.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},i.vertices.get=function(){return!!this._vertices},i.vertices.set=function(t){this._vertices=t,this._update()},r.prototype._setCacheLimits=function(t,e){!function(t,e){gt=t,vt=e}(t,e)},r.prototype.initCRS=function(t){if(t&&"string"==typeof t&&!(t=Wu.get(t)))throw new Error("crs "+t+" is not define");return t||Wu.EPSG3857},r.prototype.getCRS=function(){return this.crs},r.prototype.setCRS=function(t){if(t!==Wu.EPSG3857){this._tileExtent=[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892],this._mapCRS=t;var e=t.getExtent();if(e&&Array.isArray(e)&&4===e.length){this._tileExtent=e;var r=this._tileExtent[2]-this._tileExtent[0],i=this._tileExtent[3]-this._tileExtent[1],n=(this._tileExtent[2]+this._tileExtent[0])/2,o=(this._tileExtent[3]+this._tileExtent[1])/2,a=this._tileExtent[0],s=this._tileExtent[3];ec.prototype.getMeterPerMapUnit=function(t){return"degree"===t||"degrees"===t||"d"===t?2*Math.PI*6378137/360:"kilometer"===t||"km"===t?.001:"inch"===t?1/.025399999918:.3048},ec.prototype.getResolution=function(t,e){if(!this._resolutions[t]){var i=Math.pow(2,t);this._resolutions[t]=r/i/e}return this._resolutions[t]},ec.prototype.getScale=function(e,r){if(!this._scales[e]){var i=96*this.getResolution(e,r)*(1/.0254)*this.getMeterPerMapUnit(t.getUnit());this._scales[e]=1/i}return this._scales[e]},tc.prototype.getMeterPerMapUnit=function(t){return"degree"===t||"degrees"===t||"d"===t?2*Math.PI*6378137/360:"kilometer"===t||"km"===t?.001:"inch"===t?1/.025399999918:.3048},tc.prototype.getResolution=function(t,e){if(!this._resolutions[t]){var i=Math.pow(2,t);this._resolutions[t]=r/i/e}return this._resolutions[t]},tc.prototype.getScale=function(e,r){if(!this._scales[e]){var i=96*this.getResolution(e,r)*(1/.0254)*this.getMeterPerMapUnit(t.getUnit());this._scales[e]=1/i}return this._scales[e]},lc.prototype.getMeterPerMapUnit=function(t){return"degree"===t||"degrees"===t||"d"===t?2*Math.PI*6378137/360:"kilometer"===t||"km"===t?.001:"inch"===t?1/.025399999918:.3048},lc.prototype.getResolution=function(t,e){if(!this._resolutions[t]){var i=Math.pow(2,t);this._resolutions[t]=r/i/e}return this._resolutions[t]},lc.prototype.getScale=function(e,r){if(!this._scales[e]){var i=96*this.getResolution(e,r)*(1/.0254)*this.getMeterPerMapUnit(t.getUnit());this._scales[e]=1/i}return this._scales[e]},lc.prototype.getCrs=function(t,e){return"EPSG:4326"},Hu.prototype.getTileBBox=function(){var t=Math.max(r,i)/Math.pow(2,this.z);return t*this.x+e[0]+","+(e[3]-t*(this.y+1))+","+(t*(this.x+1)+e[0])+","+(e[3]-t*this.y)},Hu.prototype.getViewBounds=function(){var t=Math.pow(2,this.z);return'{"leftBottom":{"x":'+(e[0]+r*this.x/t)+',"y":'+(e[3]-i*(this.y+1)/t)+'},"rightTop":{"x":'+(e[0]+r*(this.x+1)/t)+',"y": '+(e[3]-i*this.y/t)+"}}"},Hu.prototype.getCRS=function(){return Wu.EPSG4326},od.prototype.lngX=function(t){return(t-a)*this.worldSize/r},od.prototype.latY=function(t){return(s-t)*this.worldSize/i},od.prototype.xLng=function(t){return t*r/this.worldSize+a},od.prototype.yLat=function(t){return s-t*i/this.worldSize},$u.prototype.contains=function(t){var e=Math.pow(2,t.z),n=Math.floor((this.bounds.getWest()-a)*e/r),o=Math.floor((s-this.bounds.getNorth())*e/i),l=Math.ceil((this.bounds.getEast()-a)*e/r),u=Math.ceil((s-this.bounds.getSouth())*e/i);return t.x>=n&&t.x<l&&t.y>=o&&t.y<u},gc.prototype.yLat=function(t,e){return s-t*i/e},gc.prototype.latY=function(t){return(s-t)*this.worldSize/i},this.updateTransform&&(this.mercatorZfromAltitude=Fe,this.updateTransform(t.getUnit(),a,s,n,o,r,i))}}},r.prototype.updateTransform=function(t,e,r,i,n,o,a){this.transform.units=t,this.transform.latRange=[this._tileExtent[1],this._tileExtent[3]],this.transform.lngRange=[this._tileExtent[0],this._tileExtent[2]];var s=this.mercatorZfromAltitude;Ve.fromLngLat=function(t,i){i=i||0;var n=Me.convert(t);return n.lng&&n.lat?new Ve((n.lng-e)/o,(r-n.lat)/a,s(i,n.lat)):new Ve(Re(0),Be(0),0)},Ve.prototype.toLngLat=function(){var t=r-this.y*a;if(t<=90&&t>=-90)return new Me(this.x*o+e,r-this.y*a)},this.customConvertPoint=self.URL.createObjectURL(new Blob(["customConvertPoint = {projectX:function(x){return (x - "+i+") / "+o+" + 0.5},projectY:function(y){y = 0.5 - ((y - "+n+") / "+a+");return y < 0 ? 0 : y > 1 ? 1 : y;},toY:function(y){return (0.5-y)*"+a+"+"+n+";}}"],{type:"text/javascript"}))},i.version.get=function(){return"16.0.0"},Object.defineProperties(r.prototype,i),r}(Sd);function Dd(t){t.parentNode&&t.parentNode.removeChild(t)}var Ld=function(t,e,r,i){for(var n=65535&t|0,o=t>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(n=n+e[i++]|0)|0}while(--a);n%=65521,o%=65521}return n|o<<16|0},Rd=new Uint32Array(function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}()),Bd=function(t,e,r,i){var n=Rd,o=i+r;t^=-1;for(var a=i;a<o;a++)t=t>>>8^n[255&(t^e[a])];return-1^t},Fd=function(t,e){var r,i,n,o,a,s,l,u,c,p,h,f,d,m,y,_,g,v,x,b,w,S,T,I,E=t.state;T=t.input,i=(r=t.next_in)+(t.avail_in-5),I=t.output,o=(n=t.next_out)-(e-t.avail_out),a=n+(t.avail_out-257),s=E.dmax,l=E.wsize,u=E.whave,c=E.wnext,p=E.window,h=E.hold,f=E.bits,d=E.lencode,m=E.distcode,y=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;t:do{f<15&&(h+=T[r++]<<f,h+=T[r++]<<(f+=8),f+=8),g=d[h&y];e:for(;;){if(h>>>=v=g>>>24,f-=v,0==(v=g>>>16&255))I[n++]=65535&g;else{if(!(16&v)){if(0==(64&v)){g=d[(65535&g)+(h&(1<<v)-1)];continue e}if(32&v){E.mode=12;break t}t.msg="invalid literal/length code",E.mode=30;break t}x=65535&g,(v&=15)&&(f<v&&(h+=T[r++]<<f,f+=8),x+=h&(1<<v)-1,h>>>=v,f-=v),f<15&&(h+=T[r++]<<f,h+=T[r++]<<(f+=8),f+=8),g=m[h&_];r:for(;;){if(h>>>=v=g>>>24,f-=v,!(16&(v=g>>>16&255))){if(0==(64&v)){g=m[(65535&g)+(h&(1<<v)-1)];continue r}t.msg="invalid distance code",E.mode=30;break t}if(b=65535&g,f<(v&=15)&&(h+=T[r++]<<f,(f+=8)<v&&(h+=T[r++]<<f,f+=8)),(b+=h&(1<<v)-1)>s){t.msg="invalid distance too far back",E.mode=30;break t}if(h>>>=v,f-=v,b>(v=n-o)){if((v=b-v)>u&&E.sane){t.msg="invalid distance too far back",E.mode=30;break t}if(w=0,S=p,0===c){if(w+=l-v,v<x){x-=v;do{I[n++]=p[w++]}while(--v);w=n-b,S=I}}else if(c<v){if(w+=l+c-v,(v-=c)<x){x-=v;do{I[n++]=p[w++]}while(--v);if(w=0,c<x){x-=v=c;do{I[n++]=p[w++]}while(--v);w=n-b,S=I}}}else if(w+=c-v,v<x){x-=v;do{I[n++]=p[w++]}while(--v);w=n-b,S=I}for(;x>2;)I[n++]=S[w++],I[n++]=S[w++],I[n++]=S[w++],x-=3;x&&(I[n++]=S[w++],x>1&&(I[n++]=S[w++]))}else{w=n-b;do{I[n++]=I[w++],I[n++]=I[w++],I[n++]=I[w++],x-=3}while(x>2);x&&(I[n++]=I[w++],x>1&&(I[n++]=I[w++]))}break}}break}}while(r<i&&n<a);h&=(1<<(f-=(x=f>>3)<<3))-1,t.next_in=r-=x,t.next_out=n,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=n<a?a-n+257:257-(n-a),E.hold=h,E.bits=f},Od=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Vd=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Ud=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Nd=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),jd=function(t,e,r,i,n,o,a,s){var l,u,c,p,h,f,d,m,y,_=s.bits,g=0,v=0,x=0,b=0,w=0,S=0,T=0,I=0,E=0,A=0,k=null,z=0,C=new Uint16Array(16),P=new Uint16Array(16),M=null,D=0;for(g=0;g<=15;g++)C[g]=0;for(v=0;v<i;v++)C[e[r+v]]++;for(w=_,b=15;b>=1&&0===C[b];b--);if(w>b&&(w=b),0===b)return n[o++]=20971520,n[o++]=20971520,s.bits=1,0;for(x=1;x<b&&0===C[x];x++);for(w<x&&(w=x),I=1,g=1;g<=15;g++)if(I<<=1,(I-=C[g])<0)return-1;if(I>0&&(0===t||1!==b))return-1;for(P[1]=0,g=1;g<15;g++)P[g+1]=P[g]+C[g];for(v=0;v<i;v++)0!==e[r+v]&&(a[P[e[r+v]]++]=v);if(0===t?(k=M=a,f=19):1===t?(k=Od,z-=257,M=Vd,D-=257,f=256):(k=Ud,M=Nd,f=-1),A=0,v=0,g=x,h=o,S=w,T=0,c=-1,p=(E=1<<w)-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){d=g-T,a[v]<f?(m=0,y=a[v]):a[v]>f?(m=M[D+a[v]],y=k[z+a[v]]):(m=96,y=0),l=1<<g-T,x=u=1<<S;do{n[h+(A>>T)+(u-=l)]=d<<24|m<<16|y|0}while(0!==u);for(l=1<<g-1;A&l;)l>>=1;if(0!==l?(A&=l-1,A+=l):A=0,v++,0==--C[g]){if(g===b)break;g=e[r+a[v]]}if(g>w&&(A&p)!==c){for(0===T&&(T=w),h+=x,I=1<<(S=g-T);S+T<b&&!((I-=C[S+T])<=0);)S++,I<<=1;if(E+=1<<S,1===t&&E>852||2===t&&E>592)return 1;n[c=A&p]=w<<24|S<<16|h-o|0}}return 0!==A&&(n[h+A]=g-T<<24|64<<16|0),s.bits=w,0},qd={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Zd=qd.Z_FINISH,Gd=qd.Z_BLOCK,Xd=qd.Z_TREES,Wd=qd.Z_OK,Hd=qd.Z_STREAM_END,Kd=qd.Z_NEED_DICT,Yd=qd.Z_STREAM_ERROR,Jd=qd.Z_DATA_ERROR,Qd=qd.Z_MEM_ERROR,$d=qd.Z_BUF_ERROR,tm=qd.Z_DEFLATED,em=function(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function rm(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var im,nm,om=function(t){if(!t||!t.state)return Yd;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,function(t){if(!t||!t.state)return Yd;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,Wd}(t)},am=!0,sm=function(t){if(am){im=new Int32Array(512),nm=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(jd(1,t.lens,0,288,im,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;jd(2,t.lens,0,32,nm,0,t.work,{bits:5}),am=!1}t.lencode=im,t.lenbits=9,t.distcode=nm,t.distbits=5},lm=function(t,e,r,i){var n,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),i>=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):((n=o.wsize-o.wnext)>i&&(n=i),o.window.set(e.subarray(r-i,r-i+n),o.wnext),(i-=n)?(o.window.set(e.subarray(r-i,r),0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0},um=om,cm=function(t,e){if(!t)return Yd;var r=new rm;t.state=r,r.window=null;var i=function(t,e){var r;if(!t||!t.state)return Yd;var i=t.state;return e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Yd:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,om(t))}(t,e);return i!==Wd&&(t.state=null),i},pm=function(t,e){var r,i,n,o,a,s,l,u,c,p,h,f,d,m,y,_,g,v,x,b,w,S,T,I,E=0,A=new Uint8Array(4),k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return Yd;12===(r=t.state).mode&&(r.mode=13),a=t.next_out,n=t.output,o=t.next_in,i=t.input,u=r.hold,c=r.bits,p=s=t.avail_in,h=l=t.avail_out,S=Wd;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;c<16;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if(2&r.wrap&&35615===u){r.check=0,A[0]=255&u,A[1]=u>>>8&255,r.check=Bd(r.check,A,2,0),u=0,c=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=30;break}if((15&u)!==tm){t.msg="unknown compression method",r.mode=30;break}if(c-=4,w=8+(15&(u>>>=4)),0===r.wbits)r.wbits=w;else if(w>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<<r.wbits,t.adler=r.check=1,r.mode=512&u?10:12,u=0,c=0;break;case 2:for(;c<16;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if(r.flags=u,(255&r.flags)!==tm){t.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=Bd(r.check,A,2,0)),u=0,c=0,r.mode=3;case 3:for(;c<32;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}r.head&&(r.head.time=u),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=Bd(r.check,A,4,0)),u=0,c=0,r.mode=4;case 4:for(;c<16;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=Bd(r.check,A,2,0)),u=0,c=0,r.mode=5;case 5:if(1024&r.flags){for(;c<16;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=Bd(r.check,A,2,0)),u=0,c=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((f=r.length)>s&&(f=s),f&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(i.subarray(o,o+f),w)),512&r.flags&&(r.check=Bd(r.check,i,f,o)),s-=f,o+=f,r.length-=f),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break t;f=0;do{w=i[o+f++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w))}while(w&&f<s);if(512&r.flags&&(r.check=Bd(r.check,i,f,o)),s-=f,o+=f,w)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break t;f=0;do{w=i[o+f++],r.head&&w&&r.length<65536&&(r.head.comment+=String.fromCharCode(w))}while(w&&f<s);if(512&r.flags&&(r.check=Bd(r.check,i,f,o)),s-=f,o+=f,w)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;c<16;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if(u!==(65535&r.check)){t.msg="header crc mismatch",r.mode=30;break}u=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;c<32;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}t.adler=r.check=em(u),u=0,c=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=a,t.avail_out=l,t.next_in=o,t.avail_in=s,r.hold=u,r.bits=c,Kd;t.adler=r.check=1,r.mode=12;case 12:if(e===Gd||e===Xd)break t;case 13:if(r.last){u>>>=7&c,c-=7&c,r.mode=27;break}for(;c<3;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}switch(r.last=1&u,c-=1,3&(u>>>=1)){case 0:r.mode=14;break;case 1:if(sm(r),r.mode=20,e===Xd){u>>>=2,c-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}u>>>=2,c-=2;break;case 14:for(u>>>=7&c,c-=7&c;c<32;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if((65535&u)!=(u>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,u=0,c=0,r.mode=15,e===Xd)break t;case 15:r.mode=16;case 16:if(f=r.length){if(f>s&&(f=s),f>l&&(f=l),0===f)break t;n.set(i.subarray(o,o+f),a),s-=f,o+=f,l-=f,a+=f,r.length-=f;break}r.mode=12;break;case 17:for(;c<14;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if(r.nlen=257+(31&u),c-=5,r.ndist=1+(31&(u>>>=5)),c-=5,r.ncode=4+(15&(u>>>=5)),u>>>=4,c-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;c<3;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}r.lens[k[r.have++]]=7&u,u>>>=3,c-=3}for(;r.have<19;)r.lens[k[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S=jd(0,r.lens,0,19,r.lencode,0,r.work,T={bits:r.lenbits}),r.lenbits=T.bits,S){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;_=(E=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,g=65535&E,!((y=E>>>24)<=c);){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if(g<16)u>>>=y,c-=y,r.lens[r.have++]=g;else{if(16===g){for(I=y+2;c<I;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if(u>>>=y,c-=y,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}w=r.lens[r.have-1],f=3+(3&u),u>>>=2,c-=2}else if(17===g){for(I=y+3;c<I;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}c-=y,w=0,f=3+(7&(u>>>=y)),u>>>=3,c-=3}else{for(I=y+7;c<I;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}c-=y,w=0,f=11+(127&(u>>>=y)),u>>>=7,c-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;f--;)r.lens[r.have++]=w}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S=jd(1,r.lens,0,r.nlen,r.lencode,0,r.work,T={bits:r.lenbits}),r.lenbits=T.bits,S){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S=jd(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T={bits:r.distbits}),r.distbits=T.bits,S){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,e===Xd)break t;case 20:r.mode=21;case 21:if(s>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=o,t.avail_in=s,r.hold=u,r.bits=c,Fd(t,h),a=t.next_out,n=t.output,l=t.avail_out,o=t.next_in,i=t.input,s=t.avail_in,u=r.hold,c=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;_=(E=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,g=65535&E,!((y=E>>>24)<=c);){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if(_&&0==(240&_)){for(v=y,x=_,b=g;_=(E=r.lencode[b+((u&(1<<v+x)-1)>>v)])>>>16&255,g=65535&E,!(v+(y=E>>>24)<=c);){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}u>>>=v,c-=v,r.back+=v}if(u>>>=y,c-=y,r.back+=y,r.length=g,0===_){r.mode=26;break}if(32&_){r.back=-1,r.mode=12;break}if(64&_){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&_,r.mode=22;case 22:if(r.extra){for(I=r.extra;c<I;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;_=(E=r.distcode[u&(1<<r.distbits)-1])>>>16&255,g=65535&E,!((y=E>>>24)<=c);){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if(0==(240&_)){for(v=y,x=_,b=g;_=(E=r.distcode[b+((u&(1<<v+x)-1)>>v)])>>>16&255,g=65535&E,!(v+(y=E>>>24)<=c);){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}u>>>=v,c-=v,r.back+=v}if(u>>>=y,c-=y,r.back+=y,64&_){t.msg="invalid distance code",r.mode=30;break}r.offset=g,r.extra=15&_,r.mode=24;case 24:if(r.extra){for(I=r.extra;c<I;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===l)break t;if(r.offset>(f=h-l)){if((f=r.offset-f)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}d=f>r.wnext?r.wsize-(f-=r.wnext):r.wnext-f,f>r.length&&(f=r.length),m=r.window}else m=n,d=a-r.offset,f=r.length;f>l&&(f=l),l-=f,r.length-=f;do{n[a++]=m[d++]}while(--f);0===r.length&&(r.mode=21);break;case 26:if(0===l)break t;n[a++]=r.length,l--,r.mode=21;break;case 27:if(r.wrap){for(;c<32;){if(0===s)break t;s--,u|=i[o++]<<c,c+=8}if(t.total_out+=h-=l,r.total+=h,h&&(t.adler=r.check=r.flags?Bd(r.check,n,h,a-h):Ld(r.check,n,h,a-h)),h=l,(r.flags?u:em(u))!==r.check){t.msg="incorrect data check",r.mode=30;break}u=0,c=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;c<32;){if(0===s)break t;s--,u+=i[o++]<<c,c+=8}if(u!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=30;break}u=0,c=0}r.mode=29;case 29:S=Hd;break t;case 30:S=Jd;break t;case 31:return Qd;case 32:default:return Yd}return t.next_out=a,t.avail_out=l,t.next_in=o,t.avail_in=s,r.hold=u,r.bits=c,(r.wsize||h!==t.avail_out&&r.mode<30&&(r.mode<27||e!==Zd))&&lm(t,t.output,t.next_out,h-t.avail_out),h-=t.avail_out,t.total_in+=p-=t.avail_in,t.total_out+=h,r.total+=h,r.wrap&&h&&(t.adler=r.check=r.flags?Bd(r.check,n,h,t.next_out-h):Ld(r.check,n,h,t.next_out-h)),t.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===p&&0===h||e===Zd)&&S===Wd&&(S=$d),S},hm=function(t){if(!t||!t.state)return Yd;var e=t.state;return e.window&&(e.window=null),t.state=null,Wd},fm=function(t,e){var r,i=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?Yd:11===r.mode&&Ld(1,e,i,0)!==r.check?Jd:lm(t,e,i,i)?(r.mode=31,Qd):(r.havedict=1,Wd):Yd},dm=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},mm=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){mm=!1}for(var ym=new Uint8Array(256),_m=0;_m<256;_m++)ym[_m]=_m>=252?6:_m>=248?5:_m>=240?4:_m>=224?3:_m>=192?2:1;ym[254]=ym[254]=1;var gm=function(t,e){var r,i,n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));var o=new Array(2*n);for(i=0,r=0;r<n;){var a=t[r++];if(a<128)o[i++]=a;else{var s=ym[a];if(s>4)o[i++]=65533,r+=s-1;else{for(a&=2===s?31:3===s?15:7;s>1&&r<n;)a=a<<6|63&t[r++],s--;s>1?o[i++]=65533:a<65536?o[i++]=a:(o[i++]=55296|(a-=65536)>>10&1023,o[i++]=56320|1023&a)}}}return function(t,e){if(e<65534&&t.subarray&&mm)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var r="",i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r}(o,i)},vm=function(t,e){(e=e||t.length)>t.length&&(e=t.length);for(var r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+ym[t[r]]>e?r:e},xm={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},bm=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},wm=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Sm=Object.prototype.toString,Tm=qd.Z_NO_FLUSH,Im=qd.Z_FINISH,Em=qd.Z_OK,Am=qd.Z_STREAM_END,km=qd.Z_NEED_DICT,zm=qd.Z_STREAM_ERROR,Cm=qd.Z_DATA_ERROR,Pm=qd.Z_MEM_ERROR;function Mm(t){this.options=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)dm(r,i)&&(t[i]=r[i])}}return t}({chunkSize:65536,windowBits:15,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bm,this.strm.avail_out=0;var r=cm(this.strm,e.windowBits);if(r!==Em)throw new Error(xm[r]);if(this.header=new wm,function(t,e){if(!t||!t.state)return Yd;var r=t.state;0==(2&r.wrap)||(r.head=e,e.done=!1)}(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,r,i,n,o,a=t.length,s=0;for(n=0;n<a;n++)55296==(64512&(r=t.charCodeAt(n)))&&n+1<a&&56320==(64512&(i=t.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(i-56320),n++),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),o=0,n=0;o<s;n++)55296==(64512&(r=t.charCodeAt(n)))&&n+1<a&&56320==(64512&(i=t.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(i-56320),n++),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e}(e.dictionary):"[object ArrayBuffer]"===Sm.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=fm(this.strm,e.dictionary))!==Em))throw new Error(xm[r])}function Dm(t,e){var r=new Mm(e);if(r.push(t),r.err)throw r.msg||xm[r.err];return r.result}Mm.prototype.push=function(t,e){var r,i,n,o=this.strm,a=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Im:Tm,o.input="[object ArrayBuffer]"===Sm.call(t)?new Uint8Array(t):t,o.next_in=0,o.avail_in=o.input.length;;){for(0===o.avail_out&&(o.output=new Uint8Array(a),o.next_out=0,o.avail_out=a),(r=pm(o,i))===km&&s&&((r=fm(o,s))===Em?r=pm(o,i):r===Cm&&(r=km));o.avail_in>0&&r===Am&&o.state.wrap>0&&0!==t[o.next_in];)um(o),r=pm(o,i);switch(r){case zm:case Cm:case km:case Pm:return this.onEnd(r),this.ended=!0,!1}if(n=o.avail_out,o.next_out&&(0===o.avail_out||r===Am))if("string"===this.options.to){var l=vm(o.output,o.next_out),u=o.next_out-l,c=gm(o.output,l);o.next_out=u,o.avail_out=a-u,u&&o.output.set(o.output.subarray(l,l+u),0),this.onData(c)}else this.onData(o.output.length===o.next_out?o.output:o.output.subarray(0,o.next_out));if(r!==Em||0!==n){if(r===Am)return r=hm(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===o.avail_in)break}}return!0},Mm.prototype.onData=function(t){this.chunks.push(t)},Mm.prototype.onEnd=function(t){t===Em&&(this.result="string"===this.options.to?this.chunks.join(""):function(t){for(var e=0,r=0,i=t.length;r<i;r++)e+=t[r].length;for(var n=new Uint8Array(e),o=0,a=0,s=t.length;o<s;o++){var l=t[o];n.set(l,a),a+=l.length}return n}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};for(var Lm={Inflate:Mm,inflate:Dm,inflateRaw:function(t,e){return(e=e||{}).raw=!0,Dm(t,e)},ungzip:Dm,constants:qd},Rm=[],Bm=[],Fm="undefined"!=typeof Uint8Array?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vm=0,Um=Om.length;Vm<Um;++Vm)Rm[Vm]=Om[Vm],Bm[Om.charCodeAt(Vm)]=Vm;function Nm(t,e,r){for(var i,n=[],o=e;o<r;o+=3)n.push(Rm[(i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]))>>18&63]+Rm[i>>12&63]+Rm[i>>6&63]+Rm[63&i]);return n.join("")}Bm["-".charCodeAt(0)]=62,Bm["_".charCodeAt(0)]=63;var jm=function(t){var e,r,i=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}(t),n=i[0],o=i[1],a=new Fm(function(t,e,r){return 3*(e+r)/4-r}(0,n,o)),s=0,l=o>0?n-4:n;for(r=0;r<l;r+=4)e=Bm[t.charCodeAt(r)]<<18|Bm[t.charCodeAt(r+1)]<<12|Bm[t.charCodeAt(r+2)]<<6|Bm[t.charCodeAt(r+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=255&e;return 2===o&&(e=Bm[t.charCodeAt(r)]<<2|Bm[t.charCodeAt(r+1)]>>4,a[s++]=255&e),1===o&&(e=Bm[t.charCodeAt(r)]<<10|Bm[t.charCodeAt(r+1)]<<4|Bm[t.charCodeAt(r+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e),a},qm=function(){};qm.openDatabase=function(t){var e=t.split("/").slice(-1)[0],r=this;return console.log("openDatabase",self),"sqlitePlugin"in self?"device"in self?new Promise((function(t,e){"Android"===device.platform?resolveLocalFileSystemURL(cordova.file.applicationStorageDirectory,(function(e){e.getDirectory("databases",{create:!0},(function(e){t(e)}))}),e):"iOS"===device.platform?resolveLocalFileSystemURL(cordova.file.documentsDirectory,t,e):e("Platform not supported")})).then((function(i){return new Promise((function(t,r){i.getFile(e,{},t,r)})).catch((function(){return r.copyDatabaseFile(t,e,i)}))})).then((function(){var t={name:e};return"iOS"===device.platform?t.iosDatabaseLocation="Documents":t.location="default",sqlitePlugin.openDatabase(t)})):Promise.reject(new Error("cordova-plugin-device not available. Please install the plugin and make sure this code is run after onDeviceReady event")):Promise.reject(new Error("cordova-sqlite-ext plugin not available. Please install the plugin and make sure this code is run after onDeviceReady event"))},qm.copyDatabaseFile=function(t,e,r){return console.log("Copying database to application storage directory"),new Promise((function(e,r){var i=cordova.file.externalRootDirectory+"/"+t;resolveLocalFileSystemURL(i,e,r)})).then((function(t){return new Promise((function(i,n){t.copyTo(r,e,i,n)})).then((function(){console.log("Database copied")}))}))};var Zm=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.dispatcher=i,this.setEventedParent(n),this.type="mbtiles",this.db=this.openDatabase(r.path)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.openDatabase=function(t){return qm.openDatabase(t)},e.prototype.copyDatabaseFile=function(t,e,r){return qm.copyDatabaseFile(t,e,r)},e.prototype.readTile=function(t,e,r,i){var n=[t,e,r];this.db.then((function(t){t.transaction((function(t){t.executeSql("SELECT BASE64(tile_data) AS base64_tile_data FROM tiles WHERE zoom_level=? AND tile_column=? AND tile_row=?",n,(function(t,e){if(e.rows.length){var r=e.rows.item(0).base64_tile_data,o=Lm.inflate(jm(r));i(void 0,function(t){for(var e,r=t.length,i=r%3,n=[],o=0,a=r-i;o<a;o+=16383)n.push(Nm(t,o,o+16383>a?a:o+16383));return 1===i?n.push(Rm[(e=t[r-1])>>2]+Rm[e<<4&63]+"=="):2===i&&n.push(Rm[(e=(t[r-2]<<8)+t[r-1])>>10]+Rm[e>>4&63]+Rm[e<<2&63]+"="),n.join("")}(o))}else i(new Error("tile "+n.join(",")+" not found"))}))}),(function(t){i(t)}))})).catch((function(t){i(t)}))},e.prototype.loadTile=function(t,e){var r=t.tileID.canonical,i=r.z>this.maxzoom?Math.pow(2,r.z-this.maxzoom):1,n=Math.min(r.z,this.maxzoom||r.z),o=r.x,a=Math.pow(2,n)-r.y-1;this.readTile(n,o,a,function(n,o){if(n)return e(n);if(void 0===o)return e(new Error("empty data"));var a={request:{url:"data:application/x-protobuf;base64,"+o},uid:t.uid,tileID:t.tileID,zoom:r.z,tileSize:this.tileSize*i,type:this.type,source:this.id,pixelRatio:window.devicePixelRatio||1,overscaling:i,showCollisionBoxes:this.map.showCollisionBoxes};function s(r,i){if(!t.aborted){if(r)return e(r);this.map._refreshExpiredTiles&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}}t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:t.request=t.actor.send("reloadTile",a,s.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",a,s.bind(this)))}.bind(this))},e}(tc),Gm=function(t){function e(e,r,i,n){t.call(this,e,r,i,n),this.id=e,this.dispatcher=i,this.setEventedParent(n),this.type="rasteroffline",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this.imageFormat="png",this._loaded=!1,this._options=f({},r),f(this,d(r,["scheme","tileSize","imageFormat"])),this._transparentPngUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.db=this.openDatabase(r.path)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.openDatabase=function(t){return qm.openDatabase(t)},e.prototype.copyDatabaseFile=function(t,e,r){return qm.copyDatabaseFile(t,e,r)},e.prototype.loadTile=function(t,e){t.request=this._getImage(t.tileID.canonical,function(r,i){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(r)t.state="errored",e(r);else if(i){this.map._refreshExpiredTiles&&t.setExpiryData(i),delete i.cacheControl,delete i.expires;var n=this.map.painter.context,o=n.gl;t.texture=this.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new zu(n,i,o.RGBA,{useMipmap:!0}),t.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),n.extTextureFilterAnisotropic&&o.texParameterf(o.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax)),t.state="loaded",e(null)}}.bind(this))},e.prototype._getBlob=function(t,e){var r=this,i=Math.pow(2,t.z)-1-t.y,n=[t.z,t.x,i],o="data:image/"+this.imageFormat+";base64,";this.db.then((function(t){t.transaction((function(t){t.executeSql("SELECT BASE64(tile_data) AS base64_tile_data FROM tiles WHERE zoom_level = ? AND tile_column = ? AND tile_row = ?",n,(function(t,i){i.rows.length?e(void 0,{data:o+i.rows.item(0).base64_tile_data,cacheControl:null,expires:null}):(console.error("tile "+n.join(",")+" not found"),e(void 0,{data:r._transparentPngUrl,cacheControl:null,expires:null}))}))}),(function(t){e(t)}))})).catch((function(t){e(t)}))},e.prototype._getImage=function(t,e){return this._getBlob(t,(function(t,r){if(t)return e(t);var i=new window.Image,n=window.URL||window.webkitURL;i.onload=function(){e(null,i),n.revokeObjectURL(i.src)},i.cacheControl=r.cacheControl,i.expires=r.expires,i.src=r.data}))},e}(ec),Xm=function(t){var e=t.style,r=/^.+:\/\//,i=self.location.origin+self.location.pathname.split("/").slice(0,-1).join("/");return"sprite"in e&&!e.sprite.match(r)&&"glyphs"in e&&!e.glyphs.match(r)&&(e.sprite=i+"/"+e.sprite,e.glyphs=i+"/"+e.glyphs),console.log("获取离线显示配置",t),t},Wm={showCompass:!0,showZoom:!0,visualizePitch:!1},Hm=function(t){var e=this;this.options=f({},Wm,t),this._container=V.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(v(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return e._map.zoomIn({},{originalEvent:t})})),V.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})})),V.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(v(["_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=V.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};function Km(t,e,r){if(t=new Me(t.lng,t.lat),e){var i=new Me(t.lng-360,t.lat),n=new Me(t.lng+360,t.lat),o=r.locationPoint(t).distSqr(e);r.locationPoint(i).distSqr(e)<o?t=i:r.locationPoint(n).distSqr(e)<o&&(t=n)}for(;Math.abs(t.lng-r.center.lng)>180;){var a=r.locationPoint(t);if(a.x>=0&&a.y>=0&&a.x<=r.width&&a.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}Hm.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom()},Hm.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},Hm.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 dd(t,{button:"left",element:this._compass,clickTolerance:t.dragRotate._clickTolerance}),V.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),V.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},Hm.prototype.onRemove=function(){V.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),V.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),V.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map},Hm.prototype._createButton=function(t,e){var r=V.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r},Hm.prototype._setButtonTitle=function(t,e){var r=this._map._getUIString("NavigationControl."+e);t.title=r,t.setAttribute("aria-label",r)};var Ym={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 Jm(t,e,r){var i=t.classList;for(var n in Ym)i.remove("mapboxgl-"+r+"-anchor-"+n);i.add("mapboxgl-"+r+"-anchor-"+e)}var Qm,$m=function(t){function e(e,r){var i=this;if(t.call(this),(e instanceof self.HTMLElement||r)&&(e=f({element:e},r)),v(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._draggable=e&&e.draggable||!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=V.create("div"),this._element.setAttribute("aria-label","Map marker");var o=V.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var a=V.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");var s=V.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=V.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var u=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"}];u<c.length;u+=1){var p=c[u],h=V.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),l.appendChild(h)}var d=V.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill",this._color);var m=V.createNS("http://www.w3.org/2000/svg","path");m.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"),d.appendChild(m);var y=V.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"opacity","0.25"),y.setAttributeNS(null,"fill","#000000");var _=V.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=V.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(6.0, 7.0)"),g.setAttributeNS(null,"fill","#FFFFFF");var x=V.createNS("http://www.w3.org/2000/svg","g");x.setAttributeNS(null,"transform","translate(8.0, 8.0)");var b=V.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#000000"),b.setAttributeNS(null,"opacity","0.25"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962");var w=V.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"),x.appendChild(b),x.appendChild(w),s.appendChild(l),s.appendChild(d),s.appendChild(y),s.appendChild(g),s.appendChild(x),o.appendChild(s),this._element.appendChild(o),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()})),this._element.addEventListener("focus",(function(){var t=i._map.getContainer();t.scrollTop=0,t.scrollLeft=0})),Jm(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),V.remove(this._element),this._popup&&this._popup.remove(),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=Me.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,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},e.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.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=Km(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 r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),V.setTransform(this._element,Ym[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+r+" "+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){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 Ot("dragstart"))),this.fire(new Ot("drag"))},e.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new Ot("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._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}(Ut),ty={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ey=0,ry=!1,iy=function(t){function e(e){t.call(this),this.options=f({},ty,e),v(["_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=V.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),e=this._setupUI,void 0!==Qm?e(Qm):void 0!==self.navigator.permissions?self.navigator.permissions.query({name:"geolocation"}).then((function(t){e(Qm="denied"!==t.state)})):(Qm=!!self.navigator.geolocation,e(Qm)),this._container},e.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(self.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(),V.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ey=0,ry=!1},e.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.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 Ot("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 Ot("geolocate",t)),this._finish()}},e.prototype._updateCamera=function(t){var e=new Me(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,i=f({bearing:this._map.getBearing()},this.options.fitBoundsOptions);this._map.fitBounds(e.toBounds(r),i,{geolocateSource:!0})},e.prototype._updateMarker=function(t){if(t){var e=new Me(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]),r=this._map.unproject([1,t]),i=e.distanceTo(r),n=Math.ceil(2*this._accuracy/i);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&&ry)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new Ot("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=V.create("button","mapboxgl-ctrl-geolocate",this._container),V.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){I("Geolocation support is not available so the GeolocateControl will be disabled.");var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}else{var i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=V.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new $m(this._dotElement),this._circleElement=V.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new $m({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 Ot("trackuserlocationend")))}))},e.prototype.trigger=function(){if(!this._setup)return I("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 Ot("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ey--,ry=!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 Ot("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 Ot("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"),++ey>1?(t={maximumAge:6e5,timeout:0},ry=!0):(t=this.options.positionOptions,ry=!1),this._geolocationWatchID=self.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else self.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},e.prototype._clearWatch=function(){self.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}(Ut),ny={maxWidth:100,unit:"metric"},oy=function(t){this.options=f({},ny,t),v(["_onMove","setUnit"],this)};function ay(t,e,r){var i=r&&r.maxWidth||100,n=t._container.clientHeight/2,o=t.unproject([0,n]),a=t.unproject([i,n]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?sy(e,i,l/5280,t._getUIString("ScaleControl.Miles")):sy(e,i,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?sy(e,i,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?sy(e,i,s/1e3,t._getUIString("ScaleControl.Kilometers")):sy(e,i,s,t._getUIString("ScaleControl.Meters"))}function sy(t,e,r,i){var n,o,a,s=(n=r,(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/r)+"px",t.innerHTML=s+"&nbsp;"+i}oy.prototype.getDefaultPosition=function(){return"bottom-left"},oy.prototype._onMove=function(){ay(this._map,this._container,this.options)},oy.prototype.onAdd=function(t){return this._map=t,this._container=V.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},oy.prototype.onRemove=function(){V.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},oy.prototype.setUnit=function(t){this.options.unit=t,ay(this._map,this._container,this.options)};var ly=function(t){v(["onMoveStart","onMoveEnd","onRender","getFPS","updateGraph"],this);var e=window.devicePixelRatio,r={background:"rgba(0,0,0,0.9)",barWidth:4*e,color:"#7cf859",font:"Monaco, Consolas, Courier, monospace",graphHeight:60*e,graphWidth:120*e,graphTop:0,graphRight:5*e,width:130*e};this.frames=0,this.totalTime=0,this.totalFrames=0,this.options=Object.assign({},r,t)};ly.prototype.onAdd=function(t){this.map=t,console.log("onAdd",this.map);var e=window.devicePixelRatio,r=this.options,i=r.width,n=r.graphHeight,o=r.color,a=r.background,s=r.font,l=this.container=document.createElement("div");return l.className="mapboxgl-ctrl mapboxgl-ctrl-fps",l.style.backgroundColor=a,l.style.borderRadius="6px",this.readOutput=document.createElement("div"),this.readOutput.style.color=o,this.readOutput.style.fontFamily=s,this.readOutput.style.padding="0 5px 5px",this.readOutput.style.fontSize="9px",this.readOutput.style.fontWeight="bold",this.readOutput.textContent="Waiting…",this.canvas=document.createElement("canvas"),this.canvas.className="mapboxgl-ctrl-canvas",this.canvas.width=i,this.canvas.height=n,this.canvas.style.cssText="width: "+i/e+"px; height: "+n/e+"px;",l.appendChild(this.readOutput),l.appendChild(this.canvas),this.map.on("movestart",this.onMoveStart),this.map.on("moveend",this.onMoveEnd),this.container},ly.prototype.onMoveStart=function(){this.frames=0,this.time=performance.now(),this.map.on("render",this.onRender)},ly.prototype.onMoveEnd=function(){var t=performance.now();this.updateGraph(this.getFPS(t)),this.frames=0,this.time=null,this.map.off("render",this.onRender)},ly.prototype.onRender=function(){this.frames++;var t=performance.now();t>=this.time+1e3&&(this.updateGraph(this.getFPS(t)),this.frames=0,this.time=t)},ly.prototype.getFPS=function(t){return this.totalTime+=t-this.time,this.totalFrames+=this.frames,Math.round(1e3*this.frames/(t-this.time))||0},ly.prototype.updateGraph=function(t){var e=this.options,r=e.barWidth,i=e.graphRight,n=e.graphTop,o=e.graphWidth,a=e.graphHeight,s=e.background,l=e.color,u=this.canvas.getContext("2d"),c=Math.round(1e3*this.totalFrames/this.totalTime)||0,p=r;u.fillStyle=s,u.globalAlpha=1,u.fillRect(0,0,o,n),u.fillStyle=l,this.readOutput.textContent="当前:"+t+" (平均:"+c+" )",u.drawImage(this.canvas,i+p,n,o-p,a,i,n,o-p,a),u.fillRect(i+o-p,n,p,a),u.fillStyle=s,u.globalAlpha=.75,u.fillRect(i+o-p,n,p,(1-t/100)*a)},ly.prototype.onRemove=function(){return this.map.off("render",this.onRender),this.map.off("movestart",this.onMoveStart),this.map.off("moveend",this.onMoveEnd),this.container.parentNode.removeChild(this.container),this.map=null,this};var uy=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof self.HTMLElement?this._container=t.container:I("Full screen control 'container' must be a DOM element.")),v(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in self.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in self.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in self.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in self.document&&(this._fullscreenchange="MSFullscreenChange")};uy.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=V.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",I("This device does not support fullscreen mode.")),this._controlContainer},uy.prototype.onRemove=function(){V.remove(this._controlContainer),this._map=null,self.document.removeEventListener(this._fullscreenchange,this._changeIcon)},uy.prototype._checkFullscreenSupport=function(){return!!(self.document.fullscreenEnabled||self.document.mozFullScreenEnabled||self.document.msFullscreenEnabled||self.document.webkitFullscreenEnabled)},uy.prototype._setupUI=function(){var t=this._fullscreenButton=V.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);V.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),self.document.addEventListener(this._fullscreenchange,this._changeIcon)},uy.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},uy.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},uy.prototype._isFullscreen=function(){return this._fullscreen},uy.prototype._changeIcon=function(){(self.document.fullscreenElement||self.document.mozFullScreenElement||self.document.webkitFullscreenElement||self.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())},uy.prototype._onClickFullscreen=function(){this._isFullscreen()?self.document.exitFullscreen?self.document.exitFullscreen():self.document.mozCancelFullScreen?self.document.mozCancelFullScreen():self.document.msExitFullscreen?self.document.msExitFullscreen():self.document.webkitCancelFullScreen&&self.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 cy={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},py=function(t){function e(e){t.call(this),this.options=f(Object.create(cy),e),v(["_update","_onClose","remove"],this)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.addTo=function(t){var e=this;return 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._trackPointer?(this._map.on("mousemove",(function(t){e._update(t.point)})),this._map.on("mouseup",(function(t){e._update(t.point)})),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 Ot("open")),this},e.prototype.isOpen=function(){return!!this._map},e.prototype.remove=function(){return this._content&&V.remove(this._content),this._container&&(V.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"),delete this._map),this.fire(new Ot("close")),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=Me.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},e.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",(function(e){t._update(e.point)})),this._map.on("drag",(function(e){t._update(e.point)})),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(self.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,r=self.document.createDocumentFragment(),i=self.document.createElement("body");for(i.innerHTML=t;e=i.firstChild;)r.appendChild(e);return this.setDOMContent(r)},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){return this._createContent(),this._content.appendChild(t),this._update(),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.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},e.prototype._createContent=function(){this._content&&V.remove(this._content),this._content=V.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=V.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},e.prototype._update=function(t){var e=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=V.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=V.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=Km(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var r=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),i=this.options.anchor,o=function t(e){if(e){if("number"==typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new n(0,0),top:new n(0,e),"top-left":new n(r,r),"top-right":new n(-r,r),bottom:new n(0,-e),"bottom-left":new n(r,-r),"bottom-right":new n(-r,-r),left:new n(e,0),right:new n(-e,0)}}if(e instanceof n||Array.isArray(e)){var i=n.convert(e);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}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(!i){var a,s=this._container.offsetWidth,l=this._container.offsetHeight;a=r.y+o.bottom.y<l?["top"]:r.y>this._map.transform.height-l?["bottom"]:[],r.x<s/2?a.push("left"):r.x>this._map.transform.width-s/2&&a.push("right"),i=0===a.length?"bottom":a.join("-")}var u=r.add(o[i]).round();V.setTransform(this._container,Ym[i]+" translate("+u.x+"px,"+u.y+"px)"),Jm(this._container,i,"popup")}},e.prototype._onClose=function(){this.remove()},e}(Ut),hy={version:"16.0.0",supported:e,setRTLTextPlugin:function(t,e,r){if(void 0===r&&(r=!1),"deferred"===Sn||"loading"===Sn||"loaded"===Sn)throw new Error("setRTLTextPlugin cannot be called multiple times.");Tn=O.resolveURL(t),Sn="deferred",wn=e,En(),r||zn()},getRTLTextPluginStatus:kn,Map:Md,OfflineMap:function(t){return function(t){return"string"==typeof t.style||t.style instanceof String?(e=t.style,new Promise((function(t,r){var i=new self.XMLHttpRequest;return i.open("GET",e,!0),i.setRequestHeader("Accept","application/json"),i.onerror=function(t){return r(t)},i.onload=function(){var e=0===i.responseURL.indexOf("file://");if((i.status>=200&&i.status<300||e)&&i.response)try{t(JSON.parse(i.response))}catch(t){r(t)}else r(new Error(i.statusText,i.status))},i.send(),i}))).then((function(e){return f({},t,{style:e})})):Promise.resolve(t);var e}(t).then(Xm).then((function(t){return function(t){return new Promise((function(e){var r=f({},t.style,{sources:{},layers:[]}),i=f({},t,{style:r}),n=new Md(i);console.log("创建空离线地图",i,n),n.once("load",(function(){var t=new Promise((function(t){n.addSourceType("mbtiles",Zm,(function(){return t()}))})),r=new Promise((function(t){n.addSourceType("rasteroffline",Gm,(function(){return t()}))}));Promise.all([t,r]).then((function(){return e(n)}))}))}))}(t).then((e=t.style,function(t){return Object.keys(e.sources).map((function(r){return t.addSource(r,e.sources[r])})),console.log("离线地图-加载数据源",e,t),t})).then(function(t){return function(e){return t.layers.map((function(t){return e.addLayer(t)})),console.log("离线地图-加载图层",t,e),e}}(t.style));var e}))},NavigationControl:Hm,GeolocateControl:iy,AttributionControl:Td,ScaleControl:oy,FullscreenControl:uy,FpsControl:ly,Popup:py,Marker:$m,Style:Eh,LngLat:Me,LngLatBounds:Pe,Point:n,MercatorCoordinate:Ve,CRS:Wu,CanonicalTileID:Hu,Evented:Ut,config:Y,get accessToken(){return Y.ACCESS_TOKEN},set accessToken(t){Y.ACCESS_TOKEN=t},get baseApiUrl(){return Y.API_URL},set baseApiUrl(t){Y.API_URL=t},get workerCount(){return bp.workerCount},set workerCount(t){bp.workerCount=t},get maxParallelImageRequests(){return Y.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){Y.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){!function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))}(t)},workerUrl:""};return hy}));
2
- //# sourceMappingURL=mapbox-gl-csp.js.map