@visitscotland/component-library 5.61.1 → 5.62.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 (267) hide show
  1. package/dist/components/LoadingSpinner-DDwWCdh8.js +36 -0
  2. package/dist/components/{LoadingSpinner-DbwQ0GQV.mjs → LoadingSpinner-PVEoCVFT.mjs} +3225 -3175
  3. package/dist/components/components/accordion/Accordion.vue.d.ts +26 -0
  4. package/dist/components/components/accordion/components/AccordionItem.vue.d.ts +1408 -0
  5. package/dist/components/components/accordion/components/AccordionToggle.vue.d.ts +726 -0
  6. package/dist/components/components/address/Address.vue.d.ts +294 -0
  7. package/dist/components/components/alert/Alert.vue.d.ts +294 -0
  8. package/dist/components/components/article/Article.vue.d.ts +288 -0
  9. package/dist/components/components/article/components/ArticleSection.vue.d.ts +151 -0
  10. package/dist/components/components/article/components/ArticleSidebar.vue.d.ts +24 -0
  11. package/dist/components/components/article-details/ArticleDetails.vue.d.ts +344 -0
  12. package/dist/components/components/back-to-top/BackToTop.vue.d.ts +9 -0
  13. package/dist/components/components/backdrop/Backdrop.vue.d.ts +60 -0
  14. package/dist/components/components/badge/Badge.vue.d.ts +123 -0
  15. package/dist/components/components/banner/Banner.vue.d.ts +1183 -0
  16. package/dist/components/components/body/Body.vue.d.ts +43 -0
  17. package/dist/components/components/breadcrumb/Breadcrumb.vue.d.ts +33 -0
  18. package/dist/components/components/breadcrumb/components/BreadcrumbItem.vue.d.ts +160 -0
  19. package/dist/components/components/button/Button.vue.d.ts +767 -0
  20. package/dist/components/components/button-toggle-group/ButtonToggleGroup.vue.d.ts +681 -0
  21. package/dist/components/components/canned-search/CannedSearch.vue.d.ts +3922 -0
  22. package/dist/components/components/canned-search/components/CannedSearchBadges.vue.d.ts +76 -0
  23. package/dist/components/components/canned-search/components/CannedSearchCategories.vue.d.ts +28 -0
  24. package/dist/components/components/canned-search/components/CannedSearchCuisines.vue.d.ts +22 -0
  25. package/dist/components/components/canned-search/components/CannedSearchDates.vue.d.ts +41 -0
  26. package/dist/components/components/canned-search/components/CannedSearchDuration.vue.d.ts +35 -0
  27. package/dist/components/components/canned-search/components/CannedSearchLogos.vue.d.ts +965 -0
  28. package/dist/components/components/canned-search/components/CannedSearchPrice.vue.d.ts +50 -0
  29. package/dist/components/components/canned-search/components/CannedSearchProductCard.vue.d.ts +791 -0
  30. package/dist/components/components/canned-search/components/CannedSearchStars.vue.d.ts +39 -0
  31. package/dist/components/components/canned-search/components/CannedSearchSubHeading.vue.d.ts +90 -0
  32. package/dist/components/components/canned-search/components/CannedSearchSummaryBox.vue.d.ts +580 -0
  33. package/dist/components/components/canned-search/components/CannedSearchTourDeparts.vue.d.ts +43 -0
  34. package/dist/components/components/canned-search/components/CannedSearchTourRuns.vue.d.ts +59 -0
  35. package/dist/components/components/caption/Caption.vue.d.ts +507 -0
  36. package/dist/components/components/caption/components/CaptionImageMap.vue.d.ts +67 -0
  37. package/dist/components/components/carbon-calculator/CarbonCalculator.vue.d.ts +5509 -0
  38. package/dist/components/components/carbon-calculator/components/CarbonCalculatorIntro.vue.d.ts +49 -0
  39. package/dist/components/components/carbon-calculator/components/CarbonCalculatorQuestion.vue.d.ts +1554 -0
  40. package/dist/components/components/carbon-calculator/components/CarbonCalculatorResults.vue.d.ts +1087 -0
  41. package/dist/components/components/carbon-calculator/components/CarbonCalculatorRunningTotal.vue.d.ts +337 -0
  42. package/dist/components/components/carbon-calculator/components/CarbonCalculatorTip.vue.d.ts +361 -0
  43. package/dist/components/components/card/Card.vue.d.ts +310 -0
  44. package/dist/components/components/card-group/CardGroup.vue.d.ts +76 -0
  45. package/dist/components/components/carousel/Carousel.vue.d.ts +948 -0
  46. package/dist/components/components/carousel/components/CarouselSlide.vue.d.ts +3090 -0
  47. package/dist/components/components/checkbox/Checkbox.vue.d.ts +424 -0
  48. package/dist/components/components/content-swiper/ContentSwiper.vue.d.ts +1427 -0
  49. package/dist/components/components/content-swiper/components/ContentSwiperSlide.d.ts +2 -0
  50. package/dist/components/components/description-list/DescriptionList.vue.d.ts +22 -0
  51. package/dist/components/components/description-list/components/DescriptionListItem.vue.d.ts +110 -0
  52. package/dist/components/components/detail/Detail.vue.d.ts +387 -0
  53. package/dist/components/components/divider/Divider.vue.d.ts +7 -0
  54. package/dist/components/components/dropdown/Dropdown.vue.d.ts +947 -0
  55. package/dist/components/components/dropdown/components/DropdownItem.vue.d.ts +97 -0
  56. package/dist/components/components/embed-wrapper/EmbedWrapper.vue.d.ts +1317 -0
  57. package/dist/components/components/event-card/EventCard.vue.d.ts +875 -0
  58. package/dist/components/components/filter/VsFilter.vue.d.ts +22 -0
  59. package/dist/components/components/filter/components/VsFilterSection.vue.d.ts +18 -0
  60. package/dist/components/components/footer/Footer.vue.d.ts +237 -0
  61. package/dist/components/components/footer/components/FooterAccordionItem.vue.d.ts +1448 -0
  62. package/dist/components/components/footer/components/FooterCopyright.vue.d.ts +671 -0
  63. package/dist/components/components/footer/components/FooterNavList.vue.d.ts +121 -0
  64. package/dist/components/components/footer/components/FooterNavListItem.vue.d.ts +445 -0
  65. package/dist/components/components/footer/components/FooterSocialItem.vue.d.ts +751 -0
  66. package/dist/components/components/footer/components/FooterSocialMenu.vue.d.ts +80 -0
  67. package/dist/components/components/footer/components/FooterUtilityList.vue.d.ts +156 -0
  68. package/dist/components/components/form/Form.vue.d.ts +4181 -0
  69. package/dist/components/components/global-menu/GlobalMenu.vue.d.ts +194 -0
  70. package/dist/components/components/global-menu/components/GlobalMenuLanguage.vue.d.ts +1279 -0
  71. package/dist/components/components/global-menu/components/GlobalMenuLanguageItem.vue.d.ts +163 -0
  72. package/dist/components/components/grid/Col.vue.d.ts +90 -0
  73. package/dist/components/components/grid/Container.vue.d.ts +33 -0
  74. package/dist/components/components/grid/Row.vue.d.ts +2 -0
  75. package/dist/components/components/grid/index.d.ts +3 -0
  76. package/dist/components/components/heading/Heading.vue.d.ts +81 -0
  77. package/dist/components/components/hero-section/HeroSection.vue.d.ts +3517 -0
  78. package/dist/components/components/hero-section/components/HeroSectionImage.vue.d.ts +376 -0
  79. package/dist/components/components/html-error/HtmlError.vue.d.ts +35 -0
  80. package/dist/components/components/icon/Icon.vue.d.ts +338 -0
  81. package/dist/components/components/icon-list/IconList.vue.d.ts +20 -0
  82. package/dist/components/components/icon-list/components/IconListItem.vue.d.ts +324 -0
  83. package/dist/components/components/illustrated-map/IllustratedMap.vue.d.ts +75 -0
  84. package/dist/components/components/image-with-caption/ImageWithCaption.vue.d.ts +4886 -0
  85. package/dist/components/components/img/Img.vue.d.ts +173 -0
  86. package/dist/components/components/input/Input.vue.d.ts +1102 -0
  87. package/dist/components/components/itineraries/Itinerary.vue.d.ts +871 -0
  88. package/dist/components/components/itineraries/components/ItineraryBorderOverlapWrapper.vue.d.ts +2 -0
  89. package/dist/components/components/itineraries/components/ItineraryDay.vue.d.ts +1843 -0
  90. package/dist/components/components/itineraries/components/ItineraryStop.vue.d.ts +760 -0
  91. package/dist/components/components/itineraries/components/ItineraryStopInfo.vue.d.ts +857 -0
  92. package/dist/components/components/itineraries/components/ItineraryTips.vue.d.ts +2 -0
  93. package/dist/components/components/itineraries/itineraries.store.d.ts +30 -0
  94. package/dist/components/components/link/Link.vue.d.ts +443 -0
  95. package/dist/components/components/link-list/LinkList.vue.d.ts +68 -0
  96. package/dist/components/components/link-list/components/LinkListItem.vue.d.ts +488 -0
  97. package/dist/components/components/list/List.vue.d.ts +50 -0
  98. package/dist/components/components/listicle/ListicleItem.vue.d.ts +565 -0
  99. package/dist/components/components/loading-spinner/LoadingSpinner.vue.d.ts +18 -0
  100. package/dist/components/components/map/Map.vue.d.ts +1461 -0
  101. package/dist/components/components/map/components/MapMarker.vue.d.ts +429 -0
  102. package/dist/components/components/map-marker-icon/MapMarkerIcon.vue.d.ts +342 -0
  103. package/dist/components/components/map-with-sidebar/MapWithSidebar.vue.d.ts +8531 -0
  104. package/dist/components/components/map-with-sidebar/components/MapWithSidebarButtons.vue.d.ts +730 -0
  105. package/dist/components/components/map-with-sidebar/components/MapWithSidebarCategory.vue.d.ts +690 -0
  106. package/dist/components/components/map-with-sidebar/components/MapWithSidebarControls.vue.d.ts +705 -0
  107. package/dist/components/components/map-with-sidebar/components/MapWithSidebarDetail.vue.d.ts +205 -0
  108. package/dist/components/components/map-with-sidebar/components/MapWithSidebarListItem.vue.d.ts +479 -0
  109. package/dist/components/components/map-with-sidebar/components/MapWithSidebarPanel.vue.d.ts +4442 -0
  110. package/dist/components/components/map-with-sidebar/components/MapWithSidebarSubcategory.vue.d.ts +711 -0
  111. package/dist/components/components/media-caption/MediaCaption.vue.d.ts +187 -0
  112. package/dist/components/components/mega-nav/MegaNav.vue.d.ts +4667 -0
  113. package/dist/components/components/mega-nav/components/MegaNavAccordionItem.vue.d.ts +1838 -0
  114. package/dist/components/components/mega-nav/components/MegaNavDropdown.vue.d.ts +865 -0
  115. package/dist/components/components/mega-nav/components/MegaNavDropdownContainer.vue.d.ts +1351 -0
  116. package/dist/components/components/mega-nav/components/MegaNavFeaturedEvent.vue.d.ts +2522 -0
  117. package/dist/components/components/mega-nav/components/MegaNavFeaturedItem.vue.d.ts +2541 -0
  118. package/dist/components/components/mega-nav/components/MegaNavList.vue.d.ts +100 -0
  119. package/dist/components/components/mega-nav/components/MegaNavListItem.vue.d.ts +457 -0
  120. package/dist/components/components/mega-nav/components/MegaNavMobileMenu.vue.d.ts +24 -0
  121. package/dist/components/components/mega-nav/components/MegaNavStaticLink.vue.d.ts +445 -0
  122. package/dist/components/components/mega-nav/components/MegaNavTopMenu.vue.d.ts +34 -0
  123. package/dist/components/components/megalinks/Megalinks.vue.d.ts +1075 -0
  124. package/dist/components/components/megalinks/components/megalink-link-list/MegalinkLinkList.vue.d.ts +3079 -0
  125. package/dist/components/components/megalinks/components/megalink-multi-image/MegalinkMultiImage.vue.d.ts +3084 -0
  126. package/dist/components/components/megalinks/components/megalink-single-image/MegalinkSingleImage.vue.d.ts +977 -0
  127. package/dist/components/components/modal/Modal.vue.d.ts +1934 -0
  128. package/dist/components/components/module-wrapper/ModuleWrapper.vue.d.ts +308 -0
  129. package/dist/components/components/navigation-bar/NavigationBar.vue.d.ts +2781 -0
  130. package/dist/components/components/navigation-bar/components/NavigationBarMenu.vue.d.ts +20 -0
  131. package/dist/components/components/navigation-bar/components/NavigationBarMenuDropdown.vue.d.ts +954 -0
  132. package/dist/components/components/navigation-bar/components/NavigationBarMenuItem.vue.d.ts +67 -0
  133. package/dist/components/components/navigation-bar/components/NavigationBarSearch.vue.d.ts +2895 -0
  134. package/dist/components/components/navigation-bar/components/NavigationBarSidebar.vue.d.ts +1108 -0
  135. package/dist/components/components/navigation-bar/components/NavigationBarSidebarButton.vue.d.ts +1513 -0
  136. package/dist/components/components/number-input/NumberInput.vue.d.ts +1069 -0
  137. package/dist/components/components/page-intro/PageIntro.vue.d.ts +287 -0
  138. package/dist/components/components/pagination/VsPagination.vue.d.ts +16 -0
  139. package/dist/components/components/panel/Panel.vue.d.ts +26 -0
  140. package/dist/components/components/product-search/ProductSearch.vue.d.ts +1336 -0
  141. package/dist/components/components/product-search/components/Autocomplete.vue.d.ts +18 -0
  142. package/dist/components/components/product-search/components/DateInput.vue.d.ts +13 -0
  143. package/dist/components/components/product-search/components/DateRange.vue.d.ts +48 -0
  144. package/dist/components/components/product-search/components/ProductSearchEmbed.vue.d.ts +55 -0
  145. package/dist/components/components/progress-bar/ProgressBar.vue.d.ts +199 -0
  146. package/dist/components/components/quote/Quote.vue.d.ts +472 -0
  147. package/dist/components/components/radio-button/RadioButton.vue.d.ts +444 -0
  148. package/dist/components/components/recaptcha/Recaptcha.vue.d.ts +116 -0
  149. package/dist/components/components/section-header/SectionHeader.vue.d.ts +231 -0
  150. package/dist/components/components/select/Select.vue.d.ts +252 -0
  151. package/dist/components/components/site-search/SiteSearch.vue.d.ts +718 -0
  152. package/dist/components/components/site-search/components/SiteSearchForm.vue.d.ts +2161 -0
  153. package/dist/components/components/ski-scotland/ski-scotland-card/SkiScotlandCard.vue.d.ts +2838 -0
  154. package/dist/components/components/ski-scotland/ski-scotland-status/SkiScotlandStatus.vue.d.ts +4505 -0
  155. package/dist/components/components/skip-to/SkipTo.vue.d.ts +435 -0
  156. package/dist/components/components/social-credit-link/SocialCreditLink.vue.d.ts +732 -0
  157. package/dist/components/components/social-share/SocialShare.vue.d.ts +1704 -0
  158. package/dist/components/components/social-share/components/SocialShareItem.vue.d.ts +850 -0
  159. package/dist/components/components/spotlight-section/SpotlightSection.vue.d.ts +860 -0
  160. package/dist/components/components/stretched-link-card/StretchedLinkCard.vue.d.ts +2591 -0
  161. package/dist/components/components/stretched-link-card/components/StretchedLinkPanels.vue.d.ts +359 -0
  162. package/dist/components/components/styled-list/StyledList.vue.d.ts +18 -0
  163. package/dist/components/components/styled-list/components/StyledListItem.vue.d.ts +22 -0
  164. package/dist/components/components/summary-box/SummaryBoxList.vue.d.ts +2 -0
  165. package/dist/components/components/summary-box/components/SummaryBoxDistanceListItem.vue.d.ts +99 -0
  166. package/dist/components/components/summary-box/components/SummaryBoxListItem.vue.d.ts +359 -0
  167. package/dist/components/components/svg/Svg.vue.d.ts +71 -0
  168. package/dist/components/components/svg-link/SvgLink.vue.d.ts +563 -0
  169. package/dist/components/components/table/Table.vue.d.ts +117 -0
  170. package/dist/components/components/table/components/TableBody.vue.d.ts +24 -0
  171. package/dist/components/components/table/components/TableDataCell.vue.d.ts +54 -0
  172. package/dist/components/components/table/components/TableFooter.vue.d.ts +24 -0
  173. package/dist/components/components/table/components/TableHead.vue.d.ts +24 -0
  174. package/dist/components/components/table/components/TableHeaderCell.vue.d.ts +57 -0
  175. package/dist/components/components/table/components/TableRow.vue.d.ts +24 -0
  176. package/dist/components/components/tabs/Tabs.vue.d.ts +268 -0
  177. package/dist/components/components/tabs/components/TabItem.vue.d.ts +198 -0
  178. package/dist/components/components/tag/Tag.vue.d.ts +409 -0
  179. package/dist/components/components/tag-manager-wrapper/TagManagerWrapper.vue.d.ts +48 -0
  180. package/dist/components/components/textarea/Textarea.vue.d.ts +382 -0
  181. package/dist/components/components/toggle-button/ToggleButton.vue.d.ts +1400 -0
  182. package/dist/components/components/tooltip/Tooltip.vue.d.ts +820 -0
  183. package/dist/components/components/tourism-info/TourismInfo.vue.d.ts +125 -0
  184. package/dist/components/components/video/Video.vue.d.ts +3003 -0
  185. package/dist/components/components/video/components/VideoHtml5.vue.d.ts +1585 -0
  186. package/dist/components/components/video/components/VideoYoutube.vue.d.ts +1321 -0
  187. package/dist/components/components/video-caption/VideoCaption.vue.d.ts +3181 -0
  188. package/dist/components/components/warning/Warning.vue.d.ts +1068 -0
  189. package/dist/components/custom-components/federated-search/FederatedSearch.vue.d.ts +40 -0
  190. package/dist/components/custom-components/federated-search/components/FedFilter.vue.d.ts +29 -0
  191. package/dist/components/custom-components/federated-search/components/FedSearchInput.vue.d.ts +21 -0
  192. package/dist/components/custom-components/federated-search/components/FedSearchSort.vue.d.ts +16 -0
  193. package/dist/components/custom-components/federated-search/composables/dataLayerComposable.d.ts +47 -0
  194. package/dist/components/custom-components/federated-search/index.d.ts +222 -0
  195. package/dist/components/custom-components/federated-search/stores/federatedSearch.store.d.ts +126 -0
  196. package/dist/components/custom-components/maps/MainMap.vue.d.ts +39 -0
  197. package/dist/components/custom-components/maps/components/MapFeaturedLocation.vue.d.ts +7 -0
  198. package/dist/components/custom-components/maps/components/MapFeaturedLocationItem.vue.d.ts +7 -0
  199. package/dist/components/custom-components/maps/components/MapSidebar.vue.d.ts +25 -0
  200. package/dist/components/custom-components/maps/composables/dataLayerComposable.d.ts +47 -0
  201. package/dist/components/custom-components/maps/composables/useViewportController.d.ts +65 -0
  202. package/dist/components/custom-components/maps/composables/verifyCookiesComposable.d.ts +8 -0
  203. package/dist/components/custom-components/maps/index.d.ts +118 -0
  204. package/dist/{src → components}/mixins/dataLayerMixin.d.ts +3 -1
  205. package/dist/components/stores/dataLayer.store.d.ts +31 -0
  206. package/dist/components/stores/mainMap.store.d.ts +29 -0
  207. package/dist/components/stores/map.store.d.ts +74 -0
  208. package/dist/{src → components}/stores/video.store.d.ts +3 -1
  209. package/dist/components/style.css +1 -1
  210. package/dist/components/vs-component-library-maps.js +1 -1
  211. package/dist/components/vs-component-library-maps.mjs +1 -1
  212. package/dist/components/vs-component-library.js +7 -5
  213. package/dist/components/vs-component-library.mjs +43 -28
  214. package/package.json +30 -33
  215. package/dist/components/LoadingSpinner-DKGM-64Z.js +0 -36
  216. package/dist/src/components/content-swiper/components/ContentSwiperSlide.d.ts +0 -1
  217. package/dist/src/components/grid/index.d.ts +0 -1
  218. package/dist/src/components/itineraries/itineraries.store.d.ts +0 -2
  219. package/dist/src/custom-components/federated-search/components/__tests__/FedFilter.jest.spec.d.ts +0 -1
  220. package/dist/src/custom-components/federated-search/components/__tests__/FedSearchSort.jest.spec.d.ts +0 -1
  221. package/dist/src/custom-components/federated-search/composables/dataLayerComposable.d.ts +0 -14
  222. package/dist/src/custom-components/federated-search/index.d.ts +0 -7
  223. package/dist/src/custom-components/federated-search/stores/federatedSearch.store.d.ts +0 -2
  224. package/dist/src/custom-components/maps/components/__tests__/MapSidebar.jest.spec.d.ts +0 -1
  225. package/dist/src/custom-components/maps/composables/dataLayerComposable.d.ts +0 -14
  226. package/dist/src/custom-components/maps/composables/useViewportController.d.ts +0 -15
  227. package/dist/src/custom-components/maps/composables/verifyCookiesComposable.d.ts +0 -6
  228. package/dist/src/custom-components/maps/index.d.ts +0 -7
  229. package/dist/src/directives/hand-down-focus.d.ts +0 -7
  230. package/dist/src/mixins/__mocks__/verifyCookiesMixin.d.ts +0 -11
  231. package/dist/src/stores/dataLayer.store.d.ts +0 -2
  232. package/dist/src/stores/mainMap.store.d.ts +0 -2
  233. package/dist/src/stores/map.store.d.ts +0 -2
  234. package/dist/src/utils/breakpoints.d.ts +0 -2
  235. package/dist/src/utils/event-bus.d.ts +0 -15
  236. package/dist/src/utils/get-token.d.ts +0 -2
  237. package/dist/src/utils/hash-code.d.ts +0 -2
  238. /package/dist/{src → components}/component-entry.d.ts +0 -0
  239. /package/dist/{src → components}/components/index.d.ts +0 -0
  240. /package/dist/{src → components}/components/map-index.d.ts +0 -0
  241. /package/dist/{src → components}/constants.d.ts +0 -0
  242. /package/dist/{src → components}/custom-components/federated-search/utils/cludo-autocomplete.d.ts +0 -0
  243. /package/dist/{src → components}/custom-components/federated-search/utils/cludo-search.d.ts +0 -0
  244. /package/dist/{src → components}/custom-components/federated-search/utils/event-search.d.ts +0 -0
  245. /package/dist/{src → components}/custom-components/index.d.ts +0 -0
  246. /package/dist/{src → components}/directives/click-outside.d.ts +0 -0
  247. /package/dist/{src → components}/mixins/ariaDescriptionMixin.d.ts +0 -0
  248. /package/dist/{src → components}/mixins/cookieMixin.d.ts +0 -0
  249. /package/dist/{src → components}/mixins/imgSizesMixin.d.ts +0 -0
  250. /package/dist/{src → components}/mixins/mapIconMapping.d.ts +0 -0
  251. /package/dist/{src → components}/mixins/srcSetMixin.d.ts +0 -0
  252. /package/dist/{src → components}/mixins/validateFormElementMixin.d.ts +0 -0
  253. /package/dist/{src → components}/mixins/verifyCookiesMixin.d.ts +0 -0
  254. /package/dist/{src → components}/stores/index.d.ts +0 -0
  255. /package/dist/{src → components}/types/types.d.ts +0 -0
  256. /package/dist/{src → components}/utils/axios.d.ts +0 -0
  257. /package/dist/{src → components}/utils/check-vendor-library.d.ts +0 -0
  258. /package/dist/{src → components}/utils/data-layer-templates.d.ts +0 -0
  259. /package/dist/{src → components}/utils/dmo-analytics-logic.d.ts +0 -0
  260. /package/dist/{src → components}/utils/get-env-value.d.ts +0 -0
  261. /package/dist/{src → components}/utils/js-is-disabled.d.ts +0 -0
  262. /package/dist/{src → components}/utils/lang.d.ts +0 -0
  263. /package/dist/{src → components}/utils/os-branding.d.ts +0 -0
  264. /package/dist/{src → components}/utils/prefers-reduced-motion.d.ts +0 -0
  265. /package/dist/{src → components}/utils/required-cookies-data.d.ts +0 -0
  266. /package/dist/{src → components}/utils/svg-context.d.ts +0 -0
  267. /package/dist/{src → components}/utils/utils.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const wt=require("./LoadingSpinner-DKGM-64Z.js"),q=require("vue"),pa=require("pinia");let Wa=null;typeof window<"u"&&(Wa=document.currentScript);const Py={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data &copy; Crown copyright and database rights YYYY",prefix:"",suffix:""},init(y){if(typeof window<"u"){Wa&&(this.options.div=Wa.getAttribute("data-div")||this.options.div,this.options.logo=Wa.getAttribute("data-logo")||this.options.logo,this.options.statement=Wa.getAttribute("data-statement")||this.options.statement,this.options.prefix=Wa.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Wa.getAttribute("data-suffix")||this.options.suffix),y=typeof y<"u"?y:{},Object.assign(this.options,y);const _=document.getElementById(this.options.div);let b="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(b="os-api-branding logo white");let M=this.options.statement;M=M.replace("YYYY",new Date().getFullYear()),this.options.prefix!==""&&(M=`${this.options.prefix}<span>|</span>${M}`),this.options.suffix!==""&&(M=`${M}<span>|</span>${this.options.suffix}`),document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach(u=>u.remove());const E=document.createElement("div");E.className=b,_.appendChild(E);const R=document.createElement("div");R.className="os-api-branding copyright",R.innerHTML=M,_.appendChild(R)}}},Sn=pa.defineStore("map",()=>{const y=q.ref([]),_=q.ref([]),b=q.ref(null),M=q.ref(null),E=q.ref(null);function R(be){y.value.push({id:be.id,filters:be.filters,places:be.places,activePins:be.activePins,hovered:"",activePlace:null})}function u(be){y.value.forEach(ke=>{ke.id===be.mapId&&(ke.hovered=be.hoveredFeature)})}function U(be){y.value.forEach(ke=>{ke.id===be.mapId&&(ke.activePlace=be.activeFeature)})}function k(be){_.value=be}function J(be){b.value=be}function X(be){M.value=be}function ae(be){return y.value.find(ke=>ke.id===be)}function Y(be){return y.value.find(Oe=>Oe.id===be)?.hovered}function Te(be){return y.value.find(Oe=>Oe.id===be)?.activePlace}return{maps:y,activeSubcatFilters:_,selectedSubCategory:b,activeMarkerPos:M,activePlace:E,addMapInstance:R,setHoveredPlace:u,setActivePlace:U,setActiveSubcatFilters:k,setSelectedSubcat:J,setActiveMarkerPos:X,getMapById:ae,getHoveredStop:Y,getActivePlace:Te}});var _c={exports:{}},S0=_c.exports,Cy;function I0(){return Cy||(Cy=1,(function(y,_){(function(b,M){y.exports=M()})(S0,(function(){var b,M,E;function R(u,U){if(!b)b=U;else if(!M)M=U;else{var k="var sharedChunk = {}; ("+b+")(sharedChunk); ("+M+")(sharedChunk);",J={};b(J),E=U(J),typeof window<"u"&&(E.workerUrl=window.URL.createObjectURL(new Blob([k],{type:"text/javascript"})))}}return R(["exports"],(function(u){function U(e,t){return e(t={exports:{}},t.exports),t.exports}var k=J;function J(e,t,r,a){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=a,this.p2x=r,this.p2y=a}J.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},J.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},J.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},J.prototype.solveCurveX=function(e,t){var r,a,l,c,h;for(t===void 0&&(t=1e-6),l=e,h=0;h<8;h++){if(c=this.sampleCurveX(l)-e,Math.abs(c)<t)return l;var m=this.sampleCurveDerivativeX(l);if(Math.abs(m)<1e-6)break;l-=c/m}if((l=e)<(r=0))return r;if(l>(a=1))return a;for(;r<a;){if(c=this.sampleCurveX(l),Math.abs(c-e)<t)return l;e>c?r=l:a=l,l=.5*(a-r)+r}return l},J.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var X=ae;function ae(e,t){this.x=e,this.y=t}ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),a=Math.sin(e),l=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ae.convert=function(e){return e instanceof ae?e:Array.isArray(e)?new ae(e[0],e[1]):e};var Y=typeof self<"u"?self:{},Te=Math.pow(2,53)-1;function be(e,t,r,a){var l=new k(e,t,r,a);return function(c){return l.solve(c)}}var ke=be(.25,.1,.25,1);function Oe(e,t,r){return Math.min(r,Math.max(t,e))}function Ve(e,t,r){var a=r-t,l=((e-t)%a+a)%a+t;return l===t?r:l}function Re(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}var ve=1;function Ke(){return ve++}function We(){return(function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)})()}function It(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function we(e,t){e.forEach((function(r){t[r]&&(t[r]=t[r].bind(t))}))}function Ge(e,t){return e.indexOf(t,e.length-t.length)!==-1}function Fe(e,t,r){var a={};for(var l in e)a[l]=t.call(r||this,e[l],l,e);return a}function tt(e,t,r){var a={};for(var l in e)t.call(r||this,e[l],l,e)&&(a[l]=e[l]);return a}function kt(e){return Array.isArray(e)?e.map(kt):typeof e=="object"&&e?Fe(e,kt):e}var Wt={};function St(e){Wt[e]||(typeof console<"u"&&console.warn(e),Wt[e]=!0)}function Ut(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Hr(e){for(var t=0,r=0,a=e.length,l=a-1,c=void 0,h=void 0;r<a;l=r++)t+=((h=e[l]).x-(c=e[r]).x)*(c.y+h.y);return t}function Er(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function bi(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(a,l,c,h){var m=c||h;return t[l]=!m||m.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var or=null;function Rr(e){if(or==null){var t=e.navigator?e.navigator.userAgent:null;or=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return or}function et(e){try{var t=Y[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Lr,Xr,At,Fr,Mi=Y.performance&&Y.performance.now?Y.performance.now.bind(Y.performance):Date.now.bind(Date),pi=Y.requestAnimationFrame||Y.mozRequestAnimationFrame||Y.webkitRequestAnimationFrame||Y.msRequestAnimationFrame,Or=Y.cancelAnimationFrame||Y.mozCancelAnimationFrame||Y.webkitCancelAnimationFrame||Y.msCancelAnimationFrame,Xi={now:Mi,frame:function(e){var t=pi(e);return{cancel:function(){return Or(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var r=Y.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,a.drawImage(e,0,0,e.width,e.height),a.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Lr||(Lr=Y.document.createElement("a")),Lr.href=e,Lr.href},hardwareConcurrency:Y.navigator&&Y.navigator.hardwareConcurrency||4,get devicePixelRatio(){return Y.devicePixelRatio},get prefersReducedMotion(){return!!Y.matchMedia&&(Xr==null&&(Xr=Y.matchMedia("(prefers-reduced-motion: reduce)")),Xr.matches)}},Nt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"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},Nr={supported:!1,testSupport:function(e){!ar&&Fr&&(sr?lt(e):At=e)}},ar=!1,sr=!1;function lt(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Fr),e.isContextLost())return;Nr.supported=!0}catch{}e.deleteTexture(t),ar=!0}Y.document&&((Fr=Y.document.createElement("img")).onload=function(){At&&lt(At),At=null,sr=!0},Fr.onerror=function(){ar=!0,At=null},Fr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var mr="01",pr=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function jr(e){return e.indexOf("mapbox:")===0}pr.prototype._createSkuToken=function(){var e=(function(){for(var t="",r=0;r<10;r++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",mr,t].join(""),tokenExpiresAt:Date.now()+432e5}})();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},pr.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},pr.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},pr.prototype.normalizeStyleURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},pr.prototype.normalizeGlyphsURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},pr.prototype.normalizeSourceURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},pr.prototype.normalizeSpriteURL=function(e,t,r,a){var l=Kr(e);return jr(e)?(l.path="/styles/v1"+l.path+"/sprite"+t+r,this._makeAPIURL(l,this._customAccessToken||a)):(l.path+=""+t+r,Bi(l))},pr.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!jr(e))return e;var r=Kr(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Xi.devicePixelRatio>=2||t===512?"@2x":"")+(Nr.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||(function(l){for(var c=0,h=l;c<h.length;c+=1){var m=h[c].match(/^access_token=(.*)$/);if(m)return m[1]}return null})(r.params)||Nt.ACCESS_TOKEN;return Nt.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},pr.prototype.canonicalizeTileURL=function(e,t){var r=Kr(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var a="mapbox://tiles/";a+=r.path.replace("/v4/","");var l=r.params;return t&&(l=l.filter((function(c){return!c.match(/^access_token=/)}))),l.length&&(a+="?"+l.join("&")),a},pr.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&jr(t),a=[],l=0,c=e.tiles||[];l<c.length;l+=1){var h=c[l];br(h)?a.push(this.canonicalizeTileURL(h,r)):a.push(h)}return a},pr.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",a=Kr(Nt.API_URL);if(e.protocol=a.protocol,e.authority=a.authority,e.protocol==="http"){var l=e.params.indexOf("secure");l>=0&&e.params.splice(l,1)}if(a.path!=="/"&&(e.path=""+a.path+e.path),!Nt.REQUIRE_ACCESS_TOKEN)return Bi(e);if(!(t=t||Nt.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if(t[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(c){return c.indexOf("access_token")===-1})),e.params.push("access_token="+t),Bi(e)};var hr=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function br(e){return hr.test(e)}var dn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Kr(e){var t=e.match(dn);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Bi(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function hi(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(Y.atob(t[1]).split("").map((function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch{return null}}var ti=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ti.prototype.getStorageKey=function(e){var t,r=hi(Nt.ACCESS_TOKEN);return t=r&&r.u?Y.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(a,l){return String.fromCharCode(+("0x"+l))}))):Nt.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+t:"mapbox.eventData:"+t},ti.prototype.fetchEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var a=Y.localStorage.getItem(t);a&&(this.eventData=JSON.parse(a));var l=Y.localStorage.getItem(r);l&&(this.anonId=l)}catch{St("Unable to read from LocalStorage")}},ti.prototype.saveEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{Y.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&Y.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{St("Unable to write to LocalStorage")}},ti.prototype.processRequests=function(e){},ti.prototype.postEvent=function(e,t,r,a){var l=this;if(Nt.EVENTS_URL){var c=Kr(Nt.EVENTS_URL);c.params.push("access_token="+(a||Nt.ACCESS_TOKEN||""));var h={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:mr,userId:this.anonId},m=t?Re(h,t):h,g={url:Bi(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([m])};this.pendingRequest=Yt(g,(function(x){l.pendingRequest=null,r(x),l.saveEventData(),l.processRequests(a)}))}},ti.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var ri,Vi,Ki=(function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(r,a,l,c){this.skuToken=l;var h=!(!c&&!Nt.ACCESS_TOKEN),m=Array.isArray(r)&&r.some((function(g){return jr(g)||br(g)}));Nt.EVENTS_URL&&h&&m&&this.queueRequest({id:a,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){var l=this.queue.shift(),c=l.id,h=l.timestamp;c&&this.success[c]||(this.anonId||this.fetchEventData(),It(this.anonId)||(this.anonId=We()),this.postEvent(h,{skuToken:this.skuToken},(function(m){m||c&&(a.success[c]=!0)}),r))}},t})(ti),yo=new((function(e){function t(r){e.call(this,"appUserTurnstile"),this._customAccessToken=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(r,a){Nt.EVENTS_URL&&Nt.ACCESS_TOKEN&&Array.isArray(r)&&r.some((function(l){return jr(l)||br(l)}))&&this.queueRequest(Date.now(),a)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var l=hi(Nt.ACCESS_TOKEN),c=l?l.u:Nt.ACCESS_TOKEN,h=c!==this.eventData.tokenU;It(this.anonId)||(this.anonId=We(),h=!0);var m=this.queue.shift();if(this.eventData.lastSuccess){var g=new Date(this.eventData.lastSuccess),x=new Date(m),S=(m-this.eventData.lastSuccess)/864e5;h=h||S>=1||S<-1||g.getDate()!==x.getDate()}else h=!0;if(!h)return this.processRequests();this.postEvent(m,{"enabled.telemetry":!1},(function(I){I||(a.eventData.lastSuccess=m,a.eventData.tokenU=c)}),r)}},t})(ti)),Zo=yo.postTurnstileEvent.bind(yo),mn=new Ki,Mn=mn.postMapLoadEvent.bind(mn),Bn=500,$o=50;function jn(){Y.caches&&!ri&&(ri=Y.caches.open("mapbox-tiles"))}function zn(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var rn,fe=1/0;function _e(){return rn==null&&(rn=Y.OffscreenCanvas&&new Y.OffscreenCanvas(1,1).getContext("2d")&&typeof Y.createImageBitmap=="function"),rn}var jt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(jt);var tr=(function(e){function t(r,a,l){a===401&&br(l)&&(r+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,r),this.status=a,this.url=l,this.name=this.constructor.name,this.message=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t})(Error),Kt=Er()?function(){return self.worker&&self.worker.referrer}:function(){return(Y.location.protocol==="blob:"?Y.parent:Y).location.href},_t,fi,qi=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(Kt())&&!/^\w+:/.test(r))){if(Y.fetch&&Y.Request&&Y.AbortController&&Y.Request.prototype.hasOwnProperty("signal"))return(function(a,l){var c,h=new Y.AbortController,m=new Y.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:Kt(),signal:h.signal}),g=!1,x=!1,S=(c=m.url).indexOf("sku=")>0&&br(c);a.type==="json"&&m.headers.set("Accept","application/json");var I=function(z,j,G){if(!x){if(z&&z.message!=="SecurityError"&&St(z),j&&G)return C(j);var te=Date.now();Y.fetch(m).then((function(K){if(K.ok){var oe=S?K.clone():null;return C(K,oe,te)}return l(new tr(K.statusText,K.status,a.url))})).catch((function(K){K.code!==20&&l(new Error(K.message))}))}},C=function(z,j,G){(a.type==="arrayBuffer"?z.arrayBuffer():a.type==="json"?z.json():z.text()).then((function(te){x||(j&&G&&(function(K,oe,le){if(jn(),ri){var ce={status:oe.status,statusText:oe.statusText,headers:new Y.Headers};oe.headers.forEach((function(xe,Pe){return ce.headers.set(Pe,xe)}));var he=bi(oe.headers.get("Cache-Control")||"");he["no-store"]||(he["max-age"]&&ce.headers.set("Expires",new Date(le+1e3*he["max-age"]).toUTCString()),new Date(ce.headers.get("Expires")).getTime()-le<42e4||(function(xe,Pe){if(Vi===void 0)try{new Response(new ReadableStream),Vi=!0}catch{Vi=!1}Vi?Pe(xe.body):xe.blob().then(Pe)})(oe,(function(xe){var Pe=new Y.Response(xe,ce);jn(),ri&&ri.then((function(De){return De.put(zn(K.url),Pe)})).catch((function(De){return St(De.message)}))})))}})(m,j,G),g=!0,l(null,te,z.headers.get("Cache-Control"),z.headers.get("Expires")))})).catch((function(te){x||l(new Error(te.message))}))};return S?(function(z,j){if(jn(),!ri)return j(null);var G=zn(z.url);ri.then((function(te){te.match(G).then((function(K){var oe=(function(le){if(!le)return!1;var ce=new Date(le.headers.get("Expires")||0),he=bi(le.headers.get("Cache-Control")||"");return ce>Date.now()&&!he["no-cache"]})(K);te.delete(G),oe&&te.put(G,K.clone()),j(null,K,oe)})).catch(j)})).catch(j)})(m,I):I(null,null),{cancel:function(){x=!0,g||h.abort()}}})(e,t);if(Er()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return(function(a,l){var c=new Y.XMLHttpRequest;for(var h in c.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(c.responseType="arraybuffer"),a.headers)c.setRequestHeader(h,a.headers[h]);return a.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=a.credentials==="include",c.onerror=function(){l(new Error(c.statusText))},c.onload=function(){if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){var m=c.response;if(a.type==="json")try{m=JSON.parse(c.response)}catch(g){return l(g)}l(null,m,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else l(new tr(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}})(e,t)},ii=function(e,t){return qi(Re(e,{type:"arrayBuffer"}),t)},Yt=function(e,t){return qi(Re(e,{method:"POST"}),t)},T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";_t=[],fi=0;var P=function(e,t){if(Nr.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),fi>=Nt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return _t.push(r),r}fi++;var a=!1,l=function(){if(!a)for(a=!0,fi--;_t.length&&fi<Nt.MAX_PARALLEL_IMAGE_REQUESTS;){var h=_t.shift();h.cancelled||(h.cancel=P(h.requestParameters,h.callback).cancel)}},c=ii(e,(function(h,m,g,x){l(),h?t(h):m&&(_e()?(function(S,I){var C=new Y.Blob([new Uint8Array(S)],{type:"image/png"});Y.createImageBitmap(C).then((function(z){I(null,z)})).catch((function(z){I(new Error("Could not load image because of "+z.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))})(m,t):(function(S,I,C,z){var j=new Y.Image,G=Y.URL;j.onload=function(){I(null,j),G.revokeObjectURL(j.src),j.onload=null,Y.requestAnimationFrame((function(){j.src=T}))},j.onerror=function(){return I(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 te=new Y.Blob([new Uint8Array(S)],{type:"image/png"});j.cacheControl=C,j.expires=z,j.src=S.byteLength?G.createObjectURL(te):T})(m,t,g,x))}));return{cancel:function(){c.cancel(),l()}}};function B(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function V(e,t,r){if(r&&r[e]){var a=r[e].indexOf(t);a!==-1&&r[e].splice(a,1)}}var Z=function(e,t){t===void 0&&(t={}),Re(this,t),this.type=e},re=(function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",Re({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Z),ie=function(){};ie.prototype.on=function(e,t){return this._listeners=this._listeners||{},B(e,t,this._listeners),this},ie.prototype.off=function(e,t){return V(e,t,this._listeners),V(e,t,this._oneTimeListeners),this},ie.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},B(e,t,this._oneTimeListeners),this},ie.prototype.fire=function(e,t){typeof e=="string"&&(e=new Z(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var a=0,l=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];a<l.length;a+=1)l[a].call(this,e);for(var c=0,h=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];c<h.length;c+=1){var m=h[c];V(r,m,this._oneTimeListeners),m.call(this,e)}var g=this._eventedParent;g&&(Re(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(e))}else e instanceof re&&console.error(e.error);return this},ie.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ie.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var L={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},H=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function se(e){var t=e.value;return t?[new H(e.key,t,"constants have been deprecated as of v8")]:[]}function Se(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}function Ee(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function me(e){if(Array.isArray(e))return e.map(me);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=me(e[r]);return t}return Ee(e)}var Ae=(function(e){function t(r,a){e.call(this,a),this.message=a,this.key=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Error),Je=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var r=0,a=t;r<a.length;r+=1){var l=a[r];this.bindings[l[0]]=l[1]}};Je.prototype.concat=function(e){return new Je(this,e)},Je.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Je.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Ze={kind:"null"},ge={kind:"number"},Ne={kind:"string"},ze={kind:"boolean"},Be={kind:"color"},yt={kind:"object"},qe={kind:"value"},Et={kind:"collator"},rr={kind:"formatted"},Pt={kind:"resolvedImage"};function Gt(e,t){return{kind:"array",itemType:e,N:t}}function Dt(e){if(e.kind==="array"){var t=Dt(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var wi=[Ze,ge,Ne,ze,Be,rr,yt,Gt(qe),Pt];function Ht(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Ht(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(var r=0,a=wi;r<a.length;r+=1)if(!Ht(a[r],t))return null}}return"Expected "+Dt(e)+" but found "+Dt(t)+" instead."}function Pr(e,t){return t.some((function(r){return r.kind===e.kind}))}function Qt(e,t){return t.some((function(r){return r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e}))}var Bt=U((function(e,t){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 a(m){return(m=Math.round(m))<0?0:m>255?255:m}function l(m){return a(m[m.length-1]==="%"?parseFloat(m)/100*255:parseInt(m))}function c(m){return(g=m[m.length-1]==="%"?parseFloat(m)/100:parseFloat(m))<0?0:g>1?1:g;var g}function h(m,g,x){return x<0?x+=1:x>1&&(x-=1),6*x<1?m+(g-m)*x*6:2*x<1?g:3*x<2?m+(g-m)*(2/3-x)*6:m}try{t.parseCSSColor=function(m){var g,x=m.replace(/ /g,"").toLowerCase();if(x in r)return r[x].slice();if(x[0]==="#")return x.length===4?(g=parseInt(x.substr(1),16))>=0&&g<=4095?[(3840&g)>>4|(3840&g)>>8,240&g|(240&g)>>4,15&g|(15&g)<<4,1]:null:x.length===7&&(g=parseInt(x.substr(1),16))>=0&&g<=16777215?[(16711680&g)>>16,(65280&g)>>8,255&g,1]:null;var S=x.indexOf("("),I=x.indexOf(")");if(S!==-1&&I+1===x.length){var C=x.substr(0,S),z=x.substr(S+1,I-(S+1)).split(","),j=1;switch(C){case"rgba":if(z.length!==4)return null;j=c(z.pop());case"rgb":return z.length!==3?null:[l(z[0]),l(z[1]),l(z[2]),j];case"hsla":if(z.length!==4)return null;j=c(z.pop());case"hsl":if(z.length!==3)return null;var G=(parseFloat(z[0])%360+360)%360/360,te=c(z[1]),K=c(z[2]),oe=K<=.5?K*(te+1):K+te-K*te,le=2*K-oe;return[a(255*h(le,oe,G+1/3)),a(255*h(le,oe,G)),a(255*h(le,oe,G-1/3)),j];default:return null}}return null}}catch{}})).parseCSSColor,Zt=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};Zt.parse=function(e){if(e){if(e instanceof Zt)return e;if(typeof e=="string"){var t=Bt(e);if(t)return new Zt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Zt.prototype.toString=function(){var e=this.toArray(),t=e[1],r=e[2],a=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+a+")"},Zt.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},Zt.black=new Zt(0,0,0,1),Zt.white=new Zt(1,1,1,1),Zt.transparent=new Zt(0,0,0,0),Zt.red=new Zt(1,0,0,1);var zi=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};zi.prototype.compare=function(e,t){return this.collator.compare(e,t)},zi.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ma=function(e,t,r,a,l){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=l},ni=function(e){this.sections=e};ni.fromString=function(e){return new ni([new ma(e,null,null,null,null)])},ni.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some((function(e){return e.text.length!==0||e.image&&e.image.name.length!==0}))},ni.factory=function(e){return e instanceof ni?e:ni.fromString(e)},ni.prototype.toString=function(){return this.sections.length===0?"":this.sections.map((function(e){return e.text})).join("")},ni.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];if(a.image)e.push(["image",a.image.name]);else{e.push(a.text);var l={};a.fontStack&&(l["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(l["font-scale"]=a.scale),a.textColor&&(l["text-color"]=["rgba"].concat(a.textColor.toArray())),e.push(l)}}return e};var Di=function(e){this.name=e.name,this.available=e.available};function eu(e,t,r,a){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value ["+[e,t,r,a].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof a=="number"?[e,t,r,a]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ya(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof Zt||e instanceof zi||e instanceof ni||e instanceof Di)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!ya(r[t]))return!1;return!0}if(typeof e=="object"){for(var a in e)if(!ya(e[a]))return!1;return!0}return!1}function Cr(e){if(e===null)return Ze;if(typeof e=="string")return Ne;if(typeof e=="boolean")return ze;if(typeof e=="number")return ge;if(e instanceof Zt)return Be;if(e instanceof zi)return Et;if(e instanceof ni)return rr;if(e instanceof Di)return Pt;if(Array.isArray(e)){for(var t,r=e.length,a=0,l=e;a<l.length;a+=1){var c=Cr(l[a]);if(t){if(t===c)continue;t=qe;break}t=c}return Gt(t||qe,r)}return yt}function va(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof Zt||e instanceof ni||e instanceof Di?e.toString():JSON.stringify(e)}Di.prototype.toString=function(){return this.name},Di.fromString=function(e){return e?new Di({name:e,available:!1}):null},Di.prototype.serialize=function(){return["image",this.name]};var Si=function(e,t){this.type=e,this.value=t};Si.parse=function(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ya(e[1]))return t.error("invalid value");var r=e[1],a=Cr(r),l=t.expectedType;return a.kind!=="array"||a.N!==0||!l||l.kind!=="array"||typeof l.N=="number"&&l.N!==0||(a=l),new Si(a,r)},Si.prototype.evaluate=function(){return this.value},Si.prototype.eachChild=function(){},Si.prototype.outputDefined=function(){return!0},Si.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Zt?["rgba"].concat(this.value.toArray()):this.value instanceof ni?this.value.serialize():this.value};var oi=function(e){this.name="ExpressionEvaluationError",this.message=e};oi.prototype.toJSON=function(){return this.message};var nn={string:Ne,number:ge,boolean:ze,object:yt},yr=function(e,t){this.type=e,this.args=t};yr.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,a=1,l=e[0];if(l==="array"){var c,h;if(e.length>2){var m=e[1];if(typeof m!="string"||!(m in nn)||m==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=nn[m],a++}else c=qe;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);h=e[2],a++}r=Gt(c,h)}else r=nn[l];for(var g=[];a<e.length;a++){var x=t.parse(e[a],a,qe);if(!x)return null;g.push(x)}return new yr(r,g)},yr.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Ht(this.type,Cr(r)))return r;if(t===this.args.length-1)throw new oi("Expected value to be of type "+Dt(this.type)+", but found "+Dt(Cr(r))+" instead.")}return null},yr.prototype.eachChild=function(e){this.args.forEach(e)},yr.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},yr.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var a=e.N;(typeof a=="number"||this.args.length>1)&&t.push(a)}}return t.concat(this.args.map((function(l){return l.serialize()})))};var yn=function(e){this.type=rr,this.sections=e};yn.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");for(var a=[],l=!1,c=1;c<=e.length-1;++c){var h=e[c];if(l&&typeof h=="object"&&!Array.isArray(h)){l=!1;var m=null;if(h["font-scale"]&&!(m=t.parse(h["font-scale"],1,ge)))return null;var g=null;if(h["text-font"]&&!(g=t.parse(h["text-font"],1,Gt(Ne))))return null;var x=null;if(h["text-color"]&&!(x=t.parse(h["text-color"],1,Be)))return null;var S=a[a.length-1];S.scale=m,S.font=g,S.textColor=x}else{var I=t.parse(e[c],1,qe);if(!I)return null;var C=I.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");l=!0,a.push({content:I,scale:null,font:null,textColor:null})}}return new yn(a)},yn.prototype.evaluate=function(e){return new ni(this.sections.map((function(t){var r=t.content.evaluate(e);return Cr(r)===Pt?new ma("",r,null,null,null):new ma(va(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},yn.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e(a.content),a.scale&&e(a.scale),a.font&&e(a.font),a.textColor&&e(a.textColor)}},yn.prototype.outputDefined=function(){return!1},yn.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e.push(a.content.serialize());var l={};a.scale&&(l["font-scale"]=a.scale.serialize()),a.font&&(l["text-font"]=a.font.serialize()),a.textColor&&(l["text-color"]=a.textColor.serialize()),e.push(l)}return e};var Ji=function(e){this.type=Pt,this.input=e};Ji.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Ne);return r?new Ji(r):t.error("No image name provided.")},Ji.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=Di.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},Ji.prototype.eachChild=function(e){e(this.input)},Ji.prototype.outputDefined=function(){return!1},Ji.prototype.serialize=function(){return["image",this.input.serialize()]};var il={"to-boolean":ze,"to-color":Be,"to-number":ge,"to-string":Ne},on=function(e,t){this.type=e,this.args=t};on.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");for(var a=il[r],l=[],c=1;c<e.length;c++){var h=t.parse(e[c],c,qe);if(!h)return null;l.push(h)}return new on(a,l)},on.prototype.evaluate=function(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){for(var t,r,a=0,l=this.args;a<l.length;a+=1){if(r=null,(t=l[a].evaluate(e))instanceof Zt)return t;if(typeof t=="string"){var c=e.parseColor(t);if(c)return c}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":eu(t[0],t[1],t[2],t[3])))return new Zt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new oi(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var h=null,m=0,g=this.args;m<g.length;m+=1){if((h=g[m].evaluate(e))===null)return 0;var x=Number(h);if(!isNaN(x))return x}throw new oi("Could not convert "+JSON.stringify(h)+" to number.")}return this.type.kind==="formatted"?ni.fromString(va(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Di.fromString(va(this.args[0].evaluate(e))):va(this.args[0].evaluate(e))},on.prototype.eachChild=function(e){this.args.forEach(e)},on.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},on.prototype.serialize=function(){if(this.type.kind==="formatted")return new yn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ji(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var Pc=["Unknown","Point","LineString","Polygon"],Dn=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Dn.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Dn.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Pc[this.feature.type]:this.feature.type:null},Dn.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Dn.prototype.canonicalID=function(){return this.canonical},Dn.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Dn.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Zt.parse(e)),t};var di=function(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a};di.prototype.evaluate=function(e){return this._evaluate(e,this.args)},di.prototype.eachChild=function(e){this.args.forEach(e)},di.prototype.outputDefined=function(){return!1},di.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},di.parse=function(e,t){var r,a=e[0],l=di.definitions[a];if(!l)return t.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0);for(var c=Array.isArray(l)?l[0]:l.type,h=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,m=h.filter((function(ot){var je=ot[0];return!Array.isArray(je)||je.length===e.length-1})),g=null,x=0,S=m;x<S.length;x+=1){var I=S[x],C=I[0],z=I[1];g=new Wn(t.registry,t.path,null,t.scope);for(var j=[],G=!1,te=1;te<e.length;te++){var K=e[te],oe=Array.isArray(C)?C[te-1]:C.type,le=g.parse(K,1+j.length,oe);if(!le){G=!0;break}j.push(le)}if(!G)if(Array.isArray(C)&&C.length!==j.length)g.error("Expected "+C.length+" arguments, but found "+j.length+" instead.");else{for(var ce=0;ce<j.length;ce++){var he=Array.isArray(C)?C[ce]:C.type,xe=j[ce];g.concat(ce+1).checkSubtype(he,xe.type)}if(g.errors.length===0)return new di(a,c,z,j)}}if(m.length===1)(r=t.errors).push.apply(r,g.errors);else{for(var Pe=(m.length?m:h).map((function(ot){var je;return je=ot[0],Array.isArray(je)?"("+je.map(Dt).join(", ")+")":"("+Dt(je.type)+"...)"})).join(" | "),De=[],rt=1;rt<e.length;rt++){var Ue=t.parse(e[rt],1+De.length);if(!Ue)return null;De.push(Dt(Ue.type))}t.error("Expected arguments of type "+Pe+", but found ("+De.join(", ")+") instead.")}return null},di.register=function(e,t){for(var r in di.definitions=t,t)e[r]=di};var In=function(e,t,r){this.type=Et,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function Ii(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function vo(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Cc(e,t){var r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*8192),Math.round(a*l*8192)]}function kc(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function tu(e,t){for(var r,a,l,c,h,m,g,x=!1,S=0,I=t.length;S<I;S++)for(var C=t[S],z=0,j=C.length;z<j-1;z++){if((c=(r=e)[0]-(a=C[z])[0])*(g=r[1]-(l=C[z+1])[1])-(m=r[0]-l[0])*(h=r[1]-a[1])==0&&c*m<=0&&h*g<=0)return!1;kc(e,C[z],C[z+1])&&(x=!x)}return x}function Mc(e,t){for(var r=0;r<t.length;r++)if(tu(e,t[r]))return!0;return!1}function nl(e,t,r,a){var l=a[0]-r[0],c=a[1]-r[1],h=(e[0]-r[0])*c-l*(e[1]-r[1]),m=(t[0]-r[0])*c-l*(t[1]-r[1]);return h>0&&m<0||h<0&&m>0}function Bc(e,t,r){for(var a=0,l=r;a<l.length;a+=1)for(var c=l[a],h=0;h<c.length-1;++h)if((I=[(S=c[h+1])[0]-(x=c[h])[0],S[1]-x[1]])[0]*(C=[(g=t)[0]-(m=e)[0],g[1]-m[1]])[1]-I[1]*C[0]!=0&&nl(m,g,x,S)&&nl(x,S,m,g))return!0;var m,g,x,S,I,C;return!1}function ol(e,t){for(var r=0;r<e.length;++r)if(!tu(e[r],t))return!1;for(var a=0;a<e.length-1;++a)if(Bc(e[a],e[a+1],t))return!1;return!0}function al(e,t){for(var r=0;r<t.length;r++)if(ol(e,t[r]))return!0;return!1}function Wo(e,t,r){for(var a=[],l=0;l<e.length;l++){for(var c=[],h=0;h<e[l].length;h++){var m=Cc(e[l][h],r);Ii(t,m),c.push(m)}a.push(c)}return a}function ru(e,t,r){for(var a=[],l=0;l<e.length;l++){var c=Wo(e[l],t,r);a.push(c)}return a}function ga(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){var l=.5*a,c=e[0]-r[0]>l?-a:r[0]-e[0]>l?a:0;c===0&&(c=e[0]-r[2]>l?-a:r[2]-e[0]>l?a:0),e[0]+=c}Ii(t,e)}function sl(e,t,r,a){for(var l=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],h=[],m=0,g=e;m<g.length;m+=1)for(var x=0,S=g[m];x<S.length;x+=1){var I=S[x],C=[I.x+c[0],I.y+c[1]];ga(C,t,r,l),h.push(C)}return h}function Qa(e,t,r,a){for(var l,c=8192*Math.pow(2,a.z),h=[8192*a.x,8192*a.y],m=[],g=0,x=e;g<x.length;g+=1){for(var S=[],I=0,C=x[g];I<C.length;I+=1){var z=C[I],j=[z.x+h[0],z.y+h[1]];Ii(t,j),S.push(j)}m.push(S)}if(t[2]-t[0]<=c/2){(l=t)[0]=l[1]=1/0,l[2]=l[3]=-1/0;for(var G=0,te=m;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1)ga(oe[K],t,r,c)}return m}In.parse=function(e,t){if(e.length!==2)return t.error("Expected one argument.");var r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");var a=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,ze);if(!a)return null;var l=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,ze);if(!l)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,Ne))?null:new In(a,l,c)},In.prototype.evaluate=function(e){return new zi(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},In.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var an=function(e,t){this.type=ze,this.geojson=e,this.geometries=t};function Gn(e){if(e instanceof di&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof an)return!1;var t=!0;return e.eachChild((function(r){t&&!Gn(r)&&(t=!1)})),t}function Zn(e){if(e instanceof di&&e.name==="feature-state")return!1;var t=!0;return e.eachChild((function(r){t&&!Zn(r)&&(t=!1)})),t}function go(e,t){if(e instanceof di&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(a){r&&!go(a,t)&&(r=!1)})),r}an.parse=function(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ya(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var a=0;a<r.features.length;++a){var l=r.features[a].geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new an(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new an(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new an(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},an.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=sl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,x=m;g<x.length;g+=1)if(!tu(x[g],h))return!1}if(r.type==="MultiPolygon"){var S=ru(r.coordinates,l,c),I=sl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!Mc(z[C],S))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,x=m;g<x.length;g+=1)if(!ol(x[g],h))return!1}if(r.type==="MultiPolygon"){var S=ru(r.coordinates,l,c),I=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!al(z[C],S))return!1}return!0})(e,this.geometries)}return!1},an.prototype.eachChild=function(){},an.prototype.outputDefined=function(){return!0},an.prototype.serialize=function(){return["within",this.geojson]};var $n=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};$n.parse=function(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new $n(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},$n.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},$n.prototype.eachChild=function(){},$n.prototype.outputDefined=function(){return!1},$n.prototype.serialize=function(){return["var",this.name]};var Wn=function(e,t,r,a,l){t===void 0&&(t=[]),a===void 0&&(a=new Je),l===void 0&&(l=[]),this.registry=e,this.path=t,this.key=t.map((function(c){return"["+c+"]"})).join(""),this.scope=a,this.errors=l,this.expectedType=r};function es(e,t){for(var r,a=e.length-1,l=0,c=a,h=0;l<=c;)if((r=e[h=Math.floor((l+c)/2)])<=t){if(h===a||t<e[h+1])return h;l=h+1}else{if(!(r>t))throw new oi("Input is not a number.");c=h-1}return 0}Wn.prototype.parse=function(e,t,r,a,l){return l===void 0&&(l={}),t?this.concat(t,r,a)._parse(e,l):this._parse(e,l)},Wn.prototype._parse=function(e,t){function r(x,S,I){return I==="assert"?new yr(S,[x]):I==="coerce"?new on(S,[x]):x}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var a=e[0];if(typeof a!="string")return this.error("Expression name must be a string, but found "+typeof a+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var l=this.registry[a];if(l){var c=l.parse(e,this);if(!c)return null;if(this.expectedType){var h=this.expectedType,m=c.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||m.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(h,m))return null}else c=r(c,h,t.typeAnnotation||"coerce");else c=r(c,h,t.typeAnnotation||"assert")}if(!(c instanceof Si)&&c.type.kind!=="resolvedImage"&&(function x(S){if(S instanceof $n)return x(S.boundExpression);if(S instanceof di&&S.name==="error"||S instanceof In||S instanceof an)return!1;var I=S instanceof on||S instanceof yr,C=!0;return S.eachChild((function(z){C=I?C&&x(z):C&&z instanceof Si})),!!C&&Gn(S)&&go(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])})(c)){var g=new Dn;try{c=new Si(c.type,c.evaluate(g))}catch(x){return this.error(x.message),null}}return c}return this.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof e+" instead.")},Wn.prototype.concat=function(e,t,r){var a=typeof e=="number"?this.path.concat(e):this.path,l=r?this.scope.concat(r):this.scope;return new Wn(this.registry,a,t||null,l,this.errors)},Wn.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var a=""+this.key+t.map((function(l){return"["+l+"]"})).join("");this.errors.push(new Ae(a,e))},Wn.prototype.checkSubtype=function(e,t){var r=Ht(e,t);return r&&this.error(r),r};var Ui=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var a=0,l=r;a<l.length;a+=1){var c=l[a],h=c[1];this.labels.push(c[0]),this.outputs.push(h)}};function Vr(e,t,r){return e*(1-r)+t*r}Ui.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=[],l=null;t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(var c=1;c<e.length;c+=2){var h=c===1?-1/0:e[c],m=e[c+1],g=c,x=c+1;if(typeof h!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',g);if(a.length&&a[a.length-1][0]>=h)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',g);var S=t.parse(m,x,l);if(!S)return null;l=l||S.type,a.push([h,S])}return new Ui(l,r,a)},Ui.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;return a>=t[l-1]?r[l-1].evaluate(e):r[es(t,a)].evaluate(e)},Ui.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Ui.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},Ui.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Ho=Object.freeze({__proto__:null,number:Vr,color:function(e,t,r){return new Zt(Vr(e.r,t.r,r),Vr(e.g,t.g,r),Vr(e.b,t.b,r),Vr(e.a,t.a,r))},array:function(e,t,r){return e.map((function(a,l){return Vr(a,t[l],r)}))}}),ul=6/29*3*(6/29),zc=Math.PI/180,Dc=180/Math.PI;function iu(e){return e>.008856451679035631?Math.pow(e,1/3):e/ul+4/29}function nu(e){return e>6/29?e*e*e:ul*(e-4/29)}function ou(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function au(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ll(e){var t=au(e.r),r=au(e.g),a=au(e.b),l=iu((.4124564*t+.3575761*r+.1804375*a)/.95047),c=iu((.2126729*t+.7151522*r+.072175*a)/1);return{l:116*c-16,a:500*(l-c),b:200*(c-iu((.0193339*t+.119192*r+.9503041*a)/1.08883)),alpha:e.a}}function cl(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,a=isNaN(e.b)?t:t-e.b/200;return t=1*nu(t),r=.95047*nu(r),a=1.08883*nu(a),new Zt(ou(3.2404542*r-1.5371385*t-.4985314*a),ou(-.969266*r+1.8760108*t+.041556*a),ou(.0556434*r-.2040259*t+1.0572252*a),e.alpha)}function Rc(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var _a={forward:ll,reverse:cl,interpolate:function(e,t,r){return{l:Vr(e.l,t.l,r),a:Vr(e.a,t.a,r),b:Vr(e.b,t.b,r),alpha:Vr(e.alpha,t.alpha,r)}}},xa={forward:function(e){var t=ll(e),r=t.l,a=t.a,l=t.b,c=Math.atan2(l,a)*Dc;return{h:c<0?c+360:c,c:Math.sqrt(a*a+l*l),l:r,alpha:e.a}},reverse:function(e){var t=e.h*zc,r=e.c;return cl({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Rc(e.h,t.h,r),c:Vr(e.c,t.c,r),l:Vr(e.l,t.l,r),alpha:Vr(e.alpha,t.alpha,r)}}},pl=Object.freeze({__proto__:null,lab:_a,hcl:xa}),mi=function(e,t,r,a,l){this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(var c=0,h=l;c<h.length;c+=1){var m=h[c],g=m[1];this.labels.push(m[0]),this.outputs.push(g)}};function su(e,t,r,a){var l=a-r,c=e-r;return l===0?0:t===1?c/l:(Math.pow(t,c)-1)/(Math.pow(t,l)-1)}mi.interpolationFactor=function(e,t,r,a){var l=0;if(e.name==="exponential")l=su(t,e.base,r,a);else if(e.name==="linear")l=su(t,1,r,a);else if(e.name==="cubic-bezier"){var c=e.controlPoints;l=new k(c[0],c[1],c[2],c[3]).solve(su(t,1,r,a))}return l},mi.parse=function(e,t){var r=e[0],a=e[1],l=e[2],c=e.slice(3);if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){var h=a[1];if(typeof h!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:h}}else{if(a[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(a[0]),1,0);var m=a.slice(1);if(m.length!==4||m.some((function(te){return typeof te!="number"||te<0||te>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:m}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(l=t.parse(l,2,ge)))return null;var g=[],x=null;r==="interpolate-hcl"||r==="interpolate-lab"?x=Be:t.expectedType&&t.expectedType.kind!=="value"&&(x=t.expectedType);for(var S=0;S<c.length;S+=2){var I=c[S],C=c[S+1],z=S+3,j=S+4;if(typeof I!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(g.length&&g[g.length-1][0]>=I)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);var G=t.parse(C,j,x);if(!G)return null;x=x||G.type,g.push([I,G])}return x.kind==="number"||x.kind==="color"||x.kind==="array"&&x.itemType.kind==="number"&&typeof x.N=="number"?new mi(x,r,a,l,g):t.error("Type "+Dt(x)+" is not interpolatable.")},mi.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;if(a>=t[l-1])return r[l-1].evaluate(e);var c=es(t,a),h=mi.interpolationFactor(this.interpolation,a,t[c],t[c+1]),m=r[c].evaluate(e),g=r[c+1].evaluate(e);return this.operator==="interpolate"?Ho[this.type.kind.toLowerCase()](m,g,h):this.operator==="interpolate-hcl"?xa.reverse(xa.interpolate(xa.forward(m),xa.forward(g),h)):_a.reverse(_a.interpolate(_a.forward(m),_a.forward(g),h))},mi.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},mi.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},mi.prototype.serialize=function(){var e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var Hn=function(e,t){this.type=e,this.args=t};Hn.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,a=t.expectedType;a&&a.kind!=="value"&&(r=a);for(var l=[],c=0,h=e.slice(1);c<h.length;c+=1){var m=t.parse(h[c],1+l.length,r,void 0,{typeAnnotation:"omit"});if(!m)return null;r=r||m.type,l.push(m)}var g=a&&l.some((function(x){return Ht(a,x.type)}));return new Hn(g?qe:r,l)},Hn.prototype.evaluate=function(e){for(var t,r=null,a=0,l=0,c=this.args;l<c.length&&(a++,(r=c[l].evaluate(e))&&r instanceof Di&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);l+=1);return r},Hn.prototype.eachChild=function(e){this.args.forEach(e)},Hn.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},Hn.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Xn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Xn.prototype.evaluate=function(e){return this.result.evaluate(e)},Xn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Xn.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],a=1;a<e.length-1;a+=2){var l=e[a];if(typeof l!="string")return t.error("Expected string, but found "+typeof l+" instead.",a);if(/[^a-zA-Z0-9_]/.test(l))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);var c=t.parse(e[a+1],a+1);if(!c)return null;r.push([l,c])}var h=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return h?new Xn(r,h):null},Xn.prototype.outputDefined=function(){return this.result.outputDefined()},Xn.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var a=r[t];e.push(a[0],a[1].serialize())}return e.push(this.result.serialize()),e};var _o=function(e,t,r){this.type=e,this.index=t,this.input=r};_o.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ge),a=t.parse(e[2],2,Gt(t.expectedType||qe));return r&&a?new _o(a.type.itemType,r,a):null},_o.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new oi("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new oi("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new oi("Array index must be an integer, but found "+t+" instead.");return r[t]},_o.prototype.eachChild=function(e){e(this.index),e(this.input)},_o.prototype.outputDefined=function(){return!1},_o.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var xo=function(e,t){this.type=ze,this.needle=e,this.haystack=t};xo.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,qe),a=t.parse(e[2],2,qe);return r&&a?Pr(r.type,[ze,Ne,ge,Ze,qe])?new xo(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead"):null},xo.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Cr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Dt(Cr(r))+" instead.");return r.indexOf(t)>=0},xo.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},xo.prototype.outputDefined=function(){return!0},xo.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Kn=function(e,t,r){this.type=ge,this.needle=e,this.haystack=t,this.fromIndex=r};Kn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,qe),a=t.parse(e[2],2,qe);if(!r||!a)return null;if(!Pr(r.type,[ze,Ne,ge,Ze,qe]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Kn(r,a,l):null}return new Kn(r,a)},Kn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Cr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Dt(Cr(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Kn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Kn.prototype.outputDefined=function(){return!1},Kn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var bo=function(e,t,r,a,l,c){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=l,this.otherwise=c};bo.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(var l={},c=[],h=2;h<e.length-1;h+=2){var m=e[h],g=e[h+1];Array.isArray(m)||(m=[m]);var x=t.concat(h);if(m.length===0)return x.error("Expected at least one branch label.");for(var S=0,I=m;S<I.length;S+=1){var C=I[S];if(typeof C!="number"&&typeof C!="string")return x.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return x.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof C=="number"&&Math.floor(C)!==C)return x.error("Numeric branch labels must be integer values.");if(r){if(x.checkSubtype(r,Cr(C)))return null}else r=Cr(C);if(l[String(C)]!==void 0)return x.error("Branch labels must be unique.");l[String(C)]=c.length}var z=t.parse(g,h,a);if(!z)return null;a=a||z.type,c.push(z)}var j=t.parse(e[1],1,qe);if(!j)return null;var G=t.parse(e[e.length-1],e.length-1,a);return G?j.type.kind!=="value"&&t.concat(1).checkSubtype(r,j.type)?null:new bo(r,a,j,l,c,G):null},bo.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Cr(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},bo.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},bo.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},bo.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],a={},l=0,c=Object.keys(this.cases).sort();l<c.length;l+=1){var h=c[l];(I=a[this.cases[h]])===void 0?(a[this.cases[h]]=r.length,r.push([this.cases[h],[h]])):r[I][1].push(h)}for(var m=function(z){return e.inputType.kind==="number"?Number(z):z},g=0,x=r;g<x.length;g+=1){var S=x[g],I=S[0],C=S[1];t.push(C.length===1?m(C[0]):C.map(m)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var wo=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};wo.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);for(var a=[],l=1;l<e.length-1;l+=2){var c=t.parse(e[l],l,ze);if(!c)return null;var h=t.parse(e[l+1],l+1,r);if(!h)return null;a.push([c,h]),r=r||h.type}var m=t.parse(e[e.length-1],e.length-1,r);return m?new wo(r,a,m):null},wo.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];if(a[0].evaluate(e))return l.evaluate(e)}return this.otherwise.evaluate(e)},wo.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];e(a[0]),e(l)}e(this.otherwise)},wo.prototype.outputDefined=function(){return this.branches.every((function(e){return e[1].outputDefined()}))&&this.otherwise.outputDefined()},wo.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Jn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function hl(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function fl(e,t,r,a){return a.compare(t,r)===0}function ir(e,t,r){var a=e!=="=="&&e!=="!=";return(function(){function l(c,h,m){this.type=ze,this.lhs=c,this.rhs=h,this.collator=m,this.hasUntypedArgument=c.type.kind==="value"||h.type.kind==="value"}return l.parse=function(c,h){if(c.length!==3&&c.length!==4)return h.error("Expected two or three arguments.");var m=c[0],g=h.parse(c[1],1,qe);if(!g)return null;if(!hl(m,g.type))return h.concat(1).error('"'+m+`" comparisons are not supported for type '`+Dt(g.type)+"'.");var x=h.parse(c[2],2,qe);if(!x)return null;if(!hl(m,x.type))return h.concat(2).error('"'+m+`" comparisons are not supported for type '`+Dt(x.type)+"'.");if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot compare types '"+Dt(g.type)+"' and '"+Dt(x.type)+"'.");a&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new yr(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new yr(g.type,[x])));var S=null;if(c.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(!(S=h.parse(c[3],3,Et)))return null}return new l(g,x,S)},l.prototype.evaluate=function(c){var h=this.lhs.evaluate(c),m=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var g=Cr(h),x=Cr(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new oi('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+g.kind+", "+x.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var S=Cr(h),I=Cr(m);if(S.kind!=="string"||I.kind!=="string")return t(c,h,m)}return this.collator?r(c,h,m,this.collator.evaluate(c)):t(c,h,m)},l.prototype.eachChild=function(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)},l.prototype.outputDefined=function(){return!0},l.prototype.serialize=function(){var c=[e];return this.eachChild((function(h){c.push(h.serialize())})),c},l})()}Jn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,qe),a=t.parse(e[2],2,ge);if(!r||!a)return null;if(!Pr(r.type,[Gt(qe),Ne,qe]))return t.error("Expected first argument to be of type array or string, but found "+Dt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Jn(r.type,r,a,l):null}return new Jn(r.type,r,a)},Jn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Qt(t,["string","array"]))throw new oi("Expected first argument to be of type array or string, but found "+Dt(Cr(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},Jn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Jn.prototype.outputDefined=function(){return!1},Jn.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Lc=ir("==",(function(e,t,r){return t===r}),fl),ts=ir("!=",(function(e,t,r){return t!==r}),(function(e,t,r,a){return!fl(0,t,r,a)})),dl=ir("<",(function(e,t,r){return t<r}),(function(e,t,r,a){return a.compare(t,r)<0})),ml=ir(">",(function(e,t,r){return t>r}),(function(e,t,r,a){return a.compare(t,r)>0})),yl=ir("<=",(function(e,t,r){return t<=r}),(function(e,t,r,a){return a.compare(t,r)<=0})),vl=ir(">=",(function(e,t,r){return t>=r}),(function(e,t,r,a){return a.compare(t,r)>=0})),So=function(e,t,r,a,l){this.type=Ne,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=l};So.parse=function(e,t){if(e.length!==3)return t.error("Expected two arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=e[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");var l=null;if(a.locale&&!(l=t.parse(a.locale,1,Ne)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,Ne)))return null;var h=null;if(a["min-fraction-digits"]&&!(h=t.parse(a["min-fraction-digits"],1,ge)))return null;var m=null;return a["max-fraction-digits"]&&!(m=t.parse(a["max-fraction-digits"],1,ge))?null:new So(r,l,c,h,m)},So.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},So.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},So.prototype.outputDefined=function(){return!1},So.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Yn=function(e){this.type=ge,this.input=e};Yn.parse=function(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error("Expected argument of type string or array, but found "+Dt(r.type)+" instead."):new Yn(r):null},Yn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new oi("Expected value to be of type string or array, but found "+Dt(Cr(t))+" instead.")},Yn.prototype.eachChild=function(e){e(this.input)},Yn.prototype.outputDefined=function(){return!1},Yn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Io={"==":Lc,"!=":ts,">":ml,"<":dl,">=":vl,"<=":yl,array:yr,at:_o,boolean:yr,case:wo,coalesce:Hn,collator:In,format:yn,image:Ji,in:xo,"index-of":Kn,interpolate:mi,"interpolate-hcl":mi,"interpolate-lab":mi,length:Yn,let:Xn,literal:Si,match:bo,number:yr,"number-format":So,object:yr,slice:Jn,step:Ui,string:yr,"to-boolean":on,"to-color":on,"to-number":on,"to-string":on,var:$n,within:an};function gl(e,t){var r=t[0],a=t[1],l=t[2],c=t[3];r=r.evaluate(e),a=a.evaluate(e),l=l.evaluate(e);var h=c?c.evaluate(e):1,m=eu(r,a,l,h);if(m)throw new oi(m);return new Zt(r/255*h,a/255*h,l/255*h,h)}function _l(e,t){return e in t}function uu(e,t){var r=t[e];return r===void 0?null:r}function To(e){return{type:e}}function xl(e){return{result:"success",value:e}}function Ao(e){return{result:"error",value:e}}function Eo(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function bl(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ba(e){return!!e.expression&&e.expression.interpolated}function ur(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function rs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fc(e){return e}function Xo(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function wl(e,t,r,a,l){return Xo(typeof r===l?a[r]:void 0,e.default,t.default)}function Oc(e,t,r){if(ur(r)!=="number")return Xo(e.default,t.default);var a=e.stops.length;if(a===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var l=es(e.stops.map((function(c){return c[0]})),r);return e.stops[l][1]}function Sl(e,t,r){var a=e.base!==void 0?e.base:1;if(ur(r)!=="number")return Xo(e.default,t.default);var l=e.stops.length;if(l===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[l-1][0])return e.stops[l-1][1];var c=es(e.stops.map((function(I){return I[0]})),r),h=(function(I,C,z,j){var G=j-z,te=I-z;return G===0?0:C===1?te/G:(Math.pow(C,te)-1)/(Math.pow(C,G)-1)})(r,a,e.stops[c][0],e.stops[c+1][0]),m=e.stops[c][1],g=e.stops[c+1][1],x=Ho[t.type]||Fc;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=pl[e.colorSpace];x=function(I,C){return S.reverse(S.interpolate(S.forward(I),S.forward(C),h))}}return typeof m.evaluate=="function"?{evaluate:function(){for(var I=[],C=arguments.length;C--;)I[C]=arguments[C];var z=m.evaluate.apply(void 0,I),j=g.evaluate.apply(void 0,I);if(z!==void 0&&j!==void 0)return x(z,j,h)}}:x(m,g,h)}function is(e,t,r){return t.type==="color"?r=Zt.parse(r):t.type==="formatted"?r=ni.fromString(r.toString()):t.type==="resolvedImage"?r=Di.fromString(r.toString()):ur(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),Xo(r,e.default,t.default)}di.register(Io,{error:[{kind:"error"},[Ne],function(e,t){throw new oi(t[0].evaluate(e))}],typeof:[Ne,[qe],function(e,t){return Dt(Cr(t[0].evaluate(e)))}],"to-rgba":[Gt(ge,4),[Be],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Be,[ge,ge,ge],gl],rgba:[Be,[ge,ge,ge,ge],gl],has:{type:ze,overloads:[[[Ne],function(e,t){return _l(t[0].evaluate(e),e.properties())}],[[Ne,yt],function(e,t){var r=t[1];return _l(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:qe,overloads:[[[Ne],function(e,t){return uu(t[0].evaluate(e),e.properties())}],[[Ne,yt],function(e,t){var r=t[1];return uu(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[qe,[Ne],function(e,t){return uu(t[0].evaluate(e),e.featureState||{})}],properties:[yt,[],function(e){return e.properties()}],"geometry-type":[Ne,[],function(e){return e.geometryType()}],id:[qe,[],function(e){return e.id()}],zoom:[ge,[],function(e){return e.globals.zoom}],"heatmap-density":[ge,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[ge,[],function(e){return e.globals.lineProgress||0}],accumulated:[qe,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[ge,To(ge),function(e,t){for(var r=0,a=0,l=t;a<l.length;a+=1)r+=l[a].evaluate(e);return r}],"*":[ge,To(ge),function(e,t){for(var r=1,a=0,l=t;a<l.length;a+=1)r*=l[a].evaluate(e);return r}],"-":{type:ge,overloads:[[[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)-r.evaluate(e)}],[[ge],function(e,t){return-t[0].evaluate(e)}]]},"/":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)/r.evaluate(e)}],"%":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)%r.evaluate(e)}],ln2:[ge,[],function(){return Math.LN2}],pi:[ge,[],function(){return Math.PI}],e:[ge,[],function(){return Math.E}],"^":[ge,[ge,ge],function(e,t){var r=t[1];return Math.pow(t[0].evaluate(e),r.evaluate(e))}],sqrt:[ge,[ge],function(e,t){return Math.sqrt(t[0].evaluate(e))}],log10:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN10}],ln:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))}],log2:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN2}],sin:[ge,[ge],function(e,t){return Math.sin(t[0].evaluate(e))}],cos:[ge,[ge],function(e,t){return Math.cos(t[0].evaluate(e))}],tan:[ge,[ge],function(e,t){return Math.tan(t[0].evaluate(e))}],asin:[ge,[ge],function(e,t){return Math.asin(t[0].evaluate(e))}],acos:[ge,[ge],function(e,t){return Math.acos(t[0].evaluate(e))}],atan:[ge,[ge],function(e,t){return Math.atan(t[0].evaluate(e))}],min:[ge,To(ge),function(e,t){return Math.min.apply(Math,t.map((function(r){return r.evaluate(e)})))}],max:[ge,To(ge),function(e,t){return Math.max.apply(Math,t.map((function(r){return r.evaluate(e)})))}],abs:[ge,[ge],function(e,t){return Math.abs(t[0].evaluate(e))}],round:[ge,[ge],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],function(e,t){return Math.floor(t[0].evaluate(e))}],ceil:[ge,[ge],function(e,t){return Math.ceil(t[0].evaluate(e))}],"filter-==":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[ze,[qe],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[ze,[Ne],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<c}],"filter-id-<":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<l}],"filter->":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>c}],"filter-id->":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>l}],"filter-<=":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<=c}],"filter-id-<=":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<=l}],"filter->=":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>=c}],"filter-id->=":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>=l}],"filter-has":[ze,[qe],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[ze,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[ze,[Gt(Ne)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[ze,[Gt(qe)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[ze,[Ne,Gt(qe)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[ze,[Ne,Gt(qe)],function(e,t){var r=t[0],a=t[1];return(function(l,c,h,m){for(;h<=m;){var g=h+m>>1;if(c[g]===l)return!0;c[g]>l?m=g-1:h=g+1}return!1})(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:ze,overloads:[[[ze,ze],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[To(ze),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(!a[r].evaluate(e))return!1;return!0}]]},any:{type:ze,overloads:[[[ze,ze],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[To(ze),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[ze,[ze],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[ze,[Ne],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[Ne,[Ne],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Ne,[Ne],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Ne,To(qe),function(e,t){return t.map((function(r){return va(r.evaluate(e))})).join("")}],"resolved-locale":[Ne,[Et],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Ko=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Dn,this._defaultValue=t?(function(r){return r.type==="color"&&rs(r.default)?new Zt(0,0,0,0):r.type==="color"?Zt.parse(r.default)||null:r.default===void 0?null:r.default})(t):null,this._enumValues=t&&t.type==="enum"?t.values:null};function wa(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in Io}function ns(e,t){var r=new Wn(Io,[],t?(function(l){var c={color:Be,string:Ne,number:ge,enum:Ne,boolean:ze,formatted:rr,resolvedImage:Pt};return l.type==="array"?Gt(c[l.value]||qe,l.length):c[l.type]})(t):void 0),a=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?xl(new Ko(a,t)):Ao(r.errors)}Ko.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},Ko.prototype.evaluate=function(e,t,r,a,l,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c||null;try{var h=this.expression.evaluate(this._evaluator);if(h==null||typeof h=="number"&&h!=h)return this._defaultValue;if(this._enumValues&&!(h in this._enumValues))throw new oi("Expected value to be one of "+Object.keys(this._enumValues).map((function(m){return JSON.stringify(m)})).join(", ")+", but found "+JSON.stringify(h)+" instead.");return h}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}};var Sa=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Zn(t.expression)};Sa.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Sa.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)};var Jo=function(e,t,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Zn(t.expression),this.interpolationType=a};function Il(e,t){if((e=ns(e,t)).result==="error")return e;var r=e.value.expression,a=Gn(r);if(!a&&!Eo(t))return Ao([new Ae("","data expressions not supported")]);var l=go(r,["zoom"]);if(!l&&!bl(t))return Ao([new Ae("","zoom expressions not supported")]);var c=(function h(m){var g=null;if(m instanceof Xn)g=h(m.result);else if(m instanceof Hn)for(var x=0,S=m.args;x<S.length&&!(g=h(S[x]));x+=1);else(m instanceof Ui||m instanceof mi)&&m.input instanceof di&&m.input.name==="zoom"&&(g=m);return g instanceof Ae||m.eachChild((function(I){var C=h(I);C instanceof Ae?g=C:!g&&C?g=new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):g&&C&&g!==C&&(g=new Ae("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),g})(r);return c||l?c instanceof Ae?Ao([c]):c instanceof mi&&!ba(t)?Ao([new Ae("",'"interpolate" expressions cannot be used with this property')]):xl(c?new Jo(a?"camera":"composite",e.value,c.labels,c instanceof mi?c.interpolation:void 0):new Sa(a?"constant":"source",e.value)):Ao([new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Jo.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Jo.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)},Jo.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?mi.interpolationFactor(this.interpolationType,e,t,r):0};var Yo=function(e,t){this._parameters=e,this._specification=t,Se(this,(function r(a,l){var c,h,m,g=l.type==="color",x=a.stops&&typeof a.stops[0][0]=="object",S=x||!(x||a.property!==void 0),I=a.type||(ba(l)?"exponential":"interval");if(g&&((a=Se({},a)).stops&&(a.stops=a.stops.map((function(Ue){return[Ue[0],Zt.parse(Ue[1])]}))),a.default=Zt.parse(a.default?a.default:l.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!pl[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(I==="exponential")c=Sl;else if(I==="interval")c=Oc;else if(I==="categorical"){c=wl,h=Object.create(null);for(var C=0,z=a.stops;C<z.length;C+=1){var j=z[C];h[j[0]]=j[1]}m=typeof a.stops[0][0]}else{if(I!=="identity")throw new Error('Unknown function type "'+I+'"');c=is}if(x){for(var G={},te=[],K=0;K<a.stops.length;K++){var oe=a.stops[K],le=oe[0].zoom;G[le]===void 0&&(G[le]={zoom:le,type:a.type,property:a.property,default:a.default,stops:[]},te.push(le)),G[le].stops.push([oe[0].value,oe[1]])}for(var ce=[],he=0,xe=te;he<xe.length;he+=1){var Pe=xe[he];ce.push([G[Pe].zoom,r(G[Pe],l)])}var De={name:"linear"};return{kind:"composite",interpolationType:De,interpolationFactor:mi.interpolationFactor.bind(void 0,De),zoomStops:ce.map((function(Ue){return Ue[0]})),evaluate:function(Ue,ot){var je=Ue.zoom;return Sl({stops:ce,base:a.base},l,je).evaluate(je,ot)}}}if(S){var rt=I==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:rt,interpolationFactor:mi.interpolationFactor.bind(void 0,rt),zoomStops:a.stops.map((function(Ue){return Ue[0]})),evaluate:function(Ue){return c(a,l,Ue.zoom,h,m)}}}return{kind:"source",evaluate:function(Ue,ot){var je=ot&&ot.properties?ot.properties[a.property]:void 0;return je===void 0?Xo(a.default,l.default):c(a,l,je,h,m)}}})(this._parameters,this._specification))};function vn(e){var t=e.key,r=e.value,a=e.valueSpec||{},l=e.objectElementValidators||{},c=e.style,h=e.styleSpec,m=[],g=ur(r);if(g!=="object")return[new H(t,r,"object expected, "+g+" found")];for(var x in r){var S=x.split(".")[0],I=a[S]||a["*"],C=void 0;if(l[S])C=l[S];else if(a[S])C=zt;else if(l["*"])C=l["*"];else{if(!a["*"]){m.push(new H(t,r[x],'unknown property "'+x+'"'));continue}C=zt}m=m.concat(C({key:(t&&t+".")+x,value:r[x],valueSpec:I,style:c,styleSpec:h,object:r,objectKey:x},r))}for(var z in a)l[z]||a[z].required&&a[z].default===void 0&&r[z]===void 0&&m.push(new H(t,r,'missing required property "'+z+'"'));return m}function Tl(e){var t=e.value,r=e.valueSpec,a=e.style,l=e.styleSpec,c=e.key,h=e.arrayElementValidator||zt;if(ur(t)!=="array")return[new H(c,t,"array expected, "+ur(t)+" found")];if(r.length&&t.length!==r.length)return[new H(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new H(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var m={type:r.value,values:r.values};l.$version<7&&(m.function=r.function),ur(r.value)==="object"&&(m=r.value);for(var g=[],x=0;x<t.length;x++)g=g.concat(h({array:t,arrayIndex:x,value:t[x],valueSpec:m,style:a,styleSpec:l,key:c+"["+x+"]"}));return g}function Al(e){var t=e.key,r=e.value,a=e.valueSpec,l=ur(r);return l==="number"&&r!=r&&(l="NaN"),l!=="number"?[new H(t,r,"number expected, "+l+" found")]:"minimum"in a&&r<a.minimum?[new H(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new H(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function El(e){var t,r,a,l=e.valueSpec,c=Ee(e.value.type),h={},m=c!=="categorical"&&e.value.property===void 0,g=!m,x=ur(e.value.stops)==="array"&&ur(e.value.stops[0])==="array"&&ur(e.value.stops[0][0])==="object",S=vn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(z){if(c==="identity")return[new H(z.key,z.value,'identity function may not have a "stops" property')];var j=[],G=z.value;return j=j.concat(Tl({key:z.key,value:G,valueSpec:z.valueSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:I})),ur(G)==="array"&&G.length===0&&j.push(new H(z.key,G,"array must have at least one stop")),j},default:function(z){return zt({key:z.key,value:z.value,valueSpec:l,style:z.style,styleSpec:z.styleSpec})}}});return c==="identity"&&m&&S.push(new H(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||S.push(new H(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!ba(e.valueSpec)&&S.push(new H(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(g&&!Eo(e.valueSpec)?S.push(new H(e.key,e.value,"property functions not supported")):m&&!bl(e.valueSpec)&&S.push(new H(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!x||e.value.property!==void 0||S.push(new H(e.key,e.value,'"property" property is required')),S;function I(z){var j=[],G=z.value,te=z.key;if(ur(G)!=="array")return[new H(te,G,"array expected, "+ur(G)+" found")];if(G.length!==2)return[new H(te,G,"array length 2 expected, length "+G.length+" found")];if(x){if(ur(G[0])!=="object")return[new H(te,G,"object expected, "+ur(G[0])+" found")];if(G[0].zoom===void 0)return[new H(te,G,"object stop key must have zoom")];if(G[0].value===void 0)return[new H(te,G,"object stop key must have value")];if(a&&a>Ee(G[0].zoom))return[new H(te,G[0].zoom,"stop zoom values must appear in ascending order")];Ee(G[0].zoom)!==a&&(a=Ee(G[0].zoom),r=void 0,h={}),j=j.concat(vn({key:te+"[0]",value:G[0],valueSpec:{zoom:{}},style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:Al,value:C}}))}else j=j.concat(C({key:te+"[0]",value:G[0],style:z.style,styleSpec:z.styleSpec},G));return wa(me(G[1]))?j.concat([new H(te+"[1]",G[1],"expressions are not allowed in function stops.")]):j.concat(zt({key:te+"[1]",value:G[1],valueSpec:l,style:z.style,styleSpec:z.styleSpec}))}function C(z,j){var G=ur(z.value),te=Ee(z.value),K=z.value!==null?z.value:j;if(t){if(G!==t)return[new H(z.key,K,G+" stop domain type must match previous stop domain type "+t)]}else t=G;if(G!=="number"&&G!=="string"&&G!=="boolean")return[new H(z.key,K,"stop domain value must be a number, string, or boolean")];if(G!=="number"&&c!=="categorical"){var oe="number expected, "+G+" found";return Eo(l)&&c===void 0&&(oe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new H(z.key,K,oe)]}return c!=="categorical"||G!=="number"||isFinite(te)&&Math.floor(te)===te?c!=="categorical"&&G==="number"&&r!==void 0&&te<r?[new H(z.key,K,"stop domain values must appear in ascending order")]:(r=te,c==="categorical"&&te in h?[new H(z.key,K,"stop domain values must be unique")]:(h[te]=!0,[])):[new H(z.key,K,"integer expected, found "+te)]}}function Po(e){var t=(e.expressionContext==="property"?Il:ns)(me(e.value),e.valueSpec);if(t.result==="error")return t.value.map((function(a){return new H(""+e.key+a.key,e.value,a.message)}));var r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new H(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Zn(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!Zn(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!go(r,["zoom","feature-state"]))return[new H(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Gn(r))return[new H(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ia(e){var t=e.key,r=e.value,a=e.valueSpec,l=[];return Array.isArray(a.values)?a.values.indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+Object.keys(a.values).join(", ")+"], "+JSON.stringify(r)+" found")),l}function os(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var a=r[t];if(!os(a)&&typeof a!="boolean")return!1}return!0;default:return!0}}Yo.deserialize=function(e){return new Yo(e._parameters,e._specification)},Yo.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var lu={type:"boolean",default:!1};function as(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};os(e)||(e=ss(e));var t=ns(e,lu);if(t.result==="error")throw new Error(t.value.map((function(r){return r.key+": "+r.message})).join(", "));return{filter:function(r,a,l){return t.value.evaluate(r,a,{},l)},needGeometry:(function r(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(var l=1;l<a.length;l++)if(r(a[l]))return!0;return!1})(e)}}function Vc(e,t){return e<t?-1:e>t?1:0}function ss(e){if(!e)return!0;var t,r=e[0];return e.length<=1?r!=="any":r==="=="?cu(e[1],e[2],"=="):r==="!="?us(cu(e[1],e[2],"==")):r==="<"||r===">"||r==="<="||r===">="?cu(e[1],e[2],r):r==="any"?(t=e.slice(1),["any"].concat(t.map(ss))):r==="all"?["all"].concat(e.slice(1).map(ss)):r==="none"?["all"].concat(e.slice(1).map(ss).map(us)):r==="in"?Pl(e[1],e.slice(2)):r==="!in"?us(Pl(e[1],e.slice(2))):r==="has"?Cl(e[1]):r==="!has"?us(Cl(e[1])):r!=="within"||e}function cu(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Pl(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(r){return typeof r!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Vc)]]:["filter-in-small",e,["literal",t]]}}function Cl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function us(e){return["!",e]}function pu(e){return os(me(e.value))?Po(Se({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):(function t(r){var a=r.value,l=r.key;if(ur(a)!=="array")return[new H(l,a,"array expected, "+ur(a)+" found")];var c,h=r.styleSpec,m=[];if(a.length<1)return[new H(l,a,"filter array must have at least 1 element")];switch(m=m.concat(Ia({key:l+"[0]",value:a[0],valueSpec:h.filter_operator,style:r.style,styleSpec:r.styleSpec})),Ee(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&Ee(a[1])==="$type"&&m.push(new H(l,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&m.push(new H(l,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=ur(a[1]))!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));for(var g=2;g<a.length;g++)c=ur(a[g]),Ee(a[1])==="$type"?m=m.concat(Ia({key:l+"["+g+"]",value:a[g],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&m.push(new H(l+"["+g+"]",a[g],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var x=1;x<a.length;x++)m=m.concat(t({key:l+"["+x+"]",value:a[x],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&m.push(new H(l+"[1]",a[1],"object expected, "+c+" found"))}return m})(e)}function hu(e,t){var r=e.key,a=e.style,l=e.styleSpec,c=e.value,h=e.objectKey,m=l[t+"_"+e.layerType];if(!m)return[];var g=h.match(/^(.*)-transition$/);if(t==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return zt({key:r,value:c,valueSpec:l.transition,style:a,styleSpec:l});var x,S=e.valueSpec||m[h];if(!S)return[new H(r,c,'unknown property "'+h+'"')];if(ur(c)==="string"&&Eo(S)&&!S.tokens&&(x=/^{([^}]+)}$/.exec(c)))return[new H(r,c,'"'+h+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(x[1])+" }`.")];var I=[];return e.layerType==="symbol"&&(h==="text-field"&&a&&!a.glyphs&&I.push(new H(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&rs(me(c))&&Ee(c.type)==="identity"&&I.push(new H(r,c,'"text-font" does not support identity functions'))),I.concat(zt({key:e.key,value:c,valueSpec:S,style:a,styleSpec:l,expressionContext:"property",propertyType:t,propertyKey:h}))}function fu(e){return hu(e,"paint")}function Ta(e){return hu(e,"layout")}function kl(e){var t=[],r=e.value,a=e.key,l=e.style,c=e.styleSpec;r.type||r.ref||t.push(new H(a,r,'either "type" or "ref" is required'));var h,m=Ee(r.type),g=Ee(r.ref);if(r.id)for(var x=Ee(r.id),S=0;S<e.arrayIndex;S++){var I=l.layers[S];Ee(I.id)===x&&t.push(new H(a,r.id,'duplicate layer id "'+r.id+'", previously used at line '+I.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(j){j in r&&t.push(new H(a,r[j],'"'+j+'" is prohibited for ref layers'))})),l.layers.forEach((function(j){Ee(j.id)===g&&(h=j)})),h?h.ref?t.push(new H(a,r.ref,"ref cannot reference another ref layer")):m=Ee(h.type):t.push(new H(a,r.ref,'ref layer "'+g+'" not found'));else if(m!=="background")if(r.source){var C=l.sources&&l.sources[r.source],z=C&&Ee(C.type);C?z==="vector"&&m==="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a raster source')):z==="raster"&&m!=="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a vector source')):z!=="vector"||r["source-layer"]?z==="raster-dem"&&m!=="hillshade"?t.push(new H(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):m!=="line"||!r.paint||!r.paint["line-gradient"]||z==="geojson"&&C.lineMetrics||t.push(new H(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new H(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new H(a,r.source,'source "'+r.source+'" not found'))}else t.push(new H(a,r,'missing required property "source"'));return t=t.concat(vn({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return zt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:pu,layout:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return Ta(Se({layerType:m},G))}}})},paint:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return fu(Se({layerType:m},G))}}})}}}))}function Co(e){var t=e.value,r=e.key,a=ur(t);return a!=="string"?[new H(r,t,"string expected, "+a+" found")]:[]}var vr={promoteId:function(e){var t=e.key,r=e.value;if(ur(r)==="string")return Co({key:t,value:r});var a=[];for(var l in r)a.push.apply(a,Co({key:t+"."+l,value:r[l]}));return a}};function ls(e){var t=e.value,r=e.key,a=e.styleSpec,l=e.style;if(!t.type)return[new H(r,t,'"type" is required')];var c,h=Ee(t.type);switch(h){case"vector":case"raster":case"raster-dem":return vn({key:r,value:t,valueSpec:a["source_"+h.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:vr});case"geojson":if(c=vn({key:r,value:t,valueSpec:a.source_geojson,style:l,styleSpec:a,objectElementValidators:vr}),t.cluster)for(var m in t.clusterProperties){var g=t.clusterProperties[m],x=g[0],S=typeof x=="string"?[x,["accumulated"],["get",m]]:x;c.push.apply(c,Po({key:r+"."+m+".map",value:g[1],expressionContext:"cluster-map"})),c.push.apply(c,Po({key:r+"."+m+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return vn({key:r,value:t,valueSpec:a.source_video,style:l,styleSpec:a});case"image":return vn({key:r,value:t,valueSpec:a.source_image,style:l,styleSpec:a});case"canvas":return[new H(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ia({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ko(e){var t=e.value,r=e.styleSpec,a=r.light,l=e.style,c=[],h=ur(t);if(t===void 0)return c;if(h!=="object")return c.concat([new H("light",t,"object expected, "+h+" found")]);for(var m in t){var g=m.match(/^(.*)-transition$/);c=c.concat(g&&a[g[1]]&&a[g[1]].transition?zt({key:m,value:t[m],valueSpec:r.transition,style:l,styleSpec:r}):a[m]?zt({key:m,value:t[m],valueSpec:a[m],style:l,styleSpec:r}):[new H(m,t[m],'unknown property "'+m+'"')])}return c}var Qn={"*":function(){return[]},array:Tl,boolean:function(e){var t=e.value,r=e.key,a=ur(t);return a!=="boolean"?[new H(r,t,"boolean expected, "+a+" found")]:[]},number:Al,color:function(e){var t=e.key,r=e.value,a=ur(r);return a!=="string"?[new H(t,r,"color expected, "+a+" found")]:Bt(r)===null?[new H(t,r,'color expected, "'+r+'" found')]:[]},constants:se,enum:Ia,filter:pu,function:El,layer:kl,object:vn,source:ls,light:ko,string:Co,formatted:function(e){return Co(e).length===0?[]:Po(e)},resolvedImage:function(e){return Co(e).length===0?[]:Po(e)}};function zt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&rs(Ee(t))?El(e):r.expression&&wa(me(t))?Po(e):r.type&&Qn[r.type]?Qn[r.type](e):vn(Se({},e,{valueSpec:r.type?a[r.type]:r}))}function lr(e){var t=e.value,r=e.key,a=Co(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{range}" token'))),a}function Yi(e,t){t===void 0&&(t=L);var r=[];return r=r.concat(zt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:lr,"*":function(){return[]}}})),e.constants&&(r=r.concat(se({key:"constants",value:e.constants}))),Aa(r)}function Aa(e){return[].concat(e).sort((function(t,r){return t.line-r.line}))}function Qo(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Aa(e.apply(this,t))}}Yi.source=Qo(ls),Yi.light=Qo(ko),Yi.layer=Qo(kl),Yi.filter=Qo(pu),Yi.paintProperty=Qo(fu),Yi.layoutProperty=Qo(Ta);var Ea=Yi,qc=Ea.light,Uc=Ea.paintProperty,Pa=Ea.layoutProperty;function Ca(e,t){var r=!1;if(t&&t.length)for(var a=0,l=t;a<l.length;a+=1)e.fire(new re(new Error(l[a].message))),r=!0;return r}var Rn=Gr;function Gr(e,t,r){var a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var l=new Int32Array(this.arrayBuffer);e=l[0],this.d=(t=l[1])+2*(r=l[2]);for(var c=0;c<this.d*this.d;c++){var h=l[3+c],m=l[3+c+1];a.push(h===m?null:l.subarray(h,m))}var g=l[3+a.length+1];this.keys=l.subarray(l[3+a.length],g),this.bboxes=l.subarray(g),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var x=0;x<this.d*this.d;x++)a.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var S=r/t*e;this.min=-S,this.max=e+S}Gr.prototype.insert=function(e,t,r,a,l){this._forEachCell(t,r,a,l,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(l)},Gr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Gr.prototype._insertCell=function(e,t,r,a,l,c){this.cells[l].push(c)},Gr.prototype.query=function(e,t,r,a,l){var c=this.min,h=this.max;if(e<=c&&t<=c&&h<=r&&h<=a&&!l)return Array.prototype.slice.call(this.keys);var m=[];return this._forEachCell(e,t,r,a,this._queryCell,m,{},l),m},Gr.prototype._queryCell=function(e,t,r,a,l,c,h,m){var g=this.cells[l];if(g!==null)for(var x=this.keys,S=this.bboxes,I=0;I<g.length;I++){var C=g[I];if(h[C]===void 0){var z=4*C;(m?m(S[z+0],S[z+1],S[z+2],S[z+3]):e<=S[z+2]&&t<=S[z+3]&&r>=S[z+0]&&a>=S[z+1])?(h[C]=!0,c.push(x[C])):h[C]=!1}}},Gr.prototype._forEachCell=function(e,t,r,a,l,c,h,m){for(var g=this._convertToCellCoord(e),x=this._convertToCellCoord(t),S=this._convertToCellCoord(r),I=this._convertToCellCoord(a),C=g;C<=S;C++)for(var z=x;z<=I;z++){var j=this.d*z+C;if((!m||m(this._convertFromCellCoord(C),this._convertFromCellCoord(z),this._convertFromCellCoord(C+1),this._convertFromCellCoord(z+1)))&&l.call(this,e,t,r,a,j,c,h,m))return}},Gr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},Gr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},Gr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,a=0;a<this.cells.length;a++)r+=this.cells[a].length;var l=new Int32Array(t+r+this.keys.length+this.bboxes.length);l[0]=this.extent,l[1]=this.n,l[2]=this.padding;for(var c=t,h=0;h<e.length;h++){var m=e[h];l[3+h]=c,l.set(m,c),c+=m.length}return l[3+e.length]=c,l.set(this.keys,c),l[3+e.length+1]=c+=this.keys.length,l.set(this.bboxes,c),c+=this.bboxes.length,l.buffer};var ka=Y.ImageData,Ml=Y.ImageBitmap,qr={};function Xe(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),qr[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var Ni in Xe("Object",Object),Rn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},Rn.deserialize=function(e){return new Rn(e.buffer)},Xe("Grid",Rn),Xe("Color",Zt),Xe("Error",Error),Xe("ResolvedImage",Di),Xe("StylePropertyFunction",Yo),Xe("StyleExpression",Ko,{omit:["_evaluator"]}),Xe("ZoomDependentExpression",Jo),Xe("ZoomConstantExpression",Sa),Xe("CompoundExpression",di,{omit:["_evaluate"]}),Io)Io[Ni]._classRegistryKey||Xe("Expression_"+Ni,Io[Ni]);function cs(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function ea(e){return Ml&&e instanceof Ml}function gn(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(cs(e)||ea(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof ka)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var a=[],l=0,c=e;l<c.length;l+=1)a.push(gn(c[l],t));return a}if(typeof e=="object"){var h=e.constructor,m=h._classRegistryKey;if(!m)throw new Error("can't serialize object of unregistered class");var g=h.serialize?h.serialize(e,t):{};if(!h.serialize){for(var x in e)if(e.hasOwnProperty(x)&&!(qr[m].omit.indexOf(x)>=0)){var S=e[x];g[x]=qr[m].shallow.indexOf(x)>=0?S:gn(S,t)}e instanceof Error&&(g.message=e.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(g.$name=m),g}throw new Error("can't serialize object of type "+typeof e)}function ji(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||cs(e)||ea(e)||ArrayBuffer.isView(e)||e instanceof ka)return e;if(Array.isArray(e))return e.map(ji);if(typeof e=="object"){var t=e.$name||"Object",r=qr[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var a=Object.create(r.prototype),l=0,c=Object.keys(e);l<c.length;l+=1){var h=c[l];if(h!=="$name"){var m=e[h];a[h]=qr[t].shallow.indexOf(h)>=0?m:ji(m)}}return a}throw new Error("can't deserialize object of type "+typeof e)}var du=function(){this.first=!0};du.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var Le={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function mu(e){for(var t=0,r=e;t<r.length;t+=1)if(ps(r[t].charCodeAt(0)))return!0;return!1}function ps(e){return!(e!==746&&e!==747&&(e<4352||!(Le["Bopomofo Extended"](e)||Le.Bopomofo(e)||Le["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Le["CJK Compatibility Ideographs"](e)||Le["CJK Compatibility"](e)||Le["CJK Radicals Supplement"](e)||Le["CJK Strokes"](e)||!(!Le["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Le["CJK Unified Ideographs Extension A"](e)||Le["CJK Unified Ideographs"](e)||Le["Enclosed CJK Letters and Months"](e)||Le["Hangul Compatibility Jamo"](e)||Le["Hangul Jamo Extended-A"](e)||Le["Hangul Jamo Extended-B"](e)||Le["Hangul Jamo"](e)||Le["Hangul Syllables"](e)||Le.Hiragana(e)||Le["Ideographic Description Characters"](e)||Le.Kanbun(e)||Le["Kangxi Radicals"](e)||Le["Katakana Phonetic Extensions"](e)||Le.Katakana(e)&&e!==12540||!(!Le["Halfwidth and Fullwidth Forms"](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Le["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Le["Unified Canadian Aboriginal Syllabics"](e)||Le["Unified Canadian Aboriginal Syllabics Extended"](e)||Le["Vertical Forms"](e)||Le["Yijing Hexagram Symbols"](e)||Le["Yi Syllables"](e)||Le["Yi Radicals"](e))))}function yu(e){return!(ps(e)||(function(t){return!!(Le["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Le["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Le["Letterlike Symbols"](t)||Le["Number Forms"](t)||Le["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Le["Control Pictures"](t)&&t!==9251||Le["Optical Character Recognition"](t)||Le["Enclosed Alphanumerics"](t)||Le["Geometric Shapes"](t)||Le["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Le["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Le["CJK Symbols and Punctuation"](t)||Le.Katakana(t)||Le["Private Use Area"](t)||Le["CJK Compatibility Forms"](t)||Le["Small Form Variants"](t)||Le["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)})(e))}function sn(e){return e>=1424&&e<=2303||Le["Arabic Presentation Forms-A"](e)||Le["Arabic Presentation Forms-B"](e)}function Gi(e,t){return!(!t&&sn(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Le.Khmer(e))}function hs(e){for(var t=0,r=e;t<r.length;t+=1)if(sn(r[t].charCodeAt(0)))return!0;return!1}var fs=null,Zi="unavailable",Ln=null,Bl=function(e){e&&typeof e=="string"&&e.indexOf("NetworkError")>-1&&(Zi="error"),fs&&fs(e)};function Ma(){vu.fire(new Z("pluginStateChange",{pluginStatus:Zi,pluginURL:Ln}))}var vu=new ie,gu=function(){return Zi},_n=function(){if(Zi!=="deferred"||!Ln)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Zi="loading",Ma(),Ln&&ii({url:Ln},(function(e){e?Bl(e):(Zi="loaded",Ma())}))},Qi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Zi==="loaded"||Qi.applyArabicShaping!=null},isLoading:function(){return Zi==="loading"},setState:function(e){Zi=e.pluginStatus,Ln=e.pluginURL},isParsed:function(){return Qi.applyArabicShaping!=null&&Qi.processBidirectionalText!=null&&Qi.processStyledBidirectionalText!=null},getPluginURL:function(){return Ln}},Ct=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new du,this.transition={})};Ct.prototype.isSupportedScript=function(e){return(function(t,r){for(var a=0,l=t;a<l.length;a+=1)if(!Gi(l[a].charCodeAt(0),r))return!1;return!0})(e,Qi.isLoaded())},Ct.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Ct.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Tn=function(e,t){this.property=e,this.value=t,this.expression=(function(r,a){if(rs(r))return new Yo(r,a);if(wa(r)){var l=Il(r,a);if(l.result==="error")throw new Error(l.value.map((function(h){return h.key+": "+h.message})).join(", "));return l.value}var c=r;return typeof r=="string"&&a.type==="color"&&(c=Zt.parse(r)),{kind:"constant",evaluate:function(){return c}}})(t===void 0?e.specification.default:t,e.specification)};Tn.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Tn.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var un=function(e){this.property=e,this.value=new Tn(e,void 0)};un.prototype.transitioned=function(e,t){return new Mo(this.property,this.value,t,Re({},e.transition,this.transition),e.now)},un.prototype.untransitioned=function(){return new Mo(this.property,this.value,null,{},0)};var yi=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};yi.prototype.getValue=function(e){return kt(this._values[e].value.value)},yi.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].value=new Tn(this._values[e].property,t===null?void 0:kt(t))},yi.prototype.getTransition=function(e){return kt(this._values[e].transition)},yi.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].transition=kt(t)||void 0},yi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l);var c=this.getTransition(a);c!==void 0&&(e[a+"-transition"]=c)}return e},yi.prototype.transitioned=function(e,t){for(var r=new eo(this._properties),a=0,l=Object.keys(this._values);a<l.length;a+=1){var c=l[a];r._values[c]=this._values[c].transitioned(e,t._values[c])}return r},yi.prototype.untransitioned=function(){for(var e=new eo(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t];e._values[a]=this._values[a].untransitioned()}return e};var Mo=function(e,t,r,a,l){this.property=e,this.value=t,this.begin=l+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)};Mo.prototype.possiblyEvaluate=function(e,t,r){var a=e.now||0,l=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(a>this.end)return this.prior=null,l;if(this.value.isDataDriven())return this.prior=null,l;if(a<this.begin)return c.possiblyEvaluate(e,t,r);var h=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(c.possiblyEvaluate(e,t,r),l,(function(m){if(m<=0)return 0;if(m>=1)return 1;var g=m*m,x=g*m;return 4*(m<.5?x:3*(m-g)+x-.75)})(h))}return l};var eo=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};eo.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a},eo.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1)if(this._values[t[e]].prior)return!0;return!1};var xn=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};xn.prototype.getValue=function(e){return kt(this._values[e].value)},xn.prototype.setValue=function(e,t){this._values[e]=new Tn(this._values[e].property,t===null?void 0:kt(t))},xn.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l)}return e},xn.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a};var Ti=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Ti.prototype.isConstant=function(){return this.value.kind==="constant"},Ti.prototype.constantOr=function(e){return this.value.kind==="constant"?this.value.value:e},Ti.prototype.evaluate=function(e,t,r,a){return this.property.evaluate(this.value,this.parameters,e,t,r,a)};var Ba=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Ba.prototype.get=function(e){return this._values[e]};var it=function(e){this.specification=e};it.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},it.prototype.interpolate=function(e,t,r){var a=Ho[this.specification.type];return a?a(e,t,r):e};var Ye=function(e,t){this.specification=e,this.overrides=t};Ye.prototype.possiblyEvaluate=function(e,t,r,a){return new Ti(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,a)}:e.expression,t)},Ye.prototype.interpolate=function(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new Ti(this,{kind:"constant",value:void 0},e.parameters);var a=Ho[this.specification.type];return a?new Ti(this,{kind:"constant",value:a(e.value.value,t.value.value,r)},e.parameters):e},Ye.prototype.evaluate=function(e,t,r,a,l,c){return e.kind==="constant"?e.value:e.evaluate(t,r,a,l,c)};var ds=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a,l,c){if(r.value===void 0)return new Ti(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){var h=r.expression.evaluate(a,null,{},l,c),m=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,g=this._calculate(m,m,m,a);return new Ti(this,{kind:"constant",value:g},a)}if(r.expression.kind==="camera"){var x=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new Ti(this,{kind:"constant",value:x},a)}return new Ti(this,r.expression,a)},t.prototype.evaluate=function(r,a,l,c,h,m){if(r.kind==="source"){var g=r.evaluate(a,l,c,h,m);return this._calculate(g,g,g,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},l,c),r.evaluate({zoom:Math.floor(a.zoom)},l,c),r.evaluate({zoom:Math.floor(a.zoom)+1},l,c),a):r.value},t.prototype._calculate=function(r,a,l,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:l,to:a}},t.prototype.interpolate=function(r){return r},t})(Ye),Ai=function(e){this.specification=e};Ai.prototype.possiblyEvaluate=function(e,t,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){var l=e.expression.evaluate(t,null,{},r,a);return this._calculate(l,l,l,t)}return this._calculate(e.expression.evaluate(new Ct(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Ct(Math.floor(t.zoom),t)),e.expression.evaluate(new Ct(Math.floor(t.zoom+1),t)),t)}},Ai.prototype._calculate=function(e,t,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Ai.prototype.interpolate=function(e){return e};var bn=function(e){this.specification=e};bn.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},bn.prototype.interpolate=function(){return!1};var vi=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var a=this.defaultPropertyValues[t]=new Tn(r,void 0),l=this.defaultTransitionablePropertyValues[t]=new un(r);this.defaultTransitioningPropertyValues[t]=l.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Xe("DataDrivenProperty",Ye),Xe("DataConstantProperty",it),Xe("CrossFadedDataDrivenProperty",ds),Xe("CrossFadedProperty",Ai),Xe("ColorRampProperty",bn);var An=(function(e){function t(r,a){if(e.call(this),this.id=r.id,this.type=r.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},r.type!=="custom"&&(this.metadata=(r=r).metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new xn(a.layout)),a.paint)){for(var l in this._transitionablePaint=new yi(a.paint),r.paint)this.setPaintProperty(l,r.paint[l],{validate:!1});for(var c in r.layout)this.setLayoutProperty(c,r.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ba(a.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)},t.prototype.setLayoutProperty=function(r,a,l){l===void 0&&(l={}),a!=null&&this._validate(Pa,"layers."+this.id+".layout."+r,r,a,l)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)},t.prototype.getPaintProperty=function(r){return Ge(r,"-transition")?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)},t.prototype.setPaintProperty=function(r,a,l){if(l===void 0&&(l={}),a!=null&&this._validate(Uc,"layers."+this.id+".paint."+r,r,a,l))return!1;if(Ge(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;var c=this._transitionablePaint._values[r],h=c.property.specification["property-type"]==="cross-faded-data-driven",m=c.value.isDataDriven(),g=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var x=this._transitionablePaint._values[r].value;return x.isDataDriven()||m||h||this._handleOverridablePaintPropertyUpdate(r,g,x)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!1},t.prototype.isHidden=function(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"},t.prototype.updateTransitions=function(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)},t.prototype.serialize=function(){var r={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&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),tt(r,(function(a,l){return!(a===void 0||l==="layout"&&!Object.keys(a).length||l==="paint"&&!Object.keys(a).length)}))},t.prototype._validate=function(r,a,l,c,h){return h===void 0&&(h={}),(!h||h.validate!==!1)&&Ca(this,r.call(Ea,{key:a,layerType:this.type,objectKey:l,value:c,styleSpec:L,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var r in this.paint._values){var a=this.paint.get(r);if(a instanceof Ti&&Eo(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t})(ie),_u={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ms=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Xt=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ai(e,t){t===void 0&&(t=1);var r=0,a=0;return{members:e.map((function(l){var c=_u[l.type].BYTES_PER_ELEMENT,h=r=zl(r,Math.max(t,c)),m=l.components||1;return a=Math.max(a,c),r+=c*m,{name:l.name,type:l.type,components:m,offset:h}})),size:zl(r,Math.max(a,t)),alignment:t}}function zl(e,t){return Math.ceil(e/t)*t}Xt.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Xt.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Xt.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Xt.prototype.clear=function(){this.length=0},Xt.prototype.resize=function(e){this.reserve(e),this.length=e},Xt.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Xt.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Bo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.int16[c+0]=a,this.int16[c+1]=l,r},t})(Xt);Bo.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",Bo);var xu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.int16[m+0]=a,this.int16[m+1]=l,this.int16[m+2]=c,this.int16[m+3]=h,r},t})(Xt);xu.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",xu);var Fn=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var x=6*r;return this.int16[x+0]=a,this.int16[x+1]=l,this.int16[x+2]=c,this.int16[x+3]=h,this.int16[x+4]=m,this.int16[x+5]=g,r},t})(Xt);Fn.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",Fn);var $i=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var x=4*r,S=8*r;return this.int16[x+0]=a,this.int16[x+1]=l,this.uint8[S+4]=c,this.uint8[S+5]=h,this.uint8[S+6]=m,this.uint8[S+7]=g,r},t})(Xt);$i.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",$i);var ta=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.float32[c+0]=a,this.float32[c+1]=l,r},t})(Xt);ta.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",ta);var En=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I){var C=this.length;return this.resize(C+1),this.emplace(C,r,a,l,c,h,m,g,x,S,I)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C){var z=10*r;return this.uint16[z+0]=a,this.uint16[z+1]=l,this.uint16[z+2]=c,this.uint16[z+3]=h,this.uint16[z+4]=m,this.uint16[z+5]=g,this.uint16[z+6]=x,this.uint16[z+7]=S,this.uint16[z+8]=I,this.uint16[z+9]=C,r},t})(Xt);En.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",En);var ys=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I,C,z){var j=this.length;return this.resize(j+1),this.emplace(j,r,a,l,c,h,m,g,x,S,I,C,z)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C,z,j){var G=12*r;return this.int16[G+0]=a,this.int16[G+1]=l,this.int16[G+2]=c,this.int16[G+3]=h,this.uint16[G+4]=m,this.uint16[G+5]=g,this.uint16[G+6]=x,this.uint16[G+7]=S,this.int16[G+8]=I,this.int16[G+9]=C,this.int16[G+10]=z,this.int16[G+11]=j,r},t})(Xt);ys.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",ys);var ra=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.float32[h+0]=a,this.float32[h+1]=l,this.float32[h+2]=c,r},t})(Xt);ra.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",ra);var za=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint32[1*r+0]=a,r},t})(Xt);za.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",za);var bu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S){var I=this.length;return this.resize(I+1),this.emplace(I,r,a,l,c,h,m,g,x,S)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I){var C=10*r,z=5*r;return this.int16[C+0]=a,this.int16[C+1]=l,this.int16[C+2]=c,this.int16[C+3]=h,this.int16[C+4]=m,this.int16[C+5]=g,this.uint32[z+3]=x,this.uint16[C+8]=S,this.uint16[C+9]=I,r},t})(Xt);bu.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",bu);var ia=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var x=6*r;return this.int16[x+0]=a,this.int16[x+1]=l,this.int16[x+2]=c,this.int16[x+3]=h,this.int16[x+4]=m,this.int16[x+5]=g,r},t})(Xt);ia.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",ia);var zo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h){var m=this.length;return this.resize(m+1),this.emplace(m,r,a,l,c,h)},t.prototype.emplace=function(r,a,l,c,h,m){var g=4*r,x=8*r;return this.float32[g+0]=a,this.float32[g+1]=l,this.float32[g+2]=c,this.int16[x+6]=h,this.int16[x+7]=m,r},t})(Xt);zo.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",zo);var wu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=12*r,g=3*r;return this.uint8[m+0]=a,this.uint8[m+1]=l,this.float32[g+1]=c,this.float32[g+2]=h,r},t})(Xt);wu.prototype.bytesPerElement=12,Xe("StructArrayLayout2ub2f12",wu);var to=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.uint16[h+0]=a,this.uint16[h+1]=l,this.uint16[h+2]=c,r},t})(Xt);to.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",to);var ro=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe){var le=this.length;return this.resize(le+1),this.emplace(le,r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le){var ce=24*r,he=12*r,xe=48*r;return this.int16[ce+0]=a,this.int16[ce+1]=l,this.uint16[ce+2]=c,this.uint16[ce+3]=h,this.uint32[he+2]=m,this.uint32[he+3]=g,this.uint32[he+4]=x,this.uint16[ce+10]=S,this.uint16[ce+11]=I,this.uint16[ce+12]=C,this.float32[he+7]=z,this.float32[he+8]=j,this.uint8[xe+36]=G,this.uint8[xe+37]=te,this.uint8[xe+38]=K,this.uint32[he+10]=oe,this.int16[ce+22]=le,r},t})(Xt);ro.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ro);var vs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,De,rt,Ue,ot,je,bt){var pt=this.length;return this.resize(pt+1),this.emplace(pt,r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,De,rt,Ue,ot,je,bt)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,De,rt,Ue,ot,je,bt,pt){var Qe=34*r,Tt=17*r;return this.int16[Qe+0]=a,this.int16[Qe+1]=l,this.int16[Qe+2]=c,this.int16[Qe+3]=h,this.int16[Qe+4]=m,this.int16[Qe+5]=g,this.int16[Qe+6]=x,this.int16[Qe+7]=S,this.uint16[Qe+8]=I,this.uint16[Qe+9]=C,this.uint16[Qe+10]=z,this.uint16[Qe+11]=j,this.uint16[Qe+12]=G,this.uint16[Qe+13]=te,this.uint16[Qe+14]=K,this.uint16[Qe+15]=oe,this.uint16[Qe+16]=le,this.uint16[Qe+17]=ce,this.uint16[Qe+18]=he,this.uint16[Qe+19]=xe,this.uint16[Qe+20]=Pe,this.uint16[Qe+21]=De,this.uint16[Qe+22]=rt,this.uint32[Tt+12]=Ue,this.float32[Tt+13]=ot,this.float32[Tt+14]=je,this.float32[Tt+15]=bt,this.float32[Tt+16]=pt,r},t})(Xt);vs.prototype.bytesPerElement=68,Xe("StructArrayLayout8i15ui1ul4f68",vs);var io=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.float32[1*r+0]=a,r},t})(Xt);io.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",io);var ln=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.int16[h+0]=a,this.int16[h+1]=l,this.int16[h+2]=c,r},t})(Xt);ln.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",ln);var Su=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=4*r;return this.uint32[2*r+0]=a,this.uint16[h+2]=l,this.uint16[h+3]=c,r},t})(Xt);Su.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Su);var Da=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.uint16[c+0]=a,this.uint16[c+1]=l,r},t})(Xt);Da.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",Da);var Iu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint16[1*r+0]=a,r},t})(Xt);Iu.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",Iu);var gs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.float32[m+0]=a,this.float32[m+1]=l,this.float32[m+2]=c,this.float32[m+3]=h,r},t})(Xt);gs.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",gs);var i=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;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},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.anchorPoint.get=function(){return new X(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t})(ms);i.prototype.size=20;var o=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new i(this,r)},t})(bu);Xe("CollisionBoxArray",o);var n=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;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(a){this._structArray.uint8[this._pos1+37]=a},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(a){this._structArray.uint8[this._pos1+38]=a},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+10]=a},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t})(ms);n.prototype.size=48;var s=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new n(this,r)},t})(ro);Xe("PlacedSymbolArray",s);var p=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;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},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{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.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+12]=a},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t})(ms);p.prototype.size=68;var f=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t})(vs);Xe("SymbolInstanceArray",f);var d=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(r){return this.float32[1*r+0]},t})(io);Xe("GlyphOffsetArray",d);var v=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(r){return this.int16[3*r+0]},t.prototype.gety=function(r){return this.int16[3*r+1]},t.prototype.gettileUnitDistanceFromAnchor=function(r){return this.int16[3*r+2]},t})(ln);Xe("SymbolLineVertexArray",v);var w=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;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(t.prototype,r),t})(ms);w.prototype.size=8;var A=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new w(this,r)},t})(Su);Xe("FeatureIndexArray",A);var D=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,F=function(e){e===void 0&&(e=[]),this.segments=e};function O(e,t){return 256*(e=Oe(Math.floor(e),0,255))+Oe(Math.floor(t),0,255)}F.prototype.prepareSegment=function(e,t,r,a){var l=this.segments[this.segments.length-1];return e>F.MAX_VERTEX_ARRAY_LENGTH&&St("Max vertices per segment is "+F.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!l||l.vertexLength+e>F.MAX_VERTEX_ARRAY_LENGTH||l.sortKey!==a)&&(l={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(l.sortKey=a),this.segments.push(l)),l},F.prototype.get=function(){return this.segments},F.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var a in r.vaos)r.vaos[a].destroy()}},F.simpleSegment=function(e,t,r,a){return new F([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])},F.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Xe("SegmentVector",F);var W=ai([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),$=U((function(e){e.exports=function(t,r){var a,l,c,h,m,g,x,S;for(l=t.length-(a=3&t.length),c=r,m=3432918353,g=461845907,S=0;S<l;)x=255&t.charCodeAt(S)|(255&t.charCodeAt(++S))<<8|(255&t.charCodeAt(++S))<<16|(255&t.charCodeAt(++S))<<24,++S,c=27492+(65535&(h=5*(65535&(c=(c^=x=(65535&(x=(x=(65535&x)*m+(((x>>>16)*m&65535)<<16)&4294967295)<<15|x>>>17))*g+(((x>>>16)*g&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(x=0,a){case 3:x^=(255&t.charCodeAt(S+2))<<16;case 2:x^=(255&t.charCodeAt(S+1))<<8;case 1:c^=x=(65535&(x=(x=(65535&(x^=255&t.charCodeAt(S)))*m+(((x>>>16)*m&65535)<<16)&4294967295)<<15|x>>>17))*g+(((x>>>16)*g&65535)<<16)&4294967295}return c^=t.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0}})),ee=U((function(e){e.exports=function(t,r){for(var a,l=t.length,c=r^l,h=0;l>=4;)a=1540483477*(65535&(a=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(a>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),l-=4,++h;switch(l){case 3:c^=(255&t.charCodeAt(h+2))<<16;case 2:c^=(255&t.charCodeAt(h+1))<<8;case 1:c=1540483477*(65535&(c^=255&t.charCodeAt(h)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0}})),N=$,Q=ee;N.murmur3=$,N.murmur2=Q;var ne=function(){this.ids=[],this.positions=[],this.indexed=!1};ne.prototype.add=function(e,t,r,a){this.ids.push(de(e)),this.positions.push(t,r,a)},ne.prototype.getPositions=function(e){for(var t=de(e),r=0,a=this.ids.length-1;r<a;){var l=r+a>>1;this.ids[l]>=t?a=l:r=l+1}for(var c=[];this.ids[r]===t;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c},ne.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return(function l(c,h,m,g){for(;m<g;){for(var x=c[m+g>>1],S=m-1,I=g+1;;){do S++;while(c[S]<x);do I--;while(c[I]>x);if(S>=I)break;pe(c,S,I),pe(h,3*S,3*I),pe(h,3*S+1,3*I+1),pe(h,3*S+2,3*I+2)}I-m<g-I?(l(c,h,m,I),m=I+1):(l(c,h,I+1,g),g=I)}})(r,a,0,r.length-1),t&&t.push(r.buffer,a.buffer),{ids:r,positions:a}},ne.deserialize=function(e){var t=new ne;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ue=Math.pow(2,53)-1;function de(e){var t=+e;return!isNaN(t)&&t<=ue?t:N(String(e))}function pe(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Xe("FeaturePositionMap",ne);var ye=function(e,t){this.gl=e.gl,this.location=t},Ie=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))},t})(ye),Me=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))},t})(ye),Ce=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))},t})(ye),$e=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))},t})(ye),nt=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3]))},t})(ye),ut=(function(e){function t(r,a){e.call(this,r,a),this.current=Zt.transparent}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a))},t})(ye),st=new Float32Array(16),Lt=(function(e){function t(r,a){e.call(this,r,a),this.current=st}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(var a=1;a<16;a++)if(r[a]!==this.current[a]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}},t})(ye);function He(e){return[O(255*e.r,255*e.g),O(255*e.b,255*e.a)]}var mt=function(e,t,r){this.value=e,this.uniformNames=t.map((function(a){return"u_"+a})),this.type=r};mt.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},mt.prototype.getBinding=function(e,t,r){return this.type==="color"?new ut(e,t):new Me(e,t)};var xt=function(e,t){this.uniformNames=t.map((function(r){return"u_"+r})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};xt.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},xt.prototype.setUniform=function(e,t,r,a){var l=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;l&&e.set(l)},xt.prototype.getBinding=function(e,t,r){return r.substr(0,9)==="u_pattern"?new nt(e,t):new Me(e,t)};var dt=function(e,t,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((function(l){return{name:"a_"+l,type:"Float32",components:r==="color"?2:1,offset:0}})),this.paintVertexArray=new a};dt.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.paintVertexArray.length,h=this.expression.evaluate(new Ct(0),t,{},a,[],l);this.paintVertexArray.resize(e),this._setPaintValue(c,e,h)},dt.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,t,l)},dt.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var a=He(r),l=e;l<t;l++)this.paintVertexArray.emplace(l,a[0],a[1]);else{for(var c=e;c<t;c++)this.paintVertexArray.emplace(c,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},dt.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},dt.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var ft=function(e,t,r,a,l,c){this.expression=e,this.uniformNames=t.map((function(h){return"u_"+h+"_t"})),this.type=r,this.useIntegerZoom=a,this.zoom=l,this.maxValue=0,this.paintVertexAttributes=t.map((function(h){return{name:"a_"+h,type:"Float32",components:r==="color"?4:2,offset:0}})),this.paintVertexArray=new c};ft.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.expression.evaluate(new Ct(this.zoom),t,{},a,[],l),h=this.expression.evaluate(new Ct(this.zoom+1),t,{},a,[],l),m=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(m,e,c,h)},ft.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:this.zoom},r,a),c=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,t,l,c)},ft.prototype._setPaintValue=function(e,t,r,a){if(this.type==="color")for(var l=He(r),c=He(a),h=e;h<t;h++)this.paintVertexArray.emplace(h,l[0],l[1],c[0],c[1]);else{for(var m=e;m<t;m++)this.paintVertexArray.emplace(m,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}},ft.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ft.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ft.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,a=Oe(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(a)},ft.prototype.getBinding=function(e,t,r){return new Me(e,t)};var gt=function(e,t,r,a,l,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=a,this.layerId=c,this.zoomInPaintVertexArray=new l,this.zoomOutPaintVertexArray=new l};gt.prototype.populatePaintArray=function(e,t,r){var a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,t.patterns&&t.patterns[this.layerId],r)},gt.prototype.updatePaintArray=function(e,t,r,a,l){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],l)},gt.prototype._setPaintValues=function(e,t,r,a){if(a&&r){var l=a[r.min],c=a[r.mid],h=a[r.max];if(l&&c&&h)for(var m=e;m<t;m++)this.zoomInPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1],c.pixelRatio,h.pixelRatio)}},gt.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,W.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,W.members,this.expression.isStateDependent))},gt.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var ht=function(e,t,r){this.binders={},this._buffers=[];var a=[];for(var l in e.paint._values)if(r(l)){var c=e.paint.get(l);if(c instanceof Ti&&Eo(c.property.specification)){var h=Jr(l,e.type),m=c.value,g=c.property.specification.type,x=c.property.useIntegerZoom,S=c.property.specification["property-type"],I=S==="cross-faded"||S==="cross-faded-data-driven";if(m.kind==="constant")this.binders[l]=I?new xt(m.value,h):new mt(m.value,h,g),a.push("/u_"+l);else if(m.kind==="source"||I){var C=Ir(l,g,"source");this.binders[l]=I?new gt(m,g,x,t,C,e.id):new dt(m,h,g,C),a.push("/a_"+l)}else{var z=Ir(l,g,"composite");this.binders[l]=new ft(m,h,g,x,t,z),a.push("/z_"+l)}}}this.cacheKey=a.sort().join("")};ht.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof dt||t instanceof ft?t.maxValue:0},ht.prototype.populatePaintArrays=function(e,t,r,a,l){for(var c in this.binders){var h=this.binders[c];(h instanceof dt||h instanceof ft||h instanceof gt)&&h.populatePaintArray(e,t,r,a,l)}},ht.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var a=this.binders[r];a instanceof xt&&a.setConstantPatternPositions(e,t)}},ht.prototype.updatePaintArrays=function(e,t,r,a,l){var c=!1;for(var h in e)for(var m=0,g=t.getPositions(h);m<g.length;m+=1){var x=g[m],S=r.feature(x.index);for(var I in this.binders){var C=this.binders[I];if((C instanceof dt||C instanceof ft||C instanceof gt)&&C.expression.isStateDependent===!0){var z=a.paint.get(I);C.expression=z.value,C.updatePaintArray(x.start,x.end,S,e[h],l),c=!0}}}return c},ht.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof mt||r instanceof xt)&&e.push.apply(e,r.uniformNames.map((function(a){return"#define HAS_UNIFORM_"+a})))}return e},ht.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof dt||r instanceof ft)for(var a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name);else if(r instanceof gt)for(var l=0;l<W.members.length;l++)e.push(W.members[l].name)}return e},ht.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof mt||r instanceof xt||r instanceof ft)for(var a=0,l=r.uniformNames;a<l.length;a+=1)e.push(l[a])}return e},ht.prototype.getPaintVertexBuffers=function(){return this._buffers},ht.prototype.getUniforms=function(e,t){var r=[];for(var a in this.binders){var l=this.binders[a];if(l instanceof mt||l instanceof xt||l instanceof ft)for(var c=0,h=l.uniformNames;c<h.length;c+=1){var m=h[c];if(t[m]){var g=l.getBinding(e,t[m],m);r.push({name:m,property:a,binding:g})}}}return r},ht.prototype.setUniforms=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1){var h=c[l],m=h.name,g=h.property;this.binders[g].setUniform(h.binding,a,r.get(g),m)}},ht.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof gt){var a=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof dt||r instanceof ft)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},ht.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof dt||r instanceof ft||r instanceof gt)&&r.upload(e)}this.updatePaintBuffers()},ht.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof dt||t instanceof ft||t instanceof gt)&&t.destroy()}};var ct=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var a=0,l=e;a<l.length;a+=1){var c=l[a];this.programConfigurations[c.id]=new ht(c,t,r)}this.needsUpload=!1,this._featureMap=new ne,this._bufferOffset=0};function Jr(e,t){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"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function Ir(e,t,r){var a={color:{source:ta,composite:gs},number:{source:io,composite:ta}},l=(function(c){return{"line-pattern":{source:En,composite:En},"fill-pattern":{source:En,composite:En},"fill-extrusion-pattern":{source:En,composite:En}}[c]})(e);return l&&l[r]||a[t][r]}ct.prototype.populatePaintArrays=function(e,t,r,a,l,c){for(var h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,t,a,l,c);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},ct.prototype.updatePaintArrays=function(e,t,r,a){for(var l=0,c=r;l<c.length;l+=1){var h=c[l];this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,t,h,a)||this.needsUpload}},ct.prototype.get=function(e){return this.programConfigurations[e]},ct.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},ct.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},Xe("ConstantBinder",mt),Xe("CrossFadedConstantBinder",xt),Xe("SourceExpressionBinder",dt),Xe("CrossFadedCompositeBinder",gt),Xe("CompositeExpressionBinder",ft),Xe("ProgramConfiguration",ht,{omit:["_buffers"]}),Xe("ProgramConfigurationSet",ct);var gi=Math.pow(2,14)-1,si=-gi-1;function wr(e){for(var t=8192/e.extent,r=e.loadGeometry(),a=0;a<r.length;a++)for(var l=r[a],c=0;c<l.length;c++){var h=l[c],m=Math.round(h.x*t),g=Math.round(h.y*t);h.x=Oe(m,si,gi),h.y=Oe(g,si,gi),(m<h.x||m>h.x+1||g<h.y||g>h.y+1)&&St("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function kr(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?wr(e):[]}}function Wi(e,t,r,a,l){e.emplaceBack(2*t+(a+1)/2,2*r+(l+1)/2)}var Ei=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Bo,this.indexArray=new to,this.segments=new F,this.programConfigurations=new ct(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function no(e,t){for(var r=0;r<e.length;r++)if(Pn(t,e[r]))return!0;for(var a=0;a<t.length;a++)if(Pn(e,t[a]))return!0;return!!Ra(e,t)}function Ri(e,t,r){return!!Pn(e,t)||!!oo(t,e,r)}function wn(e,t){if(e.length===1)return La(t,e[0]);for(var r=0;r<t.length;r++)for(var a=t[r],l=0;l<a.length;l++)if(Pn(e,a[l]))return!0;for(var c=0;c<e.length;c++)if(La(t,e[c]))return!0;for(var h=0;h<t.length;h++)if(Ra(e,t[h]))return!0;return!1}function cn(e,t,r){if(e.length>1){if(Ra(e,t))return!0;for(var a=0;a<t.length;a++)if(oo(t[a],e,r))return!0}for(var l=0;l<e.length;l++)if(oo(e[l],t,r))return!0;return!1}function Ra(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var a=e[r],l=e[r+1],c=0;c<t.length-1;c++)if(na(a,l,t[c],t[c+1]))return!0;return!1}function na(e,t,r,a){return Ut(e,r,a)!==Ut(t,r,a)&&Ut(e,t,r)!==Ut(e,t,a)}function oo(e,t,r){var a=r*r;if(t.length===1)return e.distSqr(t[0])<a;for(var l=1;l<t.length;l++)if(oa(e,t[l-1],t[l])<a)return!0;return!1}function oa(e,t,r){var a=t.distSqr(r);if(a===0)return e.distSqr(t);var l=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/a;return e.distSqr(l<0?t:l>1?r:r.sub(t)._mult(l)._add(t))}function La(e,t){for(var r,a,l,c=!1,h=0;h<e.length;h++)for(var m=0,g=(r=e[h]).length-1;m<r.length;g=m++)(a=r[m]).y>t.y!=(l=r[g]).y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(c=!c);return c}function Pn(e,t){for(var r=!1,a=0,l=e.length-1;a<e.length;l=a++){var c=e[a],h=e[l];c.y>t.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(r=!r)}return r}function Fa(e,t,r){var a=r[0],l=r[2];if(e.x<a.x&&t.x<a.x||e.x>l.x&&t.x>l.x||e.y<a.y&&t.y<a.y||e.y>l.y&&t.y>l.y)return!1;var c=Ut(e,t,r[0]);return c!==Ut(e,t,r[1])||c!==Ut(e,t,r[2])||c!==Ut(e,t,r[3])}function Cn(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Yr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function On(e,t,r,a,l){if(!t[0]&&!t[1])return e;var c=X.convert(t)._mult(l);r==="viewport"&&c._rotate(-a);for(var h=[],m=0;m<e.length;m++)h.push(e[m].sub(c));return h}Ei.prototype.populate=function(e,t,r){var a=this.layers[0],l=[],c=null;a.type==="circle"&&(c=a.layout.get("circle-sort-key"));for(var h=0,m=e;h<m.length;h+=1){var g=m[h],x=g.feature,S=g.id,I=g.index,C=g.sourceLayerIndex,z=this.layers[0]._featureFilter.needGeometry,j=kr(x,z);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),j,r)){var G=c?c.evaluate(j,{},r):void 0,te={id:S,properties:x.properties,type:x.type,sourceLayerIndex:C,index:I,geometry:z?j.geometry:wr(x),patterns:{},sortKey:G};l.push(te)}}c&&l.sort((function(De,rt){return De.sortKey-rt.sortKey}));for(var K=0,oe=l;K<oe.length;K+=1){var le=oe[K],ce=le.geometry,he=le.index,xe=le.sourceLayerIndex,Pe=e[he].feature;this.addFeature(le,ce,he,r),t.featureIndex.insert(Pe,ce,he,xe,this.index)}},Ei.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Ei.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Ei.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ei.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,D),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Ei.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ei.prototype.addFeature=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1)for(var h=0,m=c[l];h<m.length;h+=1){var g=m[h],x=g.x,S=g.y;if(!(x<0||x>=8192||S<0||S>=8192)){var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=I.vertexLength;Wi(this.layoutVertexArray,x,S,-1,-1),Wi(this.layoutVertexArray,x,S,1,-1),Wi(this.layoutVertexArray,x,S,1,1),Wi(this.layoutVertexArray,x,S,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),I.vertexLength+=4,I.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Xe("CircleBucket",Ei,{omit:["layers"]});var ao=new vi({"circle-sort-key":new Ye(L.layout_circle["circle-sort-key"])}),Do={paint:new vi({"circle-radius":new Ye(L.paint_circle["circle-radius"]),"circle-color":new Ye(L.paint_circle["circle-color"]),"circle-blur":new Ye(L.paint_circle["circle-blur"]),"circle-opacity":new Ye(L.paint_circle["circle-opacity"]),"circle-translate":new it(L.paint_circle["circle-translate"]),"circle-translate-anchor":new it(L.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new it(L.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new it(L.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ye(L.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ye(L.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ye(L.paint_circle["circle-stroke-opacity"])}),layout:ao},$t=typeof Float32Array<"u"?Float32Array:Array;function en(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Li(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],x=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],G=t[12],te=t[13],K=t[14],oe=t[15],le=r[0],ce=r[1],he=r[2],xe=r[3];return e[0]=le*a+ce*m+he*I+xe*G,e[1]=le*l+ce*g+he*C+xe*te,e[2]=le*c+ce*x+he*z+xe*K,e[3]=le*h+ce*S+he*j+xe*oe,e[4]=(le=r[4])*a+(ce=r[5])*m+(he=r[6])*I+(xe=r[7])*G,e[5]=le*l+ce*g+he*C+xe*te,e[6]=le*c+ce*x+he*z+xe*K,e[7]=le*h+ce*S+he*j+xe*oe,e[8]=(le=r[8])*a+(ce=r[9])*m+(he=r[10])*I+(xe=r[11])*G,e[9]=le*l+ce*g+he*C+xe*te,e[10]=le*c+ce*x+he*z+xe*K,e[11]=le*h+ce*S+he*j+xe*oe,e[12]=(le=r[12])*a+(ce=r[13])*m+(he=r[14])*I+(xe=r[15])*G,e[13]=le*l+ce*g+he*C+xe*te,e[14]=le*c+ce*x+he*z+xe*K,e[15]=le*h+ce*S+he*j+xe*oe,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Ro,Nc=Li;function _s(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3];return e[0]=r[0]*a+r[4]*l+r[8]*c+r[12]*h,e[1]=r[1]*a+r[5]*l+r[9]*c+r[13]*h,e[2]=r[2]*a+r[6]*l+r[10]*c+r[14]*h,e[3]=r[3]*a+r[7]*l+r[11]*c+r[15]*h,e}Ro=new $t(3),$t!=Float32Array&&(Ro[0]=0,Ro[1]=0,Ro[2]=0),(function(){var e=new $t(4);$t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)})();var jc=((function(){var e=new $t(2);$t!=Float32Array&&(e[0]=0,e[1]=0)})(),(function(e){function t(r){e.call(this,r,Do)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Ei(r)},t.prototype.queryRadius=function(r){var a=r;return Cn("circle-radius",this,a)+Cn("circle-stroke-width",this,a)+Yr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,x){for(var S=On(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),m.angle,g),I=this.paint.get("circle-radius").evaluate(a,l)+this.paint.get("circle-stroke-width").evaluate(a,l),C=this.paint.get("circle-pitch-alignment")==="map",z=C?S:(function(Pe,De){return Pe.map((function(rt){return Oa(rt,De)}))})(S,x),j=C?I*g:I,G=0,te=c;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1){var le=oe[K],ce=C?le:Oa(le,x),he=j,xe=_s([],[le.x,le.y,0,1],x);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?he*=xe[3]/m.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(he*=m.cameraToCenterDistance/xe[3]),Ri(z,ce,he))return!0}return!1},t})(An));function Oa(e,t){var r=_s([],[e.x,e.y,0,1],t);return new X(r[0]/r[3],r[1]/r[3])}var Dl=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Ei);function aa(e,t,r,a){var l=t.width,c=t.height;if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==l*c*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(l*c*r);return e.width=l,e.height=c,e.data=a,e}function xs(e,t,r){var a=t.width,l=t.height;if(a!==e.width||l!==e.height){var c=aa({},{width:a,height:l},r);Gc(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,a),height:Math.min(e.height,l)},r),e.width=a,e.height=l,e.data=c.data}}function Gc(e,t,r,a,l,c){if(l.width===0||l.height===0)return t;if(l.width>e.width||l.height>e.height||r.x>e.width-l.width||r.y>e.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||a.x>t.width-l.width||a.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");for(var h=e.data,m=t.data,g=0;g<l.height;g++)for(var x=((r.y+g)*e.width+r.x)*c,S=((a.y+g)*t.width+a.x)*c,I=0;I<l.width*c;I++)m[S+I]=h[x+I];return t}Xe("HeatmapBucket",Dl,{omit:["layers"]});var Va=function(e,t){aa(this,e,1,t)};Va.prototype.resize=function(e){xs(this,e,1)},Va.prototype.clone=function(){return new Va({width:this.width,height:this.height},new Uint8Array(this.data))},Va.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,1)};var Hi=function(e,t){aa(this,e,4,t)};Hi.prototype.resize=function(e){xs(this,e,4)},Hi.prototype.replace=function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e},Hi.prototype.clone=function(){return new Hi({width:this.width,height:this.height},new Uint8Array(this.data))},Hi.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,4)},Xe("AlphaImage",Va),Xe("RGBAImage",Hi);var Zx={paint:new vi({"heatmap-radius":new Ye(L.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ye(L.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new it(L.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bn(L.paint_heatmap["heatmap-color"]),"heatmap-opacity":new it(L.paint_heatmap["heatmap-opacity"])})};function um(e){var t={},r=e.resolution||256,a=e.clips?e.clips.length:1,l=e.image||new Hi({width:r,height:a}),c=function(j,G,te){t[e.evaluationKey]=te;var K=e.expression.evaluate(t);l.data[j+G+0]=Math.floor(255*K.r/K.a),l.data[j+G+1]=Math.floor(255*K.g/K.a),l.data[j+G+2]=Math.floor(255*K.b/K.a),l.data[j+G+3]=Math.floor(255*K.a)};if(e.clips)for(var h=0,m=0;h<a;++h,m+=4*r)for(var g=0,x=0;g<r;g++,x+=4){var S=g/(r-1),I=e.clips[h];c(m,x,I.start*(1-S)+I.end*S)}else for(var C=0,z=0;C<r;C++,z+=4)c(0,z,C/(r-1));return l}var $x=(function(e){function t(r){e.call(this,r,Zx),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Dl(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=um({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},t})(An),Wx={paint:new vi({"hillshade-illumination-direction":new it(L.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new it(L.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new it(L.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new it(L.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new it(L.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new it(L.paint_hillshade["hillshade-accent-color"])})},Hx=(function(e){function t(r){e.call(this,r,Wx)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},t})(An),Xx=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,Zc=Rl,Kx=Rl;function Rl(e,t,r){r=r||2;var a,l,c,h,m,g,x,S=t&&t.length,I=S?t[0]*r:e.length,C=lm(e,0,I,r,!0),z=[];if(!C||C.next===C.prev)return z;if(S&&(C=(function(G,te,K,oe){var le,ce,he,xe=[];for(le=0,ce=te.length;le<ce;le++)(he=lm(G,te[le]*oe,le<ce-1?te[le+1]*oe:G.length,oe,!1))===he.next&&(he.steiner=!0),xe.push(nb(he));for(xe.sort(tb),le=0;le<xe.length;le++)rb(xe[le],K),K=sa(K,K.next);return K})(e,t,C,r)),e.length>80*r){a=c=e[0],l=h=e[1];for(var j=r;j<I;j+=r)(m=e[j])<a&&(a=m),(g=e[j+1])<l&&(l=g),m>c&&(c=m),g>h&&(h=g);x=(x=Math.max(c-a,h-l))!==0?1/x:0}return Tu(C,z,r,a,l,x),z}function lm(e,t,r,a,l){var c,h;if(l===Hc(e,t,r,a)>0)for(c=t;c<r;c+=a)h=hm(c,e[c],e[c+1],h);else for(c=r-a;c>=t;c-=a)h=hm(c,e[c],e[c+1],h);return h&&Ll(h,h.next)&&(Eu(h),h=h.next),h}function sa(e,t){if(!e)return e;t||(t=e);var r,a=e;do if(r=!1,a.steiner||!Ll(a,a.next)&&Zr(a.prev,a,a.next)!==0)a=a.next;else{if(Eu(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function Tu(e,t,r,a,l,c,h){if(e){!h&&c&&(function(S,I,C,z){var j=S;do j.z===null&&(j.z=$c(j.x,j.y,I,C,z)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==S);j.prevZ.nextZ=null,j.prevZ=null,(function(G){var te,K,oe,le,ce,he,xe,Pe,De=1;do{for(K=G,G=null,ce=null,he=0;K;){for(he++,oe=K,xe=0,te=0;te<De&&(xe++,oe=oe.nextZ);te++);for(Pe=De;xe>0||Pe>0&&oe;)xe!==0&&(Pe===0||!oe||K.z<=oe.z)?(le=K,K=K.nextZ,xe--):(le=oe,oe=oe.nextZ,Pe--),ce?ce.nextZ=le:G=le,le.prevZ=ce,ce=le;K=oe}ce.nextZ=null,De*=2}while(he>1)})(j)})(e,a,l,c);for(var m,g,x=e;e.prev!==e.next;)if(m=e.prev,g=e.next,c?Yx(e,a,l,c):Jx(e))t.push(m.i/r),t.push(e.i/r),t.push(g.i/r),Eu(e),e=g.next,x=g.next;else if((e=g)===x){h?h===1?Tu(e=Qx(sa(e),t,r),t,r,a,l,c,2):h===2&&eb(e,t,r,a,l,c):Tu(sa(e),t,r,a,l,c,1);break}}}function Jx(e){var t=e.prev,r=e,a=e.next;if(Zr(t,r,a)>=0)return!1;for(var l=e.next.next;l!==e.prev;){if(bs(t.x,t.y,r.x,r.y,a.x,a.y,l.x,l.y)&&Zr(l.prev,l,l.next)>=0)return!1;l=l.next}return!0}function Yx(e,t,r,a){var l=e.prev,c=e,h=e.next;if(Zr(l,c,h)>=0)return!1;for(var m=l.x>c.x?l.x>h.x?l.x:h.x:c.x>h.x?c.x:h.x,g=l.y>c.y?l.y>h.y?l.y:h.y:c.y>h.y?c.y:h.y,x=$c(l.x<c.x?l.x<h.x?l.x:h.x:c.x<h.x?c.x:h.x,l.y<c.y?l.y<h.y?l.y:h.y:c.y<h.y?c.y:h.y,t,r,a),S=$c(m,g,t,r,a),I=e.prevZ,C=e.nextZ;I&&I.z>=x&&C&&C.z<=S;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&Zr(I.prev,I,I.next)>=0||(I=I.prevZ,C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&Zr(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;I&&I.z>=x;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&Zr(I.prev,I,I.next)>=0)return!1;I=I.prevZ}for(;C&&C.z<=S;){if(C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&Zr(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Qx(e,t,r){var a=e;do{var l=a.prev,c=a.next.next;!Ll(l,c)&&cm(l,a,a.next,c)&&Au(l,c)&&Au(c,l)&&(t.push(l.i/r),t.push(a.i/r),t.push(c.i/r),Eu(a),Eu(a.next),a=e=c),a=a.next}while(a!==e);return sa(a)}function eb(e,t,r,a,l,c){var h=e;do{for(var m=h.next.next;m!==h.prev;){if(h.i!==m.i&&ob(h,m)){var g=pm(h,m);return h=sa(h,h.next),g=sa(g,g.next),Tu(h,t,r,a,l,c),void Tu(g,t,r,a,l,c)}m=m.next}h=h.next}while(h!==e)}function tb(e,t){return e.x-t.x}function rb(e,t){if(t=(function(a,l){var c,h=l,m=a.x,g=a.y,x=-1/0;do{if(g<=h.y&&g>=h.next.y&&h.next.y!==h.y){var S=h.x+(g-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(S<=m&&S>x){if(x=S,S===m){if(g===h.y)return h;if(g===h.next.y)return h.next}c=h.x<h.next.x?h:h.next}}h=h.next}while(h!==l);if(!c)return null;if(m===x)return c;var I,C=c,z=c.x,j=c.y,G=1/0;h=c;do m>=h.x&&h.x>=z&&m!==h.x&&bs(g<j?m:x,g,z,j,g<j?x:m,g,h.x,h.y)&&(I=Math.abs(g-h.y)/(m-h.x),Au(h,a)&&(I<G||I===G&&(h.x>c.x||h.x===c.x&&ib(c,h)))&&(c=h,G=I)),h=h.next;while(h!==C);return c})(e,t)){var r=pm(t,e);sa(t,t.next),sa(r,r.next)}}function ib(e,t){return Zr(e.prev,e,t.prev)<0&&Zr(t.next,e,e.next)<0}function $c(e,t,r,a,l){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*l)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-a)*l)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function nb(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function bs(e,t,r,a,l,c,h,m){return(l-h)*(t-m)-(e-h)*(c-m)>=0&&(e-h)*(a-m)-(r-h)*(t-m)>=0&&(r-h)*(c-m)-(l-h)*(a-m)>=0}function ob(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!(function(r,a){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==a.i&&l.next.i!==a.i&&cm(l,l.next,r,a))return!0;l=l.next}while(l!==r);return!1})(e,t)&&(Au(e,t)&&Au(t,e)&&(function(r,a){var l=r,c=!1,h=(r.x+a.x)/2,m=(r.y+a.y)/2;do l.y>m!=l.next.y>m&&l.next.y!==l.y&&h<(l.next.x-l.x)*(m-l.y)/(l.next.y-l.y)+l.x&&(c=!c),l=l.next;while(l!==r);return c})(e,t)&&(Zr(e.prev,e,t.prev)||Zr(e,t.prev,t))||Ll(e,t)&&Zr(e.prev,e,e.next)>0&&Zr(t.prev,t,t.next)>0)}function Zr(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ll(e,t){return e.x===t.x&&e.y===t.y}function cm(e,t,r,a){var l=Ol(Zr(e,t,r)),c=Ol(Zr(e,t,a)),h=Ol(Zr(r,a,e)),m=Ol(Zr(r,a,t));return l!==c&&h!==m||!(l!==0||!Fl(e,r,t))||!(c!==0||!Fl(e,a,t))||!(h!==0||!Fl(r,e,a))||!(m!==0||!Fl(r,t,a))}function Fl(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ol(e){return e>0?1:e<0?-1:0}function Au(e,t){return Zr(e.prev,e,e.next)<0?Zr(e,t,e.next)>=0&&Zr(e,e.prev,t)>=0:Zr(e,t,e.prev)<0||Zr(e,e.next,t)<0}function pm(e,t){var r=new Wc(e.i,e.x,e.y),a=new Wc(t.i,t.x,t.y),l=e.next,c=t.prev;return e.next=t,t.prev=e,r.next=l,l.prev=r,a.next=r,r.prev=a,c.next=a,a.prev=c,a}function hm(e,t,r,a){var l=new Wc(e,t,r);return a?(l.next=a.next,l.prev=a,a.next.prev=l,a.next=l):(l.prev=l,l.next=l),l}function Eu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Wc(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Hc(e,t,r,a){for(var l=0,c=t,h=r-a;c<r;c+=a)l+=(e[h]-e[c])*(e[c+1]+e[h+1]),h=c;return l}function ab(e,t,r,a,l){(function c(h,m,g,x,S){for(;x>g;){if(x-g>600){var I=x-g+1,C=m-g+1,z=Math.log(I),j=.5*Math.exp(2*z/3),G=.5*Math.sqrt(z*j*(I-j)/I)*(C-I/2<0?-1:1);c(h,m,Math.max(g,Math.floor(m-C*j/I+G)),Math.min(x,Math.floor(m+(I-C)*j/I+G)),S)}var te=h[m],K=g,oe=x;for(Pu(h,g,m),S(h[x],te)>0&&Pu(h,g,x);K<oe;){for(Pu(h,K,oe),K++,oe--;S(h[K],te)<0;)K++;for(;S(h[oe],te)>0;)oe--}S(h[g],te)===0?Pu(h,g,oe):Pu(h,++oe,x),oe<=m&&(g=oe+1),m<=oe&&(x=oe-1)}})(e,t,r,a||e.length-1,l||sb)}function Pu(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function sb(e,t){return e<t?-1:e>t?1:0}function Xc(e,t){var r=e.length;if(r<=1)return[e];for(var a,l,c=[],h=0;h<r;h++){var m=Hr(e[h]);m!==0&&(e[h].area=Math.abs(m),l===void 0&&(l=m<0),l===m<0?(a&&c.push(a),a=[e[h]]):a.push(e[h]))}if(a&&c.push(a),t>1)for(var g=0;g<c.length;g++)c[g].length<=t||(ab(c[g],t,1,c[g].length-1,ub),c[g]=c[g].slice(0,t));return c}function ub(e,t){return t.area-e.area}function Kc(e,t,r){for(var a=r.patternDependencies,l=!1,c=0,h=t;c<h.length;c+=1){var m=h[c].paint.get(e+"-pattern");m.isConstant()||(l=!0);var g=m.constantOr(null);g&&(l=!0,a[g.to]=!0,a[g.from]=!0)}return l}function Jc(e,t,r,a,l){for(var c=l.patternDependencies,h=0,m=t;h<m.length;h+=1){var g=m[h],x=g.paint.get(e+"-pattern").value;if(x.kind!=="constant"){var S=x.evaluate({zoom:a-1},r,{},l.availableImages),I=x.evaluate({zoom:a},r,{},l.availableImages),C=x.evaluate({zoom:a+1},r,{},l.availableImages);I=I&&I.name?I.name:I,C=C&&C.name?C.name:C,c[S=S&&S.name?S.name:S]=!0,c[I]=!0,c[C]=!0,r.patterns[g.id]={min:S,mid:I,max:C}}}return r}Rl.deviation=function(e,t,r,a){var l=t&&t.length,c=Math.abs(Hc(e,0,l?t[0]*r:e.length,r));if(l)for(var h=0,m=t.length;h<m;h++)c-=Math.abs(Hc(e,t[h]*r,h<m-1?t[h+1]*r:e.length,r));var g=0;for(h=0;h<a.length;h+=3){var x=a[h]*r,S=a[h+1]*r,I=a[h+2]*r;g+=Math.abs((e[x]-e[I])*(e[S+1]-e[x+1])-(e[x]-e[S])*(e[I+1]-e[x+1]))}return c===0&&g===0?0:Math.abs((g-c)/c)},Rl.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,l=0;l<e.length;l++){for(var c=0;c<e[l].length;c++)for(var h=0;h<t;h++)r.vertices.push(e[l][c][h]);l>0&&r.holes.push(a+=e[l-1].length)}return r},Zc.default=Kx;var Vn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Bo,this.indexArray=new to,this.indexArray2=new Da,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.segments2=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Vn.prototype.populate=function(e,t,r){this.hasPattern=Kc("fill",this.layers,t);for(var a=this.layers[0].layout.get("fill-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,x=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=kr(g,C);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),z,r)){var j=a?a.evaluate(z,{},r,t.availableImages):void 0,G={id:x,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,De){return Pe.sortKey-De.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("fill",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Vn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Vn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Vn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Vn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Vn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Xx),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},Vn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Vn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,x=0,S=m;x<S.length;x+=1)g+=S[x].length;for(var I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray),C=I.vertexLength,z=[],j=[],G=0,te=m;G<te.length;G+=1){var K=te[G];if(K.length!==0){K!==m[0]&&j.push(z.length/2);var oe=this.segments2.prepareSegment(K.length,this.layoutVertexArray,this.indexArray2),le=oe.vertexLength;this.layoutVertexArray.emplaceBack(K[0].x,K[0].y),this.indexArray2.emplaceBack(le+K.length-1,le),z.push(K[0].x),z.push(K[0].y);for(var ce=1;ce<K.length;ce++)this.layoutVertexArray.emplaceBack(K[ce].x,K[ce].y),this.indexArray2.emplaceBack(le+ce-1,le+ce),z.push(K[ce].x),z.push(K[ce].y);oe.vertexLength+=K.length,oe.primitiveLength+=K.length}}for(var he=Zc(z,j),xe=0;xe<he.length;xe+=3)this.indexArray.emplaceBack(C+he[xe],C+he[xe+1],C+he[xe+2]);I.vertexLength+=g,I.primitiveLength+=he.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillBucket",Vn,{omit:["layers","patternFeatures"]});var lb=new vi({"fill-sort-key":new Ye(L.layout_fill["fill-sort-key"])}),cb={paint:new vi({"fill-antialias":new it(L.paint_fill["fill-antialias"]),"fill-opacity":new Ye(L.paint_fill["fill-opacity"]),"fill-color":new Ye(L.paint_fill["fill-color"]),"fill-outline-color":new Ye(L.paint_fill["fill-outline-color"]),"fill-translate":new it(L.paint_fill["fill-translate"]),"fill-translate-anchor":new it(L.paint_fill["fill-translate-anchor"]),"fill-pattern":new ds(L.paint_fill["fill-pattern"])}),layout:lb},pb=(function(e){function t(r){e.call(this,r,cb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a);var l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(r){return new Vn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){return wn(On(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),m.angle,g),c)},t.prototype.isTileClipped=function(){return!0},t})(An),hb=ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,fm=ws;function ws(e,t,r,a,l){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=l,e.readFields(fb,this,t)}function fb(e,t,r){e==1?t.id=r.readVarint():e==2?(function(a,l){for(var c=a.readVarint()+a.pos;a.pos<c;){var h=l._keys[a.readVarint()],m=l._values[a.readVarint()];l.properties[h]=m}})(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function db(e){for(var t,r,a=0,l=0,c=e.length,h=c-1;l<c;h=l++)a+=((r=e[h]).x-(t=e[l]).x)*(t.y+r.y);return a}ws.types=["Unknown","Point","LineString","Polygon"],ws.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,l=0,c=0,h=0,m=[];e.pos<r;){if(l<=0){var g=e.readVarint();a=7&g,l=g>>3}if(l--,a===1||a===2)c+=e.readSVarint(),h+=e.readSVarint(),a===1&&(t&&m.push(t),t=[]),t.push(new X(c,h));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&m.push(t),m},ws.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,l=0,c=0,h=1/0,m=-1/0,g=1/0,x=-1/0;e.pos<t;){if(a<=0){var S=e.readVarint();r=7&S,a=S>>3}if(a--,r===1||r===2)(l+=e.readSVarint())<h&&(h=l),l>m&&(m=l),(c+=e.readSVarint())<g&&(g=c),c>x&&(x=c);else if(r!==7)throw new Error("unknown command "+r)}return[h,g,m,x]},ws.prototype.toGeoJSON=function(e,t,r){var a,l,c=this.extent*Math.pow(2,r),h=this.extent*e,m=this.extent*t,g=this.loadGeometry(),x=ws.types[this.type];function S(z){for(var j=0;j<z.length;j++){var G=z[j];z[j]=[360*(G.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(G.y+m)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var I=[];for(a=0;a<g.length;a++)I[a]=g[a][0];S(g=I);break;case 2:for(a=0;a<g.length;a++)S(g[a]);break;case 3:for(g=(function(z){var j=z.length;if(j<=1)return[z];for(var G,te,K=[],oe=0;oe<j;oe++){var le=db(z[oe]);le!==0&&(te===void 0&&(te=le<0),te===le<0?(G&&K.push(G),G=[z[oe]]):G.push(z[oe]))}return G&&K.push(G),K})(g),a=0;a<g.length;a++)for(l=0;l<g[a].length;l++)S(g[a][l])}g.length===1?g=g[0]:x="Multi"+x;var C={type:"Feature",geometry:{type:x,coordinates:g},properties:this.properties};return"id"in this&&(C.id=this.id),C};var dm=mm;function mm(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(mb,this,t),this.length=this._features.length}function mb(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push((function(a){for(var l=null,c=a.readVarint()+a.pos;a.pos<c;){var h=a.readVarint()>>3;l=h===1?a.readString():h===2?a.readFloat():h===3?a.readDouble():h===4?a.readVarint64():h===5?a.readVarint():h===6?a.readSVarint():h===7?a.readBoolean():null}return l})(r))}function yb(e,t,r){if(e===3){var a=new dm(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}mm.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new fm(this._pbf,t,this.extent,this._keys,this._values)};var Ss={VectorTile:function(e,t){this.layers=e.readFields(yb,{},t)},VectorTileFeature:fm,VectorTileLayer:dm},vb=Ss.VectorTileFeature.types,Yc=Math.pow(2,13);function Cu(e,t,r,a,l,c,h,m){e.emplaceBack(t,r,2*Math.floor(a*Yc)+h,l*Yc*2,c*Yc*2,Math.round(m))}var qn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Fn,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function gb(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}qn.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=Kc("fill-extrusion",this.layers,t);for(var a=0,l=e;a<l.length;a+=1){var c=l[a],h=c.feature,m=c.id,g=c.index,x=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,I=kr(h,S);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),I,r)){var C={id:m,sourceLayerIndex:x,index:g,geometry:S?I.geometry:wr(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(Jc("fill-extrusion",this.layers,C,this.zoom,t)):this.addFeature(C,C.geometry,g,r,{}),t.featureIndex.insert(h,C.geometry,g,x,this.index,!0)}}},qn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.features;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},qn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},qn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},qn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},qn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},qn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,x=0,S=m;x<S.length;x+=1)g+=S[x].length;for(var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),C=0,z=m;C<z.length;C+=1){var j=z[C];if(j.length!==0&&!((Tt=j).every((function(vt){return vt.x<0}))||Tt.every((function(vt){return vt.x>8192}))||Tt.every((function(vt){return vt.y<0}))||Tt.every((function(vt){return vt.y>8192}))))for(var G=0,te=0;te<j.length;te++){var K=j[te];if(te>=1){var oe=j[te-1];if(!gb(K,oe)){I.vertexLength+4>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var le=K.sub(oe)._perp()._unit(),ce=oe.dist(K);G+ce>32768&&(G=0),Cu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,0,G),Cu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,1,G),Cu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,0,G+=ce),Cu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,1,G);var he=I.vertexLength;this.indexArray.emplaceBack(he,he+2,he+1),this.indexArray.emplaceBack(he+1,he+2,he+3),I.vertexLength+=4,I.primitiveLength+=2}}}}if(I.vertexLength+g>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),vb[e.type]==="Polygon"){for(var xe=[],Pe=[],De=I.vertexLength,rt=0,Ue=m;rt<Ue.length;rt+=1){var ot=Ue[rt];if(ot.length!==0){ot!==m[0]&&Pe.push(xe.length/2);for(var je=0;je<ot.length;je++){var bt=ot[je];Cu(this.layoutVertexArray,bt.x,bt.y,0,0,1,1,0),xe.push(bt.x),xe.push(bt.y)}}}for(var pt=Zc(xe,Pe),Qe=0;Qe<pt.length;Qe+=3)this.indexArray.emplaceBack(De+pt[Qe],De+pt[Qe+2],De+pt[Qe+1]);I.primitiveLength+=pt.length/3,I.vertexLength+=g}}var Tt;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillExtrusionBucket",qn,{omit:["layers","features"]});var _b={paint:new vi({"fill-extrusion-opacity":new it(L["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ye(L["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new it(L["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new it(L["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ds(L["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ye(L["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ye(L["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new it(L["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},xb=(function(e){function t(r){e.call(this,r,_b)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new qn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,x){var S=On(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),m.angle,g),I=this.paint.get("fill-extrusion-height").evaluate(a,l),C=this.paint.get("fill-extrusion-base").evaluate(a,l),z=(function(G,te,K,oe){for(var le=[],ce=0,he=G;ce<he.length;ce+=1){var xe=he[ce],Pe=[xe.x,xe.y,0,1];_s(Pe,Pe,te),le.push(new X(Pe[0]/Pe[3],Pe[1]/Pe[3]))}return le})(S,x),j=(function(G,te,K,oe){for(var le=[],ce=[],he=oe[8]*te,xe=oe[9]*te,Pe=oe[10]*te,De=oe[11]*te,rt=oe[8]*K,Ue=oe[9]*K,ot=oe[10]*K,je=oe[11]*K,bt=0,pt=G;bt<pt.length;bt+=1){for(var Qe=[],Tt=[],vt=0,Rt=pt[bt];vt<Rt.length;vt+=1){var at=Rt[vt],Vt=at.x,_r=at.y,Tr=oe[0]*Vt+oe[4]*_r+oe[12],Sr=oe[1]*Vt+oe[5]*_r+oe[13],xr=oe[2]*Vt+oe[6]*_r+oe[14],Ar=oe[3]*Vt+oe[7]*_r+oe[15],Qr=xr+Pe,ei=Ar+De,Ci=Tr+rt,li=Sr+Ue,ki=xr+ot,Mr=Ar+je,ci=new X((Tr+he)/ei,(Sr+xe)/ei);ci.z=Qr/ei,Qe.push(ci);var Mt=new X(Ci/Mr,li/Mr);Mt.z=ki/Mr,Tt.push(Mt)}le.push(Qe),ce.push(Tt)}return[le,ce]})(c,C,I,x);return(function(G,te,K){var oe=1/0;wn(K,te)&&(oe=ym(K,te[0]));for(var le=0;le<te.length;le++)for(var ce=te[le],he=G[le],xe=0;xe<ce.length-1;xe++){var Pe=ce[xe],De=[Pe,ce[xe+1],he[xe+1],he[xe],Pe];no(K,De)&&(oe=Math.min(oe,ym(K,De)))}return oe!==1/0&&oe})(j[0],j[1],z)},t})(An);function ku(e,t){return e.x*t.x+e.y*t.y}function ym(e,t){if(e.length===1){for(var r,a=0,l=t[a++];!r||l.equals(r);)if(!(r=t[a++]))return 1/0;for(;a<t.length;a++){var c=t[a],h=e[0],m=r.sub(l),g=c.sub(l),x=h.sub(l),S=ku(m,m),I=ku(m,g),C=ku(g,g),z=ku(x,m),j=ku(x,g),G=S*C-I*I,te=(C*z-I*j)/G,K=(S*j-I*z)/G,oe=l.z*(1-te-K)+r.z*te+c.z*K;if(isFinite(oe))return oe}return 1/0}for(var le=1/0,ce=0,he=t;ce<he.length;ce+=1)le=Math.min(le,he[ce].z);return le}var bb=ai([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,wb=ai([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Sb=Ss.VectorTileFeature.types,Ib=Math.cos(Math.PI/180*37.5),vm=Math.pow(2,14)/.5,Fi=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(r){return r.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(r){t.gradients[r.id]={}})),this.layoutVertexArray=new $i,this.layoutVertexArray2=new ta,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(r){return r.isStateDependent()})).map((function(r){return r.id}))};Fi.prototype.populate=function(e,t,r){this.hasPattern=Kc("line",this.layers,t);for(var a=this.layers[0].layout.get("line-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,x=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=kr(g,C);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),z,r)){var j=a?a.evaluate(z,{},r):void 0,G={id:x,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,De){return Pe.sortKey-De.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("line",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Fi.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Fi.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Fi.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Fi.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Fi.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,wb)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,bb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Fi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Fi.prototype.lineFeatureClips=function(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}},Fi.prototype.addFeature=function(e,t,r,a,l){var c=this.layers[0].layout,h=c.get("line-join").evaluate(e,{}),m=c.get("line-cap"),g=c.get("line-miter-limit"),x=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var S=0,I=t;S<I.length;S+=1)this.addLine(I[S],e,h,m,g,x);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Fi.prototype.addLine=function(e,t,r,a,l,c){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var h=0;h<e.length-1;h++)this.totalDistance+=e[h].dist(e[h+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var m=Sb[t.type]==="Polygon",g=e.length;g>=2&&e[g-1].equals(e[g-2]);)g--;for(var x=0;x<g-1&&e[x].equals(e[x+1]);)x++;if(!(g<(m?3:2))){r==="bevel"&&(l=1.05);var S,I=this.overscaling<=16?122880/(512*this.overscaling):0,C=this.segments.prepareSegment(10*g,this.layoutVertexArray,this.indexArray),z=void 0,j=void 0,G=void 0,te=void 0;this.e1=this.e2=-1,m&&(te=e[x].sub(S=e[g-2])._unit()._perp());for(var K=x;K<g;K++)if(!(j=K===g-1?m?e[x+1]:void 0:e[K+1])||!e[K].equals(j)){te&&(G=te),S&&(z=S),S=e[K],te=j?j.sub(S)._unit()._perp():G;var oe=(G=G||te).add(te);oe.x===0&&oe.y===0||oe._unit();var le=G.x*te.x+G.y*te.y,ce=oe.x*te.x+oe.y*te.y,he=ce!==0?1/ce:1/0,xe=2*Math.sqrt(2-2*ce),Pe=ce<Ib&&z&&j,De=G.x*te.y-G.y*te.x>0;if(Pe&&K>x){var rt=S.dist(z);if(rt>2*I){var Ue=S.sub(S.sub(z)._mult(I/rt)._round());this.updateDistance(z,Ue),this.addCurrentVertex(Ue,G,0,0,C),z=Ue}}var ot=z&&j,je=ot?r:m?"butt":a;if(ot&&je==="round"&&(he<c?je="miter":he<=2&&(je="fakeround")),je==="miter"&&he>l&&(je="bevel"),je==="bevel"&&(he>2&&(je="flipbevel"),he<l&&(je="miter")),z&&this.updateDistance(z,S),je==="miter")oe._mult(he),this.addCurrentVertex(S,oe,0,0,C);else if(je==="flipbevel"){if(he>100)oe=te.mult(-1);else{var bt=he*G.add(te).mag()/G.sub(te).mag();oe._perp()._mult(bt*(De?-1:1))}this.addCurrentVertex(S,oe,0,0,C),this.addCurrentVertex(S,oe.mult(-1),0,0,C)}else if(je==="bevel"||je==="fakeround"){var pt=-Math.sqrt(he*he-1),Qe=De?pt:0,Tt=De?0:pt;if(z&&this.addCurrentVertex(S,G,Qe,Tt,C),je==="fakeround")for(var vt=Math.round(180*xe/Math.PI/20),Rt=1;Rt<vt;Rt++){var at=Rt/vt;if(at!==.5){var Vt=at-.5;at+=at*Vt*(at-1)*((1.0904+le*(le*(3.55645-1.43519*le)-3.2452))*Vt*Vt+(.848013+le*(.215638*le-1.06021)))}var _r=te.sub(G)._mult(at)._add(G)._unit()._mult(De?-1:1);this.addHalfVertex(S,_r.x,_r.y,!1,De,0,C)}j&&this.addCurrentVertex(S,te,-Qe,-Tt,C)}else if(je==="butt")this.addCurrentVertex(S,oe,0,0,C);else if(je==="square"){var Tr=z?1:-1;this.addCurrentVertex(S,oe,Tr,Tr,C)}else je==="round"&&(z&&(this.addCurrentVertex(S,G,0,0,C),this.addCurrentVertex(S,G,1,1,C,!0)),j&&(this.addCurrentVertex(S,te,-1,-1,C,!0),this.addCurrentVertex(S,te,0,0,C)));if(Pe&&K<g-1){var Sr=S.dist(j);if(Sr>2*I){var xr=S.add(j.sub(S)._mult(I/Sr)._round());this.updateDistance(S,xr),this.addCurrentVertex(xr,te,0,0,C),S=xr}}}}},Fi.prototype.addCurrentVertex=function(e,t,r,a,l,c){c===void 0&&(c=!1);var h=t.y*a-t.x,m=-t.y-t.x*a;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,l),this.addHalfVertex(e,h,m,c,!0,-a,l),this.distance>vm/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,a,l,c))},Fi.prototype.addHalfVertex=function(e,t,r,a,l,c,h){var m=.5*(this.lineClips?this.scaledDistance*(vm-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(a?1:0),(e.y<<1)+(l?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(c===0?0:c<0?-1:1)|(63&m)<<2,m>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var g=h.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,g),h.primitiveLength++),l?this.e2=g:this.e1=g},Fi.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Fi.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Xe("LineBucket",Fi,{omit:["layers","patternFeatures"]});var Tb=new vi({"line-cap":new it(L.layout_line["line-cap"]),"line-join":new Ye(L.layout_line["line-join"]),"line-miter-limit":new it(L.layout_line["line-miter-limit"]),"line-round-limit":new it(L.layout_line["line-round-limit"]),"line-sort-key":new Ye(L.layout_line["line-sort-key"])}),gm={paint:new vi({"line-opacity":new Ye(L.paint_line["line-opacity"]),"line-color":new Ye(L.paint_line["line-color"]),"line-translate":new it(L.paint_line["line-translate"]),"line-translate-anchor":new it(L.paint_line["line-translate-anchor"]),"line-width":new Ye(L.paint_line["line-width"]),"line-gap-width":new Ye(L.paint_line["line-gap-width"]),"line-offset":new Ye(L.paint_line["line-offset"]),"line-blur":new Ye(L.paint_line["line-blur"]),"line-dasharray":new Ai(L.paint_line["line-dasharray"]),"line-pattern":new ds(L.paint_line["line-pattern"]),"line-gradient":new bn(L.paint_line["line-gradient"])}),layout:Tb},_m=new((function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a){return a=new Ct(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),e.prototype.possiblyEvaluate.call(this,r,a)},t.prototype.evaluate=function(r,a,l,c){return a=Re({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,l,c)},t})(Ye))(gm.paint.properties["line-width"].specification);_m.useIntegerZoom=!0;var Ab=(function(e){function t(r){e.call(this,r,gm),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ui,this.gradientVersion=(this.gradientVersion+1)%Te)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a),this.paint._values["line-floorwidth"]=_m.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)},t.prototype.createBucket=function(r){return new Fi(r)},t.prototype.queryRadius=function(r){var a=r,l=xm(Cn("line-width",this,a),Cn("line-gap-width",this,a)),c=Cn("line-offset",this,a);return l/2+Math.abs(c)+Yr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){var x=On(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,g),S=g/2*xm(this.paint.get("line-width").evaluate(a,l),this.paint.get("line-gap-width").evaluate(a,l)),I=this.paint.get("line-offset").evaluate(a,l);return I&&(c=(function(C,z){for(var j=[],G=new X(0,0),te=0;te<C.length;te++){for(var K=C[te],oe=[],le=0;le<K.length;le++){var ce=K[le],he=K[le+1],xe=le===0?G:ce.sub(K[le-1])._unit()._perp(),Pe=le===K.length-1?G:he.sub(ce)._unit()._perp(),De=xe._add(Pe)._unit();De._mult(1/(De.x*Pe.x+De.y*Pe.y)),oe.push(De._mult(z)._add(ce))}j.push(oe)}return j})(c,I*g)),(function(C,z,j){for(var G=0;G<z.length;G++){var te=z[G];if(C.length>=3){for(var K=0;K<te.length;K++)if(Pn(C,te[K]))return!0}if(cn(C,te,j))return!0}return!1})(x,c,S)},t.prototype.isTileClipped=function(){return!0},t})(An);function xm(e,t){return t>0?t+2*e:e}var Eb=ai([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Pb=ai([{name:"a_projected_pos",components:3,type:"Float32"}],4),Cb=(ai([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ai([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),bm=(ai([{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"}]),ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),kb=ai([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Mb(e,t,r){return e.sections.forEach((function(a){a.text=(function(l,c,h){var m=c.layout.get("text-transform").evaluate(h,{});return m==="uppercase"?l=l.toLocaleUpperCase():m==="lowercase"&&(l=l.toLocaleLowerCase()),Qi.applyArabicShaping&&(l=Qi.applyArabicShaping(l)),l})(a.text,t,r)})),e}ai([{name:"triangle",components:3,type:"Uint16"}]),ai([{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"}]),ai([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ai([{type:"Float32",name:"offsetX"}]),ai([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Mu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},wm=function(e,t,r,a,l){var c,h,m=8*l-a-1,g=(1<<m)-1,x=g>>1,S=-7,I=l-1,C=-1,z=e[t+I];for(I+=C,c=z&(1<<-S)-1,z>>=-S,S+=m;S>0;c=256*c+e[t+I],I+=C,S-=8);for(h=c&(1<<-S)-1,c>>=-S,S+=a;S>0;h=256*h+e[t+I],I+=C,S-=8);if(c===0)c=1-x;else{if(c===g)return h?NaN:1/0*(z?-1:1);h+=Math.pow(2,a),c-=x}return(z?-1:1)*h*Math.pow(2,c-a)},Sm=function(e,t,r,a,l,c){var h,m,g,x=8*c-l-1,S=(1<<x)-1,I=S>>1,C=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=0,j=1,G=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,h=S):(h=Math.floor(Math.log(t)/Math.LN2),t*(g=Math.pow(2,-h))<1&&(h--,g*=2),(t+=h+I>=1?C/g:C*Math.pow(2,1-I))*g>=2&&(h++,g/=2),h+I>=S?(m=0,h=S):h+I>=1?(m=(t*g-1)*Math.pow(2,l),h+=I):(m=t*Math.pow(2,I-1)*Math.pow(2,l),h=0));l>=8;e[r+z]=255&m,z+=j,m/=256,l-=8);for(h=h<<l|m,x+=l;x>0;e[r+z]=255&h,z+=j,h/=256,x-=8);e[r+z-j]|=128*G},Vl=cr;function cr(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}cr.Varint=0,cr.Fixed64=1,cr.Bytes=2,cr.Fixed32=5;var Im=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Lo(e){return e.type===cr.Bytes?e.readVarint()+e.pos:e.pos+1}function Is(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Tm(e,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var l=r.pos-1;l>=e;l--)r.buf[l+a]=r.buf[l]}function Bb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function zb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Db(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Rb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Lb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Fb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Ob(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Vb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function qb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function ql(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Ts(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Am(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Ub(e,t,r){e===1&&r.readMessage(Nb,t)}function Nb(e,t,r){if(e===3){var a=r.readMessage(jb,{}),l=a.width,c=a.height,h=a.left,m=a.top,g=a.advance;t.push({id:a.id,bitmap:new Va({width:l+6,height:c+6},a.bitmap),metrics:{width:l,height:c,left:h,top:m,advance:g}})}}function jb(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function Em(e){for(var t=0,r=0,a=0,l=e;a<l.length;a+=1){var c=l[a];t+=c.w*c.h,r=Math.max(r,c.w)}e.sort((function(G,te){return te.h-G.h}));for(var h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],m=0,g=0,x=0,S=e;x<S.length;x+=1)for(var I=S[x],C=h.length-1;C>=0;C--){var z=h[C];if(!(I.w>z.w||I.h>z.h)){if(I.x=z.x,I.y=z.y,g=Math.max(g,I.y+I.h),m=Math.max(m,I.x+I.w),I.w===z.w&&I.h===z.h){var j=h.pop();C<h.length&&(h[C]=j)}else I.h===z.h?(z.x+=I.w,z.w-=I.w):I.w===z.w?(z.y+=I.h,z.h-=I.h):(h.push({x:z.x+I.w,y:z.y,w:z.w-I.w,h:I.h}),z.y+=I.h,z.h-=I.h);break}}return{w:m,h:g,fill:t/(m*g)||0}}cr.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),l=a>>3,c=this.pos;this.type=7&a,e(l,t,this),this.pos===c&&this.skip(a)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=ql(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Am(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=ql(this.buf,this.pos)+4294967296*ql(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=ql(this.buf,this.pos)+4294967296*Am(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=wm(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=wm(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:(function(l,c,h){var m,g,x=h.buf;if(m=(112&(g=x[h.pos++]))>>4,g<128||(m|=(127&(g=x[h.pos++]))<<3,g<128)||(m|=(127&(g=x[h.pos++]))<<10,g<128)||(m|=(127&(g=x[h.pos++]))<<17,g<128)||(m|=(127&(g=x[h.pos++]))<<24,g<128)||(m|=(1&(g=x[h.pos++]))<<31,g<128))return Is(l,m,c);throw new Error("Expected varint not more than 10 bytes")})(t|=(15&(r=a[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Im?(function(r,a,l){return Im.decode(r.subarray(a,l))})(this.buf,t,e):(function(r,a,l){for(var c="",h=a;h<l;){var m,g,x,S=r[h],I=null,C=S>239?4:S>223?3:S>191?2:1;if(h+C>l)break;C===1?S<128&&(I=S):C===2?(192&(m=r[h+1]))==128&&(I=(31&S)<<6|63&m)<=127&&(I=null):C===3?(g=r[h+2],(192&(m=r[h+1]))==128&&(192&g)==128&&((I=(15&S)<<12|(63&m)<<6|63&g)<=2047||I>=55296&&I<=57343)&&(I=null)):C===4&&(g=r[h+2],x=r[h+3],(192&(m=r[h+1]))==128&&(192&g)==128&&(192&x)==128&&((I=(15&S)<<18|(63&m)<<12|(63&g)<<6|63&x)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,C=1):I>65535&&(I-=65536,c+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),c+=String.fromCharCode(I),h+=C}return c})(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==cr.Bytes)return e.push(this.readVarint(t));var r=Lo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==cr.Bytes)return e.push(this.readSVarint());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==cr.Bytes)return e.push(this.readBoolean());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==cr.Bytes)return e.push(this.readFloat());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==cr.Bytes)return e.push(this.readDouble());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===cr.Varint)for(;this.buf[this.pos++]>127;);else if(t===cr.Bytes)this.pos=this.readVarint()+this.pos;else if(t===cr.Fixed32)this.pos+=4;else{if(t!==cr.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?(function(t,r){var a,l;if(t>=0?(a=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),(function(c,h,m){m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,m.buf[m.pos]=127&(c>>>=7)})(a,0,r),(function(c,h){var m=(7&c)<<4;h.buf[h.pos++]|=m|((c>>>=3)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c)))))})(l,r)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=(function(a,l,c){for(var h,m,g=0;g<l.length;g++){if((h=l.charCodeAt(g))>55295&&h<57344){if(!m){h>56319||g+1===l.length?(a[c++]=239,a[c++]=191,a[c++]=189):m=h;continue}if(h<56320){a[c++]=239,a[c++]=191,a[c++]=189,m=h;continue}h=m-55296<<10|h-56320|65536,m=null}else m&&(a[c++]=239,a[c++]=191,a[c++]=189,m=null);h<128?a[c++]=h:(h<2048?a[c++]=h>>6|192:(h<65536?a[c++]=h>>12|224:(a[c++]=h>>18|240,a[c++]=h>>12&63|128),a[c++]=h>>6&63|128),a[c++]=63&h|128)}return c})(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Tm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Sm(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Sm(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var a=this.pos-r;a>=128&&Tm(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,cr.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Bb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,zb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Lb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Db,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Rb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Fb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Ob,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Vb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,qb,t)},writeBytesField:function(e,t){this.writeTag(e,cr.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,cr.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,cr.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Ul=function(e,t){var r=t.pixelRatio,a=t.version,l=t.stretchX,c=t.stretchY,h=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=l,this.stretchY=c,this.content=h,this.version=a},Bu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Bu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Bu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Bu.tlbr.get=function(){return this.tl.concat(this.br)},Bu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ul.prototype,Bu);var zu=function(e,t){var r={},a={};this.haveRenderCallbacks=[];var l=[];this.addImages(e,r,l),this.addImages(t,a,l);var c=Em(l),h=new Hi({width:c.w||1,height:c.h||1});for(var m in e){var g=e[m],x=r[m].paddedRect;Hi.copy(g.data,h,{x:0,y:0},{x:x.x+1,y:x.y+1},g.data)}for(var S in t){var I=t[S],C=a[S].paddedRect,z=C.x+1,j=C.y+1,G=I.data.width,te=I.data.height;Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j},I.data),Hi.copy(I.data,h,{x:0,y:te-1},{x:z,y:j-1},{width:G,height:1}),Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j+te},{width:G,height:1}),Hi.copy(I.data,h,{x:G-1,y:0},{x:z-1,y:j},{width:1,height:te}),Hi.copy(I.data,h,{x:0,y:0},{x:z+G,y:j},{width:1,height:te})}this.image=h,this.iconPositions=r,this.patternPositions=a};zu.prototype.addImages=function(e,t,r){for(var a in e){var l=e[a],c={x:0,y:0,w:l.data.width+2,h:l.data.height+2};r.push(c),t[a]=new Ul(c,l),l.hasRenderCallback&&this.haveRenderCallbacks.push(a)}},zu.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},zu.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var a=e.tl;r.update(t.data,void 0,{x:a[0],y:a[1]})}},Xe("ImagePosition",Ul),Xe("ImageAtlas",zu);var pn={horizontal:1,vertical:2,horizontalOnly:3},As=function(){this.scale=1,this.fontStack="",this.imageName=null};As.forText=function(e,t){var r=new As;return r.scale=e||1,r.fontStack=t,r},As.forImage=function(e){var t=new As;return t.imageName=e,t};var Pi=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Nl(e,t,r,a,l,c,h,m,g,x,S,I,C,z,j,G){var te,K=Pi.fromFeature(e,l);I===pn.vertical&&K.verticalizePunctuation();var oe=Qi.processBidirectionalText,le=Qi.processStyledBidirectionalText;if(oe&&K.sections.length===1){te=[];for(var ce=0,he=oe(K.toString(),Qc(K,x,c,t,a,z,j));ce<he.length;ce+=1){var xe=he[ce],Pe=new Pi;Pe.text=xe,Pe.sections=K.sections;for(var De=0;De<xe.length;De++)Pe.sectionIndex.push(0);te.push(Pe)}}else if(le){te=[];for(var rt=0,Ue=le(K.text,K.sectionIndex,Qc(K,x,c,t,a,z,j));rt<Ue.length;rt+=1){var ot=Ue[rt],je=new Pi;je.text=ot[0],je.sectionIndex=ot[1],je.sections=K.sections,te.push(je)}}else te=(function(Qe,Tt){for(var vt=[],Rt=Qe.text,at=0,Vt=0,_r=Tt;Vt<_r.length;Vt+=1){var Tr=_r[Vt];vt.push(Qe.substring(at,Tr)),at=Tr}return at<Rt.length&&vt.push(Qe.substring(at,Rt.length)),vt})(K,Qc(K,x,c,t,a,z,j));var bt=[],pt={positionedLines:bt,text:K.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:I,iconsInText:!1,verticalizable:!1};return(function(Qe,Tt,vt,Rt,at,Vt,_r,Tr,Sr,xr,Ar,Qr){for(var ei=0,Ci=-17,li=0,ki=0,Mr=Tr==="right"?1:Tr==="left"?0:.5,ci=0,Mt=0,nr=at;Mt<nr.length;Mt+=1){var Jt=nr[Mt];Jt.trim();var Ft=Jt.getMaxScale(),Oi=24*(Ft-1),_i={positionedGlyphs:[],lineOffset:0};Qe.positionedLines[ci]=_i;var fr=_i.positionedGlyphs,Ur=0;if(Jt.length()){for(var xi=0;xi<Jt.length();xi++){var qt=Jt.getSection(xi),so=Jt.getSectionIndex(xi),hn=Jt.getCharCode(xi),uo=0,Br=null,lo=null,kn=null,Ds=24,ja=!(Sr===pn.horizontal||!Ar&&!ps(hn)||Ar&&(jl[hn]||(qo=hn,Le.Arabic(qo)||Le["Arabic Supplement"](qo)||Le["Arabic Extended-A"](qo)||Le["Arabic Presentation Forms-A"](qo)||Le["Arabic Presentation Forms-B"](qo))));if(qt.imageName){var Rs=Rt[qt.imageName];if(!Rs)continue;kn=qt.imageName,Qe.iconsInText=Qe.iconsInText||!0,lo=Rs.paddedRect;var Vo=Rs.displaySize;qt.scale=24*qt.scale/Qr,uo=Oi+(24-Vo[1]*qt.scale),Ds=(Br={width:Vo[0],height:Vo[1],left:1,top:-3,advance:ja?Vo[1]:Vo[0]}).advance;var Ls=ja?Vo[0]*qt.scale-24*Ft:Vo[1]*qt.scale-24*Ft;Ls>0&&Ls>Ur&&(Ur=Ls)}else{var Yl=vt[qt.fontStack],Fs=Yl&&Yl[hn];if(Fs&&Fs.rect)lo=Fs.rect,Br=Fs.metrics;else{var Lu=Tt[qt.fontStack],Ql=Lu&&Lu[hn];if(!Ql)continue;Br=Ql.metrics}uo=24*(Ft-qt.scale)}ja?(Qe.verticalizable=!0,fr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:Br,rect:lo}),ei+=Ds*qt.scale+xr):(fr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:Br,rect:lo}),ei+=Br.advance*qt.scale+xr)}fr.length!==0&&(li=Math.max(ei-xr,li),Zb(fr,0,fr.length-1,Mr,Ur)),ei=0;var ec=Vt*Ft+Ur;_i.lineOffset=Math.max(Ur,Oi),Ci+=ec,ki=Math.max(ec,ki),++ci}else Ci+=Vt,++ci}var qo,Fu=Ci- -17,Os=ep(_r),la=Os.horizontalAlign,Vs=Os.verticalAlign;(function(tc,rc,Ou,Vu,ic,qu,Uu,Nu,nc){var qs,oc=(rc-Ou)*ic;qs=qu!==Uu?-Nu*Vu- -17:(-Vu*nc+.5)*Uu;for(var Us=0,ju=tc;Us<ju.length;Us+=1)for(var Ga=0,Gu=ju[Us].positionedGlyphs;Ga<Gu.length;Ga+=1){var Ns=Gu[Ga];Ns.x+=oc,Ns.y+=qs}})(Qe.positionedLines,Mr,la,Vs,li,ki,Vt,Fu,at.length),Qe.top+=-Vs*Fu,Qe.bottom=Qe.top+Fu,Qe.left+=-la*li,Qe.right=Qe.left+li})(pt,t,r,a,te,h,m,g,I,x,C,G),!(function(Qe){for(var Tt=0,vt=Qe;Tt<vt.length;Tt+=1)if(vt[Tt].positionedGlyphs.length!==0)return!1;return!0})(bt)&&pt}Pi.fromFeature=function(e,t){for(var r=new Pi,a=0;a<e.sections.length;a++){var l=e.sections[a];l.image?r.addImageSection(l):r.addTextSection(l,t)}return r},Pi.prototype.length=function(){return this.text.length},Pi.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Pi.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Pi.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Pi.prototype.verticalizePunctuation=function(){this.text=(function(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r+1)||null,l=e.charCodeAt(r-1)||null;t+=a&&yu(a)&&!Mu[e[r+1]]||l&&yu(l)&&!Mu[e[r-1]]||!Mu[e[r]]?e[r]:Mu[e[r]]}return t})(this.text)},Pi.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&jl[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&jl[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Pi.prototype.substring=function(e,t){var r=new Pi;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Pi.prototype.toString=function(){return this.text},Pi.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Pi.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(As.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,a=0;a<e.text.length;++a)this.sectionIndex.push(r)},Pi.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(t.length!==0){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(As.forImage(t)),this.sectionIndex.push(this.sections.length-1)):St("Reached maximum number of images 6401")}else St("Can't add FormattedSection with an empty image.")},Pi.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var jl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},tn={};function Pm(e,t,r,a,l,c){if(t.imageName){var h=a[t.imageName];return h?h.displaySize[0]*t.scale*24/c+l:0}var m=r[t.fontStack],g=m&&m[e];return g?g.metrics.advance*t.scale+l:0}function Cm(e,t,r,a){var l=Math.pow(e-t,2);return a?e<t?l/2:2*l:l+Math.abs(r)*r}function Gb(e,t,r){var a=0;return e===10&&(a-=1e4),r&&(a+=150),e!==40&&e!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function km(e,t,r,a,l,c){for(var h=null,m=Cm(t,r,l,c),g=0,x=a;g<x.length;g+=1){var S=x[g],I=Cm(t-S.x,r,l,c)+S.badness;I<=m&&(h=S,m=I)}return{index:e,x:t,priorBreak:h,badness:m}}function Qc(e,t,r,a,l,c,h){if(c!=="point")return[];if(!e)return[];for(var m,g=[],x=(function(te,K,oe,le,ce,he){for(var xe=0,Pe=0;Pe<te.length();Pe++){var De=te.getSection(Pe);xe+=Pm(te.getCharCode(Pe),De,le,ce,K,he)}return xe/Math.max(1,Math.ceil(xe/oe))})(e,t,r,a,l,h),S=e.text.indexOf("​")>=0,I=0,C=0;C<e.length();C++){var z=e.getSection(C),j=e.getCharCode(C);if(jl[j]||(I+=Pm(j,z,a,l,t,h)),C<e.length()-1){var G=!((m=j)<11904||!(Le["Bopomofo Extended"](m)||Le.Bopomofo(m)||Le["CJK Compatibility Forms"](m)||Le["CJK Compatibility Ideographs"](m)||Le["CJK Compatibility"](m)||Le["CJK Radicals Supplement"](m)||Le["CJK Strokes"](m)||Le["CJK Symbols and Punctuation"](m)||Le["CJK Unified Ideographs Extension A"](m)||Le["CJK Unified Ideographs"](m)||Le["Enclosed CJK Letters and Months"](m)||Le["Halfwidth and Fullwidth Forms"](m)||Le.Hiragana(m)||Le["Ideographic Description Characters"](m)||Le["Kangxi Radicals"](m)||Le["Katakana Phonetic Extensions"](m)||Le.Katakana(m)||Le["Vertical Forms"](m)||Le["Yi Radicals"](m)||Le["Yi Syllables"](m)));(tn[j]||G||z.imageName)&&g.push(km(C+1,I,x,g,Gb(j,e.getCharCode(C+1),G&&S),!1))}}return(function te(K){return K?te(K.priorBreak).concat(K.index):[]})(km(e.length(),I,x,g,0,!0))}function ep(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Zb(e,t,r,a,l){if(a||l)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*a,m=t;m<=r;m++)e[m].x-=h,e[m].y+=l}function Mm(e,t,r,a,l,c){var h,m=e.image;if(m.content){var g=m.content,x=m.pixelRatio||1;h=[g[0]/x,g[1]/x,m.displaySize[0]-g[2]/x,m.displaySize[1]-g[3]/x]}var S,I,C,z,j=t.left*c,G=t.right*c;r==="width"||r==="both"?(z=l[0]+j-a[3],I=l[0]+G+a[1]):I=(z=l[0]+(j+G-m.displaySize[0])/2)+m.displaySize[0];var te=t.top*c,K=t.bottom*c;return r==="height"||r==="both"?(S=l[1]+te-a[0],C=l[1]+K+a[2]):C=(S=l[1]+(te+K-m.displaySize[1])/2)+m.displaySize[1],{image:m,top:S,right:I,bottom:C,left:z,collisionPadding:h}}tn[10]=!0,tn[32]=!0,tn[38]=!0,tn[40]=!0,tn[41]=!0,tn[43]=!0,tn[45]=!0,tn[47]=!0,tn[173]=!0,tn[183]=!0,tn[8203]=!0,tn[8208]=!0,tn[8211]=!0,tn[8231]=!0;var Es=(function(e){function t(r,a,l,c){e.call(this,r,a),this.angle=l,c!==void 0&&(this.segment=c)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t})(X);function tp(e,t){var r=t.expression;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Ct(e+1))};if(r.kind==="source")return{kind:"source"};for(var a=r.zoomStops,l=r.interpolationType,c=0;c<a.length&&a[c]<=e;)c++;for(var h=c=Math.max(0,c-1);h<a.length&&a[h]<e+1;)h++;h=Math.min(a.length-1,h);var m=a[c],g=a[h];return r.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:g,interpolationType:l}:{kind:"camera",minZoom:m,maxZoom:g,minSize:r.evaluate(new Ct(m)),maxSize:r.evaluate(new Ct(g)),interpolationType:l}}function Bm(e,t,r){var a=t.uSize,l=r.lowerSize;return e.kind==="source"?l/128:e.kind==="composite"?Vr(l/128,r.upperSize/128,t.uSizeT):a}function zm(e,t){var r=0,a=0;if(e.kind==="constant")a=e.layoutSize;else if(e.kind!=="source"){var l=e.interpolationType,c=l?Oe(mi.interpolationFactor(l,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=Vr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Xe("Anchor",Es);var $b=Object.freeze({__proto__:null,getSizeData:tp,evaluateSizeForFeature:Bm,evaluateSizeForZoom:zm,SIZE_PACK_FACTOR:128});function Dm(e,t,r,a,l){if(t.segment===void 0)return!0;for(var c=t,h=t.segment+1,m=0;m>-r/2;){if(--h<0)return!1;m-=e[h].dist(c),c=e[h]}m+=e[h].dist(e[h+1]),h++;for(var g=[],x=0;m<r/2;){var S=e[h],I=e[h+1];if(!I)return!1;var C=e[h-1].angleTo(S)-S.angleTo(I);for(C=Math.abs((C+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:m,angleDelta:C}),x+=C;m-g[0].distance>a;)x-=g.shift().angleDelta;if(x>l)return!1;h++,m+=S.dist(I)}return!0}function Rm(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Lm(e,t,r){return e?.6*t*r:0}function Fm(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Wb(e,t,r,a,l,c){for(var h=Lm(r,l,c),m=Fm(r,a)*c,g=0,x=Rm(e)/2,S=0;S<e.length-1;S++){var I=e[S],C=e[S+1],z=I.dist(C);if(g+z>x){var j=(x-g)/z,G=Vr(I.x,C.x,j),te=Vr(I.y,C.y,j),K=new Es(G,te,C.angleTo(I),S);return K._round(),!h||Dm(e,K,m,h,t)?K:void 0}g+=z}}function Hb(e,t,r,a,l,c,h,m,g){var x=Lm(a,c,h),S=Fm(a,l),I=S*h,C=e[0].x===0||e[0].x===g||e[0].y===0||e[0].y===g;return t-I<t/4&&(t=I+t/4),(function z(j,G,te,K,oe,le,ce,he,xe){for(var Pe=le/2,De=Rm(j),rt=0,Ue=G-te,ot=[],je=0;je<j.length-1;je++){for(var bt=j[je],pt=j[je+1],Qe=bt.dist(pt),Tt=pt.angleTo(bt);Ue+te<rt+Qe;){var vt=((Ue+=te)-rt)/Qe,Rt=Vr(bt.x,pt.x,vt),at=Vr(bt.y,pt.y,vt);if(Rt>=0&&Rt<xe&&at>=0&&at<xe&&Ue-Pe>=0&&Ue+Pe<=De){var Vt=new Es(Rt,at,Tt,je);Vt._round(),K&&!Dm(j,Vt,le,K,oe)||ot.push(Vt)}}rt+=Qe}return he||ot.length||ce||(ot=z(j,rt/2,te,K,oe,le,ce,!0,xe)),ot})(e,C?t/2*m%t:(S/2+2*c)*h*m%t,t,x,r,I,C,!1,g)}function Om(e,t,r,a,l){for(var c=[],h=0;h<e.length;h++)for(var m=e[h],g=void 0,x=0;x<m.length-1;x++){var S=m[x],I=m[x+1];S.x<t&&I.x<t||(S.x<t?S=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x<t&&(I=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y<r&&I.y<r||(S.y<r?S=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round():I.y<r&&(I=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round()),S.x>=a&&I.x>=a||(S.x>=a?S=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x>=a&&(I=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y>=l&&I.y>=l||(S.y>=l?S=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round():I.y>=l&&(I=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round()),g&&S.equals(g[g.length-1])||c.push(g=[S]),g.push(I)))))}return c}function Vm(e,t,r,a){var l=[],c=e.image,h=c.pixelRatio,m=c.paddedRect.w-2,g=c.paddedRect.h-2,x=e.right-e.left,S=e.bottom-e.top,I=c.stretchX||[[0,m]],C=c.stretchY||[[0,g]],z=function(Rt,at){return Rt+at[1]-at[0]},j=I.reduce(z,0),G=C.reduce(z,0),te=m-j,K=g-G,oe=0,le=j,ce=0,he=G,xe=0,Pe=te,De=0,rt=K;if(c.content&&a){var Ue=c.content;oe=Gl(I,0,Ue[0]),ce=Gl(C,0,Ue[1]),le=Gl(I,Ue[0],Ue[2]),he=Gl(C,Ue[1],Ue[3]),xe=Ue[0]-oe,De=Ue[1]-ce,Pe=Ue[2]-Ue[0]-le,rt=Ue[3]-Ue[1]-he}var ot=function(Rt,at,Vt,_r){var Tr=Zl(Rt.stretch-oe,le,x,e.left),Sr=$l(Rt.fixed-xe,Pe,Rt.stretch,j),xr=Zl(at.stretch-ce,he,S,e.top),Ar=$l(at.fixed-De,rt,at.stretch,G),Qr=Zl(Vt.stretch-oe,le,x,e.left),ei=$l(Vt.fixed-xe,Pe,Vt.stretch,j),Ci=Zl(_r.stretch-ce,he,S,e.top),li=$l(_r.fixed-De,rt,_r.stretch,G),ki=new X(Tr,xr),Mr=new X(Qr,xr),ci=new X(Qr,Ci),Mt=new X(Tr,Ci),nr=new X(Sr/h,Ar/h),Jt=new X(ei/h,li/h),Ft=t*Math.PI/180;if(Ft){var Oi=Math.sin(Ft),_i=Math.cos(Ft),fr=[_i,-Oi,Oi,_i];ki._matMult(fr),Mr._matMult(fr),Mt._matMult(fr),ci._matMult(fr)}var Ur=Rt.stretch+Rt.fixed,xi=at.stretch+at.fixed;return{tl:ki,tr:Mr,bl:Mt,br:ci,tex:{x:c.paddedRect.x+1+Ur,y:c.paddedRect.y+1+xi,w:Vt.stretch+Vt.fixed-Ur,h:_r.stretch+_r.fixed-xi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:nr,pixelOffsetBR:Jt,minFontScaleX:Pe/h/x,minFontScaleY:rt/h/S,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var je=qm(I,te,j),bt=qm(C,K,G),pt=0;pt<je.length-1;pt++)for(var Qe=je[pt],Tt=je[pt+1],vt=0;vt<bt.length-1;vt++)l.push(ot(Qe,bt[vt],Tt,bt[vt+1]));else l.push(ot({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:g+1}));return l}function Gl(e,t,r){for(var a=0,l=0,c=e;l<c.length;l+=1){var h=c[l];a+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]))}return a}function qm(e,t,r){for(var a=[{fixed:-1,stretch:0}],l=0,c=e;l<c.length;l+=1){var h=c[l],m=h[0],g=h[1],x=a[a.length-1];a.push({fixed:m-x.stretch,stretch:x.stretch}),a.push({fixed:m-x.stretch,stretch:x.stretch+(g-m)})}return a.push({fixed:t+1,stretch:r}),a}function Zl(e,t,r,a){return e/t*r+a}function $l(e,t,r,a){return e-t*r/a}var Wl=function(e,t,r,a,l,c,h,m,g,x){if(this.boxStartIndex=e.length,g){var S=c.top,I=c.bottom,C=c.collisionPadding;C&&(S-=C[1],I+=C[3]);var z=I-S;z>0&&(z=Math.max(10,z),this.circleDiameter=z)}else{var j=c.top*h-m,G=c.bottom*h+m,te=c.left*h-m,K=c.right*h+m,oe=c.collisionPadding;if(oe&&(te-=oe[0]*h,j-=oe[1]*h,K+=oe[2]*h,G+=oe[3]*h),x){var le=new X(te,j),ce=new X(K,j),he=new X(te,G),xe=new X(K,G),Pe=x*Math.PI/180;le._rotate(Pe),ce._rotate(Pe),he._rotate(Pe),xe._rotate(Pe),te=Math.min(le.x,ce.x,he.x,xe.x),K=Math.max(le.x,ce.x,he.x,xe.x),j=Math.min(le.y,ce.y,he.y,xe.y),G=Math.max(le.y,ce.y,he.y,xe.y)}e.emplaceBack(t.x,t.y,te,j,K,G,r,a,l)}this.boxEndIndex=e.length},Ps=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=Xb),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Xb(e,t){return e<t?-1:e>t?1:0}function Kb(e,t,r){r===void 0&&(r=!1);for(var a=1/0,l=1/0,c=-1/0,h=-1/0,m=e[0],g=0;g<m.length;g++){var x=m[g];(!g||x.x<a)&&(a=x.x),(!g||x.y<l)&&(l=x.y),(!g||x.x>c)&&(c=x.x),(!g||x.y>h)&&(h=x.y)}var S=Math.min(c-a,h-l),I=S/2,C=new Ps([],Jb);if(S===0)return new X(a,l);for(var z=a;z<c;z+=S)for(var j=l;j<h;j+=S)C.push(new Cs(z+I,j+I,I,e));for(var G=(function(oe){for(var le=0,ce=0,he=0,xe=oe[0],Pe=0,De=xe.length,rt=De-1;Pe<De;rt=Pe++){var Ue=xe[Pe],ot=xe[rt],je=Ue.x*ot.y-ot.x*Ue.y;ce+=(Ue.x+ot.x)*je,he+=(Ue.y+ot.y)*je,le+=3*je}return new Cs(ce/le,he/le,0,oe)})(e),te=C.length;C.length;){var K=C.pop();(K.d>G.d||!G.d)&&(G=K,r&&console.log("found best %d after %d probes",Math.round(1e4*K.d)/1e4,te)),K.max-G.d<=t||(C.push(new Cs(K.p.x-(I=K.h/2),K.p.y-I,I,e)),C.push(new Cs(K.p.x+I,K.p.y-I,I,e)),C.push(new Cs(K.p.x-I,K.p.y+I,I,e)),C.push(new Cs(K.p.x+I,K.p.y+I,I,e)),te+=4)}return r&&(console.log("num probes: "+te),console.log("best distance: "+G.d)),G.p}function Jb(e,t){return t.max-e.max}function Cs(e,t,r,a){this.p=new X(e,t),this.h=r,this.d=(function(l,c){for(var h=!1,m=1/0,g=0;g<c.length;g++)for(var x=c[g],S=0,I=x.length,C=I-1;S<I;C=S++){var z=x[S],j=x[C];z.y>l.y!=j.y>l.y&&l.x<(j.x-z.x)*(l.y-z.y)/(j.y-z.y)+z.x&&(h=!h),m=Math.min(m,oa(l,z,j))}return(h?1:-1)*Math.sqrt(m)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}Ps.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Ps.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Ps.prototype.peek=function(){return this.data[0]},Ps.prototype._up=function(e){for(var t=this.data,r=this.compare,a=t[e];e>0;){var l=e-1>>1,c=t[l];if(r(a,c)>=0)break;t[e]=c,e=l}t[e]=a},Ps.prototype._down=function(e){for(var t=this.data,r=this.compare,a=this.length>>1,l=t[e];e<a;){var c=1+(e<<1),h=t[c],m=c+1;if(m<this.length&&r(t[m],h)<0&&(c=m,h=t[m]),r(h,l)>=0)break;t[e]=h,e=c}t[e]=l};var rp=Number.POSITIVE_INFINITY;function Um(e,t){return t[1]!==rp?(function(r,a,l){var c=0,h=0;switch(a=Math.abs(a),l=Math.abs(l),r){case"top-right":case"top-left":case"top":h=l-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-l}switch(r){case"top-right":case"bottom-right":case"right":c=-a;break;case"top-left":case"bottom-left":case"left":c=a}return[c,h]})(e,t[0],t[1]):(function(r,a){var l=0,c=0;a<0&&(a=0);var h=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":c=h-7;break;case"bottom-right":case"bottom-left":c=7-h;break;case"bottom":c=7-a;break;case"top":c=a-7}switch(r){case"top-right":case"bottom-right":l=-h;break;case"top-left":case"bottom-left":l=h;break;case"left":l=a;break;case"right":l=-a}return[l,c]})(e,t[0])}function ip(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Nm(e,t,r,a,l,c,h,m,g,x,S,I,C,z,j){var G=(function(ce,he,xe,Pe,De,rt,Ue,ot){for(var je=Pe.layout.get("text-rotate").evaluate(rt,{})*Math.PI/180,bt=[],pt=0,Qe=he.positionedLines;pt<Qe.length;pt+=1)for(var Tt=Qe[pt],vt=0,Rt=Tt.positionedGlyphs;vt<Rt.length;vt+=1){var at=Rt[vt];if(at.rect){var Vt=at.rect||{},_r=4,Tr=!0,Sr=1,xr=0,Ar=(De||ot)&&at.vertical,Qr=at.metrics.advance*at.scale/2;if(ot&&he.verticalizable&&(xr=Tt.lineOffset/2-(at.imageName?-(24-at.metrics.width*at.scale)/2:24*(at.scale-1))),at.imageName){var ei=Ue[at.imageName];Tr=ei.sdf,_r=1/(Sr=ei.pixelRatio)}var Ci=De?[at.x+Qr,at.y]:[0,0],li=De?[0,0]:[at.x+Qr+xe[0],at.y+xe[1]-xr],ki=[0,0];Ar&&(ki=li,li=[0,0]);var Mr=(at.metrics.left-_r)*at.scale-Qr+li[0],ci=(-at.metrics.top-_r)*at.scale+li[1],Mt=Mr+Vt.w*at.scale/Sr,nr=ci+Vt.h*at.scale/Sr,Jt=new X(Mr,ci),Ft=new X(Mt,ci),Oi=new X(Mr,nr),_i=new X(Mt,nr);if(Ar){var fr=new X(-Qr,Qr- -17),Ur=-Math.PI/2,xi=12-Qr,qt=new X(22-xi,-(at.imageName?xi:0)),so=new(Function.prototype.bind.apply(X,[null].concat(ki)));Jt._rotateAround(Ur,fr)._add(qt)._add(so),Ft._rotateAround(Ur,fr)._add(qt)._add(so),Oi._rotateAround(Ur,fr)._add(qt)._add(so),_i._rotateAround(Ur,fr)._add(qt)._add(so)}if(je){var hn=Math.sin(je),uo=Math.cos(je),Br=[uo,-hn,hn,uo];Jt._matMult(Br),Ft._matMult(Br),Oi._matMult(Br),_i._matMult(Br)}var lo=new X(0,0),kn=new X(0,0);bt.push({tl:Jt,tr:Ft,bl:Oi,br:_i,tex:Vt,writingMode:he.writingMode,glyphOffset:Ci,sectionIndex:at.sectionIndex,isSDF:Tr,pixelOffsetTL:lo,pixelOffsetBR:kn,minFontScaleX:0,minFontScaleY:0})}}return bt})(0,r,m,l,c,h,a,e.allowVerticalPlacement),te=e.textSizeData,K=null;te.kind==="source"?(K=[128*l.layout.get("text-size").evaluate(h,{})])[0]>32640&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):te.kind==="composite"&&((K=[128*z.compositeTextSizes[0].evaluate(h,{},j),128*z.compositeTextSizes[1].evaluate(h,{},j)])[0]>32640||K[1]>32640)&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,G,K,m,c,h,x,t,g.lineStartIndex,g.lineLength,C,j);for(var oe=0,le=S;oe<le.length;oe+=1)I[le[oe]]=e.text.placedSymbolArray.length-1;return 4*G.length}function jm(e){for(var t in e)return e[t];return null}function Yb(e,t,r,a){var l=e.compareText;if(t in l){for(var c=l[t],h=c.length-1;h>=0;h--)if(a.dist(c[h])<r)return!0}else l[t]=[];return l[t].push(a),!1}var Qb=Ss.VectorTileFeature.types,e0=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hl(e,t,r,a,l,c,h,m,g,x,S,I,C){var z=m?Math.min(32640,Math.round(m[0])):0,j=m?Math.min(32640,Math.round(m[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*l),c,h,(z<<1)+(g?1:0),j,16*x,16*S,256*I,256*C)}function np(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function t0(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(hs(r[t].text))return!0;return!1}var ks=function(e){this.layoutVertexArray=new ys,this.indexArray=new to,this.programConfigurations=e,this.segments=new F,this.dynamicLayoutVertexArray=new ra,this.opacityVertexArray=new za,this.placedSymbolArray=new s};ks.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},ks.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Eb.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Pb.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,e0,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Xe("SymbolBuffers",ks);var Du=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new F,this.collisionVertexArray=new wu};Du.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Cb.members,!0)},Du.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Xe("CollisionBuffers",Du);var er=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(c){return c.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=en([]),this.placementViewportMatrix=en([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=tp(this.zoom,t["text-size"]),this.iconSizeData=tp(this.zoom,t["icon-size"]);var r=this.layers[0].layout,a=r.get("symbol-sort-key"),l=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=l!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(l==="viewport-y"||l==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map((function(c){return pn[c]}))),this.stateDependentLayerIds=this.layers.filter((function(c){return c.isStateDependent()})).map((function(c){return c.id})),this.sourceID=e.sourceID};er.prototype.createArrays=function(){this.text=new ks(new ct(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new ks(new ct(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new d,this.lineVertexArray=new v,this.symbolInstances=new f},er.prototype.calculateGlyphDependencies=function(e,t,r,a,l){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||a)&&l){var h=Mu[e.charAt(c)];h&&(t[h.charCodeAt(0)]=!0)}},er.prototype.populate=function(e,t,r){var a=this.layers[0],l=a.layout,c=l.get("text-font"),h=l.get("text-field"),m=l.get("icon-image"),g=(h.value.kind!=="constant"||h.value.value instanceof ni&&!h.value.value.isEmpty()||h.value.value.toString().length>0)&&(c.value.kind!=="constant"||c.value.value.length>0),x=m.value.kind!=="constant"||!!m.value.value||Object.keys(m.parameters).length>0,S=l.get("symbol-sort-key");if(this.features=[],g||x){for(var I=t.iconDependencies,C=t.glyphDependencies,z=t.availableImages,j=new Ct(this.zoom),G=0,te=e;G<te.length;G+=1){var K=te[G],oe=K.feature,le=K.id,ce=K.index,he=K.sourceLayerIndex,xe=a._featureFilter.needGeometry,Pe=kr(oe,xe);if(a._featureFilter.filter(j,Pe,r)){xe||(Pe.geometry=wr(oe));var De=void 0;if(g){var rt=a.getValueAndResolveTokens("text-field",Pe,r,z),Ue=ni.factory(rt);t0(Ue)&&(this.hasRTLText=!0),(!this.hasRTLText||gu()==="unavailable"||this.hasRTLText&&Qi.isParsed())&&(De=Mb(Ue,a,Pe))}var ot=void 0;if(x){var je=a.getValueAndResolveTokens("icon-image",Pe,r,z);ot=je instanceof Di?je:Di.fromString(je)}if(De||ot){var bt=this.sortFeaturesByKey?S.evaluate(Pe,{},r):void 0;if(this.features.push({id:le,text:De,icon:ot,index:ce,sourceLayerIndex:he,geometry:Pe.geometry,properties:oe.properties,type:Qb[oe.type],sortKey:bt}),ot&&(I[ot.name]=!0),De){var pt=c.evaluate(Pe,{},r).join(","),Qe=l.get("text-rotation-alignment")==="map"&&l.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(pn.vertical)>=0;for(var Tt=0,vt=De.sections;Tt<vt.length;Tt+=1){var Rt=vt[Tt];if(Rt.image)I[Rt.image.name]=!0;else{var at=mu(De.toString()),Vt=Rt.fontStack||pt,_r=C[Vt]=C[Vt]||{};this.calculateGlyphDependencies(Rt.text,_r,Qe,this.allowVerticalPlacement,at)}}}}}}l.get("symbol-placement")==="line"&&(this.features=(function(Tr){var Sr={},xr={},Ar=[],Qr=0;function ei(fr){Ar.push(Tr[fr]),Qr++}function Ci(fr,Ur,xi){var qt=xr[fr];return delete xr[fr],xr[Ur]=qt,Ar[qt].geometry[0].pop(),Ar[qt].geometry[0]=Ar[qt].geometry[0].concat(xi[0]),qt}function li(fr,Ur,xi){var qt=Sr[Ur];return delete Sr[Ur],Sr[fr]=qt,Ar[qt].geometry[0].shift(),Ar[qt].geometry[0]=xi[0].concat(Ar[qt].geometry[0]),qt}function ki(fr,Ur,xi){var qt=xi?Ur[0][Ur[0].length-1]:Ur[0][0];return fr+":"+qt.x+":"+qt.y}for(var Mr=0;Mr<Tr.length;Mr++){var ci=Tr[Mr],Mt=ci.geometry,nr=ci.text?ci.text.toString():null;if(nr){var Jt=ki(nr,Mt),Ft=ki(nr,Mt,!0);if(Jt in xr&&Ft in Sr&&xr[Jt]!==Sr[Ft]){var Oi=li(Jt,Ft,Mt),_i=Ci(Jt,Ft,Ar[Oi].geometry);delete Sr[Jt],delete xr[Ft],xr[ki(nr,Ar[_i].geometry,!0)]=_i,Ar[Oi].geometry=null}else Jt in xr?Ci(Jt,Ft,Mt):Ft in Sr?li(Jt,Ft,Mt):(ei(Mr),Sr[Jt]=Qr-1,xr[Ft]=Qr-1)}else ei(Mr)}return Ar.filter((function(fr){return fr.geometry}))})(this.features)),this.sortFeaturesByKey&&this.features.sort((function(Tr,Sr){return Tr.sortKey-Sr.sortKey}))}},er.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},er.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},er.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},er.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},er.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},er.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},er.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(e.segment!==void 0){for(var a=e.dist(t[e.segment+1]),l=e.dist(t[e.segment]),c={},h=e.segment+1;h<t.length;h++)c[h]={x:t[h].x,y:t[h].y,tileUnitDistanceFromAnchor:a},h<t.length-1&&(a+=t[h+1].dist(t[h]));for(var m=e.segment||0;m>=0;m--)c[m]={x:t[m].x,y:t[m].y,tileUnitDistanceFromAnchor:l},m>0&&(l+=t[m-1].dist(t[m]));for(var g=0;g<t.length;g++){var x=c[g];this.lineVertexArray.emplaceBack(x.x,x.y,x.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},er.prototype.addSymbols=function(e,t,r,a,l,c,h,m,g,x,S,I){for(var C=e.indexArray,z=e.layoutVertexArray,j=e.segments.prepareSegment(4*t.length,z,C,this.canOverlap?c.sortKey:void 0),G=this.glyphOffsetArray.length,te=j.vertexLength,K=this.allowVerticalPlacement&&h===pn.vertical?Math.PI/2:0,oe=c.text&&c.text.sections,le=0;le<t.length;le++){var ce=t[le],he=ce.tl,xe=ce.tr,Pe=ce.bl,De=ce.br,rt=ce.tex,Ue=ce.pixelOffsetTL,ot=ce.pixelOffsetBR,je=ce.minFontScaleX,bt=ce.minFontScaleY,pt=ce.glyphOffset,Qe=ce.isSDF,Tt=ce.sectionIndex,vt=j.vertexLength,Rt=pt[1];Hl(z,m.x,m.y,he.x,Rt+he.y,rt.x,rt.y,r,Qe,Ue.x,Ue.y,je,bt),Hl(z,m.x,m.y,xe.x,Rt+xe.y,rt.x+rt.w,rt.y,r,Qe,ot.x,Ue.y,je,bt),Hl(z,m.x,m.y,Pe.x,Rt+Pe.y,rt.x,rt.y+rt.h,r,Qe,Ue.x,ot.y,je,bt),Hl(z,m.x,m.y,De.x,Rt+De.y,rt.x+rt.w,rt.y+rt.h,r,Qe,ot.x,ot.y,je,bt),np(e.dynamicLayoutVertexArray,m,K),C.emplaceBack(vt,vt+1,vt+2),C.emplaceBack(vt+1,vt+2,vt+3),j.vertexLength+=4,j.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(pt[0]),le!==t.length-1&&Tt===t[le+1].sectionIndex||e.programConfigurations.populatePaintArrays(z.length,c,c.index,{},I,oe&&oe[Tt])}e.placedSymbolArray.emplaceBack(m.x,m.y,G,this.glyphOffsetArray.length-G,te,g,x,m.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],h,0,!1,0,S)},er.prototype._addCollisionDebugVertex=function(e,t,r,a,l,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,a,l,Math.round(c.x),Math.round(c.y))},er.prototype.addCollisionDebugVertices=function(e,t,r,a,l,c,h){var m=l.segments.prepareSegment(4,l.layoutVertexArray,l.indexArray),g=m.vertexLength,x=l.layoutVertexArray,S=l.collisionVertexArray,I=h.anchorX,C=h.anchorY;this._addCollisionDebugVertex(x,S,c,I,C,new X(e,t)),this._addCollisionDebugVertex(x,S,c,I,C,new X(r,t)),this._addCollisionDebugVertex(x,S,c,I,C,new X(r,a)),this._addCollisionDebugVertex(x,S,c,I,C,new X(e,a)),m.vertexLength+=4;var z=l.indexArray;z.emplaceBack(g,g+1),z.emplaceBack(g+1,g+2),z.emplaceBack(g+2,g+3),z.emplaceBack(g+3,g),m.primitiveLength+=4},er.prototype.addDebugCollisionBoxes=function(e,t,r,a){for(var l=e;l<t;l++){var c=this.collisionBoxArray.get(l);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,a?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},er.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Du(ia,bm.members,Da),this.iconCollisionBox=new Du(ia,bm.members,Da);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},er.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,l,c,h,m,g){for(var x={},S=t;S<r;S++){var I=e.get(S);x.textBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},x.textFeatureIndex=I.featureIndex;break}for(var C=a;C<l;C++){var z=e.get(C);x.verticalTextBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},x.verticalTextFeatureIndex=z.featureIndex;break}for(var j=c;j<h;j++){var G=e.get(j);x.iconBox={x1:G.x1,y1:G.y1,x2:G.x2,y2:G.y2,anchorPointX:G.anchorPointX,anchorPointY:G.anchorPointY},x.iconFeatureIndex=G.featureIndex;break}for(var te=m;te<g;te++){var K=e.get(te);x.verticalIconBox={x1:K.x1,y1:K.y1,x2:K.x2,y2:K.y2,anchorPointX:K.anchorPointX,anchorPointY:K.anchorPointY},x.verticalIconFeatureIndex=K.featureIndex;break}return x},er.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},er.prototype.hasTextData=function(){return this.text.segments.get().length>0},er.prototype.hasIconData=function(){return this.icon.segments.get().length>0},er.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},er.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},er.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},er.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),a=r.vertexStartIndex+4*r.numGlyphs,l=r.vertexStartIndex;l<a;l+=4)e.indexArray.emplaceBack(l,l+1,l+2),e.indexArray.emplaceBack(l+1,l+2,l+3)},er.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),a=[],l=[],c=[],h=0;h<this.symbolInstances.length;++h){c.push(h);var m=this.symbolInstances.get(h);a.push(0|Math.round(t*m.anchorX+r*m.anchorY)),l.push(m.featureIndex)}return c.sort((function(g,x){return a[g]-a[x]||l[x]-l[g]})),c},er.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},er.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,a=this.symbolInstanceIndexes;r<a.length;r+=1){var l=this.symbolInstances.get(a[r]);this.featureSortOrder.push(l.featureIndex),[l.rightJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.leftJustifiedTextSymbolIndex].forEach((function(c,h,m){c>=0&&m.indexOf(c)===h&&t.addIndicesForPlacedSymbol(t.text,c)})),l.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,l.verticalPlacedTextSymbolIndex),l.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.placedIconSymbolIndex),l.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Xe("SymbolBucket",er,{omit:["layers","collisionBoxArray","features","compareText"]}),er.MAX_GLYPHS=65535,er.addDynamicAttributes=np;var r0=new vi({"symbol-placement":new it(L.layout_symbol["symbol-placement"]),"symbol-spacing":new it(L.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new it(L.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ye(L.layout_symbol["symbol-sort-key"]),"symbol-z-order":new it(L.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new it(L.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new it(L.layout_symbol["icon-ignore-placement"]),"icon-optional":new it(L.layout_symbol["icon-optional"]),"icon-rotation-alignment":new it(L.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ye(L.layout_symbol["icon-size"]),"icon-text-fit":new it(L.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new it(L.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ye(L.layout_symbol["icon-image"]),"icon-rotate":new Ye(L.layout_symbol["icon-rotate"]),"icon-padding":new it(L.layout_symbol["icon-padding"]),"icon-keep-upright":new it(L.layout_symbol["icon-keep-upright"]),"icon-offset":new Ye(L.layout_symbol["icon-offset"]),"icon-anchor":new Ye(L.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new it(L.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new it(L.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new it(L.layout_symbol["text-rotation-alignment"]),"text-field":new Ye(L.layout_symbol["text-field"]),"text-font":new Ye(L.layout_symbol["text-font"]),"text-size":new Ye(L.layout_symbol["text-size"]),"text-max-width":new Ye(L.layout_symbol["text-max-width"]),"text-line-height":new it(L.layout_symbol["text-line-height"]),"text-letter-spacing":new Ye(L.layout_symbol["text-letter-spacing"]),"text-justify":new Ye(L.layout_symbol["text-justify"]),"text-radial-offset":new Ye(L.layout_symbol["text-radial-offset"]),"text-variable-anchor":new it(L.layout_symbol["text-variable-anchor"]),"text-anchor":new Ye(L.layout_symbol["text-anchor"]),"text-max-angle":new it(L.layout_symbol["text-max-angle"]),"text-writing-mode":new it(L.layout_symbol["text-writing-mode"]),"text-rotate":new Ye(L.layout_symbol["text-rotate"]),"text-padding":new it(L.layout_symbol["text-padding"]),"text-keep-upright":new it(L.layout_symbol["text-keep-upright"]),"text-transform":new Ye(L.layout_symbol["text-transform"]),"text-offset":new Ye(L.layout_symbol["text-offset"]),"text-allow-overlap":new it(L.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new it(L.layout_symbol["text-ignore-placement"]),"text-optional":new it(L.layout_symbol["text-optional"])}),op={paint:new vi({"icon-opacity":new Ye(L.paint_symbol["icon-opacity"]),"icon-color":new Ye(L.paint_symbol["icon-color"]),"icon-halo-color":new Ye(L.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ye(L.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ye(L.paint_symbol["icon-halo-blur"]),"icon-translate":new it(L.paint_symbol["icon-translate"]),"icon-translate-anchor":new it(L.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ye(L.paint_symbol["text-opacity"]),"text-color":new Ye(L.paint_symbol["text-color"],{runtimeType:Be,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Ye(L.paint_symbol["text-halo-color"]),"text-halo-width":new Ye(L.paint_symbol["text-halo-width"]),"text-halo-blur":new Ye(L.paint_symbol["text-halo-blur"]),"text-translate":new it(L.paint_symbol["text-translate"]),"text-translate-anchor":new it(L.paint_symbol["text-translate-anchor"])}),layout:r0},Ms=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Ze,this.defaultValue=e};Ms.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},Ms.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},Ms.prototype.outputDefined=function(){return!1},Ms.prototype.serialize=function(){return null},Xe("FormatSectionOverride",Ms,{omit:["defaultValue"]});var i0=(function(e){function t(r){e.call(this,r,op)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){if(e.prototype.recalculate.call(this,r,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var l=this.layout.get("text-writing-mode");if(l){for(var c=[],h=0,m=l;h<m.length;h+=1){var g=m[h];c.indexOf(g)<0&&c.push(g)}this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(r,a,l,c){var h=this.layout.get(r).evaluate(a,{},l,c),m=this._unevaluatedLayout._values[r];return m.isDataDriven()||wa(m.value)||!h?h:(function(g,x){return x.replace(/{([^{}]+)}/g,(function(S,I){return I in g?String(g[I]):""}))})(a.properties,h)},t.prototype.createBucket=function(r){return new er(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=op.paint.overridableProperties;r<a.length;r+=1){var l=a[r];if(t.hasPaintOverride(this.layout,l)){var c,h=this.paint.get(l),m=new Ms(h),g=new Ko(m,h.property.specification);c=h.value.kind==="constant"||h.value.kind==="source"?new Sa("source",g):new Jo("composite",g,h.value.zoomStops,h.value._interpolationType),this.paint._values[l]=new Ti(h.property,c,h.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!(!this.layout||a.isDataDriven()||l.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,a){var l=r.get("text-field"),c=op.paint.properties[a],h=!1,m=function(S){for(var I=0,C=S;I<C.length;I+=1)if(c.overrides&&c.overrides.hasOverride(C[I]))return void(h=!0)};if(l.value.kind==="constant"&&l.value.value instanceof ni)m(l.value.value.sections);else if(l.value.kind==="source"){var g=function(S){h||(S instanceof Si&&Cr(S.value)===rr?m(S.value.sections):S instanceof yn?m(S.sections):S.eachChild(g))},x=l.value;x._styleExpression&&g(x._styleExpression.expression)}return h},t})(An),n0={paint:new vi({"background-color":new it(L.paint_background["background-color"]),"background-pattern":new Ai(L.paint_background["background-pattern"]),"background-opacity":new it(L.paint_background["background-opacity"])})},o0=(function(e){function t(r){e.call(this,r,n0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),a0={paint:new vi({"raster-opacity":new it(L.paint_raster["raster-opacity"]),"raster-hue-rotate":new it(L.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new it(L.paint_raster["raster-brightness-min"]),"raster-brightness-max":new it(L.paint_raster["raster-brightness-max"]),"raster-saturation":new it(L.paint_raster["raster-saturation"]),"raster-contrast":new it(L.paint_raster["raster-contrast"]),"raster-resampling":new it(L.paint_raster["raster-resampling"]),"raster-fade-duration":new it(L.paint_raster["raster-fade-duration"])})},s0=(function(e){function t(r){e.call(this,r,a0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),u0=(function(e){function t(r){e.call(this,r,{}),this.implementation=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},t.prototype.onRemove=function(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},t})(An),l0={circle:jc,heatmap:$x,hillshade:Hx,fill:pb,"fill-extrusion":xb,line:Ab,symbol:i0,background:o0,raster:s0},Gm=Y.HTMLImageElement,Zm=Y.HTMLCanvasElement,$m=Y.HTMLVideoElement,Wm=Y.ImageData,Xl=Y.ImageBitmap,qa=function(e,t,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,a)};qa.prototype.update=function(e,t,r){var a=e.width,l=e.height,c=!(this.size&&this.size[0]===a&&this.size[1]===l||r),h=this.context,m=h.gl;if(this.useMipmap=!!(t&&t.useMipmap),m.bindTexture(m.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===m.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,l],e instanceof Gm||e instanceof Zm||e instanceof $m||e instanceof Wm||Xl&&e instanceof Xl?m.texImage2D(m.TEXTURE_2D,0,this.format,this.format,m.UNSIGNED_BYTE,e):m.texImage2D(m.TEXTURE_2D,0,this.format,a,l,0,this.format,m.UNSIGNED_BYTE,e.data);else{var g=r||{x:0,y:0},x=g.x,S=g.y;e instanceof Gm||e instanceof Zm||e instanceof $m||e instanceof Wm||Xl&&e instanceof Xl?m.texSubImage2D(m.TEXTURE_2D,0,x,S,m.RGBA,m.UNSIGNED_BYTE,e):m.texSubImage2D(m.TEXTURE_2D,0,x,S,a,l,m.RGBA,m.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&m.generateMipmap(m.TEXTURE_2D)},qa.prototype.bind=function(e,t,r){var a=this.context.gl;a.bindTexture(a.TEXTURE_2D,this.texture),r!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},qa.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},qa.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var ap=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};ap.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){e._triggered=!1,e._callback()}),0))},ap.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Bs=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},we(["receive","process"],this),this.invoker=new ap(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Er()?e:Y};function Hm(e,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[e*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}Bs.prototype.send=function(e,t,r,a,l){var c=this;l===void 0&&(l=!1);var h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);var m=Rr(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:a,mustQueue:l,sourceMapId:this.mapId,data:gn(t,m)},m),{cancel:function(){r&&delete c.callbacks[h],c.target.postMessage({id:h,type:"<cancel>",targetMapId:a,sourceMapId:c.mapId})}}},Bs.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];var a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else Er()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Bs.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},Bs.prototype.processTask=function(e,t){var r=this;if(t.type==="<response>"){var a=this.callbacks[e];delete this.callbacks[e],a&&(t.error?a(ji(t.error)):a(null,ji(t.data)))}else{var l=!1,c=Rr(this.globalScope)?void 0:[],h=t.hasCallback?function(S,I){l=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:S?gn(S):null,data:gn(I,c)},c)}:function(S){l=!0},m=null,g=ji(t.data);if(this.parent[t.type])m=this.parent[t.type](t.sourceMapId,g,h);else if(this.parent.getWorkerSource){var x=t.type.split(".");m=this.parent.getWorkerSource(t.sourceMapId,x[0],g.source)[x[1]](g,h)}else h(new Error("Could not find function "+t.type));!l&&m&&m.cancel&&(this.cancelCallbacks[e]=m.cancel)}},Bs.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var $r=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};$r.prototype.setNorthEast=function(e){return this._ne=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},$r.prototype.setSouthWest=function(e){return this._sw=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},$r.prototype.extend=function(e){var t,r,a=this._sw,l=this._ne;if(e instanceof gr)t=e,r=e;else{if(!(e instanceof $r))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend($r.convert(e)):this.extend(gr.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return a||l?(a.lng=Math.min(t.lng,a.lng),a.lat=Math.min(t.lat,a.lat),l.lng=Math.max(r.lng,l.lng),l.lat=Math.max(r.lat,l.lat)):(this._sw=new gr(t.lng,t.lat),this._ne=new gr(r.lng,r.lat)),this},$r.prototype.getCenter=function(){return new gr((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},$r.prototype.getSouthWest=function(){return this._sw},$r.prototype.getNorthEast=function(){return this._ne},$r.prototype.getNorthWest=function(){return new gr(this.getWest(),this.getNorth())},$r.prototype.getSouthEast=function(){return new gr(this.getEast(),this.getSouth())},$r.prototype.getWest=function(){return this._sw.lng},$r.prototype.getSouth=function(){return this._sw.lat},$r.prototype.getEast=function(){return this._ne.lng},$r.prototype.getNorth=function(){return this._ne.lat},$r.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},$r.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},$r.prototype.isEmpty=function(){return!(this._sw&&this._ne)},$r.prototype.contains=function(e){var t=gr.convert(e),r=t.lng,a=t.lat,l=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&l},$r.convert=function(e){return!e||e instanceof $r?e:new $r(e)};var gr=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};gr.prototype.wrap=function(){return new gr(Ve(this.lng,-180,180),this.lat)},gr.prototype.toArray=function(){return[this.lng,this.lat]},gr.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},gr.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,a=e.lat*t,l=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(l,1))},gr.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new $r(new gr(this.lng-r,this.lat-t),new gr(this.lng+r,this.lat+t))},gr.convert=function(e){if(e instanceof gr)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new gr(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new gr(Number("lng"in e?e.lng:e.lon),Number(e.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 Xm=2*Math.PI*63710088e-1;function Km(e){return Xm*Math.cos(e*Math.PI/180)}function Jm(e){return(180+e)/360}function Ym(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Qm(e,t){return e/Km(t)}function sp(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var Ua=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};Ua.fromLngLat=function(e,t){t===void 0&&(t=0);var r=gr.convert(e);return new Ua(Jm(r.lng),Ym(r.lat),Qm(t,r.lat))},Ua.prototype.toLngLat=function(){return new gr(360*this.x-180,sp(this.y))},Ua.prototype.toAltitude=function(){return this.z*Km(sp(this.y))},Ua.prototype.meterInMercatorCoordinateUnits=function(){return 1/Xm*(e=sp(this.y),1/Math.cos(e*Math.PI/180));var e};var Na=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Ru(0,e,e,t,r)};Na.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Na.prototype.url=function(e,t){var r,a,l,c,h,m=(a=this.y,l=this.z,c=Hm(256*(r=this.x),256*(a=Math.pow(2,l)-a-1),l),h=Hm(256*(r+1),256*(a+1),l),c[0]+","+c[1]+","+h[0]+","+h[1]),g=(function(x,S,I){for(var C,z="",j=x;j>0;j--)z+=(S&(C=1<<j-1)?1:0)+(I&C?2:0);return z})(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",g).replace("{bbox-epsg-3857}",m)},Na.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new X(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},Na.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ey=function(e,t){this.wrap=e,this.canonical=t,this.key=Ru(e,t.z,t.z,t.x,t.y)},Wr=function(e,t,r,a,l){this.overscaledZ=e,this.wrap=t,this.canonical=new Na(r,+a,+l),this.key=Ru(t,e,r,a,l)};function Ru(e,t,r,a,l){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*l+a).toString(36)+r.toString(36)+t.toString(36)}Wr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},Wr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new Wr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Wr.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Ru(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Ru(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},Wr.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},Wr.prototype.children=function(e){if(this.overscaledZ>=e)return[new Wr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new Wr(t,this.wrap,t,r,a),new Wr(t,this.wrap,t,r+1,a),new Wr(t,this.wrap,t,r,a+1),new Wr(t,this.wrap,t,r+1,a+1)]},Wr.prototype.isLessThan=function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))},Wr.prototype.wrapped=function(){return new Wr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.unwrapTo=function(e){return new Wr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Wr.prototype.toUnwrapped=function(){return new ey(this.wrap,this.canonical)},Wr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Wr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Ua(e.x-this.wrap,e.y))},Xe("CanonicalTileID",Na),Xe("OverscaledTileID",Wr,{omit:["posMatrix"]});var Fo=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return St('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var a=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var l=0;l<a;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(a,l)]=this.data[this._idx(a-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,a)]=this.data[this._idx(l,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)]};Fo.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),a=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[a],r[a+1],r[a+2])},Fo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Fo.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Fo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Fo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Fo.prototype.getPixels=function(){return new Hi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Fo.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var a=t*this.dim,l=t*this.dim+this.dim,c=r*this.dim,h=r*this.dim+this.dim;switch(t){case-1:a=l-1;break;case 1:l=a+1}switch(r){case-1:c=h-1;break;case 1:h=c+1}for(var m=-t*this.dim,g=-r*this.dim,x=c;x<h;x++)for(var S=a;S<l;S++)this.data[this._idx(S,x)]=e.data[this._idx(S+m,x+g)]},Xe("DEMData",Fo);var Kl=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Kl.prototype.encode=function(e){return this._stringToNumber[e]},Kl.prototype.decode=function(e){return this._numberToString[e]};var Jl=function(e,t,r,a,l){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=a,this.properties=e.properties,this.id=l},up={geometry:{configurable:!0}};up.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},up.geometry.set=function(e){this._geometry=e},Jl.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&(e[t]=this[t]);return e},Object.defineProperties(Jl.prototype,up);var zs=function(){this.state={},this.stateChanges={},this.deletedStates={}};zs.prototype.updateState=function(e,t,r){var a=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},Re(this.stateChanges[e][a],r),this.deletedStates[e]===null)for(var l in this.deletedStates[e]={},this.state[e])l!==a&&(this.deletedStates[e][l]=null);else if(this.deletedStates[e]&&this.deletedStates[e][a]===null)for(var c in this.deletedStates[e][a]={},this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null);else for(var h in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][h]===null&&delete this.deletedStates[e][a][h]},zs.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}},zs.prototype.getState=function(e,t){var r=String(t),a=Re({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var l=this.deletedStates[e][t];if(l===null)return{};for(var c in l)delete a[c]}return a},zs.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},zs.prototype.coalesceChanges=function(e,t){var r={};for(var a in this.stateChanges){this.state[a]=this.state[a]||{};var l={};for(var c in this.stateChanges[a])this.state[a][c]||(this.state[a][c]={}),Re(this.state[a][c],this.stateChanges[a][c]),l[c]=this.state[a][c];r[a]=l}for(var h in this.deletedStates){this.state[h]=this.state[h]||{};var m={};if(this.deletedStates[h]===null)for(var g in this.state[h])m[g]={},this.state[h][g]={};else for(var x in this.deletedStates[h]){if(this.deletedStates[h][x]===null)this.state[h][x]={};else for(var S=0,I=Object.keys(this.deletedStates[h][x]);S<I.length;S+=1)delete this.state[h][x][I[S]];m[x]=this.state[h][x]}r[h]=r[h]||{},Re(r[h],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var C in e)e[C].setFeatureState(r,t)};var Oo=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Rn(8192,16,0),this.grid3D=new Rn(8192,16,0),this.featureIndexArray=new A,this.promoteId=t};function ty(e,t,r,a,l){return Fe(e,(function(c,h){var m=t instanceof Ba?t.get(h):null;return m&&m.evaluate?m.evaluate(r,a,l):m}))}function ry(e){for(var t=1/0,r=1/0,a=-1/0,l=-1/0,c=0,h=e;c<h.length;c+=1){var m=h[c];t=Math.min(t,m.x),r=Math.min(r,m.y),a=Math.max(a,m.x),l=Math.max(l,m.y)}return{minX:t,minY:r,maxX:a,maxY:l}}function c0(e,t){return t-e}Oo.prototype.insert=function(e,t,r,a,l,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,l);for(var m=c?this.grid3D:this.grid,g=0;g<t.length;g++){for(var x=t[g],S=[1/0,1/0,-1/0,-1/0],I=0;I<x.length;I++){var C=x[I];S[0]=Math.min(S[0],C.x),S[1]=Math.min(S[1],C.y),S[2]=Math.max(S[2],C.x),S[3]=Math.max(S[3],C.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&m.insert(h,S[0],S[1],S[2],S[3])}},Oo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ss.VectorTile(new Vl(this.rawTileData)).layers,this.sourceLayerCoder=new Kl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Oo.prototype.query=function(e,t,r,a){var l=this;this.loadVTLayers();for(var c=e.params||{},h=8192/e.tileSize/e.scale,m=as(c.filter),g=e.queryGeometry,x=e.queryPadding*h,S=ry(g),I=this.grid.query(S.minX-x,S.minY-x,S.maxX+x,S.maxY+x),C=ry(e.cameraQueryGeometry),z=this.grid3D.query(C.minX-x,C.minY-x,C.maxX+x,C.maxY+x,(function(ce,he,xe,Pe){return(function(De,rt,Ue,ot,je){for(var bt=0,pt=De;bt<pt.length;bt+=1){var Qe=pt[bt];if(rt<=Qe.x&&Ue<=Qe.y&&ot>=Qe.x&&je>=Qe.y)return!0}var Tt=[new X(rt,Ue),new X(rt,je),new X(ot,je),new X(ot,Ue)];if(De.length>2){for(var vt=0,Rt=Tt;vt<Rt.length;vt+=1)if(Pn(De,Rt[vt]))return!0}for(var at=0;at<De.length-1;at++)if(Fa(De[at],De[at+1],Tt))return!0;return!1})(e.cameraQueryGeometry,ce-x,he-x,xe+x,Pe+x)})),j=0,G=z;j<G.length;j+=1)I.push(G[j]);I.sort(c0);for(var te,K={},oe=function(ce){var he=I[ce];if(he!==te){te=he;var xe=l.featureIndexArray.get(he),Pe=null;l.loadMatchingFeature(K,xe.bucketIndex,xe.sourceLayerIndex,xe.featureIndex,m,c.layers,c.availableImages,t,r,a,(function(De,rt,Ue){return Pe||(Pe=wr(De)),rt.queryIntersectsFeature(g,De,Ue,Pe,l.z,e.transform,h,e.pixelPosMatrix)}))}},le=0;le<I.length;le++)oe(le);return K},Oo.prototype.loadMatchingFeature=function(e,t,r,a,l,c,h,m,g,x,S){var I=this.bucketLayerIDs[t];if(!c||(function(De,rt){for(var Ue=0;Ue<De.length;Ue++)if(rt.indexOf(De[Ue])>=0)return!0;return!1})(c,I)){var C=this.sourceLayerCoder.decode(r),z=this.vtLayers[C].feature(a);if(l.needGeometry){var j=kr(z,!0);if(!l.filter(new Ct(this.tileID.overscaledZ),j,this.tileID.canonical))return}else if(!l.filter(new Ct(this.tileID.overscaledZ),z))return;for(var G=this.getId(z,C),te=0;te<I.length;te++){var K=I[te];if(!(c&&c.indexOf(K)<0)){var oe=m[K];if(oe){var le={};G!==void 0&&x&&(le=x.getState(oe.sourceLayer||"_geojsonTileLayer",G));var ce=Re({},g[K]);ce.paint=ty(ce.paint,oe.paint,z,le,h),ce.layout=ty(ce.layout,oe.layout,z,le,h);var he=!S||S(z,oe,le);if(he){var xe=new Jl(z,this.z,this.x,this.y,G);xe.layer=ce;var Pe=e[K];Pe===void 0&&(Pe=e[K]=[]),Pe.push({featureIndex:a,feature:xe,intersectionZ:he})}}}}}},Oo.prototype.lookupSymbolFeatures=function(e,t,r,a,l,c,h,m){var g={};this.loadVTLayers();for(var x=as(l),S=0,I=e;S<I.length;S+=1)this.loadMatchingFeature(g,r,a,I[S],x,c,h,m,t);return g},Oo.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var a=0,l=r[t];a<l.length;a+=1)if(e===l[a])return!0;return!1},Oo.prototype.getId=function(e,t){var r=e.id;return this.promoteId&&typeof(r=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[t]])=="boolean"&&(r=Number(r)),r},Xe("FeatureIndex",Oo,{omit:["rawTileData","sourceLayerCoder"]});var ui=function(e,t){this.tileID=e,this.uid=Ke(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ui.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<Xi.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},ui.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},ui.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var a in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=(function(x,S){var I={};if(!S)return I;for(var C=function(){var G=j[z],te=G.layerIds.map((function(le){return S.getLayer(le)})).filter(Boolean);if(te.length!==0){G.layers=te,G.stateDependentLayerIds&&(G.stateDependentLayers=G.stateDependentLayerIds.map((function(le){return te.filter((function(ce){return ce.id===le}))[0]})));for(var K=0,oe=te;K<oe.length;K+=1)I[oe[K].id]=G}},z=0,j=x;z<j.length;z+=1)C();return I})(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var l=this.buckets[a];if(l instanceof er){if(this.hasSymbolBuckets=!0,!r)break;l.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var c in this.buckets){var h=this.buckets[c];if(h instanceof er&&h.hasRTLText){this.hasRTLText=!0,Qi.isLoading()||Qi.isLoaded()||gu()!=="deferred"||_n();break}}for(var m in this.queryPadding=0,this.buckets){var g=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(m).queryRadius(g))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o},ui.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ui.prototype.getBucket=function(e){return this.buckets[e.id]},ui.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new qa(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new qa(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)},ui.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},ui.prototype.queryRenderedFeatures=function(e,t,r,a,l,c,h,m,g,x){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:l,scale:c,tileSize:this.tileSize,pixelPosMatrix:x,transform:m,params:h,queryPadding:this.queryPadding*g},e,t,r):{}},ui.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var a=r.loadVTLayers(),l=t?t.sourceLayer:"",c=a._geojsonTileLayer||a[l];if(c)for(var h=as(t&&t.filter),m=this.tileID.canonical,g=m.z,x=m.x,S=m.y,I={z:g,x,y:S},C=0;C<c.length;C++){var z=c.feature(C);if(h.needGeometry){var j=kr(z,!0);if(!h.filter(new Ct(this.tileID.overscaledZ),j,this.tileID.canonical))continue}else if(!h.filter(new Ct(this.tileID.overscaledZ),z))continue;var G=r.getId(z,l),te=new Jl(z,g,x,S,G);te.tile=I,e.push(te)}}},ui.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},ui.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ui.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=bi(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var a=Date.now(),l=!1;if(this.expirationTime>a)l=!1;else if(t)if(this.expirationTime<t)l=!0;else{var c=this.expirationTime-t;c?this.expirationTime=a+Math.max(c,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ui.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)},ui.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(e).length!==0){var r=this.latestFeatureIndex.loadVTLayers();for(var a in this.buckets)if(t.style.hasLayer(a)){var l=this.buckets[a],c=l.layers[0].sourceLayer||"_geojsonTileLayer",h=r[c],m=e[c];if(h&&m&&Object.keys(m).length!==0){l.update(m,h,this.imageAtlas&&this.imageAtlas.patternPositions||{});var g=t&&t.style&&t.style.getLayer(a);g&&(this.queryPadding=Math.max(this.queryPadding,g.queryRadius(l)))}}}},ui.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},ui.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Xi.now()},ui.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ui.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=Xi.now()+e},ui.prototype.setDependencies=function(e,t){for(var r={},a=0,l=t;a<l.length;a+=1)r[l[a]]=!0;this.dependencies[e]=r},ui.prototype.hasDependency=function(e,t){for(var r=0,a=e;r<a.length;r+=1){var l=this.dependencies[a[r]];if(l){for(var c=0,h=t;c<h.length;c+=1)if(l[h[c]])return!0}}return!1};var ua=Y.performance,iy=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},ua.mark(this._marks.start)};iy.prototype.finish=function(){ua.mark(this._marks.end);var e=ua.getEntriesByName(this._marks.measure);return e.length===0&&(ua.measure(this._marks.measure,this._marks.start,this._marks.end),e=ua.getEntriesByName(this._marks.measure),ua.clearMarks(this._marks.start),ua.clearMarks(this._marks.end),ua.clearMeasures(this._marks.measure)),e},u.Actor=Bs,u.AlphaImage=Va,u.CanonicalTileID=Na,u.CollisionBoxArray=o,u.Color=Zt,u.DEMData=Fo,u.DataConstantProperty=it,u.DictionaryCoder=Kl,u.EXTENT=8192,u.ErrorEvent=re,u.EvaluationParameters=Ct,u.Event=Z,u.Evented=ie,u.FeatureIndex=Oo,u.FillBucket=Vn,u.FillExtrusionBucket=qn,u.ImageAtlas=zu,u.ImagePosition=Ul,u.LineBucket=Fi,u.LngLat=gr,u.LngLatBounds=$r,u.MercatorCoordinate=Ua,u.ONE_EM=24,u.OverscaledTileID=Wr,u.Point=X,u.Point$1=X,u.Properties=vi,u.Protobuf=Vl,u.RGBAImage=Hi,u.RequestManager=pr,u.RequestPerformance=iy,u.ResourceType=jt,u.SegmentVector=F,u.SourceFeatureState=zs,u.StructArrayLayout1ui2=Iu,u.StructArrayLayout2f1f2i16=zo,u.StructArrayLayout2i4=Bo,u.StructArrayLayout3ui6=to,u.StructArrayLayout4i8=xu,u.SymbolBucket=er,u.Texture=qa,u.Tile=ui,u.Transitionable=yi,u.Uniform1f=Me,u.Uniform1i=Ie,u.Uniform2f=Ce,u.Uniform3f=$e,u.Uniform4f=nt,u.UniformColor=ut,u.UniformMatrix4f=Lt,u.UnwrappedTileID=ey,u.ValidationError=H,u.WritingMode=pn,u.ZoomHistory=du,u.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},u.addDynamicAttributes=np,u.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var a=e.length,l=new Array(e.length),c=null;e.forEach((function(h,m){t(h,(function(g,x){g&&(c=g),l[m]=x,--a==0&&r(c,l)}))}))},u.bezier=be,u.bindAll=we,u.browser=Xi,u.cacheEntryPossiblyAdded=function(e){++fe>$o&&(e.getActor().send("enforceCacheSizeLimit",Bn),fe=0)},u.clamp=Oe,u.clearTileCache=function(e){var t=Y.caches.delete("mapbox-tiles");e&&t.catch(e).then((function(){return e()}))},u.clipLine=Om,u.clone=function(e){var t=new $t(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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},u.clone$1=kt,u.clone$2=function(e){var t=new $t(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},u.collisionCircleLayout=kb,u.config=Nt,u.create=function(){var e=new $t(16);return $t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},u.create$1=function(){var e=new $t(9);return $t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},u.create$2=function(){var e=new $t(4);return $t!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},u.createCommonjsModule=U,u.createExpression=ns,u.createLayout=ai,u.createStyleLayer=function(e){return e.type==="custom"?new u0(e):new l0[e.type](e)},u.cross=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=r[0],m=r[1],g=r[2];return e[0]=l*g-c*m,e[1]=c*h-a*g,e[2]=a*m-l*h,e},u.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(var l in t)if(!e(t[l],r[l]))return!1;return!0}return t===r},u.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},u.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},u.ease=ke,u.emitValidationErrors=Ca,u.endsWith=Ge,u.enforceCacheSizeLimit=function(e){jn(),ri&&ri.then((function(t){t.keys().then((function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])}))}))},u.evaluateSizeForFeature=Bm,u.evaluateSizeForZoom=zm,u.evaluateVariableOffset=Um,u.evented=vu,u.extend=Re,u.featureFilter=as,u.filterObject=tt,u.fromRotation=function(e,t){var r=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},u.getAnchorAlignment=ep,u.getAnchorJustification=ip,u.getArrayBuffer=ii,u.getImage=P,u.getJSON=function(e,t){return qi(Re(e,{type:"json"}),t)},u.getRTLTextPluginStatus=gu,u.getReferrer=Kt,u.getVideo=function(e,t){var r,a,l=Y.document.createElement("video");l.muted=!0,l.onloadstart=function(){t(null,l)};for(var c=0;c<e.length;c++){var h=Y.document.createElement("source");r=e[c],a=void 0,(a=Y.document.createElement("a")).href=r,(a.protocol!==Y.document.location.protocol||a.host!==Y.document.location.host)&&(l.crossOrigin="Anonymous"),h.src=e[c],l.appendChild(h)}return{cancel:function(){}}},u.identity=en,u.invert=function(e,t){var r=t[0],a=t[1],l=t[2],c=t[3],h=t[4],m=t[5],g=t[6],x=t[7],S=t[8],I=t[9],C=t[10],z=t[11],j=t[12],G=t[13],te=t[14],K=t[15],oe=r*m-a*h,le=r*g-l*h,ce=r*x-c*h,he=a*g-l*m,xe=a*x-c*m,Pe=l*x-c*g,De=S*G-I*j,rt=S*te-C*j,Ue=S*K-z*j,ot=I*te-C*G,je=I*K-z*G,bt=C*K-z*te,pt=oe*bt-le*je+ce*ot+he*Ue-xe*rt+Pe*De;return pt?(e[0]=(m*bt-g*je+x*ot)*(pt=1/pt),e[1]=(l*je-a*bt-c*ot)*pt,e[2]=(G*Pe-te*xe+K*he)*pt,e[3]=(C*xe-I*Pe-z*he)*pt,e[4]=(g*Ue-h*bt-x*rt)*pt,e[5]=(r*bt-l*Ue+c*rt)*pt,e[6]=(te*ce-j*Pe-K*le)*pt,e[7]=(S*Pe-C*ce+z*le)*pt,e[8]=(h*je-m*Ue+x*De)*pt,e[9]=(a*Ue-r*je-c*De)*pt,e[10]=(j*xe-G*ce+K*oe)*pt,e[11]=(I*ce-S*xe-z*oe)*pt,e[12]=(m*rt-h*ot-g*De)*pt,e[13]=(r*ot-a*rt+l*De)*pt,e[14]=(G*le-j*he-te*oe)*pt,e[15]=(S*he-I*le+C*oe)*pt,e):null},u.isChar=Le,u.isMapboxURL=jr,u.keysDifference=function(e,t){var r=[];for(var a in e)a in t||r.push(a);return r},u.makeRequest=qi,u.mapObject=Fe,u.mercatorXfromLng=Jm,u.mercatorYfromLat=Ym,u.mercatorZfromAltitude=Qm,u.mul=Nc,u.multiply=Li,u.mvt=Ss,u.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},u.normalize=function(e,t){var r=t[0],a=t[1],l=t[2],c=r*r+a*a+l*l;return c>0&&(c=1/Math.sqrt(c)),e[0]=t[0]*c,e[1]=t[1]*c,e[2]=t[2]*c,e},u.number=Vr,u.offscreenCanvasSupported=_e,u.ortho=function(e,t,r,a,l,c,h){var m=1/(t-r),g=1/(a-l),x=1/(c-h);return e[0]=-2*m,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*g,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*x,e[11]=0,e[12]=(t+r)*m,e[13]=(l+a)*g,e[14]=(h+c)*x,e[15]=1,e},u.parseGlyphPBF=function(e){return new Vl(e).readFields(Ub,[])},u.pbf=Vl,u.performSymbolLayout=function(e,t,r,a,l,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var m=e.layers[0].layout,g=e.layers[0]._unevaluatedLayout._values,x={};if(e.textSizeData.kind==="composite"){var S=e.textSizeData,I=S.maxZoom;x.compositeTextSizes=[g["text-size"].possiblyEvaluate(new Ct(S.minZoom),h),g["text-size"].possiblyEvaluate(new Ct(I),h)]}if(e.iconSizeData.kind==="composite"){var C=e.iconSizeData,z=C.maxZoom;x.compositeIconSizes=[g["icon-size"].possiblyEvaluate(new Ct(C.minZoom),h),g["icon-size"].possiblyEvaluate(new Ct(z),h)]}x.layoutTextSize=g["text-size"].possiblyEvaluate(new Ct(e.zoom+1),h),x.layoutIconSize=g["icon-size"].possiblyEvaluate(new Ct(e.zoom+1),h),x.textMaxSize=g["text-size"].possiblyEvaluate(new Ct(18));for(var j=24*m.get("text-line-height"),G=m.get("text-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",te=m.get("text-keep-upright"),K=m.get("text-size"),oe=function(){var he=ce[le],xe=m.get("text-font").evaluate(he,{},h).join(","),Pe=K.evaluate(he,{},h),De=x.layoutTextSize.evaluate(he,{},h),rt=x.layoutIconSize.evaluate(he,{},h),Ue={horizontal:{},vertical:void 0},ot=he.text,je=[0,0];if(ot){var bt=ot.toString(),pt=24*m.get("text-letter-spacing").evaluate(he,{},h),Qe=(function(Mt){for(var nr=0,Jt=Mt;nr<Jt.length;nr+=1)if(Ft=Jt[nr].charCodeAt(0),Le.Arabic(Ft)||Le["Arabic Supplement"](Ft)||Le["Arabic Extended-A"](Ft)||Le["Arabic Presentation Forms-A"](Ft)||Le["Arabic Presentation Forms-B"](Ft))return!1;var Ft;return!0})(bt)?pt:0,Tt=m.get("text-anchor").evaluate(he,{},h),vt=m.get("text-variable-anchor");if(!vt){var Rt=m.get("text-radial-offset").evaluate(he,{},h);je=Rt?Um(Tt,[24*Rt,rp]):m.get("text-offset").evaluate(he,{},h).map((function(Mt){return 24*Mt}))}var at=G?"center":m.get("text-justify").evaluate(he,{},h),Vt=m.get("symbol-placement"),_r=Vt==="point"?24*m.get("text-max-width").evaluate(he,{},h):0,Tr=function(){e.allowVerticalPlacement&&mu(bt)&&(Ue.vertical=Nl(ot,t,r,l,xe,_r,j,Tt,"left",Qe,je,pn.vertical,!0,Vt,De,Pe))};if(!G&&vt){for(var Sr=at==="auto"?vt.map((function(Mt){return ip(Mt)})):[at],xr=!1,Ar=0;Ar<Sr.length;Ar++){var Qr=Sr[Ar];if(!Ue.horizontal[Qr])if(xr)Ue.horizontal[Qr]=Ue.horizontal[0];else{var ei=Nl(ot,t,r,l,xe,_r,j,"center",Qr,Qe,je,pn.horizontal,!1,Vt,De,Pe);ei&&(Ue.horizontal[Qr]=ei,xr=ei.positionedLines.length===1)}}Tr()}else{at==="auto"&&(at=ip(Tt));var Ci=Nl(ot,t,r,l,xe,_r,j,Tt,at,Qe,je,pn.horizontal,!1,Vt,De,Pe);Ci&&(Ue.horizontal[at]=Ci),Tr(),mu(bt)&&G&&te&&(Ue.vertical=Nl(ot,t,r,l,xe,_r,j,Tt,at,Qe,je,pn.vertical,!1,Vt,De,Pe))}}var li=void 0,ki=!1;if(he.icon&&he.icon.name){var Mr=a[he.icon.name];Mr&&(li=(function(Mt,nr,Jt){var Ft=ep(Jt),Oi=nr[0]-Mt.displaySize[0]*Ft.horizontalAlign,_i=nr[1]-Mt.displaySize[1]*Ft.verticalAlign;return{image:Mt,top:_i,bottom:_i+Mt.displaySize[1],left:Oi,right:Oi+Mt.displaySize[0]}})(l[he.icon.name],m.get("icon-offset").evaluate(he,{},h),m.get("icon-anchor").evaluate(he,{},h)),ki=Mr.sdf,e.sdfIcons===void 0?e.sdfIcons=Mr.sdf:e.sdfIcons!==Mr.sdf&&St("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Mr.pixelRatio!==e.pixelRatio||m.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var ci=jm(Ue.horizontal)||Ue.vertical;e.iconsInText=!!ci&&ci.iconsInText,(ci||li)&&(function(Mt,nr,Jt,Ft,Oi,_i,fr,Ur,xi,qt,so){var hn=_i.textMaxSize.evaluate(nr,{});hn===void 0&&(hn=fr);var uo,Br=Mt.layers[0].layout,lo=Br.get("icon-offset").evaluate(nr,{},so),kn=jm(Jt.horizontal),Ds=fr/24,ja=Mt.tilePixelRatio*Ds,Rs=Mt.tilePixelRatio*hn/24,Vo=Mt.tilePixelRatio*Ur,Ls=Mt.tilePixelRatio*Br.get("symbol-spacing"),Yl=Br.get("text-padding")*Mt.tilePixelRatio,Fs=Br.get("icon-padding")*Mt.tilePixelRatio,Lu=Br.get("text-max-angle")/180*Math.PI,Ql=Br.get("text-rotation-alignment")==="map"&&Br.get("symbol-placement")!=="point",ec=Br.get("icon-rotation-alignment")==="map"&&Br.get("symbol-placement")!=="point",qo=Br.get("symbol-placement"),Fu=Ls/2,Os=Br.get("icon-text-fit");Ft&&Os!=="none"&&(Mt.allowVerticalPlacement&&Jt.vertical&&(uo=Mm(Ft,Jt.vertical,Os,Br.get("icon-text-fit-padding"),lo,Ds)),kn&&(Ft=Mm(Ft,kn,Os,Br.get("icon-text-fit-padding"),lo,Ds)));var la=function(p0,Zu){Zu.x<0||Zu.x>=8192||Zu.y<0||Zu.y>=8192||(function(zr,Un,h0,ca,hp,ay,ac,co,sc,$u,uc,lc,fp,sy,Wu,uy,ly,cy,py,hy,fn,cc,fy,po,f0){var dy,Za,js,Gs,Zs,$s=zr.addToLineVertexArray(Un,h0),my=0,yy=0,vy=0,gy=0,dp=-1,mp=-1,Uo={},_y=N(""),yp=0,vp=0;if(co._unevaluatedLayout.getValue("text-radial-offset")===void 0?(yp=(dy=co.layout.get("text-offset").evaluate(fn,{},po).map((function(Xu){return 24*Xu})))[0],vp=dy[1]):(yp=24*co.layout.get("text-radial-offset").evaluate(fn,{},po),vp=rp),zr.allowVerticalPlacement&&ca.vertical){var xy=co.layout.get("text-rotate").evaluate(fn,{},po)+90;Gs=new Wl(sc,Un,$u,uc,lc,ca.vertical,fp,sy,Wu,xy),ac&&(Zs=new Wl(sc,Un,$u,uc,lc,ac,ly,cy,Wu,xy))}if(hp){var gp=co.layout.get("icon-rotate").evaluate(fn,{}),by=co.layout.get("icon-text-fit")!=="none",wy=Vm(hp,gp,fy,by),_p=ac?Vm(ac,gp,fy,by):void 0;js=new Wl(sc,Un,$u,uc,lc,hp,ly,cy,!1,gp),my=4*wy.length;var Sy=zr.iconSizeData,Hu=null;Sy.kind==="source"?(Hu=[128*co.layout.get("icon-size").evaluate(fn,{})])[0]>32640&&St(zr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):Sy.kind==="composite"&&((Hu=[128*cc.compositeIconSizes[0].evaluate(fn,{},po),128*cc.compositeIconSizes[1].evaluate(fn,{},po)])[0]>32640||Hu[1]>32640)&&St(zr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),zr.addSymbols(zr.icon,wy,Hu,hy,py,fn,!1,Un,$s.lineStartIndex,$s.lineLength,-1,po),dp=zr.icon.placedSymbolArray.length-1,_p&&(yy=4*_p.length,zr.addSymbols(zr.icon,_p,Hu,hy,py,fn,pn.vertical,Un,$s.lineStartIndex,$s.lineLength,-1,po),mp=zr.icon.placedSymbolArray.length-1)}for(var Iy in ca.horizontal){var pc=ca.horizontal[Iy];if(!Za){_y=N(pc.text);var d0=co.layout.get("text-rotate").evaluate(fn,{},po);Za=new Wl(sc,Un,$u,uc,lc,pc,fp,sy,Wu,d0)}var Ty=pc.positionedLines.length===1;if(vy+=Nm(zr,Un,pc,ay,co,Wu,fn,uy,$s,ca.vertical?pn.horizontal:pn.horizontalOnly,Ty?Object.keys(ca.horizontal):[Iy],Uo,dp,cc,po),Ty)break}ca.vertical&&(gy+=Nm(zr,Un,ca.vertical,ay,co,Wu,fn,uy,$s,pn.vertical,["vertical"],Uo,mp,cc,po));var m0=Za?Za.boxStartIndex:zr.collisionBoxArray.length,y0=Za?Za.boxEndIndex:zr.collisionBoxArray.length,v0=Gs?Gs.boxStartIndex:zr.collisionBoxArray.length,g0=Gs?Gs.boxEndIndex:zr.collisionBoxArray.length,_0=js?js.boxStartIndex:zr.collisionBoxArray.length,x0=js?js.boxEndIndex:zr.collisionBoxArray.length,b0=Zs?Zs.boxStartIndex:zr.collisionBoxArray.length,w0=Zs?Zs.boxEndIndex:zr.collisionBoxArray.length,ho=-1,hc=function(Xu,Ey){return Xu&&Xu.circleDiameter?Math.max(Xu.circleDiameter,Ey):Ey};ho=hc(Za,ho),ho=hc(Gs,ho),ho=hc(js,ho);var Ay=(ho=hc(Zs,ho))>-1?1:0;Ay&&(ho*=f0/24),zr.glyphOffsetArray.length>=er.MAX_GLYPHS&&St("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),fn.sortKey!==void 0&&zr.addToSortKeyRanges(zr.symbolInstances.length,fn.sortKey),zr.symbolInstances.emplaceBack(Un.x,Un.y,Uo.right>=0?Uo.right:-1,Uo.center>=0?Uo.center:-1,Uo.left>=0?Uo.left:-1,Uo.vertical||-1,dp,mp,_y,m0,y0,v0,g0,_0,x0,b0,w0,$u,vy,gy,my,yy,Ay,0,fp,yp,vp,ho)})(Mt,Zu,p0,Jt,Ft,Oi,uo,Mt.layers[0],Mt.collisionBoxArray,nr.index,nr.sourceLayerIndex,Mt.index,ja,Yl,Ql,xi,Vo,Fs,ec,lo,nr,_i,qt,so,fr)};if(qo==="line")for(var Vs=0,tc=Om(nr.geometry,0,0,8192,8192);Vs<tc.length;Vs+=1)for(var rc=tc[Vs],Ou=0,Vu=Hb(rc,Ls,Lu,Jt.vertical||kn,Ft,24,Rs,Mt.overscaling,8192);Ou<Vu.length;Ou+=1){var ic=Vu[Ou];kn&&Yb(Mt,kn.text,Fu,ic)||la(rc,ic)}else if(qo==="line-center")for(var qu=0,Uu=nr.geometry;qu<Uu.length;qu+=1){var Nu=Uu[qu];if(Nu.length>1){var nc=Wb(Nu,Lu,Jt.vertical||kn,Ft,24,Rs);nc&&la(Nu,nc)}}else if(nr.type==="Polygon")for(var qs=0,oc=Xc(nr.geometry,0);qs<oc.length;qs+=1){var Us=oc[qs],ju=Kb(Us,16);la(Us[0],new Es(ju.x,ju.y,0))}else if(nr.type==="LineString")for(var Ga=0,Gu=nr.geometry;Ga<Gu.length;Ga+=1){var Ns=Gu[Ga];la(Ns,new Es(Ns[0].x,Ns[0].y,0))}else if(nr.type==="Point")for(var lp=0,ny=nr.geometry;lp<ny.length;lp+=1)for(var cp=0,oy=ny[lp];cp<oy.length;cp+=1){var pp=oy[cp];la([pp],new Es(pp.x,pp.y,0))}})(e,he,Ue,li,a,x,De,rt,je,ki,h)},le=0,ce=e.features;le<ce.length;le+=1)oe();c&&e.generateCollisionDebugBuffers()},u.perspective=function(e,t,r,a,l){var c,h=1/Math.tan(t/2);return e[0]=h/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=h,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,l!=null&&l!==1/0?(e[10]=(l+a)*(c=1/(a-l)),e[14]=2*l*a*c):(e[10]=-1,e[14]=-2*a),e},u.pick=function(e,t){for(var r={},a=0;a<t.length;a++){var l=t[a];l in e&&(r[l]=e[l])}return r},u.plugin=Qi,u.polygonIntersectsPolygon=no,u.postMapLoadEvent=Mn,u.postTurnstileEvent=Zo,u.potpack=Em,u.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],u.register=Xe,u.registerForPluginStateChange=function(e){return e({pluginStatus:Zi,pluginURL:Ln}),vu.on("pluginStateChange",e),e},u.renderColorRamp=um,u.rotate=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=Math.sin(r),g=Math.cos(r);return e[0]=a*g+c*m,e[1]=l*g+h*m,e[2]=a*-m+c*g,e[3]=l*-m+h*g,e},u.rotateX=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[4],h=t[5],m=t[6],g=t[7],x=t[8],S=t[9],I=t[10],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*l+x*a,e[5]=h*l+S*a,e[6]=m*l+I*a,e[7]=g*l+C*a,e[8]=x*l-c*a,e[9]=S*l-h*a,e[10]=I*l-m*a,e[11]=C*l-g*a,e},u.rotateZ=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[0],h=t[1],m=t[2],g=t[3],x=t[4],S=t[5],I=t[6],C=t[7];return t!==e&&(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[0]=c*l+x*a,e[1]=h*l+S*a,e[2]=m*l+I*a,e[3]=g*l+C*a,e[4]=x*l-c*a,e[5]=S*l-h*a,e[6]=I*l-m*a,e[7]=C*l-g*a,e},u.scale=function(e,t,r){var a=r[0],l=r[1],c=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*l,e[5]=t[5]*l,e[6]=t[6]*l,e[7]=t[7]*l,e[8]=t[8]*c,e[9]=t[9]*c,e[10]=t[10]*c,e[11]=t[11]*c,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},u.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},u.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},u.setCacheLimits=function(e,t){Bn=e,$o=t},u.setRTLTextPlugin=function(e,t,r){if(r===void 0&&(r=!1),Zi==="deferred"||Zi==="loading"||Zi==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Ln=Xi.resolveURL(e),Zi="deferred",fs=t,Ma(),r||_n()},u.sphericalToCartesian=function(e){var t=e[0],r=e[1],a=e[2];return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(a),y:t*Math.sin(r)*Math.sin(a),z:t*Math.cos(a)}},u.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},u.styleSpec=L,u.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},u.symbolSize=$b,u.transformMat3=function(e,t,r){var a=t[0],l=t[1],c=t[2];return e[0]=a*r[0]+l*r[3]+c*r[6],e[1]=a*r[1]+l*r[4]+c*r[7],e[2]=a*r[2]+l*r[5]+c*r[8],e},u.transformMat4=_s,u.translate=function(e,t,r){var a,l,c,h,m,g,x,S,I,C,z,j,G=r[0],te=r[1],K=r[2];return t===e?(e[12]=t[0]*G+t[4]*te+t[8]*K+t[12],e[13]=t[1]*G+t[5]*te+t[9]*K+t[13],e[14]=t[2]*G+t[6]*te+t[10]*K+t[14],e[15]=t[3]*G+t[7]*te+t[11]*K+t[15]):(l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],x=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],e[0]=a=t[0],e[1]=l,e[2]=c,e[3]=h,e[4]=m,e[5]=g,e[6]=x,e[7]=S,e[8]=I,e[9]=C,e[10]=z,e[11]=j,e[12]=a*G+m*te+I*K+t[12],e[13]=l*G+g*te+C*K+t[13],e[14]=c*G+x*te+z*K+t[14],e[15]=h*G+S*te+j*K+t[15]),e},u.triggerPluginCompletionEvent=Bl,u.uniqueId=Ke,u.validateCustomStyleLayer=function(e){var t=[],r=e.id;return r===void 0&&t.push({message:"layers."+r+': missing required property "id"'}),e.render===void 0&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},u.validateLight=qc,u.validateStyle=Ea,u.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},u.vectorTile=Ss,u.version="1.13.3",u.warnOnce=St,u.webpSupported=Nr,u.window=Y,u.wrap=Ve})),R(["./shared"],(function(u){function U(T){var P=typeof T;if(P==="number"||P==="boolean"||P==="string"||T==null)return JSON.stringify(T);if(Array.isArray(T)){for(var B="[",V=0,Z=T;V<Z.length;V+=1)B+=U(Z[V])+",";return B+"]"}for(var re=Object.keys(T).sort(),ie="{",L=0;L<re.length;L++)ie+=JSON.stringify(re[L])+":"+U(T[re[L]])+",";return ie+"}"}function k(T){for(var P="",B=0,V=u.refProperties;B<V.length;B+=1)P+="/"+U(T[V[B]]);return P}var J=function(T){this.keyCache={},T&&this.replace(T)};J.prototype.replace=function(T){this._layerConfigs={},this._layers={},this.update(T,[])},J.prototype.update=function(T,P){for(var B=this,V=0,Z=T;V<Z.length;V+=1){var re=Z[V];this._layerConfigs[re.id]=re;var ie=this._layers[re.id]=u.createStyleLayer(re);ie._featureFilter=u.featureFilter(ie.filter),this.keyCache[re.id]&&delete this.keyCache[re.id]}for(var L=0,H=P;L<H.length;L+=1){var se=H[L];delete this.keyCache[se],delete this._layerConfigs[se],delete this._layers[se]}this.familiesBySource={};for(var Se=0,Ee=(function(ze,Be){for(var yt={},qe=0;qe<ze.length;qe++){var Et=Be&&Be[ze[qe].id]||k(ze[qe]);Be&&(Be[ze[qe].id]=Et);var rr=yt[Et];rr||(rr=yt[Et]=[]),rr.push(ze[qe])}var Pt=[];for(var Gt in yt)Pt.push(yt[Gt]);return Pt})(u.values(this._layerConfigs),this.keyCache);Se<Ee.length;Se+=1){var me=Ee[Se].map((function(ze){return B._layers[ze.id]})),Ae=me[0];if(Ae.visibility!=="none"){var Je=Ae.source||"",Ze=this.familiesBySource[Je];Ze||(Ze=this.familiesBySource[Je]={});var ge=Ae.sourceLayer||"_geojsonTileLayer",Ne=Ze[ge];Ne||(Ne=Ze[ge]=[]),Ne.push(me)}}};var X=function(T){var P={},B=[];for(var V in T){var Z=T[V],re=P[V]={};for(var ie in Z){var L=Z[+ie];if(L&&L.bitmap.width!==0&&L.bitmap.height!==0){var H={x:0,y:0,w:L.bitmap.width+2,h:L.bitmap.height+2};B.push(H),re[ie]={rect:H,metrics:L.metrics}}}}var se=u.potpack(B),Se=new u.AlphaImage({width:se.w||1,height:se.h||1});for(var Ee in T){var me=T[Ee];for(var Ae in me){var Je=me[+Ae];if(Je&&Je.bitmap.width!==0&&Je.bitmap.height!==0){var Ze=P[Ee][Ae].rect;u.AlphaImage.copy(Je.bitmap,Se,{x:0,y:0},{x:Ze.x+1,y:Ze.y+1},Je.bitmap)}}}this.image=Se,this.positions=P};u.register("GlyphAtlas",X);var ae=function(T){this.tileID=new u.OverscaledTileID(T.tileID.overscaledZ,T.tileID.wrap,T.tileID.canonical.z,T.tileID.canonical.x,T.tileID.canonical.y),this.uid=T.uid,this.zoom=T.zoom,this.pixelRatio=T.pixelRatio,this.tileSize=T.tileSize,this.source=T.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=T.showCollisionBoxes,this.collectResourceTiming=!!T.collectResourceTiming,this.returnDependencies=!!T.returnDependencies,this.promoteId=T.promoteId};function Y(T,P,B){for(var V=new u.EvaluationParameters(P),Z=0,re=T;Z<re.length;Z+=1)re[Z].recalculate(V,B)}function Te(T,P){var B=u.getArrayBuffer(T.request,(function(V,Z,re,ie){V?P(V):Z&&P(null,{vectorTile:new u.vectorTile.VectorTile(new u.pbf(Z)),rawData:Z,cacheControl:re,expires:ie})}));return function(){B.cancel(),P()}}ae.prototype.parse=function(T,P,B,V,Z){var re=this;this.status="parsing",this.data=T,this.collisionBoxArray=new u.CollisionBoxArray;var ie=new u.DictionaryCoder(Object.keys(T.layers).sort()),L=new u.FeatureIndex(this.tileID,this.promoteId);L.bucketLayerIDs=[];var H,se,Se,Ee,me={},Ae={featureIndex:L,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:B},Je=P.familiesBySource[this.source];for(var Ze in Je){var ge=T.layers[Ze];if(ge){ge.version===1&&u.warnOnce('Vector tile source "'+this.source+'" layer "'+Ze+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Ne=ie.encode(Ze),ze=[],Be=0;Be<ge.length;Be++){var yt=ge.feature(Be),qe=L.getId(yt,Ze);ze.push({feature:yt,id:qe,index:Be,sourceLayerIndex:Ne})}for(var Et=0,rr=Je[Ze];Et<rr.length;Et+=1){var Pt=rr[Et],Gt=Pt[0];Gt.minzoom&&this.zoom<Math.floor(Gt.minzoom)||Gt.maxzoom&&this.zoom>=Gt.maxzoom||Gt.visibility!=="none"&&(Y(Pt,this.zoom,B),(me[Gt.id]=Gt.createBucket({index:L.bucketLayerIDs.length,layers:Pt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ne,sourceID:this.source})).populate(ze,Ae,this.tileID.canonical),L.bucketLayerIDs.push(Pt.map((function(Qt){return Qt.id}))))}}}var Dt=u.mapObject(Ae.glyphDependencies,(function(Qt){return Object.keys(Qt).map(Number)}));Object.keys(Dt).length?V.send("getGlyphs",{uid:this.uid,stacks:Dt},(function(Qt,Bt){H||(H=Qt,se=Bt,Pr.call(re))})):se={};var wi=Object.keys(Ae.iconDependencies);wi.length?V.send("getImages",{icons:wi,source:this.source,tileID:this.tileID,type:"icons"},(function(Qt,Bt){H||(H=Qt,Se=Bt,Pr.call(re))})):Se={};var Ht=Object.keys(Ae.patternDependencies);function Pr(){if(H)return Z(H);if(se&&Se&&Ee){var Qt=new X(se),Bt=new u.ImageAtlas(Se,Ee);for(var Zt in me){var zi=me[Zt];zi instanceof u.SymbolBucket?(Y(zi.layers,this.zoom,B),u.performSymbolLayout(zi,se,Qt.positions,Se,Bt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):zi.hasPattern&&(zi instanceof u.LineBucket||zi instanceof u.FillBucket||zi instanceof u.FillExtrusionBucket)&&(Y(zi.layers,this.zoom,B),zi.addFeatures(Ae,this.tileID.canonical,Bt.patternPositions))}this.status="done",Z(null,{buckets:u.values(me).filter((function(ma){return!ma.isEmpty()})),featureIndex:L,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Qt.image,imageAtlas:Bt,glyphMap:this.returnDependencies?se:null,iconMap:this.returnDependencies?Se:null,glyphPositions:this.returnDependencies?Qt.positions:null})}}Ht.length?V.send("getImages",{icons:Ht,source:this.source,tileID:this.tileID,type:"patterns"},(function(Qt,Bt){H||(H=Qt,Ee=Bt,Pr.call(re))})):Ee={},Pr.call(this)};var be=function(T,P,B,V){this.actor=T,this.layerIndex=P,this.availableImages=B,this.loadVectorData=V||Te,this.loading={},this.loaded={}};be.prototype.loadTile=function(T,P){var B=this,V=T.uid;this.loading||(this.loading={});var Z=!!(T&&T.request&&T.request.collectResourceTiming)&&new u.RequestPerformance(T.request),re=this.loading[V]=new ae(T);re.abort=this.loadVectorData(T,(function(ie,L){if(delete B.loading[V],ie||!L)return re.status="done",B.loaded[V]=re,P(ie);var H=L.rawData,se={};L.expires&&(se.expires=L.expires),L.cacheControl&&(se.cacheControl=L.cacheControl);var Se={};if(Z){var Ee=Z.finish();Ee&&(Se.resourceTiming=JSON.parse(JSON.stringify(Ee)))}re.vectorTile=L.vectorTile,re.parse(L.vectorTile,B.layerIndex,B.availableImages,B.actor,(function(me,Ae){if(me||!Ae)return P(me);P(null,u.extend({rawTileData:H.slice(0)},Ae,se,Se))})),B.loaded=B.loaded||{},B.loaded[V]=re}))},be.prototype.reloadTile=function(T,P){var B=this,V=this.loaded,Z=T.uid,re=this;if(V&&V[Z]){var ie=V[Z];ie.showCollisionBoxes=T.showCollisionBoxes;var L=function(H,se){var Se=ie.reloadCallback;Se&&(delete ie.reloadCallback,ie.parse(ie.vectorTile,re.layerIndex,B.availableImages,re.actor,Se)),P(H,se)};ie.status==="parsing"?ie.reloadCallback=L:ie.status==="done"&&(ie.vectorTile?ie.parse(ie.vectorTile,this.layerIndex,this.availableImages,this.actor,L):L())}},be.prototype.abortTile=function(T,P){var B=this.loading,V=T.uid;B&&B[V]&&B[V].abort&&(B[V].abort(),delete B[V]),P()},be.prototype.removeTile=function(T,P){var B=this.loaded,V=T.uid;B&&B[V]&&delete B[V],P()};var ke=u.window.ImageBitmap,Oe=function(){this.loaded={}};function Ve(T,P){if(T.length!==0){Re(T[0],P);for(var B=1;B<T.length;B++)Re(T[B],!P)}}function Re(T,P){for(var B=0,V=0,Z=0,re=T.length,ie=re-1;Z<re;ie=Z++){var L=(T[Z][0]-T[ie][0])*(T[ie][1]+T[Z][1]),H=B+L;V+=Math.abs(B)>=Math.abs(L)?B-H+L:L-H+B,B=H}B+V>=0!=!!P&&T.reverse()}Oe.prototype.loadTile=function(T,P){var B=T.uid,V=T.encoding,Z=T.rawImageData,re=ke&&Z instanceof ke?this.getImageData(Z):Z,ie=new u.DEMData(B,re,V);this.loaded=this.loaded||{},this.loaded[B]=ie,P(null,ie)},Oe.prototype.getImageData=function(T){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(T.width,T.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=T.width,this.offscreenCanvas.height=T.height,this.offscreenCanvasContext.drawImage(T,0,0,T.width,T.height);var P=this.offscreenCanvasContext.getImageData(-1,-1,T.width+2,T.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new u.RGBAImage({width:P.width,height:P.height},P.data)},Oe.prototype.removeTile=function(T){var P=this.loaded,B=T.uid;P&&P[B]&&delete P[B]};var ve=u.vectorTile.VectorTileFeature.prototype.toGeoJSON,Ke=function(T){this._feature=T,this.extent=u.EXTENT,this.type=T.type,this.properties=T.tags,"id"in T&&!isNaN(T.id)&&(this.id=parseInt(T.id,10))};Ke.prototype.loadGeometry=function(){if(this._feature.type===1){for(var T=[],P=0,B=this._feature.geometry;P<B.length;P+=1){var V=B[P];T.push([new u.Point$1(V[0],V[1])])}return T}for(var Z=[],re=0,ie=this._feature.geometry;re<ie.length;re+=1){for(var L=[],H=0,se=ie[re];H<se.length;H+=1){var Se=se[H];L.push(new u.Point$1(Se[0],Se[1]))}Z.push(L)}return Z},Ke.prototype.toGeoJSON=function(T,P,B){return ve.call(this,T,P,B)};var We=function(T){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=u.EXTENT,this.length=T.length,this._features=T};We.prototype.feature=function(T){return new Ke(this._features[T])};var It=u.vectorTile.VectorTileFeature,we=Ge;function Ge(T,P){this.options=P||{},this.features=T,this.length=T.length}function Fe(T,P){this.id=typeof T.id=="number"?T.id:void 0,this.type=T.type,this.rawGeometry=T.type===1?[T.geometry]:T.geometry,this.properties=T.tags,this.extent=P||4096}Ge.prototype.feature=function(T){return new Fe(this.features[T],this.options.extent)},Fe.prototype.loadGeometry=function(){var T=this.rawGeometry;this.geometry=[];for(var P=0;P<T.length;P++){for(var B=T[P],V=[],Z=0;Z<B.length;Z++)V.push(new u.Point$1(B[Z][0],B[Z][1]));this.geometry.push(V)}return this.geometry},Fe.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var T=this.geometry,P=1/0,B=-1/0,V=1/0,Z=-1/0,re=0;re<T.length;re++)for(var ie=T[re],L=0;L<ie.length;L++){var H=ie[L];P=Math.min(P,H.x),B=Math.max(B,H.x),V=Math.min(V,H.y),Z=Math.max(Z,H.y)}return[P,V,B,Z]},Fe.prototype.toGeoJSON=It.prototype.toGeoJSON;var tt=Wt,kt=we;function Wt(T){var P=new u.pbf;return(function(B,V){for(var Z in B.layers)V.writeMessage(3,St,B.layers[Z])})(T,P),P.finish()}function St(T,P){var B;P.writeVarintField(15,T.version||1),P.writeStringField(1,T.name||""),P.writeVarintField(5,T.extent||4096);var V={keys:[],values:[],keycache:{},valuecache:{}};for(B=0;B<T.length;B++)V.feature=T.feature(B),P.writeMessage(2,Ut,V);var Z=V.keys;for(B=0;B<Z.length;B++)P.writeStringField(3,Z[B]);var re=V.values;for(B=0;B<re.length;B++)P.writeMessage(4,Rr,re[B])}function Ut(T,P){var B=T.feature;B.id!==void 0&&P.writeVarintField(1,B.id),P.writeMessage(2,Hr,T),P.writeVarintField(3,B.type),P.writeMessage(4,or,B)}function Hr(T,P){var B=T.feature,V=T.keys,Z=T.values,re=T.keycache,ie=T.valuecache;for(var L in B.properties){var H=re[L];H===void 0&&(V.push(L),re[L]=H=V.length-1),P.writeVarint(H);var se=B.properties[L],Se=typeof se;Se!=="string"&&Se!=="boolean"&&Se!=="number"&&(se=JSON.stringify(se));var Ee=Se+":"+se,me=ie[Ee];me===void 0&&(Z.push(se),ie[Ee]=me=Z.length-1),P.writeVarint(me)}}function Er(T,P){return(P<<3)+(7&T)}function bi(T){return T<<1^T>>31}function or(T,P){for(var B=T.loadGeometry(),V=T.type,Z=0,re=0,ie=B.length,L=0;L<ie;L++){var H=B[L],se=1;V===1&&(se=H.length),P.writeVarint(Er(1,se));for(var Se=V===3?H.length-1:H.length,Ee=0;Ee<Se;Ee++){Ee===1&&V!==1&&P.writeVarint(Er(2,Se-1));var me=H[Ee].x-Z,Ae=H[Ee].y-re;P.writeVarint(bi(me)),P.writeVarint(bi(Ae)),Z+=me,re+=Ae}V===3&&P.writeVarint(Er(7,1))}}function Rr(T,P){var B=typeof T;B==="string"?P.writeStringField(1,T):B==="boolean"?P.writeBooleanField(7,T):B==="number"&&(T%1!=0?P.writeDoubleField(3,T):T<0?P.writeSVarintField(6,T):P.writeVarintField(5,T))}function et(T,P,B,V){Lr(T,B,V),Lr(P,2*B,2*V),Lr(P,2*B+1,2*V+1)}function Lr(T,P,B){var V=T[P];T[P]=T[B],T[B]=V}function Xr(T,P,B,V){var Z=T-B,re=P-V;return Z*Z+re*re}tt.fromVectorTileJs=Wt,tt.fromGeojsonVt=function(T,P){P=P||{};var B={};for(var V in T)B[V]=new we(T[V].features,P),B[V].name=V,B[V].version=P.version,B[V].extent=P.extent;return Wt({layers:B})},tt.GeoJSONWrapper=kt;var At=function(T){return T[0]},Fr=function(T){return T[1]},Mi=function(T,P,B,V,Z){P===void 0&&(P=At),B===void 0&&(B=Fr),V===void 0&&(V=64),Z===void 0&&(Z=Float64Array),this.nodeSize=V,this.points=T;for(var re=T.length<65536?Uint16Array:Uint32Array,ie=this.ids=new re(T.length),L=this.coords=new Z(2*T.length),H=0;H<T.length;H++)ie[H]=H,L[2*H]=P(T[H]),L[2*H+1]=B(T[H]);(function se(Se,Ee,me,Ae,Je,Ze){if(!(Je-Ae<=me)){var ge=Ae+Je>>1;(function Ne(ze,Be,yt,qe,Et,rr){for(;Et>qe;){if(Et-qe>600){var Pt=Et-qe+1,Gt=yt-qe+1,Dt=Math.log(Pt),wi=.5*Math.exp(2*Dt/3),Ht=.5*Math.sqrt(Dt*wi*(Pt-wi)/Pt)*(Gt-Pt/2<0?-1:1);Ne(ze,Be,yt,Math.max(qe,Math.floor(yt-Gt*wi/Pt+Ht)),Math.min(Et,Math.floor(yt+(Pt-Gt)*wi/Pt+Ht)),rr)}var Pr=Be[2*yt+rr],Qt=qe,Bt=Et;for(et(ze,Be,qe,yt),Be[2*Et+rr]>Pr&&et(ze,Be,qe,Et);Qt<Bt;){for(et(ze,Be,Qt,Bt),Qt++,Bt--;Be[2*Qt+rr]<Pr;)Qt++;for(;Be[2*Bt+rr]>Pr;)Bt--}Be[2*qe+rr]===Pr?et(ze,Be,qe,Bt):et(ze,Be,++Bt,Et),Bt<=yt&&(qe=Bt+1),yt<=Bt&&(Et=Bt-1)}})(Se,Ee,ge,Ae,Je,Ze%2),se(Se,Ee,me,Ae,ge-1,Ze+1),se(Se,Ee,me,ge+1,Je,Ze+1)}})(ie,L,V,0,ie.length-1,0)};Mi.prototype.range=function(T,P,B,V){return(function(Z,re,ie,L,H,se,Se){for(var Ee,me,Ae=[0,Z.length-1,0],Je=[];Ae.length;){var Ze=Ae.pop(),ge=Ae.pop(),Ne=Ae.pop();if(ge-Ne<=Se)for(var ze=Ne;ze<=ge;ze++)me=re[2*ze+1],(Ee=re[2*ze])>=ie&&Ee<=H&&me>=L&&me<=se&&Je.push(Z[ze]);else{var Be=Math.floor((Ne+ge)/2);me=re[2*Be+1],(Ee=re[2*Be])>=ie&&Ee<=H&&me>=L&&me<=se&&Je.push(Z[Be]);var yt=(Ze+1)%2;(Ze===0?ie<=Ee:L<=me)&&(Ae.push(Ne),Ae.push(Be-1),Ae.push(yt)),(Ze===0?H>=Ee:se>=me)&&(Ae.push(Be+1),Ae.push(ge),Ae.push(yt))}}return Je})(this.ids,this.coords,T,P,B,V,this.nodeSize)},Mi.prototype.within=function(T,P,B){return(function(V,Z,re,ie,L,H){for(var se=[0,V.length-1,0],Se=[],Ee=L*L;se.length;){var me=se.pop(),Ae=se.pop(),Je=se.pop();if(Ae-Je<=H)for(var Ze=Je;Ze<=Ae;Ze++)Xr(Z[2*Ze],Z[2*Ze+1],re,ie)<=Ee&&Se.push(V[Ze]);else{var ge=Math.floor((Je+Ae)/2),Ne=Z[2*ge],ze=Z[2*ge+1];Xr(Ne,ze,re,ie)<=Ee&&Se.push(V[ge]);var Be=(me+1)%2;(me===0?re-L<=Ne:ie-L<=ze)&&(se.push(Je),se.push(ge-1),se.push(Be)),(me===0?re+L>=Ne:ie+L>=ze)&&(se.push(ge+1),se.push(Ae),se.push(Be))}}return Se})(this.ids,this.coords,T,P,B,this.nodeSize)};var pi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(T){return T}},Or=function(T){this.options=mr(Object.create(pi),T),this.trees=new Array(this.options.maxZoom+1)};function Xi(T,P,B,V,Z){return{x:T,y:P,zoom:1/0,id:B,parentId:-1,numPoints:V,properties:Z}}function Nt(T,P){var B=T.geometry.coordinates,V=B[1];return{x:sr(B[0]),y:lt(V),zoom:1/0,index:P,parentId:-1}}function Nr(T){return{type:"Feature",id:T.id,properties:ar(T),geometry:{type:"Point",coordinates:[(V=T.x,360*(V-.5)),(P=T.y,B=(180-360*P)*Math.PI/180,360*Math.atan(Math.exp(B))/Math.PI-90)]}};var P,B,V}function ar(T){var P=T.numPoints,B=P>=1e4?Math.round(P/1e3)+"k":P>=1e3?Math.round(P/100)/10+"k":P;return mr(mr({},T.properties),{cluster:!0,cluster_id:T.id,point_count:P,point_count_abbreviated:B})}function sr(T){return T/360+.5}function lt(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function mr(T,P){for(var B in P)T[B]=P[B];return T}function pr(T){return T.x}function jr(T){return T.y}function hr(T,P,B,V,Z,re){var ie=Z-B,L=re-V;if(ie!==0||L!==0){var H=((T-B)*ie+(P-V)*L)/(ie*ie+L*L);H>1?(B=Z,V=re):H>0&&(B+=ie*H,V+=L*H)}return(ie=T-B)*ie+(L=P-V)*L}function br(T,P,B,V){var Z={id:T===void 0?null:T,type:P,geometry:B,tags:V,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return(function(re){var ie=re.geometry,L=re.type;if(L==="Point"||L==="MultiPoint"||L==="LineString")dn(re,ie);else if(L==="Polygon"||L==="MultiLineString")for(var H=0;H<ie.length;H++)dn(re,ie[H]);else if(L==="MultiPolygon")for(H=0;H<ie.length;H++)for(var se=0;se<ie[H].length;se++)dn(re,ie[H][se])})(Z),Z}function dn(T,P){for(var B=0;B<P.length;B+=3)T.minX=Math.min(T.minX,P[B]),T.minY=Math.min(T.minY,P[B+1]),T.maxX=Math.max(T.maxX,P[B]),T.maxY=Math.max(T.maxY,P[B+1])}function Kr(T,P,B,V){if(P.geometry){var Z=P.geometry.coordinates,re=P.geometry.type,ie=Math.pow(B.tolerance/((1<<B.maxZoom)*B.extent),2),L=[],H=P.id;if(B.promoteId?H=P.properties[B.promoteId]:B.generateId&&(H=V||0),re==="Point")Bi(Z,L);else if(re==="MultiPoint")for(var se=0;se<Z.length;se++)Bi(Z[se],L);else if(re==="LineString")hi(Z,L,ie,!1);else if(re==="MultiLineString"){if(B.lineMetrics){for(se=0;se<Z.length;se++)hi(Z[se],L=[],ie,!1),T.push(br(H,"LineString",L,P.properties));return}ti(Z,L,ie,!1)}else if(re==="Polygon")ti(Z,L,ie,!0);else{if(re!=="MultiPolygon"){if(re==="GeometryCollection"){for(se=0;se<P.geometry.geometries.length;se++)Kr(T,{id:H,geometry:P.geometry.geometries[se],properties:P.properties},B,V);return}throw new Error("Input data is not a valid GeoJSON object.")}for(se=0;se<Z.length;se++){var Se=[];ti(Z[se],Se,ie,!0),L.push(Se)}}T.push(br(H,re,L,P.properties))}}function Bi(T,P){P.push(ri(T[0])),P.push(Vi(T[1])),P.push(0)}function hi(T,P,B,V){for(var Z,re,ie=0,L=0;L<T.length;L++){var H=ri(T[L][0]),se=Vi(T[L][1]);P.push(H),P.push(se),P.push(0),L>0&&(ie+=V?(Z*se-H*re)/2:Math.sqrt(Math.pow(H-Z,2)+Math.pow(se-re,2))),Z=H,re=se}var Se=P.length-3;P[2]=1,(function Ee(me,Ae,Je,Ze){for(var ge,Ne=Ze,ze=Je-Ae>>1,Be=Je-Ae,yt=me[Ae],qe=me[Ae+1],Et=me[Je],rr=me[Je+1],Pt=Ae+3;Pt<Je;Pt+=3){var Gt=hr(me[Pt],me[Pt+1],yt,qe,Et,rr);if(Gt>Ne)ge=Pt,Ne=Gt;else if(Gt===Ne){var Dt=Math.abs(Pt-ze);Dt<Be&&(ge=Pt,Be=Dt)}}Ne>Ze&&(ge-Ae>3&&Ee(me,Ae,ge,Ze),me[ge+2]=Ne,Je-ge>3&&Ee(me,ge,Je,Ze))})(P,0,Se,B),P[Se+2]=1,P.size=Math.abs(ie),P.start=0,P.end=P.size}function ti(T,P,B,V){for(var Z=0;Z<T.length;Z++){var re=[];hi(T[Z],re,B,V),P.push(re)}}function ri(T){return T/360+.5}function Vi(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function Ki(T,P,B,V,Z,re,ie,L){if(V/=P,re>=(B/=P)&&ie<V)return T;if(ie<B||re>=V)return null;for(var H=[],se=0;se<T.length;se++){var Se=T[se],Ee=Se.geometry,me=Se.type,Ae=Z===0?Se.minX:Se.minY,Je=Z===0?Se.maxX:Se.maxY;if(Ae>=B&&Je<V)H.push(Se);else if(!(Je<B||Ae>=V)){var Ze=[];if(me==="Point"||me==="MultiPoint")yo(Ee,Ze,B,V,Z);else if(me==="LineString")Zo(Ee,Ze,B,V,Z,!1,L.lineMetrics);else if(me==="MultiLineString")Mn(Ee,Ze,B,V,Z,!1);else if(me==="Polygon")Mn(Ee,Ze,B,V,Z,!0);else if(me==="MultiPolygon")for(var ge=0;ge<Ee.length;ge++){var Ne=[];Mn(Ee[ge],Ne,B,V,Z,!0),Ne.length&&Ze.push(Ne)}if(Ze.length){if(L.lineMetrics&&me==="LineString"){for(ge=0;ge<Ze.length;ge++)H.push(br(Se.id,me,Ze[ge],Se.tags));continue}me!=="LineString"&&me!=="MultiLineString"||(Ze.length===1?(me="LineString",Ze=Ze[0]):me="MultiLineString"),me!=="Point"&&me!=="MultiPoint"||(me=Ze.length===3?"Point":"MultiPoint"),H.push(br(Se.id,me,Ze,Se.tags))}}}return H.length?H:null}function yo(T,P,B,V,Z){for(var re=0;re<T.length;re+=3){var ie=T[re+Z];ie>=B&&ie<=V&&(P.push(T[re]),P.push(T[re+1]),P.push(T[re+2]))}}function Zo(T,P,B,V,Z,re,ie){for(var L,H,se=mn(T),Se=Z===0?$o:jn,Ee=T.start,me=0;me<T.length-3;me+=3){var Ae=T[me],Je=T[me+1],Ze=T[me+2],ge=T[me+3],Ne=T[me+4],ze=Z===0?Ae:Je,Be=Z===0?ge:Ne,yt=!1;ie&&(L=Math.sqrt(Math.pow(Ae-ge,2)+Math.pow(Je-Ne,2))),ze<B?Be>B&&(H=Se(se,Ae,Je,ge,Ne,B),ie&&(se.start=Ee+L*H)):ze>V?Be<V&&(H=Se(se,Ae,Je,ge,Ne,V),ie&&(se.start=Ee+L*H)):Bn(se,Ae,Je,Ze),Be<B&&ze>=B&&(H=Se(se,Ae,Je,ge,Ne,B),yt=!0),Be>V&&ze<=V&&(H=Se(se,Ae,Je,ge,Ne,V),yt=!0),!re&&yt&&(ie&&(se.end=Ee+L*H),P.push(se),se=mn(T)),ie&&(Ee+=L)}var qe=T.length-3;Ae=T[qe],Je=T[qe+1],Ze=T[qe+2],(ze=Z===0?Ae:Je)>=B&&ze<=V&&Bn(se,Ae,Je,Ze),qe=se.length-3,re&&qe>=3&&(se[qe]!==se[0]||se[qe+1]!==se[1])&&Bn(se,se[0],se[1],se[2]),se.length&&P.push(se)}function mn(T){var P=[];return P.size=T.size,P.start=T.start,P.end=T.end,P}function Mn(T,P,B,V,Z,re){for(var ie=0;ie<T.length;ie++)Zo(T[ie],P,B,V,Z,re,!1)}function Bn(T,P,B,V){T.push(P),T.push(B),T.push(V)}function $o(T,P,B,V,Z,re){var ie=(re-P)/(V-P);return T.push(re),T.push(B+(Z-B)*ie),T.push(1),ie}function jn(T,P,B,V,Z,re){var ie=(re-B)/(Z-B);return T.push(P+(V-P)*ie),T.push(re),T.push(1),ie}function zn(T,P){for(var B=[],V=0;V<T.length;V++){var Z,re=T[V],ie=re.type;if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")Z=rn(re.geometry,P);else if(ie==="MultiLineString"||ie==="Polygon"){Z=[];for(var L=0;L<re.geometry.length;L++)Z.push(rn(re.geometry[L],P))}else if(ie==="MultiPolygon")for(Z=[],L=0;L<re.geometry.length;L++){for(var H=[],se=0;se<re.geometry[L].length;se++)H.push(rn(re.geometry[L][se],P));Z.push(H)}B.push(br(re.id,ie,Z,re.tags))}return B}function rn(T,P){var B=[];B.size=T.size,T.start!==void 0&&(B.start=T.start,B.end=T.end);for(var V=0;V<T.length;V+=3)B.push(T[V]+P,T[V+1],T[V+2]);return B}function fe(T,P){if(T.transformed)return T;var B,V,Z,re=1<<T.z,ie=T.x,L=T.y;for(B=0;B<T.features.length;B++){var H=T.features[B],se=H.geometry,Se=H.type;if(H.geometry=[],Se===1)for(V=0;V<se.length;V+=2)H.geometry.push(_e(se[V],se[V+1],P,re,ie,L));else for(V=0;V<se.length;V++){var Ee=[];for(Z=0;Z<se[V].length;Z+=2)Ee.push(_e(se[V][Z],se[V][Z+1],P,re,ie,L));H.geometry.push(Ee)}}return T.transformed=!0,T}function _e(T,P,B,V,Z,re){return[Math.round(B*(T*V-Z)),Math.round(B*(P*V-re))]}function jt(T,P,B,V,Z){for(var re=P===Z.maxZoom?0:Z.tolerance/((1<<P)*Z.extent),ie={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:B,y:V,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},L=0;L<T.length;L++){ie.numFeatures++,tr(ie,T[L],re,Z);var H=T[L].minX,se=T[L].minY,Se=T[L].maxX,Ee=T[L].maxY;H<ie.minX&&(ie.minX=H),se<ie.minY&&(ie.minY=se),Se>ie.maxX&&(ie.maxX=Se),Ee>ie.maxY&&(ie.maxY=Ee)}return ie}function tr(T,P,B,V){var Z=P.geometry,re=P.type,ie=[];if(re==="Point"||re==="MultiPoint")for(var L=0;L<Z.length;L+=3)ie.push(Z[L]),ie.push(Z[L+1]),T.numPoints++,T.numSimplified++;else if(re==="LineString")Kt(ie,Z,T,B,!1,!1);else if(re==="MultiLineString"||re==="Polygon")for(L=0;L<Z.length;L++)Kt(ie,Z[L],T,B,re==="Polygon",L===0);else if(re==="MultiPolygon")for(var H=0;H<Z.length;H++){var se=Z[H];for(L=0;L<se.length;L++)Kt(ie,se[L],T,B,!0,L===0)}if(ie.length){var Se=P.tags||null;if(re==="LineString"&&V.lineMetrics){for(var Ee in Se={},P.tags)Se[Ee]=P.tags[Ee];Se.mapbox_clip_start=Z.start/Z.size,Se.mapbox_clip_end=Z.end/Z.size}var me={geometry:ie,type:re==="Polygon"||re==="MultiPolygon"?3:re==="LineString"||re==="MultiLineString"?2:1,tags:Se};P.id!==null&&(me.id=P.id),T.features.push(me)}}function Kt(T,P,B,V,Z,re){var ie=V*V;if(V>0&&P.size<(Z?ie:V))B.numPoints+=P.length/3;else{for(var L=[],H=0;H<P.length;H+=3)(V===0||P[H+2]>ie)&&(B.numSimplified++,L.push(P[H]),L.push(P[H+1])),B.numPoints++;Z&&(function(se,Se){for(var Ee=0,me=0,Ae=se.length,Je=Ae-2;me<Ae;Je=me,me+=2)Ee+=(se[me]-se[Je])*(se[me+1]+se[Je+1]);if(Ee>0===Se)for(me=0,Ae=se.length;me<Ae/2;me+=2){var Ze=se[me],ge=se[me+1];se[me]=se[Ae-2-me],se[me+1]=se[Ae-1-me],se[Ae-2-me]=Ze,se[Ae-1-me]=ge}})(L,re),T.push(L)}}function _t(T,P){var B=(P=this.options=(function(Z,re){for(var ie in re)Z[ie]=re[ie];return Z})(Object.create(this.options),P)).debug;if(B&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var V=(function(Z,re){var ie=[];if(Z.type==="FeatureCollection")for(var L=0;L<Z.features.length;L++)Kr(ie,Z.features[L],re,L);else Kr(ie,Z.type==="Feature"?Z:{geometry:Z},re);return ie})(T,P);this.tiles={},this.tileCoords=[],B&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(V=(function(Z,re){var ie=re.buffer/re.extent,L=Z,H=Ki(Z,1,-1-ie,ie,0,-1,2,re),se=Ki(Z,1,1-ie,2+ie,0,-1,2,re);return(H||se)&&(L=Ki(Z,1,-ie,1+ie,0,-1,2,re)||[],H&&(L=zn(H,1).concat(L)),se&&(L=L.concat(zn(se,-1)))),L})(V,P)).length&&this.splitTile(V,0,0,0),B&&(V.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function fi(T,P,B){return 32*((1<<T)*B+P)+T}function qi(T,P){var B=T.tileID.canonical;if(!this._geoJSONIndex)return P(null,null);var V=this._geoJSONIndex.getTile(B.z,B.x,B.y);if(!V)return P(null,null);var Z=new We(V.features),re=tt(Z);re.byteOffset===0&&re.byteLength===re.buffer.byteLength||(re=new Uint8Array(re)),P(null,{vectorTile:Z,rawData:re.buffer})}Or.prototype.load=function(T){var P=this.options,B=P.log,V=P.minZoom,Z=P.maxZoom,re=P.nodeSize;B&&console.time("total time");var ie="prepare "+T.length+" points";B&&console.time(ie),this.points=T;for(var L=[],H=0;H<T.length;H++)T[H].geometry&&L.push(Nt(T[H],H));this.trees[Z+1]=new Mi(L,pr,jr,re,Float32Array),B&&console.timeEnd(ie);for(var se=Z;se>=V;se--){var Se=+Date.now();L=this._cluster(L,se),this.trees[se]=new Mi(L,pr,jr,re,Float32Array),B&&console.log("z%d: %d clusters in %dms",se,L.length,+Date.now()-Se)}return B&&console.timeEnd("total time"),this},Or.prototype.getClusters=function(T,P){var B=((T[0]+180)%360+360)%360-180,V=Math.max(-90,Math.min(90,T[1])),Z=T[2]===180?180:((T[2]+180)%360+360)%360-180,re=Math.max(-90,Math.min(90,T[3]));if(T[2]-T[0]>=360)B=-180,Z=180;else if(B>Z){var ie=this.getClusters([B,V,180,re],P),L=this.getClusters([-180,V,Z,re],P);return ie.concat(L)}for(var H=this.trees[this._limitZoom(P)],se=[],Se=0,Ee=H.range(sr(B),lt(re),sr(Z),lt(V));Se<Ee.length;Se+=1){var me=H.points[Ee[Se]];se.push(me.numPoints?Nr(me):this.points[me.index])}return se},Or.prototype.getChildren=function(T){var P=this._getOriginId(T),B=this._getOriginZoom(T),V="No cluster with the specified id.",Z=this.trees[B];if(!Z)throw new Error(V);var re=Z.points[P];if(!re)throw new Error(V);for(var ie=this.options.radius/(this.options.extent*Math.pow(2,B-1)),L=[],H=0,se=Z.within(re.x,re.y,ie);H<se.length;H+=1){var Se=Z.points[se[H]];Se.parentId===T&&L.push(Se.numPoints?Nr(Se):this.points[Se.index])}if(L.length===0)throw new Error(V);return L},Or.prototype.getLeaves=function(T,P,B){var V=[];return this._appendLeaves(V,T,P=P||10,B=B||0,0),V},Or.prototype.getTile=function(T,P,B){var V=this.trees[this._limitZoom(T)],Z=Math.pow(2,T),re=this.options,ie=re.radius/re.extent,L=(B-ie)/Z,H=(B+1+ie)/Z,se={features:[]};return this._addTileFeatures(V.range((P-ie)/Z,L,(P+1+ie)/Z,H),V.points,P,B,Z,se),P===0&&this._addTileFeatures(V.range(1-ie/Z,L,1,H),V.points,Z,B,Z,se),P===Z-1&&this._addTileFeatures(V.range(0,L,ie/Z,H),V.points,-1,B,Z,se),se.features.length?se:null},Or.prototype.getClusterExpansionZoom=function(T){for(var P=this._getOriginZoom(T)-1;P<=this.options.maxZoom;){var B=this.getChildren(T);if(P++,B.length!==1)break;T=B[0].properties.cluster_id}return P},Or.prototype._appendLeaves=function(T,P,B,V,Z){for(var re=0,ie=this.getChildren(P);re<ie.length;re+=1){var L=ie[re],H=L.properties;if(H&&H.cluster?Z+H.point_count<=V?Z+=H.point_count:Z=this._appendLeaves(T,H.cluster_id,B,V,Z):Z<V?Z++:T.push(L),T.length===B)break}return Z},Or.prototype._addTileFeatures=function(T,P,B,V,Z,re){for(var ie=0,L=T;ie<L.length;ie+=1){var H=P[L[ie]],se=H.numPoints,Se={type:1,geometry:[[Math.round(this.options.extent*(H.x*Z-B)),Math.round(this.options.extent*(H.y*Z-V))]],tags:se?ar(H):this.points[H.index].properties},Ee=void 0;se?Ee=H.id:this.options.generateId?Ee=H.index:this.points[H.index].id&&(Ee=this.points[H.index].id),Ee!==void 0&&(Se.id=Ee),re.features.push(Se)}},Or.prototype._limitZoom=function(T){return Math.max(this.options.minZoom,Math.min(+T,this.options.maxZoom+1))},Or.prototype._cluster=function(T,P){for(var B=[],V=this.options,Z=V.reduce,re=V.minPoints,ie=V.radius/(V.extent*Math.pow(2,P)),L=0;L<T.length;L++){var H=T[L];if(!(H.zoom<=P)){H.zoom=P;for(var se=this.trees[P+1],Se=se.within(H.x,H.y,ie),Ee=H.numPoints||1,me=Ee,Ae=0,Je=Se;Ae<Je.length;Ae+=1){var Ze=se.points[Je[Ae]];Ze.zoom>P&&(me+=Ze.numPoints||1)}if(me>=re){for(var ge=H.x*Ee,Ne=H.y*Ee,ze=Z&&Ee>1?this._map(H,!0):null,Be=(L<<5)+(P+1)+this.points.length,yt=0,qe=Se;yt<qe.length;yt+=1){var Et=se.points[qe[yt]];if(!(Et.zoom<=P)){Et.zoom=P;var rr=Et.numPoints||1;ge+=Et.x*rr,Ne+=Et.y*rr,Et.parentId=Be,Z&&(ze||(ze=this._map(H,!0)),Z(ze,this._map(Et)))}}H.parentId=Be,B.push(Xi(ge/me,Ne/me,Be,me,ze))}else if(B.push(H),me>1)for(var Pt=0,Gt=Se;Pt<Gt.length;Pt+=1){var Dt=se.points[Gt[Pt]];Dt.zoom<=P||(Dt.zoom=P,B.push(Dt))}}}return B},Or.prototype._getOriginId=function(T){return T-this.points.length>>5},Or.prototype._getOriginZoom=function(T){return(T-this.points.length)%32},Or.prototype._map=function(T,P){if(T.numPoints)return P?mr({},T.properties):T.properties;var B=this.points[T.index].properties,V=this.options.map(B);return P&&V===B?mr({},V):V},_t.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_t.prototype.splitTile=function(T,P,B,V,Z,re,ie){for(var L=[T,P,B,V],H=this.options,se=H.debug;L.length;){V=L.pop(),B=L.pop(),P=L.pop(),T=L.pop();var Se=1<<P,Ee=fi(P,B,V),me=this.tiles[Ee];if(!me&&(se>1&&console.time("creation"),me=this.tiles[Ee]=jt(T,P,B,V,H),this.tileCoords.push({z:P,x:B,y:V}),se)){se>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,B,V,me.numFeatures,me.numPoints,me.numSimplified),console.timeEnd("creation"));var Ae="z"+P;this.stats[Ae]=(this.stats[Ae]||0)+1,this.total++}if(me.source=T,Z){if(P===H.maxZoom||P===Z)continue;var Je=1<<Z-P;if(B!==Math.floor(re/Je)||V!==Math.floor(ie/Je))continue}else if(P===H.indexMaxZoom||me.numPoints<=H.indexMaxPoints)continue;if(me.source=null,T.length!==0){se>1&&console.time("clipping");var Ze,ge,Ne,ze,Be,yt,qe=.5*H.buffer/H.extent,Et=.5-qe,rr=.5+qe,Pt=1+qe;Ze=ge=Ne=ze=null,Be=Ki(T,Se,B-qe,B+rr,0,me.minX,me.maxX,H),yt=Ki(T,Se,B+Et,B+Pt,0,me.minX,me.maxX,H),T=null,Be&&(Ze=Ki(Be,Se,V-qe,V+rr,1,me.minY,me.maxY,H),ge=Ki(Be,Se,V+Et,V+Pt,1,me.minY,me.maxY,H),Be=null),yt&&(Ne=Ki(yt,Se,V-qe,V+rr,1,me.minY,me.maxY,H),ze=Ki(yt,Se,V+Et,V+Pt,1,me.minY,me.maxY,H),yt=null),se>1&&console.timeEnd("clipping"),L.push(Ze||[],P+1,2*B,2*V),L.push(ge||[],P+1,2*B,2*V+1),L.push(Ne||[],P+1,2*B+1,2*V),L.push(ze||[],P+1,2*B+1,2*V+1)}}},_t.prototype.getTile=function(T,P,B){var V=this.options,Z=V.extent,re=V.debug;if(T<0||T>24)return null;var ie=1<<T,L=fi(T,P=(P%ie+ie)%ie,B);if(this.tiles[L])return fe(this.tiles[L],Z);re>1&&console.log("drilling down to z%d-%d-%d",T,P,B);for(var H,se=T,Se=P,Ee=B;!H&&se>0;)se--,Se=Math.floor(Se/2),Ee=Math.floor(Ee/2),H=this.tiles[fi(se,Se,Ee)];return H&&H.source?(re>1&&console.log("found parent tile z%d-%d-%d",se,Se,Ee),re>1&&console.time("drilling down"),this.splitTile(H.source,se,Se,Ee,T,P,B),re>1&&console.timeEnd("drilling down"),this.tiles[L]?fe(this.tiles[L],Z):null):null};var ii=(function(T){function P(B,V,Z,re){T.call(this,B,V,Z,qi),re&&(this.loadGeoJSON=re)}return T&&(P.__proto__=T),(P.prototype=Object.create(T&&T.prototype)).constructor=P,P.prototype.loadData=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=V,this._pendingLoadDataParams=B,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},P.prototype._loadData=function(){var B=this;if(this._pendingCallback&&this._pendingLoadDataParams){var V=this._pendingCallback,Z=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var re=!!(Z&&Z.request&&Z.request.collectResourceTiming)&&new u.RequestPerformance(Z.request);this.loadGeoJSON(Z,(function(ie,L){if(ie||!L)return V(ie);if(typeof L!="object")return V(new Error("Input data given to '"+Z.source+"' is not a valid GeoJSON object."));(function me(Ae,Je){var Ze,ge=Ae&&Ae.type;if(ge==="FeatureCollection")for(Ze=0;Ze<Ae.features.length;Ze++)me(Ae.features[Ze],Je);else if(ge==="GeometryCollection")for(Ze=0;Ze<Ae.geometries.length;Ze++)me(Ae.geometries[Ze],Je);else if(ge==="Feature")me(Ae.geometry,Je);else if(ge==="Polygon")Ve(Ae.coordinates,Je);else if(ge==="MultiPolygon")for(Ze=0;Ze<Ae.coordinates.length;Ze++)Ve(Ae.coordinates[Ze],Je);return Ae})(L,!0);try{if(Z.filter){var H=u.createExpression(Z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(H.result==="error")throw new Error(H.value.map((function(me){return me.key+": "+me.message})).join(", "));var se=L.features.filter((function(me){return H.value.evaluate({zoom:0},me)}));L={type:"FeatureCollection",features:se}}B._geoJSONIndex=Z.cluster?new Or((function(me){var Ae=me.superclusterOptions,Je=me.clusterProperties;if(!Je||!Ae)return Ae;for(var Ze={},ge={},Ne={accumulated:null,zoom:0},ze={properties:null},Be=Object.keys(Je),yt=0,qe=Be;yt<qe.length;yt+=1){var Et=qe[yt],rr=Je[Et],Pt=rr[0],Gt=u.createExpression(rr[1]),Dt=u.createExpression(typeof Pt=="string"?[Pt,["accumulated"],["get",Et]]:Pt);Ze[Et]=Gt.value,ge[Et]=Dt.value}return Ae.map=function(wi){ze.properties=wi;for(var Ht={},Pr=0,Qt=Be;Pr<Qt.length;Pr+=1){var Bt=Qt[Pr];Ht[Bt]=Ze[Bt].evaluate(Ne,ze)}return Ht},Ae.reduce=function(wi,Ht){ze.properties=Ht;for(var Pr=0,Qt=Be;Pr<Qt.length;Pr+=1){var Bt=Qt[Pr];Ne.accumulated=wi[Bt],wi[Bt]=ge[Bt].evaluate(Ne,ze)}},Ae})(Z)).load(L.features):(function(me,Ae){return new _t(me,Ae)})(L,Z.geojsonVtOptions)}catch(me){return V(me)}B.loaded={};var Se={};if(re){var Ee=re.finish();Ee&&(Se.resourceTiming={},Se.resourceTiming[Z.source]=JSON.parse(JSON.stringify(Ee)))}V(null,Se)}))}},P.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},P.prototype.reloadTile=function(B,V){var Z=this.loaded;return Z&&Z[B.uid]?T.prototype.reloadTile.call(this,B,V):this.loadTile(B,V)},P.prototype.loadGeoJSON=function(B,V){if(B.request)u.getJSON(B.request,V);else{if(typeof B.data!="string")return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."));try{return V(null,JSON.parse(B.data))}catch{return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."))}}},P.prototype.removeSource=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),V()},P.prototype.getClusterExpansionZoom=function(B,V){try{V(null,this._geoJSONIndex.getClusterExpansionZoom(B.clusterId))}catch(Z){V(Z)}},P.prototype.getClusterChildren=function(B,V){try{V(null,this._geoJSONIndex.getChildren(B.clusterId))}catch(Z){V(Z)}},P.prototype.getClusterLeaves=function(B,V){try{V(null,this._geoJSONIndex.getLeaves(B.clusterId,B.limit,B.offset))}catch(Z){V(Z)}},P})(be),Yt=function(T){var P=this;this.self=T,this.actor=new u.Actor(T,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:be,geojson:ii},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(B,V){if(P.workerSourceTypes[B])throw new Error('Worker source with name "'+B+'" already registered.');P.workerSourceTypes[B]=V},this.self.registerRTLTextPlugin=function(B){if(u.plugin.isParsed())throw new Error("RTL text plugin already registered.");u.plugin.applyArabicShaping=B.applyArabicShaping,u.plugin.processBidirectionalText=B.processBidirectionalText,u.plugin.processStyledBidirectionalText=B.processStyledBidirectionalText}};return Yt.prototype.setReferrer=function(T,P){this.referrer=P},Yt.prototype.setImages=function(T,P,B){for(var V in this.availableImages[T]=P,this.workerSources[T]){var Z=this.workerSources[T][V];for(var re in Z)Z[re].availableImages=P}B()},Yt.prototype.setLayers=function(T,P,B){this.getLayerIndex(T).replace(P),B()},Yt.prototype.updateLayers=function(T,P,B){this.getLayerIndex(T).update(P.layers,P.removedIds),B()},Yt.prototype.loadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).loadTile(P,B)},Yt.prototype.loadDEMTile=function(T,P,B){this.getDEMWorkerSource(T,P.source).loadTile(P,B)},Yt.prototype.reloadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).reloadTile(P,B)},Yt.prototype.abortTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).abortTile(P,B)},Yt.prototype.removeTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).removeTile(P,B)},Yt.prototype.removeDEMTile=function(T,P){this.getDEMWorkerSource(T,P.source).removeTile(P)},Yt.prototype.removeSource=function(T,P,B){if(this.workerSources[T]&&this.workerSources[T][P.type]&&this.workerSources[T][P.type][P.source]){var V=this.workerSources[T][P.type][P.source];delete this.workerSources[T][P.type][P.source],V.removeSource!==void 0?V.removeSource(P,B):B()}},Yt.prototype.loadWorkerSource=function(T,P,B){try{this.self.importScripts(P.url),B()}catch(V){B(V.toString())}},Yt.prototype.syncRTLPluginState=function(T,P,B){try{u.plugin.setState(P);var V=u.plugin.getPluginURL();if(u.plugin.isLoaded()&&!u.plugin.isParsed()&&V!=null){this.self.importScripts(V);var Z=u.plugin.isParsed();B(Z?void 0:new Error("RTL Text Plugin failed to import scripts from "+V),Z)}}catch(re){B(re.toString())}},Yt.prototype.getAvailableImages=function(T){var P=this.availableImages[T];return P||(P=[]),P},Yt.prototype.getLayerIndex=function(T){var P=this.layerIndexes[T];return P||(P=this.layerIndexes[T]=new J),P},Yt.prototype.getWorkerSource=function(T,P,B){var V=this;return this.workerSources[T]||(this.workerSources[T]={}),this.workerSources[T][P]||(this.workerSources[T][P]={}),this.workerSources[T][P][B]||(this.workerSources[T][P][B]=new this.workerSourceTypes[P]({send:function(Z,re,ie){V.actor.send(Z,re,ie,T)}},this.getLayerIndex(T),this.getAvailableImages(T))),this.workerSources[T][P][B]},Yt.prototype.getDEMWorkerSource=function(T,P){return this.demWorkerSources[T]||(this.demWorkerSources[T]={}),this.demWorkerSources[T][P]||(this.demWorkerSources[T][P]=new Oe),this.demWorkerSources[T][P]},Yt.prototype.enforceCacheSizeLimit=function(T,P){u.enforceCacheSizeLimit(P)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Yt(self)),Yt})),R(["./shared"],(function(u){var U=u.createCommonjsModule((function(i){function o(p){return!n(p)}function n(p){return typeof window>"u"||typeof document>"u"?"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 d,v,w=new Blob([""],{type:"text/javascript"}),A=URL.createObjectURL(w);try{v=new Worker(A),d=!0}catch{d=!1}return v&&v.terminate(),URL.revokeObjectURL(A),d})()?"Uint8ClampedArray"in window?ArrayBuffer.isView?(function(){var d=document.createElement("canvas");d.width=d.height=1;var v=d.getContext("2d");if(!v)return!1;var w=v.getImageData(0,0,1,1);return w&&w.width===d.width})()?(s[f=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[f]=(function(d){var v=(function(A){var D=document.createElement("canvas"),F=Object.create(o.webGLContextAttributes);return F.failIfMajorPerformanceCaveat=A,D.probablySupportsContext?D.probablySupportsContext("webgl",F)||D.probablySupportsContext("experimental-webgl",F):D.supportsContext?D.supportsContext("webgl",F)||D.supportsContext("experimental-webgl",F):D.getContext("webgl",F)||D.getContext("experimental-webgl",F)})(d);if(!v)return!1;var w=v.createShader(v.VERTEX_SHADER);return!(!w||v.isContextLost())&&(v.shaderSource(w,"void main() {}"),v.compileShader(w),v.getShaderParameter(w,v.COMPILE_STATUS)===!0)})(f)),s[f]?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 f}i.exports?i.exports=o:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=o,window.mapboxgl.notSupportedReason=n);var s={};o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),k={create:function(i,o,n){var s=u.window.document.createElement(i);return o!==void 0&&(s.className=o),n&&n.appendChild(s),s},createNS:function(i,o){return u.window.document.createElementNS(i,o)}},J=u.window.document&&u.window.document.documentElement.style;function X(i){if(!J)return i[0];for(var o=0;o<i.length;o++)if(i[o]in J)return i[o];return i[0]}var ae,Y=X(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);k.disableDrag=function(){J&&Y&&(ae=J[Y],J[Y]="none")},k.enableDrag=function(){J&&Y&&(J[Y]=ae)};var Te=X(["transform","WebkitTransform"]);k.setTransform=function(i,o){i.style[Te]=o};var be=!1;try{var ke=Object.defineProperty({},"passive",{get:function(){be=!0}});u.window.addEventListener("test",ke,ke),u.window.removeEventListener("test",ke,ke)}catch{be=!1}k.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&be?s:s.capture)},k.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&be?s:s.capture)};var Oe=function(i){i.preventDefault(),i.stopPropagation(),u.window.removeEventListener("click",Oe,!0)};function Ve(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}k.suppressClick=function(){u.window.addEventListener("click",Oe,!0),u.window.setTimeout((function(){u.window.removeEventListener("click",Oe,!0)}),0)},k.mousePos=function(i,o){var n=i.getBoundingClientRect();return new u.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},k.touchPos=function(i,o){for(var n=i.getBoundingClientRect(),s=[],p=0;p<o.length;p++)s.push(new u.Point(o[p].clientX-n.left-i.clientLeft,o[p].clientY-n.top-i.clientTop));return s},k.mouseButton=function(i){return u.window.InstallTrigger!==void 0&&i.button===2&&i.ctrlKey&&u.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:i.button},k.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var Re=(function(i){function o(){i.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.RGBAImage({width:1,height:1}),this.dirty=!0}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.isLoaded=function(){return this.loaded},o.prototype.setLoaded=function(n){if(this.loaded!==n&&(this.loaded=n,n)){for(var s=0,p=this.requestors;s<p.length;s+=1){var f=p[s];this._notify(f.ids,f.callback)}this.requestors=[]}},o.prototype.getImage=function(n){return this.images[n]},o.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},o.prototype._validate=function(n,s){var p=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchX" value'))),p=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchY" value'))),p=!1),this._validateContent(s.content,s)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "content" value'))),p=!1),p},o.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,f=0,d=n;f<d.length;f+=1){var v=d[f];if(v[0]<p||v[1]<v[0]||s<v[1])return!1;p=v[1]}return!0},o.prototype._validateContent=function(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))},o.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},o.prototype.removeImage=function(n){var s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()},o.prototype.listImages=function(){return Object.keys(this.images)},o.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var f=0,d=n;f<d.length;f+=1)this.images[d[f]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},o.prototype._notify=function(n,s){for(var p={},f=0,d=n;f<d.length;f+=1){var v=d[f];this.images[v]||this.fire(new u.Event("styleimagemissing",{id:v}));var w=this.images[v];w?p[v]={data:w.data.clone(),pixelRatio:w.pixelRatio,sdf:w.sdf,version:w.version,stretchX:w.stretchX,stretchY:w.stretchY,content:w.content,hasRenderCallback:!!(w.userImage&&w.userImage.render)}:u.warnOnce('Image "'+v+'" 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.')}s(null,p)},o.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},o.prototype.getPattern=function(n){var s=this.patterns[n],p=this.getImage(n);if(!p)return null;if(s&&s.position.version===p.version)return s.position;if(s)s.position.version=p.version;else{var f={w:p.data.width+2,h:p.data.height+2,x:0,y:0},d=new u.ImagePosition(f,p);this.patterns[n]={bin:f,position:d}}return this._updatePatternAtlas(),this.patterns[n].position},o.prototype.bind=function(n){var s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)},o.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=u.potpack(n),f=p.w,d=p.h,v=this.atlasImage;for(var w in v.resize({width:f||1,height:d||1}),this.patterns){var A=this.patterns[w].bin,D=A.x+1,F=A.y+1,O=this.images[w].data,W=O.width,$=O.height;u.RGBAImage.copy(O,v,{x:0,y:0},{x:D,y:F},{width:W,height:$}),u.RGBAImage.copy(O,v,{x:0,y:$-1},{x:D,y:F-1},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:D,y:F+$},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:W-1,y:0},{x:D-1,y:F},{width:1,height:$}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:D+W,y:F},{width:1,height:$})}this.dirty=!0},o.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},o.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var f=p[s];if(!this.callbackDispatchedThisFrame[f]){this.callbackDispatchedThisFrame[f]=!0;var d=this.images[f];Ve(d)&&this.updateImage(f,d)}}},o})(u.Evented),ve=It,Ke=It,We=1e20;function It(i,o,n,s,p,f){this.fontSize=i||24,this.buffer=o===void 0?3:o,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=f||"normal",this.radius=n||8;var d=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=d,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(d*d),this.gridInner=new Float64Array(d*d),this.f=new Float64Array(d),this.d=new Float64Array(d),this.z=new Float64Array(d+1),this.v=new Int16Array(d),this.middle=Math.round(d/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function we(i,o,n,s,p,f,d){for(var v=0;v<o;v++){for(var w=0;w<n;w++)s[w]=i[w*o+v];for(Ge(s,p,f,d,n),w=0;w<n;w++)i[w*o+v]=p[w]}for(w=0;w<n;w++){for(v=0;v<o;v++)s[v]=i[w*o+v];for(Ge(s,p,f,d,o),v=0;v<o;v++)i[w*o+v]=Math.sqrt(p[v])}}function Ge(i,o,n,s,p){n[0]=0,s[0]=-We,s[1]=+We;for(var f=1,d=0;f<p;f++){for(var v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);v<=s[d];)d--,v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);n[++d]=f,s[d]=v,s[d+1]=+We}for(f=0,d=0;f<p;f++){for(;s[d+1]<f;)d++;o[f]=(f-n[d])*(f-n[d])+i[n[d]]}}It.prototype.draw=function(i){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(i,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),s=0;s<this.size*this.size;s++){var p=o.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?We:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?We:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(we(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),we(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),s=0;s<this.size*this.size;s++)n[s]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[s]-this.gridInner[s])/this.radius+this.cutoff))));return n},ve.default=Ke;var Fe=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};Fe.prototype.setURL=function(i){this.url=i},Fe.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var f=0,d=i[p];f<d.length;f+=1)s.push({stack:p,id:d[f]});u.asyncAll(s,(function(v,w){var A=v.stack,D=v.id,F=n.entries[A];F||(F=n.entries[A]={glyphs:{},requests:{},ranges:{}});var O=F.glyphs[D];if(O===void 0){if(O=n._tinySDF(F,A,D))return F.glyphs[D]=O,void w(null,{stack:A,id:D,glyph:O});var W=Math.floor(D/256);if(256*W>65535)w(new Error("glyphs > 65535 not supported"));else if(F.ranges[W])w(null,{stack:A,id:D,glyph:O});else{var $=F.requests[W];$||($=F.requests[W]=[],Fe.loadGlyphRange(A,W,n.url,n.requestManager,(function(ee,N){if(N){for(var Q in N)n._doesCharSupportLocalGlyph(+Q)||(F.glyphs[+Q]=N[+Q]);F.ranges[W]=!0}for(var ne=0,ue=$;ne<ue.length;ne+=1)(0,ue[ne])(ee,N);delete F.requests[W]}))),$.push((function(ee,N){ee?w(ee):N&&w(null,{stack:A,id:D,glyph:N[D]||null})}))}}else w(null,{stack:A,id:D,glyph:O})}),(function(v,w){if(v)o(v);else if(w){for(var A={},D=0,F=w;D<F.length;D+=1){var O=F[D],W=O.stack,$=O.id,ee=O.glyph;(A[W]||(A[W]={}))[$]=ee&&{id:ee.id,bitmap:ee.bitmap.clone(),metrics:ee.metrics}}o(null,A)}}))},Fe.prototype._doesCharSupportLocalGlyph=function(i){return!!this.localIdeographFontFamily&&(u.isChar["CJK Unified Ideographs"](i)||u.isChar["Hangul Syllables"](i)||u.isChar.Hiragana(i)||u.isChar.Katakana(i))},Fe.prototype._tinySDF=function(i,o,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var f="400";/bold/i.test(o)?f="900":/medium/i.test(o)?f="500":/light/i.test(o)&&(f="200"),p=i.tinySDF=new Fe.TinySDF(24,3,8,.25,s,f)}return{id:n,bitmap:new u.AlphaImage({width:30,height:30},p.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},Fe.loadGlyphRange=function(i,o,n,s,p){var f=256*o,d=f+255,v=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",f+"-"+d),u.ResourceType.Glyphs);u.getArrayBuffer(v,(function(w,A){if(w)p(w);else if(A){for(var D={},F=0,O=u.parseGlyphPBF(A);F<O.length;F+=1){var W=O[F];D[W.id]=W}p(null,D)}}))},Fe.TinySDF=ve;var tt=function(){this.specification=u.styleSpec.light.position};tt.prototype.possiblyEvaluate=function(i,o){return u.sphericalToCartesian(i.expression.evaluate(o))},tt.prototype.interpolate=function(i,o,n){return{x:u.number(i.x,o.x,n),y:u.number(i.y,o.y,n),z:u.number(i.z,o.z,n)}};var kt=new u.Properties({anchor:new u.DataConstantProperty(u.styleSpec.light.anchor),position:new tt,color:new u.DataConstantProperty(u.styleSpec.light.color),intensity:new u.DataConstantProperty(u.styleSpec.light.intensity)}),Wt=(function(i){function o(n){i.call(this),this._transitionable=new u.Transitionable(kt),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getLight=function(){return this._transitionable.serialize()},o.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(u.validateLight,n,s))for(var p in n){var f=n[p];u.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),f):this._transitionable.setValue(p,f)}},o.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},o.prototype.hasTransition=function(){return this._transitioning.hasTransition()},o.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},o.prototype._validate=function(n,s,p){return(!p||p.validate!==!1)&&u.emitValidationErrors(this,n.call(u.validateStyle,u.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:u.styleSpec})))},o})(u.Evented),St=function(i,o){this.width=i,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};St.prototype.getDash=function(i,o){var n=i.join(",")+String(o);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,o)),this.dashEntry[n]},St.prototype.getDashRanges=function(i,o,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,f=i[0]*n,d=!0;s.push({left:p,right:f,isDash:d,zeroLength:i[0]===0});for(var v=i[0],w=1;w<i.length;w++){var A=i[w];s.push({left:p=v*n,right:f=(v+=A)*n,isDash:d=!d,zeroLength:A===0})}return s},St.prototype.addRoundDash=function(i,o,n){for(var s=o/2,p=-n;p<=n;p++)for(var f=this.width*(this.nextRow+n+p),d=0,v=i[d],w=0;w<this.width;w++){w/v.right>1&&(v=i[++d]);var A=Math.abs(w-v.left),D=Math.abs(w-v.right),F=Math.min(A,D),O=void 0,W=p/n*(s+1);if(v.isDash){var $=s-Math.abs(W);O=Math.sqrt(F*F+$*$)}else O=s-Math.sqrt(F*F+W*W);this.data[f+w]=Math.max(0,Math.min(255,O+128))}},St.prototype.addRegularDash=function(i){for(var o=i.length-1;o>=0;--o){var n=i[o],s=i[o+1];n.zeroLength?i.splice(o,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(o,1))}var p=i[0],f=i[i.length-1];p.isDash===f.isDash&&(p.left=f.left-this.width,f.right=p.right+this.width);for(var d=this.width*this.nextRow,v=0,w=i[v],A=0;A<this.width;A++){A/w.right>1&&(w=i[++v]);var D=Math.abs(A-w.left),F=Math.abs(A-w.right),O=Math.min(D,F);this.data[d+A]=Math.max(0,Math.min(255,(w.isDash?O:-O)+128))}},St.prototype.addDash=function(i,o){var n=o?7:0,s=2*n+1;if(this.nextRow+s>this.height)return u.warnOnce("LineAtlas out of space"),null;for(var p=0,f=0;f<i.length;f++)p+=i[f];if(p!==0){var d=this.width/p,v=this.getDashRanges(i,this.width,d);o?this.addRoundDash(v,d,n):this.addRegularDash(v)}var w={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,w},St.prototype.bind=function(i){var o=i.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))};var Ut=function i(o,n){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=u.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var f=new i.Actor(s[p],n,this.id);f.name="Worker "+p,this.actors.push(f)}};function Hr(i,o,n){var s=function(p,f){if(p)return n(p);if(f){var d=u.pick(u.extend(f,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);f.vector_layers&&(d.vectorLayers=f.vector_layers,d.vectorLayerIds=d.vectorLayers.map((function(v){return v.id}))),d.tiles=o.canonicalizeTileset(d,i.url),n(null,d)}};return i.url?u.getJSON(o.transformRequest(o.normalizeSourceURL(i.url),u.ResourceType.Source),s):u.browser.frame((function(){return s(null,i)}))}Ut.prototype.broadcast=function(i,o,n){u.asyncAll(this.actors,(function(s,p){s.send(i,o,p)}),n=n||function(){})},Ut.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Ut.prototype.remove=function(){this.actors.forEach((function(i){i.remove()})),this.actors=[],this.workerPool.release(this.id)},Ut.Actor=u.Actor;var Er=function(i,o,n){this.bounds=u.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=o||0,this.maxzoom=n||24};Er.prototype.validateBounds=function(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]},Er.prototype.contains=function(i){var o=Math.pow(2,i.z),n=Math.floor(u.mercatorXfromLng(this.bounds.getWest())*o),s=Math.floor(u.mercatorYfromLat(this.bounds.getNorth())*o),p=Math.ceil(u.mercatorXfromLng(this.bounds.getEast())*o),f=Math.ceil(u.mercatorYfromLat(this.bounds.getSouth())*o);return i.x>=n&&i.x<p&&i.y>=s&&i.y<f};var bi=(function(i){function o(n,s,p,f){if(i.call(this),this.id=n,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.extend(this,u.pick(s,["url","scheme","tileSize","promoteId"])),this._options=u.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Er(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles,n.map._requestManager._customAccessToken),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken,n.map._requestManager._customAccessToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},o.prototype.setTiles=function(n){var s=this;return this.setSourceProperty((function(){s._options.tiles=n})),this},o.prototype.setUrl=function(n){var s=this;return this.setSourceProperty((function(){s.url=n,s._options.url=n})),this},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),f={request:this.map._requestManager.transformRequest(p,u.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(v,w){return delete n.request,n.aborted?s(null):v&&v.status!==404?s(v):(w&&w.resourceTiming&&(n.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&n.setExpiryData(w),n.loadVectorData(w,this.map.painter),u.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}f.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",f,d.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",f,d.bind(this)))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.hasTransition=function(){return!1},o})(u.Evented),or=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(f),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.extend({type:"raster"},s),u.extend(this,u.pick(s,["url","scheme","tileSize"]))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Er(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.loadTile=function(n,s){var p=this,f=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=u.getImage(this.map._requestManager.transformRequest(f,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){p.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=p.map.painter.context,A=w.gl;n.texture=p.map.painter.getTileTexture(v.width),n.texture?n.texture.update(v,{useMipmap:!0}):(n.texture=new u.Texture(w,v,A.RGBA,{useMipmap:!0}),n.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.extTextureFilterAnisotropicMax)),n.state="loaded",u.cacheEntryPossiblyAdded(p.dispatcher),s(null)}}))},o.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},o.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Rr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.type="raster-dem",this.maxzoom=22,this._options=u.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function f(d,v){d&&(n.state="errored",s(d)),v&&(n.dem=v,n.needsHillshadePrepare=!0,n.state="loaded",s(null))}n.request=u.getImage(this.map._requestManager.transformRequest(p,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){this.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=u.window.ImageBitmap&&v instanceof u.window.ImageBitmap&&u.offscreenCanvasSupported()?v:u.browser.getImageData(v,1),A={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:w,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",A,f.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},o.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),f=(s.x-1+p)%p,d=s.x===0?n.wrap-1:n.wrap,v=(s.x+1+p)%p,w=s.x+1===p?n.wrap+1:n.wrap,A={};return A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y).key]={backfilled:!1},s.y>0&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y-1).key]={backfilled:!1}),s.y+1<p&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y+1).key]={backfilled:!1}),A},o.prototype.unloadTile=function(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})},o})(or),et=(function(i){function o(n,s,p,f){i.call(this),this.id=n,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=p.getActor(),this.setEventedParent(f),this._data=s.data,this._options=u.extend({},s),this._collectResourceTiming=s.collectResourceTiming,this._resourceTiming=[],s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;var d=u.EXTENT/this.tileSize;this.workerOptions=u.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*d,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*d,extent:u.EXTENT,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?Math.min(s.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:u.EXTENT,radius:(s.clusterRadius||50)*d,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(s){if(s)n.fire(new u.ErrorEvent(s));else{var p={dataType:"source",sourceDataType:"metadata"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(p.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new u.Event("data",p))}}))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setData=function(n){var s=this;return this._data=n,this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(p){if(p)s.fire(new u.ErrorEvent(p));else{var f={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(f.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new u.Event("data",f))}})),this},o.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},o.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},o.prototype.getClusterLeaves=function(n,s,p,f){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},f),this},o.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=u.extend({},this.workerOptions),f=this._data;typeof f=="string"?(p.request=this.map._requestManager.transformRequest(u.browser.resolveURL(f),u.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(f),this.actor.send(this.type+".loadData",p,(function(d,v){s._removed||v&&v.abandoned||(s._loaded=!0,v&&v.resourceTiming&&v.resourceTiming[s.id]&&(s._resourceTiming=v.resourceTiming[s.id].slice(0)),s.actor.send(s.type+".coalesce",{source:p.source},null),n(d))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.loadTile=function(n,s){var p=this,f=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(f,{type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(d,v){return delete n.request,n.unloadVectorData(),n.aborted?s(null):d?s(d):(n.loadVectorData(v,p.map.painter,f==="reloadTile"),s(null))}))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},o.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},o.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},o.prototype.serialize=function(){return u.extend({},this._options,{type:this.type,data:this._data})},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Lr=u.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Xr=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(f),this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(n,s){var p=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this.url=this.options.url,u.getImage(this.map._requestManager.transformRequest(this.url,u.ResourceType.Image),(function(f,d){p._loaded=!0,f?p.fire(new u.ErrorEvent(f)):d&&(p.image=d,n&&(p.coordinates=n),s&&s(),p._finishLoading())}))},o.prototype.loaded=function(){return this._loaded},o.prototype.updateImage=function(n){var s=this;return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,(function(){s.texture=null})),this):this},o.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setCoordinates=function(n){var s=this;this.coordinates=n;var p=n.map(u.MercatorCoordinate.fromLngLat);this.tileID=(function(d){for(var v=1/0,w=1/0,A=-1/0,D=-1/0,F=0,O=d;F<O.length;F+=1){var W=O[F];v=Math.min(v,W.x),w=Math.min(w,W.y),A=Math.max(A,W.x),D=Math.max(D,W.y)}var $=Math.max(A-v,D-w),ee=Math.max(0,Math.floor(-Math.log($)/Math.LN2)),N=Math.pow(2,ee);return new u.CanonicalTileID(ee,Math.floor((v+A)/2*N),Math.floor((w+D)/2*N))})(p),this.minzoom=this.maxzoom=this.tileID.z;var f=p.map((function(d){return s.tileID.getTilePoint(d)._round()}));return this._boundsArray=new u.StructArrayLayout4i8,this._boundsArray.emplaceBack(f[0].x,f[0].y,0,0),this._boundsArray.emplaceBack(f[1].x,f[1].y,u.EXTENT,0),this._boundsArray.emplaceBack(f[3].x,f[3].y,0,u.EXTENT),this._boundsArray.emplaceBack(f[2].x,f[2].y,u.EXTENT,u.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})),this},o.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.loadTile=function(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))},o.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return!1},o})(u.Evented),At=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.roundZoom=!0,this.type="video",this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,f=s.urls;p<f.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(f[p],u.ResourceType.Source).url);u.getVideo(this.urls,(function(d,v){n._loaded=!0,d?n.fire(new u.ErrorEvent(d)):v&&(n.video=v,n.video.loop=!0,n.video.setAttribute("playsinline",""),n.video.addEventListener("playing",(function(){n.map.triggerRepaint()})),n.map&&n.video.play(),n._finishLoading())}))},o.prototype.pause=function(){this.video&&this.video.pause()},o.prototype.play=function(){this.video&&this.video.play()},o.prototype.seek=function(n){if(this.video){var s=this.video.seekable;n<s.start(0)||n>s.end(0)?this.fire(new u.ErrorEvent(new u.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+s.start(0)+" and "+s.end(0)+"-second mark."))):this.video.currentTime=n}},o.prototype.getVideo=function(){return this.video},o.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},o.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new u.Texture(n,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this.video&&!this.video.paused},o})(Xr),Fr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some((function(d){return!Array.isArray(d)||d.length!==2||d.some((function(v){return typeof v!="number"}))}))||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof u.window.HTMLCanvasElement||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,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 u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof u.window.HTMLCanvasElement?this.options.canvas:u.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new u.ErrorEvent(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())},o.prototype.getCanvas=function(){return this.canvas},o.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},o.prototype.onRemove=function(){this.pause()},o.prototype.prepare=function(){var n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var s=this.map.painter.context,p=s.gl;for(var f in this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u.Texture(s,this.canvas,p.RGBA,{premultiply:!0}),this.tiles){var d=this.tiles[f];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this._playing},o.prototype._hasInvalidDimensions=function(){for(var n=0,s=[this.canvas.width,this.canvas.height];n<s.length;n+=1){var p=s[n];if(isNaN(p)||p<=0)return!0}return!1},o})(Xr),Mi={vector:bi,raster:or,"raster-dem":Rr,geojson:et,video:At,image:Xr,canvas:Fr};function pi(i,o){var n=u.identity([]);return u.translate(n,n,[1,1,0]),u.scale(n,n,[.5*i.width,.5*i.height,1]),u.multiply(n,n,i.calculatePosMatrix(o.toUnwrapped()))}function Or(i,o,n,s,p,f){var d=(function(ee,N,Q){if(ee)for(var ne=0,ue=ee;ne<ue.length;ne+=1){var de=N[ue[ne]];if(de&&de.source===Q&&de.type==="fill-extrusion")return!0}else for(var pe in N){var ye=N[pe];if(ye.source===Q&&ye.type==="fill-extrusion")return!0}return!1})(p&&p.layers,o,i.id),v=f.maxPitchScaleFactor(),w=i.tilesIn(s,v,d);w.sort(Xi);for(var A=[],D=0,F=w;D<F.length;D+=1){var O=F[D];A.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,n,i._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,p,f,v,pi(i.transform,O.tileID))})}var W=(function(ee){for(var N={},Q={},ne=0,ue=ee;ne<ue.length;ne+=1){var de=ue[ne],pe=de.queryResults,ye=de.wrappedTileID,Ie=Q[ye]=Q[ye]||{};for(var Me in pe)for(var Ce=pe[Me],$e=Ie[Me]=Ie[Me]||{},nt=N[Me]=N[Me]||[],ut=0,st=Ce;ut<st.length;ut+=1){var Lt=st[ut];$e[Lt.featureIndex]||($e[Lt.featureIndex]=!0,nt.push(Lt))}}return N})(A);for(var $ in W)W[$].forEach((function(ee){var N=ee.feature,Q=i.getFeatureState(N.layer["source-layer"],N.id);N.source=N.layer.source,N.layer["source-layer"]&&(N.sourceLayer=N.layer["source-layer"]),N.state=Q}));return W}function Xi(i,o){var n=i.tileID,s=o.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}var Nt=function(i,o){this.max=i,this.onRemove=o,this.reset()};Nt.prototype.reset=function(){for(var i in this.data)for(var o=0,n=this.data[i];o<n.length;o+=1){var s=n[o];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Nt.prototype.add=function(i,o,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var f={value:o,timeout:void 0};if(n!==void 0&&(f.timeout=setTimeout((function(){s.remove(i,f)}),n)),this.data[p].push(f),this.order.push(p),this.order.length>this.max){var d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this},Nt.prototype.has=function(i){return i.wrapped().key in this.data},Nt.prototype.getAndRemove=function(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null},Nt.prototype._getAndRemoveByKey=function(i){var o=this.data[i].shift();return o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),o.value},Nt.prototype.getByKey=function(i){var o=this.data[i];return o?o[0].value:null},Nt.prototype.get=function(i){return this.has(i)?this.data[i.wrapped().key][0].value:null},Nt.prototype.remove=function(i,o){if(!this.has(i))return this;var n=i.wrapped().key,s=o===void 0?0:this.data[n].indexOf(o),p=this.data[n][s];return this.data[n].splice(s,1),p.timeout&&clearTimeout(p.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(p.value),this.order.splice(this.order.indexOf(n),1),this},Nt.prototype.setMaxSize=function(i){for(this.max=i;this.order.length>this.max;){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Nt.prototype.filter=function(i){var o=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var f=p[s];i(f.value)||o.push(f)}for(var d=0,v=o;d<v.length;d+=1){var w=v[d];this.remove(w.value.tileID,w)}};var Nr=function(i,o,n){this.context=i;var s=i.gl;this.buffer=s.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Nr.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Nr.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Nr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var ar={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},sr=function(i,o,n,s){this.length=o.length,this.attributes=n,this.itemSize=o.bytesPerElement,this.dynamicDraw=s,this.context=i;var p=i.gl;this.buffer=p.createBuffer(),i.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};sr.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},sr.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},sr.prototype.enableAttributes=function(i,o){for(var n=0;n<this.attributes.length;n++){var s=o.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},sr.prototype.setVertexAttribPointers=function(i,o,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],f=o.attributes[p.name];f!==void 0&&i.vertexAttribPointer(f,p.components,i[ar[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},sr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var lt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};lt.prototype.get=function(){return this.current},lt.prototype.set=function(i){},lt.prototype.getDefault=function(){return this.default},lt.prototype.setDefault=function(){this.set(this.default)};var mr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),pr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 1},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},o})(lt),jr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},o})(lt),hr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[!0,!0,!0,!0]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),br=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},o})(lt),dn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 255},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},o})(lt),Kr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},o.prototype.set=function(n){var s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)},o})(lt),Bi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)},o})(lt),hi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}},o})(lt),ti=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[0,1]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),ri=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}},o})(lt),Vi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.LESS},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},o})(lt),Ki=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}},o})(lt),yo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),Zo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.FUNC_ADD},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},o})(lt),Mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}},o})(lt),Bn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.BACK},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},o})(lt),$o=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.CCW},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},o})(lt),jn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},o})(lt),zn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.TEXTURE0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},o})(lt),rn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),fe=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),_e=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),jt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}},o})(lt),tr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}},o})(lt),Kt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},o})(lt),_t=(function(i){function o(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},o})(lt),fi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 4},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}},o})(lt),qi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),ii=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),Yt=(function(i){function o(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o})(lt),T=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.setDirty=function(){this.dirty=!0},o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}},o})(Yt),P=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(Yt),B=function(i,o,n,s){this.context=i,this.width=o,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new T(i,p),s&&(this.depthAttachment=new P(i,p))};B.prototype.destroy=function(){var i=this.context.gl,o=this.colorAttachment.get();if(o&&i.deleteTexture(o),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var V=function(i,o,n){this.func=i,this.mask=o,this.range=n};V.ReadOnly=!1,V.ReadWrite=!0,V.disabled=new V(519,V.ReadOnly,[0,1]);var Z=function(i,o,n,s,p,f){this.test=i,this.ref=o,this.mask=n,this.fail=s,this.depthFail=p,this.pass=f};Z.disabled=new Z({func:519,mask:0},0,0,7680,7680,7680);var re=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};re.disabled=new re(re.Replace=[1,0],u.Color.transparent,[!1,!1,!1,!1]),re.unblended=new re(re.Replace,u.Color.transparent,[!0,!0,!0,!0]),re.alphaBlended=new re([1,771],u.Color.transparent,[!0,!0,!0,!0]);var ie=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};ie.disabled=new ie(!1,1029,2305),ie.backCCW=new ie(!0,1029,2305);var L=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new mr(this),this.clearDepth=new pr(this),this.clearStencil=new jr(this),this.colorMask=new hr(this),this.depthMask=new br(this),this.stencilMask=new dn(this),this.stencilFunc=new Kr(this),this.stencilOp=new Bi(this),this.stencilTest=new hi(this),this.depthRange=new ti(this),this.depthTest=new ri(this),this.depthFunc=new Vi(this),this.blend=new Ki(this),this.blendFunc=new yo(this),this.blendColor=new Zo(this),this.blendEquation=new mn(this),this.cullFace=new Mn(this),this.cullFaceSide=new Bn(this),this.frontFace=new $o(this),this.program=new jn(this),this.activeTexture=new zn(this),this.viewport=new rn(this),this.bindFramebuffer=new fe(this),this.bindRenderbuffer=new _e(this),this.bindTexture=new jt(this),this.bindVertexBuffer=new tr(this),this.bindElementBuffer=new Kt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new _t(this),this.pixelStoreUnpack=new fi(this),this.pixelStoreUnpackPremultiplyAlpha=new qi(this),this.pixelStoreUnpackFlipY=new ii(this),this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=i.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(i.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)};L.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()},L.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},L.prototype.createIndexBuffer=function(i,o){return new Nr(this,i,o)},L.prototype.createVertexBuffer=function(i,o,n){return new sr(this,i,o,n)},L.prototype.createRenderbuffer=function(i,o,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,o,n),this.bindRenderbuffer.set(null),p},L.prototype.createFramebuffer=function(i,o,n){return new B(this,i,o,n)},L.prototype.clear=function(i){var o=i.color,n=i.depth,s=this.gl,p=0;o&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(o),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s.clear(p)},L.prototype.setCullFace=function(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))},L.prototype.setDepthMode=function(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)},L.prototype.setStencilMode=function(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)},L.prototype.setColorMode=function(i){u.deepEqual(i.blendFunction,re.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)},L.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var H=(function(i){function o(n,s,p){var f=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",(function(d){d.dataType==="source"&&d.sourceDataType==="metadata"&&(f._sourceLoaded=!0),f._sourceLoaded&&!f._paused&&d.dataType==="source"&&d.sourceDataType==="content"&&(f.reload(),f.transform&&f.update(f.transform))})),this.on("error",(function(){f._sourceErrored=!0})),this._source=(function(d,v,w,A){var D=new Mi[v.type](d,v,w,A);if(D.id!==d)throw new Error("Expected Source id to be "+d+" instead of "+D.id);return u.bindAll(["load","abort","unload","serialize","prepare"],D),D})(n,s,p,this),this._tiles={},this._cache=new Nt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new u.SourceFeatureState}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},o.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},o.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var n in this._tiles){var s=this._tiles[n];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0},o.prototype.getSource=function(){return this._source},o.prototype.pause=function(){this._paused=!0},o.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}},o.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},o.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,(function(){}))},o.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,(function(){}))},o.prototype.serialize=function(){return this._source.serialize()},o.prototype.prepare=function(n){for(var s in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var p=this._tiles[s];p.upload(n),p.prepare(this.map.style.imageManager)}},o.prototype.getIds=function(){return u.values(this._tiles).map((function(n){return n.tileID})).sort(se).map((function(n){return n.key}))},o.prototype.getRenderableIds=function(n){var s=this,p=[];for(var f in this._tiles)this._isIdRenderable(f,n)&&p.push(this._tiles[f]);return n?p.sort((function(d,v){var w=d.tileID,A=v.tileID,D=new u.Point(w.canonical.x,w.canonical.y)._rotate(s.transform.angle),F=new u.Point(A.canonical.x,A.canonical.y)._rotate(s.transform.angle);return w.overscaledZ-A.overscaledZ||F.y-D.y||F.x-D.x})).map((function(d){return d.tileID.key})):p.map((function(d){return d.tileID})).sort(se).map((function(d){return d.key}))},o.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},o.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},o.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var n in this._cache.reset(),this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")},o.prototype._reloadTile=function(n,s){var p=this._tiles[n];p&&(p.state!=="loading"&&(p.state=s),this._loadTile(p,this._tileLoaded.bind(this,p,n,s)))},o.prototype._tileLoaded=function(n,s,p,f){if(f)return n.state="errored",void(f.status!==404?this._source.fire(new u.ErrorEvent(f,{tile:n})):this.update(this.transform));n.timeAdded=u.browser.now(),p==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(s,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),this._source.fire(new u.Event("data",{dataType:"source",tile:n,coord:n.tileID}))},o.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var f=s[p];if(n.neighboringTiles&&n.neighboringTiles[f]){var d=this.getTileByID(f);v(n,d),v(d,n)}}function v(w,A){w.needsHillshadePrepare=!0;var D=A.tileID.canonical.x-w.tileID.canonical.x,F=A.tileID.canonical.y-w.tileID.canonical.y,O=Math.pow(2,w.tileID.canonical.z),W=A.tileID.key;D===0&&F===0||Math.abs(F)>1||(Math.abs(D)>1&&(Math.abs(D+O)===1?D+=O:Math.abs(D-O)===1&&(D-=O)),A.dem&&w.dem&&(w.dem.backfillBorder(A.dem,D,F),w.neighboringTiles&&w.neighboringTiles[W]&&(w.neighboringTiles[W].backfilled=!0)))}},o.prototype.getTile=function(n){return this.getTileByID(n.key)},o.prototype.getTileByID=function(n){return this._tiles[n]},o.prototype._retainLoadedChildren=function(n,s,p,f){for(var d in this._tiles){var v=this._tiles[d];if(!(f[d]||!v.hasData()||v.tileID.overscaledZ<=s||v.tileID.overscaledZ>p)){for(var w=v.tileID;v&&v.tileID.overscaledZ>s+1;){var A=v.tileID.scaledTo(v.tileID.overscaledZ-1);(v=this._tiles[A.key])&&v.hasData()&&(w=A)}for(var D=w;D.overscaledZ>s;)if(n[(D=D.scaledTo(D.overscaledZ-1)).key]){f[w.key]=w;break}}}},o.prototype.findLoadedParent=function(n,s){if(n.key in this._loadedParentTiles){var p=this._loadedParentTiles[n.key];return p&&p.tileID.overscaledZ>=s?p:null}for(var f=n.overscaledZ-1;f>=s;f--){var d=n.scaledTo(f),v=this._getLoadedTile(d);if(v)return v}},o.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},o.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,f=Math.floor(s*p*5),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._cache.setMaxSize(d)},o.prototype.handleWrapJump=function(n){var s=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,s){var p={};for(var f in this._tiles){var d=this._tiles[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+s),p[d.tileID.key]=d}for(var v in this._tiles=p,this._timers)clearTimeout(this._timers[v]),delete this._timers[v];for(var w in this._tiles)this._setTileReloadTimer(w,this._tiles[w])}},o.prototype.update=function(n){var s=this;if(this.transform=n,this._sourceLoaded&&!this._paused){var p;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?p=n.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(Ie){return new u.OverscaledTileID(Ie.canonical.z,Ie.wrap,Ie.canonical.z,Ie.canonical.x,Ie.canonical.y)})):(p=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(p=p.filter((function(Ie){return s._source.hasTile(Ie)})))):p=[];var f=n.coveringZoomLevel(this._source),d=Math.max(f-o.maxOverzooming,this._source.minzoom),v=Math.max(f+o.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,f);if(Se(this._source.type)){for(var A={},D={},F=0,O=Object.keys(w);F<O.length;F+=1){var W=O[F],$=w[W],ee=this._tiles[W];if(ee&&!(ee.fadeEndTime&&ee.fadeEndTime<=u.browser.now())){var N=this.findLoadedParent($,d);N&&(this._addTile(N.tileID),A[N.tileID.key]=N.tileID),D[W]=$}}for(var Q in this._retainLoadedChildren(D,f,v,w),A)w[Q]||(this._coveredTiles[Q]=!0,w[Q]=A[Q])}for(var ne in w)this._tiles[ne].clearFadeHold();for(var ue=0,de=u.keysDifference(this._tiles,w);ue<de.length;ue+=1){var pe=de[ue],ye=this._tiles[pe];ye.hasSymbolBuckets&&!ye.holdingForFade()?ye.setHoldDuration(this.map._fadeDuration):ye.hasSymbolBuckets&&!ye.symbolFadeFinished()||this._removeTile(pe)}this._updateLoadedParentTileCache()}},o.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},o.prototype._updateRetainedTiles=function(n,s){for(var p={},f={},d=Math.max(s-o.maxOverzooming,this._source.minzoom),v=Math.max(s+o.maxUnderzooming,this._source.minzoom),w={},A=0,D=n;A<D.length;A+=1){var F=D[A],O=this._addTile(F);p[F.key]=F,O.hasData()||s<this._source.maxzoom&&(w[F.key]=F)}this._retainLoadedChildren(w,s,v,p);for(var W=0,$=n;W<$.length;W+=1){var ee=$[W],N=this._tiles[ee.key];if(!N.hasData()){if(s+1>this._source.maxzoom){var Q=ee.children(this._source.maxzoom)[0],ne=this.getTile(Q);if(ne&&ne.hasData()){p[Q.key]=Q;continue}}else{var ue=ee.children(this._source.maxzoom);if(p[ue[0].key]&&p[ue[1].key]&&p[ue[2].key]&&p[ue[3].key])continue}for(var de=N.wasRequested(),pe=ee.overscaledZ-1;pe>=d;--pe){var ye=ee.scaledTo(pe);if(f[ye.key]||(f[ye.key]=!0,!(N=this.getTile(ye))&&de&&(N=this._addTile(ye)),N&&(p[ye.key]=ye,de=N.wasRequested(),N.hasData())))break}}}return p},o.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,f=this._tiles[n].tileID;f.overscaledZ>0;){if(f.key in this._loadedParentTiles){p=this._loadedParentTiles[f.key];break}s.push(f.key);var d=f.scaledTo(f.overscaledZ-1);if(p=this._getLoadedTile(d))break;f=d}for(var v=0,w=s;v<w.length;v+=1)this._loadedParentTiles[w[v]]=p}},o.prototype._addTile=function(n){var s=this._tiles[n.key];if(s)return s;(s=this._cache.getAndRemove(n))&&(this._setTileReloadTimer(n.key,s),s.tileID=n,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,s)));var p=!!s;return p||(s=new u.Tile(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,n.key,s.state))),s?(s.uses++,this._tiles[n.key]=s,p||this._source.fire(new u.Event("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s):null},o.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var f=s.getExpiryTimeout();f&&(this._timers[n]=setTimeout((function(){p._reloadTile(n,"expired"),delete p._timers[n]}),f))},o.prototype._removeTile=function(n){var s=this._tiles[n];s&&(s.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))},o.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},o.prototype.tilesIn=function(n,s,p){var f=this,d=[],v=this.transform;if(!v)return d;for(var w=p?v.getCameraQueryGeometry(n):n,A=n.map((function(pe){return v.pointCoordinate(pe)})),D=w.map((function(pe){return v.pointCoordinate(pe)})),F=this.getIds(),O=1/0,W=1/0,$=-1/0,ee=-1/0,N=0,Q=D;N<Q.length;N+=1){var ne=Q[N];O=Math.min(O,ne.x),W=Math.min(W,ne.y),$=Math.max($,ne.x),ee=Math.max(ee,ne.y)}for(var ue=function(pe){var ye=f._tiles[F[pe]];if(!ye.holdingForFade()){var Ie=ye.tileID,Me=Math.pow(2,v.zoom-ye.tileID.overscaledZ),Ce=s*ye.queryPadding*u.EXTENT/ye.tileSize/Me,$e=[Ie.getTilePoint(new u.MercatorCoordinate(O,W)),Ie.getTilePoint(new u.MercatorCoordinate($,ee))];if($e[0].x-Ce<u.EXTENT&&$e[0].y-Ce<u.EXTENT&&$e[1].x+Ce>=0&&$e[1].y+Ce>=0){var nt=A.map((function(st){return Ie.getTilePoint(st)})),ut=D.map((function(st){return Ie.getTilePoint(st)}));d.push({tile:ye,tileID:Ie,queryGeometry:nt,cameraQueryGeometry:ut,scale:Me})}}},de=0;de<F.length;de++)ue(de);return d},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map((function(w){return s._tiles[w].tileID})),f=0,d=p;f<d.length;f+=1){var v=d[f];v.posMatrix=this.transform.calculatePosMatrix(v.toUnwrapped())}return p},o.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Se(this._source.type))for(var n in this._tiles){var s=this._tiles[n];if(s.fadeEndTime!==void 0&&s.fadeEndTime>=u.browser.now())return!0}return!1},o.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},o.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},o.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},o.prototype.setDependencies=function(n,s,p){var f=this._tiles[n];f&&f.setDependencies(s,p)},o.prototype.reloadTilesForDependencies=function(n,s){for(var p in this._tiles)this._tiles[p].hasDependency(n,s)&&this._reloadTile(p,"reloading");this._cache.filter((function(f){return!f.hasDependency(n,s)}))},o})(u.Evented);function se(i,o){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*o.wrap)-+(o.wrap<0);return i.overscaledZ-o.overscaledZ||s-n||o.canonical.y-i.canonical.y||o.canonical.x-i.canonical.x}function Se(i){return i==="raster"||i==="image"||i==="video"}function Ee(){return new u.window.Worker(gs.workerUrl)}H.maxOverzooming=10,H.maxUnderzooming=3;var me="mapboxgl_preloaded_worker_pool",Ae=function(){this.active={}};Ae.prototype.acquire=function(i){if(!this.workers)for(this.workers=[];this.workers.length<Ae.workerCount;)this.workers.push(new Ee);return this.active[i]=!0,this.workers.slice()},Ae.prototype.release=function(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach((function(o){o.terminate()})),this.workers=null)},Ae.prototype.isPreloaded=function(){return!!this.active[me]},Ae.prototype.numActive=function(){return Object.keys(this.active).length};var Je,Ze=Math.floor(u.browser.hardwareConcurrency/2);function ge(){return Je||(Je=new Ae),Je}function Ne(i,o){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return u.refProperties.forEach((function(p){p in o&&(n[p]=o[p])})),n}function ze(i){i=i.slice();for(var o=Object.create(null),n=0;n<i.length;n++)o[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=Ne(i[s],o[i[s].ref]));return i}Ae.workerCount=Math.max(Math.min(Ze,6),1);var Be={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 yt(i,o,n){n.push({command:Be.addSource,args:[i,o[i]]})}function qe(i,o,n){o.push({command:Be.removeSource,args:[i]}),n[i]=!0}function Et(i,o,n,s){qe(i,n,s),yt(i,o,n)}function rr(i,o,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;for(s in o[n])if(o[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;return!0}function Pt(i,o,n,s,p,f){var d;for(d in o=o||{},i=i||{})i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}));for(d in o)o.hasOwnProperty(d)&&!i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}))}function Gt(i){return i.id}function Dt(i,o){return i[o.id]=o,i}var wi=function(i,o){this.reset(i,o)};wi.prototype.reset=function(i,o){this.points=i||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding},wi.prototype.lerp=function(i){if(this.points.length===1)return this.points[0];i=u.clamp(i,0,1);for(var o=1,n=this._distances[o],s=i*this.paddedLength+this.padding;n<s&&o<this._distances.length;)n=this._distances[++o];var p=o-1,f=this._distances[p],d=n-f,v=d>0?(s-f)/d:0;return this.points[p].mult(1-v).add(this.points[o].mult(v))};var Ht=function(i,o,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(o/n);for(var f=0;f<this.xCellCount*this.yCellCount;f++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=o,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0};function Pr(i,o,n,s,p){var f=u.create();return o?(u.scale(f,f,[1/p,1/p,1]),n||u.rotateZ(f,f,s.angle)):u.multiply(f,s.labelPlaneMatrix,i),f}function Qt(i,o,n,s,p){if(o){var f=u.clone(i);return u.scale(f,f,[p,p,1]),n||u.rotateZ(f,f,-s.angle),f}return s.glCoordMatrix}function Bt(i,o){var n=[i.x,i.y,0,1];oi(n,n,o);var s=n[3];return{point:new u.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Zt(i,o){return .5+i/o*.5}function zi(i,o){var n=i[0]/i[3],s=i[1]/i[3];return n>=-o[0]&&n<=o[0]&&s>=-o[1]&&s<=o[1]}function ma(i,o,n,s,p,f,d,v){var w=s?i.textSizeData:i.iconSizeData,A=u.evaluateSizeForZoom(w,n.transform.zoom),D=[256/n.width*2+1,256/n.height*2+1],F=s?i.text.dynamicLayoutVertexArray:i.icon.dynamicLayoutVertexArray;F.clear();for(var O=i.lineVertexArray,W=s?i.text.placedSymbolArray:i.icon.placedSymbolArray,$=n.transform.width/n.transform.height,ee=!1,N=0;N<W.length;N++){var Q=W.get(N);if(Q.hidden||Q.writingMode===u.WritingMode.vertical&&!ee)Si(Q.numGlyphs,F);else{ee=!1;var ne=[Q.anchorX,Q.anchorY,0,1];if(u.transformMat4(ne,ne,o),zi(ne,D)){var ue=Zt(n.transform.cameraToCenterDistance,ne[3]),de=u.evaluateSizeForFeature(w,A,Q),pe=d?de/ue:de*ue,ye=new u.Point(Q.anchorX,Q.anchorY),Ie=Bt(ye,p).point,Me={},Ce=eu(Q,pe,!1,v,o,p,f,i.glyphOffsetArray,O,F,Ie,ye,Me,$);ee=Ce.useVertical,(Ce.notEnoughRoom||ee||Ce.needsFlipping&&eu(Q,pe,!0,v,o,p,f,i.glyphOffsetArray,O,F,Ie,ye,Me,$).notEnoughRoom)&&Si(Q.numGlyphs,F)}else Si(Q.numGlyphs,F)}}s?i.text.dynamicLayoutVertexBuffer.updateData(F):i.icon.dynamicLayoutVertexBuffer.updateData(F)}function ni(i,o,n,s,p,f,d,v,w,A,D){var F=v.glyphStartIndex+v.numGlyphs,O=v.lineStartIndex,W=v.lineStartIndex+v.lineLength,$=o.getoffsetX(v.glyphStartIndex),ee=o.getoffsetX(F-1),N=Cr(i*$,n,s,p,f,d,v.segment,O,W,w,A,D);if(!N)return null;var Q=Cr(i*ee,n,s,p,f,d,v.segment,O,W,w,A,D);return Q?{first:N,last:Q}:null}function Di(i,o,n,s){return i===u.WritingMode.horizontal&&Math.abs(n.y-o.y)>Math.abs(n.x-o.x)*s?{useVertical:!0}:(i===u.WritingMode.vertical?o.y<n.y:o.x>n.x)?{needsFlipping:!0}:null}function eu(i,o,n,s,p,f,d,v,w,A,D,F,O,W){var $,ee=o/24,N=i.lineOffsetX*ee,Q=i.lineOffsetY*ee;if(i.numGlyphs>1){var ne=i.glyphStartIndex+i.numGlyphs,ue=i.lineStartIndex,de=i.lineStartIndex+i.lineLength,pe=ni(ee,v,N,Q,n,D,F,i,w,f,O);if(!pe)return{notEnoughRoom:!0};var ye=Bt(pe.first.point,d).point,Ie=Bt(pe.last.point,d).point;if(s&&!n){var Me=Di(i.writingMode,ye,Ie,W);if(Me)return Me}$=[pe.first];for(var Ce=i.glyphStartIndex+1;Ce<ne-1;Ce++)$.push(Cr(ee*v.getoffsetX(Ce),N,Q,n,D,F,i.segment,ue,de,w,f,O));$.push(pe.last)}else{if(s&&!n){var $e=Bt(F,p).point,nt=i.lineStartIndex+i.segment+1,ut=new u.Point(w.getx(nt),w.gety(nt)),st=Bt(ut,p),Lt=st.signedDistanceFromCamera>0?st.point:ya(F,ut,$e,1,p),He=Di(i.writingMode,$e,Lt,W);if(He)return He}var mt=Cr(ee*v.getoffsetX(i.glyphStartIndex),N,Q,n,D,F,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,w,f,O);if(!mt)return{notEnoughRoom:!0};$=[mt]}for(var xt=0,dt=$;xt<dt.length;xt+=1){var ft=dt[xt];u.addDynamicAttributes(A,ft.point,ft.angle)}return{}}function ya(i,o,n,s,p){var f=Bt(i.add(i.sub(o)._unit()),p).point,d=n.sub(f);return n.add(d._mult(s/d.mag()))}function Cr(i,o,n,s,p,f,d,v,w,A,D,F){var O=s?i-o:i+o,W=O>0?1:-1,$=0;s&&(W*=-1,$=Math.PI),W<0&&($+=Math.PI);for(var ee=W>0?v+d:v+d+1,N=p,Q=p,ne=0,ue=0,de=Math.abs(O),pe=[];ne+ue<=de;){if((ee+=W)<v||ee>=w)return null;if(Q=N,pe.push(N),(N=F[ee])===void 0){var ye=new u.Point(A.getx(ee),A.gety(ee)),Ie=Bt(ye,D);if(Ie.signedDistanceFromCamera>0)N=F[ee]=Ie.point;else{var Me=ee-W;N=ya(ne===0?f:new u.Point(A.getx(Me),A.gety(Me)),ye,Q,de-ne+1,D)}}ne+=ue,ue=Q.dist(N)}var Ce=(de-ne)/ue,$e=N.sub(Q),nt=$e.mult(Ce)._add(Q);nt._add($e._unit()._perp()._mult(n*W));var ut=$+Math.atan2(N.y-Q.y,N.x-Q.x);return pe.push(nt),{point:nt,angle:ut,path:pe}}Ht.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ht.prototype.insert=function(i,o,n,s,p){this._forEachCell(o,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Ht.prototype.insertCircle=function(i,o,n,s){this._forEachCell(o-s,n-s,o+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(o),this.circles.push(n),this.circles.push(s)},Ht.prototype._insertBoxCell=function(i,o,n,s,p,f){this.boxCells[p].push(f)},Ht.prototype._insertCircleCell=function(i,o,n,s,p,f){this.circleCells[p].push(f)},Ht.prototype._query=function(i,o,n,s,p,f){if(n<0||i>this.width||s<0||o>this.height)return!p&&[];var d=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var v=0;v<this.boxKeys.length;v++)d.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(var w=0;w<this.circleKeys.length;w++){var A=this.circles[3*w],D=this.circles[3*w+1],F=this.circles[3*w+2];d.push({key:this.circleKeys[w],x1:A-F,y1:D-F,x2:A+F,y2:D+F})}return f?d.filter(f):d}return this._forEachCell(i,o,n,s,this._queryCell,d,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?d.length>0:d},Ht.prototype._queryCircle=function(i,o,n,s,p){var f=i-n,d=i+n,v=o-n,w=o+n;if(d<0||f>this.width||w<0||v>this.height)return!s&&[];var A=[];return this._forEachCell(f,v,d,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},Ht.prototype.query=function(i,o,n,s,p){return this._query(i,o,n,s,!1,p)},Ht.prototype.hitTest=function(i,o,n,s,p){return this._query(i,o,n,s,!0,p)},Ht.prototype.hitTestCircle=function(i,o,n,s){return this._queryCircle(i,o,n,!0,s)},Ht.prototype._queryCell=function(i,o,n,s,p,f,d,v){var w=d.seenUids,A=this.boxCells[p];if(A!==null)for(var D=this.bboxes,F=0,O=A;F<O.length;F+=1){var W=O[F];if(!w.box[W]){w.box[W]=!0;var $=4*W;if(i<=D[$+2]&&o<=D[$+3]&&n>=D[$+0]&&s>=D[$+1]&&(!v||v(this.boxKeys[W]))){if(d.hitTest)return f.push(!0),!0;f.push({key:this.boxKeys[W],x1:D[$],y1:D[$+1],x2:D[$+2],y2:D[$+3]})}}}var ee=this.circleCells[p];if(ee!==null)for(var N=this.circles,Q=0,ne=ee;Q<ne.length;Q+=1){var ue=ne[Q];if(!w.circle[ue]){w.circle[ue]=!0;var de=3*ue;if(this._circleAndRectCollide(N[de],N[de+1],N[de+2],i,o,n,s)&&(!v||v(this.circleKeys[ue]))){if(d.hitTest)return f.push(!0),!0;var pe=N[de],ye=N[de+1],Ie=N[de+2];f.push({key:this.circleKeys[ue],x1:pe-Ie,y1:ye-Ie,x2:pe+Ie,y2:ye+Ie})}}}},Ht.prototype._queryCellCircle=function(i,o,n,s,p,f,d,v){var w=d.circle,A=d.seenUids,D=this.boxCells[p];if(D!==null)for(var F=this.bboxes,O=0,W=D;O<W.length;O+=1){var $=W[O];if(!A.box[$]){A.box[$]=!0;var ee=4*$;if(this._circleAndRectCollide(w.x,w.y,w.radius,F[ee+0],F[ee+1],F[ee+2],F[ee+3])&&(!v||v(this.boxKeys[$])))return f.push(!0),!0}}var N=this.circleCells[p];if(N!==null)for(var Q=this.circles,ne=0,ue=N;ne<ue.length;ne+=1){var de=ue[ne];if(!A.circle[de]){A.circle[de]=!0;var pe=3*de;if(this._circlesCollide(Q[pe],Q[pe+1],Q[pe+2],w.x,w.y,w.radius)&&(!v||v(this.circleKeys[de])))return f.push(!0),!0}}},Ht.prototype._forEachCell=function(i,o,n,s,p,f,d,v){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(o),D=this._convertToXCellCoord(n),F=this._convertToYCellCoord(s),O=w;O<=D;O++)for(var W=A;W<=F;W++)if(p.call(this,i,o,n,s,this.xCellCount*W+O,f,d,v))return},Ht.prototype._convertToXCellCoord=function(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))},Ht.prototype._convertToYCellCoord=function(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))},Ht.prototype._circlesCollide=function(i,o,n,s,p,f){var d=s-i,v=p-o,w=n+f;return w*w>d*d+v*v},Ht.prototype._circleAndRectCollide=function(i,o,n,s,p,f,d){var v=(f-s)/2,w=Math.abs(i-(s+v));if(w>v+n)return!1;var A=(d-p)/2,D=Math.abs(o-(p+A));if(D>A+n)return!1;if(w<=v||D<=A)return!0;var F=w-v,O=D-A;return F*F+O*O<=n*n};var va=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Si(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(va,3*s)}}function oi(i,o,n){var s=o[0],p=o[1];return i[0]=n[0]*s+n[4]*p+n[12],i[1]=n[1]*s+n[5]*p+n[13],i[3]=n[3]*s+n[7]*p+n[15],i}var nn=function(i,o,n){o===void 0&&(o=new Ht(i.width+200,i.height+200,25)),n===void 0&&(n=new Ht(i.width+200,i.height+200,25)),this.transform=i,this.grid=o,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function yr(i,o,n){return o*(u.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}nn.prototype.placeCollisionBox=function(i,o,n,s,p){var f=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),d=n*f.perspectiveRatio,v=i.x1*d+f.point.x,w=i.y1*d+f.point.y,A=i.x2*d+f.point.x,D=i.y2*d+f.point.y;return!this.isInsideGrid(v,w,A,D)||!o&&this.grid.hitTest(v,w,A,D,p)?{box:[],offscreen:!1}:{box:[v,w,A,D],offscreen:this.isOffscreen(v,w,A,D)}},nn.prototype.placeCollisionCircles=function(i,o,n,s,p,f,d,v,w,A,D,F,O){var W=[],$=new u.Point(o.anchorX,o.anchorY),ee=Bt($,f),N=Zt(this.transform.cameraToCenterDistance,ee.signedDistanceFromCamera),Q=(A?p/N:p*N)/u.ONE_EM,ne=Bt($,d).point,ue=ni(Q,s,o.lineOffsetX*Q,o.lineOffsetY*Q,!1,ne,$,o,n,d,{}),de=!1,pe=!1,ye=!0;if(ue){for(var Ie=.5*F*N+O,Me=new u.Point(-100,-100),Ce=new u.Point(this.screenRightBoundary,this.screenBottomBoundary),$e=new wi,nt=ue.first,ut=ue.last,st=[],Lt=nt.path.length-1;Lt>=1;Lt--)st.push(nt.path[Lt]);for(var He=1;He<ut.path.length;He++)st.push(ut.path[He]);var mt=2.5*Ie;if(v){var xt=st.map((function(cn){return Bt(cn,v)}));st=xt.some((function(cn){return cn.signedDistanceFromCamera<=0}))?[]:xt.map((function(cn){return cn.point}))}var dt=[];if(st.length>0){for(var ft=st[0].clone(),gt=st[0].clone(),ht=1;ht<st.length;ht++)ft.x=Math.min(ft.x,st[ht].x),ft.y=Math.min(ft.y,st[ht].y),gt.x=Math.max(gt.x,st[ht].x),gt.y=Math.max(gt.y,st[ht].y);dt=ft.x>=Me.x&&gt.x<=Ce.x&&ft.y>=Me.y&&gt.y<=Ce.y?[st]:gt.x<Me.x||ft.x>Ce.x||gt.y<Me.y||ft.y>Ce.y?[]:u.clipLine([st],Me.x,Me.y,Ce.x,Ce.y)}for(var ct=0,Jr=dt;ct<Jr.length;ct+=1){var Ir;$e.reset(Jr[ct],.25*Ie),Ir=$e.length<=.5*Ie?1:Math.ceil($e.paddedLength/mt)+1;for(var gi=0;gi<Ir;gi++){var si=gi/Math.max(Ir-1,1),wr=$e.lerp(si),kr=wr.x+100,Wi=wr.y+100;W.push(kr,Wi,Ie,0);var Ei=kr-Ie,no=Wi-Ie,Ri=kr+Ie,wn=Wi+Ie;if(ye=ye&&this.isOffscreen(Ei,no,Ri,wn),pe=pe||this.isInsideGrid(Ei,no,Ri,wn),!i&&this.grid.hitTestCircle(kr,Wi,Ie,D)&&(de=!0,!w))return{circles:[],offscreen:!1,collisionDetected:de}}}}return{circles:!w&&de||!pe?[]:W,offscreen:ye,collisionDetected:de}},nn.prototype.queryRenderedSymbols=function(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var o=[],n=1/0,s=1/0,p=-1/0,f=-1/0,d=0,v=i;d<v.length;d+=1){var w=v[d],A=new u.Point(w.x+100,w.y+100);n=Math.min(n,A.x),s=Math.min(s,A.y),p=Math.max(p,A.x),f=Math.max(f,A.y),o.push(A)}for(var D={},F={},O=0,W=this.grid.query(n,s,p,f).concat(this.ignoredGrid.query(n,s,p,f));O<W.length;O+=1){var $=W[O],ee=$.key;if(D[ee.bucketInstanceId]===void 0&&(D[ee.bucketInstanceId]={}),!D[ee.bucketInstanceId][ee.featureIndex]){var N=[new u.Point($.x1,$.y1),new u.Point($.x2,$.y1),new u.Point($.x2,$.y2),new u.Point($.x1,$.y2)];u.polygonIntersectsPolygon(o,N)&&(D[ee.bucketInstanceId][ee.featureIndex]=!0,F[ee.bucketInstanceId]===void 0&&(F[ee.bucketInstanceId]=[]),F[ee.bucketInstanceId].push(ee.featureIndex))}}return F},nn.prototype.insertCollisionBox=function(i,o,n,s,p){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},nn.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var f=o?this.ignoredGrid:this.grid,d={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},v=0;v<i.length;v+=4)f.insertCircle(d,i[v],i[v+1],i[v+2])},nn.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return oi(s,s,i),{point:new u.Point((s[0]/s[3]+1)/2*this.transform.width+100,(-s[1]/s[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s[3]*.5}},nn.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},nn.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},nn.prototype.getViewportMatrix=function(){var i=u.identity([]);return u.translate(i,i,[-100,-100,0]),i};var yn=function(i,o,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?o:-o))):s&&n?1:0,this.placed=n};yn.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Ji=function(i,o,n,s,p){this.text=new yn(i?i.text:null,o,n,p),this.icon=new yn(i?i.icon:null,o,s,p)};Ji.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var il=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},on=function(){this.invProjMatrix=u.create(),this.viewportMatrix=u.create(),this.circles=[]},Pc=function(i,o,n,s,p){this.bucketInstanceId=i,this.featureIndex=o,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},Dn=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function di(i,o,n,s,p){var f=u.getAnchorAlignment(i),d=-(f.horizontalAlign-.5)*o,v=-(f.verticalAlign-.5)*n,w=u.evaluateVariableOffset(i,s);return new u.Point(d+w[0]*p,v+w[1]*p)}function In(i,o,n,s,p,f){var d=i.x1,v=i.x2,w=i.y1,A=i.y2,D=i.anchorPointX,F=i.anchorPointY,O=new u.Point(o,n);return s&&O._rotate(p?f:-f),{x1:d+O.x,y1:w+O.y,x2:v+O.x,y2:A+O.y,anchorPointX:D,anchorPointY:F}}Dn.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var o=++this.maxGroupID;this.collisionGroups[i]={ID:o,predicate:function(n){return n.collisionGroupID===o}}}return this.collisionGroups[i]};var Ii=function(i,o,n,s){this.transform=i.clone(),this.collisionIndex=new nn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new Dn(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function vo(i,o,n,s,p){i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0)}Ii.prototype.getBucketParts=function(i,o,n,s){var p=n.getBucket(o),f=n.latestFeatureIndex;if(p&&f&&o.id===p.layerIds[0]){var d=n.collisionBoxArray,v=p.layers[0].layout,w=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),A=n.tileSize/u.EXTENT,D=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),F=v.get("text-pitch-alignment")==="map",O=v.get("text-rotation-alignment")==="map",W=yr(n,1,this.transform.zoom),$=Pr(D,F,O,this.transform,W),ee=null;if(F){var N=Qt(D,F,O,this.transform,W);ee=u.multiply([],this.transform.labelPlaneMatrix,N)}this.retainedQueryData[p.bucketInstanceId]=new Pc(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,n.tileID);var Q={bucket:p,layout:v,posMatrix:D,textLabelPlaneMatrix:$,labelToScreenMatrix:ee,scale:w,textPixelRatio:A,holdingForFade:n.holdingForFade(),collisionBoxArray:d,partiallyEvaluatedTextSize:u.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var ne=0,ue=p.sortKeyRanges;ne<ue.length;ne+=1){var de=ue[ne];i.push({sortKey:de.sortKey,symbolInstanceStart:de.symbolInstanceStart,symbolInstanceEnd:de.symbolInstanceEnd,parameters:Q})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:Q})}},Ii.prototype.attemptAnchorPlacement=function(i,o,n,s,p,f,d,v,w,A,D,F,O,W,$){var ee,N=[F.textOffset0,F.textOffset1],Q=di(i,n,s,N,p),ne=this.collisionIndex.placeCollisionBox(In(o,Q.x,Q.y,f,d,this.transform.angle),D,v,w,A.predicate);if(!$||this.collisionIndex.placeCollisionBox(In($,Q.x,Q.y,f,d,this.transform.angle),D,v,w,A.predicate).box.length!==0)return ne.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID].text&&(ee=this.prevPlacement.variableOffsets[F.crossTileID].anchor),this.variableOffsets[F.crossTileID]={textOffset:N,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:ee},this.markUsedJustification(O,i,F,W),O.allowVerticalPlacement&&(this.markUsedOrientation(O,W,F),this.placedOrientations[F.crossTileID]=W),{shift:Q,placedGlyphBoxes:ne}):void 0},Ii.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,f=p.bucket,d=p.layout,v=p.posMatrix,w=p.textLabelPlaneMatrix,A=p.labelToScreenMatrix,D=p.textPixelRatio,F=p.holdingForFade,O=p.collisionBoxArray,W=p.partiallyEvaluatedTextSize,$=p.collisionGroup,ee=d.get("text-optional"),N=d.get("icon-optional"),Q=d.get("text-allow-overlap"),ne=d.get("icon-allow-overlap"),ue=d.get("text-rotation-alignment")==="map",de=d.get("text-pitch-alignment")==="map",pe=d.get("icon-text-fit")!=="none",ye=d.get("symbol-z-order")==="viewport-y",Ie=Q&&(ne||!f.hasIconData()||N),Me=ne&&(Q||!f.hasTextData()||ee);!f.collisionArrays&&O&&f.deserializeCollisionBoxes(O);var Ce=function(He,mt){if(!o[He.crossTileID])if(F)s.placements[He.crossTileID]=new il(!1,!1,!1);else{var xt,dt=!1,ft=!1,gt=!0,ht=null,ct={box:null,offscreen:null},Jr={box:null,offscreen:null},Ir=null,gi=null,si=0,wr=0,kr=0;mt.textFeatureIndex?si=mt.textFeatureIndex:He.useRuntimeCollisionCircles&&(si=He.featureIndex),mt.verticalTextFeatureIndex&&(wr=mt.verticalTextFeatureIndex);var Wi=mt.textBox;if(Wi){var Ei=function($t){var en=u.WritingMode.horizontal;if(f.allowVerticalPlacement&&!$t&&s.prevPlacement){var Li=s.prevPlacement.placedOrientations[He.crossTileID];Li&&(s.placedOrientations[He.crossTileID]=Li,s.markUsedOrientation(f,en=Li,He))}return en},no=function($t,en){if(f.allowVerticalPlacement&&He.numVerticalGlyphVertices>0&&mt.verticalTextBox)for(var Li=0,Ro=f.writingModes;Li<Ro.length&&(Ro[Li]===u.WritingMode.vertical?(ct=en(),Jr=ct):ct=$t(),!(ct&&ct.box&&ct.box.length));Li+=1);else ct=$t()};if(d.get("text-variable-anchor")){var Ri=d.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[He.crossTileID]){var wn=s.prevPlacement.variableOffsets[He.crossTileID];Ri.indexOf(wn.anchor)>0&&(Ri=Ri.filter((function($t){return $t!==wn.anchor}))).unshift(wn.anchor)}var cn=function($t,en,Li){for(var Ro=$t.x2-$t.x1,Nc=$t.y2-$t.y1,_s=He.textBoxScale,jc=pe&&!ne?en:null,Oa={box:[],offscreen:!1},Dl=Q?2*Ri.length:Ri.length,aa=0;aa<Dl;++aa){var xs=s.attemptAnchorPlacement(Ri[aa%Ri.length],$t,Ro,Nc,_s,ue,de,D,v,$,aa>=Ri.length,He,f,Li,jc);if(xs&&(Oa=xs.placedGlyphBoxes)&&Oa.box&&Oa.box.length){dt=!0,ht=xs.shift;break}}return Oa};no((function(){return cn(Wi,mt.iconBox,u.WritingMode.horizontal)}),(function(){var $t=mt.verticalTextBox;return f.allowVerticalPlacement&&!(ct&&ct.box&&ct.box.length)&&He.numVerticalGlyphVertices>0&&$t?cn($t,mt.verticalIconBox,u.WritingMode.vertical):{box:null,offscreen:null}})),ct&&(dt=ct.box,gt=ct.offscreen);var Ra=Ei(ct&&ct.box);if(!dt&&s.prevPlacement){var na=s.prevPlacement.variableOffsets[He.crossTileID];na&&(s.variableOffsets[He.crossTileID]=na,s.markUsedJustification(f,na.anchor,He,Ra))}}else{var oo=function($t,en){var Li=s.collisionIndex.placeCollisionBox($t,Q,D,v,$.predicate);return Li&&Li.box&&Li.box.length&&(s.markUsedOrientation(f,en,He),s.placedOrientations[He.crossTileID]=en),Li};no((function(){return oo(Wi,u.WritingMode.horizontal)}),(function(){var $t=mt.verticalTextBox;return f.allowVerticalPlacement&&He.numVerticalGlyphVertices>0&&$t?oo($t,u.WritingMode.vertical):{box:null,offscreen:null}})),Ei(ct&&ct.box&&ct.box.length)}}if(dt=(xt=ct)&&xt.box&&xt.box.length>0,gt=xt&&xt.offscreen,He.useRuntimeCollisionCircles){var oa=f.text.placedSymbolArray.get(He.centerJustifiedTextSymbolIndex),La=u.evaluateSizeForFeature(f.textSizeData,W,oa),Pn=d.get("text-padding");Ir=s.collisionIndex.placeCollisionCircles(Q,oa,f.lineVertexArray,f.glyphOffsetArray,La,v,w,A,n,de,$.predicate,He.collisionCircleDiameter,Pn),dt=Q||Ir.circles.length>0&&!Ir.collisionDetected,gt=gt&&Ir.offscreen}if(mt.iconFeatureIndex&&(kr=mt.iconFeatureIndex),mt.iconBox){var Fa=function($t){var en=pe&&ht?In($t,ht.x,ht.y,ue,de,s.transform.angle):$t;return s.collisionIndex.placeCollisionBox(en,ne,D,v,$.predicate)};ft=Jr&&Jr.box&&Jr.box.length&&mt.verticalIconBox?(gi=Fa(mt.verticalIconBox)).box.length>0:(gi=Fa(mt.iconBox)).box.length>0,gt=gt&&gi.offscreen}var Cn=ee||He.numHorizontalGlyphVertices===0&&He.numVerticalGlyphVertices===0,Yr=N||He.numIconVertices===0;if(Cn||Yr?Yr?Cn||(ft=ft&&dt):dt=ft&&dt:ft=dt=ft&&dt,dt&&xt&&xt.box&&s.collisionIndex.insertCollisionBox(xt.box,d.get("text-ignore-placement"),f.bucketInstanceId,Jr&&Jr.box&&wr?wr:si,$.ID),ft&&gi&&s.collisionIndex.insertCollisionBox(gi.box,d.get("icon-ignore-placement"),f.bucketInstanceId,kr,$.ID),Ir&&(dt&&s.collisionIndex.insertCollisionCircles(Ir.circles,d.get("text-ignore-placement"),f.bucketInstanceId,si,$.ID),n)){var On=f.bucketInstanceId,ao=s.collisionCircleArrays[On];ao===void 0&&(ao=s.collisionCircleArrays[On]=new on);for(var Do=0;Do<Ir.circles.length;Do+=4)ao.circles.push(Ir.circles[Do+0]),ao.circles.push(Ir.circles[Do+1]),ao.circles.push(Ir.circles[Do+2]),ao.circles.push(Ir.collisionDetected?1:0)}s.placements[He.crossTileID]=new il(dt||Ie,ft||Me,gt||f.justReloaded),o[He.crossTileID]=!0}};if(ye)for(var $e=f.getSortedSymbolIndexes(this.transform.angle),nt=$e.length-1;nt>=0;--nt){var ut=$e[nt];Ce(f.symbolInstances.get(ut),f.collisionArrays[ut])}else for(var st=i.symbolInstanceStart;st<i.symbolInstanceEnd;st++)Ce(f.symbolInstances.get(st),f.collisionArrays[st]);if(n&&f.bucketInstanceId in this.collisionCircleArrays){var Lt=this.collisionCircleArrays[f.bucketInstanceId];u.invert(Lt.invProjMatrix,v),Lt.viewportMatrix=this.collisionIndex.getViewportMatrix()}f.justReloaded=!1},Ii.prototype.markUsedJustification=function(i,o,n,s){var p;p=s===u.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[u.getAnchorJustification(o)];for(var f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];f<d.length;f+=1){var v=d[f];v>=0&&(i.text.placedSymbolArray.get(v).crossTileID=p>=0&&v!==p?0:n.crossTileID)}},Ii.prototype.markUsedOrientation=function(i,o,n){for(var s=o===u.WritingMode.horizontal||o===u.WritingMode.horizontalOnly?o:0,p=o===u.WritingMode.vertical?o:0,f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];f<d.length;f+=1)i.text.placedSymbolArray.get(d[f]).placedOrientation=s;n.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)},Ii.prototype.commit=function(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;var o=this.prevPlacement,n=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;var s=o?o.symbolFadeChange(i):1,p=o?o.opacities:{},f=o?o.variableOffsets:{},d=o?o.placedOrientations:{};for(var v in this.placements){var w=this.placements[v],A=p[v];A?(this.opacities[v]=new Ji(A,s,w.text,w.icon),n=n||w.text!==A.text.placed||w.icon!==A.icon.placed):(this.opacities[v]=new Ji(null,s,w.text,w.icon,w.skipFade),n=n||w.text||w.icon)}for(var D in p){var F=p[D];if(!this.opacities[D]){var O=new Ji(F,s,!1,!1);O.isHidden()||(this.opacities[D]=O,n=n||F.text.placed||F.icon.placed)}}for(var W in f)this.variableOffsets[W]||!this.opacities[W]||this.opacities[W].isHidden()||(this.variableOffsets[W]=f[W]);for(var $ in d)this.placedOrientations[$]||!this.opacities[$]||this.opacities[$].isHidden()||(this.placedOrientations[$]=d[$]);n?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:i)},Ii.prototype.updateLayerOpacities=function(i,o){for(var n={},s=0,p=o;s<p.length;s+=1){var f=p[s],d=f.getBucket(i);d&&f.latestFeatureIndex&&i.id===d.layerIds[0]&&this.updateBucketOpacities(d,n,f.collisionBoxArray)}},Ii.prototype.updateBucketOpacities=function(i,o,n){var s=this;i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();var p=i.layers[0].layout,f=new Ji(null,0,!1,!1,!0),d=p.get("text-allow-overlap"),v=p.get("icon-allow-overlap"),w=p.get("text-variable-anchor"),A=p.get("text-rotation-alignment")==="map",D=p.get("text-pitch-alignment")==="map",F=p.get("icon-text-fit")!=="none",O=new Ji(null,0,d&&(v||!i.hasIconData()||p.get("icon-optional")),v&&(d||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var W=function(Q,ne,ue){for(var de=0;de<ne/4;de++)Q.opacityVertexArray.emplaceBack(ue)},$=function(Q){var ne=i.symbolInstances.get(Q),ue=ne.numHorizontalGlyphVertices,de=ne.numVerticalGlyphVertices,pe=ne.crossTileID,ye=s.opacities[pe];o[pe]?ye=f:ye||(s.opacities[pe]=ye=O),o[pe]=!0;var Ie=ne.numIconVertices>0,Me=s.placedOrientations[ne.crossTileID],Ce=Me===u.WritingMode.vertical,$e=Me===u.WritingMode.horizontal||Me===u.WritingMode.horizontalOnly;if(ue>0||de>0){var nt=al(ye.text);W(i.text,ue,Ce?Wo:nt),W(i.text,de,$e?Wo:nt);var ut=ye.text.isHidden();[ne.rightJustifiedTextSymbolIndex,ne.centerJustifiedTextSymbolIndex,ne.leftJustifiedTextSymbolIndex].forEach((function(ct){ct>=0&&(i.text.placedSymbolArray.get(ct).hidden=ut||Ce?1:0)})),ne.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(ne.verticalPlacedTextSymbolIndex).hidden=ut||$e?1:0);var st=s.variableOffsets[ne.crossTileID];st&&s.markUsedJustification(i,st.anchor,ne,Me);var Lt=s.placedOrientations[ne.crossTileID];Lt&&(s.markUsedJustification(i,"left",ne,Lt),s.markUsedOrientation(i,Lt,ne))}if(Ie){var He=al(ye.icon),mt=!(F&&ne.verticalPlacedIconSymbolIndex&&Ce);ne.placedIconSymbolIndex>=0&&(W(i.icon,ne.numIconVertices,mt?He:Wo),i.icon.placedSymbolArray.get(ne.placedIconSymbolIndex).hidden=ye.icon.isHidden()),ne.verticalPlacedIconSymbolIndex>=0&&(W(i.icon,ne.numVerticalIconVertices,mt?Wo:He),i.icon.placedSymbolArray.get(ne.verticalPlacedIconSymbolIndex).hidden=ye.icon.isHidden())}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){var xt=i.collisionArrays[Q];if(xt){var dt=new u.Point(0,0);if(xt.textBox||xt.verticalTextBox){var ft=!0;if(w){var gt=s.variableOffsets[pe];gt?(dt=di(gt.anchor,gt.width,gt.height,gt.textOffset,gt.textBoxScale),A&&dt._rotate(D?s.transform.angle:-s.transform.angle)):ft=!1}xt.textBox&&vo(i.textCollisionBox.collisionVertexArray,ye.text.placed,!ft||Ce,dt.x,dt.y),xt.verticalTextBox&&vo(i.textCollisionBox.collisionVertexArray,ye.text.placed,!ft||$e,dt.x,dt.y)}var ht=!!(!$e&&xt.verticalIconBox);xt.iconBox&&vo(i.iconCollisionBox.collisionVertexArray,ye.icon.placed,ht,F?dt.x:0,F?dt.y:0),xt.verticalIconBox&&vo(i.iconCollisionBox.collisionVertexArray,ye.icon.placed,!ht,F?dt.x:0,F?dt.y:0)}}},ee=0;ee<i.symbolInstances.length;ee++)$(ee);if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){var N=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=N.invProjMatrix,i.placementViewportMatrix=N.viewportMatrix,i.collisionCircleArray=N.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}},Ii.prototype.symbolFadeChange=function(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Ii.prototype.zoomAdjustment=function(i){return Math.max(0,(this.transform.zoom-i)/1.5)},Ii.prototype.hasTransitions=function(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration},Ii.prototype.stillRecent=function(i,o){var n=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*n>i},Ii.prototype.setStale=function(){this.stale=!0};var Cc=Math.pow(2,25),kc=Math.pow(2,24),tu=Math.pow(2,17),Mc=Math.pow(2,16),nl=Math.pow(2,9),Bc=Math.pow(2,8),ol=Math.pow(2,1);function al(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var o=i.placed?1:0,n=Math.floor(127*i.opacity);return n*Cc+o*kc+n*tu+o*Mc+n*nl+o*Bc+n*ol+o}var Wo=0,ru=function(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ru.prototype.continuePlacement=function(i,o,n,s,p){for(var f=this._bucketParts;this._currentTileIndex<i.length;)if(o.getBucketParts(f,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,f.sort((function(d,v){return d.sortKey-v.sortKey})));this._currentPartIndex<f.length;)if(o.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var ga=function(i,o,n,s,p,f,d){this.placement=new Ii(i,p,f,d),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};ga.prototype.isDone=function(){return this._done},ga.prototype.continuePlacement=function(i,o,n){for(var s=this,p=u.browser.now(),f=function(){var w=u.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var d=o[i[this._currentPlacementIndex]],v=this.placement.collisionIndex.transform.zoom;if(d.type==="symbol"&&(!d.minzoom||d.minzoom<=v)&&(!d.maxzoom||d.maxzoom>v)){if(this._inProgressLayer||(this._inProgressLayer=new ru(d)),this._inProgressLayer.continuePlacement(n[d.source],this.placement,this._showCollisionBoxes,d,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ga.prototype.commit=function(i){return this.placement.commit(i),this.placement};var sl=512/u.EXTENT/2,Qa=function(i,o,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<o.length;s++){var p=o.get(s),f=p.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};Qa.prototype.getScaledCoordinates=function(i,o){var n=sl/Math.pow(2,o.canonical.z-this.tileID.canonical.z);return{x:Math.floor((o.canonical.x*u.EXTENT+i.anchorX)*n),y:Math.floor((o.canonical.y*u.EXTENT+i.anchorY)*n)}},Qa.prototype.findMatches=function(i,o,n){for(var s=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),p=0;p<i.length;p++){var f=i.get(p);if(!f.crossTileID){var d=this.indexedSymbolInstances[f.key];if(d)for(var v=this.getScaledCoordinates(f,o),w=0,A=d;w<A.length;w+=1){var D=A[w];if(Math.abs(D.coord.x-v.x)<=s&&Math.abs(D.coord.y-v.y)<=s&&!n[D.crossTileID]){n[D.crossTileID]=!0,f.crossTileID=D.crossTileID;break}}}}};var an=function(){this.maxCrossTileID=0};an.prototype.generate=function(){return++this.maxCrossTileID};var Gn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Gn.prototype.handleWrapJump=function(i){var o=Math.round((i-this.lng)/360);if(o!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var f in s){var d=s[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+o),p[d.tileID.key]=d}this.indexes[n]=p}this.lng=i},Gn.prototype.addBucket=function(i,o,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<o.symbolInstances.length;s++)o.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var f in this.indexes){var d=this.indexes[f];if(Number(f)>i.overscaledZ)for(var v in d){var w=d[v];w.tileID.isChildOf(i)&&w.findMatches(o.symbolInstances,i,p)}else{var A=d[i.scaledTo(Number(f)).key];A&&A.findMatches(o.symbolInstances,i,p)}}for(var D=0;D<o.symbolInstances.length;D++){var F=o.symbolInstances.get(D);F.crossTileID||(F.crossTileID=n.generate(),p[F.crossTileID]=!0)}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new Qa(i,o.symbolInstances,o.bucketInstanceId),!0},Gn.prototype.removeBucketCrossTileIDs=function(i,o){for(var n in o.indexedSymbolInstances)for(var s=0,p=o.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},Gn.prototype.removeStaleBuckets=function(i){var o=!1;for(var n in this.indexes){var s=this.indexes[n];for(var p in s)i[s[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,s[p]),delete s[p],o=!0)}return o};var Zn=function(){this.layerIndexes={},this.crossTileIDs=new an,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Zn.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new Gn);var p=!1,f={};s.handleWrapJump(n);for(var d=0,v=o;d<v.length;d+=1){var w=v[d],A=w.getBucket(i);A&&i.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),f[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(f)&&(p=!0),p},Zn.prototype.pruneUnusedLayers=function(i){var o={};for(var n in i.forEach((function(s){o[s]=!0})),this.layerIndexes)o[n]||delete this.layerIndexes[n]};var go=function(i,o){return u.emitValidationErrors(i,o&&o.filter((function(n){return n.identifier!=="source.canvas"})))},$n=u.pick(Be,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Wn=u.pick(Be,["setCenter","setZoom","setBearing","setPitch"]),es=(function(){var i={},o=u.styleSpec.$version;for(var n in u.styleSpec.$root){var s,p=u.styleSpec.$root[n];p.required&&(s=n==="version"?o:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i})(),Ui=(function(i){function o(n,s){var p=this;s===void 0&&(s={}),i.call(this),this.map=n,this.dispatcher=new Ut(ge(),this),this.imageManager=new Re,this.imageManager.setEventedParent(this),this.glyphManager=new Fe(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new St(256,512),this.crossTileSymbolIndex=new Zn,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",u.getReferrer());var f=this;this._rtlTextPluginCallback=o.registerForPluginStateChange((function(d){f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(function(v,w){if(u.triggerPluginCompletionEvent(v),w&&w.every((function(D){return D})))for(var A in f.sourceCaches)f.sourceCaches[A].reload()}))})),this.on("data",(function(d){if(d.dataType==="source"&&d.sourceDataType==="metadata"){var v=p.sourceCaches[d.sourceId];if(v){var w=v.getSource();if(w&&w.vectorLayerIds)for(var A in p._layers){var D=p._layers[A];D.source===w.id&&p._validateLayer(D)}}}}))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"}));var f=typeof s.validate=="boolean"?s.validate:!u.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);var d=this.map._requestManager.transformRequest(n,u.ResourceType.Style);this._request=u.getJSON(d,(function(v,w){p._request=null,v?p.fire(new u.ErrorEvent(v)):w&&p._load(w,f)}))},o.prototype.loadJSON=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"})),this._request=u.browser.frame((function(){p._request=null,p._load(n,s.validate!==!1)}))},o.prototype.loadEmpty=function(){this.fire(new u.Event("dataloading",{dataType:"style"})),this._load(es,!1)},o.prototype._load=function(n,s){if(!s||!go(this,u.validateStyle(n))){for(var p in this._loaded=!0,this.stylesheet=n,n.sources)this.addSource(p,n.sources[p],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);var f=ze(this.stylesheet.layers);this._order=f.map((function(A){return A.id})),this._layers={},this._serializedLayers={};for(var d=0,v=f;d<v.length;d+=1){var w=v[d];(w=u.createStyleLayer(w)).setEventedParent(this,{layer:{id:w.id}}),this._layers[w.id]=w,this._serializedLayers[w.id]=w.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Wt(this.stylesheet.light),this.fire(new u.Event("data",{dataType:"style"})),this.fire(new u.Event("style.load"))}},o.prototype._loadSprite=function(n){var s=this;this._spriteRequest=(function(p,f,d){var v,w,A,D=u.browser.devicePixelRatio>1?"@2x":"",F=u.getJSON(f.transformRequest(f.normalizeSpriteURL(p,D,".json"),u.ResourceType.SpriteJSON),(function($,ee){F=null,A||(A=$,v=ee,W())})),O=u.getImage(f.transformRequest(f.normalizeSpriteURL(p,D,".png"),u.ResourceType.SpriteImage),(function($,ee){O=null,A||(A=$,w=ee,W())}));function W(){if(A)d(A);else if(v&&w){var $=u.browser.getImageData(w),ee={};for(var N in v){var Q=v[N],ne=Q.width,ue=Q.height,de=Q.x,pe=Q.y,ye=Q.sdf,Ie=Q.pixelRatio,Me=Q.stretchX,Ce=Q.stretchY,$e=Q.content,nt=new u.RGBAImage({width:ne,height:ue});u.RGBAImage.copy($,nt,{x:de,y:pe},{x:0,y:0},{width:ne,height:ue}),ee[N]={data:nt,pixelRatio:Ie,sdf:ye,stretchX:Me,stretchY:Ce,content:$e}}d(null,ee)}}return{cancel:function(){F&&(F.cancel(),F=null),O&&(O.cancel(),O=null)}}})(n,this.map._requestManager,(function(p,f){if(s._spriteRequest=null,p)s.fire(new u.ErrorEvent(p));else if(f)for(var d in f)s.imageManager.addImage(d,f[d]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new u.Event("data",{dataType:"style"}))}))},o.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var f=s.getSource();(f.type==="geojson"||f.vectorLayerIds&&f.vectorLayerIds.indexOf(p)===-1)&&this.fire(new u.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+f.id+'" as specified by style layer "'+n.id+'"')))}}},o.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()},o.prototype._serializeLayers=function(n){for(var s=[],p=0,f=n;p<f.length;p+=1){var d=this._layers[f[p]];d.type!=="custom"&&s.push(d.serialize())}return s},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(var s in this._layers)if(this._layers[s].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);for(var d in(p.length||f.length)&&this._updateWorkerLayers(p,f),this._updatedSources){var v=this._updatedSources[d];v==="reload"?this._reloadSource(d):v==="clear"&&this._clearSource(d)}for(var w in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[w].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var A={};for(var D in this.sourceCaches){var F=this.sourceCaches[D];A[D]=F.used,F.used=!1}for(var O=0,W=this._order;O<W.length;O+=1){var $=this._layers[W[O]];$.recalculate(n,this._availableImages),!$.isHidden(n.zoom)&&$.source&&(this.sourceCaches[$.source].used=!0)}for(var ee in A){var N=this.sourceCaches[ee];A[ee]!==N.used&&N.fire(new u.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:ee}))}this.light.recalculate(n),this.z=n.zoom,s&&this.fire(new u.Event("data",{dataType:"style"}))}},o.prototype._updateTilesForChangedImages=function(){var n=Object.keys(this._changedImages);if(n.length){for(var s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}},o.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},o.prototype.setState=function(n){var s=this;if(this._checkLoaded(),go(this,u.validateStyle(n)))return!1;(n=u.clone$1(n)).layers=ze(n.layers);var p=(function(d,v){if(!d)return[{command:Be.setStyle,args:[v]}];var w=[];try{if(!u.deepEqual(d.version,v.version))return[{command:Be.setStyle,args:[v]}];u.deepEqual(d.center,v.center)||w.push({command:Be.setCenter,args:[v.center]}),u.deepEqual(d.zoom,v.zoom)||w.push({command:Be.setZoom,args:[v.zoom]}),u.deepEqual(d.bearing,v.bearing)||w.push({command:Be.setBearing,args:[v.bearing]}),u.deepEqual(d.pitch,v.pitch)||w.push({command:Be.setPitch,args:[v.pitch]}),u.deepEqual(d.sprite,v.sprite)||w.push({command:Be.setSprite,args:[v.sprite]}),u.deepEqual(d.glyphs,v.glyphs)||w.push({command:Be.setGlyphs,args:[v.glyphs]}),u.deepEqual(d.transition,v.transition)||w.push({command:Be.setTransition,args:[v.transition]}),u.deepEqual(d.light,v.light)||w.push({command:Be.setLight,args:[v.light]});var A={},D=[];(function(O,W,$,ee){var N;for(N in W=W||{},O=O||{})O.hasOwnProperty(N)&&(W.hasOwnProperty(N)||qe(N,$,ee));for(N in W)W.hasOwnProperty(N)&&(O.hasOwnProperty(N)?u.deepEqual(O[N],W[N])||(O[N].type==="geojson"&&W[N].type==="geojson"&&rr(O,W,N)?$.push({command:Be.setGeoJSONSourceData,args:[N,W[N].data]}):Et(N,W,$,ee)):yt(N,W,$))})(d.sources,v.sources,D,A);var F=[];d.layers&&d.layers.forEach((function(O){A[O.source]?w.push({command:Be.removeLayer,args:[O.id]}):F.push(O)})),w=w.concat(D),(function(O,W,$){W=W||[];var ee,N,Q,ne,ue,de,pe,ye=(O=O||[]).map(Gt),Ie=W.map(Gt),Me=O.reduce(Dt,{}),Ce=W.reduce(Dt,{}),$e=ye.slice(),nt=Object.create(null);for(ee=0,N=0;ee<ye.length;ee++)Ce.hasOwnProperty(Q=ye[ee])?N++:($.push({command:Be.removeLayer,args:[Q]}),$e.splice($e.indexOf(Q,N),1));for(ee=0,N=0;ee<Ie.length;ee++)$e[$e.length-1-ee]!==(Q=Ie[Ie.length-1-ee])&&(Me.hasOwnProperty(Q)?($.push({command:Be.removeLayer,args:[Q]}),$e.splice($e.lastIndexOf(Q,$e.length-N),1)):N++,$.push({command:Be.addLayer,args:[Ce[Q],de=$e[$e.length-ee]]}),$e.splice($e.length-ee,0,Q),nt[Q]=!0);for(ee=0;ee<Ie.length;ee++)if(ne=Me[Q=Ie[ee]],ue=Ce[Q],!nt[Q]&&!u.deepEqual(ne,ue))if(u.deepEqual(ne.source,ue.source)&&u.deepEqual(ne["source-layer"],ue["source-layer"])&&u.deepEqual(ne.type,ue.type)){for(pe in Pt(ne.layout,ue.layout,$,Q,null,Be.setLayoutProperty),Pt(ne.paint,ue.paint,$,Q,null,Be.setPaintProperty),u.deepEqual(ne.filter,ue.filter)||$.push({command:Be.setFilter,args:[Q,ue.filter]}),u.deepEqual(ne.minzoom,ue.minzoom)&&u.deepEqual(ne.maxzoom,ue.maxzoom)||$.push({command:Be.setLayerZoomRange,args:[Q,ue.minzoom,ue.maxzoom]}),ne)ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Pt(ne[pe],ue[pe],$,Q,pe.slice(6),Be.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||$.push({command:Be.setLayerProperty,args:[Q,pe,ue[pe]]}));for(pe in ue)ue.hasOwnProperty(pe)&&!ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Pt(ne[pe],ue[pe],$,Q,pe.slice(6),Be.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||$.push({command:Be.setLayerProperty,args:[Q,pe,ue[pe]]}))}else $.push({command:Be.removeLayer,args:[Q]}),de=$e[$e.lastIndexOf(Q)+1],$.push({command:Be.addLayer,args:[ue,de]})})(F,v.layers,w)}catch(O){console.warn("Unable to compute style diff:",O),w=[{command:Be.setStyle,args:[v]}]}return w})(this.serialize(),n).filter((function(d){return!(d.command in Wn)}));if(p.length===0)return!1;var f=p.filter((function(d){return!(d.command in $n)}));if(f.length>0)throw new Error("Unimplemented: "+f.map((function(d){return d.command})).join(", ")+".");return p.forEach((function(d){d.command!=="setTransition"&&s[d.command].apply(s,d.args)})),this.stylesheet=n,!0},o.prototype.addImage=function(n,s){if(this.getImage(n))return this.fire(new u.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(n,s),this._afterImageUpdated(n)},o.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},o.prototype.getImage=function(n){return this.imageManager.getImage(n)},o.prototype.removeImage=function(n){if(!this.getImage(n))return this.fire(new u.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(n),this._afterImageUpdated(n)},o.prototype._afterImageUpdated=function(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.Event("data",{dataType:"style"}))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(n,s,p){var f=this;if(p===void 0&&(p={}),this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(s).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(u.validateStyle.source,"sources."+n,s,null,p))){this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);var d=this.sourceCaches[n]=new H(n,s,this.dispatcher);d.style=this,d.setEventedParent(this,(function(){return{isSourceLoaded:f.loaded(),source:d.serialize(),sourceId:n}})),d.onAdd(this.map),this._changed=!0}},o.prototype.removeSource=function(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(var s in this._layers)if(this._layers[s].source===n)return this.fire(new u.ErrorEvent(new Error('Source "'+n+'" cannot be removed while layer "'+s+'" is using it.')));var p=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],p.fire(new u.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),p.setEventedParent(null),p.clearTiles(),p.onRemove&&p.onRemove(this.map),this._changed=!0},o.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},o.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},o.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=n.id;if(this.getLayer(f))this.fire(new u.ErrorEvent(new Error('Layer with id "'+f+'" already exists on this map')));else{var d;if(n.type==="custom"){if(go(this,u.validateCustomStyleLayer(n)))return;d=u.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(f,n.source),n=u.clone$1(n),n=u.extend(n,{source:f})),this._validate(u.validateStyle.layer,"layers."+f,n,{arrayIndex:-1},p))return;d=u.createStyleLayer(n),this._validateLayer(d),d.setEventedParent(this,{layer:{id:f}}),this._serializedLayers[d.id]=d.serialize()}var v=s?this._order.indexOf(s):this._order.length;if(s&&v===-1)this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.')));else{if(this._order.splice(v,0,f),this._layerOrderChanged=!0,this._layers[f]=d,this._removedLayers[f]&&d.source&&d.type!=="custom"){var w=this._removedLayers[f];delete this._removedLayers[f],w.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}},o.prototype.moveLayer=function(n,s){if(this._checkLoaded(),this._changed=!0,this._layers[n]){if(n!==s){var p=this._order.indexOf(n);this._order.splice(p,1);var f=s?this._order.indexOf(s):this._order.length;s&&f===-1?this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(f,0,n),this._layerOrderChanged=!0)}}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")))},o.prototype.removeLayer=function(n){this._checkLoaded();var s=this._layers[n];if(s){s.setEventedParent(null);var p=this._order.indexOf(n);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map)}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(n){return this._layers[n]},o.prototype.hasLayer=function(n){return n in this._layers},o.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var f=this.getLayer(n);f?f.minzoom===s&&f.maxzoom===p||(s!=null&&(f.minzoom=s),p!=null&&(f.maxzoom=p),this._updateLayer(f)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=this.getLayer(n);if(f){if(!u.deepEqual(f.filter,s))return s==null?(f.filter=void 0,void this._updateLayer(f)):void(this._validate(u.validateStyle.filter,"layers."+f.id+".filter",s,null,p)||(f.filter=u.clone$1(s),this._updateLayer(f)))}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(n){return u.clone$1(this.getLayer(n).filter)},o.prototype.setLayoutProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getLayoutProperty(s),p)||(d.setLayoutProperty(s,p,f),this._updateLayer(d)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getLayoutProperty=function(n,s){var p=this.getLayer(n);if(p)return p.getLayoutProperty(s);this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style.")))},o.prototype.setPaintProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getPaintProperty(s),p)||(d.setPaintProperty(s,p,f)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},o.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=n.sourceLayer,d=this.sourceCaches[p];if(d!==void 0){var v=d.getSource().type;v==="geojson"&&f?this.fire(new u.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):v!=="vector"||f?(n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(f,n.id,s)):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=this.sourceCaches[p];if(f!==void 0){var d=f.getSource().type,v=d==="vector"?n.sourceLayer:void 0;d!=="vector"||v?s&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new u.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):f.removeFeatureState(v,n.id,s):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,f=this.sourceCaches[s];if(f!==void 0){if(f.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),f.getFeatureState(p,n.id);this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+s+"' does not exist in the map's style.")))},o.prototype.getTransition=function(){return u.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){return u.filterObject({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:u.mapObject(this.sourceCaches,(function(n){return n.serialize()})),layers:this._serializeLayers(this._order)},(function(n){return n!==void 0}))},o.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0},o.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(Me){return s._layers[Me].type==="fill-extrusion"},f={},d=[],v=this._order.length-1;v>=0;v--){var w=this._order[v];if(p(w)){f[w]=v;for(var A=0,D=n;A<D.length;A+=1){var F=D[A][w];if(F)for(var O=0,W=F;O<W.length;O+=1)d.push(W[O])}}}d.sort((function(Me,Ce){return Ce.intersectionZ-Me.intersectionZ}));for(var $=[],ee=this._order.length-1;ee>=0;ee--){var N=this._order[ee];if(p(N))for(var Q=d.length-1;Q>=0;Q--){var ne=d[Q].feature;if(f[ne.layer.id]<ee)break;$.push(ne),d.pop()}else for(var ue=0,de=n;ue<de.length;ue+=1){var pe=de[ue][N];if(pe)for(var ye=0,Ie=pe;ye<Ie.length;ye+=1)$.push(Ie[ye].feature)}}return $},o.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(u.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var f={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new u.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var d=0,v=s.layers;d<v.length;d+=1){var w=v[d],A=this._layers[w];if(!A)return this.fire(new u.ErrorEvent(new Error("The layer '"+w+"' does not exist in the map's style and cannot be queried for features."))),[];f[A.source]=!0}}var D=[];for(var F in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!f[F]||D.push(Or(this.sourceCaches[F],this._layers,this._serializedLayers,n,s,p));return this.placement&&D.push((function(O,W,$,ee,N,Q,ne){for(var ue={},de=Q.queryRenderedSymbols(ee),pe=[],ye=0,Ie=Object.keys(de).map(Number);ye<Ie.length;ye+=1)pe.push(ne[Ie[ye]]);pe.sort(Xi);for(var Me=function(){var st=$e[Ce],Lt=st.featureIndex.lookupSymbolFeatures(de[st.bucketInstanceId],W,st.bucketIndex,st.sourceLayerIndex,N.filter,N.layers,N.availableImages,O);for(var He in Lt){var mt=ue[He]=ue[He]||[],xt=Lt[He];xt.sort((function(gt,ht){var ct=st.featureSortOrder;if(ct){var Jr=ct.indexOf(gt.featureIndex);return ct.indexOf(ht.featureIndex)-Jr}return ht.featureIndex-gt.featureIndex}));for(var dt=0,ft=xt;dt<ft.length;dt+=1)mt.push(ft[dt])}},Ce=0,$e=pe;Ce<$e.length;Ce+=1)Me();var nt=function(st){ue[st].forEach((function(Lt){var He=Lt.feature,mt=$[O[st].source].getFeatureState(He.layer["source-layer"],He.id);He.source=He.layer.source,He.layer["source-layer"]&&(He.sourceLayer=He.layer["source-layer"]),He.state=mt}))};for(var ut in ue)nt(ut);return ue})(this._layers,this._serializedLayers,this.sourceCaches,n,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(D)},o.prototype.querySourceFeatures=function(n,s){s&&s.filter&&this._validate(u.validateStyle.filter,"querySourceFeatures.filter",s.filter,null,s);var p=this.sourceCaches[n];return p?(function(f,d){for(var v=f.getRenderableIds().map((function(W){return f.getTileByID(W)})),w=[],A={},D=0;D<v.length;D++){var F=v[D],O=F.tileID.canonical.key;A[O]||(A[O]=!0,F.querySourceFeatures(w,d))}return w})(p,s):[]},o.prototype.addSourceType=function(n,s,p){return o.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(o.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),f=!1;for(var d in n)if(!u.deepEqual(n[d],p[d])){f=!0;break}if(f){var v={now:u.browser.now(),transition:u.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,s),this.light.updateTransitions(v)}},o.prototype._validate=function(n,s,p,f,d){return d===void 0&&(d={}),(!d||d.validate!==!1)&&go(this,n.call(u.validateStyle,u.extend({key:s,style:this.serialize(),value:p,styleSpec:u.styleSpec},f)))},o.prototype._remove=function(){for(var n in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),u.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[n].setEventedParent(null);for(var s in this.sourceCaches)this.sourceCaches[s].clearTiles(),this.sourceCaches[s].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},o.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},o.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},o.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},o.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},o.prototype._updatePlacement=function(n,s,p,f,d){d===void 0&&(d=!1);for(var v=!1,w=!1,A={},D=0,F=this._order;D<F.length;D+=1){var O=this._layers[F[D]];if(O.type==="symbol"){if(!A[O.source]){var W=this.sourceCaches[O.source];A[O.source]=W.getRenderableIds(!0).map((function(ne){return W.getTileByID(ne)})).sort((function(ne,ue){return ue.tileID.overscaledZ-ne.tileID.overscaledZ||(ne.tileID.isLessThan(ue.tileID)?-1:1)}))}var $=this.crossTileSymbolIndex.addLayer(O,A[O.source],n.center.lng);v=v||$}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.browser.now(),n.zoom))&&(this.pauseablePlacement=new ga(n,this._order,d,s,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.browser.now()),w=!0),v&&this.pauseablePlacement.placement.setStale()),w||v)for(var ee=0,N=this._order;ee<N.length;ee+=1){var Q=this._layers[N[ee]];Q.type==="symbol"&&this.placement.updateLayerOpacities(Q,A[Q.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.browser.now())},o.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},o.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var f=this.sourceCaches[s.source];f&&f.setDependencies(s.tileID.key,s.type,s.icons)},o.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},o.prototype.getResource=function(n,s,p){return u.makeRequest(s,p)},o})(u.Evented);Ui.getSourceType=function(i){return Mi[i]},Ui.setSourceType=function(i,o){Mi[i]=o},Ui.registerForPluginStateChange=u.registerForPluginStateChange;var Vr=u.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ho=ir(`#ifdef GL_ES
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const wt=require("./LoadingSpinner-DDwWCdh8.js"),q=require("vue"),pa=require("pinia");let Wa=null;typeof window<"u"&&(Wa=document.currentScript);const Py={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data &copy; Crown copyright and database rights YYYY",prefix:"",suffix:""},init(y){if(typeof window<"u"){Wa&&(this.options.div=Wa.getAttribute("data-div")||this.options.div,this.options.logo=Wa.getAttribute("data-logo")||this.options.logo,this.options.statement=Wa.getAttribute("data-statement")||this.options.statement,this.options.prefix=Wa.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Wa.getAttribute("data-suffix")||this.options.suffix),y=typeof y<"u"?y:{},Object.assign(this.options,y);const _=document.getElementById(this.options.div);let b="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(b="os-api-branding logo white");let M=this.options.statement;M=M.replace("YYYY",new Date().getFullYear()),this.options.prefix!==""&&(M=`${this.options.prefix}<span>|</span>${M}`),this.options.suffix!==""&&(M=`${M}<span>|</span>${this.options.suffix}`),document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach(u=>u.remove());const E=document.createElement("div");E.className=b,_.appendChild(E);const R=document.createElement("div");R.className="os-api-branding copyright",R.innerHTML=M,_.appendChild(R)}}},Sn=pa.defineStore("map",()=>{const y=q.ref([]),_=q.ref([]),b=q.ref(null),M=q.ref(null),E=q.ref(null);function R(be){y.value.push({id:be.id,filters:be.filters,places:be.places,activePins:be.activePins,hovered:"",activePlace:null})}function u(be){y.value.forEach(ke=>{ke.id===be.mapId&&(ke.hovered=be.hoveredFeature)})}function U(be){y.value.forEach(ke=>{ke.id===be.mapId&&(ke.activePlace=be.activeFeature)})}function k(be){_.value=be}function J(be){b.value=be}function X(be){M.value=be}function ae(be){return y.value.find(ke=>ke.id===be)}function Y(be){return y.value.find(Oe=>Oe.id===be)?.hovered}function Te(be){return y.value.find(Oe=>Oe.id===be)?.activePlace}return{maps:y,activeSubcatFilters:_,selectedSubCategory:b,activeMarkerPos:M,activePlace:E,addMapInstance:R,setHoveredPlace:u,setActivePlace:U,setActiveSubcatFilters:k,setSelectedSubcat:J,setActiveMarkerPos:X,getMapById:ae,getHoveredStop:Y,getActivePlace:Te}});var _c={exports:{}},S0=_c.exports,Cy;function I0(){return Cy||(Cy=1,(function(y,_){(function(b,M){y.exports=M()})(S0,(function(){var b,M,E;function R(u,U){if(!b)b=U;else if(!M)M=U;else{var k="var sharedChunk = {}; ("+b+")(sharedChunk); ("+M+")(sharedChunk);",J={};b(J),E=U(J),typeof window<"u"&&(E.workerUrl=window.URL.createObjectURL(new Blob([k],{type:"text/javascript"})))}}return R(["exports"],(function(u){function U(e,t){return e(t={exports:{}},t.exports),t.exports}var k=J;function J(e,t,r,a){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=a,this.p2x=r,this.p2y=a}J.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},J.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},J.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},J.prototype.solveCurveX=function(e,t){var r,a,l,c,h;for(t===void 0&&(t=1e-6),l=e,h=0;h<8;h++){if(c=this.sampleCurveX(l)-e,Math.abs(c)<t)return l;var m=this.sampleCurveDerivativeX(l);if(Math.abs(m)<1e-6)break;l-=c/m}if((l=e)<(r=0))return r;if(l>(a=1))return a;for(;r<a;){if(c=this.sampleCurveX(l),Math.abs(c-e)<t)return l;e>c?r=l:a=l,l=.5*(a-r)+r}return l},J.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var X=ae;function ae(e,t){this.x=e,this.y=t}ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),a=Math.sin(e),l=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ae.convert=function(e){return e instanceof ae?e:Array.isArray(e)?new ae(e[0],e[1]):e};var Y=typeof self<"u"?self:{},Te=Math.pow(2,53)-1;function be(e,t,r,a){var l=new k(e,t,r,a);return function(c){return l.solve(c)}}var ke=be(.25,.1,.25,1);function Oe(e,t,r){return Math.min(r,Math.max(t,e))}function Ve(e,t,r){var a=r-t,l=((e-t)%a+a)%a+t;return l===t?r:l}function Re(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}var ve=1;function Ke(){return ve++}function We(){return(function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)})()}function It(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function we(e,t){e.forEach((function(r){t[r]&&(t[r]=t[r].bind(t))}))}function Ge(e,t){return e.indexOf(t,e.length-t.length)!==-1}function Fe(e,t,r){var a={};for(var l in e)a[l]=t.call(r||this,e[l],l,e);return a}function tt(e,t,r){var a={};for(var l in e)t.call(r||this,e[l],l,e)&&(a[l]=e[l]);return a}function kt(e){return Array.isArray(e)?e.map(kt):typeof e=="object"&&e?Fe(e,kt):e}var Wt={};function St(e){Wt[e]||(typeof console<"u"&&console.warn(e),Wt[e]=!0)}function Ut(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Hr(e){for(var t=0,r=0,a=e.length,l=a-1,c=void 0,h=void 0;r<a;l=r++)t+=((h=e[l]).x-(c=e[r]).x)*(c.y+h.y);return t}function Er(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function bi(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(a,l,c,h){var m=c||h;return t[l]=!m||m.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var or=null;function Rr(e){if(or==null){var t=e.navigator?e.navigator.userAgent:null;or=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return or}function et(e){try{var t=Y[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Lr,Xr,At,Fr,Mi=Y.performance&&Y.performance.now?Y.performance.now.bind(Y.performance):Date.now.bind(Date),pi=Y.requestAnimationFrame||Y.mozRequestAnimationFrame||Y.webkitRequestAnimationFrame||Y.msRequestAnimationFrame,Or=Y.cancelAnimationFrame||Y.mozCancelAnimationFrame||Y.webkitCancelAnimationFrame||Y.msCancelAnimationFrame,Xi={now:Mi,frame:function(e){var t=pi(e);return{cancel:function(){return Or(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var r=Y.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,a.drawImage(e,0,0,e.width,e.height),a.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Lr||(Lr=Y.document.createElement("a")),Lr.href=e,Lr.href},hardwareConcurrency:Y.navigator&&Y.navigator.hardwareConcurrency||4,get devicePixelRatio(){return Y.devicePixelRatio},get prefersReducedMotion(){return!!Y.matchMedia&&(Xr==null&&(Xr=Y.matchMedia("(prefers-reduced-motion: reduce)")),Xr.matches)}},Nt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"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},Nr={supported:!1,testSupport:function(e){!ar&&Fr&&(sr?lt(e):At=e)}},ar=!1,sr=!1;function lt(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Fr),e.isContextLost())return;Nr.supported=!0}catch{}e.deleteTexture(t),ar=!0}Y.document&&((Fr=Y.document.createElement("img")).onload=function(){At&&lt(At),At=null,sr=!0},Fr.onerror=function(){ar=!0,At=null},Fr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var mr="01",pr=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function jr(e){return e.indexOf("mapbox:")===0}pr.prototype._createSkuToken=function(){var e=(function(){for(var t="",r=0;r<10;r++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",mr,t].join(""),tokenExpiresAt:Date.now()+432e5}})();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},pr.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},pr.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},pr.prototype.normalizeStyleURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},pr.prototype.normalizeGlyphsURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},pr.prototype.normalizeSourceURL=function(e,t){if(!jr(e))return e;var r=Kr(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},pr.prototype.normalizeSpriteURL=function(e,t,r,a){var l=Kr(e);return jr(e)?(l.path="/styles/v1"+l.path+"/sprite"+t+r,this._makeAPIURL(l,this._customAccessToken||a)):(l.path+=""+t+r,Bi(l))},pr.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!jr(e))return e;var r=Kr(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Xi.devicePixelRatio>=2||t===512?"@2x":"")+(Nr.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||(function(l){for(var c=0,h=l;c<h.length;c+=1){var m=h[c].match(/^access_token=(.*)$/);if(m)return m[1]}return null})(r.params)||Nt.ACCESS_TOKEN;return Nt.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},pr.prototype.canonicalizeTileURL=function(e,t){var r=Kr(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var a="mapbox://tiles/";a+=r.path.replace("/v4/","");var l=r.params;return t&&(l=l.filter((function(c){return!c.match(/^access_token=/)}))),l.length&&(a+="?"+l.join("&")),a},pr.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&jr(t),a=[],l=0,c=e.tiles||[];l<c.length;l+=1){var h=c[l];br(h)?a.push(this.canonicalizeTileURL(h,r)):a.push(h)}return a},pr.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",a=Kr(Nt.API_URL);if(e.protocol=a.protocol,e.authority=a.authority,e.protocol==="http"){var l=e.params.indexOf("secure");l>=0&&e.params.splice(l,1)}if(a.path!=="/"&&(e.path=""+a.path+e.path),!Nt.REQUIRE_ACCESS_TOKEN)return Bi(e);if(!(t=t||Nt.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if(t[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(c){return c.indexOf("access_token")===-1})),e.params.push("access_token="+t),Bi(e)};var hr=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function br(e){return hr.test(e)}var dn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Kr(e){var t=e.match(dn);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Bi(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function hi(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(Y.atob(t[1]).split("").map((function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch{return null}}var ti=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ti.prototype.getStorageKey=function(e){var t,r=hi(Nt.ACCESS_TOKEN);return t=r&&r.u?Y.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(a,l){return String.fromCharCode(+("0x"+l))}))):Nt.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+t:"mapbox.eventData:"+t},ti.prototype.fetchEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var a=Y.localStorage.getItem(t);a&&(this.eventData=JSON.parse(a));var l=Y.localStorage.getItem(r);l&&(this.anonId=l)}catch{St("Unable to read from LocalStorage")}},ti.prototype.saveEventData=function(){var e=et("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{Y.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&Y.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{St("Unable to write to LocalStorage")}},ti.prototype.processRequests=function(e){},ti.prototype.postEvent=function(e,t,r,a){var l=this;if(Nt.EVENTS_URL){var c=Kr(Nt.EVENTS_URL);c.params.push("access_token="+(a||Nt.ACCESS_TOKEN||""));var h={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:mr,userId:this.anonId},m=t?Re(h,t):h,g={url:Bi(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([m])};this.pendingRequest=Yt(g,(function(x){l.pendingRequest=null,r(x),l.saveEventData(),l.processRequests(a)}))}},ti.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var ri,Vi,Ki=(function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(r,a,l,c){this.skuToken=l;var h=!(!c&&!Nt.ACCESS_TOKEN),m=Array.isArray(r)&&r.some((function(g){return jr(g)||br(g)}));Nt.EVENTS_URL&&h&&m&&this.queueRequest({id:a,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){var l=this.queue.shift(),c=l.id,h=l.timestamp;c&&this.success[c]||(this.anonId||this.fetchEventData(),It(this.anonId)||(this.anonId=We()),this.postEvent(h,{skuToken:this.skuToken},(function(m){m||c&&(a.success[c]=!0)}),r))}},t})(ti),yo=new((function(e){function t(r){e.call(this,"appUserTurnstile"),this._customAccessToken=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(r,a){Nt.EVENTS_URL&&Nt.ACCESS_TOKEN&&Array.isArray(r)&&r.some((function(l){return jr(l)||br(l)}))&&this.queueRequest(Date.now(),a)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var l=hi(Nt.ACCESS_TOKEN),c=l?l.u:Nt.ACCESS_TOKEN,h=c!==this.eventData.tokenU;It(this.anonId)||(this.anonId=We(),h=!0);var m=this.queue.shift();if(this.eventData.lastSuccess){var g=new Date(this.eventData.lastSuccess),x=new Date(m),S=(m-this.eventData.lastSuccess)/864e5;h=h||S>=1||S<-1||g.getDate()!==x.getDate()}else h=!0;if(!h)return this.processRequests();this.postEvent(m,{"enabled.telemetry":!1},(function(I){I||(a.eventData.lastSuccess=m,a.eventData.tokenU=c)}),r)}},t})(ti)),Zo=yo.postTurnstileEvent.bind(yo),mn=new Ki,Mn=mn.postMapLoadEvent.bind(mn),Bn=500,$o=50;function jn(){Y.caches&&!ri&&(ri=Y.caches.open("mapbox-tiles"))}function zn(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var rn,fe=1/0;function _e(){return rn==null&&(rn=Y.OffscreenCanvas&&new Y.OffscreenCanvas(1,1).getContext("2d")&&typeof Y.createImageBitmap=="function"),rn}var jt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(jt);var tr=(function(e){function t(r,a,l){a===401&&br(l)&&(r+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,r),this.status=a,this.url=l,this.name=this.constructor.name,this.message=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t})(Error),Kt=Er()?function(){return self.worker&&self.worker.referrer}:function(){return(Y.location.protocol==="blob:"?Y.parent:Y).location.href},_t,fi,qi=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(Kt())&&!/^\w+:/.test(r))){if(Y.fetch&&Y.Request&&Y.AbortController&&Y.Request.prototype.hasOwnProperty("signal"))return(function(a,l){var c,h=new Y.AbortController,m=new Y.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:Kt(),signal:h.signal}),g=!1,x=!1,S=(c=m.url).indexOf("sku=")>0&&br(c);a.type==="json"&&m.headers.set("Accept","application/json");var I=function(z,j,G){if(!x){if(z&&z.message!=="SecurityError"&&St(z),j&&G)return C(j);var te=Date.now();Y.fetch(m).then((function(K){if(K.ok){var oe=S?K.clone():null;return C(K,oe,te)}return l(new tr(K.statusText,K.status,a.url))})).catch((function(K){K.code!==20&&l(new Error(K.message))}))}},C=function(z,j,G){(a.type==="arrayBuffer"?z.arrayBuffer():a.type==="json"?z.json():z.text()).then((function(te){x||(j&&G&&(function(K,oe,le){if(jn(),ri){var ce={status:oe.status,statusText:oe.statusText,headers:new Y.Headers};oe.headers.forEach((function(xe,Pe){return ce.headers.set(Pe,xe)}));var he=bi(oe.headers.get("Cache-Control")||"");he["no-store"]||(he["max-age"]&&ce.headers.set("Expires",new Date(le+1e3*he["max-age"]).toUTCString()),new Date(ce.headers.get("Expires")).getTime()-le<42e4||(function(xe,Pe){if(Vi===void 0)try{new Response(new ReadableStream),Vi=!0}catch{Vi=!1}Vi?Pe(xe.body):xe.blob().then(Pe)})(oe,(function(xe){var Pe=new Y.Response(xe,ce);jn(),ri&&ri.then((function(De){return De.put(zn(K.url),Pe)})).catch((function(De){return St(De.message)}))})))}})(m,j,G),g=!0,l(null,te,z.headers.get("Cache-Control"),z.headers.get("Expires")))})).catch((function(te){x||l(new Error(te.message))}))};return S?(function(z,j){if(jn(),!ri)return j(null);var G=zn(z.url);ri.then((function(te){te.match(G).then((function(K){var oe=(function(le){if(!le)return!1;var ce=new Date(le.headers.get("Expires")||0),he=bi(le.headers.get("Cache-Control")||"");return ce>Date.now()&&!he["no-cache"]})(K);te.delete(G),oe&&te.put(G,K.clone()),j(null,K,oe)})).catch(j)})).catch(j)})(m,I):I(null,null),{cancel:function(){x=!0,g||h.abort()}}})(e,t);if(Er()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return(function(a,l){var c=new Y.XMLHttpRequest;for(var h in c.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(c.responseType="arraybuffer"),a.headers)c.setRequestHeader(h,a.headers[h]);return a.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=a.credentials==="include",c.onerror=function(){l(new Error(c.statusText))},c.onload=function(){if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){var m=c.response;if(a.type==="json")try{m=JSON.parse(c.response)}catch(g){return l(g)}l(null,m,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else l(new tr(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}})(e,t)},ii=function(e,t){return qi(Re(e,{type:"arrayBuffer"}),t)},Yt=function(e,t){return qi(Re(e,{method:"POST"}),t)},T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";_t=[],fi=0;var P=function(e,t){if(Nr.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),fi>=Nt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return _t.push(r),r}fi++;var a=!1,l=function(){if(!a)for(a=!0,fi--;_t.length&&fi<Nt.MAX_PARALLEL_IMAGE_REQUESTS;){var h=_t.shift();h.cancelled||(h.cancel=P(h.requestParameters,h.callback).cancel)}},c=ii(e,(function(h,m,g,x){l(),h?t(h):m&&(_e()?(function(S,I){var C=new Y.Blob([new Uint8Array(S)],{type:"image/png"});Y.createImageBitmap(C).then((function(z){I(null,z)})).catch((function(z){I(new Error("Could not load image because of "+z.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))})(m,t):(function(S,I,C,z){var j=new Y.Image,G=Y.URL;j.onload=function(){I(null,j),G.revokeObjectURL(j.src),j.onload=null,Y.requestAnimationFrame((function(){j.src=T}))},j.onerror=function(){return I(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 te=new Y.Blob([new Uint8Array(S)],{type:"image/png"});j.cacheControl=C,j.expires=z,j.src=S.byteLength?G.createObjectURL(te):T})(m,t,g,x))}));return{cancel:function(){c.cancel(),l()}}};function B(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function V(e,t,r){if(r&&r[e]){var a=r[e].indexOf(t);a!==-1&&r[e].splice(a,1)}}var Z=function(e,t){t===void 0&&(t={}),Re(this,t),this.type=e},re=(function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",Re({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Z),ie=function(){};ie.prototype.on=function(e,t){return this._listeners=this._listeners||{},B(e,t,this._listeners),this},ie.prototype.off=function(e,t){return V(e,t,this._listeners),V(e,t,this._oneTimeListeners),this},ie.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},B(e,t,this._oneTimeListeners),this},ie.prototype.fire=function(e,t){typeof e=="string"&&(e=new Z(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var a=0,l=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];a<l.length;a+=1)l[a].call(this,e);for(var c=0,h=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];c<h.length;c+=1){var m=h[c];V(r,m,this._oneTimeListeners),m.call(this,e)}var g=this._eventedParent;g&&(Re(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(e))}else e instanceof re&&console.error(e.error);return this},ie.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ie.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var L={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},H=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function se(e){var t=e.value;return t?[new H(e.key,t,"constants have been deprecated as of v8")]:[]}function Se(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,l=t;a<l.length;a+=1){var c=l[a];for(var h in c)e[h]=c[h]}return e}function Ee(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function me(e){if(Array.isArray(e))return e.map(me);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=me(e[r]);return t}return Ee(e)}var Ae=(function(e){function t(r,a){e.call(this,a),this.message=a,this.key=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Error),Je=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var r=0,a=t;r<a.length;r+=1){var l=a[r];this.bindings[l[0]]=l[1]}};Je.prototype.concat=function(e){return new Je(this,e)},Je.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Je.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Ze={kind:"null"},ge={kind:"number"},Ne={kind:"string"},ze={kind:"boolean"},Be={kind:"color"},yt={kind:"object"},qe={kind:"value"},Et={kind:"collator"},rr={kind:"formatted"},Pt={kind:"resolvedImage"};function Gt(e,t){return{kind:"array",itemType:e,N:t}}function Dt(e){if(e.kind==="array"){var t=Dt(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var wi=[Ze,ge,Ne,ze,Be,rr,yt,Gt(qe),Pt];function Ht(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Ht(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(var r=0,a=wi;r<a.length;r+=1)if(!Ht(a[r],t))return null}}return"Expected "+Dt(e)+" but found "+Dt(t)+" instead."}function Pr(e,t){return t.some((function(r){return r.kind===e.kind}))}function Qt(e,t){return t.some((function(r){return r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e}))}var Bt=U((function(e,t){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 a(m){return(m=Math.round(m))<0?0:m>255?255:m}function l(m){return a(m[m.length-1]==="%"?parseFloat(m)/100*255:parseInt(m))}function c(m){return(g=m[m.length-1]==="%"?parseFloat(m)/100:parseFloat(m))<0?0:g>1?1:g;var g}function h(m,g,x){return x<0?x+=1:x>1&&(x-=1),6*x<1?m+(g-m)*x*6:2*x<1?g:3*x<2?m+(g-m)*(2/3-x)*6:m}try{t.parseCSSColor=function(m){var g,x=m.replace(/ /g,"").toLowerCase();if(x in r)return r[x].slice();if(x[0]==="#")return x.length===4?(g=parseInt(x.substr(1),16))>=0&&g<=4095?[(3840&g)>>4|(3840&g)>>8,240&g|(240&g)>>4,15&g|(15&g)<<4,1]:null:x.length===7&&(g=parseInt(x.substr(1),16))>=0&&g<=16777215?[(16711680&g)>>16,(65280&g)>>8,255&g,1]:null;var S=x.indexOf("("),I=x.indexOf(")");if(S!==-1&&I+1===x.length){var C=x.substr(0,S),z=x.substr(S+1,I-(S+1)).split(","),j=1;switch(C){case"rgba":if(z.length!==4)return null;j=c(z.pop());case"rgb":return z.length!==3?null:[l(z[0]),l(z[1]),l(z[2]),j];case"hsla":if(z.length!==4)return null;j=c(z.pop());case"hsl":if(z.length!==3)return null;var G=(parseFloat(z[0])%360+360)%360/360,te=c(z[1]),K=c(z[2]),oe=K<=.5?K*(te+1):K+te-K*te,le=2*K-oe;return[a(255*h(le,oe,G+1/3)),a(255*h(le,oe,G)),a(255*h(le,oe,G-1/3)),j];default:return null}}return null}}catch{}})).parseCSSColor,Zt=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};Zt.parse=function(e){if(e){if(e instanceof Zt)return e;if(typeof e=="string"){var t=Bt(e);if(t)return new Zt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Zt.prototype.toString=function(){var e=this.toArray(),t=e[1],r=e[2],a=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+a+")"},Zt.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},Zt.black=new Zt(0,0,0,1),Zt.white=new Zt(1,1,1,1),Zt.transparent=new Zt(0,0,0,0),Zt.red=new Zt(1,0,0,1);var zi=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};zi.prototype.compare=function(e,t){return this.collator.compare(e,t)},zi.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ma=function(e,t,r,a,l){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=l},ni=function(e){this.sections=e};ni.fromString=function(e){return new ni([new ma(e,null,null,null,null)])},ni.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some((function(e){return e.text.length!==0||e.image&&e.image.name.length!==0}))},ni.factory=function(e){return e instanceof ni?e:ni.fromString(e)},ni.prototype.toString=function(){return this.sections.length===0?"":this.sections.map((function(e){return e.text})).join("")},ni.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];if(a.image)e.push(["image",a.image.name]);else{e.push(a.text);var l={};a.fontStack&&(l["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(l["font-scale"]=a.scale),a.textColor&&(l["text-color"]=["rgba"].concat(a.textColor.toArray())),e.push(l)}}return e};var Di=function(e){this.name=e.name,this.available=e.available};function eu(e,t,r,a){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value ["+[e,t,r,a].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof a=="number"?[e,t,r,a]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ya(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof Zt||e instanceof zi||e instanceof ni||e instanceof Di)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!ya(r[t]))return!1;return!0}if(typeof e=="object"){for(var a in e)if(!ya(e[a]))return!1;return!0}return!1}function Cr(e){if(e===null)return Ze;if(typeof e=="string")return Ne;if(typeof e=="boolean")return ze;if(typeof e=="number")return ge;if(e instanceof Zt)return Be;if(e instanceof zi)return Et;if(e instanceof ni)return rr;if(e instanceof Di)return Pt;if(Array.isArray(e)){for(var t,r=e.length,a=0,l=e;a<l.length;a+=1){var c=Cr(l[a]);if(t){if(t===c)continue;t=qe;break}t=c}return Gt(t||qe,r)}return yt}function va(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof Zt||e instanceof ni||e instanceof Di?e.toString():JSON.stringify(e)}Di.prototype.toString=function(){return this.name},Di.fromString=function(e){return e?new Di({name:e,available:!1}):null},Di.prototype.serialize=function(){return["image",this.name]};var Si=function(e,t){this.type=e,this.value=t};Si.parse=function(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ya(e[1]))return t.error("invalid value");var r=e[1],a=Cr(r),l=t.expectedType;return a.kind!=="array"||a.N!==0||!l||l.kind!=="array"||typeof l.N=="number"&&l.N!==0||(a=l),new Si(a,r)},Si.prototype.evaluate=function(){return this.value},Si.prototype.eachChild=function(){},Si.prototype.outputDefined=function(){return!0},Si.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Zt?["rgba"].concat(this.value.toArray()):this.value instanceof ni?this.value.serialize():this.value};var oi=function(e){this.name="ExpressionEvaluationError",this.message=e};oi.prototype.toJSON=function(){return this.message};var nn={string:Ne,number:ge,boolean:ze,object:yt},yr=function(e,t){this.type=e,this.args=t};yr.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,a=1,l=e[0];if(l==="array"){var c,h;if(e.length>2){var m=e[1];if(typeof m!="string"||!(m in nn)||m==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=nn[m],a++}else c=qe;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);h=e[2],a++}r=Gt(c,h)}else r=nn[l];for(var g=[];a<e.length;a++){var x=t.parse(e[a],a,qe);if(!x)return null;g.push(x)}return new yr(r,g)},yr.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Ht(this.type,Cr(r)))return r;if(t===this.args.length-1)throw new oi("Expected value to be of type "+Dt(this.type)+", but found "+Dt(Cr(r))+" instead.")}return null},yr.prototype.eachChild=function(e){this.args.forEach(e)},yr.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},yr.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var a=e.N;(typeof a=="number"||this.args.length>1)&&t.push(a)}}return t.concat(this.args.map((function(l){return l.serialize()})))};var yn=function(e){this.type=rr,this.sections=e};yn.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");for(var a=[],l=!1,c=1;c<=e.length-1;++c){var h=e[c];if(l&&typeof h=="object"&&!Array.isArray(h)){l=!1;var m=null;if(h["font-scale"]&&!(m=t.parse(h["font-scale"],1,ge)))return null;var g=null;if(h["text-font"]&&!(g=t.parse(h["text-font"],1,Gt(Ne))))return null;var x=null;if(h["text-color"]&&!(x=t.parse(h["text-color"],1,Be)))return null;var S=a[a.length-1];S.scale=m,S.font=g,S.textColor=x}else{var I=t.parse(e[c],1,qe);if(!I)return null;var C=I.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");l=!0,a.push({content:I,scale:null,font:null,textColor:null})}}return new yn(a)},yn.prototype.evaluate=function(e){return new ni(this.sections.map((function(t){var r=t.content.evaluate(e);return Cr(r)===Pt?new ma("",r,null,null,null):new ma(va(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},yn.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e(a.content),a.scale&&e(a.scale),a.font&&e(a.font),a.textColor&&e(a.textColor)}},yn.prototype.outputDefined=function(){return!1},yn.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e.push(a.content.serialize());var l={};a.scale&&(l["font-scale"]=a.scale.serialize()),a.font&&(l["text-font"]=a.font.serialize()),a.textColor&&(l["text-color"]=a.textColor.serialize()),e.push(l)}return e};var Ji=function(e){this.type=Pt,this.input=e};Ji.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Ne);return r?new Ji(r):t.error("No image name provided.")},Ji.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=Di.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},Ji.prototype.eachChild=function(e){e(this.input)},Ji.prototype.outputDefined=function(){return!1},Ji.prototype.serialize=function(){return["image",this.input.serialize()]};var il={"to-boolean":ze,"to-color":Be,"to-number":ge,"to-string":Ne},on=function(e,t){this.type=e,this.args=t};on.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");for(var a=il[r],l=[],c=1;c<e.length;c++){var h=t.parse(e[c],c,qe);if(!h)return null;l.push(h)}return new on(a,l)},on.prototype.evaluate=function(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){for(var t,r,a=0,l=this.args;a<l.length;a+=1){if(r=null,(t=l[a].evaluate(e))instanceof Zt)return t;if(typeof t=="string"){var c=e.parseColor(t);if(c)return c}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":eu(t[0],t[1],t[2],t[3])))return new Zt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new oi(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var h=null,m=0,g=this.args;m<g.length;m+=1){if((h=g[m].evaluate(e))===null)return 0;var x=Number(h);if(!isNaN(x))return x}throw new oi("Could not convert "+JSON.stringify(h)+" to number.")}return this.type.kind==="formatted"?ni.fromString(va(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Di.fromString(va(this.args[0].evaluate(e))):va(this.args[0].evaluate(e))},on.prototype.eachChild=function(e){this.args.forEach(e)},on.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},on.prototype.serialize=function(){if(this.type.kind==="formatted")return new yn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ji(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var Pc=["Unknown","Point","LineString","Polygon"],Dn=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Dn.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Dn.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Pc[this.feature.type]:this.feature.type:null},Dn.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Dn.prototype.canonicalID=function(){return this.canonical},Dn.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Dn.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Zt.parse(e)),t};var di=function(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a};di.prototype.evaluate=function(e){return this._evaluate(e,this.args)},di.prototype.eachChild=function(e){this.args.forEach(e)},di.prototype.outputDefined=function(){return!1},di.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},di.parse=function(e,t){var r,a=e[0],l=di.definitions[a];if(!l)return t.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0);for(var c=Array.isArray(l)?l[0]:l.type,h=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,m=h.filter((function(ot){var je=ot[0];return!Array.isArray(je)||je.length===e.length-1})),g=null,x=0,S=m;x<S.length;x+=1){var I=S[x],C=I[0],z=I[1];g=new Wn(t.registry,t.path,null,t.scope);for(var j=[],G=!1,te=1;te<e.length;te++){var K=e[te],oe=Array.isArray(C)?C[te-1]:C.type,le=g.parse(K,1+j.length,oe);if(!le){G=!0;break}j.push(le)}if(!G)if(Array.isArray(C)&&C.length!==j.length)g.error("Expected "+C.length+" arguments, but found "+j.length+" instead.");else{for(var ce=0;ce<j.length;ce++){var he=Array.isArray(C)?C[ce]:C.type,xe=j[ce];g.concat(ce+1).checkSubtype(he,xe.type)}if(g.errors.length===0)return new di(a,c,z,j)}}if(m.length===1)(r=t.errors).push.apply(r,g.errors);else{for(var Pe=(m.length?m:h).map((function(ot){var je;return je=ot[0],Array.isArray(je)?"("+je.map(Dt).join(", ")+")":"("+Dt(je.type)+"...)"})).join(" | "),De=[],rt=1;rt<e.length;rt++){var Ue=t.parse(e[rt],1+De.length);if(!Ue)return null;De.push(Dt(Ue.type))}t.error("Expected arguments of type "+Pe+", but found ("+De.join(", ")+") instead.")}return null},di.register=function(e,t){for(var r in di.definitions=t,t)e[r]=di};var In=function(e,t,r){this.type=Et,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function Ii(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function vo(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Cc(e,t){var r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*8192),Math.round(a*l*8192)]}function kc(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function tu(e,t){for(var r,a,l,c,h,m,g,x=!1,S=0,I=t.length;S<I;S++)for(var C=t[S],z=0,j=C.length;z<j-1;z++){if((c=(r=e)[0]-(a=C[z])[0])*(g=r[1]-(l=C[z+1])[1])-(m=r[0]-l[0])*(h=r[1]-a[1])==0&&c*m<=0&&h*g<=0)return!1;kc(e,C[z],C[z+1])&&(x=!x)}return x}function Mc(e,t){for(var r=0;r<t.length;r++)if(tu(e,t[r]))return!0;return!1}function nl(e,t,r,a){var l=a[0]-r[0],c=a[1]-r[1],h=(e[0]-r[0])*c-l*(e[1]-r[1]),m=(t[0]-r[0])*c-l*(t[1]-r[1]);return h>0&&m<0||h<0&&m>0}function Bc(e,t,r){for(var a=0,l=r;a<l.length;a+=1)for(var c=l[a],h=0;h<c.length-1;++h)if((I=[(S=c[h+1])[0]-(x=c[h])[0],S[1]-x[1]])[0]*(C=[(g=t)[0]-(m=e)[0],g[1]-m[1]])[1]-I[1]*C[0]!=0&&nl(m,g,x,S)&&nl(x,S,m,g))return!0;var m,g,x,S,I,C;return!1}function ol(e,t){for(var r=0;r<e.length;++r)if(!tu(e[r],t))return!1;for(var a=0;a<e.length-1;++a)if(Bc(e[a],e[a+1],t))return!1;return!0}function al(e,t){for(var r=0;r<t.length;r++)if(ol(e,t[r]))return!0;return!1}function Wo(e,t,r){for(var a=[],l=0;l<e.length;l++){for(var c=[],h=0;h<e[l].length;h++){var m=Cc(e[l][h],r);Ii(t,m),c.push(m)}a.push(c)}return a}function ru(e,t,r){for(var a=[],l=0;l<e.length;l++){var c=Wo(e[l],t,r);a.push(c)}return a}function ga(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){var l=.5*a,c=e[0]-r[0]>l?-a:r[0]-e[0]>l?a:0;c===0&&(c=e[0]-r[2]>l?-a:r[2]-e[0]>l?a:0),e[0]+=c}Ii(t,e)}function sl(e,t,r,a){for(var l=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],h=[],m=0,g=e;m<g.length;m+=1)for(var x=0,S=g[m];x<S.length;x+=1){var I=S[x],C=[I.x+c[0],I.y+c[1]];ga(C,t,r,l),h.push(C)}return h}function Qa(e,t,r,a){for(var l,c=8192*Math.pow(2,a.z),h=[8192*a.x,8192*a.y],m=[],g=0,x=e;g<x.length;g+=1){for(var S=[],I=0,C=x[g];I<C.length;I+=1){var z=C[I],j=[z.x+h[0],z.y+h[1]];Ii(t,j),S.push(j)}m.push(S)}if(t[2]-t[0]<=c/2){(l=t)[0]=l[1]=1/0,l[2]=l[3]=-1/0;for(var G=0,te=m;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1)ga(oe[K],t,r,c)}return m}In.parse=function(e,t){if(e.length!==2)return t.error("Expected one argument.");var r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");var a=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,ze);if(!a)return null;var l=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,ze);if(!l)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,Ne))?null:new In(a,l,c)},In.prototype.evaluate=function(e){return new zi(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},In.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var an=function(e,t){this.type=ze,this.geojson=e,this.geometries=t};function Gn(e){if(e instanceof di&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof an)return!1;var t=!0;return e.eachChild((function(r){t&&!Gn(r)&&(t=!1)})),t}function Zn(e){if(e instanceof di&&e.name==="feature-state")return!1;var t=!0;return e.eachChild((function(r){t&&!Zn(r)&&(t=!1)})),t}function go(e,t){if(e instanceof di&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(a){r&&!go(a,t)&&(r=!1)})),r}an.parse=function(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ya(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var a=0;a<r.features.length;++a){var l=r.features[a].geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new an(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new an(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new an(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},an.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=sl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,x=m;g<x.length;g+=1)if(!tu(x[g],h))return!1}if(r.type==="MultiPolygon"){var S=ru(r.coordinates,l,c),I=sl(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!Mc(z[C],S))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(t,r){var a=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=Wo(r.coordinates,l,c),m=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var g=0,x=m;g<x.length;g+=1)if(!ol(x[g],h))return!1}if(r.type==="MultiPolygon"){var S=ru(r.coordinates,l,c),I=Qa(t.geometry(),a,l,c);if(!vo(a,l))return!1;for(var C=0,z=I;C<z.length;C+=1)if(!al(z[C],S))return!1}return!0})(e,this.geometries)}return!1},an.prototype.eachChild=function(){},an.prototype.outputDefined=function(){return!0},an.prototype.serialize=function(){return["within",this.geojson]};var $n=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};$n.parse=function(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new $n(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},$n.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},$n.prototype.eachChild=function(){},$n.prototype.outputDefined=function(){return!1},$n.prototype.serialize=function(){return["var",this.name]};var Wn=function(e,t,r,a,l){t===void 0&&(t=[]),a===void 0&&(a=new Je),l===void 0&&(l=[]),this.registry=e,this.path=t,this.key=t.map((function(c){return"["+c+"]"})).join(""),this.scope=a,this.errors=l,this.expectedType=r};function es(e,t){for(var r,a=e.length-1,l=0,c=a,h=0;l<=c;)if((r=e[h=Math.floor((l+c)/2)])<=t){if(h===a||t<e[h+1])return h;l=h+1}else{if(!(r>t))throw new oi("Input is not a number.");c=h-1}return 0}Wn.prototype.parse=function(e,t,r,a,l){return l===void 0&&(l={}),t?this.concat(t,r,a)._parse(e,l):this._parse(e,l)},Wn.prototype._parse=function(e,t){function r(x,S,I){return I==="assert"?new yr(S,[x]):I==="coerce"?new on(S,[x]):x}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var a=e[0];if(typeof a!="string")return this.error("Expression name must be a string, but found "+typeof a+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var l=this.registry[a];if(l){var c=l.parse(e,this);if(!c)return null;if(this.expectedType){var h=this.expectedType,m=c.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||m.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(h,m))return null}else c=r(c,h,t.typeAnnotation||"coerce");else c=r(c,h,t.typeAnnotation||"assert")}if(!(c instanceof Si)&&c.type.kind!=="resolvedImage"&&(function x(S){if(S instanceof $n)return x(S.boundExpression);if(S instanceof di&&S.name==="error"||S instanceof In||S instanceof an)return!1;var I=S instanceof on||S instanceof yr,C=!0;return S.eachChild((function(z){C=I?C&&x(z):C&&z instanceof Si})),!!C&&Gn(S)&&go(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])})(c)){var g=new Dn;try{c=new Si(c.type,c.evaluate(g))}catch(x){return this.error(x.message),null}}return c}return this.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof e+" instead.")},Wn.prototype.concat=function(e,t,r){var a=typeof e=="number"?this.path.concat(e):this.path,l=r?this.scope.concat(r):this.scope;return new Wn(this.registry,a,t||null,l,this.errors)},Wn.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var a=""+this.key+t.map((function(l){return"["+l+"]"})).join("");this.errors.push(new Ae(a,e))},Wn.prototype.checkSubtype=function(e,t){var r=Ht(e,t);return r&&this.error(r),r};var Ui=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var a=0,l=r;a<l.length;a+=1){var c=l[a],h=c[1];this.labels.push(c[0]),this.outputs.push(h)}};function Vr(e,t,r){return e*(1-r)+t*r}Ui.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=[],l=null;t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(var c=1;c<e.length;c+=2){var h=c===1?-1/0:e[c],m=e[c+1],g=c,x=c+1;if(typeof h!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',g);if(a.length&&a[a.length-1][0]>=h)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',g);var S=t.parse(m,x,l);if(!S)return null;l=l||S.type,a.push([h,S])}return new Ui(l,r,a)},Ui.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;return a>=t[l-1]?r[l-1].evaluate(e):r[es(t,a)].evaluate(e)},Ui.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Ui.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},Ui.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Ho=Object.freeze({__proto__:null,number:Vr,color:function(e,t,r){return new Zt(Vr(e.r,t.r,r),Vr(e.g,t.g,r),Vr(e.b,t.b,r),Vr(e.a,t.a,r))},array:function(e,t,r){return e.map((function(a,l){return Vr(a,t[l],r)}))}}),ul=6/29*3*(6/29),zc=Math.PI/180,Dc=180/Math.PI;function iu(e){return e>.008856451679035631?Math.pow(e,1/3):e/ul+4/29}function nu(e){return e>6/29?e*e*e:ul*(e-4/29)}function ou(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function au(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ll(e){var t=au(e.r),r=au(e.g),a=au(e.b),l=iu((.4124564*t+.3575761*r+.1804375*a)/.95047),c=iu((.2126729*t+.7151522*r+.072175*a)/1);return{l:116*c-16,a:500*(l-c),b:200*(c-iu((.0193339*t+.119192*r+.9503041*a)/1.08883)),alpha:e.a}}function cl(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,a=isNaN(e.b)?t:t-e.b/200;return t=1*nu(t),r=.95047*nu(r),a=1.08883*nu(a),new Zt(ou(3.2404542*r-1.5371385*t-.4985314*a),ou(-.969266*r+1.8760108*t+.041556*a),ou(.0556434*r-.2040259*t+1.0572252*a),e.alpha)}function Rc(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var _a={forward:ll,reverse:cl,interpolate:function(e,t,r){return{l:Vr(e.l,t.l,r),a:Vr(e.a,t.a,r),b:Vr(e.b,t.b,r),alpha:Vr(e.alpha,t.alpha,r)}}},xa={forward:function(e){var t=ll(e),r=t.l,a=t.a,l=t.b,c=Math.atan2(l,a)*Dc;return{h:c<0?c+360:c,c:Math.sqrt(a*a+l*l),l:r,alpha:e.a}},reverse:function(e){var t=e.h*zc,r=e.c;return cl({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Rc(e.h,t.h,r),c:Vr(e.c,t.c,r),l:Vr(e.l,t.l,r),alpha:Vr(e.alpha,t.alpha,r)}}},pl=Object.freeze({__proto__:null,lab:_a,hcl:xa}),mi=function(e,t,r,a,l){this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(var c=0,h=l;c<h.length;c+=1){var m=h[c],g=m[1];this.labels.push(m[0]),this.outputs.push(g)}};function su(e,t,r,a){var l=a-r,c=e-r;return l===0?0:t===1?c/l:(Math.pow(t,c)-1)/(Math.pow(t,l)-1)}mi.interpolationFactor=function(e,t,r,a){var l=0;if(e.name==="exponential")l=su(t,e.base,r,a);else if(e.name==="linear")l=su(t,1,r,a);else if(e.name==="cubic-bezier"){var c=e.controlPoints;l=new k(c[0],c[1],c[2],c[3]).solve(su(t,1,r,a))}return l},mi.parse=function(e,t){var r=e[0],a=e[1],l=e[2],c=e.slice(3);if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){var h=a[1];if(typeof h!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:h}}else{if(a[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(a[0]),1,0);var m=a.slice(1);if(m.length!==4||m.some((function(te){return typeof te!="number"||te<0||te>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:m}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(l=t.parse(l,2,ge)))return null;var g=[],x=null;r==="interpolate-hcl"||r==="interpolate-lab"?x=Be:t.expectedType&&t.expectedType.kind!=="value"&&(x=t.expectedType);for(var S=0;S<c.length;S+=2){var I=c[S],C=c[S+1],z=S+3,j=S+4;if(typeof I!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(g.length&&g[g.length-1][0]>=I)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);var G=t.parse(C,j,x);if(!G)return null;x=x||G.type,g.push([I,G])}return x.kind==="number"||x.kind==="color"||x.kind==="array"&&x.itemType.kind==="number"&&typeof x.N=="number"?new mi(x,r,a,l,g):t.error("Type "+Dt(x)+" is not interpolatable.")},mi.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var l=t.length;if(a>=t[l-1])return r[l-1].evaluate(e);var c=es(t,a),h=mi.interpolationFactor(this.interpolation,a,t[c],t[c+1]),m=r[c].evaluate(e),g=r[c+1].evaluate(e);return this.operator==="interpolate"?Ho[this.type.kind.toLowerCase()](m,g,h):this.operator==="interpolate-hcl"?xa.reverse(xa.interpolate(xa.forward(m),xa.forward(g),h)):_a.reverse(_a.interpolate(_a.forward(m),_a.forward(g),h))},mi.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},mi.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},mi.prototype.serialize=function(){var e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var Hn=function(e,t){this.type=e,this.args=t};Hn.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,a=t.expectedType;a&&a.kind!=="value"&&(r=a);for(var l=[],c=0,h=e.slice(1);c<h.length;c+=1){var m=t.parse(h[c],1+l.length,r,void 0,{typeAnnotation:"omit"});if(!m)return null;r=r||m.type,l.push(m)}var g=a&&l.some((function(x){return Ht(a,x.type)}));return new Hn(g?qe:r,l)},Hn.prototype.evaluate=function(e){for(var t,r=null,a=0,l=0,c=this.args;l<c.length&&(a++,(r=c[l].evaluate(e))&&r instanceof Di&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);l+=1);return r},Hn.prototype.eachChild=function(e){this.args.forEach(e)},Hn.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},Hn.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Xn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Xn.prototype.evaluate=function(e){return this.result.evaluate(e)},Xn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Xn.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],a=1;a<e.length-1;a+=2){var l=e[a];if(typeof l!="string")return t.error("Expected string, but found "+typeof l+" instead.",a);if(/[^a-zA-Z0-9_]/.test(l))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);var c=t.parse(e[a+1],a+1);if(!c)return null;r.push([l,c])}var h=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return h?new Xn(r,h):null},Xn.prototype.outputDefined=function(){return this.result.outputDefined()},Xn.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var a=r[t];e.push(a[0],a[1].serialize())}return e.push(this.result.serialize()),e};var _o=function(e,t,r){this.type=e,this.index=t,this.input=r};_o.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ge),a=t.parse(e[2],2,Gt(t.expectedType||qe));return r&&a?new _o(a.type.itemType,r,a):null},_o.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new oi("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new oi("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new oi("Array index must be an integer, but found "+t+" instead.");return r[t]},_o.prototype.eachChild=function(e){e(this.index),e(this.input)},_o.prototype.outputDefined=function(){return!1},_o.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var xo=function(e,t){this.type=ze,this.needle=e,this.haystack=t};xo.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,qe),a=t.parse(e[2],2,qe);return r&&a?Pr(r.type,[ze,Ne,ge,Ze,qe])?new xo(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead"):null},xo.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Cr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Dt(Cr(r))+" instead.");return r.indexOf(t)>=0},xo.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},xo.prototype.outputDefined=function(){return!0},xo.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Kn=function(e,t,r){this.type=ge,this.needle=e,this.haystack=t,this.fromIndex=r};Kn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,qe),a=t.parse(e[2],2,qe);if(!r||!a)return null;if(!Pr(r.type,[ze,Ne,ge,Ze,qe]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Dt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Kn(r,a,l):null}return new Kn(r,a)},Kn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Qt(t,["boolean","string","number","null"]))throw new oi("Expected first argument to be of type boolean, string, number or null, but found "+Dt(Cr(t))+" instead.");if(!Qt(r,["string","array"]))throw new oi("Expected second argument to be of type array or string, but found "+Dt(Cr(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Kn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Kn.prototype.outputDefined=function(){return!1},Kn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var bo=function(e,t,r,a,l,c){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=l,this.otherwise=c};bo.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(var l={},c=[],h=2;h<e.length-1;h+=2){var m=e[h],g=e[h+1];Array.isArray(m)||(m=[m]);var x=t.concat(h);if(m.length===0)return x.error("Expected at least one branch label.");for(var S=0,I=m;S<I.length;S+=1){var C=I[S];if(typeof C!="number"&&typeof C!="string")return x.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return x.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof C=="number"&&Math.floor(C)!==C)return x.error("Numeric branch labels must be integer values.");if(r){if(x.checkSubtype(r,Cr(C)))return null}else r=Cr(C);if(l[String(C)]!==void 0)return x.error("Branch labels must be unique.");l[String(C)]=c.length}var z=t.parse(g,h,a);if(!z)return null;a=a||z.type,c.push(z)}var j=t.parse(e[1],1,qe);if(!j)return null;var G=t.parse(e[e.length-1],e.length-1,a);return G?j.type.kind!=="value"&&t.concat(1).checkSubtype(r,j.type)?null:new bo(r,a,j,l,c,G):null},bo.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Cr(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},bo.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},bo.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},bo.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],a={},l=0,c=Object.keys(this.cases).sort();l<c.length;l+=1){var h=c[l];(I=a[this.cases[h]])===void 0?(a[this.cases[h]]=r.length,r.push([this.cases[h],[h]])):r[I][1].push(h)}for(var m=function(z){return e.inputType.kind==="number"?Number(z):z},g=0,x=r;g<x.length;g+=1){var S=x[g],I=S[0],C=S[1];t.push(C.length===1?m(C[0]):C.map(m)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var wo=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};wo.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);for(var a=[],l=1;l<e.length-1;l+=2){var c=t.parse(e[l],l,ze);if(!c)return null;var h=t.parse(e[l+1],l+1,r);if(!h)return null;a.push([c,h]),r=r||h.type}var m=t.parse(e[e.length-1],e.length-1,r);return m?new wo(r,a,m):null},wo.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];if(a[0].evaluate(e))return l.evaluate(e)}return this.otherwise.evaluate(e)},wo.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],l=a[1];e(a[0]),e(l)}e(this.otherwise)},wo.prototype.outputDefined=function(){return this.branches.every((function(e){return e[1].outputDefined()}))&&this.otherwise.outputDefined()},wo.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Jn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function hl(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function fl(e,t,r,a){return a.compare(t,r)===0}function ir(e,t,r){var a=e!=="=="&&e!=="!=";return(function(){function l(c,h,m){this.type=ze,this.lhs=c,this.rhs=h,this.collator=m,this.hasUntypedArgument=c.type.kind==="value"||h.type.kind==="value"}return l.parse=function(c,h){if(c.length!==3&&c.length!==4)return h.error("Expected two or three arguments.");var m=c[0],g=h.parse(c[1],1,qe);if(!g)return null;if(!hl(m,g.type))return h.concat(1).error('"'+m+`" comparisons are not supported for type '`+Dt(g.type)+"'.");var x=h.parse(c[2],2,qe);if(!x)return null;if(!hl(m,x.type))return h.concat(2).error('"'+m+`" comparisons are not supported for type '`+Dt(x.type)+"'.");if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot compare types '"+Dt(g.type)+"' and '"+Dt(x.type)+"'.");a&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new yr(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new yr(g.type,[x])));var S=null;if(c.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(!(S=h.parse(c[3],3,Et)))return null}return new l(g,x,S)},l.prototype.evaluate=function(c){var h=this.lhs.evaluate(c),m=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var g=Cr(h),x=Cr(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new oi('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+g.kind+", "+x.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var S=Cr(h),I=Cr(m);if(S.kind!=="string"||I.kind!=="string")return t(c,h,m)}return this.collator?r(c,h,m,this.collator.evaluate(c)):t(c,h,m)},l.prototype.eachChild=function(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)},l.prototype.outputDefined=function(){return!0},l.prototype.serialize=function(){var c=[e];return this.eachChild((function(h){c.push(h.serialize())})),c},l})()}Jn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,qe),a=t.parse(e[2],2,ge);if(!r||!a)return null;if(!Pr(r.type,[Gt(qe),Ne,qe]))return t.error("Expected first argument to be of type array or string, but found "+Dt(r.type)+" instead");if(e.length===4){var l=t.parse(e[3],3,ge);return l?new Jn(r.type,r,a,l):null}return new Jn(r.type,r,a)},Jn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Qt(t,["string","array"]))throw new oi("Expected first argument to be of type array or string, but found "+Dt(Cr(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},Jn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Jn.prototype.outputDefined=function(){return!1},Jn.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Lc=ir("==",(function(e,t,r){return t===r}),fl),ts=ir("!=",(function(e,t,r){return t!==r}),(function(e,t,r,a){return!fl(0,t,r,a)})),dl=ir("<",(function(e,t,r){return t<r}),(function(e,t,r,a){return a.compare(t,r)<0})),ml=ir(">",(function(e,t,r){return t>r}),(function(e,t,r,a){return a.compare(t,r)>0})),yl=ir("<=",(function(e,t,r){return t<=r}),(function(e,t,r,a){return a.compare(t,r)<=0})),vl=ir(">=",(function(e,t,r){return t>=r}),(function(e,t,r,a){return a.compare(t,r)>=0})),So=function(e,t,r,a,l){this.type=Ne,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=l};So.parse=function(e,t){if(e.length!==3)return t.error("Expected two arguments.");var r=t.parse(e[1],1,ge);if(!r)return null;var a=e[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");var l=null;if(a.locale&&!(l=t.parse(a.locale,1,Ne)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,Ne)))return null;var h=null;if(a["min-fraction-digits"]&&!(h=t.parse(a["min-fraction-digits"],1,ge)))return null;var m=null;return a["max-fraction-digits"]&&!(m=t.parse(a["max-fraction-digits"],1,ge))?null:new So(r,l,c,h,m)},So.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},So.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},So.prototype.outputDefined=function(){return!1},So.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Yn=function(e){this.type=ge,this.input=e};Yn.parse=function(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error("Expected argument of type string or array, but found "+Dt(r.type)+" instead."):new Yn(r):null},Yn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new oi("Expected value to be of type string or array, but found "+Dt(Cr(t))+" instead.")},Yn.prototype.eachChild=function(e){e(this.input)},Yn.prototype.outputDefined=function(){return!1},Yn.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Io={"==":Lc,"!=":ts,">":ml,"<":dl,">=":vl,"<=":yl,array:yr,at:_o,boolean:yr,case:wo,coalesce:Hn,collator:In,format:yn,image:Ji,in:xo,"index-of":Kn,interpolate:mi,"interpolate-hcl":mi,"interpolate-lab":mi,length:Yn,let:Xn,literal:Si,match:bo,number:yr,"number-format":So,object:yr,slice:Jn,step:Ui,string:yr,"to-boolean":on,"to-color":on,"to-number":on,"to-string":on,var:$n,within:an};function gl(e,t){var r=t[0],a=t[1],l=t[2],c=t[3];r=r.evaluate(e),a=a.evaluate(e),l=l.evaluate(e);var h=c?c.evaluate(e):1,m=eu(r,a,l,h);if(m)throw new oi(m);return new Zt(r/255*h,a/255*h,l/255*h,h)}function _l(e,t){return e in t}function uu(e,t){var r=t[e];return r===void 0?null:r}function To(e){return{type:e}}function xl(e){return{result:"success",value:e}}function Ao(e){return{result:"error",value:e}}function Eo(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function bl(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ba(e){return!!e.expression&&e.expression.interpolated}function ur(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function rs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fc(e){return e}function Xo(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function wl(e,t,r,a,l){return Xo(typeof r===l?a[r]:void 0,e.default,t.default)}function Oc(e,t,r){if(ur(r)!=="number")return Xo(e.default,t.default);var a=e.stops.length;if(a===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var l=es(e.stops.map((function(c){return c[0]})),r);return e.stops[l][1]}function Sl(e,t,r){var a=e.base!==void 0?e.base:1;if(ur(r)!=="number")return Xo(e.default,t.default);var l=e.stops.length;if(l===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[l-1][0])return e.stops[l-1][1];var c=es(e.stops.map((function(I){return I[0]})),r),h=(function(I,C,z,j){var G=j-z,te=I-z;return G===0?0:C===1?te/G:(Math.pow(C,te)-1)/(Math.pow(C,G)-1)})(r,a,e.stops[c][0],e.stops[c+1][0]),m=e.stops[c][1],g=e.stops[c+1][1],x=Ho[t.type]||Fc;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=pl[e.colorSpace];x=function(I,C){return S.reverse(S.interpolate(S.forward(I),S.forward(C),h))}}return typeof m.evaluate=="function"?{evaluate:function(){for(var I=[],C=arguments.length;C--;)I[C]=arguments[C];var z=m.evaluate.apply(void 0,I),j=g.evaluate.apply(void 0,I);if(z!==void 0&&j!==void 0)return x(z,j,h)}}:x(m,g,h)}function is(e,t,r){return t.type==="color"?r=Zt.parse(r):t.type==="formatted"?r=ni.fromString(r.toString()):t.type==="resolvedImage"?r=Di.fromString(r.toString()):ur(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),Xo(r,e.default,t.default)}di.register(Io,{error:[{kind:"error"},[Ne],function(e,t){throw new oi(t[0].evaluate(e))}],typeof:[Ne,[qe],function(e,t){return Dt(Cr(t[0].evaluate(e)))}],"to-rgba":[Gt(ge,4),[Be],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Be,[ge,ge,ge],gl],rgba:[Be,[ge,ge,ge,ge],gl],has:{type:ze,overloads:[[[Ne],function(e,t){return _l(t[0].evaluate(e),e.properties())}],[[Ne,yt],function(e,t){var r=t[1];return _l(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:qe,overloads:[[[Ne],function(e,t){return uu(t[0].evaluate(e),e.properties())}],[[Ne,yt],function(e,t){var r=t[1];return uu(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[qe,[Ne],function(e,t){return uu(t[0].evaluate(e),e.featureState||{})}],properties:[yt,[],function(e){return e.properties()}],"geometry-type":[Ne,[],function(e){return e.geometryType()}],id:[qe,[],function(e){return e.id()}],zoom:[ge,[],function(e){return e.globals.zoom}],"heatmap-density":[ge,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[ge,[],function(e){return e.globals.lineProgress||0}],accumulated:[qe,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[ge,To(ge),function(e,t){for(var r=0,a=0,l=t;a<l.length;a+=1)r+=l[a].evaluate(e);return r}],"*":[ge,To(ge),function(e,t){for(var r=1,a=0,l=t;a<l.length;a+=1)r*=l[a].evaluate(e);return r}],"-":{type:ge,overloads:[[[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)-r.evaluate(e)}],[[ge],function(e,t){return-t[0].evaluate(e)}]]},"/":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)/r.evaluate(e)}],"%":[ge,[ge,ge],function(e,t){var r=t[1];return t[0].evaluate(e)%r.evaluate(e)}],ln2:[ge,[],function(){return Math.LN2}],pi:[ge,[],function(){return Math.PI}],e:[ge,[],function(){return Math.E}],"^":[ge,[ge,ge],function(e,t){var r=t[1];return Math.pow(t[0].evaluate(e),r.evaluate(e))}],sqrt:[ge,[ge],function(e,t){return Math.sqrt(t[0].evaluate(e))}],log10:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN10}],ln:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))}],log2:[ge,[ge],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN2}],sin:[ge,[ge],function(e,t){return Math.sin(t[0].evaluate(e))}],cos:[ge,[ge],function(e,t){return Math.cos(t[0].evaluate(e))}],tan:[ge,[ge],function(e,t){return Math.tan(t[0].evaluate(e))}],asin:[ge,[ge],function(e,t){return Math.asin(t[0].evaluate(e))}],acos:[ge,[ge],function(e,t){return Math.acos(t[0].evaluate(e))}],atan:[ge,[ge],function(e,t){return Math.atan(t[0].evaluate(e))}],min:[ge,To(ge),function(e,t){return Math.min.apply(Math,t.map((function(r){return r.evaluate(e)})))}],max:[ge,To(ge),function(e,t){return Math.max.apply(Math,t.map((function(r){return r.evaluate(e)})))}],abs:[ge,[ge],function(e,t){return Math.abs(t[0].evaluate(e))}],round:[ge,[ge],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],function(e,t){return Math.floor(t[0].evaluate(e))}],ceil:[ge,[ge],function(e,t){return Math.ceil(t[0].evaluate(e))}],"filter-==":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[ze,[qe],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[ze,[Ne],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<c}],"filter-id-<":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<l}],"filter->":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>c}],"filter-id->":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>l}],"filter-<=":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l<=c}],"filter-id-<=":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a<=l}],"filter->=":[ze,[Ne,qe],function(e,t){var r=t[0],a=t[1],l=e.properties()[r.value],c=a.value;return typeof l==typeof c&&l>=c}],"filter-id->=":[ze,[qe],function(e,t){var r=t[0],a=e.id(),l=r.value;return typeof a==typeof l&&a>=l}],"filter-has":[ze,[qe],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[ze,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[ze,[Gt(Ne)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[ze,[Gt(qe)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[ze,[Ne,Gt(qe)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[ze,[Ne,Gt(qe)],function(e,t){var r=t[0],a=t[1];return(function(l,c,h,m){for(;h<=m;){var g=h+m>>1;if(c[g]===l)return!0;c[g]>l?m=g-1:h=g+1}return!1})(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:ze,overloads:[[[ze,ze],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[To(ze),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(!a[r].evaluate(e))return!1;return!0}]]},any:{type:ze,overloads:[[[ze,ze],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[To(ze),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[ze,[ze],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[ze,[Ne],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[Ne,[Ne],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Ne,[Ne],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Ne,To(qe),function(e,t){return t.map((function(r){return va(r.evaluate(e))})).join("")}],"resolved-locale":[Ne,[Et],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Ko=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Dn,this._defaultValue=t?(function(r){return r.type==="color"&&rs(r.default)?new Zt(0,0,0,0):r.type==="color"?Zt.parse(r.default)||null:r.default===void 0?null:r.default})(t):null,this._enumValues=t&&t.type==="enum"?t.values:null};function wa(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in Io}function ns(e,t){var r=new Wn(Io,[],t?(function(l){var c={color:Be,string:Ne,number:ge,enum:Ne,boolean:ze,formatted:rr,resolvedImage:Pt};return l.type==="array"?Gt(c[l.value]||qe,l.length):c[l.type]})(t):void 0),a=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?xl(new Ko(a,t)):Ao(r.errors)}Ko.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},Ko.prototype.evaluate=function(e,t,r,a,l,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=c||null;try{var h=this.expression.evaluate(this._evaluator);if(h==null||typeof h=="number"&&h!=h)return this._defaultValue;if(this._enumValues&&!(h in this._enumValues))throw new oi("Expected value to be one of "+Object.keys(this._enumValues).map((function(m){return JSON.stringify(m)})).join(", ")+", but found "+JSON.stringify(h)+" instead.");return h}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}};var Sa=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Zn(t.expression)};Sa.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Sa.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)};var Jo=function(e,t,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Zn(t.expression),this.interpolationType=a};function Il(e,t){if((e=ns(e,t)).result==="error")return e;var r=e.value.expression,a=Gn(r);if(!a&&!Eo(t))return Ao([new Ae("","data expressions not supported")]);var l=go(r,["zoom"]);if(!l&&!bl(t))return Ao([new Ae("","zoom expressions not supported")]);var c=(function h(m){var g=null;if(m instanceof Xn)g=h(m.result);else if(m instanceof Hn)for(var x=0,S=m.args;x<S.length&&!(g=h(S[x]));x+=1);else(m instanceof Ui||m instanceof mi)&&m.input instanceof di&&m.input.name==="zoom"&&(g=m);return g instanceof Ae||m.eachChild((function(I){var C=h(I);C instanceof Ae?g=C:!g&&C?g=new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):g&&C&&g!==C&&(g=new Ae("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),g})(r);return c||l?c instanceof Ae?Ao([c]):c instanceof mi&&!ba(t)?Ao([new Ae("",'"interpolate" expressions cannot be used with this property')]):xl(c?new Jo(a?"camera":"composite",e.value,c.labels,c instanceof mi?c.interpolation:void 0):new Sa(a?"constant":"source",e.value)):Ao([new Ae("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Jo.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,l,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,l,c)},Jo.prototype.evaluate=function(e,t,r,a,l,c){return this._styleExpression.evaluate(e,t,r,a,l,c)},Jo.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?mi.interpolationFactor(this.interpolationType,e,t,r):0};var Yo=function(e,t){this._parameters=e,this._specification=t,Se(this,(function r(a,l){var c,h,m,g=l.type==="color",x=a.stops&&typeof a.stops[0][0]=="object",S=x||!(x||a.property!==void 0),I=a.type||(ba(l)?"exponential":"interval");if(g&&((a=Se({},a)).stops&&(a.stops=a.stops.map((function(Ue){return[Ue[0],Zt.parse(Ue[1])]}))),a.default=Zt.parse(a.default?a.default:l.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!pl[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(I==="exponential")c=Sl;else if(I==="interval")c=Oc;else if(I==="categorical"){c=wl,h=Object.create(null);for(var C=0,z=a.stops;C<z.length;C+=1){var j=z[C];h[j[0]]=j[1]}m=typeof a.stops[0][0]}else{if(I!=="identity")throw new Error('Unknown function type "'+I+'"');c=is}if(x){for(var G={},te=[],K=0;K<a.stops.length;K++){var oe=a.stops[K],le=oe[0].zoom;G[le]===void 0&&(G[le]={zoom:le,type:a.type,property:a.property,default:a.default,stops:[]},te.push(le)),G[le].stops.push([oe[0].value,oe[1]])}for(var ce=[],he=0,xe=te;he<xe.length;he+=1){var Pe=xe[he];ce.push([G[Pe].zoom,r(G[Pe],l)])}var De={name:"linear"};return{kind:"composite",interpolationType:De,interpolationFactor:mi.interpolationFactor.bind(void 0,De),zoomStops:ce.map((function(Ue){return Ue[0]})),evaluate:function(Ue,ot){var je=Ue.zoom;return Sl({stops:ce,base:a.base},l,je).evaluate(je,ot)}}}if(S){var rt=I==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:rt,interpolationFactor:mi.interpolationFactor.bind(void 0,rt),zoomStops:a.stops.map((function(Ue){return Ue[0]})),evaluate:function(Ue){return c(a,l,Ue.zoom,h,m)}}}return{kind:"source",evaluate:function(Ue,ot){var je=ot&&ot.properties?ot.properties[a.property]:void 0;return je===void 0?Xo(a.default,l.default):c(a,l,je,h,m)}}})(this._parameters,this._specification))};function vn(e){var t=e.key,r=e.value,a=e.valueSpec||{},l=e.objectElementValidators||{},c=e.style,h=e.styleSpec,m=[],g=ur(r);if(g!=="object")return[new H(t,r,"object expected, "+g+" found")];for(var x in r){var S=x.split(".")[0],I=a[S]||a["*"],C=void 0;if(l[S])C=l[S];else if(a[S])C=zt;else if(l["*"])C=l["*"];else{if(!a["*"]){m.push(new H(t,r[x],'unknown property "'+x+'"'));continue}C=zt}m=m.concat(C({key:(t&&t+".")+x,value:r[x],valueSpec:I,style:c,styleSpec:h,object:r,objectKey:x},r))}for(var z in a)l[z]||a[z].required&&a[z].default===void 0&&r[z]===void 0&&m.push(new H(t,r,'missing required property "'+z+'"'));return m}function Tl(e){var t=e.value,r=e.valueSpec,a=e.style,l=e.styleSpec,c=e.key,h=e.arrayElementValidator||zt;if(ur(t)!=="array")return[new H(c,t,"array expected, "+ur(t)+" found")];if(r.length&&t.length!==r.length)return[new H(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new H(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var m={type:r.value,values:r.values};l.$version<7&&(m.function=r.function),ur(r.value)==="object"&&(m=r.value);for(var g=[],x=0;x<t.length;x++)g=g.concat(h({array:t,arrayIndex:x,value:t[x],valueSpec:m,style:a,styleSpec:l,key:c+"["+x+"]"}));return g}function Al(e){var t=e.key,r=e.value,a=e.valueSpec,l=ur(r);return l==="number"&&r!=r&&(l="NaN"),l!=="number"?[new H(t,r,"number expected, "+l+" found")]:"minimum"in a&&r<a.minimum?[new H(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new H(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function El(e){var t,r,a,l=e.valueSpec,c=Ee(e.value.type),h={},m=c!=="categorical"&&e.value.property===void 0,g=!m,x=ur(e.value.stops)==="array"&&ur(e.value.stops[0])==="array"&&ur(e.value.stops[0][0])==="object",S=vn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(z){if(c==="identity")return[new H(z.key,z.value,'identity function may not have a "stops" property')];var j=[],G=z.value;return j=j.concat(Tl({key:z.key,value:G,valueSpec:z.valueSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:I})),ur(G)==="array"&&G.length===0&&j.push(new H(z.key,G,"array must have at least one stop")),j},default:function(z){return zt({key:z.key,value:z.value,valueSpec:l,style:z.style,styleSpec:z.styleSpec})}}});return c==="identity"&&m&&S.push(new H(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||S.push(new H(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!ba(e.valueSpec)&&S.push(new H(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(g&&!Eo(e.valueSpec)?S.push(new H(e.key,e.value,"property functions not supported")):m&&!bl(e.valueSpec)&&S.push(new H(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!x||e.value.property!==void 0||S.push(new H(e.key,e.value,'"property" property is required')),S;function I(z){var j=[],G=z.value,te=z.key;if(ur(G)!=="array")return[new H(te,G,"array expected, "+ur(G)+" found")];if(G.length!==2)return[new H(te,G,"array length 2 expected, length "+G.length+" found")];if(x){if(ur(G[0])!=="object")return[new H(te,G,"object expected, "+ur(G[0])+" found")];if(G[0].zoom===void 0)return[new H(te,G,"object stop key must have zoom")];if(G[0].value===void 0)return[new H(te,G,"object stop key must have value")];if(a&&a>Ee(G[0].zoom))return[new H(te,G[0].zoom,"stop zoom values must appear in ascending order")];Ee(G[0].zoom)!==a&&(a=Ee(G[0].zoom),r=void 0,h={}),j=j.concat(vn({key:te+"[0]",value:G[0],valueSpec:{zoom:{}},style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:Al,value:C}}))}else j=j.concat(C({key:te+"[0]",value:G[0],style:z.style,styleSpec:z.styleSpec},G));return wa(me(G[1]))?j.concat([new H(te+"[1]",G[1],"expressions are not allowed in function stops.")]):j.concat(zt({key:te+"[1]",value:G[1],valueSpec:l,style:z.style,styleSpec:z.styleSpec}))}function C(z,j){var G=ur(z.value),te=Ee(z.value),K=z.value!==null?z.value:j;if(t){if(G!==t)return[new H(z.key,K,G+" stop domain type must match previous stop domain type "+t)]}else t=G;if(G!=="number"&&G!=="string"&&G!=="boolean")return[new H(z.key,K,"stop domain value must be a number, string, or boolean")];if(G!=="number"&&c!=="categorical"){var oe="number expected, "+G+" found";return Eo(l)&&c===void 0&&(oe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new H(z.key,K,oe)]}return c!=="categorical"||G!=="number"||isFinite(te)&&Math.floor(te)===te?c!=="categorical"&&G==="number"&&r!==void 0&&te<r?[new H(z.key,K,"stop domain values must appear in ascending order")]:(r=te,c==="categorical"&&te in h?[new H(z.key,K,"stop domain values must be unique")]:(h[te]=!0,[])):[new H(z.key,K,"integer expected, found "+te)]}}function Po(e){var t=(e.expressionContext==="property"?Il:ns)(me(e.value),e.valueSpec);if(t.result==="error")return t.value.map((function(a){return new H(""+e.key+a.key,e.value,a.message)}));var r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new H(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Zn(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!Zn(r))return[new H(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!go(r,["zoom","feature-state"]))return[new H(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Gn(r))return[new H(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ia(e){var t=e.key,r=e.value,a=e.valueSpec,l=[];return Array.isArray(a.values)?a.values.indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(Ee(r))===-1&&l.push(new H(t,r,"expected one of ["+Object.keys(a.values).join(", ")+"], "+JSON.stringify(r)+" found")),l}function os(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var a=r[t];if(!os(a)&&typeof a!="boolean")return!1}return!0;default:return!0}}Yo.deserialize=function(e){return new Yo(e._parameters,e._specification)},Yo.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var lu={type:"boolean",default:!1};function as(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};os(e)||(e=ss(e));var t=ns(e,lu);if(t.result==="error")throw new Error(t.value.map((function(r){return r.key+": "+r.message})).join(", "));return{filter:function(r,a,l){return t.value.evaluate(r,a,{},l)},needGeometry:(function r(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(var l=1;l<a.length;l++)if(r(a[l]))return!0;return!1})(e)}}function Vc(e,t){return e<t?-1:e>t?1:0}function ss(e){if(!e)return!0;var t,r=e[0];return e.length<=1?r!=="any":r==="=="?cu(e[1],e[2],"=="):r==="!="?us(cu(e[1],e[2],"==")):r==="<"||r===">"||r==="<="||r===">="?cu(e[1],e[2],r):r==="any"?(t=e.slice(1),["any"].concat(t.map(ss))):r==="all"?["all"].concat(e.slice(1).map(ss)):r==="none"?["all"].concat(e.slice(1).map(ss).map(us)):r==="in"?Pl(e[1],e.slice(2)):r==="!in"?us(Pl(e[1],e.slice(2))):r==="has"?Cl(e[1]):r==="!has"?us(Cl(e[1])):r!=="within"||e}function cu(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Pl(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(r){return typeof r!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Vc)]]:["filter-in-small",e,["literal",t]]}}function Cl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function us(e){return["!",e]}function pu(e){return os(me(e.value))?Po(Se({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):(function t(r){var a=r.value,l=r.key;if(ur(a)!=="array")return[new H(l,a,"array expected, "+ur(a)+" found")];var c,h=r.styleSpec,m=[];if(a.length<1)return[new H(l,a,"filter array must have at least 1 element")];switch(m=m.concat(Ia({key:l+"[0]",value:a[0],valueSpec:h.filter_operator,style:r.style,styleSpec:r.styleSpec})),Ee(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&Ee(a[1])==="$type"&&m.push(new H(l,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&m.push(new H(l,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=ur(a[1]))!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));for(var g=2;g<a.length;g++)c=ur(a[g]),Ee(a[1])==="$type"?m=m.concat(Ia({key:l+"["+g+"]",value:a[g],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&m.push(new H(l+"["+g+"]",a[g],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var x=1;x<a.length;x++)m=m.concat(t({key:l+"["+x+"]",value:a[x],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&m.push(new H(l+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=ur(a[1]),a.length!==2?m.push(new H(l,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&m.push(new H(l+"[1]",a[1],"object expected, "+c+" found"))}return m})(e)}function hu(e,t){var r=e.key,a=e.style,l=e.styleSpec,c=e.value,h=e.objectKey,m=l[t+"_"+e.layerType];if(!m)return[];var g=h.match(/^(.*)-transition$/);if(t==="paint"&&g&&m[g[1]]&&m[g[1]].transition)return zt({key:r,value:c,valueSpec:l.transition,style:a,styleSpec:l});var x,S=e.valueSpec||m[h];if(!S)return[new H(r,c,'unknown property "'+h+'"')];if(ur(c)==="string"&&Eo(S)&&!S.tokens&&(x=/^{([^}]+)}$/.exec(c)))return[new H(r,c,'"'+h+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(x[1])+" }`.")];var I=[];return e.layerType==="symbol"&&(h==="text-field"&&a&&!a.glyphs&&I.push(new H(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&rs(me(c))&&Ee(c.type)==="identity"&&I.push(new H(r,c,'"text-font" does not support identity functions'))),I.concat(zt({key:e.key,value:c,valueSpec:S,style:a,styleSpec:l,expressionContext:"property",propertyType:t,propertyKey:h}))}function fu(e){return hu(e,"paint")}function Ta(e){return hu(e,"layout")}function kl(e){var t=[],r=e.value,a=e.key,l=e.style,c=e.styleSpec;r.type||r.ref||t.push(new H(a,r,'either "type" or "ref" is required'));var h,m=Ee(r.type),g=Ee(r.ref);if(r.id)for(var x=Ee(r.id),S=0;S<e.arrayIndex;S++){var I=l.layers[S];Ee(I.id)===x&&t.push(new H(a,r.id,'duplicate layer id "'+r.id+'", previously used at line '+I.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(j){j in r&&t.push(new H(a,r[j],'"'+j+'" is prohibited for ref layers'))})),l.layers.forEach((function(j){Ee(j.id)===g&&(h=j)})),h?h.ref?t.push(new H(a,r.ref,"ref cannot reference another ref layer")):m=Ee(h.type):t.push(new H(a,r.ref,'ref layer "'+g+'" not found'));else if(m!=="background")if(r.source){var C=l.sources&&l.sources[r.source],z=C&&Ee(C.type);C?z==="vector"&&m==="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a raster source')):z==="raster"&&m!=="raster"?t.push(new H(a,r.source,'layer "'+r.id+'" requires a vector source')):z!=="vector"||r["source-layer"]?z==="raster-dem"&&m!=="hillshade"?t.push(new H(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):m!=="line"||!r.paint||!r.paint["line-gradient"]||z==="geojson"&&C.lineMetrics||t.push(new H(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new H(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new H(a,r.source,'source "'+r.source+'" not found'))}else t.push(new H(a,r,'missing required property "source"'));return t=t.concat(vn({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return zt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:pu,layout:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return Ta(Se({layerType:m},G))}}})},paint:function(j){return vn({layer:r,key:j.key,value:j.value,style:j.style,styleSpec:j.styleSpec,objectElementValidators:{"*":function(G){return fu(Se({layerType:m},G))}}})}}}))}function Co(e){var t=e.value,r=e.key,a=ur(t);return a!=="string"?[new H(r,t,"string expected, "+a+" found")]:[]}var vr={promoteId:function(e){var t=e.key,r=e.value;if(ur(r)==="string")return Co({key:t,value:r});var a=[];for(var l in r)a.push.apply(a,Co({key:t+"."+l,value:r[l]}));return a}};function ls(e){var t=e.value,r=e.key,a=e.styleSpec,l=e.style;if(!t.type)return[new H(r,t,'"type" is required')];var c,h=Ee(t.type);switch(h){case"vector":case"raster":case"raster-dem":return vn({key:r,value:t,valueSpec:a["source_"+h.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:vr});case"geojson":if(c=vn({key:r,value:t,valueSpec:a.source_geojson,style:l,styleSpec:a,objectElementValidators:vr}),t.cluster)for(var m in t.clusterProperties){var g=t.clusterProperties[m],x=g[0],S=typeof x=="string"?[x,["accumulated"],["get",m]]:x;c.push.apply(c,Po({key:r+"."+m+".map",value:g[1],expressionContext:"cluster-map"})),c.push.apply(c,Po({key:r+"."+m+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return vn({key:r,value:t,valueSpec:a.source_video,style:l,styleSpec:a});case"image":return vn({key:r,value:t,valueSpec:a.source_image,style:l,styleSpec:a});case"canvas":return[new H(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ia({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ko(e){var t=e.value,r=e.styleSpec,a=r.light,l=e.style,c=[],h=ur(t);if(t===void 0)return c;if(h!=="object")return c.concat([new H("light",t,"object expected, "+h+" found")]);for(var m in t){var g=m.match(/^(.*)-transition$/);c=c.concat(g&&a[g[1]]&&a[g[1]].transition?zt({key:m,value:t[m],valueSpec:r.transition,style:l,styleSpec:r}):a[m]?zt({key:m,value:t[m],valueSpec:a[m],style:l,styleSpec:r}):[new H(m,t[m],'unknown property "'+m+'"')])}return c}var Qn={"*":function(){return[]},array:Tl,boolean:function(e){var t=e.value,r=e.key,a=ur(t);return a!=="boolean"?[new H(r,t,"boolean expected, "+a+" found")]:[]},number:Al,color:function(e){var t=e.key,r=e.value,a=ur(r);return a!=="string"?[new H(t,r,"color expected, "+a+" found")]:Bt(r)===null?[new H(t,r,'color expected, "'+r+'" found')]:[]},constants:se,enum:Ia,filter:pu,function:El,layer:kl,object:vn,source:ls,light:ko,string:Co,formatted:function(e){return Co(e).length===0?[]:Po(e)},resolvedImage:function(e){return Co(e).length===0?[]:Po(e)}};function zt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&rs(Ee(t))?El(e):r.expression&&wa(me(t))?Po(e):r.type&&Qn[r.type]?Qn[r.type](e):vn(Se({},e,{valueSpec:r.type?a[r.type]:r}))}function lr(e){var t=e.value,r=e.key,a=Co(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new H(r,t,'"glyphs" url must include a "{range}" token'))),a}function Yi(e,t){t===void 0&&(t=L);var r=[];return r=r.concat(zt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:lr,"*":function(){return[]}}})),e.constants&&(r=r.concat(se({key:"constants",value:e.constants}))),Aa(r)}function Aa(e){return[].concat(e).sort((function(t,r){return t.line-r.line}))}function Qo(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Aa(e.apply(this,t))}}Yi.source=Qo(ls),Yi.light=Qo(ko),Yi.layer=Qo(kl),Yi.filter=Qo(pu),Yi.paintProperty=Qo(fu),Yi.layoutProperty=Qo(Ta);var Ea=Yi,qc=Ea.light,Uc=Ea.paintProperty,Pa=Ea.layoutProperty;function Ca(e,t){var r=!1;if(t&&t.length)for(var a=0,l=t;a<l.length;a+=1)e.fire(new re(new Error(l[a].message))),r=!0;return r}var Rn=Gr;function Gr(e,t,r){var a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var l=new Int32Array(this.arrayBuffer);e=l[0],this.d=(t=l[1])+2*(r=l[2]);for(var c=0;c<this.d*this.d;c++){var h=l[3+c],m=l[3+c+1];a.push(h===m?null:l.subarray(h,m))}var g=l[3+a.length+1];this.keys=l.subarray(l[3+a.length],g),this.bboxes=l.subarray(g),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var x=0;x<this.d*this.d;x++)a.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var S=r/t*e;this.min=-S,this.max=e+S}Gr.prototype.insert=function(e,t,r,a,l){this._forEachCell(t,r,a,l,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(l)},Gr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Gr.prototype._insertCell=function(e,t,r,a,l,c){this.cells[l].push(c)},Gr.prototype.query=function(e,t,r,a,l){var c=this.min,h=this.max;if(e<=c&&t<=c&&h<=r&&h<=a&&!l)return Array.prototype.slice.call(this.keys);var m=[];return this._forEachCell(e,t,r,a,this._queryCell,m,{},l),m},Gr.prototype._queryCell=function(e,t,r,a,l,c,h,m){var g=this.cells[l];if(g!==null)for(var x=this.keys,S=this.bboxes,I=0;I<g.length;I++){var C=g[I];if(h[C]===void 0){var z=4*C;(m?m(S[z+0],S[z+1],S[z+2],S[z+3]):e<=S[z+2]&&t<=S[z+3]&&r>=S[z+0]&&a>=S[z+1])?(h[C]=!0,c.push(x[C])):h[C]=!1}}},Gr.prototype._forEachCell=function(e,t,r,a,l,c,h,m){for(var g=this._convertToCellCoord(e),x=this._convertToCellCoord(t),S=this._convertToCellCoord(r),I=this._convertToCellCoord(a),C=g;C<=S;C++)for(var z=x;z<=I;z++){var j=this.d*z+C;if((!m||m(this._convertFromCellCoord(C),this._convertFromCellCoord(z),this._convertFromCellCoord(C+1),this._convertFromCellCoord(z+1)))&&l.call(this,e,t,r,a,j,c,h,m))return}},Gr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},Gr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},Gr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,a=0;a<this.cells.length;a++)r+=this.cells[a].length;var l=new Int32Array(t+r+this.keys.length+this.bboxes.length);l[0]=this.extent,l[1]=this.n,l[2]=this.padding;for(var c=t,h=0;h<e.length;h++){var m=e[h];l[3+h]=c,l.set(m,c),c+=m.length}return l[3+e.length]=c,l.set(this.keys,c),l[3+e.length+1]=c+=this.keys.length,l.set(this.bboxes,c),c+=this.bboxes.length,l.buffer};var ka=Y.ImageData,Ml=Y.ImageBitmap,qr={};function Xe(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),qr[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var Ni in Xe("Object",Object),Rn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},Rn.deserialize=function(e){return new Rn(e.buffer)},Xe("Grid",Rn),Xe("Color",Zt),Xe("Error",Error),Xe("ResolvedImage",Di),Xe("StylePropertyFunction",Yo),Xe("StyleExpression",Ko,{omit:["_evaluator"]}),Xe("ZoomDependentExpression",Jo),Xe("ZoomConstantExpression",Sa),Xe("CompoundExpression",di,{omit:["_evaluate"]}),Io)Io[Ni]._classRegistryKey||Xe("Expression_"+Ni,Io[Ni]);function cs(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function ea(e){return Ml&&e instanceof Ml}function gn(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(cs(e)||ea(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof ka)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var a=[],l=0,c=e;l<c.length;l+=1)a.push(gn(c[l],t));return a}if(typeof e=="object"){var h=e.constructor,m=h._classRegistryKey;if(!m)throw new Error("can't serialize object of unregistered class");var g=h.serialize?h.serialize(e,t):{};if(!h.serialize){for(var x in e)if(e.hasOwnProperty(x)&&!(qr[m].omit.indexOf(x)>=0)){var S=e[x];g[x]=qr[m].shallow.indexOf(x)>=0?S:gn(S,t)}e instanceof Error&&(g.message=e.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(g.$name=m),g}throw new Error("can't serialize object of type "+typeof e)}function ji(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||cs(e)||ea(e)||ArrayBuffer.isView(e)||e instanceof ka)return e;if(Array.isArray(e))return e.map(ji);if(typeof e=="object"){var t=e.$name||"Object",r=qr[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var a=Object.create(r.prototype),l=0,c=Object.keys(e);l<c.length;l+=1){var h=c[l];if(h!=="$name"){var m=e[h];a[h]=qr[t].shallow.indexOf(h)>=0?m:ji(m)}}return a}throw new Error("can't deserialize object of type "+typeof e)}var du=function(){this.first=!0};du.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var Le={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function mu(e){for(var t=0,r=e;t<r.length;t+=1)if(ps(r[t].charCodeAt(0)))return!0;return!1}function ps(e){return!(e!==746&&e!==747&&(e<4352||!(Le["Bopomofo Extended"](e)||Le.Bopomofo(e)||Le["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Le["CJK Compatibility Ideographs"](e)||Le["CJK Compatibility"](e)||Le["CJK Radicals Supplement"](e)||Le["CJK Strokes"](e)||!(!Le["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Le["CJK Unified Ideographs Extension A"](e)||Le["CJK Unified Ideographs"](e)||Le["Enclosed CJK Letters and Months"](e)||Le["Hangul Compatibility Jamo"](e)||Le["Hangul Jamo Extended-A"](e)||Le["Hangul Jamo Extended-B"](e)||Le["Hangul Jamo"](e)||Le["Hangul Syllables"](e)||Le.Hiragana(e)||Le["Ideographic Description Characters"](e)||Le.Kanbun(e)||Le["Kangxi Radicals"](e)||Le["Katakana Phonetic Extensions"](e)||Le.Katakana(e)&&e!==12540||!(!Le["Halfwidth and Fullwidth Forms"](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Le["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Le["Unified Canadian Aboriginal Syllabics"](e)||Le["Unified Canadian Aboriginal Syllabics Extended"](e)||Le["Vertical Forms"](e)||Le["Yijing Hexagram Symbols"](e)||Le["Yi Syllables"](e)||Le["Yi Radicals"](e))))}function yu(e){return!(ps(e)||(function(t){return!!(Le["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Le["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Le["Letterlike Symbols"](t)||Le["Number Forms"](t)||Le["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Le["Control Pictures"](t)&&t!==9251||Le["Optical Character Recognition"](t)||Le["Enclosed Alphanumerics"](t)||Le["Geometric Shapes"](t)||Le["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Le["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Le["CJK Symbols and Punctuation"](t)||Le.Katakana(t)||Le["Private Use Area"](t)||Le["CJK Compatibility Forms"](t)||Le["Small Form Variants"](t)||Le["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)})(e))}function sn(e){return e>=1424&&e<=2303||Le["Arabic Presentation Forms-A"](e)||Le["Arabic Presentation Forms-B"](e)}function Gi(e,t){return!(!t&&sn(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Le.Khmer(e))}function hs(e){for(var t=0,r=e;t<r.length;t+=1)if(sn(r[t].charCodeAt(0)))return!0;return!1}var fs=null,Zi="unavailable",Ln=null,Bl=function(e){e&&typeof e=="string"&&e.indexOf("NetworkError")>-1&&(Zi="error"),fs&&fs(e)};function Ma(){vu.fire(new Z("pluginStateChange",{pluginStatus:Zi,pluginURL:Ln}))}var vu=new ie,gu=function(){return Zi},_n=function(){if(Zi!=="deferred"||!Ln)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Zi="loading",Ma(),Ln&&ii({url:Ln},(function(e){e?Bl(e):(Zi="loaded",Ma())}))},Qi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Zi==="loaded"||Qi.applyArabicShaping!=null},isLoading:function(){return Zi==="loading"},setState:function(e){Zi=e.pluginStatus,Ln=e.pluginURL},isParsed:function(){return Qi.applyArabicShaping!=null&&Qi.processBidirectionalText!=null&&Qi.processStyledBidirectionalText!=null},getPluginURL:function(){return Ln}},Ct=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new du,this.transition={})};Ct.prototype.isSupportedScript=function(e){return(function(t,r){for(var a=0,l=t;a<l.length;a+=1)if(!Gi(l[a].charCodeAt(0),r))return!1;return!0})(e,Qi.isLoaded())},Ct.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Ct.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Tn=function(e,t){this.property=e,this.value=t,this.expression=(function(r,a){if(rs(r))return new Yo(r,a);if(wa(r)){var l=Il(r,a);if(l.result==="error")throw new Error(l.value.map((function(h){return h.key+": "+h.message})).join(", "));return l.value}var c=r;return typeof r=="string"&&a.type==="color"&&(c=Zt.parse(r)),{kind:"constant",evaluate:function(){return c}}})(t===void 0?e.specification.default:t,e.specification)};Tn.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Tn.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var un=function(e){this.property=e,this.value=new Tn(e,void 0)};un.prototype.transitioned=function(e,t){return new Mo(this.property,this.value,t,Re({},e.transition,this.transition),e.now)},un.prototype.untransitioned=function(){return new Mo(this.property,this.value,null,{},0)};var yi=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};yi.prototype.getValue=function(e){return kt(this._values[e].value.value)},yi.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].value=new Tn(this._values[e].property,t===null?void 0:kt(t))},yi.prototype.getTransition=function(e){return kt(this._values[e].transition)},yi.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new un(this._values[e].property)),this._values[e].transition=kt(t)||void 0},yi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l);var c=this.getTransition(a);c!==void 0&&(e[a+"-transition"]=c)}return e},yi.prototype.transitioned=function(e,t){for(var r=new eo(this._properties),a=0,l=Object.keys(this._values);a<l.length;a+=1){var c=l[a];r._values[c]=this._values[c].transitioned(e,t._values[c])}return r},yi.prototype.untransitioned=function(){for(var e=new eo(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t];e._values[a]=this._values[a].untransitioned()}return e};var Mo=function(e,t,r,a,l){this.property=e,this.value=t,this.begin=l+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)};Mo.prototype.possiblyEvaluate=function(e,t,r){var a=e.now||0,l=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(a>this.end)return this.prior=null,l;if(this.value.isDataDriven())return this.prior=null,l;if(a<this.begin)return c.possiblyEvaluate(e,t,r);var h=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(c.possiblyEvaluate(e,t,r),l,(function(m){if(m<=0)return 0;if(m>=1)return 1;var g=m*m,x=g*m;return 4*(m<.5?x:3*(m-g)+x-.75)})(h))}return l};var eo=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};eo.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a},eo.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1)if(this._values[t[e]].prior)return!0;return!1};var xn=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};xn.prototype.getValue=function(e){return kt(this._values[e].value)},xn.prototype.setValue=function(e,t){this._values[e]=new Tn(this._values[e].property,t===null?void 0:kt(t))},xn.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],l=this.getValue(a);l!==void 0&&(e[a]=l)}return e},xn.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ba(this._properties),l=0,c=Object.keys(this._values);l<c.length;l+=1){var h=c[l];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a};var Ti=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Ti.prototype.isConstant=function(){return this.value.kind==="constant"},Ti.prototype.constantOr=function(e){return this.value.kind==="constant"?this.value.value:e},Ti.prototype.evaluate=function(e,t,r,a){return this.property.evaluate(this.value,this.parameters,e,t,r,a)};var Ba=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Ba.prototype.get=function(e){return this._values[e]};var it=function(e){this.specification=e};it.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},it.prototype.interpolate=function(e,t,r){var a=Ho[this.specification.type];return a?a(e,t,r):e};var Ye=function(e,t){this.specification=e,this.overrides=t};Ye.prototype.possiblyEvaluate=function(e,t,r,a){return new Ti(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,a)}:e.expression,t)},Ye.prototype.interpolate=function(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new Ti(this,{kind:"constant",value:void 0},e.parameters);var a=Ho[this.specification.type];return a?new Ti(this,{kind:"constant",value:a(e.value.value,t.value.value,r)},e.parameters):e},Ye.prototype.evaluate=function(e,t,r,a,l,c){return e.kind==="constant"?e.value:e.evaluate(t,r,a,l,c)};var ds=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a,l,c){if(r.value===void 0)return new Ti(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){var h=r.expression.evaluate(a,null,{},l,c),m=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,g=this._calculate(m,m,m,a);return new Ti(this,{kind:"constant",value:g},a)}if(r.expression.kind==="camera"){var x=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new Ti(this,{kind:"constant",value:x},a)}return new Ti(this,r.expression,a)},t.prototype.evaluate=function(r,a,l,c,h,m){if(r.kind==="source"){var g=r.evaluate(a,l,c,h,m);return this._calculate(g,g,g,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},l,c),r.evaluate({zoom:Math.floor(a.zoom)},l,c),r.evaluate({zoom:Math.floor(a.zoom)+1},l,c),a):r.value},t.prototype._calculate=function(r,a,l,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:l,to:a}},t.prototype.interpolate=function(r){return r},t})(Ye),Ai=function(e){this.specification=e};Ai.prototype.possiblyEvaluate=function(e,t,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){var l=e.expression.evaluate(t,null,{},r,a);return this._calculate(l,l,l,t)}return this._calculate(e.expression.evaluate(new Ct(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Ct(Math.floor(t.zoom),t)),e.expression.evaluate(new Ct(Math.floor(t.zoom+1),t)),t)}},Ai.prototype._calculate=function(e,t,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Ai.prototype.interpolate=function(e){return e};var bn=function(e){this.specification=e};bn.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},bn.prototype.interpolate=function(){return!1};var vi=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var a=this.defaultPropertyValues[t]=new Tn(r,void 0),l=this.defaultTransitionablePropertyValues[t]=new un(r);this.defaultTransitioningPropertyValues[t]=l.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Xe("DataDrivenProperty",Ye),Xe("DataConstantProperty",it),Xe("CrossFadedDataDrivenProperty",ds),Xe("CrossFadedProperty",Ai),Xe("ColorRampProperty",bn);var An=(function(e){function t(r,a){if(e.call(this),this.id=r.id,this.type=r.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},r.type!=="custom"&&(this.metadata=(r=r).metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new xn(a.layout)),a.paint)){for(var l in this._transitionablePaint=new yi(a.paint),r.paint)this.setPaintProperty(l,r.paint[l],{validate:!1});for(var c in r.layout)this.setLayoutProperty(c,r.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ba(a.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)},t.prototype.setLayoutProperty=function(r,a,l){l===void 0&&(l={}),a!=null&&this._validate(Pa,"layers."+this.id+".layout."+r,r,a,l)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)},t.prototype.getPaintProperty=function(r){return Ge(r,"-transition")?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)},t.prototype.setPaintProperty=function(r,a,l){if(l===void 0&&(l={}),a!=null&&this._validate(Uc,"layers."+this.id+".paint."+r,r,a,l))return!1;if(Ge(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;var c=this._transitionablePaint._values[r],h=c.property.specification["property-type"]==="cross-faded-data-driven",m=c.value.isDataDriven(),g=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var x=this._transitionablePaint._values[r].value;return x.isDataDriven()||m||h||this._handleOverridablePaintPropertyUpdate(r,g,x)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!1},t.prototype.isHidden=function(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"},t.prototype.updateTransitions=function(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)},t.prototype.serialize=function(){var r={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&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),tt(r,(function(a,l){return!(a===void 0||l==="layout"&&!Object.keys(a).length||l==="paint"&&!Object.keys(a).length)}))},t.prototype._validate=function(r,a,l,c,h){return h===void 0&&(h={}),(!h||h.validate!==!1)&&Ca(this,r.call(Ea,{key:a,layerType:this.type,objectKey:l,value:c,styleSpec:L,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var r in this.paint._values){var a=this.paint.get(r);if(a instanceof Ti&&Eo(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t})(ie),_u={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ms=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Xt=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ai(e,t){t===void 0&&(t=1);var r=0,a=0;return{members:e.map((function(l){var c=_u[l.type].BYTES_PER_ELEMENT,h=r=zl(r,Math.max(t,c)),m=l.components||1;return a=Math.max(a,c),r+=c*m,{name:l.name,type:l.type,components:m,offset:h}})),size:zl(r,Math.max(a,t)),alignment:t}}function zl(e,t){return Math.ceil(e/t)*t}Xt.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Xt.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Xt.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Xt.prototype.clear=function(){this.length=0},Xt.prototype.resize=function(e){this.reserve(e),this.length=e},Xt.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Xt.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Bo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.int16[c+0]=a,this.int16[c+1]=l,r},t})(Xt);Bo.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",Bo);var xu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.int16[m+0]=a,this.int16[m+1]=l,this.int16[m+2]=c,this.int16[m+3]=h,r},t})(Xt);xu.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",xu);var Fn=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var x=6*r;return this.int16[x+0]=a,this.int16[x+1]=l,this.int16[x+2]=c,this.int16[x+3]=h,this.int16[x+4]=m,this.int16[x+5]=g,r},t})(Xt);Fn.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",Fn);var $i=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var x=4*r,S=8*r;return this.int16[x+0]=a,this.int16[x+1]=l,this.uint8[S+4]=c,this.uint8[S+5]=h,this.uint8[S+6]=m,this.uint8[S+7]=g,r},t})(Xt);$i.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",$i);var ta=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.float32[c+0]=a,this.float32[c+1]=l,r},t})(Xt);ta.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",ta);var En=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I){var C=this.length;return this.resize(C+1),this.emplace(C,r,a,l,c,h,m,g,x,S,I)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C){var z=10*r;return this.uint16[z+0]=a,this.uint16[z+1]=l,this.uint16[z+2]=c,this.uint16[z+3]=h,this.uint16[z+4]=m,this.uint16[z+5]=g,this.uint16[z+6]=x,this.uint16[z+7]=S,this.uint16[z+8]=I,this.uint16[z+9]=C,r},t})(Xt);En.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",En);var ys=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I,C,z){var j=this.length;return this.resize(j+1),this.emplace(j,r,a,l,c,h,m,g,x,S,I,C,z)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C,z,j){var G=12*r;return this.int16[G+0]=a,this.int16[G+1]=l,this.int16[G+2]=c,this.int16[G+3]=h,this.uint16[G+4]=m,this.uint16[G+5]=g,this.uint16[G+6]=x,this.uint16[G+7]=S,this.int16[G+8]=I,this.int16[G+9]=C,this.int16[G+10]=z,this.int16[G+11]=j,r},t})(Xt);ys.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",ys);var ra=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.float32[h+0]=a,this.float32[h+1]=l,this.float32[h+2]=c,r},t})(Xt);ra.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",ra);var za=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint32[1*r+0]=a,r},t})(Xt);za.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",za);var bu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S){var I=this.length;return this.resize(I+1),this.emplace(I,r,a,l,c,h,m,g,x,S)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I){var C=10*r,z=5*r;return this.int16[C+0]=a,this.int16[C+1]=l,this.int16[C+2]=c,this.int16[C+3]=h,this.int16[C+4]=m,this.int16[C+5]=g,this.uint32[z+3]=x,this.uint16[C+8]=S,this.uint16[C+9]=I,r},t})(Xt);bu.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",bu);var ia=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h,m){var g=this.length;return this.resize(g+1),this.emplace(g,r,a,l,c,h,m)},t.prototype.emplace=function(r,a,l,c,h,m,g){var x=6*r;return this.int16[x+0]=a,this.int16[x+1]=l,this.int16[x+2]=c,this.int16[x+3]=h,this.int16[x+4]=m,this.int16[x+5]=g,r},t})(Xt);ia.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",ia);var zo=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c,h){var m=this.length;return this.resize(m+1),this.emplace(m,r,a,l,c,h)},t.prototype.emplace=function(r,a,l,c,h,m){var g=4*r,x=8*r;return this.float32[g+0]=a,this.float32[g+1]=l,this.float32[g+2]=c,this.int16[x+6]=h,this.int16[x+7]=m,r},t})(Xt);zo.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",zo);var wu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=12*r,g=3*r;return this.uint8[m+0]=a,this.uint8[m+1]=l,this.float32[g+1]=c,this.float32[g+2]=h,r},t})(Xt);wu.prototype.bytesPerElement=12,Xe("StructArrayLayout2ub2f12",wu);var to=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.uint16[h+0]=a,this.uint16[h+1]=l,this.uint16[h+2]=c,r},t})(Xt);to.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",to);var ro=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe){var le=this.length;return this.resize(le+1),this.emplace(le,r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le){var ce=24*r,he=12*r,xe=48*r;return this.int16[ce+0]=a,this.int16[ce+1]=l,this.uint16[ce+2]=c,this.uint16[ce+3]=h,this.uint32[he+2]=m,this.uint32[he+3]=g,this.uint32[he+4]=x,this.uint16[ce+10]=S,this.uint16[ce+11]=I,this.uint16[ce+12]=C,this.float32[he+7]=z,this.float32[he+8]=j,this.uint8[xe+36]=G,this.uint8[xe+37]=te,this.uint8[xe+38]=K,this.uint32[he+10]=oe,this.int16[ce+22]=le,r},t})(Xt);ro.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ro);var vs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.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)},t.prototype.emplaceBack=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,De,rt,Ue,ot,je,bt){var pt=this.length;return this.resize(pt+1),this.emplace(pt,r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,De,rt,Ue,ot,je,bt)},t.prototype.emplace=function(r,a,l,c,h,m,g,x,S,I,C,z,j,G,te,K,oe,le,ce,he,xe,Pe,De,rt,Ue,ot,je,bt,pt){var Qe=34*r,Tt=17*r;return this.int16[Qe+0]=a,this.int16[Qe+1]=l,this.int16[Qe+2]=c,this.int16[Qe+3]=h,this.int16[Qe+4]=m,this.int16[Qe+5]=g,this.int16[Qe+6]=x,this.int16[Qe+7]=S,this.uint16[Qe+8]=I,this.uint16[Qe+9]=C,this.uint16[Qe+10]=z,this.uint16[Qe+11]=j,this.uint16[Qe+12]=G,this.uint16[Qe+13]=te,this.uint16[Qe+14]=K,this.uint16[Qe+15]=oe,this.uint16[Qe+16]=le,this.uint16[Qe+17]=ce,this.uint16[Qe+18]=he,this.uint16[Qe+19]=xe,this.uint16[Qe+20]=Pe,this.uint16[Qe+21]=De,this.uint16[Qe+22]=rt,this.uint32[Tt+12]=Ue,this.float32[Tt+13]=ot,this.float32[Tt+14]=je,this.float32[Tt+15]=bt,this.float32[Tt+16]=pt,r},t})(Xt);vs.prototype.bytesPerElement=68,Xe("StructArrayLayout8i15ui1ul4f68",vs);var io=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.float32[1*r+0]=a,r},t})(Xt);io.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",io);var ln=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=3*r;return this.int16[h+0]=a,this.int16[h+1]=l,this.int16[h+2]=c,r},t})(Xt);ln.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",ln);var Su=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,l)},t.prototype.emplace=function(r,a,l,c){var h=4*r;return this.uint32[2*r+0]=a,this.uint16[h+2]=l,this.uint16[h+3]=c,r},t})(Xt);Su.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Su);var Da=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var l=this.length;return this.resize(l+1),this.emplace(l,r,a)},t.prototype.emplace=function(r,a,l){var c=2*r;return this.uint16[c+0]=a,this.uint16[c+1]=l,r},t})(Xt);Da.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",Da);var Iu=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint16[1*r+0]=a,r},t})(Xt);Iu.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",Iu);var gs=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,l,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,l,c)},t.prototype.emplace=function(r,a,l,c,h){var m=4*r;return this.float32[m+0]=a,this.float32[m+1]=l,this.float32[m+2]=c,this.float32[m+3]=h,r},t})(Xt);gs.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",gs);var i=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;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},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.anchorPoint.get=function(){return new X(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t})(ms);i.prototype.size=20;var o=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new i(this,r)},t})(bu);Xe("CollisionBoxArray",o);var n=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;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(a){this._structArray.uint8[this._pos1+37]=a},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(a){this._structArray.uint8[this._pos1+38]=a},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+10]=a},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t})(ms);n.prototype.size=48;var s=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new n(this,r)},t})(ro);Xe("PlacedSymbolArray",s);var p=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;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},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{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.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+12]=a},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t})(ms);p.prototype.size=68;var f=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t})(vs);Xe("SymbolInstanceArray",f);var d=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(r){return this.float32[1*r+0]},t})(io);Xe("GlyphOffsetArray",d);var v=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(r){return this.int16[3*r+0]},t.prototype.gety=function(r){return this.int16[3*r+1]},t.prototype.gettileUnitDistanceFromAnchor=function(r){return this.int16[3*r+2]},t})(ln);Xe("SymbolLineVertexArray",v);var w=(function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;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(t.prototype,r),t})(ms);w.prototype.size=8;var A=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new w(this,r)},t})(Su);Xe("FeatureIndexArray",A);var D=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,F=function(e){e===void 0&&(e=[]),this.segments=e};function O(e,t){return 256*(e=Oe(Math.floor(e),0,255))+Oe(Math.floor(t),0,255)}F.prototype.prepareSegment=function(e,t,r,a){var l=this.segments[this.segments.length-1];return e>F.MAX_VERTEX_ARRAY_LENGTH&&St("Max vertices per segment is "+F.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!l||l.vertexLength+e>F.MAX_VERTEX_ARRAY_LENGTH||l.sortKey!==a)&&(l={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(l.sortKey=a),this.segments.push(l)),l},F.prototype.get=function(){return this.segments},F.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var a in r.vaos)r.vaos[a].destroy()}},F.simpleSegment=function(e,t,r,a){return new F([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])},F.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Xe("SegmentVector",F);var W=ai([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),$=U((function(e){e.exports=function(t,r){var a,l,c,h,m,g,x,S;for(l=t.length-(a=3&t.length),c=r,m=3432918353,g=461845907,S=0;S<l;)x=255&t.charCodeAt(S)|(255&t.charCodeAt(++S))<<8|(255&t.charCodeAt(++S))<<16|(255&t.charCodeAt(++S))<<24,++S,c=27492+(65535&(h=5*(65535&(c=(c^=x=(65535&(x=(x=(65535&x)*m+(((x>>>16)*m&65535)<<16)&4294967295)<<15|x>>>17))*g+(((x>>>16)*g&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(x=0,a){case 3:x^=(255&t.charCodeAt(S+2))<<16;case 2:x^=(255&t.charCodeAt(S+1))<<8;case 1:c^=x=(65535&(x=(x=(65535&(x^=255&t.charCodeAt(S)))*m+(((x>>>16)*m&65535)<<16)&4294967295)<<15|x>>>17))*g+(((x>>>16)*g&65535)<<16)&4294967295}return c^=t.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0}})),ee=U((function(e){e.exports=function(t,r){for(var a,l=t.length,c=r^l,h=0;l>=4;)a=1540483477*(65535&(a=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(a>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),l-=4,++h;switch(l){case 3:c^=(255&t.charCodeAt(h+2))<<16;case 2:c^=(255&t.charCodeAt(h+1))<<8;case 1:c=1540483477*(65535&(c^=255&t.charCodeAt(h)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0}})),N=$,Q=ee;N.murmur3=$,N.murmur2=Q;var ne=function(){this.ids=[],this.positions=[],this.indexed=!1};ne.prototype.add=function(e,t,r,a){this.ids.push(de(e)),this.positions.push(t,r,a)},ne.prototype.getPositions=function(e){for(var t=de(e),r=0,a=this.ids.length-1;r<a;){var l=r+a>>1;this.ids[l]>=t?a=l:r=l+1}for(var c=[];this.ids[r]===t;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c},ne.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return(function l(c,h,m,g){for(;m<g;){for(var x=c[m+g>>1],S=m-1,I=g+1;;){do S++;while(c[S]<x);do I--;while(c[I]>x);if(S>=I)break;pe(c,S,I),pe(h,3*S,3*I),pe(h,3*S+1,3*I+1),pe(h,3*S+2,3*I+2)}I-m<g-I?(l(c,h,m,I),m=I+1):(l(c,h,I+1,g),g=I)}})(r,a,0,r.length-1),t&&t.push(r.buffer,a.buffer),{ids:r,positions:a}},ne.deserialize=function(e){var t=new ne;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ue=Math.pow(2,53)-1;function de(e){var t=+e;return!isNaN(t)&&t<=ue?t:N(String(e))}function pe(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Xe("FeaturePositionMap",ne);var ye=function(e,t){this.gl=e.gl,this.location=t},Ie=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))},t})(ye),Me=(function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))},t})(ye),Ce=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))},t})(ye),$e=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))},t})(ye),nt=(function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3]))},t})(ye),ut=(function(e){function t(r,a){e.call(this,r,a),this.current=Zt.transparent}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a))},t})(ye),st=new Float32Array(16),Lt=(function(e){function t(r,a){e.call(this,r,a),this.current=st}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(var a=1;a<16;a++)if(r[a]!==this.current[a]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}},t})(ye);function He(e){return[O(255*e.r,255*e.g),O(255*e.b,255*e.a)]}var mt=function(e,t,r){this.value=e,this.uniformNames=t.map((function(a){return"u_"+a})),this.type=r};mt.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},mt.prototype.getBinding=function(e,t,r){return this.type==="color"?new ut(e,t):new Me(e,t)};var xt=function(e,t){this.uniformNames=t.map((function(r){return"u_"+r})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};xt.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},xt.prototype.setUniform=function(e,t,r,a){var l=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;l&&e.set(l)},xt.prototype.getBinding=function(e,t,r){return r.substr(0,9)==="u_pattern"?new nt(e,t):new Me(e,t)};var dt=function(e,t,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((function(l){return{name:"a_"+l,type:"Float32",components:r==="color"?2:1,offset:0}})),this.paintVertexArray=new a};dt.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.paintVertexArray.length,h=this.expression.evaluate(new Ct(0),t,{},a,[],l);this.paintVertexArray.resize(e),this._setPaintValue(c,e,h)},dt.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,t,l)},dt.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var a=He(r),l=e;l<t;l++)this.paintVertexArray.emplace(l,a[0],a[1]);else{for(var c=e;c<t;c++)this.paintVertexArray.emplace(c,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},dt.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},dt.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var ft=function(e,t,r,a,l,c){this.expression=e,this.uniformNames=t.map((function(h){return"u_"+h+"_t"})),this.type=r,this.useIntegerZoom=a,this.zoom=l,this.maxValue=0,this.paintVertexAttributes=t.map((function(h){return{name:"a_"+h,type:"Float32",components:r==="color"?4:2,offset:0}})),this.paintVertexArray=new c};ft.prototype.populatePaintArray=function(e,t,r,a,l){var c=this.expression.evaluate(new Ct(this.zoom),t,{},a,[],l),h=this.expression.evaluate(new Ct(this.zoom+1),t,{},a,[],l),m=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(m,e,c,h)},ft.prototype.updatePaintArray=function(e,t,r,a){var l=this.expression.evaluate({zoom:this.zoom},r,a),c=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,t,l,c)},ft.prototype._setPaintValue=function(e,t,r,a){if(this.type==="color")for(var l=He(r),c=He(a),h=e;h<t;h++)this.paintVertexArray.emplace(h,l[0],l[1],c[0],c[1]);else{for(var m=e;m<t;m++)this.paintVertexArray.emplace(m,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}},ft.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ft.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ft.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,a=Oe(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(a)},ft.prototype.getBinding=function(e,t,r){return new Me(e,t)};var gt=function(e,t,r,a,l,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=a,this.layerId=c,this.zoomInPaintVertexArray=new l,this.zoomOutPaintVertexArray=new l};gt.prototype.populatePaintArray=function(e,t,r){var a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,t.patterns&&t.patterns[this.layerId],r)},gt.prototype.updatePaintArray=function(e,t,r,a,l){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],l)},gt.prototype._setPaintValues=function(e,t,r,a){if(a&&r){var l=a[r.min],c=a[r.mid],h=a[r.max];if(l&&c&&h)for(var m=e;m<t;m++)this.zoomInPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1],c.pixelRatio,h.pixelRatio)}},gt.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,W.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,W.members,this.expression.isStateDependent))},gt.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var ht=function(e,t,r){this.binders={},this._buffers=[];var a=[];for(var l in e.paint._values)if(r(l)){var c=e.paint.get(l);if(c instanceof Ti&&Eo(c.property.specification)){var h=Jr(l,e.type),m=c.value,g=c.property.specification.type,x=c.property.useIntegerZoom,S=c.property.specification["property-type"],I=S==="cross-faded"||S==="cross-faded-data-driven";if(m.kind==="constant")this.binders[l]=I?new xt(m.value,h):new mt(m.value,h,g),a.push("/u_"+l);else if(m.kind==="source"||I){var C=Ir(l,g,"source");this.binders[l]=I?new gt(m,g,x,t,C,e.id):new dt(m,h,g,C),a.push("/a_"+l)}else{var z=Ir(l,g,"composite");this.binders[l]=new ft(m,h,g,x,t,z),a.push("/z_"+l)}}}this.cacheKey=a.sort().join("")};ht.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof dt||t instanceof ft?t.maxValue:0},ht.prototype.populatePaintArrays=function(e,t,r,a,l){for(var c in this.binders){var h=this.binders[c];(h instanceof dt||h instanceof ft||h instanceof gt)&&h.populatePaintArray(e,t,r,a,l)}},ht.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var a=this.binders[r];a instanceof xt&&a.setConstantPatternPositions(e,t)}},ht.prototype.updatePaintArrays=function(e,t,r,a,l){var c=!1;for(var h in e)for(var m=0,g=t.getPositions(h);m<g.length;m+=1){var x=g[m],S=r.feature(x.index);for(var I in this.binders){var C=this.binders[I];if((C instanceof dt||C instanceof ft||C instanceof gt)&&C.expression.isStateDependent===!0){var z=a.paint.get(I);C.expression=z.value,C.updatePaintArray(x.start,x.end,S,e[h],l),c=!0}}}return c},ht.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof mt||r instanceof xt)&&e.push.apply(e,r.uniformNames.map((function(a){return"#define HAS_UNIFORM_"+a})))}return e},ht.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof dt||r instanceof ft)for(var a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name);else if(r instanceof gt)for(var l=0;l<W.members.length;l++)e.push(W.members[l].name)}return e},ht.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof mt||r instanceof xt||r instanceof ft)for(var a=0,l=r.uniformNames;a<l.length;a+=1)e.push(l[a])}return e},ht.prototype.getPaintVertexBuffers=function(){return this._buffers},ht.prototype.getUniforms=function(e,t){var r=[];for(var a in this.binders){var l=this.binders[a];if(l instanceof mt||l instanceof xt||l instanceof ft)for(var c=0,h=l.uniformNames;c<h.length;c+=1){var m=h[c];if(t[m]){var g=l.getBinding(e,t[m],m);r.push({name:m,property:a,binding:g})}}}return r},ht.prototype.setUniforms=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1){var h=c[l],m=h.name,g=h.property;this.binders[g].setUniform(h.binding,a,r.get(g),m)}},ht.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof gt){var a=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof dt||r instanceof ft)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},ht.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof dt||r instanceof ft||r instanceof gt)&&r.upload(e)}this.updatePaintBuffers()},ht.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof dt||t instanceof ft||t instanceof gt)&&t.destroy()}};var ct=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var a=0,l=e;a<l.length;a+=1){var c=l[a];this.programConfigurations[c.id]=new ht(c,t,r)}this.needsUpload=!1,this._featureMap=new ne,this._bufferOffset=0};function Jr(e,t){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"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function Ir(e,t,r){var a={color:{source:ta,composite:gs},number:{source:io,composite:ta}},l=(function(c){return{"line-pattern":{source:En,composite:En},"fill-pattern":{source:En,composite:En},"fill-extrusion-pattern":{source:En,composite:En}}[c]})(e);return l&&l[r]||a[t][r]}ct.prototype.populatePaintArrays=function(e,t,r,a,l,c){for(var h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,t,a,l,c);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},ct.prototype.updatePaintArrays=function(e,t,r,a){for(var l=0,c=r;l<c.length;l+=1){var h=c[l];this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,t,h,a)||this.needsUpload}},ct.prototype.get=function(e){return this.programConfigurations[e]},ct.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},ct.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},Xe("ConstantBinder",mt),Xe("CrossFadedConstantBinder",xt),Xe("SourceExpressionBinder",dt),Xe("CrossFadedCompositeBinder",gt),Xe("CompositeExpressionBinder",ft),Xe("ProgramConfiguration",ht,{omit:["_buffers"]}),Xe("ProgramConfigurationSet",ct);var gi=Math.pow(2,14)-1,si=-gi-1;function wr(e){for(var t=8192/e.extent,r=e.loadGeometry(),a=0;a<r.length;a++)for(var l=r[a],c=0;c<l.length;c++){var h=l[c],m=Math.round(h.x*t),g=Math.round(h.y*t);h.x=Oe(m,si,gi),h.y=Oe(g,si,gi),(m<h.x||m>h.x+1||g<h.y||g>h.y+1)&&St("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function kr(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?wr(e):[]}}function Wi(e,t,r,a,l){e.emplaceBack(2*t+(a+1)/2,2*r+(l+1)/2)}var Ei=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Bo,this.indexArray=new to,this.segments=new F,this.programConfigurations=new ct(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function no(e,t){for(var r=0;r<e.length;r++)if(Pn(t,e[r]))return!0;for(var a=0;a<t.length;a++)if(Pn(e,t[a]))return!0;return!!Ra(e,t)}function Ri(e,t,r){return!!Pn(e,t)||!!oo(t,e,r)}function wn(e,t){if(e.length===1)return La(t,e[0]);for(var r=0;r<t.length;r++)for(var a=t[r],l=0;l<a.length;l++)if(Pn(e,a[l]))return!0;for(var c=0;c<e.length;c++)if(La(t,e[c]))return!0;for(var h=0;h<t.length;h++)if(Ra(e,t[h]))return!0;return!1}function cn(e,t,r){if(e.length>1){if(Ra(e,t))return!0;for(var a=0;a<t.length;a++)if(oo(t[a],e,r))return!0}for(var l=0;l<e.length;l++)if(oo(e[l],t,r))return!0;return!1}function Ra(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var a=e[r],l=e[r+1],c=0;c<t.length-1;c++)if(na(a,l,t[c],t[c+1]))return!0;return!1}function na(e,t,r,a){return Ut(e,r,a)!==Ut(t,r,a)&&Ut(e,t,r)!==Ut(e,t,a)}function oo(e,t,r){var a=r*r;if(t.length===1)return e.distSqr(t[0])<a;for(var l=1;l<t.length;l++)if(oa(e,t[l-1],t[l])<a)return!0;return!1}function oa(e,t,r){var a=t.distSqr(r);if(a===0)return e.distSqr(t);var l=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/a;return e.distSqr(l<0?t:l>1?r:r.sub(t)._mult(l)._add(t))}function La(e,t){for(var r,a,l,c=!1,h=0;h<e.length;h++)for(var m=0,g=(r=e[h]).length-1;m<r.length;g=m++)(a=r[m]).y>t.y!=(l=r[g]).y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(c=!c);return c}function Pn(e,t){for(var r=!1,a=0,l=e.length-1;a<e.length;l=a++){var c=e[a],h=e[l];c.y>t.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(r=!r)}return r}function Fa(e,t,r){var a=r[0],l=r[2];if(e.x<a.x&&t.x<a.x||e.x>l.x&&t.x>l.x||e.y<a.y&&t.y<a.y||e.y>l.y&&t.y>l.y)return!1;var c=Ut(e,t,r[0]);return c!==Ut(e,t,r[1])||c!==Ut(e,t,r[2])||c!==Ut(e,t,r[3])}function Cn(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Yr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function On(e,t,r,a,l){if(!t[0]&&!t[1])return e;var c=X.convert(t)._mult(l);r==="viewport"&&c._rotate(-a);for(var h=[],m=0;m<e.length;m++)h.push(e[m].sub(c));return h}Ei.prototype.populate=function(e,t,r){var a=this.layers[0],l=[],c=null;a.type==="circle"&&(c=a.layout.get("circle-sort-key"));for(var h=0,m=e;h<m.length;h+=1){var g=m[h],x=g.feature,S=g.id,I=g.index,C=g.sourceLayerIndex,z=this.layers[0]._featureFilter.needGeometry,j=kr(x,z);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),j,r)){var G=c?c.evaluate(j,{},r):void 0,te={id:S,properties:x.properties,type:x.type,sourceLayerIndex:C,index:I,geometry:z?j.geometry:wr(x),patterns:{},sortKey:G};l.push(te)}}c&&l.sort((function(De,rt){return De.sortKey-rt.sortKey}));for(var K=0,oe=l;K<oe.length;K+=1){var le=oe[K],ce=le.geometry,he=le.index,xe=le.sourceLayerIndex,Pe=e[he].feature;this.addFeature(le,ce,he,r),t.featureIndex.insert(Pe,ce,he,xe,this.index)}},Ei.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Ei.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Ei.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ei.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,D),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Ei.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ei.prototype.addFeature=function(e,t,r,a){for(var l=0,c=t;l<c.length;l+=1)for(var h=0,m=c[l];h<m.length;h+=1){var g=m[h],x=g.x,S=g.y;if(!(x<0||x>=8192||S<0||S>=8192)){var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=I.vertexLength;Wi(this.layoutVertexArray,x,S,-1,-1),Wi(this.layoutVertexArray,x,S,1,-1),Wi(this.layoutVertexArray,x,S,1,1),Wi(this.layoutVertexArray,x,S,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),I.vertexLength+=4,I.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Xe("CircleBucket",Ei,{omit:["layers"]});var ao=new vi({"circle-sort-key":new Ye(L.layout_circle["circle-sort-key"])}),Do={paint:new vi({"circle-radius":new Ye(L.paint_circle["circle-radius"]),"circle-color":new Ye(L.paint_circle["circle-color"]),"circle-blur":new Ye(L.paint_circle["circle-blur"]),"circle-opacity":new Ye(L.paint_circle["circle-opacity"]),"circle-translate":new it(L.paint_circle["circle-translate"]),"circle-translate-anchor":new it(L.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new it(L.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new it(L.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ye(L.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ye(L.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ye(L.paint_circle["circle-stroke-opacity"])}),layout:ao},$t=typeof Float32Array<"u"?Float32Array:Array;function en(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Li(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],x=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],G=t[12],te=t[13],K=t[14],oe=t[15],le=r[0],ce=r[1],he=r[2],xe=r[3];return e[0]=le*a+ce*m+he*I+xe*G,e[1]=le*l+ce*g+he*C+xe*te,e[2]=le*c+ce*x+he*z+xe*K,e[3]=le*h+ce*S+he*j+xe*oe,e[4]=(le=r[4])*a+(ce=r[5])*m+(he=r[6])*I+(xe=r[7])*G,e[5]=le*l+ce*g+he*C+xe*te,e[6]=le*c+ce*x+he*z+xe*K,e[7]=le*h+ce*S+he*j+xe*oe,e[8]=(le=r[8])*a+(ce=r[9])*m+(he=r[10])*I+(xe=r[11])*G,e[9]=le*l+ce*g+he*C+xe*te,e[10]=le*c+ce*x+he*z+xe*K,e[11]=le*h+ce*S+he*j+xe*oe,e[12]=(le=r[12])*a+(ce=r[13])*m+(he=r[14])*I+(xe=r[15])*G,e[13]=le*l+ce*g+he*C+xe*te,e[14]=le*c+ce*x+he*z+xe*K,e[15]=le*h+ce*S+he*j+xe*oe,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Ro,Nc=Li;function _s(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3];return e[0]=r[0]*a+r[4]*l+r[8]*c+r[12]*h,e[1]=r[1]*a+r[5]*l+r[9]*c+r[13]*h,e[2]=r[2]*a+r[6]*l+r[10]*c+r[14]*h,e[3]=r[3]*a+r[7]*l+r[11]*c+r[15]*h,e}Ro=new $t(3),$t!=Float32Array&&(Ro[0]=0,Ro[1]=0,Ro[2]=0),(function(){var e=new $t(4);$t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)})();var jc=((function(){var e=new $t(2);$t!=Float32Array&&(e[0]=0,e[1]=0)})(),(function(e){function t(r){e.call(this,r,Do)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Ei(r)},t.prototype.queryRadius=function(r){var a=r;return Cn("circle-radius",this,a)+Cn("circle-stroke-width",this,a)+Yr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,x){for(var S=On(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),m.angle,g),I=this.paint.get("circle-radius").evaluate(a,l)+this.paint.get("circle-stroke-width").evaluate(a,l),C=this.paint.get("circle-pitch-alignment")==="map",z=C?S:(function(Pe,De){return Pe.map((function(rt){return Oa(rt,De)}))})(S,x),j=C?I*g:I,G=0,te=c;G<te.length;G+=1)for(var K=0,oe=te[G];K<oe.length;K+=1){var le=oe[K],ce=C?le:Oa(le,x),he=j,xe=_s([],[le.x,le.y,0,1],x);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?he*=xe[3]/m.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(he*=m.cameraToCenterDistance/xe[3]),Ri(z,ce,he))return!0}return!1},t})(An));function Oa(e,t){var r=_s([],[e.x,e.y,0,1],t);return new X(r[0]/r[3],r[1]/r[3])}var Dl=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(Ei);function aa(e,t,r,a){var l=t.width,c=t.height;if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==l*c*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(l*c*r);return e.width=l,e.height=c,e.data=a,e}function xs(e,t,r){var a=t.width,l=t.height;if(a!==e.width||l!==e.height){var c=aa({},{width:a,height:l},r);Gc(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,a),height:Math.min(e.height,l)},r),e.width=a,e.height=l,e.data=c.data}}function Gc(e,t,r,a,l,c){if(l.width===0||l.height===0)return t;if(l.width>e.width||l.height>e.height||r.x>e.width-l.width||r.y>e.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||a.x>t.width-l.width||a.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");for(var h=e.data,m=t.data,g=0;g<l.height;g++)for(var x=((r.y+g)*e.width+r.x)*c,S=((a.y+g)*t.width+a.x)*c,I=0;I<l.width*c;I++)m[S+I]=h[x+I];return t}Xe("HeatmapBucket",Dl,{omit:["layers"]});var Va=function(e,t){aa(this,e,1,t)};Va.prototype.resize=function(e){xs(this,e,1)},Va.prototype.clone=function(){return new Va({width:this.width,height:this.height},new Uint8Array(this.data))},Va.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,1)};var Hi=function(e,t){aa(this,e,4,t)};Hi.prototype.resize=function(e){xs(this,e,4)},Hi.prototype.replace=function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e},Hi.prototype.clone=function(){return new Hi({width:this.width,height:this.height},new Uint8Array(this.data))},Hi.copy=function(e,t,r,a,l){Gc(e,t,r,a,l,4)},Xe("AlphaImage",Va),Xe("RGBAImage",Hi);var Zx={paint:new vi({"heatmap-radius":new Ye(L.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ye(L.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new it(L.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bn(L.paint_heatmap["heatmap-color"]),"heatmap-opacity":new it(L.paint_heatmap["heatmap-opacity"])})};function um(e){var t={},r=e.resolution||256,a=e.clips?e.clips.length:1,l=e.image||new Hi({width:r,height:a}),c=function(j,G,te){t[e.evaluationKey]=te;var K=e.expression.evaluate(t);l.data[j+G+0]=Math.floor(255*K.r/K.a),l.data[j+G+1]=Math.floor(255*K.g/K.a),l.data[j+G+2]=Math.floor(255*K.b/K.a),l.data[j+G+3]=Math.floor(255*K.a)};if(e.clips)for(var h=0,m=0;h<a;++h,m+=4*r)for(var g=0,x=0;g<r;g++,x+=4){var S=g/(r-1),I=e.clips[h];c(m,x,I.start*(1-S)+I.end*S)}else for(var C=0,z=0;C<r;C++,z+=4)c(0,z,C/(r-1));return l}var $x=(function(e){function t(r){e.call(this,r,Zx),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Dl(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=um({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},t})(An),Wx={paint:new vi({"hillshade-illumination-direction":new it(L.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new it(L.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new it(L.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new it(L.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new it(L.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new it(L.paint_hillshade["hillshade-accent-color"])})},Hx=(function(e){function t(r){e.call(this,r,Wx)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},t})(An),Xx=ai([{name:"a_pos",components:2,type:"Int16"}],4).members,Zc=Rl,Kx=Rl;function Rl(e,t,r){r=r||2;var a,l,c,h,m,g,x,S=t&&t.length,I=S?t[0]*r:e.length,C=lm(e,0,I,r,!0),z=[];if(!C||C.next===C.prev)return z;if(S&&(C=(function(G,te,K,oe){var le,ce,he,xe=[];for(le=0,ce=te.length;le<ce;le++)(he=lm(G,te[le]*oe,le<ce-1?te[le+1]*oe:G.length,oe,!1))===he.next&&(he.steiner=!0),xe.push(nb(he));for(xe.sort(tb),le=0;le<xe.length;le++)rb(xe[le],K),K=sa(K,K.next);return K})(e,t,C,r)),e.length>80*r){a=c=e[0],l=h=e[1];for(var j=r;j<I;j+=r)(m=e[j])<a&&(a=m),(g=e[j+1])<l&&(l=g),m>c&&(c=m),g>h&&(h=g);x=(x=Math.max(c-a,h-l))!==0?1/x:0}return Tu(C,z,r,a,l,x),z}function lm(e,t,r,a,l){var c,h;if(l===Hc(e,t,r,a)>0)for(c=t;c<r;c+=a)h=hm(c,e[c],e[c+1],h);else for(c=r-a;c>=t;c-=a)h=hm(c,e[c],e[c+1],h);return h&&Ll(h,h.next)&&(Eu(h),h=h.next),h}function sa(e,t){if(!e)return e;t||(t=e);var r,a=e;do if(r=!1,a.steiner||!Ll(a,a.next)&&Zr(a.prev,a,a.next)!==0)a=a.next;else{if(Eu(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function Tu(e,t,r,a,l,c,h){if(e){!h&&c&&(function(S,I,C,z){var j=S;do j.z===null&&(j.z=$c(j.x,j.y,I,C,z)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==S);j.prevZ.nextZ=null,j.prevZ=null,(function(G){var te,K,oe,le,ce,he,xe,Pe,De=1;do{for(K=G,G=null,ce=null,he=0;K;){for(he++,oe=K,xe=0,te=0;te<De&&(xe++,oe=oe.nextZ);te++);for(Pe=De;xe>0||Pe>0&&oe;)xe!==0&&(Pe===0||!oe||K.z<=oe.z)?(le=K,K=K.nextZ,xe--):(le=oe,oe=oe.nextZ,Pe--),ce?ce.nextZ=le:G=le,le.prevZ=ce,ce=le;K=oe}ce.nextZ=null,De*=2}while(he>1)})(j)})(e,a,l,c);for(var m,g,x=e;e.prev!==e.next;)if(m=e.prev,g=e.next,c?Yx(e,a,l,c):Jx(e))t.push(m.i/r),t.push(e.i/r),t.push(g.i/r),Eu(e),e=g.next,x=g.next;else if((e=g)===x){h?h===1?Tu(e=Qx(sa(e),t,r),t,r,a,l,c,2):h===2&&eb(e,t,r,a,l,c):Tu(sa(e),t,r,a,l,c,1);break}}}function Jx(e){var t=e.prev,r=e,a=e.next;if(Zr(t,r,a)>=0)return!1;for(var l=e.next.next;l!==e.prev;){if(bs(t.x,t.y,r.x,r.y,a.x,a.y,l.x,l.y)&&Zr(l.prev,l,l.next)>=0)return!1;l=l.next}return!0}function Yx(e,t,r,a){var l=e.prev,c=e,h=e.next;if(Zr(l,c,h)>=0)return!1;for(var m=l.x>c.x?l.x>h.x?l.x:h.x:c.x>h.x?c.x:h.x,g=l.y>c.y?l.y>h.y?l.y:h.y:c.y>h.y?c.y:h.y,x=$c(l.x<c.x?l.x<h.x?l.x:h.x:c.x<h.x?c.x:h.x,l.y<c.y?l.y<h.y?l.y:h.y:c.y<h.y?c.y:h.y,t,r,a),S=$c(m,g,t,r,a),I=e.prevZ,C=e.nextZ;I&&I.z>=x&&C&&C.z<=S;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&Zr(I.prev,I,I.next)>=0||(I=I.prevZ,C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&Zr(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;I&&I.z>=x;){if(I!==e.prev&&I!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,I.x,I.y)&&Zr(I.prev,I,I.next)>=0)return!1;I=I.prevZ}for(;C&&C.z<=S;){if(C!==e.prev&&C!==e.next&&bs(l.x,l.y,c.x,c.y,h.x,h.y,C.x,C.y)&&Zr(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Qx(e,t,r){var a=e;do{var l=a.prev,c=a.next.next;!Ll(l,c)&&cm(l,a,a.next,c)&&Au(l,c)&&Au(c,l)&&(t.push(l.i/r),t.push(a.i/r),t.push(c.i/r),Eu(a),Eu(a.next),a=e=c),a=a.next}while(a!==e);return sa(a)}function eb(e,t,r,a,l,c){var h=e;do{for(var m=h.next.next;m!==h.prev;){if(h.i!==m.i&&ob(h,m)){var g=pm(h,m);return h=sa(h,h.next),g=sa(g,g.next),Tu(h,t,r,a,l,c),void Tu(g,t,r,a,l,c)}m=m.next}h=h.next}while(h!==e)}function tb(e,t){return e.x-t.x}function rb(e,t){if(t=(function(a,l){var c,h=l,m=a.x,g=a.y,x=-1/0;do{if(g<=h.y&&g>=h.next.y&&h.next.y!==h.y){var S=h.x+(g-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(S<=m&&S>x){if(x=S,S===m){if(g===h.y)return h;if(g===h.next.y)return h.next}c=h.x<h.next.x?h:h.next}}h=h.next}while(h!==l);if(!c)return null;if(m===x)return c;var I,C=c,z=c.x,j=c.y,G=1/0;h=c;do m>=h.x&&h.x>=z&&m!==h.x&&bs(g<j?m:x,g,z,j,g<j?x:m,g,h.x,h.y)&&(I=Math.abs(g-h.y)/(m-h.x),Au(h,a)&&(I<G||I===G&&(h.x>c.x||h.x===c.x&&ib(c,h)))&&(c=h,G=I)),h=h.next;while(h!==C);return c})(e,t)){var r=pm(t,e);sa(t,t.next),sa(r,r.next)}}function ib(e,t){return Zr(e.prev,e,t.prev)<0&&Zr(t.next,e,e.next)<0}function $c(e,t,r,a,l){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*l)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-a)*l)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function nb(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function bs(e,t,r,a,l,c,h,m){return(l-h)*(t-m)-(e-h)*(c-m)>=0&&(e-h)*(a-m)-(r-h)*(t-m)>=0&&(r-h)*(c-m)-(l-h)*(a-m)>=0}function ob(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!(function(r,a){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==a.i&&l.next.i!==a.i&&cm(l,l.next,r,a))return!0;l=l.next}while(l!==r);return!1})(e,t)&&(Au(e,t)&&Au(t,e)&&(function(r,a){var l=r,c=!1,h=(r.x+a.x)/2,m=(r.y+a.y)/2;do l.y>m!=l.next.y>m&&l.next.y!==l.y&&h<(l.next.x-l.x)*(m-l.y)/(l.next.y-l.y)+l.x&&(c=!c),l=l.next;while(l!==r);return c})(e,t)&&(Zr(e.prev,e,t.prev)||Zr(e,t.prev,t))||Ll(e,t)&&Zr(e.prev,e,e.next)>0&&Zr(t.prev,t,t.next)>0)}function Zr(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ll(e,t){return e.x===t.x&&e.y===t.y}function cm(e,t,r,a){var l=Ol(Zr(e,t,r)),c=Ol(Zr(e,t,a)),h=Ol(Zr(r,a,e)),m=Ol(Zr(r,a,t));return l!==c&&h!==m||!(l!==0||!Fl(e,r,t))||!(c!==0||!Fl(e,a,t))||!(h!==0||!Fl(r,e,a))||!(m!==0||!Fl(r,t,a))}function Fl(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ol(e){return e>0?1:e<0?-1:0}function Au(e,t){return Zr(e.prev,e,e.next)<0?Zr(e,t,e.next)>=0&&Zr(e,e.prev,t)>=0:Zr(e,t,e.prev)<0||Zr(e,e.next,t)<0}function pm(e,t){var r=new Wc(e.i,e.x,e.y),a=new Wc(t.i,t.x,t.y),l=e.next,c=t.prev;return e.next=t,t.prev=e,r.next=l,l.prev=r,a.next=r,r.prev=a,c.next=a,a.prev=c,a}function hm(e,t,r,a){var l=new Wc(e,t,r);return a?(l.next=a.next,l.prev=a,a.next.prev=l,a.next=l):(l.prev=l,l.next=l),l}function Eu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Wc(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Hc(e,t,r,a){for(var l=0,c=t,h=r-a;c<r;c+=a)l+=(e[h]-e[c])*(e[c+1]+e[h+1]),h=c;return l}function ab(e,t,r,a,l){(function c(h,m,g,x,S){for(;x>g;){if(x-g>600){var I=x-g+1,C=m-g+1,z=Math.log(I),j=.5*Math.exp(2*z/3),G=.5*Math.sqrt(z*j*(I-j)/I)*(C-I/2<0?-1:1);c(h,m,Math.max(g,Math.floor(m-C*j/I+G)),Math.min(x,Math.floor(m+(I-C)*j/I+G)),S)}var te=h[m],K=g,oe=x;for(Pu(h,g,m),S(h[x],te)>0&&Pu(h,g,x);K<oe;){for(Pu(h,K,oe),K++,oe--;S(h[K],te)<0;)K++;for(;S(h[oe],te)>0;)oe--}S(h[g],te)===0?Pu(h,g,oe):Pu(h,++oe,x),oe<=m&&(g=oe+1),m<=oe&&(x=oe-1)}})(e,t,r,a||e.length-1,l||sb)}function Pu(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function sb(e,t){return e<t?-1:e>t?1:0}function Xc(e,t){var r=e.length;if(r<=1)return[e];for(var a,l,c=[],h=0;h<r;h++){var m=Hr(e[h]);m!==0&&(e[h].area=Math.abs(m),l===void 0&&(l=m<0),l===m<0?(a&&c.push(a),a=[e[h]]):a.push(e[h]))}if(a&&c.push(a),t>1)for(var g=0;g<c.length;g++)c[g].length<=t||(ab(c[g],t,1,c[g].length-1,ub),c[g]=c[g].slice(0,t));return c}function ub(e,t){return t.area-e.area}function Kc(e,t,r){for(var a=r.patternDependencies,l=!1,c=0,h=t;c<h.length;c+=1){var m=h[c].paint.get(e+"-pattern");m.isConstant()||(l=!0);var g=m.constantOr(null);g&&(l=!0,a[g.to]=!0,a[g.from]=!0)}return l}function Jc(e,t,r,a,l){for(var c=l.patternDependencies,h=0,m=t;h<m.length;h+=1){var g=m[h],x=g.paint.get(e+"-pattern").value;if(x.kind!=="constant"){var S=x.evaluate({zoom:a-1},r,{},l.availableImages),I=x.evaluate({zoom:a},r,{},l.availableImages),C=x.evaluate({zoom:a+1},r,{},l.availableImages);I=I&&I.name?I.name:I,C=C&&C.name?C.name:C,c[S=S&&S.name?S.name:S]=!0,c[I]=!0,c[C]=!0,r.patterns[g.id]={min:S,mid:I,max:C}}}return r}Rl.deviation=function(e,t,r,a){var l=t&&t.length,c=Math.abs(Hc(e,0,l?t[0]*r:e.length,r));if(l)for(var h=0,m=t.length;h<m;h++)c-=Math.abs(Hc(e,t[h]*r,h<m-1?t[h+1]*r:e.length,r));var g=0;for(h=0;h<a.length;h+=3){var x=a[h]*r,S=a[h+1]*r,I=a[h+2]*r;g+=Math.abs((e[x]-e[I])*(e[S+1]-e[x+1])-(e[x]-e[S])*(e[I+1]-e[x+1]))}return c===0&&g===0?0:Math.abs((g-c)/c)},Rl.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,l=0;l<e.length;l++){for(var c=0;c<e[l].length;c++)for(var h=0;h<t;h++)r.vertices.push(e[l][c][h]);l>0&&r.holes.push(a+=e[l-1].length)}return r},Zc.default=Kx;var Vn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Bo,this.indexArray=new to,this.indexArray2=new Da,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.segments2=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Vn.prototype.populate=function(e,t,r){this.hasPattern=Kc("fill",this.layers,t);for(var a=this.layers[0].layout.get("fill-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,x=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=kr(g,C);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),z,r)){var j=a?a.evaluate(z,{},r,t.availableImages):void 0,G={id:x,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,De){return Pe.sortKey-De.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("fill",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Vn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Vn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Vn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Vn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Vn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Xx),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},Vn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Vn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,x=0,S=m;x<S.length;x+=1)g+=S[x].length;for(var I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray),C=I.vertexLength,z=[],j=[],G=0,te=m;G<te.length;G+=1){var K=te[G];if(K.length!==0){K!==m[0]&&j.push(z.length/2);var oe=this.segments2.prepareSegment(K.length,this.layoutVertexArray,this.indexArray2),le=oe.vertexLength;this.layoutVertexArray.emplaceBack(K[0].x,K[0].y),this.indexArray2.emplaceBack(le+K.length-1,le),z.push(K[0].x),z.push(K[0].y);for(var ce=1;ce<K.length;ce++)this.layoutVertexArray.emplaceBack(K[ce].x,K[ce].y),this.indexArray2.emplaceBack(le+ce-1,le+ce),z.push(K[ce].x),z.push(K[ce].y);oe.vertexLength+=K.length,oe.primitiveLength+=K.length}}for(var he=Zc(z,j),xe=0;xe<he.length;xe+=3)this.indexArray.emplaceBack(C+he[xe],C+he[xe+1],C+he[xe+2]);I.vertexLength+=g,I.primitiveLength+=he.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillBucket",Vn,{omit:["layers","patternFeatures"]});var lb=new vi({"fill-sort-key":new Ye(L.layout_fill["fill-sort-key"])}),cb={paint:new vi({"fill-antialias":new it(L.paint_fill["fill-antialias"]),"fill-opacity":new Ye(L.paint_fill["fill-opacity"]),"fill-color":new Ye(L.paint_fill["fill-color"]),"fill-outline-color":new Ye(L.paint_fill["fill-outline-color"]),"fill-translate":new it(L.paint_fill["fill-translate"]),"fill-translate-anchor":new it(L.paint_fill["fill-translate-anchor"]),"fill-pattern":new ds(L.paint_fill["fill-pattern"])}),layout:lb},pb=(function(e){function t(r){e.call(this,r,cb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a);var l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(r){return new Vn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){return wn(On(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),m.angle,g),c)},t.prototype.isTileClipped=function(){return!0},t})(An),hb=ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,fm=ws;function ws(e,t,r,a,l){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=l,e.readFields(fb,this,t)}function fb(e,t,r){e==1?t.id=r.readVarint():e==2?(function(a,l){for(var c=a.readVarint()+a.pos;a.pos<c;){var h=l._keys[a.readVarint()],m=l._values[a.readVarint()];l.properties[h]=m}})(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function db(e){for(var t,r,a=0,l=0,c=e.length,h=c-1;l<c;h=l++)a+=((r=e[h]).x-(t=e[l]).x)*(t.y+r.y);return a}ws.types=["Unknown","Point","LineString","Polygon"],ws.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,l=0,c=0,h=0,m=[];e.pos<r;){if(l<=0){var g=e.readVarint();a=7&g,l=g>>3}if(l--,a===1||a===2)c+=e.readSVarint(),h+=e.readSVarint(),a===1&&(t&&m.push(t),t=[]),t.push(new X(c,h));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&m.push(t),m},ws.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,l=0,c=0,h=1/0,m=-1/0,g=1/0,x=-1/0;e.pos<t;){if(a<=0){var S=e.readVarint();r=7&S,a=S>>3}if(a--,r===1||r===2)(l+=e.readSVarint())<h&&(h=l),l>m&&(m=l),(c+=e.readSVarint())<g&&(g=c),c>x&&(x=c);else if(r!==7)throw new Error("unknown command "+r)}return[h,g,m,x]},ws.prototype.toGeoJSON=function(e,t,r){var a,l,c=this.extent*Math.pow(2,r),h=this.extent*e,m=this.extent*t,g=this.loadGeometry(),x=ws.types[this.type];function S(z){for(var j=0;j<z.length;j++){var G=z[j];z[j]=[360*(G.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(G.y+m)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var I=[];for(a=0;a<g.length;a++)I[a]=g[a][0];S(g=I);break;case 2:for(a=0;a<g.length;a++)S(g[a]);break;case 3:for(g=(function(z){var j=z.length;if(j<=1)return[z];for(var G,te,K=[],oe=0;oe<j;oe++){var le=db(z[oe]);le!==0&&(te===void 0&&(te=le<0),te===le<0?(G&&K.push(G),G=[z[oe]]):G.push(z[oe]))}return G&&K.push(G),K})(g),a=0;a<g.length;a++)for(l=0;l<g[a].length;l++)S(g[a][l])}g.length===1?g=g[0]:x="Multi"+x;var C={type:"Feature",geometry:{type:x,coordinates:g},properties:this.properties};return"id"in this&&(C.id=this.id),C};var dm=mm;function mm(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(mb,this,t),this.length=this._features.length}function mb(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push((function(a){for(var l=null,c=a.readVarint()+a.pos;a.pos<c;){var h=a.readVarint()>>3;l=h===1?a.readString():h===2?a.readFloat():h===3?a.readDouble():h===4?a.readVarint64():h===5?a.readVarint():h===6?a.readSVarint():h===7?a.readBoolean():null}return l})(r))}function yb(e,t,r){if(e===3){var a=new dm(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}mm.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new fm(this._pbf,t,this.extent,this._keys,this._values)};var Ss={VectorTile:function(e,t){this.layers=e.readFields(yb,{},t)},VectorTileFeature:fm,VectorTileLayer:dm},vb=Ss.VectorTileFeature.types,Yc=Math.pow(2,13);function Cu(e,t,r,a,l,c,h,m){e.emplaceBack(t,r,2*Math.floor(a*Yc)+h,l*Yc*2,c*Yc*2,Math.round(m))}var qn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Fn,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function gb(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}qn.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=Kc("fill-extrusion",this.layers,t);for(var a=0,l=e;a<l.length;a+=1){var c=l[a],h=c.feature,m=c.id,g=c.index,x=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,I=kr(h,S);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),I,r)){var C={id:m,sourceLayerIndex:x,index:g,geometry:S?I.geometry:wr(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(Jc("fill-extrusion",this.layers,C,this.zoom,t)):this.addFeature(C,C.geometry,g,r,{}),t.featureIndex.insert(h,C.geometry,g,x,this.index,!0)}}},qn.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.features;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},qn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},qn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},qn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},qn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},qn.prototype.addFeature=function(e,t,r,a,l){for(var c=0,h=Xc(t,500);c<h.length;c+=1){for(var m=h[c],g=0,x=0,S=m;x<S.length;x+=1)g+=S[x].length;for(var I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),C=0,z=m;C<z.length;C+=1){var j=z[C];if(j.length!==0&&!((Tt=j).every((function(vt){return vt.x<0}))||Tt.every((function(vt){return vt.x>8192}))||Tt.every((function(vt){return vt.y<0}))||Tt.every((function(vt){return vt.y>8192}))))for(var G=0,te=0;te<j.length;te++){var K=j[te];if(te>=1){var oe=j[te-1];if(!gb(K,oe)){I.vertexLength+4>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var le=K.sub(oe)._perp()._unit(),ce=oe.dist(K);G+ce>32768&&(G=0),Cu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,0,G),Cu(this.layoutVertexArray,K.x,K.y,le.x,le.y,0,1,G),Cu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,0,G+=ce),Cu(this.layoutVertexArray,oe.x,oe.y,le.x,le.y,0,1,G);var he=I.vertexLength;this.indexArray.emplaceBack(he,he+2,he+1),this.indexArray.emplaceBack(he+1,he+2,he+3),I.vertexLength+=4,I.primitiveLength+=2}}}}if(I.vertexLength+g>F.MAX_VERTEX_ARRAY_LENGTH&&(I=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),vb[e.type]==="Polygon"){for(var xe=[],Pe=[],De=I.vertexLength,rt=0,Ue=m;rt<Ue.length;rt+=1){var ot=Ue[rt];if(ot.length!==0){ot!==m[0]&&Pe.push(xe.length/2);for(var je=0;je<ot.length;je++){var bt=ot[je];Cu(this.layoutVertexArray,bt.x,bt.y,0,0,1,1,0),xe.push(bt.x),xe.push(bt.y)}}}for(var pt=Zc(xe,Pe),Qe=0;Qe<pt.length;Qe+=3)this.indexArray.emplaceBack(De+pt[Qe],De+pt[Qe+2],De+pt[Qe+1]);I.primitiveLength+=pt.length/3,I.vertexLength+=g}}var Tt;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Xe("FillExtrusionBucket",qn,{omit:["layers","features"]});var _b={paint:new vi({"fill-extrusion-opacity":new it(L["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ye(L["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new it(L["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new it(L["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ds(L["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ye(L["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ye(L["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new it(L["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},xb=(function(e){function t(r){e.call(this,r,_b)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new qn(r)},t.prototype.queryRadius=function(){return Yr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g,x){var S=On(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),m.angle,g),I=this.paint.get("fill-extrusion-height").evaluate(a,l),C=this.paint.get("fill-extrusion-base").evaluate(a,l),z=(function(G,te,K,oe){for(var le=[],ce=0,he=G;ce<he.length;ce+=1){var xe=he[ce],Pe=[xe.x,xe.y,0,1];_s(Pe,Pe,te),le.push(new X(Pe[0]/Pe[3],Pe[1]/Pe[3]))}return le})(S,x),j=(function(G,te,K,oe){for(var le=[],ce=[],he=oe[8]*te,xe=oe[9]*te,Pe=oe[10]*te,De=oe[11]*te,rt=oe[8]*K,Ue=oe[9]*K,ot=oe[10]*K,je=oe[11]*K,bt=0,pt=G;bt<pt.length;bt+=1){for(var Qe=[],Tt=[],vt=0,Rt=pt[bt];vt<Rt.length;vt+=1){var at=Rt[vt],Vt=at.x,_r=at.y,Tr=oe[0]*Vt+oe[4]*_r+oe[12],Sr=oe[1]*Vt+oe[5]*_r+oe[13],xr=oe[2]*Vt+oe[6]*_r+oe[14],Ar=oe[3]*Vt+oe[7]*_r+oe[15],Qr=xr+Pe,ei=Ar+De,Ci=Tr+rt,li=Sr+Ue,ki=xr+ot,Mr=Ar+je,ci=new X((Tr+he)/ei,(Sr+xe)/ei);ci.z=Qr/ei,Qe.push(ci);var Mt=new X(Ci/Mr,li/Mr);Mt.z=ki/Mr,Tt.push(Mt)}le.push(Qe),ce.push(Tt)}return[le,ce]})(c,C,I,x);return(function(G,te,K){var oe=1/0;wn(K,te)&&(oe=ym(K,te[0]));for(var le=0;le<te.length;le++)for(var ce=te[le],he=G[le],xe=0;xe<ce.length-1;xe++){var Pe=ce[xe],De=[Pe,ce[xe+1],he[xe+1],he[xe],Pe];no(K,De)&&(oe=Math.min(oe,ym(K,De)))}return oe!==1/0&&oe})(j[0],j[1],z)},t})(An);function ku(e,t){return e.x*t.x+e.y*t.y}function ym(e,t){if(e.length===1){for(var r,a=0,l=t[a++];!r||l.equals(r);)if(!(r=t[a++]))return 1/0;for(;a<t.length;a++){var c=t[a],h=e[0],m=r.sub(l),g=c.sub(l),x=h.sub(l),S=ku(m,m),I=ku(m,g),C=ku(g,g),z=ku(x,m),j=ku(x,g),G=S*C-I*I,te=(C*z-I*j)/G,K=(S*j-I*z)/G,oe=l.z*(1-te-K)+r.z*te+c.z*K;if(isFinite(oe))return oe}return 1/0}for(var le=1/0,ce=0,he=t;ce<he.length;ce+=1)le=Math.min(le,he[ce].z);return le}var bb=ai([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,wb=ai([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Sb=Ss.VectorTileFeature.types,Ib=Math.cos(Math.PI/180*37.5),vm=Math.pow(2,14)/.5,Fi=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(r){return r.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(r){t.gradients[r.id]={}})),this.layoutVertexArray=new $i,this.layoutVertexArray2=new ta,this.indexArray=new to,this.programConfigurations=new ct(e.layers,e.zoom),this.segments=new F,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(r){return r.isStateDependent()})).map((function(r){return r.id}))};Fi.prototype.populate=function(e,t,r){this.hasPattern=Kc("line",this.layers,t);for(var a=this.layers[0].layout.get("line-sort-key"),l=[],c=0,h=e;c<h.length;c+=1){var m=h[c],g=m.feature,x=m.id,S=m.index,I=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=kr(g,C);if(this.layers[0]._featureFilter.filter(new Ct(this.zoom),z,r)){var j=a?a.evaluate(z,{},r):void 0,G={id:x,properties:g.properties,type:g.type,sourceLayerIndex:I,index:S,geometry:C?z.geometry:wr(g),patterns:{},sortKey:j};l.push(G)}}a&&l.sort((function(Pe,De){return Pe.sortKey-De.sortKey}));for(var te=0,K=l;te<K.length;te+=1){var oe=K[te],le=oe.geometry,ce=oe.index,he=oe.sourceLayerIndex;if(this.hasPattern){var xe=Jc("line",this.layers,oe,this.zoom,t);this.patternFeatures.push(xe)}else this.addFeature(oe,le,ce,r,{});t.featureIndex.insert(e[ce].feature,le,ce,he,this.index)}},Fi.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Fi.prototype.addFeatures=function(e,t,r){for(var a=0,l=this.patternFeatures;a<l.length;a+=1){var c=l[a];this.addFeature(c,c.geometry,c.index,t,r)}},Fi.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Fi.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Fi.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,wb)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,bb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Fi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Fi.prototype.lineFeatureClips=function(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}},Fi.prototype.addFeature=function(e,t,r,a,l){var c=this.layers[0].layout,h=c.get("line-join").evaluate(e,{}),m=c.get("line-cap"),g=c.get("line-miter-limit"),x=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var S=0,I=t;S<I.length;S+=1)this.addLine(I[S],e,h,m,g,x);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,l,a)},Fi.prototype.addLine=function(e,t,r,a,l,c){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var h=0;h<e.length-1;h++)this.totalDistance+=e[h].dist(e[h+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var m=Sb[t.type]==="Polygon",g=e.length;g>=2&&e[g-1].equals(e[g-2]);)g--;for(var x=0;x<g-1&&e[x].equals(e[x+1]);)x++;if(!(g<(m?3:2))){r==="bevel"&&(l=1.05);var S,I=this.overscaling<=16?122880/(512*this.overscaling):0,C=this.segments.prepareSegment(10*g,this.layoutVertexArray,this.indexArray),z=void 0,j=void 0,G=void 0,te=void 0;this.e1=this.e2=-1,m&&(te=e[x].sub(S=e[g-2])._unit()._perp());for(var K=x;K<g;K++)if(!(j=K===g-1?m?e[x+1]:void 0:e[K+1])||!e[K].equals(j)){te&&(G=te),S&&(z=S),S=e[K],te=j?j.sub(S)._unit()._perp():G;var oe=(G=G||te).add(te);oe.x===0&&oe.y===0||oe._unit();var le=G.x*te.x+G.y*te.y,ce=oe.x*te.x+oe.y*te.y,he=ce!==0?1/ce:1/0,xe=2*Math.sqrt(2-2*ce),Pe=ce<Ib&&z&&j,De=G.x*te.y-G.y*te.x>0;if(Pe&&K>x){var rt=S.dist(z);if(rt>2*I){var Ue=S.sub(S.sub(z)._mult(I/rt)._round());this.updateDistance(z,Ue),this.addCurrentVertex(Ue,G,0,0,C),z=Ue}}var ot=z&&j,je=ot?r:m?"butt":a;if(ot&&je==="round"&&(he<c?je="miter":he<=2&&(je="fakeround")),je==="miter"&&he>l&&(je="bevel"),je==="bevel"&&(he>2&&(je="flipbevel"),he<l&&(je="miter")),z&&this.updateDistance(z,S),je==="miter")oe._mult(he),this.addCurrentVertex(S,oe,0,0,C);else if(je==="flipbevel"){if(he>100)oe=te.mult(-1);else{var bt=he*G.add(te).mag()/G.sub(te).mag();oe._perp()._mult(bt*(De?-1:1))}this.addCurrentVertex(S,oe,0,0,C),this.addCurrentVertex(S,oe.mult(-1),0,0,C)}else if(je==="bevel"||je==="fakeround"){var pt=-Math.sqrt(he*he-1),Qe=De?pt:0,Tt=De?0:pt;if(z&&this.addCurrentVertex(S,G,Qe,Tt,C),je==="fakeround")for(var vt=Math.round(180*xe/Math.PI/20),Rt=1;Rt<vt;Rt++){var at=Rt/vt;if(at!==.5){var Vt=at-.5;at+=at*Vt*(at-1)*((1.0904+le*(le*(3.55645-1.43519*le)-3.2452))*Vt*Vt+(.848013+le*(.215638*le-1.06021)))}var _r=te.sub(G)._mult(at)._add(G)._unit()._mult(De?-1:1);this.addHalfVertex(S,_r.x,_r.y,!1,De,0,C)}j&&this.addCurrentVertex(S,te,-Qe,-Tt,C)}else if(je==="butt")this.addCurrentVertex(S,oe,0,0,C);else if(je==="square"){var Tr=z?1:-1;this.addCurrentVertex(S,oe,Tr,Tr,C)}else je==="round"&&(z&&(this.addCurrentVertex(S,G,0,0,C),this.addCurrentVertex(S,G,1,1,C,!0)),j&&(this.addCurrentVertex(S,te,-1,-1,C,!0),this.addCurrentVertex(S,te,0,0,C)));if(Pe&&K<g-1){var Sr=S.dist(j);if(Sr>2*I){var xr=S.add(j.sub(S)._mult(I/Sr)._round());this.updateDistance(S,xr),this.addCurrentVertex(xr,te,0,0,C),S=xr}}}}},Fi.prototype.addCurrentVertex=function(e,t,r,a,l,c){c===void 0&&(c=!1);var h=t.y*a-t.x,m=-t.y-t.x*a;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,l),this.addHalfVertex(e,h,m,c,!0,-a,l),this.distance>vm/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,a,l,c))},Fi.prototype.addHalfVertex=function(e,t,r,a,l,c,h){var m=.5*(this.lineClips?this.scaledDistance*(vm-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(a?1:0),(e.y<<1)+(l?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(c===0?0:c<0?-1:1)|(63&m)<<2,m>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var g=h.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,g),h.primitiveLength++),l?this.e2=g:this.e1=g},Fi.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Fi.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Xe("LineBucket",Fi,{omit:["layers","patternFeatures"]});var Tb=new vi({"line-cap":new it(L.layout_line["line-cap"]),"line-join":new Ye(L.layout_line["line-join"]),"line-miter-limit":new it(L.layout_line["line-miter-limit"]),"line-round-limit":new it(L.layout_line["line-round-limit"]),"line-sort-key":new Ye(L.layout_line["line-sort-key"])}),gm={paint:new vi({"line-opacity":new Ye(L.paint_line["line-opacity"]),"line-color":new Ye(L.paint_line["line-color"]),"line-translate":new it(L.paint_line["line-translate"]),"line-translate-anchor":new it(L.paint_line["line-translate-anchor"]),"line-width":new Ye(L.paint_line["line-width"]),"line-gap-width":new Ye(L.paint_line["line-gap-width"]),"line-offset":new Ye(L.paint_line["line-offset"]),"line-blur":new Ye(L.paint_line["line-blur"]),"line-dasharray":new Ai(L.paint_line["line-dasharray"]),"line-pattern":new ds(L.paint_line["line-pattern"]),"line-gradient":new bn(L.paint_line["line-gradient"])}),layout:Tb},_m=new((function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a){return a=new Ct(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),e.prototype.possiblyEvaluate.call(this,r,a)},t.prototype.evaluate=function(r,a,l,c){return a=Re({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,l,c)},t})(Ye))(gm.paint.properties["line-width"].specification);_m.useIntegerZoom=!0;var Ab=(function(e){function t(r){e.call(this,r,gm),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ui,this.gradientVersion=(this.gradientVersion+1)%Te)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a),this.paint._values["line-floorwidth"]=_m.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)},t.prototype.createBucket=function(r){return new Fi(r)},t.prototype.queryRadius=function(r){var a=r,l=xm(Cn("line-width",this,a),Cn("line-gap-width",this,a)),c=Cn("line-offset",this,a);return l/2+Math.abs(c)+Yr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,l,c,h,m,g){var x=On(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,g),S=g/2*xm(this.paint.get("line-width").evaluate(a,l),this.paint.get("line-gap-width").evaluate(a,l)),I=this.paint.get("line-offset").evaluate(a,l);return I&&(c=(function(C,z){for(var j=[],G=new X(0,0),te=0;te<C.length;te++){for(var K=C[te],oe=[],le=0;le<K.length;le++){var ce=K[le],he=K[le+1],xe=le===0?G:ce.sub(K[le-1])._unit()._perp(),Pe=le===K.length-1?G:he.sub(ce)._unit()._perp(),De=xe._add(Pe)._unit();De._mult(1/(De.x*Pe.x+De.y*Pe.y)),oe.push(De._mult(z)._add(ce))}j.push(oe)}return j})(c,I*g)),(function(C,z,j){for(var G=0;G<z.length;G++){var te=z[G];if(C.length>=3){for(var K=0;K<te.length;K++)if(Pn(C,te[K]))return!0}if(cn(C,te,j))return!0}return!1})(x,c,S)},t.prototype.isTileClipped=function(){return!0},t})(An);function xm(e,t){return t>0?t+2*e:e}var Eb=ai([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Pb=ai([{name:"a_projected_pos",components:3,type:"Float32"}],4),Cb=(ai([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ai([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),bm=(ai([{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"}]),ai([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),kb=ai([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Mb(e,t,r){return e.sections.forEach((function(a){a.text=(function(l,c,h){var m=c.layout.get("text-transform").evaluate(h,{});return m==="uppercase"?l=l.toLocaleUpperCase():m==="lowercase"&&(l=l.toLocaleLowerCase()),Qi.applyArabicShaping&&(l=Qi.applyArabicShaping(l)),l})(a.text,t,r)})),e}ai([{name:"triangle",components:3,type:"Uint16"}]),ai([{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"}]),ai([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ai([{type:"Float32",name:"offsetX"}]),ai([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Mu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},wm=function(e,t,r,a,l){var c,h,m=8*l-a-1,g=(1<<m)-1,x=g>>1,S=-7,I=l-1,C=-1,z=e[t+I];for(I+=C,c=z&(1<<-S)-1,z>>=-S,S+=m;S>0;c=256*c+e[t+I],I+=C,S-=8);for(h=c&(1<<-S)-1,c>>=-S,S+=a;S>0;h=256*h+e[t+I],I+=C,S-=8);if(c===0)c=1-x;else{if(c===g)return h?NaN:1/0*(z?-1:1);h+=Math.pow(2,a),c-=x}return(z?-1:1)*h*Math.pow(2,c-a)},Sm=function(e,t,r,a,l,c){var h,m,g,x=8*c-l-1,S=(1<<x)-1,I=S>>1,C=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=0,j=1,G=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,h=S):(h=Math.floor(Math.log(t)/Math.LN2),t*(g=Math.pow(2,-h))<1&&(h--,g*=2),(t+=h+I>=1?C/g:C*Math.pow(2,1-I))*g>=2&&(h++,g/=2),h+I>=S?(m=0,h=S):h+I>=1?(m=(t*g-1)*Math.pow(2,l),h+=I):(m=t*Math.pow(2,I-1)*Math.pow(2,l),h=0));l>=8;e[r+z]=255&m,z+=j,m/=256,l-=8);for(h=h<<l|m,x+=l;x>0;e[r+z]=255&h,z+=j,h/=256,x-=8);e[r+z-j]|=128*G},Vl=cr;function cr(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}cr.Varint=0,cr.Fixed64=1,cr.Bytes=2,cr.Fixed32=5;var Im=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Lo(e){return e.type===cr.Bytes?e.readVarint()+e.pos:e.pos+1}function Is(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Tm(e,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var l=r.pos-1;l>=e;l--)r.buf[l+a]=r.buf[l]}function Bb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function zb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Db(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Rb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Lb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Fb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Ob(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Vb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function qb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function ql(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Ts(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Am(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Ub(e,t,r){e===1&&r.readMessage(Nb,t)}function Nb(e,t,r){if(e===3){var a=r.readMessage(jb,{}),l=a.width,c=a.height,h=a.left,m=a.top,g=a.advance;t.push({id:a.id,bitmap:new Va({width:l+6,height:c+6},a.bitmap),metrics:{width:l,height:c,left:h,top:m,advance:g}})}}function jb(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function Em(e){for(var t=0,r=0,a=0,l=e;a<l.length;a+=1){var c=l[a];t+=c.w*c.h,r=Math.max(r,c.w)}e.sort((function(G,te){return te.h-G.h}));for(var h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],m=0,g=0,x=0,S=e;x<S.length;x+=1)for(var I=S[x],C=h.length-1;C>=0;C--){var z=h[C];if(!(I.w>z.w||I.h>z.h)){if(I.x=z.x,I.y=z.y,g=Math.max(g,I.y+I.h),m=Math.max(m,I.x+I.w),I.w===z.w&&I.h===z.h){var j=h.pop();C<h.length&&(h[C]=j)}else I.h===z.h?(z.x+=I.w,z.w-=I.w):I.w===z.w?(z.y+=I.h,z.h-=I.h):(h.push({x:z.x+I.w,y:z.y,w:z.w-I.w,h:I.h}),z.y+=I.h,z.h-=I.h);break}}return{w:m,h:g,fill:t/(m*g)||0}}cr.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),l=a>>3,c=this.pos;this.type=7&a,e(l,t,this),this.pos===c&&this.skip(a)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=ql(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Am(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=ql(this.buf,this.pos)+4294967296*ql(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=ql(this.buf,this.pos)+4294967296*Am(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=wm(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=wm(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:(function(l,c,h){var m,g,x=h.buf;if(m=(112&(g=x[h.pos++]))>>4,g<128||(m|=(127&(g=x[h.pos++]))<<3,g<128)||(m|=(127&(g=x[h.pos++]))<<10,g<128)||(m|=(127&(g=x[h.pos++]))<<17,g<128)||(m|=(127&(g=x[h.pos++]))<<24,g<128)||(m|=(1&(g=x[h.pos++]))<<31,g<128))return Is(l,m,c);throw new Error("Expected varint not more than 10 bytes")})(t|=(15&(r=a[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Im?(function(r,a,l){return Im.decode(r.subarray(a,l))})(this.buf,t,e):(function(r,a,l){for(var c="",h=a;h<l;){var m,g,x,S=r[h],I=null,C=S>239?4:S>223?3:S>191?2:1;if(h+C>l)break;C===1?S<128&&(I=S):C===2?(192&(m=r[h+1]))==128&&(I=(31&S)<<6|63&m)<=127&&(I=null):C===3?(g=r[h+2],(192&(m=r[h+1]))==128&&(192&g)==128&&((I=(15&S)<<12|(63&m)<<6|63&g)<=2047||I>=55296&&I<=57343)&&(I=null)):C===4&&(g=r[h+2],x=r[h+3],(192&(m=r[h+1]))==128&&(192&g)==128&&(192&x)==128&&((I=(15&S)<<18|(63&m)<<12|(63&g)<<6|63&x)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,C=1):I>65535&&(I-=65536,c+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),c+=String.fromCharCode(I),h+=C}return c})(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==cr.Bytes)return e.push(this.readVarint(t));var r=Lo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==cr.Bytes)return e.push(this.readSVarint());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==cr.Bytes)return e.push(this.readBoolean());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==cr.Bytes)return e.push(this.readFloat());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==cr.Bytes)return e.push(this.readDouble());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed32());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==cr.Bytes)return e.push(this.readSFixed64());var t=Lo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===cr.Varint)for(;this.buf[this.pos++]>127;);else if(t===cr.Bytes)this.pos=this.readVarint()+this.pos;else if(t===cr.Fixed32)this.pos+=4;else{if(t!==cr.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Ts(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Ts(this.buf,-1&e,this.pos),Ts(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?(function(t,r){var a,l;if(t>=0?(a=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),(function(c,h,m){m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,m.buf[m.pos]=127&(c>>>=7)})(a,0,r),(function(c,h){var m=(7&c)<<4;h.buf[h.pos++]|=m|((c>>>=3)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c)))))})(l,r)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=(function(a,l,c){for(var h,m,g=0;g<l.length;g++){if((h=l.charCodeAt(g))>55295&&h<57344){if(!m){h>56319||g+1===l.length?(a[c++]=239,a[c++]=191,a[c++]=189):m=h;continue}if(h<56320){a[c++]=239,a[c++]=191,a[c++]=189,m=h;continue}h=m-55296<<10|h-56320|65536,m=null}else m&&(a[c++]=239,a[c++]=191,a[c++]=189,m=null);h<128?a[c++]=h:(h<2048?a[c++]=h>>6|192:(h<65536?a[c++]=h>>12|224:(a[c++]=h>>18|240,a[c++]=h>>12&63|128),a[c++]=h>>6&63|128),a[c++]=63&h|128)}return c})(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Tm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Sm(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Sm(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var a=this.pos-r;a>=128&&Tm(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,cr.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Bb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,zb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Lb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Db,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Rb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Fb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Ob,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Vb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,qb,t)},writeBytesField:function(e,t){this.writeTag(e,cr.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,cr.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,cr.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,cr.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,cr.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,cr.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,cr.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Ul=function(e,t){var r=t.pixelRatio,a=t.version,l=t.stretchX,c=t.stretchY,h=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=l,this.stretchY=c,this.content=h,this.version=a},Bu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Bu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Bu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Bu.tlbr.get=function(){return this.tl.concat(this.br)},Bu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ul.prototype,Bu);var zu=function(e,t){var r={},a={};this.haveRenderCallbacks=[];var l=[];this.addImages(e,r,l),this.addImages(t,a,l);var c=Em(l),h=new Hi({width:c.w||1,height:c.h||1});for(var m in e){var g=e[m],x=r[m].paddedRect;Hi.copy(g.data,h,{x:0,y:0},{x:x.x+1,y:x.y+1},g.data)}for(var S in t){var I=t[S],C=a[S].paddedRect,z=C.x+1,j=C.y+1,G=I.data.width,te=I.data.height;Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j},I.data),Hi.copy(I.data,h,{x:0,y:te-1},{x:z,y:j-1},{width:G,height:1}),Hi.copy(I.data,h,{x:0,y:0},{x:z,y:j+te},{width:G,height:1}),Hi.copy(I.data,h,{x:G-1,y:0},{x:z-1,y:j},{width:1,height:te}),Hi.copy(I.data,h,{x:0,y:0},{x:z+G,y:j},{width:1,height:te})}this.image=h,this.iconPositions=r,this.patternPositions=a};zu.prototype.addImages=function(e,t,r){for(var a in e){var l=e[a],c={x:0,y:0,w:l.data.width+2,h:l.data.height+2};r.push(c),t[a]=new Ul(c,l),l.hasRenderCallback&&this.haveRenderCallbacks.push(a)}},zu.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},zu.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var a=e.tl;r.update(t.data,void 0,{x:a[0],y:a[1]})}},Xe("ImagePosition",Ul),Xe("ImageAtlas",zu);var pn={horizontal:1,vertical:2,horizontalOnly:3},As=function(){this.scale=1,this.fontStack="",this.imageName=null};As.forText=function(e,t){var r=new As;return r.scale=e||1,r.fontStack=t,r},As.forImage=function(e){var t=new As;return t.imageName=e,t};var Pi=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Nl(e,t,r,a,l,c,h,m,g,x,S,I,C,z,j,G){var te,K=Pi.fromFeature(e,l);I===pn.vertical&&K.verticalizePunctuation();var oe=Qi.processBidirectionalText,le=Qi.processStyledBidirectionalText;if(oe&&K.sections.length===1){te=[];for(var ce=0,he=oe(K.toString(),Qc(K,x,c,t,a,z,j));ce<he.length;ce+=1){var xe=he[ce],Pe=new Pi;Pe.text=xe,Pe.sections=K.sections;for(var De=0;De<xe.length;De++)Pe.sectionIndex.push(0);te.push(Pe)}}else if(le){te=[];for(var rt=0,Ue=le(K.text,K.sectionIndex,Qc(K,x,c,t,a,z,j));rt<Ue.length;rt+=1){var ot=Ue[rt],je=new Pi;je.text=ot[0],je.sectionIndex=ot[1],je.sections=K.sections,te.push(je)}}else te=(function(Qe,Tt){for(var vt=[],Rt=Qe.text,at=0,Vt=0,_r=Tt;Vt<_r.length;Vt+=1){var Tr=_r[Vt];vt.push(Qe.substring(at,Tr)),at=Tr}return at<Rt.length&&vt.push(Qe.substring(at,Rt.length)),vt})(K,Qc(K,x,c,t,a,z,j));var bt=[],pt={positionedLines:bt,text:K.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:I,iconsInText:!1,verticalizable:!1};return(function(Qe,Tt,vt,Rt,at,Vt,_r,Tr,Sr,xr,Ar,Qr){for(var ei=0,Ci=-17,li=0,ki=0,Mr=Tr==="right"?1:Tr==="left"?0:.5,ci=0,Mt=0,nr=at;Mt<nr.length;Mt+=1){var Jt=nr[Mt];Jt.trim();var Ft=Jt.getMaxScale(),Oi=24*(Ft-1),_i={positionedGlyphs:[],lineOffset:0};Qe.positionedLines[ci]=_i;var fr=_i.positionedGlyphs,Ur=0;if(Jt.length()){for(var xi=0;xi<Jt.length();xi++){var qt=Jt.getSection(xi),so=Jt.getSectionIndex(xi),hn=Jt.getCharCode(xi),uo=0,Br=null,lo=null,kn=null,Ds=24,ja=!(Sr===pn.horizontal||!Ar&&!ps(hn)||Ar&&(jl[hn]||(qo=hn,Le.Arabic(qo)||Le["Arabic Supplement"](qo)||Le["Arabic Extended-A"](qo)||Le["Arabic Presentation Forms-A"](qo)||Le["Arabic Presentation Forms-B"](qo))));if(qt.imageName){var Rs=Rt[qt.imageName];if(!Rs)continue;kn=qt.imageName,Qe.iconsInText=Qe.iconsInText||!0,lo=Rs.paddedRect;var Vo=Rs.displaySize;qt.scale=24*qt.scale/Qr,uo=Oi+(24-Vo[1]*qt.scale),Ds=(Br={width:Vo[0],height:Vo[1],left:1,top:-3,advance:ja?Vo[1]:Vo[0]}).advance;var Ls=ja?Vo[0]*qt.scale-24*Ft:Vo[1]*qt.scale-24*Ft;Ls>0&&Ls>Ur&&(Ur=Ls)}else{var Yl=vt[qt.fontStack],Fs=Yl&&Yl[hn];if(Fs&&Fs.rect)lo=Fs.rect,Br=Fs.metrics;else{var Lu=Tt[qt.fontStack],Ql=Lu&&Lu[hn];if(!Ql)continue;Br=Ql.metrics}uo=24*(Ft-qt.scale)}ja?(Qe.verticalizable=!0,fr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:Br,rect:lo}),ei+=Ds*qt.scale+xr):(fr.push({glyph:hn,imageName:kn,x:ei,y:Ci+uo,vertical:ja,scale:qt.scale,fontStack:qt.fontStack,sectionIndex:so,metrics:Br,rect:lo}),ei+=Br.advance*qt.scale+xr)}fr.length!==0&&(li=Math.max(ei-xr,li),Zb(fr,0,fr.length-1,Mr,Ur)),ei=0;var ec=Vt*Ft+Ur;_i.lineOffset=Math.max(Ur,Oi),Ci+=ec,ki=Math.max(ec,ki),++ci}else Ci+=Vt,++ci}var qo,Fu=Ci- -17,Os=ep(_r),la=Os.horizontalAlign,Vs=Os.verticalAlign;(function(tc,rc,Ou,Vu,ic,qu,Uu,Nu,nc){var qs,oc=(rc-Ou)*ic;qs=qu!==Uu?-Nu*Vu- -17:(-Vu*nc+.5)*Uu;for(var Us=0,ju=tc;Us<ju.length;Us+=1)for(var Ga=0,Gu=ju[Us].positionedGlyphs;Ga<Gu.length;Ga+=1){var Ns=Gu[Ga];Ns.x+=oc,Ns.y+=qs}})(Qe.positionedLines,Mr,la,Vs,li,ki,Vt,Fu,at.length),Qe.top+=-Vs*Fu,Qe.bottom=Qe.top+Fu,Qe.left+=-la*li,Qe.right=Qe.left+li})(pt,t,r,a,te,h,m,g,I,x,C,G),!(function(Qe){for(var Tt=0,vt=Qe;Tt<vt.length;Tt+=1)if(vt[Tt].positionedGlyphs.length!==0)return!1;return!0})(bt)&&pt}Pi.fromFeature=function(e,t){for(var r=new Pi,a=0;a<e.sections.length;a++){var l=e.sections[a];l.image?r.addImageSection(l):r.addTextSection(l,t)}return r},Pi.prototype.length=function(){return this.text.length},Pi.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Pi.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Pi.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Pi.prototype.verticalizePunctuation=function(){this.text=(function(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r+1)||null,l=e.charCodeAt(r-1)||null;t+=a&&yu(a)&&!Mu[e[r+1]]||l&&yu(l)&&!Mu[e[r-1]]||!Mu[e[r]]?e[r]:Mu[e[r]]}return t})(this.text)},Pi.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&jl[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&jl[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Pi.prototype.substring=function(e,t){var r=new Pi;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Pi.prototype.toString=function(){return this.text},Pi.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},Pi.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(As.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,a=0;a<e.text.length;++a)this.sectionIndex.push(r)},Pi.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(t.length!==0){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(As.forImage(t)),this.sectionIndex.push(this.sections.length-1)):St("Reached maximum number of images 6401")}else St("Can't add FormattedSection with an empty image.")},Pi.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var jl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},tn={};function Pm(e,t,r,a,l,c){if(t.imageName){var h=a[t.imageName];return h?h.displaySize[0]*t.scale*24/c+l:0}var m=r[t.fontStack],g=m&&m[e];return g?g.metrics.advance*t.scale+l:0}function Cm(e,t,r,a){var l=Math.pow(e-t,2);return a?e<t?l/2:2*l:l+Math.abs(r)*r}function Gb(e,t,r){var a=0;return e===10&&(a-=1e4),r&&(a+=150),e!==40&&e!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function km(e,t,r,a,l,c){for(var h=null,m=Cm(t,r,l,c),g=0,x=a;g<x.length;g+=1){var S=x[g],I=Cm(t-S.x,r,l,c)+S.badness;I<=m&&(h=S,m=I)}return{index:e,x:t,priorBreak:h,badness:m}}function Qc(e,t,r,a,l,c,h){if(c!=="point")return[];if(!e)return[];for(var m,g=[],x=(function(te,K,oe,le,ce,he){for(var xe=0,Pe=0;Pe<te.length();Pe++){var De=te.getSection(Pe);xe+=Pm(te.getCharCode(Pe),De,le,ce,K,he)}return xe/Math.max(1,Math.ceil(xe/oe))})(e,t,r,a,l,h),S=e.text.indexOf("​")>=0,I=0,C=0;C<e.length();C++){var z=e.getSection(C),j=e.getCharCode(C);if(jl[j]||(I+=Pm(j,z,a,l,t,h)),C<e.length()-1){var G=!((m=j)<11904||!(Le["Bopomofo Extended"](m)||Le.Bopomofo(m)||Le["CJK Compatibility Forms"](m)||Le["CJK Compatibility Ideographs"](m)||Le["CJK Compatibility"](m)||Le["CJK Radicals Supplement"](m)||Le["CJK Strokes"](m)||Le["CJK Symbols and Punctuation"](m)||Le["CJK Unified Ideographs Extension A"](m)||Le["CJK Unified Ideographs"](m)||Le["Enclosed CJK Letters and Months"](m)||Le["Halfwidth and Fullwidth Forms"](m)||Le.Hiragana(m)||Le["Ideographic Description Characters"](m)||Le["Kangxi Radicals"](m)||Le["Katakana Phonetic Extensions"](m)||Le.Katakana(m)||Le["Vertical Forms"](m)||Le["Yi Radicals"](m)||Le["Yi Syllables"](m)));(tn[j]||G||z.imageName)&&g.push(km(C+1,I,x,g,Gb(j,e.getCharCode(C+1),G&&S),!1))}}return(function te(K){return K?te(K.priorBreak).concat(K.index):[]})(km(e.length(),I,x,g,0,!0))}function ep(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Zb(e,t,r,a,l){if(a||l)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*a,m=t;m<=r;m++)e[m].x-=h,e[m].y+=l}function Mm(e,t,r,a,l,c){var h,m=e.image;if(m.content){var g=m.content,x=m.pixelRatio||1;h=[g[0]/x,g[1]/x,m.displaySize[0]-g[2]/x,m.displaySize[1]-g[3]/x]}var S,I,C,z,j=t.left*c,G=t.right*c;r==="width"||r==="both"?(z=l[0]+j-a[3],I=l[0]+G+a[1]):I=(z=l[0]+(j+G-m.displaySize[0])/2)+m.displaySize[0];var te=t.top*c,K=t.bottom*c;return r==="height"||r==="both"?(S=l[1]+te-a[0],C=l[1]+K+a[2]):C=(S=l[1]+(te+K-m.displaySize[1])/2)+m.displaySize[1],{image:m,top:S,right:I,bottom:C,left:z,collisionPadding:h}}tn[10]=!0,tn[32]=!0,tn[38]=!0,tn[40]=!0,tn[41]=!0,tn[43]=!0,tn[45]=!0,tn[47]=!0,tn[173]=!0,tn[183]=!0,tn[8203]=!0,tn[8208]=!0,tn[8211]=!0,tn[8231]=!0;var Es=(function(e){function t(r,a,l,c){e.call(this,r,a),this.angle=l,c!==void 0&&(this.segment=c)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t})(X);function tp(e,t){var r=t.expression;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Ct(e+1))};if(r.kind==="source")return{kind:"source"};for(var a=r.zoomStops,l=r.interpolationType,c=0;c<a.length&&a[c]<=e;)c++;for(var h=c=Math.max(0,c-1);h<a.length&&a[h]<e+1;)h++;h=Math.min(a.length-1,h);var m=a[c],g=a[h];return r.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:g,interpolationType:l}:{kind:"camera",minZoom:m,maxZoom:g,minSize:r.evaluate(new Ct(m)),maxSize:r.evaluate(new Ct(g)),interpolationType:l}}function Bm(e,t,r){var a=t.uSize,l=r.lowerSize;return e.kind==="source"?l/128:e.kind==="composite"?Vr(l/128,r.upperSize/128,t.uSizeT):a}function zm(e,t){var r=0,a=0;if(e.kind==="constant")a=e.layoutSize;else if(e.kind!=="source"){var l=e.interpolationType,c=l?Oe(mi.interpolationFactor(l,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=Vr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Xe("Anchor",Es);var $b=Object.freeze({__proto__:null,getSizeData:tp,evaluateSizeForFeature:Bm,evaluateSizeForZoom:zm,SIZE_PACK_FACTOR:128});function Dm(e,t,r,a,l){if(t.segment===void 0)return!0;for(var c=t,h=t.segment+1,m=0;m>-r/2;){if(--h<0)return!1;m-=e[h].dist(c),c=e[h]}m+=e[h].dist(e[h+1]),h++;for(var g=[],x=0;m<r/2;){var S=e[h],I=e[h+1];if(!I)return!1;var C=e[h-1].angleTo(S)-S.angleTo(I);for(C=Math.abs((C+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:m,angleDelta:C}),x+=C;m-g[0].distance>a;)x-=g.shift().angleDelta;if(x>l)return!1;h++,m+=S.dist(I)}return!0}function Rm(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Lm(e,t,r){return e?.6*t*r:0}function Fm(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Wb(e,t,r,a,l,c){for(var h=Lm(r,l,c),m=Fm(r,a)*c,g=0,x=Rm(e)/2,S=0;S<e.length-1;S++){var I=e[S],C=e[S+1],z=I.dist(C);if(g+z>x){var j=(x-g)/z,G=Vr(I.x,C.x,j),te=Vr(I.y,C.y,j),K=new Es(G,te,C.angleTo(I),S);return K._round(),!h||Dm(e,K,m,h,t)?K:void 0}g+=z}}function Hb(e,t,r,a,l,c,h,m,g){var x=Lm(a,c,h),S=Fm(a,l),I=S*h,C=e[0].x===0||e[0].x===g||e[0].y===0||e[0].y===g;return t-I<t/4&&(t=I+t/4),(function z(j,G,te,K,oe,le,ce,he,xe){for(var Pe=le/2,De=Rm(j),rt=0,Ue=G-te,ot=[],je=0;je<j.length-1;je++){for(var bt=j[je],pt=j[je+1],Qe=bt.dist(pt),Tt=pt.angleTo(bt);Ue+te<rt+Qe;){var vt=((Ue+=te)-rt)/Qe,Rt=Vr(bt.x,pt.x,vt),at=Vr(bt.y,pt.y,vt);if(Rt>=0&&Rt<xe&&at>=0&&at<xe&&Ue-Pe>=0&&Ue+Pe<=De){var Vt=new Es(Rt,at,Tt,je);Vt._round(),K&&!Dm(j,Vt,le,K,oe)||ot.push(Vt)}}rt+=Qe}return he||ot.length||ce||(ot=z(j,rt/2,te,K,oe,le,ce,!0,xe)),ot})(e,C?t/2*m%t:(S/2+2*c)*h*m%t,t,x,r,I,C,!1,g)}function Om(e,t,r,a,l){for(var c=[],h=0;h<e.length;h++)for(var m=e[h],g=void 0,x=0;x<m.length-1;x++){var S=m[x],I=m[x+1];S.x<t&&I.x<t||(S.x<t?S=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x<t&&(I=new X(t,S.y+(t-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y<r&&I.y<r||(S.y<r?S=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round():I.y<r&&(I=new X(S.x+(r-S.y)/(I.y-S.y)*(I.x-S.x),r)._round()),S.x>=a&&I.x>=a||(S.x>=a?S=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round():I.x>=a&&(I=new X(a,S.y+(a-S.x)/(I.x-S.x)*(I.y-S.y))._round()),S.y>=l&&I.y>=l||(S.y>=l?S=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round():I.y>=l&&(I=new X(S.x+(l-S.y)/(I.y-S.y)*(I.x-S.x),l)._round()),g&&S.equals(g[g.length-1])||c.push(g=[S]),g.push(I)))))}return c}function Vm(e,t,r,a){var l=[],c=e.image,h=c.pixelRatio,m=c.paddedRect.w-2,g=c.paddedRect.h-2,x=e.right-e.left,S=e.bottom-e.top,I=c.stretchX||[[0,m]],C=c.stretchY||[[0,g]],z=function(Rt,at){return Rt+at[1]-at[0]},j=I.reduce(z,0),G=C.reduce(z,0),te=m-j,K=g-G,oe=0,le=j,ce=0,he=G,xe=0,Pe=te,De=0,rt=K;if(c.content&&a){var Ue=c.content;oe=Gl(I,0,Ue[0]),ce=Gl(C,0,Ue[1]),le=Gl(I,Ue[0],Ue[2]),he=Gl(C,Ue[1],Ue[3]),xe=Ue[0]-oe,De=Ue[1]-ce,Pe=Ue[2]-Ue[0]-le,rt=Ue[3]-Ue[1]-he}var ot=function(Rt,at,Vt,_r){var Tr=Zl(Rt.stretch-oe,le,x,e.left),Sr=$l(Rt.fixed-xe,Pe,Rt.stretch,j),xr=Zl(at.stretch-ce,he,S,e.top),Ar=$l(at.fixed-De,rt,at.stretch,G),Qr=Zl(Vt.stretch-oe,le,x,e.left),ei=$l(Vt.fixed-xe,Pe,Vt.stretch,j),Ci=Zl(_r.stretch-ce,he,S,e.top),li=$l(_r.fixed-De,rt,_r.stretch,G),ki=new X(Tr,xr),Mr=new X(Qr,xr),ci=new X(Qr,Ci),Mt=new X(Tr,Ci),nr=new X(Sr/h,Ar/h),Jt=new X(ei/h,li/h),Ft=t*Math.PI/180;if(Ft){var Oi=Math.sin(Ft),_i=Math.cos(Ft),fr=[_i,-Oi,Oi,_i];ki._matMult(fr),Mr._matMult(fr),Mt._matMult(fr),ci._matMult(fr)}var Ur=Rt.stretch+Rt.fixed,xi=at.stretch+at.fixed;return{tl:ki,tr:Mr,bl:Mt,br:ci,tex:{x:c.paddedRect.x+1+Ur,y:c.paddedRect.y+1+xi,w:Vt.stretch+Vt.fixed-Ur,h:_r.stretch+_r.fixed-xi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:nr,pixelOffsetBR:Jt,minFontScaleX:Pe/h/x,minFontScaleY:rt/h/S,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var je=qm(I,te,j),bt=qm(C,K,G),pt=0;pt<je.length-1;pt++)for(var Qe=je[pt],Tt=je[pt+1],vt=0;vt<bt.length-1;vt++)l.push(ot(Qe,bt[vt],Tt,bt[vt+1]));else l.push(ot({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:g+1}));return l}function Gl(e,t,r){for(var a=0,l=0,c=e;l<c.length;l+=1){var h=c[l];a+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]))}return a}function qm(e,t,r){for(var a=[{fixed:-1,stretch:0}],l=0,c=e;l<c.length;l+=1){var h=c[l],m=h[0],g=h[1],x=a[a.length-1];a.push({fixed:m-x.stretch,stretch:x.stretch}),a.push({fixed:m-x.stretch,stretch:x.stretch+(g-m)})}return a.push({fixed:t+1,stretch:r}),a}function Zl(e,t,r,a){return e/t*r+a}function $l(e,t,r,a){return e-t*r/a}var Wl=function(e,t,r,a,l,c,h,m,g,x){if(this.boxStartIndex=e.length,g){var S=c.top,I=c.bottom,C=c.collisionPadding;C&&(S-=C[1],I+=C[3]);var z=I-S;z>0&&(z=Math.max(10,z),this.circleDiameter=z)}else{var j=c.top*h-m,G=c.bottom*h+m,te=c.left*h-m,K=c.right*h+m,oe=c.collisionPadding;if(oe&&(te-=oe[0]*h,j-=oe[1]*h,K+=oe[2]*h,G+=oe[3]*h),x){var le=new X(te,j),ce=new X(K,j),he=new X(te,G),xe=new X(K,G),Pe=x*Math.PI/180;le._rotate(Pe),ce._rotate(Pe),he._rotate(Pe),xe._rotate(Pe),te=Math.min(le.x,ce.x,he.x,xe.x),K=Math.max(le.x,ce.x,he.x,xe.x),j=Math.min(le.y,ce.y,he.y,xe.y),G=Math.max(le.y,ce.y,he.y,xe.y)}e.emplaceBack(t.x,t.y,te,j,K,G,r,a,l)}this.boxEndIndex=e.length},Ps=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=Xb),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Xb(e,t){return e<t?-1:e>t?1:0}function Kb(e,t,r){r===void 0&&(r=!1);for(var a=1/0,l=1/0,c=-1/0,h=-1/0,m=e[0],g=0;g<m.length;g++){var x=m[g];(!g||x.x<a)&&(a=x.x),(!g||x.y<l)&&(l=x.y),(!g||x.x>c)&&(c=x.x),(!g||x.y>h)&&(h=x.y)}var S=Math.min(c-a,h-l),I=S/2,C=new Ps([],Jb);if(S===0)return new X(a,l);for(var z=a;z<c;z+=S)for(var j=l;j<h;j+=S)C.push(new Cs(z+I,j+I,I,e));for(var G=(function(oe){for(var le=0,ce=0,he=0,xe=oe[0],Pe=0,De=xe.length,rt=De-1;Pe<De;rt=Pe++){var Ue=xe[Pe],ot=xe[rt],je=Ue.x*ot.y-ot.x*Ue.y;ce+=(Ue.x+ot.x)*je,he+=(Ue.y+ot.y)*je,le+=3*je}return new Cs(ce/le,he/le,0,oe)})(e),te=C.length;C.length;){var K=C.pop();(K.d>G.d||!G.d)&&(G=K,r&&console.log("found best %d after %d probes",Math.round(1e4*K.d)/1e4,te)),K.max-G.d<=t||(C.push(new Cs(K.p.x-(I=K.h/2),K.p.y-I,I,e)),C.push(new Cs(K.p.x+I,K.p.y-I,I,e)),C.push(new Cs(K.p.x-I,K.p.y+I,I,e)),C.push(new Cs(K.p.x+I,K.p.y+I,I,e)),te+=4)}return r&&(console.log("num probes: "+te),console.log("best distance: "+G.d)),G.p}function Jb(e,t){return t.max-e.max}function Cs(e,t,r,a){this.p=new X(e,t),this.h=r,this.d=(function(l,c){for(var h=!1,m=1/0,g=0;g<c.length;g++)for(var x=c[g],S=0,I=x.length,C=I-1;S<I;C=S++){var z=x[S],j=x[C];z.y>l.y!=j.y>l.y&&l.x<(j.x-z.x)*(l.y-z.y)/(j.y-z.y)+z.x&&(h=!h),m=Math.min(m,oa(l,z,j))}return(h?1:-1)*Math.sqrt(m)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}Ps.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Ps.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Ps.prototype.peek=function(){return this.data[0]},Ps.prototype._up=function(e){for(var t=this.data,r=this.compare,a=t[e];e>0;){var l=e-1>>1,c=t[l];if(r(a,c)>=0)break;t[e]=c,e=l}t[e]=a},Ps.prototype._down=function(e){for(var t=this.data,r=this.compare,a=this.length>>1,l=t[e];e<a;){var c=1+(e<<1),h=t[c],m=c+1;if(m<this.length&&r(t[m],h)<0&&(c=m,h=t[m]),r(h,l)>=0)break;t[e]=h,e=c}t[e]=l};var rp=Number.POSITIVE_INFINITY;function Um(e,t){return t[1]!==rp?(function(r,a,l){var c=0,h=0;switch(a=Math.abs(a),l=Math.abs(l),r){case"top-right":case"top-left":case"top":h=l-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-l}switch(r){case"top-right":case"bottom-right":case"right":c=-a;break;case"top-left":case"bottom-left":case"left":c=a}return[c,h]})(e,t[0],t[1]):(function(r,a){var l=0,c=0;a<0&&(a=0);var h=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":c=h-7;break;case"bottom-right":case"bottom-left":c=7-h;break;case"bottom":c=7-a;break;case"top":c=a-7}switch(r){case"top-right":case"bottom-right":l=-h;break;case"top-left":case"bottom-left":l=h;break;case"left":l=a;break;case"right":l=-a}return[l,c]})(e,t[0])}function ip(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Nm(e,t,r,a,l,c,h,m,g,x,S,I,C,z,j){var G=(function(ce,he,xe,Pe,De,rt,Ue,ot){for(var je=Pe.layout.get("text-rotate").evaluate(rt,{})*Math.PI/180,bt=[],pt=0,Qe=he.positionedLines;pt<Qe.length;pt+=1)for(var Tt=Qe[pt],vt=0,Rt=Tt.positionedGlyphs;vt<Rt.length;vt+=1){var at=Rt[vt];if(at.rect){var Vt=at.rect||{},_r=4,Tr=!0,Sr=1,xr=0,Ar=(De||ot)&&at.vertical,Qr=at.metrics.advance*at.scale/2;if(ot&&he.verticalizable&&(xr=Tt.lineOffset/2-(at.imageName?-(24-at.metrics.width*at.scale)/2:24*(at.scale-1))),at.imageName){var ei=Ue[at.imageName];Tr=ei.sdf,_r=1/(Sr=ei.pixelRatio)}var Ci=De?[at.x+Qr,at.y]:[0,0],li=De?[0,0]:[at.x+Qr+xe[0],at.y+xe[1]-xr],ki=[0,0];Ar&&(ki=li,li=[0,0]);var Mr=(at.metrics.left-_r)*at.scale-Qr+li[0],ci=(-at.metrics.top-_r)*at.scale+li[1],Mt=Mr+Vt.w*at.scale/Sr,nr=ci+Vt.h*at.scale/Sr,Jt=new X(Mr,ci),Ft=new X(Mt,ci),Oi=new X(Mr,nr),_i=new X(Mt,nr);if(Ar){var fr=new X(-Qr,Qr- -17),Ur=-Math.PI/2,xi=12-Qr,qt=new X(22-xi,-(at.imageName?xi:0)),so=new(Function.prototype.bind.apply(X,[null].concat(ki)));Jt._rotateAround(Ur,fr)._add(qt)._add(so),Ft._rotateAround(Ur,fr)._add(qt)._add(so),Oi._rotateAround(Ur,fr)._add(qt)._add(so),_i._rotateAround(Ur,fr)._add(qt)._add(so)}if(je){var hn=Math.sin(je),uo=Math.cos(je),Br=[uo,-hn,hn,uo];Jt._matMult(Br),Ft._matMult(Br),Oi._matMult(Br),_i._matMult(Br)}var lo=new X(0,0),kn=new X(0,0);bt.push({tl:Jt,tr:Ft,bl:Oi,br:_i,tex:Vt,writingMode:he.writingMode,glyphOffset:Ci,sectionIndex:at.sectionIndex,isSDF:Tr,pixelOffsetTL:lo,pixelOffsetBR:kn,minFontScaleX:0,minFontScaleY:0})}}return bt})(0,r,m,l,c,h,a,e.allowVerticalPlacement),te=e.textSizeData,K=null;te.kind==="source"?(K=[128*l.layout.get("text-size").evaluate(h,{})])[0]>32640&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):te.kind==="composite"&&((K=[128*z.compositeTextSizes[0].evaluate(h,{},j),128*z.compositeTextSizes[1].evaluate(h,{},j)])[0]>32640||K[1]>32640)&&St(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,G,K,m,c,h,x,t,g.lineStartIndex,g.lineLength,C,j);for(var oe=0,le=S;oe<le.length;oe+=1)I[le[oe]]=e.text.placedSymbolArray.length-1;return 4*G.length}function jm(e){for(var t in e)return e[t];return null}function Yb(e,t,r,a){var l=e.compareText;if(t in l){for(var c=l[t],h=c.length-1;h>=0;h--)if(a.dist(c[h])<r)return!0}else l[t]=[];return l[t].push(a),!1}var Qb=Ss.VectorTileFeature.types,e0=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hl(e,t,r,a,l,c,h,m,g,x,S,I,C){var z=m?Math.min(32640,Math.round(m[0])):0,j=m?Math.min(32640,Math.round(m[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*l),c,h,(z<<1)+(g?1:0),j,16*x,16*S,256*I,256*C)}function np(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function t0(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(hs(r[t].text))return!0;return!1}var ks=function(e){this.layoutVertexArray=new ys,this.indexArray=new to,this.programConfigurations=e,this.segments=new F,this.dynamicLayoutVertexArray=new ra,this.opacityVertexArray=new za,this.placedSymbolArray=new s};ks.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},ks.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Eb.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Pb.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,e0,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Xe("SymbolBuffers",ks);var Du=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new F,this.collisionVertexArray=new wu};Du.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Cb.members,!0)},Du.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Xe("CollisionBuffers",Du);var er=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(c){return c.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=en([]),this.placementViewportMatrix=en([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=tp(this.zoom,t["text-size"]),this.iconSizeData=tp(this.zoom,t["icon-size"]);var r=this.layers[0].layout,a=r.get("symbol-sort-key"),l=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=l!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(l==="viewport-y"||l==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map((function(c){return pn[c]}))),this.stateDependentLayerIds=this.layers.filter((function(c){return c.isStateDependent()})).map((function(c){return c.id})),this.sourceID=e.sourceID};er.prototype.createArrays=function(){this.text=new ks(new ct(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new ks(new ct(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new d,this.lineVertexArray=new v,this.symbolInstances=new f},er.prototype.calculateGlyphDependencies=function(e,t,r,a,l){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||a)&&l){var h=Mu[e.charAt(c)];h&&(t[h.charCodeAt(0)]=!0)}},er.prototype.populate=function(e,t,r){var a=this.layers[0],l=a.layout,c=l.get("text-font"),h=l.get("text-field"),m=l.get("icon-image"),g=(h.value.kind!=="constant"||h.value.value instanceof ni&&!h.value.value.isEmpty()||h.value.value.toString().length>0)&&(c.value.kind!=="constant"||c.value.value.length>0),x=m.value.kind!=="constant"||!!m.value.value||Object.keys(m.parameters).length>0,S=l.get("symbol-sort-key");if(this.features=[],g||x){for(var I=t.iconDependencies,C=t.glyphDependencies,z=t.availableImages,j=new Ct(this.zoom),G=0,te=e;G<te.length;G+=1){var K=te[G],oe=K.feature,le=K.id,ce=K.index,he=K.sourceLayerIndex,xe=a._featureFilter.needGeometry,Pe=kr(oe,xe);if(a._featureFilter.filter(j,Pe,r)){xe||(Pe.geometry=wr(oe));var De=void 0;if(g){var rt=a.getValueAndResolveTokens("text-field",Pe,r,z),Ue=ni.factory(rt);t0(Ue)&&(this.hasRTLText=!0),(!this.hasRTLText||gu()==="unavailable"||this.hasRTLText&&Qi.isParsed())&&(De=Mb(Ue,a,Pe))}var ot=void 0;if(x){var je=a.getValueAndResolveTokens("icon-image",Pe,r,z);ot=je instanceof Di?je:Di.fromString(je)}if(De||ot){var bt=this.sortFeaturesByKey?S.evaluate(Pe,{},r):void 0;if(this.features.push({id:le,text:De,icon:ot,index:ce,sourceLayerIndex:he,geometry:Pe.geometry,properties:oe.properties,type:Qb[oe.type],sortKey:bt}),ot&&(I[ot.name]=!0),De){var pt=c.evaluate(Pe,{},r).join(","),Qe=l.get("text-rotation-alignment")==="map"&&l.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(pn.vertical)>=0;for(var Tt=0,vt=De.sections;Tt<vt.length;Tt+=1){var Rt=vt[Tt];if(Rt.image)I[Rt.image.name]=!0;else{var at=mu(De.toString()),Vt=Rt.fontStack||pt,_r=C[Vt]=C[Vt]||{};this.calculateGlyphDependencies(Rt.text,_r,Qe,this.allowVerticalPlacement,at)}}}}}}l.get("symbol-placement")==="line"&&(this.features=(function(Tr){var Sr={},xr={},Ar=[],Qr=0;function ei(fr){Ar.push(Tr[fr]),Qr++}function Ci(fr,Ur,xi){var qt=xr[fr];return delete xr[fr],xr[Ur]=qt,Ar[qt].geometry[0].pop(),Ar[qt].geometry[0]=Ar[qt].geometry[0].concat(xi[0]),qt}function li(fr,Ur,xi){var qt=Sr[Ur];return delete Sr[Ur],Sr[fr]=qt,Ar[qt].geometry[0].shift(),Ar[qt].geometry[0]=xi[0].concat(Ar[qt].geometry[0]),qt}function ki(fr,Ur,xi){var qt=xi?Ur[0][Ur[0].length-1]:Ur[0][0];return fr+":"+qt.x+":"+qt.y}for(var Mr=0;Mr<Tr.length;Mr++){var ci=Tr[Mr],Mt=ci.geometry,nr=ci.text?ci.text.toString():null;if(nr){var Jt=ki(nr,Mt),Ft=ki(nr,Mt,!0);if(Jt in xr&&Ft in Sr&&xr[Jt]!==Sr[Ft]){var Oi=li(Jt,Ft,Mt),_i=Ci(Jt,Ft,Ar[Oi].geometry);delete Sr[Jt],delete xr[Ft],xr[ki(nr,Ar[_i].geometry,!0)]=_i,Ar[Oi].geometry=null}else Jt in xr?Ci(Jt,Ft,Mt):Ft in Sr?li(Jt,Ft,Mt):(ei(Mr),Sr[Jt]=Qr-1,xr[Ft]=Qr-1)}else ei(Mr)}return Ar.filter((function(fr){return fr.geometry}))})(this.features)),this.sortFeaturesByKey&&this.features.sort((function(Tr,Sr){return Tr.sortKey-Sr.sortKey}))}},er.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},er.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},er.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},er.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},er.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},er.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},er.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(e.segment!==void 0){for(var a=e.dist(t[e.segment+1]),l=e.dist(t[e.segment]),c={},h=e.segment+1;h<t.length;h++)c[h]={x:t[h].x,y:t[h].y,tileUnitDistanceFromAnchor:a},h<t.length-1&&(a+=t[h+1].dist(t[h]));for(var m=e.segment||0;m>=0;m--)c[m]={x:t[m].x,y:t[m].y,tileUnitDistanceFromAnchor:l},m>0&&(l+=t[m-1].dist(t[m]));for(var g=0;g<t.length;g++){var x=c[g];this.lineVertexArray.emplaceBack(x.x,x.y,x.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},er.prototype.addSymbols=function(e,t,r,a,l,c,h,m,g,x,S,I){for(var C=e.indexArray,z=e.layoutVertexArray,j=e.segments.prepareSegment(4*t.length,z,C,this.canOverlap?c.sortKey:void 0),G=this.glyphOffsetArray.length,te=j.vertexLength,K=this.allowVerticalPlacement&&h===pn.vertical?Math.PI/2:0,oe=c.text&&c.text.sections,le=0;le<t.length;le++){var ce=t[le],he=ce.tl,xe=ce.tr,Pe=ce.bl,De=ce.br,rt=ce.tex,Ue=ce.pixelOffsetTL,ot=ce.pixelOffsetBR,je=ce.minFontScaleX,bt=ce.minFontScaleY,pt=ce.glyphOffset,Qe=ce.isSDF,Tt=ce.sectionIndex,vt=j.vertexLength,Rt=pt[1];Hl(z,m.x,m.y,he.x,Rt+he.y,rt.x,rt.y,r,Qe,Ue.x,Ue.y,je,bt),Hl(z,m.x,m.y,xe.x,Rt+xe.y,rt.x+rt.w,rt.y,r,Qe,ot.x,Ue.y,je,bt),Hl(z,m.x,m.y,Pe.x,Rt+Pe.y,rt.x,rt.y+rt.h,r,Qe,Ue.x,ot.y,je,bt),Hl(z,m.x,m.y,De.x,Rt+De.y,rt.x+rt.w,rt.y+rt.h,r,Qe,ot.x,ot.y,je,bt),np(e.dynamicLayoutVertexArray,m,K),C.emplaceBack(vt,vt+1,vt+2),C.emplaceBack(vt+1,vt+2,vt+3),j.vertexLength+=4,j.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(pt[0]),le!==t.length-1&&Tt===t[le+1].sectionIndex||e.programConfigurations.populatePaintArrays(z.length,c,c.index,{},I,oe&&oe[Tt])}e.placedSymbolArray.emplaceBack(m.x,m.y,G,this.glyphOffsetArray.length-G,te,g,x,m.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],h,0,!1,0,S)},er.prototype._addCollisionDebugVertex=function(e,t,r,a,l,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,a,l,Math.round(c.x),Math.round(c.y))},er.prototype.addCollisionDebugVertices=function(e,t,r,a,l,c,h){var m=l.segments.prepareSegment(4,l.layoutVertexArray,l.indexArray),g=m.vertexLength,x=l.layoutVertexArray,S=l.collisionVertexArray,I=h.anchorX,C=h.anchorY;this._addCollisionDebugVertex(x,S,c,I,C,new X(e,t)),this._addCollisionDebugVertex(x,S,c,I,C,new X(r,t)),this._addCollisionDebugVertex(x,S,c,I,C,new X(r,a)),this._addCollisionDebugVertex(x,S,c,I,C,new X(e,a)),m.vertexLength+=4;var z=l.indexArray;z.emplaceBack(g,g+1),z.emplaceBack(g+1,g+2),z.emplaceBack(g+2,g+3),z.emplaceBack(g+3,g),m.primitiveLength+=4},er.prototype.addDebugCollisionBoxes=function(e,t,r,a){for(var l=e;l<t;l++){var c=this.collisionBoxArray.get(l);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,a?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},er.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Du(ia,bm.members,Da),this.iconCollisionBox=new Du(ia,bm.members,Da);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},er.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,l,c,h,m,g){for(var x={},S=t;S<r;S++){var I=e.get(S);x.textBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},x.textFeatureIndex=I.featureIndex;break}for(var C=a;C<l;C++){var z=e.get(C);x.verticalTextBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},x.verticalTextFeatureIndex=z.featureIndex;break}for(var j=c;j<h;j++){var G=e.get(j);x.iconBox={x1:G.x1,y1:G.y1,x2:G.x2,y2:G.y2,anchorPointX:G.anchorPointX,anchorPointY:G.anchorPointY},x.iconFeatureIndex=G.featureIndex;break}for(var te=m;te<g;te++){var K=e.get(te);x.verticalIconBox={x1:K.x1,y1:K.y1,x2:K.x2,y2:K.y2,anchorPointX:K.anchorPointX,anchorPointY:K.anchorPointY},x.verticalIconFeatureIndex=K.featureIndex;break}return x},er.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},er.prototype.hasTextData=function(){return this.text.segments.get().length>0},er.prototype.hasIconData=function(){return this.icon.segments.get().length>0},er.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},er.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},er.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},er.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),a=r.vertexStartIndex+4*r.numGlyphs,l=r.vertexStartIndex;l<a;l+=4)e.indexArray.emplaceBack(l,l+1,l+2),e.indexArray.emplaceBack(l+1,l+2,l+3)},er.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),a=[],l=[],c=[],h=0;h<this.symbolInstances.length;++h){c.push(h);var m=this.symbolInstances.get(h);a.push(0|Math.round(t*m.anchorX+r*m.anchorY)),l.push(m.featureIndex)}return c.sort((function(g,x){return a[g]-a[x]||l[x]-l[g]})),c},er.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},er.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,a=this.symbolInstanceIndexes;r<a.length;r+=1){var l=this.symbolInstances.get(a[r]);this.featureSortOrder.push(l.featureIndex),[l.rightJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.leftJustifiedTextSymbolIndex].forEach((function(c,h,m){c>=0&&m.indexOf(c)===h&&t.addIndicesForPlacedSymbol(t.text,c)})),l.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,l.verticalPlacedTextSymbolIndex),l.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.placedIconSymbolIndex),l.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Xe("SymbolBucket",er,{omit:["layers","collisionBoxArray","features","compareText"]}),er.MAX_GLYPHS=65535,er.addDynamicAttributes=np;var r0=new vi({"symbol-placement":new it(L.layout_symbol["symbol-placement"]),"symbol-spacing":new it(L.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new it(L.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ye(L.layout_symbol["symbol-sort-key"]),"symbol-z-order":new it(L.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new it(L.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new it(L.layout_symbol["icon-ignore-placement"]),"icon-optional":new it(L.layout_symbol["icon-optional"]),"icon-rotation-alignment":new it(L.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ye(L.layout_symbol["icon-size"]),"icon-text-fit":new it(L.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new it(L.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ye(L.layout_symbol["icon-image"]),"icon-rotate":new Ye(L.layout_symbol["icon-rotate"]),"icon-padding":new it(L.layout_symbol["icon-padding"]),"icon-keep-upright":new it(L.layout_symbol["icon-keep-upright"]),"icon-offset":new Ye(L.layout_symbol["icon-offset"]),"icon-anchor":new Ye(L.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new it(L.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new it(L.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new it(L.layout_symbol["text-rotation-alignment"]),"text-field":new Ye(L.layout_symbol["text-field"]),"text-font":new Ye(L.layout_symbol["text-font"]),"text-size":new Ye(L.layout_symbol["text-size"]),"text-max-width":new Ye(L.layout_symbol["text-max-width"]),"text-line-height":new it(L.layout_symbol["text-line-height"]),"text-letter-spacing":new Ye(L.layout_symbol["text-letter-spacing"]),"text-justify":new Ye(L.layout_symbol["text-justify"]),"text-radial-offset":new Ye(L.layout_symbol["text-radial-offset"]),"text-variable-anchor":new it(L.layout_symbol["text-variable-anchor"]),"text-anchor":new Ye(L.layout_symbol["text-anchor"]),"text-max-angle":new it(L.layout_symbol["text-max-angle"]),"text-writing-mode":new it(L.layout_symbol["text-writing-mode"]),"text-rotate":new Ye(L.layout_symbol["text-rotate"]),"text-padding":new it(L.layout_symbol["text-padding"]),"text-keep-upright":new it(L.layout_symbol["text-keep-upright"]),"text-transform":new Ye(L.layout_symbol["text-transform"]),"text-offset":new Ye(L.layout_symbol["text-offset"]),"text-allow-overlap":new it(L.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new it(L.layout_symbol["text-ignore-placement"]),"text-optional":new it(L.layout_symbol["text-optional"])}),op={paint:new vi({"icon-opacity":new Ye(L.paint_symbol["icon-opacity"]),"icon-color":new Ye(L.paint_symbol["icon-color"]),"icon-halo-color":new Ye(L.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ye(L.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ye(L.paint_symbol["icon-halo-blur"]),"icon-translate":new it(L.paint_symbol["icon-translate"]),"icon-translate-anchor":new it(L.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ye(L.paint_symbol["text-opacity"]),"text-color":new Ye(L.paint_symbol["text-color"],{runtimeType:Be,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Ye(L.paint_symbol["text-halo-color"]),"text-halo-width":new Ye(L.paint_symbol["text-halo-width"]),"text-halo-blur":new Ye(L.paint_symbol["text-halo-blur"]),"text-translate":new it(L.paint_symbol["text-translate"]),"text-translate-anchor":new it(L.paint_symbol["text-translate-anchor"])}),layout:r0},Ms=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Ze,this.defaultValue=e};Ms.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},Ms.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},Ms.prototype.outputDefined=function(){return!1},Ms.prototype.serialize=function(){return null},Xe("FormatSectionOverride",Ms,{omit:["defaultValue"]});var i0=(function(e){function t(r){e.call(this,r,op)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){if(e.prototype.recalculate.call(this,r,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var l=this.layout.get("text-writing-mode");if(l){for(var c=[],h=0,m=l;h<m.length;h+=1){var g=m[h];c.indexOf(g)<0&&c.push(g)}this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(r,a,l,c){var h=this.layout.get(r).evaluate(a,{},l,c),m=this._unevaluatedLayout._values[r];return m.isDataDriven()||wa(m.value)||!h?h:(function(g,x){return x.replace(/{([^{}]+)}/g,(function(S,I){return I in g?String(g[I]):""}))})(a.properties,h)},t.prototype.createBucket=function(r){return new er(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=op.paint.overridableProperties;r<a.length;r+=1){var l=a[r];if(t.hasPaintOverride(this.layout,l)){var c,h=this.paint.get(l),m=new Ms(h),g=new Ko(m,h.property.specification);c=h.value.kind==="constant"||h.value.kind==="source"?new Sa("source",g):new Jo("composite",g,h.value.zoomStops,h.value._interpolationType),this.paint._values[l]=new Ti(h.property,c,h.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,l){return!(!this.layout||a.isDataDriven()||l.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,a){var l=r.get("text-field"),c=op.paint.properties[a],h=!1,m=function(S){for(var I=0,C=S;I<C.length;I+=1)if(c.overrides&&c.overrides.hasOverride(C[I]))return void(h=!0)};if(l.value.kind==="constant"&&l.value.value instanceof ni)m(l.value.value.sections);else if(l.value.kind==="source"){var g=function(S){h||(S instanceof Si&&Cr(S.value)===rr?m(S.value.sections):S instanceof yn?m(S.sections):S.eachChild(g))},x=l.value;x._styleExpression&&g(x._styleExpression.expression)}return h},t})(An),n0={paint:new vi({"background-color":new it(L.paint_background["background-color"]),"background-pattern":new Ai(L.paint_background["background-pattern"]),"background-opacity":new it(L.paint_background["background-opacity"])})},o0=(function(e){function t(r){e.call(this,r,n0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),a0={paint:new vi({"raster-opacity":new it(L.paint_raster["raster-opacity"]),"raster-hue-rotate":new it(L.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new it(L.paint_raster["raster-brightness-min"]),"raster-brightness-max":new it(L.paint_raster["raster-brightness-max"]),"raster-saturation":new it(L.paint_raster["raster-saturation"]),"raster-contrast":new it(L.paint_raster["raster-contrast"]),"raster-resampling":new it(L.paint_raster["raster-resampling"]),"raster-fade-duration":new it(L.paint_raster["raster-fade-duration"])})},s0=(function(e){function t(r){e.call(this,r,a0)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t})(An),u0=(function(e){function t(r){e.call(this,r,{}),this.implementation=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},t.prototype.onRemove=function(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},t})(An),l0={circle:jc,heatmap:$x,hillshade:Hx,fill:pb,"fill-extrusion":xb,line:Ab,symbol:i0,background:o0,raster:s0},Gm=Y.HTMLImageElement,Zm=Y.HTMLCanvasElement,$m=Y.HTMLVideoElement,Wm=Y.ImageData,Xl=Y.ImageBitmap,qa=function(e,t,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,a)};qa.prototype.update=function(e,t,r){var a=e.width,l=e.height,c=!(this.size&&this.size[0]===a&&this.size[1]===l||r),h=this.context,m=h.gl;if(this.useMipmap=!!(t&&t.useMipmap),m.bindTexture(m.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===m.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,l],e instanceof Gm||e instanceof Zm||e instanceof $m||e instanceof Wm||Xl&&e instanceof Xl?m.texImage2D(m.TEXTURE_2D,0,this.format,this.format,m.UNSIGNED_BYTE,e):m.texImage2D(m.TEXTURE_2D,0,this.format,a,l,0,this.format,m.UNSIGNED_BYTE,e.data);else{var g=r||{x:0,y:0},x=g.x,S=g.y;e instanceof Gm||e instanceof Zm||e instanceof $m||e instanceof Wm||Xl&&e instanceof Xl?m.texSubImage2D(m.TEXTURE_2D,0,x,S,m.RGBA,m.UNSIGNED_BYTE,e):m.texSubImage2D(m.TEXTURE_2D,0,x,S,a,l,m.RGBA,m.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&m.generateMipmap(m.TEXTURE_2D)},qa.prototype.bind=function(e,t,r){var a=this.context.gl;a.bindTexture(a.TEXTURE_2D,this.texture),r!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},qa.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},qa.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var ap=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};ap.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){e._triggered=!1,e._callback()}),0))},ap.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Bs=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},we(["receive","process"],this),this.invoker=new ap(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Er()?e:Y};function Hm(e,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[e*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}Bs.prototype.send=function(e,t,r,a,l){var c=this;l===void 0&&(l=!1);var h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);var m=Rr(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:a,mustQueue:l,sourceMapId:this.mapId,data:gn(t,m)},m),{cancel:function(){r&&delete c.callbacks[h],c.target.postMessage({id:h,type:"<cancel>",targetMapId:a,sourceMapId:c.mapId})}}},Bs.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];var a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else Er()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Bs.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},Bs.prototype.processTask=function(e,t){var r=this;if(t.type==="<response>"){var a=this.callbacks[e];delete this.callbacks[e],a&&(t.error?a(ji(t.error)):a(null,ji(t.data)))}else{var l=!1,c=Rr(this.globalScope)?void 0:[],h=t.hasCallback?function(S,I){l=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:S?gn(S):null,data:gn(I,c)},c)}:function(S){l=!0},m=null,g=ji(t.data);if(this.parent[t.type])m=this.parent[t.type](t.sourceMapId,g,h);else if(this.parent.getWorkerSource){var x=t.type.split(".");m=this.parent.getWorkerSource(t.sourceMapId,x[0],g.source)[x[1]](g,h)}else h(new Error("Could not find function "+t.type));!l&&m&&m.cancel&&(this.cancelCallbacks[e]=m.cancel)}},Bs.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var $r=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};$r.prototype.setNorthEast=function(e){return this._ne=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},$r.prototype.setSouthWest=function(e){return this._sw=e instanceof gr?new gr(e.lng,e.lat):gr.convert(e),this},$r.prototype.extend=function(e){var t,r,a=this._sw,l=this._ne;if(e instanceof gr)t=e,r=e;else{if(!(e instanceof $r))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend($r.convert(e)):this.extend(gr.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return a||l?(a.lng=Math.min(t.lng,a.lng),a.lat=Math.min(t.lat,a.lat),l.lng=Math.max(r.lng,l.lng),l.lat=Math.max(r.lat,l.lat)):(this._sw=new gr(t.lng,t.lat),this._ne=new gr(r.lng,r.lat)),this},$r.prototype.getCenter=function(){return new gr((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},$r.prototype.getSouthWest=function(){return this._sw},$r.prototype.getNorthEast=function(){return this._ne},$r.prototype.getNorthWest=function(){return new gr(this.getWest(),this.getNorth())},$r.prototype.getSouthEast=function(){return new gr(this.getEast(),this.getSouth())},$r.prototype.getWest=function(){return this._sw.lng},$r.prototype.getSouth=function(){return this._sw.lat},$r.prototype.getEast=function(){return this._ne.lng},$r.prototype.getNorth=function(){return this._ne.lat},$r.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},$r.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},$r.prototype.isEmpty=function(){return!(this._sw&&this._ne)},$r.prototype.contains=function(e){var t=gr.convert(e),r=t.lng,a=t.lat,l=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&l},$r.convert=function(e){return!e||e instanceof $r?e:new $r(e)};var gr=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};gr.prototype.wrap=function(){return new gr(Ve(this.lng,-180,180),this.lat)},gr.prototype.toArray=function(){return[this.lng,this.lat]},gr.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},gr.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,a=e.lat*t,l=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(l,1))},gr.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new $r(new gr(this.lng-r,this.lat-t),new gr(this.lng+r,this.lat+t))},gr.convert=function(e){if(e instanceof gr)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new gr(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new gr(Number("lng"in e?e.lng:e.lon),Number(e.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 Xm=2*Math.PI*63710088e-1;function Km(e){return Xm*Math.cos(e*Math.PI/180)}function Jm(e){return(180+e)/360}function Ym(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Qm(e,t){return e/Km(t)}function sp(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var Ua=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};Ua.fromLngLat=function(e,t){t===void 0&&(t=0);var r=gr.convert(e);return new Ua(Jm(r.lng),Ym(r.lat),Qm(t,r.lat))},Ua.prototype.toLngLat=function(){return new gr(360*this.x-180,sp(this.y))},Ua.prototype.toAltitude=function(){return this.z*Km(sp(this.y))},Ua.prototype.meterInMercatorCoordinateUnits=function(){return 1/Xm*(e=sp(this.y),1/Math.cos(e*Math.PI/180));var e};var Na=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Ru(0,e,e,t,r)};Na.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Na.prototype.url=function(e,t){var r,a,l,c,h,m=(a=this.y,l=this.z,c=Hm(256*(r=this.x),256*(a=Math.pow(2,l)-a-1),l),h=Hm(256*(r+1),256*(a+1),l),c[0]+","+c[1]+","+h[0]+","+h[1]),g=(function(x,S,I){for(var C,z="",j=x;j>0;j--)z+=(S&(C=1<<j-1)?1:0)+(I&C?2:0);return z})(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",g).replace("{bbox-epsg-3857}",m)},Na.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new X(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},Na.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ey=function(e,t){this.wrap=e,this.canonical=t,this.key=Ru(e,t.z,t.z,t.x,t.y)},Wr=function(e,t,r,a,l){this.overscaledZ=e,this.wrap=t,this.canonical=new Na(r,+a,+l),this.key=Ru(t,e,r,a,l)};function Ru(e,t,r,a,l){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*l+a).toString(36)+r.toString(36)+t.toString(36)}Wr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},Wr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new Wr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Wr.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Ru(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Ru(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},Wr.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},Wr.prototype.children=function(e){if(this.overscaledZ>=e)return[new Wr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new Wr(t,this.wrap,t,r,a),new Wr(t,this.wrap,t,r+1,a),new Wr(t,this.wrap,t,r,a+1),new Wr(t,this.wrap,t,r+1,a+1)]},Wr.prototype.isLessThan=function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))},Wr.prototype.wrapped=function(){return new Wr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.unwrapTo=function(e){return new Wr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},Wr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Wr.prototype.toUnwrapped=function(){return new ey(this.wrap,this.canonical)},Wr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Wr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Ua(e.x-this.wrap,e.y))},Xe("CanonicalTileID",Na),Xe("OverscaledTileID",Wr,{omit:["posMatrix"]});var Fo=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return St('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var a=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var l=0;l<a;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(a,l)]=this.data[this._idx(a-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,a)]=this.data[this._idx(l,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)]};Fo.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),a=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[a],r[a+1],r[a+2])},Fo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Fo.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Fo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Fo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Fo.prototype.getPixels=function(){return new Hi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Fo.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var a=t*this.dim,l=t*this.dim+this.dim,c=r*this.dim,h=r*this.dim+this.dim;switch(t){case-1:a=l-1;break;case 1:l=a+1}switch(r){case-1:c=h-1;break;case 1:h=c+1}for(var m=-t*this.dim,g=-r*this.dim,x=c;x<h;x++)for(var S=a;S<l;S++)this.data[this._idx(S,x)]=e.data[this._idx(S+m,x+g)]},Xe("DEMData",Fo);var Kl=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Kl.prototype.encode=function(e){return this._stringToNumber[e]},Kl.prototype.decode=function(e){return this._numberToString[e]};var Jl=function(e,t,r,a,l){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=a,this.properties=e.properties,this.id=l},up={geometry:{configurable:!0}};up.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},up.geometry.set=function(e){this._geometry=e},Jl.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&(e[t]=this[t]);return e},Object.defineProperties(Jl.prototype,up);var zs=function(){this.state={},this.stateChanges={},this.deletedStates={}};zs.prototype.updateState=function(e,t,r){var a=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},Re(this.stateChanges[e][a],r),this.deletedStates[e]===null)for(var l in this.deletedStates[e]={},this.state[e])l!==a&&(this.deletedStates[e][l]=null);else if(this.deletedStates[e]&&this.deletedStates[e][a]===null)for(var c in this.deletedStates[e][a]={},this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null);else for(var h in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][h]===null&&delete this.deletedStates[e][a][h]},zs.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}},zs.prototype.getState=function(e,t){var r=String(t),a=Re({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var l=this.deletedStates[e][t];if(l===null)return{};for(var c in l)delete a[c]}return a},zs.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},zs.prototype.coalesceChanges=function(e,t){var r={};for(var a in this.stateChanges){this.state[a]=this.state[a]||{};var l={};for(var c in this.stateChanges[a])this.state[a][c]||(this.state[a][c]={}),Re(this.state[a][c],this.stateChanges[a][c]),l[c]=this.state[a][c];r[a]=l}for(var h in this.deletedStates){this.state[h]=this.state[h]||{};var m={};if(this.deletedStates[h]===null)for(var g in this.state[h])m[g]={},this.state[h][g]={};else for(var x in this.deletedStates[h]){if(this.deletedStates[h][x]===null)this.state[h][x]={};else for(var S=0,I=Object.keys(this.deletedStates[h][x]);S<I.length;S+=1)delete this.state[h][x][I[S]];m[x]=this.state[h][x]}r[h]=r[h]||{},Re(r[h],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var C in e)e[C].setFeatureState(r,t)};var Oo=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Rn(8192,16,0),this.grid3D=new Rn(8192,16,0),this.featureIndexArray=new A,this.promoteId=t};function ty(e,t,r,a,l){return Fe(e,(function(c,h){var m=t instanceof Ba?t.get(h):null;return m&&m.evaluate?m.evaluate(r,a,l):m}))}function ry(e){for(var t=1/0,r=1/0,a=-1/0,l=-1/0,c=0,h=e;c<h.length;c+=1){var m=h[c];t=Math.min(t,m.x),r=Math.min(r,m.y),a=Math.max(a,m.x),l=Math.max(l,m.y)}return{minX:t,minY:r,maxX:a,maxY:l}}function c0(e,t){return t-e}Oo.prototype.insert=function(e,t,r,a,l,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,l);for(var m=c?this.grid3D:this.grid,g=0;g<t.length;g++){for(var x=t[g],S=[1/0,1/0,-1/0,-1/0],I=0;I<x.length;I++){var C=x[I];S[0]=Math.min(S[0],C.x),S[1]=Math.min(S[1],C.y),S[2]=Math.max(S[2],C.x),S[3]=Math.max(S[3],C.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&m.insert(h,S[0],S[1],S[2],S[3])}},Oo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ss.VectorTile(new Vl(this.rawTileData)).layers,this.sourceLayerCoder=new Kl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Oo.prototype.query=function(e,t,r,a){var l=this;this.loadVTLayers();for(var c=e.params||{},h=8192/e.tileSize/e.scale,m=as(c.filter),g=e.queryGeometry,x=e.queryPadding*h,S=ry(g),I=this.grid.query(S.minX-x,S.minY-x,S.maxX+x,S.maxY+x),C=ry(e.cameraQueryGeometry),z=this.grid3D.query(C.minX-x,C.minY-x,C.maxX+x,C.maxY+x,(function(ce,he,xe,Pe){return(function(De,rt,Ue,ot,je){for(var bt=0,pt=De;bt<pt.length;bt+=1){var Qe=pt[bt];if(rt<=Qe.x&&Ue<=Qe.y&&ot>=Qe.x&&je>=Qe.y)return!0}var Tt=[new X(rt,Ue),new X(rt,je),new X(ot,je),new X(ot,Ue)];if(De.length>2){for(var vt=0,Rt=Tt;vt<Rt.length;vt+=1)if(Pn(De,Rt[vt]))return!0}for(var at=0;at<De.length-1;at++)if(Fa(De[at],De[at+1],Tt))return!0;return!1})(e.cameraQueryGeometry,ce-x,he-x,xe+x,Pe+x)})),j=0,G=z;j<G.length;j+=1)I.push(G[j]);I.sort(c0);for(var te,K={},oe=function(ce){var he=I[ce];if(he!==te){te=he;var xe=l.featureIndexArray.get(he),Pe=null;l.loadMatchingFeature(K,xe.bucketIndex,xe.sourceLayerIndex,xe.featureIndex,m,c.layers,c.availableImages,t,r,a,(function(De,rt,Ue){return Pe||(Pe=wr(De)),rt.queryIntersectsFeature(g,De,Ue,Pe,l.z,e.transform,h,e.pixelPosMatrix)}))}},le=0;le<I.length;le++)oe(le);return K},Oo.prototype.loadMatchingFeature=function(e,t,r,a,l,c,h,m,g,x,S){var I=this.bucketLayerIDs[t];if(!c||(function(De,rt){for(var Ue=0;Ue<De.length;Ue++)if(rt.indexOf(De[Ue])>=0)return!0;return!1})(c,I)){var C=this.sourceLayerCoder.decode(r),z=this.vtLayers[C].feature(a);if(l.needGeometry){var j=kr(z,!0);if(!l.filter(new Ct(this.tileID.overscaledZ),j,this.tileID.canonical))return}else if(!l.filter(new Ct(this.tileID.overscaledZ),z))return;for(var G=this.getId(z,C),te=0;te<I.length;te++){var K=I[te];if(!(c&&c.indexOf(K)<0)){var oe=m[K];if(oe){var le={};G!==void 0&&x&&(le=x.getState(oe.sourceLayer||"_geojsonTileLayer",G));var ce=Re({},g[K]);ce.paint=ty(ce.paint,oe.paint,z,le,h),ce.layout=ty(ce.layout,oe.layout,z,le,h);var he=!S||S(z,oe,le);if(he){var xe=new Jl(z,this.z,this.x,this.y,G);xe.layer=ce;var Pe=e[K];Pe===void 0&&(Pe=e[K]=[]),Pe.push({featureIndex:a,feature:xe,intersectionZ:he})}}}}}},Oo.prototype.lookupSymbolFeatures=function(e,t,r,a,l,c,h,m){var g={};this.loadVTLayers();for(var x=as(l),S=0,I=e;S<I.length;S+=1)this.loadMatchingFeature(g,r,a,I[S],x,c,h,m,t);return g},Oo.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var a=0,l=r[t];a<l.length;a+=1)if(e===l[a])return!0;return!1},Oo.prototype.getId=function(e,t){var r=e.id;return this.promoteId&&typeof(r=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[t]])=="boolean"&&(r=Number(r)),r},Xe("FeatureIndex",Oo,{omit:["rawTileData","sourceLayerCoder"]});var ui=function(e,t){this.tileID=e,this.uid=Ke(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ui.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<Xi.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},ui.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},ui.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var a in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=(function(x,S){var I={};if(!S)return I;for(var C=function(){var G=j[z],te=G.layerIds.map((function(le){return S.getLayer(le)})).filter(Boolean);if(te.length!==0){G.layers=te,G.stateDependentLayerIds&&(G.stateDependentLayers=G.stateDependentLayerIds.map((function(le){return te.filter((function(ce){return ce.id===le}))[0]})));for(var K=0,oe=te;K<oe.length;K+=1)I[oe[K].id]=G}},z=0,j=x;z<j.length;z+=1)C();return I})(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var l=this.buckets[a];if(l instanceof er){if(this.hasSymbolBuckets=!0,!r)break;l.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var c in this.buckets){var h=this.buckets[c];if(h instanceof er&&h.hasRTLText){this.hasRTLText=!0,Qi.isLoading()||Qi.isLoaded()||gu()!=="deferred"||_n();break}}for(var m in this.queryPadding=0,this.buckets){var g=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(m).queryRadius(g))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o},ui.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ui.prototype.getBucket=function(e){return this.buckets[e.id]},ui.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new qa(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new qa(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)},ui.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},ui.prototype.queryRenderedFeatures=function(e,t,r,a,l,c,h,m,g,x){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:l,scale:c,tileSize:this.tileSize,pixelPosMatrix:x,transform:m,params:h,queryPadding:this.queryPadding*g},e,t,r):{}},ui.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var a=r.loadVTLayers(),l=t?t.sourceLayer:"",c=a._geojsonTileLayer||a[l];if(c)for(var h=as(t&&t.filter),m=this.tileID.canonical,g=m.z,x=m.x,S=m.y,I={z:g,x,y:S},C=0;C<c.length;C++){var z=c.feature(C);if(h.needGeometry){var j=kr(z,!0);if(!h.filter(new Ct(this.tileID.overscaledZ),j,this.tileID.canonical))continue}else if(!h.filter(new Ct(this.tileID.overscaledZ),z))continue;var G=r.getId(z,l),te=new Jl(z,g,x,S,G);te.tile=I,e.push(te)}}},ui.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},ui.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ui.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=bi(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var a=Date.now(),l=!1;if(this.expirationTime>a)l=!1;else if(t)if(this.expirationTime<t)l=!0;else{var c=this.expirationTime-t;c?this.expirationTime=a+Math.max(c,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ui.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)},ui.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(e).length!==0){var r=this.latestFeatureIndex.loadVTLayers();for(var a in this.buckets)if(t.style.hasLayer(a)){var l=this.buckets[a],c=l.layers[0].sourceLayer||"_geojsonTileLayer",h=r[c],m=e[c];if(h&&m&&Object.keys(m).length!==0){l.update(m,h,this.imageAtlas&&this.imageAtlas.patternPositions||{});var g=t&&t.style&&t.style.getLayer(a);g&&(this.queryPadding=Math.max(this.queryPadding,g.queryRadius(l)))}}}},ui.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},ui.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Xi.now()},ui.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ui.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=Xi.now()+e},ui.prototype.setDependencies=function(e,t){for(var r={},a=0,l=t;a<l.length;a+=1)r[l[a]]=!0;this.dependencies[e]=r},ui.prototype.hasDependency=function(e,t){for(var r=0,a=e;r<a.length;r+=1){var l=this.dependencies[a[r]];if(l){for(var c=0,h=t;c<h.length;c+=1)if(l[h[c]])return!0}}return!1};var ua=Y.performance,iy=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},ua.mark(this._marks.start)};iy.prototype.finish=function(){ua.mark(this._marks.end);var e=ua.getEntriesByName(this._marks.measure);return e.length===0&&(ua.measure(this._marks.measure,this._marks.start,this._marks.end),e=ua.getEntriesByName(this._marks.measure),ua.clearMarks(this._marks.start),ua.clearMarks(this._marks.end),ua.clearMeasures(this._marks.measure)),e},u.Actor=Bs,u.AlphaImage=Va,u.CanonicalTileID=Na,u.CollisionBoxArray=o,u.Color=Zt,u.DEMData=Fo,u.DataConstantProperty=it,u.DictionaryCoder=Kl,u.EXTENT=8192,u.ErrorEvent=re,u.EvaluationParameters=Ct,u.Event=Z,u.Evented=ie,u.FeatureIndex=Oo,u.FillBucket=Vn,u.FillExtrusionBucket=qn,u.ImageAtlas=zu,u.ImagePosition=Ul,u.LineBucket=Fi,u.LngLat=gr,u.LngLatBounds=$r,u.MercatorCoordinate=Ua,u.ONE_EM=24,u.OverscaledTileID=Wr,u.Point=X,u.Point$1=X,u.Properties=vi,u.Protobuf=Vl,u.RGBAImage=Hi,u.RequestManager=pr,u.RequestPerformance=iy,u.ResourceType=jt,u.SegmentVector=F,u.SourceFeatureState=zs,u.StructArrayLayout1ui2=Iu,u.StructArrayLayout2f1f2i16=zo,u.StructArrayLayout2i4=Bo,u.StructArrayLayout3ui6=to,u.StructArrayLayout4i8=xu,u.SymbolBucket=er,u.Texture=qa,u.Tile=ui,u.Transitionable=yi,u.Uniform1f=Me,u.Uniform1i=Ie,u.Uniform2f=Ce,u.Uniform3f=$e,u.Uniform4f=nt,u.UniformColor=ut,u.UniformMatrix4f=Lt,u.UnwrappedTileID=ey,u.ValidationError=H,u.WritingMode=pn,u.ZoomHistory=du,u.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},u.addDynamicAttributes=np,u.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var a=e.length,l=new Array(e.length),c=null;e.forEach((function(h,m){t(h,(function(g,x){g&&(c=g),l[m]=x,--a==0&&r(c,l)}))}))},u.bezier=be,u.bindAll=we,u.browser=Xi,u.cacheEntryPossiblyAdded=function(e){++fe>$o&&(e.getActor().send("enforceCacheSizeLimit",Bn),fe=0)},u.clamp=Oe,u.clearTileCache=function(e){var t=Y.caches.delete("mapbox-tiles");e&&t.catch(e).then((function(){return e()}))},u.clipLine=Om,u.clone=function(e){var t=new $t(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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},u.clone$1=kt,u.clone$2=function(e){var t=new $t(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},u.collisionCircleLayout=kb,u.config=Nt,u.create=function(){var e=new $t(16);return $t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},u.create$1=function(){var e=new $t(9);return $t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},u.create$2=function(){var e=new $t(4);return $t!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},u.createCommonjsModule=U,u.createExpression=ns,u.createLayout=ai,u.createStyleLayer=function(e){return e.type==="custom"?new u0(e):new l0[e.type](e)},u.cross=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=r[0],m=r[1],g=r[2];return e[0]=l*g-c*m,e[1]=c*h-a*g,e[2]=a*m-l*h,e},u.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(var l in t)if(!e(t[l],r[l]))return!1;return!0}return t===r},u.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},u.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},u.ease=ke,u.emitValidationErrors=Ca,u.endsWith=Ge,u.enforceCacheSizeLimit=function(e){jn(),ri&&ri.then((function(t){t.keys().then((function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])}))}))},u.evaluateSizeForFeature=Bm,u.evaluateSizeForZoom=zm,u.evaluateVariableOffset=Um,u.evented=vu,u.extend=Re,u.featureFilter=as,u.filterObject=tt,u.fromRotation=function(e,t){var r=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},u.getAnchorAlignment=ep,u.getAnchorJustification=ip,u.getArrayBuffer=ii,u.getImage=P,u.getJSON=function(e,t){return qi(Re(e,{type:"json"}),t)},u.getRTLTextPluginStatus=gu,u.getReferrer=Kt,u.getVideo=function(e,t){var r,a,l=Y.document.createElement("video");l.muted=!0,l.onloadstart=function(){t(null,l)};for(var c=0;c<e.length;c++){var h=Y.document.createElement("source");r=e[c],a=void 0,(a=Y.document.createElement("a")).href=r,(a.protocol!==Y.document.location.protocol||a.host!==Y.document.location.host)&&(l.crossOrigin="Anonymous"),h.src=e[c],l.appendChild(h)}return{cancel:function(){}}},u.identity=en,u.invert=function(e,t){var r=t[0],a=t[1],l=t[2],c=t[3],h=t[4],m=t[5],g=t[6],x=t[7],S=t[8],I=t[9],C=t[10],z=t[11],j=t[12],G=t[13],te=t[14],K=t[15],oe=r*m-a*h,le=r*g-l*h,ce=r*x-c*h,he=a*g-l*m,xe=a*x-c*m,Pe=l*x-c*g,De=S*G-I*j,rt=S*te-C*j,Ue=S*K-z*j,ot=I*te-C*G,je=I*K-z*G,bt=C*K-z*te,pt=oe*bt-le*je+ce*ot+he*Ue-xe*rt+Pe*De;return pt?(e[0]=(m*bt-g*je+x*ot)*(pt=1/pt),e[1]=(l*je-a*bt-c*ot)*pt,e[2]=(G*Pe-te*xe+K*he)*pt,e[3]=(C*xe-I*Pe-z*he)*pt,e[4]=(g*Ue-h*bt-x*rt)*pt,e[5]=(r*bt-l*Ue+c*rt)*pt,e[6]=(te*ce-j*Pe-K*le)*pt,e[7]=(S*Pe-C*ce+z*le)*pt,e[8]=(h*je-m*Ue+x*De)*pt,e[9]=(a*Ue-r*je-c*De)*pt,e[10]=(j*xe-G*ce+K*oe)*pt,e[11]=(I*ce-S*xe-z*oe)*pt,e[12]=(m*rt-h*ot-g*De)*pt,e[13]=(r*ot-a*rt+l*De)*pt,e[14]=(G*le-j*he-te*oe)*pt,e[15]=(S*he-I*le+C*oe)*pt,e):null},u.isChar=Le,u.isMapboxURL=jr,u.keysDifference=function(e,t){var r=[];for(var a in e)a in t||r.push(a);return r},u.makeRequest=qi,u.mapObject=Fe,u.mercatorXfromLng=Jm,u.mercatorYfromLat=Ym,u.mercatorZfromAltitude=Qm,u.mul=Nc,u.multiply=Li,u.mvt=Ss,u.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},u.normalize=function(e,t){var r=t[0],a=t[1],l=t[2],c=r*r+a*a+l*l;return c>0&&(c=1/Math.sqrt(c)),e[0]=t[0]*c,e[1]=t[1]*c,e[2]=t[2]*c,e},u.number=Vr,u.offscreenCanvasSupported=_e,u.ortho=function(e,t,r,a,l,c,h){var m=1/(t-r),g=1/(a-l),x=1/(c-h);return e[0]=-2*m,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*g,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*x,e[11]=0,e[12]=(t+r)*m,e[13]=(l+a)*g,e[14]=(h+c)*x,e[15]=1,e},u.parseGlyphPBF=function(e){return new Vl(e).readFields(Ub,[])},u.pbf=Vl,u.performSymbolLayout=function(e,t,r,a,l,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var m=e.layers[0].layout,g=e.layers[0]._unevaluatedLayout._values,x={};if(e.textSizeData.kind==="composite"){var S=e.textSizeData,I=S.maxZoom;x.compositeTextSizes=[g["text-size"].possiblyEvaluate(new Ct(S.minZoom),h),g["text-size"].possiblyEvaluate(new Ct(I),h)]}if(e.iconSizeData.kind==="composite"){var C=e.iconSizeData,z=C.maxZoom;x.compositeIconSizes=[g["icon-size"].possiblyEvaluate(new Ct(C.minZoom),h),g["icon-size"].possiblyEvaluate(new Ct(z),h)]}x.layoutTextSize=g["text-size"].possiblyEvaluate(new Ct(e.zoom+1),h),x.layoutIconSize=g["icon-size"].possiblyEvaluate(new Ct(e.zoom+1),h),x.textMaxSize=g["text-size"].possiblyEvaluate(new Ct(18));for(var j=24*m.get("text-line-height"),G=m.get("text-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",te=m.get("text-keep-upright"),K=m.get("text-size"),oe=function(){var he=ce[le],xe=m.get("text-font").evaluate(he,{},h).join(","),Pe=K.evaluate(he,{},h),De=x.layoutTextSize.evaluate(he,{},h),rt=x.layoutIconSize.evaluate(he,{},h),Ue={horizontal:{},vertical:void 0},ot=he.text,je=[0,0];if(ot){var bt=ot.toString(),pt=24*m.get("text-letter-spacing").evaluate(he,{},h),Qe=(function(Mt){for(var nr=0,Jt=Mt;nr<Jt.length;nr+=1)if(Ft=Jt[nr].charCodeAt(0),Le.Arabic(Ft)||Le["Arabic Supplement"](Ft)||Le["Arabic Extended-A"](Ft)||Le["Arabic Presentation Forms-A"](Ft)||Le["Arabic Presentation Forms-B"](Ft))return!1;var Ft;return!0})(bt)?pt:0,Tt=m.get("text-anchor").evaluate(he,{},h),vt=m.get("text-variable-anchor");if(!vt){var Rt=m.get("text-radial-offset").evaluate(he,{},h);je=Rt?Um(Tt,[24*Rt,rp]):m.get("text-offset").evaluate(he,{},h).map((function(Mt){return 24*Mt}))}var at=G?"center":m.get("text-justify").evaluate(he,{},h),Vt=m.get("symbol-placement"),_r=Vt==="point"?24*m.get("text-max-width").evaluate(he,{},h):0,Tr=function(){e.allowVerticalPlacement&&mu(bt)&&(Ue.vertical=Nl(ot,t,r,l,xe,_r,j,Tt,"left",Qe,je,pn.vertical,!0,Vt,De,Pe))};if(!G&&vt){for(var Sr=at==="auto"?vt.map((function(Mt){return ip(Mt)})):[at],xr=!1,Ar=0;Ar<Sr.length;Ar++){var Qr=Sr[Ar];if(!Ue.horizontal[Qr])if(xr)Ue.horizontal[Qr]=Ue.horizontal[0];else{var ei=Nl(ot,t,r,l,xe,_r,j,"center",Qr,Qe,je,pn.horizontal,!1,Vt,De,Pe);ei&&(Ue.horizontal[Qr]=ei,xr=ei.positionedLines.length===1)}}Tr()}else{at==="auto"&&(at=ip(Tt));var Ci=Nl(ot,t,r,l,xe,_r,j,Tt,at,Qe,je,pn.horizontal,!1,Vt,De,Pe);Ci&&(Ue.horizontal[at]=Ci),Tr(),mu(bt)&&G&&te&&(Ue.vertical=Nl(ot,t,r,l,xe,_r,j,Tt,at,Qe,je,pn.vertical,!1,Vt,De,Pe))}}var li=void 0,ki=!1;if(he.icon&&he.icon.name){var Mr=a[he.icon.name];Mr&&(li=(function(Mt,nr,Jt){var Ft=ep(Jt),Oi=nr[0]-Mt.displaySize[0]*Ft.horizontalAlign,_i=nr[1]-Mt.displaySize[1]*Ft.verticalAlign;return{image:Mt,top:_i,bottom:_i+Mt.displaySize[1],left:Oi,right:Oi+Mt.displaySize[0]}})(l[he.icon.name],m.get("icon-offset").evaluate(he,{},h),m.get("icon-anchor").evaluate(he,{},h)),ki=Mr.sdf,e.sdfIcons===void 0?e.sdfIcons=Mr.sdf:e.sdfIcons!==Mr.sdf&&St("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Mr.pixelRatio!==e.pixelRatio||m.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var ci=jm(Ue.horizontal)||Ue.vertical;e.iconsInText=!!ci&&ci.iconsInText,(ci||li)&&(function(Mt,nr,Jt,Ft,Oi,_i,fr,Ur,xi,qt,so){var hn=_i.textMaxSize.evaluate(nr,{});hn===void 0&&(hn=fr);var uo,Br=Mt.layers[0].layout,lo=Br.get("icon-offset").evaluate(nr,{},so),kn=jm(Jt.horizontal),Ds=fr/24,ja=Mt.tilePixelRatio*Ds,Rs=Mt.tilePixelRatio*hn/24,Vo=Mt.tilePixelRatio*Ur,Ls=Mt.tilePixelRatio*Br.get("symbol-spacing"),Yl=Br.get("text-padding")*Mt.tilePixelRatio,Fs=Br.get("icon-padding")*Mt.tilePixelRatio,Lu=Br.get("text-max-angle")/180*Math.PI,Ql=Br.get("text-rotation-alignment")==="map"&&Br.get("symbol-placement")!=="point",ec=Br.get("icon-rotation-alignment")==="map"&&Br.get("symbol-placement")!=="point",qo=Br.get("symbol-placement"),Fu=Ls/2,Os=Br.get("icon-text-fit");Ft&&Os!=="none"&&(Mt.allowVerticalPlacement&&Jt.vertical&&(uo=Mm(Ft,Jt.vertical,Os,Br.get("icon-text-fit-padding"),lo,Ds)),kn&&(Ft=Mm(Ft,kn,Os,Br.get("icon-text-fit-padding"),lo,Ds)));var la=function(p0,Zu){Zu.x<0||Zu.x>=8192||Zu.y<0||Zu.y>=8192||(function(zr,Un,h0,ca,hp,ay,ac,co,sc,$u,uc,lc,fp,sy,Wu,uy,ly,cy,py,hy,fn,cc,fy,po,f0){var dy,Za,js,Gs,Zs,$s=zr.addToLineVertexArray(Un,h0),my=0,yy=0,vy=0,gy=0,dp=-1,mp=-1,Uo={},_y=N(""),yp=0,vp=0;if(co._unevaluatedLayout.getValue("text-radial-offset")===void 0?(yp=(dy=co.layout.get("text-offset").evaluate(fn,{},po).map((function(Xu){return 24*Xu})))[0],vp=dy[1]):(yp=24*co.layout.get("text-radial-offset").evaluate(fn,{},po),vp=rp),zr.allowVerticalPlacement&&ca.vertical){var xy=co.layout.get("text-rotate").evaluate(fn,{},po)+90;Gs=new Wl(sc,Un,$u,uc,lc,ca.vertical,fp,sy,Wu,xy),ac&&(Zs=new Wl(sc,Un,$u,uc,lc,ac,ly,cy,Wu,xy))}if(hp){var gp=co.layout.get("icon-rotate").evaluate(fn,{}),by=co.layout.get("icon-text-fit")!=="none",wy=Vm(hp,gp,fy,by),_p=ac?Vm(ac,gp,fy,by):void 0;js=new Wl(sc,Un,$u,uc,lc,hp,ly,cy,!1,gp),my=4*wy.length;var Sy=zr.iconSizeData,Hu=null;Sy.kind==="source"?(Hu=[128*co.layout.get("icon-size").evaluate(fn,{})])[0]>32640&&St(zr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):Sy.kind==="composite"&&((Hu=[128*cc.compositeIconSizes[0].evaluate(fn,{},po),128*cc.compositeIconSizes[1].evaluate(fn,{},po)])[0]>32640||Hu[1]>32640)&&St(zr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),zr.addSymbols(zr.icon,wy,Hu,hy,py,fn,!1,Un,$s.lineStartIndex,$s.lineLength,-1,po),dp=zr.icon.placedSymbolArray.length-1,_p&&(yy=4*_p.length,zr.addSymbols(zr.icon,_p,Hu,hy,py,fn,pn.vertical,Un,$s.lineStartIndex,$s.lineLength,-1,po),mp=zr.icon.placedSymbolArray.length-1)}for(var Iy in ca.horizontal){var pc=ca.horizontal[Iy];if(!Za){_y=N(pc.text);var d0=co.layout.get("text-rotate").evaluate(fn,{},po);Za=new Wl(sc,Un,$u,uc,lc,pc,fp,sy,Wu,d0)}var Ty=pc.positionedLines.length===1;if(vy+=Nm(zr,Un,pc,ay,co,Wu,fn,uy,$s,ca.vertical?pn.horizontal:pn.horizontalOnly,Ty?Object.keys(ca.horizontal):[Iy],Uo,dp,cc,po),Ty)break}ca.vertical&&(gy+=Nm(zr,Un,ca.vertical,ay,co,Wu,fn,uy,$s,pn.vertical,["vertical"],Uo,mp,cc,po));var m0=Za?Za.boxStartIndex:zr.collisionBoxArray.length,y0=Za?Za.boxEndIndex:zr.collisionBoxArray.length,v0=Gs?Gs.boxStartIndex:zr.collisionBoxArray.length,g0=Gs?Gs.boxEndIndex:zr.collisionBoxArray.length,_0=js?js.boxStartIndex:zr.collisionBoxArray.length,x0=js?js.boxEndIndex:zr.collisionBoxArray.length,b0=Zs?Zs.boxStartIndex:zr.collisionBoxArray.length,w0=Zs?Zs.boxEndIndex:zr.collisionBoxArray.length,ho=-1,hc=function(Xu,Ey){return Xu&&Xu.circleDiameter?Math.max(Xu.circleDiameter,Ey):Ey};ho=hc(Za,ho),ho=hc(Gs,ho),ho=hc(js,ho);var Ay=(ho=hc(Zs,ho))>-1?1:0;Ay&&(ho*=f0/24),zr.glyphOffsetArray.length>=er.MAX_GLYPHS&&St("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),fn.sortKey!==void 0&&zr.addToSortKeyRanges(zr.symbolInstances.length,fn.sortKey),zr.symbolInstances.emplaceBack(Un.x,Un.y,Uo.right>=0?Uo.right:-1,Uo.center>=0?Uo.center:-1,Uo.left>=0?Uo.left:-1,Uo.vertical||-1,dp,mp,_y,m0,y0,v0,g0,_0,x0,b0,w0,$u,vy,gy,my,yy,Ay,0,fp,yp,vp,ho)})(Mt,Zu,p0,Jt,Ft,Oi,uo,Mt.layers[0],Mt.collisionBoxArray,nr.index,nr.sourceLayerIndex,Mt.index,ja,Yl,Ql,xi,Vo,Fs,ec,lo,nr,_i,qt,so,fr)};if(qo==="line")for(var Vs=0,tc=Om(nr.geometry,0,0,8192,8192);Vs<tc.length;Vs+=1)for(var rc=tc[Vs],Ou=0,Vu=Hb(rc,Ls,Lu,Jt.vertical||kn,Ft,24,Rs,Mt.overscaling,8192);Ou<Vu.length;Ou+=1){var ic=Vu[Ou];kn&&Yb(Mt,kn.text,Fu,ic)||la(rc,ic)}else if(qo==="line-center")for(var qu=0,Uu=nr.geometry;qu<Uu.length;qu+=1){var Nu=Uu[qu];if(Nu.length>1){var nc=Wb(Nu,Lu,Jt.vertical||kn,Ft,24,Rs);nc&&la(Nu,nc)}}else if(nr.type==="Polygon")for(var qs=0,oc=Xc(nr.geometry,0);qs<oc.length;qs+=1){var Us=oc[qs],ju=Kb(Us,16);la(Us[0],new Es(ju.x,ju.y,0))}else if(nr.type==="LineString")for(var Ga=0,Gu=nr.geometry;Ga<Gu.length;Ga+=1){var Ns=Gu[Ga];la(Ns,new Es(Ns[0].x,Ns[0].y,0))}else if(nr.type==="Point")for(var lp=0,ny=nr.geometry;lp<ny.length;lp+=1)for(var cp=0,oy=ny[lp];cp<oy.length;cp+=1){var pp=oy[cp];la([pp],new Es(pp.x,pp.y,0))}})(e,he,Ue,li,a,x,De,rt,je,ki,h)},le=0,ce=e.features;le<ce.length;le+=1)oe();c&&e.generateCollisionDebugBuffers()},u.perspective=function(e,t,r,a,l){var c,h=1/Math.tan(t/2);return e[0]=h/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=h,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,l!=null&&l!==1/0?(e[10]=(l+a)*(c=1/(a-l)),e[14]=2*l*a*c):(e[10]=-1,e[14]=-2*a),e},u.pick=function(e,t){for(var r={},a=0;a<t.length;a++){var l=t[a];l in e&&(r[l]=e[l])}return r},u.plugin=Qi,u.polygonIntersectsPolygon=no,u.postMapLoadEvent=Mn,u.postTurnstileEvent=Zo,u.potpack=Em,u.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],u.register=Xe,u.registerForPluginStateChange=function(e){return e({pluginStatus:Zi,pluginURL:Ln}),vu.on("pluginStateChange",e),e},u.renderColorRamp=um,u.rotate=function(e,t,r){var a=t[0],l=t[1],c=t[2],h=t[3],m=Math.sin(r),g=Math.cos(r);return e[0]=a*g+c*m,e[1]=l*g+h*m,e[2]=a*-m+c*g,e[3]=l*-m+h*g,e},u.rotateX=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[4],h=t[5],m=t[6],g=t[7],x=t[8],S=t[9],I=t[10],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*l+x*a,e[5]=h*l+S*a,e[6]=m*l+I*a,e[7]=g*l+C*a,e[8]=x*l-c*a,e[9]=S*l-h*a,e[10]=I*l-m*a,e[11]=C*l-g*a,e},u.rotateZ=function(e,t,r){var a=Math.sin(r),l=Math.cos(r),c=t[0],h=t[1],m=t[2],g=t[3],x=t[4],S=t[5],I=t[6],C=t[7];return t!==e&&(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[0]=c*l+x*a,e[1]=h*l+S*a,e[2]=m*l+I*a,e[3]=g*l+C*a,e[4]=x*l-c*a,e[5]=S*l-h*a,e[6]=I*l-m*a,e[7]=C*l-g*a,e},u.scale=function(e,t,r){var a=r[0],l=r[1],c=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*l,e[5]=t[5]*l,e[6]=t[6]*l,e[7]=t[7]*l,e[8]=t[8]*c,e[9]=t[9]*c,e[10]=t[10]*c,e[11]=t[11]*c,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},u.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},u.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},u.setCacheLimits=function(e,t){Bn=e,$o=t},u.setRTLTextPlugin=function(e,t,r){if(r===void 0&&(r=!1),Zi==="deferred"||Zi==="loading"||Zi==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Ln=Xi.resolveURL(e),Zi="deferred",fs=t,Ma(),r||_n()},u.sphericalToCartesian=function(e){var t=e[0],r=e[1],a=e[2];return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(a),y:t*Math.sin(r)*Math.sin(a),z:t*Math.cos(a)}},u.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},u.styleSpec=L,u.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},u.symbolSize=$b,u.transformMat3=function(e,t,r){var a=t[0],l=t[1],c=t[2];return e[0]=a*r[0]+l*r[3]+c*r[6],e[1]=a*r[1]+l*r[4]+c*r[7],e[2]=a*r[2]+l*r[5]+c*r[8],e},u.transformMat4=_s,u.translate=function(e,t,r){var a,l,c,h,m,g,x,S,I,C,z,j,G=r[0],te=r[1],K=r[2];return t===e?(e[12]=t[0]*G+t[4]*te+t[8]*K+t[12],e[13]=t[1]*G+t[5]*te+t[9]*K+t[13],e[14]=t[2]*G+t[6]*te+t[10]*K+t[14],e[15]=t[3]*G+t[7]*te+t[11]*K+t[15]):(l=t[1],c=t[2],h=t[3],m=t[4],g=t[5],x=t[6],S=t[7],I=t[8],C=t[9],z=t[10],j=t[11],e[0]=a=t[0],e[1]=l,e[2]=c,e[3]=h,e[4]=m,e[5]=g,e[6]=x,e[7]=S,e[8]=I,e[9]=C,e[10]=z,e[11]=j,e[12]=a*G+m*te+I*K+t[12],e[13]=l*G+g*te+C*K+t[13],e[14]=c*G+x*te+z*K+t[14],e[15]=h*G+S*te+j*K+t[15]),e},u.triggerPluginCompletionEvent=Bl,u.uniqueId=Ke,u.validateCustomStyleLayer=function(e){var t=[],r=e.id;return r===void 0&&t.push({message:"layers."+r+': missing required property "id"'}),e.render===void 0&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},u.validateLight=qc,u.validateStyle=Ea,u.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},u.vectorTile=Ss,u.version="1.13.3",u.warnOnce=St,u.webpSupported=Nr,u.window=Y,u.wrap=Ve})),R(["./shared"],(function(u){function U(T){var P=typeof T;if(P==="number"||P==="boolean"||P==="string"||T==null)return JSON.stringify(T);if(Array.isArray(T)){for(var B="[",V=0,Z=T;V<Z.length;V+=1)B+=U(Z[V])+",";return B+"]"}for(var re=Object.keys(T).sort(),ie="{",L=0;L<re.length;L++)ie+=JSON.stringify(re[L])+":"+U(T[re[L]])+",";return ie+"}"}function k(T){for(var P="",B=0,V=u.refProperties;B<V.length;B+=1)P+="/"+U(T[V[B]]);return P}var J=function(T){this.keyCache={},T&&this.replace(T)};J.prototype.replace=function(T){this._layerConfigs={},this._layers={},this.update(T,[])},J.prototype.update=function(T,P){for(var B=this,V=0,Z=T;V<Z.length;V+=1){var re=Z[V];this._layerConfigs[re.id]=re;var ie=this._layers[re.id]=u.createStyleLayer(re);ie._featureFilter=u.featureFilter(ie.filter),this.keyCache[re.id]&&delete this.keyCache[re.id]}for(var L=0,H=P;L<H.length;L+=1){var se=H[L];delete this.keyCache[se],delete this._layerConfigs[se],delete this._layers[se]}this.familiesBySource={};for(var Se=0,Ee=(function(ze,Be){for(var yt={},qe=0;qe<ze.length;qe++){var Et=Be&&Be[ze[qe].id]||k(ze[qe]);Be&&(Be[ze[qe].id]=Et);var rr=yt[Et];rr||(rr=yt[Et]=[]),rr.push(ze[qe])}var Pt=[];for(var Gt in yt)Pt.push(yt[Gt]);return Pt})(u.values(this._layerConfigs),this.keyCache);Se<Ee.length;Se+=1){var me=Ee[Se].map((function(ze){return B._layers[ze.id]})),Ae=me[0];if(Ae.visibility!=="none"){var Je=Ae.source||"",Ze=this.familiesBySource[Je];Ze||(Ze=this.familiesBySource[Je]={});var ge=Ae.sourceLayer||"_geojsonTileLayer",Ne=Ze[ge];Ne||(Ne=Ze[ge]=[]),Ne.push(me)}}};var X=function(T){var P={},B=[];for(var V in T){var Z=T[V],re=P[V]={};for(var ie in Z){var L=Z[+ie];if(L&&L.bitmap.width!==0&&L.bitmap.height!==0){var H={x:0,y:0,w:L.bitmap.width+2,h:L.bitmap.height+2};B.push(H),re[ie]={rect:H,metrics:L.metrics}}}}var se=u.potpack(B),Se=new u.AlphaImage({width:se.w||1,height:se.h||1});for(var Ee in T){var me=T[Ee];for(var Ae in me){var Je=me[+Ae];if(Je&&Je.bitmap.width!==0&&Je.bitmap.height!==0){var Ze=P[Ee][Ae].rect;u.AlphaImage.copy(Je.bitmap,Se,{x:0,y:0},{x:Ze.x+1,y:Ze.y+1},Je.bitmap)}}}this.image=Se,this.positions=P};u.register("GlyphAtlas",X);var ae=function(T){this.tileID=new u.OverscaledTileID(T.tileID.overscaledZ,T.tileID.wrap,T.tileID.canonical.z,T.tileID.canonical.x,T.tileID.canonical.y),this.uid=T.uid,this.zoom=T.zoom,this.pixelRatio=T.pixelRatio,this.tileSize=T.tileSize,this.source=T.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=T.showCollisionBoxes,this.collectResourceTiming=!!T.collectResourceTiming,this.returnDependencies=!!T.returnDependencies,this.promoteId=T.promoteId};function Y(T,P,B){for(var V=new u.EvaluationParameters(P),Z=0,re=T;Z<re.length;Z+=1)re[Z].recalculate(V,B)}function Te(T,P){var B=u.getArrayBuffer(T.request,(function(V,Z,re,ie){V?P(V):Z&&P(null,{vectorTile:new u.vectorTile.VectorTile(new u.pbf(Z)),rawData:Z,cacheControl:re,expires:ie})}));return function(){B.cancel(),P()}}ae.prototype.parse=function(T,P,B,V,Z){var re=this;this.status="parsing",this.data=T,this.collisionBoxArray=new u.CollisionBoxArray;var ie=new u.DictionaryCoder(Object.keys(T.layers).sort()),L=new u.FeatureIndex(this.tileID,this.promoteId);L.bucketLayerIDs=[];var H,se,Se,Ee,me={},Ae={featureIndex:L,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:B},Je=P.familiesBySource[this.source];for(var Ze in Je){var ge=T.layers[Ze];if(ge){ge.version===1&&u.warnOnce('Vector tile source "'+this.source+'" layer "'+Ze+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Ne=ie.encode(Ze),ze=[],Be=0;Be<ge.length;Be++){var yt=ge.feature(Be),qe=L.getId(yt,Ze);ze.push({feature:yt,id:qe,index:Be,sourceLayerIndex:Ne})}for(var Et=0,rr=Je[Ze];Et<rr.length;Et+=1){var Pt=rr[Et],Gt=Pt[0];Gt.minzoom&&this.zoom<Math.floor(Gt.minzoom)||Gt.maxzoom&&this.zoom>=Gt.maxzoom||Gt.visibility!=="none"&&(Y(Pt,this.zoom,B),(me[Gt.id]=Gt.createBucket({index:L.bucketLayerIDs.length,layers:Pt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ne,sourceID:this.source})).populate(ze,Ae,this.tileID.canonical),L.bucketLayerIDs.push(Pt.map((function(Qt){return Qt.id}))))}}}var Dt=u.mapObject(Ae.glyphDependencies,(function(Qt){return Object.keys(Qt).map(Number)}));Object.keys(Dt).length?V.send("getGlyphs",{uid:this.uid,stacks:Dt},(function(Qt,Bt){H||(H=Qt,se=Bt,Pr.call(re))})):se={};var wi=Object.keys(Ae.iconDependencies);wi.length?V.send("getImages",{icons:wi,source:this.source,tileID:this.tileID,type:"icons"},(function(Qt,Bt){H||(H=Qt,Se=Bt,Pr.call(re))})):Se={};var Ht=Object.keys(Ae.patternDependencies);function Pr(){if(H)return Z(H);if(se&&Se&&Ee){var Qt=new X(se),Bt=new u.ImageAtlas(Se,Ee);for(var Zt in me){var zi=me[Zt];zi instanceof u.SymbolBucket?(Y(zi.layers,this.zoom,B),u.performSymbolLayout(zi,se,Qt.positions,Se,Bt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):zi.hasPattern&&(zi instanceof u.LineBucket||zi instanceof u.FillBucket||zi instanceof u.FillExtrusionBucket)&&(Y(zi.layers,this.zoom,B),zi.addFeatures(Ae,this.tileID.canonical,Bt.patternPositions))}this.status="done",Z(null,{buckets:u.values(me).filter((function(ma){return!ma.isEmpty()})),featureIndex:L,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Qt.image,imageAtlas:Bt,glyphMap:this.returnDependencies?se:null,iconMap:this.returnDependencies?Se:null,glyphPositions:this.returnDependencies?Qt.positions:null})}}Ht.length?V.send("getImages",{icons:Ht,source:this.source,tileID:this.tileID,type:"patterns"},(function(Qt,Bt){H||(H=Qt,Ee=Bt,Pr.call(re))})):Ee={},Pr.call(this)};var be=function(T,P,B,V){this.actor=T,this.layerIndex=P,this.availableImages=B,this.loadVectorData=V||Te,this.loading={},this.loaded={}};be.prototype.loadTile=function(T,P){var B=this,V=T.uid;this.loading||(this.loading={});var Z=!!(T&&T.request&&T.request.collectResourceTiming)&&new u.RequestPerformance(T.request),re=this.loading[V]=new ae(T);re.abort=this.loadVectorData(T,(function(ie,L){if(delete B.loading[V],ie||!L)return re.status="done",B.loaded[V]=re,P(ie);var H=L.rawData,se={};L.expires&&(se.expires=L.expires),L.cacheControl&&(se.cacheControl=L.cacheControl);var Se={};if(Z){var Ee=Z.finish();Ee&&(Se.resourceTiming=JSON.parse(JSON.stringify(Ee)))}re.vectorTile=L.vectorTile,re.parse(L.vectorTile,B.layerIndex,B.availableImages,B.actor,(function(me,Ae){if(me||!Ae)return P(me);P(null,u.extend({rawTileData:H.slice(0)},Ae,se,Se))})),B.loaded=B.loaded||{},B.loaded[V]=re}))},be.prototype.reloadTile=function(T,P){var B=this,V=this.loaded,Z=T.uid,re=this;if(V&&V[Z]){var ie=V[Z];ie.showCollisionBoxes=T.showCollisionBoxes;var L=function(H,se){var Se=ie.reloadCallback;Se&&(delete ie.reloadCallback,ie.parse(ie.vectorTile,re.layerIndex,B.availableImages,re.actor,Se)),P(H,se)};ie.status==="parsing"?ie.reloadCallback=L:ie.status==="done"&&(ie.vectorTile?ie.parse(ie.vectorTile,this.layerIndex,this.availableImages,this.actor,L):L())}},be.prototype.abortTile=function(T,P){var B=this.loading,V=T.uid;B&&B[V]&&B[V].abort&&(B[V].abort(),delete B[V]),P()},be.prototype.removeTile=function(T,P){var B=this.loaded,V=T.uid;B&&B[V]&&delete B[V],P()};var ke=u.window.ImageBitmap,Oe=function(){this.loaded={}};function Ve(T,P){if(T.length!==0){Re(T[0],P);for(var B=1;B<T.length;B++)Re(T[B],!P)}}function Re(T,P){for(var B=0,V=0,Z=0,re=T.length,ie=re-1;Z<re;ie=Z++){var L=(T[Z][0]-T[ie][0])*(T[ie][1]+T[Z][1]),H=B+L;V+=Math.abs(B)>=Math.abs(L)?B-H+L:L-H+B,B=H}B+V>=0!=!!P&&T.reverse()}Oe.prototype.loadTile=function(T,P){var B=T.uid,V=T.encoding,Z=T.rawImageData,re=ke&&Z instanceof ke?this.getImageData(Z):Z,ie=new u.DEMData(B,re,V);this.loaded=this.loaded||{},this.loaded[B]=ie,P(null,ie)},Oe.prototype.getImageData=function(T){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(T.width,T.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=T.width,this.offscreenCanvas.height=T.height,this.offscreenCanvasContext.drawImage(T,0,0,T.width,T.height);var P=this.offscreenCanvasContext.getImageData(-1,-1,T.width+2,T.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new u.RGBAImage({width:P.width,height:P.height},P.data)},Oe.prototype.removeTile=function(T){var P=this.loaded,B=T.uid;P&&P[B]&&delete P[B]};var ve=u.vectorTile.VectorTileFeature.prototype.toGeoJSON,Ke=function(T){this._feature=T,this.extent=u.EXTENT,this.type=T.type,this.properties=T.tags,"id"in T&&!isNaN(T.id)&&(this.id=parseInt(T.id,10))};Ke.prototype.loadGeometry=function(){if(this._feature.type===1){for(var T=[],P=0,B=this._feature.geometry;P<B.length;P+=1){var V=B[P];T.push([new u.Point$1(V[0],V[1])])}return T}for(var Z=[],re=0,ie=this._feature.geometry;re<ie.length;re+=1){for(var L=[],H=0,se=ie[re];H<se.length;H+=1){var Se=se[H];L.push(new u.Point$1(Se[0],Se[1]))}Z.push(L)}return Z},Ke.prototype.toGeoJSON=function(T,P,B){return ve.call(this,T,P,B)};var We=function(T){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=u.EXTENT,this.length=T.length,this._features=T};We.prototype.feature=function(T){return new Ke(this._features[T])};var It=u.vectorTile.VectorTileFeature,we=Ge;function Ge(T,P){this.options=P||{},this.features=T,this.length=T.length}function Fe(T,P){this.id=typeof T.id=="number"?T.id:void 0,this.type=T.type,this.rawGeometry=T.type===1?[T.geometry]:T.geometry,this.properties=T.tags,this.extent=P||4096}Ge.prototype.feature=function(T){return new Fe(this.features[T],this.options.extent)},Fe.prototype.loadGeometry=function(){var T=this.rawGeometry;this.geometry=[];for(var P=0;P<T.length;P++){for(var B=T[P],V=[],Z=0;Z<B.length;Z++)V.push(new u.Point$1(B[Z][0],B[Z][1]));this.geometry.push(V)}return this.geometry},Fe.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var T=this.geometry,P=1/0,B=-1/0,V=1/0,Z=-1/0,re=0;re<T.length;re++)for(var ie=T[re],L=0;L<ie.length;L++){var H=ie[L];P=Math.min(P,H.x),B=Math.max(B,H.x),V=Math.min(V,H.y),Z=Math.max(Z,H.y)}return[P,V,B,Z]},Fe.prototype.toGeoJSON=It.prototype.toGeoJSON;var tt=Wt,kt=we;function Wt(T){var P=new u.pbf;return(function(B,V){for(var Z in B.layers)V.writeMessage(3,St,B.layers[Z])})(T,P),P.finish()}function St(T,P){var B;P.writeVarintField(15,T.version||1),P.writeStringField(1,T.name||""),P.writeVarintField(5,T.extent||4096);var V={keys:[],values:[],keycache:{},valuecache:{}};for(B=0;B<T.length;B++)V.feature=T.feature(B),P.writeMessage(2,Ut,V);var Z=V.keys;for(B=0;B<Z.length;B++)P.writeStringField(3,Z[B]);var re=V.values;for(B=0;B<re.length;B++)P.writeMessage(4,Rr,re[B])}function Ut(T,P){var B=T.feature;B.id!==void 0&&P.writeVarintField(1,B.id),P.writeMessage(2,Hr,T),P.writeVarintField(3,B.type),P.writeMessage(4,or,B)}function Hr(T,P){var B=T.feature,V=T.keys,Z=T.values,re=T.keycache,ie=T.valuecache;for(var L in B.properties){var H=re[L];H===void 0&&(V.push(L),re[L]=H=V.length-1),P.writeVarint(H);var se=B.properties[L],Se=typeof se;Se!=="string"&&Se!=="boolean"&&Se!=="number"&&(se=JSON.stringify(se));var Ee=Se+":"+se,me=ie[Ee];me===void 0&&(Z.push(se),ie[Ee]=me=Z.length-1),P.writeVarint(me)}}function Er(T,P){return(P<<3)+(7&T)}function bi(T){return T<<1^T>>31}function or(T,P){for(var B=T.loadGeometry(),V=T.type,Z=0,re=0,ie=B.length,L=0;L<ie;L++){var H=B[L],se=1;V===1&&(se=H.length),P.writeVarint(Er(1,se));for(var Se=V===3?H.length-1:H.length,Ee=0;Ee<Se;Ee++){Ee===1&&V!==1&&P.writeVarint(Er(2,Se-1));var me=H[Ee].x-Z,Ae=H[Ee].y-re;P.writeVarint(bi(me)),P.writeVarint(bi(Ae)),Z+=me,re+=Ae}V===3&&P.writeVarint(Er(7,1))}}function Rr(T,P){var B=typeof T;B==="string"?P.writeStringField(1,T):B==="boolean"?P.writeBooleanField(7,T):B==="number"&&(T%1!=0?P.writeDoubleField(3,T):T<0?P.writeSVarintField(6,T):P.writeVarintField(5,T))}function et(T,P,B,V){Lr(T,B,V),Lr(P,2*B,2*V),Lr(P,2*B+1,2*V+1)}function Lr(T,P,B){var V=T[P];T[P]=T[B],T[B]=V}function Xr(T,P,B,V){var Z=T-B,re=P-V;return Z*Z+re*re}tt.fromVectorTileJs=Wt,tt.fromGeojsonVt=function(T,P){P=P||{};var B={};for(var V in T)B[V]=new we(T[V].features,P),B[V].name=V,B[V].version=P.version,B[V].extent=P.extent;return Wt({layers:B})},tt.GeoJSONWrapper=kt;var At=function(T){return T[0]},Fr=function(T){return T[1]},Mi=function(T,P,B,V,Z){P===void 0&&(P=At),B===void 0&&(B=Fr),V===void 0&&(V=64),Z===void 0&&(Z=Float64Array),this.nodeSize=V,this.points=T;for(var re=T.length<65536?Uint16Array:Uint32Array,ie=this.ids=new re(T.length),L=this.coords=new Z(2*T.length),H=0;H<T.length;H++)ie[H]=H,L[2*H]=P(T[H]),L[2*H+1]=B(T[H]);(function se(Se,Ee,me,Ae,Je,Ze){if(!(Je-Ae<=me)){var ge=Ae+Je>>1;(function Ne(ze,Be,yt,qe,Et,rr){for(;Et>qe;){if(Et-qe>600){var Pt=Et-qe+1,Gt=yt-qe+1,Dt=Math.log(Pt),wi=.5*Math.exp(2*Dt/3),Ht=.5*Math.sqrt(Dt*wi*(Pt-wi)/Pt)*(Gt-Pt/2<0?-1:1);Ne(ze,Be,yt,Math.max(qe,Math.floor(yt-Gt*wi/Pt+Ht)),Math.min(Et,Math.floor(yt+(Pt-Gt)*wi/Pt+Ht)),rr)}var Pr=Be[2*yt+rr],Qt=qe,Bt=Et;for(et(ze,Be,qe,yt),Be[2*Et+rr]>Pr&&et(ze,Be,qe,Et);Qt<Bt;){for(et(ze,Be,Qt,Bt),Qt++,Bt--;Be[2*Qt+rr]<Pr;)Qt++;for(;Be[2*Bt+rr]>Pr;)Bt--}Be[2*qe+rr]===Pr?et(ze,Be,qe,Bt):et(ze,Be,++Bt,Et),Bt<=yt&&(qe=Bt+1),yt<=Bt&&(Et=Bt-1)}})(Se,Ee,ge,Ae,Je,Ze%2),se(Se,Ee,me,Ae,ge-1,Ze+1),se(Se,Ee,me,ge+1,Je,Ze+1)}})(ie,L,V,0,ie.length-1,0)};Mi.prototype.range=function(T,P,B,V){return(function(Z,re,ie,L,H,se,Se){for(var Ee,me,Ae=[0,Z.length-1,0],Je=[];Ae.length;){var Ze=Ae.pop(),ge=Ae.pop(),Ne=Ae.pop();if(ge-Ne<=Se)for(var ze=Ne;ze<=ge;ze++)me=re[2*ze+1],(Ee=re[2*ze])>=ie&&Ee<=H&&me>=L&&me<=se&&Je.push(Z[ze]);else{var Be=Math.floor((Ne+ge)/2);me=re[2*Be+1],(Ee=re[2*Be])>=ie&&Ee<=H&&me>=L&&me<=se&&Je.push(Z[Be]);var yt=(Ze+1)%2;(Ze===0?ie<=Ee:L<=me)&&(Ae.push(Ne),Ae.push(Be-1),Ae.push(yt)),(Ze===0?H>=Ee:se>=me)&&(Ae.push(Be+1),Ae.push(ge),Ae.push(yt))}}return Je})(this.ids,this.coords,T,P,B,V,this.nodeSize)},Mi.prototype.within=function(T,P,B){return(function(V,Z,re,ie,L,H){for(var se=[0,V.length-1,0],Se=[],Ee=L*L;se.length;){var me=se.pop(),Ae=se.pop(),Je=se.pop();if(Ae-Je<=H)for(var Ze=Je;Ze<=Ae;Ze++)Xr(Z[2*Ze],Z[2*Ze+1],re,ie)<=Ee&&Se.push(V[Ze]);else{var ge=Math.floor((Je+Ae)/2),Ne=Z[2*ge],ze=Z[2*ge+1];Xr(Ne,ze,re,ie)<=Ee&&Se.push(V[ge]);var Be=(me+1)%2;(me===0?re-L<=Ne:ie-L<=ze)&&(se.push(Je),se.push(ge-1),se.push(Be)),(me===0?re+L>=Ne:ie+L>=ze)&&(se.push(ge+1),se.push(Ae),se.push(Be))}}return Se})(this.ids,this.coords,T,P,B,this.nodeSize)};var pi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(T){return T}},Or=function(T){this.options=mr(Object.create(pi),T),this.trees=new Array(this.options.maxZoom+1)};function Xi(T,P,B,V,Z){return{x:T,y:P,zoom:1/0,id:B,parentId:-1,numPoints:V,properties:Z}}function Nt(T,P){var B=T.geometry.coordinates,V=B[1];return{x:sr(B[0]),y:lt(V),zoom:1/0,index:P,parentId:-1}}function Nr(T){return{type:"Feature",id:T.id,properties:ar(T),geometry:{type:"Point",coordinates:[(V=T.x,360*(V-.5)),(P=T.y,B=(180-360*P)*Math.PI/180,360*Math.atan(Math.exp(B))/Math.PI-90)]}};var P,B,V}function ar(T){var P=T.numPoints,B=P>=1e4?Math.round(P/1e3)+"k":P>=1e3?Math.round(P/100)/10+"k":P;return mr(mr({},T.properties),{cluster:!0,cluster_id:T.id,point_count:P,point_count_abbreviated:B})}function sr(T){return T/360+.5}function lt(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function mr(T,P){for(var B in P)T[B]=P[B];return T}function pr(T){return T.x}function jr(T){return T.y}function hr(T,P,B,V,Z,re){var ie=Z-B,L=re-V;if(ie!==0||L!==0){var H=((T-B)*ie+(P-V)*L)/(ie*ie+L*L);H>1?(B=Z,V=re):H>0&&(B+=ie*H,V+=L*H)}return(ie=T-B)*ie+(L=P-V)*L}function br(T,P,B,V){var Z={id:T===void 0?null:T,type:P,geometry:B,tags:V,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return(function(re){var ie=re.geometry,L=re.type;if(L==="Point"||L==="MultiPoint"||L==="LineString")dn(re,ie);else if(L==="Polygon"||L==="MultiLineString")for(var H=0;H<ie.length;H++)dn(re,ie[H]);else if(L==="MultiPolygon")for(H=0;H<ie.length;H++)for(var se=0;se<ie[H].length;se++)dn(re,ie[H][se])})(Z),Z}function dn(T,P){for(var B=0;B<P.length;B+=3)T.minX=Math.min(T.minX,P[B]),T.minY=Math.min(T.minY,P[B+1]),T.maxX=Math.max(T.maxX,P[B]),T.maxY=Math.max(T.maxY,P[B+1])}function Kr(T,P,B,V){if(P.geometry){var Z=P.geometry.coordinates,re=P.geometry.type,ie=Math.pow(B.tolerance/((1<<B.maxZoom)*B.extent),2),L=[],H=P.id;if(B.promoteId?H=P.properties[B.promoteId]:B.generateId&&(H=V||0),re==="Point")Bi(Z,L);else if(re==="MultiPoint")for(var se=0;se<Z.length;se++)Bi(Z[se],L);else if(re==="LineString")hi(Z,L,ie,!1);else if(re==="MultiLineString"){if(B.lineMetrics){for(se=0;se<Z.length;se++)hi(Z[se],L=[],ie,!1),T.push(br(H,"LineString",L,P.properties));return}ti(Z,L,ie,!1)}else if(re==="Polygon")ti(Z,L,ie,!0);else{if(re!=="MultiPolygon"){if(re==="GeometryCollection"){for(se=0;se<P.geometry.geometries.length;se++)Kr(T,{id:H,geometry:P.geometry.geometries[se],properties:P.properties},B,V);return}throw new Error("Input data is not a valid GeoJSON object.")}for(se=0;se<Z.length;se++){var Se=[];ti(Z[se],Se,ie,!0),L.push(Se)}}T.push(br(H,re,L,P.properties))}}function Bi(T,P){P.push(ri(T[0])),P.push(Vi(T[1])),P.push(0)}function hi(T,P,B,V){for(var Z,re,ie=0,L=0;L<T.length;L++){var H=ri(T[L][0]),se=Vi(T[L][1]);P.push(H),P.push(se),P.push(0),L>0&&(ie+=V?(Z*se-H*re)/2:Math.sqrt(Math.pow(H-Z,2)+Math.pow(se-re,2))),Z=H,re=se}var Se=P.length-3;P[2]=1,(function Ee(me,Ae,Je,Ze){for(var ge,Ne=Ze,ze=Je-Ae>>1,Be=Je-Ae,yt=me[Ae],qe=me[Ae+1],Et=me[Je],rr=me[Je+1],Pt=Ae+3;Pt<Je;Pt+=3){var Gt=hr(me[Pt],me[Pt+1],yt,qe,Et,rr);if(Gt>Ne)ge=Pt,Ne=Gt;else if(Gt===Ne){var Dt=Math.abs(Pt-ze);Dt<Be&&(ge=Pt,Be=Dt)}}Ne>Ze&&(ge-Ae>3&&Ee(me,Ae,ge,Ze),me[ge+2]=Ne,Je-ge>3&&Ee(me,ge,Je,Ze))})(P,0,Se,B),P[Se+2]=1,P.size=Math.abs(ie),P.start=0,P.end=P.size}function ti(T,P,B,V){for(var Z=0;Z<T.length;Z++){var re=[];hi(T[Z],re,B,V),P.push(re)}}function ri(T){return T/360+.5}function Vi(T){var P=Math.sin(T*Math.PI/180),B=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return B<0?0:B>1?1:B}function Ki(T,P,B,V,Z,re,ie,L){if(V/=P,re>=(B/=P)&&ie<V)return T;if(ie<B||re>=V)return null;for(var H=[],se=0;se<T.length;se++){var Se=T[se],Ee=Se.geometry,me=Se.type,Ae=Z===0?Se.minX:Se.minY,Je=Z===0?Se.maxX:Se.maxY;if(Ae>=B&&Je<V)H.push(Se);else if(!(Je<B||Ae>=V)){var Ze=[];if(me==="Point"||me==="MultiPoint")yo(Ee,Ze,B,V,Z);else if(me==="LineString")Zo(Ee,Ze,B,V,Z,!1,L.lineMetrics);else if(me==="MultiLineString")Mn(Ee,Ze,B,V,Z,!1);else if(me==="Polygon")Mn(Ee,Ze,B,V,Z,!0);else if(me==="MultiPolygon")for(var ge=0;ge<Ee.length;ge++){var Ne=[];Mn(Ee[ge],Ne,B,V,Z,!0),Ne.length&&Ze.push(Ne)}if(Ze.length){if(L.lineMetrics&&me==="LineString"){for(ge=0;ge<Ze.length;ge++)H.push(br(Se.id,me,Ze[ge],Se.tags));continue}me!=="LineString"&&me!=="MultiLineString"||(Ze.length===1?(me="LineString",Ze=Ze[0]):me="MultiLineString"),me!=="Point"&&me!=="MultiPoint"||(me=Ze.length===3?"Point":"MultiPoint"),H.push(br(Se.id,me,Ze,Se.tags))}}}return H.length?H:null}function yo(T,P,B,V,Z){for(var re=0;re<T.length;re+=3){var ie=T[re+Z];ie>=B&&ie<=V&&(P.push(T[re]),P.push(T[re+1]),P.push(T[re+2]))}}function Zo(T,P,B,V,Z,re,ie){for(var L,H,se=mn(T),Se=Z===0?$o:jn,Ee=T.start,me=0;me<T.length-3;me+=3){var Ae=T[me],Je=T[me+1],Ze=T[me+2],ge=T[me+3],Ne=T[me+4],ze=Z===0?Ae:Je,Be=Z===0?ge:Ne,yt=!1;ie&&(L=Math.sqrt(Math.pow(Ae-ge,2)+Math.pow(Je-Ne,2))),ze<B?Be>B&&(H=Se(se,Ae,Je,ge,Ne,B),ie&&(se.start=Ee+L*H)):ze>V?Be<V&&(H=Se(se,Ae,Je,ge,Ne,V),ie&&(se.start=Ee+L*H)):Bn(se,Ae,Je,Ze),Be<B&&ze>=B&&(H=Se(se,Ae,Je,ge,Ne,B),yt=!0),Be>V&&ze<=V&&(H=Se(se,Ae,Je,ge,Ne,V),yt=!0),!re&&yt&&(ie&&(se.end=Ee+L*H),P.push(se),se=mn(T)),ie&&(Ee+=L)}var qe=T.length-3;Ae=T[qe],Je=T[qe+1],Ze=T[qe+2],(ze=Z===0?Ae:Je)>=B&&ze<=V&&Bn(se,Ae,Je,Ze),qe=se.length-3,re&&qe>=3&&(se[qe]!==se[0]||se[qe+1]!==se[1])&&Bn(se,se[0],se[1],se[2]),se.length&&P.push(se)}function mn(T){var P=[];return P.size=T.size,P.start=T.start,P.end=T.end,P}function Mn(T,P,B,V,Z,re){for(var ie=0;ie<T.length;ie++)Zo(T[ie],P,B,V,Z,re,!1)}function Bn(T,P,B,V){T.push(P),T.push(B),T.push(V)}function $o(T,P,B,V,Z,re){var ie=(re-P)/(V-P);return T.push(re),T.push(B+(Z-B)*ie),T.push(1),ie}function jn(T,P,B,V,Z,re){var ie=(re-B)/(Z-B);return T.push(P+(V-P)*ie),T.push(re),T.push(1),ie}function zn(T,P){for(var B=[],V=0;V<T.length;V++){var Z,re=T[V],ie=re.type;if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")Z=rn(re.geometry,P);else if(ie==="MultiLineString"||ie==="Polygon"){Z=[];for(var L=0;L<re.geometry.length;L++)Z.push(rn(re.geometry[L],P))}else if(ie==="MultiPolygon")for(Z=[],L=0;L<re.geometry.length;L++){for(var H=[],se=0;se<re.geometry[L].length;se++)H.push(rn(re.geometry[L][se],P));Z.push(H)}B.push(br(re.id,ie,Z,re.tags))}return B}function rn(T,P){var B=[];B.size=T.size,T.start!==void 0&&(B.start=T.start,B.end=T.end);for(var V=0;V<T.length;V+=3)B.push(T[V]+P,T[V+1],T[V+2]);return B}function fe(T,P){if(T.transformed)return T;var B,V,Z,re=1<<T.z,ie=T.x,L=T.y;for(B=0;B<T.features.length;B++){var H=T.features[B],se=H.geometry,Se=H.type;if(H.geometry=[],Se===1)for(V=0;V<se.length;V+=2)H.geometry.push(_e(se[V],se[V+1],P,re,ie,L));else for(V=0;V<se.length;V++){var Ee=[];for(Z=0;Z<se[V].length;Z+=2)Ee.push(_e(se[V][Z],se[V][Z+1],P,re,ie,L));H.geometry.push(Ee)}}return T.transformed=!0,T}function _e(T,P,B,V,Z,re){return[Math.round(B*(T*V-Z)),Math.round(B*(P*V-re))]}function jt(T,P,B,V,Z){for(var re=P===Z.maxZoom?0:Z.tolerance/((1<<P)*Z.extent),ie={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:B,y:V,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},L=0;L<T.length;L++){ie.numFeatures++,tr(ie,T[L],re,Z);var H=T[L].minX,se=T[L].minY,Se=T[L].maxX,Ee=T[L].maxY;H<ie.minX&&(ie.minX=H),se<ie.minY&&(ie.minY=se),Se>ie.maxX&&(ie.maxX=Se),Ee>ie.maxY&&(ie.maxY=Ee)}return ie}function tr(T,P,B,V){var Z=P.geometry,re=P.type,ie=[];if(re==="Point"||re==="MultiPoint")for(var L=0;L<Z.length;L+=3)ie.push(Z[L]),ie.push(Z[L+1]),T.numPoints++,T.numSimplified++;else if(re==="LineString")Kt(ie,Z,T,B,!1,!1);else if(re==="MultiLineString"||re==="Polygon")for(L=0;L<Z.length;L++)Kt(ie,Z[L],T,B,re==="Polygon",L===0);else if(re==="MultiPolygon")for(var H=0;H<Z.length;H++){var se=Z[H];for(L=0;L<se.length;L++)Kt(ie,se[L],T,B,!0,L===0)}if(ie.length){var Se=P.tags||null;if(re==="LineString"&&V.lineMetrics){for(var Ee in Se={},P.tags)Se[Ee]=P.tags[Ee];Se.mapbox_clip_start=Z.start/Z.size,Se.mapbox_clip_end=Z.end/Z.size}var me={geometry:ie,type:re==="Polygon"||re==="MultiPolygon"?3:re==="LineString"||re==="MultiLineString"?2:1,tags:Se};P.id!==null&&(me.id=P.id),T.features.push(me)}}function Kt(T,P,B,V,Z,re){var ie=V*V;if(V>0&&P.size<(Z?ie:V))B.numPoints+=P.length/3;else{for(var L=[],H=0;H<P.length;H+=3)(V===0||P[H+2]>ie)&&(B.numSimplified++,L.push(P[H]),L.push(P[H+1])),B.numPoints++;Z&&(function(se,Se){for(var Ee=0,me=0,Ae=se.length,Je=Ae-2;me<Ae;Je=me,me+=2)Ee+=(se[me]-se[Je])*(se[me+1]+se[Je+1]);if(Ee>0===Se)for(me=0,Ae=se.length;me<Ae/2;me+=2){var Ze=se[me],ge=se[me+1];se[me]=se[Ae-2-me],se[me+1]=se[Ae-1-me],se[Ae-2-me]=Ze,se[Ae-1-me]=ge}})(L,re),T.push(L)}}function _t(T,P){var B=(P=this.options=(function(Z,re){for(var ie in re)Z[ie]=re[ie];return Z})(Object.create(this.options),P)).debug;if(B&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var V=(function(Z,re){var ie=[];if(Z.type==="FeatureCollection")for(var L=0;L<Z.features.length;L++)Kr(ie,Z.features[L],re,L);else Kr(ie,Z.type==="Feature"?Z:{geometry:Z},re);return ie})(T,P);this.tiles={},this.tileCoords=[],B&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(V=(function(Z,re){var ie=re.buffer/re.extent,L=Z,H=Ki(Z,1,-1-ie,ie,0,-1,2,re),se=Ki(Z,1,1-ie,2+ie,0,-1,2,re);return(H||se)&&(L=Ki(Z,1,-ie,1+ie,0,-1,2,re)||[],H&&(L=zn(H,1).concat(L)),se&&(L=L.concat(zn(se,-1)))),L})(V,P)).length&&this.splitTile(V,0,0,0),B&&(V.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function fi(T,P,B){return 32*((1<<T)*B+P)+T}function qi(T,P){var B=T.tileID.canonical;if(!this._geoJSONIndex)return P(null,null);var V=this._geoJSONIndex.getTile(B.z,B.x,B.y);if(!V)return P(null,null);var Z=new We(V.features),re=tt(Z);re.byteOffset===0&&re.byteLength===re.buffer.byteLength||(re=new Uint8Array(re)),P(null,{vectorTile:Z,rawData:re.buffer})}Or.prototype.load=function(T){var P=this.options,B=P.log,V=P.minZoom,Z=P.maxZoom,re=P.nodeSize;B&&console.time("total time");var ie="prepare "+T.length+" points";B&&console.time(ie),this.points=T;for(var L=[],H=0;H<T.length;H++)T[H].geometry&&L.push(Nt(T[H],H));this.trees[Z+1]=new Mi(L,pr,jr,re,Float32Array),B&&console.timeEnd(ie);for(var se=Z;se>=V;se--){var Se=+Date.now();L=this._cluster(L,se),this.trees[se]=new Mi(L,pr,jr,re,Float32Array),B&&console.log("z%d: %d clusters in %dms",se,L.length,+Date.now()-Se)}return B&&console.timeEnd("total time"),this},Or.prototype.getClusters=function(T,P){var B=((T[0]+180)%360+360)%360-180,V=Math.max(-90,Math.min(90,T[1])),Z=T[2]===180?180:((T[2]+180)%360+360)%360-180,re=Math.max(-90,Math.min(90,T[3]));if(T[2]-T[0]>=360)B=-180,Z=180;else if(B>Z){var ie=this.getClusters([B,V,180,re],P),L=this.getClusters([-180,V,Z,re],P);return ie.concat(L)}for(var H=this.trees[this._limitZoom(P)],se=[],Se=0,Ee=H.range(sr(B),lt(re),sr(Z),lt(V));Se<Ee.length;Se+=1){var me=H.points[Ee[Se]];se.push(me.numPoints?Nr(me):this.points[me.index])}return se},Or.prototype.getChildren=function(T){var P=this._getOriginId(T),B=this._getOriginZoom(T),V="No cluster with the specified id.",Z=this.trees[B];if(!Z)throw new Error(V);var re=Z.points[P];if(!re)throw new Error(V);for(var ie=this.options.radius/(this.options.extent*Math.pow(2,B-1)),L=[],H=0,se=Z.within(re.x,re.y,ie);H<se.length;H+=1){var Se=Z.points[se[H]];Se.parentId===T&&L.push(Se.numPoints?Nr(Se):this.points[Se.index])}if(L.length===0)throw new Error(V);return L},Or.prototype.getLeaves=function(T,P,B){var V=[];return this._appendLeaves(V,T,P=P||10,B=B||0,0),V},Or.prototype.getTile=function(T,P,B){var V=this.trees[this._limitZoom(T)],Z=Math.pow(2,T),re=this.options,ie=re.radius/re.extent,L=(B-ie)/Z,H=(B+1+ie)/Z,se={features:[]};return this._addTileFeatures(V.range((P-ie)/Z,L,(P+1+ie)/Z,H),V.points,P,B,Z,se),P===0&&this._addTileFeatures(V.range(1-ie/Z,L,1,H),V.points,Z,B,Z,se),P===Z-1&&this._addTileFeatures(V.range(0,L,ie/Z,H),V.points,-1,B,Z,se),se.features.length?se:null},Or.prototype.getClusterExpansionZoom=function(T){for(var P=this._getOriginZoom(T)-1;P<=this.options.maxZoom;){var B=this.getChildren(T);if(P++,B.length!==1)break;T=B[0].properties.cluster_id}return P},Or.prototype._appendLeaves=function(T,P,B,V,Z){for(var re=0,ie=this.getChildren(P);re<ie.length;re+=1){var L=ie[re],H=L.properties;if(H&&H.cluster?Z+H.point_count<=V?Z+=H.point_count:Z=this._appendLeaves(T,H.cluster_id,B,V,Z):Z<V?Z++:T.push(L),T.length===B)break}return Z},Or.prototype._addTileFeatures=function(T,P,B,V,Z,re){for(var ie=0,L=T;ie<L.length;ie+=1){var H=P[L[ie]],se=H.numPoints,Se={type:1,geometry:[[Math.round(this.options.extent*(H.x*Z-B)),Math.round(this.options.extent*(H.y*Z-V))]],tags:se?ar(H):this.points[H.index].properties},Ee=void 0;se?Ee=H.id:this.options.generateId?Ee=H.index:this.points[H.index].id&&(Ee=this.points[H.index].id),Ee!==void 0&&(Se.id=Ee),re.features.push(Se)}},Or.prototype._limitZoom=function(T){return Math.max(this.options.minZoom,Math.min(+T,this.options.maxZoom+1))},Or.prototype._cluster=function(T,P){for(var B=[],V=this.options,Z=V.reduce,re=V.minPoints,ie=V.radius/(V.extent*Math.pow(2,P)),L=0;L<T.length;L++){var H=T[L];if(!(H.zoom<=P)){H.zoom=P;for(var se=this.trees[P+1],Se=se.within(H.x,H.y,ie),Ee=H.numPoints||1,me=Ee,Ae=0,Je=Se;Ae<Je.length;Ae+=1){var Ze=se.points[Je[Ae]];Ze.zoom>P&&(me+=Ze.numPoints||1)}if(me>=re){for(var ge=H.x*Ee,Ne=H.y*Ee,ze=Z&&Ee>1?this._map(H,!0):null,Be=(L<<5)+(P+1)+this.points.length,yt=0,qe=Se;yt<qe.length;yt+=1){var Et=se.points[qe[yt]];if(!(Et.zoom<=P)){Et.zoom=P;var rr=Et.numPoints||1;ge+=Et.x*rr,Ne+=Et.y*rr,Et.parentId=Be,Z&&(ze||(ze=this._map(H,!0)),Z(ze,this._map(Et)))}}H.parentId=Be,B.push(Xi(ge/me,Ne/me,Be,me,ze))}else if(B.push(H),me>1)for(var Pt=0,Gt=Se;Pt<Gt.length;Pt+=1){var Dt=se.points[Gt[Pt]];Dt.zoom<=P||(Dt.zoom=P,B.push(Dt))}}}return B},Or.prototype._getOriginId=function(T){return T-this.points.length>>5},Or.prototype._getOriginZoom=function(T){return(T-this.points.length)%32},Or.prototype._map=function(T,P){if(T.numPoints)return P?mr({},T.properties):T.properties;var B=this.points[T.index].properties,V=this.options.map(B);return P&&V===B?mr({},V):V},_t.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_t.prototype.splitTile=function(T,P,B,V,Z,re,ie){for(var L=[T,P,B,V],H=this.options,se=H.debug;L.length;){V=L.pop(),B=L.pop(),P=L.pop(),T=L.pop();var Se=1<<P,Ee=fi(P,B,V),me=this.tiles[Ee];if(!me&&(se>1&&console.time("creation"),me=this.tiles[Ee]=jt(T,P,B,V,H),this.tileCoords.push({z:P,x:B,y:V}),se)){se>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,B,V,me.numFeatures,me.numPoints,me.numSimplified),console.timeEnd("creation"));var Ae="z"+P;this.stats[Ae]=(this.stats[Ae]||0)+1,this.total++}if(me.source=T,Z){if(P===H.maxZoom||P===Z)continue;var Je=1<<Z-P;if(B!==Math.floor(re/Je)||V!==Math.floor(ie/Je))continue}else if(P===H.indexMaxZoom||me.numPoints<=H.indexMaxPoints)continue;if(me.source=null,T.length!==0){se>1&&console.time("clipping");var Ze,ge,Ne,ze,Be,yt,qe=.5*H.buffer/H.extent,Et=.5-qe,rr=.5+qe,Pt=1+qe;Ze=ge=Ne=ze=null,Be=Ki(T,Se,B-qe,B+rr,0,me.minX,me.maxX,H),yt=Ki(T,Se,B+Et,B+Pt,0,me.minX,me.maxX,H),T=null,Be&&(Ze=Ki(Be,Se,V-qe,V+rr,1,me.minY,me.maxY,H),ge=Ki(Be,Se,V+Et,V+Pt,1,me.minY,me.maxY,H),Be=null),yt&&(Ne=Ki(yt,Se,V-qe,V+rr,1,me.minY,me.maxY,H),ze=Ki(yt,Se,V+Et,V+Pt,1,me.minY,me.maxY,H),yt=null),se>1&&console.timeEnd("clipping"),L.push(Ze||[],P+1,2*B,2*V),L.push(ge||[],P+1,2*B,2*V+1),L.push(Ne||[],P+1,2*B+1,2*V),L.push(ze||[],P+1,2*B+1,2*V+1)}}},_t.prototype.getTile=function(T,P,B){var V=this.options,Z=V.extent,re=V.debug;if(T<0||T>24)return null;var ie=1<<T,L=fi(T,P=(P%ie+ie)%ie,B);if(this.tiles[L])return fe(this.tiles[L],Z);re>1&&console.log("drilling down to z%d-%d-%d",T,P,B);for(var H,se=T,Se=P,Ee=B;!H&&se>0;)se--,Se=Math.floor(Se/2),Ee=Math.floor(Ee/2),H=this.tiles[fi(se,Se,Ee)];return H&&H.source?(re>1&&console.log("found parent tile z%d-%d-%d",se,Se,Ee),re>1&&console.time("drilling down"),this.splitTile(H.source,se,Se,Ee,T,P,B),re>1&&console.timeEnd("drilling down"),this.tiles[L]?fe(this.tiles[L],Z):null):null};var ii=(function(T){function P(B,V,Z,re){T.call(this,B,V,Z,qi),re&&(this.loadGeoJSON=re)}return T&&(P.__proto__=T),(P.prototype=Object.create(T&&T.prototype)).constructor=P,P.prototype.loadData=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=V,this._pendingLoadDataParams=B,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},P.prototype._loadData=function(){var B=this;if(this._pendingCallback&&this._pendingLoadDataParams){var V=this._pendingCallback,Z=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var re=!!(Z&&Z.request&&Z.request.collectResourceTiming)&&new u.RequestPerformance(Z.request);this.loadGeoJSON(Z,(function(ie,L){if(ie||!L)return V(ie);if(typeof L!="object")return V(new Error("Input data given to '"+Z.source+"' is not a valid GeoJSON object."));(function me(Ae,Je){var Ze,ge=Ae&&Ae.type;if(ge==="FeatureCollection")for(Ze=0;Ze<Ae.features.length;Ze++)me(Ae.features[Ze],Je);else if(ge==="GeometryCollection")for(Ze=0;Ze<Ae.geometries.length;Ze++)me(Ae.geometries[Ze],Je);else if(ge==="Feature")me(Ae.geometry,Je);else if(ge==="Polygon")Ve(Ae.coordinates,Je);else if(ge==="MultiPolygon")for(Ze=0;Ze<Ae.coordinates.length;Ze++)Ve(Ae.coordinates[Ze],Je);return Ae})(L,!0);try{if(Z.filter){var H=u.createExpression(Z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(H.result==="error")throw new Error(H.value.map((function(me){return me.key+": "+me.message})).join(", "));var se=L.features.filter((function(me){return H.value.evaluate({zoom:0},me)}));L={type:"FeatureCollection",features:se}}B._geoJSONIndex=Z.cluster?new Or((function(me){var Ae=me.superclusterOptions,Je=me.clusterProperties;if(!Je||!Ae)return Ae;for(var Ze={},ge={},Ne={accumulated:null,zoom:0},ze={properties:null},Be=Object.keys(Je),yt=0,qe=Be;yt<qe.length;yt+=1){var Et=qe[yt],rr=Je[Et],Pt=rr[0],Gt=u.createExpression(rr[1]),Dt=u.createExpression(typeof Pt=="string"?[Pt,["accumulated"],["get",Et]]:Pt);Ze[Et]=Gt.value,ge[Et]=Dt.value}return Ae.map=function(wi){ze.properties=wi;for(var Ht={},Pr=0,Qt=Be;Pr<Qt.length;Pr+=1){var Bt=Qt[Pr];Ht[Bt]=Ze[Bt].evaluate(Ne,ze)}return Ht},Ae.reduce=function(wi,Ht){ze.properties=Ht;for(var Pr=0,Qt=Be;Pr<Qt.length;Pr+=1){var Bt=Qt[Pr];Ne.accumulated=wi[Bt],wi[Bt]=ge[Bt].evaluate(Ne,ze)}},Ae})(Z)).load(L.features):(function(me,Ae){return new _t(me,Ae)})(L,Z.geojsonVtOptions)}catch(me){return V(me)}B.loaded={};var Se={};if(re){var Ee=re.finish();Ee&&(Se.resourceTiming={},Se.resourceTiming[Z.source]=JSON.parse(JSON.stringify(Ee)))}V(null,Se)}))}},P.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},P.prototype.reloadTile=function(B,V){var Z=this.loaded;return Z&&Z[B.uid]?T.prototype.reloadTile.call(this,B,V):this.loadTile(B,V)},P.prototype.loadGeoJSON=function(B,V){if(B.request)u.getJSON(B.request,V);else{if(typeof B.data!="string")return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."));try{return V(null,JSON.parse(B.data))}catch{return V(new Error("Input data given to '"+B.source+"' is not a valid GeoJSON object."))}}},P.prototype.removeSource=function(B,V){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),V()},P.prototype.getClusterExpansionZoom=function(B,V){try{V(null,this._geoJSONIndex.getClusterExpansionZoom(B.clusterId))}catch(Z){V(Z)}},P.prototype.getClusterChildren=function(B,V){try{V(null,this._geoJSONIndex.getChildren(B.clusterId))}catch(Z){V(Z)}},P.prototype.getClusterLeaves=function(B,V){try{V(null,this._geoJSONIndex.getLeaves(B.clusterId,B.limit,B.offset))}catch(Z){V(Z)}},P})(be),Yt=function(T){var P=this;this.self=T,this.actor=new u.Actor(T,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:be,geojson:ii},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(B,V){if(P.workerSourceTypes[B])throw new Error('Worker source with name "'+B+'" already registered.');P.workerSourceTypes[B]=V},this.self.registerRTLTextPlugin=function(B){if(u.plugin.isParsed())throw new Error("RTL text plugin already registered.");u.plugin.applyArabicShaping=B.applyArabicShaping,u.plugin.processBidirectionalText=B.processBidirectionalText,u.plugin.processStyledBidirectionalText=B.processStyledBidirectionalText}};return Yt.prototype.setReferrer=function(T,P){this.referrer=P},Yt.prototype.setImages=function(T,P,B){for(var V in this.availableImages[T]=P,this.workerSources[T]){var Z=this.workerSources[T][V];for(var re in Z)Z[re].availableImages=P}B()},Yt.prototype.setLayers=function(T,P,B){this.getLayerIndex(T).replace(P),B()},Yt.prototype.updateLayers=function(T,P,B){this.getLayerIndex(T).update(P.layers,P.removedIds),B()},Yt.prototype.loadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).loadTile(P,B)},Yt.prototype.loadDEMTile=function(T,P,B){this.getDEMWorkerSource(T,P.source).loadTile(P,B)},Yt.prototype.reloadTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).reloadTile(P,B)},Yt.prototype.abortTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).abortTile(P,B)},Yt.prototype.removeTile=function(T,P,B){this.getWorkerSource(T,P.type,P.source).removeTile(P,B)},Yt.prototype.removeDEMTile=function(T,P){this.getDEMWorkerSource(T,P.source).removeTile(P)},Yt.prototype.removeSource=function(T,P,B){if(this.workerSources[T]&&this.workerSources[T][P.type]&&this.workerSources[T][P.type][P.source]){var V=this.workerSources[T][P.type][P.source];delete this.workerSources[T][P.type][P.source],V.removeSource!==void 0?V.removeSource(P,B):B()}},Yt.prototype.loadWorkerSource=function(T,P,B){try{this.self.importScripts(P.url),B()}catch(V){B(V.toString())}},Yt.prototype.syncRTLPluginState=function(T,P,B){try{u.plugin.setState(P);var V=u.plugin.getPluginURL();if(u.plugin.isLoaded()&&!u.plugin.isParsed()&&V!=null){this.self.importScripts(V);var Z=u.plugin.isParsed();B(Z?void 0:new Error("RTL Text Plugin failed to import scripts from "+V),Z)}}catch(re){B(re.toString())}},Yt.prototype.getAvailableImages=function(T){var P=this.availableImages[T];return P||(P=[]),P},Yt.prototype.getLayerIndex=function(T){var P=this.layerIndexes[T];return P||(P=this.layerIndexes[T]=new J),P},Yt.prototype.getWorkerSource=function(T,P,B){var V=this;return this.workerSources[T]||(this.workerSources[T]={}),this.workerSources[T][P]||(this.workerSources[T][P]={}),this.workerSources[T][P][B]||(this.workerSources[T][P][B]=new this.workerSourceTypes[P]({send:function(Z,re,ie){V.actor.send(Z,re,ie,T)}},this.getLayerIndex(T),this.getAvailableImages(T))),this.workerSources[T][P][B]},Yt.prototype.getDEMWorkerSource=function(T,P){return this.demWorkerSources[T]||(this.demWorkerSources[T]={}),this.demWorkerSources[T][P]||(this.demWorkerSources[T][P]=new Oe),this.demWorkerSources[T][P]},Yt.prototype.enforceCacheSizeLimit=function(T,P){u.enforceCacheSizeLimit(P)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Yt(self)),Yt})),R(["./shared"],(function(u){var U=u.createCommonjsModule((function(i){function o(p){return!n(p)}function n(p){return typeof window>"u"||typeof document>"u"?"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 d,v,w=new Blob([""],{type:"text/javascript"}),A=URL.createObjectURL(w);try{v=new Worker(A),d=!0}catch{d=!1}return v&&v.terminate(),URL.revokeObjectURL(A),d})()?"Uint8ClampedArray"in window?ArrayBuffer.isView?(function(){var d=document.createElement("canvas");d.width=d.height=1;var v=d.getContext("2d");if(!v)return!1;var w=v.getImageData(0,0,1,1);return w&&w.width===d.width})()?(s[f=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[f]=(function(d){var v=(function(A){var D=document.createElement("canvas"),F=Object.create(o.webGLContextAttributes);return F.failIfMajorPerformanceCaveat=A,D.probablySupportsContext?D.probablySupportsContext("webgl",F)||D.probablySupportsContext("experimental-webgl",F):D.supportsContext?D.supportsContext("webgl",F)||D.supportsContext("experimental-webgl",F):D.getContext("webgl",F)||D.getContext("experimental-webgl",F)})(d);if(!v)return!1;var w=v.createShader(v.VERTEX_SHADER);return!(!w||v.isContextLost())&&(v.shaderSource(w,"void main() {}"),v.compileShader(w),v.getShaderParameter(w,v.COMPILE_STATUS)===!0)})(f)),s[f]?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 f}i.exports?i.exports=o:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=o,window.mapboxgl.notSupportedReason=n);var s={};o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),k={create:function(i,o,n){var s=u.window.document.createElement(i);return o!==void 0&&(s.className=o),n&&n.appendChild(s),s},createNS:function(i,o){return u.window.document.createElementNS(i,o)}},J=u.window.document&&u.window.document.documentElement.style;function X(i){if(!J)return i[0];for(var o=0;o<i.length;o++)if(i[o]in J)return i[o];return i[0]}var ae,Y=X(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);k.disableDrag=function(){J&&Y&&(ae=J[Y],J[Y]="none")},k.enableDrag=function(){J&&Y&&(J[Y]=ae)};var Te=X(["transform","WebkitTransform"]);k.setTransform=function(i,o){i.style[Te]=o};var be=!1;try{var ke=Object.defineProperty({},"passive",{get:function(){be=!0}});u.window.addEventListener("test",ke,ke),u.window.removeEventListener("test",ke,ke)}catch{be=!1}k.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&be?s:s.capture)},k.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&be?s:s.capture)};var Oe=function(i){i.preventDefault(),i.stopPropagation(),u.window.removeEventListener("click",Oe,!0)};function Ve(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}k.suppressClick=function(){u.window.addEventListener("click",Oe,!0),u.window.setTimeout((function(){u.window.removeEventListener("click",Oe,!0)}),0)},k.mousePos=function(i,o){var n=i.getBoundingClientRect();return new u.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},k.touchPos=function(i,o){for(var n=i.getBoundingClientRect(),s=[],p=0;p<o.length;p++)s.push(new u.Point(o[p].clientX-n.left-i.clientLeft,o[p].clientY-n.top-i.clientTop));return s},k.mouseButton=function(i){return u.window.InstallTrigger!==void 0&&i.button===2&&i.ctrlKey&&u.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:i.button},k.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var Re=(function(i){function o(){i.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.RGBAImage({width:1,height:1}),this.dirty=!0}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.isLoaded=function(){return this.loaded},o.prototype.setLoaded=function(n){if(this.loaded!==n&&(this.loaded=n,n)){for(var s=0,p=this.requestors;s<p.length;s+=1){var f=p[s];this._notify(f.ids,f.callback)}this.requestors=[]}},o.prototype.getImage=function(n){return this.images[n]},o.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},o.prototype._validate=function(n,s){var p=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchX" value'))),p=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchY" value'))),p=!1),this._validateContent(s.content,s)||(this.fire(new u.ErrorEvent(new Error('Image "'+n+'" has invalid "content" value'))),p=!1),p},o.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,f=0,d=n;f<d.length;f+=1){var v=d[f];if(v[0]<p||v[1]<v[0]||s<v[1])return!1;p=v[1]}return!0},o.prototype._validateContent=function(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))},o.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},o.prototype.removeImage=function(n){var s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()},o.prototype.listImages=function(){return Object.keys(this.images)},o.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var f=0,d=n;f<d.length;f+=1)this.images[d[f]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},o.prototype._notify=function(n,s){for(var p={},f=0,d=n;f<d.length;f+=1){var v=d[f];this.images[v]||this.fire(new u.Event("styleimagemissing",{id:v}));var w=this.images[v];w?p[v]={data:w.data.clone(),pixelRatio:w.pixelRatio,sdf:w.sdf,version:w.version,stretchX:w.stretchX,stretchY:w.stretchY,content:w.content,hasRenderCallback:!!(w.userImage&&w.userImage.render)}:u.warnOnce('Image "'+v+'" 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.')}s(null,p)},o.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},o.prototype.getPattern=function(n){var s=this.patterns[n],p=this.getImage(n);if(!p)return null;if(s&&s.position.version===p.version)return s.position;if(s)s.position.version=p.version;else{var f={w:p.data.width+2,h:p.data.height+2,x:0,y:0},d=new u.ImagePosition(f,p);this.patterns[n]={bin:f,position:d}}return this._updatePatternAtlas(),this.patterns[n].position},o.prototype.bind=function(n){var s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)},o.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=u.potpack(n),f=p.w,d=p.h,v=this.atlasImage;for(var w in v.resize({width:f||1,height:d||1}),this.patterns){var A=this.patterns[w].bin,D=A.x+1,F=A.y+1,O=this.images[w].data,W=O.width,$=O.height;u.RGBAImage.copy(O,v,{x:0,y:0},{x:D,y:F},{width:W,height:$}),u.RGBAImage.copy(O,v,{x:0,y:$-1},{x:D,y:F-1},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:D,y:F+$},{width:W,height:1}),u.RGBAImage.copy(O,v,{x:W-1,y:0},{x:D-1,y:F},{width:1,height:$}),u.RGBAImage.copy(O,v,{x:0,y:0},{x:D+W,y:F},{width:1,height:$})}this.dirty=!0},o.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},o.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var f=p[s];if(!this.callbackDispatchedThisFrame[f]){this.callbackDispatchedThisFrame[f]=!0;var d=this.images[f];Ve(d)&&this.updateImage(f,d)}}},o})(u.Evented),ve=It,Ke=It,We=1e20;function It(i,o,n,s,p,f){this.fontSize=i||24,this.buffer=o===void 0?3:o,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=f||"normal",this.radius=n||8;var d=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=d,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(d*d),this.gridInner=new Float64Array(d*d),this.f=new Float64Array(d),this.d=new Float64Array(d),this.z=new Float64Array(d+1),this.v=new Int16Array(d),this.middle=Math.round(d/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function we(i,o,n,s,p,f,d){for(var v=0;v<o;v++){for(var w=0;w<n;w++)s[w]=i[w*o+v];for(Ge(s,p,f,d,n),w=0;w<n;w++)i[w*o+v]=p[w]}for(w=0;w<n;w++){for(v=0;v<o;v++)s[v]=i[w*o+v];for(Ge(s,p,f,d,o),v=0;v<o;v++)i[w*o+v]=Math.sqrt(p[v])}}function Ge(i,o,n,s,p){n[0]=0,s[0]=-We,s[1]=+We;for(var f=1,d=0;f<p;f++){for(var v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);v<=s[d];)d--,v=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);n[++d]=f,s[d]=v,s[d+1]=+We}for(f=0,d=0;f<p;f++){for(;s[d+1]<f;)d++;o[f]=(f-n[d])*(f-n[d])+i[n[d]]}}It.prototype.draw=function(i){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(i,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),s=0;s<this.size*this.size;s++){var p=o.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?We:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?We:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(we(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),we(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),s=0;s<this.size*this.size;s++)n[s]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[s]-this.gridInner[s])/this.radius+this.cutoff))));return n},ve.default=Ke;var Fe=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};Fe.prototype.setURL=function(i){this.url=i},Fe.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var f=0,d=i[p];f<d.length;f+=1)s.push({stack:p,id:d[f]});u.asyncAll(s,(function(v,w){var A=v.stack,D=v.id,F=n.entries[A];F||(F=n.entries[A]={glyphs:{},requests:{},ranges:{}});var O=F.glyphs[D];if(O===void 0){if(O=n._tinySDF(F,A,D))return F.glyphs[D]=O,void w(null,{stack:A,id:D,glyph:O});var W=Math.floor(D/256);if(256*W>65535)w(new Error("glyphs > 65535 not supported"));else if(F.ranges[W])w(null,{stack:A,id:D,glyph:O});else{var $=F.requests[W];$||($=F.requests[W]=[],Fe.loadGlyphRange(A,W,n.url,n.requestManager,(function(ee,N){if(N){for(var Q in N)n._doesCharSupportLocalGlyph(+Q)||(F.glyphs[+Q]=N[+Q]);F.ranges[W]=!0}for(var ne=0,ue=$;ne<ue.length;ne+=1)(0,ue[ne])(ee,N);delete F.requests[W]}))),$.push((function(ee,N){ee?w(ee):N&&w(null,{stack:A,id:D,glyph:N[D]||null})}))}}else w(null,{stack:A,id:D,glyph:O})}),(function(v,w){if(v)o(v);else if(w){for(var A={},D=0,F=w;D<F.length;D+=1){var O=F[D],W=O.stack,$=O.id,ee=O.glyph;(A[W]||(A[W]={}))[$]=ee&&{id:ee.id,bitmap:ee.bitmap.clone(),metrics:ee.metrics}}o(null,A)}}))},Fe.prototype._doesCharSupportLocalGlyph=function(i){return!!this.localIdeographFontFamily&&(u.isChar["CJK Unified Ideographs"](i)||u.isChar["Hangul Syllables"](i)||u.isChar.Hiragana(i)||u.isChar.Katakana(i))},Fe.prototype._tinySDF=function(i,o,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var f="400";/bold/i.test(o)?f="900":/medium/i.test(o)?f="500":/light/i.test(o)&&(f="200"),p=i.tinySDF=new Fe.TinySDF(24,3,8,.25,s,f)}return{id:n,bitmap:new u.AlphaImage({width:30,height:30},p.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},Fe.loadGlyphRange=function(i,o,n,s,p){var f=256*o,d=f+255,v=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",f+"-"+d),u.ResourceType.Glyphs);u.getArrayBuffer(v,(function(w,A){if(w)p(w);else if(A){for(var D={},F=0,O=u.parseGlyphPBF(A);F<O.length;F+=1){var W=O[F];D[W.id]=W}p(null,D)}}))},Fe.TinySDF=ve;var tt=function(){this.specification=u.styleSpec.light.position};tt.prototype.possiblyEvaluate=function(i,o){return u.sphericalToCartesian(i.expression.evaluate(o))},tt.prototype.interpolate=function(i,o,n){return{x:u.number(i.x,o.x,n),y:u.number(i.y,o.y,n),z:u.number(i.z,o.z,n)}};var kt=new u.Properties({anchor:new u.DataConstantProperty(u.styleSpec.light.anchor),position:new tt,color:new u.DataConstantProperty(u.styleSpec.light.color),intensity:new u.DataConstantProperty(u.styleSpec.light.intensity)}),Wt=(function(i){function o(n){i.call(this),this._transitionable=new u.Transitionable(kt),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getLight=function(){return this._transitionable.serialize()},o.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(u.validateLight,n,s))for(var p in n){var f=n[p];u.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),f):this._transitionable.setValue(p,f)}},o.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},o.prototype.hasTransition=function(){return this._transitioning.hasTransition()},o.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},o.prototype._validate=function(n,s,p){return(!p||p.validate!==!1)&&u.emitValidationErrors(this,n.call(u.validateStyle,u.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:u.styleSpec})))},o})(u.Evented),St=function(i,o){this.width=i,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};St.prototype.getDash=function(i,o){var n=i.join(",")+String(o);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,o)),this.dashEntry[n]},St.prototype.getDashRanges=function(i,o,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,f=i[0]*n,d=!0;s.push({left:p,right:f,isDash:d,zeroLength:i[0]===0});for(var v=i[0],w=1;w<i.length;w++){var A=i[w];s.push({left:p=v*n,right:f=(v+=A)*n,isDash:d=!d,zeroLength:A===0})}return s},St.prototype.addRoundDash=function(i,o,n){for(var s=o/2,p=-n;p<=n;p++)for(var f=this.width*(this.nextRow+n+p),d=0,v=i[d],w=0;w<this.width;w++){w/v.right>1&&(v=i[++d]);var A=Math.abs(w-v.left),D=Math.abs(w-v.right),F=Math.min(A,D),O=void 0,W=p/n*(s+1);if(v.isDash){var $=s-Math.abs(W);O=Math.sqrt(F*F+$*$)}else O=s-Math.sqrt(F*F+W*W);this.data[f+w]=Math.max(0,Math.min(255,O+128))}},St.prototype.addRegularDash=function(i){for(var o=i.length-1;o>=0;--o){var n=i[o],s=i[o+1];n.zeroLength?i.splice(o,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(o,1))}var p=i[0],f=i[i.length-1];p.isDash===f.isDash&&(p.left=f.left-this.width,f.right=p.right+this.width);for(var d=this.width*this.nextRow,v=0,w=i[v],A=0;A<this.width;A++){A/w.right>1&&(w=i[++v]);var D=Math.abs(A-w.left),F=Math.abs(A-w.right),O=Math.min(D,F);this.data[d+A]=Math.max(0,Math.min(255,(w.isDash?O:-O)+128))}},St.prototype.addDash=function(i,o){var n=o?7:0,s=2*n+1;if(this.nextRow+s>this.height)return u.warnOnce("LineAtlas out of space"),null;for(var p=0,f=0;f<i.length;f++)p+=i[f];if(p!==0){var d=this.width/p,v=this.getDashRanges(i,this.width,d);o?this.addRoundDash(v,d,n):this.addRegularDash(v)}var w={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,w},St.prototype.bind=function(i){var o=i.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))};var Ut=function i(o,n){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=u.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var f=new i.Actor(s[p],n,this.id);f.name="Worker "+p,this.actors.push(f)}};function Hr(i,o,n){var s=function(p,f){if(p)return n(p);if(f){var d=u.pick(u.extend(f,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);f.vector_layers&&(d.vectorLayers=f.vector_layers,d.vectorLayerIds=d.vectorLayers.map((function(v){return v.id}))),d.tiles=o.canonicalizeTileset(d,i.url),n(null,d)}};return i.url?u.getJSON(o.transformRequest(o.normalizeSourceURL(i.url),u.ResourceType.Source),s):u.browser.frame((function(){return s(null,i)}))}Ut.prototype.broadcast=function(i,o,n){u.asyncAll(this.actors,(function(s,p){s.send(i,o,p)}),n=n||function(){})},Ut.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Ut.prototype.remove=function(){this.actors.forEach((function(i){i.remove()})),this.actors=[],this.workerPool.release(this.id)},Ut.Actor=u.Actor;var Er=function(i,o,n){this.bounds=u.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=o||0,this.maxzoom=n||24};Er.prototype.validateBounds=function(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]},Er.prototype.contains=function(i){var o=Math.pow(2,i.z),n=Math.floor(u.mercatorXfromLng(this.bounds.getWest())*o),s=Math.floor(u.mercatorYfromLat(this.bounds.getNorth())*o),p=Math.ceil(u.mercatorXfromLng(this.bounds.getEast())*o),f=Math.ceil(u.mercatorYfromLat(this.bounds.getSouth())*o);return i.x>=n&&i.x<p&&i.y>=s&&i.y<f};var bi=(function(i){function o(n,s,p,f){if(i.call(this),this.id=n,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.extend(this,u.pick(s,["url","scheme","tileSize","promoteId"])),this._options=u.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Er(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles,n.map._requestManager._customAccessToken),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken,n.map._requestManager._customAccessToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},o.prototype.setTiles=function(n){var s=this;return this.setSourceProperty((function(){s._options.tiles=n})),this},o.prototype.setUrl=function(n){var s=this;return this.setSourceProperty((function(){s.url=n,s._options.url=n})),this},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),f={request:this.map._requestManager.transformRequest(p,u.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(v,w){return delete n.request,n.aborted?s(null):v&&v.status!==404?s(v):(w&&w.resourceTiming&&(n.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&n.setExpiryData(w),n.loadVectorData(w,this.map.painter),u.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}f.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",f,d.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",f,d.bind(this)))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.hasTransition=function(){return!1},o})(u.Evented),or=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(f),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.extend({type:"raster"},s),u.extend(this,u.pick(s,["url","scheme","tileSize"]))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Hr(this._options,this.map._requestManager,(function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new u.ErrorEvent(s)):p&&(u.extend(n,p),p.bounds&&(n.tileBounds=new Er(p.bounds,n.minzoom,n.maxzoom)),u.postTurnstileEvent(p.tiles),u.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return u.extend({},this._options)},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.loadTile=function(n,s){var p=this,f=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=u.getImage(this.map._requestManager.transformRequest(f,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){p.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=p.map.painter.context,A=w.gl;n.texture=p.map.painter.getTileTexture(v.width),n.texture?n.texture.update(v,{useMipmap:!0}):(n.texture=new u.Texture(w,v,A.RGBA,{useMipmap:!0}),n.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.extTextureFilterAnisotropicMax)),n.state="loaded",u.cacheEntryPossiblyAdded(p.dispatcher),s(null)}}))},o.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},o.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Rr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.type="raster-dem",this.maxzoom=22,this._options=u.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function f(d,v){d&&(n.state="errored",s(d)),v&&(n.dem=v,n.needsHillshadePrepare=!0,n.state="loaded",s(null))}n.request=u.getImage(this.map._requestManager.transformRequest(p,u.ResourceType.Tile),(function(d,v){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(v){this.map._refreshExpiredTiles&&n.setExpiryData(v),delete v.cacheControl,delete v.expires;var w=u.window.ImageBitmap&&v instanceof u.window.ImageBitmap&&u.offscreenCanvasSupported()?v:u.browser.getImageData(v,1),A={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:w,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",A,f.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},o.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),f=(s.x-1+p)%p,d=s.x===0?n.wrap-1:n.wrap,v=(s.x+1+p)%p,w=s.x+1===p?n.wrap+1:n.wrap,A={};return A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y).key]={backfilled:!1},s.y>0&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y-1).key]={backfilled:!1}),s.y+1<p&&(A[new u.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},A[new u.OverscaledTileID(n.overscaledZ,w,s.z,v,s.y+1).key]={backfilled:!1}),A},o.prototype.unloadTile=function(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})},o})(or),et=(function(i){function o(n,s,p,f){i.call(this),this.id=n,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=p.getActor(),this.setEventedParent(f),this._data=s.data,this._options=u.extend({},s),this._collectResourceTiming=s.collectResourceTiming,this._resourceTiming=[],s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;var d=u.EXTENT/this.tileSize;this.workerOptions=u.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*d,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*d,extent:u.EXTENT,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?Math.min(s.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:u.EXTENT,radius:(s.clusterRadius||50)*d,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(s){if(s)n.fire(new u.ErrorEvent(s));else{var p={dataType:"source",sourceDataType:"metadata"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(p.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new u.Event("data",p))}}))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setData=function(n){var s=this;return this._data=n,this.fire(new u.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(p){if(p)s.fire(new u.ErrorEvent(p));else{var f={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(f.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new u.Event("data",f))}})),this},o.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},o.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},o.prototype.getClusterLeaves=function(n,s,p,f){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},f),this},o.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=u.extend({},this.workerOptions),f=this._data;typeof f=="string"?(p.request=this.map._requestManager.transformRequest(u.browser.resolveURL(f),u.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(f),this.actor.send(this.type+".loadData",p,(function(d,v){s._removed||v&&v.abandoned||(s._loaded=!0,v&&v.resourceTiming&&v.resourceTiming[s.id]&&(s._resourceTiming=v.resourceTiming[s.id].slice(0)),s.actor.send(s.type+".coalesce",{source:p.source},null),n(d))}))},o.prototype.loaded=function(){return this._loaded},o.prototype.loadTile=function(n,s){var p=this,f=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(f,{type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:u.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(d,v){return delete n.request,n.unloadVectorData(),n.aborted?s(null):d?s(d):(n.loadVectorData(v,p.map.painter,f==="reloadTile"),s(null))}))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},o.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},o.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},o.prototype.serialize=function(){return u.extend({},this._options,{type:this.type,data:this._data})},o.prototype.hasTransition=function(){return!1},o})(u.Evented),Lr=u.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Xr=(function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(f),this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(n,s){var p=this;this._loaded=!1,this.fire(new u.Event("dataloading",{dataType:"source"})),this.url=this.options.url,u.getImage(this.map._requestManager.transformRequest(this.url,u.ResourceType.Image),(function(f,d){p._loaded=!0,f?p.fire(new u.ErrorEvent(f)):d&&(p.image=d,n&&(p.coordinates=n),s&&s(),p._finishLoading())}))},o.prototype.loaded=function(){return this._loaded},o.prototype.updateImage=function(n){var s=this;return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,(function(){s.texture=null})),this):this},o.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"metadata"})))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setCoordinates=function(n){var s=this;this.coordinates=n;var p=n.map(u.MercatorCoordinate.fromLngLat);this.tileID=(function(d){for(var v=1/0,w=1/0,A=-1/0,D=-1/0,F=0,O=d;F<O.length;F+=1){var W=O[F];v=Math.min(v,W.x),w=Math.min(w,W.y),A=Math.max(A,W.x),D=Math.max(D,W.y)}var $=Math.max(A-v,D-w),ee=Math.max(0,Math.floor(-Math.log($)/Math.LN2)),N=Math.pow(2,ee);return new u.CanonicalTileID(ee,Math.floor((v+A)/2*N),Math.floor((w+D)/2*N))})(p),this.minzoom=this.maxzoom=this.tileID.z;var f=p.map((function(d){return s.tileID.getTilePoint(d)._round()}));return this._boundsArray=new u.StructArrayLayout4i8,this._boundsArray.emplaceBack(f[0].x,f[0].y,0,0),this._boundsArray.emplaceBack(f[1].x,f[1].y,u.EXTENT,0),this._boundsArray.emplaceBack(f[3].x,f[3].y,0,u.EXTENT),this._boundsArray.emplaceBack(f[2].x,f[2].y,u.EXTENT,u.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new u.Event("data",{dataType:"source",sourceDataType:"content"})),this},o.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.loadTile=function(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))},o.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return!1},o})(u.Evented),At=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.roundZoom=!0,this.type="video",this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,f=s.urls;p<f.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(f[p],u.ResourceType.Source).url);u.getVideo(this.urls,(function(d,v){n._loaded=!0,d?n.fire(new u.ErrorEvent(d)):v&&(n.video=v,n.video.loop=!0,n.video.setAttribute("playsinline",""),n.video.addEventListener("playing",(function(){n.map.triggerRepaint()})),n.map&&n.video.play(),n._finishLoading())}))},o.prototype.pause=function(){this.video&&this.video.pause()},o.prototype.play=function(){this.video&&this.video.play()},o.prototype.seek=function(n){if(this.video){var s=this.video.seekable;n<s.start(0)||n>s.end(0)?this.fire(new u.ErrorEvent(new u.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+s.start(0)+" and "+s.end(0)+"-second mark."))):this.video.currentTime=n}},o.prototype.getVideo=function(){return this.video},o.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},o.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new u.Texture(n,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this.video&&!this.video.paused},o})(Xr),Fr=(function(i){function o(n,s,p,f){i.call(this,n,s,p,f),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some((function(d){return!Array.isArray(d)||d.length!==2||d.some((function(v){return typeof v!="number"}))}))||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof u.window.HTMLCanvasElement||this.fire(new u.ErrorEvent(new u.ValidationError("sources."+n,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 u.ErrorEvent(new u.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof u.window.HTMLCanvasElement?this.options.canvas:u.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new u.ErrorEvent(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())},o.prototype.getCanvas=function(){return this.canvas},o.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},o.prototype.onRemove=function(){this.pause()},o.prototype.prepare=function(){var n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var s=this.map.painter.context,p=s.gl;for(var f in this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Lr.members)),this.boundsSegments||(this.boundsSegments=u.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u.Texture(s,this.canvas,p.RGBA,{premultiply:!0}),this.tiles){var d=this.tiles[f];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this._playing},o.prototype._hasInvalidDimensions=function(){for(var n=0,s=[this.canvas.width,this.canvas.height];n<s.length;n+=1){var p=s[n];if(isNaN(p)||p<=0)return!0}return!1},o})(Xr),Mi={vector:bi,raster:or,"raster-dem":Rr,geojson:et,video:At,image:Xr,canvas:Fr};function pi(i,o){var n=u.identity([]);return u.translate(n,n,[1,1,0]),u.scale(n,n,[.5*i.width,.5*i.height,1]),u.multiply(n,n,i.calculatePosMatrix(o.toUnwrapped()))}function Or(i,o,n,s,p,f){var d=(function(ee,N,Q){if(ee)for(var ne=0,ue=ee;ne<ue.length;ne+=1){var de=N[ue[ne]];if(de&&de.source===Q&&de.type==="fill-extrusion")return!0}else for(var pe in N){var ye=N[pe];if(ye.source===Q&&ye.type==="fill-extrusion")return!0}return!1})(p&&p.layers,o,i.id),v=f.maxPitchScaleFactor(),w=i.tilesIn(s,v,d);w.sort(Xi);for(var A=[],D=0,F=w;D<F.length;D+=1){var O=F[D];A.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,n,i._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,p,f,v,pi(i.transform,O.tileID))})}var W=(function(ee){for(var N={},Q={},ne=0,ue=ee;ne<ue.length;ne+=1){var de=ue[ne],pe=de.queryResults,ye=de.wrappedTileID,Ie=Q[ye]=Q[ye]||{};for(var Me in pe)for(var Ce=pe[Me],$e=Ie[Me]=Ie[Me]||{},nt=N[Me]=N[Me]||[],ut=0,st=Ce;ut<st.length;ut+=1){var Lt=st[ut];$e[Lt.featureIndex]||($e[Lt.featureIndex]=!0,nt.push(Lt))}}return N})(A);for(var $ in W)W[$].forEach((function(ee){var N=ee.feature,Q=i.getFeatureState(N.layer["source-layer"],N.id);N.source=N.layer.source,N.layer["source-layer"]&&(N.sourceLayer=N.layer["source-layer"]),N.state=Q}));return W}function Xi(i,o){var n=i.tileID,s=o.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}var Nt=function(i,o){this.max=i,this.onRemove=o,this.reset()};Nt.prototype.reset=function(){for(var i in this.data)for(var o=0,n=this.data[i];o<n.length;o+=1){var s=n[o];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Nt.prototype.add=function(i,o,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var f={value:o,timeout:void 0};if(n!==void 0&&(f.timeout=setTimeout((function(){s.remove(i,f)}),n)),this.data[p].push(f),this.order.push(p),this.order.length>this.max){var d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this},Nt.prototype.has=function(i){return i.wrapped().key in this.data},Nt.prototype.getAndRemove=function(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null},Nt.prototype._getAndRemoveByKey=function(i){var o=this.data[i].shift();return o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),o.value},Nt.prototype.getByKey=function(i){var o=this.data[i];return o?o[0].value:null},Nt.prototype.get=function(i){return this.has(i)?this.data[i.wrapped().key][0].value:null},Nt.prototype.remove=function(i,o){if(!this.has(i))return this;var n=i.wrapped().key,s=o===void 0?0:this.data[n].indexOf(o),p=this.data[n][s];return this.data[n].splice(s,1),p.timeout&&clearTimeout(p.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(p.value),this.order.splice(this.order.indexOf(n),1),this},Nt.prototype.setMaxSize=function(i){for(this.max=i;this.order.length>this.max;){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Nt.prototype.filter=function(i){var o=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var f=p[s];i(f.value)||o.push(f)}for(var d=0,v=o;d<v.length;d+=1){var w=v[d];this.remove(w.value.tileID,w)}};var Nr=function(i,o,n){this.context=i;var s=i.gl;this.buffer=s.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Nr.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Nr.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Nr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var ar={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},sr=function(i,o,n,s){this.length=o.length,this.attributes=n,this.itemSize=o.bytesPerElement,this.dynamicDraw=s,this.context=i;var p=i.gl;this.buffer=p.createBuffer(),i.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};sr.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},sr.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},sr.prototype.enableAttributes=function(i,o){for(var n=0;n<this.attributes.length;n++){var s=o.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},sr.prototype.setVertexAttribPointers=function(i,o,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],f=o.attributes[p.name];f!==void 0&&i.vertexAttribPointer(f,p.components,i[ar[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},sr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var lt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};lt.prototype.get=function(){return this.current},lt.prototype.set=function(i){},lt.prototype.getDefault=function(){return this.default},lt.prototype.setDefault=function(){this.set(this.default)};var mr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),pr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 1},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},o})(lt),jr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},o})(lt),hr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[!0,!0,!0,!0]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),br=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},o})(lt),dn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 255},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},o})(lt),Kr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},o.prototype.set=function(n){var s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)},o})(lt),Bi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)},o})(lt),hi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}},o})(lt),ti=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[0,1]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),ri=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}},o})(lt),Vi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.LESS},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},o})(lt),Ki=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}},o})(lt),yo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)},o})(lt),Zo=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return u.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o})(lt),mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.FUNC_ADD},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},o})(lt),Mn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}},o})(lt),Bn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.BACK},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},o})(lt),$o=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.CCW},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},o})(lt),jn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},o})(lt),zn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.TEXTURE0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},o})(lt),rn=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o})(lt),fe=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),_e=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(lt),jt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}},o})(lt),tr=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}},o})(lt),Kt=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},o})(lt),_t=(function(i){function o(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},o})(lt),fi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 4},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}},o})(lt),qi=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),ii=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}},o})(lt),Yt=(function(i){function o(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o})(lt),T=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.setDirty=function(){this.dirty=!0},o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}},o})(Yt),P=(function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o})(Yt),B=function(i,o,n,s){this.context=i,this.width=o,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new T(i,p),s&&(this.depthAttachment=new P(i,p))};B.prototype.destroy=function(){var i=this.context.gl,o=this.colorAttachment.get();if(o&&i.deleteTexture(o),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var V=function(i,o,n){this.func=i,this.mask=o,this.range=n};V.ReadOnly=!1,V.ReadWrite=!0,V.disabled=new V(519,V.ReadOnly,[0,1]);var Z=function(i,o,n,s,p,f){this.test=i,this.ref=o,this.mask=n,this.fail=s,this.depthFail=p,this.pass=f};Z.disabled=new Z({func:519,mask:0},0,0,7680,7680,7680);var re=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};re.disabled=new re(re.Replace=[1,0],u.Color.transparent,[!1,!1,!1,!1]),re.unblended=new re(re.Replace,u.Color.transparent,[!0,!0,!0,!0]),re.alphaBlended=new re([1,771],u.Color.transparent,[!0,!0,!0,!0]);var ie=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};ie.disabled=new ie(!1,1029,2305),ie.backCCW=new ie(!0,1029,2305);var L=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new mr(this),this.clearDepth=new pr(this),this.clearStencil=new jr(this),this.colorMask=new hr(this),this.depthMask=new br(this),this.stencilMask=new dn(this),this.stencilFunc=new Kr(this),this.stencilOp=new Bi(this),this.stencilTest=new hi(this),this.depthRange=new ti(this),this.depthTest=new ri(this),this.depthFunc=new Vi(this),this.blend=new Ki(this),this.blendFunc=new yo(this),this.blendColor=new Zo(this),this.blendEquation=new mn(this),this.cullFace=new Mn(this),this.cullFaceSide=new Bn(this),this.frontFace=new $o(this),this.program=new jn(this),this.activeTexture=new zn(this),this.viewport=new rn(this),this.bindFramebuffer=new fe(this),this.bindRenderbuffer=new _e(this),this.bindTexture=new jt(this),this.bindVertexBuffer=new tr(this),this.bindElementBuffer=new Kt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new _t(this),this.pixelStoreUnpack=new fi(this),this.pixelStoreUnpackPremultiplyAlpha=new qi(this),this.pixelStoreUnpackFlipY=new ii(this),this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=i.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(i.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)};L.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()},L.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},L.prototype.createIndexBuffer=function(i,o){return new Nr(this,i,o)},L.prototype.createVertexBuffer=function(i,o,n){return new sr(this,i,o,n)},L.prototype.createRenderbuffer=function(i,o,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,o,n),this.bindRenderbuffer.set(null),p},L.prototype.createFramebuffer=function(i,o,n){return new B(this,i,o,n)},L.prototype.clear=function(i){var o=i.color,n=i.depth,s=this.gl,p=0;o&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(o),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s.clear(p)},L.prototype.setCullFace=function(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))},L.prototype.setDepthMode=function(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)},L.prototype.setStencilMode=function(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)},L.prototype.setColorMode=function(i){u.deepEqual(i.blendFunction,re.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)},L.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var H=(function(i){function o(n,s,p){var f=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",(function(d){d.dataType==="source"&&d.sourceDataType==="metadata"&&(f._sourceLoaded=!0),f._sourceLoaded&&!f._paused&&d.dataType==="source"&&d.sourceDataType==="content"&&(f.reload(),f.transform&&f.update(f.transform))})),this.on("error",(function(){f._sourceErrored=!0})),this._source=(function(d,v,w,A){var D=new Mi[v.type](d,v,w,A);if(D.id!==d)throw new Error("Expected Source id to be "+d+" instead of "+D.id);return u.bindAll(["load","abort","unload","serialize","prepare"],D),D})(n,s,p,this),this._tiles={},this._cache=new Nt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new u.SourceFeatureState}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},o.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},o.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var n in this._tiles){var s=this._tiles[n];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0},o.prototype.getSource=function(){return this._source},o.prototype.pause=function(){this._paused=!0},o.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}},o.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},o.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,(function(){}))},o.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,(function(){}))},o.prototype.serialize=function(){return this._source.serialize()},o.prototype.prepare=function(n){for(var s in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var p=this._tiles[s];p.upload(n),p.prepare(this.map.style.imageManager)}},o.prototype.getIds=function(){return u.values(this._tiles).map((function(n){return n.tileID})).sort(se).map((function(n){return n.key}))},o.prototype.getRenderableIds=function(n){var s=this,p=[];for(var f in this._tiles)this._isIdRenderable(f,n)&&p.push(this._tiles[f]);return n?p.sort((function(d,v){var w=d.tileID,A=v.tileID,D=new u.Point(w.canonical.x,w.canonical.y)._rotate(s.transform.angle),F=new u.Point(A.canonical.x,A.canonical.y)._rotate(s.transform.angle);return w.overscaledZ-A.overscaledZ||F.y-D.y||F.x-D.x})).map((function(d){return d.tileID.key})):p.map((function(d){return d.tileID})).sort(se).map((function(d){return d.key}))},o.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},o.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},o.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var n in this._cache.reset(),this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")},o.prototype._reloadTile=function(n,s){var p=this._tiles[n];p&&(p.state!=="loading"&&(p.state=s),this._loadTile(p,this._tileLoaded.bind(this,p,n,s)))},o.prototype._tileLoaded=function(n,s,p,f){if(f)return n.state="errored",void(f.status!==404?this._source.fire(new u.ErrorEvent(f,{tile:n})):this.update(this.transform));n.timeAdded=u.browser.now(),p==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(s,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),this._source.fire(new u.Event("data",{dataType:"source",tile:n,coord:n.tileID}))},o.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var f=s[p];if(n.neighboringTiles&&n.neighboringTiles[f]){var d=this.getTileByID(f);v(n,d),v(d,n)}}function v(w,A){w.needsHillshadePrepare=!0;var D=A.tileID.canonical.x-w.tileID.canonical.x,F=A.tileID.canonical.y-w.tileID.canonical.y,O=Math.pow(2,w.tileID.canonical.z),W=A.tileID.key;D===0&&F===0||Math.abs(F)>1||(Math.abs(D)>1&&(Math.abs(D+O)===1?D+=O:Math.abs(D-O)===1&&(D-=O)),A.dem&&w.dem&&(w.dem.backfillBorder(A.dem,D,F),w.neighboringTiles&&w.neighboringTiles[W]&&(w.neighboringTiles[W].backfilled=!0)))}},o.prototype.getTile=function(n){return this.getTileByID(n.key)},o.prototype.getTileByID=function(n){return this._tiles[n]},o.prototype._retainLoadedChildren=function(n,s,p,f){for(var d in this._tiles){var v=this._tiles[d];if(!(f[d]||!v.hasData()||v.tileID.overscaledZ<=s||v.tileID.overscaledZ>p)){for(var w=v.tileID;v&&v.tileID.overscaledZ>s+1;){var A=v.tileID.scaledTo(v.tileID.overscaledZ-1);(v=this._tiles[A.key])&&v.hasData()&&(w=A)}for(var D=w;D.overscaledZ>s;)if(n[(D=D.scaledTo(D.overscaledZ-1)).key]){f[w.key]=w;break}}}},o.prototype.findLoadedParent=function(n,s){if(n.key in this._loadedParentTiles){var p=this._loadedParentTiles[n.key];return p&&p.tileID.overscaledZ>=s?p:null}for(var f=n.overscaledZ-1;f>=s;f--){var d=n.scaledTo(f),v=this._getLoadedTile(d);if(v)return v}},o.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},o.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,f=Math.floor(s*p*5),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._cache.setMaxSize(d)},o.prototype.handleWrapJump=function(n){var s=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,s){var p={};for(var f in this._tiles){var d=this._tiles[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+s),p[d.tileID.key]=d}for(var v in this._tiles=p,this._timers)clearTimeout(this._timers[v]),delete this._timers[v];for(var w in this._tiles)this._setTileReloadTimer(w,this._tiles[w])}},o.prototype.update=function(n){var s=this;if(this.transform=n,this._sourceLoaded&&!this._paused){var p;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?p=n.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(Ie){return new u.OverscaledTileID(Ie.canonical.z,Ie.wrap,Ie.canonical.z,Ie.canonical.x,Ie.canonical.y)})):(p=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(p=p.filter((function(Ie){return s._source.hasTile(Ie)})))):p=[];var f=n.coveringZoomLevel(this._source),d=Math.max(f-o.maxOverzooming,this._source.minzoom),v=Math.max(f+o.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,f);if(Se(this._source.type)){for(var A={},D={},F=0,O=Object.keys(w);F<O.length;F+=1){var W=O[F],$=w[W],ee=this._tiles[W];if(ee&&!(ee.fadeEndTime&&ee.fadeEndTime<=u.browser.now())){var N=this.findLoadedParent($,d);N&&(this._addTile(N.tileID),A[N.tileID.key]=N.tileID),D[W]=$}}for(var Q in this._retainLoadedChildren(D,f,v,w),A)w[Q]||(this._coveredTiles[Q]=!0,w[Q]=A[Q])}for(var ne in w)this._tiles[ne].clearFadeHold();for(var ue=0,de=u.keysDifference(this._tiles,w);ue<de.length;ue+=1){var pe=de[ue],ye=this._tiles[pe];ye.hasSymbolBuckets&&!ye.holdingForFade()?ye.setHoldDuration(this.map._fadeDuration):ye.hasSymbolBuckets&&!ye.symbolFadeFinished()||this._removeTile(pe)}this._updateLoadedParentTileCache()}},o.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},o.prototype._updateRetainedTiles=function(n,s){for(var p={},f={},d=Math.max(s-o.maxOverzooming,this._source.minzoom),v=Math.max(s+o.maxUnderzooming,this._source.minzoom),w={},A=0,D=n;A<D.length;A+=1){var F=D[A],O=this._addTile(F);p[F.key]=F,O.hasData()||s<this._source.maxzoom&&(w[F.key]=F)}this._retainLoadedChildren(w,s,v,p);for(var W=0,$=n;W<$.length;W+=1){var ee=$[W],N=this._tiles[ee.key];if(!N.hasData()){if(s+1>this._source.maxzoom){var Q=ee.children(this._source.maxzoom)[0],ne=this.getTile(Q);if(ne&&ne.hasData()){p[Q.key]=Q;continue}}else{var ue=ee.children(this._source.maxzoom);if(p[ue[0].key]&&p[ue[1].key]&&p[ue[2].key]&&p[ue[3].key])continue}for(var de=N.wasRequested(),pe=ee.overscaledZ-1;pe>=d;--pe){var ye=ee.scaledTo(pe);if(f[ye.key]||(f[ye.key]=!0,!(N=this.getTile(ye))&&de&&(N=this._addTile(ye)),N&&(p[ye.key]=ye,de=N.wasRequested(),N.hasData())))break}}}return p},o.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,f=this._tiles[n].tileID;f.overscaledZ>0;){if(f.key in this._loadedParentTiles){p=this._loadedParentTiles[f.key];break}s.push(f.key);var d=f.scaledTo(f.overscaledZ-1);if(p=this._getLoadedTile(d))break;f=d}for(var v=0,w=s;v<w.length;v+=1)this._loadedParentTiles[w[v]]=p}},o.prototype._addTile=function(n){var s=this._tiles[n.key];if(s)return s;(s=this._cache.getAndRemove(n))&&(this._setTileReloadTimer(n.key,s),s.tileID=n,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,s)));var p=!!s;return p||(s=new u.Tile(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,n.key,s.state))),s?(s.uses++,this._tiles[n.key]=s,p||this._source.fire(new u.Event("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s):null},o.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var f=s.getExpiryTimeout();f&&(this._timers[n]=setTimeout((function(){p._reloadTile(n,"expired"),delete p._timers[n]}),f))},o.prototype._removeTile=function(n){var s=this._tiles[n];s&&(s.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))},o.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},o.prototype.tilesIn=function(n,s,p){var f=this,d=[],v=this.transform;if(!v)return d;for(var w=p?v.getCameraQueryGeometry(n):n,A=n.map((function(pe){return v.pointCoordinate(pe)})),D=w.map((function(pe){return v.pointCoordinate(pe)})),F=this.getIds(),O=1/0,W=1/0,$=-1/0,ee=-1/0,N=0,Q=D;N<Q.length;N+=1){var ne=Q[N];O=Math.min(O,ne.x),W=Math.min(W,ne.y),$=Math.max($,ne.x),ee=Math.max(ee,ne.y)}for(var ue=function(pe){var ye=f._tiles[F[pe]];if(!ye.holdingForFade()){var Ie=ye.tileID,Me=Math.pow(2,v.zoom-ye.tileID.overscaledZ),Ce=s*ye.queryPadding*u.EXTENT/ye.tileSize/Me,$e=[Ie.getTilePoint(new u.MercatorCoordinate(O,W)),Ie.getTilePoint(new u.MercatorCoordinate($,ee))];if($e[0].x-Ce<u.EXTENT&&$e[0].y-Ce<u.EXTENT&&$e[1].x+Ce>=0&&$e[1].y+Ce>=0){var nt=A.map((function(st){return Ie.getTilePoint(st)})),ut=D.map((function(st){return Ie.getTilePoint(st)}));d.push({tile:ye,tileID:Ie,queryGeometry:nt,cameraQueryGeometry:ut,scale:Me})}}},de=0;de<F.length;de++)ue(de);return d},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map((function(w){return s._tiles[w].tileID})),f=0,d=p;f<d.length;f+=1){var v=d[f];v.posMatrix=this.transform.calculatePosMatrix(v.toUnwrapped())}return p},o.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Se(this._source.type))for(var n in this._tiles){var s=this._tiles[n];if(s.fadeEndTime!==void 0&&s.fadeEndTime>=u.browser.now())return!0}return!1},o.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},o.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},o.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},o.prototype.setDependencies=function(n,s,p){var f=this._tiles[n];f&&f.setDependencies(s,p)},o.prototype.reloadTilesForDependencies=function(n,s){for(var p in this._tiles)this._tiles[p].hasDependency(n,s)&&this._reloadTile(p,"reloading");this._cache.filter((function(f){return!f.hasDependency(n,s)}))},o})(u.Evented);function se(i,o){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*o.wrap)-+(o.wrap<0);return i.overscaledZ-o.overscaledZ||s-n||o.canonical.y-i.canonical.y||o.canonical.x-i.canonical.x}function Se(i){return i==="raster"||i==="image"||i==="video"}function Ee(){return new u.window.Worker(gs.workerUrl)}H.maxOverzooming=10,H.maxUnderzooming=3;var me="mapboxgl_preloaded_worker_pool",Ae=function(){this.active={}};Ae.prototype.acquire=function(i){if(!this.workers)for(this.workers=[];this.workers.length<Ae.workerCount;)this.workers.push(new Ee);return this.active[i]=!0,this.workers.slice()},Ae.prototype.release=function(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach((function(o){o.terminate()})),this.workers=null)},Ae.prototype.isPreloaded=function(){return!!this.active[me]},Ae.prototype.numActive=function(){return Object.keys(this.active).length};var Je,Ze=Math.floor(u.browser.hardwareConcurrency/2);function ge(){return Je||(Je=new Ae),Je}function Ne(i,o){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return u.refProperties.forEach((function(p){p in o&&(n[p]=o[p])})),n}function ze(i){i=i.slice();for(var o=Object.create(null),n=0;n<i.length;n++)o[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=Ne(i[s],o[i[s].ref]));return i}Ae.workerCount=Math.max(Math.min(Ze,6),1);var Be={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 yt(i,o,n){n.push({command:Be.addSource,args:[i,o[i]]})}function qe(i,o,n){o.push({command:Be.removeSource,args:[i]}),n[i]=!0}function Et(i,o,n,s){qe(i,n,s),yt(i,o,n)}function rr(i,o,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;for(s in o[n])if(o[n].hasOwnProperty(s)&&s!=="data"&&!u.deepEqual(i[n][s],o[n][s]))return!1;return!0}function Pt(i,o,n,s,p,f){var d;for(d in o=o||{},i=i||{})i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}));for(d in o)o.hasOwnProperty(d)&&!i.hasOwnProperty(d)&&(u.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}))}function Gt(i){return i.id}function Dt(i,o){return i[o.id]=o,i}var wi=function(i,o){this.reset(i,o)};wi.prototype.reset=function(i,o){this.points=i||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding},wi.prototype.lerp=function(i){if(this.points.length===1)return this.points[0];i=u.clamp(i,0,1);for(var o=1,n=this._distances[o],s=i*this.paddedLength+this.padding;n<s&&o<this._distances.length;)n=this._distances[++o];var p=o-1,f=this._distances[p],d=n-f,v=d>0?(s-f)/d:0;return this.points[p].mult(1-v).add(this.points[o].mult(v))};var Ht=function(i,o,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(o/n);for(var f=0;f<this.xCellCount*this.yCellCount;f++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=o,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0};function Pr(i,o,n,s,p){var f=u.create();return o?(u.scale(f,f,[1/p,1/p,1]),n||u.rotateZ(f,f,s.angle)):u.multiply(f,s.labelPlaneMatrix,i),f}function Qt(i,o,n,s,p){if(o){var f=u.clone(i);return u.scale(f,f,[p,p,1]),n||u.rotateZ(f,f,-s.angle),f}return s.glCoordMatrix}function Bt(i,o){var n=[i.x,i.y,0,1];oi(n,n,o);var s=n[3];return{point:new u.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Zt(i,o){return .5+i/o*.5}function zi(i,o){var n=i[0]/i[3],s=i[1]/i[3];return n>=-o[0]&&n<=o[0]&&s>=-o[1]&&s<=o[1]}function ma(i,o,n,s,p,f,d,v){var w=s?i.textSizeData:i.iconSizeData,A=u.evaluateSizeForZoom(w,n.transform.zoom),D=[256/n.width*2+1,256/n.height*2+1],F=s?i.text.dynamicLayoutVertexArray:i.icon.dynamicLayoutVertexArray;F.clear();for(var O=i.lineVertexArray,W=s?i.text.placedSymbolArray:i.icon.placedSymbolArray,$=n.transform.width/n.transform.height,ee=!1,N=0;N<W.length;N++){var Q=W.get(N);if(Q.hidden||Q.writingMode===u.WritingMode.vertical&&!ee)Si(Q.numGlyphs,F);else{ee=!1;var ne=[Q.anchorX,Q.anchorY,0,1];if(u.transformMat4(ne,ne,o),zi(ne,D)){var ue=Zt(n.transform.cameraToCenterDistance,ne[3]),de=u.evaluateSizeForFeature(w,A,Q),pe=d?de/ue:de*ue,ye=new u.Point(Q.anchorX,Q.anchorY),Ie=Bt(ye,p).point,Me={},Ce=eu(Q,pe,!1,v,o,p,f,i.glyphOffsetArray,O,F,Ie,ye,Me,$);ee=Ce.useVertical,(Ce.notEnoughRoom||ee||Ce.needsFlipping&&eu(Q,pe,!0,v,o,p,f,i.glyphOffsetArray,O,F,Ie,ye,Me,$).notEnoughRoom)&&Si(Q.numGlyphs,F)}else Si(Q.numGlyphs,F)}}s?i.text.dynamicLayoutVertexBuffer.updateData(F):i.icon.dynamicLayoutVertexBuffer.updateData(F)}function ni(i,o,n,s,p,f,d,v,w,A,D){var F=v.glyphStartIndex+v.numGlyphs,O=v.lineStartIndex,W=v.lineStartIndex+v.lineLength,$=o.getoffsetX(v.glyphStartIndex),ee=o.getoffsetX(F-1),N=Cr(i*$,n,s,p,f,d,v.segment,O,W,w,A,D);if(!N)return null;var Q=Cr(i*ee,n,s,p,f,d,v.segment,O,W,w,A,D);return Q?{first:N,last:Q}:null}function Di(i,o,n,s){return i===u.WritingMode.horizontal&&Math.abs(n.y-o.y)>Math.abs(n.x-o.x)*s?{useVertical:!0}:(i===u.WritingMode.vertical?o.y<n.y:o.x>n.x)?{needsFlipping:!0}:null}function eu(i,o,n,s,p,f,d,v,w,A,D,F,O,W){var $,ee=o/24,N=i.lineOffsetX*ee,Q=i.lineOffsetY*ee;if(i.numGlyphs>1){var ne=i.glyphStartIndex+i.numGlyphs,ue=i.lineStartIndex,de=i.lineStartIndex+i.lineLength,pe=ni(ee,v,N,Q,n,D,F,i,w,f,O);if(!pe)return{notEnoughRoom:!0};var ye=Bt(pe.first.point,d).point,Ie=Bt(pe.last.point,d).point;if(s&&!n){var Me=Di(i.writingMode,ye,Ie,W);if(Me)return Me}$=[pe.first];for(var Ce=i.glyphStartIndex+1;Ce<ne-1;Ce++)$.push(Cr(ee*v.getoffsetX(Ce),N,Q,n,D,F,i.segment,ue,de,w,f,O));$.push(pe.last)}else{if(s&&!n){var $e=Bt(F,p).point,nt=i.lineStartIndex+i.segment+1,ut=new u.Point(w.getx(nt),w.gety(nt)),st=Bt(ut,p),Lt=st.signedDistanceFromCamera>0?st.point:ya(F,ut,$e,1,p),He=Di(i.writingMode,$e,Lt,W);if(He)return He}var mt=Cr(ee*v.getoffsetX(i.glyphStartIndex),N,Q,n,D,F,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,w,f,O);if(!mt)return{notEnoughRoom:!0};$=[mt]}for(var xt=0,dt=$;xt<dt.length;xt+=1){var ft=dt[xt];u.addDynamicAttributes(A,ft.point,ft.angle)}return{}}function ya(i,o,n,s,p){var f=Bt(i.add(i.sub(o)._unit()),p).point,d=n.sub(f);return n.add(d._mult(s/d.mag()))}function Cr(i,o,n,s,p,f,d,v,w,A,D,F){var O=s?i-o:i+o,W=O>0?1:-1,$=0;s&&(W*=-1,$=Math.PI),W<0&&($+=Math.PI);for(var ee=W>0?v+d:v+d+1,N=p,Q=p,ne=0,ue=0,de=Math.abs(O),pe=[];ne+ue<=de;){if((ee+=W)<v||ee>=w)return null;if(Q=N,pe.push(N),(N=F[ee])===void 0){var ye=new u.Point(A.getx(ee),A.gety(ee)),Ie=Bt(ye,D);if(Ie.signedDistanceFromCamera>0)N=F[ee]=Ie.point;else{var Me=ee-W;N=ya(ne===0?f:new u.Point(A.getx(Me),A.gety(Me)),ye,Q,de-ne+1,D)}}ne+=ue,ue=Q.dist(N)}var Ce=(de-ne)/ue,$e=N.sub(Q),nt=$e.mult(Ce)._add(Q);nt._add($e._unit()._perp()._mult(n*W));var ut=$+Math.atan2(N.y-Q.y,N.x-Q.x);return pe.push(nt),{point:nt,angle:ut,path:pe}}Ht.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ht.prototype.insert=function(i,o,n,s,p){this._forEachCell(o,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Ht.prototype.insertCircle=function(i,o,n,s){this._forEachCell(o-s,n-s,o+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(o),this.circles.push(n),this.circles.push(s)},Ht.prototype._insertBoxCell=function(i,o,n,s,p,f){this.boxCells[p].push(f)},Ht.prototype._insertCircleCell=function(i,o,n,s,p,f){this.circleCells[p].push(f)},Ht.prototype._query=function(i,o,n,s,p,f){if(n<0||i>this.width||s<0||o>this.height)return!p&&[];var d=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var v=0;v<this.boxKeys.length;v++)d.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(var w=0;w<this.circleKeys.length;w++){var A=this.circles[3*w],D=this.circles[3*w+1],F=this.circles[3*w+2];d.push({key:this.circleKeys[w],x1:A-F,y1:D-F,x2:A+F,y2:D+F})}return f?d.filter(f):d}return this._forEachCell(i,o,n,s,this._queryCell,d,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?d.length>0:d},Ht.prototype._queryCircle=function(i,o,n,s,p){var f=i-n,d=i+n,v=o-n,w=o+n;if(d<0||f>this.width||w<0||v>this.height)return!s&&[];var A=[];return this._forEachCell(f,v,d,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},Ht.prototype.query=function(i,o,n,s,p){return this._query(i,o,n,s,!1,p)},Ht.prototype.hitTest=function(i,o,n,s,p){return this._query(i,o,n,s,!0,p)},Ht.prototype.hitTestCircle=function(i,o,n,s){return this._queryCircle(i,o,n,!0,s)},Ht.prototype._queryCell=function(i,o,n,s,p,f,d,v){var w=d.seenUids,A=this.boxCells[p];if(A!==null)for(var D=this.bboxes,F=0,O=A;F<O.length;F+=1){var W=O[F];if(!w.box[W]){w.box[W]=!0;var $=4*W;if(i<=D[$+2]&&o<=D[$+3]&&n>=D[$+0]&&s>=D[$+1]&&(!v||v(this.boxKeys[W]))){if(d.hitTest)return f.push(!0),!0;f.push({key:this.boxKeys[W],x1:D[$],y1:D[$+1],x2:D[$+2],y2:D[$+3]})}}}var ee=this.circleCells[p];if(ee!==null)for(var N=this.circles,Q=0,ne=ee;Q<ne.length;Q+=1){var ue=ne[Q];if(!w.circle[ue]){w.circle[ue]=!0;var de=3*ue;if(this._circleAndRectCollide(N[de],N[de+1],N[de+2],i,o,n,s)&&(!v||v(this.circleKeys[ue]))){if(d.hitTest)return f.push(!0),!0;var pe=N[de],ye=N[de+1],Ie=N[de+2];f.push({key:this.circleKeys[ue],x1:pe-Ie,y1:ye-Ie,x2:pe+Ie,y2:ye+Ie})}}}},Ht.prototype._queryCellCircle=function(i,o,n,s,p,f,d,v){var w=d.circle,A=d.seenUids,D=this.boxCells[p];if(D!==null)for(var F=this.bboxes,O=0,W=D;O<W.length;O+=1){var $=W[O];if(!A.box[$]){A.box[$]=!0;var ee=4*$;if(this._circleAndRectCollide(w.x,w.y,w.radius,F[ee+0],F[ee+1],F[ee+2],F[ee+3])&&(!v||v(this.boxKeys[$])))return f.push(!0),!0}}var N=this.circleCells[p];if(N!==null)for(var Q=this.circles,ne=0,ue=N;ne<ue.length;ne+=1){var de=ue[ne];if(!A.circle[de]){A.circle[de]=!0;var pe=3*de;if(this._circlesCollide(Q[pe],Q[pe+1],Q[pe+2],w.x,w.y,w.radius)&&(!v||v(this.circleKeys[de])))return f.push(!0),!0}}},Ht.prototype._forEachCell=function(i,o,n,s,p,f,d,v){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(o),D=this._convertToXCellCoord(n),F=this._convertToYCellCoord(s),O=w;O<=D;O++)for(var W=A;W<=F;W++)if(p.call(this,i,o,n,s,this.xCellCount*W+O,f,d,v))return},Ht.prototype._convertToXCellCoord=function(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))},Ht.prototype._convertToYCellCoord=function(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))},Ht.prototype._circlesCollide=function(i,o,n,s,p,f){var d=s-i,v=p-o,w=n+f;return w*w>d*d+v*v},Ht.prototype._circleAndRectCollide=function(i,o,n,s,p,f,d){var v=(f-s)/2,w=Math.abs(i-(s+v));if(w>v+n)return!1;var A=(d-p)/2,D=Math.abs(o-(p+A));if(D>A+n)return!1;if(w<=v||D<=A)return!0;var F=w-v,O=D-A;return F*F+O*O<=n*n};var va=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Si(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(va,3*s)}}function oi(i,o,n){var s=o[0],p=o[1];return i[0]=n[0]*s+n[4]*p+n[12],i[1]=n[1]*s+n[5]*p+n[13],i[3]=n[3]*s+n[7]*p+n[15],i}var nn=function(i,o,n){o===void 0&&(o=new Ht(i.width+200,i.height+200,25)),n===void 0&&(n=new Ht(i.width+200,i.height+200,25)),this.transform=i,this.grid=o,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function yr(i,o,n){return o*(u.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}nn.prototype.placeCollisionBox=function(i,o,n,s,p){var f=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),d=n*f.perspectiveRatio,v=i.x1*d+f.point.x,w=i.y1*d+f.point.y,A=i.x2*d+f.point.x,D=i.y2*d+f.point.y;return!this.isInsideGrid(v,w,A,D)||!o&&this.grid.hitTest(v,w,A,D,p)?{box:[],offscreen:!1}:{box:[v,w,A,D],offscreen:this.isOffscreen(v,w,A,D)}},nn.prototype.placeCollisionCircles=function(i,o,n,s,p,f,d,v,w,A,D,F,O){var W=[],$=new u.Point(o.anchorX,o.anchorY),ee=Bt($,f),N=Zt(this.transform.cameraToCenterDistance,ee.signedDistanceFromCamera),Q=(A?p/N:p*N)/u.ONE_EM,ne=Bt($,d).point,ue=ni(Q,s,o.lineOffsetX*Q,o.lineOffsetY*Q,!1,ne,$,o,n,d,{}),de=!1,pe=!1,ye=!0;if(ue){for(var Ie=.5*F*N+O,Me=new u.Point(-100,-100),Ce=new u.Point(this.screenRightBoundary,this.screenBottomBoundary),$e=new wi,nt=ue.first,ut=ue.last,st=[],Lt=nt.path.length-1;Lt>=1;Lt--)st.push(nt.path[Lt]);for(var He=1;He<ut.path.length;He++)st.push(ut.path[He]);var mt=2.5*Ie;if(v){var xt=st.map((function(cn){return Bt(cn,v)}));st=xt.some((function(cn){return cn.signedDistanceFromCamera<=0}))?[]:xt.map((function(cn){return cn.point}))}var dt=[];if(st.length>0){for(var ft=st[0].clone(),gt=st[0].clone(),ht=1;ht<st.length;ht++)ft.x=Math.min(ft.x,st[ht].x),ft.y=Math.min(ft.y,st[ht].y),gt.x=Math.max(gt.x,st[ht].x),gt.y=Math.max(gt.y,st[ht].y);dt=ft.x>=Me.x&&gt.x<=Ce.x&&ft.y>=Me.y&&gt.y<=Ce.y?[st]:gt.x<Me.x||ft.x>Ce.x||gt.y<Me.y||ft.y>Ce.y?[]:u.clipLine([st],Me.x,Me.y,Ce.x,Ce.y)}for(var ct=0,Jr=dt;ct<Jr.length;ct+=1){var Ir;$e.reset(Jr[ct],.25*Ie),Ir=$e.length<=.5*Ie?1:Math.ceil($e.paddedLength/mt)+1;for(var gi=0;gi<Ir;gi++){var si=gi/Math.max(Ir-1,1),wr=$e.lerp(si),kr=wr.x+100,Wi=wr.y+100;W.push(kr,Wi,Ie,0);var Ei=kr-Ie,no=Wi-Ie,Ri=kr+Ie,wn=Wi+Ie;if(ye=ye&&this.isOffscreen(Ei,no,Ri,wn),pe=pe||this.isInsideGrid(Ei,no,Ri,wn),!i&&this.grid.hitTestCircle(kr,Wi,Ie,D)&&(de=!0,!w))return{circles:[],offscreen:!1,collisionDetected:de}}}}return{circles:!w&&de||!pe?[]:W,offscreen:ye,collisionDetected:de}},nn.prototype.queryRenderedSymbols=function(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var o=[],n=1/0,s=1/0,p=-1/0,f=-1/0,d=0,v=i;d<v.length;d+=1){var w=v[d],A=new u.Point(w.x+100,w.y+100);n=Math.min(n,A.x),s=Math.min(s,A.y),p=Math.max(p,A.x),f=Math.max(f,A.y),o.push(A)}for(var D={},F={},O=0,W=this.grid.query(n,s,p,f).concat(this.ignoredGrid.query(n,s,p,f));O<W.length;O+=1){var $=W[O],ee=$.key;if(D[ee.bucketInstanceId]===void 0&&(D[ee.bucketInstanceId]={}),!D[ee.bucketInstanceId][ee.featureIndex]){var N=[new u.Point($.x1,$.y1),new u.Point($.x2,$.y1),new u.Point($.x2,$.y2),new u.Point($.x1,$.y2)];u.polygonIntersectsPolygon(o,N)&&(D[ee.bucketInstanceId][ee.featureIndex]=!0,F[ee.bucketInstanceId]===void 0&&(F[ee.bucketInstanceId]=[]),F[ee.bucketInstanceId].push(ee.featureIndex))}}return F},nn.prototype.insertCollisionBox=function(i,o,n,s,p){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},nn.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var f=o?this.ignoredGrid:this.grid,d={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},v=0;v<i.length;v+=4)f.insertCircle(d,i[v],i[v+1],i[v+2])},nn.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return oi(s,s,i),{point:new u.Point((s[0]/s[3]+1)/2*this.transform.width+100,(-s[1]/s[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s[3]*.5}},nn.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},nn.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},nn.prototype.getViewportMatrix=function(){var i=u.identity([]);return u.translate(i,i,[-100,-100,0]),i};var yn=function(i,o,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?o:-o))):s&&n?1:0,this.placed=n};yn.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Ji=function(i,o,n,s,p){this.text=new yn(i?i.text:null,o,n,p),this.icon=new yn(i?i.icon:null,o,s,p)};Ji.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var il=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},on=function(){this.invProjMatrix=u.create(),this.viewportMatrix=u.create(),this.circles=[]},Pc=function(i,o,n,s,p){this.bucketInstanceId=i,this.featureIndex=o,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},Dn=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function di(i,o,n,s,p){var f=u.getAnchorAlignment(i),d=-(f.horizontalAlign-.5)*o,v=-(f.verticalAlign-.5)*n,w=u.evaluateVariableOffset(i,s);return new u.Point(d+w[0]*p,v+w[1]*p)}function In(i,o,n,s,p,f){var d=i.x1,v=i.x2,w=i.y1,A=i.y2,D=i.anchorPointX,F=i.anchorPointY,O=new u.Point(o,n);return s&&O._rotate(p?f:-f),{x1:d+O.x,y1:w+O.y,x2:v+O.x,y2:A+O.y,anchorPointX:D,anchorPointY:F}}Dn.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var o=++this.maxGroupID;this.collisionGroups[i]={ID:o,predicate:function(n){return n.collisionGroupID===o}}}return this.collisionGroups[i]};var Ii=function(i,o,n,s){this.transform=i.clone(),this.collisionIndex=new nn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new Dn(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function vo(i,o,n,s,p){i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0)}Ii.prototype.getBucketParts=function(i,o,n,s){var p=n.getBucket(o),f=n.latestFeatureIndex;if(p&&f&&o.id===p.layerIds[0]){var d=n.collisionBoxArray,v=p.layers[0].layout,w=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),A=n.tileSize/u.EXTENT,D=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),F=v.get("text-pitch-alignment")==="map",O=v.get("text-rotation-alignment")==="map",W=yr(n,1,this.transform.zoom),$=Pr(D,F,O,this.transform,W),ee=null;if(F){var N=Qt(D,F,O,this.transform,W);ee=u.multiply([],this.transform.labelPlaneMatrix,N)}this.retainedQueryData[p.bucketInstanceId]=new Pc(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,n.tileID);var Q={bucket:p,layout:v,posMatrix:D,textLabelPlaneMatrix:$,labelToScreenMatrix:ee,scale:w,textPixelRatio:A,holdingForFade:n.holdingForFade(),collisionBoxArray:d,partiallyEvaluatedTextSize:u.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var ne=0,ue=p.sortKeyRanges;ne<ue.length;ne+=1){var de=ue[ne];i.push({sortKey:de.sortKey,symbolInstanceStart:de.symbolInstanceStart,symbolInstanceEnd:de.symbolInstanceEnd,parameters:Q})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:Q})}},Ii.prototype.attemptAnchorPlacement=function(i,o,n,s,p,f,d,v,w,A,D,F,O,W,$){var ee,N=[F.textOffset0,F.textOffset1],Q=di(i,n,s,N,p),ne=this.collisionIndex.placeCollisionBox(In(o,Q.x,Q.y,f,d,this.transform.angle),D,v,w,A.predicate);if(!$||this.collisionIndex.placeCollisionBox(In($,Q.x,Q.y,f,d,this.transform.angle),D,v,w,A.predicate).box.length!==0)return ne.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID].text&&(ee=this.prevPlacement.variableOffsets[F.crossTileID].anchor),this.variableOffsets[F.crossTileID]={textOffset:N,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:ee},this.markUsedJustification(O,i,F,W),O.allowVerticalPlacement&&(this.markUsedOrientation(O,W,F),this.placedOrientations[F.crossTileID]=W),{shift:Q,placedGlyphBoxes:ne}):void 0},Ii.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,f=p.bucket,d=p.layout,v=p.posMatrix,w=p.textLabelPlaneMatrix,A=p.labelToScreenMatrix,D=p.textPixelRatio,F=p.holdingForFade,O=p.collisionBoxArray,W=p.partiallyEvaluatedTextSize,$=p.collisionGroup,ee=d.get("text-optional"),N=d.get("icon-optional"),Q=d.get("text-allow-overlap"),ne=d.get("icon-allow-overlap"),ue=d.get("text-rotation-alignment")==="map",de=d.get("text-pitch-alignment")==="map",pe=d.get("icon-text-fit")!=="none",ye=d.get("symbol-z-order")==="viewport-y",Ie=Q&&(ne||!f.hasIconData()||N),Me=ne&&(Q||!f.hasTextData()||ee);!f.collisionArrays&&O&&f.deserializeCollisionBoxes(O);var Ce=function(He,mt){if(!o[He.crossTileID])if(F)s.placements[He.crossTileID]=new il(!1,!1,!1);else{var xt,dt=!1,ft=!1,gt=!0,ht=null,ct={box:null,offscreen:null},Jr={box:null,offscreen:null},Ir=null,gi=null,si=0,wr=0,kr=0;mt.textFeatureIndex?si=mt.textFeatureIndex:He.useRuntimeCollisionCircles&&(si=He.featureIndex),mt.verticalTextFeatureIndex&&(wr=mt.verticalTextFeatureIndex);var Wi=mt.textBox;if(Wi){var Ei=function($t){var en=u.WritingMode.horizontal;if(f.allowVerticalPlacement&&!$t&&s.prevPlacement){var Li=s.prevPlacement.placedOrientations[He.crossTileID];Li&&(s.placedOrientations[He.crossTileID]=Li,s.markUsedOrientation(f,en=Li,He))}return en},no=function($t,en){if(f.allowVerticalPlacement&&He.numVerticalGlyphVertices>0&&mt.verticalTextBox)for(var Li=0,Ro=f.writingModes;Li<Ro.length&&(Ro[Li]===u.WritingMode.vertical?(ct=en(),Jr=ct):ct=$t(),!(ct&&ct.box&&ct.box.length));Li+=1);else ct=$t()};if(d.get("text-variable-anchor")){var Ri=d.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[He.crossTileID]){var wn=s.prevPlacement.variableOffsets[He.crossTileID];Ri.indexOf(wn.anchor)>0&&(Ri=Ri.filter((function($t){return $t!==wn.anchor}))).unshift(wn.anchor)}var cn=function($t,en,Li){for(var Ro=$t.x2-$t.x1,Nc=$t.y2-$t.y1,_s=He.textBoxScale,jc=pe&&!ne?en:null,Oa={box:[],offscreen:!1},Dl=Q?2*Ri.length:Ri.length,aa=0;aa<Dl;++aa){var xs=s.attemptAnchorPlacement(Ri[aa%Ri.length],$t,Ro,Nc,_s,ue,de,D,v,$,aa>=Ri.length,He,f,Li,jc);if(xs&&(Oa=xs.placedGlyphBoxes)&&Oa.box&&Oa.box.length){dt=!0,ht=xs.shift;break}}return Oa};no((function(){return cn(Wi,mt.iconBox,u.WritingMode.horizontal)}),(function(){var $t=mt.verticalTextBox;return f.allowVerticalPlacement&&!(ct&&ct.box&&ct.box.length)&&He.numVerticalGlyphVertices>0&&$t?cn($t,mt.verticalIconBox,u.WritingMode.vertical):{box:null,offscreen:null}})),ct&&(dt=ct.box,gt=ct.offscreen);var Ra=Ei(ct&&ct.box);if(!dt&&s.prevPlacement){var na=s.prevPlacement.variableOffsets[He.crossTileID];na&&(s.variableOffsets[He.crossTileID]=na,s.markUsedJustification(f,na.anchor,He,Ra))}}else{var oo=function($t,en){var Li=s.collisionIndex.placeCollisionBox($t,Q,D,v,$.predicate);return Li&&Li.box&&Li.box.length&&(s.markUsedOrientation(f,en,He),s.placedOrientations[He.crossTileID]=en),Li};no((function(){return oo(Wi,u.WritingMode.horizontal)}),(function(){var $t=mt.verticalTextBox;return f.allowVerticalPlacement&&He.numVerticalGlyphVertices>0&&$t?oo($t,u.WritingMode.vertical):{box:null,offscreen:null}})),Ei(ct&&ct.box&&ct.box.length)}}if(dt=(xt=ct)&&xt.box&&xt.box.length>0,gt=xt&&xt.offscreen,He.useRuntimeCollisionCircles){var oa=f.text.placedSymbolArray.get(He.centerJustifiedTextSymbolIndex),La=u.evaluateSizeForFeature(f.textSizeData,W,oa),Pn=d.get("text-padding");Ir=s.collisionIndex.placeCollisionCircles(Q,oa,f.lineVertexArray,f.glyphOffsetArray,La,v,w,A,n,de,$.predicate,He.collisionCircleDiameter,Pn),dt=Q||Ir.circles.length>0&&!Ir.collisionDetected,gt=gt&&Ir.offscreen}if(mt.iconFeatureIndex&&(kr=mt.iconFeatureIndex),mt.iconBox){var Fa=function($t){var en=pe&&ht?In($t,ht.x,ht.y,ue,de,s.transform.angle):$t;return s.collisionIndex.placeCollisionBox(en,ne,D,v,$.predicate)};ft=Jr&&Jr.box&&Jr.box.length&&mt.verticalIconBox?(gi=Fa(mt.verticalIconBox)).box.length>0:(gi=Fa(mt.iconBox)).box.length>0,gt=gt&&gi.offscreen}var Cn=ee||He.numHorizontalGlyphVertices===0&&He.numVerticalGlyphVertices===0,Yr=N||He.numIconVertices===0;if(Cn||Yr?Yr?Cn||(ft=ft&&dt):dt=ft&&dt:ft=dt=ft&&dt,dt&&xt&&xt.box&&s.collisionIndex.insertCollisionBox(xt.box,d.get("text-ignore-placement"),f.bucketInstanceId,Jr&&Jr.box&&wr?wr:si,$.ID),ft&&gi&&s.collisionIndex.insertCollisionBox(gi.box,d.get("icon-ignore-placement"),f.bucketInstanceId,kr,$.ID),Ir&&(dt&&s.collisionIndex.insertCollisionCircles(Ir.circles,d.get("text-ignore-placement"),f.bucketInstanceId,si,$.ID),n)){var On=f.bucketInstanceId,ao=s.collisionCircleArrays[On];ao===void 0&&(ao=s.collisionCircleArrays[On]=new on);for(var Do=0;Do<Ir.circles.length;Do+=4)ao.circles.push(Ir.circles[Do+0]),ao.circles.push(Ir.circles[Do+1]),ao.circles.push(Ir.circles[Do+2]),ao.circles.push(Ir.collisionDetected?1:0)}s.placements[He.crossTileID]=new il(dt||Ie,ft||Me,gt||f.justReloaded),o[He.crossTileID]=!0}};if(ye)for(var $e=f.getSortedSymbolIndexes(this.transform.angle),nt=$e.length-1;nt>=0;--nt){var ut=$e[nt];Ce(f.symbolInstances.get(ut),f.collisionArrays[ut])}else for(var st=i.symbolInstanceStart;st<i.symbolInstanceEnd;st++)Ce(f.symbolInstances.get(st),f.collisionArrays[st]);if(n&&f.bucketInstanceId in this.collisionCircleArrays){var Lt=this.collisionCircleArrays[f.bucketInstanceId];u.invert(Lt.invProjMatrix,v),Lt.viewportMatrix=this.collisionIndex.getViewportMatrix()}f.justReloaded=!1},Ii.prototype.markUsedJustification=function(i,o,n,s){var p;p=s===u.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[u.getAnchorJustification(o)];for(var f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];f<d.length;f+=1){var v=d[f];v>=0&&(i.text.placedSymbolArray.get(v).crossTileID=p>=0&&v!==p?0:n.crossTileID)}},Ii.prototype.markUsedOrientation=function(i,o,n){for(var s=o===u.WritingMode.horizontal||o===u.WritingMode.horizontalOnly?o:0,p=o===u.WritingMode.vertical?o:0,f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];f<d.length;f+=1)i.text.placedSymbolArray.get(d[f]).placedOrientation=s;n.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)},Ii.prototype.commit=function(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;var o=this.prevPlacement,n=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;var s=o?o.symbolFadeChange(i):1,p=o?o.opacities:{},f=o?o.variableOffsets:{},d=o?o.placedOrientations:{};for(var v in this.placements){var w=this.placements[v],A=p[v];A?(this.opacities[v]=new Ji(A,s,w.text,w.icon),n=n||w.text!==A.text.placed||w.icon!==A.icon.placed):(this.opacities[v]=new Ji(null,s,w.text,w.icon,w.skipFade),n=n||w.text||w.icon)}for(var D in p){var F=p[D];if(!this.opacities[D]){var O=new Ji(F,s,!1,!1);O.isHidden()||(this.opacities[D]=O,n=n||F.text.placed||F.icon.placed)}}for(var W in f)this.variableOffsets[W]||!this.opacities[W]||this.opacities[W].isHidden()||(this.variableOffsets[W]=f[W]);for(var $ in d)this.placedOrientations[$]||!this.opacities[$]||this.opacities[$].isHidden()||(this.placedOrientations[$]=d[$]);n?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:i)},Ii.prototype.updateLayerOpacities=function(i,o){for(var n={},s=0,p=o;s<p.length;s+=1){var f=p[s],d=f.getBucket(i);d&&f.latestFeatureIndex&&i.id===d.layerIds[0]&&this.updateBucketOpacities(d,n,f.collisionBoxArray)}},Ii.prototype.updateBucketOpacities=function(i,o,n){var s=this;i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();var p=i.layers[0].layout,f=new Ji(null,0,!1,!1,!0),d=p.get("text-allow-overlap"),v=p.get("icon-allow-overlap"),w=p.get("text-variable-anchor"),A=p.get("text-rotation-alignment")==="map",D=p.get("text-pitch-alignment")==="map",F=p.get("icon-text-fit")!=="none",O=new Ji(null,0,d&&(v||!i.hasIconData()||p.get("icon-optional")),v&&(d||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var W=function(Q,ne,ue){for(var de=0;de<ne/4;de++)Q.opacityVertexArray.emplaceBack(ue)},$=function(Q){var ne=i.symbolInstances.get(Q),ue=ne.numHorizontalGlyphVertices,de=ne.numVerticalGlyphVertices,pe=ne.crossTileID,ye=s.opacities[pe];o[pe]?ye=f:ye||(s.opacities[pe]=ye=O),o[pe]=!0;var Ie=ne.numIconVertices>0,Me=s.placedOrientations[ne.crossTileID],Ce=Me===u.WritingMode.vertical,$e=Me===u.WritingMode.horizontal||Me===u.WritingMode.horizontalOnly;if(ue>0||de>0){var nt=al(ye.text);W(i.text,ue,Ce?Wo:nt),W(i.text,de,$e?Wo:nt);var ut=ye.text.isHidden();[ne.rightJustifiedTextSymbolIndex,ne.centerJustifiedTextSymbolIndex,ne.leftJustifiedTextSymbolIndex].forEach((function(ct){ct>=0&&(i.text.placedSymbolArray.get(ct).hidden=ut||Ce?1:0)})),ne.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(ne.verticalPlacedTextSymbolIndex).hidden=ut||$e?1:0);var st=s.variableOffsets[ne.crossTileID];st&&s.markUsedJustification(i,st.anchor,ne,Me);var Lt=s.placedOrientations[ne.crossTileID];Lt&&(s.markUsedJustification(i,"left",ne,Lt),s.markUsedOrientation(i,Lt,ne))}if(Ie){var He=al(ye.icon),mt=!(F&&ne.verticalPlacedIconSymbolIndex&&Ce);ne.placedIconSymbolIndex>=0&&(W(i.icon,ne.numIconVertices,mt?He:Wo),i.icon.placedSymbolArray.get(ne.placedIconSymbolIndex).hidden=ye.icon.isHidden()),ne.verticalPlacedIconSymbolIndex>=0&&(W(i.icon,ne.numVerticalIconVertices,mt?Wo:He),i.icon.placedSymbolArray.get(ne.verticalPlacedIconSymbolIndex).hidden=ye.icon.isHidden())}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){var xt=i.collisionArrays[Q];if(xt){var dt=new u.Point(0,0);if(xt.textBox||xt.verticalTextBox){var ft=!0;if(w){var gt=s.variableOffsets[pe];gt?(dt=di(gt.anchor,gt.width,gt.height,gt.textOffset,gt.textBoxScale),A&&dt._rotate(D?s.transform.angle:-s.transform.angle)):ft=!1}xt.textBox&&vo(i.textCollisionBox.collisionVertexArray,ye.text.placed,!ft||Ce,dt.x,dt.y),xt.verticalTextBox&&vo(i.textCollisionBox.collisionVertexArray,ye.text.placed,!ft||$e,dt.x,dt.y)}var ht=!!(!$e&&xt.verticalIconBox);xt.iconBox&&vo(i.iconCollisionBox.collisionVertexArray,ye.icon.placed,ht,F?dt.x:0,F?dt.y:0),xt.verticalIconBox&&vo(i.iconCollisionBox.collisionVertexArray,ye.icon.placed,!ht,F?dt.x:0,F?dt.y:0)}}},ee=0;ee<i.symbolInstances.length;ee++)$(ee);if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){var N=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=N.invProjMatrix,i.placementViewportMatrix=N.viewportMatrix,i.collisionCircleArray=N.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}},Ii.prototype.symbolFadeChange=function(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Ii.prototype.zoomAdjustment=function(i){return Math.max(0,(this.transform.zoom-i)/1.5)},Ii.prototype.hasTransitions=function(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration},Ii.prototype.stillRecent=function(i,o){var n=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*n>i},Ii.prototype.setStale=function(){this.stale=!0};var Cc=Math.pow(2,25),kc=Math.pow(2,24),tu=Math.pow(2,17),Mc=Math.pow(2,16),nl=Math.pow(2,9),Bc=Math.pow(2,8),ol=Math.pow(2,1);function al(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var o=i.placed?1:0,n=Math.floor(127*i.opacity);return n*Cc+o*kc+n*tu+o*Mc+n*nl+o*Bc+n*ol+o}var Wo=0,ru=function(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ru.prototype.continuePlacement=function(i,o,n,s,p){for(var f=this._bucketParts;this._currentTileIndex<i.length;)if(o.getBucketParts(f,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,f.sort((function(d,v){return d.sortKey-v.sortKey})));this._currentPartIndex<f.length;)if(o.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var ga=function(i,o,n,s,p,f,d){this.placement=new Ii(i,p,f,d),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};ga.prototype.isDone=function(){return this._done},ga.prototype.continuePlacement=function(i,o,n){for(var s=this,p=u.browser.now(),f=function(){var w=u.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var d=o[i[this._currentPlacementIndex]],v=this.placement.collisionIndex.transform.zoom;if(d.type==="symbol"&&(!d.minzoom||d.minzoom<=v)&&(!d.maxzoom||d.maxzoom>v)){if(this._inProgressLayer||(this._inProgressLayer=new ru(d)),this._inProgressLayer.continuePlacement(n[d.source],this.placement,this._showCollisionBoxes,d,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ga.prototype.commit=function(i){return this.placement.commit(i),this.placement};var sl=512/u.EXTENT/2,Qa=function(i,o,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<o.length;s++){var p=o.get(s),f=p.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};Qa.prototype.getScaledCoordinates=function(i,o){var n=sl/Math.pow(2,o.canonical.z-this.tileID.canonical.z);return{x:Math.floor((o.canonical.x*u.EXTENT+i.anchorX)*n),y:Math.floor((o.canonical.y*u.EXTENT+i.anchorY)*n)}},Qa.prototype.findMatches=function(i,o,n){for(var s=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),p=0;p<i.length;p++){var f=i.get(p);if(!f.crossTileID){var d=this.indexedSymbolInstances[f.key];if(d)for(var v=this.getScaledCoordinates(f,o),w=0,A=d;w<A.length;w+=1){var D=A[w];if(Math.abs(D.coord.x-v.x)<=s&&Math.abs(D.coord.y-v.y)<=s&&!n[D.crossTileID]){n[D.crossTileID]=!0,f.crossTileID=D.crossTileID;break}}}}};var an=function(){this.maxCrossTileID=0};an.prototype.generate=function(){return++this.maxCrossTileID};var Gn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Gn.prototype.handleWrapJump=function(i){var o=Math.round((i-this.lng)/360);if(o!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var f in s){var d=s[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+o),p[d.tileID.key]=d}this.indexes[n]=p}this.lng=i},Gn.prototype.addBucket=function(i,o,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<o.symbolInstances.length;s++)o.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var f in this.indexes){var d=this.indexes[f];if(Number(f)>i.overscaledZ)for(var v in d){var w=d[v];w.tileID.isChildOf(i)&&w.findMatches(o.symbolInstances,i,p)}else{var A=d[i.scaledTo(Number(f)).key];A&&A.findMatches(o.symbolInstances,i,p)}}for(var D=0;D<o.symbolInstances.length;D++){var F=o.symbolInstances.get(D);F.crossTileID||(F.crossTileID=n.generate(),p[F.crossTileID]=!0)}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new Qa(i,o.symbolInstances,o.bucketInstanceId),!0},Gn.prototype.removeBucketCrossTileIDs=function(i,o){for(var n in o.indexedSymbolInstances)for(var s=0,p=o.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},Gn.prototype.removeStaleBuckets=function(i){var o=!1;for(var n in this.indexes){var s=this.indexes[n];for(var p in s)i[s[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,s[p]),delete s[p],o=!0)}return o};var Zn=function(){this.layerIndexes={},this.crossTileIDs=new an,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Zn.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new Gn);var p=!1,f={};s.handleWrapJump(n);for(var d=0,v=o;d<v.length;d+=1){var w=v[d],A=w.getBucket(i);A&&i.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),f[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(f)&&(p=!0),p},Zn.prototype.pruneUnusedLayers=function(i){var o={};for(var n in i.forEach((function(s){o[s]=!0})),this.layerIndexes)o[n]||delete this.layerIndexes[n]};var go=function(i,o){return u.emitValidationErrors(i,o&&o.filter((function(n){return n.identifier!=="source.canvas"})))},$n=u.pick(Be,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Wn=u.pick(Be,["setCenter","setZoom","setBearing","setPitch"]),es=(function(){var i={},o=u.styleSpec.$version;for(var n in u.styleSpec.$root){var s,p=u.styleSpec.$root[n];p.required&&(s=n==="version"?o:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i})(),Ui=(function(i){function o(n,s){var p=this;s===void 0&&(s={}),i.call(this),this.map=n,this.dispatcher=new Ut(ge(),this),this.imageManager=new Re,this.imageManager.setEventedParent(this),this.glyphManager=new Fe(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new St(256,512),this.crossTileSymbolIndex=new Zn,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",u.getReferrer());var f=this;this._rtlTextPluginCallback=o.registerForPluginStateChange((function(d){f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(function(v,w){if(u.triggerPluginCompletionEvent(v),w&&w.every((function(D){return D})))for(var A in f.sourceCaches)f.sourceCaches[A].reload()}))})),this.on("data",(function(d){if(d.dataType==="source"&&d.sourceDataType==="metadata"){var v=p.sourceCaches[d.sourceId];if(v){var w=v.getSource();if(w&&w.vectorLayerIds)for(var A in p._layers){var D=p._layers[A];D.source===w.id&&p._validateLayer(D)}}}}))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"}));var f=typeof s.validate=="boolean"?s.validate:!u.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);var d=this.map._requestManager.transformRequest(n,u.ResourceType.Style);this._request=u.getJSON(d,(function(v,w){p._request=null,v?p.fire(new u.ErrorEvent(v)):w&&p._load(w,f)}))},o.prototype.loadJSON=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new u.Event("dataloading",{dataType:"style"})),this._request=u.browser.frame((function(){p._request=null,p._load(n,s.validate!==!1)}))},o.prototype.loadEmpty=function(){this.fire(new u.Event("dataloading",{dataType:"style"})),this._load(es,!1)},o.prototype._load=function(n,s){if(!s||!go(this,u.validateStyle(n))){for(var p in this._loaded=!0,this.stylesheet=n,n.sources)this.addSource(p,n.sources[p],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);var f=ze(this.stylesheet.layers);this._order=f.map((function(A){return A.id})),this._layers={},this._serializedLayers={};for(var d=0,v=f;d<v.length;d+=1){var w=v[d];(w=u.createStyleLayer(w)).setEventedParent(this,{layer:{id:w.id}}),this._layers[w.id]=w,this._serializedLayers[w.id]=w.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Wt(this.stylesheet.light),this.fire(new u.Event("data",{dataType:"style"})),this.fire(new u.Event("style.load"))}},o.prototype._loadSprite=function(n){var s=this;this._spriteRequest=(function(p,f,d){var v,w,A,D=u.browser.devicePixelRatio>1?"@2x":"",F=u.getJSON(f.transformRequest(f.normalizeSpriteURL(p,D,".json"),u.ResourceType.SpriteJSON),(function($,ee){F=null,A||(A=$,v=ee,W())})),O=u.getImage(f.transformRequest(f.normalizeSpriteURL(p,D,".png"),u.ResourceType.SpriteImage),(function($,ee){O=null,A||(A=$,w=ee,W())}));function W(){if(A)d(A);else if(v&&w){var $=u.browser.getImageData(w),ee={};for(var N in v){var Q=v[N],ne=Q.width,ue=Q.height,de=Q.x,pe=Q.y,ye=Q.sdf,Ie=Q.pixelRatio,Me=Q.stretchX,Ce=Q.stretchY,$e=Q.content,nt=new u.RGBAImage({width:ne,height:ue});u.RGBAImage.copy($,nt,{x:de,y:pe},{x:0,y:0},{width:ne,height:ue}),ee[N]={data:nt,pixelRatio:Ie,sdf:ye,stretchX:Me,stretchY:Ce,content:$e}}d(null,ee)}}return{cancel:function(){F&&(F.cancel(),F=null),O&&(O.cancel(),O=null)}}})(n,this.map._requestManager,(function(p,f){if(s._spriteRequest=null,p)s.fire(new u.ErrorEvent(p));else if(f)for(var d in f)s.imageManager.addImage(d,f[d]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new u.Event("data",{dataType:"style"}))}))},o.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var f=s.getSource();(f.type==="geojson"||f.vectorLayerIds&&f.vectorLayerIds.indexOf(p)===-1)&&this.fire(new u.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+f.id+'" as specified by style layer "'+n.id+'"')))}}},o.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()},o.prototype._serializeLayers=function(n){for(var s=[],p=0,f=n;p<f.length;p+=1){var d=this._layers[f[p]];d.type!=="custom"&&s.push(d.serialize())}return s},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(var s in this._layers)if(this._layers[s].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);for(var d in(p.length||f.length)&&this._updateWorkerLayers(p,f),this._updatedSources){var v=this._updatedSources[d];v==="reload"?this._reloadSource(d):v==="clear"&&this._clearSource(d)}for(var w in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[w].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var A={};for(var D in this.sourceCaches){var F=this.sourceCaches[D];A[D]=F.used,F.used=!1}for(var O=0,W=this._order;O<W.length;O+=1){var $=this._layers[W[O]];$.recalculate(n,this._availableImages),!$.isHidden(n.zoom)&&$.source&&(this.sourceCaches[$.source].used=!0)}for(var ee in A){var N=this.sourceCaches[ee];A[ee]!==N.used&&N.fire(new u.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:ee}))}this.light.recalculate(n),this.z=n.zoom,s&&this.fire(new u.Event("data",{dataType:"style"}))}},o.prototype._updateTilesForChangedImages=function(){var n=Object.keys(this._changedImages);if(n.length){for(var s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}},o.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},o.prototype.setState=function(n){var s=this;if(this._checkLoaded(),go(this,u.validateStyle(n)))return!1;(n=u.clone$1(n)).layers=ze(n.layers);var p=(function(d,v){if(!d)return[{command:Be.setStyle,args:[v]}];var w=[];try{if(!u.deepEqual(d.version,v.version))return[{command:Be.setStyle,args:[v]}];u.deepEqual(d.center,v.center)||w.push({command:Be.setCenter,args:[v.center]}),u.deepEqual(d.zoom,v.zoom)||w.push({command:Be.setZoom,args:[v.zoom]}),u.deepEqual(d.bearing,v.bearing)||w.push({command:Be.setBearing,args:[v.bearing]}),u.deepEqual(d.pitch,v.pitch)||w.push({command:Be.setPitch,args:[v.pitch]}),u.deepEqual(d.sprite,v.sprite)||w.push({command:Be.setSprite,args:[v.sprite]}),u.deepEqual(d.glyphs,v.glyphs)||w.push({command:Be.setGlyphs,args:[v.glyphs]}),u.deepEqual(d.transition,v.transition)||w.push({command:Be.setTransition,args:[v.transition]}),u.deepEqual(d.light,v.light)||w.push({command:Be.setLight,args:[v.light]});var A={},D=[];(function(O,W,$,ee){var N;for(N in W=W||{},O=O||{})O.hasOwnProperty(N)&&(W.hasOwnProperty(N)||qe(N,$,ee));for(N in W)W.hasOwnProperty(N)&&(O.hasOwnProperty(N)?u.deepEqual(O[N],W[N])||(O[N].type==="geojson"&&W[N].type==="geojson"&&rr(O,W,N)?$.push({command:Be.setGeoJSONSourceData,args:[N,W[N].data]}):Et(N,W,$,ee)):yt(N,W,$))})(d.sources,v.sources,D,A);var F=[];d.layers&&d.layers.forEach((function(O){A[O.source]?w.push({command:Be.removeLayer,args:[O.id]}):F.push(O)})),w=w.concat(D),(function(O,W,$){W=W||[];var ee,N,Q,ne,ue,de,pe,ye=(O=O||[]).map(Gt),Ie=W.map(Gt),Me=O.reduce(Dt,{}),Ce=W.reduce(Dt,{}),$e=ye.slice(),nt=Object.create(null);for(ee=0,N=0;ee<ye.length;ee++)Ce.hasOwnProperty(Q=ye[ee])?N++:($.push({command:Be.removeLayer,args:[Q]}),$e.splice($e.indexOf(Q,N),1));for(ee=0,N=0;ee<Ie.length;ee++)$e[$e.length-1-ee]!==(Q=Ie[Ie.length-1-ee])&&(Me.hasOwnProperty(Q)?($.push({command:Be.removeLayer,args:[Q]}),$e.splice($e.lastIndexOf(Q,$e.length-N),1)):N++,$.push({command:Be.addLayer,args:[Ce[Q],de=$e[$e.length-ee]]}),$e.splice($e.length-ee,0,Q),nt[Q]=!0);for(ee=0;ee<Ie.length;ee++)if(ne=Me[Q=Ie[ee]],ue=Ce[Q],!nt[Q]&&!u.deepEqual(ne,ue))if(u.deepEqual(ne.source,ue.source)&&u.deepEqual(ne["source-layer"],ue["source-layer"])&&u.deepEqual(ne.type,ue.type)){for(pe in Pt(ne.layout,ue.layout,$,Q,null,Be.setLayoutProperty),Pt(ne.paint,ue.paint,$,Q,null,Be.setPaintProperty),u.deepEqual(ne.filter,ue.filter)||$.push({command:Be.setFilter,args:[Q,ue.filter]}),u.deepEqual(ne.minzoom,ue.minzoom)&&u.deepEqual(ne.maxzoom,ue.maxzoom)||$.push({command:Be.setLayerZoomRange,args:[Q,ue.minzoom,ue.maxzoom]}),ne)ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Pt(ne[pe],ue[pe],$,Q,pe.slice(6),Be.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||$.push({command:Be.setLayerProperty,args:[Q,pe,ue[pe]]}));for(pe in ue)ue.hasOwnProperty(pe)&&!ne.hasOwnProperty(pe)&&pe!=="layout"&&pe!=="paint"&&pe!=="filter"&&pe!=="metadata"&&pe!=="minzoom"&&pe!=="maxzoom"&&(pe.indexOf("paint.")===0?Pt(ne[pe],ue[pe],$,Q,pe.slice(6),Be.setPaintProperty):u.deepEqual(ne[pe],ue[pe])||$.push({command:Be.setLayerProperty,args:[Q,pe,ue[pe]]}))}else $.push({command:Be.removeLayer,args:[Q]}),de=$e[$e.lastIndexOf(Q)+1],$.push({command:Be.addLayer,args:[ue,de]})})(F,v.layers,w)}catch(O){console.warn("Unable to compute style diff:",O),w=[{command:Be.setStyle,args:[v]}]}return w})(this.serialize(),n).filter((function(d){return!(d.command in Wn)}));if(p.length===0)return!1;var f=p.filter((function(d){return!(d.command in $n)}));if(f.length>0)throw new Error("Unimplemented: "+f.map((function(d){return d.command})).join(", ")+".");return p.forEach((function(d){d.command!=="setTransition"&&s[d.command].apply(s,d.args)})),this.stylesheet=n,!0},o.prototype.addImage=function(n,s){if(this.getImage(n))return this.fire(new u.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(n,s),this._afterImageUpdated(n)},o.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},o.prototype.getImage=function(n){return this.imageManager.getImage(n)},o.prototype.removeImage=function(n){if(!this.getImage(n))return this.fire(new u.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(n),this._afterImageUpdated(n)},o.prototype._afterImageUpdated=function(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.Event("data",{dataType:"style"}))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(n,s,p){var f=this;if(p===void 0&&(p={}),this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(s).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(u.validateStyle.source,"sources."+n,s,null,p))){this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);var d=this.sourceCaches[n]=new H(n,s,this.dispatcher);d.style=this,d.setEventedParent(this,(function(){return{isSourceLoaded:f.loaded(),source:d.serialize(),sourceId:n}})),d.onAdd(this.map),this._changed=!0}},o.prototype.removeSource=function(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(var s in this._layers)if(this._layers[s].source===n)return this.fire(new u.ErrorEvent(new Error('Source "'+n+'" cannot be removed while layer "'+s+'" is using it.')));var p=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],p.fire(new u.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),p.setEventedParent(null),p.clearTiles(),p.onRemove&&p.onRemove(this.map),this._changed=!0},o.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},o.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},o.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=n.id;if(this.getLayer(f))this.fire(new u.ErrorEvent(new Error('Layer with id "'+f+'" already exists on this map')));else{var d;if(n.type==="custom"){if(go(this,u.validateCustomStyleLayer(n)))return;d=u.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(f,n.source),n=u.clone$1(n),n=u.extend(n,{source:f})),this._validate(u.validateStyle.layer,"layers."+f,n,{arrayIndex:-1},p))return;d=u.createStyleLayer(n),this._validateLayer(d),d.setEventedParent(this,{layer:{id:f}}),this._serializedLayers[d.id]=d.serialize()}var v=s?this._order.indexOf(s):this._order.length;if(s&&v===-1)this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.')));else{if(this._order.splice(v,0,f),this._layerOrderChanged=!0,this._layers[f]=d,this._removedLayers[f]&&d.source&&d.type!=="custom"){var w=this._removedLayers[f];delete this._removedLayers[f],w.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}},o.prototype.moveLayer=function(n,s){if(this._checkLoaded(),this._changed=!0,this._layers[n]){if(n!==s){var p=this._order.indexOf(n);this._order.splice(p,1);var f=s?this._order.indexOf(s):this._order.length;s&&f===-1?this.fire(new u.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(f,0,n),this._layerOrderChanged=!0)}}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")))},o.prototype.removeLayer=function(n){this._checkLoaded();var s=this._layers[n];if(s){s.setEventedParent(null);var p=this._order.indexOf(n);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map)}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(n){return this._layers[n]},o.prototype.hasLayer=function(n){return n in this._layers},o.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var f=this.getLayer(n);f?f.minzoom===s&&f.maxzoom===p||(s!=null&&(f.minzoom=s),p!=null&&(f.maxzoom=p),this._updateLayer(f)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=this.getLayer(n);if(f){if(!u.deepEqual(f.filter,s))return s==null?(f.filter=void 0,void this._updateLayer(f)):void(this._validate(u.validateStyle.filter,"layers."+f.id+".filter",s,null,p)||(f.filter=u.clone$1(s),this._updateLayer(f)))}else this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(n){return u.clone$1(this.getLayer(n).filter)},o.prototype.setLayoutProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getLayoutProperty(s),p)||(d.setLayoutProperty(s,p,f),this._updateLayer(d)):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getLayoutProperty=function(n,s){var p=this.getLayer(n);if(p)return p.getLayoutProperty(s);this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style.")))},o.prototype.setPaintProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?u.deepEqual(d.getPaintProperty(s),p)||(d.setPaintProperty(s,p,f)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new u.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},o.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=n.sourceLayer,d=this.sourceCaches[p];if(d!==void 0){var v=d.getSource().type;v==="geojson"&&f?this.fire(new u.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):v!=="vector"||f?(n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(f,n.id,s)):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=this.sourceCaches[p];if(f!==void 0){var d=f.getSource().type,v=d==="vector"?n.sourceLayer:void 0;d!=="vector"||v?s&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new u.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):f.removeFeatureState(v,n.id,s):this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,f=this.sourceCaches[s];if(f!==void 0){if(f.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new u.ErrorEvent(new Error("The feature id parameter must be provided."))),f.getFeatureState(p,n.id);this.fire(new u.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new u.ErrorEvent(new Error("The source '"+s+"' does not exist in the map's style.")))},o.prototype.getTransition=function(){return u.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){return u.filterObject({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:u.mapObject(this.sourceCaches,(function(n){return n.serialize()})),layers:this._serializeLayers(this._order)},(function(n){return n!==void 0}))},o.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0},o.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(Me){return s._layers[Me].type==="fill-extrusion"},f={},d=[],v=this._order.length-1;v>=0;v--){var w=this._order[v];if(p(w)){f[w]=v;for(var A=0,D=n;A<D.length;A+=1){var F=D[A][w];if(F)for(var O=0,W=F;O<W.length;O+=1)d.push(W[O])}}}d.sort((function(Me,Ce){return Ce.intersectionZ-Me.intersectionZ}));for(var $=[],ee=this._order.length-1;ee>=0;ee--){var N=this._order[ee];if(p(N))for(var Q=d.length-1;Q>=0;Q--){var ne=d[Q].feature;if(f[ne.layer.id]<ee)break;$.push(ne),d.pop()}else for(var ue=0,de=n;ue<de.length;ue+=1){var pe=de[ue][N];if(pe)for(var ye=0,Ie=pe;ye<Ie.length;ye+=1)$.push(Ie[ye].feature)}}return $},o.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(u.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var f={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new u.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var d=0,v=s.layers;d<v.length;d+=1){var w=v[d],A=this._layers[w];if(!A)return this.fire(new u.ErrorEvent(new Error("The layer '"+w+"' does not exist in the map's style and cannot be queried for features."))),[];f[A.source]=!0}}var D=[];for(var F in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!f[F]||D.push(Or(this.sourceCaches[F],this._layers,this._serializedLayers,n,s,p));return this.placement&&D.push((function(O,W,$,ee,N,Q,ne){for(var ue={},de=Q.queryRenderedSymbols(ee),pe=[],ye=0,Ie=Object.keys(de).map(Number);ye<Ie.length;ye+=1)pe.push(ne[Ie[ye]]);pe.sort(Xi);for(var Me=function(){var st=$e[Ce],Lt=st.featureIndex.lookupSymbolFeatures(de[st.bucketInstanceId],W,st.bucketIndex,st.sourceLayerIndex,N.filter,N.layers,N.availableImages,O);for(var He in Lt){var mt=ue[He]=ue[He]||[],xt=Lt[He];xt.sort((function(gt,ht){var ct=st.featureSortOrder;if(ct){var Jr=ct.indexOf(gt.featureIndex);return ct.indexOf(ht.featureIndex)-Jr}return ht.featureIndex-gt.featureIndex}));for(var dt=0,ft=xt;dt<ft.length;dt+=1)mt.push(ft[dt])}},Ce=0,$e=pe;Ce<$e.length;Ce+=1)Me();var nt=function(st){ue[st].forEach((function(Lt){var He=Lt.feature,mt=$[O[st].source].getFeatureState(He.layer["source-layer"],He.id);He.source=He.layer.source,He.layer["source-layer"]&&(He.sourceLayer=He.layer["source-layer"]),He.state=mt}))};for(var ut in ue)nt(ut);return ue})(this._layers,this._serializedLayers,this.sourceCaches,n,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(D)},o.prototype.querySourceFeatures=function(n,s){s&&s.filter&&this._validate(u.validateStyle.filter,"querySourceFeatures.filter",s.filter,null,s);var p=this.sourceCaches[n];return p?(function(f,d){for(var v=f.getRenderableIds().map((function(W){return f.getTileByID(W)})),w=[],A={},D=0;D<v.length;D++){var F=v[D],O=F.tileID.canonical.key;A[O]||(A[O]=!0,F.querySourceFeatures(w,d))}return w})(p,s):[]},o.prototype.addSourceType=function(n,s,p){return o.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(o.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),f=!1;for(var d in n)if(!u.deepEqual(n[d],p[d])){f=!0;break}if(f){var v={now:u.browser.now(),transition:u.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,s),this.light.updateTransitions(v)}},o.prototype._validate=function(n,s,p,f,d){return d===void 0&&(d={}),(!d||d.validate!==!1)&&go(this,n.call(u.validateStyle,u.extend({key:s,style:this.serialize(),value:p,styleSpec:u.styleSpec},f)))},o.prototype._remove=function(){for(var n in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),u.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[n].setEventedParent(null);for(var s in this.sourceCaches)this.sourceCaches[s].clearTiles(),this.sourceCaches[s].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},o.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},o.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},o.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},o.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},o.prototype._updatePlacement=function(n,s,p,f,d){d===void 0&&(d=!1);for(var v=!1,w=!1,A={},D=0,F=this._order;D<F.length;D+=1){var O=this._layers[F[D]];if(O.type==="symbol"){if(!A[O.source]){var W=this.sourceCaches[O.source];A[O.source]=W.getRenderableIds(!0).map((function(ne){return W.getTileByID(ne)})).sort((function(ne,ue){return ue.tileID.overscaledZ-ne.tileID.overscaledZ||(ne.tileID.isLessThan(ue.tileID)?-1:1)}))}var $=this.crossTileSymbolIndex.addLayer(O,A[O.source],n.center.lng);v=v||$}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.browser.now(),n.zoom))&&(this.pauseablePlacement=new ga(n,this._order,d,s,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.browser.now()),w=!0),v&&this.pauseablePlacement.placement.setStale()),w||v)for(var ee=0,N=this._order;ee<N.length;ee+=1){var Q=this._layers[N[ee]];Q.type==="symbol"&&this.placement.updateLayerOpacities(Q,A[Q.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.browser.now())},o.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},o.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var f=this.sourceCaches[s.source];f&&f.setDependencies(s.tileID.key,s.type,s.icons)},o.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},o.prototype.getResource=function(n,s,p){return u.makeRequest(s,p)},o})(u.Evented);Ui.getSourceType=function(i){return Mi[i]},Ui.setSourceType=function(i,o){Mi[i]=o},Ui.registerForPluginStateChange=u.registerForPluginStateChange;var Vr=u.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ho=ir(`#ifdef GL_ES
2
2
  precision mediump float;
3
3
  #else
4
4
  #if !defined(lowp)