@oiz/stzh-components 2.5.0-alpha-carousel → 2.5.0-alpha

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 (847) hide show
  1. package/dist/cjs/{app-globals-d7bd37fe.js → app-globals-0c3558c0.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/overlay-utils-00d640c8.js +19 -0
  4. package/dist/cjs/stzh-accordion-item.cjs.entry.js +36 -2
  5. package/dist/cjs/stzh-accordion.cjs.entry.js +1 -1
  6. package/dist/cjs/stzh-actions.cjs.entry.js +1 -1
  7. package/dist/cjs/stzh-actionset.cjs.entry.js +1 -1
  8. package/dist/cjs/stzh-anchornav.cjs.entry.js +1 -1
  9. package/dist/cjs/stzh-appnav.cjs.entry.js +1 -1
  10. package/dist/cjs/stzh-appointments.cjs.entry.js +1 -1
  11. package/dist/cjs/stzh-audio.cjs.entry.js +1 -1
  12. package/dist/cjs/stzh-badge_3.cjs.entry.js +12 -4
  13. package/dist/cjs/stzh-buttongroup.cjs.entry.js +23 -0
  14. package/dist/cjs/stzh-calendar.cjs.entry.js +1 -1
  15. package/dist/cjs/stzh-card_3.cjs.entry.js +12 -10
  16. package/dist/cjs/stzh-carousel.cjs.entry.js +1 -1
  17. package/dist/cjs/stzh-cell.cjs.entry.js +1 -1
  18. package/dist/cjs/stzh-chart.cjs.entry.js +1 -1
  19. package/dist/cjs/stzh-checkbox.cjs.entry.js +11 -3
  20. package/dist/cjs/stzh-checkboxgroup.cjs.entry.js +1 -1
  21. package/dist/cjs/stzh-chip_2.cjs.entry.js +11 -3
  22. package/dist/cjs/stzh-components.cjs.js +2 -2
  23. package/dist/cjs/stzh-contact.cjs.entry.js +1 -1
  24. package/dist/cjs/stzh-container.cjs.entry.js +1 -1
  25. package/dist/cjs/stzh-cspace.cjs.entry.js +1 -1
  26. package/dist/cjs/stzh-datalist_2.cjs.entry.js +25 -9
  27. package/dist/cjs/stzh-datamessagelist-item.cjs.entry.js +15 -6
  28. package/dist/cjs/stzh-datamessagelist.cjs.entry.js +1 -1
  29. package/dist/cjs/stzh-datatable.cjs.entry.js +1 -1
  30. package/dist/cjs/stzh-datepicker_3.cjs.entry.js +19 -6
  31. package/dist/cjs/stzh-details.cjs.entry.js +1 -1
  32. package/dist/cjs/stzh-dialog.cjs.entry.js +3 -5
  33. package/dist/cjs/stzh-dropdown.cjs.entry.js +14 -3
  34. package/dist/cjs/stzh-fieldset.cjs.entry.js +1 -1
  35. package/dist/cjs/stzh-figure.cjs.entry.js +1 -1
  36. package/dist/cjs/stzh-flyingfocus.cjs.entry.js +4 -2
  37. package/dist/cjs/stzh-footer.cjs.entry.js +1 -1
  38. package/dist/cjs/stzh-ghettobox_2.cjs.entry.js +3 -3
  39. package/dist/cjs/stzh-header.cjs.entry.js +1 -1
  40. package/dist/cjs/stzh-heading.cjs.entry.js +1 -1
  41. package/dist/cjs/stzh-hr.cjs.entry.js +1 -1
  42. package/dist/cjs/stzh-hspace.cjs.entry.js +1 -1
  43. package/dist/cjs/stzh-icon-sprite.cjs.entry.js +2 -2
  44. package/dist/cjs/stzh-input.cjs.entry.js +10 -3
  45. package/dist/cjs/stzh-invert.cjs.entry.js +1 -1
  46. package/dist/cjs/stzh-langnav.cjs.entry.js +1 -1
  47. package/dist/cjs/stzh-link.cjs.entry.js +10 -2
  48. package/dist/cjs/stzh-list-item.cjs.entry.js +1 -1
  49. package/dist/cjs/stzh-list.cjs.entry.js +1 -1
  50. package/dist/cjs/stzh-loader.cjs.entry.js +1 -1
  51. package/dist/cjs/stzh-loadingbar.cjs.entry.js +1 -1
  52. package/dist/cjs/stzh-menu_2.cjs.entry.js +11 -3
  53. package/dist/cjs/stzh-message.cjs.entry.js +2 -2
  54. package/dist/cjs/stzh-metanav.cjs.entry.js +1 -1
  55. package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js +1 -1
  56. package/dist/cjs/stzh-olmap.cjs.entry.js +53 -7
  57. package/dist/cjs/stzh-overlay.cjs.entry.js +3 -5
  58. package/dist/cjs/stzh-page-skiplinks.cjs.entry.js +1 -1
  59. package/dist/cjs/stzh-pagebottom.cjs.entry.js +1 -1
  60. package/dist/cjs/stzh-pagetitle-hero.cjs.entry.js +1 -1
  61. package/dist/cjs/stzh-pagetitle.cjs.entry.js +1 -1
  62. package/dist/cjs/stzh-popover.cjs.entry.js +1 -1
  63. package/dist/cjs/stzh-portal-mitwirken.cjs.entry.js +1 -1
  64. package/dist/cjs/stzh-progressbar-item.cjs.entry.js +1 -1
  65. package/dist/cjs/stzh-progressbar.cjs.entry.js +1 -1
  66. package/dist/cjs/stzh-ratio.cjs.entry.js +1 -1
  67. package/dist/cjs/stzh-readspeaker.cjs.entry.js +1 -1
  68. package/dist/cjs/stzh-row.cjs.entry.js +1 -1
  69. package/dist/cjs/stzh-saptcha.cjs.entry.js +1 -1
  70. package/dist/cjs/stzh-section.cjs.entry.js +1 -1
  71. package/dist/cjs/stzh-share.cjs.entry.js +1 -1
  72. package/dist/cjs/stzh-show.cjs.entry.js +1 -1
  73. package/dist/cjs/stzh-sitemap.cjs.entry.js +1 -1
  74. package/dist/cjs/stzh-skiplink.cjs.entry.js +1 -1
  75. package/dist/cjs/stzh-sortable.cjs.entry.js +1 -1
  76. package/dist/cjs/stzh-space.cjs.entry.js +1 -1
  77. package/dist/cjs/stzh-status.cjs.entry.js +1 -1
  78. package/dist/cjs/stzh-sticky.cjs.entry.js +1 -1
  79. package/dist/cjs/stzh-table.cjs.entry.js +1 -1
  80. package/dist/cjs/stzh-text.cjs.entry.js +1 -1
  81. package/dist/cjs/stzh-textandimage.cjs.entry.js +1 -1
  82. package/dist/cjs/stzh-toggle.cjs.entry.js +11 -3
  83. package/dist/cjs/stzh-tooltip.cjs.entry.js +1 -1
  84. package/dist/cjs/stzh-upload.cjs.entry.js +1 -1
  85. package/dist/cjs/stzh-vbz-linechip.cjs.entry.js +11 -2
  86. package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js +1 -1
  87. package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +1 -1
  88. package/dist/cjs/stzh-visuallyhidden.cjs.entry.js +1 -1
  89. package/dist/cjs/stzh-vspace.cjs.entry.js +1 -1
  90. package/dist/collection/assets/i18n/de.json +1 -0
  91. package/dist/collection/assets/i18n/en.json +1 -0
  92. package/dist/collection/assets/icons/mono/mail.svg +1 -1
  93. package/dist/collection/assets/media/olmap/marker-active.png +0 -0
  94. package/dist/collection/assets/media/olmap/marker-position.png +0 -0
  95. package/dist/collection/assets/media/olmap/marker.png +0 -0
  96. package/dist/collection/assets/vendors/readspeaker/ReadSpeaker.Styles-Basic.css +881 -881
  97. package/dist/collection/assets/vendors/readspeaker/ReadSpeaker.Styles-Button.css +75 -75
  98. package/dist/collection/assets/vendors/readspeaker/ReadSpeaker.Styles.css +977 -977
  99. package/dist/collection/assets/vendors/readspeaker/ReadSpeakerClassic.css +2 -2
  100. package/dist/collection/collection-manifest.json +1 -0
  101. package/dist/collection/components/stzh-accordion/stzh-accordion.css +2 -0
  102. package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.css +2 -0
  103. package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.js +73 -1
  104. package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.stories.js +1 -1
  105. package/dist/collection/components/stzh-actions/stzh-actions.css +2 -0
  106. package/dist/collection/components/stzh-actionset/stzh-actionset.css +2 -0
  107. package/dist/collection/components/stzh-anchornav/stzh-anchornav.css +4 -2
  108. package/dist/collection/components/stzh-appnav/stzh-appnav.css +6 -3
  109. package/dist/collection/components/stzh-appointments/stzh-appointments.css +2 -0
  110. package/dist/collection/components/stzh-audio/stzh-audio.css +2 -0
  111. package/dist/collection/components/stzh-badge/stzh-badge.css +4 -2
  112. package/dist/collection/components/stzh-button/stzh-button.css +9 -3
  113. package/dist/collection/components/stzh-button/stzh-button.js +9 -1
  114. package/dist/collection/components/stzh-buttongroup/stzh-buttongroup.css +123 -0
  115. package/dist/collection/components/stzh-buttongroup/stzh-buttongroup.js +25 -0
  116. package/dist/collection/components/stzh-buttongroup/stzh-buttongroup.stories.js +57 -0
  117. package/dist/collection/components/stzh-calendar/stzh-calendar.css +8 -3
  118. package/dist/collection/components/stzh-card/stzh-card.css +12 -7
  119. package/dist/collection/components/stzh-card-list/stzh-card-list.css +2 -0
  120. package/dist/collection/components/stzh-carousel/stzh-carousel.css +2 -7
  121. package/dist/collection/components/stzh-carousel/stzh-carousel.stories.js +20 -18
  122. package/dist/collection/components/stzh-cell/stzh-cell.css +2 -0
  123. package/dist/collection/components/stzh-chart/stzh-chart.css +4 -0
  124. package/dist/collection/components/stzh-checkbox/stzh-checkbox.css +6 -1
  125. package/dist/collection/components/stzh-checkbox/stzh-checkbox.js +11 -3
  126. package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.css +2 -0
  127. package/dist/collection/components/stzh-chip/stzh-chip.css +10 -6
  128. package/dist/collection/components/stzh-chip/stzh-chip.js +9 -1
  129. package/dist/collection/components/stzh-chip-select/stzh-chip-select.css +2 -0
  130. package/dist/collection/components/stzh-chip-select/stzh-chip-select.js +9 -7
  131. package/dist/collection/components/stzh-clamp/stzh-clamp.css +4 -0
  132. package/dist/collection/components/stzh-contact/stzh-contact.css +2 -0
  133. package/dist/collection/components/stzh-container/stzh-container.css +2 -0
  134. package/dist/collection/components/stzh-cspace/stzh-cspace.css +2 -0
  135. package/dist/collection/components/stzh-datalist/stzh-datalist.css +2 -0
  136. package/dist/collection/components/stzh-datalist/stzh-datalist.js +1 -1
  137. package/dist/collection/components/stzh-datalist/stzh-datalist.stories.js +4 -1
  138. package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.css +8 -13
  139. package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.js +65 -7
  140. package/dist/collection/components/stzh-datamessagelist/stzh-datamessagelist.css +2 -0
  141. package/dist/collection/components/stzh-datamessagelist/stzh-datamessagelist.stories.js +2 -1
  142. package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.css +28 -4
  143. package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.js +59 -10
  144. package/dist/collection/components/stzh-datatable/stzh-datatable.css +4 -0
  145. package/dist/collection/components/stzh-datepicker/stzh-datepicker.css +2 -0
  146. package/dist/collection/components/stzh-datepicker/stzh-datepicker.js +6 -1
  147. package/dist/collection/components/stzh-details/stzh-details.css +2 -0
  148. package/dist/collection/components/stzh-dialog/stzh-dialog.css +2 -0
  149. package/dist/collection/components/stzh-dialog/stzh-dialog.js +2 -4
  150. package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +8 -3
  151. package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +14 -3
  152. package/dist/collection/components/stzh-fieldset/stzh-fieldset.css +2 -0
  153. package/dist/collection/components/stzh-figure/stzh-figure.css +2 -0
  154. package/dist/collection/components/stzh-flyingfocus/stzh-flyingfocus.css +2 -0
  155. package/dist/collection/components/stzh-flyingfocus/stzh-flyingfocus.js +9 -1
  156. package/dist/collection/components/stzh-footer/stzh-footer.css +5 -1
  157. package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.css +91 -51
  158. package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.js +1 -1
  159. package/dist/collection/components/stzh-header/stzh-header.css +2 -0
  160. package/dist/collection/components/stzh-heading/stzh-heading.css +2 -0
  161. package/dist/collection/components/stzh-hr/stzh-hr.css +2 -0
  162. package/dist/collection/components/stzh-hspace/stzh-hspace.css +2 -0
  163. package/dist/collection/components/stzh-icon/stzh-icon.css +2 -0
  164. package/dist/collection/components/stzh-icon-sprite/assets/svgsprites/symbol/sprite.symbol.html +1 -1
  165. package/dist/collection/components/stzh-icon-sprite/assets/svgsprites/symbol/svg/sprite.symbol.svg +1 -1
  166. package/dist/collection/components/stzh-icon-sprite/stzh-icon-sprite.css +2 -0
  167. package/dist/collection/components/stzh-input/stzh-input.css +2 -1
  168. package/dist/collection/components/stzh-input/stzh-input.js +9 -2
  169. package/dist/collection/components/stzh-invert/stzh-invert.css +79 -18
  170. package/dist/collection/components/stzh-invert/stzh-invert.stories.js +31 -7
  171. package/dist/collection/components/stzh-langnav/stzh-langnav.css +2 -0
  172. package/dist/collection/components/stzh-link/stzh-link.css +10 -8
  173. package/dist/collection/components/stzh-link/stzh-link.js +9 -1
  174. package/dist/collection/components/stzh-list/stzh-list.css +2 -0
  175. package/dist/collection/components/stzh-list-item/stzh-list-item.css +2 -0
  176. package/dist/collection/components/stzh-loader/stzh-loader.css +2 -0
  177. package/dist/collection/components/stzh-loadingbar/stzh-loadingbar.css +2 -0
  178. package/dist/collection/components/stzh-menu/stzh-menu.css +2 -0
  179. package/dist/collection/components/stzh-menu-item/stzh-menu-item.css +6 -2
  180. package/dist/collection/components/stzh-menu-item/stzh-menu-item.js +9 -1
  181. package/dist/collection/components/stzh-message/stzh-message.css +8 -54
  182. package/dist/collection/components/stzh-message/stzh-message.js +1 -1
  183. package/dist/collection/components/stzh-metanav/stzh-metanav.css +6 -10
  184. package/dist/collection/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.css +2 -0
  185. package/dist/collection/components/stzh-olmap/assets/compass.svg +6 -0
  186. package/dist/collection/components/stzh-olmap/stzh-olmap.css +106 -46
  187. package/dist/collection/components/stzh-olmap/stzh-olmap.js +91 -10
  188. package/dist/collection/components/stzh-overlay/stzh-overlay.css +2 -0
  189. package/dist/collection/components/stzh-overlay/stzh-overlay.js +2 -4
  190. package/dist/collection/components/stzh-page-skiplinks/stzh-page-skiplinks.css +2 -0
  191. package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.css +2 -0
  192. package/dist/collection/components/stzh-pagetitle/stzh-pagetitle.css +2 -0
  193. package/dist/collection/components/stzh-pagetitle-hero/stzh-pagetitle-hero.css +40 -14
  194. package/dist/collection/components/stzh-popover/stzh-popover.css +2 -0
  195. package/dist/collection/components/stzh-portal-mitwirken/stzh-portal-mitwirken.css +39 -13
  196. package/dist/collection/components/stzh-progressbar/stzh-progressbar.css +2 -0
  197. package/dist/collection/components/stzh-progressbar-item/stzh-progressbar-item.css +4 -1
  198. package/dist/collection/components/stzh-radio/stzh-radio.css +6 -1
  199. package/dist/collection/components/stzh-radio/stzh-radio.js +11 -3
  200. package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.css +2 -0
  201. package/dist/collection/components/stzh-ratio/stzh-ratio.css +2 -0
  202. package/dist/collection/components/stzh-readspeaker/stzh-readspeaker.css +4 -0
  203. package/dist/collection/components/stzh-richtext/stzh-richtext.css +5 -1
  204. package/dist/collection/components/stzh-row/stzh-row.css +2 -0
  205. package/dist/collection/components/stzh-saptcha/stzh-saptcha.css +2 -0
  206. package/dist/collection/components/stzh-section/stzh-section.css +2 -0
  207. package/dist/collection/components/stzh-share/stzh-share.css +2 -0
  208. package/dist/collection/components/stzh-show/stzh-show.css +2 -0
  209. package/dist/collection/components/stzh-sitemap/stzh-sitemap.css +2 -0
  210. package/dist/collection/components/stzh-skiplink/stzh-skiplink.css +4 -1
  211. package/dist/collection/components/stzh-skiplink/stzh-skiplink.stories.js +3 -8
  212. package/dist/collection/components/stzh-sortable/stzh-sortable.css +2 -0
  213. package/dist/collection/components/stzh-space/stzh-space.css +2 -0
  214. package/dist/collection/components/stzh-status/stzh-status.css +2 -0
  215. package/dist/collection/components/stzh-sticky/stzh-sticky.css +2 -0
  216. package/dist/collection/components/stzh-table/stzh-table.css +4 -0
  217. package/dist/collection/components/stzh-text/stzh-text.css +17 -0
  218. package/dist/collection/components/stzh-text/stzh-text.stories.js +10 -0
  219. package/dist/collection/components/stzh-textandimage/stzh-textandimage.css +2 -0
  220. package/dist/collection/components/stzh-toggle/stzh-toggle.css +6 -1
  221. package/dist/collection/components/stzh-toggle/stzh-toggle.js +11 -3
  222. package/dist/collection/components/stzh-tooltip/stzh-tooltip.css +2 -0
  223. package/dist/collection/components/stzh-upload/stzh-upload.css +4 -0
  224. package/dist/collection/components/stzh-vbz-linechip/stzh-vbz-linechip.css +3 -1
  225. package/dist/collection/components/stzh-vbz-linechip/stzh-vbz-linechip.js +28 -1
  226. package/dist/collection/components/stzh-vbz-majorticker/stzh-vbz-majorticker.css +2 -0
  227. package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.css +2 -0
  228. package/dist/collection/components/stzh-visuallyhidden/stzh-visuallyhidden.css +2 -0
  229. package/dist/collection/components/stzh-vspace/stzh-vspace.css +2 -0
  230. package/dist/collection/pages/egov.stories.js +69 -56
  231. package/dist/collection/pages/meinkonto.stories.js +71 -69
  232. package/dist/collection/pages/microsite.stories.js +13 -11
  233. package/dist/collection/pages/website.stories.js +14 -12
  234. package/dist/collection/utils/overlay-utils.js +15 -0
  235. package/dist/components/index.d.ts +1 -0
  236. package/dist/components/index.js +2 -1
  237. package/dist/components/overlay-utils.js +17 -0
  238. package/dist/components/stzh-accordion-item.js +36 -2
  239. package/dist/components/stzh-accordion.js +1 -1
  240. package/dist/components/stzh-actions.js +1 -1
  241. package/dist/components/stzh-actionset2.js +1 -1
  242. package/dist/components/stzh-anchornav.js +1 -1
  243. package/dist/components/stzh-appnav.js +1 -1
  244. package/dist/components/stzh-appointments.js +1 -1
  245. package/dist/components/stzh-audio.js +1 -1
  246. package/dist/components/stzh-badge2.js +1 -1
  247. package/dist/components/stzh-button2.js +10 -2
  248. package/dist/components/stzh-buttongroup.d.ts +11 -0
  249. package/dist/components/stzh-buttongroup.js +36 -0
  250. package/dist/components/stzh-calendar2.js +1 -1
  251. package/dist/components/stzh-card-list2.js +1 -1
  252. package/dist/components/stzh-card2.js +1 -1
  253. package/dist/components/stzh-carousel.js +1 -1
  254. package/dist/components/stzh-cell.js +1 -1
  255. package/dist/components/stzh-chart.js +1 -1
  256. package/dist/components/stzh-checkbox.js +12 -4
  257. package/dist/components/stzh-checkboxgroup.js +1 -1
  258. package/dist/components/stzh-chip-select2.js +10 -8
  259. package/dist/components/stzh-chip2.js +10 -2
  260. package/dist/components/stzh-clamp2.js +1 -1
  261. package/dist/components/stzh-contact.js +21 -15
  262. package/dist/components/stzh-container.js +1 -1
  263. package/dist/components/stzh-cspace.js +1 -1
  264. package/dist/components/stzh-datalist-item2.js +42 -17
  265. package/dist/components/stzh-datalist2.js +17 -11
  266. package/dist/components/stzh-datamessagelist-item.js +20 -8
  267. package/dist/components/stzh-datamessagelist.js +1 -1
  268. package/dist/components/stzh-datatable.js +1 -1
  269. package/dist/components/stzh-datepicker2.js +7 -2
  270. package/dist/components/stzh-details.js +1 -1
  271. package/dist/components/stzh-dialog.js +3 -5
  272. package/dist/components/stzh-dropdown2.js +14 -3
  273. package/dist/components/stzh-fieldset.js +1 -1
  274. package/dist/components/stzh-figure.js +1 -1
  275. package/dist/components/stzh-flyingfocus.js +5 -3
  276. package/dist/components/stzh-footer.js +1 -1
  277. package/dist/components/stzh-ghettobox2.js +15 -3
  278. package/dist/components/stzh-header.js +1 -1
  279. package/dist/components/stzh-heading2.js +1 -1
  280. package/dist/components/stzh-hr.js +1 -1
  281. package/dist/components/stzh-hspace.js +1 -1
  282. package/dist/components/stzh-icon-sprite.js +2 -2
  283. package/dist/components/stzh-icon2.js +1 -1
  284. package/dist/components/stzh-input2.js +10 -3
  285. package/dist/components/stzh-invert.js +1 -1
  286. package/dist/components/stzh-langnav.js +1 -1
  287. package/dist/components/stzh-link2.js +10 -2
  288. package/dist/components/stzh-list-item.js +1 -1
  289. package/dist/components/stzh-list.js +1 -1
  290. package/dist/components/stzh-loader2.js +1 -1
  291. package/dist/components/stzh-loadingbar.js +1 -1
  292. package/dist/components/stzh-menu-item2.js +10 -2
  293. package/dist/components/stzh-menu2.js +1 -1
  294. package/dist/components/stzh-message.js +15 -3
  295. package/dist/components/stzh-metanav.js +1 -1
  296. package/dist/components/stzh-microsite-teaserlist.js +1 -1
  297. package/dist/components/stzh-olmap.js +55 -8
  298. package/dist/components/stzh-overlay.js +3 -5
  299. package/dist/components/stzh-page-skiplinks.js +1 -1
  300. package/dist/components/stzh-pagebottom.js +1 -1
  301. package/dist/components/stzh-pagetitle-hero.js +1 -1
  302. package/dist/components/stzh-pagetitle.js +1 -1
  303. package/dist/components/stzh-popover2.js +1 -1
  304. package/dist/components/stzh-portal-mitwirken.js +1 -1
  305. package/dist/components/stzh-progressbar-item2.js +1 -1
  306. package/dist/components/stzh-progressbar.js +1 -1
  307. package/dist/components/stzh-radio2.js +12 -4
  308. package/dist/components/stzh-radiogroup2.js +1 -1
  309. package/dist/components/stzh-ratio.js +1 -1
  310. package/dist/components/stzh-readspeaker.js +1 -1
  311. package/dist/components/stzh-richtext2.js +1 -1
  312. package/dist/components/stzh-row.js +1 -1
  313. package/dist/components/stzh-saptcha.js +1 -1
  314. package/dist/components/stzh-section.js +1 -1
  315. package/dist/components/stzh-share2.js +1 -1
  316. package/dist/components/stzh-show.js +1 -1
  317. package/dist/components/stzh-sitemap.js +19 -13
  318. package/dist/components/stzh-skiplink.js +1 -1
  319. package/dist/components/stzh-sortable2.js +1 -1
  320. package/dist/components/stzh-space.js +1 -1
  321. package/dist/components/stzh-status2.js +1 -1
  322. package/dist/components/stzh-sticky.js +1 -1
  323. package/dist/components/stzh-table.js +1 -1
  324. package/dist/components/stzh-text2.js +1 -1
  325. package/dist/components/stzh-textandimage.js +1 -1
  326. package/dist/components/stzh-toggle.js +12 -4
  327. package/dist/components/stzh-tooltip2.js +1 -1
  328. package/dist/components/stzh-upload.js +1 -1
  329. package/dist/components/stzh-vbz-linechip2.js +12 -2
  330. package/dist/components/stzh-vbz-majorticker.js +1 -1
  331. package/dist/components/stzh-vbz-ticker.js +1 -1
  332. package/dist/components/stzh-visuallyhidden.js +1 -1
  333. package/dist/components/stzh-vspace.js +1 -1
  334. package/dist/esm/{app-globals-62e1178d.js → app-globals-a58b5d2d.js} +1 -1
  335. package/dist/esm/loader.js +2 -2
  336. package/dist/esm/overlay-utils-33021971.js +17 -0
  337. package/dist/esm/stzh-accordion-item.entry.js +36 -2
  338. package/dist/esm/stzh-accordion.entry.js +1 -1
  339. package/dist/esm/stzh-actions.entry.js +1 -1
  340. package/dist/esm/stzh-actionset.entry.js +1 -1
  341. package/dist/esm/stzh-anchornav.entry.js +1 -1
  342. package/dist/esm/stzh-appnav.entry.js +1 -1
  343. package/dist/esm/stzh-appointments.entry.js +1 -1
  344. package/dist/esm/stzh-audio.entry.js +1 -1
  345. package/dist/esm/stzh-badge_3.entry.js +12 -4
  346. package/dist/esm/stzh-buttongroup.entry.js +19 -0
  347. package/dist/esm/stzh-calendar.entry.js +1 -1
  348. package/dist/esm/stzh-card_3.entry.js +12 -10
  349. package/dist/esm/stzh-carousel.entry.js +1 -1
  350. package/dist/esm/stzh-cell.entry.js +1 -1
  351. package/dist/esm/stzh-chart.entry.js +1 -1
  352. package/dist/esm/stzh-checkbox.entry.js +12 -4
  353. package/dist/esm/stzh-checkboxgroup.entry.js +1 -1
  354. package/dist/esm/stzh-chip_2.entry.js +11 -3
  355. package/dist/esm/stzh-components.js +2 -2
  356. package/dist/esm/stzh-contact.entry.js +1 -1
  357. package/dist/esm/stzh-container.entry.js +1 -1
  358. package/dist/esm/stzh-cspace.entry.js +1 -1
  359. package/dist/esm/stzh-datalist_2.entry.js +25 -9
  360. package/dist/esm/stzh-datamessagelist-item.entry.js +15 -6
  361. package/dist/esm/stzh-datamessagelist.entry.js +1 -1
  362. package/dist/esm/stzh-datatable.entry.js +1 -1
  363. package/dist/esm/stzh-datepicker_3.entry.js +19 -6
  364. package/dist/esm/stzh-details.entry.js +1 -1
  365. package/dist/esm/stzh-dialog.entry.js +3 -5
  366. package/dist/esm/stzh-dropdown.entry.js +14 -3
  367. package/dist/esm/stzh-fieldset.entry.js +1 -1
  368. package/dist/esm/stzh-figure.entry.js +1 -1
  369. package/dist/esm/stzh-flyingfocus.entry.js +4 -2
  370. package/dist/esm/stzh-footer.entry.js +1 -1
  371. package/dist/esm/stzh-ghettobox_2.entry.js +3 -3
  372. package/dist/esm/stzh-header.entry.js +1 -1
  373. package/dist/esm/stzh-heading.entry.js +1 -1
  374. package/dist/esm/stzh-hr.entry.js +1 -1
  375. package/dist/esm/stzh-hspace.entry.js +1 -1
  376. package/dist/esm/stzh-icon-sprite.entry.js +2 -2
  377. package/dist/esm/stzh-input.entry.js +10 -3
  378. package/dist/esm/stzh-invert.entry.js +1 -1
  379. package/dist/esm/stzh-langnav.entry.js +1 -1
  380. package/dist/esm/stzh-link.entry.js +10 -2
  381. package/dist/esm/stzh-list-item.entry.js +1 -1
  382. package/dist/esm/stzh-list.entry.js +1 -1
  383. package/dist/esm/stzh-loader.entry.js +1 -1
  384. package/dist/esm/stzh-loadingbar.entry.js +1 -1
  385. package/dist/esm/stzh-menu_2.entry.js +11 -3
  386. package/dist/esm/stzh-message.entry.js +2 -2
  387. package/dist/esm/stzh-metanav.entry.js +1 -1
  388. package/dist/esm/stzh-microsite-teaserlist.entry.js +1 -1
  389. package/dist/esm/stzh-olmap.entry.js +53 -7
  390. package/dist/esm/stzh-overlay.entry.js +3 -5
  391. package/dist/esm/stzh-page-skiplinks.entry.js +1 -1
  392. package/dist/esm/stzh-pagebottom.entry.js +1 -1
  393. package/dist/esm/stzh-pagetitle-hero.entry.js +1 -1
  394. package/dist/esm/stzh-pagetitle.entry.js +1 -1
  395. package/dist/esm/stzh-popover.entry.js +1 -1
  396. package/dist/esm/stzh-portal-mitwirken.entry.js +1 -1
  397. package/dist/esm/stzh-progressbar-item.entry.js +1 -1
  398. package/dist/esm/stzh-progressbar.entry.js +1 -1
  399. package/dist/esm/stzh-ratio.entry.js +1 -1
  400. package/dist/esm/stzh-readspeaker.entry.js +1 -1
  401. package/dist/esm/stzh-row.entry.js +1 -1
  402. package/dist/esm/stzh-saptcha.entry.js +1 -1
  403. package/dist/esm/stzh-section.entry.js +1 -1
  404. package/dist/esm/stzh-share.entry.js +1 -1
  405. package/dist/esm/stzh-show.entry.js +1 -1
  406. package/dist/esm/stzh-sitemap.entry.js +1 -1
  407. package/dist/esm/stzh-skiplink.entry.js +1 -1
  408. package/dist/esm/stzh-sortable.entry.js +1 -1
  409. package/dist/esm/stzh-space.entry.js +1 -1
  410. package/dist/esm/stzh-status.entry.js +1 -1
  411. package/dist/esm/stzh-sticky.entry.js +1 -1
  412. package/dist/esm/stzh-table.entry.js +1 -1
  413. package/dist/esm/stzh-text.entry.js +1 -1
  414. package/dist/esm/stzh-textandimage.entry.js +1 -1
  415. package/dist/esm/stzh-toggle.entry.js +12 -4
  416. package/dist/esm/stzh-tooltip.entry.js +1 -1
  417. package/dist/esm/stzh-upload.entry.js +1 -1
  418. package/dist/esm/stzh-vbz-linechip.entry.js +11 -2
  419. package/dist/esm/stzh-vbz-majorticker.entry.js +1 -1
  420. package/dist/esm/stzh-vbz-ticker.entry.js +1 -1
  421. package/dist/esm/stzh-visuallyhidden.entry.js +1 -1
  422. package/dist/esm/stzh-vspace.entry.js +1 -1
  423. package/dist/esm-es5/{app-globals-62e1178d.js → app-globals-a58b5d2d.js} +1 -1
  424. package/dist/esm-es5/loader.js +1 -1
  425. package/dist/esm-es5/overlay-utils-33021971.js +1 -0
  426. package/dist/esm-es5/stzh-accordion-item.entry.js +1 -1
  427. package/dist/esm-es5/stzh-accordion.entry.js +1 -1
  428. package/dist/esm-es5/stzh-actions.entry.js +1 -1
  429. package/dist/esm-es5/stzh-actionset.entry.js +1 -1
  430. package/dist/esm-es5/stzh-anchornav.entry.js +1 -1
  431. package/dist/esm-es5/stzh-appnav.entry.js +1 -1
  432. package/dist/esm-es5/stzh-appointments.entry.js +1 -1
  433. package/dist/esm-es5/stzh-audio.entry.js +1 -1
  434. package/dist/esm-es5/stzh-badge_3.entry.js +1 -1
  435. package/dist/esm-es5/stzh-buttongroup.entry.js +1 -0
  436. package/dist/esm-es5/stzh-calendar.entry.js +1 -1
  437. package/dist/esm-es5/stzh-card_3.entry.js +1 -1
  438. package/dist/esm-es5/stzh-carousel.entry.js +1 -1
  439. package/dist/esm-es5/stzh-cell.entry.js +1 -1
  440. package/dist/esm-es5/stzh-chart.entry.js +1 -1
  441. package/dist/esm-es5/stzh-checkbox.entry.js +1 -1
  442. package/dist/esm-es5/stzh-checkboxgroup.entry.js +1 -1
  443. package/dist/esm-es5/stzh-chip_2.entry.js +1 -1
  444. package/dist/esm-es5/stzh-components.js +1 -1
  445. package/dist/esm-es5/stzh-contact.entry.js +1 -1
  446. package/dist/esm-es5/stzh-container.entry.js +1 -1
  447. package/dist/esm-es5/stzh-cspace.entry.js +1 -1
  448. package/dist/esm-es5/stzh-datalist_2.entry.js +1 -1
  449. package/dist/esm-es5/stzh-datamessagelist-item.entry.js +1 -1
  450. package/dist/esm-es5/stzh-datamessagelist.entry.js +1 -1
  451. package/dist/esm-es5/stzh-datatable.entry.js +1 -1
  452. package/dist/esm-es5/stzh-datepicker_3.entry.js +1 -1
  453. package/dist/esm-es5/stzh-details.entry.js +1 -1
  454. package/dist/esm-es5/stzh-dialog.entry.js +1 -1
  455. package/dist/esm-es5/stzh-dropdown.entry.js +1 -1
  456. package/dist/esm-es5/stzh-fieldset.entry.js +1 -1
  457. package/dist/esm-es5/stzh-figure.entry.js +1 -1
  458. package/dist/esm-es5/stzh-flyingfocus.entry.js +1 -1
  459. package/dist/esm-es5/stzh-footer.entry.js +1 -1
  460. package/dist/esm-es5/stzh-ghettobox_2.entry.js +1 -1
  461. package/dist/esm-es5/stzh-header.entry.js +1 -1
  462. package/dist/esm-es5/stzh-heading.entry.js +1 -1
  463. package/dist/esm-es5/stzh-hr.entry.js +1 -1
  464. package/dist/esm-es5/stzh-hspace.entry.js +1 -1
  465. package/dist/esm-es5/stzh-icon-sprite.entry.js +1 -1
  466. package/dist/esm-es5/stzh-input.entry.js +1 -1
  467. package/dist/esm-es5/stzh-invert.entry.js +1 -1
  468. package/dist/esm-es5/stzh-langnav.entry.js +1 -1
  469. package/dist/esm-es5/stzh-link.entry.js +1 -1
  470. package/dist/esm-es5/stzh-list-item.entry.js +1 -1
  471. package/dist/esm-es5/stzh-list.entry.js +1 -1
  472. package/dist/esm-es5/stzh-loader.entry.js +1 -1
  473. package/dist/esm-es5/stzh-loadingbar.entry.js +1 -1
  474. package/dist/esm-es5/stzh-menu_2.entry.js +1 -1
  475. package/dist/esm-es5/stzh-message.entry.js +1 -1
  476. package/dist/esm-es5/stzh-metanav.entry.js +1 -1
  477. package/dist/esm-es5/stzh-microsite-teaserlist.entry.js +1 -1
  478. package/dist/esm-es5/stzh-olmap.entry.js +1 -1
  479. package/dist/esm-es5/stzh-overlay.entry.js +1 -1
  480. package/dist/esm-es5/stzh-page-skiplinks.entry.js +1 -1
  481. package/dist/esm-es5/stzh-pagebottom.entry.js +1 -1
  482. package/dist/esm-es5/stzh-pagetitle-hero.entry.js +1 -1
  483. package/dist/esm-es5/stzh-pagetitle.entry.js +1 -1
  484. package/dist/esm-es5/stzh-popover.entry.js +1 -1
  485. package/dist/esm-es5/stzh-portal-mitwirken.entry.js +1 -1
  486. package/dist/esm-es5/stzh-progressbar-item.entry.js +1 -1
  487. package/dist/esm-es5/stzh-progressbar.entry.js +1 -1
  488. package/dist/esm-es5/stzh-ratio.entry.js +1 -1
  489. package/dist/esm-es5/stzh-readspeaker.entry.js +1 -1
  490. package/dist/esm-es5/stzh-row.entry.js +1 -1
  491. package/dist/esm-es5/stzh-saptcha.entry.js +1 -1
  492. package/dist/esm-es5/stzh-section.entry.js +1 -1
  493. package/dist/esm-es5/stzh-share.entry.js +1 -1
  494. package/dist/esm-es5/stzh-show.entry.js +1 -1
  495. package/dist/esm-es5/stzh-sitemap.entry.js +1 -1
  496. package/dist/esm-es5/stzh-skiplink.entry.js +1 -1
  497. package/dist/esm-es5/stzh-sortable.entry.js +1 -1
  498. package/dist/esm-es5/stzh-space.entry.js +1 -1
  499. package/dist/esm-es5/stzh-status.entry.js +1 -1
  500. package/dist/esm-es5/stzh-sticky.entry.js +1 -1
  501. package/dist/esm-es5/stzh-table.entry.js +1 -1
  502. package/dist/esm-es5/stzh-text.entry.js +1 -1
  503. package/dist/esm-es5/stzh-textandimage.entry.js +1 -1
  504. package/dist/esm-es5/stzh-toggle.entry.js +1 -1
  505. package/dist/esm-es5/stzh-tooltip.entry.js +1 -1
  506. package/dist/esm-es5/stzh-upload.entry.js +1 -1
  507. package/dist/esm-es5/stzh-vbz-linechip.entry.js +1 -1
  508. package/dist/esm-es5/stzh-vbz-majorticker.entry.js +1 -1
  509. package/dist/esm-es5/stzh-vbz-ticker.entry.js +1 -1
  510. package/dist/esm-es5/stzh-visuallyhidden.entry.js +1 -1
  511. package/dist/esm-es5/stzh-vspace.entry.js +1 -1
  512. package/dist/stzh-components/assets/i18n/de.json +1 -0
  513. package/dist/stzh-components/assets/i18n/en.json +1 -0
  514. package/dist/stzh-components/assets/icons/mono/mail.svg +1 -1
  515. package/dist/stzh-components/assets/media/olmap/marker-active.png +0 -0
  516. package/dist/stzh-components/assets/media/olmap/marker-position.png +0 -0
  517. package/dist/stzh-components/assets/media/olmap/marker.png +0 -0
  518. package/dist/stzh-components/assets/svgsprites/symbol/sprite.symbol.html +1 -1
  519. package/dist/stzh-components/assets/svgsprites/symbol/svg/sprite.symbol.svg +1 -1
  520. package/dist/stzh-components/assets/vendors/readspeaker/ReadSpeaker.Styles-Basic.css +881 -881
  521. package/dist/stzh-components/assets/vendors/readspeaker/ReadSpeaker.Styles-Button.css +75 -75
  522. package/dist/stzh-components/assets/vendors/readspeaker/ReadSpeaker.Styles.css +977 -977
  523. package/dist/stzh-components/assets/vendors/readspeaker/ReadSpeakerClassic.css +2 -2
  524. package/dist/stzh-components/p-00d91505.entry.js +1 -0
  525. package/dist/stzh-components/p-00e99280.entry.js +1 -0
  526. package/dist/stzh-components/p-035a0f82.system.entry.js +1 -0
  527. package/dist/stzh-components/{p-8f577bc6.system.entry.js → p-0688fe3a.system.entry.js} +1 -1
  528. package/dist/stzh-components/p-06e2b01d.system.entry.js +1 -0
  529. package/dist/stzh-components/p-077a1368.entry.js +1 -0
  530. package/dist/stzh-components/{p-6e3231ce.entry.js → p-0aeaba03.entry.js} +1 -1
  531. package/dist/stzh-components/{p-f4c0d928.entry.js → p-0b5226e2.entry.js} +2 -2
  532. package/dist/stzh-components/p-0bebedd4.entry.js +1 -0
  533. package/dist/stzh-components/p-0ecd29c5.system.entry.js +1 -0
  534. package/dist/stzh-components/p-10041557.entry.js +1 -0
  535. package/dist/stzh-components/p-12bebf6e.entry.js +1 -0
  536. package/dist/stzh-components/p-13017524.system.entry.js +1 -0
  537. package/dist/stzh-components/p-13f024e3.system.entry.js +1 -0
  538. package/dist/stzh-components/p-1434d4f7.system.entry.js +1 -0
  539. package/dist/stzh-components/p-1457ac31.system.entry.js +1 -0
  540. package/dist/stzh-components/p-17761054.system.entry.js +1 -0
  541. package/dist/stzh-components/p-17b3570a.entry.js +1 -0
  542. package/dist/stzh-components/p-180e8516.system.entry.js +1 -0
  543. package/dist/stzh-components/p-18c9a3e1.system.entry.js +1 -0
  544. package/dist/stzh-components/p-198b8305.system.entry.js +1 -0
  545. package/dist/stzh-components/p-1abd7bf8.entry.js +1 -0
  546. package/dist/stzh-components/{p-e54ef44f.system.entry.js → p-1b197c5e.system.entry.js} +1 -1
  547. package/dist/stzh-components/p-1ed06318.entry.js +1 -0
  548. package/dist/stzh-components/p-1fc11b81.entry.js +1 -0
  549. package/dist/stzh-components/p-206f5f74.system.entry.js +1 -0
  550. package/dist/stzh-components/p-222d9dd1.system.entry.js +1 -0
  551. package/dist/stzh-components/p-25496f49.system.entry.js +1 -0
  552. package/dist/stzh-components/p-25d95c73.entry.js +1 -0
  553. package/dist/stzh-components/p-294acb66.system.entry.js +1 -0
  554. package/dist/stzh-components/p-2a9e7099.system.entry.js +1 -0
  555. package/dist/stzh-components/{p-12564ee4.entry.js → p-2b1b9b7f.entry.js} +1 -1
  556. package/dist/stzh-components/p-309b73e1.entry.js +1 -0
  557. package/dist/stzh-components/{p-6dbf976b.entry.js → p-318ebb9e.entry.js} +1 -1
  558. package/dist/stzh-components/p-320273c3.system.entry.js +1 -0
  559. package/dist/stzh-components/{p-af9aac53.entry.js → p-3680ed9c.entry.js} +1 -1
  560. package/dist/stzh-components/p-36fbc15e.system.entry.js +1 -0
  561. package/dist/stzh-components/p-373e5bb9.system.entry.js +1 -0
  562. package/dist/stzh-components/{p-77320d20.entry.js → p-39871486.entry.js} +1 -1
  563. package/dist/stzh-components/{p-8c371d1d.system.entry.js → p-39f6243c.system.entry.js} +2 -2
  564. package/dist/stzh-components/p-3a3d196e.system.entry.js +1 -0
  565. package/dist/stzh-components/p-3a57e4ab.entry.js +1 -0
  566. package/dist/stzh-components/{p-6ee87986.entry.js → p-3b2d7678.entry.js} +1 -1
  567. package/dist/stzh-components/{p-884793dd.system.entry.js → p-3c75c708.system.entry.js} +1 -1
  568. package/dist/stzh-components/p-3cdbb1ed.js +1 -0
  569. package/dist/stzh-components/p-3d00dad8.entry.js +1 -0
  570. package/dist/stzh-components/p-3e8bba03.system.entry.js +1 -0
  571. package/dist/stzh-components/p-406c9413.entry.js +9 -0
  572. package/dist/stzh-components/{p-f725921a.entry.js → p-40f7ceb9.entry.js} +1 -1
  573. package/dist/stzh-components/p-42b69706.system.entry.js +1 -0
  574. package/dist/stzh-components/p-444af671.system.entry.js +1 -0
  575. package/dist/stzh-components/p-47bf4999.system.entry.js +1 -0
  576. package/dist/stzh-components/p-47c70501.system.entry.js +1 -0
  577. package/dist/stzh-components/p-4909551f.system.entry.js +1 -0
  578. package/dist/stzh-components/p-509c7218.system.entry.js +1 -0
  579. package/dist/stzh-components/p-526144dc.entry.js +1 -0
  580. package/dist/stzh-components/p-529951e9.system.entry.js +1 -0
  581. package/dist/stzh-components/p-5373c40e.system.entry.js +1 -0
  582. package/dist/stzh-components/p-5538ecd9.entry.js +1 -0
  583. package/dist/stzh-components/p-57f2b7d4.entry.js +1 -0
  584. package/dist/stzh-components/p-5859f81f.system.entry.js +1 -0
  585. package/dist/stzh-components/p-595f202a.entry.js +1 -0
  586. package/dist/stzh-components/p-5ab2ae81.system.entry.js +1 -0
  587. package/dist/stzh-components/{p-b9adebdc.entry.js → p-5efd5a1d.entry.js} +1 -1
  588. package/dist/stzh-components/p-5f33f681.entry.js +1 -0
  589. package/dist/stzh-components/p-6022d291.entry.js +1 -0
  590. package/dist/stzh-components/{p-4f8085e5.entry.js → p-61d68434.entry.js} +1 -1
  591. package/dist/stzh-components/p-61e701ce.system.entry.js +1 -0
  592. package/dist/stzh-components/p-65833306.system.entry.js +1 -0
  593. package/dist/stzh-components/p-663287a8.entry.js +1 -0
  594. package/dist/stzh-components/p-66ea8863.system.js +1 -0
  595. package/dist/stzh-components/{p-3fc51ad1.system.entry.js → p-670495df.system.entry.js} +1 -1
  596. package/dist/stzh-components/p-673d68e7.system.entry.js +1 -0
  597. package/dist/stzh-components/p-6a7152dd.system.entry.js +1 -0
  598. package/dist/stzh-components/p-6a911d9c.system.entry.js +1 -0
  599. package/dist/stzh-components/p-6b05235b.system.entry.js +1 -0
  600. package/dist/stzh-components/p-6bdbad44.entry.js +1 -0
  601. package/dist/stzh-components/p-6c6380a8.entry.js +1 -0
  602. package/dist/stzh-components/p-6ef3c304.system.entry.js +1 -0
  603. package/dist/stzh-components/{p-6a109ce9.system.entry.js → p-6f4d7926.system.entry.js} +1 -1
  604. package/dist/stzh-components/p-7142e816.system.entry.js +1 -0
  605. package/dist/stzh-components/p-72a71f30.system.entry.js +1 -0
  606. package/dist/stzh-components/{p-cd59cead.system.js → p-72f050c1.system.js} +1 -1
  607. package/dist/stzh-components/{p-88fbb2fc.system.entry.js → p-73ce3c9b.system.entry.js} +8 -8
  608. package/dist/stzh-components/{p-bc2af057.entry.js → p-73d779a3.entry.js} +1 -1
  609. package/dist/stzh-components/p-7413b79d.entry.js +1 -0
  610. package/dist/stzh-components/p-74831964.entry.js +1 -0
  611. package/dist/stzh-components/{p-155ecf6c.entry.js → p-75693b7f.entry.js} +1 -1
  612. package/dist/stzh-components/p-770a5d07.system.entry.js +1 -0
  613. package/dist/stzh-components/p-788e2455.system.entry.js +1 -0
  614. package/dist/stzh-components/p-7a95f89c.system.entry.js +1 -0
  615. package/dist/stzh-components/p-7b887b10.system.entry.js +1 -0
  616. package/dist/stzh-components/p-7bc49298.system.entry.js +1 -0
  617. package/dist/stzh-components/p-7c1e4ff7.system.entry.js +1 -0
  618. package/dist/stzh-components/{p-0a408348.entry.js → p-7f442c8f.entry.js} +1 -1
  619. package/dist/stzh-components/{p-b4db3558.js → p-8276a3a5.js} +1 -1
  620. package/dist/stzh-components/p-843301ca.entry.js +1 -0
  621. package/dist/stzh-components/p-84ee50a5.system.entry.js +1 -0
  622. package/dist/stzh-components/p-87eb2a8d.entry.js +1 -0
  623. package/dist/stzh-components/p-8aaef773.entry.js +1 -0
  624. package/dist/stzh-components/p-8b02b816.entry.js +1 -0
  625. package/dist/stzh-components/p-8d5fd36f.entry.js +1 -0
  626. package/dist/stzh-components/p-8f996d7e.system.entry.js +1 -0
  627. package/dist/stzh-components/p-90053b06.system.entry.js +1 -0
  628. package/dist/stzh-components/p-90a3867e.entry.js +1 -0
  629. package/dist/stzh-components/p-91ea8f3b.entry.js +1 -0
  630. package/dist/stzh-components/p-92332dae.entry.js +1 -0
  631. package/dist/stzh-components/p-929a0532.entry.js +1 -0
  632. package/dist/stzh-components/p-9443ef45.system.entry.js +1 -0
  633. package/dist/stzh-components/p-9522b7c7.entry.js +1 -0
  634. package/dist/stzh-components/p-9a990d3c.entry.js +1 -0
  635. package/dist/stzh-components/{p-5b162e4f.entry.js → p-9b9b579b.entry.js} +1 -1
  636. package/dist/stzh-components/{p-4da7ebff.entry.js → p-9d996db9.entry.js} +1 -1
  637. package/dist/stzh-components/p-a0aeb3d6.system.entry.js +1 -0
  638. package/dist/stzh-components/p-a26d3e2d.entry.js +1 -0
  639. package/dist/stzh-components/p-a3781fae.entry.js +1 -0
  640. package/dist/stzh-components/p-a3d99e8f.entry.js +1 -0
  641. package/dist/stzh-components/{p-8eda017e.entry.js → p-a51184fb.entry.js} +1 -1
  642. package/dist/stzh-components/p-a63df129.system.entry.js +1 -0
  643. package/dist/stzh-components/p-a6c76983.system.entry.js +1 -0
  644. package/dist/stzh-components/p-a70423e5.system.entry.js +1 -0
  645. package/dist/stzh-components/{p-d5514e5b.system.entry.js → p-a8205b50.system.entry.js} +2 -2
  646. package/dist/stzh-components/p-a89d05d3.entry.js +1 -0
  647. package/dist/stzh-components/p-a89e510c.entry.js +1 -0
  648. package/dist/stzh-components/p-ab66cdf8.entry.js +1 -0
  649. package/dist/stzh-components/p-ac6df3e4.system.entry.js +1 -0
  650. package/dist/stzh-components/p-ad85c5c6.entry.js +1 -0
  651. package/dist/stzh-components/p-b0d74781.entry.js +1 -0
  652. package/dist/stzh-components/p-b42a99f2.entry.js +1 -0
  653. package/dist/stzh-components/p-b7509be8.system.entry.js +1 -0
  654. package/dist/stzh-components/p-b7e7b956.entry.js +1 -0
  655. package/dist/stzh-components/p-b9a687f5.system.entry.js +1 -0
  656. package/dist/stzh-components/p-bbacd4b6.system.entry.js +1 -0
  657. package/dist/stzh-components/p-bd275bc1.system.entry.js +1 -0
  658. package/dist/stzh-components/p-bfeae490.entry.js +1 -0
  659. package/dist/stzh-components/p-bfece369.system.entry.js +1 -0
  660. package/dist/stzh-components/p-c164e020.system.entry.js +1 -0
  661. package/dist/stzh-components/p-c28d19c7.entry.js +1 -0
  662. package/dist/stzh-components/p-c4619b1f.entry.js +9 -0
  663. package/dist/stzh-components/p-c7263e0f.system.entry.js +1 -0
  664. package/dist/stzh-components/p-ca7ec43f.system.entry.js +1 -0
  665. package/dist/stzh-components/p-cb8d0d64.system.entry.js +1 -0
  666. package/dist/stzh-components/p-cd3c2a3a.system.entry.js +1 -0
  667. package/dist/stzh-components/p-cd7d91be.system.entry.js +1 -0
  668. package/dist/stzh-components/p-cfe82456.entry.js +1 -0
  669. package/dist/stzh-components/p-d0236fd5.entry.js +1 -0
  670. package/dist/stzh-components/{p-8b16550d.entry.js → p-d332af6f.entry.js} +1 -1
  671. package/dist/stzh-components/{p-48dee587.entry.js → p-d34653bd.entry.js} +1 -1
  672. package/dist/stzh-components/p-d46116ce.system.entry.js +1 -0
  673. package/dist/stzh-components/p-d7d424bc.entry.js +1 -0
  674. package/dist/stzh-components/{p-ae7255f6.entry.js → p-d9be7a41.entry.js} +1 -1
  675. package/dist/stzh-components/p-d9f5bb65.system.entry.js +1 -0
  676. package/dist/stzh-components/p-dbe89e81.system.entry.js +1 -0
  677. package/dist/stzh-components/p-dc970ea6.system.entry.js +1 -0
  678. package/dist/stzh-components/p-dde56464.system.js +1 -0
  679. package/dist/stzh-components/p-de151e4f.system.entry.js +1 -0
  680. package/dist/stzh-components/p-df617d8e.system.entry.js +1 -0
  681. package/dist/stzh-components/p-dfeb38f7.entry.js +1 -0
  682. package/dist/stzh-components/p-e18f5e43.system.entry.js +1 -0
  683. package/dist/stzh-components/p-e3576ccb.entry.js +1 -0
  684. package/dist/stzh-components/p-e5318901.system.entry.js +1 -0
  685. package/dist/stzh-components/p-e5e7548f.entry.js +1 -0
  686. package/dist/stzh-components/p-e993dfe4.entry.js +1 -0
  687. package/dist/stzh-components/p-ea1b0a82.entry.js +1 -0
  688. package/dist/stzh-components/{p-59793ef8.system.entry.js → p-ea5b9340.entry.js} +1 -1
  689. package/dist/stzh-components/p-ebc2b991.system.entry.js +1 -0
  690. package/dist/stzh-components/{p-aa2c81e6.system.entry.js → p-ec7f15c8.system.entry.js} +1 -1
  691. package/dist/stzh-components/p-ecd1ca5a.entry.js +1 -0
  692. package/dist/stzh-components/p-ee8becb5.entry.js +1 -0
  693. package/dist/stzh-components/p-f202e06c.entry.js +1 -0
  694. package/dist/stzh-components/p-f41788fc.entry.js +1 -0
  695. package/dist/stzh-components/p-f683c9d0.entry.js +1 -0
  696. package/dist/stzh-components/p-f867f814.entry.js +1 -0
  697. package/dist/stzh-components/p-fb6952f1.system.entry.js +1 -0
  698. package/dist/stzh-components/p-fb71ade8.entry.js +1 -0
  699. package/dist/stzh-components/stzh-components.css +1 -1
  700. package/dist/stzh-components/stzh-components.esm.js +1 -1
  701. package/dist/stzh-components/stzh-components.js +1 -1
  702. package/dist/types/components/stzh-olmap/stzh-olmap.localization.d.ts +1 -0
  703. package/dist/types/components.d.ts +83 -14
  704. package/dist/types/index.d.ts +14 -0
  705. package/dist/types/utils/overlay-utils.d.ts +5 -0
  706. package/dist/vscode-data.json +39 -7
  707. package/package.json +1 -1
  708. package/dist/stzh-components/p-013d269a.system.entry.js +0 -1
  709. package/dist/stzh-components/p-0759cd7e.entry.js +0 -1
  710. package/dist/stzh-components/p-0930004d.entry.js +0 -1
  711. package/dist/stzh-components/p-0a2de4e8.entry.js +0 -1
  712. package/dist/stzh-components/p-0c779613.system.entry.js +0 -1
  713. package/dist/stzh-components/p-0e690e3e.system.entry.js +0 -1
  714. package/dist/stzh-components/p-0f882e26.system.entry.js +0 -1
  715. package/dist/stzh-components/p-0ffd0de8.system.entry.js +0 -1
  716. package/dist/stzh-components/p-10b4fedd.system.entry.js +0 -1
  717. package/dist/stzh-components/p-12e03b78.system.entry.js +0 -1
  718. package/dist/stzh-components/p-14729939.entry.js +0 -1
  719. package/dist/stzh-components/p-1494b502.entry.js +0 -1
  720. package/dist/stzh-components/p-14d5a56d.entry.js +0 -1
  721. package/dist/stzh-components/p-16b3d4ee.system.entry.js +0 -1
  722. package/dist/stzh-components/p-205f5111.system.entry.js +0 -1
  723. package/dist/stzh-components/p-20bd79d0.entry.js +0 -1
  724. package/dist/stzh-components/p-215d2cf6.system.entry.js +0 -1
  725. package/dist/stzh-components/p-25d8a9c0.system.entry.js +0 -1
  726. package/dist/stzh-components/p-263fd0bb.system.entry.js +0 -1
  727. package/dist/stzh-components/p-2674dc69.system.entry.js +0 -1
  728. package/dist/stzh-components/p-2c42ae68.entry.js +0 -1
  729. package/dist/stzh-components/p-2e6ef670.entry.js +0 -1
  730. package/dist/stzh-components/p-2ed20db5.entry.js +0 -1
  731. package/dist/stzh-components/p-31b995e8.entry.js +0 -1
  732. package/dist/stzh-components/p-322e74e9.system.entry.js +0 -1
  733. package/dist/stzh-components/p-353294ce.entry.js +0 -1
  734. package/dist/stzh-components/p-396697db.system.entry.js +0 -1
  735. package/dist/stzh-components/p-3af95b5d.entry.js +0 -1
  736. package/dist/stzh-components/p-3b00d8b8.entry.js +0 -1
  737. package/dist/stzh-components/p-3f676d99.system.entry.js +0 -1
  738. package/dist/stzh-components/p-3f80ce87.entry.js +0 -1
  739. package/dist/stzh-components/p-40798ed2.entry.js +0 -1
  740. package/dist/stzh-components/p-418e04f7.system.entry.js +0 -1
  741. package/dist/stzh-components/p-4453449f.entry.js +0 -1
  742. package/dist/stzh-components/p-44d10402.system.entry.js +0 -1
  743. package/dist/stzh-components/p-454e50f8.system.entry.js +0 -1
  744. package/dist/stzh-components/p-46d07ed7.entry.js +0 -1
  745. package/dist/stzh-components/p-470182bb.system.entry.js +0 -1
  746. package/dist/stzh-components/p-47175c6f.system.entry.js +0 -1
  747. package/dist/stzh-components/p-48d40c7c.system.entry.js +0 -1
  748. package/dist/stzh-components/p-48e79dc0.system.entry.js +0 -1
  749. package/dist/stzh-components/p-4a60b27f.entry.js +0 -1
  750. package/dist/stzh-components/p-4acb6752.system.entry.js +0 -1
  751. package/dist/stzh-components/p-4b995fe4.system.entry.js +0 -1
  752. package/dist/stzh-components/p-51b53e68.entry.js +0 -1
  753. package/dist/stzh-components/p-552d0e82.system.entry.js +0 -1
  754. package/dist/stzh-components/p-558f336d.system.entry.js +0 -1
  755. package/dist/stzh-components/p-57235597.system.entry.js +0 -1
  756. package/dist/stzh-components/p-5a4aef52.entry.js +0 -1
  757. package/dist/stzh-components/p-617ece76.system.entry.js +0 -1
  758. package/dist/stzh-components/p-655e3c46.system.entry.js +0 -1
  759. package/dist/stzh-components/p-6606e17e.system.entry.js +0 -1
  760. package/dist/stzh-components/p-6659b6f6.system.entry.js +0 -1
  761. package/dist/stzh-components/p-66692130.entry.js +0 -1
  762. package/dist/stzh-components/p-6722e89a.system.entry.js +0 -1
  763. package/dist/stzh-components/p-6769b9a8.system.entry.js +0 -1
  764. package/dist/stzh-components/p-67ae4994.entry.js +0 -1
  765. package/dist/stzh-components/p-6a26c9eb.system.entry.js +0 -1
  766. package/dist/stzh-components/p-6bc7f44a.entry.js +0 -1
  767. package/dist/stzh-components/p-6deb516e.entry.js +0 -1
  768. package/dist/stzh-components/p-70f85be3.system.entry.js +0 -1
  769. package/dist/stzh-components/p-77d0a54b.system.entry.js +0 -1
  770. package/dist/stzh-components/p-7f1b7b44.system.entry.js +0 -1
  771. package/dist/stzh-components/p-7ff1640c.entry.js +0 -1
  772. package/dist/stzh-components/p-80f497d8.system.entry.js +0 -1
  773. package/dist/stzh-components/p-814e5ae7.entry.js +0 -9
  774. package/dist/stzh-components/p-821ca4af.system.entry.js +0 -1
  775. package/dist/stzh-components/p-8361c9d8.system.entry.js +0 -1
  776. package/dist/stzh-components/p-838b0542.entry.js +0 -1
  777. package/dist/stzh-components/p-862e7723.system.entry.js +0 -1
  778. package/dist/stzh-components/p-86336227.entry.js +0 -1
  779. package/dist/stzh-components/p-919cf183.entry.js +0 -1
  780. package/dist/stzh-components/p-94918f2a.system.entry.js +0 -1
  781. package/dist/stzh-components/p-949f7885.system.js +0 -1
  782. package/dist/stzh-components/p-95bfbf67.system.entry.js +0 -1
  783. package/dist/stzh-components/p-99d85a97.entry.js +0 -1
  784. package/dist/stzh-components/p-9a94b249.system.entry.js +0 -1
  785. package/dist/stzh-components/p-9ed30a9f.entry.js +0 -1
  786. package/dist/stzh-components/p-9f29e6c3.entry.js +0 -1
  787. package/dist/stzh-components/p-a0b2739a.entry.js +0 -1
  788. package/dist/stzh-components/p-a1727d35.entry.js +0 -1
  789. package/dist/stzh-components/p-a2121744.system.entry.js +0 -1
  790. package/dist/stzh-components/p-a22ac109.entry.js +0 -1
  791. package/dist/stzh-components/p-a2df0ea1.entry.js +0 -1
  792. package/dist/stzh-components/p-a3bf419d.entry.js +0 -1
  793. package/dist/stzh-components/p-a47e205f.entry.js +0 -1
  794. package/dist/stzh-components/p-a693ab41.entry.js +0 -1
  795. package/dist/stzh-components/p-abf13db9.system.entry.js +0 -1
  796. package/dist/stzh-components/p-acf59d10.entry.js +0 -1
  797. package/dist/stzh-components/p-ad62a793.system.entry.js +0 -1
  798. package/dist/stzh-components/p-ad816fd9.entry.js +0 -1
  799. package/dist/stzh-components/p-ad96eb50.entry.js +0 -1
  800. package/dist/stzh-components/p-ae673b30.system.entry.js +0 -1
  801. package/dist/stzh-components/p-af05718d.system.entry.js +0 -1
  802. package/dist/stzh-components/p-b395bed5.system.entry.js +0 -1
  803. package/dist/stzh-components/p-b4c28bf5.entry.js +0 -1
  804. package/dist/stzh-components/p-b61f7404.entry.js +0 -1
  805. package/dist/stzh-components/p-b9bd42e6.system.entry.js +0 -1
  806. package/dist/stzh-components/p-b9f784e4.system.entry.js +0 -1
  807. package/dist/stzh-components/p-bada7caa.system.entry.js +0 -1
  808. package/dist/stzh-components/p-bcfba21f.entry.js +0 -1
  809. package/dist/stzh-components/p-bd1a5d6d.system.entry.js +0 -1
  810. package/dist/stzh-components/p-be68b323.entry.js +0 -1
  811. package/dist/stzh-components/p-c457dad2.system.entry.js +0 -1
  812. package/dist/stzh-components/p-c80a9d50.entry.js +0 -1
  813. package/dist/stzh-components/p-c87e9b71.entry.js +0 -1
  814. package/dist/stzh-components/p-c9940c35.entry.js +0 -1
  815. package/dist/stzh-components/p-cab1a192.entry.js +0 -1
  816. package/dist/stzh-components/p-cd979ce9.system.entry.js +0 -1
  817. package/dist/stzh-components/p-ce5db779.system.entry.js +0 -1
  818. package/dist/stzh-components/p-d29fd401.entry.js +0 -1
  819. package/dist/stzh-components/p-d585e8fd.system.entry.js +0 -1
  820. package/dist/stzh-components/p-d5994419.system.entry.js +0 -1
  821. package/dist/stzh-components/p-d6e5f396.system.entry.js +0 -1
  822. package/dist/stzh-components/p-dd1bb919.entry.js +0 -1
  823. package/dist/stzh-components/p-de76e01b.entry.js +0 -1
  824. package/dist/stzh-components/p-e085a0a0.entry.js +0 -1
  825. package/dist/stzh-components/p-e1501622.system.entry.js +0 -1
  826. package/dist/stzh-components/p-e2d80ee3.entry.js +0 -1
  827. package/dist/stzh-components/p-e3afc8f7.entry.js +0 -1
  828. package/dist/stzh-components/p-e4aa12ba.system.entry.js +0 -1
  829. package/dist/stzh-components/p-e54f66ea.system.entry.js +0 -1
  830. package/dist/stzh-components/p-e59c2adc.system.entry.js +0 -1
  831. package/dist/stzh-components/p-e7909de9.system.entry.js +0 -1
  832. package/dist/stzh-components/p-e8feb92e.system.entry.js +0 -1
  833. package/dist/stzh-components/p-e9994d05.system.entry.js +0 -1
  834. package/dist/stzh-components/p-eb16ad0d.entry.js +0 -9
  835. package/dist/stzh-components/p-eb1ea7f0.entry.js +0 -1
  836. package/dist/stzh-components/p-eb7773f3.entry.js +0 -1
  837. package/dist/stzh-components/p-ec87506f.entry.js +0 -1
  838. package/dist/stzh-components/p-ee20b95b.system.entry.js +0 -1
  839. package/dist/stzh-components/p-eed126cf.system.entry.js +0 -1
  840. package/dist/stzh-components/p-f122e15d.system.entry.js +0 -1
  841. package/dist/stzh-components/p-f27d1a06.system.entry.js +0 -1
  842. package/dist/stzh-components/p-f2deda0a.entry.js +0 -1
  843. package/dist/stzh-components/p-f449f909.entry.js +0 -1
  844. package/dist/stzh-components/p-f7bb76d8.system.entry.js +0 -1
  845. package/dist/stzh-components/p-f7e18135.entry.js +0 -1
  846. package/dist/stzh-components/p-f9ab0433.entry.js +0 -1
  847. package/dist/stzh-components/p-fe1c8047.system.entry.js +0 -1
@@ -1,7 +1,7 @@
1
- import{r as t,e as i,h as s,c as h,g as n}from"./p-99a3742a.js";import{f as r}from"./p-25a09313.js";import{c as e,a as o}from"./p-3e8ff66b.js";var a=484813681109536e-20,u=Math.PI/2,f=1e-10,c=.017453292519943295,l=57.29577951308232,v=Math.PI/4,d=2*Math.PI,M=3.14159265359,m={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const p={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var g=/[\s_\-\/\(\)]/g;function _(t,i){if(t[i])return t[i];for(var s,h=Object.keys(t),n=i.toLowerCase().replace(g,""),r=-1;++r<h.length;)if((s=h[r]).toLowerCase().replace(g,"")===n)return t[s]}function w(t){var i,s,h,n={},r=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var s=i.split("=");return s.push(!0),t[s[0].toLowerCase()]=s[1],t}),{}),e={proj:"projName",datum:"datumCode",rf:function(t){n.rf=parseFloat(t)},lat_0:function(t){n.lat0=t*c},lat_1:function(t){n.lat1=t*c},lat_2:function(t){n.lat2=t*c},lat_ts:function(t){n.lat_ts=t*c},lon_0:function(t){n.long0=t*c},lon_1:function(t){n.long1=t*c},lon_2:function(t){n.long2=t*c},alpha:function(t){n.alpha=parseFloat(t)*c},lonc:function(t){n.longc=t*c},x_0:function(t){n.x0=parseFloat(t)},y_0:function(t){n.y0=parseFloat(t)},k_0:function(t){n.k0=parseFloat(t)},k:function(t){n.k0=parseFloat(t)},a:function(t){n.a=parseFloat(t)},b:function(t){n.b=parseFloat(t)},r_a:function(){n.R_A=!0},zone:function(t){n.zone=parseInt(t,10)},south:function(){n.utmSouth=!0},towgs84:function(t){n.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){n.to_meter=parseFloat(t)},units:function(t){n.units=t;var i=_(p,t);i&&(n.to_meter=i.to_meter)},from_greenwich:function(t){n.from_greenwich=t*c},pm:function(t){var i=_(m,t);n.from_greenwich=(i||parseFloat(t))*c},nadgrids:function(t){"@null"===t?n.datumCode="none":n.nadgrids=t},axis:function(t){var i="ewnsud";3===t.length&&-1!==i.indexOf(t.substr(0,1))&&-1!==i.indexOf(t.substr(1,1))&&-1!==i.indexOf(t.substr(2,1))&&(n.axis=t)}};for(i in r)s=r[i],i in e?"function"==typeof(h=e[i])?h(s):n[h]=s:n[i]=s;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n}var y=/\s/,b=/[A-Za-z]/,x=/[A-Za-z84_]/,E=/[,\]]/,C=/[\d\.E\-\+]/;function S(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function A(t,i,s){Array.isArray(i)&&(s.unshift(i),i=null);var h=s.reduce((function(t,i){return N(i,t),t}),i?{}:t);i&&(t[i]=h)}function N(t,i){if(Array.isArray(t)){var s=t.shift();if("PARAMETER"===s&&(s=t.shift()),1===t.length)return Array.isArray(t[0])?(i[s]={},void N(t[0],i[s])):void(i[s]=t[0]);if(t.length)if("TOWGS84"!==s){if("AXIS"===s)return s in i||(i[s]=[]),void i[s].push(t);var h;switch(Array.isArray(s)||(i[s]={}),s){case"UNIT":case"PRIMEM":case"VERT_DATUM":return i[s]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&N(t[2],i[s]));case"SPHEROID":case"ELLIPSOID":return i[s]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&N(t[3],i[s]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void A(i,s,t);default:for(h=-1;++h<t.length;)if(!Array.isArray(t[h]))return N(t,i[s]);return A(i,s,t)}}else i[s]=t;else i[s]=!0}else i[t]=!0}function z(t){return.017453292519943295*t}function k(t){var i=new S(t).output(),s=i.shift(),h=i.shift();i.unshift(["name",h]),i.unshift(["type",s]);var n={};return N(i,n),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):t.projName="object"==typeof t.PROJECTION?Object.keys(t.PROJECTION)[0]:t.PROJECTION,t.AXIS){for(var i="",s=0,h=t.AXIS.length;s<h;++s){var n=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];-1!==n[0].indexOf("north")||("y"===n[0]||"lat"===n[0])&&"north"===n[1]?i+="n":-1!==n[0].indexOf("south")||("y"===n[0]||"lat"===n[0])&&"south"===n[1]?i+="s":-1!==n[0].indexOf("east")||("x"===n[0]||"lon"===n[0])&&"east"===n[1]?i+="e":-1===n[0].indexOf("west")&&("x"!==n[0]&&"lon"!==n[0]||"west"!==n[1])||(i+="w")}2===i.length&&(i+="u"),3===i.length&&(t.axis=i)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var r=t.GEOGCS;function e(i){return i*(t.to_meter||1)}"GEOGCS"===t.type&&(r=t),r&&(t.datumCode=r.DATUM?r.DATUM.name.toLowerCase():r.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(t.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=r.DATUM.SPHEROID.a,t.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(t.datum_params=r.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",z],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",z],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",z],["lat0","latitude_of_origin",z],["lat0","standard_parallel_1",z],["lat1","standard_parallel_1",z],["lat2","standard_parallel_2",z],["azimuth","Azimuth"],["alpha","azimuth",z],["srsCode","name"]].forEach((function(i){return r=(h=i)[1],void(!((n=h[0])in(s=t))&&r in s&&(s[n]=s[r],3===h.length&&(s[n]=h[2](s[n]))));var s,h,n,r})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=z(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(n),n}function R(t){var i=this;if(2===arguments.length){var s=arguments[1];R[t]="string"==typeof s?"+"===s.charAt(0)?w(arguments[1]):k(arguments[1]):s}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?R.apply(i,t):R(t)}));if("string"==typeof t){if(t in R)return R[t]}else"EPSG"in t?R["EPSG:"+t.EPSG]=t:"ESRI"in t?R["ESRI:"+t.ESRI]=t:"IAU2000"in t?R["IAU2000:"+t.IAU2000]=t:console.log(t);return}}S.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;y.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},S.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(E.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},S.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},S.prototype.number=function(t){if(!C.test(t)){if(E.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},S.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},S.prototype.keyword=function(t){if(x.test(t))this.word+=t;else{if("["===t){var i=[];return i.push(this.word),this.level++,null===this.root?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,void(this.state=1)}if(!E.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},S.prototype.neutral=function(t){if(b.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(C.test(t))return this.word=t,void(this.state=3);if(!E.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},S.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)},function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(R);var P=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function T(t,i){var s,h;if(t=t||{},!i)return t;for(h in i)void 0!==(s=i[h])&&(t[h]=s);return t}function O(t,i,s){var h=t*i;return s/Math.sqrt(1-h*h)}function L(t){return t<0?-1:1}function I(t){return Math.abs(t)<=M?t:t-L(t)*d}function F(t,i,s){var h=t*s;return h=Math.pow((1-h)/(1+h),.5*t),Math.tan(.5*(u-i))/h}function D(t,i){for(var s,h,n=.5*t,r=u-2*Math.atan(i),e=0;e<=15;e++)if(s=t*Math.sin(r),r+=h=u-2*Math.atan(i*Math.pow((1-s)/(1+s),n))-r,Math.abs(h)<=1e-10)return r;return-9999}function W(t){return t}var G=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):O(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1)},forward:function(t){var i,s,h=t.x,n=t.y;if(n*l>90&&n*l<-90&&h*l>180&&h*l<-180)return null;if(Math.abs(Math.abs(n)-u)<=f)return null;if(this.sphere)i=this.x0+this.a*this.k0*I(h-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(v+.5*n));else{var r=Math.sin(n),e=F(this.e,n,r);i=this.x0+this.a*this.k0*I(h-this.long0),s=this.y0-this.a*this.k0*Math.log(e)}return t.x=i,t.y=s,t},inverse:function(t){var i,s,h=t.x-this.x0,n=t.y-this.y0;if(this.sphere)s=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var r=Math.exp(-n/(this.a*this.k0));if(-9999===(s=D(this.e,r)))return null}return i=I(this.long0+h/(this.a*this.k0)),t.x=i,t.y=s,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:W,inverse:W,names:["longlat","identity"]}],V={},j=[];function U(t,i){var s=j.length;return t.names?(j[s]=t,t.names.forEach((function(t){V[t.toLowerCase()]=s})),this):(console.log(i),!0)}const X={start:function(){G.forEach(U)},add:U,get:function(t){if(!t)return!1;var i=t.toLowerCase();return void 0!==V[i]&&j[V[i]]?j[V[i]]:void 0}};var q={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},B=q.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};q.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Y={};function H(t,i){if(!(this instanceof H))return new H(t);i=i||function(t){if(t)throw t};var s,h=function(t){return"string"==typeof t}(s=t)?function(t){return t in R}(s)?R[s]:function(t){return P.some((function(i){return t.indexOf(i)>-1}))}(s)?k(s):function(t){return"+"===t[0]}(s)?w(s):void 0:s;if("object"==typeof h){var n=H.projections.get(h.projName);if(n){if(h.datumCode&&"none"!==h.datumCode){var r=_(Y,h.datumCode);r&&(h.datum_params=r.towgs84?r.towgs84.split(","):null,h.ellps=r.ellipse,h.datumName=r.datumName?r.datumName:h.datumCode)}h.k0=h.k0||1,h.axis=h.axis||"enu",h.ellps=h.ellps||"wgs84";var e,o,u,c,l,v,d=function(t,i,s,h,n){if(!t){var r=_(q,h);r||(r=B),t=r.a,i=r.b,s=r.rf}return s&&!i&&(i=(1-1/s)*t),(0===s||Math.abs(t-i)<f)&&(n=!0,i=t),{a:t,b:i,rf:s,sphere:n}}(h.a,h.b,h.rf,h.ellps,h.sphere),M=(l=((u=(e=d.a)*e)-(c=(o=d.b)*o))/u,v=0,h.R_A?(u=(e*=1-l*(.16666666666666666+l*(.04722222222222222+.022156084656084655*l)))*e,l=0):v=Math.sqrt(l),{es:l,e:v,ep2:(u-c)/c}),m=h.datum||function(t,i,s,h,n,r){var e={};return e.datum_type=void 0===t||"none"===t?5:4,i&&(e.datum_params=i.map(parseFloat),0===e.datum_params[0]&&0===e.datum_params[1]&&0===e.datum_params[2]||(e.datum_type=1),e.datum_params.length>3&&(0===e.datum_params[3]&&0===e.datum_params[4]&&0===e.datum_params[5]&&0===e.datum_params[6]||(e.datum_type=2,e.datum_params[3]*=a,e.datum_params[4]*=a,e.datum_params[5]*=a,e.datum_params[6]=e.datum_params[6]/1e6+1))),e.a=s,e.b=h,e.es=n,e.ep2=r,e}(h.datumCode,h.datum_params,d.a,d.b,M.es,M.ep2);T(this,h),T(this,n),this.a=d.a,this.b=d.b,this.rf=d.rf,this.sphere=d.sphere,this.es=M.es,this.e=M.e,this.ep2=M.ep2,this.datum=m,this.init(),i(null,this)}else i(t)}else i(t)}function J(t){return 1===t||2===t}function Z(t,i,s){var h,n,r,e=s.x,o=s.y,a=s.z||0,u={};for(r=0;r<3;r++)if(!i||2!==r||void 0!==s.z)switch(0===r?(h=e,n="x"):1===r?(h=o,n="y"):(h=a,n="z"),t.axis[r]){case"e":case"n":u[n]=h;break;case"w":case"s":u[n]=-h;break;case"u":void 0!==s[n]&&(u.z=h);break;case"d":void 0!==s[n]&&(u.z=-h);break;default:return null}return u}function K(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function Q(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function $(t,i,s){var h;return Array.isArray(s)&&(s=K(s)),function(t){Q(t.x),Q(t.y)}(s),t.datum&&i.datum&&function(t,i){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==i.datumCode||(1===i.datum.datum_type||2===i.datum.datum_type)&&"WGS84"!==t.datumCode}(t,i)&&(s=$(t,h=new H("WGS84"),s),t=h),"enu"!==t.axis&&(s=Z(t,!1,s)),"longlat"===t.projName?s={x:s.x*c,y:s.y*c}:(t.to_meter&&(s={x:s.x*t.to_meter,y:s.y*t.to_meter}),s=t.inverse(s)),t.from_greenwich&&(s.x+=t.from_greenwich),s=function(t,i,s){return function(t,i){return t.datum_type===i.datum_type&&!(t.a!==i.a||Math.abs(t.es-i.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:2!==t.datum_type||t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6])}(t,i)||5===t.datum_type||5===i.datum_type?s:t.es!==i.es||t.a!==i.a||J(t.datum_type)||J(i.datum_type)?(s=function(t,i,s){var h,n,r,e=t.x,o=t.y,a=t.z?t.z:0;if(o<-u&&o>-1.001*u)o=-u;else if(o>u&&o<1.001*u)o=u;else if(o<-u||o>u)return null;return e>Math.PI&&(e-=2*Math.PI),n=Math.sin(o),r=Math.cos(o),{x:((h=s/Math.sqrt(1-i*(n*n)))+a)*r*Math.cos(e),y:(h+a)*r*Math.sin(e),z:(h*(1-i)+a)*n}}(s,t.es,t.a),J(t.datum_type)&&(s=function(t,i,s){if(1===i)return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]};if(2===i){var h=s[3],n=s[4],r=s[5],e=s[6];return{x:e*(t.x-r*t.y+n*t.z)+s[0],y:e*(r*t.x+t.y-h*t.z)+s[1],z:e*(-n*t.x+h*t.y+t.z)+s[2]}}}(s,t.datum_type,t.datum_params)),J(i.datum_type)&&(s=function(t,i,s){if(1===i)return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]};if(2===i){var h=s[3],n=s[4],r=s[5],e=s[6],o=(t.x-s[0])/e,a=(t.y-s[1])/e,u=(t.z-s[2])/e;return{x:o+r*a-n*u,y:-r*o+a+h*u,z:n*o-h*a+u}}}(s,i.datum_type,i.datum_params)),function(t,i,s,h){var n,r,e,o,a,u,f,c,l,v,d,M,m,p,g,_=t.x,w=t.y,y=t.z?t.z:0;if(n=Math.sqrt(_*_+w*w),r=Math.sqrt(_*_+w*w+y*y),n/s<1e-12){if(p=0,r/s<1e-12)return g=-h,{x:t.x,y:t.y,z:t.z}}else p=Math.atan2(w,_);e=y/r,c=(o=n/r)*(1-i)*(a=1/Math.sqrt(1-i*(2-i)*o*o)),l=e*a,m=0;do{m++,u=i*(f=s/Math.sqrt(1-i*l*l))/(f+(g=n*c+y*l-f*(1-i*l*l))),M=(d=e*(a=1/Math.sqrt(1-u*(2-u)*o*o)))*c-(v=o*(1-u)*a)*l,c=v,l=d}while(M*M>1e-24&&m<30);return{x:p,y:Math.atan(d/Math.abs(v)),z:g}}(s,i.es,i.a,i.b)):s}(t.datum,i.datum,s),i.from_greenwich&&(s={x:s.x-i.from_greenwich,y:s.y}),"longlat"===i.projName?s={x:s.x*l,y:s.y*l}:(s=i.forward(s),i.to_meter&&(s={x:s.x/i.to_meter,y:s.y/i.to_meter})),"enu"!==i.axis?Z(i,!0,s):s}Y.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Y.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Y.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Y.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Y.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Y.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Y.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Y.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},Y.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Y.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Y.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Y.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Y.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Y.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Y.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Y.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Y.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},(H.projections=X).start();var tt=H("WGS84");function it(t,i,s){var h,n,r;return Array.isArray(s)?(h=$(t,i,s),3===s.length?[h.x,h.y,h.z]:[h.x,h.y]):(n=$(t,i,s),2===(r=Object.keys(s)).length||r.forEach((function(t){"x"!==t&&"y"!==t&&(n[t]=s[t])})),n)}function st(t){return t instanceof H?t:t.oProj?t.oProj:H(t)}function ht(t,i,s){t=st(t);var h,n=!1;return void 0===i?(i=t,t=tt,n=!0):(void 0!==i.x||Array.isArray(i))&&(s=i,i=t,t=tt,n=!0),i=st(i),s?it(t,i,s):(h={forward:function(s){return it(t,i,s)},inverse:function(s){return it(i,t,s)}},n&&(h.oProj=i),h)}var nt="AJSAJS",rt="AFAFAF",et=65,ot=73,at=79;const ut={forward:ft,inverse:function(t){var i=dt(mt(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat,i.lon,i.lat]:[i.left,i.bottom,i.right,i.top]},toPoint:ct};function ft(t,i){return i=i||5,function(t,i){var s,h,n,r,e,o,a,u,f,c,l,v="00000"+t.easting,d="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(f=t.easting,c=t.northing,l=Mt(t.zoneNumber),s=Math.floor(f/1e5),h=Math.floor(c/1e5)%20,r=nt.charCodeAt(n=l-1),e=rt.charCodeAt(n),u=!1,(o=r+s-1)>90&&(o=o-90+et-1,u=!0),(o===ot||r<ot&&o>ot||(o>ot||r<ot)&&u)&&o++,(o===at||r<at&&o>at||(o>at||r<at)&&u)&&++o===ot&&o++,o>90&&(o=o-90+et-1),(a=e+h)>86?(a=a-86+et-1,u=!0):u=!1,(a===ot||e<ot&&a>ot||(a>ot||e<ot)&&u)&&a++,(a===at||e<at&&a>at||(a>at||e<at)&&u)&&++a===ot&&a++,a>86&&(a=a-86+et-1),String.fromCharCode(o)+String.fromCharCode(a))+v.substr(v.length-5,i)+d.substr(d.length-5,i)}(function(t){var i,s,h,n,r,e,o,a=t.lat,u=t.lon,f=6378137,c=.00669438,l=.9996,v=lt(a),d=lt(u);o=Math.floor((u+180)/6)+1,180===u&&(o=60),a>=56&&a<64&&u>=3&&u<12&&(o=32),a>=72&&a<84&&(u>=0&&u<9?o=31:u>=9&&u<21?o=33:u>=21&&u<33?o=35:u>=33&&u<42&&(o=37)),e=lt(6*(o-1)-180+3),i=.006739496752268451,s=f/Math.sqrt(1-c*Math.sin(v)*Math.sin(v)),h=Math.tan(v)*Math.tan(v),n=i*Math.cos(v)*Math.cos(v);var M,m,p=l*s*((r=Math.cos(v)*(d-e))+(1-h+n)*r*r*r/6+(5-18*h+h*h+72*n-58*i)*r*r*r*r*r/120)+5e5,g=l*(f*(.9983242984503243*v-.002514607064228144*Math.sin(2*v)+2639046602129982e-21*Math.sin(4*v)-3.418046101696858e-9*Math.sin(6*v))+s*Math.tan(v)*(r*r/2+(5-h+9*n+4*n*n)*r*r*r*r/24+(61-58*h+h*h+600*n-2.2240339282485886)*r*r*r*r*r*r/720));return a<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(p),zoneNumber:o,zoneLetter:(M=a,m="Z",84>=M&&M>=72?m="X":72>M&&M>=64?m="W":64>M&&M>=56?m="V":56>M&&M>=48?m="U":48>M&&M>=40?m="T":40>M&&M>=32?m="S":32>M&&M>=24?m="R":24>M&&M>=16?m="Q":16>M&&M>=8?m="P":8>M&&M>=0?m="N":0>M&&M>=-8?m="M":-8>M&&M>=-16?m="L":-16>M&&M>=-24?m="K":-24>M&&M>=-32?m="J":-32>M&&M>=-40?m="H":-40>M&&M>=-48?m="G":-48>M&&M>=-56?m="F":-56>M&&M>=-64?m="E":-64>M&&M>=-72?m="D":-72>M&&M>=-80&&(m="C"),m)}}({lat:t[1],lon:t[0]}),i)}function ct(t){var i=dt(mt(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function lt(t){return t*(Math.PI/180)}function vt(t){return t/Math.PI*180}function dt(t){var i=t.northing,s=t.easting,h=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var r,e,o,a,u,f,c,l,v,d=.9996,M=6378137,m=.00669438,p=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=s-5e5,_=i;h<"N"&&(_-=1e7),c=6*(n-1)-180+3,r=.006739496752268451,v=(l=_/d/6367449.145945056)+(3*p/2-27*p*p*p/32)*Math.sin(2*l)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*l)+151*p*p*p/96*Math.sin(6*l),e=M/Math.sqrt(1-m*Math.sin(v)*Math.sin(v)),o=Math.tan(v)*Math.tan(v),a=r*Math.cos(v)*Math.cos(v),u=.99330562*M/Math.pow(1-m*Math.sin(v)*Math.sin(v),1.5),f=g/(e*d);var w=v-e*Math.tan(v)/u*(f*f/2-(5+3*o+10*a-4*a*a-9*r)*f*f*f*f/24+(61+90*o+298*a+45*o*o-1.6983531815716497-3*a*a)*f*f*f*f*f*f/720);w=vt(w);var y,b=(f-(1+2*o+a)*f*f*f/6+(5-2*a+28*o-3*a*a+8*r+24*o*o)*f*f*f*f*f/120)/Math.cos(v);if(b=c+vt(b),t.accuracy){var x=dt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:x.lat,right:x.lon,bottom:w,left:b}}else y={lat:w,lon:b};return y}function Mt(t){var i=t%6;return 0===i&&(i=6),i}function mt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var i,s=t.length,h=null,n="",r=0;!/[A-Z]/.test(i=t.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+t;n+=i,r++}var e=parseInt(n,10);if(0===r||r+3>s)throw"MGRSPoint bad conversion from: "+t;var o=t.charAt(r++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+t;h=t.substring(r,r+=2);for(var a=Mt(e),u=function(t,i){for(var s=nt.charCodeAt(i-1),h=1e5,n=!1;s!==t.charCodeAt(0);){if(++s===ot&&s++,s===at&&s++,s>90){if(n)throw"Bad character: "+t;s=et,n=!0}h+=1e5}return h}(h.charAt(0),a),f=function(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var s=rt.charCodeAt(i-1),h=0,n=!1;s!==t.charCodeAt(0);){if(++s===ot&&s++,s===at&&s++,s>86){if(n)throw"Bad character: "+t;s=et,n=!0}h+=1e5}return h}(h.charAt(1),a);f<pt(o);)f+=2e6;var c=s-r;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var l,v,d,M=c/2,m=0,p=0;return M>0&&(l=1e5/Math.pow(10,M),v=t.substring(r,r+M),m=parseFloat(v)*l,d=t.substring(r+M),p=parseFloat(d)*l),{easting:m+u,northing:p+f,zoneLetter:o,zoneNumber:e,accuracy:l}}function pt(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function gt(t,i,s){if(!(this instanceof gt))return new gt(t,i,s);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===i){var h=t.split(",");this.x=parseFloat(h[0],10),this.y=parseFloat(h[1],10),this.z=parseFloat(h[2],10)||0}else this.x=t,this.y=i,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}gt.fromMGRS=function(t){return new gt(ct(t))},gt.prototype.toMGRS=function(t){return ft([this.x,this.y],t)};var _t=.046875,wt=.01953125,yt=.01068115234375;function bt(t){var i=[];i[0]=1-t*(.25+t*(_t+t*(wt+t*yt))),i[1]=t*(.75-t*(_t+t*(wt+t*yt)));var s=t*t;return i[2]=s*(.46875-t*(.013020833333333334+.007120768229166667*t)),i[3]=(s*=t)*(.3645833333333333-.005696614583333333*t),i[4]=s*t*.3076171875,i}function xt(t,i,s,h){return h[0]*t-(s*=i)*(h[1]+(i*=i)*(h[2]+i*(h[3]+i*h[4])))}function Et(t,i,s){for(var h=1/(1-i),n=t,r=20;r;--r){var e=Math.sin(n),o=1-i*e*e;if(n-=o=(xt(n,e,Math.cos(n),s)-t)*(o*Math.sqrt(o))*h,Math.abs(o)<f)return n}return n}const Ct={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=bt(this.es),this.ml0=xt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var i,s,h,n=t.y,r=I(t.x-this.long0),e=Math.sin(n),o=Math.cos(n);if(this.es){var a=o*r,u=Math.pow(a,2),c=this.ep2*Math.pow(o,2),l=Math.pow(c,2),v=Math.abs(o)>f?Math.tan(n):0,d=Math.pow(v,2),M=Math.pow(d,2);i=1-this.es*Math.pow(e,2),a/=Math.sqrt(i);var m=xt(n,e,o,this.en);s=this.a*(this.k0*a*(1+u/6*(1-d+c+u/20*(5-18*d+M+14*c-58*d*c+u/42*(61+179*M-M*d-479*d)))))+this.x0,h=this.a*(this.k0*(m-this.ml0+e*r*a/2*(1+u/12*(5-d+9*c+4*l+u/30*(61+M-58*d+270*c-330*d*c+u/56*(1385+543*M-M*d-3111*d))))))+this.y0}else{var p=o*Math.sin(r);if(Math.abs(Math.abs(p)-1)<f)return 93;if(s=.5*this.a*this.k0*Math.log((1+p)/(1-p))+this.x0,h=o*Math.cos(r)/Math.sqrt(1-Math.pow(p,2)),(p=Math.abs(h))>=1){if(p-1>f)return 93;h=0}else h=Math.acos(h);n<0&&(h=-h),h=this.a*this.k0*(h-this.lat0)+this.y0}return t.x=s,t.y=h,t},inverse:function(t){var i,s,h,n,r=1/this.a*(t.x-this.x0),e=1/this.a*(t.y-this.y0);if(this.es)if(s=Et(i=this.ml0+e/this.k0,this.es,this.en),Math.abs(s)<u){var o=Math.sin(s),a=Math.cos(s),c=Math.abs(a)>f?Math.tan(s):0,l=this.ep2*Math.pow(a,2),v=Math.pow(l,2),d=Math.pow(c,2),M=Math.pow(d,2);i=1-this.es*Math.pow(o,2);var m=r*Math.sqrt(i)/this.k0,p=Math.pow(m,2);h=s-(i*=c)*p/(1-this.es)*.5*(1-p/12*(5+3*d-9*l*d+l-4*v-p/30*(61+90*d-252*l*d+45*M+46*l-p/56*(1385+3633*d+4095*M+1574*M*d)))),n=I(this.long0+m*(1-p/6*(1+2*d+l-p/20*(5+28*d+24*M+8*l*d+6*l-p/42*(61+662*d+1320*M+720*M*d))))/a)}else h=u*L(e),n=0;else{var g=Math.exp(r/this.k0),_=.5*(g-1/g),w=Math.cos(this.lat0+e/this.k0);i=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(_,2))),h=Math.asin(i),e<0&&(h=-h),n=0===_&&0===w?0:I(Math.atan2(_,w)+this.long0)}return t.x=n,t.y=h,t},names:["Transverse_Mercator","Transverse Mercator","tmerc"]};function St(t){var i=Math.exp(t);return(i-1/i)/2}function At(t,i){t=Math.abs(t),i=Math.abs(i);var s=Math.max(t,i),h=Math.min(t,i)/(s||1);return s*Math.sqrt(1+Math.pow(h,2))}function Nt(t,i){for(var s,h=2*Math.cos(2*i),n=t.length-1,r=t[n],e=0;--n>=0;)s=h*r-e+t[n],e=r,r=s;return i+s*Math.sin(2*i)}function zt(t,i,s){for(var h,n,r=Math.sin(i),e=Math.cos(i),o=St(s),a=function(t){var i=Math.exp(t);return(i+1/i)/2}(s),u=2*e*a,f=-2*r*o,c=t.length-1,l=t[c],v=0,d=0,M=0;--c>=0;)h=d,n=v,l=u*(d=l)-h-f*(v=M)+t[c],M=f*d-n+u*v;return[(u=r*a)*l-(f=e*o)*M,u*M+f*l]}const kt={init:function(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),i=t/(2-t),s=i;this.cgb[0]=i*(2+i*(-2/3+i*(i*(116/45+i*(26/45+i*(-2854/675)))-2))),this.cbg[0]=i*(i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))-2),this.cgb[1]=(s*=i)*(7/3+i*(i*(-227/45+i*(2704/315+i*(2323/945)))-1.6)),this.cbg[1]=s*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),this.cgb[2]=(s*=i)*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=s*(-26/15+i*(34/21+i*(1.6+i*(-12686/2835)))),this.cgb[3]=(s*=i)*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=s*(1237/630+i*(i*(-24832/14175)-2.4)),this.cgb[4]=(s*=i)*(4174/315+i*(-144838/6237)),this.cbg[4]=s*(-734/315+i*(109598/31185)),this.cgb[5]=(s*=i)*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=i*(i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))-.5),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=s*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=s*(13/48+i*(i*(557/1440+i*(281/630+i*(-1983433/1935360)))-.6)),this.utg[2]=(s*=i)*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=s*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),this.utg[3]=(s*=i)*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=s*(49561/161280+i*(-179/168+i*(6601661/7257600))),this.utg[4]=(s*=i)*(-4583/161280+i*(108847/3991680)),this.gtu[4]=s*(34729/80640+i*(-3418889/1995840)),this.utg[5]=(s*=i)*(-20648693/638668800),this.gtu[5]=.6650675310896665*s;var h=Nt(this.cbg,this.lat0);this.Zb=-this.Qn*(h+function(t,i){for(var s,h=2*Math.cos(i),n=t.length-1,r=t[n],e=0;--n>=0;)s=h*r-e+t[n],e=r,r=s;return Math.sin(i)*s}(this.gtu,2*h))},forward:function(t){var i=I(t.x-this.long0),s=t.y;s=Nt(this.cbg,s);var h=Math.sin(s),n=Math.cos(s),r=Math.sin(i),e=Math.cos(i);s=Math.atan2(h,e*n),i=Math.atan2(r*n,At(h,n*e)),i=function(t){var i=Math.abs(t);return i=function(t){var i=1+t,s=i-1;return 0===s?t:t*Math.log(i)/s}(i*(1+i/(At(1,i)+1))),t<0?-i:i}(Math.tan(i));var o,a,u=zt(this.gtu,2*s,2*i);return s+=u[0],i+=u[1],Math.abs(i)<=2.623395162778?(o=this.a*(this.Qn*i)+this.x0,a=this.a*(this.Qn*s+this.Zb)+this.y0):(o=1/0,a=1/0),t.x=o,t.y=a,t},inverse:function(t){var i,s,h=1/this.a*(t.x-this.x0),n=1/this.a*(t.y-this.y0);if(n=(n-this.Zb)/this.Qn,h/=this.Qn,Math.abs(h)<=2.623395162778){var r=zt(this.utg,2*n,2*h);n+=r[0],h+=r[1],h=Math.atan(St(h));var e=Math.sin(n),o=Math.cos(n),a=Math.sin(h),u=Math.cos(h);n=Math.atan2(e*u,At(a,u*o)),i=I((h=Math.atan2(a,u*o))+this.long0),s=Nt(this.cgb,n)}else i=1/0,s=1/0;return t.x=i,t.y=s,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"]},Rt={init:function(){var t=function(t,i){if(void 0===t){if((t=Math.floor(30*(I(i)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*c,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,kt.init.apply(this),this.forward=kt.forward,this.inverse=kt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Pt(t,i){return Math.pow((1-t)/(1+t),i)}const Tt={init:function(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+v)/(Math.pow(Math.tan(.5*this.lat0+v),this.C)*Pt(this.e*t,this.ratexp))},forward:function(t){var i=t.x,s=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+v),this.C)*Pt(this.e*Math.sin(s),this.ratexp))-u,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,s=t.y,h=Math.pow(Math.tan(.5*s+v)/this.K,1/this.C),n=20;n>0&&(s=2*Math.atan(h*Pt(this.e*Math.sin(t.y),-.5*this.e))-u,!(Math.abs(s-t.y)<1e-14));--n)t.y=s;return n?(t.x=i,t.y=s,t):null},names:["gauss"]},Ot={init:function(){Tt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var i,s,h,n;return t.x=I(t.x-this.long0),Tt.forward.apply(this,[t]),i=Math.sin(t.y),s=Math.cos(t.y),h=Math.cos(t.x),t.x=(n=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*s*h))*s*Math.sin(t.x),t.y=n*(this.cosc0*i-this.sinc0*s*h),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var i,s,h,n,r;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,r=Math.sqrt(t.x*t.x+t.y*t.y)){var e=2*Math.atan2(r,this.R2);i=Math.sin(e),s=Math.cos(e),n=Math.asin(s*this.sinc0+t.y*i*this.cosc0/r),h=Math.atan2(t.x*i,r*this.cosc0*s-t.y*this.sinc0*i)}else n=this.phic0,h=0;return t.x=h,t.y=n,Tt.inverse.apply(this,[t]),t.x=I(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"]},Lt={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=f&&(this.k0=.5*(1+L(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=f&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=f&&(this.k0=.5*this.cons*O(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/F(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=O(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var i,s,h,n,r,e,o=t.x,a=t.y,c=Math.sin(a),l=Math.cos(a),v=I(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=f&&Math.abs(a+this.lat0)<=f?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*c+this.coslat0*l*Math.cos(v)),t.x=this.a*i*l*Math.sin(v)+this.x0,t.y=this.a*i*(this.coslat0*c-this.sinlat0*l*Math.cos(v))+this.y0,t):(s=2*Math.atan(this.ssfn_(a,c,this.e))-u,n=Math.cos(s),h=Math.sin(s),Math.abs(this.coslat0)<=f?(r=F(this.e,a*this.con,this.con*c),t.x=this.x0+(e=2*this.a*this.k0*r/this.cons)*Math.sin(o-this.long0),t.y=this.y0-this.con*e*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<f?(i=2*this.a*this.k0/(1+n*Math.cos(v)),t.y=i*h):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*h+this.cosX0*n*Math.cos(v))),t.y=i*(this.cosX0*h-this.sinX0*n*Math.cos(v))+this.y0),t.x=i*n*Math.sin(v)+this.x0,t))},inverse:function(t){var i,s,h,n;t.x-=this.x0,t.y-=this.y0;var r=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var e=2*Math.atan(r/(.5*this.a*this.k0));return i=this.long0,s=this.lat0,r<=f?(t.x=i,t.y=s,t):(s=Math.asin(Math.cos(e)*this.sinlat0+t.y*Math.sin(e)*this.coslat0/r),i=Math.abs(this.coslat0)<f?I(this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y)):I(this.long0+Math.atan2(t.x*Math.sin(e),r*this.coslat0*Math.cos(e)-t.y*this.sinlat0*Math.sin(e))),t.x=i,t.y=s,t)}if(Math.abs(this.coslat0)<=f){if(r<=f)return s=this.lat0,t.x=i=this.long0,t.y=s,t;t.x*=this.con,t.y*=this.con,s=this.con*D(this.e,r*this.cons/(2*this.a*this.k0)),i=this.con*I(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else h=2*Math.atan(r*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,r<=f?n=this.X0:(n=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/r),i=I(this.long0+Math.atan2(t.x*Math.sin(h),r*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)))),s=-1*D(this.e,Math.tan(.5*(u+n)));return t.x=i,t.y=s,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,i,s){return i*=s,Math.tan(.5*(u+t))*Math.pow((1-i)/(1+i),.5*s)}},It={init:function(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),s=this.a,h=1/this.rf,n=2*h-Math.pow(h,2),r=this.e=Math.sqrt(n);this.R=this.k0*s*Math.sqrt(1-n)/(1-n*Math.pow(i,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var e=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+t/2)),a=Math.log((1+r*i)/(1-r*i));this.K=e-this.alpha*o+this.alpha*r/2*a},forward:function(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),h=2*(Math.atan(Math.exp(-this.alpha*(i+s)+this.K))-Math.PI/4),n=this.alpha*(t.x-this.lambda0),r=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(n))),e=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(n));return t.y=this.R/2*Math.log((1+Math.sin(e))/(1-Math.sin(e)))+this.y0,t.x=this.R*r+this.x0,t},inverse:function(t){for(var i=(t.x-this.x0)/this.R,s=2*(Math.atan(Math.exp((t.y-this.y0)/this.R))-Math.PI/4),h=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),n=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(s))),r=this.lambda0+n/this.alpha,e=0,o=h,a=-1e3,u=0;Math.abs(o-a)>1e-7;){if(++u>20)return;e=1/this.alpha*(Math.log(Math.tan(Math.PI/4+h/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(o))/2)),a=o,o=2*Math.atan(Math.exp(e))-Math.PI/2}return t.x=r,t.y=o,t},names:["somerc"]},Ft={init:function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),i=Math.cos(this.lat0),s=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(i,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-s*s);var h,n,r=F(this.e,this.lat0,t),e=this.bl/i*Math.sqrt((1-this.es)/(1-s*s));if(e*e<1&&(e=1),isNaN(this.longc)){var o=F(this.e,this.lat1,Math.sin(this.lat1)),a=F(this.e,this.lat2,Math.sin(this.lat2));this.el=this.lat0>=0?(e+Math.sqrt(e*e-1))*Math.pow(r,this.bl):(e-Math.sqrt(e*e-1))*Math.pow(r,this.bl);var u=Math.pow(o,this.bl),f=Math.pow(a,this.bl);n=.5*((h=this.el/u)-1/h);var c=(this.el*this.el-f*u)/(this.el*this.el+f*u),l=(f-u)/(f+u),v=I(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(c*Math.tan(.5*this.bl*v)/l)/this.bl,this.long0=I(this.long0);var d=I(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*d)/n),this.alpha=Math.asin(e*Math.sin(this.gamma0))}else h=this.lat0>=0?e+Math.sqrt(e*e-1):e-Math.sqrt(e*e-1),this.el=h*Math.pow(r,this.bl),n=.5*(h-1/h),this.gamma0=Math.asin(Math.sin(this.alpha)/e),this.long0=this.longc-Math.asin(n*Math.tan(this.gamma0))/this.bl;this.uc=this.no_off?0:this.lat0>=0?this.al/this.bl*Math.atan2(Math.sqrt(e*e-1),Math.cos(this.alpha)):-1*this.al/this.bl*Math.atan2(Math.sqrt(e*e-1),Math.cos(this.alpha))},forward:function(t){var i,s,h,n=t.y,r=I(t.x-this.long0);if(Math.abs(Math.abs(n)-u)<=f)h=n>0?-1:1,s=this.al/this.bl*Math.log(Math.tan(v+h*this.gamma0*.5)),i=-1*h*u*this.al/this.bl;else{var e=F(this.e,n,Math.sin(n)),o=this.el/Math.pow(e,this.bl),a=.5*(o-1/o),c=.5*(o+1/o),l=Math.sin(this.bl*r),d=(a*Math.sin(this.gamma0)-l*Math.cos(this.gamma0))/c;s=Math.abs(Math.abs(d)-1)<=f?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-d)/(1+d))/this.bl,i=Math.abs(Math.cos(this.bl*r))<=f?this.al*this.bl*r:this.al*Math.atan2(a*Math.cos(this.gamma0)+l*Math.sin(this.gamma0),Math.cos(this.bl*r))/this.bl}return this.no_rot?(t.x=this.x0+i,t.y=this.y0+s):(i-=this.uc,t.x=this.x0+s*Math.cos(this.alpha)+i*Math.sin(this.alpha),t.y=this.y0+i*Math.cos(this.alpha)-s*Math.sin(this.alpha)),t},inverse:function(t){var i,s;this.no_rot?(s=t.y-this.y0,i=t.x-this.x0):(s=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),i=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),i+=this.uc);var h=Math.exp(-1*this.bl*s/this.al),n=.5*(h-1/h),r=.5*(h+1/h),e=Math.sin(this.bl*i/this.al),o=(e*Math.cos(this.gamma0)+n*Math.sin(this.gamma0))/r,a=Math.pow(this.el/Math.sqrt((1+o)/(1-o)),1/this.bl);return Math.abs(o-1)<f?(t.x=this.long0,t.y=u):Math.abs(o+1)<f?(t.x=this.long0,t.y=-1*u):(t.y=D(this.e,a),t.x=I(this.long0-Math.atan2(n*Math.cos(this.gamma0)-e*Math.sin(this.gamma0),Math.cos(this.bl*i/this.al))/this.bl)),t},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]},Dt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<f)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),s=Math.cos(this.lat1),h=O(this.e,i,s),n=F(this.e,this.lat1,i),r=Math.sin(this.lat2),e=Math.cos(this.lat2),o=O(this.e,r,e),a=F(this.e,this.lat2,r),u=F(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>f?Math.log(h/o)/Math.log(n/a):i,isNaN(this.ns)&&(this.ns=i),this.f0=h/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var i=t.x,s=t.y;Math.abs(2*Math.abs(s)-Math.PI)<=f&&(s=L(s)*(u-2e-10));var h,n,r=Math.abs(Math.abs(s)-u);if(r>f)h=F(this.e,s,Math.sin(s)),n=this.a*this.f0*Math.pow(h,this.ns);else{if((r=s*this.ns)<=0)return null;n=0}var e=this.ns*I(i-this.long0);return t.x=this.k0*(n*Math.sin(e))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(e))+this.y0,t},inverse:function(t){var i,s,h,n,r,e=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(e*e+o*o),s=1):(i=-Math.sqrt(e*e+o*o),s=-1);var a=0;if(0!==i&&(a=Math.atan2(s*e,s*o)),0!==i||this.ns>0){if(s=1/this.ns,h=Math.pow(i/(this.a*this.f0),s),-9999===(n=D(this.e,h)))return null}else n=-u;return r=I(a/this.ns+this.long0),t.x=r,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]},Wt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var i,s,h,n,r,e,o,a=t.y,u=I(t.x-this.long0);return i=Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(a/2+this.s45),this.alfa)/i)-this.s45),h=-u*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(h)),r=Math.asin(Math.cos(s)*Math.sin(h)/Math.cos(n)),e=this.n*r,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=o*Math.cos(e)/1,t.x=o*Math.sin(e)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var i,s,h,n,r,e,o,a=t.x;t.x=t.y,t.y=a,this.czech||(t.y*=-1,t.x*=-1),r=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),h=2*(Math.atan(Math.pow(this.ro0/r,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(h)-Math.sin(this.ad)*Math.cos(h)*Math.cos(n)),s=Math.asin(Math.cos(h)*Math.sin(n)/Math.cos(i)),t.x=this.long0-s/this.alfa,e=i,o=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(e))/(1-this.e*Math.sin(e)),this.e/2))-this.s45),Math.abs(e-t.y)<1e-10&&(o=1),e=t.y,u+=1}while(0===o&&u<15);return u>=15?null:t},names:["Krovak","krovak"]};function Gt(t,i,s,h,n){return t*n-i*Math.sin(2*n)+s*Math.sin(4*n)-h*Math.sin(6*n)}function Vt(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function jt(t){return.375*t*(1+.25*t*(1+.46875*t))}function Ut(t){return.05859375*t*t*(1+.75*t)}function Xt(t){return t*t*t*(35/3072)}function qt(t,i,s){var h=i*s;return t/Math.sqrt(1-h*h)}function Bt(t){return Math.abs(t)<u?t:t-L(t)*Math.PI}function Yt(t,i,s,h,n){var r,e;r=t/i;for(var o=0;o<15;o++)if(r+=e=(t-(i*r-s*Math.sin(2*r)+h*Math.sin(4*r)-n*Math.sin(6*r)))/(i-2*s*Math.cos(2*r)+4*h*Math.cos(4*r)-6*n*Math.cos(6*r)),Math.abs(e)<=1e-10)return r;return NaN}const Ht={init:function(){this.sphere||(this.e0=Vt(this.es),this.e1=jt(this.es),this.e2=Ut(this.es),this.e3=Xt(this.es),this.ml0=this.a*Gt(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var i,s,h=t.x,n=t.y;if(h=I(h-this.long0),this.sphere)i=this.a*Math.asin(Math.cos(n)*Math.sin(h)),s=this.a*(Math.atan2(Math.tan(n),Math.cos(h))-this.lat0);else{var r=Math.sin(n),e=Math.cos(n),o=qt(this.a,this.e,r),a=Math.tan(n)*Math.tan(n),u=h*Math.cos(n),f=u*u,c=this.es*e*e/(1-this.es);i=o*u*(1-f*a*(1/6-(8-a+8*c)*f/120)),s=this.a*Gt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+o*r/e*f*(.5+(5-a+6*c)*f/24)}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,h=t.x/this.a,n=t.y/this.a;if(this.sphere){var r=n+this.lat0;i=Math.asin(Math.sin(r)*Math.cos(h)),s=Math.atan2(Math.tan(h),Math.cos(r))}else{var e=Yt(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(e)-u)<=f)return t.x=this.long0,t.y=u,n<0&&(t.y*=-1),t;var o=qt(this.a,this.e,Math.sin(e)),a=o*o*o/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(e),2),l=h*this.a/o,v=l*l;i=e-o*Math.tan(e)/a*l*l*(.5-(1+3*c)*l*l/24),s=l*(1-v*(c/3+(1+3*c)*c*v/15))/Math.cos(e)}return t.x=I(s+this.long0),t.y=Bt(i),t},names:["Cassini","Cassini_Soldner","cass"]};function Jt(t,i){var s;return t>1e-7?(1-t*t)*(i/(1-(s=t*i)*s)-.5/t*Math.log((1-s)/(1+s))):2*i}const Zt={init:function(){var t,i=Math.abs(this.lat0);if(this.mode=Math.abs(i-u)<f?this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<f?this.EQUIT:this.OBLIQ,this.es>0)switch(this.qp=Jt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var i,s=[];return s[0]=.3333333333333333*t,s[0]+=.17222222222222222*(i=t*t),s[1]=.06388888888888888*i,s[0]+=.10257936507936508*(i*=t),s[1]+=.0664021164021164*i,s[2]=.016415012942191543*i,s}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Jt(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var i,s,h,n,r,e,o,a,c,l,d=t.x,M=t.y;if(d=I(d-this.long0),this.sphere){if(r=Math.sin(M),l=Math.cos(M),h=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((s=this.mode===this.EQUIT?1+l*h:1+this.sinph0*r+this.cosph0*l*h)<=f)return null;i=(s=Math.sqrt(2/s))*l*Math.sin(d),s*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*l*h}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),Math.abs(M+this.phi0)<f)return null;s=v-.5*M,i=(s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s)))*Math.sin(d),s*=h}}else{switch(o=0,a=0,c=0,h=Math.cos(d),n=Math.sin(d),r=Math.sin(M),e=Jt(this.e,r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=e/this.qp,a=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:c=1+this.sinb1*o+this.cosb1*a*h;break;case this.EQUIT:c=1+a*h;break;case this.N_POLE:c=u+M,e=this.qp-e;break;case this.S_POLE:c=M-u,e=this.qp+e}if(Math.abs(c)<f)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),s=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*o-this.sinb1*a*h):(c=Math.sqrt(2/(1+a*h)))*o*this.ymf,i=this.xmf*c*a*n;break;case this.N_POLE:case this.S_POLE:e>=0?(i=(c=Math.sqrt(e))*n,s=h*(this.mode===this.S_POLE?c:-c)):i=s=0}}return t.x=this.a*i+this.x0,t.y=this.a*s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,h,n,r,e,o,a,c,l,v=t.x/this.a,d=t.y/this.a;if(this.sphere){var M,m=0,p=0;if((s=.5*(M=Math.sqrt(v*v+d*d)))>1)return null;switch(s=2*Math.asin(s),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(p=Math.sin(s),m=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(M)<=f?0:Math.asin(d*p/M),v*=p,d=m*M;break;case this.OBLIQ:s=Math.abs(M)<=f?this.phi0:Math.asin(m*this.sinph0+d*p*this.cosph0/M),v*=p*this.cosph0,d=(m-Math.sin(s)*this.sinph0)*M;break;case this.N_POLE:d=-d,s=u-s;break;case this.S_POLE:s-=u}i=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(v,d):0}else{if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(v/=this.dd,d*=this.dd,(e=Math.sqrt(v*v+d*d))<f)return t.x=0,t.y=this.phi0,t;n=2*Math.asin(.5*e/this.rq),h=Math.cos(n),v*=n=Math.sin(n),this.mode===this.OBLIQ?(r=this.qp*(o=h*this.sinb1+d*n*this.cosb1/e),d=e*this.cosb1*h-d*this.sinb1*n):(r=this.qp*(o=d*n/e),d=e*h)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(d=-d),!(r=v*v+d*d))return t.x=0,t.y=this.phi0,t;o=1-r/this.qp,this.mode===this.S_POLE&&(o=-o)}i=Math.atan2(v,d),l=(a=Math.asin(o))+a,s=a+(c=this.apa)[0]*Math.sin(l)+c[1]*Math.sin(l+l)+c[2]*Math.sin(l+l+l)}return t.x=I(this.long0+i),t.y=s,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Kt(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}const Qt={init:function(){Math.abs(this.lat1+this.lat2)<f||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=O(this.e3,this.sin_po,this.cos_po),this.qs1=Jt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=O(this.e3,this.sin_po,this.cos_po),this.qs2=Jt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Jt(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>f?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var i=t.x,s=t.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var h=Jt(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*h)/this.ns0,r=this.ns0*I(i-this.long0),e=n*Math.sin(r)+this.x0,o=this.rh-n*Math.cos(r)+this.y0;return t.x=e,t.y=o,t},inverse:function(t){var i,s,h,n,r;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),h=0,0!==i&&(h=Math.atan2(s*t.x,s*t.y)),s=i*this.ns0/this.a,r=this.sphere?Math.asin((this.c-s*s)/(2*this.ns0)):this.phi1z(this.e3,(this.c-s*s)/this.ns0),n=I(h/this.ns0+this.long0),t.x=n,t.y=r,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,i){var s,h,n,r,e=Kt(.5*i);if(t<f)return e;for(var o=t*t,a=1;a<=25;a++)if(e+=r=.5*(n=1-(h=t*(s=Math.sin(e)))*h)*n/Math.cos(e)*(i/(1-o)-s/n+.5/t*Math.log((1-h)/(1+h))),Math.abs(r)<=1e-7)return e;return null}},$t={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var i,s,h,n,r,e,o,a=t.y;return h=I(t.x-this.long0),i=Math.sin(a),s=Math.cos(a),n=Math.cos(h),(r=this.sin_p14*i+this.cos_p14*s*n)>0||Math.abs(r)<=f?(e=this.x0+1*this.a*s*Math.sin(h)/r,o=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*n)/r):(e=this.x0+this.infinity_dist*s*Math.sin(h),o=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*s*n)),t.x=e,t.y=o,t},inverse:function(t){var i,s,h,n,r,e;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(i,this.rc),s=Math.sin(n),e=Kt((h=Math.cos(n))*this.sin_p14+t.y*s*this.cos_p14/i),r=Math.atan2(t.x*s,i*this.cos_p14*h-t.y*this.sin_p14*s),r=I(this.long0+r)):(e=this.phic0,r=0),t.x=r,t.y=e,t},names:["gnom"]},ti={init:function(){this.sphere||(this.k0=O(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var i,s,h=t.y,n=I(t.x-this.long0);if(this.sphere)i=this.x0+this.a*n*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(h)/Math.cos(this.lat_ts);else{var r=Jt(this.e,Math.sin(h));i=this.x0+this.a*this.k0*n,s=this.y0+this.a*r*.5/this.k0}return t.x=i,t.y=s,t},inverse:function(t){var i,s;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=I(this.long0+t.x/this.a/Math.cos(this.lat_ts)),s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(s=function(t,i){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-s)<1e-6)return i<0?-1*u:u;for(var h,n,r,e,o=Math.asin(.5*i),a=0;a<30;a++)if(n=Math.sin(o),r=Math.cos(o),e=t*n,o+=h=Math.pow(1-e*e,2)/(2*r)*(i/(1-t*t)-n/(1-e*e)+.5/t*Math.log((1-e)/(1+e))),Math.abs(h)<=1e-10)return o;return NaN}(this.e,2*t.y*this.k0/this.a),i=I(this.long0+t.x/(this.a*this.k0))),t.x=i,t.y=s,t},names:["cea"]},ii={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var i=t.y,s=I(t.x-this.long0),h=Bt(i-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*h,t},inverse:function(t){var i=t.y;return t.x=I(this.long0+(t.x-this.x0)/(this.a*this.rc)),t.y=Bt(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},si={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Vt(this.es),this.e1=jt(this.es),this.e2=Ut(this.es),this.e3=Xt(this.es),this.ml0=this.a*Gt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var i,s,h,n=t.y,r=I(t.x-this.long0);if(h=r*Math.sin(n),this.sphere)Math.abs(n)<=f?(i=this.a*r,s=-1*this.a*this.lat0):(i=this.a*Math.sin(h)/Math.tan(n),s=this.a*(Bt(n-this.lat0)+(1-Math.cos(h))/Math.tan(n)));else if(Math.abs(n)<=f)i=this.a*r,s=-1*this.ml0;else{var e=qt(this.a,this.e,Math.sin(n))/Math.tan(n);i=e*Math.sin(h),s=this.a*Gt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+e*(1-Math.cos(h))}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){var i,s,h,n,r,e,o,a,u;if(h=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=f)i=I(h/this.a+this.long0),s=0;else{var c;for(o=h*h/this.a/this.a+(e=this.lat0+n/this.a)*e,a=e,r=20;r;--r)if(a+=u=-1*(e*(a*(c=Math.tan(a))+1)-a-.5*(a*a+o)*c)/((a-e)/c-1),Math.abs(u)<=f){s=a;break}i=I(this.long0+Math.asin(h*Math.tan(a)/this.a)/Math.sin(s))}else if(Math.abs(n+this.ml0)<=f)s=0,i=I(this.long0+h/this.a);else{var l,v,d,M,m;for(o=h*h/this.a/this.a+(e=(this.ml0+n)/this.a)*e,a=e,r=20;r;--r)if(m=this.e*Math.sin(a),l=Math.sqrt(1-m*m)*Math.tan(a),v=this.a*Gt(this.e0,this.e1,this.e2,this.e3,a),d=this.e0-2*this.e1*Math.cos(2*a)+4*this.e2*Math.cos(4*a)-6*this.e3*Math.cos(6*a),a-=u=(e*(l*(M=v/this.a)+1)-M-.5*l*(M*M+o))/(this.es*Math.sin(2*a)*(M*M+o-2*e*M)/(4*l)+(e-M)*(l*d-2/Math.sin(2*a))-d),Math.abs(u)<=f){s=a;break}l=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),i=I(this.long0+Math.asin(h*l/this.a)/Math.sin(s))}return t.x=i,t.y=s,t},names:["Polyconic","poly"]},hi={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var i,s=(t.y-this.lat0)/a*1e-5,h=t.x-this.long0,n=1,r=0;for(i=1;i<=10;i++)r+=this.A[i]*(n*=s);var e,o=r,u=h,f=1,c=0,l=0,v=0;for(i=1;i<=6;i++)e=c*o+f*u,l=l+this.B_re[i]*(f=f*o-c*u)-this.B_im[i]*(c=e),v=v+this.B_im[i]*f+this.B_re[i]*c;return t.x=v*this.a+this.x0,t.y=l*this.a+this.y0,t},inverse:function(t){var i,s,h=(t.y-this.y0)/this.a,n=(t.x-this.x0)/this.a,r=1,e=0,o=0,u=0;for(i=1;i<=6;i++)s=e*h+r*n,o=o+this.C_re[i]*(r=r*h-e*n)-this.C_im[i]*(e=s),u=u+this.C_im[i]*r+this.C_re[i]*e;for(var f=0;f<this.iterations;f++){var c,l=o,v=u,d=h,M=n;for(i=2;i<=6;i++)c=v*o+l*u,d+=(i-1)*(this.B_re[i]*(l=l*o-v*u)-this.B_im[i]*(v=c)),M+=(i-1)*(this.B_im[i]*l+this.B_re[i]*v);l=1,v=0;var m=this.B_re[1],p=this.B_im[1];for(i=2;i<=6;i++)c=v*o+l*u,m+=i*(this.B_re[i]*(l=l*o-v*u)-this.B_im[i]*(v=c)),p+=i*(this.B_im[i]*l+this.B_re[i]*v);var g=m*m+p*p;o=(d*m+M*p)/g,u=(M*m-d*p)/g}var _=o,w=u,y=1,b=0;for(i=1;i<=9;i++)b+=this.D[i]*(y*=_);var x=this.lat0+b*a*1e5;return t.x=this.long0+w,t.y=x,t},names:["New_Zealand_Map_Grid","nzmg"]},ni={init:function(){},forward:function(t){var i=t.y,s=I(t.x-this.long0),h=this.x0+this.a*s,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=h,t.y=n,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i=I(this.long0+t.x/this.a),s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=s,t},names:["Miller_Cylindrical","mill"]},ri={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=bt(this.es)},forward:function(t){var i,s,h=t.x,n=t.y;if(h=I(h-this.long0),this.sphere){if(this.m)for(var r=this.n*Math.sin(n),e=20;e;--e){var o=(this.m*n+Math.sin(n)-r)/(this.m+Math.cos(n));if(n-=o,Math.abs(o)<f)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;i=this.a*this.C_x*h*(this.m+Math.cos(n)),s=this.a*this.C_y*n}else{var a=Math.sin(n),u=Math.cos(n);s=this.a*xt(n,a,u,this.en),i=this.a*h*u/Math.sqrt(1-this.es*a*a)}return t.x=i,t.y=s,t},inverse:function(t){var i,s,h;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,s/=this.C_x*(this.m+Math.cos(i)),this.m?i=Kt((this.m*i+Math.sin(i))/this.n):1!==this.n&&(i=Kt(Math.sin(i)/this.n)),s=I(s+this.long0),i=Bt(i)):(i=Et(t.y/this.a,this.es,this.en),(h=Math.abs(i))<u?(h=Math.sin(i),s=I(this.long0+t.x*Math.sqrt(1-this.es*h*h)/(this.a*Math.cos(i)))):h-f<u&&(s=this.long0)),t.x=s,t.y=i,t},names:["Sinusoidal","sinu"]},ei={init:function(){},forward:function(t){for(var i=t.y,s=I(t.x-this.long0),h=i,n=Math.PI*Math.sin(i);;){var r=-(h+Math.sin(h)-n)/(1+Math.cos(h));if(h+=r,Math.abs(r)<f)break}h/=2,Math.PI/2-Math.abs(i)<f&&(s=0);var e=.900316316158*this.a*s*Math.cos(h)+this.x0,o=1.4142135623731*this.a*Math.sin(h)+this.y0;return t.x=e,t.y=o,t},inverse:function(t){var i,s;t.x-=this.x0,t.y-=this.y0,s=t.y/(1.4142135623731*this.a),Math.abs(s)>.999999999999&&(s=.999999999999),i=Math.asin(s);var h=I(this.long0+t.x/(.900316316158*this.a*Math.cos(i)));h<-Math.PI&&(h=-Math.PI),h>Math.PI&&(h=Math.PI),s=(2*i+Math.sin(2*i))/Math.PI,Math.abs(s)>1&&(s=1);var n=Math.asin(s);return t.x=h,t.y=n,t},names:["Mollweide","moll"]},oi={init:function(){Math.abs(this.lat1+this.lat2)<f||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Vt(this.es),this.e1=jt(this.es),this.e2=Ut(this.es),this.e3=Xt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=O(this.e,this.sinphi,this.cosphi),this.ml1=Gt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<f?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=O(this.e,this.sinphi,this.cosphi),this.ml2=Gt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Gt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var i,s=t.x,h=t.y;if(this.sphere)i=this.a*(this.g-h);else{var n=Gt(this.e0,this.e1,this.e2,this.e3,h);i=this.a*(this.g-n)}var r=this.ns*I(s-this.long0),e=this.x0+i*Math.sin(r),o=this.y0+this.rh-i*Math.cos(r);return t.x=e,t.y=o,t},inverse:function(t){var i,s,h,n;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var r=0;return 0!==s&&(r=Math.atan2(i*t.x,i*t.y)),this.sphere?(n=I(this.long0+r/this.ns),h=Bt(this.g-s/this.a),t.x=n,t.y=h,t):(h=Yt(this.g-s/this.a,this.e0,this.e1,this.e2,this.e3),n=I(this.long0+r/this.ns),t.x=n,t.y=h,t)},names:["Equidistant_Conic","eqdc"]},ai={init:function(){this.R=this.a},forward:function(t){var i,s,h=t.y,n=I(t.x-this.long0);Math.abs(h)<=f&&(i=this.x0+this.R*n,s=this.y0);var r=Kt(2*Math.abs(h/Math.PI));(Math.abs(n)<=f||Math.abs(Math.abs(h)-u)<=f)&&(i=this.x0,s=h>=0?this.y0+Math.PI*this.R*Math.tan(.5*r):this.y0+Math.PI*this.R*-Math.tan(.5*r));var e=.5*Math.abs(Math.PI/n-n/Math.PI),o=e*e,a=Math.sin(r),c=Math.cos(r),l=c/(a+c-1),v=l*(2/a-1),d=v*v,M=Math.PI*this.R*(e*(l-d)+Math.sqrt(o*(l-d)*(l-d)-(d+o)*(l*l-d)))/(d+o);n<0&&(M=-M),i=this.x0+M;var m=o+l;return M=Math.PI*this.R*(v*m-e*Math.sqrt((d+o)*(o+1)-m*m))/(d+o),s=h>=0?this.y0+M:this.y0-M,t.x=i,t.y=s,t},inverse:function(t){var i,s,h,n,r,e,o,a,u,c,l,v;return t.x-=this.x0,t.y-=this.y0,l=Math.PI*this.R,r=(h=t.x/l)*h+(n=t.y/l)*n,l=3*(n*n/(a=-2*(e=-Math.abs(n)*(1+r))+1+2*n*n+r*r)+(2*(o=e-2*n*n+h*h)*o*o/a/a/a-9*e*o/a/a)/27)/(u=(e-o*o/3/a)/a)/(c=2*Math.sqrt(-u/3)),Math.abs(l)>1&&(l=l>=0?1:-1),v=Math.acos(l)/3,s=t.y>=0?(-c*Math.cos(v+Math.PI/3)-o/3/a)*Math.PI:-(-c*Math.cos(v+Math.PI/3)-o/3/a)*Math.PI,i=Math.abs(h)<f?this.long0:I(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(h*h-n*n)+r*r))/2/h),t.x=i,t.y=s,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},ui={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var i,s,h,n,r,e,o,a,c,l,v,d,M,m,p,g,_,w,y,b,x,E,C=t.x,S=t.y,A=Math.sin(t.y),N=Math.cos(t.y),z=I(C-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=f?(t.x=this.x0+this.a*(u-S)*Math.sin(z),t.y=this.y0-this.a*(u-S)*Math.cos(z),t):Math.abs(this.sin_p12+1)<=f?(t.x=this.x0+this.a*(u+S)*Math.sin(z),t.y=this.y0+this.a*(u+S)*Math.cos(z),t):(w=this.sin_p12*A+this.cos_p12*N*Math.cos(z),_=(g=Math.acos(w))/Math.sin(g),t.x=this.x0+this.a*_*N*Math.sin(z),t.y=this.y0+this.a*_*(this.cos_p12*A-this.sin_p12*N*Math.cos(z)),t):(i=Vt(this.es),s=jt(this.es),h=Ut(this.es),n=Xt(this.es),Math.abs(this.sin_p12-1)<=f?(r=this.a*Gt(i,s,h,n,u),e=this.a*Gt(i,s,h,n,S),t.x=this.x0+(r-e)*Math.sin(z),t.y=this.y0-(r-e)*Math.cos(z),t):Math.abs(this.sin_p12+1)<=f?(r=this.a*Gt(i,s,h,n,u),e=this.a*Gt(i,s,h,n,S),t.x=this.x0+(r+e)*Math.sin(z),t.y=this.y0+(r+e)*Math.cos(z),t):(o=A/N,a=qt(this.a,this.e,this.sin_p12),c=qt(this.a,this.e,A),l=Math.atan((1-this.es)*o+this.es*a*this.sin_p12/(c*N)),y=0===(v=Math.atan2(Math.sin(z),this.cos_p12*Math.tan(l)-this.sin_p12*Math.cos(z)))?Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.abs(Math.abs(v)-Math.PI)<=f?-Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.asin(Math.sin(z)*Math.cos(l)/Math.sin(v)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),M=this.e*this.cos_p12*Math.cos(v)/Math.sqrt(1-this.es),t.x=this.x0+(g=a*y*(1-(b=y*y)*(p=M*M)*(1-p)/6+(x=b*y)/8*(m=d*M)*(1-2*p)+(E=x*y)/120*(p*(4-7*p)-3*d*d*(1-7*p))-E*y/48*m))*Math.sin(v),t.y=this.y0+g*Math.cos(v),t))},inverse:function(t){var i,s,h,n,r,e,o,a,c,l,v,d,M,m,p,g,_,w,y,b,x,E;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*u*this.a)return;return s=i/this.a,h=Math.sin(s),n=Math.cos(s),r=this.long0,Math.abs(i)<=f?e=this.lat0:(e=Kt(n*this.sin_p12+t.y*h*this.cos_p12/i),o=Math.abs(this.lat0)-u,r=Math.abs(o)<=f?I(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)):I(this.long0+Math.atan2(t.x*h,i*this.cos_p12*n-t.y*this.sin_p12*h))),t.x=r,t.y=e,t}return a=Vt(this.es),c=jt(this.es),l=Ut(this.es),v=Xt(this.es),Math.abs(this.sin_p12-1)<=f?(e=Yt(((d=this.a*Gt(a,c,l,v,u))-(i=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,a,c,l,v),r=I(this.long0+Math.atan2(t.x,-1*t.y)),t.x=r,t.y=e,t):Math.abs(this.sin_p12+1)<=f?(d=this.a*Gt(a,c,l,v,u),e=Yt(((i=Math.sqrt(t.x*t.x+t.y*t.y))-d)/this.a,a,c,l,v),r=I(this.long0+Math.atan2(t.x,t.y)),t.x=r,t.y=e,t):(i=Math.sqrt(t.x*t.x+t.y*t.y),p=Math.atan2(t.x,t.y),M=qt(this.a,this.e,this.sin_p12),g=Math.cos(p),y=3*this.es*(1-(w=-(_=this.e*this.cos_p12*g)*_/(1-this.es)))*this.sin_p12*this.cos_p12*g/(1-this.es),E=1-w*(x=(b=i/M)-w*(1+w)*Math.pow(b,3)/6-y*(1+3*w)*Math.pow(b,4)/24)*x/2-b*x*x*x/6,m=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*g),r=I(this.long0+Math.asin(Math.sin(p)*Math.sin(x)/Math.cos(m))),e=Math.atan((1-this.es*E*this.sin_p12/Math.sin(m))*Math.tan(m)/(1-this.es)),t.x=r,t.y=e,t)},names:["Azimuthal_Equidistant","aeqd"]},fi={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var i,s,h,n,r,e,o,a=t.y;return h=I(t.x-this.long0),i=Math.sin(a),s=Math.cos(a),n=Math.cos(h),((r=this.sin_p14*i+this.cos_p14*s*n)>0||Math.abs(r)<=f)&&(e=1*this.a*s*Math.sin(h),o=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*n)),t.x=e,t.y=o,t},inverse:function(t){var i,s,h,n,r,e,o;return t.x-=this.x0,t.y-=this.y0,s=Kt((i=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),h=Math.sin(s),n=Math.cos(s),e=this.long0,Math.abs(i)<=f?(o=this.lat0,t.x=e,t.y=o,t):(o=Kt(n*this.sin_p14+t.y*h*this.cos_p14/i),r=Math.abs(this.lat0)-u,Math.abs(r)<=f?(e=I(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)),t.x=e,t.y=o,t):(e=I(this.long0+Math.atan2(t.x*h,i*this.cos_p14*n-t.y*this.sin_p14*h)),t.x=e,t.y=o,t))},names:["ortho"]};function ci(t,i,s,h){var n;return t<f?(h.value=1,n=0):(n=Math.atan2(i,s),Math.abs(n)<=v?h.value=1:n>v&&n<=u+v?(h.value=2,n-=u):n>u+v||n<=-(u+v)?(h.value=3,n=n>=0?n-M:n+M):(h.value=4,n+=u)),n}function li(t,i){var s=t+i;return s<-M?s+=d:s>+M&&(s-=d),s}const vi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.face=this.lat0>=u-v/2?5:this.lat0<=-(u-v/2)?6:Math.abs(this.long0)<=v?1:Math.abs(this.long0)<=u+v?this.long0>0?2:4:3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var i,s,h,n,r,e,o={x:0,y:0},a={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,s=t.x,5===this.face)n=u-i,s>=v&&s<=u+v?(a.value=1,h=s-u):s>u+v||s<=-(u+v)?(a.value=2,h=s>0?s-M:s+M):s>-(u+v)&&s<=-v?(a.value=3,h=s+u):(a.value=4,h=s);else if(6===this.face)n=u+i,s>=v&&s<=u+v?(a.value=1,h=-s+u):s<v&&s>=-v?(a.value=2,h=-s):s<-v&&s>=-(u+v)?(a.value=3,h=-s-u):(a.value=4,h=s>0?-s+M:-s-M);else{var f,c,l,d,m,p;2===this.face?s=li(s,+u):3===this.face?s=li(s,+M):4===this.face&&(s=li(s,-u)),d=Math.sin(i),m=Math.cos(i),p=Math.sin(s),f=m*Math.cos(s),c=m*p,l=d,1===this.face?h=ci(n=Math.acos(f),l,c,a):2===this.face?h=ci(n=Math.acos(c),l,-f,a):3===this.face?h=ci(n=Math.acos(-f),l,-c,a):4===this.face?h=ci(n=Math.acos(-c),l,f,a):(n=h=0,a.value=1)}return e=Math.atan(12/M*(h+Math.acos(Math.sin(h)*Math.cos(v))-u)),r=Math.sqrt((1-Math.cos(n))/(Math.cos(e)*Math.cos(e))/(1-Math.cos(Math.atan(1/Math.cos(h))))),2===a.value?e+=u:3===a.value?e+=M:4===a.value&&(e+=1.5*M),o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var i,s,h,n,r,e,o,a,f,c,l,v,d={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=2,i-=u):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=3,i=i<0?i+M:i-M):(m.value=4,i+=u),f=M/12*Math.tan(i),r=Math.sin(f)/(Math.cos(f)-1/Math.sqrt(2)),e=Math.atan(r),(o=1-(h=Math.cos(i))*h*(n=Math.tan(s))*n*(1-Math.cos(Math.atan(1/Math.cos(e)))))<-1?o=-1:o>1&&(o=1),5===this.face)a=Math.acos(o),d.phi=u-a,d.lam=1===m.value?e+u:2===m.value?e<0?e+M:e-M:3===m.value?e-u:e;else if(6===this.face)a=Math.acos(o),d.phi=a-u,d.lam=1===m.value?-e+u:2===m.value?-e:3===m.value?-e-u:e<0?-e-M:-e+M;else{var p,g,_;f=(p=o)*p,g=(f+=(_=f>=1?0:Math.sqrt(1-f)*Math.sin(e))*_)>=1?0:Math.sqrt(1-f),2===m.value?(f=g,g=-_,_=f):3===m.value?(g=-g,_=-_):4===m.value&&(f=g,g=_,_=-f),2===this.face?(f=p,p=-g,g=f):3===this.face?(p=-p,g=-g):4===this.face&&(f=p,p=g,g=-f),d.phi=Math.acos(-_)-u,d.lam=Math.atan2(g,p),2===this.face?d.lam=li(d.lam,-u):3===this.face?d.lam=li(d.lam,-M):4===this.face&&(d.lam=li(d.lam,+u))}return 0!==this.es&&(c=d.phi<0?1:0,l=Math.tan(d.phi),v=this.b/Math.sqrt(l*l+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-v*v)/(this.one_minus_f*v)),c&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};ht.defaultDatum="WGS84",ht.Proj=H,ht.WGS84=new ht.Proj("WGS84"),ht.Point=gt,ht.toPoint=K,ht.defs=R,ht.transform=$,ht.mgrs=ut,ht.version="2.4.4",function(t){t.Proj.projections.add(Ct),t.Proj.projections.add(kt),t.Proj.projections.add(Rt),t.Proj.projections.add(Ot),t.Proj.projections.add(Lt),t.Proj.projections.add(It),t.Proj.projections.add(Ft),t.Proj.projections.add(Dt),t.Proj.projections.add(Wt),t.Proj.projections.add(Ht),t.Proj.projections.add(Zt),t.Proj.projections.add(Qt),t.Proj.projections.add($t),t.Proj.projections.add(ti),t.Proj.projections.add(ii),t.Proj.projections.add(si),t.Proj.projections.add(hi),t.Proj.projections.add(ni),t.Proj.projections.add(ri),t.Proj.projections.add(ei),t.Proj.projections.add(oi),t.Proj.projections.add(ai),t.Proj.projections.add(ui),t.Proj.projections.add(fi),t.Proj.projections.add(vi)}(ht);var di={ASSUME_TOUCH:!1,DEFAULT_MAX_ZOOM:42,DEFAULT_MIN_ZOOM:0,DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD:.5,DEFAULT_TILE_SIZE:256,DEFAULT_WMS_VERSION:"1.3.0",ENABLE_CANVAS:!0,ENABLE_PROJ4JS:!0,ENABLE_RASTER_REPROJECTION:!0,ENABLE_WEBGL:!0,DEBUG_WEBGL:!0,INITIAL_ATLAS_SIZE:256,MAX_ATLAS_SIZE:-1,MOUSEWHEELZOOM_MAXDELTA:1,OVERVIEWMAP_MAX_RATIO:.75,OVERVIEWMAP_MIN_RATIO:.1,RASTER_REPROJECTION_MAX_SOURCE_TILES:100,RASTER_REPROJECTION_MAX_SUBDIVISION:10,RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH:.25,SIMPLIFY_TOLERANCE:.5,WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK:1024,VERSION:"v4.6.5",inherits:function(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t},nullFunction:function(){},getUid:function(t){return t.ol_uid||(t.ol_uid=++di.uidCounter_)},uidCounter_:0},Mi="accuracy",mi="accuracyGeometry",pi="altitude",gi="altitudeAccuracy",_i="heading",wi="position",yi="projection",bi="speed",xi="tracking",Ei="trackingOptions",Ci="propertychange",Si={};Si.assign="function"==typeof Object.assign?Object.assign:function(t,i){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(t),h=1,n=arguments.length;h<n;++h){var r=arguments[h];if(null!=r)for(var e in r)r.hasOwnProperty(e)&&(s[e]=r[e])}return s},Si.clear=function(t){for(var i in t)delete t[i]},Si.getValues=function(t){var i=[];for(var s in t)i.push(t[s]);return i},Si.isEmpty=function(t){var i;for(i in t)return!1;return!i};var Ai={bindListener_:function(t){var i=function(i){var s=t.listener,h=t.bindTo||t.target;return t.callOnce&&Ai.unlistenByKey(t),s.call(h,i)};return t.boundListener=i,i},findListener_:function(t,i,s,h){for(var n,r=0,e=t.length;r<e;++r)if((n=t[r]).listener===i&&n.bindTo===s)return h&&(n.deleteIndex=r),n},getListeners:function(t,i){var s=t.ol_lm;return s?s[i]:void 0},getListenerMap_:function(t){var i=t.ol_lm;return i||(i=t.ol_lm={}),i},removeListeners_:function(t,i){var s=Ai.getListeners(t,i);if(s){for(var h=0,n=s.length;h<n;++h)t.removeEventListener(i,s[h].boundListener),Si.clear(s[h]);s.length=0;var r=t.ol_lm;r&&(delete r[i],0===Object.keys(r).length&&delete t.ol_lm)}},listen:function(t,i,s,h,n){var r=Ai.getListenerMap_(t),e=r[i];e||(e=r[i]=[]);var o=Ai.findListener_(e,s,h,!1);return o?n||(o.callOnce=!1):(t.addEventListener(i,Ai.bindListener_(o={bindTo:h,callOnce:!!n,listener:s,target:t,type:i})),e.push(o)),o},listenOnce:function(t,i,s,h){return Ai.listen(t,i,s,h,!0)},unlisten:function(t,i,s,h){var n=Ai.getListeners(t,i);if(n){var r=Ai.findListener_(n,s,h,!0);r&&Ai.unlistenByKey(r)}},unlistenByKey:function(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var i=Ai.getListeners(t.target,t.type);if(i){var s="deleteIndex"in t?t.deleteIndex:i.indexOf(t);-1!==s&&i.splice(s,1),0===i.length&&Ai.removeListeners_(t.target,t.type)}Si.clear(t)}},unlistenAll:function(t){var i=Ai.getListenerMap_(t);for(var s in i)Ai.removeListeners_(t,s)}},Ni=function(){};Ni.prototype.disposed_=!1,Ni.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},Ni.prototype.disposeInternal=di.nullFunction;var zi=function(t){this.type=t,this.target=null};zi.prototype.preventDefault=zi.prototype.stopPropagation=function(){this.propagationStopped=!0},zi.stopPropagation=function(t){t.stopPropagation()},zi.preventDefault=function(t){t.preventDefault()};var ki=function(){Ni.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}};di.inherits(ki,Ni),ki.prototype.addEventListener=function(t,i){var s=this.listeners_[t];s||(s=this.listeners_[t]=[]),-1===s.indexOf(i)&&s.push(i)},ki.prototype.dispatchEvent=function(t){var i="string"==typeof t?new zi(t):t,s=i.type;i.target=this;var h,n=this.listeners_[s];if(n){s in this.dispatching_||(this.dispatching_[s]=0,this.pendingRemovals_[s]=0),++this.dispatching_[s];for(var r=0,e=n.length;r<e;++r)if(!1===n[r].call(this,i)||i.propagationStopped){h=!1;break}if(--this.dispatching_[s],0===this.dispatching_[s]){var o=this.pendingRemovals_[s];for(delete this.pendingRemovals_[s];o--;)this.removeEventListener(s,di.nullFunction);delete this.dispatching_[s]}return h}},ki.prototype.disposeInternal=function(){Ai.unlistenAll(this)},ki.prototype.getListeners=function(t){return this.listeners_[t]},ki.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},ki.prototype.removeEventListener=function(t,i){var s=this.listeners_[t];if(s){var h=s.indexOf(i);t in this.pendingRemovals_?(s[h]=di.nullFunction,++this.pendingRemovals_[t]):(s.splice(h,1),0===s.length&&delete this.listeners_[t])}};var Ri="change",Pi="clear",Ti="click",Oi="dblclick",Li="error",Ii="keydown",Fi="keypress",Di="load",Wi="mousewheel",Gi="resize",Vi="wheel",ji=function(){ki.call(this),this.revision_=0};di.inherits(ji,ki),ji.unByKey=function(t){if(Array.isArray(t))for(var i=0,s=t.length;i<s;++i)Ai.unlistenByKey(t[i]);else Ai.unlistenByKey(t)},ji.prototype.changed=function(){++this.revision_,this.dispatchEvent(Ri)},ji.prototype.getRevision=function(){return this.revision_},ji.prototype.on=function(t,i,s){if(Array.isArray(t)){for(var h=t.length,n=new Array(h),r=0;r<h;++r)n[r]=Ai.listen(this,t[r],i,s);return n}return Ai.listen(this,t,i,s)},ji.prototype.once=function(t,i,s){if(Array.isArray(t)){for(var h=t.length,n=new Array(h),r=0;r<h;++r)n[r]=Ai.listenOnce(this,t[r],i,s);return n}return Ai.listenOnce(this,t,i,s)},ji.prototype.un=function(t,i,s){if(Array.isArray(t))for(var h=0,n=t.length;h<n;++h)Ai.unlisten(this,t[h],i,s);else Ai.unlisten(this,t,i,s)};var Ui=function(t){ji.call(this),di.getUid(this),this.values_={},void 0!==t&&this.setProperties(t)};di.inherits(Ui,ji),Ui.changeEventTypeCache_={},Ui.getChangeEventType=function(t){return Ui.changeEventTypeCache_.hasOwnProperty(t)?Ui.changeEventTypeCache_[t]:Ui.changeEventTypeCache_[t]="change:"+t},Ui.prototype.get=function(t){var i;return this.values_.hasOwnProperty(t)&&(i=this.values_[t]),i},Ui.prototype.getKeys=function(){return Object.keys(this.values_)},Ui.prototype.getProperties=function(){return Si.assign({},this.values_)},Ui.prototype.notify=function(t,i){var s;s=Ui.getChangeEventType(t),this.dispatchEvent(new Ui.Event(s,t,i)),this.dispatchEvent(new Ui.Event(s=Ci,t,i))},Ui.prototype.set=function(t,i,s){if(s)this.values_[t]=i;else{var h=this.values_[t];this.values_[t]=i,h!==i&&this.notify(t,h)}},Ui.prototype.setProperties=function(t,i){var s;for(s in t)this.set(s,t[s],i)},Ui.prototype.unset=function(t,i){if(t in this.values_){var s=this.values_[t];delete this.values_[t],i||this.notify(t,s)}},di.inherits(Ui.Event=function(t,i,s){zi.call(this,t),this.key=i,this.oldValue=s},zi);var Xi=function(t){var i=di.VERSION?di.VERSION.split("-")[0]:"latest";this.message="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+t+" for details.",this.code=t,this.name="AssertionError"};di.inherits(Xi,Error);var qi=function(t,i){if(!t)throw new Xi(i)},Bi={clamp:function(t,i,s){return Math.min(Math.max(t,i),s)}};Bi.cosh="cosh"in Math?Math.cosh:function(t){var i=Math.exp(t);return(i+1/i)/2},Bi.roundUpToPowerOfTwo=function(t){return qi(0<t,29),Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},Bi.squaredSegmentDistance=function(t,i,s,h,n,r){var e=n-s,o=r-h;if(0!==e||0!==o){var a=((t-s)*e+(i-h)*o)/(e*e+o*o);a>1?(s=n,h=r):a>0&&(s+=e*a,h+=o*a)}return Bi.squaredDistance(t,i,s,h)},Bi.squaredDistance=function(t,i,s,h){var n=s-t,r=h-i;return n*n+r*r},Bi.solveLinearSystem=function(t){for(var i=t.length,s=0;s<i;s++){for(var h=s,n=Math.abs(t[s][s]),r=s+1;r<i;r++){var e=Math.abs(t[r][s]);e>n&&(n=e,h=r)}if(0===n)return null;var o=t[h];t[h]=t[s],t[s]=o;for(var a=s+1;a<i;a++)for(var u=-t[a][s]/t[s][s],f=s;f<i+1;f++)s==f?t[a][f]=0:t[a][f]+=u*t[s][f]}for(var c=new Array(i),l=i-1;l>=0;l--){c[l]=t[l][i]/t[l][l];for(var v=l-1;v>=0;v--)t[v][i]-=t[v][l]*c[l]}return c},Bi.toDegrees=function(t){return 180*t/Math.PI},Bi.toRadians=function(t){return t*Math.PI/180},Bi.modulo=function(t,i){var s=t%i;return s*i<0?s+i:s},Bi.lerp=function(t,i,s){return t+s*(i-t)};var Yi="Point",Hi="LineString",Ji="LinearRing",Zi="Polygon",Ki="MultiPoint",Qi="MultiLineString",$i="MultiPolygon",ts="GeometryCollection",is="Circle",ss=function(t){this.radius=t};
1
+ import{r as t,e as i,h as s,c as h,g as n}from"./p-99a3742a.js";import{f as r}from"./p-25a09313.js";import{c as e,a as o}from"./p-3e8ff66b.js";var a=484813681109536e-20,u=Math.PI/2,f=1e-10,c=.017453292519943295,l=57.29577951308232,v=Math.PI/4,d=2*Math.PI,M=3.14159265359,m={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const p={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var g=/[\s_\-\/\(\)]/g;function _(t,i){if(t[i])return t[i];for(var s,h=Object.keys(t),n=i.toLowerCase().replace(g,""),r=-1;++r<h.length;)if((s=h[r]).toLowerCase().replace(g,"")===n)return t[s]}function w(t){var i,s,h,n={},r=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var s=i.split("=");return s.push(!0),t[s[0].toLowerCase()]=s[1],t}),{}),e={proj:"projName",datum:"datumCode",rf:function(t){n.rf=parseFloat(t)},lat_0:function(t){n.lat0=t*c},lat_1:function(t){n.lat1=t*c},lat_2:function(t){n.lat2=t*c},lat_ts:function(t){n.lat_ts=t*c},lon_0:function(t){n.long0=t*c},lon_1:function(t){n.long1=t*c},lon_2:function(t){n.long2=t*c},alpha:function(t){n.alpha=parseFloat(t)*c},lonc:function(t){n.longc=t*c},x_0:function(t){n.x0=parseFloat(t)},y_0:function(t){n.y0=parseFloat(t)},k_0:function(t){n.k0=parseFloat(t)},k:function(t){n.k0=parseFloat(t)},a:function(t){n.a=parseFloat(t)},b:function(t){n.b=parseFloat(t)},r_a:function(){n.R_A=!0},zone:function(t){n.zone=parseInt(t,10)},south:function(){n.utmSouth=!0},towgs84:function(t){n.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){n.to_meter=parseFloat(t)},units:function(t){n.units=t;var i=_(p,t);i&&(n.to_meter=i.to_meter)},from_greenwich:function(t){n.from_greenwich=t*c},pm:function(t){var i=_(m,t);n.from_greenwich=(i||parseFloat(t))*c},nadgrids:function(t){"@null"===t?n.datumCode="none":n.nadgrids=t},axis:function(t){var i="ewnsud";3===t.length&&-1!==i.indexOf(t.substr(0,1))&&-1!==i.indexOf(t.substr(1,1))&&-1!==i.indexOf(t.substr(2,1))&&(n.axis=t)}};for(i in r)s=r[i],i in e?"function"==typeof(h=e[i])?h(s):n[h]=s:n[i]=s;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n}var y=/\s/,b=/[A-Za-z]/,x=/[A-Za-z84_]/,E=/[,\]]/,C=/[\d\.E\-\+]/;function S(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function z(t,i,s){Array.isArray(i)&&(s.unshift(i),i=null);var h=s.reduce((function(t,i){return A(i,t),t}),i?{}:t);i&&(t[i]=h)}function A(t,i){if(Array.isArray(t)){var s=t.shift();if("PARAMETER"===s&&(s=t.shift()),1===t.length)return Array.isArray(t[0])?(i[s]={},void A(t[0],i[s])):void(i[s]=t[0]);if(t.length)if("TOWGS84"!==s){if("AXIS"===s)return s in i||(i[s]=[]),void i[s].push(t);var h;switch(Array.isArray(s)||(i[s]={}),s){case"UNIT":case"PRIMEM":case"VERT_DATUM":return i[s]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&A(t[2],i[s]));case"SPHEROID":case"ELLIPSOID":return i[s]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&A(t[3],i[s]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void z(i,s,t);default:for(h=-1;++h<t.length;)if(!Array.isArray(t[h]))return A(t,i[s]);return z(i,s,t)}}else i[s]=t;else i[s]=!0}else i[t]=!0}function k(t){return.017453292519943295*t}function N(t){var i=new S(t).output(),s=i.shift(),h=i.shift();i.unshift(["name",h]),i.unshift(["type",s]);var n={};return A(i,n),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):t.projName="object"==typeof t.PROJECTION?Object.keys(t.PROJECTION)[0]:t.PROJECTION,t.AXIS){for(var i="",s=0,h=t.AXIS.length;s<h;++s){var n=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];-1!==n[0].indexOf("north")||("y"===n[0]||"lat"===n[0])&&"north"===n[1]?i+="n":-1!==n[0].indexOf("south")||("y"===n[0]||"lat"===n[0])&&"south"===n[1]?i+="s":-1!==n[0].indexOf("east")||("x"===n[0]||"lon"===n[0])&&"east"===n[1]?i+="e":-1===n[0].indexOf("west")&&("x"!==n[0]&&"lon"!==n[0]||"west"!==n[1])||(i+="w")}2===i.length&&(i+="u"),3===i.length&&(t.axis=i)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var r=t.GEOGCS;function e(i){return i*(t.to_meter||1)}"GEOGCS"===t.type&&(r=t),r&&(t.datumCode=r.DATUM?r.DATUM.name.toLowerCase():r.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(t.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=r.DATUM.SPHEROID.a,t.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(t.datum_params=r.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",k],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",k],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",k],["lat0","latitude_of_origin",k],["lat0","standard_parallel_1",k],["lat1","standard_parallel_1",k],["lat2","standard_parallel_2",k],["azimuth","Azimuth"],["alpha","azimuth",k],["srsCode","name"]].forEach((function(i){return r=(h=i)[1],void(!((n=h[0])in(s=t))&&r in s&&(s[n]=s[r],3===h.length&&(s[n]=h[2](s[n]))));var s,h,n,r})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=k(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(n),n}function R(t){var i=this;if(2===arguments.length){var s=arguments[1];R[t]="string"==typeof s?"+"===s.charAt(0)?w(arguments[1]):N(arguments[1]):s}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?R.apply(i,t):R(t)}));if("string"==typeof t){if(t in R)return R[t]}else"EPSG"in t?R["EPSG:"+t.EPSG]=t:"ESRI"in t?R["ESRI:"+t.ESRI]=t:"IAU2000"in t?R["IAU2000:"+t.IAU2000]=t:console.log(t);return}}S.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;y.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},S.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(E.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},S.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},S.prototype.number=function(t){if(!C.test(t)){if(E.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},S.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},S.prototype.keyword=function(t){if(x.test(t))this.word+=t;else{if("["===t){var i=[];return i.push(this.word),this.level++,null===this.root?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,void(this.state=1)}if(!E.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},S.prototype.neutral=function(t){if(b.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(C.test(t))return this.word=t,void(this.state=3);if(!E.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},S.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)},function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(R);var P=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function T(t,i){var s,h;if(t=t||{},!i)return t;for(h in i)void 0!==(s=i[h])&&(t[h]=s);return t}function O(t,i,s){var h=t*i;return s/Math.sqrt(1-h*h)}function L(t){return t<0?-1:1}function F(t){return Math.abs(t)<=M?t:t-L(t)*d}function I(t,i,s){var h=t*s;return h=Math.pow((1-h)/(1+h),.5*t),Math.tan(.5*(u-i))/h}function D(t,i){for(var s,h,n=.5*t,r=u-2*Math.atan(i),e=0;e<=15;e++)if(s=t*Math.sin(r),r+=h=u-2*Math.atan(i*Math.pow((1-s)/(1+s),n))-r,Math.abs(h)<=1e-10)return r;return-9999}function W(t){return t}var G=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):O(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1)},forward:function(t){var i,s,h=t.x,n=t.y;if(n*l>90&&n*l<-90&&h*l>180&&h*l<-180)return null;if(Math.abs(Math.abs(n)-u)<=f)return null;if(this.sphere)i=this.x0+this.a*this.k0*F(h-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(v+.5*n));else{var r=Math.sin(n),e=I(this.e,n,r);i=this.x0+this.a*this.k0*F(h-this.long0),s=this.y0-this.a*this.k0*Math.log(e)}return t.x=i,t.y=s,t},inverse:function(t){var i,s,h=t.x-this.x0,n=t.y-this.y0;if(this.sphere)s=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var r=Math.exp(-n/(this.a*this.k0));if(-9999===(s=D(this.e,r)))return null}return i=F(this.long0+h/(this.a*this.k0)),t.x=i,t.y=s,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:W,inverse:W,names:["longlat","identity"]}],V={},j=[];function U(t,i){var s=j.length;return t.names?(j[s]=t,t.names.forEach((function(t){V[t.toLowerCase()]=s})),this):(console.log(i),!0)}const X={start:function(){G.forEach(U)},add:U,get:function(t){if(!t)return!1;var i=t.toLowerCase();return void 0!==V[i]&&j[V[i]]?j[V[i]]:void 0}};var q={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},B=q.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};q.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Y={};function H(t,i){if(!(this instanceof H))return new H(t);i=i||function(t){if(t)throw t};var s,h=function(t){return"string"==typeof t}(s=t)?function(t){return t in R}(s)?R[s]:function(t){return P.some((function(i){return t.indexOf(i)>-1}))}(s)?N(s):function(t){return"+"===t[0]}(s)?w(s):void 0:s;if("object"==typeof h){var n=H.projections.get(h.projName);if(n){if(h.datumCode&&"none"!==h.datumCode){var r=_(Y,h.datumCode);r&&(h.datum_params=r.towgs84?r.towgs84.split(","):null,h.ellps=r.ellipse,h.datumName=r.datumName?r.datumName:h.datumCode)}h.k0=h.k0||1,h.axis=h.axis||"enu",h.ellps=h.ellps||"wgs84";var e,o,u,c,l,v,d=function(t,i,s,h,n){if(!t){var r=_(q,h);r||(r=B),t=r.a,i=r.b,s=r.rf}return s&&!i&&(i=(1-1/s)*t),(0===s||Math.abs(t-i)<f)&&(n=!0,i=t),{a:t,b:i,rf:s,sphere:n}}(h.a,h.b,h.rf,h.ellps,h.sphere),M=(l=((u=(e=d.a)*e)-(c=(o=d.b)*o))/u,v=0,h.R_A?(u=(e*=1-l*(.16666666666666666+l*(.04722222222222222+.022156084656084655*l)))*e,l=0):v=Math.sqrt(l),{es:l,e:v,ep2:(u-c)/c}),m=h.datum||function(t,i,s,h,n,r){var e={};return e.datum_type=void 0===t||"none"===t?5:4,i&&(e.datum_params=i.map(parseFloat),0===e.datum_params[0]&&0===e.datum_params[1]&&0===e.datum_params[2]||(e.datum_type=1),e.datum_params.length>3&&(0===e.datum_params[3]&&0===e.datum_params[4]&&0===e.datum_params[5]&&0===e.datum_params[6]||(e.datum_type=2,e.datum_params[3]*=a,e.datum_params[4]*=a,e.datum_params[5]*=a,e.datum_params[6]=e.datum_params[6]/1e6+1))),e.a=s,e.b=h,e.es=n,e.ep2=r,e}(h.datumCode,h.datum_params,d.a,d.b,M.es,M.ep2);T(this,h),T(this,n),this.a=d.a,this.b=d.b,this.rf=d.rf,this.sphere=d.sphere,this.es=M.es,this.e=M.e,this.ep2=M.ep2,this.datum=m,this.init(),i(null,this)}else i(t)}else i(t)}function J(t){return 1===t||2===t}function Z(t,i,s){var h,n,r,e=s.x,o=s.y,a=s.z||0,u={};for(r=0;r<3;r++)if(!i||2!==r||void 0!==s.z)switch(0===r?(h=e,n="x"):1===r?(h=o,n="y"):(h=a,n="z"),t.axis[r]){case"e":case"n":u[n]=h;break;case"w":case"s":u[n]=-h;break;case"u":void 0!==s[n]&&(u.z=h);break;case"d":void 0!==s[n]&&(u.z=-h);break;default:return null}return u}function K(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function Q(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function $(t,i,s){var h;return Array.isArray(s)&&(s=K(s)),function(t){Q(t.x),Q(t.y)}(s),t.datum&&i.datum&&function(t,i){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==i.datumCode||(1===i.datum.datum_type||2===i.datum.datum_type)&&"WGS84"!==t.datumCode}(t,i)&&(s=$(t,h=new H("WGS84"),s),t=h),"enu"!==t.axis&&(s=Z(t,!1,s)),"longlat"===t.projName?s={x:s.x*c,y:s.y*c}:(t.to_meter&&(s={x:s.x*t.to_meter,y:s.y*t.to_meter}),s=t.inverse(s)),t.from_greenwich&&(s.x+=t.from_greenwich),s=function(t,i,s){return function(t,i){return t.datum_type===i.datum_type&&!(t.a!==i.a||Math.abs(t.es-i.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:2!==t.datum_type||t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6])}(t,i)||5===t.datum_type||5===i.datum_type?s:t.es!==i.es||t.a!==i.a||J(t.datum_type)||J(i.datum_type)?(s=function(t,i,s){var h,n,r,e=t.x,o=t.y,a=t.z?t.z:0;if(o<-u&&o>-1.001*u)o=-u;else if(o>u&&o<1.001*u)o=u;else if(o<-u||o>u)return null;return e>Math.PI&&(e-=2*Math.PI),n=Math.sin(o),r=Math.cos(o),{x:((h=s/Math.sqrt(1-i*(n*n)))+a)*r*Math.cos(e),y:(h+a)*r*Math.sin(e),z:(h*(1-i)+a)*n}}(s,t.es,t.a),J(t.datum_type)&&(s=function(t,i,s){if(1===i)return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]};if(2===i){var h=s[3],n=s[4],r=s[5],e=s[6];return{x:e*(t.x-r*t.y+n*t.z)+s[0],y:e*(r*t.x+t.y-h*t.z)+s[1],z:e*(-n*t.x+h*t.y+t.z)+s[2]}}}(s,t.datum_type,t.datum_params)),J(i.datum_type)&&(s=function(t,i,s){if(1===i)return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]};if(2===i){var h=s[3],n=s[4],r=s[5],e=s[6],o=(t.x-s[0])/e,a=(t.y-s[1])/e,u=(t.z-s[2])/e;return{x:o+r*a-n*u,y:-r*o+a+h*u,z:n*o-h*a+u}}}(s,i.datum_type,i.datum_params)),function(t,i,s,h){var n,r,e,o,a,u,f,c,l,v,d,M,m,p,g,_=t.x,w=t.y,y=t.z?t.z:0;if(n=Math.sqrt(_*_+w*w),r=Math.sqrt(_*_+w*w+y*y),n/s<1e-12){if(p=0,r/s<1e-12)return g=-h,{x:t.x,y:t.y,z:t.z}}else p=Math.atan2(w,_);e=y/r,c=(o=n/r)*(1-i)*(a=1/Math.sqrt(1-i*(2-i)*o*o)),l=e*a,m=0;do{m++,u=i*(f=s/Math.sqrt(1-i*l*l))/(f+(g=n*c+y*l-f*(1-i*l*l))),M=(d=e*(a=1/Math.sqrt(1-u*(2-u)*o*o)))*c-(v=o*(1-u)*a)*l,c=v,l=d}while(M*M>1e-24&&m<30);return{x:p,y:Math.atan(d/Math.abs(v)),z:g}}(s,i.es,i.a,i.b)):s}(t.datum,i.datum,s),i.from_greenwich&&(s={x:s.x-i.from_greenwich,y:s.y}),"longlat"===i.projName?s={x:s.x*l,y:s.y*l}:(s=i.forward(s),i.to_meter&&(s={x:s.x/i.to_meter,y:s.y/i.to_meter})),"enu"!==i.axis?Z(i,!0,s):s}Y.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Y.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Y.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Y.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Y.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Y.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Y.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Y.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},Y.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Y.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Y.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Y.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Y.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Y.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Y.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Y.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Y.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},(H.projections=X).start();var tt=H("WGS84");function it(t,i,s){var h,n,r;return Array.isArray(s)?(h=$(t,i,s),3===s.length?[h.x,h.y,h.z]:[h.x,h.y]):(n=$(t,i,s),2===(r=Object.keys(s)).length||r.forEach((function(t){"x"!==t&&"y"!==t&&(n[t]=s[t])})),n)}function st(t){return t instanceof H?t:t.oProj?t.oProj:H(t)}function ht(t,i,s){t=st(t);var h,n=!1;return void 0===i?(i=t,t=tt,n=!0):(void 0!==i.x||Array.isArray(i))&&(s=i,i=t,t=tt,n=!0),i=st(i),s?it(t,i,s):(h={forward:function(s){return it(t,i,s)},inverse:function(s){return it(i,t,s)}},n&&(h.oProj=i),h)}var nt="AJSAJS",rt="AFAFAF",et=65,ot=73,at=79;const ut={forward:ft,inverse:function(t){var i=dt(mt(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat,i.lon,i.lat]:[i.left,i.bottom,i.right,i.top]},toPoint:ct};function ft(t,i){return i=i||5,function(t,i){var s,h,n,r,e,o,a,u,f,c,l,v="00000"+t.easting,d="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(f=t.easting,c=t.northing,l=Mt(t.zoneNumber),s=Math.floor(f/1e5),h=Math.floor(c/1e5)%20,r=nt.charCodeAt(n=l-1),e=rt.charCodeAt(n),u=!1,(o=r+s-1)>90&&(o=o-90+et-1,u=!0),(o===ot||r<ot&&o>ot||(o>ot||r<ot)&&u)&&o++,(o===at||r<at&&o>at||(o>at||r<at)&&u)&&++o===ot&&o++,o>90&&(o=o-90+et-1),(a=e+h)>86?(a=a-86+et-1,u=!0):u=!1,(a===ot||e<ot&&a>ot||(a>ot||e<ot)&&u)&&a++,(a===at||e<at&&a>at||(a>at||e<at)&&u)&&++a===ot&&a++,a>86&&(a=a-86+et-1),String.fromCharCode(o)+String.fromCharCode(a))+v.substr(v.length-5,i)+d.substr(d.length-5,i)}(function(t){var i,s,h,n,r,e,o,a=t.lat,u=t.lon,f=6378137,c=.00669438,l=.9996,v=lt(a),d=lt(u);o=Math.floor((u+180)/6)+1,180===u&&(o=60),a>=56&&a<64&&u>=3&&u<12&&(o=32),a>=72&&a<84&&(u>=0&&u<9?o=31:u>=9&&u<21?o=33:u>=21&&u<33?o=35:u>=33&&u<42&&(o=37)),e=lt(6*(o-1)-180+3),i=.006739496752268451,s=f/Math.sqrt(1-c*Math.sin(v)*Math.sin(v)),h=Math.tan(v)*Math.tan(v),n=i*Math.cos(v)*Math.cos(v);var M,m,p=l*s*((r=Math.cos(v)*(d-e))+(1-h+n)*r*r*r/6+(5-18*h+h*h+72*n-58*i)*r*r*r*r*r/120)+5e5,g=l*(f*(.9983242984503243*v-.002514607064228144*Math.sin(2*v)+2639046602129982e-21*Math.sin(4*v)-3.418046101696858e-9*Math.sin(6*v))+s*Math.tan(v)*(r*r/2+(5-h+9*n+4*n*n)*r*r*r*r/24+(61-58*h+h*h+600*n-2.2240339282485886)*r*r*r*r*r*r/720));return a<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(p),zoneNumber:o,zoneLetter:(M=a,m="Z",84>=M&&M>=72?m="X":72>M&&M>=64?m="W":64>M&&M>=56?m="V":56>M&&M>=48?m="U":48>M&&M>=40?m="T":40>M&&M>=32?m="S":32>M&&M>=24?m="R":24>M&&M>=16?m="Q":16>M&&M>=8?m="P":8>M&&M>=0?m="N":0>M&&M>=-8?m="M":-8>M&&M>=-16?m="L":-16>M&&M>=-24?m="K":-24>M&&M>=-32?m="J":-32>M&&M>=-40?m="H":-40>M&&M>=-48?m="G":-48>M&&M>=-56?m="F":-56>M&&M>=-64?m="E":-64>M&&M>=-72?m="D":-72>M&&M>=-80&&(m="C"),m)}}({lat:t[1],lon:t[0]}),i)}function ct(t){var i=dt(mt(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function lt(t){return t*(Math.PI/180)}function vt(t){return t/Math.PI*180}function dt(t){var i=t.northing,s=t.easting,h=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var r,e,o,a,u,f,c,l,v,d=.9996,M=6378137,m=.00669438,p=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=s-5e5,_=i;h<"N"&&(_-=1e7),c=6*(n-1)-180+3,r=.006739496752268451,v=(l=_/d/6367449.145945056)+(3*p/2-27*p*p*p/32)*Math.sin(2*l)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*l)+151*p*p*p/96*Math.sin(6*l),e=M/Math.sqrt(1-m*Math.sin(v)*Math.sin(v)),o=Math.tan(v)*Math.tan(v),a=r*Math.cos(v)*Math.cos(v),u=.99330562*M/Math.pow(1-m*Math.sin(v)*Math.sin(v),1.5),f=g/(e*d);var w=v-e*Math.tan(v)/u*(f*f/2-(5+3*o+10*a-4*a*a-9*r)*f*f*f*f/24+(61+90*o+298*a+45*o*o-1.6983531815716497-3*a*a)*f*f*f*f*f*f/720);w=vt(w);var y,b=(f-(1+2*o+a)*f*f*f/6+(5-2*a+28*o-3*a*a+8*r+24*o*o)*f*f*f*f*f/120)/Math.cos(v);if(b=c+vt(b),t.accuracy){var x=dt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:x.lat,right:x.lon,bottom:w,left:b}}else y={lat:w,lon:b};return y}function Mt(t){var i=t%6;return 0===i&&(i=6),i}function mt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var i,s=t.length,h=null,n="",r=0;!/[A-Z]/.test(i=t.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+t;n+=i,r++}var e=parseInt(n,10);if(0===r||r+3>s)throw"MGRSPoint bad conversion from: "+t;var o=t.charAt(r++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+t;h=t.substring(r,r+=2);for(var a=Mt(e),u=function(t,i){for(var s=nt.charCodeAt(i-1),h=1e5,n=!1;s!==t.charCodeAt(0);){if(++s===ot&&s++,s===at&&s++,s>90){if(n)throw"Bad character: "+t;s=et,n=!0}h+=1e5}return h}(h.charAt(0),a),f=function(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var s=rt.charCodeAt(i-1),h=0,n=!1;s!==t.charCodeAt(0);){if(++s===ot&&s++,s===at&&s++,s>86){if(n)throw"Bad character: "+t;s=et,n=!0}h+=1e5}return h}(h.charAt(1),a);f<pt(o);)f+=2e6;var c=s-r;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var l,v,d,M=c/2,m=0,p=0;return M>0&&(l=1e5/Math.pow(10,M),v=t.substring(r,r+M),m=parseFloat(v)*l,d=t.substring(r+M),p=parseFloat(d)*l),{easting:m+u,northing:p+f,zoneLetter:o,zoneNumber:e,accuracy:l}}function pt(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function gt(t,i,s){if(!(this instanceof gt))return new gt(t,i,s);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===i){var h=t.split(",");this.x=parseFloat(h[0],10),this.y=parseFloat(h[1],10),this.z=parseFloat(h[2],10)||0}else this.x=t,this.y=i,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}gt.fromMGRS=function(t){return new gt(ct(t))},gt.prototype.toMGRS=function(t){return ft([this.x,this.y],t)};var _t=.046875,wt=.01953125,yt=.01068115234375;function bt(t){var i=[];i[0]=1-t*(.25+t*(_t+t*(wt+t*yt))),i[1]=t*(.75-t*(_t+t*(wt+t*yt)));var s=t*t;return i[2]=s*(.46875-t*(.013020833333333334+.007120768229166667*t)),i[3]=(s*=t)*(.3645833333333333-.005696614583333333*t),i[4]=s*t*.3076171875,i}function xt(t,i,s,h){return h[0]*t-(s*=i)*(h[1]+(i*=i)*(h[2]+i*(h[3]+i*h[4])))}function Et(t,i,s){for(var h=1/(1-i),n=t,r=20;r;--r){var e=Math.sin(n),o=1-i*e*e;if(n-=o=(xt(n,e,Math.cos(n),s)-t)*(o*Math.sqrt(o))*h,Math.abs(o)<f)return n}return n}const Ct={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=bt(this.es),this.ml0=xt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var i,s,h,n=t.y,r=F(t.x-this.long0),e=Math.sin(n),o=Math.cos(n);if(this.es){var a=o*r,u=Math.pow(a,2),c=this.ep2*Math.pow(o,2),l=Math.pow(c,2),v=Math.abs(o)>f?Math.tan(n):0,d=Math.pow(v,2),M=Math.pow(d,2);i=1-this.es*Math.pow(e,2),a/=Math.sqrt(i);var m=xt(n,e,o,this.en);s=this.a*(this.k0*a*(1+u/6*(1-d+c+u/20*(5-18*d+M+14*c-58*d*c+u/42*(61+179*M-M*d-479*d)))))+this.x0,h=this.a*(this.k0*(m-this.ml0+e*r*a/2*(1+u/12*(5-d+9*c+4*l+u/30*(61+M-58*d+270*c-330*d*c+u/56*(1385+543*M-M*d-3111*d))))))+this.y0}else{var p=o*Math.sin(r);if(Math.abs(Math.abs(p)-1)<f)return 93;if(s=.5*this.a*this.k0*Math.log((1+p)/(1-p))+this.x0,h=o*Math.cos(r)/Math.sqrt(1-Math.pow(p,2)),(p=Math.abs(h))>=1){if(p-1>f)return 93;h=0}else h=Math.acos(h);n<0&&(h=-h),h=this.a*this.k0*(h-this.lat0)+this.y0}return t.x=s,t.y=h,t},inverse:function(t){var i,s,h,n,r=1/this.a*(t.x-this.x0),e=1/this.a*(t.y-this.y0);if(this.es)if(s=Et(i=this.ml0+e/this.k0,this.es,this.en),Math.abs(s)<u){var o=Math.sin(s),a=Math.cos(s),c=Math.abs(a)>f?Math.tan(s):0,l=this.ep2*Math.pow(a,2),v=Math.pow(l,2),d=Math.pow(c,2),M=Math.pow(d,2);i=1-this.es*Math.pow(o,2);var m=r*Math.sqrt(i)/this.k0,p=Math.pow(m,2);h=s-(i*=c)*p/(1-this.es)*.5*(1-p/12*(5+3*d-9*l*d+l-4*v-p/30*(61+90*d-252*l*d+45*M+46*l-p/56*(1385+3633*d+4095*M+1574*M*d)))),n=F(this.long0+m*(1-p/6*(1+2*d+l-p/20*(5+28*d+24*M+8*l*d+6*l-p/42*(61+662*d+1320*M+720*M*d))))/a)}else h=u*L(e),n=0;else{var g=Math.exp(r/this.k0),_=.5*(g-1/g),w=Math.cos(this.lat0+e/this.k0);i=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(_,2))),h=Math.asin(i),e<0&&(h=-h),n=0===_&&0===w?0:F(Math.atan2(_,w)+this.long0)}return t.x=n,t.y=h,t},names:["Transverse_Mercator","Transverse Mercator","tmerc"]};function St(t){var i=Math.exp(t);return(i-1/i)/2}function zt(t,i){t=Math.abs(t),i=Math.abs(i);var s=Math.max(t,i),h=Math.min(t,i)/(s||1);return s*Math.sqrt(1+Math.pow(h,2))}function At(t,i){for(var s,h=2*Math.cos(2*i),n=t.length-1,r=t[n],e=0;--n>=0;)s=h*r-e+t[n],e=r,r=s;return i+s*Math.sin(2*i)}function kt(t,i,s){for(var h,n,r=Math.sin(i),e=Math.cos(i),o=St(s),a=function(t){var i=Math.exp(t);return(i+1/i)/2}(s),u=2*e*a,f=-2*r*o,c=t.length-1,l=t[c],v=0,d=0,M=0;--c>=0;)h=d,n=v,l=u*(d=l)-h-f*(v=M)+t[c],M=f*d-n+u*v;return[(u=r*a)*l-(f=e*o)*M,u*M+f*l]}const Nt={init:function(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),i=t/(2-t),s=i;this.cgb[0]=i*(2+i*(-2/3+i*(i*(116/45+i*(26/45+i*(-2854/675)))-2))),this.cbg[0]=i*(i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))-2),this.cgb[1]=(s*=i)*(7/3+i*(i*(-227/45+i*(2704/315+i*(2323/945)))-1.6)),this.cbg[1]=s*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),this.cgb[2]=(s*=i)*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=s*(-26/15+i*(34/21+i*(1.6+i*(-12686/2835)))),this.cgb[3]=(s*=i)*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=s*(1237/630+i*(i*(-24832/14175)-2.4)),this.cgb[4]=(s*=i)*(4174/315+i*(-144838/6237)),this.cbg[4]=s*(-734/315+i*(109598/31185)),this.cgb[5]=(s*=i)*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=i*(i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))-.5),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=s*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=s*(13/48+i*(i*(557/1440+i*(281/630+i*(-1983433/1935360)))-.6)),this.utg[2]=(s*=i)*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=s*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),this.utg[3]=(s*=i)*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=s*(49561/161280+i*(-179/168+i*(6601661/7257600))),this.utg[4]=(s*=i)*(-4583/161280+i*(108847/3991680)),this.gtu[4]=s*(34729/80640+i*(-3418889/1995840)),this.utg[5]=(s*=i)*(-20648693/638668800),this.gtu[5]=.6650675310896665*s;var h=At(this.cbg,this.lat0);this.Zb=-this.Qn*(h+function(t,i){for(var s,h=2*Math.cos(i),n=t.length-1,r=t[n],e=0;--n>=0;)s=h*r-e+t[n],e=r,r=s;return Math.sin(i)*s}(this.gtu,2*h))},forward:function(t){var i=F(t.x-this.long0),s=t.y;s=At(this.cbg,s);var h=Math.sin(s),n=Math.cos(s),r=Math.sin(i),e=Math.cos(i);s=Math.atan2(h,e*n),i=Math.atan2(r*n,zt(h,n*e)),i=function(t){var i=Math.abs(t);return i=function(t){var i=1+t,s=i-1;return 0===s?t:t*Math.log(i)/s}(i*(1+i/(zt(1,i)+1))),t<0?-i:i}(Math.tan(i));var o,a,u=kt(this.gtu,2*s,2*i);return s+=u[0],i+=u[1],Math.abs(i)<=2.623395162778?(o=this.a*(this.Qn*i)+this.x0,a=this.a*(this.Qn*s+this.Zb)+this.y0):(o=1/0,a=1/0),t.x=o,t.y=a,t},inverse:function(t){var i,s,h=1/this.a*(t.x-this.x0),n=1/this.a*(t.y-this.y0);if(n=(n-this.Zb)/this.Qn,h/=this.Qn,Math.abs(h)<=2.623395162778){var r=kt(this.utg,2*n,2*h);n+=r[0],h+=r[1],h=Math.atan(St(h));var e=Math.sin(n),o=Math.cos(n),a=Math.sin(h),u=Math.cos(h);n=Math.atan2(e*u,zt(a,u*o)),i=F((h=Math.atan2(a,u*o))+this.long0),s=At(this.cgb,n)}else i=1/0,s=1/0;return t.x=i,t.y=s,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"]},Rt={init:function(){var t=function(t,i){if(void 0===t){if((t=Math.floor(30*(F(i)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*c,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Nt.init.apply(this),this.forward=Nt.forward,this.inverse=Nt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Pt(t,i){return Math.pow((1-t)/(1+t),i)}const Tt={init:function(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+v)/(Math.pow(Math.tan(.5*this.lat0+v),this.C)*Pt(this.e*t,this.ratexp))},forward:function(t){var i=t.x,s=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+v),this.C)*Pt(this.e*Math.sin(s),this.ratexp))-u,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,s=t.y,h=Math.pow(Math.tan(.5*s+v)/this.K,1/this.C),n=20;n>0&&(s=2*Math.atan(h*Pt(this.e*Math.sin(t.y),-.5*this.e))-u,!(Math.abs(s-t.y)<1e-14));--n)t.y=s;return n?(t.x=i,t.y=s,t):null},names:["gauss"]},Ot={init:function(){Tt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var i,s,h,n;return t.x=F(t.x-this.long0),Tt.forward.apply(this,[t]),i=Math.sin(t.y),s=Math.cos(t.y),h=Math.cos(t.x),t.x=(n=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*s*h))*s*Math.sin(t.x),t.y=n*(this.cosc0*i-this.sinc0*s*h),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var i,s,h,n,r;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,r=Math.sqrt(t.x*t.x+t.y*t.y)){var e=2*Math.atan2(r,this.R2);i=Math.sin(e),s=Math.cos(e),n=Math.asin(s*this.sinc0+t.y*i*this.cosc0/r),h=Math.atan2(t.x*i,r*this.cosc0*s-t.y*this.sinc0*i)}else n=this.phic0,h=0;return t.x=h,t.y=n,Tt.inverse.apply(this,[t]),t.x=F(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"]},Lt={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=f&&(this.k0=.5*(1+L(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=f&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=f&&(this.k0=.5*this.cons*O(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/I(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=O(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var i,s,h,n,r,e,o=t.x,a=t.y,c=Math.sin(a),l=Math.cos(a),v=F(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=f&&Math.abs(a+this.lat0)<=f?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*c+this.coslat0*l*Math.cos(v)),t.x=this.a*i*l*Math.sin(v)+this.x0,t.y=this.a*i*(this.coslat0*c-this.sinlat0*l*Math.cos(v))+this.y0,t):(s=2*Math.atan(this.ssfn_(a,c,this.e))-u,n=Math.cos(s),h=Math.sin(s),Math.abs(this.coslat0)<=f?(r=I(this.e,a*this.con,this.con*c),t.x=this.x0+(e=2*this.a*this.k0*r/this.cons)*Math.sin(o-this.long0),t.y=this.y0-this.con*e*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<f?(i=2*this.a*this.k0/(1+n*Math.cos(v)),t.y=i*h):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*h+this.cosX0*n*Math.cos(v))),t.y=i*(this.cosX0*h-this.sinX0*n*Math.cos(v))+this.y0),t.x=i*n*Math.sin(v)+this.x0,t))},inverse:function(t){var i,s,h,n;t.x-=this.x0,t.y-=this.y0;var r=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var e=2*Math.atan(r/(.5*this.a*this.k0));return i=this.long0,s=this.lat0,r<=f?(t.x=i,t.y=s,t):(s=Math.asin(Math.cos(e)*this.sinlat0+t.y*Math.sin(e)*this.coslat0/r),i=Math.abs(this.coslat0)<f?F(this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y)):F(this.long0+Math.atan2(t.x*Math.sin(e),r*this.coslat0*Math.cos(e)-t.y*this.sinlat0*Math.sin(e))),t.x=i,t.y=s,t)}if(Math.abs(this.coslat0)<=f){if(r<=f)return s=this.lat0,t.x=i=this.long0,t.y=s,t;t.x*=this.con,t.y*=this.con,s=this.con*D(this.e,r*this.cons/(2*this.a*this.k0)),i=this.con*F(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else h=2*Math.atan(r*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,r<=f?n=this.X0:(n=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/r),i=F(this.long0+Math.atan2(t.x*Math.sin(h),r*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)))),s=-1*D(this.e,Math.tan(.5*(u+n)));return t.x=i,t.y=s,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,i,s){return i*=s,Math.tan(.5*(u+t))*Math.pow((1-i)/(1+i),.5*s)}},Ft={init:function(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),s=this.a,h=1/this.rf,n=2*h-Math.pow(h,2),r=this.e=Math.sqrt(n);this.R=this.k0*s*Math.sqrt(1-n)/(1-n*Math.pow(i,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var e=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+t/2)),a=Math.log((1+r*i)/(1-r*i));this.K=e-this.alpha*o+this.alpha*r/2*a},forward:function(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),h=2*(Math.atan(Math.exp(-this.alpha*(i+s)+this.K))-Math.PI/4),n=this.alpha*(t.x-this.lambda0),r=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(n))),e=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(n));return t.y=this.R/2*Math.log((1+Math.sin(e))/(1-Math.sin(e)))+this.y0,t.x=this.R*r+this.x0,t},inverse:function(t){for(var i=(t.x-this.x0)/this.R,s=2*(Math.atan(Math.exp((t.y-this.y0)/this.R))-Math.PI/4),h=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),n=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(s))),r=this.lambda0+n/this.alpha,e=0,o=h,a=-1e3,u=0;Math.abs(o-a)>1e-7;){if(++u>20)return;e=1/this.alpha*(Math.log(Math.tan(Math.PI/4+h/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(o))/2)),a=o,o=2*Math.atan(Math.exp(e))-Math.PI/2}return t.x=r,t.y=o,t},names:["somerc"]},It={init:function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),i=Math.cos(this.lat0),s=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(i,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-s*s);var h,n,r=I(this.e,this.lat0,t),e=this.bl/i*Math.sqrt((1-this.es)/(1-s*s));if(e*e<1&&(e=1),isNaN(this.longc)){var o=I(this.e,this.lat1,Math.sin(this.lat1)),a=I(this.e,this.lat2,Math.sin(this.lat2));this.el=this.lat0>=0?(e+Math.sqrt(e*e-1))*Math.pow(r,this.bl):(e-Math.sqrt(e*e-1))*Math.pow(r,this.bl);var u=Math.pow(o,this.bl),f=Math.pow(a,this.bl);n=.5*((h=this.el/u)-1/h);var c=(this.el*this.el-f*u)/(this.el*this.el+f*u),l=(f-u)/(f+u),v=F(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(c*Math.tan(.5*this.bl*v)/l)/this.bl,this.long0=F(this.long0);var d=F(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*d)/n),this.alpha=Math.asin(e*Math.sin(this.gamma0))}else h=this.lat0>=0?e+Math.sqrt(e*e-1):e-Math.sqrt(e*e-1),this.el=h*Math.pow(r,this.bl),n=.5*(h-1/h),this.gamma0=Math.asin(Math.sin(this.alpha)/e),this.long0=this.longc-Math.asin(n*Math.tan(this.gamma0))/this.bl;this.uc=this.no_off?0:this.lat0>=0?this.al/this.bl*Math.atan2(Math.sqrt(e*e-1),Math.cos(this.alpha)):-1*this.al/this.bl*Math.atan2(Math.sqrt(e*e-1),Math.cos(this.alpha))},forward:function(t){var i,s,h,n=t.y,r=F(t.x-this.long0);if(Math.abs(Math.abs(n)-u)<=f)h=n>0?-1:1,s=this.al/this.bl*Math.log(Math.tan(v+h*this.gamma0*.5)),i=-1*h*u*this.al/this.bl;else{var e=I(this.e,n,Math.sin(n)),o=this.el/Math.pow(e,this.bl),a=.5*(o-1/o),c=.5*(o+1/o),l=Math.sin(this.bl*r),d=(a*Math.sin(this.gamma0)-l*Math.cos(this.gamma0))/c;s=Math.abs(Math.abs(d)-1)<=f?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-d)/(1+d))/this.bl,i=Math.abs(Math.cos(this.bl*r))<=f?this.al*this.bl*r:this.al*Math.atan2(a*Math.cos(this.gamma0)+l*Math.sin(this.gamma0),Math.cos(this.bl*r))/this.bl}return this.no_rot?(t.x=this.x0+i,t.y=this.y0+s):(i-=this.uc,t.x=this.x0+s*Math.cos(this.alpha)+i*Math.sin(this.alpha),t.y=this.y0+i*Math.cos(this.alpha)-s*Math.sin(this.alpha)),t},inverse:function(t){var i,s;this.no_rot?(s=t.y-this.y0,i=t.x-this.x0):(s=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),i=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),i+=this.uc);var h=Math.exp(-1*this.bl*s/this.al),n=.5*(h-1/h),r=.5*(h+1/h),e=Math.sin(this.bl*i/this.al),o=(e*Math.cos(this.gamma0)+n*Math.sin(this.gamma0))/r,a=Math.pow(this.el/Math.sqrt((1+o)/(1-o)),1/this.bl);return Math.abs(o-1)<f?(t.x=this.long0,t.y=u):Math.abs(o+1)<f?(t.x=this.long0,t.y=-1*u):(t.y=D(this.e,a),t.x=F(this.long0-Math.atan2(n*Math.cos(this.gamma0)-e*Math.sin(this.gamma0),Math.cos(this.bl*i/this.al))/this.bl)),t},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]},Dt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<f)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),s=Math.cos(this.lat1),h=O(this.e,i,s),n=I(this.e,this.lat1,i),r=Math.sin(this.lat2),e=Math.cos(this.lat2),o=O(this.e,r,e),a=I(this.e,this.lat2,r),u=I(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>f?Math.log(h/o)/Math.log(n/a):i,isNaN(this.ns)&&(this.ns=i),this.f0=h/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var i=t.x,s=t.y;Math.abs(2*Math.abs(s)-Math.PI)<=f&&(s=L(s)*(u-2e-10));var h,n,r=Math.abs(Math.abs(s)-u);if(r>f)h=I(this.e,s,Math.sin(s)),n=this.a*this.f0*Math.pow(h,this.ns);else{if((r=s*this.ns)<=0)return null;n=0}var e=this.ns*F(i-this.long0);return t.x=this.k0*(n*Math.sin(e))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(e))+this.y0,t},inverse:function(t){var i,s,h,n,r,e=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(e*e+o*o),s=1):(i=-Math.sqrt(e*e+o*o),s=-1);var a=0;if(0!==i&&(a=Math.atan2(s*e,s*o)),0!==i||this.ns>0){if(s=1/this.ns,h=Math.pow(i/(this.a*this.f0),s),-9999===(n=D(this.e,h)))return null}else n=-u;return r=F(a/this.ns+this.long0),t.x=r,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]},Wt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var i,s,h,n,r,e,o,a=t.y,u=F(t.x-this.long0);return i=Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(a/2+this.s45),this.alfa)/i)-this.s45),h=-u*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(h)),r=Math.asin(Math.cos(s)*Math.sin(h)/Math.cos(n)),e=this.n*r,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=o*Math.cos(e)/1,t.x=o*Math.sin(e)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var i,s,h,n,r,e,o,a=t.x;t.x=t.y,t.y=a,this.czech||(t.y*=-1,t.x*=-1),r=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),h=2*(Math.atan(Math.pow(this.ro0/r,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(h)-Math.sin(this.ad)*Math.cos(h)*Math.cos(n)),s=Math.asin(Math.cos(h)*Math.sin(n)/Math.cos(i)),t.x=this.long0-s/this.alfa,e=i,o=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(e))/(1-this.e*Math.sin(e)),this.e/2))-this.s45),Math.abs(e-t.y)<1e-10&&(o=1),e=t.y,u+=1}while(0===o&&u<15);return u>=15?null:t},names:["Krovak","krovak"]};function Gt(t,i,s,h,n){return t*n-i*Math.sin(2*n)+s*Math.sin(4*n)-h*Math.sin(6*n)}function Vt(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function jt(t){return.375*t*(1+.25*t*(1+.46875*t))}function Ut(t){return.05859375*t*t*(1+.75*t)}function Xt(t){return t*t*t*(35/3072)}function qt(t,i,s){var h=i*s;return t/Math.sqrt(1-h*h)}function Bt(t){return Math.abs(t)<u?t:t-L(t)*Math.PI}function Yt(t,i,s,h,n){var r,e;r=t/i;for(var o=0;o<15;o++)if(r+=e=(t-(i*r-s*Math.sin(2*r)+h*Math.sin(4*r)-n*Math.sin(6*r)))/(i-2*s*Math.cos(2*r)+4*h*Math.cos(4*r)-6*n*Math.cos(6*r)),Math.abs(e)<=1e-10)return r;return NaN}const Ht={init:function(){this.sphere||(this.e0=Vt(this.es),this.e1=jt(this.es),this.e2=Ut(this.es),this.e3=Xt(this.es),this.ml0=this.a*Gt(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var i,s,h=t.x,n=t.y;if(h=F(h-this.long0),this.sphere)i=this.a*Math.asin(Math.cos(n)*Math.sin(h)),s=this.a*(Math.atan2(Math.tan(n),Math.cos(h))-this.lat0);else{var r=Math.sin(n),e=Math.cos(n),o=qt(this.a,this.e,r),a=Math.tan(n)*Math.tan(n),u=h*Math.cos(n),f=u*u,c=this.es*e*e/(1-this.es);i=o*u*(1-f*a*(1/6-(8-a+8*c)*f/120)),s=this.a*Gt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+o*r/e*f*(.5+(5-a+6*c)*f/24)}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,h=t.x/this.a,n=t.y/this.a;if(this.sphere){var r=n+this.lat0;i=Math.asin(Math.sin(r)*Math.cos(h)),s=Math.atan2(Math.tan(h),Math.cos(r))}else{var e=Yt(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(e)-u)<=f)return t.x=this.long0,t.y=u,n<0&&(t.y*=-1),t;var o=qt(this.a,this.e,Math.sin(e)),a=o*o*o/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(e),2),l=h*this.a/o,v=l*l;i=e-o*Math.tan(e)/a*l*l*(.5-(1+3*c)*l*l/24),s=l*(1-v*(c/3+(1+3*c)*c*v/15))/Math.cos(e)}return t.x=F(s+this.long0),t.y=Bt(i),t},names:["Cassini","Cassini_Soldner","cass"]};function Jt(t,i){var s;return t>1e-7?(1-t*t)*(i/(1-(s=t*i)*s)-.5/t*Math.log((1-s)/(1+s))):2*i}const Zt={init:function(){var t,i=Math.abs(this.lat0);if(this.mode=Math.abs(i-u)<f?this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<f?this.EQUIT:this.OBLIQ,this.es>0)switch(this.qp=Jt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var i,s=[];return s[0]=.3333333333333333*t,s[0]+=.17222222222222222*(i=t*t),s[1]=.06388888888888888*i,s[0]+=.10257936507936508*(i*=t),s[1]+=.0664021164021164*i,s[2]=.016415012942191543*i,s}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Jt(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var i,s,h,n,r,e,o,a,c,l,d=t.x,M=t.y;if(d=F(d-this.long0),this.sphere){if(r=Math.sin(M),l=Math.cos(M),h=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((s=this.mode===this.EQUIT?1+l*h:1+this.sinph0*r+this.cosph0*l*h)<=f)return null;i=(s=Math.sqrt(2/s))*l*Math.sin(d),s*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*l*h}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),Math.abs(M+this.phi0)<f)return null;s=v-.5*M,i=(s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s)))*Math.sin(d),s*=h}}else{switch(o=0,a=0,c=0,h=Math.cos(d),n=Math.sin(d),r=Math.sin(M),e=Jt(this.e,r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=e/this.qp,a=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:c=1+this.sinb1*o+this.cosb1*a*h;break;case this.EQUIT:c=1+a*h;break;case this.N_POLE:c=u+M,e=this.qp-e;break;case this.S_POLE:c=M-u,e=this.qp+e}if(Math.abs(c)<f)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),s=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*o-this.sinb1*a*h):(c=Math.sqrt(2/(1+a*h)))*o*this.ymf,i=this.xmf*c*a*n;break;case this.N_POLE:case this.S_POLE:e>=0?(i=(c=Math.sqrt(e))*n,s=h*(this.mode===this.S_POLE?c:-c)):i=s=0}}return t.x=this.a*i+this.x0,t.y=this.a*s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,h,n,r,e,o,a,c,l,v=t.x/this.a,d=t.y/this.a;if(this.sphere){var M,m=0,p=0;if((s=.5*(M=Math.sqrt(v*v+d*d)))>1)return null;switch(s=2*Math.asin(s),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(p=Math.sin(s),m=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(M)<=f?0:Math.asin(d*p/M),v*=p,d=m*M;break;case this.OBLIQ:s=Math.abs(M)<=f?this.phi0:Math.asin(m*this.sinph0+d*p*this.cosph0/M),v*=p*this.cosph0,d=(m-Math.sin(s)*this.sinph0)*M;break;case this.N_POLE:d=-d,s=u-s;break;case this.S_POLE:s-=u}i=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(v,d):0}else{if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(v/=this.dd,d*=this.dd,(e=Math.sqrt(v*v+d*d))<f)return t.x=0,t.y=this.phi0,t;n=2*Math.asin(.5*e/this.rq),h=Math.cos(n),v*=n=Math.sin(n),this.mode===this.OBLIQ?(r=this.qp*(o=h*this.sinb1+d*n*this.cosb1/e),d=e*this.cosb1*h-d*this.sinb1*n):(r=this.qp*(o=d*n/e),d=e*h)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(d=-d),!(r=v*v+d*d))return t.x=0,t.y=this.phi0,t;o=1-r/this.qp,this.mode===this.S_POLE&&(o=-o)}i=Math.atan2(v,d),l=(a=Math.asin(o))+a,s=a+(c=this.apa)[0]*Math.sin(l)+c[1]*Math.sin(l+l)+c[2]*Math.sin(l+l+l)}return t.x=F(this.long0+i),t.y=s,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Kt(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}const Qt={init:function(){Math.abs(this.lat1+this.lat2)<f||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=O(this.e3,this.sin_po,this.cos_po),this.qs1=Jt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=O(this.e3,this.sin_po,this.cos_po),this.qs2=Jt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Jt(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>f?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var i=t.x,s=t.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var h=Jt(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*h)/this.ns0,r=this.ns0*F(i-this.long0),e=n*Math.sin(r)+this.x0,o=this.rh-n*Math.cos(r)+this.y0;return t.x=e,t.y=o,t},inverse:function(t){var i,s,h,n,r;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),h=0,0!==i&&(h=Math.atan2(s*t.x,s*t.y)),s=i*this.ns0/this.a,r=this.sphere?Math.asin((this.c-s*s)/(2*this.ns0)):this.phi1z(this.e3,(this.c-s*s)/this.ns0),n=F(h/this.ns0+this.long0),t.x=n,t.y=r,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,i){var s,h,n,r,e=Kt(.5*i);if(t<f)return e;for(var o=t*t,a=1;a<=25;a++)if(e+=r=.5*(n=1-(h=t*(s=Math.sin(e)))*h)*n/Math.cos(e)*(i/(1-o)-s/n+.5/t*Math.log((1-h)/(1+h))),Math.abs(r)<=1e-7)return e;return null}},$t={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var i,s,h,n,r,e,o,a=t.y;return h=F(t.x-this.long0),i=Math.sin(a),s=Math.cos(a),n=Math.cos(h),(r=this.sin_p14*i+this.cos_p14*s*n)>0||Math.abs(r)<=f?(e=this.x0+1*this.a*s*Math.sin(h)/r,o=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*n)/r):(e=this.x0+this.infinity_dist*s*Math.sin(h),o=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*s*n)),t.x=e,t.y=o,t},inverse:function(t){var i,s,h,n,r,e;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(i,this.rc),s=Math.sin(n),e=Kt((h=Math.cos(n))*this.sin_p14+t.y*s*this.cos_p14/i),r=Math.atan2(t.x*s,i*this.cos_p14*h-t.y*this.sin_p14*s),r=F(this.long0+r)):(e=this.phic0,r=0),t.x=r,t.y=e,t},names:["gnom"]},ti={init:function(){this.sphere||(this.k0=O(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var i,s,h=t.y,n=F(t.x-this.long0);if(this.sphere)i=this.x0+this.a*n*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(h)/Math.cos(this.lat_ts);else{var r=Jt(this.e,Math.sin(h));i=this.x0+this.a*this.k0*n,s=this.y0+this.a*r*.5/this.k0}return t.x=i,t.y=s,t},inverse:function(t){var i,s;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=F(this.long0+t.x/this.a/Math.cos(this.lat_ts)),s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(s=function(t,i){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-s)<1e-6)return i<0?-1*u:u;for(var h,n,r,e,o=Math.asin(.5*i),a=0;a<30;a++)if(n=Math.sin(o),r=Math.cos(o),e=t*n,o+=h=Math.pow(1-e*e,2)/(2*r)*(i/(1-t*t)-n/(1-e*e)+.5/t*Math.log((1-e)/(1+e))),Math.abs(h)<=1e-10)return o;return NaN}(this.e,2*t.y*this.k0/this.a),i=F(this.long0+t.x/(this.a*this.k0))),t.x=i,t.y=s,t},names:["cea"]},ii={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var i=t.y,s=F(t.x-this.long0),h=Bt(i-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*h,t},inverse:function(t){var i=t.y;return t.x=F(this.long0+(t.x-this.x0)/(this.a*this.rc)),t.y=Bt(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},si={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Vt(this.es),this.e1=jt(this.es),this.e2=Ut(this.es),this.e3=Xt(this.es),this.ml0=this.a*Gt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var i,s,h,n=t.y,r=F(t.x-this.long0);if(h=r*Math.sin(n),this.sphere)Math.abs(n)<=f?(i=this.a*r,s=-1*this.a*this.lat0):(i=this.a*Math.sin(h)/Math.tan(n),s=this.a*(Bt(n-this.lat0)+(1-Math.cos(h))/Math.tan(n)));else if(Math.abs(n)<=f)i=this.a*r,s=-1*this.ml0;else{var e=qt(this.a,this.e,Math.sin(n))/Math.tan(n);i=e*Math.sin(h),s=this.a*Gt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+e*(1-Math.cos(h))}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){var i,s,h,n,r,e,o,a,u;if(h=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=f)i=F(h/this.a+this.long0),s=0;else{var c;for(o=h*h/this.a/this.a+(e=this.lat0+n/this.a)*e,a=e,r=20;r;--r)if(a+=u=-1*(e*(a*(c=Math.tan(a))+1)-a-.5*(a*a+o)*c)/((a-e)/c-1),Math.abs(u)<=f){s=a;break}i=F(this.long0+Math.asin(h*Math.tan(a)/this.a)/Math.sin(s))}else if(Math.abs(n+this.ml0)<=f)s=0,i=F(this.long0+h/this.a);else{var l,v,d,M,m;for(o=h*h/this.a/this.a+(e=(this.ml0+n)/this.a)*e,a=e,r=20;r;--r)if(m=this.e*Math.sin(a),l=Math.sqrt(1-m*m)*Math.tan(a),v=this.a*Gt(this.e0,this.e1,this.e2,this.e3,a),d=this.e0-2*this.e1*Math.cos(2*a)+4*this.e2*Math.cos(4*a)-6*this.e3*Math.cos(6*a),a-=u=(e*(l*(M=v/this.a)+1)-M-.5*l*(M*M+o))/(this.es*Math.sin(2*a)*(M*M+o-2*e*M)/(4*l)+(e-M)*(l*d-2/Math.sin(2*a))-d),Math.abs(u)<=f){s=a;break}l=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),i=F(this.long0+Math.asin(h*l/this.a)/Math.sin(s))}return t.x=i,t.y=s,t},names:["Polyconic","poly"]},hi={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var i,s=(t.y-this.lat0)/a*1e-5,h=t.x-this.long0,n=1,r=0;for(i=1;i<=10;i++)r+=this.A[i]*(n*=s);var e,o=r,u=h,f=1,c=0,l=0,v=0;for(i=1;i<=6;i++)e=c*o+f*u,l=l+this.B_re[i]*(f=f*o-c*u)-this.B_im[i]*(c=e),v=v+this.B_im[i]*f+this.B_re[i]*c;return t.x=v*this.a+this.x0,t.y=l*this.a+this.y0,t},inverse:function(t){var i,s,h=(t.y-this.y0)/this.a,n=(t.x-this.x0)/this.a,r=1,e=0,o=0,u=0;for(i=1;i<=6;i++)s=e*h+r*n,o=o+this.C_re[i]*(r=r*h-e*n)-this.C_im[i]*(e=s),u=u+this.C_im[i]*r+this.C_re[i]*e;for(var f=0;f<this.iterations;f++){var c,l=o,v=u,d=h,M=n;for(i=2;i<=6;i++)c=v*o+l*u,d+=(i-1)*(this.B_re[i]*(l=l*o-v*u)-this.B_im[i]*(v=c)),M+=(i-1)*(this.B_im[i]*l+this.B_re[i]*v);l=1,v=0;var m=this.B_re[1],p=this.B_im[1];for(i=2;i<=6;i++)c=v*o+l*u,m+=i*(this.B_re[i]*(l=l*o-v*u)-this.B_im[i]*(v=c)),p+=i*(this.B_im[i]*l+this.B_re[i]*v);var g=m*m+p*p;o=(d*m+M*p)/g,u=(M*m-d*p)/g}var _=o,w=u,y=1,b=0;for(i=1;i<=9;i++)b+=this.D[i]*(y*=_);var x=this.lat0+b*a*1e5;return t.x=this.long0+w,t.y=x,t},names:["New_Zealand_Map_Grid","nzmg"]},ni={init:function(){},forward:function(t){var i=t.y,s=F(t.x-this.long0),h=this.x0+this.a*s,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=h,t.y=n,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i=F(this.long0+t.x/this.a),s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=s,t},names:["Miller_Cylindrical","mill"]},ri={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=bt(this.es)},forward:function(t){var i,s,h=t.x,n=t.y;if(h=F(h-this.long0),this.sphere){if(this.m)for(var r=this.n*Math.sin(n),e=20;e;--e){var o=(this.m*n+Math.sin(n)-r)/(this.m+Math.cos(n));if(n-=o,Math.abs(o)<f)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;i=this.a*this.C_x*h*(this.m+Math.cos(n)),s=this.a*this.C_y*n}else{var a=Math.sin(n),u=Math.cos(n);s=this.a*xt(n,a,u,this.en),i=this.a*h*u/Math.sqrt(1-this.es*a*a)}return t.x=i,t.y=s,t},inverse:function(t){var i,s,h;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,s/=this.C_x*(this.m+Math.cos(i)),this.m?i=Kt((this.m*i+Math.sin(i))/this.n):1!==this.n&&(i=Kt(Math.sin(i)/this.n)),s=F(s+this.long0),i=Bt(i)):(i=Et(t.y/this.a,this.es,this.en),(h=Math.abs(i))<u?(h=Math.sin(i),s=F(this.long0+t.x*Math.sqrt(1-this.es*h*h)/(this.a*Math.cos(i)))):h-f<u&&(s=this.long0)),t.x=s,t.y=i,t},names:["Sinusoidal","sinu"]},ei={init:function(){},forward:function(t){for(var i=t.y,s=F(t.x-this.long0),h=i,n=Math.PI*Math.sin(i);;){var r=-(h+Math.sin(h)-n)/(1+Math.cos(h));if(h+=r,Math.abs(r)<f)break}h/=2,Math.PI/2-Math.abs(i)<f&&(s=0);var e=.900316316158*this.a*s*Math.cos(h)+this.x0,o=1.4142135623731*this.a*Math.sin(h)+this.y0;return t.x=e,t.y=o,t},inverse:function(t){var i,s;t.x-=this.x0,t.y-=this.y0,s=t.y/(1.4142135623731*this.a),Math.abs(s)>.999999999999&&(s=.999999999999),i=Math.asin(s);var h=F(this.long0+t.x/(.900316316158*this.a*Math.cos(i)));h<-Math.PI&&(h=-Math.PI),h>Math.PI&&(h=Math.PI),s=(2*i+Math.sin(2*i))/Math.PI,Math.abs(s)>1&&(s=1);var n=Math.asin(s);return t.x=h,t.y=n,t},names:["Mollweide","moll"]},oi={init:function(){Math.abs(this.lat1+this.lat2)<f||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Vt(this.es),this.e1=jt(this.es),this.e2=Ut(this.es),this.e3=Xt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=O(this.e,this.sinphi,this.cosphi),this.ml1=Gt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<f?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=O(this.e,this.sinphi,this.cosphi),this.ml2=Gt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Gt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var i,s=t.x,h=t.y;if(this.sphere)i=this.a*(this.g-h);else{var n=Gt(this.e0,this.e1,this.e2,this.e3,h);i=this.a*(this.g-n)}var r=this.ns*F(s-this.long0),e=this.x0+i*Math.sin(r),o=this.y0+this.rh-i*Math.cos(r);return t.x=e,t.y=o,t},inverse:function(t){var i,s,h,n;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var r=0;return 0!==s&&(r=Math.atan2(i*t.x,i*t.y)),this.sphere?(n=F(this.long0+r/this.ns),h=Bt(this.g-s/this.a),t.x=n,t.y=h,t):(h=Yt(this.g-s/this.a,this.e0,this.e1,this.e2,this.e3),n=F(this.long0+r/this.ns),t.x=n,t.y=h,t)},names:["Equidistant_Conic","eqdc"]},ai={init:function(){this.R=this.a},forward:function(t){var i,s,h=t.y,n=F(t.x-this.long0);Math.abs(h)<=f&&(i=this.x0+this.R*n,s=this.y0);var r=Kt(2*Math.abs(h/Math.PI));(Math.abs(n)<=f||Math.abs(Math.abs(h)-u)<=f)&&(i=this.x0,s=h>=0?this.y0+Math.PI*this.R*Math.tan(.5*r):this.y0+Math.PI*this.R*-Math.tan(.5*r));var e=.5*Math.abs(Math.PI/n-n/Math.PI),o=e*e,a=Math.sin(r),c=Math.cos(r),l=c/(a+c-1),v=l*(2/a-1),d=v*v,M=Math.PI*this.R*(e*(l-d)+Math.sqrt(o*(l-d)*(l-d)-(d+o)*(l*l-d)))/(d+o);n<0&&(M=-M),i=this.x0+M;var m=o+l;return M=Math.PI*this.R*(v*m-e*Math.sqrt((d+o)*(o+1)-m*m))/(d+o),s=h>=0?this.y0+M:this.y0-M,t.x=i,t.y=s,t},inverse:function(t){var i,s,h,n,r,e,o,a,u,c,l,v;return t.x-=this.x0,t.y-=this.y0,l=Math.PI*this.R,r=(h=t.x/l)*h+(n=t.y/l)*n,l=3*(n*n/(a=-2*(e=-Math.abs(n)*(1+r))+1+2*n*n+r*r)+(2*(o=e-2*n*n+h*h)*o*o/a/a/a-9*e*o/a/a)/27)/(u=(e-o*o/3/a)/a)/(c=2*Math.sqrt(-u/3)),Math.abs(l)>1&&(l=l>=0?1:-1),v=Math.acos(l)/3,s=t.y>=0?(-c*Math.cos(v+Math.PI/3)-o/3/a)*Math.PI:-(-c*Math.cos(v+Math.PI/3)-o/3/a)*Math.PI,i=Math.abs(h)<f?this.long0:F(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(h*h-n*n)+r*r))/2/h),t.x=i,t.y=s,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},ui={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var i,s,h,n,r,e,o,a,c,l,v,d,M,m,p,g,_,w,y,b,x,E,C=t.x,S=t.y,z=Math.sin(t.y),A=Math.cos(t.y),k=F(C-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=f?(t.x=this.x0+this.a*(u-S)*Math.sin(k),t.y=this.y0-this.a*(u-S)*Math.cos(k),t):Math.abs(this.sin_p12+1)<=f?(t.x=this.x0+this.a*(u+S)*Math.sin(k),t.y=this.y0+this.a*(u+S)*Math.cos(k),t):(w=this.sin_p12*z+this.cos_p12*A*Math.cos(k),_=(g=Math.acos(w))/Math.sin(g),t.x=this.x0+this.a*_*A*Math.sin(k),t.y=this.y0+this.a*_*(this.cos_p12*z-this.sin_p12*A*Math.cos(k)),t):(i=Vt(this.es),s=jt(this.es),h=Ut(this.es),n=Xt(this.es),Math.abs(this.sin_p12-1)<=f?(r=this.a*Gt(i,s,h,n,u),e=this.a*Gt(i,s,h,n,S),t.x=this.x0+(r-e)*Math.sin(k),t.y=this.y0-(r-e)*Math.cos(k),t):Math.abs(this.sin_p12+1)<=f?(r=this.a*Gt(i,s,h,n,u),e=this.a*Gt(i,s,h,n,S),t.x=this.x0+(r+e)*Math.sin(k),t.y=this.y0+(r+e)*Math.cos(k),t):(o=z/A,a=qt(this.a,this.e,this.sin_p12),c=qt(this.a,this.e,z),l=Math.atan((1-this.es)*o+this.es*a*this.sin_p12/(c*A)),y=0===(v=Math.atan2(Math.sin(k),this.cos_p12*Math.tan(l)-this.sin_p12*Math.cos(k)))?Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.abs(Math.abs(v)-Math.PI)<=f?-Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.asin(Math.sin(k)*Math.cos(l)/Math.sin(v)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),M=this.e*this.cos_p12*Math.cos(v)/Math.sqrt(1-this.es),t.x=this.x0+(g=a*y*(1-(b=y*y)*(p=M*M)*(1-p)/6+(x=b*y)/8*(m=d*M)*(1-2*p)+(E=x*y)/120*(p*(4-7*p)-3*d*d*(1-7*p))-E*y/48*m))*Math.sin(v),t.y=this.y0+g*Math.cos(v),t))},inverse:function(t){var i,s,h,n,r,e,o,a,c,l,v,d,M,m,p,g,_,w,y,b,x,E;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*u*this.a)return;return s=i/this.a,h=Math.sin(s),n=Math.cos(s),r=this.long0,Math.abs(i)<=f?e=this.lat0:(e=Kt(n*this.sin_p12+t.y*h*this.cos_p12/i),o=Math.abs(this.lat0)-u,r=Math.abs(o)<=f?F(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)):F(this.long0+Math.atan2(t.x*h,i*this.cos_p12*n-t.y*this.sin_p12*h))),t.x=r,t.y=e,t}return a=Vt(this.es),c=jt(this.es),l=Ut(this.es),v=Xt(this.es),Math.abs(this.sin_p12-1)<=f?(e=Yt(((d=this.a*Gt(a,c,l,v,u))-(i=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,a,c,l,v),r=F(this.long0+Math.atan2(t.x,-1*t.y)),t.x=r,t.y=e,t):Math.abs(this.sin_p12+1)<=f?(d=this.a*Gt(a,c,l,v,u),e=Yt(((i=Math.sqrt(t.x*t.x+t.y*t.y))-d)/this.a,a,c,l,v),r=F(this.long0+Math.atan2(t.x,t.y)),t.x=r,t.y=e,t):(i=Math.sqrt(t.x*t.x+t.y*t.y),p=Math.atan2(t.x,t.y),M=qt(this.a,this.e,this.sin_p12),g=Math.cos(p),y=3*this.es*(1-(w=-(_=this.e*this.cos_p12*g)*_/(1-this.es)))*this.sin_p12*this.cos_p12*g/(1-this.es),E=1-w*(x=(b=i/M)-w*(1+w)*Math.pow(b,3)/6-y*(1+3*w)*Math.pow(b,4)/24)*x/2-b*x*x*x/6,m=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*g),r=F(this.long0+Math.asin(Math.sin(p)*Math.sin(x)/Math.cos(m))),e=Math.atan((1-this.es*E*this.sin_p12/Math.sin(m))*Math.tan(m)/(1-this.es)),t.x=r,t.y=e,t)},names:["Azimuthal_Equidistant","aeqd"]},fi={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var i,s,h,n,r,e,o,a=t.y;return h=F(t.x-this.long0),i=Math.sin(a),s=Math.cos(a),n=Math.cos(h),((r=this.sin_p14*i+this.cos_p14*s*n)>0||Math.abs(r)<=f)&&(e=1*this.a*s*Math.sin(h),o=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*n)),t.x=e,t.y=o,t},inverse:function(t){var i,s,h,n,r,e,o;return t.x-=this.x0,t.y-=this.y0,s=Kt((i=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),h=Math.sin(s),n=Math.cos(s),e=this.long0,Math.abs(i)<=f?(o=this.lat0,t.x=e,t.y=o,t):(o=Kt(n*this.sin_p14+t.y*h*this.cos_p14/i),r=Math.abs(this.lat0)-u,Math.abs(r)<=f?(e=F(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)),t.x=e,t.y=o,t):(e=F(this.long0+Math.atan2(t.x*h,i*this.cos_p14*n-t.y*this.sin_p14*h)),t.x=e,t.y=o,t))},names:["ortho"]};function ci(t,i,s,h){var n;return t<f?(h.value=1,n=0):(n=Math.atan2(i,s),Math.abs(n)<=v?h.value=1:n>v&&n<=u+v?(h.value=2,n-=u):n>u+v||n<=-(u+v)?(h.value=3,n=n>=0?n-M:n+M):(h.value=4,n+=u)),n}function li(t,i){var s=t+i;return s<-M?s+=d:s>+M&&(s-=d),s}const vi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.face=this.lat0>=u-v/2?5:this.lat0<=-(u-v/2)?6:Math.abs(this.long0)<=v?1:Math.abs(this.long0)<=u+v?this.long0>0?2:4:3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var i,s,h,n,r,e,o={x:0,y:0},a={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,s=t.x,5===this.face)n=u-i,s>=v&&s<=u+v?(a.value=1,h=s-u):s>u+v||s<=-(u+v)?(a.value=2,h=s>0?s-M:s+M):s>-(u+v)&&s<=-v?(a.value=3,h=s+u):(a.value=4,h=s);else if(6===this.face)n=u+i,s>=v&&s<=u+v?(a.value=1,h=-s+u):s<v&&s>=-v?(a.value=2,h=-s):s<-v&&s>=-(u+v)?(a.value=3,h=-s-u):(a.value=4,h=s>0?-s+M:-s-M);else{var f,c,l,d,m,p;2===this.face?s=li(s,+u):3===this.face?s=li(s,+M):4===this.face&&(s=li(s,-u)),d=Math.sin(i),m=Math.cos(i),p=Math.sin(s),f=m*Math.cos(s),c=m*p,l=d,1===this.face?h=ci(n=Math.acos(f),l,c,a):2===this.face?h=ci(n=Math.acos(c),l,-f,a):3===this.face?h=ci(n=Math.acos(-f),l,-c,a):4===this.face?h=ci(n=Math.acos(-c),l,f,a):(n=h=0,a.value=1)}return e=Math.atan(12/M*(h+Math.acos(Math.sin(h)*Math.cos(v))-u)),r=Math.sqrt((1-Math.cos(n))/(Math.cos(e)*Math.cos(e))/(1-Math.cos(Math.atan(1/Math.cos(h))))),2===a.value?e+=u:3===a.value?e+=M:4===a.value&&(e+=1.5*M),o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var i,s,h,n,r,e,o,a,f,c,l,v,d={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=2,i-=u):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=3,i=i<0?i+M:i-M):(m.value=4,i+=u),f=M/12*Math.tan(i),r=Math.sin(f)/(Math.cos(f)-1/Math.sqrt(2)),e=Math.atan(r),(o=1-(h=Math.cos(i))*h*(n=Math.tan(s))*n*(1-Math.cos(Math.atan(1/Math.cos(e)))))<-1?o=-1:o>1&&(o=1),5===this.face)a=Math.acos(o),d.phi=u-a,d.lam=1===m.value?e+u:2===m.value?e<0?e+M:e-M:3===m.value?e-u:e;else if(6===this.face)a=Math.acos(o),d.phi=a-u,d.lam=1===m.value?-e+u:2===m.value?-e:3===m.value?-e-u:e<0?-e-M:-e+M;else{var p,g,_;f=(p=o)*p,g=(f+=(_=f>=1?0:Math.sqrt(1-f)*Math.sin(e))*_)>=1?0:Math.sqrt(1-f),2===m.value?(f=g,g=-_,_=f):3===m.value?(g=-g,_=-_):4===m.value&&(f=g,g=_,_=-f),2===this.face?(f=p,p=-g,g=f):3===this.face?(p=-p,g=-g):4===this.face&&(f=p,p=g,g=-f),d.phi=Math.acos(-_)-u,d.lam=Math.atan2(g,p),2===this.face?d.lam=li(d.lam,-u):3===this.face?d.lam=li(d.lam,-M):4===this.face&&(d.lam=li(d.lam,+u))}return 0!==this.es&&(c=d.phi<0?1:0,l=Math.tan(d.phi),v=this.b/Math.sqrt(l*l+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-v*v)/(this.one_minus_f*v)),c&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};ht.defaultDatum="WGS84",ht.Proj=H,ht.WGS84=new ht.Proj("WGS84"),ht.Point=gt,ht.toPoint=K,ht.defs=R,ht.transform=$,ht.mgrs=ut,ht.version="2.4.4",function(t){t.Proj.projections.add(Ct),t.Proj.projections.add(Nt),t.Proj.projections.add(Rt),t.Proj.projections.add(Ot),t.Proj.projections.add(Lt),t.Proj.projections.add(Ft),t.Proj.projections.add(It),t.Proj.projections.add(Dt),t.Proj.projections.add(Wt),t.Proj.projections.add(Ht),t.Proj.projections.add(Zt),t.Proj.projections.add(Qt),t.Proj.projections.add($t),t.Proj.projections.add(ti),t.Proj.projections.add(ii),t.Proj.projections.add(si),t.Proj.projections.add(hi),t.Proj.projections.add(ni),t.Proj.projections.add(ri),t.Proj.projections.add(ei),t.Proj.projections.add(oi),t.Proj.projections.add(ai),t.Proj.projections.add(ui),t.Proj.projections.add(fi),t.Proj.projections.add(vi)}(ht);var di={ASSUME_TOUCH:!1,DEFAULT_MAX_ZOOM:42,DEFAULT_MIN_ZOOM:0,DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD:.5,DEFAULT_TILE_SIZE:256,DEFAULT_WMS_VERSION:"1.3.0",ENABLE_CANVAS:!0,ENABLE_PROJ4JS:!0,ENABLE_RASTER_REPROJECTION:!0,ENABLE_WEBGL:!0,DEBUG_WEBGL:!0,INITIAL_ATLAS_SIZE:256,MAX_ATLAS_SIZE:-1,MOUSEWHEELZOOM_MAXDELTA:1,OVERVIEWMAP_MAX_RATIO:.75,OVERVIEWMAP_MIN_RATIO:.1,RASTER_REPROJECTION_MAX_SOURCE_TILES:100,RASTER_REPROJECTION_MAX_SUBDIVISION:10,RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH:.25,SIMPLIFY_TOLERANCE:.5,WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK:1024,VERSION:"v4.6.5",inherits:function(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t},nullFunction:function(){},getUid:function(t){return t.ol_uid||(t.ol_uid=++di.uidCounter_)},uidCounter_:0},Mi="accuracy",mi="accuracyGeometry",pi="altitude",gi="altitudeAccuracy",_i="heading",wi="position",yi="projection",bi="speed",xi="tracking",Ei="trackingOptions",Ci="propertychange",Si={};Si.assign="function"==typeof Object.assign?Object.assign:function(t,i){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(t),h=1,n=arguments.length;h<n;++h){var r=arguments[h];if(null!=r)for(var e in r)r.hasOwnProperty(e)&&(s[e]=r[e])}return s},Si.clear=function(t){for(var i in t)delete t[i]},Si.getValues=function(t){var i=[];for(var s in t)i.push(t[s]);return i},Si.isEmpty=function(t){var i;for(i in t)return!1;return!i};var zi={bindListener_:function(t){var i=function(i){var s=t.listener,h=t.bindTo||t.target;return t.callOnce&&zi.unlistenByKey(t),s.call(h,i)};return t.boundListener=i,i},findListener_:function(t,i,s,h){for(var n,r=0,e=t.length;r<e;++r)if((n=t[r]).listener===i&&n.bindTo===s)return h&&(n.deleteIndex=r),n},getListeners:function(t,i){var s=t.ol_lm;return s?s[i]:void 0},getListenerMap_:function(t){var i=t.ol_lm;return i||(i=t.ol_lm={}),i},removeListeners_:function(t,i){var s=zi.getListeners(t,i);if(s){for(var h=0,n=s.length;h<n;++h)t.removeEventListener(i,s[h].boundListener),Si.clear(s[h]);s.length=0;var r=t.ol_lm;r&&(delete r[i],0===Object.keys(r).length&&delete t.ol_lm)}},listen:function(t,i,s,h,n){var r=zi.getListenerMap_(t),e=r[i];e||(e=r[i]=[]);var o=zi.findListener_(e,s,h,!1);return o?n||(o.callOnce=!1):(t.addEventListener(i,zi.bindListener_(o={bindTo:h,callOnce:!!n,listener:s,target:t,type:i})),e.push(o)),o},listenOnce:function(t,i,s,h){return zi.listen(t,i,s,h,!0)},unlisten:function(t,i,s,h){var n=zi.getListeners(t,i);if(n){var r=zi.findListener_(n,s,h,!0);r&&zi.unlistenByKey(r)}},unlistenByKey:function(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var i=zi.getListeners(t.target,t.type);if(i){var s="deleteIndex"in t?t.deleteIndex:i.indexOf(t);-1!==s&&i.splice(s,1),0===i.length&&zi.removeListeners_(t.target,t.type)}Si.clear(t)}},unlistenAll:function(t){var i=zi.getListenerMap_(t);for(var s in i)zi.removeListeners_(t,s)}},Ai=function(){};Ai.prototype.disposed_=!1,Ai.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},Ai.prototype.disposeInternal=di.nullFunction;var ki=function(t){this.type=t,this.target=null};ki.prototype.preventDefault=ki.prototype.stopPropagation=function(){this.propagationStopped=!0},ki.stopPropagation=function(t){t.stopPropagation()},ki.preventDefault=function(t){t.preventDefault()};var Ni=function(){Ai.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}};di.inherits(Ni,Ai),Ni.prototype.addEventListener=function(t,i){var s=this.listeners_[t];s||(s=this.listeners_[t]=[]),-1===s.indexOf(i)&&s.push(i)},Ni.prototype.dispatchEvent=function(t){var i="string"==typeof t?new ki(t):t,s=i.type;i.target=this;var h,n=this.listeners_[s];if(n){s in this.dispatching_||(this.dispatching_[s]=0,this.pendingRemovals_[s]=0),++this.dispatching_[s];for(var r=0,e=n.length;r<e;++r)if(!1===n[r].call(this,i)||i.propagationStopped){h=!1;break}if(--this.dispatching_[s],0===this.dispatching_[s]){var o=this.pendingRemovals_[s];for(delete this.pendingRemovals_[s];o--;)this.removeEventListener(s,di.nullFunction);delete this.dispatching_[s]}return h}},Ni.prototype.disposeInternal=function(){zi.unlistenAll(this)},Ni.prototype.getListeners=function(t){return this.listeners_[t]},Ni.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},Ni.prototype.removeEventListener=function(t,i){var s=this.listeners_[t];if(s){var h=s.indexOf(i);t in this.pendingRemovals_?(s[h]=di.nullFunction,++this.pendingRemovals_[t]):(s.splice(h,1),0===s.length&&delete this.listeners_[t])}};var Ri="change",Pi="clear",Ti="click",Oi="dblclick",Li="error",Fi="keydown",Ii="keypress",Di="load",Wi="mousewheel",Gi="resize",Vi="wheel",ji=function(){Ni.call(this),this.revision_=0};di.inherits(ji,Ni),ji.unByKey=function(t){if(Array.isArray(t))for(var i=0,s=t.length;i<s;++i)zi.unlistenByKey(t[i]);else zi.unlistenByKey(t)},ji.prototype.changed=function(){++this.revision_,this.dispatchEvent(Ri)},ji.prototype.getRevision=function(){return this.revision_},ji.prototype.on=function(t,i,s){if(Array.isArray(t)){for(var h=t.length,n=new Array(h),r=0;r<h;++r)n[r]=zi.listen(this,t[r],i,s);return n}return zi.listen(this,t,i,s)},ji.prototype.once=function(t,i,s){if(Array.isArray(t)){for(var h=t.length,n=new Array(h),r=0;r<h;++r)n[r]=zi.listenOnce(this,t[r],i,s);return n}return zi.listenOnce(this,t,i,s)},ji.prototype.un=function(t,i,s){if(Array.isArray(t))for(var h=0,n=t.length;h<n;++h)zi.unlisten(this,t[h],i,s);else zi.unlisten(this,t,i,s)};var Ui=function(t){ji.call(this),di.getUid(this),this.values_={},void 0!==t&&this.setProperties(t)};di.inherits(Ui,ji),Ui.changeEventTypeCache_={},Ui.getChangeEventType=function(t){return Ui.changeEventTypeCache_.hasOwnProperty(t)?Ui.changeEventTypeCache_[t]:Ui.changeEventTypeCache_[t]="change:"+t},Ui.prototype.get=function(t){var i;return this.values_.hasOwnProperty(t)&&(i=this.values_[t]),i},Ui.prototype.getKeys=function(){return Object.keys(this.values_)},Ui.prototype.getProperties=function(){return Si.assign({},this.values_)},Ui.prototype.notify=function(t,i){var s;s=Ui.getChangeEventType(t),this.dispatchEvent(new Ui.Event(s,t,i)),this.dispatchEvent(new Ui.Event(s=Ci,t,i))},Ui.prototype.set=function(t,i,s){if(s)this.values_[t]=i;else{var h=this.values_[t];this.values_[t]=i,h!==i&&this.notify(t,h)}},Ui.prototype.setProperties=function(t,i){var s;for(s in t)this.set(s,t[s],i)},Ui.prototype.unset=function(t,i){if(t in this.values_){var s=this.values_[t];delete this.values_[t],i||this.notify(t,s)}},di.inherits(Ui.Event=function(t,i,s){ki.call(this,t),this.key=i,this.oldValue=s},ki);var Xi=function(t){var i=di.VERSION?di.VERSION.split("-")[0]:"latest";this.message="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+t+" for details.",this.code=t,this.name="AssertionError"};di.inherits(Xi,Error);var qi=function(t,i){if(!t)throw new Xi(i)},Bi={clamp:function(t,i,s){return Math.min(Math.max(t,i),s)}};Bi.cosh="cosh"in Math?Math.cosh:function(t){var i=Math.exp(t);return(i+1/i)/2},Bi.roundUpToPowerOfTwo=function(t){return qi(0<t,29),Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},Bi.squaredSegmentDistance=function(t,i,s,h,n,r){var e=n-s,o=r-h;if(0!==e||0!==o){var a=((t-s)*e+(i-h)*o)/(e*e+o*o);a>1?(s=n,h=r):a>0&&(s+=e*a,h+=o*a)}return Bi.squaredDistance(t,i,s,h)},Bi.squaredDistance=function(t,i,s,h){var n=s-t,r=h-i;return n*n+r*r},Bi.solveLinearSystem=function(t){for(var i=t.length,s=0;s<i;s++){for(var h=s,n=Math.abs(t[s][s]),r=s+1;r<i;r++){var e=Math.abs(t[r][s]);e>n&&(n=e,h=r)}if(0===n)return null;var o=t[h];t[h]=t[s],t[s]=o;for(var a=s+1;a<i;a++)for(var u=-t[a][s]/t[s][s],f=s;f<i+1;f++)s==f?t[a][f]=0:t[a][f]+=u*t[s][f]}for(var c=new Array(i),l=i-1;l>=0;l--){c[l]=t[l][i]/t[l][l];for(var v=l-1;v>=0;v--)t[v][i]-=t[v][l]*c[l]}return c},Bi.toDegrees=function(t){return 180*t/Math.PI},Bi.toRadians=function(t){return t*Math.PI/180},Bi.modulo=function(t,i){var s=t%i;return s*i<0?s+i:s},Bi.lerp=function(t,i,s){return t+s*(i-t)};var Yi="Point",Hi="LineString",Ji="LinearRing",Zi="Polygon",Ki="MultiPoint",Qi="MultiLineString",$i="MultiPolygon",ts="GeometryCollection",is="Circle",ss=function(t){this.radius=t};
2
2
  /**
3
3
  * @license
4
4
  * Latitude/longitude spherical geodesy formulae taken from
5
5
  * http://www.movable-type.co.uk/scripts/latlong.html
6
6
  * Licensed under CC-BY-3.0.
7
- */ss.prototype.geodesicArea=function(t){return ss.getArea_(t,this.radius)},ss.prototype.haversineDistance=function(t,i){return ss.getDistance_(t,i,this.radius)},ss.prototype.offset=function(t,i,s){var h=Bi.toRadians(t[1]),n=Bi.toRadians(t[0]),r=i/this.radius,e=Math.asin(Math.sin(h)*Math.cos(r)+Math.cos(h)*Math.sin(r)*Math.cos(s)),o=n+Math.atan2(Math.sin(s)*Math.sin(r)*Math.cos(h),Math.cos(r)-Math.sin(h)*Math.sin(e));return[Bi.toDegrees(o),Bi.toDegrees(e)]},ss.DEFAULT_RADIUS=6371008.8,ss.getLength=function(t,i){var s,h,n,r,e,o,a=i||{},u=a.radius||ss.DEFAULT_RADIUS,f=a.projection||"EPSG:3857",c=(t=t.clone().transform(f,"EPSG:4326")).getType(),l=0;switch(c){case Yi:case Ki:break;case Hi:case Ji:s=t.getCoordinates(),l=ss.getLength_(s,u);break;case Qi:case Zi:for(n=0,r=(s=t.getCoordinates()).length;n<r;++n)l+=ss.getLength_(s[n],u);break;case $i:for(n=0,r=(s=t.getCoordinates()).length;n<r;++n)for(e=0,o=(h=s[n]).length;e<o;++e)l+=ss.getLength_(h[e],u);break;case ts:var v=t.getGeometries();for(n=0,r=v.length;n<r;++n)l+=ss.getLength(v[n],i);break;default:throw new Error("Unsupported geometry type: "+c)}return l},ss.getLength_=function(t,i){for(var s=0,h=0,n=t.length;h<n-1;++h)s+=ss.getDistance_(t[h],t[h+1],i);return s},ss.getDistance_=function(t,i,s){var h=Bi.toRadians(t[1]),n=Bi.toRadians(i[1]),r=(n-h)/2,e=Bi.toRadians(i[0]-t[0])/2,o=Math.sin(r)*Math.sin(r)+Math.sin(e)*Math.sin(e)*Math.cos(h)*Math.cos(n);return 2*s*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))},ss.getArea=function(t,i){var s,h,n,r,e,o,a=i||{},u=a.radius||ss.DEFAULT_RADIUS,f=a.projection||"EPSG:3857",c=(t=t.clone().transform(f,"EPSG:4326")).getType(),l=0;switch(c){case Yi:case Ki:case Hi:case Qi:case Ji:break;case Zi:for(s=t.getCoordinates(),l=Math.abs(ss.getArea_(s[0],u)),n=1,r=s.length;n<r;++n)l-=Math.abs(ss.getArea_(s[n],u));break;case $i:for(n=0,r=(s=t.getCoordinates()).length;n<r;++n)for(h=s[n],l+=Math.abs(ss.getArea_(h[0],u)),e=1,o=h.length;e<o;++e)l-=Math.abs(ss.getArea_(h[e],u));break;case ts:var v=t.getGeometries();for(n=0,r=v.length;n<r;++n)l+=ss.getArea(v[n],i);break;default:throw new Error("Unsupported geometry type: "+c)}return l},ss.getArea_=function(t,i){for(var s=0,h=t.length,n=t[h-1][0],r=t[h-1][1],e=0;e<h;e++){var o=t[e][0],a=t[e][1];s+=Bi.toRadians(o-n)*(2+Math.sin(Bi.toRadians(r))+Math.sin(Bi.toRadians(a))),n=o,r=a}return s*i*i/2};var hs={binarySearch:function(t,i,s){for(var h,n,r=s||hs.numberSafeCompareFunction,e=0,o=t.length,a=!1;e<o;)(n=+r(t[h=e+(o-e>>1)],i))<0?e=h+1:(o=h,a=!n);return a?e:~e},numberSafeCompareFunction:function(t,i){return t>i?1:t<i?-1:0},includes:function(t,i){return t.indexOf(i)>=0},linearFindNearest:function(t,i,s){var h,n=t.length;if(t[0]<=i)return 0;if(i<=t[n-1])return n-1;if(s>0){for(h=1;h<n;++h)if(t[h]<i)return h-1}else if(s<0){for(h=1;h<n;++h)if(t[h]<=i)return h}else for(h=1;h<n;++h){if(t[h]==i)return h;if(t[h]<i)return t[h-1]-i<i-t[h]?h-1:h}return n-1},reverseSubArray:function(t,i,s){for(;i<s;){var h=t[i];t[i]=t[s],t[s]=h,++i,--s}},extend:function(t,i){var s,h=Array.isArray(i)?i:[i],n=h.length;for(s=0;s<n;s++)t[t.length]=h[s]},remove:function(t,i){var s=t.indexOf(i),h=s>-1;return h&&t.splice(s,1),h},find:function(t,i){for(var s,h=t.length>>>0,n=0;n<h;n++)if(i(s=t[n],n,t))return s;return null},equals:function(t,i){var s=t.length;if(s!==i.length)return!1;for(var h=0;h<s;h++)if(t[h]!==i[h])return!1;return!0},stableSort:function(t,i){var s,h=t.length,n=Array(t.length);for(s=0;s<h;s++)n[s]={index:s,value:t[s]};for(n.sort((function(t,s){return i(t.value,s.value)||t.index-s.index})),s=0;s<t.length;s++)t[s]=n[s].value},findIndex:function(t,i){var s;return t.every((function(h,n){return s=n,!i(h,n,t)}))?-1:s},isSorted:function(t,i,s){var h=i||hs.numberSafeCompareFunction;return t.every((function(i,n){if(0===n)return!0;var r=h(t[n-1],i);return!(r>0||s&&0===r)}))}},ns="top-left",rs={boundingExtent:function(t){for(var i=rs.createEmpty(),s=0,h=t.length;s<h;++s)rs.extendCoordinate(i,t[s]);return i},boundingExtentXYs_:function(t,i,s){var h=Math.min.apply(null,t),n=Math.min.apply(null,i),r=Math.max.apply(null,t),e=Math.max.apply(null,i);return rs.createOrUpdate(h,n,r,e,s)},buffer:function(t,i,s){return s?(s[0]=t[0]-i,s[1]=t[1]-i,s[2]=t[2]+i,s[3]=t[3]+i,s):[t[0]-i,t[1]-i,t[2]+i,t[3]+i]},clone:function(t,i){return i?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i):t.slice()},closestSquaredDistanceXY:function(t,i,s){var h,n;return(h=i<t[0]?t[0]-i:t[2]<i?i-t[2]:0)*h+(n=s<t[1]?t[1]-s:t[3]<s?s-t[3]:0)*n},containsCoordinate:function(t,i){return rs.containsXY(t,i[0],i[1])},containsExtent:function(t,i){return t[0]<=i[0]&&i[2]<=t[2]&&t[1]<=i[1]&&i[3]<=t[3]},containsXY:function(t,i,s){return t[0]<=i&&i<=t[2]&&t[1]<=s&&s<=t[3]},coordinateRelationship:function(t,i){var s=i[0],h=i[1],n=0;return s<t[0]?n|=16:s>t[2]&&(n|=4),h<t[1]?n|=8:h>t[3]&&(n|=2),0===n&&(n=1),n},createEmpty:function(){return[1/0,1/0,-1/0,-1/0]},createOrUpdate:function(t,i,s,h,n){return n?(n[0]=t,n[1]=i,n[2]=s,n[3]=h,n):[t,i,s,h]},createOrUpdateEmpty:function(t){return rs.createOrUpdate(1/0,1/0,-1/0,-1/0,t)},createOrUpdateFromCoordinate:function(t,i){var s=t[0],h=t[1];return rs.createOrUpdate(s,h,s,h,i)},createOrUpdateFromCoordinates:function(t,i){var s=rs.createOrUpdateEmpty(i);return rs.extendCoordinates(s,t)},createOrUpdateFromFlatCoordinates:function(t,i,s,h,n){var r=rs.createOrUpdateEmpty(n);return rs.extendFlatCoordinates(r,t,i,s,h)},createOrUpdateFromRings:function(t,i){var s=rs.createOrUpdateEmpty(i);return rs.extendRings(s,t)},equals:function(t,i){return t[0]==i[0]&&t[2]==i[2]&&t[1]==i[1]&&t[3]==i[3]},extend:function(t,i){return i[0]<t[0]&&(t[0]=i[0]),i[2]>t[2]&&(t[2]=i[2]),i[1]<t[1]&&(t[1]=i[1]),i[3]>t[3]&&(t[3]=i[3]),t},extendCoordinate:function(t,i){i[0]<t[0]&&(t[0]=i[0]),i[0]>t[2]&&(t[2]=i[0]),i[1]<t[1]&&(t[1]=i[1]),i[1]>t[3]&&(t[3]=i[1])},extendCoordinates:function(t,i){var s,h;for(s=0,h=i.length;s<h;++s)rs.extendCoordinate(t,i[s]);return t},extendFlatCoordinates:function(t,i,s,h,n){for(;s<h;s+=n)rs.extendXY(t,i[s],i[s+1]);return t},extendRings:function(t,i){var s,h;for(s=0,h=i.length;s<h;++s)rs.extendCoordinates(t,i[s]);return t},extendXY:function(t,i,s){t[0]=Math.min(t[0],i),t[1]=Math.min(t[1],s),t[2]=Math.max(t[2],i),t[3]=Math.max(t[3],s)},forEachCorner:function(t,i,s){var h;return(h=i.call(s,rs.getBottomLeft(t)))||(h=i.call(s,rs.getBottomRight(t)))||(h=i.call(s,rs.getTopRight(t)))?h:(h=i.call(s,rs.getTopLeft(t)))||!1},getArea:function(t){var i=0;return rs.isEmpty(t)||(i=rs.getWidth(t)*rs.getHeight(t)),i},getBottomLeft:function(t){return[t[0],t[1]]},getBottomRight:function(t){return[t[2],t[1]]},getCenter:function(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]},getCorner:function(t,i){var s;return"bottom-left"===i?s=rs.getBottomLeft(t):"bottom-right"===i?s=rs.getBottomRight(t):i===ns?s=rs.getTopLeft(t):"top-right"===i?s=rs.getTopRight(t):qi(!1,13),s},getEnlargedArea:function(t,i){var s=Math.min(t[0],i[0]),h=Math.min(t[1],i[1]);return(Math.max(t[2],i[2])-s)*(Math.max(t[3],i[3])-h)},getForViewAndSize:function(t,i,s,h,n){var r=i*h[0]/2,e=i*h[1]/2,o=Math.cos(s),a=Math.sin(s),u=r*o,f=r*a,c=e*o,l=e*a,v=t[0],d=t[1],M=v-u+l,m=v-u-l,p=v+u-l,g=v+u+l,_=d-f-c,w=d-f+c,y=d+f+c,b=d+f-c;return rs.createOrUpdate(Math.min(M,m,p,g),Math.min(_,w,y,b),Math.max(M,m,p,g),Math.max(_,w,y,b),n)},getHeight:function(t){return t[3]-t[1]},getIntersectionArea:function(t,i){var s=rs.getIntersection(t,i);return rs.getArea(s)},getIntersection:function(t,i,s){var h=s||rs.createEmpty();return rs.intersects(t,i)&&(h[0]=t[0]>i[0]?t[0]:i[0],h[1]=t[1]>i[1]?t[1]:i[1],h[2]=t[2]<i[2]?t[2]:i[2],h[3]=t[3]<i[3]?t[3]:i[3]),h},getMargin:function(t){return rs.getWidth(t)+rs.getHeight(t)},getSize:function(t){return[t[2]-t[0],t[3]-t[1]]},getTopLeft:function(t){return[t[0],t[3]]},getTopRight:function(t){return[t[2],t[3]]},getWidth:function(t){return t[2]-t[0]},intersects:function(t,i){return t[0]<=i[2]&&t[2]>=i[0]&&t[1]<=i[3]&&t[3]>=i[1]},isEmpty:function(t){return t[2]<t[0]||t[3]<t[1]},returnOrUpdate:function(t,i){return i?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i):t},scaleFromCenter:function(t,i){var s=(t[2]-t[0])/2*(i-1),h=(t[3]-t[1])/2*(i-1);t[0]-=s,t[2]+=s,t[1]-=h,t[3]+=h},intersectsSegment:function(t,i,s){var h=!1,n=rs.coordinateRelationship(t,i),r=rs.coordinateRelationship(t,s);if(1===n||1===r)h=!0;else{var e,o,a=t[0],u=t[1],f=t[2],c=t[3],l=s[0],v=s[1],d=(v-i[1])/(l-i[0]);2&r&&!(2&n)&&(h=(e=l-(v-c)/d)>=a&&e<=f),h||!(4&r)||4&n||(h=(o=v-(l-f)*d)>=u&&o<=c),h||!(8&r)||8&n||(h=(e=l-(v-u)/d)>=a&&e<=f),h||!(16&r)||16&n||(h=(o=v-(l-a)*d)>=u&&o<=c)}return h},applyTransform:function(t,i,s){var h=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return i(h,h,2),rs.boundingExtentXYs_([h[0],h[2],h[4],h[6]],[h[1],h[3],h[5],h[7]],s)}},es="XY",os="XYZM",as={TRUE:function(){return!0},FALSE:function(){return!1}},us=function(t,i,s,h,n,r){var e,o=r||[],a=0;for(e=i;e<s;e+=h){var u=t[e],f=t[e+1];o[a++]=n[0]*u+n[2]*f+n[4],o[a++]=n[1]*u+n[3]*f+n[5]}return r&&o.length!=a&&(o.length=a),o},fs=function(t,i,s,h,n,r,e){for(var o=e||[],a=Math.cos(n),u=Math.sin(n),f=r[0],c=r[1],l=0,v=i;v<s;v+=h){var d=t[v]-f,M=t[v+1]-c;o[l++]=f+d*a-M*u,o[l++]=c+d*u+M*a;for(var m=v+2;m<v+h;++m)o[l++]=t[m]}return e&&o.length!=l&&(o.length=l),o},cs=function(t,i,s,h,n,r,e,o){for(var a=o||[],u=e[0],f=e[1],c=0,l=i;l<s;l+=h){var v=t[l+1]-f;a[c++]=u+n*(t[l]-u),a[c++]=f+r*v;for(var d=l+2;d<l+h;++d)a[c++]=t[d]}return o&&a.length!=c&&(a.length=c),a},ls=function(t,i,s,h,n,r,e){var o,a,u=e||[],f=0;for(o=i;o<s;o+=h)for(u[f++]=t[o]+n,u[f++]=t[o+1]+r,a=o+2;a<o+h;++a)u[f++]=t[a];return e&&u.length!=f&&(u.length=f),u},vs={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft",METERS_PER_UNIT:{}};vs.METERS_PER_UNIT[vs.DEGREES]=2*Math.PI*6370997/360,vs.METERS_PER_UNIT[vs.FEET]=.3048,vs.METERS_PER_UNIT[vs.METERS]=1,vs.METERS_PER_UNIT[vs.USFEET]=1200/3937;var ds={cache_:null,set:function(t){ds.cache_=t},get:function(){return ds.cache_||window.proj4}},Ms=function(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit;var i=t.code;if(di.ENABLE_PROJ4JS){var s=ds.get();if("function"==typeof s){var h=s.defs(i);void 0!==h&&(void 0!==h.axis&&void 0===t.axisOrientation&&(this.axisOrientation_=h.axis),void 0===t.metersPerUnit&&(this.metersPerUnit_=h.to_meter),void 0===t.units&&(this.units_=h.units))}}};Ms.prototype.canWrapX=function(){return this.canWrapX_},Ms.prototype.getCode=function(){return this.code_},Ms.prototype.getExtent=function(){return this.extent_},Ms.prototype.getUnits=function(){return this.units_},Ms.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||vs.METERS_PER_UNIT[this.units_]},Ms.prototype.getWorldExtent=function(){return this.worldExtent_},Ms.prototype.getAxisOrientation=function(){return this.axisOrientation_},Ms.prototype.isGlobal=function(){return this.global_},Ms.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},Ms.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},Ms.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},Ms.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},Ms.prototype.setWorldExtent=function(t){this.worldExtent_=t},Ms.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},Ms.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var ms={Projection_:function(t){Ms.call(this,{code:t,units:vs.METERS,extent:ms.EXTENT,global:!0,worldExtent:ms.WORLD_EXTENT,getPointResolution:function(t,i){return t/Bi.cosh(i[1]/ms.RADIUS)}})}};di.inherits(ms.Projection_,Ms),ms.RADIUS=6378137,ms.HALF_SIZE=Math.PI*ms.RADIUS,ms.EXTENT=[-ms.HALF_SIZE,-ms.HALF_SIZE,ms.HALF_SIZE,ms.HALF_SIZE],ms.WORLD_EXTENT=[-180,-85,180,85],ms.PROJECTIONS=[new ms.Projection_("EPSG:3857"),new ms.Projection_("EPSG:102100"),new ms.Projection_("EPSG:102113"),new ms.Projection_("EPSG:900913"),new ms.Projection_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new ms.Projection_("urn:ogc:def:crs:EPSG::3857"),new ms.Projection_("http://www.opengis.net/gml/srs/epsg.xml#3857")],ms.fromEPSG4326=function(t,i,s){var h=t.length,n=s>1?s:2,r=i;void 0===r&&(r=n>2?t.slice():new Array(h));for(var e=ms.HALF_SIZE,o=0;o<h;o+=n){r[o]=e*t[o]/180;var a=ms.RADIUS*Math.log(Math.tan(Math.PI*(t[o+1]+90)/360));a>e?a=e:a<-e&&(a=-e),r[o+1]=a}return r},ms.toEPSG4326=function(t,i,s){var h=t.length,n=s>1?s:2,r=i;void 0===r&&(r=n>2?t.slice():new Array(h));for(var e=0;e<h;e+=n)r[e]=180*t[e]/ms.HALF_SIZE,r[e+1]=360*Math.atan(Math.exp(t[e+1]/ms.RADIUS))/Math.PI-90;return r};var ps={Projection_:function(t,i){Ms.call(this,{code:t,units:vs.DEGREES,extent:ps.EXTENT,axisOrientation:i,global:!0,metersPerUnit:ps.METERS_PER_UNIT,worldExtent:ps.EXTENT})}};di.inherits(ps.Projection_,Ms),ps.RADIUS=6378137,ps.EXTENT=[-180,-90,180,90],ps.METERS_PER_UNIT=Math.PI*ps.RADIUS/180,ps.PROJECTIONS=[new ps.Projection_("CRS:84"),new ps.Projection_("EPSG:4326","neu"),new ps.Projection_("urn:ogc:def:crs:EPSG::4326","neu"),new ps.Projection_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new ps.Projection_("urn:ogc:def:crs:OGC:1.3:CRS84"),new ps.Projection_("urn:ogc:def:crs:OGC:2:84"),new ps.Projection_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ps.Projection_("urn:x-ogc:def:crs:EPSG:4326","neu")];var gs={cache_:{},clear:function(){gs.cache_={}},get:function(t){return gs.cache_[t]||null},add:function(t,i){gs.cache_[t]=i}},_s={cache_:{},clear:function(){_s.cache_={}},add:function(t,i,s){var h=t.getCode(),n=i.getCode(),r=_s.cache_;h in r||(r[h]={}),r[h][n]=s},remove:function(t,i){var s=t.getCode(),h=i.getCode(),n=_s.cache_,r=n[s][h];return delete n[s][h],Si.isEmpty(n[s])&&delete n[s],r},get:function(t,i){var s,h=_s.cache_;return t in h&&i in h[t]&&(s=h[t][i]),s}},ws={};ws.METERS_PER_UNIT=vs.METERS_PER_UNIT,ws.SPHERE_=new ss(ss.DEFAULT_RADIUS),di.ENABLE_PROJ4JS&&(ws.setProj4=function(t){ds.set(t)}),ws.getPointResolution=function(t,i,s,h){var n,r=(t=ws.get(t)).getPointResolutionFunc();if(r)n=r(i,s);else if(t.getUnits()==vs.DEGREES&&!h||h==vs.DEGREES)n=i;else{var e=ws.getTransformFromProjections(t,ws.get("EPSG:4326")),o=[s[0]-i/2,s[1],s[0]+i/2,s[1],s[0],s[1]-i/2,s[0],s[1]+i/2];o=e(o,o,2),n=(ws.SPHERE_.haversineDistance(o.slice(0,2),o.slice(2,4))+ws.SPHERE_.haversineDistance(o.slice(4,6),o.slice(6,8)))/2;var a=h?vs.METERS_PER_UNIT[h]:t.getMetersPerUnit();void 0!==a&&(n/=a)}return n},ws.addEquivalentProjections=function(t){ws.addProjections(t),t.forEach((function(i){t.forEach((function(t){i!==t&&_s.add(i,t,ws.cloneTransform)}))}))},ws.addEquivalentTransforms=function(t,i,s,h){t.forEach((function(t){i.forEach((function(i){_s.add(t,i,s),_s.add(i,t,h)}))}))},ws.addProjection=function(t){gs.add(t.getCode(),t),_s.add(t,t,ws.cloneTransform)},ws.addProjections=function(t){t.forEach(ws.addProjection)},ws.clearAllProjections=function(){gs.clear(),_s.clear()},ws.createProjection=function(t,i){return t?"string"==typeof t?ws.get(t):t:ws.get(i)},ws.addCoordinateTransforms=function(t,i,s,h){var n=ws.get(t),r=ws.get(i);_s.add(n,r,ws.createTransformFromCoordinateTransform(s)),_s.add(r,n,ws.createTransformFromCoordinateTransform(h))},ws.createTransformFromCoordinateTransform=function(t){return function(i,s,h){var n,r,e,o=i.length,a=void 0!==h?h:2,u=void 0!==s?s:new Array(o);for(r=0;r<o;r+=a)for(n=t([i[r],i[r+1]]),u[r]=n[0],u[r+1]=n[1],e=a-1;e>=2;--e)u[r+e]=i[r+e];return u}},ws.fromLonLat=function(t,i){return ws.transform(t,"EPSG:4326",void 0!==i?i:"EPSG:3857")},ws.toLonLat=function(t,i){var s=ws.transform(t,void 0!==i?i:"EPSG:3857","EPSG:4326"),h=s[0];return(h<-180||h>180)&&(s[0]=Bi.modulo(h+180,360)-180),s},ws.get=function(t){var i=null;if(t instanceof Ms)i=t;else if("string"==typeof t){var s=t;if(i=gs.get(s),di.ENABLE_PROJ4JS&&!i){var h=ds.get();"function"==typeof h&&void 0!==h.defs(s)&&(i=new Ms({code:s}),ws.addProjection(i))}}return i},ws.equivalent=function(t,i){if(t===i)return!0;var s=t.getUnits()===i.getUnits();return(t.getCode()===i.getCode()||ws.getTransformFromProjections(t,i)===ws.cloneTransform)&&s},ws.getTransform=function(t,i){var s=ws.get(t),h=ws.get(i);return ws.getTransformFromProjections(s,h)},ws.getTransformFromProjections=function(t,i){var s=t.getCode(),h=i.getCode(),n=_s.get(s,h);if(di.ENABLE_PROJ4JS&&!n){var r=ds.get();if("function"==typeof r){var e=r.defs(s),o=r.defs(h);if(void 0!==e&&void 0!==o){if(e===o)ws.addEquivalentProjections([i,t]);else{var a=r(h,s);ws.addCoordinateTransforms(i,t,a.forward,a.inverse)}n=_s.get(s,h)}}}return n||(n=ws.identityTransform),n},ws.identityTransform=function(t,i){if(void 0!==i&&t!==i){for(var s=0,h=t.length;s<h;++s)i[s]=t[s];t=i}return t},ws.cloneTransform=function(t,i){var s;if(void 0!==i){for(var h=0,n=t.length;h<n;++h)i[h]=t[h];s=i}else s=t.slice();return s},ws.transform=function(t,i,s){return ws.getTransform(i,s)(t,void 0,t.length)},ws.transformExtent=function(t,i,s){var h=ws.getTransform(i,s);return rs.applyTransform(t,h)},ws.transformWithProjections=function(t,i,s){return ws.getTransformFromProjections(i,s)(t)},ws.addCommon=function(){ws.addEquivalentProjections(ms.PROJECTIONS),ws.addEquivalentProjections(ps.PROJECTIONS),ws.addEquivalentTransforms(ps.PROJECTIONS,ms.PROJECTIONS,ms.fromEPSG4326,ms.toEPSG4326)},ws.addCommon();var ys={};ys.tmp_=new Array(6),ys.create=function(){return[1,0,0,1,0,0]},ys.reset=function(t){return ys.set(t,1,0,0,1,0,0)},ys.multiply=function(t,i){var s=t[0],h=t[1],n=t[2],r=t[3],e=t[4],o=t[5],a=i[0],u=i[1],f=i[2],c=i[3],l=i[4],v=i[5];return t[0]=s*a+n*u,t[1]=h*a+r*u,t[2]=s*f+n*c,t[3]=h*f+r*c,t[4]=s*l+n*v+e,t[5]=h*l+r*v+o,t},ys.set=function(t,i,s,h,n,r,e){return t[0]=i,t[1]=s,t[2]=h,t[3]=n,t[4]=r,t[5]=e,t},ys.setFromArray=function(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t},ys.apply=function(t,i){var s=i[0],h=i[1];return i[0]=t[0]*s+t[2]*h+t[4],i[1]=t[1]*s+t[3]*h+t[5],i},ys.rotate=function(t,i){var s=Math.cos(i),h=Math.sin(i);return ys.multiply(t,ys.set(ys.tmp_,s,h,-h,s,0,0))},ys.scale=function(t,i,s){return ys.multiply(t,ys.set(ys.tmp_,i,0,0,s,0,0))},ys.translate=function(t,i,s){return ys.multiply(t,ys.set(ys.tmp_,1,0,0,1,i,s))},ys.compose=function(t,i,s,h,n,r,e,o){var a=Math.sin(r),u=Math.cos(r);return t[0]=h*u,t[1]=n*a,t[2]=-h*a,t[3]=n*u,t[4]=e*h*u-o*h*a+i,t[5]=e*n*a+o*n*u+s,t},ys.invert=function(t){var i=ys.determinant(t);qi(0!==i,32);var s=t[0],h=t[1],n=t[2],r=t[3],e=t[4],o=t[5];return t[0]=r/i,t[1]=-h/i,t[2]=-n/i,t[3]=s/i,t[4]=(n*o-r*e)/i,t[5]=-(s*o-h*e)/i,t},ys.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};var bs=function(){Ui.call(this),this.extent_=rs.createEmpty(),this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.tmpTransform_=ys.create()};di.inherits(bs,Ui),bs.prototype.clone=function(){},bs.prototype.closestPointXY=function(){},bs.prototype.getClosestPoint=function(t,i){var s=i||[NaN,NaN];return this.closestPointXY(t[0],t[1],s,1/0),s},bs.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},bs.prototype.computeExtent=function(){},bs.prototype.containsXY=as.FALSE,bs.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),rs.returnOrUpdate(this.extent_,t)},bs.prototype.rotate=function(){},bs.prototype.scale=function(){},bs.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},bs.prototype.getSimplifiedGeometry=function(){},bs.prototype.getType=function(){},bs.prototype.applyTransform=function(){},bs.prototype.intersectsExtent=function(){},bs.prototype.translate=function(){},bs.prototype.transform=function(t,i){var s=this.tmpTransform_,h=(t=ws.get(t)).getUnits()==vs.TILE_PIXELS?function(h,n,r){var e=t.getExtent(),o=t.getWorldExtent(),a=rs.getHeight(o)/rs.getHeight(e);return ys.compose(s,o[0],o[3],a,-a,0,0,0),us(h,0,h.length,r,s,n),ws.getTransform(t,i)(h,n,r)}:ws.getTransform(t,i);return this.applyTransform(h),this};var xs=function(){bs.call(this),this.layout=es,this.stride=2,this.flatCoordinates=null};di.inherits(xs,bs),xs.getLayoutForStride_=function(t){var i;return 2==t?i=es:3==t?i="XYZ":4==t&&(i=os),i},xs.getStrideForLayout=function(t){var i;return t==es?i=2:"XYZ"==t||"XYM"==t?i=3:t==os&&(i=4),i},xs.prototype.containsXY=as.FALSE,xs.prototype.computeExtent=function(t){return rs.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},xs.prototype.getCoordinates=function(){},xs.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},xs.prototype.getFlatCoordinates=function(){return this.flatCoordinates},xs.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},xs.prototype.getLayout=function(){return this.layout},xs.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(Si.clear(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i))return this.simplifiedGeometryCache[i];var s=this.getSimplifiedGeometryInternal(t);return s.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[i]=s,s):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},xs.prototype.getSimplifiedGeometryInternal=function(){return this},xs.prototype.getStride=function(){return this.stride},xs.prototype.setFlatCoordinatesInternal=function(t,i){this.stride=xs.getStrideForLayout(t),this.layout=t,this.flatCoordinates=i},xs.prototype.setCoordinates=function(){},xs.prototype.setLayout=function(t,i,s){var h;if(t)h=xs.getStrideForLayout(t);else{var n;for(n=0;n<s;++n){if(0===i.length)return this.layout=es,void(this.stride=2);i=i[0]}t=xs.getLayoutForStride_(h=i.length)}this.layout=t,this.stride=h},xs.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},xs.prototype.rotate=function(t,i){var s=this.getFlatCoordinates();if(s){var h=this.getStride();fs(s,0,s.length,h,t,i,s),this.changed()}},xs.prototype.scale=function(t,i,s){var h=i;void 0===h&&(h=t);var n=s;n||(n=rs.getCenter(this.getExtent()));var r=this.getFlatCoordinates();if(r){var e=this.getStride();cs(r,0,r.length,e,t,h,n,r),this.changed()}},xs.prototype.translate=function(t,i){var s=this.getFlatCoordinates();if(s){var h=this.getStride();ls(s,0,s.length,h,t,i,s),this.changed()}},xs.transform2D=function(t,i,s){var h=t.getFlatCoordinates();if(h){var n=t.getStride();return us(h,0,h.length,n,i,s)}return null};var Es={linearRing:function(t,i,s,h){for(var n=0,r=t[s-h],e=t[s-h+1];i<s;i+=h){var o=t[i],a=t[i+1];n+=e*o-r*a,r=o,e=a}return n/2},linearRings:function(t,i,s,h){var n,r,e=0;for(n=0,r=s.length;n<r;++n){var o=s[n];e+=Es.linearRing(t,i,o,h),i=o}return e},linearRingss:function(t,i,s,h){var n,r,e=0;for(n=0,r=s.length;n<r;++n){var o=s[n];e+=Es.linearRings(t,i,o,h),i=o[o.length-1]}return e}},Cs={point:function(t,i,s,h,n,r,e){var o,a,u=t[i],f=t[i+1],c=t[s]-u,l=t[s+1]-f;if(0===c&&0===l)a=i;else{var v=((n-u)*c+(r-f)*l)/(c*c+l*l);if(v>1)a=s;else{if(v>0){for(o=0;o<h;++o)e[o]=Bi.lerp(t[i+o],t[s+o],v);return void(e.length=h)}a=i}}for(o=0;o<h;++o)e[o]=t[a+o];e.length=h},getMaxSquaredDelta:function(t,i,s,h,n){var r=t[i],e=t[i+1];for(i+=h;i<s;i+=h){var o=t[i],a=t[i+1],u=Bi.squaredDistance(r,e,o,a);u>n&&(n=u),r=o,e=a}return n},getsMaxSquaredDelta:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r){var o=s[r];n=Cs.getMaxSquaredDelta(t,i,o,h,n),i=o}return n},getssMaxSquaredDelta:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r){var o=s[r];n=Cs.getsMaxSquaredDelta(t,i,o,h,n),i=o[o.length-1]}return n},getClosestPoint:function(t,i,s,h,n,r,e,o,a,u,f){if(i==s)return u;var c,l;if(0===n){if((l=Bi.squaredDistance(e,o,t[i],t[i+1]))<u){for(c=0;c<h;++c)a[c]=t[i+c];return a.length=h,l}return u}for(var v=f||[NaN,NaN],d=i+h;d<s;)if(Cs.point(t,d-h,d,h,e,o,v),(l=Bi.squaredDistance(e,o,v[0],v[1]))<u){for(u=l,c=0;c<h;++c)a[c]=v[c];a.length=h,d+=h}else d+=h*Math.max((Math.sqrt(l)-Math.sqrt(u))/n|0,1);if(r&&(Cs.point(t,s-h,i,h,e,o,v),(l=Bi.squaredDistance(e,o,v[0],v[1]))<u)){for(u=l,c=0;c<h;++c)a[c]=v[c];a.length=h}return u},getsClosestPoint:function(t,i,s,h,n,r,e,o,a,u,f){var c,l,v=f||[NaN,NaN];for(c=0,l=s.length;c<l;++c){var d=s[c];u=Cs.getClosestPoint(t,i,d,h,n,r,e,o,a,u,v),i=d}return u},getssClosestPoint:function(t,i,s,h,n,r,e,o,a,u,f){var c,l,v=f||[NaN,NaN];for(c=0,l=s.length;c<l;++c){var d=s[c];u=Cs.getsClosestPoint(t,i,d,h,n,r,e,o,a,u,v),i=d[d.length-1]}return u}},Ss={coordinate:function(t,i,s){var h,n;for(h=0,n=s.length;h<n;++h)t[i++]=s[h];return i},coordinates:function(t,i,s,h){var n,r;for(n=0,r=s.length;n<r;++n){var e,o=s[n];for(e=0;e<h;++e)t[i++]=o[e]}return i},coordinatess:function(t,i,s,h,n){var r,e,o=n||[],a=0;for(r=0,e=s.length;r<e;++r){var u=Ss.coordinates(t,i,s[r],h);o[a++]=u,i=u}return o.length=a,o},coordinatesss:function(t,i,s,h,n){var r,e,o=n||[],a=0;for(r=0,e=s.length;r<e;++r){var u=Ss.coordinatess(t,i,s[r],h,o[a]);o[a++]=u,i=u[u.length-1]}return o.length=a,o}},As={coordinates:function(t,i,s,h,n){var r,e=void 0!==n?n:[],o=0;for(r=i;r<s;r+=h)e[o++]=t.slice(r,r+h);return e.length=o,e},coordinatess:function(t,i,s,h,n){var r,e,o=void 0!==n?n:[],a=0;for(r=0,e=s.length;r<e;++r){var u=s[r];o[a++]=As.coordinates(t,i,u,h,o[a]),i=u}return o.length=a,o},coordinatesss:function(t,i,s,h,n){var r,e,o=void 0!==n?n:[],a=0;for(r=0,e=s.length;r<e;++r){var u=s[r];o[a++]=As.coordinatess(t,i,u,h,o[a]),i=u[u.length-1]}return o.length=a,o}},Ns={lineString:function(t,i,s,h,n,r,e){var o=void 0!==e?e:[];return r||(s=Ns.radialDistance(t,i,s,h,n,o,0),t=o,i=0,h=2),o.length=Ns.douglasPeucker(t,i,s,h,n,o,0),o},douglasPeucker:function(t,i,s,h,n,r,e){var o=(s-i)/h;if(o<3){for(;i<s;i+=h)r[e++]=t[i],r[e++]=t[i+1];return e}var a=new Array(o);a[0]=1,a[o-1]=1;for(var u,f=[i,s-h],c=0;f.length>0;){var l=f.pop(),v=f.pop(),d=0,M=t[v],m=t[v+1],p=t[l],g=t[l+1];for(u=v+h;u<l;u+=h){var _=Bi.squaredSegmentDistance(t[u],t[u+1],M,m,p,g);_>d&&(c=u,d=_)}d>n&&(a[(c-i)/h]=1,v+h<c&&f.push(v,c),c+h<l&&f.push(c,l))}for(u=0;u<o;++u)a[u]&&(r[e++]=t[i+u*h],r[e++]=t[i+u*h+1]);return e},douglasPeuckers:function(t,i,s,h,n,r,e,o){var a,u;for(a=0,u=s.length;a<u;++a){var f=s[a];e=Ns.douglasPeucker(t,i,f,h,n,r,e),o.push(e),i=f}return e},douglasPeuckerss:function(t,i,s,h,n,r,e,o){var a,u;for(a=0,u=s.length;a<u;++a){var f=s[a],c=[];e=Ns.douglasPeuckers(t,i,f,h,n,r,e,c),o.push(c),i=f[f.length-1]}return e},radialDistance:function(t,i,s,h,n,r,e){if(s<=i+h){for(;i<s;i+=h)r[e++]=t[i],r[e++]=t[i+1];return e}var o=t[i],a=t[i+1];r[e++]=o,r[e++]=a;var u=o,f=a;for(i+=h;i<s;i+=h)Bi.squaredDistance(o,a,u=t[i],f=t[i+1])>n&&(r[e++]=u,r[e++]=f,o=u,a=f);return u==o&&f==a||(r[e++]=u,r[e++]=f),e},snap:function(t,i){return i*Math.round(t/i)},quantize:function(t,i,s,h,n,r,e){if(i==s)return e;var o,a,u=Ns.snap(t[i],n),f=Ns.snap(t[i+1],n);i+=h,r[e++]=u,r[e++]=f;do{if(o=Ns.snap(t[i],n),a=Ns.snap(t[i+1],n),(i+=h)==s)return r[e++]=o,r[e++]=a,e}while(o==u&&a==f);for(;i<s;){var c,l;if(c=Ns.snap(t[i],n),l=Ns.snap(t[i+1],n),i+=h,c!=o||l!=a){var v=o-u,d=a-f,M=c-u,m=l-f;v*m==d*M&&(v<0&&M<v||v==M||v>0&&M>v)&&(d<0&&m<d||d==m||d>0&&m>d)?(o=c,a=l):(r[e++]=o,r[e++]=a,u=o,f=a,o=c,a=l)}}return r[e++]=o,r[e++]=a,e},quantizes:function(t,i,s,h,n,r,e,o){var a,u;for(a=0,u=s.length;a<u;++a){var f=s[a];e=Ns.quantize(t,i,f,h,n,r,e),o.push(e),i=f}return e},quantizess:function(t,i,s,h,n,r,e,o){var a,u;for(a=0,u=s.length;a<u;++a){var f=s[a],c=[];e=Ns.quantizes(t,i,f,h,n,r,e,c),o.push(c),i=f[f.length-1]}return e}},zs=function(t,i){xs.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(t,i)};di.inherits(zs,xs),zs.prototype.clone=function(){var t=new zs(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},zs.prototype.closestPointXY=function(t,i,s,h){return h<rs.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Cs.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Cs.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,i,s,h))},zs.prototype.getArea=function(){return Es.linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},zs.prototype.getCoordinates=function(){return As.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},zs.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=Ns.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new zs(null);return s.setFlatCoordinates(es,i),s},zs.prototype.getType=function(){return Ji},zs.prototype.intersectsExtent=function(){},zs.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ss.coordinates(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(es,null)},zs.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var ks=function(t,i){xs.call(this),this.setCoordinates(t,i)};di.inherits(ks,xs),ks.prototype.clone=function(){var t=new ks(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},ks.prototype.closestPointXY=function(t,i,s,h){var n=this.flatCoordinates,r=Bi.squaredDistance(t,i,n[0],n[1]);if(r<h){var e,o=this.stride;for(e=0;e<o;++e)s[e]=n[e];return s.length=o,r}return h},ks.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},ks.prototype.computeExtent=function(t){return rs.createOrUpdateFromCoordinate(this.flatCoordinates,t)},ks.prototype.getType=function(){return Yi},ks.prototype.intersectsExtent=function(t){return rs.containsXY(t,this.flatCoordinates[0],this.flatCoordinates[1])},ks.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ss.coordinate(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(es,null)},ks.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var Rs={linearRingContainsExtent:function(t,i,s,h,n){return!rs.forEachCorner(n,(function(n){return!Rs.linearRingContainsXY(t,i,s,h,n[0],n[1])}))},linearRingContainsXY:function(t,i,s,h,n,r){for(var e=0,o=t[s-h],a=t[s-h+1];i<s;i+=h){var u=t[i],f=t[i+1];a<=r?f>r&&(u-o)*(r-a)-(n-o)*(f-a)>0&&e++:f<=r&&(u-o)*(r-a)-(n-o)*(f-a)<0&&e--,o=u,a=f}return 0!==e},linearRingsContainsXY:function(t,i,s,h,n,r){if(0===s.length)return!1;if(!Rs.linearRingContainsXY(t,i,s[0],h,n,r))return!1;var e,o;for(e=1,o=s.length;e<o;++e)if(Rs.linearRingContainsXY(t,s[e-1],s[e],h,n,r))return!1;return!0},linearRingssContainsXY:function(t,i,s,h,n,r){if(0===s.length)return!1;var e,o;for(e=0,o=s.length;e<o;++e){var a=s[e];if(Rs.linearRingsContainsXY(t,i,a,h,n,r))return!0;i=a[a.length-1]}return!1}},Ps={linearRings:function(t,i,s,h,n,r,e){for(var o,a,u,f,c,l,v,d=n[r+1],M=[],m=0,p=s.length;m<p;++m){var g=s[m];for(f=t[g-h],l=t[g-h+1],o=i;o<g;o+=h)c=t[o],v=t[o+1],(d<=l&&v<=d||l<=d&&d<=v)&&M.push(u=(d-l)/(v-l)*(c-f)+f),f=c,l=v}var _=NaN,w=-1/0;for(M.sort(hs.numberSafeCompareFunction),f=M[0],o=1,a=M.length;o<a;++o){c=M[o];var y=Math.abs(c-f);y>w&&Rs.linearRingsContainsXY(t,i,s,h,u=(f+c)/2,d)&&(_=u,w=y),f=c}return isNaN(_)&&(_=n[r]),e?(e.push(_,d,w),e):[_,d,w]},linearRingss:function(t,i,s,h,n){var r,e,o=[];for(r=0,e=s.length;r<e;++r){var a=s[r];o=Ps.linearRings(t,i,a,h,n,2*r,o),i=a[a.length-1]}return o}},Ts=function(t,i,s,h,n,r){for(var e,o=[t[i],t[i+1]],a=[];i+h<s;i+=h){if(a[0]=t[i+h],a[1]=t[i+h+1],e=n.call(r,o,a))return e;o[0]=a[0],o[1]=a[1]}return!1},Os={lineString:function(t,i,s,h,n){var r=rs.extendFlatCoordinates(rs.createEmpty(),t,i,s,h);return!!rs.intersects(n,r)&&(!!rs.containsExtent(n,r)||r[0]>=n[0]&&r[2]<=n[2]||r[1]>=n[1]&&r[3]<=n[3]||Ts(t,i,s,h,(function(t,i){return rs.intersectsSegment(n,t,i)})))},lineStrings:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r){if(Os.lineString(t,i,s[r],h,n))return!0;i=s[r]}return!1},linearRing:function(t,i,s,h,n){return!!(Os.lineString(t,i,s,h,n)||Rs.linearRingContainsXY(t,i,s,h,n[0],n[1])||Rs.linearRingContainsXY(t,i,s,h,n[0],n[3])||Rs.linearRingContainsXY(t,i,s,h,n[2],n[1])||Rs.linearRingContainsXY(t,i,s,h,n[2],n[3]))},linearRings:function(t,i,s,h,n){if(!Os.linearRing(t,i,s[0],h,n))return!1;if(1===s.length)return!0;var r,e;for(r=1,e=s.length;r<e;++r)if(Rs.linearRingContainsExtent(t,s[r-1],s[r],h,n))return!1;return!0},linearRingss:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r){var o=s[r];if(Os.linearRings(t,i,o,h,n))return!0;i=o[o.length-1]}return!1}},Ls=function(t,i,s,h){for(;i<s-h;){var n;for(n=0;n<h;++n){var r=t[i+n];t[i+n]=t[s-h+n],t[s-h+n]=r}i+=h,s-=h}},Is={linearRingIsClockwise:function(t,i,s,h){for(var n=0,r=t[s-h],e=t[s-h+1];i<s;i+=h){var o=t[i],a=t[i+1];n+=(o-r)*(a+e),r=o,e=a}return n>0},linearRingsAreOriented:function(t,i,s,h,n){var r,e,o=void 0!==n&&n;for(r=0,e=s.length;r<e;++r){var a=s[r],u=Is.linearRingIsClockwise(t,i,a,h);if(0===r){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;i=a}return!0},linearRingssAreOriented:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r)if(!Is.linearRingsAreOriented(t,i,s[r],h,n))return!1;return!0},orientLinearRings:function(t,i,s,h,n){var r,e,o=void 0!==n&&n;for(r=0,e=s.length;r<e;++r){var a=s[r],u=Is.linearRingIsClockwise(t,i,a,h);(0===r?o&&u||!o&&!u:o&&!u||!o&&u)&&Ls(t,i,a,h),i=a}return i},orientLinearRingss:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r)i=Is.orientLinearRings(t,i,s[r],h,n);return i}},Fs=function(t,i){xs.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,this.setCoordinates(t,i)};di.inherits(Fs,xs),Fs.prototype.appendLinearRing=function(t){this.flatCoordinates?hs.extend(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},Fs.prototype.clone=function(){var t=new Fs(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice()),t},Fs.prototype.closestPointXY=function(t,i,s,h){return h<rs.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Cs.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Cs.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,i,s,h))},Fs.prototype.containsXY=function(t,i){return Rs.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)},Fs.prototype.getArea=function(){return Es.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},Fs.prototype.getCoordinates=function(t){var i;return void 0!==t?(i=this.getOrientedFlatCoordinates().slice(),Is.orientLinearRings(i,0,this.ends_,this.stride,t)):i=this.flatCoordinates,As.coordinatess(i,0,this.ends_,this.stride)},Fs.prototype.getEnds=function(){return this.ends_},Fs.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=rs.getCenter(this.getExtent());this.flatInteriorPoint_=Ps.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},Fs.prototype.getInteriorPoint=function(){return new ks(this.getFlatInteriorPoint(),"XYM")},Fs.prototype.getLinearRingCount=function(){return this.ends_.length},Fs.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t)return null;var i=new zs(null);return i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t])),i},Fs.prototype.getLinearRings=function(){var t,i,s=this.layout,h=this.flatCoordinates,n=this.ends_,r=[],e=0;for(t=0,i=n.length;t<i;++t){var o=n[t],a=new zs(null);a.setFlatCoordinates(s,h.slice(e,o)),r.push(a),e=o}return r},Fs.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Is.linearRingsAreOriented(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Is.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},Fs.prototype.getSimplifiedGeometryInternal=function(t){var i=[],s=[];i.length=Ns.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,s);var h=new Fs(null);return h.setFlatCoordinates(es,i,s),h},Fs.prototype.getType=function(){return Zi},Fs.prototype.intersectsExtent=function(t){return Os.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},Fs.prototype.setCoordinates=function(t,i){if(t){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var s=Ss.coordinatess(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===s.length?0:s[s.length-1],this.changed()}else this.setFlatCoordinates(es,null,this.ends_)},Fs.prototype.setFlatCoordinates=function(t,i,s){this.setFlatCoordinatesInternal(t,i),this.ends_=s,this.changed()},Fs.circular=function(t,i,s,h){var n,r=h||32,e=[];for(n=0;n<r;++n)hs.extend(e,t.offset(i,s,2*Math.PI*n/r));e.push(e[0],e[1]);var o=new Fs(null);return o.setFlatCoordinates(es,e,[e.length]),o},Fs.fromExtent=function(t){var i=t[0],s=t[1],h=t[2],n=t[3],r=[i,s,i,n,h,n,h,s,i,s],e=new Fs(null);return e.setFlatCoordinates(es,r,[r.length]),e},Fs.fromCircle=function(t,i,s){for(var h=i||32,n=t.getStride(),r=t.getLayout(),e=new Fs(null,r),o=n*(h+1),a=new Array(o),u=0;u<o;u++)a[u]=0;return e.setFlatCoordinates(r,a,[a.length]),Fs.makeRegular(e,t.getCenter(),t.getRadius(),s),e},Fs.makeRegular=function(t,i,s,h){for(var n,r,e=t.getFlatCoordinates(),o=t.getLayout(),a=t.getStride(),u=t.getEnds(),f=e.length/a-1,c=h||0,l=0;l<=f;++l)r=l*a,n=c+2*Bi.modulo(l,f)*Math.PI/f,e[r]=i[0]+s*Math.cos(n),e[r+1]=i[1]+s*Math.sin(n);t.setFlatCoordinates(o,e,u)};var Ds={ONE:1,SRC_ALPHA:770,COLOR_ATTACHMENT0:36064,COLOR_BUFFER_BIT:16384,TRIANGLES:4,TRIANGLE_STRIP:5,ONE_MINUS_SRC_ALPHA:771,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,CULL_FACE:2884,BLEND:3042,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126,RGBA:6408,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,LINK_STATUS:35714,LINEAR:9729,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE0:33984,CLAMP_TO_EDGE:33071,COMPILE_STATUS:35713,FRAMEBUFFER:36160,CONTEXT_IDS_:["experimental-webgl","webgl","webkit-3d","moz-webgl"],getContext:function(t,i){var s,h,n=Ds.CONTEXT_IDS_.length;for(h=0;h<n;++h)try{if(s=t.getContext(Ds.CONTEXT_IDS_[h],i))return s}catch(r){}return null}},Ws={},Gs="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";Ws.FIREFOX=-1!==Gs.indexOf("firefox"),Ws.SAFARI=-1!==Gs.indexOf("safari")&&-1==Gs.indexOf("chrom"),Ws.WEBKIT=-1!==Gs.indexOf("webkit")&&-1==Gs.indexOf("edge"),Ws.MAC=-1!==Gs.indexOf("macintosh"),Ws.DEVICE_PIXEL_RATIO=window.devicePixelRatio||1,Ws.CANVAS_LINE_DASH=!1,Ws.CANVAS=di.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in window))return!1;try{var t=document.createElement("CANVAS").getContext("2d");return!!t&&(void 0!==t.setLineDash&&(Ws.CANVAS_LINE_DASH=!0),!0)}catch(i){return!1}}(),Ws.DEVICE_ORIENTATION="DeviceOrientationEvent"in window,Ws.GEOLOCATION="geolocation"in navigator,Ws.TOUCH=di.ASSUME_TOUCH||"ontouchstart"in window,Ws.POINTER="PointerEvent"in window,Ws.MSPOINTER=!!navigator.msPointerEnabled,function(){if(di.ENABLE_WEBGL){var t,i=!1,s=[];if("WebGLRenderingContext"in window)try{var h=document.createElement("CANVAS"),n=Ds.getContext(h,{failIfMajorPerformanceCaveat:!0});n&&(i=!0,t=n.getParameter(n.MAX_TEXTURE_SIZE),s=n.getSupportedExtensions())}catch(r){}Ws.WEBGL=i,di.WEBGL_EXTENSIONS=s,di.WEBGL_MAX_TEXTURE_SIZE=t}}();var Vs=function(t){Ui.call(this);var i=t||{};this.position_=null,this.transform_=ws.identityTransform,this.sphere_=new ss(ps.RADIUS),this.watchId_=void 0,Ai.listen(this,Ui.getChangeEventType(yi),this.handleProjectionChanged_,this),Ai.listen(this,Ui.getChangeEventType(xi),this.handleTrackingChanged_,this),void 0!==i.projection&&this.setProjection(i.projection),void 0!==i.trackingOptions&&this.setTrackingOptions(i.trackingOptions),this.setTracking(void 0!==i.tracking&&i.tracking)};di.inherits(Vs,Ui),Vs.prototype.disposeInternal=function(){this.setTracking(!1),Ui.prototype.disposeInternal.call(this)},Vs.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=ws.getTransformFromProjections(ws.get("EPSG:4326"),t),this.position_&&this.set(wi,this.transform_(this.position_)))},Vs.prototype.handleTrackingChanged_=function(){if(Ws.GEOLOCATION){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},Vs.prototype.positionChange_=function(t){var i=t.coords;this.set(Mi,i.accuracy),this.set(pi,null===i.altitude?void 0:i.altitude),this.set(gi,null===i.altitudeAccuracy?void 0:i.altitudeAccuracy),this.set(_i,null===i.heading?void 0:Bi.toRadians(i.heading)),this.position_?(this.position_[0]=i.longitude,this.position_[1]=i.latitude):this.position_=[i.longitude,i.latitude];var s=this.transform_(this.position_);this.set(wi,s),this.set(bi,null===i.speed?void 0:i.speed);var h=Fs.circular(this.sphere_,this.position_,i.accuracy);h.applyTransform(this.transform_),this.set(mi,h),this.changed()},Vs.prototype.positionError_=function(t){t.type=Li,this.setTracking(!1),this.dispatchEvent(t)},Vs.prototype.getAccuracy=function(){return this.get(Mi)},Vs.prototype.getAccuracyGeometry=function(){return this.get(mi)||null},Vs.prototype.getAltitude=function(){return this.get(pi)},Vs.prototype.getAltitudeAccuracy=function(){return this.get(gi)},Vs.prototype.getHeading=function(){return this.get(_i)},Vs.prototype.getPosition=function(){return this.get(wi)},Vs.prototype.getProjection=function(){return this.get(yi)},Vs.prototype.getSpeed=function(){return this.get(bi)},Vs.prototype.getTracking=function(){return this.get(xi)},Vs.prototype.getTrackingOptions=function(){return this.get(Ei)},Vs.prototype.setProjection=function(t){this.set(yi,ws.get(t))},Vs.prototype.setTracking=function(t){this.set(xi,t)},Vs.prototype.setTrackingOptions=function(t){this.set(Ei,t)};var js="add",Us="remove",Xs=function(t,i){if(Ui.call(this),this.unique_=!!(i||{}).unique,this.array_=t||[],this.unique_)for(var s=0,h=this.array_.length;s<h;++s)this.assertUnique_(this.array_[s],s);this.updateLength_()};di.inherits(Xs,Ui),Xs.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},Xs.prototype.extend=function(t){var i,s;for(i=0,s=t.length;i<s;++i)this.push(t[i]);return this},Xs.prototype.forEach=function(t,i){for(var s=i?t.bind(i):t,h=this.array_,n=0,r=h.length;n<r;++n)s(h[n],n,h)},Xs.prototype.getArray=function(){return this.array_},Xs.prototype.item=function(t){return this.array_[t]},Xs.prototype.getLength=function(){return this.get(Xs.Property_.LENGTH)},Xs.prototype.insertAt=function(t,i){this.unique_&&this.assertUnique_(i),this.array_.splice(t,0,i),this.updateLength_(),this.dispatchEvent(new Xs.Event(js,i))},Xs.prototype.pop=function(){return this.removeAt(this.getLength()-1)},Xs.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var i=this.getLength();return this.insertAt(i,t),this.getLength()},Xs.prototype.remove=function(t){var i,s,h=this.array_;for(i=0,s=h.length;i<s;++i)if(h[i]===t)return this.removeAt(i)},Xs.prototype.removeAt=function(t){var i=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Xs.Event(Us,i)),i},Xs.prototype.setAt=function(t,i){var s=this.getLength();if(t<s){this.unique_&&this.assertUnique_(i,t);var h=this.array_[t];this.array_[t]=i,this.dispatchEvent(new Xs.Event(Us,h)),this.dispatchEvent(new Xs.Event(js,i))}else{var n;for(n=s;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,i)}},Xs.prototype.updateLength_=function(){this.set(Xs.Property_.LENGTH,this.array_.length)},Xs.prototype.assertUnique_=function(t,i){for(var s=0,h=this.array_.length;s<h;++s)if(this.array_[s]===t&&s!==i)throw new Xi(58)},Xs.Property_={LENGTH:"length"},di.inherits(Xs.Event=function(t,i){zi.call(this,t),this.element=i},zi);var qs=function(t,i,s){zi.call(this,t),this.map=i,this.frameState=void 0!==s?s:null};di.inherits(qs,zi);var Bs=function(t,i,s,h,n){qs.call(this,t,i,n),this.originalEvent=s,this.pixel=i.getEventPixel(s),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==h&&h};di.inherits(Bs,qs),Bs.prototype.preventDefault=function(){qs.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},Bs.prototype.stopPropagation=function(){qs.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()};var Ys={SINGLECLICK:"singleclick",CLICK:Ti,DBLCLICK:Oi,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Hs=function(t,i,s,h,n){Bs.call(this,t,i,s.originalEvent,h,n),this.pointerEvent=s};di.inherits(Hs,Bs);var Js="pointermove",Zs="pointerdown",Ks=function(t,i){this.dispatcher=t,this.mapping_=i};Ks.prototype.getEvents=function(){return Object.keys(this.mapping_)},Ks.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var Qs=function(t){Ks.call(this,t,{mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout}),this.pointerMap=t.pointerMap,this.lastTouches=[]};di.inherits(Qs,Ks),Qs.POINTER_ID=1,Qs.POINTER_TYPE="mouse",Qs.DEDUP_DIST=25,Qs.prototype.isEventSimulatedFromTouch_=function(t){for(var i,s=this.lastTouches,h=t.clientX,n=t.clientY,r=0,e=s.length;r<e&&(i=s[r]);r++){var o=Math.abs(h-i[0]),a=Math.abs(n-i[1]);if(o<=Qs.DEDUP_DIST&&a<=Qs.DEDUP_DIST)return!0}return!1},Qs.prepareEvent=function(t,i){var s=i.cloneEvent(t,t),h=s.preventDefault;return s.preventDefault=function(){t.preventDefault(),h()},s.pointerId=Qs.POINTER_ID,s.isPrimary=!0,s.pointerType=Qs.POINTER_TYPE,s},Qs.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){Qs.POINTER_ID.toString()in this.pointerMap&&this.cancel(t);var i=Qs.prepareEvent(t,this.dispatcher);this.pointerMap[Qs.POINTER_ID.toString()]=t,this.dispatcher.down(i,t)}},Qs.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.move(i,t)}},Qs.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=this.pointerMap[Qs.POINTER_ID.toString()];if(i&&i.button===t.button){var s=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.up(s,t),this.cleanupMouse()}}},Qs.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.enterOver(i,t)}},Qs.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.leaveOut(i,t)}},Qs.prototype.cancel=function(t){var i=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.cancel(i,t),this.cleanupMouse()},Qs.prototype.cleanupMouse=function(){delete this.pointerMap[Qs.POINTER_ID.toString()]};var $s=function(t){Ks.call(this,t,{MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture}),this.pointerMap=t.pointerMap,this.POINTER_TYPES=["","unavailable","touch","pen","mouse"]};di.inherits($s,Ks),$s.prototype.prepareEvent_=function(t){var i=t;return"number"==typeof t.pointerType&&((i=this.dispatcher.cloneEvent(t,t)).pointerType=this.POINTER_TYPES[t.pointerType]),i},$s.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},$s.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var i=this.prepareEvent_(t);this.dispatcher.down(i,t)},$s.prototype.msPointerMove=function(t){var i=this.prepareEvent_(t);this.dispatcher.move(i,t)},$s.prototype.msPointerUp=function(t){var i=this.prepareEvent_(t);this.dispatcher.up(i,t),this.cleanup(t.pointerId)},$s.prototype.msPointerOut=function(t){var i=this.prepareEvent_(t);this.dispatcher.leaveOut(i,t)},$s.prototype.msPointerOver=function(t){var i=this.prepareEvent_(t);this.dispatcher.enterOver(i,t)},$s.prototype.msPointerCancel=function(t){var i=this.prepareEvent_(t);this.dispatcher.cancel(i,t),this.cleanup(t.pointerId)},$s.prototype.msLostPointerCapture=function(t){var i=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(i)},$s.prototype.msGotPointerCapture=function(t){var i=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(i)};var th=function(t){Ks.call(this,t,{pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture})};di.inherits(th,Ks),th.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};var ih=function(t,i,s){zi.call(this,t),this.originalEvent=i;var h=s||{};this.buttons=this.getButtons_(h),this.pressure=this.getPressure_(h,this.buttons),this.bubbles="bubbles"in h&&h.bubbles,this.cancelable="cancelable"in h&&h.cancelable,this.view="view"in h?h.view:null,this.detail="detail"in h?h.detail:null,this.screenX="screenX"in h?h.screenX:0,this.screenY="screenY"in h?h.screenY:0,this.clientX="clientX"in h?h.clientX:0,this.clientY="clientY"in h?h.clientY:0,this.ctrlKey="ctrlKey"in h&&h.ctrlKey,this.altKey="altKey"in h&&h.altKey,this.shiftKey="shiftKey"in h&&h.shiftKey,this.metaKey="metaKey"in h&&h.metaKey,this.button="button"in h?h.button:0,this.relatedTarget="relatedTarget"in h?h.relatedTarget:null,this.pointerId="pointerId"in h?h.pointerId:0,this.width="width"in h?h.width:0,this.height="height"in h?h.height:0,this.tiltX="tiltX"in h?h.tiltX:0,this.tiltY="tiltY"in h?h.tiltY:0,this.pointerType="pointerType"in h?h.pointerType:"",this.hwTimestamp="hwTimestamp"in h?h.hwTimestamp:0,this.isPrimary="isPrimary"in h&&h.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})};di.inherits(ih,zi),ih.prototype.getButtons_=function(t){var i;if(t.buttons||ih.HAS_BUTTONS)i=t.buttons;else switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}return i},ih.prototype.getPressure_=function(t,i){return t.pressure?t.pressure:i?.5:0},ih.HAS_BUTTONS=!1,function(){try{var t=new MouseEvent("click",{buttons:1});ih.HAS_BUTTONS=1===t.buttons}catch(i){}}();var sh=function(t,i){Ks.call(this,t,{touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel}),this.pointerMap=t.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_=void 0};di.inherits(sh,Ks),sh.DEDUP_TIMEOUT=2500,sh.CLICK_COUNT_TIMEOUT=200,sh.POINTER_TYPE="touch",sh.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},sh.prototype.setPrimaryTouch_=function(t){var i=Object.keys(this.pointerMap).length;(0===i||1===i&&Qs.POINTER_ID.toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},sh.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},sh.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),sh.CLICK_COUNT_TIMEOUT)},sh.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},sh.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},sh.prototype.touchToPointer_=function(t,i){var s=this.dispatcher.cloneEvent(t,i);return s.pointerId=i.identifier+2,s.bubbles=!0,s.cancelable=!0,s.detail=this.clickCount_,s.button=0,s.buttons=1,s.width=i.webkitRadiusX||i.radiusX||0,s.height=i.webkitRadiusY||i.radiusY||0,s.pressure=i.webkitForce||i.force||.5,s.isPrimary=this.isPrimaryTouch_(i),s.pointerType=sh.POINTER_TYPE,s.clientX=i.clientX,s.clientY=i.clientY,s.screenX=i.screenX,s.screenY=i.screenY,s},sh.prototype.processTouches_=function(t,i){var s,h,n=Array.prototype.slice.call(t.changedTouches),r=n.length;function e(){t.preventDefault()}for(s=0;s<r;++s)(h=this.touchToPointer_(t,n[s])).preventDefault=e,i.call(this,t,h)},sh.prototype.findTouch_=function(t,i){for(var s=t.length,h=0;h<s;h++)if(t[h].identifier===i)return!0;return!1},sh.prototype.vacuumTouches_=function(t){var i=t.touches,s=Object.keys(this.pointerMap),h=s.length;if(h>=i.length){var n,r,e,o=[];for(n=0;n<h;++n)e=this.pointerMap[r=s[n]],r==Qs.POINTER_ID||this.findTouch_(i,r-2)||o.push(e.out);for(n=0;n<o.length;++n)this.cancelOut_(t,o[n])}},sh.prototype.touchstart=function(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)},sh.prototype.overDown_=function(t,i){this.pointerMap[i.pointerId]={target:i.target,out:i,outTarget:i.target},this.dispatcher.over(i,t),this.dispatcher.enter(i,t),this.dispatcher.down(i,t)},sh.prototype.touchmove=function(t){t.preventDefault(),this.processTouches_(t,this.moveOverOut_)},sh.prototype.moveOverOut_=function(t,i){var s=i,h=this.pointerMap[s.pointerId];if(h){var n=h.out,r=h.outTarget;this.dispatcher.move(s,t),n&&r!==s.target&&(n.relatedTarget=s.target,s.relatedTarget=r,n.target=r,s.target?(this.dispatcher.leaveOut(n,t),this.dispatcher.enterOver(s,t)):(s.target=r,s.relatedTarget=null,this.cancelOut_(t,s))),h.out=s,h.outTarget=s.target}},sh.prototype.touchend=function(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)},sh.prototype.upOut_=function(t,i){this.dispatcher.up(i,t),this.dispatcher.out(i,t),this.dispatcher.leave(i,t),this.cleanUpPointer_(i)},sh.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)},sh.prototype.cancelOut_=function(t,i){this.dispatcher.cancel(i,t),this.dispatcher.out(i,t),this.dispatcher.leave(i,t),this.cleanUpPointer_(i)},sh.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId],this.removePrimaryPointer_(t)},sh.prototype.dedupSynthMouse_=function(t){var i=this.mouseSource.lastTouches,s=t.changedTouches[0];if(this.isPrimaryTouch_(s)){var h=[s.clientX,s.clientY];i.push(h),setTimeout((function(){hs.remove(i,h)}),sh.DEDUP_TIMEOUT)}};var hh=function(t){ki.call(this),this.element_=t,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()};di.inherits(hh,ki),hh.prototype.registerSources=function(){if(Ws.POINTER)this.registerSource("native",new th(this));else if(Ws.MSPOINTER)this.registerSource("ms",new $s(this));else{var t=new Qs(this);this.registerSource("mouse",t),Ws.TOUCH&&this.registerSource("touch",new sh(this,t))}this.register_()},hh.prototype.registerSource=function(t,i){var s=i,h=s.getEvents();h&&(h.forEach((function(t){var i=s.getHandlerForEvent(t);i&&(this.eventMap_[t]=i.bind(s))}),this),this.eventSourceList_.push(s))},hh.prototype.register_=function(){for(var t=this.eventSourceList_.length,i=0;i<t;i++)this.addEvents_(this.eventSourceList_[i].getEvents())},hh.prototype.unregister_=function(){for(var t=this.eventSourceList_.length,i=0;i<t;i++)this.removeEvents_(this.eventSourceList_[i].getEvents())},hh.prototype.eventHandler_=function(t){var i=this.eventMap_[t.type];i&&i(t)},hh.prototype.addEvents_=function(t){t.forEach((function(t){Ai.listen(this.element_,t,this.eventHandler_,this)}),this)},hh.prototype.removeEvents_=function(t){t.forEach((function(t){Ai.unlisten(this.element_,t,this.eventHandler_,this)}),this)},hh.prototype.cloneEvent=function(t,i){for(var s,h={},n=0,r=hh.CLONE_PROPS.length;n<r;n++)h[s=hh.CLONE_PROPS[n][0]]=t[s]||i[s]||hh.CLONE_PROPS[n][1];return h},hh.prototype.down=function(t,i){this.fireEvent(Zs,t,i)},hh.prototype.move=function(t,i){this.fireEvent(Js,t,i)},hh.prototype.up=function(t,i){this.fireEvent("pointerup",t,i)},hh.prototype.enter=function(t,i){t.bubbles=!1,this.fireEvent("pointerenter",t,i)},hh.prototype.leave=function(t,i){t.bubbles=!1,this.fireEvent("pointerleave",t,i)},hh.prototype.over=function(t,i){t.bubbles=!0,this.fireEvent("pointerover",t,i)},hh.prototype.out=function(t,i){t.bubbles=!0,this.fireEvent("pointerout",t,i)},hh.prototype.cancel=function(t,i){this.fireEvent("pointercancel",t,i)},hh.prototype.leaveOut=function(t,i){this.out(t,i),this.contains_(t.target,t.relatedTarget)||this.leave(t,i)},hh.prototype.enterOver=function(t,i){this.over(t,i),this.contains_(t.target,t.relatedTarget)||this.enter(t,i)},hh.prototype.contains_=function(t,i){return!(!t||!i)&&t.contains(i)},hh.prototype.makeEvent=function(t,i,s){return new ih(t,s,i)},hh.prototype.fireEvent=function(t,i,s){var h=this.makeEvent(t,i,s);this.dispatchEvent(h)},hh.prototype.fireNativeEvent=function(t){var i=this.makeEvent(t.type,t,t);this.dispatchEvent(i)},hh.prototype.wrapMouseEvent=function(t,i){return this.makeEvent(t,Qs.prepareEvent(i,this),i)},hh.prototype.disposeInternal=function(){this.unregister_(),ki.prototype.disposeInternal.call(this)},hh.CLONE_PROPS=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]];var nh=function(t,i){ki.call(this),this.map_=t,this.clickTimeoutId_=0,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=i?i*Ws.DEVICE_PIXEL_RATIO:Ws.DEVICE_PIXEL_RATIO,this.down_=null;var s=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new hh(s),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=Ai.listen(this.pointerEventHandler_,Zs,this.handlePointerDown_,this),this.relayedListenerKey_=Ai.listen(this.pointerEventHandler_,Js,this.relayEvent_,this)};di.inherits(nh,ki),nh.prototype.emulateClick_=function(t){var i=new Hs(Ys.CLICK,this.map_,t);this.dispatchEvent(i),0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=0,i=new Hs(Ys.DBLCLICK,this.map_,t),this.dispatchEvent(i)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var i=new Hs(Ys.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)},nh.prototype.updateActivePointers_=function(t){var i=t;i.type==Ys.POINTERUP||i.type==Ys.POINTERCANCEL?delete this.trackedTouches_[i.pointerId]:i.type==Ys.POINTERDOWN&&(this.trackedTouches_[i.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},nh.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var i=new Hs(Ys.POINTERUP,this.map_,t);this.dispatchEvent(i),i.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(Ai.unlistenByKey),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},nh.prototype.isMouseActionButton_=function(t){return 0===t.button},nh.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var i=new Hs(Ys.POINTERDOWN,this.map_,t);this.dispatchEvent(i),this.down_=t,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new hh(document),this.dragListenerKeys_.push(Ai.listen(this.documentPointerEventHandler_,Ys.POINTERMOVE,this.handlePointerMove_,this),Ai.listen(this.documentPointerEventHandler_,Ys.POINTERUP,this.handlePointerUp_,this),Ai.listen(this.pointerEventHandler_,Ys.POINTERCANCEL,this.handlePointerUp_,this)))},nh.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var i=new Hs(Ys.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(i)}t.preventDefault()},nh.prototype.relayEvent_=function(t){var i=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Hs(t.type,this.map_,t,i))},nh.prototype.isMoving_=function(t){return Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},nh.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Ai.unlistenByKey(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(Ai.unlistenByKey(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ai.unlistenByKey),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),ki.prototype.disposeInternal.call(this)};var rh="postrender",eh="layergroup",oh="size",ah="target",uh="view",fh=function(t,i){this.priorityFunction_=t,this.keyFunction_=i,this.elements_=[],this.priorities_=[],this.queuedElements_={}};fh.DROP=1/0,fh.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Si.clear(this.queuedElements_)},fh.prototype.dequeue=function(){var t=this.elements_,i=this.priorities_,s=t[0];1==t.length?(t.length=0,i.length=0):(t[0]=t.pop(),i[0]=i.pop(),this.siftUp_(0));var h=this.keyFunction_(s);return delete this.queuedElements_[h],s},fh.prototype.enqueue=function(t){qi(!(this.keyFunction_(t)in this.queuedElements_),31);var i=this.priorityFunction_(t);return i!=fh.DROP&&(this.elements_.push(t),this.priorities_.push(i),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},fh.prototype.getCount=function(){return this.elements_.length},fh.prototype.getLeftChildIndex_=function(t){return 2*t+1},fh.prototype.getRightChildIndex_=function(t){return 2*t+2},fh.prototype.getParentIndex_=function(t){return t-1>>1},fh.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},fh.prototype.isEmpty=function(){return 0===this.elements_.length},fh.prototype.isKeyQueued=function(t){return t in this.queuedElements_},fh.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},fh.prototype.siftUp_=function(t){for(var i=this.elements_,s=this.priorities_,h=i.length,n=i[t],r=s[t],e=t;t<h>>1;){var o=this.getLeftChildIndex_(t),a=this.getRightChildIndex_(t),u=a<h&&s[a]<s[o]?a:o;i[t]=i[u],s[t]=s[u],t=u}i[t]=n,s[t]=r,this.siftDown_(e,t)},fh.prototype.siftDown_=function(t,i){for(var s=this.elements_,h=this.priorities_,n=s[i],r=h[i];i>t;){var e=this.getParentIndex_(i);if(!(h[e]>r))break;s[i]=s[e],h[i]=h[e],i=e}s[i]=n,h[i]=r},fh.prototype.reprioritize=function(){var t,i,s,h=this.priorityFunction_,n=this.elements_,r=this.priorities_,e=0,o=n.length;for(i=0;i<o;++i)(s=h(t=n[i]))==fh.DROP?delete this.queuedElements_[this.keyFunction_(t)]:(r[e]=s,n[e++]=t);n.length=e,r.length=e,this.heapify_()};var ch=function(t,i){fh.call(this,(function(i){return t.apply(null,i)}),(function(t){return t[0].getKey()})),this.tileChangeCallback_=i,this.tilesLoading_=0,this.tilesLoadingKeys_={}};di.inherits(ch,fh),ch.prototype.enqueue=function(t){var i=fh.prototype.enqueue.call(this,t);return i&&Ai.listen(t[0],Ri,this.handleTileChange,this),i},ch.prototype.getTilesLoading=function(){return this.tilesLoading_},ch.prototype.handleTileChange=function(t){var i=t.target,s=i.getState();if(2===s||3===s||4===s||5===s){Ai.unlisten(i,Ri,this.handleTileChange,this);var h=i.getKey();h in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[h],--this.tilesLoading_),this.tileChangeCallback_()}},ch.prototype.loadMoreTiles=function(t,i){for(var s,h,n,r=0,e=!1;this.tilesLoading_<t&&r<i&&this.getCount()>0;)n=(h=this.dequeue()[0]).getKey(),5===(s=h.getState())?e=!0:0!==s||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++r,h.load());0===r&&e&&this.tileChangeCallback_()};var lh={createExtent:function(t){return function(i){return i?[Bi.clamp(i[0],t[0],t[2]),Bi.clamp(i[1],t[1],t[3])]:void 0}},none:function(t){return t}},vh=function(t){return function(i,s,h){if(void 0!==i){var n=hs.linearFindNearest(t,i,h);n=Bi.clamp(n+s,0,t.length-1);var r=Math.floor(n);return n!=r&&r<t.length-1?t[r]/Math.pow(t[r]/t[r+1],n-r):t[r]}}},dh=function(t,i,s){return function(h,n,r){if(void 0!==h){var e=-r/2+.5,o=Math.floor(Math.log(i/h)/Math.log(t)+e),a=Math.max(o+n,0);return void 0!==s&&(a=Math.min(a,s)),i/Math.pow(t,a)}}},Mh={disable:function(t){return void 0!==t?0:void 0},none:function(t,i){return void 0!==t?t+i:void 0},createSnapToN:function(t){var i=2*Math.PI/t;return function(t,s){return void 0!==t?t=Math.floor((t+s)/i+.5)*i:void 0}},createSnapToZero:function(t){var i=t||Bi.toRadians(5);return function(t,s){return void 0!==t?Math.abs(t+s)<=i?0:t+s:void 0}}},mh="center",ph="resolution",gh="rotation",_h=function(t,i,s){var h=void 0!==s?t.toFixed(s):""+t,n=h.indexOf(".");return(n=-1===n?h.length:n)>i?h:new Array(1+i-n).join("0")+h},wh={add:function(t,i){return t[0]+=i[0],t[1]+=i[1],t},closestOnCircle:function(t,i){var s=i.getRadius(),h=i.getCenter(),n=h[0],r=h[1],e=t[0]-n,o=t[1]-r;0===e&&0===o&&(e=1);var a=Math.sqrt(e*e+o*o);return[n+s*e/a,r+s*o/a]},closestOnSegment:function(t,i){var s,h,n=i[0],r=i[1],e=n[0],o=n[1],a=r[0],u=r[1],f=a-e,c=u-o,l=0===f&&0===c?0:(f*(t[0]-e)+c*(t[1]-o))/(f*f+c*c||0);return l<=0?(s=e,h=o):l>=1?(s=a,h=u):(s=e+l*f,h=o+l*c),[s,h]},createStringXY:function(t){return function(i){return wh.toStringXY(i,t)}},degreesToStringHDMS:function(t,i,s){var h=Bi.modulo(i+180,360)-180,n=Math.abs(3600*h),r=s||0,e=Math.pow(10,r),o=Math.floor(n/3600),a=Math.floor((n-3600*o)/60),u=n-3600*o-60*a;return(u=Math.ceil(u*e)/e)>=60&&(u=0,a+=1),a>=60&&(a=0,o+=1),o+"° "+_h(a,2)+"′ "+_h(u,2,r)+"″"+(0==h?"":" "+t.charAt(h<0?1:0))},format:function(t,i,s){return t?i.replace("{x}",t[0].toFixed(s)).replace("{y}",t[1].toFixed(s)):""},equals:function(t,i){for(var s=!0,h=t.length-1;h>=0;--h)if(t[h]!=i[h]){s=!1;break}return s},rotate:function(t,i){var s=Math.cos(i),h=Math.sin(i),n=t[1]*s+t[0]*h;return t[0]=t[0]*s-t[1]*h,t[1]=n,t},scale:function(t,i){return t[0]*=i,t[1]*=i,t},sub:function(t,i){return t[0]-=i[0],t[1]-=i[1],t},squaredDistance:function(t,i){var s=t[0]-i[0],h=t[1]-i[1];return s*s+h*h},distance:function(t,i){return Math.sqrt(wh.squaredDistance(t,i))},squaredDistanceToSegment:function(t,i){return wh.squaredDistance(t,wh.closestOnSegment(t,i))},toStringHDMS:function(t,i){return t?wh.degreesToStringHDMS("NS",t[1],i)+" "+wh.degreesToStringHDMS("EW",t[0],i):""},toStringXY:function(t,i){return wh.format(t,"{x}, {y}",i)}},yh={easeIn:function(t){return Math.pow(t,3)},easeOut:function(t){return 1-yh.easeIn(1-t)},inAndOut:function(t){return 3*t*t-2*t*t*t},linear:function(t){return t},upAndDown:function(t){return t<.5?yh.inAndOut(2*t):1-yh.inAndOut(2*(t-.5))}},bh=function(t){Ui.call(this);var i=Si.assign({},t);this.hints_=[0,0],this.animations_=[],this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=ws.createProjection(i.projection,"EPSG:3857"),this.applyOptions_(i)};di.inherits(bh,Ui),bh.prototype.applyOptions_=function(t){var i={};i[mh]=void 0!==t.center?t.center:null;var s=bh.createResolutionConstraint_(t);this.maxResolution_=s.maxResolution,this.minResolution_=s.minResolution,this.zoomFactor_=s.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=s.minZoom;var h=bh.createCenterConstraint_(t),n=s.constraint,r=bh.createRotationConstraint_(t);this.constraints_={center:h,resolution:n,rotation:r},void 0!==t.resolution?i[ph]=t.resolution:void 0!==t.zoom&&(i[ph]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_),this.resolutions_&&(i[ph]=Bi.clamp(Number(this.getResolution()||i[ph]),this.minResolution_,this.maxResolution_))),i[gh]=void 0!==t.rotation?t.rotation:0,this.setProperties(i),this.options_=t},bh.prototype.getUpdatedOptions_=function(t){var i=Si.assign({},this.options_);return void 0!==i.resolution?i.resolution=this.getResolution():i.zoom=this.getZoom(),i.center=this.getCenter(),i.rotation=this.getRotation(),Si.assign({},i,t)},bh.prototype.animate=function(t){var i,s=arguments.length;if(s>1&&"function"==typeof arguments[s-1]&&(i=arguments[s-1],--s),!this.isDef()){var h=arguments[s-1];return h.center&&this.setCenter(h.center),void 0!==h.zoom&&this.setZoom(h.zoom),void 0!==h.rotation&&this.setRotation(h.rotation),void(i&&i(!0))}for(var n=Date.now(),r=this.getCenter().slice(),e=this.getResolution(),o=this.getRotation(),a=[],u=0;u<s;++u){var f=arguments[u],c={start:n,complete:!1,anchor:f.anchor,duration:void 0!==f.duration?f.duration:1e3,easing:f.easing||yh.inAndOut};if(f.center&&(c.sourceCenter=r,c.targetCenter=f.center,r=c.targetCenter),void 0!==f.zoom?(c.sourceResolution=e,c.targetResolution=this.constrainResolution(this.maxResolution_,f.zoom-this.minZoom_,0),e=c.targetResolution):f.resolution&&(c.sourceResolution=e,c.targetResolution=f.resolution,e=c.targetResolution),void 0!==f.rotation){c.sourceRotation=o;var l=Bi.modulo(f.rotation-o+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=o+l,o=c.targetRotation}c.callback=i,bh.isNoopAnimation(c)?c.complete=!0:n+=c.duration,a.push(c)}this.animations_.push(a),this.setHint(0,1),this.updateAnimations_()},bh.prototype.getAnimating=function(){return this.hints_[0]>0},bh.prototype.getInteracting=function(){return this.hints_[1]>0},bh.prototype.cancelAnimations=function(){this.setHint(0,-this.hints_[0]);for(var t=0,i=this.animations_.length;t<i;++t){var s=this.animations_[t];s[0].callback&&s[0].callback(!1)}this.animations_.length=0},bh.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),i=!1,s=this.animations_.length-1;s>=0;--s){for(var h=this.animations_[s],n=!0,r=0,e=h.length;r<e;++r){var o=h[r];if(!o.complete){var a=o.duration>0?(t-o.start)/o.duration:1;a>=1?(o.complete=!0,a=1):n=!1;var u=o.easing(a);if(o.sourceCenter){var f=o.sourceCenter[0],c=o.sourceCenter[1];this.set(mh,[f+u*(o.targetCenter[0]-f),c+u*(o.targetCenter[1]-c)])}if(o.sourceResolution&&o.targetResolution){var l=1===u?o.targetResolution:o.sourceResolution+u*(o.targetResolution-o.sourceResolution);o.anchor&&this.set(mh,this.calculateCenterZoom(l,o.anchor)),this.set(ph,l)}if(void 0!==o.sourceRotation&&void 0!==o.targetRotation){var v=1===u?Bi.modulo(o.targetRotation+Math.PI,2*Math.PI)-Math.PI:o.sourceRotation+u*(o.targetRotation-o.sourceRotation);o.anchor&&this.set(mh,this.calculateCenterRotate(v,o.anchor)),this.set(gh,v)}if(i=!0,!o.complete)break}}if(n){this.animations_[s]=null,this.setHint(0,-1);var d=h[0].callback;d&&d(!0)}}this.animations_=this.animations_.filter(Boolean),i&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},bh.prototype.calculateCenterRotate=function(t,i){var s,h=this.getCenter();return void 0!==h&&(wh.rotate(s=[h[0]-i[0],h[1]-i[1]],t-this.getRotation()),wh.add(s,i)),s},bh.prototype.calculateCenterZoom=function(t,i){var s,h=this.getCenter(),n=this.getResolution();return void 0!==h&&void 0!==n&&(s=[i[0]-t*(i[0]-h[0])/n,i[1]-t*(i[1]-h[1])/n]),s},bh.prototype.getSizeFromViewport_=function(){var t=[100,100],i='.ol-viewport[data-view="'+di.getUid(this)+'"]',s=document.querySelector(i);if(s){var h=getComputedStyle(s);t[0]=parseInt(h.width,10),t[1]=parseInt(h.height,10)}return t},bh.prototype.constrainCenter=function(t){return this.constraints_.center(t)},bh.prototype.constrainResolution=function(t,i,s){return this.constraints_.resolution(t,i||0,s||0)},bh.prototype.constrainRotation=function(t,i){return this.constraints_.rotation(t,i||0)},bh.prototype.getCenter=function(){return this.get(mh)},bh.prototype.getConstraints=function(){return this.constraints_},bh.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},bh.prototype.calculateExtent=function(t){var i=t||this.getSizeFromViewport_(),s=this.getCenter();qi(s,1);var h=this.getResolution();qi(void 0!==h,2);var n=this.getRotation();return qi(void 0!==n,3),rs.getForViewAndSize(s,h,n,i)},bh.prototype.getMaxResolution=function(){return this.maxResolution_},bh.prototype.getMinResolution=function(){return this.minResolution_},bh.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},bh.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},bh.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},bh.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},bh.prototype.getProjection=function(){return this.projection_},bh.prototype.getResolution=function(){return this.get(ph)},bh.prototype.getResolutions=function(){return this.resolutions_},bh.prototype.getResolutionForExtent=function(t,i){var s=i||this.getSizeFromViewport_(),h=rs.getWidth(t)/s[0],n=rs.getHeight(t)/s[1];return Math.max(h,n)},bh.prototype.getResolutionForValueFunction=function(t){var i=t||2,s=this.maxResolution_,h=Math.log(s/this.minResolution_)/Math.log(i);return function(t){return s/Math.pow(i,t*h)}},bh.prototype.getRotation=function(){return this.get(gh)},bh.prototype.getValueForResolutionFunction=function(t){var i=t||2,s=this.maxResolution_,h=Math.log(s/this.minResolution_)/Math.log(i);return function(t){return Math.log(s/t)/Math.log(i)/h}},bh.prototype.getState=function(){var t=this.getCenter(),i=this.getProjection(),s=this.getResolution(),h=this.getRotation();return{center:t.slice(),projection:void 0!==i?i:null,resolution:s,rotation:h,zoom:this.getZoom()}},bh.prototype.getZoom=function(){var t,i=this.getResolution();return void 0!==i&&(t=this.getZoomForResolution(i)),t},bh.prototype.getZoomForResolution=function(t){var i,s,h=this.minZoom_||0;if(this.resolutions_){var n=hs.linearFindNearest(this.resolutions_,t,1);h=n,i=this.resolutions_[n],s=n==this.resolutions_.length-1?2:i/this.resolutions_[n+1]}else i=this.maxResolution_,s=this.zoomFactor_;return h+Math.log(i/t)/Math.log(s)},bh.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},bh.prototype.fit=function(t,i){var s,h=i||{},n=h.size;n||(n=this.getSizeFromViewport_()),t instanceof xs?t.getType()===is?(t=t.getExtent(),(s=Fs.fromExtent(t)).rotate(this.getRotation(),rs.getCenter(t))):s=t:(qi(Array.isArray(t),24),qi(!rs.isEmpty(t),25),s=Fs.fromExtent(t));var r,e=void 0!==h.padding?h.padding:[0,0,0,0],o=void 0===h.constrainResolution||h.constrainResolution,a=void 0!==h.nearest&&h.nearest;r=void 0!==h.minResolution?h.minResolution:void 0!==h.maxZoom?this.constrainResolution(this.maxResolution_,h.maxZoom-this.minZoom_,0):0;for(var u=s.getFlatCoordinates(),f=this.getRotation(),c=Math.cos(-f),l=Math.sin(-f),v=1/0,d=1/0,M=-1/0,m=-1/0,p=s.getStride(),g=0,_=u.length;g<_;g+=p){var w=u[g]*c-u[g+1]*l,y=u[g]*l+u[g+1]*c;v=Math.min(v,w),d=Math.min(d,y),M=Math.max(M,w),m=Math.max(m,y)}var b=this.getResolutionForExtent([v,d,M,m],[n[0]-e[1]-e[3],n[1]-e[0]-e[2]]);if(b=isNaN(b)?r:Math.max(b,r),o){var x=this.constrainResolution(b,0,0);!a&&x<b&&(x=this.constrainResolution(x,-1,0)),b=x}var E=(v+M)/2,C=(d+m)/2,S=[(E+=(e[1]-e[3])/2*b)*c-(C+=(e[0]-e[2])/2*b)*(l=-l),C*c+E*l],A=h.callback?h.callback:di.nullFunction;void 0!==h.duration?this.animate({resolution:b,center:S,duration:h.duration,easing:h.easing},A):(this.setResolution(b),this.setCenter(S),setTimeout(A.bind(void 0,!0),0))},bh.prototype.centerOn=function(t,i,s){var h=this.getRotation(),n=Math.cos(-h),r=Math.sin(-h),e=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r,a=this.getResolution();this.setCenter([(e+=(i[0]/2-s[0])*a)*n-(o+=(s[1]-i[1]/2)*a)*(r=-r),o*n+e*r])},bh.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},bh.prototype.rotate=function(t,i){if(void 0!==i){var s=this.calculateCenterRotate(t,i);this.setCenter(s)}this.setRotation(t)},bh.prototype.setCenter=function(t){this.set(mh,t),this.getAnimating()&&this.cancelAnimations()},bh.prototype.setHint=function(t,i){return this.hints_[t]+=i,this.changed(),this.hints_[t]},bh.prototype.setResolution=function(t){this.set(ph,t),this.getAnimating()&&this.cancelAnimations()},bh.prototype.setRotation=function(t){this.set(gh,t),this.getAnimating()&&this.cancelAnimations()},bh.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},bh.createCenterConstraint_=function(t){return void 0!==t.extent?lh.createExtent(t.extent):lh.none},bh.createResolutionConstraint_=function(t){var i,s,h,n=void 0!==t.minZoom?t.minZoom:di.DEFAULT_MIN_ZOOM,r=void 0!==t.maxZoom?t.maxZoom:28,e=void 0!==t.zoomFactor?t.zoomFactor:2;if(void 0!==t.resolutions){var o=t.resolutions;s=o[n],h=void 0!==o[r]?o[r]:o[o.length-1],i=vh(o)}else{var a=ws.createProjection(t.projection,"EPSG:3857"),u=a.getExtent(),f=(u?Math.max(rs.getWidth(u),rs.getHeight(u)):360*ws.METERS_PER_UNIT[vs.DEGREES]/a.getMetersPerUnit())/di.DEFAULT_TILE_SIZE/Math.pow(2,di.DEFAULT_MIN_ZOOM),c=f/Math.pow(2,28-di.DEFAULT_MIN_ZOOM);void 0!==(s=t.maxResolution)?n=0:s=f/Math.pow(e,n),void 0===(h=t.minResolution)&&(h=void 0!==t.maxZoom?void 0!==t.maxResolution?s/Math.pow(e,r):f/Math.pow(e,r):c),r=n+Math.floor(Math.log(s/h)/Math.log(e)),h=s/Math.pow(e,r-n),i=dh(e,s,r-n)}return{constraint:i,maxResolution:s,minResolution:h,minZoom:n,zoomFactor:e}},bh.createRotationConstraint_=function(t){if(void 0===t.enableRotation||t.enableRotation){var i=t.constrainRotation;return void 0===i||!0===i?Mh.createSnapToZero():!1===i?Mh.none:"number"==typeof i?Mh.createSnapToN(i):Mh.none}return Mh.disable},bh.isNoopAnimation=function(t){return!(t.sourceCenter&&t.targetCenter&&!wh.equals(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation};var xh=function(t,i){var s=document.createElement("CANVAS");return t&&(s.width=t),i&&(s.height=i),s.getContext("2d")},Eh=function(t,i){var s=i.parentNode;s&&s.replaceChild(t,i)},Ch=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null},Sh="opacity",Ah="visible",Nh="extent",zh="zIndex",kh="maxResolution",Rh="minResolution",Ph="source",Th=function(t){Ui.call(this);var i=Si.assign({},t);i[Sh]=void 0!==t.opacity?t.opacity:1,i[Ah]=void 0===t.visible||t.visible,i[zh]=void 0!==t.zIndex?t.zIndex:0,i[kh]=void 0!==t.maxResolution?t.maxResolution:1/0,i[Rh]=void 0!==t.minResolution?t.minResolution:0,this.setProperties(i),this.state_={layer:this,managed:!0}};di.inherits(Th,Ui),Th.prototype.getType=function(){return this.type},Th.prototype.getLayerState=function(){return this.state_.opacity=Bi.clamp(this.getOpacity(),0,1),this.state_.sourceState=this.getSourceState(),this.state_.visible=this.getVisible(),this.state_.extent=this.getExtent(),this.state_.zIndex=this.getZIndex(),this.state_.maxResolution=this.getMaxResolution(),this.state_.minResolution=Math.max(this.getMinResolution(),0),this.state_},Th.prototype.getLayersArray=function(){},Th.prototype.getLayerStatesArray=function(){},Th.prototype.getExtent=function(){return this.get(Nh)},Th.prototype.getMaxResolution=function(){return this.get(kh)},Th.prototype.getMinResolution=function(){return this.get(Rh)},Th.prototype.getOpacity=function(){return this.get(Sh)},Th.prototype.getSourceState=function(){},Th.prototype.getVisible=function(){return this.get(Ah)},Th.prototype.getZIndex=function(){return this.get(zh)},Th.prototype.setExtent=function(t){this.set(Nh,t)},Th.prototype.setMaxResolution=function(t){this.set(kh,t)},Th.prototype.setMinResolution=function(t){this.set(Rh,t)},Th.prototype.setOpacity=function(t){this.set(Sh,t)},Th.prototype.setVisible=function(t){this.set(Ah,t)},Th.prototype.setZIndex=function(t){this.set(zh,t)};var Oh="ready",Lh=function(t){var i=t||{},s=Si.assign({},i);delete s.layers;var h=i.layers;Th.call(this,s),this.layersListenerKeys_=[],this.listenerKeys_={},Ai.listen(this,Ui.getChangeEventType(Lh.Property_.LAYERS),this.handleLayersChanged_,this),h?Array.isArray(h)?h=new Xs(h.slice(),{unique:!0}):qi(h instanceof Xs,43):h=new Xs(void 0,{unique:!0}),this.setLayers(h)};di.inherits(Lh,Th),Lh.prototype.handleLayerChange_=function(){this.changed()},Lh.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Ai.unlistenByKey),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var i in this.layersListenerKeys_.push(Ai.listen(t,js,this.handleLayersAdd_,this),Ai.listen(t,Us,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[i].forEach(Ai.unlistenByKey);Si.clear(this.listenerKeys_);var s,h,n,r=t.getArray();for(s=0,h=r.length;s<h;s++)this.listenerKeys_[di.getUid(n=r[s]).toString()]=[Ai.listen(n,Ci,this.handleLayerChange_,this),Ai.listen(n,Ri,this.handleLayerChange_,this)];this.changed()},Lh.prototype.handleLayersAdd_=function(t){var i=t.element,s=di.getUid(i).toString();this.listenerKeys_[s]=[Ai.listen(i,Ci,this.handleLayerChange_,this),Ai.listen(i,Ri,this.handleLayerChange_,this)],this.changed()},Lh.prototype.handleLayersRemove_=function(t){var i=di.getUid(t.element).toString();this.listenerKeys_[i].forEach(Ai.unlistenByKey),delete this.listenerKeys_[i],this.changed()},Lh.prototype.getLayers=function(){return this.get(Lh.Property_.LAYERS)},Lh.prototype.setLayers=function(t){this.set(Lh.Property_.LAYERS,t)},Lh.prototype.getLayersArray=function(t){var i=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(i)})),i},Lh.prototype.getLayerStatesArray=function(t){var i=void 0!==t?t:[],s=i.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(i)}));var h,n,r,e=this.getLayerState();for(h=s,n=i.length;h<n;h++)(r=i[h]).opacity*=e.opacity,r.visible=r.visible&&e.visible,r.maxResolution=Math.min(r.maxResolution,e.maxResolution),r.minResolution=Math.max(r.minResolution,e.minResolution),void 0!==e.extent&&(r.extent=void 0!==r.extent?rs.getIntersection(r.extent,e.extent):e.extent);return i},Lh.prototype.getSourceState=function(){return Oh},Lh.Property_={LAYERS:"layers"};var Ih="MAP_RENDERER",Fh="LAYER_RENDERER",Dh={mapRendererPlugins_:[],getMapRendererPlugins:function(){return Dh.mapRendererPlugins_},layerRendererPlugins_:[],getLayerRendererPlugins:function(){return Dh.layerRendererPlugins_},register:function(t,i){switch(t){case Ih:Dh.mapRendererPlugins_.push(i);break;case Fh:Dh.layerRendererPlugins_.push(i);break;default:throw new Error("Unsupported plugin type: "+t)}},registerMultiple:function(t,i){for(var s=0,h=i.length;s<h;++s)Dh.register(t,i[s])}},Wh="canvas",Gh="webgl",Vh=function(t){return t[0]>0&&t[1]>0},jh=function(t,i,s){return void 0===s&&(s=[0,0]),s[0]=t[0]*i+.5|0,s[1]=t[1]*i+.5|0,s},Uh=function(t,i){return Array.isArray(t)?t:(void 0===i?i=[t,t]:i[0]=i[1]=t,i)},Xh=function(t){Ui.call(this);var i=Xh.createOptionsInternal(t);this.loadTilesWhileAnimating_=void 0!==t.loadTilesWhileAnimating&&t.loadTilesWhileAnimating,this.loadTilesWhileInteracting_=void 0!==t.loadTilesWhileInteracting&&t.loadTilesWhileInteracting,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:Ws.DEVICE_PIXEL_RATIO,this.logos_=i.logos,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_.call(this,Date.now())}.bind(this),this.coordinateToPixelTransform_=ys.create(),this.pixelToCoordinateTransform_=ys.create(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("DIV"),this.viewport_.className="ol-viewport"+(Ws.TOUCH?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.viewport_.style.msTouchAction="none",this.viewport_.style.touchAction="none",this.overlayContainer_=document.createElement("DIV"),this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("DIV"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";for(var s=[Ti,Oi,"mousedown","touchstart","MSPointerDown",Ys.POINTERDOWN,Wi,Vi],h=0,n=s.length;h<n;++h)Ai.listen(this.overlayContainerStopEvent_,s[h],zi.stopPropagation);for(var r in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new nh(this,t.moveTolerance),Ys)Ai.listen(this.mapBrowserEventHandler_,Ys[r],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=i.keyboardEventTarget,this.keyHandlerKeys_=null,Ai.listen(this.viewport_,Vi,this.handleBrowserEvent,this),Ai.listen(this.viewport_,Wi,this.handleBrowserEvent,this),this.controls=i.controls||new Xs,this.interactions=i.interactions||new Xs,this.overlays_=i.overlays,this.overlayIdIndex_={},this.renderer_=i.mapRendererPlugin.create(this.viewport_,this),this.focus_=null,this.postRenderFunctions_=[],this.tileQueue_=new ch(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.skippedFeatureUids_={},Ai.listen(this,Ui.getChangeEventType(eh),this.handleLayerGroupChanged_,this),Ai.listen(this,Ui.getChangeEventType(uh),this.handleViewChanged_,this),Ai.listen(this,Ui.getChangeEventType(oh),this.handleSizeChanged_,this),Ai.listen(this,Ui.getChangeEventType(ah),this.handleTargetChanged_,this),this.setProperties(i.values),this.controls.forEach((function(t){t.setMap(this)}),this),Ai.listen(this.controls,js,(function(t){t.element.setMap(this)}),this),Ai.listen(this.controls,Us,(function(t){t.element.setMap(null)}),this),this.interactions.forEach((function(t){t.setMap(this)}),this),Ai.listen(this.interactions,js,(function(t){t.element.setMap(this)}),this),Ai.listen(this.interactions,Us,(function(t){t.element.setMap(null)}),this),this.overlays_.forEach(this.addOverlayInternal_,this),Ai.listen(this.overlays_,js,(function(t){this.addOverlayInternal_(t.element)}),this),Ai.listen(this.overlays_,Us,(function(t){var i=t.element.getId();void 0!==i&&delete this.overlayIdIndex_[i.toString()],t.element.setMap(null)}),this)};di.inherits(Xh,Ui),Xh.prototype.addControl=function(t){this.getControls().push(t)},Xh.prototype.addInteraction=function(t){this.getInteractions().push(t)},Xh.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},Xh.prototype.addOverlay=function(t){this.getOverlays().push(t)},Xh.prototype.addOverlayInternal_=function(t){var i=t.getId();void 0!==i&&(this.overlayIdIndex_[i.toString()]=t),t.setMap(this)},Xh.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),Ai.unlisten(this.viewport_,Vi,this.handleBrowserEvent,this),Ai.unlisten(this.viewport_,Wi,this.handleBrowserEvent,this),void 0!==this.handleResize_&&(window.removeEventListener(Gi,this.handleResize_,!1),this.handleResize_=void 0),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),this.setTarget(null),Ui.prototype.disposeInternal.call(this)},Xh.prototype.forEachFeatureAtPixel=function(t,i,s){if(this.frameState_){var h=this.getCoordinateFromPixel(t);return this.renderer_.forEachFeatureAtCoordinate(h,this.frameState_,void 0!==(s=void 0!==s?s:{}).hitTolerance?s.hitTolerance*this.frameState_.pixelRatio:0,i,null,void 0!==s.layerFilter?s.layerFilter:as.TRUE,null)}},Xh.prototype.getFeaturesAtPixel=function(t,i){var s=null;return this.forEachFeatureAtPixel(t,(function(t){s||(s=[]),s.push(t)}),i),s},Xh.prototype.forEachLayerAtPixel=function(t,i,s,h,n){if(this.frameState_)return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,void 0!==s?s:null,void 0!==h?h:as.TRUE,void 0!==n?n:null)},Xh.prototype.hasFeatureAtPixel=function(t,i){if(!this.frameState_)return!1;var s=this.getCoordinateFromPixel(t);return this.renderer_.hasFeatureAtCoordinate(s,this.frameState_,void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,void 0!==i.layerFilter?i.layerFilter:as.TRUE,null)},Xh.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},Xh.prototype.getEventPixel=function(t){var i=this.viewport_.getBoundingClientRect(),s=t.changedTouches?t.changedTouches[0]:t;return[s.clientX-i.left,s.clientY-i.top]},Xh.prototype.getTarget=function(){return this.get(ah)},Xh.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},Xh.prototype.getCoordinateFromPixel=function(t){var i=this.frameState_;return i?ys.apply(i.pixelToCoordinateTransform,t.slice()):null},Xh.prototype.getControls=function(){return this.controls},Xh.prototype.getOverlays=function(){return this.overlays_},Xh.prototype.getOverlayById=function(t){var i=this.overlayIdIndex_[t.toString()];return void 0!==i?i:null},Xh.prototype.getInteractions=function(){return this.interactions},Xh.prototype.getLayerGroup=function(){return this.get(eh)},Xh.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},Xh.prototype.getPixelFromCoordinate=function(t){var i=this.frameState_;return i?ys.apply(i.coordinateToPixelTransform,t.slice(0,2)):null},Xh.prototype.getRenderer=function(){return this.renderer_},Xh.prototype.getSize=function(){return this.get(oh)},Xh.prototype.getView=function(){return this.get(uh)},Xh.prototype.getViewport=function(){return this.viewport_},Xh.prototype.getOverlayContainer=function(){return this.overlayContainer_},Xh.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},Xh.prototype.getTilePriority=function(t,i,s,h){var n=this.frameState_;if(!n||!(i in n.wantedTiles))return fh.DROP;if(!n.wantedTiles[i][t.getKey()])return fh.DROP;var r=s[0]-n.focus[0],e=s[1]-n.focus[1];return 65536*Math.log(h)+Math.sqrt(r*r+e*e)/h},Xh.prototype.handleBrowserEvent=function(t,i){var s=new Bs(i||t.type,this,t);this.handleMapBrowserEvent(s)},Xh.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){this.focus_=t.coordinate,t.frameState=this.frameState_;var i,s=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(i=s.length-1;i>=0;i--){var h=s[i];if(h.getActive()&&!h.handleEvent(t))break}}},Xh.prototype.handlePostRender=function(){var t=this.frameState_,i=this.tileQueue_;if(!i.isEmpty()){var s=16,h=s;if(t){var n=t.viewHints;n[0]&&(s=this.loadTilesWhileAnimating_?8:0,h=2),n[1]&&(s=this.loadTilesWhileInteracting_?8:0,h=2)}i.getTilesLoading()<s&&(i.reprioritize(),i.loadMoreTiles(s,h))}var r,e,o=this.postRenderFunctions_;for(r=0,e=o.length;r<e;++r)o[r](this,t);o.length=0},Xh.prototype.handleSizeChanged_=function(){this.render()},Xh.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var i=0,s=this.keyHandlerKeys_.length;i<s;++i)Ai.unlistenByKey(this.keyHandlerKeys_[i]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);var h=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Ai.listen(h,Ii,this.handleBrowserEvent,this),Ai.listen(h,Fi,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(Gi,this.handleResize_,!1))}else this.renderer_.removeLayerRenderers(),Ch(this.viewport_),void 0!==this.handleResize_&&(window.removeEventListener(Gi,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},Xh.prototype.handleTileChange_=function(){this.render()},Xh.prototype.handleViewPropertyChanged_=function(){this.render()},Xh.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(Ai.unlistenByKey(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Ai.unlistenByKey(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",di.getUid(t)),this.viewPropertyListenerKey_=Ai.listen(t,Ci,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Ai.listen(t,Ri,this.handleViewPropertyChanged_,this)),this.render()},Xh.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Ai.unlistenByKey),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Ai.listen(t,Ci,this.render,this),Ai.listen(t,Ri,this.render,this)]),this.render()},Xh.prototype.isRendered=function(){return!!this.frameState_},Xh.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},Xh.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},Xh.prototype.removeControl=function(t){return this.getControls().remove(t)},Xh.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},Xh.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},Xh.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},Xh.prototype.renderFrame_=function(t){var i,s,h,n=this.getSize(),r=this.getView(),e=rs.createEmpty(),o=this.frameState_,a=null;if(void 0!==n&&Vh(n)&&r&&r.isDef()){var u=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),f=this.getLayerGroup().getLayerStatesArray(),c={};for(i=0,s=f.length;i<s;++i)c[di.getUid(f[i].layer)]=f[i];var l=(h=r.getState()).center,v=h.resolution/this.pixelRatio_;l[0]=Math.round(l[0]/v)*v,l[1]=Math.round(l[1]/v)*v,a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:e,focus:this.focus_?this.focus_:l,index:this.frameIndex_++,layerStates:c,layerStatesArray:f,logos:Si.assign({},this.logos_),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:h,viewHints:u,wantedTiles:{}}}a&&(a.extent=rs.getForViewAndSize(h.center,h.resolution,h.rotation,a.size,e)),this.frameState_=a,this.renderer_.renderFrame(a),a&&(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),o&&(!this.previousExtent_||!rs.isEmpty(this.previousExtent_)&&!rs.equals(a.extent,this.previousExtent_))&&(this.dispatchEvent(new qs("movestart",this,o)),this.previousExtent_=rs.createOrUpdateEmpty(this.previousExtent_)),this.previousExtent_&&!a.viewHints[0]&&!a.viewHints[1]&&!rs.equals(a.extent,this.previousExtent_)&&(this.dispatchEvent(new qs("moveend",this,a)),rs.clone(a.extent,this.previousExtent_))),this.dispatchEvent(new qs(rh,this,a)),setTimeout(this.handlePostRender.bind(this),0)},Xh.prototype.setLayerGroup=function(t){this.set(eh,t)},Xh.prototype.setSize=function(t){this.set(oh,t)},Xh.prototype.setTarget=function(t){this.set(ah,t)},Xh.prototype.setView=function(t){this.set(uh,t)},Xh.prototype.skipFeature=function(t){var i=di.getUid(t).toString();this.skippedFeatureUids_[i]=!0,this.render()},Xh.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var i=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth)])}else this.setSize(void 0)},Xh.prototype.unskipFeature=function(t){var i=di.getUid(t).toString();delete this.skippedFeatureUids_[i],this.render()},Xh.DEFAULT_RENDERER_TYPES=[Wh,Gh],Xh.LOGO_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszWWMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvYasvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvXH1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1VkbMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLPVcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqTacrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaarldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+HizeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDnBAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSFhYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJREFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxCBrb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7ahgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCnB3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDgq82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC",Xh.createOptionsInternal=function(t){var i=null;void 0!==t.keyboardEventTarget&&(i="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var s={},h={};if(void 0===t.logo||"boolean"==typeof t.logo&&t.logo)h[Xh.LOGO_URL]="https://openlayers.org/";else{var n=t.logo;"string"==typeof n?h[n]="":n instanceof HTMLElement?h[di.getUid(n).toString()]=n:n&&(qi("string"==typeof n.href,44),qi("string"==typeof n.src,45),h[n.src]=n.href)}var r,e,o=t.layers instanceof Lh?t.layers:new Lh({layers:t.layers});s[eh]=o,s[ah]=t.target,s[uh]=void 0!==t.view?t.view:new bh,void 0!==t.renderer?(Array.isArray(t.renderer)?r=t.renderer:"string"==typeof t.renderer?r=[t.renderer]:qi(!1,46),r.indexOf("dom")>=0&&(r=r.concat(Xh.DEFAULT_RENDERER_TYPES))):r=Xh.DEFAULT_RENDERER_TYPES;var a,u,f,c=Dh.getMapRendererPlugins();t:for(var l=0,v=r.length;l<v;++l)for(var d=r[l],M=0,m=c.length;M<m;++M){var p=c[M];if(p.handles(d)){e=p;break t}}if(!e)throw new Error("Unable to create a map renderer for types: "+r.join(", "));return void 0!==t.controls&&(Array.isArray(t.controls)?a=new Xs(t.controls.slice()):(qi(t.controls instanceof Xs,47),a=t.controls)),void 0!==t.interactions&&(Array.isArray(t.interactions)?u=new Xs(t.interactions.slice()):(qi(t.interactions instanceof Xs,48),u=t.interactions)),void 0!==t.overlays?Array.isArray(t.overlays)?f=new Xs(t.overlays.slice()):(qi(t.overlays instanceof Xs,49),f=t.overlays):f=new Xs,{controls:a,interactions:u,keyboardEventTarget:i,logos:h,overlays:f,mapRendererPlugin:e,values:s}};var qh=function(t){Ui.call(this),this.element=t.element?t.element:null,this.target_=null,this.map_=null,this.listenerKeys=[],this.render=t.render?t.render:di.nullFunction,t.target&&this.setTarget(t.target)};di.inherits(qh,Ui),qh.prototype.disposeInternal=function(){Ch(this.element),Ui.prototype.disposeInternal.call(this)},qh.prototype.getMap=function(){return this.map_},qh.prototype.setMap=function(t){this.map_&&Ch(this.element);for(var i=0,s=this.listenerKeys.length;i<s;++i)Ai.unlistenByKey(this.listenerKeys[i]);this.listenerKeys.length=0,this.map_=t,this.map_&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==di.nullFunction&&this.listenerKeys.push(Ai.listen(t,rh,this.render,this)),t.render())},qh.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t};var Bh,Yh,Hh={CLASS_HIDDEN:"ol-hidden",CLASS_SELECTABLE:"ol-selectable",CLASS_UNSELECTABLE:"ol-unselectable",CLASS_UNSUPPORTED:"ol-unsupported",CLASS_CONTROL:"ol-control"};Hh.getFontFamilies=(Yh={},function(t){if(Bh||(Bh=document.createElement("div").style),!(t in Yh)){Bh.font=t;var i=Bh.fontFamily;if(Bh.font="",!i)return null;Yh[t]=i.split(/,\s?/)}return Yh[t]});var Jh="postcompose",Zh="precompose",Kh="render",Qh=function(t){var i=Si.assign({},t);delete i.source,Th.call(this,i),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,t.map&&this.setMap(t.map),Ai.listen(this,Ui.getChangeEventType(Ph),this.handleSourcePropertyChange_,this),this.setSource(t.source?t.source:null)};di.inherits(Qh,Th),Qh.visibleAtResolution=function(t,i){return t.visible&&i>=t.minResolution&&i<t.maxResolution},Qh.prototype.getLayersArray=function(t){var i=t||[];return i.push(this),i},Qh.prototype.getLayerStatesArray=function(t){var i=t||[];return i.push(this.getLayerState()),i},Qh.prototype.getSource=function(){return this.get(Ph)||null},Qh.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},Qh.prototype.handleSourceChange_=function(){this.changed()},Qh.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ai.unlistenByKey(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Ai.listen(t,Ri,this.handleSourceChange_,this)),this.changed()},Qh.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ai.unlistenByKey(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ai.unlistenByKey(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Ai.listen(t,Zh,(function(t){var i=this.getLayerState();i.managed=!1,i.zIndex=1/0,t.frameState.layerStatesArray.push(i),t.frameState.layerStates[di.getUid(this)]=i}),this),this.mapRenderKey_=Ai.listen(this,Ri,t.render,t),this.changed())},Qh.prototype.setSource=function(t){this.set(Ph,t)};var $h=function(t){var i=t||{};this.ulElement_=document.createElement("UL"),this.logoLi_=document.createElement("LI"),this.ulElement_.appendChild(this.logoLi_),this.logoLi_.style.display="none",this.collapsed_=void 0===i.collapsed||i.collapsed,this.collapsible_=void 0===i.collapsible||i.collapsible,this.collapsible_||(this.collapsed_=!1);var s=void 0!==i.className?i.className:"ol-attribution",h=void 0!==i.tipLabel?i.tipLabel:"Attributions",n=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;var r=void 0!==i.label?i.label:"i";"string"==typeof r?(this.label_=document.createElement("span"),this.label_.textContent=r):this.label_=r;var e=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,o=document.createElement("button");o.setAttribute("type","button"),o.title=h,o.appendChild(e),Ai.listen(o,Ti,this.handleClick_,this);var a=s+" "+Hh.CLASS_UNSELECTABLE+" "+Hh.CLASS_CONTROL+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible"),u=document.createElement("div");u.className=a,u.appendChild(this.ulElement_),u.appendChild(o),qh.call(this,{element:u,render:i.render?i.render:$h.render,target:i.target}),this.renderedAttributions_=[],this.renderedVisible_=!0,this.logoElements_={}};di.inherits($h,qh),$h.prototype.getSourceAttributions_=function(t){for(var i={},s=[],h=t.layerStatesArray,n=t.viewState.resolution,r=0,e=h.length;r<e;++r){var o=h[r];if(Qh.visibleAtResolution(o,n)){var a=o.layer.getSource();if(a){var u=a.getAttributions2();if(u){var f=u(t);if(f)if(Array.isArray(f))for(var c=0,l=f.length;c<l;++c)f[c]in i||(s.push(f[c]),i[f[c]]=!0);else f in i||(s.push(f),i[f]=!0)}}}}return s},$h.render=function(t){this.updateElement_(t.frameState)},$h.prototype.updateElement_=function(t){if(t){var i=this.getSourceAttributions_(t);if(!hs.equals(i,this.renderedAttributions_)){for(;this.ulElement_.lastChild!==this.logoLi_;)this.ulElement_.removeChild(this.ulElement_.lastChild);for(var s=0,h=i.length;s<h;++s){var n=document.createElement("LI");n.innerHTML=i[s],this.ulElement_.appendChild(n)}0===i.length&&this.renderedAttributions_.length>0?this.element.classList.add("ol-logo-only"):0===this.renderedAttributions_.length&&i.length>0&&this.element.classList.remove("ol-logo-only");var r=i.length>0||!Si.isEmpty(t.logos);this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),this.renderedAttributions_=i,this.insertLogos_(t)}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},$h.prototype.insertLogos_=function(t){var i,s,h,n,r=t.logos,e=this.logoElements_;for(i in e)i in r||(Ch(e[i]),delete e[i]);for(n in r){var o=r[n];o instanceof HTMLElement&&(this.logoLi_.appendChild(o),e[n]=o),n in e||((s=new Image).src=n,""===o?h=s:((h=document.createElement("a")).href=o,h.appendChild(s)),this.logoLi_.appendChild(h),e[n]=h)}this.logoLi_.style.display=Si.isEmpty(r)?"none":""},$h.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},$h.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Eh(this.collapseLabel_,this.label_):Eh(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},$h.prototype.getCollapsible=function(){return this.collapsible_},$h.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},$h.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},$h.prototype.getCollapsed=function(){return this.collapsed_};var tn=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-rotate",h=void 0!==i.label?i.label:"⇧";this.label_=null,"string"==typeof h?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=h):(this.label_=h,this.label_.classList.add("ol-compass"));var n=i.tipLabel?i.tipLabel:"Reset rotation",r=document.createElement("button");r.className=s+"-reset",r.setAttribute("type","button"),r.title=n,r.appendChild(this.label_),Ai.listen(r,Ti,tn.prototype.handleClick_,this);var e=s+" "+Hh.CLASS_UNSELECTABLE+" "+Hh.CLASS_CONTROL,o=document.createElement("div");o.className=e,o.appendChild(r);var a=i.render?i.render:tn.render;this.callResetNorth_=i.resetNorth?i.resetNorth:void 0,qh.call(this,{element:o,render:a,target:i.target}),this.duration_=void 0!==i.duration?i.duration:250,this.autoHide_=void 0===i.autoHide||i.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Hh.CLASS_HIDDEN)};di.inherits(tn,qh),tn.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},tn.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(this.duration_>0?t.animate({rotation:0,duration:this.duration_,easing:yh.easeOut}):t.setRotation(0))},tn.render=function(t){var i=t.frameState;if(i){var s=i.viewState.rotation;if(s!=this.rotation_){var h="rotate("+s+"rad)";if(this.autoHide_){var n=this.element.classList.contains(Hh.CLASS_HIDDEN);n||0!==s?n&&0!==s&&this.element.classList.remove(Hh.CLASS_HIDDEN):this.element.classList.add(Hh.CLASS_HIDDEN)}this.label_.style.msTransform=h,this.label_.style.webkitTransform=h,this.label_.style.transform=h}this.rotation_=s}};var sn=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-zoom",h=void 0!==i.delta?i.delta:1,n=void 0!==i.zoomInLabel?i.zoomInLabel:"+",r=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",e=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",o=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",a=document.createElement("button");a.className=s+"-in",a.setAttribute("type","button"),a.title=e,a.appendChild("string"==typeof n?document.createTextNode(n):n),Ai.listen(a,Ti,sn.prototype.handleClick_.bind(this,h));var u=document.createElement("button");u.className=s+"-out",u.setAttribute("type","button"),u.title=o,u.appendChild("string"==typeof r?document.createTextNode(r):r),Ai.listen(u,Ti,sn.prototype.handleClick_.bind(this,-h));var f=s+" "+Hh.CLASS_UNSELECTABLE+" "+Hh.CLASS_CONTROL,c=document.createElement("div");c.className=f,c.appendChild(a),c.appendChild(u),qh.call(this,{element:c,target:i.target}),this.duration_=void 0!==i.duration?i.duration:250};di.inherits(sn,qh),sn.prototype.handleClick_=function(t,i){i.preventDefault(),this.zoomByDelta_(t)},sn.prototype.zoomByDelta_=function(t){var i=this.getMap().getView();if(i){var s=i.getResolution();if(s){var h=i.constrainResolution(s,t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:h,duration:this.duration_,easing:yh.easeOut})):i.setResolution(h)}}};var hn=function(t){var i=t||{},s=new Xs;return(void 0===i.zoom||i.zoom)&&s.push(new sn(i.zoomOptions)),(void 0===i.rotate||i.rotate)&&s.push(new tn(i.rotateOptions)),(void 0===i.attribution||i.attribution)&&s.push(new $h(i.attributionOptions)),s},nn=function(t,i,s){this.decay_=t,this.minVelocity_=i,this.delay_=s,this.points_=[],this.angle_=0,this.initialVelocity_=0};nn.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},nn.prototype.update=function(t,i){this.points_.push(t,i,Date.now())},nn.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,i=this.points_.length-3;if(this.points_[i+2]<t)return!1;for(var s=i-3;s>0&&this.points_[s+2]>t;)s-=3;var h=this.points_[i+2]-this.points_[s+2];if(h<1e3/60)return!1;var n=this.points_[i]-this.points_[s],r=this.points_[i+1]-this.points_[s+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/h,this.initialVelocity_>this.minVelocity_},nn.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},nn.prototype.getAngle=function(){return this.angle_};var rn="active",en=function(t){Ui.call(this),this.map_=null,this.setActive(!0),this.handleEvent=t.handleEvent};di.inherits(en,Ui),en.prototype.getActive=function(){return this.get(rn)},en.prototype.getMap=function(){return this.map_},en.prototype.setActive=function(t){this.set(rn,t)},en.prototype.setMap=function(t){this.map_=t},en.pan=function(t,i,s){var h=t.getCenter();if(h){var n=t.constrainCenter([h[0]+i[0],h[1]+i[1]]);s?t.animate({duration:s,easing:yh.linear,center:n}):t.setCenter(n)}},en.rotate=function(t,i,s,h){i=t.constrainRotation(i,0),en.rotateWithoutConstraints(t,i,s,h)},en.rotateWithoutConstraints=function(t,i,s,h){if(void 0!==i){var n=t.getRotation(),r=t.getCenter();void 0!==n&&r&&h>0?t.animate({rotation:i,anchor:s,duration:h,easing:yh.easeOut}):t.rotate(i,s)}},en.zoom=function(t,i,s,h,n){i=t.constrainResolution(i,0,n),en.zoomWithoutConstraints(t,i,s,h)},en.zoomByDelta=function(t,i,s,h){var n=t.getResolution(),r=t.constrainResolution(n,i,0);if(void 0!==r){var e=t.getResolutions();r=Bi.clamp(r,t.getMinResolution()||e[e.length-1],t.getMaxResolution()||e[0])}if(s&&void 0!==r&&r!==n){var o=t.getCenter(),a=t.calculateCenterZoom(r,s);a=t.constrainCenter(a),s=[(r*o[0]-n*a[0])/(r-n),(r*o[1]-n*a[1])/(r-n)]}en.zoomWithoutConstraints(t,r,s,h)},en.zoomWithoutConstraints=function(t,i,s,h){if(i){var n=t.getResolution(),r=t.getCenter();if(void 0!==n&&r&&i!==n&&h)t.animate({resolution:i,anchor:s,duration:h,easing:yh.easeOut});else{if(s){var e=t.calculateCenterZoom(i,s);t.setCenter(e)}t.setResolution(i)}}};var on=function(t){var i=t||{};this.delta_=i.delta?i.delta:1,en.call(this,{handleEvent:on.handleEvent}),this.duration_=void 0!==i.duration?i.duration:250};di.inherits(on,en),on.handleEvent=function(t){var i=!1;if(t.type==Ys.DBLCLICK){var s=t.coordinate,h=t.originalEvent.shiftKey?-this.delta_:this.delta_,n=t.map.getView();en.zoomByDelta(n,h,s,this.duration_),t.preventDefault(),i=!0}return!i};var an={altKeyOnly:function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey},altShiftKeysOnly:function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey}};an.always=as.TRUE,an.click=function(t){return t.type==Ys.CLICK},an.mouseActionButton=function(t){var i=t.originalEvent;return 0==i.button&&!(Ws.WEBKIT&&Ws.MAC&&i.ctrlKey)},an.never=as.FALSE,an.pointerMove=function(t){return"pointermove"==t.type},an.singleClick=function(t){return t.type==Ys.SINGLECLICK},an.doubleClick=function(t){return t.type==Ys.DBLCLICK},an.noModifierKeys=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey},an.platformModifierKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&(Ws.MAC?i.metaKey:i.ctrlKey)&&!i.shiftKey},an.shiftKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey},an.targetNotEditable=function(t){var i=t.originalEvent.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i},an.mouseOnly=function(t){return qi(t.pointerEvent,56),"mouse"==t.pointerEvent.pointerType},an.primaryAction=function(t){var i=t.pointerEvent;return i.isPrimary&&0===i.button};var un=function(t){var i=t||{};en.call(this,{handleEvent:i.handleEvent?i.handleEvent:un.handleEvent}),this.handleDownEvent_=i.handleDownEvent?i.handleDownEvent:un.handleDownEvent,this.handleDragEvent_=i.handleDragEvent?i.handleDragEvent:un.handleDragEvent,this.handleMoveEvent_=i.handleMoveEvent?i.handleMoveEvent:un.handleMoveEvent,this.handleUpEvent_=i.handleUpEvent?i.handleUpEvent:un.handleUpEvent,this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]};di.inherits(un,en),un.centroid=function(t){for(var i=t.length,s=0,h=0,n=0;n<i;n++)s+=t[n].clientX,h+=t[n].clientY;return[s/i,h/i]},un.prototype.isPointerDraggingEvent_=function(t){var i=t.type;return i===Ys.POINTERDOWN||i===Ys.POINTERDRAG||i===Ys.POINTERUP},un.prototype.updateTrackedPointers_=function(t){if(this.isPointerDraggingEvent_(t)){var i=t.pointerEvent,s=i.pointerId.toString();t.type==Ys.POINTERUP?delete this.trackedPointers_[s]:(t.type==Ys.POINTERDOWN||s in this.trackedPointers_)&&(this.trackedPointers_[s]=i),this.targetPointers=Si.getValues(this.trackedPointers_)}},un.handleDragEvent=di.nullFunction,un.handleUpEvent=as.FALSE,un.handleDownEvent=as.FALSE,un.handleMoveEvent=di.nullFunction,un.handleEvent=function(t){if(!(t instanceof Hs))return!0;var i=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Ys.POINTERDRAG)this.handleDragEvent_(t);else if(t.type==Ys.POINTERUP){var s=this.handleUpEvent_(t);this.handlingDownUpSequence=s&&this.targetPointers.length>0}}else if(t.type==Ys.POINTERDOWN){var h=this.handleDownEvent_(t);this.handlingDownUpSequence=h,i=this.shouldStopEvent(h)}else t.type==Ys.POINTERMOVE&&this.handleMoveEvent_(t);return!i},un.prototype.shouldStopEvent=function(t){return t};var fn=function(t){un.call(this,{handleDownEvent:fn.handleDownEvent_,handleDragEvent:fn.handleDragEvent_,handleUpEvent:fn.handleUpEvent_});var i=t||{};this.kinetic_=i.kinetic,this.lastCentroid=null,this.condition_=i.condition?i.condition:an.noModifierKeys,this.noKinetic_=!1};di.inherits(fn,un),fn.handleDragEvent_=function(t){var i=this.targetPointers,s=un.centroid(i);if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){var h=this.lastCentroid[0]-s[0],n=s[1]-this.lastCentroid[1],r=t.map.getView(),e=r.getState(),o=[h,n];wh.scale(o,e.resolution),wh.rotate(o,e.rotation),wh.add(o,e.center),o=r.constrainCenter(o),r.setCenter(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=i.length},fn.handleUpEvent_=function(t){var i=t.map,s=i.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var h=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=s.getCenter(),e=i.getPixelFromCoordinate(r),o=i.getCoordinateFromPixel([e[0]-h*Math.cos(n),e[1]-h*Math.sin(n)]);s.animate({center:s.constrainCenter(o),duration:500,easing:yh.easeOut})}return s.setHint(1,-1),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},fn.handleDownEvent_=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var i=t.map.getView();return this.lastCentroid=null,this.handlingDownUpSequence||i.setHint(1,1),i.getAnimating()&&i.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},fn.prototype.shouldStopEvent=as.FALSE;var cn=function(t){var i=t||{};un.call(this,{handleDownEvent:cn.handleDownEvent_,handleDragEvent:cn.handleDragEvent_,handleUpEvent:cn.handleUpEvent_}),this.condition_=i.condition?i.condition:an.altShiftKeysOnly,this.lastAngle_=void 0,this.duration_=void 0!==i.duration?i.duration:250};di.inherits(cn,un),cn.handleDragEvent_=function(t){if(an.mouseOnly(t)){var i=t.map,s=i.getView();if(s.getConstraints().rotation!==Mh.disable){var h=i.getSize(),n=t.pixel,r=Math.atan2(h[1]/2-n[1],n[0]-h[0]/2);if(void 0!==this.lastAngle_){var e=r-this.lastAngle_,o=s.getRotation();en.rotateWithoutConstraints(s,o-e)}this.lastAngle_=r}}},cn.handleUpEvent_=function(t){if(!an.mouseOnly(t))return!0;var i=t.map.getView();i.setHint(1,-1);var s=i.getRotation();return en.rotate(i,s,void 0,this.duration_),!1},cn.handleDownEvent_=function(t){return!(!an.mouseOnly(t)||!an.mouseActionButton(t)||!this.condition_(t)||(t.map.getView().setHint(1,1),this.lastAngle_=void 0,0))},cn.prototype.shouldStopEvent=as.FALSE;var ln=function(t){this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null};di.inherits(ln,Ni),ln.prototype.disposeInternal=function(){this.setMap(null)},ln.prototype.render_=function(){var t=this.startPixel_,i=this.endPixel_,s="px",h=this.element_.style;h.left=Math.min(t[0],i[0])+s,h.top=Math.min(t[1],i[1])+s,h.width=Math.abs(i[0]-t[0])+s,h.height=Math.abs(i[1]-t[1])+s},ln.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var i=this.element_.style;i.left=i.top=i.width=i.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},ln.prototype.setPixels=function(t,i){this.startPixel_=t,this.endPixel_=i,this.createOrUpdateGeometry(),this.render_()},ln.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,i=this.endPixel_,s=[t,[t[0],i[1]],i,[i[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new Fs([s])},ln.prototype.getGeometry=function(){return this.geometry_};var vn=function(t){un.call(this,{handleDownEvent:vn.handleDownEvent_,handleDragEvent:vn.handleDragEvent_,handleUpEvent:vn.handleUpEvent_});var i=t||{};this.box_=new ln(i.className||"ol-dragbox"),this.minArea_=void 0!==i.minArea?i.minArea:64,this.startPixel_=null,this.condition_=i.condition?i.condition:an.always,this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:vn.defaultBoxEndCondition};di.inherits(vn,un),vn.defaultBoxEndCondition=function(t,i,s){var h=s[0]-i[0],n=s[1]-i[1];return h*h+n*n>=this.minArea_},vn.handleDragEvent_=function(t){an.mouseOnly(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new vn.Event(vn.EventType_.BOXDRAG,t.coordinate,t)))},vn.prototype.getGeometry=function(){return this.box_.getGeometry()},vn.prototype.onBoxEnd=di.nullFunction,vn.handleUpEvent_=function(t){return!an.mouseOnly(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new vn.Event(vn.EventType_.BOXEND,t.coordinate,t))),!1)},vn.handleDownEvent_=function(t){return!(!an.mouseOnly(t)||!an.mouseActionButton(t)||!this.condition_(t)||(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new vn.Event(vn.EventType_.BOXSTART,t.coordinate,t)),0))},vn.EventType_={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"},vn.Event=function(t,i,s){zi.call(this,t),this.coordinate=i,this.mapBrowserEvent=s},di.inherits(vn.Event,zi);var dn=function(t){var i=t||{},s=i.condition?i.condition:an.shiftKeyOnly;this.duration_=void 0!==i.duration?i.duration:200,this.out_=void 0!==i.out&&i.out,vn.call(this,{condition:s,className:i.className||"ol-dragzoom"})};di.inherits(dn,vn),dn.prototype.onBoxEnd=function(){var t=this.getMap(),i=t.getView(),s=t.getSize(),h=this.getGeometry().getExtent();if(this.out_){var n=i.calculateExtent(s),r=rs.createOrUpdateFromCoordinates([t.getPixelFromCoordinate(rs.getBottomLeft(h)),t.getPixelFromCoordinate(rs.getTopRight(h))]),e=i.getResolutionForExtent(r,s);rs.scaleFromCenter(n,1/e),h=n}var o=i.constrainResolution(i.getResolutionForExtent(h,s)),a=rs.getCenter(h);a=i.constrainCenter(a),i.animate({resolution:o,center:a,duration:this.duration_,easing:yh.easeOut})};var Mn=function(t){en.call(this,{handleEvent:Mn.handleEvent});var i=t||{};this.defaultCondition_=function(t){return an.noModifierKeys(t)&&an.targetNotEditable(t)},this.condition_=void 0!==i.condition?i.condition:this.defaultCondition_,this.duration_=void 0!==i.duration?i.duration:100,this.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128};di.inherits(Mn,en),Mn.handleEvent=function(t){var i=!1;if(t.type==Ii){var s=t.originalEvent.keyCode;if(this.condition_(t)&&(40==s||37==s||39==s||38==s)){var h=t.map.getView(),n=h.getResolution()*this.pixelDelta_,r=0,e=0;40==s?e=-n:37==s?r=-n:39==s?r=n:e=n;var o=[r,e];wh.rotate(o,h.getRotation()),en.pan(h,o,this.duration_),t.preventDefault(),i=!0}}return!i};var mn=function(t){en.call(this,{handleEvent:mn.handleEvent});var i=t||{};this.condition_=i.condition?i.condition:an.targetNotEditable,this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:100};di.inherits(mn,en),mn.handleEvent=function(t){var i=!1;if(t.type==Ii||t.type==Fi){var s=t.originalEvent.charCode;if(this.condition_(t)&&(s=="+".charCodeAt(0)||s=="-".charCodeAt(0))){var h=t.map,n=s=="+".charCodeAt(0)?this.delta_:-this.delta_,r=h.getView();en.zoomByDelta(r,n,void 0,this.duration_),t.preventDefault(),i=!0}}return!i};var pn=function(t){en.call(this,{handleEvent:pn.handleEvent});var i=t||{};this.delta_=0,this.duration_=void 0!==i.duration?i.duration:250,this.timeout_=void 0!==i.timeout?i.timeout:80,this.useAnchor_=void 0===i.useAnchor||i.useAnchor,this.constrainResolution_=i.constrainResolution||!1,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_=void 0,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5};di.inherits(pn,en),pn.handleEvent=function(t){var i=t.type;if(i!==Vi&&i!==Wi)return!0;t.preventDefault();var s,h=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Vi?(s=n.deltaY,Ws.FIREFOX&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=Ws.DEVICE_PIXEL_RATIO),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)):t.type==Wi&&(s=-n.wheelDeltaY,Ws.SAFARI&&(s/=3)),0===s)return!1;var r=Date.now();if(void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?pn.Mode_.TRACKPAD:pn.Mode_.WHEEL),this.mode_===pn.Mode_.TRACKPAD){var e=h.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):e.setHint(1,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var o=e.getResolution()*Math.pow(2,s/this.trackpadDeltaPerZoom_),a=e.getMinResolution(),u=e.getMaxResolution(),f=0;if(o<a?(o=Math.max(o,a/this.trackpadZoomBuffer_),f=1):o>u&&(o=Math.min(o,u*this.trackpadZoomBuffer_),f=-1),this.lastAnchor_){var c=e.calculateCenterZoom(o,this.lastAnchor_);e.setCenter(e.constrainCenter(c))}return e.setResolution(o),0===f&&this.constrainResolution_&&e.animate({resolution:e.constrainResolution(o,s>0?-1:1),easing:yh.easeOut,anchor:this.lastAnchor_,duration:this.duration_}),f>0?e.animate({resolution:a,easing:yh.easeOut,anchor:this.lastAnchor_,duration:500}):f<0&&e.animate({resolution:u,easing:yh.easeOut,anchor:this.lastAnchor_,duration:500}),this.startTime_=r,!1}this.delta_+=s;var l=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,h),l),!1},pn.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(1,-1)},pn.prototype.handleWheelZoom_=function(t){var i=t.getView();i.getAnimating()&&i.cancelAnimations();var s=di.MOUSEWHEELZOOM_MAXDELTA,h=Bi.clamp(this.delta_,-s,s);en.zoomByDelta(i,-h,this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},pn.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},pn.Mode_={TRACKPAD:"trackpad",WHEEL:"wheel"};var gn=function(t){un.call(this,{handleDownEvent:gn.handleDownEvent_,handleDragEvent:gn.handleDragEvent_,handleUpEvent:gn.handleUpEvent_});var i=t||{};this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==i.threshold?i.threshold:.3,this.duration_=void 0!==i.duration?i.duration:250};di.inherits(gn,un),gn.handleDragEvent_=function(t){var i=0,s=this.targetPointers[0],h=this.targetPointers[1],n=Math.atan2(h.clientY-s.clientY,h.clientX-s.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),i=r}this.lastAngle_=n;var e=t.map,o=e.getView();if(o.getConstraints().rotation!==Mh.disable){var a=e.getViewport().getBoundingClientRect(),u=un.centroid(this.targetPointers);if(u[0]-=a.left,u[1]-=a.top,this.anchor_=e.getCoordinateFromPixel(u),this.rotating_){var f=o.getRotation();e.render(),en.rotateWithoutConstraints(o,f+i,this.anchor_)}}},gn.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map.getView();if(i.setHint(1,-1),this.rotating_){var s=i.getRotation();en.rotate(i,s,this.anchor_,this.duration_)}return!1}return!0},gn.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||i.getView().setHint(1,1),!0}return!1},gn.prototype.shouldStopEvent=as.FALSE;var _n=function(t){un.call(this,{handleDownEvent:_n.handleDownEvent_,handleDragEvent:_n.handleDragEvent_,handleUpEvent:_n.handleUpEvent_});var i=t||{};this.constrainResolution_=i.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==i.duration?i.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1};di.inherits(_n,un),_n.handleDragEvent_=function(t){var i=1,s=this.targetPointers[0],h=this.targetPointers[1],n=s.clientX-h.clientX,r=s.clientY-h.clientY,e=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(i=this.lastDistance_/e),this.lastDistance_=e;var o=t.map,a=o.getView(),u=a.getResolution(),f=a.getMaxResolution(),c=a.getMinResolution(),l=u*i;l>f?(i=f/u,l=f):l<c&&(i=c/u,l=c),1!=i&&(this.lastScaleDelta_=i);var v=o.getViewport().getBoundingClientRect(),d=un.centroid(this.targetPointers);d[0]-=v.left,d[1]-=v.top,this.anchor_=o.getCoordinateFromPixel(d),o.render(),en.zoomWithoutConstraints(a,l,this.anchor_)},_n.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map.getView();i.setHint(1,-1);var s=i.getResolution();return(this.constrainResolution_||s<i.getMinResolution()||s>i.getMaxResolution())&&en.zoom(i,s,this.anchor_,this.duration_,this.lastScaleDelta_-1),!1}return!0},_n.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||i.getView().setHint(1,1),!0}return!1},_n.prototype.shouldStopEvent=as.FALSE;var wn=function(t){var i=t||{},s=new Xs,h=new nn(-.005,.05,100);return(void 0===i.altShiftDragRotate||i.altShiftDragRotate)&&s.push(new cn),(void 0===i.doubleClickZoom||i.doubleClickZoom)&&s.push(new on({delta:i.zoomDelta,duration:i.zoomDuration})),(void 0===i.dragPan||i.dragPan)&&s.push(new fn({kinetic:h})),(void 0===i.pinchRotate||i.pinchRotate)&&s.push(new gn),(void 0===i.pinchZoom||i.pinchZoom)&&s.push(new _n({constrainResolution:i.constrainResolution,duration:i.zoomDuration})),(void 0===i.keyboard||i.keyboard)&&(s.push(new Mn),s.push(new mn({delta:i.zoomDelta,duration:i.zoomDuration}))),(void 0===i.mouseWheelZoom||i.mouseWheelZoom)&&s.push(new pn({constrainResolution:i.constrainResolution,duration:i.zoomDuration})),(void 0===i.shiftDragZoom||i.shiftDragZoom)&&s.push(new dn({duration:i.zoomDuration})),s},yn=function(t,i,s,h){ki.call(this),this.extent=t,this.pixelRatio_=s,this.resolution=i,this.state=h};di.inherits(yn,ki),yn.prototype.changed=function(){this.dispatchEvent(Ri)},yn.prototype.getExtent=function(){return this.extent},yn.prototype.getImage=function(){},yn.prototype.getPixelRatio=function(){return this.pixelRatio_},yn.prototype.getResolution=function(){return this.resolution},yn.prototype.getState=function(){return this.state},yn.prototype.load=function(){};var bn=function(t,i,s,h,n){this.loader_=void 0!==n?n:null,yn.call(this,t,i,s,void 0!==n?0:2),this.canvas_=h,this.error_=null};di.inherits(bn,yn),bn.prototype.getError=function(){return this.error_},bn.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=3):this.state=2,this.changed()},bn.prototype.load=function(){0==this.state&&(this.state=1,this.changed(),this.loader_(this.handleLoad_.bind(this)))},bn.prototype.getImage=function(){return this.canvas_};var xn="IMAGE",En="TILE",Cn="VECTOR",Sn=function(t,i,s,h,n){zi.call(this,t),this.vectorContext=i,this.frameState=s,this.context=h,this.glContext=n};di.inherits(Sn,zi);var An=function(t){ki.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null};di.inherits(An,ki),An.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},An.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Pi)},An.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},An.prototype.forEach=function(t,i){for(var s=this.oldest_;s;)t.call(i,s.value_,s.key_,this),s=s.newer},An.prototype.get=function(t){var i=this.entries_[t];return qi(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},An.prototype.remove=function(t){var i=this.entries_[t];return qi(void 0!==i,15),i===this.newest_?(this.newest_=i.older,this.newest_&&(this.newest_.newer=null)):i===this.oldest_?(this.oldest_=i.newer,this.oldest_&&(this.oldest_.older=null)):(i.newer.older=i.older,i.older.newer=i.newer),delete this.entries_[t],--this.count_,i.value_},An.prototype.getCount=function(){return this.count_},An.prototype.getKeys=function(){var t,i=new Array(this.count_),s=0;for(t=this.newest_;t;t=t.older)i[s++]=t.key_;return i},An.prototype.getValues=function(){var t,i=new Array(this.count_),s=0;for(t=this.newest_;t;t=t.older)i[s++]=t.value_;return i},An.prototype.peekLast=function(){return this.oldest_.value_},An.prototype.peekLastKey=function(){return this.oldest_.key_},An.prototype.peekFirstKey=function(){return this.newest_.key_},An.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},An.prototype.replace=function(t,i){this.get(t),this.entries_[t].value_=i},An.prototype.set=function(t,i){qi(!(t in this.entries_),16);var s={key_:t,newer:null,older:this.newest_,value_:i};this.newest_?this.newest_.newer=s:this.oldest_=s,this.newest_=s,this.entries_[t]=s,++this.count_},An.prototype.prune=function(){for(;this.canExpireCache();)this.pop()};var Nn,zn,kn={defaultFont:"10px sans-serif",defaultFillStyle:[0,0,0,1],defaultLineCap:"round",defaultLineDash:[],defaultLineDashOffset:0,defaultLineJoin:"round",defaultMiterLimit:10,defaultStrokeStyle:[0,0,0,1],defaultTextAlign:"center",defaultTextBaseline:"middle",defaultPadding:[0,0,0,0],defaultLineWidth:1};kn.labelCache=new An,kn.checkedFonts_={},kn.measureContext_=null,kn.textHeights_={},kn.checkFont=function(){var t,i,s=kn.checkedFonts_,h=kn.labelCache,n="wmytzilWMYTZIL@#/&?$%10";function r(t){var s=kn.getMeasureContext();s.font="32px monospace",i=s.measureText(n).width;var h=!0;return"monospace"!=t&&(s.font="32px "+t+",monospace",h=s.measureText(n).width!=i),h}function e(){var i=!0;for(var n in s)s[n]<60&&(r(n)?(s[n]=60,Si.clear(kn.textHeights_),kn.measureContext_=null,h.clear()):(++s[n],i=!1));i&&(window.clearInterval(t),t=void 0)}return function(i){var h=Hh.getFontFamilies(i);if(h)for(var n=0,o=h.length;n<o;++n){var a=h[n];a in s||(s[a]=60,r(a)||(s[a]=0,void 0===t&&(t=window.setInterval(e,32))))}}}(),kn.getMeasureContext=function(){var t=kn.measureContext_;return t||(t=kn.measureContext_=xh(1,1)),t},kn.measureTextHeight=(zn=kn.textHeights_,function(t){var i=zn[t];return null==i&&(Nn||((Nn=document.createElement("span")).textContent="M",Nn.style.margin=Nn.style.padding="0 !important",Nn.style.position="absolute !important",Nn.style.left="-99999px !important"),Nn.style.font=t,document.body.appendChild(Nn),i=zn[t]=Nn.offsetHeight,document.body.removeChild(Nn)),i}),kn.measureTextWidth=function(t,i){var s=kn.getMeasureContext();return t!=s.font&&(s.font=t),s.measureText(i).width},kn.rotateAtOffset=function(t,i,s,h){0!==i&&(t.translate(s,h),t.rotate(i),t.translate(-s,-h))},kn.resetTransform_=ys.create(),kn.drawImage=function(t,i,s,h,n,r,e,o,a,u,f){var c;1!=s&&(t.globalAlpha=(c=t.globalAlpha)*s),i&&t.setTransform.apply(t,i),t.drawImage(h,n,r,e,o,a,u,e*f,o*f),c&&(t.globalAlpha=c),i&&t.setTransform.apply(t,kn.resetTransform_)};var Rn={HEX_COLOR_RE_:/^#(?:[0-9a-f]{3,4}){1,2}$/i,NAMED_COLOR_RE_:/^([a-z]*)$/i,asArray:function(t){return Array.isArray(t)?t:Rn.fromString(t)},asString:function(t){return"string"==typeof t?t:Rn.toString(t)},fromNamed:function(t){var i=document.createElement("div");i.style.color=t,document.body.appendChild(i);var s=getComputedStyle(i).color;return document.body.removeChild(i),s}};Rn.fromString=function(){var t={},i=0;return function(s){var h;if(t.hasOwnProperty(s))h=t[s];else{if(i>=1024){var n,r=0;for(n in t)0==(3&r++)&&(delete t[n],--i)}h=Rn.fromStringInternal_(s),t[s]=h,++i}return h}}(),Rn.fromStringInternal_=function(t){var i,s,h,n,r,e;if(Rn.NAMED_COLOR_RE_.exec(t)&&(t=Rn.fromNamed(t)),Rn.HEX_COLOR_RE_.exec(t)){var o,a=t.length-1;o=a<=4?1:2;var u=4===a||8===a;i=parseInt(t.substr(1+0*o,o),16),s=parseInt(t.substr(1+1*o,o),16),h=parseInt(t.substr(1+2*o,o),16),n=u?parseInt(t.substr(1+3*o,o),16):255,1==o&&(i=(i<<4)+i,s=(s<<4)+s,h=(h<<4)+h,u&&(n=(n<<4)+n)),r=[i,s,h,n/255]}else 0==t.indexOf("rgba(")?(e=t.slice(5,-1).split(",").map(Number),r=Rn.normalize(e)):0==t.indexOf("rgb(")?((e=t.slice(4,-1).split(",").map(Number)).push(1),r=Rn.normalize(e)):qi(!1,14);return r},Rn.normalize=function(t,i){var s=i||[];return s[0]=Bi.clamp(t[0]+.5|0,0,255),s[1]=Bi.clamp(t[1]+.5|0,0,255),s[2]=Bi.clamp(t[2]+.5|0,0,255),s[3]=Bi.clamp(t[3],0,1),s},Rn.toString=function(t){var i=t[0];i!=(0|i)&&(i=i+.5|0);var s=t[1];s!=(0|s)&&(s=s+.5|0);var h=t[2];return h!=(0|h)&&(h=h+.5|0),"rgba("+i+","+s+","+h+","+(void 0===t[3]?1:t[3])+")"};var Pn={asColorLike:function(t){return Pn.isColorLike(t)?t:Rn.asString(t)},isColorLike:function(t){return"string"==typeof t||t instanceof CanvasPattern||t instanceof CanvasGradient}},Tn=function(){};Tn.prototype.drawCustom=function(){},Tn.prototype.drawGeometry=function(){},Tn.prototype.setStyle=function(){},Tn.prototype.drawCircle=function(){},Tn.prototype.drawFeature=function(){},Tn.prototype.drawGeometryCollection=function(){},Tn.prototype.drawLineString=function(){},Tn.prototype.drawMultiLineString=function(){},Tn.prototype.drawMultiPoint=function(){},Tn.prototype.drawMultiPolygon=function(){},Tn.prototype.drawPoint=function(){},Tn.prototype.drawPolygon=function(){},Tn.prototype.drawText=function(){},Tn.prototype.setFillStrokeStyle=function(){},Tn.prototype.setImageStyle=function(){},Tn.prototype.setTextStyle=function(){};var On=function(t,i,s,h,n){Tn.call(this),this.context_=t,this.pixelRatio_=i,this.extent_=s,this.transform_=h,this.viewRotation_=n,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageSnapToPixel_=!1,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=ys.create()};di.inherits(On,Tn),On.prototype.drawImages_=function(t,i,s){if(this.image_){var h=us(t,i,s,2,this.transform_,this.pixelCoordinates_),n=this.context_,r=this.tmpLocalTransform_,e=n.globalAlpha;1!=this.imageOpacity_&&(n.globalAlpha=e*this.imageOpacity_);var o,a,u=this.imageRotation_;for(this.imageRotateWithView_&&(u+=this.viewRotation_),o=0,a=h.length;o<a;o+=2){var f=h[o]-this.imageAnchorX_,c=h[o+1]-this.imageAnchorY_;if(this.imageSnapToPixel_&&(f=Math.round(f),c=Math.round(c)),0!==u||1!=this.imageScale_){var l=f+this.imageAnchorX_,v=c+this.imageAnchorY_;ys.compose(r,l,v,this.imageScale_,this.imageScale_,u,-l,-v),n.setTransform.apply(n,r)}n.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,f,c,this.imageWidth_,this.imageHeight_)}0===u&&1==this.imageScale_||n.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(n.globalAlpha=e)}},On.prototype.drawText_=function(t,i,s,h){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=us(t,i,s,h,this.transform_,this.pixelCoordinates_),r=this.context_,e=this.textRotation_;for(this.textRotateWithView_&&(e+=this.viewRotation_);i<s;i+=h){var o=n[i]+this.textOffsetX_,a=n[i+1]+this.textOffsetY_;if(0!==e||1!=this.textScale_){var u=ys.compose(this.tmpLocalTransform_,o,a,this.textScale_,this.textScale_,e,-o,-a);r.setTransform.apply(r,u)}this.textStrokeState_&&r.strokeText(this.text_,o,a),this.textFillState_&&r.fillText(this.text_,o,a)}0===e&&1==this.textScale_||r.setTransform(1,0,0,1,0,0)}},On.prototype.moveToLineTo_=function(t,i,s,h,n){var r=this.context_,e=us(t,i,s,h,this.transform_,this.pixelCoordinates_);r.moveTo(e[0],e[1]);var o=e.length;n&&(o-=2);for(var a=2;a<o;a+=2)r.lineTo(e[a],e[a+1]);return n&&r.closePath(),s},On.prototype.drawRings_=function(t,i,s,h){var n,r;for(n=0,r=s.length;n<r;++n)i=this.moveToLineTo_(t,i,s[n],h,!0);return i},On.prototype.drawCircle=function(t){if(rs.intersects(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=xs.transform2D(t,this.transform_,this.pixelCoordinates_),s=i[2]-i[0],h=i[3]-i[1],n=Math.sqrt(s*s+h*h),r=this.context_;r.beginPath(),r.arc(i[0],i[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},On.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},On.prototype.drawGeometry=function(t){switch(t.getType()){case Yi:this.drawPoint(t);break;case Hi:this.drawLineString(t);break;case Zi:this.drawPolygon(t);break;case Ki:this.drawMultiPoint(t);break;case Qi:this.drawMultiLineString(t);break;case $i:this.drawMultiPolygon(t);break;case ts:this.drawGeometryCollection(t);break;case is:this.drawCircle(t)}},On.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);s&&rs.intersects(this.extent_,s.getExtent())&&(this.setStyle(i),this.drawGeometry(s))},On.prototype.drawGeometryCollection=function(t){var i,s,h=t.getGeometriesArray();for(i=0,s=h.length;i<s;++i)this.drawGeometry(h[i])},On.prototype.drawPoint=function(t){var i=t.getFlatCoordinates(),s=t.getStride();this.image_&&this.drawImages_(i,0,i.length,s),""!==this.text_&&this.drawText_(i,0,i.length,s)},On.prototype.drawMultiPoint=function(t){var i=t.getFlatCoordinates(),s=t.getStride();this.image_&&this.drawImages_(i,0,i.length,s),""!==this.text_&&this.drawText_(i,0,i.length,s)},On.prototype.drawLineString=function(t){if(rs.intersects(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,s=t.getFlatCoordinates();i.beginPath(),this.moveToLineTo_(s,0,s.length,t.getStride(),!1),i.stroke()}if(""!==this.text_){var h=t.getFlatMidpoint();this.drawText_(h,0,2,2)}}},On.prototype.drawMultiLineString=function(t){var i=t.getExtent();if(rs.intersects(this.extent_,i)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var s,h,n=this.context_,r=t.getFlatCoordinates(),e=0,o=t.getEnds(),a=t.getStride();for(n.beginPath(),s=0,h=o.length;s<h;++s)e=this.moveToLineTo_(r,e,o[s],a,!1);n.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},On.prototype.drawPolygon=function(t){if(rs.intersects(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=this.context_;i.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&i.fill(),this.strokeState_&&i.stroke()}if(""!==this.text_){var s=t.getFlatInteriorPoint();this.drawText_(s,0,2,2)}}},On.prototype.drawMultiPolygon=function(t){if(rs.intersects(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i,s,h=this.context_,n=t.getOrientedFlatCoordinates(),r=0,e=t.getEndss(),o=t.getStride();for(h.beginPath(),i=0,s=e.length;i<s;++i)r=this.drawRings_(n,r,e[i],o);this.fillState_&&h.fill(),this.strokeState_&&h.stroke()}if(""!==this.text_){var a=t.getFlatInteriorPoints();this.drawText_(a,0,a.length,2)}}},On.prototype.setContextFillState_=function(t){var i=this.context_,s=this.contextFillState_;s?s.fillStyle!=t.fillStyle&&(s.fillStyle=i.fillStyle=t.fillStyle):(i.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},On.prototype.setContextStrokeState_=function(t){var i=this.context_,s=this.contextStrokeState_;s?(s.lineCap!=t.lineCap&&(s.lineCap=i.lineCap=t.lineCap),Ws.CANVAS_LINE_DASH&&(hs.equals(s.lineDash,t.lineDash)||i.setLineDash(s.lineDash=t.lineDash),s.lineDashOffset!=t.lineDashOffset&&(s.lineDashOffset=i.lineDashOffset=t.lineDashOffset)),s.lineJoin!=t.lineJoin&&(s.lineJoin=i.lineJoin=t.lineJoin),s.lineWidth!=t.lineWidth&&(s.lineWidth=i.lineWidth=t.lineWidth),s.miterLimit!=t.miterLimit&&(s.miterLimit=i.miterLimit=t.miterLimit),s.strokeStyle!=t.strokeStyle&&(s.strokeStyle=i.strokeStyle=t.strokeStyle)):(i.lineCap=t.lineCap,Ws.CANVAS_LINE_DASH&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineJoin=t.lineJoin,i.lineWidth=t.lineWidth,i.miterLimit=t.miterLimit,i.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},On.prototype.setContextTextState_=function(t){var i=this.context_,s=this.contextTextState_,h=t.textAlign?t.textAlign:kn.defaultTextAlign;s?(s.font!=t.font&&(s.font=i.font=t.font),s.textAlign!=h&&(s.textAlign=h),s.textBaseline!=t.textBaseline&&(s.textBaseline=i.textBaseline=t.textBaseline)):(i.font=t.font,i.textAlign=h,i.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:h,textBaseline:t.textBaseline})},On.prototype.setFillStrokeStyle=function(t,i){if(t){var s=t.getColor();this.fillState_={fillStyle:Pn.asColorLike(s||kn.defaultFillStyle)}}else this.fillState_=null;if(i){var h=i.getColor(),n=i.getLineCap(),r=i.getLineDash(),e=i.getLineDashOffset(),o=i.getLineJoin(),a=i.getWidth(),u=i.getMiterLimit();this.strokeState_={lineCap:void 0!==n?n:kn.defaultLineCap,lineDash:r||kn.defaultLineDash,lineDashOffset:e||kn.defaultLineDashOffset,lineJoin:void 0!==o?o:kn.defaultLineJoin,lineWidth:this.pixelRatio_*(void 0!==a?a:kn.defaultLineWidth),miterLimit:void 0!==u?u:kn.defaultMiterLimit,strokeStyle:Pn.asColorLike(h||kn.defaultStrokeStyle)}}else this.strokeState_=null},On.prototype.setImageStyle=function(t){if(t){var i=t.getAnchor(),s=t.getImage(1),h=t.getOrigin(),n=t.getSize();this.imageAnchorX_=i[0],this.imageAnchorY_=i[1],this.imageHeight_=n[1],this.image_=s,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=h[0],this.imageOriginY_=h[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageSnapToPixel_=t.getSnapToPixel(),this.imageWidth_=n[0]}else this.image_=null},On.prototype.setTextStyle=function(t){if(t){var i=t.getFill();if(i){var s=i.getColor();this.textFillState_={fillStyle:Pn.asColorLike(s||kn.defaultFillStyle)}}else this.textFillState_=null;var h=t.getStroke();if(h){var n=h.getColor(),r=h.getLineCap(),e=h.getLineDash(),o=h.getLineDashOffset(),a=h.getLineJoin(),u=h.getWidth(),f=h.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:kn.defaultLineCap,lineDash:e||kn.defaultLineDash,lineDashOffset:o||kn.defaultLineDashOffset,lineJoin:void 0!==a?a:kn.defaultLineJoin,lineWidth:void 0!==u?u:kn.defaultLineWidth,miterLimit:void 0!==f?f:kn.defaultMiterLimit,strokeStyle:Pn.asColorLike(n||kn.defaultStrokeStyle)}}else this.textStrokeState_=null;var c=t.getFont(),l=t.getOffsetX(),v=t.getOffsetY(),d=t.getRotateWithView(),M=t.getRotation(),m=t.getScale(),p=t.getText(),g=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==c?c:kn.defaultFont,textAlign:void 0!==g?g:kn.defaultTextAlign,textBaseline:void 0!==_?_:kn.defaultTextBaseline},this.text_=void 0!==p?p:"",this.textOffsetX_=void 0!==l?this.pixelRatio_*l:0,this.textOffsetY_=void 0!==v?this.pixelRatio_*v:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==M?M:0,this.textScale_=this.pixelRatio_*(void 0!==m?m:1)}else this.text_=""};var Ln=function(t){ji.call(this),this.layer_=t};di.inherits(Ln,ji),Ln.prototype.forEachFeatureAtCoordinate=di.nullFunction,Ln.prototype.hasFeatureAtCoordinate=as.FALSE,Ln.prototype.createLoadedTileFinder=function(t,i,s){return function(h,n){return t.forEachLoadedTile(i,h,n,(function(t){s[h]||(s[h]={}),s[h][t.tileCoord.toString()]=t}))}},Ln.prototype.getLayer=function(){return this.layer_},Ln.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},Ln.prototype.loadImage=function(t){var i=t.getState();return 2!=i&&3!=i&&Ai.listen(t,Ri,this.handleImageChange_,this),0==i&&(t.load(),i=t.getState()),2==i},Ln.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Oh&&this.changed()},Ln.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var s=function(t,i,s){var h=di.getUid(t).toString();h in s.usedTiles&&t.expireCache(s.viewState.projection,s.usedTiles[h])}.bind(null,i);t.postRenderFunctions.push(s)}},Ln.prototype.updateLogos=function(t,i){var s=i.getLogo();void 0!==s&&("string"==typeof s?t.logos[s]="":s&&(qi("string"==typeof s.href,44),qi("string"==typeof s.src,45),t.logos[s.src]=s.href))},Ln.prototype.updateUsedTiles=function(t,i,s,h){var n=di.getUid(i).toString(),r=s.toString();n in t?r in t[n]?t[n][r].extend(h):t[n][r]=h:(t[n]={},t[n][r]=h)},Ln.prototype.manageTilePyramid=function(t,i,s,h,n,r,e,o,a,u){var f=di.getUid(i).toString();f in t.wantedTiles||(t.wantedTiles[f]={});var c,l,v,d,M,m,p=t.wantedTiles[f],g=t.tileQueue;for(m=s.getMinZoom();m<=e;++m)for(l=s.getTileRangeForExtentAndZ(r,m,l),v=s.getResolution(m),d=l.minX;d<=l.maxX;++d)for(M=l.minY;M<=l.maxY;++M)e-m<=o?(0==(c=i.getTile(m,d,M,h,n)).getState()&&(p[c.getKey()]=!0,g.isKeyQueued(c.getKey())||g.enqueue([c,f,s.getTileCoordCenter(c.tileCoord),v])),void 0!==a&&a.call(u,c)):i.useTile(m,d,M,n)};var In=function(t){Ln.call(this,t),this.transform_=ys.create()};di.inherits(In,Ln),In.prototype.clip=function(t,i,s){var h=i.pixelRatio,n=i.size[0]*h,r=i.size[1]*h,e=i.viewState.rotation,o=rs.getTopLeft(s),a=rs.getTopRight(s),u=rs.getBottomRight(s),f=rs.getBottomLeft(s);ys.apply(i.coordinateToPixelTransform,o),ys.apply(i.coordinateToPixelTransform,a),ys.apply(i.coordinateToPixelTransform,u),ys.apply(i.coordinateToPixelTransform,f),t.save(),kn.rotateAtOffset(t,-e,n/2,r/2),t.beginPath(),t.moveTo(o[0]*h,o[1]*h),t.lineTo(a[0]*h,a[1]*h),t.lineTo(u[0]*h,u[1]*h),t.lineTo(f[0]*h,f[1]*h),t.clip(),kn.rotateAtOffset(t,e,n/2,r/2)},In.prototype.dispatchComposeEvent_=function(t,i,s,h){var n=this.getLayer();if(n.hasListener(t)){var r=s.size[0]*s.pixelRatio,e=s.size[1]*s.pixelRatio,o=s.viewState.rotation;kn.rotateAtOffset(i,-o,r/2,e/2);var a=void 0!==h?h:this.getTransform(s,0),u=new On(i,s.pixelRatio,s.extent,a,s.viewState.rotation),f=new Sn(t,u,s,i,null);n.dispatchEvent(f),kn.rotateAtOffset(i,o,r/2,e/2)}},In.prototype.forEachLayerAtCoordinate=function(t,i,s,h){return this.forEachFeatureAtCoordinate(t,i,0,as.TRUE,this)?s.call(h,this.getLayer(),null):void 0},In.prototype.postCompose=function(t,i,s,h){this.dispatchComposeEvent_(Jh,t,i,h)},In.prototype.preCompose=function(t,i,s){this.dispatchComposeEvent_(Zh,t,i,s)},In.prototype.dispatchRenderEvent=function(t,i,s){this.dispatchComposeEvent_(Kh,t,i,s)},In.prototype.getTransform=function(t,i){var s=t.viewState,h=t.pixelRatio,n=h/s.resolution;return ys.compose(this.transform_,h*t.size[0]/2,h*t.size[1]/2,n,-n,-s.rotation,-s.center[0]+i,-s.center[1])},In.prototype.composeFrame=function(){},In.prototype.prepareFrame=function(){};var Fn=function(t){In.call(this,t),this.coordinateToCanvasPixelTransform=ys.create(),this.hitCanvasContext_=null};di.inherits(Fn,In),Fn.prototype.composeFrame=function(t,i,s){this.preCompose(s,t);var h=this.getImage();if(h){var n=i.extent,r=void 0!==n&&!rs.containsExtent(n,t.extent)&&rs.intersects(n,t.extent);r&&this.clip(s,t,n);var e=this.getImageTransform(),o=s.globalAlpha;s.globalAlpha=i.opacity;var a=e[5],u=h.width*e[0],f=h.height*e[3];s.drawImage(h,0,0,+h.width,+h.height,Math.round(e[4]),Math.round(a),Math.round(u),Math.round(f)),s.globalAlpha=o,r&&s.restore()}this.postCompose(s,t,i)},Fn.prototype.getImage=function(){},Fn.prototype.getImageTransform=function(){},Fn.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var r=this.getLayer();return r.getSource().forEachFeatureAtCoordinate(t,i.viewState.resolution,i.viewState.rotation,s,i.skippedFeatureUids,(function(t){return h.call(n,t,r)}))},Fn.prototype.forEachLayerAtCoordinate=function(t,i,s,h){if(this.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==di.nullFunction)return In.prototype.forEachLayerAtCoordinate.apply(this,arguments);var n=ys.apply(this.coordinateToCanvasPixelTransform,t.slice());wh.scale(n,i.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=xh(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),n[0],n[1],1,1,0,0,1,1);var r=this.hitCanvasContext_.getImageData(0,0,1,1).data;return r[3]>0?s.call(h,this.getLayer(),r):void 0}};var Dn=function(t){Fn.call(this,t),this.image_=null,this.imageTransform_=ys.create(),this.skippedFeatures_=[],this.vectorRenderer_=null};di.inherits(Dn,Fn),Dn.handles=function(t,i){return t===Wh&&(i.getType()===xn||i.getType()===Cn&&"image"===i.getRenderMode())},Dn.create=function(t,i){var s=new Dn(i);if(i.getType()===Cn)for(var h=Dh.getLayerRendererPlugins(),n=0,r=h.length;n<r;++n){var e=h[n];e!==Dn&&e.handles(Wh,i)&&s.setVectorRenderer(e.create(t,i))}return s},Dn.prototype.getImage=function(){return this.image_?this.image_.getImage():null},Dn.prototype.getImageTransform=function(){return this.imageTransform_},Dn.prototype.prepareFrame=function(t,i){var s,h=t.pixelRatio,n=t.size,r=t.viewState,e=r.center,o=r.resolution,a=this.getLayer().getSource(),u=t.viewHints,f=t.extent;if(void 0!==i.extent&&(f=rs.getIntersection(f,i.extent)),!u[0]&&!u[1]&&!rs.isEmpty(f)){var c=r.projection;if(!di.ENABLE_RASTER_REPROJECTION){var l=a.getProjection();l&&(c=l)}var v=this.vectorRenderer_;if(v){var d=v.context,M=Si.assign({},t,{size:[rs.getWidth(f)/o,rs.getHeight(f)/o],viewState:Si.assign({},t.viewState,{rotation:0})}),m=Object.keys(M.skippedFeatureUids).sort();!v.prepareFrame(M,i)||!v.replayGroupChanged&&hs.equals(m,this.skippedFeatures_)||(d.canvas.width=M.size[0]*h,d.canvas.height=M.size[1]*h,v.composeFrame(M,i,d),this.image_=new bn(f,o,h,d.canvas),this.skippedFeatures_=m)}else(s=a.getImage(f,o,h,c))&&this.loadImage(s)&&(this.image_=s)}if(this.image_){var p=(s=this.image_).getExtent(),g=s.getResolution(),_=s.getPixelRatio(),w=h*g/(o*_),y=ys.compose(this.imageTransform_,h*n[0]/2,h*n[1]/2,w,w,0,_*(p[0]-e[0])/g,_*(e[1]-p[3])/g);ys.compose(this.coordinateToCanvasPixelTransform,h*n[0]/2-y[4],h*n[1]/2-y[5],h/o,-h/o,0,-e[0],-e[1]),this.updateLogos(t,a),this.renderedResolution=g*h/_}return!!this.image_},Dn.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,s,h,n):Fn.prototype.forEachFeatureAtCoordinate.call(this,t,i,s,h,n)},Dn.prototype.setVectorRenderer=function(t){this.vectorRenderer_=t};var Wn=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};Wn.getKey=function(t,i,s){return i+":"+t+":"+(s?Rn.asString(s):"null")},Wn.prototype.clear=function(){this.cache_={},this.cacheSize_=0},Wn.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t,i=0;for(t in this.cache_)0!=(3&i++)||this.cache_[t].hasListener()||(delete this.cache_[t],--this.cacheSize_)}},Wn.prototype.get=function(t,i,s){var h=Wn.getKey(t,i,s);return h in this.cache_?this.cache_[h]:null},Wn.prototype.set=function(t,i,s,h){var n=Wn.getKey(t,i,s);this.cache_[n]=h,++this.cacheSize_},Wn.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var Gn={};Gn.iconImageCache=new Wn;var Vn=function(t,i){Ni.call(this),this.map_=i,this.layerRenderers_={},this.layerRendererListeners_={}};di.inherits(Vn,Ni),Vn.prototype.calculateMatrices2D=function(t){var i=t.viewState,s=t.coordinateToPixelTransform,h=t.pixelToCoordinateTransform;ys.compose(s,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]),ys.invert(ys.setFromArray(h,s))},Vn.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},Vn.expireIconCache_=function(){Gn.iconImageCache.expire()},Vn.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,r,e){var o,a=i.viewState,u=a.resolution;function f(t,s){var r=di.getUid(t).toString(),e=i.layerStates[di.getUid(s)].managed;if(!(r in i.skippedFeatureUids)||e)return h.call(n,t,e?s:null)}var c=a.projection,l=t;if(c.canWrapX()){var v=c.getExtent(),d=rs.getWidth(v),M=t[0];(M<v[0]||M>v[2])&&(l=[M+d*Math.ceil((v[0]-M)/d),t[1]])}var m,p=i.layerStatesArray;for(m=p.length-1;m>=0;--m){var g=p[m],_=g.layer;if(Qh.visibleAtResolution(g,u)&&r.call(e,_)){var w=this.getLayerRenderer(_);if(_.getSource()&&(o=w.forEachFeatureAtCoordinate(_.getSource().getWrapX()?l:t,i,s,f,n)),o)return o}}},Vn.prototype.forEachLayerAtPixel=function(){},Vn.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n){return void 0!==this.forEachFeatureAtCoordinate(t,i,s,as.TRUE,this,h,n)},Vn.prototype.getLayerRenderer=function(t){var i=di.getUid(t).toString();if(i in this.layerRenderers_)return this.layerRenderers_[i];for(var s,h=Dh.getLayerRendererPlugins(),n=this.getType(),r=0,e=h.length;r<e;++r){var o=h[r];if(o.handles(n,t)){s=o.create(this,t);break}}if(!s)throw new Error("Unable to create renderer for layer: "+t.getType());return this.layerRenderers_[i]=s,this.layerRendererListeners_[i]=Ai.listen(s,Ri,this.handleLayerRendererChange_,this),s},Vn.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]},Vn.prototype.getLayerRenderers=function(){return this.layerRenderers_},Vn.prototype.getMap=function(){return this.map_},Vn.prototype.getType=function(){},Vn.prototype.handleLayerRendererChange_=function(){this.map_.render()},Vn.prototype.removeLayerRendererByKey_=function(t){var i=this.layerRenderers_[t];return delete this.layerRenderers_[t],Ai.unlistenByKey(this.layerRendererListeners_[t]),delete this.layerRendererListeners_[t],i},Vn.prototype.renderFrame=di.nullFunction,Vn.prototype.removeUnusedLayerRenderers_=function(t,i){var s;for(s in this.layerRenderers_)i&&s in i.layerStates||this.removeLayerRendererByKey_(s).dispose()},Vn.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(Vn.expireIconCache_)},Vn.prototype.scheduleRemoveUnusedLayerRenderers=function(t){var i;for(i in this.layerRenderers_)if(!(i in t.layerStates))return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))},Vn.sortByZIndex=function(t,i){return t.zIndex-i.zIndex};var jn=function(t,i){Vn.call(this,t,i),this.context_=xh(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=Hh.CLASS_UNSELECTABLE,t.insertBefore(this.canvas_,t.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=ys.create()};di.inherits(jn,Vn),jn.handles=function(t){return t===Wh},jn.create=function(t,i){return new jn(t,i)},jn.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap(),h=this.context_;if(s.hasListener(t)){var n=i.extent,r=i.pixelRatio,e=i.viewState.rotation,o=this.getTransform(i),a=new On(h,r,n,o,e),u=new Sn(t,a,i,h,null);s.dispatchEvent(u)}},jn.prototype.getTransform=function(t){var i=t.viewState,s=t.pixelRatio/i.resolution;return ys.compose(this.transform_,this.canvas_.width/2,this.canvas_.height/2,s,-s,-i.rotation,-i.center[0],-i.center[1])},jn.prototype.getType=function(){return Wh},jn.prototype.renderFrame=function(t){if(t){var i=this.context_,s=t.pixelRatio,h=Math.round(t.size[0]*s),n=Math.round(t.size[1]*s);this.canvas_.width!=h||this.canvas_.height!=n?(this.canvas_.width=h,this.canvas_.height=n):i.clearRect(0,0,h,n);var r=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchComposeEvent_(Zh,t);var e=t.layerStatesArray;hs.stableSort(e,Vn.sortByZIndex),r&&(i.save(),kn.rotateAtOffset(i,r,h/2,n/2));var o,a,u,f,c=t.viewState.resolution;for(o=0,a=e.length;o<a;++o)u=this.getLayerRenderer((f=e[o]).layer),Qh.visibleAtResolution(f,c)&&f.sourceState==Oh&&u.prepareFrame(t,f)&&u.composeFrame(t,f,i);r&&i.restore(),this.dispatchComposeEvent_(Jh,t),this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},jn.prototype.forEachLayerAtPixel=function(t,i,s,h,n,r){var e,o,a=i.viewState.resolution,u=i.layerStatesArray,f=u.length,c=ys.apply(i.pixelToCoordinateTransform,t.slice());for(o=f-1;o>=0;--o){var l=u[o],v=l.layer;if(Qh.visibleAtResolution(l,a)&&n.call(r,v)&&(e=this.getLayerRenderer(v).forEachLayerAtCoordinate(c,i,s,h)))return e}};var Un=function(t,i,s,h){this.minX=t,this.maxX=i,this.minY=s,this.maxY=h};Un.createOrUpdate=function(t,i,s,h,n){return void 0!==n?(n.minX=t,n.maxX=i,n.minY=s,n.maxY=h,n):new Un(t,i,s,h)},Un.prototype.contains=function(t){return this.containsXY(t[1],t[2])},Un.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},Un.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY},Un.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},Un.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},Un.prototype.getHeight=function(){return this.maxY-this.minY+1},Un.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},Un.prototype.getWidth=function(){return this.maxX-this.minX+1},Un.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var Xn=function(t){Fn.call(this,t),this.context=null===this.context?null:xh(),this.renderedExtent_=null,this.renderedTiles=[],this.tmpExtent=rs.createEmpty(),this.tmpTileRange_=new Un(0,0,0,0),this.imageTransform_=ys.create(),this.zDirection=0};di.inherits(Xn,Fn),Xn.handles=function(t,i){return t===Wh&&i.getType()===En},Xn.create=function(t,i){return new Xn(i)},Xn.prototype.isDrawableTile_=function(t){var i=t.getState(),s=this.getLayer().getUseInterimTilesOnError();return 2==i||4==i||3==i&&!s},Xn.prototype.prepareFrame=function(t,i){var s=t.pixelRatio,h=t.size,n=t.viewState,r=n.projection,e=n.resolution,o=n.center,a=this.getLayer(),u=a.getSource(),f=u.getRevision(),c=u.getTileGridForProjection(r),l=c.getZForResolution(e,this.zDirection),v=c.getResolution(l),d=Math.round(e/v)||1,M=t.extent;if(void 0!==i.extent&&(M=rs.getIntersection(M,i.extent)),rs.isEmpty(M))return!1;var m=c.getTileRangeForExtentAndZ(M,l),p=c.getTileRangeExtent(l,m),g=u.getTilePixelRatio(s),_={};_[l]={};var w,y,b,x=this.createLoadedTileFinder(u,r,_),E=this.tmpExtent,C=this.tmpTileRange_,S=!1;for(y=m.minX;y<=m.maxX;++y)for(b=m.minY;b<=m.maxY;++b){if(3==(w=u.getTile(l,y,b,s,r)).getState()&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(S=!0):w.setState(2)),this.isDrawableTile_(w)||(w=w.getInterimTile()),this.isDrawableTile_(w)){var A=di.getUid(this);if(2==w.getState()){_[l][w.tileCoord.toString()]=w;var N=w.inTransition(A);S||!N&&-1!==this.renderedTiles.indexOf(w)||(S=!0)}if(1===w.getAlpha(A,t.time))continue}var z=c.getTileCoordChildTileRange(w.tileCoord,C,E),k=!1;z&&(k=x(l+1,z)),k||c.forEachTileCoordParentTileRange(w.tileCoord,x,null,C,E)}var R=v*s/g*d,P=t.viewHints,T=P[0]||P[1];if(!(this.renderedResolution&&Date.now()-t.time>16&&T)&&(S||!this.renderedExtent_||!rs.containsExtent(this.renderedExtent_,M)||this.renderedRevision!=f||d!=this.oversampling_||!T&&R!=this.renderedResolution)){var O=this.context;if(O){var L=u.getTilePixelSize(l,s,r),I=Math.round(m.getWidth()*L[0]/d),F=Math.round(m.getHeight()*L[1]/d),D=O.canvas;D.width!=I||D.height!=F?(this.oversampling_=d,D.width=I,D.height=F):(this.renderedExtent_&&!rs.equals(p,this.renderedExtent_)&&O.clearRect(0,0,I,F),d=this.oversampling_)}this.renderedTiles.length=0;var W,G,V,j,U,X,q,B,Y=Object.keys(_).map(Number);for(Y.sort((function(t,i){return t===l?1:i===l?-1:t>i?1:t<i?-1:0})),j=0,U=Y.length;j<U;++j)for(var H in G=u.getTilePixelSize(V=Y[j],s,r),W=c.getResolution(V)/v,q=g*u.getGutter(r),B=_[V])X=c.getTileCoordExtent((w=B[H]).getTileCoord(),E),this.drawTileImage(w,t,i,y=(X[0]-p[0])/v*g/d,b=(p[3]-X[3])/v*g/d,G[0]*W/d,G[1]*W/d,q,l===V),this.renderedTiles.push(w);this.renderedRevision=f,this.renderedResolution=v*s/g*d,this.renderedExtent_=p}var J=this.renderedResolution/e,Z=ys.compose(this.imageTransform_,s*h[0]/2,s*h[1]/2,J,J,0,(this.renderedExtent_[0]-o[0])/this.renderedResolution*s,(o[1]-this.renderedExtent_[3])/this.renderedResolution*s);return ys.compose(this.coordinateToCanvasPixelTransform,s*h[0]/2-Z[4],s*h[1]/2-Z[5],s/e,-s/e,0,-o[0],-o[1]),this.updateUsedTiles(t.usedTiles,u,l,m),this.manageTilePyramid(t,u,c,s,r,M,l,a.getPreload()),this.scheduleExpireCache(t,u),this.updateLogos(t,u),this.renderedTiles.length>0},Xn.prototype.drawTileImage=function(t,i,s,h,n,r,e,o,a){var u=t.getImage(this.getLayer());if(u){var f=di.getUid(this),c=a?t.getAlpha(f,i.time):1;1!==c||this.getLayer().getSource().getOpaque(i.viewState.projection)||this.context.clearRect(h,n,r,e);var l=c!==this.context.globalAlpha;l&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(u,o,o,u.width-2*o,u.height-2*o,h,n,r,e),l&&this.context.restore(),1!==c?i.animate=!0:a&&t.endTransition(f)}},Xn.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},Xn.prototype.getImageTransform=function(){return this.imageTransform_};var qn=e((function(t){t.exports=function(){function t(s,h,n,r,e){for(;r>n;){if(r-n>600){var o=r-n+1,a=h-n+1,u=Math.log(o),f=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*f*(o-f)/o)*(a-o/2<0?-1:1);t(s,h,Math.max(n,Math.floor(h-a*f/o+c)),Math.min(r,Math.floor(h+(o-a)*f/o+c)),e)}var l=s[h],v=n,d=r;for(i(s,n,h),e(s[r],l)>0&&i(s,n,r);v<d;){for(i(s,v,d),v++,d--;e(s[v],l)<0;)v++;for(;e(s[d],l)>0;)d--}0===e(s[n],l)?i(s,n,d):i(s,++d,r),d<=h&&(n=d+1),h<=d&&(r=d-1)}}function i(t,i,s){var h=t[i];t[i]=t[s],t[s]=h}function s(t,i){return t<i?-1:t>i?1:0}return function(i,h,n,r,e){t(i,h,n||0,r||i.length-1,e||s)}}()})),Bn=Yn;function Yn(t,i){if(!(this instanceof Yn))return new Yn(t,i);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),i&&this._initFormat(i),this.clear()}function Hn(t,i,s){if(!s)return i.indexOf(t);for(var h=0;h<i.length;h++)if(s(t,i[h]))return h;return-1}function Jn(t,i){Zn(t,0,t.children.length,i,t)}function Zn(t,i,s,h,n){n||(n=nr(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var r,e=i;e<s;e++)r=t.children[e],Kn(n,t.leaf?h(r):r);return n}function Kn(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function Qn(t,i){return t.minX-i.minX}function $n(t,i){return t.minY-i.minY}function tr(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ir(t){return t.maxX-t.minX+(t.maxY-t.minY)}function sr(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function hr(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function nr(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function rr(t,i,s,h,n){for(var r,e=[i,s];e.length;)(s=e.pop())-(i=e.pop())<=h||(r=i+Math.ceil((s-i)/h/2)*h,qn(t,r,i,s,n),e.push(i,r,r,s))}Yn.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,s=[],h=this.toBBox;if(!hr(t,i))return s;for(var n,r,e,o,a=[];i;){for(n=0,r=i.children.length;n<r;n++)e=i.children[n],hr(t,o=i.leaf?h(e):e)&&(i.leaf?s.push(e):sr(t,o)?this._all(e,s):a.push(e));i=a.pop()}return s},collides:function(t){var i=this.data,s=this.toBBox;if(!hr(t,i))return!1;for(var h,n,r,e,o=[];i;){for(h=0,n=i.children.length;h<n;h++)if(r=i.children[h],hr(t,e=i.leaf?s(r):r)){if(i.leaf||sr(t,e))return!0;o.push(r)}i=o.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0,s=t.length;i<s;i++)this.insert(t[i]);return this}var h=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===h.height)this._splitRoot(this.data,h);else{if(this.data.height<h.height){var n=this.data;this.data=h,h=n}this._insert(h,this.data.height-h.height-1,!0)}else this.data=h;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=nr([]),this},remove:function(t,i){if(!t)return this;for(var s,h,n,r,e=this.data,o=this.toBBox(t),a=[],u=[];e||a.length;){if(e||(e=a.pop(),h=a[a.length-1],s=u.pop(),r=!0),e.leaf&&-1!==(n=Hn(t,e.children,i)))return e.children.splice(n,1),a.push(e),this._condense(a),this;r||e.leaf||!sr(e,o)?h?(s++,e=h.children[s],r=!1):e=null:(a.push(e),u.push(s),s=0,h=e,e=e.children[0])}return this},toBBox:function(t){return t},compareMinX:Qn,compareMinY:$n,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,i){for(var s=[];t;)t.leaf?i.push.apply(i,t.children):s.push.apply(s,t.children),t=s.pop();return i},_build:function(t,i,s,h){var n,r=s-i+1,e=this._maxEntries;if(r<=e)return Jn(n=nr(t.slice(i,s+1)),this.toBBox),n;h||(h=Math.ceil(Math.log(r)/Math.log(e)),e=Math.ceil(r/Math.pow(e,h-1))),(n=nr([])).leaf=!1,n.height=h;var o,a,u,f,c=Math.ceil(r/e),l=c*Math.ceil(Math.sqrt(e));for(rr(t,i,s,l,this.compareMinX),o=i;o<=s;o+=l)for(rr(t,o,u=Math.min(o+l-1,s),c,this.compareMinY),a=o;a<=u;a+=c)f=Math.min(a+c-1,u),n.children.push(this._build(t,a,f,h-1));return Jn(n,this.toBBox),n},_chooseSubtree:function(t,i,s,h){for(var n,r,e,o,a,u,f,c,l,v;h.push(i),!i.leaf&&h.length-1!==s;){for(f=c=1/0,n=0,r=i.children.length;n<r;n++)a=tr(e=i.children[n]),l=t,v=e,(u=(Math.max(v.maxX,l.maxX)-Math.min(v.minX,l.minX))*(Math.max(v.maxY,l.maxY)-Math.min(v.minY,l.minY))-a)<c?(c=u,f=a<f?a:f,o=e):u===c&&a<f&&(f=a,o=e);i=o||i.children[0]}return i},_insert:function(t,i,s){var h=s?t:(0,this.toBBox)(t),n=[],r=this._chooseSubtree(h,this.data,i,n);for(r.children.push(t),Kn(r,h);i>=0&&n[i].children.length>this._maxEntries;)this._split(n,i),i--;this._adjustParentBBoxes(h,n,i)},_split:function(t,i){var s=t[i],h=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,h);var r=this._chooseSplitIndex(s,n,h),e=nr(s.children.splice(r,s.children.length-r));e.height=s.height,e.leaf=s.leaf,Jn(s,this.toBBox),Jn(e,this.toBBox),i?t[i-1].children.push(e):this._splitRoot(s,e)},_splitRoot:function(t,i){this.data=nr([t,i]),this.data.height=t.height+1,this.data.leaf=!1,Jn(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,s){var h,n,r,e,o,a,u,f,c,l,v,d,M,m;for(a=u=1/0,h=i;h<=s-i;h++)c=n=Zn(t,0,h,this.toBBox),l=r=Zn(t,h,s,this.toBBox),void 0,void 0,void 0,void 0,v=Math.max(c.minX,l.minX),d=Math.max(c.minY,l.minY),M=Math.min(c.maxX,l.maxX),m=Math.min(c.maxY,l.maxY),e=Math.max(0,M-v)*Math.max(0,m-d),o=tr(n)+tr(r),e<a?(a=e,f=h,u=o<u?o:u):e===a&&o<u&&(u=o,f=h);return f},_chooseSplitAxis:function(t,i,s){var h=t.leaf?this.compareMinX:Qn,n=t.leaf?this.compareMinY:$n;this._allDistMargin(t,i,s,h)<this._allDistMargin(t,i,s,n)&&t.children.sort(h)},_allDistMargin:function(t,i,s,h){t.children.sort(h);var n,r,e=this.toBBox,o=Zn(t,0,i,e),a=Zn(t,s-i,s,e),u=ir(o)+ir(a);for(n=i;n<s-i;n++)r=t.children[n],Kn(o,t.leaf?e(r):r),u+=ir(o);for(n=s-i-1;n>=i;n--)r=t.children[n],Kn(a,t.leaf?e(r):r),u+=ir(a);return u},_adjustParentBBoxes:function(t,i,s){for(var h=s;h>=0;h--)Kn(i[h],t)},_condense:function(t){for(var i,s=t.length-1;s>=0;s--)0===t[s].children.length?s>0?(i=t[s-1].children).splice(i.indexOf(t[s]),1):this.clear():Jn(t[s],this.toBBox)},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0])),this.compareMinY=new Function("a","b",i.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var er=function(){};er.prototype.getReplay=function(){},er.prototype.isEmpty=function(){};var or="Circle",ar="Default",ur="Image",fr="LineString",cr="Polygon",lr="Text",vr={lineString:function(t,i,s,h){var n,r=t[i],e=t[i+1],o=0;for(n=i+h;n<s;n+=h){var a=t[n],u=t[n+1];o+=Math.sqrt((a-r)*(a-r)+(u-e)*(u-e)),r=a,e=u}return o},linearRing:function(t,i,s,h){var n=vr.lineString(t,i,s,h),r=t[s-h]-t[i],e=t[s-h+1]-t[i+1];return n+Math.sqrt(r*r+e*e)}},dr=function(t,i,s,h,n,r,e,o){for(var a,u,f=[],c=t[i]>t[s-h],l=n.length,v=t[i],d=t[i+1],M=t[i+=h],m=t[i+1],p=0,g=Math.sqrt(Math.pow(M-v,2)+Math.pow(m-d,2)),_="",w=0,y=0;y<l;++y){var b=n.charAt(c?l-y-1:y),x=r(_=c?b+_:_+b)-w;w+=x;for(var E=e+x/2;i<s-h&&p+g<E;)v=M,d=m,M=t[i+=h],m=t[i+1],p+=g,g=Math.sqrt(Math.pow(M-v,2)+Math.pow(m-d,2));var C=E-p,S=Math.atan2(m-d,M-v);if(c&&(S+=S>0?-Math.PI:Math.PI),void 0!==u){var A=S-u;if(A+=A>Math.PI?-2*Math.PI:A<-Math.PI?2*Math.PI:0,Math.abs(A)>o)return null}var N=C/g,z=Bi.lerp(v,M,N),k=Bi.lerp(d,m,N);u==S?(c&&(a[0]=z,a[1]=k,a[2]=x/2),a[4]=_):(w=x,a=[z,k,x/2,S,_=b],c?f.unshift(a):f.push(a),u=S),e+=x}return f},Mr=11,mr=12,pr={};pr.ORDER=[cr,or,fr,ur,lr,ar],pr.TEXT_ALIGN={},pr.TEXT_ALIGN.left=0,pr.TEXT_ALIGN.end=0,pr.TEXT_ALIGN.center=.5,pr.TEXT_ALIGN.right=1,pr.TEXT_ALIGN.start=1,pr.TEXT_ALIGN.top=0,pr.TEXT_ALIGN.middle=.5,pr.TEXT_ALIGN.hanging=.2,pr.TEXT_ALIGN.alphabetic=.8,pr.TEXT_ALIGN.ideographic=.8,pr.TEXT_ALIGN.bottom=1;var gr=function(t,i,s,h,n,r){Tn.call(this),this.declutterTree=r,this.tmpExtent_=rs.createEmpty(),this.tolerance=t,this.maxExtent=i,this.overlaps=n,this.pixelRatio=h,this.maxLineWidth=0,this.resolution=s,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=ys.create(),this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0,this.tmpLocalTransform_=ys.create(),this.resetTransform_=ys.create()};di.inherits(gr,Tn),gr.prototype.replayTextBackground_=function(t,i,s,h,n,r,e){t.beginPath(),t.moveTo.apply(t,i),t.lineTo.apply(t,s),t.lineTo.apply(t,h),t.lineTo.apply(t,n),t.lineTo.apply(t,i),r&&(this.fillOrigin_=r[2],this.fill_(t)),e&&(this.setStrokeStyle_(t,e),t.stroke())},gr.prototype.replayImage_=function(t,i,s,h,n,r,e,o,a,u,f,c,l,v,d,M,m,p){var g=m||p,_=this.tmpLocalTransform_;i-=n*=l,s-=r*=l,v&&(i=Math.round(i),s=Math.round(s));var w,y,b,x,E=d+u>h.width?h.width-u:d,C=o+f>h.height?h.height-f:o,S=this.tmpExtent_,A=M[3]+E*l+M[1],N=M[0]+C*l+M[2],z=i-M[3],k=s-M[0];(g||0!==c)&&(w=[z,k],y=[z+A,k],b=[z+A,k+N],x=[z,k+N]);var R=null;if(0!==c){var P=i+n,T=s+r;R=ys.compose(_,P,T,1,1,c,-P,-T),rs.createOrUpdateEmpty(S),rs.extendCoordinate(S,ys.apply(_,w)),rs.extendCoordinate(S,ys.apply(_,y)),rs.extendCoordinate(S,ys.apply(_,b)),rs.extendCoordinate(S,ys.apply(_,x))}else rs.createOrUpdate(z,k,z+A,k+N,S);var O=t.canvas,L=S[0]<=O.width&&S[2]>=0&&S[1]<=O.height&&S[3]>=0;if(e){if(!L&&1==e[4])return;rs.extend(e,S);var I=L?[t,R?R.slice(0):null,a,h,u,f,E,C,i,s,l]:null;I&&g&&I.push(m,p,w,y,b,x),e.push(I)}else L&&(g&&this.replayTextBackground_(t,w,y,b,x,m,p),kn.drawImage(t,R,a,h,u,f,E,C,i,s,l))},gr.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return 1==i?t:t.map((function(t){return t*i}))},gr.prototype.appendFlatCoordinates=function(t,i,s,h,n,r){var e=this.coordinates.length,o=this.getBufferedMaxExtent();r&&(i+=h);var a,u,f,c=[t[i],t[i+1]],l=[NaN,NaN],v=!0;for(a=i+h;a<s;a+=h)l[0]=t[a],l[1]=t[a+1],(f=rs.coordinateRelationship(o,l))!==u?(v&&(this.coordinates[e++]=c[0],this.coordinates[e++]=c[1]),this.coordinates[e++]=l[0],this.coordinates[e++]=l[1],v=!1):1===f?(this.coordinates[e++]=l[0],this.coordinates[e++]=l[1],v=!1):v=!0,c[0]=l[0],c[1]=l[1],u=f;return(n&&v||a===i+h)&&(this.coordinates[e++]=c[0],this.coordinates[e++]=c[1]),e},gr.prototype.drawCustomCoordinates_=function(t,i,s,h,n){for(var r=0,e=s.length;r<e;++r){var o=s[r],a=this.appendFlatCoordinates(t,i,o,h,!1,!1);n.push(a),i=o}return i},gr.prototype.drawCustom=function(t,i,s){this.beginGeometry(t,i);var h,n,r,e,o,a=t.getType(),u=t.getStride(),f=this.coordinates.length;if(a==$i){h=t.getOrientedFlatCoordinates(),e=[];var c=t.getEndss();o=0;for(var l=0,v=c.length;l<v;++l){var d=[];o=this.drawCustomCoordinates_(h,o,c[l],u,d),e.push(d)}this.instructions.push([4,f,e,t,s,As.coordinatesss])}else a==Zi||a==Qi?(r=[],h=a==Zi?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),o=this.drawCustomCoordinates_(h,0,t.getEnds(),u,r),this.instructions.push([4,f,r,t,s,As.coordinatess])):a==Hi||a==Ki?(h=t.getFlatCoordinates(),n=this.appendFlatCoordinates(h,0,h.length,u,!1,!1),this.instructions.push([4,f,n,t,s,As.coordinates])):a==Yi&&(h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),this.instructions.push([4,f,n=this.coordinates.length,t,s]));this.endGeometry(t,i)},gr.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[0,i,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[0,i,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},gr.prototype.fill_=function(t){if(this.fillOrigin_){var i=ys.apply(this.renderedTransform_,this.fillOrigin_.slice());t.translate(i[0],i[1]),t.rotate(this.viewRotation_)}t.fill(),this.fillOrigin_&&t.setTransform.apply(t,kn.resetTransform_)},gr.prototype.setStrokeStyle_=function(t,i){t.strokeStyle=i[1],t.lineWidth=i[2],t.lineCap=i[3],t.lineJoin=i[4],t.miterLimit=i[5],Ws.CANVAS_LINE_DASH&&(t.lineDashOffset=i[7],t.setLineDash(i[6]))},gr.prototype.renderDeclutter_=function(t,i){if(t&&t.length>5){var s=t[4];if(1==s||s==t.length-5){var h={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};if(!this.declutterTree.collides(h)){this.declutterTree.insert(h);for(var n=kn.drawImage,r=5,e=t.length;r<e;++r){var o=t[r];o&&(o.length>11&&this.replayTextBackground_(o[0],o[13],o[14],o[15],o[16],o[11],o[12]),n.apply(void 0,o))}}t.length=5,rs.createOrUpdateEmpty(t)}}},gr.prototype.replay_=function(t,i,s,h,n,r){var e;this.pixelCoordinates_&&hs.equals(i,this.renderedTransform_)?e=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),e=us(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),ys.setFromArray(this.renderedTransform_,i));for(var o,a,u,f,c,l,v,d,M,m=!Si.isEmpty(s),p=0,g=h.length,_=0,w=0,y=0,b=null,x=null,E=this.coordinateCache_,C=this.viewRotation_,S={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:C},A=this.instructions!=h||this.overlaps?0:200;p<g;){var N,z,k,R=h[p];switch(R[0]){case 0:N=R[1],m&&s[di.getUid(N).toString()]||!N.getGeometry()?p=R[2]:void 0===r||rs.intersects(r,N.getGeometry().getExtent())?++p:p=R[2]+1;break;case 1:w>A&&(this.fill_(t),w=0),y>A&&(t.stroke(),y=0),w||y||(t.beginPath(),f=c=NaN),++p;break;case 2:var P=e[_=R[1]],T=e[_+1],O=e[_+2]-P,L=e[_+3]-T,I=Math.sqrt(O*O+L*L);t.moveTo(P+I,T),t.arc(P,T,I,0,2*Math.PI,!0),++p;break;case 3:t.closePath(),++p;break;case 4:_=R[1],o=R[2];var F=R[4],D=6==R.length?R[5]:void 0;S.geometry=R[3],S.feature=N,p in E||(E[p]=[]);var W=E[p];D?D(e,_,o,2,W):(W[0]=e[_],W[1]=e[_+1],W.length=2),F(W,S),++p;break;case 6:_=R[1],o=R[2],M=R[3],a=R[4],u=R[5],d=n?null:R[6];var G,V,j,U=R[7],X=R[8],q=R[9],B=R[10],Y=R[12],H=R[13],J=R[14],Z=R[15];for(R.length>16?(G=R[16],V=R[17],j=R[18]):(G=kn.defaultPadding,V=j=!1),R[11]&&(Y+=C);_<o;_+=2)this.replayImage_(t,e[_],e[_+1],M,a,u,d,U,X,q,B,Y,H,J,Z,G,V?b:null,j?x:null);this.renderDeclutter_(d,N),++p;break;case 5:var K=R[1],Q=R[2],$=R[3];d=n?null:R[4];var tt=R[5],it=R[6],st=R[7],ht=R[8],nt=R[9],rt=R[10],et=R[11],ot=R[12],at=R[13],ut=R[14],ft=vr.lineString(e,K,Q,2),ct=ht(ot);if(tt||ct<=ft){var lt=dr(e,K,Q,2,ot,ht,(ft-ct)*pr.TEXT_ALIGN[this.textStates[at].textAlign],st);if(lt){var vt,dt,Mt,mt;if(rt)for(vt=0,dt=lt.length;vt<dt;++vt)Mt=this.getImage((mt=lt[vt])[4],at,"",rt),this.replayImage_(t,mt[0],mt[1],Mt,a=mt[2]+et,u=$*Mt.height+2*(.5-$)*et-nt,d,Mt.height,1,0,0,mt[3],ut,!1,Mt.width,kn.defaultPadding,null,null);if(it)for(vt=0,dt=lt.length;vt<dt;++vt)Mt=this.getImage((mt=lt[vt])[4],at,it,""),this.replayImage_(t,mt[0],mt[1],Mt,a=mt[2],u=$*Mt.height-nt,d,Mt.height,1,0,0,mt[3],ut,!1,Mt.width,kn.defaultPadding,null,null)}}this.renderDeclutter_(d,N),++p;break;case 7:if(void 0!==n){var pt=n(N=R[1]);if(pt)return pt}++p;break;case 8:A?w++:this.fill_(t),++p;break;case 9:for(o=R[2],v=(k=e[(_=R[1])+1])+.5|0,(l=(z=e[_])+.5|0)===f&&v===c||(t.moveTo(z,k),f=l,c=v),_+=2;_<o;_+=2)l=(z=e[_])+.5|0,v=(k=e[_+1])+.5|0,_!=o-2&&l===f&&v===c||(t.lineTo(z,k),f=l,c=v);++p;break;case 10:b=R,this.fillOrigin_=R[2],w&&(this.fill_(t),w=0,y&&(t.stroke(),y=0)),t.fillStyle=R[1],++p;break;case Mr:x=R,y&&(t.stroke(),y=0),this.setStrokeStyle_(t,R),++p;break;case mr:A?y++:t.stroke(),++p;break;default:++p}}w&&this.fill_(t),y&&t.stroke()},gr.prototype.replay=function(t,i,s,h){this.viewRotation_=s,this.replay_(t,i,h,this.instructions,void 0,void 0)},gr.prototype.replayHitDetection=function(t,i,s,h,n,r){return this.viewRotation_=s,this.replay_(t,i,h,this.hitDetectionInstructions,n,r)},gr.prototype.reverseHitDetectionInstructions=function(){var t,i=this.hitDetectionInstructions;i.reverse();var s,h,n=i.length,r=-1;for(t=0;t<n;++t)7==(h=(s=i[t])[0])?r=t:0==h&&(s[2]=t,hs.reverseSubArray(this.hitDetectionInstructions,r,t),r=-1)},gr.prototype.setFillStrokeStyle=function(t,i){var s=this.state;if(t){var h=t.getColor();s.fillStyle=Pn.asColorLike(h||kn.defaultFillStyle)}else s.fillStyle=void 0;if(i){var n=i.getColor();s.strokeStyle=Pn.asColorLike(n||kn.defaultStrokeStyle);var r=i.getLineCap();s.lineCap=void 0!==r?r:kn.defaultLineCap;var e=i.getLineDash();s.lineDash=e?e.slice():kn.defaultLineDash;var o=i.getLineDashOffset();s.lineDashOffset=o||kn.defaultLineDashOffset;var a=i.getLineJoin();s.lineJoin=void 0!==a?a:kn.defaultLineJoin;var u=i.getWidth();s.lineWidth=void 0!==u?u:kn.defaultLineWidth;var f=i.getMiterLimit();s.miterLimit=void 0!==f?f:kn.defaultMiterLimit,s.lineWidth>this.maxLineWidth&&(this.maxLineWidth=s.lineWidth,this.bufferedMaxExtent_=null)}else s.strokeStyle=void 0,s.lineCap=void 0,s.lineDash=null,s.lineDashOffset=void 0,s.lineJoin=void 0,s.lineWidth=void 0,s.miterLimit=void 0},gr.prototype.applyFill=function(t,i){var s=t.fillStyle,h=[10,s];if("string"!=typeof s){var n=i.getExtent();h.push([n[0],n[3]])}this.instructions.push(h)},gr.prototype.applyStroke=function(t){this.instructions.push([Mr,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])},gr.prototype.updateFillStyle=function(t,i,s){var h=t.fillStyle;"string"==typeof h&&t.currentFillStyle==h||(i.call(this,t,s),t.currentFillStyle=h)},gr.prototype.updateStrokeStyle=function(t,i){var s=t.strokeStyle,h=t.lineCap,n=t.lineDash,r=t.lineDashOffset,e=t.lineJoin,o=t.lineWidth,a=t.miterLimit;(t.currentStrokeStyle!=s||t.currentLineCap!=h||n!=t.currentLineDash&&!hs.equals(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=e||t.currentLineWidth!=o||t.currentMiterLimit!=a)&&(i.call(this,t),t.currentStrokeStyle=s,t.currentLineCap=h,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=e,t.currentLineWidth=o,t.currentMiterLimit=a)},gr.prototype.endGeometry=function(t,i){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var s=[7,i];this.instructions.push(s),this.hitDetectionInstructions.push(s)},gr.prototype.finish=di.nullFunction,gr.prototype.getBufferedMaxExtent=function(){return this.bufferedMaxExtent_||(this.bufferedMaxExtent_=rs.clone(this.maxExtent),this.maxLineWidth>0&&rs.buffer(this.bufferedMaxExtent_,this.resolution*(this.maxLineWidth+1)/2,this.bufferedMaxExtent_)),this.bufferedMaxExtent_};var _r=function(t,i,s,h,n,r){gr.call(this,t,i,s,h,n,r),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.snapToPixel_=void 0,this.width_=void 0};di.inherits(_r,gr),_r.prototype.drawCoordinates_=function(t,i,s,h){return this.appendFlatCoordinates(t,i,s,h,!1,!1)},_r.prototype.drawPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var s=t.getFlatCoordinates(),h=t.getStride(),n=this.coordinates.length,r=this.drawCoordinates_(s,0,s.length,h);this.instructions.push([6,n,r,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([6,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,i)}},_r.prototype.drawMultiPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var s=t.getFlatCoordinates(),h=t.getStride(),n=this.coordinates.length,r=this.drawCoordinates_(s,0,s.length,h);this.instructions.push([6,n,r,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([6,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,i)}},_r.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.snapToPixel_=void 0,this.width_=void 0},_r.prototype.setImageStyle=function(t,i){var s=t.getAnchor(),h=t.getSize(),n=t.getHitDetectionImage(1),r=t.getImage(1),e=t.getOrigin();this.anchorX_=s[0],this.anchorY_=s[1],this.declutterGroup_=i,this.hitDetectionImage_=n,this.image_=r,this.height_=h[1],this.opacity_=t.getOpacity(),this.originX_=e[0],this.originY_=e[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.snapToPixel_=t.getSnapToPixel(),this.width_=h[0]};var wr=function(t,i,s,h,n,r){gr.call(this,t,i,s,h,n,r)};di.inherits(wr,gr),wr.prototype.drawFlatCoordinates_=function(t,i,s,h){var n=[9,this.coordinates.length,this.appendFlatCoordinates(t,i,s,h,!1,!1)];return this.instructions.push(n),this.hitDetectionInstructions.push(n),s},wr.prototype.drawLineString=function(t,i){var s=this.state;if(void 0!==s.strokeStyle&&void 0!==s.lineWidth){this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[1]);var h=t.getFlatCoordinates(),n=t.getStride();this.drawFlatCoordinates_(h,0,h.length,n),this.hitDetectionInstructions.push([mr]),this.endGeometry(t,i)}},wr.prototype.drawMultiLineString=function(t,i){var s=this.state;if(void 0!==s.strokeStyle&&void 0!==s.lineWidth){this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[1]);var h,n,r=t.getEnds(),e=t.getFlatCoordinates(),o=t.getStride(),a=0;for(h=0,n=r.length;h<n;++h)a=this.drawFlatCoordinates_(e,a,r[h],o);this.hitDetectionInstructions.push([mr]),this.endGeometry(t,i)}},wr.prototype.finish=function(){var t=this.state;null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push([mr]),this.reverseHitDetectionInstructions(),this.state=null},wr.prototype.applyStroke=function(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push([mr]),t.lastStroke=this.coordinates.length),t.lastStroke=0,gr.prototype.applyStroke.call(this,t),this.instructions.push([1])};var yr=function(t,i,s,h,n,r){gr.call(this,t,i,s,h,n,r)};di.inherits(yr,gr),yr.prototype.drawFlatCoordinatess_=function(t,i,s,h){var n=this.state,r=void 0!==n.fillStyle,e=null!=n.strokeStyle,o=s.length,a=[1];this.instructions.push(a),this.hitDetectionInstructions.push(a);for(var u=0;u<o;++u){var f=s[u],c=[9,this.coordinates.length,this.appendFlatCoordinates(t,i,f,h,!0,!e)];if(this.instructions.push(c),this.hitDetectionInstructions.push(c),e){var l=[3];this.instructions.push(l),this.hitDetectionInstructions.push(l)}i=f}var v=[8];if(this.hitDetectionInstructions.push(v),r&&this.instructions.push(v),e){var d=[mr];this.instructions.push(d),this.hitDetectionInstructions.push(d)}return i},yr.prototype.drawCircle=function(t,i){var s=this.state;if(void 0!==s.fillStyle||void 0!==s.strokeStyle){this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Rn.asString(kn.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length;this.appendFlatCoordinates(h,0,h.length,n,!1,!1);var e=[1],o=[2,r];this.instructions.push(e,o),this.hitDetectionInstructions.push(e,o);var a=[8];if(this.hitDetectionInstructions.push(a),void 0!==s.fillStyle&&this.instructions.push(a),void 0!==s.strokeStyle){var u=[mr];this.instructions.push(u),this.hitDetectionInstructions.push(u)}this.endGeometry(t,i)}},yr.prototype.drawPolygon=function(t,i){var s=this.state;this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Rn.asString(kn.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h=t.getEnds(),n=t.getOrientedFlatCoordinates(),r=t.getStride();this.drawFlatCoordinatess_(n,0,h,r),this.endGeometry(t,i)},yr.prototype.drawMultiPolygon=function(t,i){var s=this.state;if(void 0!==s.fillStyle||void 0!==s.strokeStyle){this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Rn.asString(kn.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h,n,r=t.getEndss(),e=t.getOrientedFlatCoordinates(),o=t.getStride(),a=0;for(h=0,n=r.length;h<n;++h)a=this.drawFlatCoordinatess_(e,a,r[h],o);this.endGeometry(t,i)}},yr.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(0!==t){var i,s,h=this.coordinates;for(i=0,s=h.length;i<s;++i)h[i]=Ns.snap(h[i],t)}},yr.prototype.setFillStrokeStyles_=function(t){var i=this.state;void 0!==i.fillStyle&&this.updateFillStyle(i,this.applyFill,t),void 0!==i.strokeStyle&&this.updateStrokeStyle(i,this.applyStroke)};var br=function(t,i,s,h,n){var r,e,o,a,u,f,c,l,v,d=s,M=s,m=0,p=0,g=s;for(r=s;r<h;r+=n){var _=i[r],w=i[r+1];void 0!==a&&(l=_-a,v=w-u,o=Math.sqrt(l*l+v*v),void 0!==f&&(p+=e,Math.acos((f*l+c*v)/(e*o))>t&&(p>m&&(m=p,d=g,M=r),p=0,g=r-n)),e=o,f=l,c=v),a=_,u=w}return(p+=o)>m?[g,r]:[d,M]},xr=function(t,i,s,h,n,r){gr.call(this,t,i,s,h,n,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},kn.labelCache.prune()};di.inherits(xr,gr),xr.measureTextWidths=function(t,i,s){var h,n,r=i.length,e=0;for(n=0;n<r;++n)h=kn.measureTextWidth(t,i[n]),e=Math.max(e,h),s.push(h);return e},xr.prototype.drawText=function(t,i){var s=this.textState_;if(""!==this.text_&&s&&(this.textFillState_||this.textStrokeState_)){var h,n,r=this.coordinates.length,e=t.getType(),o=null,a=2,u=2;if("line"===s.placement){if(!rs.intersects(this.getBufferedMaxExtent(),t.getExtent()))return;var f;if(o=t.getFlatCoordinates(),u=t.getStride(),e==Hi)f=[o.length];else if(e==Qi)f=t.getEnds();else if(e==Zi)f=t.getEnds().slice(0,1);else if(e==$i){var c=t.getEndss();for(f=[],h=0,n=c.length;h<n;++h)f.push(c[h][0])}this.beginGeometry(t,i);for(var l,v=s.textAlign,d=0,M=0,m=f.length;M<m;++M){if(null==v){var p=br(s.maxAngle,o,d,f[M],u);d=p[0],l=p[1]}else l=f[M];for(h=d;h<l;h+=u)this.coordinates.push(o[h],o[h+1]);d=f[M],this.drawChars_(r,a=this.coordinates.length,this.declutterGroup_),r=a}this.endGeometry(t,i)}else{var g=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),_=g.width/this.pixelRatio;switch(e){case Yi:case Ki:a=(o=t.getFlatCoordinates()).length;break;case Hi:o=t.getFlatMidpoint();break;case is:o=t.getCenter();break;case Qi:a=(o=t.getFlatMidpoints()).length;break;case Zi:if(o=t.getFlatInteriorPoint(),!s.overflow&&o[2]/this.resolution<_)return;u=3;break;case $i:var w=t.getFlatInteriorPoints();for(o=[],h=0,n=w.length;h<n;h+=3)(s.overflow||w[h+2]/this.resolution>=_)&&o.push(w[h],w[h+1]);if(0==(a=o.length))return}a=this.appendFlatCoordinates(o,0,a,u,!1,!1),this.beginGeometry(t,i),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),this.updateFillStyle(this.state,this.applyFill,t),this.updateStrokeStyle(this.state,this.applyStroke)),this.drawTextImage_(g,r,a),this.endGeometry(t,i)}}},xr.prototype.getImage=function(t,i,s,h){var n,r=h+i+t+s+this.pixelRatio,e=kn.labelCache;if(!e.containsKey(r)){var o=h?this.strokeStates[h]||this.textStrokeState_:null,a=s?this.fillStates[s]||this.textFillState_:null,u=this.textStates[i]||this.textState_,f=u.scale*this.pixelRatio,c=pr.TEXT_ALIGN[u.textAlign||kn.defaultTextAlign],l=h&&o.lineWidth?o.lineWidth:0,v=t.split("\n"),d=v.length,M=[],m=xr.measureTextWidths(u.font,v,M),p=kn.measureTextHeight(u.font),g=p*d,_=xh(Math.ceil((m+l)*f),Math.ceil((g+l)*f));e.set(r,n=_.canvas),1!=f&&_.scale(f,f),_.font=u.font,h&&(_.strokeStyle=o.strokeStyle,_.lineWidth=l*(Ws.SAFARI?f:1),_.lineCap=o.lineCap,_.lineJoin=o.lineJoin,_.miterLimit=o.miterLimit,Ws.CANVAS_LINE_DASH&&o.lineDash.length&&(_.setLineDash(o.lineDash),_.lineDashOffset=o.lineDashOffset)),s&&(_.fillStyle=a.fillStyle),_.textBaseline="middle",_.textAlign="center";var w,y=.5-c,b=c*n.width/f+y*l;if(h)for(w=0;w<d;++w)_.strokeText(v[w],b+y*M[w],.5*(l+p)+w*p);if(s)for(w=0;w<d;++w)_.fillText(v[w],b+y*M[w],.5*(l+p)+w*p)}return e.get(r)},xr.prototype.drawTextImage_=function(t,i,s){var h=this.textState_,n=this.textStrokeState_,r=this.pixelRatio,e=pr.TEXT_ALIGN[h.textAlign||kn.defaultTextAlign],o=pr.TEXT_ALIGN[h.textBaseline],a=n&&n.lineWidth?n.lineWidth:0,u=e*t.width/r+2*(.5-e)*a,f=o*t.height/r+2*(.5-o)*a;this.instructions.push([6,i,s,t,(u-this.textOffsetX_)*r,(f-this.textOffsetY_)*r,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,!0,t.width,h.padding==kn.defaultPadding?kn.defaultPadding:h.padding.map((function(t){return t*r})),!!h.backgroundFill,!!h.backgroundStroke]),this.hitDetectionInstructions.push([6,i,s,t,(u-this.textOffsetX_)*r,(f-this.textOffsetY_)*r,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/r,!0,t.width,h.padding,!!h.backgroundFill,!!h.backgroundStroke])},xr.prototype.drawChars_=function(t,i,s){var h=this.textStrokeState_,n=this.textState_,r=this.textFillState_,e=this.strokeKey_;h&&(e in this.strokeStates||(this.strokeStates[e]={strokeStyle:h.strokeStyle,lineCap:h.lineCap,lineDashOffset:h.lineDashOffset,lineWidth:h.lineWidth,lineJoin:h.lineJoin,miterLimit:h.miterLimit,lineDash:h.lineDash}));var o=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||kn.defaultTextAlign,scale:n.scale});var a=this.fillKey_;r&&(a in this.fillStates||(this.fillStates[a]={fillStyle:r.fillStyle}));var u=this.pixelRatio,f=pr.TEXT_ALIGN[n.textBaseline],c=this.textOffsetY_*u,l=this.text_,v=n.font,d=n.scale,M=h?h.lineWidth*d/2:0,m=this.widths_[v];m||(this.widths_[v]=m={}),this.instructions.push([5,t,i,f,s,n.overflow,a,n.maxAngle,function(t){var i=m[t];return i||(i=m[t]=kn.measureTextWidth(v,t)),i*d*u},c,e,M*u,l,o,1]),this.hitDetectionInstructions.push([5,t,i,f,s,n.overflow,a,n.maxAngle,function(t){var i=m[t];return i||(i=m[t]=kn.measureTextWidth(v,t)),i*d},c,e,M,l,o,1/u])},xr.prototype.setTextStyle=function(t,i){var s,h,n;if(t){this.declutterGroup_=i;var r=t.getFill();r?((h=this.textFillState_)||(h=this.textFillState_={}),h.fillStyle=Pn.asColorLike(r.getColor()||kn.defaultFillStyle)):h=this.textFillState_=null;var e=t.getStroke();if(e){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var o=e.getLineDash(),a=e.getLineDashOffset(),u=e.getWidth(),f=e.getMiterLimit();n.lineCap=e.getLineCap()||kn.defaultLineCap,n.lineDash=o?o.slice():kn.defaultLineDash,n.lineDashOffset=void 0===a?kn.defaultLineDashOffset:a,n.lineJoin=e.getLineJoin()||kn.defaultLineJoin,n.lineWidth=void 0===u?kn.defaultLineWidth:u,n.miterLimit=void 0===f?kn.defaultMiterLimit:f,n.strokeStyle=Pn.asColorLike(e.getColor()||kn.defaultStrokeStyle)}else n=this.textStrokeState_=null;s=this.textState_;var c=t.getFont()||kn.defaultFont;kn.checkFont(c);var l=t.getScale();s.overflow=t.getOverflow(),s.font=c,s.maxAngle=t.getMaxAngle(),s.placement=t.getPlacement(),s.textAlign=t.getTextAlign(),s.textBaseline=t.getTextBaseline()||kn.defaultTextBaseline,s.backgroundFill=t.getBackgroundFill(),s.backgroundStroke=t.getBackgroundStroke(),s.padding=t.getPadding()||kn.defaultPadding,s.scale=void 0===l?1:l;var v=t.getOffsetX(),d=t.getOffsetY(),M=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===v?0:v,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==M&&M,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:di.getUid(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=s.font+s.scale+(s.textAlign||"?"),this.fillKey_=h?"string"==typeof h.fillStyle?h.fillStyle:"|"+di.getUid(h.fillStyle):""}else this.text_=""};var Er=function(t,i,s,h,n,r,e){er.call(this),this.declutterTree_=r,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=n,this.pixelRatio_=h,this.resolution_=s,this.renderBuffer_=e,this.replaysByZIndex_={},this.hitDetectionContext_=xh(1,1),this.hitDetectionTransform_=ys.create()};di.inherits(Er,er),Er.circleArrayCache_={0:[[!0]]},Er.fillCircleArrayRowToMiddle_=function(t,i,s){var h,n=Math.floor(t.length/2);if(i>=n)for(h=n;h<i;h++)t[h][s]=!0;else if(i<n)for(h=i+1;h<n;h++)t[h][s]=!0},Er.getCircleArray_=function(t){if(void 0!==Er.circleArrayCache_[t])return Er.circleArrayCache_[t];for(var i=2*t+1,s=new Array(i),h=0;h<i;h++)s[h]=new Array(i);for(var n=t,r=0,e=0;n>=r;)Er.fillCircleArrayRowToMiddle_(s,t+n,t+r),Er.fillCircleArrayRowToMiddle_(s,t+r,t+n),Er.fillCircleArrayRowToMiddle_(s,t-r,t+n),Er.fillCircleArrayRowToMiddle_(s,t-n,t+r),Er.fillCircleArrayRowToMiddle_(s,t-n,t-r),Er.fillCircleArrayRowToMiddle_(s,t-r,t-n),Er.fillCircleArrayRowToMiddle_(s,t+r,t-n),Er.fillCircleArrayRowToMiddle_(s,t+n,t-r),2*((e+=1+2*++r)-n)+1>0&&(e+=1-2*(n-=1));return Er.circleArrayCache_[t]=s,s},Er.replayDeclutter=function(t,i,s){for(var h=Object.keys(t).map(Number).sort(hs.numberSafeCompareFunction),n={},r=0,e=h.length;r<e;++r)for(var o=t[h[r].toString()],a=0,u=o.length;a<u;){var f=o[a++],c=o[a++];f.replay(i,c,s,n)}},Er.prototype.addDeclutter=function(t){var i=null;return this.declutterTree_&&(t?(i=this.declutterGroup_)[4]++:(i=this.declutterGroup_=rs.createEmpty()).push(1)),i},Er.prototype.clip=function(t,i){var s=this.getClipCoords(i);t.beginPath(),t.moveTo(s[0],s[1]),t.lineTo(s[2],s[3]),t.lineTo(s[4],s[5]),t.lineTo(s[6],s[7]),t.clip()},Er.prototype.hasReplays=function(t){for(var i in this.replaysByZIndex_)for(var s=this.replaysByZIndex_[i],h=0,n=t.length;h<n;++h)if(t[h]in s)return!0;return!1},Er.prototype.finish=function(){var t;for(t in this.replaysByZIndex_){var i,s=this.replaysByZIndex_[t];for(i in s)s[i].finish()}},Er.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,r,e){var o,a=2*(h=Math.round(h))+1,u=ys.compose(this.hitDetectionTransform_,h+.5,h+.5,1/i,-1/i,-s,-t[0],-t[1]),f=this.hitDetectionContext_;f.canvas.width!==a||f.canvas.height!==a?(f.canvas.width=a,f.canvas.height=a):f.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(o=rs.createEmpty(),rs.extendCoordinate(o,t),rs.buffer(o,i*(this.renderBuffer_+h),o));var c,l,v=Er.getCircleArray_(h);function d(t){for(var i=f.getImageData(0,0,a,a).data,s=0;s<a;s++)for(var h=0;h<a;h++){var n;if(v[s][h]&&i[4*(h*a+s)+3]>0)return(!c||l!=ur&&l!=lr||-1!==c.indexOf(t))&&(n=r(t)),n||void f.clearRect(0,0,a,a)}}this.declutterTree_&&(c=this.declutterTree_.all().map((function(t){return t.value})));var M,m,p,g,_,w=Object.keys(this.replaysByZIndex_).map(Number);for(w.sort(hs.numberSafeCompareFunction),M=w.length-1;M>=0;--M){var y=w[M].toString();for(p=this.replaysByZIndex_[y],m=pr.ORDER.length-1;m>=0;--m)if(void 0!==(g=p[l=pr.ORDER[m]]))if(!e||l!=ur&&l!=lr){if(_=g.replayHitDetection(f,u,s,n,d,o))return _}else{var b=e[y];b?b.push(g,u.slice(0)):e[y]=[g,u.slice(0)]}}},Er.prototype.getClipCoords=function(t){var i=this.maxExtent_,s=i[0],h=i[1],n=i[2],r=i[3],e=[s,h,s,r,n,r,n,h];return us(e,0,8,2,t,e),e},Er.prototype.getReplay=function(t,i){var s=void 0!==t?t.toString():"0",h=this.replaysByZIndex_[s];void 0===h&&(this.replaysByZIndex_[s]=h={});var n=h[i];return void 0===n&&(n=new(0,Er.BATCH_CONSTRUCTORS_[i])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),h[i]=n),n},Er.prototype.getReplays=function(){return this.replaysByZIndex_},Er.prototype.isEmpty=function(){return Si.isEmpty(this.replaysByZIndex_)},Er.prototype.replay=function(t,i,s,h,n,r){var e=Object.keys(this.replaysByZIndex_).map(Number);e.sort(hs.numberSafeCompareFunction),t.save(),this.clip(t,i);var o,a,u,f,c,l,v=n||pr.ORDER;for(o=0,a=e.length;o<a;++o){var d=e[o].toString();for(c=this.replaysByZIndex_[d],u=0,f=v.length;u<f;++u){var M=v[u];if(void 0!==(l=c[M]))if(!r||M!=ur&&M!=lr)l.replay(t,i,s,h);else{var m=r[d];m?m.push(l,i.slice(0)):r[d]=[l,i.slice(0)]}}}t.restore()},Er.BATCH_CONSTRUCTORS_={Circle:yr,Default:gr,Image:_r,LineString:wr,Polygon:yr,Text:xr};var Cr={defaultOrder:function(t,i){return di.getUid(t)-di.getUid(i)},getSquaredTolerance:function(t,i){var s=Cr.getTolerance(t,i);return s*s},getTolerance:function(t,i){return di.SIMPLIFY_TOLERANCE*t/i},renderCircleGeometry_:function(t,i,s,h){var n=s.getFill(),r=s.getStroke();if(n||r){var e=t.getReplay(s.getZIndex(),or);e.setFillStrokeStyle(n,r),e.drawCircle(i,h)}var o=s.getText();if(o){var a=t.getReplay(s.getZIndex(),lr);a.setTextStyle(o,t.addDeclutter(!1)),a.drawText(i,h)}},renderFeature:function(t,i,s,h,n,r){var e,o,a=!1;return(e=s.getImage())&&(2==(o=e.getImageState())||3==o?e.unlistenImageChange(n,r):(0==o&&e.load(),o=e.getImageState(),e.listenImageChange(n,r),a=!0)),Cr.renderFeature_(t,i,s,h),a},renderFeature_:function(t,i,s,h){var n=s.getGeometryFunction()(i);if(n){var r=n.getSimplifiedGeometry(h);s.getRenderer()?Cr.renderGeometry_(t,r,s,i):(0,Cr.GEOMETRY_RENDERERS_[r.getType()])(t,r,s,i)}},renderGeometry_:function(t,i,s,h){if(i.getType()!=ts)t.getReplay(s.getZIndex(),ar).drawCustom(i,h,s.getRenderer());else for(var n=i.getGeometries(),r=0,e=n.length;r<e;++r)Cr.renderGeometry_(t,n[r],s,h)},renderGeometryCollectionGeometry_:function(t,i,s,h){var n,r,e=i.getGeometriesArray();for(n=0,r=e.length;n<r;++n)(0,Cr.GEOMETRY_RENDERERS_[e[n].getType()])(t,e[n],s,h)},renderLineStringGeometry_:function(t,i,s,h){var n=s.getStroke();if(n){var r=t.getReplay(s.getZIndex(),fr);r.setFillStrokeStyle(null,n),r.drawLineString(i,h)}var e=s.getText();if(e){var o=t.getReplay(s.getZIndex(),lr);o.setTextStyle(e,t.addDeclutter(!1)),o.drawText(i,h)}},renderMultiLineStringGeometry_:function(t,i,s,h){var n=s.getStroke();if(n){var r=t.getReplay(s.getZIndex(),fr);r.setFillStrokeStyle(null,n),r.drawMultiLineString(i,h)}var e=s.getText();if(e){var o=t.getReplay(s.getZIndex(),lr);o.setTextStyle(e,t.addDeclutter(!1)),o.drawText(i,h)}},renderMultiPolygonGeometry_:function(t,i,s,h){var n=s.getFill(),r=s.getStroke();if(r||n){var e=t.getReplay(s.getZIndex(),cr);e.setFillStrokeStyle(n,r),e.drawMultiPolygon(i,h)}var o=s.getText();if(o){var a=t.getReplay(s.getZIndex(),lr);a.setTextStyle(o,t.addDeclutter(!1)),a.drawText(i,h)}},renderPointGeometry_:function(t,i,s,h){var n=s.getImage();if(n){if(2!=n.getImageState())return;var r=t.getReplay(s.getZIndex(),ur);r.setImageStyle(n,t.addDeclutter(!1)),r.drawPoint(i,h)}var e=s.getText();if(e){var o=t.getReplay(s.getZIndex(),lr);o.setTextStyle(e,t.addDeclutter(!!n)),o.drawText(i,h)}},renderMultiPointGeometry_:function(t,i,s,h){var n=s.getImage();if(n){if(2!=n.getImageState())return;var r=t.getReplay(s.getZIndex(),ur);r.setImageStyle(n,t.addDeclutter(!1)),r.drawMultiPoint(i,h)}var e=s.getText();if(e){var o=t.getReplay(s.getZIndex(),lr);o.setTextStyle(e,t.addDeclutter(!!n)),o.drawText(i,h)}},renderPolygonGeometry_:function(t,i,s,h){var n=s.getFill(),r=s.getStroke();if(n||r){var e=t.getReplay(s.getZIndex(),cr);e.setFillStrokeStyle(n,r),e.drawPolygon(i,h)}var o=s.getText();if(o){var a=t.getReplay(s.getZIndex(),lr);a.setTextStyle(o,t.addDeclutter(!1)),a.drawText(i,h)}}};Cr.GEOMETRY_RENDERERS_={Point:Cr.renderPointGeometry_,LineString:Cr.renderLineStringGeometry_,Polygon:Cr.renderPolygonGeometry_,MultiPoint:Cr.renderMultiPointGeometry_,MultiLineString:Cr.renderMultiLineStringGeometry_,MultiPolygon:Cr.renderMultiPolygonGeometry_,GeometryCollection:Cr.renderGeometryCollectionGeometry_,Circle:Cr.renderCircleGeometry_};var Sr=function(t){In.call(this,t),this.declutterTree_=t.getDeclutter()?Bn(9):null,this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=rs.createEmpty(),this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.context=xh(),Ai.listen(kn.labelCache,Pi,this.handleFontsChanged_,this)};di.inherits(Sr,In),Sr.handles=function(t,i){return t===Wh&&i.getType()===Cn},Sr.create=function(t,i){return new Sr(i)},Sr.prototype.disposeInternal=function(){Ai.unlisten(kn.labelCache,Pi,this.handleFontsChanged_,this),In.prototype.disposeInternal.call(this)},Sr.prototype.composeFrame=function(t,i,s){var h=t.extent,n=t.pixelRatio,r=i.managed?t.skippedFeatureUids:{},e=t.viewState,o=e.projection,a=e.rotation,u=o.getExtent(),f=this.getLayer().getSource(),c=this.getTransform(t,0);this.preCompose(s,t,c);var l=i.extent,v=void 0!==l;v&&this.clip(s,t,l);var d=this.replayGroup_;if(d&&!d.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var M,m=this.getLayer(),p=0,g=0,_=1!==i.opacity,w=m.hasListener(Kh);if(_||w){var y=s.canvas.width,b=s.canvas.height;if(a){var x=Math.round(Math.sqrt(y*y+b*b));p=(x-y)/2,g=(x-b)/2,y=b=x}this.context.canvas.width=y,this.context.canvas.height=b,M=this.context}else M=s;var E=M.globalAlpha;_||(M.globalAlpha=i.opacity),M!=s&&M.translate(p,g);var C=t.size[0]*n,S=t.size[1]*n;if(kn.rotateAtOffset(M,-a,C/2,S/2),d.replay(M,c,a,r),f.getWrapX()&&o.canWrapX()&&!rs.containsExtent(u,h)){for(var A=h[0],N=rs.getWidth(u),z=0;A<u[0];)--z,c=this.getTransform(t,N*z),d.replay(M,c,a,r),A+=N;for(z=0,A=h[2];A>u[2];)++z,c=this.getTransform(t,N*z),d.replay(M,c,a,r),A-=N;c=this.getTransform(t,0)}if(kn.rotateAtOffset(M,a,C/2,S/2),M!=s){if(w&&this.dispatchRenderEvent(M,t,c),_){var k=s.globalAlpha;s.globalAlpha=i.opacity,s.drawImage(M.canvas,-p,-g),s.globalAlpha=k}else s.drawImage(M.canvas,-p,-g);M.translate(-p,-g)}_||(M.globalAlpha=E)}v&&s.restore(),this.postCompose(s,t,i,c)},Sr.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){if(this.replayGroup_){var r=i.viewState.resolution,e=i.viewState.rotation,o=this.getLayer(),a={};return this.replayGroup_.forEachFeatureAtCoordinate(t,r,e,s,{},(function(t){var i=di.getUid(t).toString();if(!(i in a))return a[i]=!0,h.call(n,t,o)}),null)}},Sr.prototype.handleFontsChanged_=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},Sr.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Sr.prototype.prepareFrame=function(t){var i=this.getLayer(),s=i.getSource();this.updateLogos(t,s);var h=t.viewHints[0],n=t.viewHints[1],r=i.getUpdateWhileAnimating(),e=i.getUpdateWhileInteracting();if(!this.dirty_&&!r&&h||!e&&n)return!0;var o=t.extent,a=t.viewState,u=a.projection,f=a.resolution,c=t.pixelRatio,l=i.getRevision(),v=i.getRenderBuffer(),d=i.getRenderOrder();void 0===d&&(d=Cr.defaultOrder);var M=rs.buffer(o,v*f),m=a.projection.getExtent();if(s.getWrapX()&&a.projection.canWrapX()&&!rs.containsExtent(m,t.extent)){var p=rs.getWidth(m),g=Math.max(rs.getWidth(M)/2,p);M[0]=m[0]-g,M[2]=m[2]+g}if(!this.dirty_&&this.renderedResolution_==f&&this.renderedRevision_==l&&this.renderedRenderOrder_==d&&rs.containsExtent(this.renderedExtent_,M))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var _=new Er(Cr.getTolerance(f,c),M,f,c,s.getOverlaps(),this.declutterTree_,i.getRenderBuffer());s.loadFeatures(M,f,u);var w=function(t){var s,h=t.getStyleFunction();if(h?s=h.call(t,f):(h=i.getStyleFunction())&&(s=h(t,f)),s){var n=this.renderFeature(t,f,c,s,_);this.dirty_=this.dirty_||n}}.bind(this);if(d){var y=[];s.forEachFeatureInExtent(M,(function(t){y.push(t)}),this),y.sort(d);for(var b=0,x=y.length;b<x;++b)w(y[b])}else s.forEachFeatureInExtent(M,w,this);return _.finish(),this.renderedResolution_=f,this.renderedRevision_=l,this.renderedRenderOrder_=d,this.renderedExtent_=M,this.replayGroup_=_,this.replayGroupChanged=!0,!0},Sr.prototype.renderFeature=function(t,i,s,h,n){if(!h)return!1;var r=!1;if(Array.isArray(h))for(var e=0,o=h.length;e<o;++e)r=Cr.renderFeature(n,t,h[e],Cr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||r;else r=Cr.renderFeature(n,t,h,Cr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this);return r};var Ar="vector",Nr=function(t){this.context=null,Xn.call(this,t),this.declutterTree_=t.getDeclutter()?Bn(9):null,this.dirty_=!1,this.tmpTransform_=ys.create(),this.zDirection=t.getRenderMode()==Ar?1:0,Ai.listen(kn.labelCache,Pi,this.handleFontsChanged_,this)};di.inherits(Nr,Xn),Nr.handles=function(t,i){return t===Wh&&"VECTOR_TILE"===i.getType()},Nr.create=function(t,i){return new Nr(i)},Nr.IMAGE_REPLAYS={image:[cr,or,fr,ur,lr],hybrid:[cr,fr]},Nr.VECTOR_REPLAYS={image:[ar],hybrid:[ur,lr,ar],vector:pr.ORDER},Nr.prototype.disposeInternal=function(){Ai.unlisten(kn.labelCache,Pi,this.handleFontsChanged_,this),Xn.prototype.disposeInternal.call(this)},Nr.prototype.prepareFrame=function(t,i){var s=this.getLayer(),h=s.getRevision();if(this.renderedLayerRevision_!=h){this.renderedTiles.length=0;var n=s.getRenderMode();this.context||n==Ar||(this.context=xh()),this.context&&n==Ar&&(this.context=null)}return this.renderedLayerRevision_=h,Xn.prototype.prepareFrame.apply(this,arguments)},Nr.prototype.createReplayGroup_=function(t,i){var s=this.getLayer(),h=i.pixelRatio,n=i.viewState.projection,r=s.getRevision(),e=s.getRenderOrder()||null,o=t.getReplayState(s);if(o.dirty||o.renderedRevision!=r||o.renderedRenderOrder!=e){for(var a=s.getSource(),u=a.getTileGrid(),f=a.getTileGridForProjection(n),c=f.getResolution(t.tileCoord[0]),l=f.getTileCoordExtent(t.wrappedTileCoord),v=0,d=t.tileKeys.length;v<d;++v){var M=t.getTile(t.tileKeys[v]);if(3!=M.getState()){var m=u.getTileCoordExtent(M.tileCoord),p=rs.getIntersection(l,m),g=rs.equals(m,p)?null:rs.buffer(p,s.getRenderBuffer()*c),_=M.getProjection(),w=!1;ws.equivalent(n,_)||(w=!0,M.setProjection(n)),o.dirty=!1;var y,b=new Er(0,p,c,h,a.getOverlaps(),this.declutterTree_,s.getRenderBuffer()),x=Cr.getSquaredTolerance(c,h),E=function(t){var i,h=t.getStyleFunction();if(h?i=h.call(t,c):(h=s.getStyleFunction())&&(i=h(t,c)),i){var n=this.renderFeature(t,x,i,b);this.dirty_=this.dirty_||n,o.dirty=o.dirty||n}},C=M.getFeatures();e&&e!==o.renderedRenderOrder&&C.sort(e);for(var S=0,A=C.length;S<A;++S)y=C[S],w&&(_.getUnits()==vs.TILE_PIXELS&&(_.setWorldExtent(m),_.setExtent(M.getExtent())),y.getGeometry().transform(_,n)),g&&!rs.intersects(g,y.getGeometry().getExtent())||E.call(this,y);for(var N in b.finish(),b.getReplays());M.setReplayGroup(s,t.tileCoord.toString(),b)}}o.renderedRevision=r,o.renderedRenderOrder=e}},Nr.prototype.drawTileImage=function(t,i,s,h,n,r,e,o,a){var u=t;this.createReplayGroup_(u,i),this.context&&(this.renderTileImage_(u,i,s),Xn.prototype.drawTileImage.apply(this,arguments))},Nr.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var r=i.viewState.resolution,e=i.viewState.rotation;s=null==s?0:s;var o,a,u,f,c,l,v,d=this.getLayer(),M={},m=this.renderedTiles,p=d.getSource().getTileGridForProjection(i.viewState.projection);for(u=0,f=m.length;u<f;++u)if(v=p.getTileCoordExtent((l=m[u]).wrappedTileCoord,this.tmpExtent),o=rs.buffer(v,s*r,o),rs.containsCoordinate(o,t))for(var g=0,_=l.tileKeys.length;g<_;++g){var w=l.getTile(l.tileKeys[g]);3!=w.getState()&&(c=w.getReplayGroup(d,l.tileCoord.toString()),a=a||c.forEachFeatureAtCoordinate(t,r,e,s,{},(function(t){var i=di.getUid(t).toString();if(!(i in M))return M[i]=!0,h.call(n,t,d)}),null))}return a},Nr.prototype.getReplayTransform_=function(t,i){var s=this.getLayer().getSource().getTileGrid(),h=t.tileCoord,n=s.getResolution(h[0]),r=i.viewState,e=i.pixelRatio,o=r.resolution/e,a=s.getTileCoordExtent(h,this.tmpExtent),u=r.center,f=rs.getTopLeft(a),c=i.size,l=Math.round(e*c[0]/2),v=Math.round(e*c[1]/2);return ys.compose(this.tmpTransform_,l,v,n/o,n/o,r.rotation,(f[0]-u[0])/n,(u[1]-f[1])/n)},Nr.prototype.handleFontsChanged_=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},Nr.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Nr.prototype.postCompose=function(t,i,s){var h,n,r=this.getLayer(),e=r.getDeclutter()?{}:null,o=r.getSource(),a=r.getRenderMode(),u=Nr.VECTOR_REPLAYS[a],f=i.pixelRatio,c=i.viewState.rotation,l=i.size;c&&(h=Math.round(f*l[0]/2),n=Math.round(f*l[1]/2),kn.rotateAtOffset(t,-c,h,n)),e&&this.declutterTree_.clear();for(var v=this.renderedTiles,d=o.getTileGridForProjection(i.viewState.projection),M=[],m=[],p=v.length-1;p>=0;--p){var g=v[p];if(5!=g.getState())for(var _=g.tileCoord,w=d.getTileCoordExtent(_)[0]-d.getTileCoordExtent(g.wrappedTileCoord)[0],y=void 0,b=0,x=g.tileKeys.length;b<x;++b){var E=g.getTile(g.tileKeys[b]);if(3!=E.getState()){var C=E.getReplayGroup(r,_.toString());if(a==Ar||C.hasReplays(u)){y||(y=this.getTransform(i,w));var S=E.tileCoord[0],A=C.getClipCoords(y);t.save(),t.globalAlpha=s.opacity;for(var N=0,z=M.length;N<z;++N){var k=M[N];S<m[N]&&(t.beginPath(),t.moveTo(A[0],A[1]),t.lineTo(A[2],A[3]),t.lineTo(A[4],A[5]),t.lineTo(A[6],A[7]),t.moveTo(k[6],k[7]),t.lineTo(k[4],k[5]),t.lineTo(k[2],k[3]),t.lineTo(k[0],k[1]),t.clip())}C.replay(t,y,c,{},u,e),t.restore(),M.push(A),m.push(S)}}}}e&&Er.replayDeclutter(e,t,c),c&&kn.rotateAtOffset(t,c,h,n),Xn.prototype.postCompose.apply(this,arguments)},Nr.prototype.renderFeature=function(t,i,s,h){if(!s)return!1;var n=!1;if(Array.isArray(s))for(var r=0,e=s.length;r<e;++r)n=Cr.renderFeature(h,t,s[r],i,this.handleStyleImageChange_,this)||n;else n=Cr.renderFeature(h,t,s,i,this.handleStyleImageChange_,this);return n},Nr.prototype.renderTileImage_=function(t,i){var s=this.getLayer(),h=t.getReplayState(s),n=s.getRevision(),r=Nr.IMAGE_REPLAYS[s.getRenderMode()];if(r&&h.renderedTileRevision!==n){h.renderedTileRevision=n;var e=t.wrappedTileCoord,o=e[0],a=i.pixelRatio,u=s.getSource(),f=u.getTileGridForProjection(i.viewState.projection),c=f.getResolution(o),l=t.getContext(s),v=u.getTilePixelSize(o,a,i.viewState.projection);l.canvas.width=v[0],l.canvas.height=v[1];for(var d=f.getTileCoordExtent(e),M=0,m=t.tileKeys.length;M<m;++M){var p=t.getTile(t.tileKeys[M]);if(3!=p.getState()){var g=a/c,_=ys.reset(this.tmpTransform_);ys.scale(_,g,-g),ys.translate(_,-d[0],-d[3]),p.getReplayGroup(s,t.tileCoord.toString()).replay(l,_,0,{},r)}}}};var zr=function(t){this.source_=t};zr.prototype.getType=function(){},zr.prototype.getSource=function(){return this.source_},zr.prototype.isAnimated=as.FALSE;var kr=function(t){zr.call(this,t)};di.inherits(kr,zr),kr.prototype.getType=function(){return Ds.FRAGMENT_SHADER};var Rr=function(t){zr.call(this,t)};di.inherits(Rr,zr),Rr.prototype.getType=function(){return Ds.VERTEX_SHADER};var Pr={};Pr.fragment=new kr(di.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n":"precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}"),Pr.vertex=new Rr(di.DEBUG_WEBGL?"varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n":"varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}");var Tr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_lineWidth=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_lineWidth":"k"),this.u_pixelRatio=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_pixelRatio":"l"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"m"),this.u_fillColor=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_fillColor":"n"),this.u_strokeColor=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_strokeColor":"o"),this.u_size=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_size":"p"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"e"),this.a_instruction=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_instruction":"f"),this.a_radius=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_radius":"g")},Or=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Lr=function(t,i){return t[0]=i[0],t[1]=i[1],t[4]=i[2],t[5]=i[3],t[12]=i[4],t[13]=i[5],t},Ir=function(t,i){Tn.call(this),this.tolerance=t,this.maxExtent=i,this.origin=rs.getCenter(i),this.projectionMatrix_=ys.create(),this.offsetRotateMatrix_=ys.create(),this.offsetScaleMatrix_=ys.create(),this.tmpMat4_=Or(),this.indices=[],this.indicesBuffer=null,this.startIndices=[],this.startIndicesFeature=[],this.vertices=[],this.verticesBuffer=null,this.lineStringReplay=void 0};di.inherits(Ir,Tn),Ir.prototype.getDeleteResourcesFunction=function(){},Ir.prototype.finish=function(){},Ir.prototype.setUpProgram=function(){},Ir.prototype.shutDownProgram=function(){},Ir.prototype.drawReplay=function(){},Ir.prototype.drawHitDetectionReplayOneByOne=function(){},Ir.prototype.drawHitDetectionReplay=function(t,i,s,h,n,r){return n?this.drawHitDetectionReplayOneByOne(t,i,s,h,r):this.drawHitDetectionReplayAll(t,i,s,h)},Ir.prototype.drawHitDetectionReplayAll=function(t,i,s,h){return t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawReplay(t,i,s,!0),h(null)||void 0},Ir.prototype.replay=function(t,i,s,h,n,r,e,o,a,u,f){var c,l,v,d,M,m,p,g,_=t.getGL();this.lineStringReplay&&(c=_.isEnabled(_.STENCIL_TEST),l=_.getParameter(_.STENCIL_FUNC),v=_.getParameter(_.STENCIL_VALUE_MASK),d=_.getParameter(_.STENCIL_REF),M=_.getParameter(_.STENCIL_WRITEMASK),m=_.getParameter(_.STENCIL_FAIL),p=_.getParameter(_.STENCIL_PASS_DEPTH_PASS),g=_.getParameter(_.STENCIL_PASS_DEPTH_FAIL),_.enable(_.STENCIL_TEST),_.clear(_.STENCIL_BUFFER_BIT),_.stencilMask(255),_.stencilFunc(_.ALWAYS,1,255),_.stencilOp(_.KEEP,_.KEEP,_.REPLACE),this.lineStringReplay.replay(t,i,s,h,n,r,e,o,a,u,f),_.stencilMask(0),_.stencilFunc(_.NOTEQUAL,1,255)),t.bindBuffer(Ds.ARRAY_BUFFER,this.verticesBuffer),t.bindBuffer(Ds.ELEMENT_ARRAY_BUFFER,this.indicesBuffer);var w=this.setUpProgram(_,t,n,r),y=ys.reset(this.projectionMatrix_);ys.scale(y,2/(s*n[0]),2/(s*n[1])),ys.rotate(y,-h),ys.translate(y,-(i[0]-this.origin[0]),-(i[1]-this.origin[1]));var b=ys.reset(this.offsetScaleMatrix_);ys.scale(b,2/n[0],2/n[1]);var x,E=ys.reset(this.offsetRotateMatrix_);return 0!==h&&ys.rotate(E,-h),_.uniformMatrix4fv(w.u_projectionMatrix,!1,Lr(this.tmpMat4_,y)),_.uniformMatrix4fv(w.u_offsetScaleMatrix,!1,Lr(this.tmpMat4_,b)),_.uniformMatrix4fv(w.u_offsetRotateMatrix,!1,Lr(this.tmpMat4_,E)),_.uniform1f(w.u_opacity,e),void 0===a?this.drawReplay(_,t,o,!1):x=this.drawHitDetectionReplay(_,t,o,a,u,f),this.shutDownProgram(_,w),this.lineStringReplay&&(c||_.disable(_.STENCIL_TEST),_.clear(_.STENCIL_BUFFER_BIT),_.stencilFunc(l,d,v),_.stencilMask(M),_.stencilOp(m,g,p)),x},Ir.prototype.drawElements=function(t,i,s,h){t.drawElements(Ds.TRIANGLES,h-s,i.hasOESElementIndexUint?Ds.UNSIGNED_INT:Ds.UNSIGNED_SHORT,s*(i.hasOESElementIndexUint?4:2))};var Fr={defaultFont:"10px sans-serif",defaultFillStyle:[0,0,0,1],defaultLineCap:"round",defaultLineDash:[],defaultLineDashOffset:0,defaultLineJoin:"round",defaultMiterLimit:10,defaultStrokeStyle:[0,0,0,1],defaultTextAlign:.5,defaultTextBaseline:.5,defaultLineWidth:1,triangleIsCounterClockwise:function(t,i,s,h,n,r){var e=(s-t)*(r-i)-(n-t)*(h-i);return e<=Fr.EPSILON&&e>=-Fr.EPSILON?void 0:e>0}};Fr.EPSILON=Number.EPSILON||2220446049250313e-31;var Dr=function(t,i){this.arr_=void 0!==t?t:[],this.usage_=void 0!==i?i:Dr.Usage_.STATIC_DRAW};Dr.prototype.getArray=function(){return this.arr_},Dr.prototype.getUsage=function(){return this.usage_},Dr.Usage_={STATIC_DRAW:Ds.STATIC_DRAW,STREAM_DRAW:Ds.STREAM_DRAW,DYNAMIC_DRAW:Ds.DYNAMIC_DRAW};var Wr=function(t,i){Ir.call(this,t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.radius_=0,this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:void 0,lineWidth:void 0,changed:!1}};di.inherits(Wr,Ir),Wr.prototype.drawCoordinates_=function(t,i,s,h){var n,r,e=this.vertices.length,o=this.indices.length,a=e/4;for(n=i,r=s;n<r;n+=h)this.vertices[e++]=t[n],this.vertices[e++]=t[n+1],this.vertices[e++]=0,this.vertices[e++]=this.radius_,this.vertices[e++]=t[n],this.vertices[e++]=t[n+1],this.vertices[e++]=1,this.vertices[e++]=this.radius_,this.vertices[e++]=t[n],this.vertices[e++]=t[n+1],this.vertices[e++]=2,this.vertices[e++]=this.radius_,this.vertices[e++]=t[n],this.vertices[e++]=t[n+1],this.vertices[e++]=3,this.vertices[e++]=this.radius_,this.indices[o++]=a,this.indices[o++]=a+1,this.indices[o++]=a+2,this.indices[o++]=a+2,this.indices[o++]=a+3,this.indices[o++]=a,a+=4},Wr.prototype.drawCircle=function(t,i){var s=t.getRadius(),h=t.getStride();if(s){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.radius_=s;var n=t.getFlatCoordinates();n=ls(n,0,2,h,-this.origin[0],-this.origin[1]),this.drawCoordinates_(n,0,2,h)}else if(this.state_.changed&&(this.styles_.pop(),this.styles_.length)){var r=this.styles_[this.styles_.length-1];this.state_.fillColor=r[0],this.state_.strokeColor=r[1],this.state_.lineWidth=r[2],this.state_.changed=!1}},Wr.prototype.finish=function(){this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},Wr.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer;return function(){t.deleteBuffer(i),t.deleteBuffer(s)}},Wr.prototype.setUpProgram=function(t,i,s,h){var n,r=i.getProgram(Pr.fragment,Pr.vertex);return this.defaultLocations_?n=this.defaultLocations_:(n=new Tr(t,r),this.defaultLocations_=n),i.useProgram(r),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Ds.FLOAT,!1,16,0),t.enableVertexAttribArray(n.a_instruction),t.vertexAttribPointer(n.a_instruction,1,Ds.FLOAT,!1,16,8),t.enableVertexAttribArray(n.a_radius),t.vertexAttribPointer(n.a_radius,1,Ds.FLOAT,!1,16,12),t.uniform2fv(n.u_size,s),t.uniform1f(n.u_pixelRatio,h),n},Wr.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_instruction),t.disableVertexAttribArray(i.a_radius)},Wr.prototype.drawReplay=function(t,i,s){var h,n,r,e;if(Si.isEmpty(s))for(r=this.startIndices[this.startIndices.length-1],h=this.styleIndices_.length-1;h>=0;--h)n=this.styleIndices_[h],this.setFillStyle_(t,(e=this.styles_[h])[0]),this.setStrokeStyle_(t,e[1],e[2]),this.drawElements(t,i,n,r),r=n;else this.drawReplaySkipping_(t,i,s)},Wr.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var r,e,o,a,u,f,c;for(o=this.startIndices[1+(c=this.startIndices.length-2)],r=this.styleIndices_.length-1;r>=0;--r)for(this.setFillStyle_(t,(a=this.styles_[r])[0]),this.setStrokeStyle_(t,a[1],a[2]),u=this.styleIndices_[r];c>=0&&this.startIndices[c]>=u;){if(e=this.startIndices[c],void 0===s[di.getUid(f=this.startIndicesFeature[c]).toString()]&&f.getGeometry()&&(void 0===n||rs.intersects(n,f.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,e,o);var l=h(f);if(l)return l}c--,o=e}},Wr.prototype.drawReplaySkipping_=function(t,i,s){var h,n,r,e,o,a,u;for(r=n=this.startIndices[1+(a=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setFillStyle_(t,(e=this.styles_[h])[0]),this.setStrokeStyle_(t,e[1],e[2]),o=this.styleIndices_[h];a>=0&&this.startIndices[a]>=o;)u=this.startIndices[a],s[di.getUid(this.startIndicesFeature[a]).toString()]&&(n!==r&&this.drawElements(t,i,n,r),r=u),a--,n=u;n!==r&&this.drawElements(t,i,n,r),n=r=o}},Wr.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_fillColor,i)},Wr.prototype.setStrokeStyle_=function(t,i,s){t.uniform4fv(this.defaultLocations_.u_strokeColor,i),t.uniform1f(this.defaultLocations_.u_lineWidth,s)},Wr.prototype.setFillStrokeStyle=function(t,i){var s,h;if(i){var n=i.getLineDash();this.state_.lineDash=n||Fr.defaultLineDash;var r=i.getLineDashOffset();this.state_.lineDashOffset=r||Fr.defaultLineDashOffset,s=(s=i.getColor())instanceof CanvasGradient||s instanceof CanvasPattern?Fr.defaultStrokeStyle:Rn.asArray(s).map((function(t,i){return 3!=i?t/255:t}))||Fr.defaultStrokeStyle,h=void 0!==(h=i.getWidth())?h:Fr.defaultLineWidth}else s=[0,0,0,0],h=0;var e=t?t.getColor():[0,0,0,0];e=e instanceof CanvasGradient||e instanceof CanvasPattern?Fr.defaultFillStyle:Rn.asArray(e).map((function(t,i){return 3!=i?t/255:t}))||Fr.defaultFillStyle,this.state_.strokeColor&&hs.equals(this.state_.strokeColor,s)&&this.state_.fillColor&&hs.equals(this.state_.fillColor,e)&&this.state_.lineWidth===h||(this.state_.changed=!0,this.state_.fillColor=e,this.state_.strokeColor=s,this.state_.lineWidth=h,this.styles_.push([e,s,h]))};var Gr={};Gr.fragment=new kr(di.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),Gr.vertex=new Rr(di.DEBUG_WEBGL?"varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n":"varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}");var Vr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"k"),this.u_image=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_image":"l"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"c"),this.a_texCoord=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_texCoord":"d"),this.a_offsets=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_offsets":"e"),this.a_opacity=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_opacity":"f"),this.a_rotateWithView=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_rotateWithView":"g")},jr="webglcontextlost",Ur="webglcontextrestored",Xr=function(t,i){this.canvas_=t,this.gl_=i,this.bufferCache_={},this.shaderCache_={},this.programCache_={},this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null,this.hasOESElementIndexUint=hs.includes(di.WEBGL_EXTENSIONS,"OES_element_index_uint"),this.hasOESElementIndexUint&&i.getExtension("OES_element_index_uint"),Ai.listen(this.canvas_,jr,this.handleWebGLContextLost,this),Ai.listen(this.canvas_,Ur,this.handleWebGLContextRestored,this)};di.inherits(Xr,Ni),Xr.prototype.bindBuffer=function(t,i){var s=this.getGL(),h=i.getArray(),n=String(di.getUid(i));if(n in this.bufferCache_)s.bindBuffer(t,this.bufferCache_[n].buffer);else{var r,e=s.createBuffer();s.bindBuffer(t,e),t==Ds.ARRAY_BUFFER?r=new Float32Array(h):t==Ds.ELEMENT_ARRAY_BUFFER&&(r=this.hasOESElementIndexUint?new Uint32Array(h):new Uint16Array(h)),s.bufferData(t,r,i.getUsage()),this.bufferCache_[n]={buf:i,buffer:e}}},Xr.prototype.deleteBuffer=function(t){var i=this.getGL(),s=String(di.getUid(t)),h=this.bufferCache_[s];i.isContextLost()||i.deleteBuffer(h.buffer),delete this.bufferCache_[s]},Xr.prototype.disposeInternal=function(){Ai.unlistenAll(this.canvas_);var t=this.getGL();if(!t.isContextLost()){var i;for(i in this.bufferCache_)t.deleteBuffer(this.bufferCache_[i].buffer);for(i in this.programCache_)t.deleteProgram(this.programCache_[i]);for(i in this.shaderCache_)t.deleteShader(this.shaderCache_[i]);t.deleteFramebuffer(this.hitDetectionFramebuffer_),t.deleteRenderbuffer(this.hitDetectionRenderbuffer_),t.deleteTexture(this.hitDetectionTexture_)}},Xr.prototype.getCanvas=function(){return this.canvas_},Xr.prototype.getGL=function(){return this.gl_},Xr.prototype.getHitDetectionFramebuffer=function(){return this.hitDetectionFramebuffer_||this.initHitDetectionFramebuffer_(),this.hitDetectionFramebuffer_},Xr.prototype.getShader=function(t){var i=String(di.getUid(t));if(i in this.shaderCache_)return this.shaderCache_[i];var s=this.getGL(),h=s.createShader(t.getType());return s.shaderSource(h,t.getSource()),s.compileShader(h),this.shaderCache_[i]=h,h},Xr.prototype.getProgram=function(t,i){var s=di.getUid(t)+"/"+di.getUid(i);if(s in this.programCache_)return this.programCache_[s];var h=this.getGL(),n=h.createProgram();return h.attachShader(n,this.getShader(t)),h.attachShader(n,this.getShader(i)),h.linkProgram(n),this.programCache_[s]=n,n},Xr.prototype.handleWebGLContextLost=function(){Si.clear(this.bufferCache_),Si.clear(this.shaderCache_),Si.clear(this.programCache_),this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null},Xr.prototype.handleWebGLContextRestored=function(){},Xr.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_,i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i);var s=Xr.createEmptyTexture(t,1,1),h=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,h),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,h),t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.hitDetectionFramebuffer_=i,this.hitDetectionTexture_=s,this.hitDetectionRenderbuffer_=h},Xr.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,!0)},Xr.createTexture_=function(t,i,s){var h=t.createTexture();return t.bindTexture(t.TEXTURE_2D,h),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),void 0!==i&&t.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_WRAP_S,i),void 0!==s&&t.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_WRAP_T,s),h},Xr.createEmptyTexture=function(t,i,s,h,n){var r=Xr.createTexture_(t,h,n);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i,s,0,t.RGBA,t.UNSIGNED_BYTE,null),r},Xr.createTexture=function(t,i,s,h){var n=Xr.createTexture_(t,s,h);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i),n};var qr=function(t,i){Ir.call(this,t,i),this.anchorX=void 0,this.anchorY=void 0,this.groupIndices=[],this.hitDetectionGroupIndices=[],this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.defaultLocations=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.width=void 0};di.inherits(qr,Ir),qr.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer,h=this.getTextures(!0),n=t.getGL();return function(){var r,e;if(!n.isContextLost())for(r=0,e=h.length;r<e;++r)n.deleteTexture(h[r]);t.deleteBuffer(i),t.deleteBuffer(s)}},qr.prototype.drawCoordinates=function(t,i,s,h){var n,r,e,o,a,u,f=this.anchorX,c=this.anchorY,l=this.height,v=this.imageHeight,d=this.imageWidth,M=this.opacity,m=this.originX,p=this.originY,g=this.rotateWithView?1:0,_=-this.rotation,w=this.scale,y=this.width,b=Math.cos(_),x=Math.sin(_),E=this.indices.length,C=this.vertices.length;for(n=i;n<s;n+=h)u=t[n+1]-this.origin[1],r=C/8,e=-w*f,o=-w*(l-c),this.vertices[C++]=a=t[n]-this.origin[0],this.vertices[C++]=u,this.vertices[C++]=e*b-o*x,this.vertices[C++]=e*x+o*b,this.vertices[C++]=m/d,this.vertices[C++]=(p+l)/v,this.vertices[C++]=M,this.vertices[C++]=g,e=w*(y-f),o=-w*(l-c),this.vertices[C++]=a,this.vertices[C++]=u,this.vertices[C++]=e*b-o*x,this.vertices[C++]=e*x+o*b,this.vertices[C++]=(m+y)/d,this.vertices[C++]=(p+l)/v,this.vertices[C++]=M,this.vertices[C++]=g,e=w*(y-f),o=w*c,this.vertices[C++]=a,this.vertices[C++]=u,this.vertices[C++]=e*b-o*x,this.vertices[C++]=e*x+o*b,this.vertices[C++]=(m+y)/d,this.vertices[C++]=p/v,this.vertices[C++]=M,this.vertices[C++]=g,e=-w*f,o=w*c,this.vertices[C++]=a,this.vertices[C++]=u,this.vertices[C++]=e*b-o*x,this.vertices[C++]=e*x+o*b,this.vertices[C++]=m/d,this.vertices[C++]=p/v,this.vertices[C++]=M,this.vertices[C++]=g,this.indices[E++]=r,this.indices[E++]=r+1,this.indices[E++]=r+2,this.indices[E++]=r,this.indices[E++]=r+2,this.indices[E++]=r+3;return C},qr.prototype.createTextures=function(t,i,s,h){var n,r,e,o,a=i.length;for(o=0;o<a;++o)(e=di.getUid(r=i[o]).toString())in s?n=s[e]:(n=Xr.createTexture(h,r,Ds.CLAMP_TO_EDGE,Ds.CLAMP_TO_EDGE),s[e]=n),t[o]=n},qr.prototype.setUpProgram=function(t,i){var s,h=i.getProgram(Gr.fragment,Gr.vertex);return this.defaultLocations?s=this.defaultLocations:(s=new Vr(t,h),this.defaultLocations=s),i.useProgram(h),t.enableVertexAttribArray(s.a_position),t.vertexAttribPointer(s.a_position,2,Ds.FLOAT,!1,32,0),t.enableVertexAttribArray(s.a_offsets),t.vertexAttribPointer(s.a_offsets,2,Ds.FLOAT,!1,32,8),t.enableVertexAttribArray(s.a_texCoord),t.vertexAttribPointer(s.a_texCoord,2,Ds.FLOAT,!1,32,16),t.enableVertexAttribArray(s.a_opacity),t.vertexAttribPointer(s.a_opacity,1,Ds.FLOAT,!1,32,24),t.enableVertexAttribArray(s.a_rotateWithView),t.vertexAttribPointer(s.a_rotateWithView,1,Ds.FLOAT,!1,32,28),s},qr.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_offsets),t.disableVertexAttribArray(i.a_texCoord),t.disableVertexAttribArray(i.a_opacity),t.disableVertexAttribArray(i.a_rotateWithView)},qr.prototype.drawReplay=function(t,i,s,h){var n,r,e,o=h?this.getHitDetectionTextures():this.getTextures(),a=h?this.hitDetectionGroupIndices:this.groupIndices;if(Si.isEmpty(s))for(n=0,r=o.length,e=0;n<r;++n){t.bindTexture(Ds.TEXTURE_2D,o[n]);var u=a[n];this.drawElements(t,i,e,u),e=u}else this.drawReplaySkipping(t,i,s,o,a)},qr.prototype.drawReplaySkipping=function(t,i,s,h,n){var r,e,o=0;for(r=0,e=h.length;r<e;++r){t.bindTexture(Ds.TEXTURE_2D,h[r]);for(var a=r>0?n[r-1]:0,u=n[r],f=a,c=a;o<this.startIndices.length&&this.startIndices[o]<=u;)void 0!==s[di.getUid(this.startIndicesFeature[o]).toString()]?(f!==c&&this.drawElements(t,i,f,c),c=f=o===this.startIndices.length-1?u:this.startIndices[o+1]):c=o===this.startIndices.length-1?u:this.startIndices[o+1],o++;f!==c&&this.drawElements(t,i,f,c)}},qr.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var r,e,o,a,u,f=this.startIndices.length-1,c=this.getHitDetectionTextures();for(r=c.length-1;r>=0;--r)for(t.bindTexture(Ds.TEXTURE_2D,c[r]),e=r>0?this.hitDetectionGroupIndices[r-1]:0,a=this.hitDetectionGroupIndices[r];f>=0&&this.startIndices[f]>=e;){if(o=this.startIndices[f],void 0===s[di.getUid(u=this.startIndicesFeature[f]).toString()]&&u.getGeometry()&&(void 0===n||rs.intersects(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,o,a);var l=h(u);if(l)return l}a=o,f--}},qr.prototype.finish=function(){this.anchorX=void 0,this.anchorY=void 0,this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.indices=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.vertices=null,this.width=void 0},qr.prototype.getTextures=function(){},qr.prototype.getHitDetectionTextures=function(){};var Br=function(t,i){qr.call(this,t,i),this.images_=[],this.hitDetectionImages_=[],this.textures_=[],this.hitDetectionTextures_=[]};di.inherits(Br,qr),Br.prototype.drawMultiPoint=function(t,i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var s=t.getFlatCoordinates(),h=t.getStride();this.drawCoordinates(s,0,s.length,h)},Br.prototype.drawPoint=function(t,i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var s=t.getFlatCoordinates(),h=t.getStride();this.drawCoordinates(s,0,s.length,h)},Br.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices.push(this.indices.length),this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices);var s={};this.createTextures(this.textures_,this.images_,s,i),this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,s,i),this.images_=null,this.hitDetectionImages_=null,qr.prototype.finish.call(this,t)},Br.prototype.setImageStyle=function(t){var i=t.getAnchor(),s=t.getImage(1),h=t.getImageSize(),n=t.getHitDetectionImage(1),r=t.getOpacity(),e=t.getOrigin(),o=t.getRotateWithView(),a=t.getRotation(),u=t.getSize(),f=t.getScale();0===this.images_.length?this.images_.push(s):di.getUid(this.images_[this.images_.length-1])!=di.getUid(s)&&(this.groupIndices.push(this.indices.length),this.images_.push(s)),0===this.hitDetectionImages_.length?this.hitDetectionImages_.push(n):di.getUid(this.hitDetectionImages_[this.hitDetectionImages_.length-1])!=di.getUid(n)&&(this.hitDetectionGroupIndices.push(this.indices.length),this.hitDetectionImages_.push(n)),this.anchorX=i[0],this.anchorY=i[1],this.height=u[1],this.imageHeight=h[1],this.imageWidth=h[0],this.opacity=r,this.originX=e[0],this.originY=e[1],this.rotation=a,this.rotateWithView=o,this.scale=f,this.width=u[0]},Br.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_},Br.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var Yr=function(t,i,s,h){var n=s-h;return t[i]===t[n]&&t[i+1]===t[n+1]&&(s-i)/h>3&&!!Es.linearRing(t,i,s,h)},Hr={};Hr.fragment=new kr(di.DEBUG_WEBGL?"precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),Hr.vertex=new Rr(di.DEBUG_WEBGL?"varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n":"varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}");var Jr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_lineWidth=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_lineWidth":"k"),this.u_miterLimit=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_miterLimit":"l"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"m"),this.u_color=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_color":"n"),this.u_size=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_size":"o"),this.u_pixelRatio=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_pixelRatio":"p"),this.a_lastPos=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_lastPos":"d"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"e"),this.a_nextPos=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_nextPos":"f"),this.a_direction=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_direction":"g")},Zr=function(t,i){Ir.call(this,t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0,changed:!1}};di.inherits(Zr,Ir),Zr.prototype.drawCoordinates_=function(t,i,s,h){var n,r,e,o,a,u,f,c,l=this.vertices.length,v=this.indices.length,d="bevel"===this.state_.lineJoin?0:"miter"===this.state_.lineJoin?1:2,M="butt"===this.state_.lineCap?0:"square"===this.state_.lineCap?1:2,m=Yr(t,i,s,h),p=v,g=1;for(n=i,r=s;n<r;n+=h){if(a=l/7,u=f,f=c||[t[n],t[n+1]],n===i){if(c=[t[n+h],t[n+h+1]],s-i==2*h&&hs.equals(f,c))break;if(!m){M&&(l=this.addVertices_([0,0],f,c,g*Zr.Instruction_.BEGIN_LINE_CAP*M,l),l=this.addVertices_([0,0],f,c,-g*Zr.Instruction_.BEGIN_LINE_CAP*M,l),this.indices[v++]=a+2,this.indices[v++]=a,this.indices[v++]=a+1,this.indices[v++]=a+1,this.indices[v++]=a+3,this.indices[v++]=a+2),l=this.addVertices_([0,0],f,c,g*Zr.Instruction_.BEGIN_LINE*(M||1),l),p=(l=this.addVertices_([0,0],f,c,-g*Zr.Instruction_.BEGIN_LINE*(M||1),l))/7-1;continue}u=[t[s-2*h],t[s-2*h+1]],e=c}else{if(n===s-h){if(m){c=e;break}l=this.addVertices_(u=u||[0,0],f,[0,0],g*Zr.Instruction_.END_LINE*(M||1),l),l=this.addVertices_(u,f,[0,0],-g*Zr.Instruction_.END_LINE*(M||1),l),this.indices[v++]=a,this.indices[v++]=p-1,this.indices[v++]=p,this.indices[v++]=p,this.indices[v++]=a+1,this.indices[v++]=a,M&&(l=this.addVertices_(u,f,[0,0],g*Zr.Instruction_.END_LINE_CAP*M,l),l=this.addVertices_(u,f,[0,0],-g*Zr.Instruction_.END_LINE_CAP*M,l),this.indices[v++]=a+2,this.indices[v++]=a,this.indices[v++]=a+1,this.indices[v++]=a+1,this.indices[v++]=a+3,this.indices[v++]=a+2);break}c=[t[n+h],t[n+h+1]]}o=Fr.triangleIsCounterClockwise(u[0],u[1],f[0],f[1],c[0],c[1])?-1:1,l=this.addVertices_(u,f,c,o*Zr.Instruction_.BEVEL_FIRST*(d||1),l),l=this.addVertices_(u,f,c,o*Zr.Instruction_.BEVEL_SECOND*(d||1),l),l=this.addVertices_(u,f,c,-o*Zr.Instruction_.MITER_BOTTOM*(d||1),l),n>i&&(this.indices[v++]=a,this.indices[v++]=p-1,this.indices[v++]=p,this.indices[v++]=a+2,this.indices[v++]=a,this.indices[v++]=g*o>0?p:p-1),this.indices[v++]=a,this.indices[v++]=a+2,this.indices[v++]=a+1,p=a+2,g=o,d&&(l=this.addVertices_(u,f,c,o*Zr.Instruction_.MITER_TOP*d,l),this.indices[v++]=a+1,this.indices[v++]=a+3,this.indices[v++]=a)}m&&(a=a||l/7,o=Is.linearRingIsClockwise([u[0],u[1],f[0],f[1],c[0],c[1]],0,6,2)?1:-1,l=this.addVertices_(u,f,c,o*Zr.Instruction_.BEVEL_FIRST*(d||1),l),l=this.addVertices_(u,f,c,-o*Zr.Instruction_.MITER_BOTTOM*(d||1),l),this.indices[v++]=a,this.indices[v++]=p-1,this.indices[v++]=p,this.indices[v++]=a+1,this.indices[v++]=a,this.indices[v++]=g*o>0?p:p-1)},Zr.prototype.addVertices_=function(t,i,s,h,n){return this.vertices[n++]=t[0],this.vertices[n++]=t[1],this.vertices[n++]=i[0],this.vertices[n++]=i[1],this.vertices[n++]=s[0],this.vertices[n++]=s[1],this.vertices[n++]=h,n},Zr.prototype.isValid_=function(t,i,s,h){var n=s-i;return!(n<2*h||n===2*h&&hs.equals([t[i],t[i+1]],[t[i+h],t[i+h+1]]))},Zr.prototype.drawLineString=function(t,i){var s=t.getFlatCoordinates(),h=t.getStride();this.isValid_(s,0,s.length,h)&&(s=ls(s,0,s.length,h,-this.origin[0],-this.origin[1]),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.drawCoordinates_(s,0,s.length,h))},Zr.prototype.drawMultiLineString=function(t,i){var s=this.indices.length,h=t.getEnds();h.unshift(0);var n,r,e=t.getFlatCoordinates(),o=t.getStride();if(h.length>1)for(n=1,r=h.length;n<r;++n)if(this.isValid_(e,h[n-1],h[n],o)){var a=ls(e,h[n-1],h[n],o,-this.origin[0],-this.origin[1]);this.drawCoordinates_(a,0,a.length,o)}this.indices.length>s&&(this.startIndices.push(s),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(s),this.state_.changed=!1))},Zr.prototype.drawPolygonCoordinates=function(t,i,s){var h,n;if(Yr(t,0,t.length,s)||(t.push(t[0]),t.push(t[1])),this.drawCoordinates_(t,0,t.length,s),i.length)for(h=0,n=i.length;h<n;++h)Yr(i[h],0,i[h].length,s)||(i[h].push(i[h][0]),i[h].push(i[h][1])),this.drawCoordinates_(i[h],0,i[h].length,s)},Zr.prototype.setPolygonStyle=function(t,i){var s=void 0===i?this.indices.length:i;this.startIndices.push(s),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(s),this.state_.changed=!1)},Zr.prototype.getCurrentIndex=function(){return this.indices.length},Zr.prototype.finish=function(){this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},Zr.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer;return function(){t.deleteBuffer(i),t.deleteBuffer(s)}},Zr.prototype.setUpProgram=function(t,i,s,h){var n,r=i.getProgram(Hr.fragment,Hr.vertex);return this.defaultLocations_?n=this.defaultLocations_:(n=new Jr(t,r),this.defaultLocations_=n),i.useProgram(r),t.enableVertexAttribArray(n.a_lastPos),t.vertexAttribPointer(n.a_lastPos,2,Ds.FLOAT,!1,28,0),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Ds.FLOAT,!1,28,8),t.enableVertexAttribArray(n.a_nextPos),t.vertexAttribPointer(n.a_nextPos,2,Ds.FLOAT,!1,28,16),t.enableVertexAttribArray(n.a_direction),t.vertexAttribPointer(n.a_direction,1,Ds.FLOAT,!1,28,24),t.uniform2fv(n.u_size,s),t.uniform1f(n.u_pixelRatio,h),n},Zr.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_lastPos),t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_nextPos),t.disableVertexAttribArray(i.a_direction)},Zr.prototype.drawReplay=function(t,i,s,h){var n,r,e,o,a=t.getParameter(t.DEPTH_FUNC),u=t.getParameter(t.DEPTH_WRITEMASK);if(h||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Si.isEmpty(s))for(e=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)r=this.styleIndices_[n],this.setStrokeStyle_(t,(o=this.styles_[n])[0],o[1],o[2]),this.drawElements(t,i,r,e),t.clear(t.DEPTH_BUFFER_BIT),e=r;else this.drawReplaySkipping_(t,i,s);h||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(u),t.depthFunc(a))},Zr.prototype.drawReplaySkipping_=function(t,i,s){var h,n,r,e,o,a,u;for(r=n=this.startIndices[1+(a=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setStrokeStyle_(t,(e=this.styles_[h])[0],e[1],e[2]),o=this.styleIndices_[h];a>=0&&this.startIndices[a]>=o;)u=this.startIndices[a],s[di.getUid(this.startIndicesFeature[a]).toString()]&&(n!==r&&(this.drawElements(t,i,n,r),t.clear(t.DEPTH_BUFFER_BIT)),r=u),a--,n=u;n!==r&&(this.drawElements(t,i,n,r),t.clear(t.DEPTH_BUFFER_BIT)),n=r=o}},Zr.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var r,e,o,a,u,f,c;for(o=this.startIndices[1+(c=this.startIndices.length-2)],r=this.styleIndices_.length-1;r>=0;--r)for(this.setStrokeStyle_(t,(a=this.styles_[r])[0],a[1],a[2]),u=this.styleIndices_[r];c>=0&&this.startIndices[c]>=u;){if(e=this.startIndices[c],void 0===s[di.getUid(f=this.startIndicesFeature[c]).toString()]&&f.getGeometry()&&(void 0===n||rs.intersects(n,f.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,e,o);var l=h(f);if(l)return l}c--,o=e}},Zr.prototype.setStrokeStyle_=function(t,i,s,h){t.uniform4fv(this.defaultLocations_.u_color,i),t.uniform1f(this.defaultLocations_.u_lineWidth,s),t.uniform1f(this.defaultLocations_.u_miterLimit,h)},Zr.prototype.setFillStrokeStyle=function(t,i){var s=i.getLineCap();this.state_.lineCap=void 0!==s?s:Fr.defaultLineCap;var h=i.getLineDash();this.state_.lineDash=h||Fr.defaultLineDash;var n=i.getLineDashOffset();this.state_.lineDashOffset=n||Fr.defaultLineDashOffset;var r=i.getLineJoin();this.state_.lineJoin=void 0!==r?r:Fr.defaultLineJoin;var e=i.getColor();e=e instanceof CanvasGradient||e instanceof CanvasPattern?Fr.defaultStrokeStyle:Rn.asArray(e).map((function(t,i){return 3!=i?t/255:t}))||Fr.defaultStrokeStyle;var o=i.getWidth();o=void 0!==o?o:Fr.defaultLineWidth;var a=i.getMiterLimit();a=void 0!==a?a:Fr.defaultMiterLimit,this.state_.strokeColor&&hs.equals(this.state_.strokeColor,e)&&this.state_.lineWidth===o&&this.state_.miterLimit===a||(this.state_.changed=!0,this.state_.strokeColor=e,this.state_.lineWidth=o,this.state_.miterLimit=a,this.styles_.push([e,o,a]))},Zr.Instruction_={ROUND:2,BEGIN_LINE:3,END_LINE:5,BEGIN_LINE_CAP:7,END_LINE_CAP:11,BEVEL_FIRST:13,BEVEL_SECOND:17,MITER_BOTTOM:19,MITER_TOP:23};var Kr={};Kr.fragment=new kr(di.DEBUG_WEBGL?"precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),Kr.vertex=new Rr(di.DEBUG_WEBGL?"\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n":"attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}");var Qr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"b"),this.u_offsetScaleMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetScaleMatrix":"c"),this.u_offsetRotateMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetRotateMatrix":"d"),this.u_color=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_color":"e"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"f"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"a")},$r=function(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.lineCap_=i.lineCap,this.lineDash_=void 0!==i.lineDash?i.lineDash:null,this.lineDashOffset_=i.lineDashOffset,this.lineJoin_=i.lineJoin,this.miterLimit_=i.miterLimit,this.width_=i.width,this.checksum_=void 0};$r.prototype.clone=function(){var t=this.getColor();return new $r({color:t&&t.slice?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},$r.prototype.getColor=function(){return this.color_},$r.prototype.getLineCap=function(){return this.lineCap_},$r.prototype.getLineDash=function(){return this.lineDash_},$r.prototype.getLineDashOffset=function(){return this.lineDashOffset_},$r.prototype.getLineJoin=function(){return this.lineJoin_},$r.prototype.getMiterLimit=function(){return this.miterLimit_},$r.prototype.getWidth=function(){return this.width_},$r.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},$r.prototype.setLineCap=function(t){this.lineCap_=t,this.checksum_=void 0},$r.prototype.setLineDash=function(t){this.lineDash_=t,this.checksum_=void 0},$r.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t,this.checksum_=void 0},$r.prototype.setLineJoin=function(t){this.lineJoin_=t,this.checksum_=void 0},$r.prototype.setMiterLimit=function(t){this.miterLimit_=t,this.checksum_=void 0},$r.prototype.setWidth=function(t){this.width_=t,this.checksum_=void 0},$r.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.checksum_+=this.color_?"string"==typeof this.color_?this.color_:di.getUid(this.color_).toString():"-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var te=function(t){this.first_=void 0,this.last_=void 0,this.head_=void 0,this.circular_=void 0===t||t,this.length_=0};te.prototype.insertItem=function(t){var i={prev:void 0,next:void 0,data:t},s=this.head_;if(s){var h=s.next;i.prev=s,i.next=h,s.next=i,h&&(h.prev=i),s===this.last_&&(this.last_=i)}else this.first_=i,this.last_=i,this.circular_&&(i.next=i,i.prev=i);this.head_=i,this.length_++},te.prototype.removeItem=function(){var t=this.head_;if(t){var i=t.next,s=t.prev;i&&(i.prev=s),s&&(s.next=i),this.head_=i||s,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===t?this.first_=this.head_:this.last_===t&&(this.last_=s?this.head_.prev:this.head_),this.length_--}},te.prototype.firstItem=function(){if(this.head_=this.first_,this.head_)return this.head_.data},te.prototype.lastItem=function(){if(this.head_=this.last_,this.head_)return this.head_.data},te.prototype.nextItem=function(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data},te.prototype.getNextItem=function(){if(this.head_&&this.head_.next)return this.head_.next.data},te.prototype.prevItem=function(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data},te.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev)return this.head_.prev.data},te.prototype.getCurrItem=function(){if(this.head_)return this.head_.data},te.prototype.setFirstItem=function(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)},te.prototype.concat=function(t){if(t.head_){if(this.head_){var i=this.head_.next;this.head_.next=t.first_,t.first_.prev=this.head_,i.prev=t.last_,t.last_.next=i,this.length_+=t.length_}else this.head_=t.head_,this.first_=t.first_,this.last_=t.last_,this.length_=t.length_;t.head_=void 0,t.first_=void 0,t.last_=void 0,t.length_=0}},te.prototype.getLength=function(){return this.length_};var ie=function(t){this.rbush_=Bn(t),this.items_={}};ie.prototype.insert=function(t,i){var s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(s),this.items_[di.getUid(i)]=s},ie.prototype.load=function(t,i){for(var s=new Array(i.length),h=0,n=i.length;h<n;h++){var r=t[h],e=i[h],o={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:e};s[h]=o,this.items_[di.getUid(e)]=o}this.rbush_.load(s)},ie.prototype.remove=function(t){var i=di.getUid(t),s=this.items_[i];return delete this.items_[i],null!==this.rbush_.remove(s)},ie.prototype.update=function(t,i){var s=this.items_[di.getUid(i)];rs.equals([s.minX,s.minY,s.maxX,s.maxY],t)||(this.remove(i),this.insert(t,i))},ie.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},ie.prototype.getInExtent=function(t){return this.rbush_.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}).map((function(t){return t.value}))},ie.prototype.forEach=function(t,i){return this.forEach_(this.getAll(),t,i)},ie.prototype.forEachInExtent=function(t,i,s){return this.forEach_(this.getInExtent(t),i,s)},ie.prototype.forEach_=function(t,i,s){for(var h,n=0,r=t.length;n<r;n++)if(h=i.call(s,t[n]))return h;return h},ie.prototype.isEmpty=function(){return Si.isEmpty(this.items_)},ie.prototype.clear=function(){this.rbush_.clear(),this.items_={}},ie.prototype.getExtent=function(t){var i=this.rbush_.data;return rs.createOrUpdate(i.minX,i.minY,i.maxX,i.maxY,t)},ie.prototype.concat=function(t){for(var i in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[0|i]=t.items_[0|i]};var se=function(t,i){Ir.call(this,t,i),this.lineStringReplay=new Zr(t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={fillColor:null,changed:!1}};di.inherits(se,Ir),se.prototype.drawCoordinates_=function(t,i,s){var h=new te,n=new ie;this.processFlatCoordinates_(t,s,h,n,!0);var r=this.getMaxCoords_(h);if(i.length){var e,o,a=[];for(e=0,o=i.length;e<o;++e){var u={list:new te,maxCoords:void 0,rtree:new ie};a.push(u),this.processFlatCoordinates_(i[e],s,u.list,u.rtree,!1),this.classifyPoints_(u.list,u.rtree,!0),u.maxCoords=this.getMaxCoords_(u.list)}for(a.sort((function(t,i){return i.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-i.maxCoords[1]:i.maxCoords[0]-t.maxCoords[0]})),e=0;e<a.length;++e){var f,c=a[e].list,l=c.firstItem(),v=l;do{if(this.getIntersections_(v,n).length){f=!0;break}v=c.nextItem()}while(l!==v);f||this.bridgeHole_(c,a[e].maxCoords[0],h,r[0],n)&&(n.concat(a[e].rtree),this.classifyPoints_(h,n,!1))}}else this.classifyPoints_(h,n,!1);this.triangulate_(h,n)},se.prototype.processFlatCoordinates_=function(t,i,s,h,n){var r,e,o,a,u,f=Is.linearRingIsClockwise(t,0,t.length,i),c=this.vertices.length/2,l=[],v=[];if(n===f){for(a=o=this.createPoint_(t[0],t[1],c++),r=i,e=t.length;r<e;r+=i)u=this.createPoint_(t[r],t[r+1],c++),v.push(this.insertItem_(a,u,s)),l.push([Math.min(a.x,u.x),Math.min(a.y,u.y),Math.max(a.x,u.x),Math.max(a.y,u.y)]),a=u;v.push(this.insertItem_(u,o,s)),l.push([Math.min(a.x,u.x),Math.min(a.y,u.y),Math.max(a.x,u.x),Math.max(a.y,u.y)])}else{var d=t.length-i;for(a=o=this.createPoint_(t[d],t[d+1],c++),r=d-i,e=0;r>=e;r-=i)u=this.createPoint_(t[r],t[r+1],c++),v.push(this.insertItem_(a,u,s)),l.push([Math.min(a.x,u.x),Math.min(a.y,u.y),Math.max(a.x,u.x),Math.max(a.y,u.y)]),a=u;v.push(this.insertItem_(u,o,s)),l.push([Math.min(a.x,u.x),Math.min(a.y,u.y),Math.max(a.x,u.x),Math.max(a.y,u.y)])}h.load(l,v)},se.prototype.getMaxCoords_=function(t){var i=t.firstItem(),s=i,h=[s.p0.x,s.p0.y];do{(s=t.nextItem()).p0.x>h[0]&&(h=[s.p0.x,s.p0.y])}while(s!==i);return h},se.prototype.classifyPoints_=function(t,i,s){var h=t.firstItem(),n=h,r=t.nextItem(),e=!1;do{var o=s?Fr.triangleIsCounterClockwise(r.p1.x,r.p1.y,n.p1.x,n.p1.y,n.p0.x,n.p0.y):Fr.triangleIsCounterClockwise(n.p0.x,n.p0.y,n.p1.x,n.p1.y,r.p1.x,r.p1.y);void 0===o?(this.removeItem_(n,r,t,i),e=!0,r===h&&(h=t.getNextItem()),r=n,t.prevItem()):n.p1.reflex!==o&&(n.p1.reflex=o,e=!0),n=r,r=t.nextItem()}while(n!==h);return e},se.prototype.bridgeHole_=function(t,i,s,h,n){for(var r=t.firstItem();r.p1.x!==i;)r=t.nextItem();var e,o,a,u,f=r.p1,c={x:h,y:f.y,i:-1},l=1/0,v=this.getIntersections_({p0:f,p1:c},n,!0);for(e=0,o=v.length;e<o;++e){var d=v[e],M=this.calculateIntersection_(f,c,d.p0,d.p1,!0),m=Math.abs(f.x-M[0]);m<l&&void 0!==Fr.triangleIsCounterClockwise(f.x,f.y,d.p0.x,d.p0.y,d.p1.x,d.p1.y)&&(l=m,u={x:M[0],y:M[1],i:-1},r=d)}if(l===1/0)return!1;if(a=r.p1,l>0){var p=this.getPointsInTriangle_(f,u,r.p1,n);if(p.length){var g=1/0;for(e=0,o=p.length;e<o;++e){var _=p[e],w=Math.atan2(f.y-_.y,c.x-_.x);(w<g||w===g&&_.x<a.x)&&(g=w,a=_)}}}for(r=s.firstItem();r.p1.x!==a.x||r.p1.y!==a.y;)r=s.nextItem();var y={x:f.x,y:f.y,i:f.i,reflex:void 0},b={x:r.p1.x,y:r.p1.y,i:r.p1.i,reflex:void 0};return t.getNextItem().p0=y,this.insertItem_(f,r.p1,t,n),this.insertItem_(b,y,t,n),r.p1=b,t.setFirstItem(),s.concat(t),!0},se.prototype.triangulate_=function(t,i){for(var s=!1,h=this.isSimple_(t,i);t.getLength()>3;)if(h){if(!this.clipEars_(t,i,h,s)&&!this.classifyPoints_(t,i,s)&&!this.resolveSelfIntersections_(t,i,!0))break}else if(!this.clipEars_(t,i,h,s)&&!this.classifyPoints_(t,i,s)&&!this.resolveSelfIntersections_(t,i)){if(!(h=this.isSimple_(t,i))){this.splitPolygon_(t,i);break}s=!this.isClockwise_(t),this.classifyPoints_(t,i,s)}if(3===t.getLength()){var n=this.indices.length;this.indices[n++]=t.getPrevItem().p0.i,this.indices[n++]=t.getCurrItem().p0.i,this.indices[n++]=t.getNextItem().p0.i}},se.prototype.clipEars_=function(t,i,s,h){var n,r,e,o=this.indices.length,a=t.firstItem(),u=t.getPrevItem(),f=a,c=t.nextItem(),l=t.getNextItem(),v=!1;do{var d;n=f.p0,e=c.p1,!1===(r=f.p1).reflex&&(d=s?0===this.getPointsInTriangle_(n,r,e,i,!0).length:h?this.diagonalIsInside_(l.p1,e,r,n,u.p0):this.diagonalIsInside_(u.p0,n,r,e,l.p1),(s||0===this.getIntersections_({p0:n,p1:e},i).length)&&d&&(s||!1===n.reflex||!1===e.reflex||Is.linearRingIsClockwise([u.p0.x,u.p0.y,n.x,n.y,r.x,r.y,e.x,e.y,l.p1.x,l.p1.y],0,10,2)===!h)&&(this.indices[o++]=n.i,this.indices[o++]=r.i,this.indices[o++]=e.i,this.removeItem_(f,c,t,i),c===a&&(a=l),v=!0)),u=t.getPrevItem(),f=t.getCurrItem(),c=t.nextItem(),l=t.getNextItem()}while(f!==a&&t.getLength()>3);return v},se.prototype.resolveSelfIntersections_=function(t,i,s){var h=t.firstItem();t.nextItem();var n=h,r=t.nextItem(),e=!1;do{var o=this.calculateIntersection_(n.p0,n.p1,r.p0,r.p1,s);if(o){var a,u=!1,f=this.indices.length,c=this.vertices.length/2,l=t.prevItem();if(t.removeItem(),i.remove(l),u=l===h,s?(o[0]===n.p0.x&&o[1]===n.p0.y?(t.prevItem(),r.p0=a=n.p0,i.remove(n),u=u||n===h):(n.p1=a=r.p1,i.remove(r),u=u||r===h),t.removeItem()):(a=this.createPoint_(o[0],o[1],c),n.p1=a,r.p0=a,i.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n),i.update([Math.min(r.p0.x,r.p1.x),Math.min(r.p0.y,r.p1.y),Math.max(r.p0.x,r.p1.x),Math.max(r.p0.y,r.p1.y)],r)),this.indices[f++]=l.p0.i,this.indices[f++]=l.p1.i,this.indices[f++]=a.i,e=!0,u)break}n=t.getPrevItem(),r=t.nextItem()}while(n!==h);return e},se.prototype.isSimple_=function(t,i){var s=t.firstItem(),h=s;do{if(this.getIntersections_(h,i).length)return!1;h=t.nextItem()}while(h!==s);return!0},se.prototype.isClockwise_=function(t){var i=2*t.getLength(),s=new Array(i),h=t.firstItem(),n=h,r=0;do{s[r++]=n.p0.x,s[r++]=n.p0.y,n=t.nextItem()}while(n!==h);return Is.linearRingIsClockwise(s,0,i,2)},se.prototype.splitPolygon_=function(t,i){var s=t.firstItem(),h=s;do{var n=this.getIntersections_(h,i);if(n.length){var r=n[0],e=this.vertices.length/2,o=this.calculateIntersection_(h.p0,h.p1,r.p0,r.p1),a=this.createPoint_(o[0],o[1],e),u=new te,f=new ie;this.insertItem_(a,h.p1,u,f),h.p1=a,i.update([Math.min(h.p0.x,a.x),Math.min(h.p0.y,a.y),Math.max(h.p0.x,a.x),Math.max(h.p0.y,a.y)],h);for(var c=t.nextItem();c!==r;)this.insertItem_(c.p0,c.p1,u,f),i.remove(c),t.removeItem(),c=t.getCurrItem();this.insertItem_(r.p0,a,u,f),r.p0=a,i.update([Math.min(r.p1.x,a.x),Math.min(r.p1.y,a.y),Math.max(r.p1.x,a.x),Math.max(r.p1.y,a.y)],r),this.classifyPoints_(t,i,!1),this.triangulate_(t,i),this.classifyPoints_(u,f,!1),this.triangulate_(u,f);break}h=t.nextItem()}while(h!==s)},se.prototype.createPoint_=function(t,i,s){var h=this.vertices.length;return this.vertices[h++]=t,this.vertices[h++]=i,{x:t,y:i,i:s,reflex:void 0}},se.prototype.insertItem_=function(t,i,s,h){var n={p0:t,p1:i};return s.insertItem(n),h&&h.insert([Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x,i.x),Math.max(t.y,i.y)],n),n},se.prototype.removeItem_=function(t,i,s,h){s.getCurrItem()===i&&(s.removeItem(),t.p1=i.p1,h.remove(i),h.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t))},se.prototype.getPointsInTriangle_=function(t,i,s,h,n){var r,e,o,a,u=[],f=h.getInExtent([Math.min(t.x,i.x,s.x),Math.min(t.y,i.y,s.y),Math.max(t.x,i.x,s.x),Math.max(t.y,i.y,s.y)]);for(r=0,e=f.length;r<e;++r)for(o in f[r])"object"!=typeof(a=f[r][o])||n&&!a.reflex||a.x===t.x&&a.y===t.y||a.x===i.x&&a.y===i.y||a.x===s.x&&a.y===s.y||-1!==u.indexOf(a)||!Rs.linearRingContainsXY([t.x,t.y,i.x,i.y,s.x,s.y],0,6,2,a.x,a.y)||u.push(a);return u},se.prototype.getIntersections_=function(t,i,s){var h,n,r=t.p0,e=t.p1,o=i.getInExtent([Math.min(r.x,e.x),Math.min(r.y,e.y),Math.max(r.x,e.x),Math.max(r.y,e.y)]),a=[];for(h=0,n=o.length;h<n;++h){var u=o[h];t!==u&&(s||u.p0!==e||u.p1!==r)&&this.calculateIntersection_(r,e,u.p0,u.p1,s)&&a.push(u)}return a},se.prototype.calculateIntersection_=function(t,i,s,h,n){var r=(h.y-s.y)*(i.x-t.x)-(h.x-s.x)*(i.y-t.y);if(0!==r){var e=((h.x-s.x)*(t.y-s.y)-(h.y-s.y)*(t.x-s.x))/r,o=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/r;if(!n&&e>Fr.EPSILON&&e<1-Fr.EPSILON&&o>Fr.EPSILON&&o<1-Fr.EPSILON||n&&e>=0&&e<=1&&o>=0&&o<=1)return[t.x+e*(i.x-t.x),t.y+e*(i.y-t.y)]}},se.prototype.diagonalIsInside_=function(t,i,s,h,n){if(void 0===i.reflex||void 0===h.reflex)return!1;var r=(s.x-h.x)*(i.y-h.y)>(s.y-h.y)*(i.x-h.x),e=(n.x-h.x)*(i.y-h.y)<(n.y-h.y)*(i.x-h.x),o=(t.x-i.x)*(h.y-i.y)>(t.y-i.y)*(h.x-i.x),a=(s.x-i.x)*(h.y-i.y)<(s.y-i.y)*(h.x-i.x);return(h.reflex?e||r:e&&r)&&(i.reflex?a||o:a&&o)},se.prototype.drawMultiPolygon=function(t,i){var s,h,n,r,e=t.getEndss(),o=t.getStride(),a=this.indices.length,u=this.lineStringReplay.getCurrentIndex(),f=t.getFlatCoordinates(),c=0;for(s=0,h=e.length;s<h;++s){var l=e[s];if(l.length>0){var v=ls(f,c,l[0],o,-this.origin[0],-this.origin[1]);if(v.length){var d,M=[];for(n=1,r=l.length;n<r;++n)l[n]!==l[n-1]&&(d=ls(f,l[n-1],l[n],o,-this.origin[0],-this.origin[1]),M.push(d));this.lineStringReplay.drawPolygonCoordinates(v,M,o),this.drawCoordinates_(v,M,o)}}c=l[l.length-1]}this.indices.length>a&&(this.startIndices.push(a),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(a),this.state_.changed=!1)),this.lineStringReplay.getCurrentIndex()>u&&this.lineStringReplay.setPolygonStyle(i,u)},se.prototype.drawPolygon=function(t,i){var s=t.getEnds(),h=t.getStride();if(s.length>0){var n=t.getFlatCoordinates().map(Number),r=ls(n,0,s[0],h,-this.origin[0],-this.origin[1]);if(r.length){var e,o,a,u=[];for(e=1,o=s.length;e<o;++e)s[e]!==s[e-1]&&(a=ls(n,s[e-1],s[e],h,-this.origin[0],-this.origin[1]),u.push(a));this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.lineStringReplay.setPolygonStyle(i),this.lineStringReplay.drawPolygonCoordinates(r,u,h),this.drawCoordinates_(r,u,h)}}},se.prototype.finish=function(t){this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices),this.startIndices.push(this.indices.length),this.lineStringReplay.finish(t),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},se.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer,h=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(i),t.deleteBuffer(s),h()}},se.prototype.setUpProgram=function(t,i){var s,h=i.getProgram(Kr.fragment,Kr.vertex);return this.defaultLocations_?s=this.defaultLocations_:(s=new Qr(t,h),this.defaultLocations_=s),i.useProgram(h),t.enableVertexAttribArray(s.a_position),t.vertexAttribPointer(s.a_position,2,Ds.FLOAT,!1,8,0),s},se.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position)},se.prototype.drawReplay=function(t,i,s,h){var n,r,e,o=t.getParameter(t.DEPTH_FUNC),a=t.getParameter(t.DEPTH_WRITEMASK);if(h||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Si.isEmpty(s))for(e=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)r=this.styleIndices_[n],this.setFillStyle_(t,this.styles_[n]),this.drawElements(t,i,r,e),e=r;else this.drawReplaySkipping_(t,i,s);h||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(a),t.depthFunc(o))},se.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var r,e,o,a,u,f;for(o=this.startIndices[1+(f=this.startIndices.length-2)],r=this.styleIndices_.length-1;r>=0;--r)for(this.setFillStyle_(t,this.styles_[r]),a=this.styleIndices_[r];f>=0&&this.startIndices[f]>=a;){if(e=this.startIndices[f],void 0===s[di.getUid(u=this.startIndicesFeature[f]).toString()]&&u.getGeometry()&&(void 0===n||rs.intersects(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,e,o);var c=h(u);if(c)return c}f--,o=e}},se.prototype.drawReplaySkipping_=function(t,i,s){var h,n,r,e,o,a;for(r=n=this.startIndices[1+(o=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setFillStyle_(t,this.styles_[h]),e=this.styleIndices_[h];o>=0&&this.startIndices[o]>=e;)a=this.startIndices[o],s[di.getUid(this.startIndicesFeature[o]).toString()]&&(n!==r&&(this.drawElements(t,i,n,r),t.clear(t.DEPTH_BUFFER_BIT)),r=a),o--,n=a;n!==r&&(this.drawElements(t,i,n,r),t.clear(t.DEPTH_BUFFER_BIT)),n=r=e}},se.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_color,i)},se.prototype.setFillStrokeStyle=function(t,i){var s=t?t.getColor():[0,0,0,0];if(s=s instanceof CanvasGradient||s instanceof CanvasPattern?Fr.defaultFillStyle:Rn.asArray(s).map((function(t,i){return 3!=i?t/255:t}))||Fr.defaultFillStyle,this.state_.fillColor&&hs.equals(s,this.state_.fillColor)||(this.state_.fillColor=s,this.state_.changed=!0,this.styles_.push(s)),i)this.lineStringReplay.setFillStrokeStyle(null,i);else{var h=new $r({color:[0,0,0,0],lineWidth:0});this.lineStringReplay.setFillStrokeStyle(null,h)}};var he=function(t,i){this.space_=i,this.emptyBlocks_=[{x:0,y:0,width:t,height:t}],this.entries_={},this.context_=xh(t,t),this.canvas_=this.context_.canvas};he.prototype.get=function(t){return this.entries_[t]||null},he.prototype.add=function(t,i,s,h,n){var r,e,o;for(e=0,o=this.emptyBlocks_.length;e<o;++e)if((r=this.emptyBlocks_[e]).width>=i+this.space_&&r.height>=s+this.space_){var a={offsetX:r.x+this.space_,offsetY:r.y+this.space_,image:this.canvas_};return this.entries_[t]=a,h.call(n,this.context_,r.x+this.space_,r.y+this.space_),this.split_(e,r,i+this.space_,s+this.space_),a}return null},he.prototype.split_=function(t,i,s,h){i.width-s>i.height-h?this.updateBlocks_(t,{x:i.x+s,y:i.y,width:i.width-s,height:i.height},{x:i.x,y:i.y+h,width:s,height:i.height-h}):this.updateBlocks_(t,{x:i.x+s,y:i.y,width:i.width-s,height:h},{x:i.x,y:i.y+h,width:i.width,height:i.height-h})},he.prototype.updateBlocks_=function(t,i,s){var h=[t,1];i.width>0&&i.height>0&&h.push(i),s.width>0&&s.height>0&&h.push(s),this.emptyBlocks_.splice.apply(this.emptyBlocks_,h)};var ne=function(t){var i=t||{};this.currentSize_=void 0!==i.initialSize?i.initialSize:di.INITIAL_ATLAS_SIZE,this.maxSize_=void 0!==i.maxSize?i.maxSize:-1!=di.MAX_ATLAS_SIZE?di.MAX_ATLAS_SIZE:void 0!==di.WEBGL_MAX_TEXTURE_SIZE?di.WEBGL_MAX_TEXTURE_SIZE:2048,this.space_=void 0!==i.space?i.space:1,this.atlases_=[new he(this.currentSize_,this.space_)],this.currentHitSize_=this.currentSize_,this.hitAtlases_=[new he(this.currentHitSize_,this.space_)]};ne.prototype.getInfo=function(t){var i=this.getInfo_(this.atlases_,t);if(!i)return null;var s=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(i,s)},ne.prototype.getInfo_=function(t,i){var s,h,n;for(h=0,n=t.length;h<n;++h)if(s=t[h].get(i))return s;return null},ne.prototype.mergeInfos_=function(t,i){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:i.image}},ne.prototype.add=function(t,i,s,h,n,r){if(i+this.space_>this.maxSize_||s+this.space_>this.maxSize_)return null;var e=this.add_(!1,t,i,s,h,r);if(!e)return null;var o=this.add_(!0,t,i,s,void 0!==n?n:di.nullFunction,r);return this.mergeInfos_(e,o)},ne.prototype.add_=function(t,i,s,h,n,r){var e,o,a,u,f=t?this.hitAtlases_:this.atlases_;for(a=0,u=f.length;a<u;++a){if(o=(e=f[a]).add(i,s,h,n,r))return o;var c;o||a!==u-1||(t?(c=Math.min(2*this.currentHitSize_,this.maxSize_),this.currentHitSize_=c):(c=Math.min(2*this.currentSize_,this.maxSize_),this.currentSize_=c),e=new he(c,this.space_),f.push(e),++u)}return null};var re=function(t,i){qr.call(this,t,i),this.images_=[],this.textures_=[],this.measureCanvas_=xh(0,0).canvas,this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.atlases_={},this.currAtlas_=void 0,this.scale=1,this.opacity=1};di.inherits(re,qr),re.prototype.drawText=function(t,i){if(this.text_){var s=null,h=2,n=2;switch(t.getType()){case Yi:case Ki:h=(s=t.getFlatCoordinates()).length,n=t.getStride();break;case is:s=t.getCenter();break;case Hi:s=t.getFlatMidpoint();break;case Qi:h=(s=t.getFlatMidpoints()).length;break;case Zi:s=t.getFlatInteriorPoint();break;case $i:h=(s=t.getFlatInteriorPoints()).length}this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var r,e,o,a,u,f,c,l,v=this.currAtlas_,d=this.text_.split("\n"),M=this.getTextSize_(d),m=Math.round(M[0]*this.textAlign_-this.offsetX_),p=Math.round(M[1]*this.textBaseline_-this.offsetY_),g=this.state_.lineWidth/2*this.state_.scale;for(r=0,e=d.length;r<e;++r)for(u=0,f=v.height*r,o=0,a=(c=d[r].split("")).length;o<a;++o){if(l=v.atlas.getInfo(c[o])){var _=l.image;this.anchorX=m-u,this.anchorY=p-f,this.originX=0===o?l.offsetX-g:l.offsetX,this.originY=l.offsetY,this.height=v.height,this.width=0===o||o===c.length-1?v.width[c[o]]+g:v.width[c[o]],this.imageHeight=_.height,this.imageWidth=_.width,0===this.images_.length?this.images_.push(_):di.getUid(this.images_[this.images_.length-1])!=di.getUid(_)&&(this.groupIndices.push(this.indices.length),this.images_.push(_)),this.drawText_(s,0,h,n)}u+=this.width}}},re.prototype.getTextSize_=function(t){var i=this,s=this.currAtlas_,h=t.length*s.height;return[t.map((function(t){var h,n,r=0;for(h=0,n=t.length;h<n;++h){var e=t[h];s.width[e]||i.addCharToAtlas_(e),r+=s.width[e]?s.width[e]:0}return r})).reduce((function(t,i){return Math.max(t,i)})),h]},re.prototype.drawText_=function(t,i,s,h){var n,r;for(n=i,r=s;n<r;n+=h)this.drawCoordinates(t,i,s,h)},re.prototype.addCharToAtlas_=function(t){if(1===t.length){var i=this.currAtlas_,s=this.state_,h=this.measureCanvas_.getContext("2d");h.font=s.font;var n=Math.ceil(h.measureText(t).width*s.scale);i.atlas.add(t,n,i.height,(function(i,h,n){i.font=s.font,i.fillStyle=s.fillColor,i.strokeStyle=s.strokeColor,i.lineWidth=s.lineWidth,i.lineCap=s.lineCap,i.lineJoin=s.lineJoin,i.miterLimit=s.miterLimit,i.textAlign="left",i.textBaseline="top",Ws.CANVAS_LINE_DASH&&s.lineDash&&(i.setLineDash(s.lineDash),i.lineDashOffset=s.lineDashOffset),1!==s.scale&&i.setTransform(s.scale,0,0,s.scale,0,0),s.strokeColor&&i.strokeText(t,h,n),s.fillColor&&i.fillText(t,h,n)}))&&(i.width[t]=n)}},re.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices=this.groupIndices,this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices),this.createTextures(this.textures_,this.images_,{},i),this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.images_=null,this.atlases_={},this.currAtlas_=void 0,qr.prototype.finish.call(this,t)},re.prototype.setTextStyle=function(t){var i=this.state_,s=t.getFill(),h=t.getStroke();if(t&&t.getText()&&(s||h)){if(s){var n=s.getColor();i.fillColor=Pn.asColorLike(n||Fr.defaultFillStyle)}else i.fillColor=null;if(h){var r=h.getColor();i.strokeColor=Pn.asColorLike(r||Fr.defaultStrokeStyle),i.lineWidth=h.getWidth()||Fr.defaultLineWidth,i.lineCap=h.getLineCap()||Fr.defaultLineCap,i.lineDashOffset=h.getLineDashOffset()||Fr.defaultLineDashOffset,i.lineJoin=h.getLineJoin()||Fr.defaultLineJoin,i.miterLimit=h.getMiterLimit()||Fr.defaultMiterLimit;var e=h.getLineDash();i.lineDash=e?e.slice():Fr.defaultLineDash}else i.strokeColor=null,i.lineWidth=0;i.font=t.getFont()||Fr.defaultFont,i.scale=t.getScale()||1,this.text_=t.getText();var o=pr.TEXT_ALIGN[t.getTextAlign()],a=pr.TEXT_ALIGN[t.getTextBaseline()];this.textAlign_=void 0===o?Fr.defaultTextAlign:o,this.textBaseline_=void 0===a?Fr.defaultTextBaseline:a,this.offsetX_=t.getOffsetX()||0,this.offsetY_=t.getOffsetY()||0,this.rotateWithView=!!t.getRotateWithView(),this.rotation=t.getRotation()||0,this.currAtlas_=this.getAtlas_(i)}else this.text_=""},re.prototype.getAtlas_=function(t){var i,s=[];for(i in t)(t[i]||0===t[i])&&(Array.isArray(t[i])?s=s.concat(t[i]):s.push(t[i]));var h=this.calculateHash_(s);if(!this.atlases_[h]){var n=this.measureCanvas_.getContext("2d");n.font=t.font;var r=Math.ceil((1.5*n.measureText("M").width+t.lineWidth/2)*t.scale);this.atlases_[h]={atlas:new ne({space:t.lineWidth+1}),width:{},height:r}}return this.atlases_[h]},re.prototype.calculateHash_=function(t){var i,s,h="";for(i=0,s=t.length;i<s;++i)h+=t[i];return h},re.prototype.getTextures=function(){return this.textures_},re.prototype.getHitDetectionTextures=function(){return this.textures_};var ee=function(t,i,s){er.call(this),this.maxExtent_=i,this.tolerance_=t,this.renderBuffer_=s,this.replaysByZIndex_={}};di.inherits(ee,er),ee.prototype.addDeclutter=function(){},ee.prototype.getDeleteResourcesFunction=function(t){var i,s=[];for(i in this.replaysByZIndex_){var h,n=this.replaysByZIndex_[i];for(h in n)s.push(n[h].getDeleteResourcesFunction(t))}return function(){for(var t,i=s.length,h=0;h<i;h++)t=s[h].apply(this,arguments);return t}},ee.prototype.finish=function(t){var i;for(i in this.replaysByZIndex_){var s,h=this.replaysByZIndex_[i];for(s in h)h[s].finish(t)}},ee.prototype.getReplay=function(t,i){var s=void 0!==t?t.toString():"0",h=this.replaysByZIndex_[s];void 0===h&&(this.replaysByZIndex_[s]=h={});var n=h[i];return void 0===n&&(n=new(0,ee.BATCH_CONSTRUCTORS_[i])(this.tolerance_,this.maxExtent_),h[i]=n),n},ee.prototype.isEmpty=function(){return Si.isEmpty(this.replaysByZIndex_)},ee.prototype.replay=function(t,i,s,h,n,r,e,o){var a,u,f,c,l,v,d=Object.keys(this.replaysByZIndex_).map(Number);for(d.sort(hs.numberSafeCompareFunction),a=0,u=d.length;a<u;++a)for(l=this.replaysByZIndex_[d[a].toString()],f=0,c=pr.ORDER.length;f<c;++f)void 0!==(v=l[pr.ORDER[f]])&&v.replay(t,i,s,h,n,r,e,o,void 0,!1)},ee.prototype.replayHitDetection_=function(t,i,s,h,n,r,e,o,a,u,f){var c,l,v,d,M,m,p=Object.keys(this.replaysByZIndex_).map(Number);for(p.sort((function(t,i){return i-t})),c=0,l=p.length;c<l;++c)for(d=this.replaysByZIndex_[p[c].toString()],v=pr.ORDER.length-1;v>=0;--v)if(void 0!==(M=d[pr.ORDER[v]])&&(m=M.replay(t,i,s,h,n,r,e,o,a,u,f)))return m},ee.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,r,e,o,a,u){var f,c=i.getGL();return c.bindFramebuffer(c.FRAMEBUFFER,i.getHitDetectionFramebuffer()),void 0!==this.renderBuffer_&&(f=rs.buffer(rs.createOrUpdateFromCoordinate(t),h*this.renderBuffer_)),this.replayHitDetection_(i,t,h,n,ee.HIT_DETECTION_SIZE_,e,o,a,(function(t){var i=new Uint8Array(4);if(c.readPixels(0,0,1,1,c.RGBA,c.UNSIGNED_BYTE,i),i[3]>0){var s=u(t);if(s)return s}}),!0,f)},ee.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n,r,e,o,a){var u=i.getGL();return u.bindFramebuffer(u.FRAMEBUFFER,i.getHitDetectionFramebuffer()),void 0!==this.replayHitDetection_(i,t,h,n,ee.HIT_DETECTION_SIZE_,e,o,a,(function(){var t=new Uint8Array(4);return u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,t),t[3]>0}),!1)},ee.HIT_DETECTION_SIZE_=[1,1],ee.BATCH_CONSTRUCTORS_={Circle:Wr,Image:Br,LineString:Zr,Polygon:se,Text:re};var oe=function(t,i,s,h,n,r,e){Tn.call(this),this.context_=t,this.center_=i,this.extent_=r,this.pixelRatio_=e,this.size_=n,this.rotation_=h,this.resolution_=s,this.imageStyle_=null,this.fillStyle_=null,this.strokeStyle_=null,this.textStyle_=null};di.inherits(oe,Tn),oe.prototype.drawText_=function(t,i){var s=this.context_,h=t.getReplay(0,lr);h.setTextStyle(this.textStyle_),h.drawText(i,null),h.finish(s),h.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),h.getDeleteResourcesFunction(s)()},oe.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},oe.prototype.drawGeometry=function(t){switch(t.getType()){case Yi:this.drawPoint(t,null);break;case Hi:this.drawLineString(t,null);break;case Zi:this.drawPolygon(t,null);break;case Ki:this.drawMultiPoint(t,null);break;case Qi:this.drawMultiLineString(t,null);break;case $i:this.drawMultiPolygon(t,null);break;case ts:this.drawGeometryCollection(t,null);break;case is:this.drawCircle(t,null)}},oe.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);s&&rs.intersects(this.extent_,s.getExtent())&&(this.setStyle(i),this.drawGeometry(s))},oe.prototype.drawGeometryCollection=function(t){var i,s,h=t.getGeometriesArray();for(i=0,s=h.length;i<s;++i)this.drawGeometry(h[i])},oe.prototype.drawPoint=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,ur);n.setImageStyle(this.imageStyle_),n.drawPoint(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawMultiPoint=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,ur);n.setImageStyle(this.imageStyle_),n.drawMultiPoint(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawLineString=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,fr);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawLineString(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawMultiLineString=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,fr);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawMultiLineString(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawPolygon=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,cr);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawPolygon(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawMultiPolygon=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,cr);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawMultiPolygon(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawCircle=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,or);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawCircle(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.setImageStyle=function(t){this.imageStyle_=t},oe.prototype.setFillStrokeStyle=function(t,i){this.fillStyle_=t,this.strokeStyle_=i},oe.prototype.setTextStyle=function(t){this.textStyle_=t};var ae={};ae.fragment=new kr(di.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n":"precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}"),ae.vertex=new Rr(di.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}");var ue=function(t,i){this.u_texCoordMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_texCoordMatrix":"d"),this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"e"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"f"),this.u_texture=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_texture":"g"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"b"),this.a_texCoord=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_texCoord":"c")},fe=function(t,i){Ln.call(this,i),this.mapRenderer=t,this.arrayBuffer_=new Dr([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0,this.texCoordMatrix=ys.create(),this.projectionMatrix=ys.create(),this.tmpMat4_=Or(),this.defaultLocations_=null};di.inherits(fe,Ln),fe.prototype.bindFramebuffer=function(t,i){var s=this.mapRenderer.getGL();if(void 0===this.framebufferDimension||this.framebufferDimension!=i){var h=function(t,i,s){t.isContextLost()||(t.deleteFramebuffer(i),t.deleteTexture(s))}.bind(null,s,this.framebuffer,this.texture);t.postRenderFunctions.push(h);var n=Xr.createEmptyTexture(s,i,i),r=s.createFramebuffer();s.bindFramebuffer(Ds.FRAMEBUFFER,r),s.framebufferTexture2D(Ds.FRAMEBUFFER,Ds.COLOR_ATTACHMENT0,Ds.TEXTURE_2D,n,0),this.texture=n,this.framebuffer=r,this.framebufferDimension=i}else s.bindFramebuffer(Ds.FRAMEBUFFER,this.framebuffer)},fe.prototype.composeFrame=function(t,i,s){this.dispatchComposeEvent_(Zh,s,t),s.bindBuffer(Ds.ARRAY_BUFFER,this.arrayBuffer_);var h,n=s.getGL(),r=s.getProgram(ae.fragment,ae.vertex);this.defaultLocations_?h=this.defaultLocations_:(h=new ue(n,r),this.defaultLocations_=h),s.useProgram(r)&&(n.enableVertexAttribArray(h.a_position),n.vertexAttribPointer(h.a_position,2,Ds.FLOAT,!1,16,0),n.enableVertexAttribArray(h.a_texCoord),n.vertexAttribPointer(h.a_texCoord,2,Ds.FLOAT,!1,16,8),n.uniform1i(h.u_texture,0)),n.uniformMatrix4fv(h.u_texCoordMatrix,!1,Lr(this.tmpMat4_,this.getTexCoordMatrix())),n.uniformMatrix4fv(h.u_projectionMatrix,!1,Lr(this.tmpMat4_,this.getProjectionMatrix())),n.uniform1f(h.u_opacity,i.opacity),n.bindTexture(Ds.TEXTURE_2D,this.getTexture()),n.drawArrays(Ds.TRIANGLE_STRIP,0,4),this.dispatchComposeEvent_(Jh,s,t)},fe.prototype.dispatchComposeEvent_=function(t,i,s){var h=this.getLayer();if(h.hasListener(t)){var n=s.viewState,r=new oe(i,n.center,n.resolution,n.rotation,s.size,s.extent,s.pixelRatio),e=new Sn(t,r,s,null,i);h.dispatchEvent(e)}},fe.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix},fe.prototype.getTexture=function(){return this.texture},fe.prototype.getProjectionMatrix=function(){return this.projectionMatrix},fe.prototype.handleWebGLContextLost=function(){this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0},fe.prototype.prepareFrame=function(){},fe.prototype.forEachLayerAtPixel=function(){};var ce=function(t,i){fe.call(this,t,i),this.image_=null,this.hitCanvasContext_=null,this.hitTransformationMatrix_=null};di.inherits(ce,fe),ce.handles=function(t,i){return t===Gh&&i.getType()===xn},ce.create=function(t,i){return new ce(t,i)},ce.prototype.createTexture_=function(t){var i=t.getImage(),s=this.mapRenderer.getGL();return Xr.createTexture(s,i,Ds.CLAMP_TO_EDGE,Ds.CLAMP_TO_EDGE)},ce.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var r=this.getLayer();return r.getSource().forEachFeatureAtCoordinate(t,i.viewState.resolution,i.viewState.rotation,s,i.skippedFeatureUids,(function(t){return h.call(n,t,r)}))},ce.prototype.prepareFrame=function(t,i){var s=this.mapRenderer.getGL(),h=t.pixelRatio,n=t.viewState,r=n.center,e=n.resolution,o=n.rotation,a=this.image_,u=this.texture,f=this.getLayer().getSource(),c=t.viewHints,l=t.extent;if(void 0!==i.extent&&(l=rs.getIntersection(l,i.extent)),!c[0]&&!c[1]&&!rs.isEmpty(l)){var v=n.projection;if(!di.ENABLE_RASTER_REPROJECTION){var d=f.getProjection();d&&(v=d)}var M=f.getImage(l,e,h,v);if(M&&this.loadImage(M)&&(a=M,u=this.createTexture_(M),this.texture)){var m=function(t,i){t.isContextLost()||t.deleteTexture(i)}.bind(null,s,this.texture);t.postRenderFunctions.push(m)}}if(a){var p=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(p.width,p.height,h,r,e,o,a.getExtent()),this.hitTransformationMatrix_=null;var g=this.texCoordMatrix;ys.reset(g),ys.scale(g,1,-1),ys.translate(g,0,-1),this.image_=a,this.texture=u,this.updateLogos(t,f)}return!!a},ce.prototype.updateProjectionMatrix_=function(t,i,s,h,n,r,e){var o=t*n,a=i*n,u=this.projectionMatrix;ys.reset(u),ys.scale(u,2*s/o,2*s/a),ys.rotate(u,-r),ys.translate(u,e[0]-h[0],e[1]-h[1]),ys.scale(u,(e[2]-e[0])/2,(e[3]-e[1])/2),ys.translate(u,1,1)},ce.prototype.hasFeatureAtCoordinate=function(t,i){return void 0!==this.forEachFeatureAtCoordinate(t,i,0,as.TRUE,this)},ce.prototype.forEachLayerAtPixel=function(t,i,s,h){if(this.image_&&this.image_.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==di.nullFunction){var n=ys.apply(i.pixelToCoordinateTransform,t.slice());return this.forEachFeatureAtCoordinate(n,i,0,as.TRUE,this)?s.call(h,this.getLayer(),null):void 0}var r=[this.image_.getImage().width,this.image_.getImage().height];this.hitTransformationMatrix_||(this.hitTransformationMatrix_=this.getHitTransformationMatrix_(i.size,r));var e=ys.apply(this.hitTransformationMatrix_,t.slice());if(!(e[0]<0||e[0]>r[0]||e[1]<0||e[1]>r[1])){this.hitCanvasContext_||(this.hitCanvasContext_=xh(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.image_.getImage(),e[0],e[1],1,1,0,0,1,1);var o=this.hitCanvasContext_.getImageData(0,0,1,1).data;return o[3]>0?s.call(h,this.getLayer(),o):void 0}}},ce.prototype.getHitTransformationMatrix_=function(t,i){var s=ys.create();ys.translate(s,-1,-1),ys.scale(s,2/t[0],2/t[1]),ys.translate(s,0,t[1]),ys.scale(s,1,-1);var h=ys.invert(this.projectionMatrix.slice()),n=ys.create();return ys.translate(n,0,i[1]),ys.scale(n,1,-1),ys.scale(n,i[0]/2,i[1]/2),ys.translate(n,1,1),ys.multiply(n,h),ys.multiply(n,s),n};var le=function(t,i){Vn.call(this,t,i),this.canvas_=document.createElement("CANVAS"),this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=Hh.CLASS_UNSELECTABLE,t.insertBefore(this.canvas_,t.childNodes[0]||null),this.clipTileCanvasWidth_=0,this.clipTileCanvasHeight_=0,this.clipTileContext_=xh(),this.renderedVisible_=!0,this.gl_=Ds.getContext(this.canvas_,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0}),this.context_=new Xr(this.canvas_,this.gl_),Ai.listen(this.canvas_,jr,this.handleWebGLContextLost,this),Ai.listen(this.canvas_,Ur,this.handleWebGLContextRestored,this),this.textureCache_=new An,this.focus_=null,this.tileTextureQueue_=new fh(function(t){var i=t[1],s=t[2],h=i[0]-this.focus_[0],n=i[1]-this.focus_[1];return 65536*Math.log(s)+Math.sqrt(h*h+n*n)/s}.bind(this),(function(t){return t[0].getKey()})),this.loadNextTileTexture_=function(){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var t=this.tileTextureQueue_.dequeue();this.bindTileTexture(t[0],t[3],t[4],Ds.LINEAR,Ds.LINEAR)}return!1}.bind(this),this.textureCacheFrameMarkerCount_=0,this.initializeGL_()};di.inherits(le,Vn),le.handles=function(t){return Ws.WEBGL&&t===Gh},le.create=function(t,i){return new le(t,i)},le.prototype.bindTileTexture=function(t,i,s,h,n){var r=this.getGL(),e=t.getKey();if(this.textureCache_.containsKey(e)){var o=this.textureCache_.get(e);r.bindTexture(Ds.TEXTURE_2D,o.texture),o.magFilter!=h&&(r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_MAG_FILTER,h),o.magFilter=h),o.minFilter!=n&&(r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_MIN_FILTER,n),o.minFilter=n)}else{var a=r.createTexture();if(r.bindTexture(Ds.TEXTURE_2D,a),s>0){var u=this.clipTileContext_.canvas,f=this.clipTileContext_;this.clipTileCanvasWidth_!==i[0]||this.clipTileCanvasHeight_!==i[1]?(u.width=i[0],u.height=i[1],this.clipTileCanvasWidth_=i[0],this.clipTileCanvasHeight_=i[1]):f.clearRect(0,0,i[0],i[1]),f.drawImage(t.getImage(),s,s,i[0],i[1],0,0,i[0],i[1]),r.texImage2D(Ds.TEXTURE_2D,0,Ds.RGBA,Ds.RGBA,Ds.UNSIGNED_BYTE,u)}else r.texImage2D(Ds.TEXTURE_2D,0,Ds.RGBA,Ds.RGBA,Ds.UNSIGNED_BYTE,t.getImage());r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_MAG_FILTER,h),r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_MIN_FILTER,n),r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_WRAP_S,Ds.CLAMP_TO_EDGE),r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_WRAP_T,Ds.CLAMP_TO_EDGE),this.textureCache_.set(e,{texture:a,magFilter:h,minFilter:n})}},le.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();if(s.hasListener(t)){var h=this.context_,n=i.viewState,r=new oe(h,n.center,n.resolution,n.rotation,i.size,i.extent,i.pixelRatio),e=new Sn(t,r,i,null,h);s.dispatchEvent(e)}},le.prototype.disposeInternal=function(){var t=this.getGL();t.isContextLost()||this.textureCache_.forEach((function(i){i&&t.deleteTexture(i.texture)})),this.context_.dispose(),Vn.prototype.disposeInternal.call(this)},le.prototype.expireCache_=function(t,i){for(var s,h=this.getGL();this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>di.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK;){if(s=this.textureCache_.peekLast())h.deleteTexture(s.texture);else{if(+this.textureCache_.peekLastKey()==i.index)break;--this.textureCacheFrameMarkerCount_}this.textureCache_.pop()}},le.prototype.getContext=function(){return this.context_},le.prototype.getGL=function(){return this.gl_},le.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_},le.prototype.getType=function(){return Gh},le.prototype.handleWebGLContextLost=function(t){t.preventDefault(),this.textureCache_.clear(),this.textureCacheFrameMarkerCount_=0;var i=this.getLayerRenderers();for(var s in i)i[s].handleWebGLContextLost()},le.prototype.handleWebGLContextRestored=function(){this.initializeGL_(),this.getMap().render()},le.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(Ds.TEXTURE0),t.blendFuncSeparate(Ds.SRC_ALPHA,Ds.ONE_MINUS_SRC_ALPHA,Ds.ONE,Ds.ONE_MINUS_SRC_ALPHA),t.disable(Ds.CULL_FACE),t.disable(Ds.DEPTH_TEST),t.disable(Ds.SCISSOR_TEST),t.disable(Ds.STENCIL_TEST)},le.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())},le.prototype.renderFrame=function(t){var i=this.getContext(),s=this.getGL();if(s.isContextLost())return!1;if(!t)return this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1),!1;this.focus_=t.focus,this.textureCache_.set((-t.index).toString(),null),++this.textureCacheFrameMarkerCount_,this.dispatchComposeEvent_(Zh,t);var h=[],n=t.layerStatesArray;hs.stableSort(n,Vn.sortByZIndex);var r,e,o,a=t.viewState.resolution;for(r=0,e=n.length;r<e;++r)Qh.visibleAtResolution(o=n[r],a)&&o.sourceState==Oh&&this.getLayerRenderer(o.layer).prepareFrame(t,o,i)&&h.push(o);var u=t.size[0]*t.pixelRatio,f=t.size[1]*t.pixelRatio;for(this.canvas_.width==u&&this.canvas_.height==f||(this.canvas_.width=u,this.canvas_.height=f),s.bindFramebuffer(Ds.FRAMEBUFFER,null),s.clearColor(0,0,0,0),s.clear(Ds.COLOR_BUFFER_BIT),s.enable(Ds.BLEND),s.viewport(0,0,this.canvas_.width,this.canvas_.height),r=0,e=h.length;r<e;++r)this.getLayerRenderer((o=h[r]).layer).composeFrame(t,o,i);this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.calculateMatrices2D(t),this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>di.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK&&t.postRenderFunctions.push(this.expireCache_.bind(this)),this.tileTextureQueue_.isEmpty()||(t.postRenderFunctions.push(this.loadNextTileTexture_),t.animate=!0),this.dispatchComposeEvent_(Jh,t),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)},le.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,r,e){var o;if(this.getGL().isContextLost())return!1;var a,u=i.viewState,f=i.layerStatesArray;for(a=f.length-1;a>=0;--a){var c=f[a],l=c.layer;if(Qh.visibleAtResolution(c,u.resolution)&&r.call(e,l)&&(o=this.getLayerRenderer(l).forEachFeatureAtCoordinate(t,i,s,h,n)))return o}},le.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n){var r=!1;if(this.getGL().isContextLost())return!1;var e,o=i.viewState,a=i.layerStatesArray;for(e=a.length-1;e>=0;--e){var u=a[e],f=u.layer;if(Qh.visibleAtResolution(u,o.resolution)&&h.call(n,f)&&(r=this.getLayerRenderer(f).hasFeatureAtCoordinate(t,i)))return!0}return r},le.prototype.forEachLayerAtPixel=function(t,i,s,h,n){if(this.getGL().isContextLost())return!1;var r,e,o=i.viewState,a=i.layerStatesArray;for(e=a.length-1;e>=0;--e){var u=a[e],f=u.layer;if(Qh.visibleAtResolution(u,o.resolution)&&n.call(h,f)&&(r=this.getLayerRenderer(f).forEachLayerAtPixel(t,i,s,h)))return r}};var ve={};ve.fragment=new kr(di.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n":"precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}"),ve.vertex=new Rr(di.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}");var de=function(t,i){this.u_tileOffset=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_tileOffset":"d"),this.u_texture=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_texture":"e"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"b"),this.a_texCoord=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_texCoord":"c")},Me=function(t,i){fe.call(this,t,i),this.fragmentShader_=ve.fragment,this.vertexShader_=ve.vertex,this.locations_=null,this.renderArrayBuffer_=new Dr([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]),this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,this.tmpSize_=[0,0]};di.inherits(Me,fe),Me.handles=function(t,i){return t===Gh&&i.getType()===En},Me.create=function(t,i){return new Me(t,i)},Me.prototype.disposeInternal=function(){this.mapRenderer.getContext().deleteBuffer(this.renderArrayBuffer_),fe.prototype.disposeInternal.call(this)},Me.prototype.createLoadedTileFinder=function(t,i,s){var h=this.mapRenderer;return function(n,r){return t.forEachLoadedTile(i,n,r,(function(t){var i=h.isTileTextureLoaded(t);return i&&(s[n]||(s[n]={}),s[n][t.tileCoord.toString()]=t),i}))}},Me.prototype.handleWebGLContextLost=function(){fe.prototype.handleWebGLContextLost.call(this),this.locations_=null},Me.prototype.prepareFrame=function(t,i,s){var h,n=this.mapRenderer,r=s.getGL(),e=t.viewState,o=e.projection,a=this.getLayer(),u=a.getSource(),f=u.getTileGridForProjection(o),c=f.getZForResolution(e.resolution),l=f.getResolution(c),v=u.getTilePixelSize(c,t.pixelRatio,o),d=v[0]/Uh(f.getTileSize(c),this.tmpSize_)[0],M=l/d,m=u.getTilePixelRatio(d)*u.getGutter(o),p=e.center,g=t.extent,_=f.getTileRangeForExtentAndZ(g,c);if(this.renderedTileRange_&&this.renderedTileRange_.equals(_)&&this.renderedRevision_==u.getRevision())h=this.renderedFramebufferExtent_;else{var w=_.getSize(),y=Math.max(w[0]*v[0],w[1]*v[1]),b=Bi.roundUpToPowerOfTwo(y),x=M*b,E=f.getOrigin(c),C=E[0]+_.minX*v[0]*M,S=E[1]+_.minY*v[1]*M;h=[C,S,C+x,S+x],this.bindFramebuffer(t,b),r.viewport(0,0,b,b),r.clearColor(0,0,0,0),r.clear(Ds.COLOR_BUFFER_BIT),r.disable(Ds.BLEND);var A=s.getProgram(this.fragmentShader_,this.vertexShader_);s.useProgram(A),this.locations_||(this.locations_=new de(r,A)),s.bindBuffer(Ds.ARRAY_BUFFER,this.renderArrayBuffer_),r.enableVertexAttribArray(this.locations_.a_position),r.vertexAttribPointer(this.locations_.a_position,2,Ds.FLOAT,!1,16,0),r.enableVertexAttribArray(this.locations_.a_texCoord),r.vertexAttribPointer(this.locations_.a_texCoord,2,Ds.FLOAT,!1,16,8),r.uniform1i(this.locations_.u_texture,0);var N={};N[c]={};var z,k,R,P,T,O,L=this.createLoadedTileFinder(u,o,N),I=a.getUseInterimTilesOnError(),F=!0,D=rs.createEmpty(),W=new Un(0,0,0,0);for(P=_.minX;P<=_.maxX;++P)for(T=_.minY;T<=_.maxY;++T)if(k=u.getTile(c,P,T,d,o),void 0===i.extent||(O=f.getTileCoordExtent(k.tileCoord,D),rs.intersects(O,i.extent))){if(2==(R=k.getState())||4==R||3==R&&!I||(k=k.getInterimTile()),2==(R=k.getState())){if(n.isTileTextureLoaded(k)){N[c][k.tileCoord.toString()]=k;continue}}else if(4==R||3==R&&!I)continue;F=!1,f.forEachTileCoordParentTileRange(k.tileCoord,L,null,W,D)||(z=f.getTileCoordChildTileRange(k.tileCoord,W,D))&&L(c+1,z)}var G=Object.keys(N).map(Number);G.sort(hs.numberSafeCompareFunction);var V,j,U,X,q=new Float32Array(4);for(V=0,j=G.length;V<j;++V)for(U in X=N[G[V]])O=f.getTileCoordExtent((k=X[U]).tileCoord,D),q[0]=2*(O[2]-O[0])/x,q[1]=2*(O[3]-O[1])/x,q[2]=2*(O[0]-h[0])/x-1,q[3]=2*(O[1]-h[1])/x-1,r.uniform4fv(this.locations_.u_tileOffset,q),n.bindTileTexture(k,v,m*d,Ds.LINEAR,Ds.LINEAR),r.drawArrays(Ds.TRIANGLE_STRIP,0,4);F?(this.renderedTileRange_=_,this.renderedFramebufferExtent_=h,this.renderedRevision_=u.getRevision()):(this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,t.animate=!0)}this.updateUsedTiles(t.usedTiles,u,c,_);var B=n.getTileTextureQueue();this.manageTilePyramid(t,u,f,d,o,g,c,a.getPreload(),(function(t){2!=t.getState()||n.isTileTextureLoaded(t)||B.isKeyQueued(t.getKey())||B.enqueue([t,f.getTileCoordCenter(t.tileCoord),f.getResolution(t.tileCoord[0]),v,m*d])}),this),this.scheduleExpireCache(t,u),this.updateLogos(t,u);var Y=this.texCoordMatrix;return ys.reset(Y),ys.translate(Y,(Math.round(p[0]/l)*l-h[0])/(h[2]-h[0]),(Math.round(p[1]/l)*l-h[1])/(h[3]-h[1])),0!==e.rotation&&ys.rotate(Y,e.rotation),ys.scale(Y,t.size[0]*e.resolution/(h[2]-h[0]),t.size[1]*e.resolution/(h[3]-h[1])),ys.translate(Y,-.5,-.5),!0},Me.prototype.forEachLayerAtPixel=function(t,i,s,h){if(this.framebuffer){var n=ys.apply(this.texCoordMatrix,[t[0]/i.size[0],(i.size[1]-t[1])/i.size[1]].slice()),r=[n[0]*this.framebufferDimension,n[1]*this.framebufferDimension],e=this.mapRenderer.getContext().getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer);var o=new Uint8Array(4);return e.readPixels(r[0],r[1],1,1,e.RGBA,e.UNSIGNED_BYTE,o),o[3]>0?s.call(h,this.getLayer(),o):void 0}};var me=function(t,i){fe.call(this,t,i),this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=rs.createEmpty(),this.renderedRenderOrder_=null,this.replayGroup_=null,this.layerState_=null};di.inherits(me,fe),me.handles=function(t,i){return t===Gh&&i.getType()===Cn},me.create=function(t,i){return new me(t,i)},me.prototype.composeFrame=function(t,i,s){this.layerState_=i;var h=t.viewState,n=this.replayGroup_,r=t.size,e=t.pixelRatio,o=this.mapRenderer.getGL();n&&!n.isEmpty()&&(o.enable(o.SCISSOR_TEST),o.scissor(0,0,r[0]*e,r[1]*e),n.replay(s,h.center,h.resolution,h.rotation,r,e,i.opacity,i.managed?t.skippedFeatureUids:{}),o.disable(o.SCISSOR_TEST))},me.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var i=this.mapRenderer.getContext();t.getDeleteResourcesFunction(i)(),this.replayGroup_=null}fe.prototype.disposeInternal.call(this)},me.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){if(this.replayGroup_&&this.layerState_){var r=this.mapRenderer.getContext(),e=i.viewState,o=this.getLayer(),a={};return this.replayGroup_.forEachFeatureAtCoordinate(t,r,e.center,e.resolution,e.rotation,i.size,i.pixelRatio,this.layerState_.opacity,{},(function(t){var i=di.getUid(t).toString();if(!(i in a))return a[i]=!0,h.call(n,t,o)}))}},me.prototype.hasFeatureAtCoordinate=function(t,i){if(this.replayGroup_&&this.layerState_){var s=this.mapRenderer.getContext(),h=i.viewState;return this.replayGroup_.hasFeatureAtCoordinate(t,s,h.center,h.resolution,h.rotation,i.size,i.pixelRatio,this.layerState_.opacity,i.skippedFeatureUids)}return!1},me.prototype.forEachLayerAtPixel=function(t,i,s,h){var n=ys.apply(i.pixelToCoordinateTransform,t.slice());return this.hasFeatureAtCoordinate(n,i)?s.call(h,this.getLayer(),null):void 0},me.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},me.prototype.prepareFrame=function(t,i,s){var h=this.getLayer(),n=h.getSource();this.updateLogos(t,n);var r=t.viewHints[0],e=t.viewHints[1],o=h.getUpdateWhileAnimating(),a=h.getUpdateWhileInteracting();if(!this.dirty_&&!o&&r||!a&&e)return!0;var u=t.extent,f=t.viewState,c=f.projection,l=f.resolution,v=t.pixelRatio,d=h.getRevision(),M=h.getRenderBuffer(),m=h.getRenderOrder();void 0===m&&(m=Cr.defaultOrder);var p=rs.buffer(u,M*l);if(!this.dirty_&&this.renderedResolution_==l&&this.renderedRevision_==d&&this.renderedRenderOrder_==m&&rs.containsExtent(this.renderedExtent_,p))return!0;this.replayGroup_&&t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(s)),this.dirty_=!1;var g=new ee(Cr.getTolerance(l,v),p,h.getRenderBuffer());n.loadFeatures(p,l,c);var _=function(t){var i,s=t.getStyleFunction();if(s?i=s.call(t,l):(s=h.getStyleFunction())&&(i=s(t,l)),i){var n=this.renderFeature(t,l,v,i,g);this.dirty_=this.dirty_||n}};if(m){var w=[];n.forEachFeatureInExtent(p,(function(t){w.push(t)}),this),w.sort(m),w.forEach(_,this)}else n.forEachFeatureInExtent(p,_,this);return g.finish(s),this.renderedResolution_=l,this.renderedRevision_=d,this.renderedRenderOrder_=m,this.renderedExtent_=p,this.replayGroup_=g,!0},me.prototype.renderFeature=function(t,i,s,h,n){if(!h)return!1;var r=!1;if(Array.isArray(h))for(var e=h.length-1;e>=0;--e)r=Cr.renderFeature(n,t,h[e],Cr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||r;else r=Cr.renderFeature(n,t,h,Cr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||r;return r},di.ENABLE_CANVAS&&(Dh.register(Ih,jn),Dh.registerMultiple(Fh,[Dn,Xn,Sr,Nr])),di.ENABLE_WEBGL&&(Dh.register(Ih,le),Dh.registerMultiple(Fh,[ce,Me,me]));var pe=function(t){(t=Si.assign({},t)).controls||(t.controls=hn()),t.interactions||(t.interactions=wn()),Xh.call(this,t)};di.inherits(pe,Xh);var ge=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.snapToPixel_=t.snapToPixel};ge.prototype.getOpacity=function(){return this.opacity_},ge.prototype.getRotateWithView=function(){return this.rotateWithView_},ge.prototype.getRotation=function(){return this.rotation_},ge.prototype.getScale=function(){return this.scale_},ge.prototype.getSnapToPixel=function(){return this.snapToPixel_},ge.prototype.getAnchor=function(){},ge.prototype.getImage=function(){},ge.prototype.getHitDetectionImage=function(){},ge.prototype.getImageState=function(){},ge.prototype.getImageSize=function(){},ge.prototype.getHitDetectionImageSize=function(){},ge.prototype.getOrigin=function(){},ge.prototype.getSize=function(){},ge.prototype.setOpacity=function(t){this.opacity_=t},ge.prototype.setRotateWithView=function(t){this.rotateWithView_=t},ge.prototype.setRotation=function(t){this.rotation_=t},ge.prototype.setScale=function(t){this.scale_=t},ge.prototype.setSnapToPixel=function(t){this.snapToPixel_=t},ge.prototype.listenImageChange=function(){},ge.prototype.load=function(){},ge.prototype.unlistenImageChange=function(){};var _e=function(t){this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_),ge.call(this,{opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:1,snapToPixel:void 0===t.snapToPixel||t.snapToPixel})};di.inherits(_e,ge),_e.prototype.clone=function(){var t=new _e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},_e.prototype.getAnchor=function(){return this.anchor_},_e.prototype.getAngle=function(){return this.angle_},_e.prototype.getFill=function(){return this.fill_},_e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_},_e.prototype.getImage=function(){return this.canvas_},_e.prototype.getImageSize=function(){return this.imageSize_},_e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},_e.prototype.getImageState=function(){return 2},_e.prototype.getOrigin=function(){return this.origin_},_e.prototype.getPoints=function(){return this.points_},_e.prototype.getRadius=function(){return this.radius_},_e.prototype.getRadius2=function(){return this.radius2_},_e.prototype.getSize=function(){return this.size_},_e.prototype.getStroke=function(){return this.stroke_},_e.prototype.listenImageChange=function(){},_e.prototype.load=function(){},_e.prototype.unlistenImageChange=function(){},_e.prototype.render_=function(t){var i,s,h="",n="",r=0,e=null,o=0,a=0;this.stroke_&&(null===(s=this.stroke_.getColor())&&(s=kn.defaultStrokeStyle),s=Pn.asColorLike(s),void 0===(a=this.stroke_.getWidth())&&(a=kn.defaultLineWidth),e=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),Ws.CANVAS_LINE_DASH||(e=null,o=0),void 0===(n=this.stroke_.getLineJoin())&&(n=kn.defaultLineJoin),void 0===(h=this.stroke_.getLineCap())&&(h=kn.defaultLineCap),void 0===(r=this.stroke_.getMiterLimit())&&(r=kn.defaultMiterLimit));var u=2*(this.radius_+a)+1,f={strokeStyle:s,strokeWidth:a,size:u,lineCap:h,lineDash:e,lineDashOffset:o,lineJoin:n,miterLimit:r};if(void 0===t){var c=xh(u,u);this.canvas_=c.canvas,i=u=this.canvas_.width,this.draw_(f,c,0,0),this.createHitDetectionCanvas_(f)}else{u=Math.round(u);var l,v=!this.fill_;v&&(l=this.drawHitDetectionCanvas_.bind(this,f));var d=this.getChecksum(),M=t.add(d,u,u,this.draw_.bind(this,f),l);this.canvas_=M.image,this.origin_=[M.offsetX,M.offsetY],i=M.image.width,v?(this.hitDetectionCanvas_=M.hitImage,this.hitDetectionImageSize_=[M.hitImage.width,M.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[i,i])}this.anchor_=[u/2,u/2],this.size_=[u,u],this.imageSize_=[i,i]},_e.prototype.draw_=function(t,i,s,h){var n,r,e;i.setTransform(1,0,0,1,0,0),i.translate(s,h),i.beginPath();var o=this.points_;if(o===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var a=void 0!==this.radius2_?this.radius2_:this.radius_;for(a!==this.radius_&&(o*=2),n=0;n<=o;n++)r=2*n*Math.PI/o-Math.PI/2+this.angle_,i.lineTo(t.size/2+(e=n%2==0?this.radius_:a)*Math.cos(r),t.size/2+e*Math.sin(r))}if(this.fill_){var u=this.fill_.getColor();null===u&&(u=kn.defaultFillStyle),i.fillStyle=Pn.asColorLike(u),i.fill()}this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineCap=t.lineCap,i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke()),i.closePath()},_e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var i=xh(t.size,t.size);this.hitDetectionCanvas_=i.canvas,this.drawHitDetectionCanvas_(t,i,0,0)}},_e.prototype.drawHitDetectionCanvas_=function(t,i,s,h){i.setTransform(1,0,0,1,0,0),i.translate(s,h),i.beginPath();var n=this.points_;if(n===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var r,e,o,a=void 0!==this.radius2_?this.radius2_:this.radius_;for(a!==this.radius_&&(n*=2),r=0;r<=n;r++)o=2*r*Math.PI/n-Math.PI/2+this.angle_,i.lineTo(t.size/2+(e=r%2==0?this.radius_:a)*Math.cos(o),t.size/2+e*Math.sin(o))}i.fillStyle=kn.defaultFillStyle,i.fill(),this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.stroke()),i.closePath()},_e.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-",i=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||t!=this.checksums_[1]||i!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var s="r"+t+i+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[s,t,i,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var we=function(t){var i=t||{};_e.call(this,{points:1/0,fill:i.fill,radius:i.radius,snapToPixel:i.snapToPixel,stroke:i.stroke,atlasManager:i.atlasManager})};di.inherits(we,_e),we.prototype.clone=function(){var t=new we({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},we.prototype.setRadius=function(t){this.radius_=t,this.render_(this.atlasManager_)};var ye=function(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.checksum_=void 0};ye.prototype.clone=function(){var t=this.getColor();return new ye({color:t&&t.slice?t.slice():t||void 0})},ye.prototype.getColor=function(){return this.color_},ye.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},ye.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_=this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient?di.getUid(this.color_).toString():"f"+(this.color_?Rn.asString(this.color_):"-")),this.checksum_};var be=function(t){var i=t||{};this.geometry_=null,this.geometryFunction_=be.defaultGeometryFunction,void 0!==i.geometry&&this.setGeometry(i.geometry),this.fill_=void 0!==i.fill?i.fill:null,this.image_=void 0!==i.image?i.image:null,this.renderer_=void 0!==i.renderer?i.renderer:null,this.stroke_=void 0!==i.stroke?i.stroke:null,this.text_=void 0!==i.text?i.text:null,this.zIndex_=i.zIndex};be.prototype.clone=function(){var t=this.getGeometry();return t&&t.clone&&(t=t.clone()),new be({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},be.prototype.getRenderer=function(){return this.renderer_},be.prototype.setRenderer=function(t){this.renderer_=t},be.prototype.getGeometry=function(){return this.geometry_},be.prototype.getGeometryFunction=function(){return this.geometryFunction_},be.prototype.getFill=function(){return this.fill_},be.prototype.setFill=function(t){this.fill_=t},be.prototype.getImage=function(){return this.image_},be.prototype.setImage=function(t){this.image_=t},be.prototype.getStroke=function(){return this.stroke_},be.prototype.setStroke=function(t){this.stroke_=t},be.prototype.getText=function(){return this.text_},be.prototype.setText=function(t){this.text_=t},be.prototype.getZIndex=function(){return this.zIndex_},be.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(i){return i.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=be.defaultGeometryFunction,this.geometry_=t},be.prototype.setZIndex=function(t){this.zIndex_=t},be.createFunction=function(t){var i,s;return"function"==typeof t?i=t:(Array.isArray(t)?s=t:(qi(t instanceof be,41),s=[t]),i=function(){return s}),i},be.default_=null,be.defaultFunction=function(){if(!be.default_){var t=new ye({color:"rgba(255,255,255,0.4)"}),i=new $r({color:"#3399CC",width:1.25});be.default_=[new be({image:new we({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return be.default_},be.createDefaultEditing=function(){var t={},i=[255,255,255,1],s=[0,153,255,1];return t[Zi]=[new be({fill:new ye({color:[255,255,255,.5]})})],t[$i]=t[Zi],t[Hi]=[new be({stroke:new $r({color:i,width:5})}),new be({stroke:new $r({color:s,width:3})})],t[Qi]=t[Hi],t[is]=t[Zi].concat(t[Hi]),t[Yi]=[new be({image:new we({radius:6,fill:new ye({color:s}),stroke:new $r({color:i,width:1.5})}),zIndex:1/0})],t[Ki]=t[Yi],t[ts]=t[Zi].concat(t[Hi],t[Yi]),t},be.defaultGeometryFunction=function(t){return t.getGeometry()};var xe=function(t){Ui.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,Ai.listen(this,Ui.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),void 0!==t&&(t instanceof bs||!t?this.setGeometry(t):this.setProperties(t))};di.inherits(xe,Ui),xe.prototype.clone=function(){var t=new xe(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var s=this.getStyle();return s&&t.setStyle(s),t},xe.prototype.getGeometry=function(){return this.get(this.geometryName_)},xe.prototype.getId=function(){return this.id_},xe.prototype.getGeometryName=function(){return this.geometryName_},xe.prototype.getStyle=function(){return this.style_},xe.prototype.getStyleFunction=function(){return this.styleFunction_},xe.prototype.handleGeometryChange_=function(){this.changed()},xe.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Ai.unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Ai.listen(t,Ri,this.handleGeometryChange_,this)),this.changed()},xe.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},xe.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?xe.createStyleFunction(t):void 0,this.changed()},xe.prototype.setId=function(t){this.id_=t,this.changed()},xe.prototype.setGeometryName=function(t){Ai.unlisten(this,Ui.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,Ai.listen(this,Ui.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},xe.createStyleFunction=function(t){var i,s;return"function"==typeof t?i=2==t.length?function(i){return t(this,i)}:t:(Array.isArray(t)?s=t:(qi(t instanceof be,41),s=[t]),i=function(){return s}),i};var Ee={createOrUpdate:function(t,i,s,h){return void 0!==h?(h[0]=t,h[1]=i,h[2]=s,h):[t,i,s]},getKeyZXY:function(t,i,s){return t+"/"+i+"/"+s},getKey:function(t){return Ee.getKeyZXY(t[0],t[1],t[2])},fromKey:function(t){return t.split("/").map(Number)},hash:function(t){return(t[1]<<t[0])+t[2]},quadKey:function(t){var i,s,h=t[0],n=new Array(h),r=1<<h-1;for(i=0;i<h;++i)s=48,t[1]&r&&(s+=1),t[2]&r&&(s+=2),n[i]=String.fromCharCode(s),r>>=1;return n.join("")},withinExtentAndZ:function(t,i){var s=t[0],h=t[1],n=t[2];if(i.getMinZoom()>s||s>i.getMaxZoom())return!1;var r,e=i.getExtent();return!(r=e?i.getTileRangeForExtentAndZ(e,s):i.getFullTileRange(s))||r.containsXY(h,n)}},Ce={createFromTemplate:function(t,i){var s=/\{z\}/g,h=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(e){return e?t.replace(s,e[0].toString()).replace(h,e[1].toString()).replace(n,(function(){return(-e[2]-1).toString()})).replace(r,(function(){var t=i.getFullTileRange(e[0]);return qi(t,55),(t.getHeight()+e[2]).toString()})):void 0}},createFromTemplates:function(t,i){for(var s=t.length,h=new Array(s),n=0;n<s;++n)h[n]=Ce.createFromTemplate(t[n],i);return Ce.createFromTileUrlFunctions(h)},createFromTileUrlFunctions:function(t){return 1===t.length?t[0]:function(i,s,h){if(i){var n=Ee.hash(i),r=Bi.modulo(n,t.length);return t[r](i,s,h)}}},nullTileUrlFunction:function(){},expandUrl:function(t){var i=[],s=/\{([a-z])-([a-z])\}/.exec(t);if(s){var h,n=s[1].charCodeAt(0),r=s[2].charCodeAt(0);for(h=n;h<=r;++h)i.push(t.replace(s[0],String.fromCharCode(h)));return i}if(s=s=/\{(\d+)-(\d+)\}/.exec(t)){for(var e=parseInt(s[2],10),o=parseInt(s[1],10);o<=e;o++)i.push(t.replace(s[0],o.toString()));return i}return i.push(t),i}},Se=function(t,i,s){ki.call(this);var h=s||{};this.tileCoord=t,this.state=i,this.interimTile=null,this.key="",this.transition_=void 0===h.transition?250:h.transition,this.transitionStarts_={}};di.inherits(Se,ki),Se.prototype.changed=function(){this.dispatchEvent(Ri)},Se.prototype.getKey=function(){return this.key+"/"+this.tileCoord},Se.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return t;t=t.interimTile}while(t);return this},Se.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,i=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?i=t:0==t.getState()?i.interimTile=t.interimTile:i=t,t=i.interimTile}while(t)}},Se.prototype.getTileCoord=function(){return this.tileCoord},Se.prototype.getState=function(){return this.state},Se.prototype.setState=function(t){this.state=t,this.changed()},Se.prototype.load=function(){},Se.prototype.getAlpha=function(t,i){if(!this.transition_)return 1;var s=this.transitionStarts_[t];if(s){if(-1===s)return 1}else this.transitionStarts_[t]=s=i;var h=i-s+1e3/60;return h>=this.transition_?1:yh.easeIn(h/this.transition_)},Se.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},Se.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)};var Ae=function(t,i,s,h,n,r){Se.call(this,t,i,r),this.crossOrigin_=h,this.src_=s,this.image_=new Image,null!==h&&(this.image_.crossOrigin=h),this.imageListenerKeys_=null,this.tileLoadFunction_=n};di.inherits(Ae,Se),Ae.prototype.disposeInternal=function(){1==this.state&&(this.unlistenImage_(),this.image_=Ae.getBlankImage()),this.interimTile&&this.interimTile.dispose(),this.state=5,this.changed(),Se.prototype.disposeInternal.call(this)},Ae.prototype.getImage=function(){return this.image_},Ae.prototype.getKey=function(){return this.src_},Ae.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.image_=Ae.getBlankImage(),this.changed()},Ae.prototype.handleImageLoad_=function(){this.state=this.image_.naturalWidth&&this.image_.naturalHeight?2:4,this.unlistenImage_(),this.changed()},Ae.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.imageListenerKeys_=[Ai.listenOnce(this.image_,Li,this.handleImageError_,this),Ai.listenOnce(this.image_,Di,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},Ae.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ai.unlistenByKey),this.imageListenerKeys_=null},Ae.getBlankImage=function(){var t=xh(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas};var Ne=function(t){An.call(this,t)};di.inherits(Ne,An),Ne.prototype.expireCache=function(t){for(var i,s;this.canExpireCache()&&(!((s=(i=this.peekLast()).tileCoord[0].toString())in t)||!t[s].contains(i.tileCoord));)this.pop().dispose()},Ne.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),i=Ee.fromKey(t)[0];this.forEach((function(t){t.tileCoord[0]!==i&&(this.remove(Ee.getKey(t.tileCoord)),t.dispose())}),this)}};var ze={calculateSourceResolution:function(t,i,s,h){var n=ws.transform(s,i,t),r=ws.getPointResolution(i,h,s),e=i.getMetersPerUnit();void 0!==e&&(r*=e);var o=t.getMetersPerUnit();void 0!==o&&(r/=o);var a=t.getExtent();if(!a||rs.containsCoordinate(a,n)){var u=ws.getPointResolution(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r},enlargeClipPoint_:function(t,i,s,h){var n=s-t,r=h-i,e=Math.sqrt(n*n+r*r);return[Math.round(s+n/e),Math.round(h+r/e)]},render:function(t,i,s,h,n,r,e,o,a,u,f){var c=xh(Math.round(s*t),Math.round(s*i));if(0===a.length)return c.canvas;c.scale(s,s);var l=rs.createEmpty();a.forEach((function(t){rs.extend(l,t.extent)}));var v=rs.getWidth(l),d=rs.getHeight(l),M=xh(Math.round(s*v/h),Math.round(s*d/h)),m=s/h;a.forEach((function(t){var i=t.extent[0]-l[0],s=-(t.extent[3]-l[3]),h=rs.getWidth(t.extent),n=rs.getHeight(t.extent);M.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,i*m,s*m,h*m,n*m)}));var p=rs.getTopLeft(e);return o.getTriangles().forEach((function(t){var i=t.source,n=t.target,e=i[0][0],o=i[0][1],a=i[1][0],u=i[1][1],f=i[2][0],v=i[2][1],d=(n[0][0]-p[0])/r,m=-(n[0][1]-p[1])/r,g=(n[1][0]-p[0])/r,_=-(n[1][1]-p[1])/r,w=(n[2][0]-p[0])/r,y=-(n[2][1]-p[1])/r,b=e,x=o;e=0,o=0;var E=Bi.solveLinearSystem([[a-=b,u-=x,0,0,g-d],[f-=b,v-=x,0,0,w-d],[0,0,a,u,_-m],[0,0,f,v,y-m]]);if(E){c.save(),c.beginPath();var C=(d+g+w)/3,S=(m+_+y)/3,A=ze.enlargeClipPoint_(C,S,d,m),N=ze.enlargeClipPoint_(C,S,g,_),z=ze.enlargeClipPoint_(C,S,w,y);c.moveTo(N[0],N[1]),c.lineTo(A[0],A[1]),c.lineTo(z[0],z[1]),c.clip(),c.transform(E[0],E[2],E[1],E[3],d,m),c.translate(l[0]-b,l[3]-x),c.scale(h/s,-h/s),c.drawImage(M.canvas,0,0),c.restore()}})),f&&(c.save(),c.strokeStyle="black",c.lineWidth=1,o.getTriangles().forEach((function(t){var i=t.target,s=(i[0][0]-p[0])/r,h=-(i[0][1]-p[1])/r,n=(i[1][0]-p[0])/r,e=-(i[1][1]-p[1])/r,o=(i[2][0]-p[0])/r,a=-(i[2][1]-p[1])/r;c.beginPath(),c.moveTo(n,e),c.lineTo(s,h),c.lineTo(o,a),c.closePath(),c.stroke()})),c.restore()),c.canvas}},ke=function(t,i,s,h,n){this.sourceProj_=t,this.targetProj_=i;var r={},e=ws.getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];return r[i]||(r[i]=e(t)),r[i]},this.maxSourceExtent_=h,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!h&&!!this.sourceProj_.getExtent()&&rs.getWidth(h)==rs.getWidth(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?rs.getWidth(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?rs.getWidth(this.targetProj_.getExtent()):null;var o=rs.getTopLeft(s),a=rs.getTopRight(s),u=rs.getBottomRight(s),f=rs.getBottomLeft(s),c=this.transformInv_(o),l=this.transformInv_(a),v=this.transformInv_(u),d=this.transformInv_(f);if(this.addQuad_(o,a,u,f,c,l,v,d,di.RASTER_REPROJECTION_MAX_SUBDIVISION),this.wrapsXInSource_){var M=1/0;this.triangles_.forEach((function(t){M=Math.min(M,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach((function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-M>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];i[0][0]-M>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-M>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-M>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);var s=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-s<this.sourceWorldWidth_/2&&(t.source=i)}}),this)}r={}};ke.prototype.addTriangle_=function(t,i,s,h,n,r){this.triangles_.push({source:[h,n,r],target:[t,i,s]})},ke.prototype.addQuad_=function(t,i,s,h,n,r,e,o,a){var u=rs.boundingExtent([n,r,e,o]),f=this.sourceWorldWidth_?rs.getWidth(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,l=this.sourceProj_.canWrapX()&&f>.5&&f<1,v=!1;if(a>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var d=rs.boundingExtent([t,i,s,h]);v|=rs.getWidth(d)/this.targetWorldWidth_>di.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}!l&&this.sourceProj_.isGlobal()&&f&&(v|=f>di.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH)}if(v||!this.maxSourceExtent_||rs.intersects(u,this.maxSourceExtent_)){if(!(v||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(o[0])&&isFinite(o[1]))){if(!(a>0))return;v=!0}if(a>0){if(!v){var M,m=this.transformInv_([(t[0]+s[0])/2,(t[1]+s[1])/2]);M=l?(Bi.modulo(n[0],c)+Bi.modulo(e[0],c))/2-Bi.modulo(m[0],c):(n[0]+e[0])/2-m[0];var p=(n[1]+e[1])/2-m[1];v=M*M+p*p>this.errorThresholdSquared_}if(v){if(Math.abs(t[0]-s[0])<=Math.abs(t[1]-s[1])){var g=[(i[0]+s[0])/2,(i[1]+s[1])/2],_=this.transformInv_(g),w=[(h[0]+t[0])/2,(h[1]+t[1])/2],y=this.transformInv_(w);this.addQuad_(t,i,g,w,n,r,_,y,a-1),this.addQuad_(w,g,s,h,y,_,e,o,a-1)}else{var b=[(t[0]+i[0])/2,(t[1]+i[1])/2],x=this.transformInv_(b),E=[(s[0]+h[0])/2,(s[1]+h[1])/2],C=this.transformInv_(E);this.addQuad_(t,b,E,h,n,x,C,o,a-1),this.addQuad_(b,i,s,E,x,r,e,C,a-1)}return}}if(l){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,s,h,n,e,o),this.addTriangle_(t,i,s,n,r,e)}},ke.prototype.calculateSourceExtent=function(){var t=rs.createEmpty();return this.triangles_.forEach((function(i){var s=i.source;rs.extendCoordinate(t,s[0]),rs.extendCoordinate(t,s[1]),rs.extendCoordinate(t,s[2])})),t},ke.prototype.getTriangles=function(){return this.triangles_};var Re=function(t,i,s,h,n,r,e,o,a,u,f){Se.call(this,n,0),this.renderEdges_=void 0!==f&&f,this.pixelRatio_=e,this.gutter_=o,this.canvas_=null,this.sourceTileGrid_=i,this.targetTileGrid_=h,this.wrappedTileCoord_=r||n,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var c=h.getTileCoordExtent(this.wrappedTileCoord_),l=this.targetTileGrid_.getExtent(),v=this.sourceTileGrid_.getExtent(),d=l?rs.getIntersection(c,l):c;if(0!==rs.getArea(d)){var M=t.getExtent();M&&(v=v?rs.getIntersection(v,M):M);var m=h.getResolution(this.wrappedTileCoord_[0]),p=rs.getCenter(d),g=ze.calculateSourceResolution(t,s,p,m);if(!isFinite(g)||g<=0)this.state=4;else if(this.triangulation_=new ke(t,s,d,v,g*(void 0!==u?u:di.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD)),0!==this.triangulation_.getTriangles().length){this.sourceZ_=i.getZForResolution(g);var _=this.triangulation_.calculateSourceExtent();if(v&&(t.canWrapX()?(_[1]=Bi.clamp(_[1],v[1],v[3]),_[3]=Bi.clamp(_[3],v[1],v[3])):_=rs.getIntersection(_,v)),rs.getArea(_)){for(var w=i.getTileRangeForExtentAndZ(_,this.sourceZ_),y=w.minX;y<=w.maxX;y++)for(var b=w.minY;b<=w.maxY;b++){var x=a(this.sourceZ_,y,b,e);x&&this.sourceTiles_.push(x)}0===this.sourceTiles_.length&&(this.state=4)}else this.state=4}else this.state=4}else this.state=4};di.inherits(Re,Se),Re.prototype.disposeInternal=function(){1==this.state&&this.unlistenSources_(),Se.prototype.disposeInternal.call(this)},Re.prototype.getImage=function(){return this.canvas_},Re.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach((function(i){i&&2==i.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(i.tileCoord),image:i.getImage()})}),this),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var i=this.wrappedTileCoord_[0],s=this.targetTileGrid_.getTileSize(i),h="number"==typeof s?s:s[0],n="number"==typeof s?s:s[1],r=this.targetTileGrid_.getResolution(i),e=this.sourceTileGrid_.getResolution(this.sourceZ_),o=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=ze.render(h,n,this.pixelRatio_,e,this.sourceTileGrid_.getExtent(),r,o,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=2}this.changed()},Re.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach((function(i){var s,h=i.getState();0!=h&&1!=h||(t++,s=Ai.listen(i,Ri,(function(){var h=i.getState();2!=h&&3!=h&&4!=h||(Ai.unlistenByKey(s),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this),this.sourcesListenerKeys_.push(s))}),this),this.sourceTiles_.forEach((function(t){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},Re.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ai.unlistenByKey),this.sourcesListenerKeys_=null};var Pe=function(t){var i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,qi(hs.isSorted(this.resolutions_,(function(t,i){return i-t}),!0),17),!t.origins)for(var s=0,h=this.resolutions_.length-1;s<h;++s)if(i){if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=void 0;break}}else i=this.resolutions_[s]/this.resolutions_[s+1];this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,qi(this.origins_.length==this.resolutions_.length,20));var n=t.extent;void 0===n||this.origin_||this.origins_||(this.origin_=rs.getTopLeft(n)),qi(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,qi(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:di.DEFAULT_TILE_SIZE,qi(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==n?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t){return new Un(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))}),this):n&&this.calculateTileRanges_(n)};Pe.tmpTileCoord_=[0,0,0],Pe.prototype.forEachTileCoord=function(t,i,s){for(var h=this.getTileRangeForExtentAndZ(t,i),n=h.minX,r=h.maxX;n<=r;++n)for(var e=h.minY,o=h.maxY;e<=o;++e)s([i,n,e])},Pe.prototype.forEachTileCoordParentTileRange=function(t,i,s,h,n){var r,e,o,a=null,u=t[0]-1;for(2===this.zoomFactor_?(e=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);u>=this.minZoom;){if(2===this.zoomFactor_?(e=Math.floor(e/2),o=Math.floor(o/2),r=Un.createOrUpdate(e,e,o,o,h)):r=this.getTileRangeForExtentAndZ(a,u,h),i.call(s,u,r))return!0;--u}return!1},Pe.prototype.getExtent=function(){return this.extent_},Pe.prototype.getMaxZoom=function(){return this.maxZoom},Pe.prototype.getMinZoom=function(){return this.minZoom},Pe.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},Pe.prototype.getResolution=function(t){return this.resolutions_[t]},Pe.prototype.getResolutions=function(){return this.resolutions_},Pe.prototype.getTileCoordChildTileRange=function(t,i,s){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var h=2*t[1],n=2*t[2];return Un.createOrUpdate(h,h+1,n,n+1,i)}var r=this.getTileCoordExtent(t,s);return this.getTileRangeForExtentAndZ(r,t[0]+1,i)}return null},Pe.prototype.getTileRangeExtent=function(t,i,s){var h=this.getOrigin(t),n=this.getResolution(t),r=Uh(this.getTileSize(t),this.tmpSize_);return rs.createOrUpdate(h[0]+i.minX*r[0]*n,h[1]+i.minY*r[1]*n,h[0]+(i.maxX+1)*r[0]*n,h[1]+(i.maxY+1)*r[1]*n,s)},Pe.prototype.getTileRangeForExtentAndZ=function(t,i,s){var h=Pe.tmpTileCoord_;this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,h);var n=h[1],r=h[2];return this.getTileCoordForXYAndZ_(t[2],t[3],i,!0,h),Un.createOrUpdate(n,h[1],r,h[2],s)},Pe.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]),s=this.getResolution(t[0]),h=Uh(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*h[0]*s,i[1]+(t[2]+.5)*h[1]*s]},Pe.prototype.getTileCoordExtent=function(t,i){var s=this.getOrigin(t[0]),h=this.getResolution(t[0]),n=Uh(this.getTileSize(t[0]),this.tmpSize_),r=s[0]+t[1]*n[0]*h,e=s[1]+t[2]*n[1]*h;return rs.createOrUpdate(r,e,r+n[0]*h,e+n[1]*h,i)},Pe.prototype.getTileCoordForCoordAndResolution=function(t,i,s){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,!1,s)},Pe.prototype.getTileCoordForXYAndResolution_=function(t,i,s,h,n){var r=this.getZForResolution(s),e=s/this.getResolution(r),o=this.getOrigin(r),a=Uh(this.getTileSize(r),this.tmpSize_),u=h?0:.5,f=Math.floor((t-o[0])/s+(h?.5:0)),c=Math.floor((i-o[1])/s+u),l=e*f/a[0],v=e*c/a[1];return h?(l=Math.ceil(l)-1,v=Math.ceil(v)-1):(l=Math.floor(l),v=Math.floor(v)),Ee.createOrUpdate(r,l,v,n)},Pe.prototype.getTileCoordForXYAndZ_=function(t,i,s,h,n){var r=this.getOrigin(s),e=this.getResolution(s),o=Uh(this.getTileSize(s),this.tmpSize_),a=h?0:.5,u=Math.floor((t-r[0])/e+(h?.5:0)),f=Math.floor((i-r[1])/e+a),c=u/o[0],l=f/o[1];return h?(c=Math.ceil(c)-1,l=Math.ceil(l)-1):(c=Math.floor(c),l=Math.floor(l)),Ee.createOrUpdate(s,c,l,n)},Pe.prototype.getTileCoordForCoordAndZ=function(t,i,s){return this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,s)},Pe.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},Pe.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},Pe.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},Pe.prototype.getZForResolution=function(t,i){var s=hs.linearFindNearest(this.resolutions_,t,i||0);return Bi.clamp(s,this.minZoom,this.maxZoom)},Pe.prototype.calculateTileRanges_=function(t){for(var i=this.resolutions_.length,s=new Array(i),h=this.minZoom;h<i;++h)s[h]=this.getTileRangeForExtentAndZ(t,h);this.fullTileRanges_=s};var Te={getForProjection:function(t){var i=t.getDefaultTileGrid();return i||(i=Te.createForProjection(t),t.setDefaultTileGrid(i)),i},wrapX:function(t,i,s){var h=i[0],n=t.getTileCoordCenter(i),r=Te.extentFromProjection(s);if(rs.containsCoordinate(r,n))return i;var e=rs.getWidth(r),o=Math.ceil((r[0]-n[0])/e);return n[0]+=e*o,t.getTileCoordForCoordAndZ(n,h)},createForExtent:function(t,i,s,h){var n=void 0!==h?h:ns,r=Te.resolutionsFromExtent(t,i,s);return new Pe({extent:t,origin:rs.getCorner(t,n),resolutions:r,tileSize:s})},createXYZ:function(t){var i={};return Si.assign(i,void 0!==t?t:{}),void 0===i.extent&&(i.extent=ws.get("EPSG:3857").getExtent()),i.resolutions=Te.resolutionsFromExtent(i.extent,i.maxZoom,i.tileSize),delete i.maxZoom,new Pe(i)},resolutionsFromExtent:function(t,i,s){for(var h=void 0!==i?i:di.DEFAULT_MAX_ZOOM,n=rs.getHeight(t),r=rs.getWidth(t),e=Uh(void 0!==s?s:di.DEFAULT_TILE_SIZE),o=Math.max(r/e[0],n/e[1]),a=h+1,u=new Array(a),f=0;f<a;++f)u[f]=o/Math.pow(2,f);return u},createForProjection:function(t,i,s,h){var n=Te.extentFromProjection(t);return Te.createForExtent(n,i,s,h)},extentFromProjection:function(t){var i=(t=ws.get(t)).getExtent();if(!i){var s=180*ws.METERS_PER_UNIT[vs.DEGREES]/t.getMetersPerUnit();i=rs.createOrUpdate(-s,-s,s,s)}return i}},Oe=function(t){this.html_=t.html,this.tileRanges_=t.tileRanges?t.tileRanges:null};Oe.prototype.getHTML=function(){return this.html_},Oe.prototype.intersectsAnyTileRange=function(t,i,s){if(!this.tileRanges_)return!0;var h,n,r,e;for(e in t){var o;if(e in this.tileRanges_)for(r=t[e],h=0,n=this.tileRanges_[e].length;h<n;++h){if((o=this.tileRanges_[e][h]).intersects(r))return!0;var a=i.getTileRangeForExtentAndZ(Te.extentFromProjection(s),parseInt(e,10)),u=a.getWidth();if(r.minX<a.minX||r.maxX>a.maxX){if(o.intersects(new Un(Bi.modulo(r.minX,u),Bi.modulo(r.maxX,u),r.minY,r.maxY)))return!0;if(r.getWidth()>u&&o.intersects(a))return!0}}}return!1};var Le=function(t){Ui.call(this),this.projection_=ws.get(t.projection),this.attributions_=null,this.attributions2_=this.adaptAttributions_(t.attributions),this.logo_=t.logo,this.state_=void 0!==t.state?t.state:Oh,this.wrapX_=void 0!==t.wrapX&&t.wrapX};di.inherits(Le,Ui),Le.prototype.adaptAttributions_=function(t){if(!t)return null;if(t instanceof Oe)return this.attributions_=[t],function(){return[t.getHTML()]};if(Array.isArray(t)){if(t[0]instanceof Oe){this.attributions_=t;var i=t.map((function(t){return t.getHTML()}));return function(){return i}}return this.attributions_=t.map((function(t){return new Oe({html:t})})),function(){return t}}return"function"==typeof t?t:(this.attributions_=[new Oe({html:t})],function(){return[t]})},Le.prototype.forEachFeatureAtCoordinate=di.nullFunction,Le.prototype.getAttributions=function(){return this.attributions_},Le.prototype.getAttributions2=function(){return this.attributions2_},Le.prototype.getLogo=function(){return this.logo_},Le.prototype.getProjection=function(){return this.projection_},Le.prototype.getResolutions=function(){},Le.prototype.getState=function(){return this.state_},Le.prototype.getWrapX=function(){return this.wrapX_},Le.prototype.refresh=function(){this.changed()},Le.prototype.setAttributions=function(t){this.attributions2_=this.adaptAttributions_(t),this.changed()},Le.prototype.setLogo=function(t){this.logo_=t},Le.prototype.setState=function(t){this.state_=t,this.changed()};var Ie=function(t){Le.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX}),this.opaque_=void 0!==t.opaque&&t.opaque,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.tileCache=new Ne(t.cacheSize),this.tmpSize=[0,0],this.key_="",this.tileOptions={transition:t.transition}};di.inherits(Ie,Le),Ie.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},Ie.prototype.expireCache=function(t,i){var s=this.getTileCacheForProjection(t);s&&s.expireCache(i)},Ie.prototype.forEachLoadedTile=function(t,i,s,h){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,e,o,a=!0,u=s.minX;u<=s.maxX;++u)for(var f=s.minY;f<=s.maxY;++f)e=Ee.getKeyZXY(i,u,f),o=!1,n.containsKey(e)&&(o=2===(r=n.get(e)).getState())&&(o=!1!==h(r)),o||(a=!1);return a},Ie.prototype.getGutter=function(){return 0},Ie.prototype.getKey=function(){return this.key_},Ie.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},Ie.prototype.getOpaque=function(){return this.opaque_},Ie.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},Ie.prototype.getTile=function(){},Ie.prototype.getTileGrid=function(){return this.tileGrid},Ie.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Te.getForProjection(t)},Ie.prototype.getTileCacheForProjection=function(t){var i=this.getProjection();return i&&!ws.equivalent(i,t)?null:this.tileCache},Ie.prototype.getTilePixelRatio=function(){return this.tilePixelRatio_},Ie.prototype.getTilePixelSize=function(t,i,s){var h=this.getTileGridForProjection(s),n=this.getTilePixelRatio(i),r=Uh(h.getTileSize(t),this.tmpSize);return 1==n?r:jh(r,n,this.tmpSize)},Ie.prototype.getTileCoordForTileUrlFunction=function(t,i){var s=void 0!==i?i:this.getProjection(),h=this.getTileGridForProjection(s);return this.getWrapX()&&s.isGlobal()&&(t=Te.wrapX(h,t,s)),Ee.withinExtentAndZ(t,h)?t:null},Ie.prototype.refresh=function(){this.tileCache.clear(),this.changed()},Ie.prototype.useTile=di.nullFunction,di.inherits(Ie.Event=function(t,i){zi.call(this,t),this.tile=i},zi);var Fe=function(t){Ie.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition}),this.tileLoadFunction=t.tileLoadFunction,this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Ce.nullTileUrlFunction,this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),t.tileUrlFunction&&this.setTileUrlFunction(t.tileUrlFunction),this.tileLoadingKeys_={}};di.inherits(Fe,Ie),Fe.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},Fe.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},Fe.prototype.getUrls=function(){return this.urls},Fe.prototype.handleTileChange=function(t){var i,s=t.target,h=di.getUid(s),n=s.getState();1==n?(this.tileLoadingKeys_[h]=!0,i="tileloadstart"):h in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[h],i=3==n?"tileloaderror":2==n||5==n?"tileloadend":void 0),null!=i&&this.dispatchEvent(new Ie.Event(i,s))},Fe.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},Fe.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==i?this.setKey(i):this.changed()},Fe.prototype.setUrl=function(t){var i=this.urls=Ce.expandUrl(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Ce.createFromTemplates(i,this.tileGrid),t)},Fe.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Ce.createFromTemplates(t,this.tileGrid),i)},Fe.prototype.useTile=function(t,i,s){var h=Ee.getKeyZXY(t,i,s);this.tileCache.containsKey(h)&&this.tileCache.get(h)};var De=function(t){Fe.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:De.defaultTileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:Ae,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1};di.inherits(De,Fe),De.prototype.canExpireCache=function(){if(!di.ENABLE_RASTER_REPROJECTION)return Fe.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},De.prototype.expireCache=function(t,i){if(di.ENABLE_RASTER_REPROJECTION){var s=this.getTileCacheForProjection(t);for(var h in this.tileCache.expireCache(this.tileCache==s?i:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[h];n.expireCache(n==s?i:{})}}else Fe.prototype.expireCache.call(this,t,i)},De.prototype.getGutter=function(t){return di.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!ws.equivalent(this.getProjection(),t)?0:this.getGutterInternal()},De.prototype.getGutterInternal=function(){return 0},De.prototype.getOpaque=function(t){return!(di.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!ws.equivalent(this.getProjection(),t))&&Fe.prototype.getOpaque.call(this,t)},De.prototype.getTileGridForProjection=function(t){if(!di.ENABLE_RASTER_REPROJECTION)return Fe.prototype.getTileGridForProjection.call(this,t);var i=this.getProjection();if(!this.tileGrid||i&&!ws.equivalent(i,t)){var s=di.getUid(t).toString();return s in this.tileGridForProjection||(this.tileGridForProjection[s]=Te.getForProjection(t)),this.tileGridForProjection[s]}return this.tileGrid},De.prototype.getTileCacheForProjection=function(t){if(!di.ENABLE_RASTER_REPROJECTION)return Fe.prototype.getTileCacheForProjection.call(this,t);var i=this.getProjection();if(!i||ws.equivalent(i,t))return this.tileCache;var s=di.getUid(t).toString();return s in this.tileCacheForProjection||(this.tileCacheForProjection[s]=new Ne(this.tileCache.highWaterMark)),this.tileCacheForProjection[s]},De.prototype.createTile_=function(t,i,s,h,n,r){var e=[t,i,s],o=this.getTileCoordForTileUrlFunction(e,n),a=o?this.tileUrlFunction(o,h,n):void 0,u=new this.tileClass(e,void 0!==a?0:4,void 0!==a?a:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,Ai.listen(u,Ri,this.handleTileChange,this),u},De.prototype.getTile=function(t,i,s,h,n){var r=this.getProjection();if(di.ENABLE_RASTER_REPROJECTION&&r&&n&&!ws.equivalent(r,n)){var e,o=this.getTileCacheForProjection(n),a=[t,i,s],u=Ee.getKey(a);o.containsKey(u)&&(e=o.get(u));var f=this.getKey();if(e&&e.key==f)return e;var c=this.getTileGridForProjection(r),l=this.getTileGridForProjection(n),v=this.getTileCoordForTileUrlFunction(a,n),d=new Re(r,c,n,l,a,v,this.getTilePixelRatio(h),this.getGutterInternal(),function(t,i,s,h){return this.getTileInternal(t,i,s,h,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return d.key=f,e?(d.interimTile=e,d.refreshInterimChain(),o.replace(u,d)):o.set(u,d),d}return this.getTileInternal(t,i,s,h,r||n)},De.prototype.getTileInternal=function(t,i,s,h,n){var r=null,e=Ee.getKeyZXY(t,i,s),o=this.getKey();if(this.tileCache.containsKey(e)){if((r=this.tileCache.get(e)).key!=o){var a=r;(r=this.createTile_(t,i,s,h,n,o)).interimTile=0==a.getState()?a.interimTile:a,r.refreshInterimChain(),this.tileCache.replace(e,r)}}else r=this.createTile_(t,i,s,h,n,o),this.tileCache.set(e,r);return r},De.prototype.setRenderReprojectionEdges=function(t){if(di.ENABLE_RASTER_REPROJECTION&&this.renderReprojectionEdges_!=t){for(var i in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[i].clear();this.changed()}},De.prototype.setTileGridForProjection=function(t,i){if(di.ENABLE_RASTER_REPROJECTION){var s=ws.get(t);if(s){var h=di.getUid(s).toString();h in this.tileGridForProjection||(this.tileGridForProjection[h]=i)}}},De.defaultTileLoadFunction=function(t,i){t.getImage().src=i};var We="KVP",Ge=function(t){this.matrixIds_=t.matrixIds,Pe.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};di.inherits(Ge,Pe),Ge.prototype.getMatrixId=function(t){return this.matrixIds_[t]},Ge.prototype.getMatrixIds=function(){return this.matrixIds_},Ge.createFromCapabilitiesMatrixSet=function(t,i,s){var h=[],n=[],r=[],e=[],o=[],a=void 0!==s?s:[],u="TileMatrix",f="Identifier",c="ScaleDenominator",l="TopLeftCorner",v=t.SupportedCRS,d=ws.get(v.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ws.get(v),M=d.getMetersPerUnit(),m="ne"==d.getAxisOrientation().substr(0,2);return t[u].sort((function(t,i){return i[c]-t[c]})),t[u].forEach((function(t){if(!(a.length>0)||hs.find(a,(function(i){return t[f]==i[u]}))){n.push(t[f]);var i=28e-5*t[c]/M,s=t.TileWidth,v=t.TileHeight;r.push(m?[t[l][1],t[l][0]]:t[l]),h.push(i),e.push(s==v?s:[s,v]),o.push([t.MatrixWidth,-t.MatrixHeight])}})),new Ge({extent:i,origins:r,resolutions:h,matrixIds:n,tileSizes:e,sizes:o})};var Ve=function(t,i){var s=[];Object.keys(i).forEach((function(t){null!=i[t]&&s.push(t+"="+encodeURIComponent(i[t]))}));var h=s.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+h},je=function(t){this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style;var i=t.urls;void 0===i&&void 0!==t.url&&(i=Ce.expandUrl(t.url)),this.requestEncoding_=void 0!==t.requestEncoding?t.requestEncoding:We;var s=this.requestEncoding_,h=t.tileGrid,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};s==We&&Si.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_});var r=this.dimensions_;this.createFromWMTSTemplate_=function(t){return t=s==We?Ve(t,n):t.replace(/\{(\w+?)\}/g,(function(t,i){return i.toLowerCase()in n?n[i.toLowerCase()]:t})),function(i){if(i){var n={TileMatrix:h.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};Si.assign(n,r);var e=t;return s==We?Ve(e,n):e.replace(/\{(\w+?)\}/g,(function(t,i){return n[i]}))}}};var e=i&&i.length>0?Ce.createFromTileUrlFunctions(i.map(this.createFromWMTSTemplate_)):Ce.nullTileUrlFunction;De.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:h,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:e,urls:i,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition}),this.setKey(this.getKeyForDimensions_())};di.inherits(je,De),je.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Ce.createFromTileUrlFunctions(t.map(this.createFromWMTSTemplate_.bind(this))),i)},je.prototype.getDimensions=function(){return this.dimensions_},je.prototype.getFormat=function(){return this.format_},je.prototype.getLayer=function(){return this.layer_},je.prototype.getMatrixSet=function(){return this.matrixSet_},je.prototype.getRequestEncoding=function(){return this.requestEncoding_},je.prototype.getStyle=function(){return this.style_},je.prototype.getVersion=function(){return this.version_},je.prototype.getKeyForDimensions_=function(){var t=0,i=[];for(var s in this.dimensions_)i[t++]=s+"-"+this.dimensions_[s];return i.join("/")},je.prototype.updateDimensions=function(t){Si.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},je.optionsFromCapabilities=function(t,i){var s=hs.find(t.Contents.Layer,(function(t){return t.Identifier==i.layer}));if(null===s)return null;var h,n,r,e=t.Contents.TileMatrixSet;(h=s.TileMatrixSetLink.length>1?hs.findIndex(s.TileMatrixSetLink,"projection"in i?function(t){var s=hs.find(e,(function(i){return i.Identifier==t.TileMatrixSet})).SupportedCRS,h=ws.get(s.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ws.get(s),n=ws.get(i.projection);return h&&n?ws.equivalent(h,n):s==i.projection}:function(t){return t.TileMatrixSet==i.matrixSet}):0)<0&&(h=0),n=s.TileMatrixSetLink[h].TileMatrixSet,r=s.TileMatrixSetLink[h].TileMatrixSetLimits;var o=s.Format[0];"format"in i&&(o=i.format),(h=hs.findIndex(s.Style,(function(t){return"style"in i?t.Title==i.style:t.isDefault})))<0&&(h=0);var a=s.Style[h].Identifier,u={};"Dimension"in s&&s.Dimension.forEach((function(t){var i=t.Default;void 0===i&&(i=t.Value[0]),u[t.Identifier]=i}));var f,c=hs.find(t.Contents.TileMatrixSet,(function(t){return t.Identifier==n})),l=c.SupportedCRS;if(l&&(f=ws.get(l.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ws.get(l)),"projection"in i){var v=ws.get(i.projection);v&&(f&&!ws.equivalent(v,f)||(f=v))}var d,M,m=s.WGS84BoundingBox;if(void 0!==m){var p=ws.get("EPSG:4326").getExtent();M=m[0]==p[0]&&m[2]==p[2],d=ws.transformExtent(m,"EPSG:4326",f);var g=f.getExtent();g&&(rs.containsExtent(g,d)||(d=void 0))}var _=Ge.createFromCapabilitiesMatrixSet(c,d,r),w=[],y=i.requestEncoding;if(y=void 0!==y?y:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var b=t.OperationsMetadata.GetTile.DCP.HTTP.Get,x=0,E=b.length;x<E;++x)if(b[x].Constraint){var C=hs.find(b[x].Constraint,(function(t){return"GetEncoding"==t.name})).AllowedValues.Value;if(""===y&&(y=C[0]),y!==We)break;hs.includes(C,We)&&w.push(b[x].href)}else b[x].href&&(y=We,w.push(b[x].href));return 0===w.length&&(y="REST",s.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(o=t.format,w.push(t.template))}))),{urls:w,layer:i.layer,matrixSet:n,format:o,projection:f,requestEncoding:y,tileGrid:_,style:a,dimensions:u,wrapX:M,crossOrigin:i.crossOrigin}};var Ue="arraybuffer",Xe={};Xe.DOCUMENT=document.implementation.createDocument("","",null),Xe.createElementNS=function(t,i){return Xe.DOCUMENT.createElementNS(t,i)},Xe.getAllTextContent=function(t,i){return Xe.getAllTextContent_(t,i,[]).join("")},Xe.getAllTextContent_=function(t,i,s){var h;if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)s.push(i?String(t.nodeValue).replace(/(\r\n|\r|\n)/g,""):t.nodeValue);else for(h=t.firstChild;h;h=h.nextSibling)Xe.getAllTextContent_(h,i,s);return s},Xe.isDocument=function(t){return t instanceof Document},Xe.isNode=function(t){return t instanceof Node},Xe.getAttributeNS=function(t,i,s){return t.getAttributeNS(i,s)||""},Xe.setAttributeNS=function(t,i,s,h){t.setAttributeNS(i,s,h)},Xe.parse=function(t){return(new DOMParser).parseFromString(t,"application/xml")},Xe.makeArrayExtender=function(t,i){return function(s,h){var n=t.call(i,s,h);void 0!==n&&hs.extend(h[h.length-1],n)}},Xe.makeArrayPusher=function(t,i){return function(s,h){var n=t.call(void 0!==i?i:this,s,h);void 0!==n&&h[h.length-1].push(n)}},Xe.makeReplacer=function(t,i){return function(s,h){var n=t.call(void 0!==i?i:this,s,h);void 0!==n&&(h[h.length-1]=n)}},Xe.makeObjectPropertyPusher=function(t,i,s){return function(h,n){var r=t.call(void 0!==s?s:this,h,n);if(void 0!==r){var e=n[n.length-1],o=void 0!==i?i:h.localName;(o in e?e[o]:e[o]=[]).push(r)}}},Xe.makeObjectPropertySetter=function(t,i,s){return function(h,n){var r=t.call(void 0!==s?s:this,h,n);void 0!==r&&(n[n.length-1][void 0!==i?i:h.localName]=r)}},Xe.makeChildAppender=function(t,i){return function(s,h,n){t.call(void 0!==i?i:this,s,h,n),n[n.length-1].node.appendChild(s)}},Xe.makeArraySerializer=function(t){var i,s;return function(h,n,r){if(void 0===i){i={};var e={};e[h.localName]=t,i[h.namespaceURI]=e,s=Xe.makeSimpleNodeFactory(h.localName)}Xe.serialize(i,s,n,r)}},Xe.makeSimpleNodeFactory=function(t,i){var s=t;return function(t,h,n){var r=s;void 0===r&&(r=n);var e=i;return void 0===i&&(e=h[h.length-1].node.namespaceURI),Xe.createElementNS(e,r)}},Xe.OBJECT_PROPERTY_NODE_FACTORY=Xe.makeSimpleNodeFactory(),Xe.makeSequence=function(t,i){for(var s=i.length,h=new Array(s),n=0;n<s;++n)h[n]=t[i[n]];return h},Xe.makeStructureNS=function(t,i,s){var h,n,r=void 0!==s?s:{};for(h=0,n=t.length;h<n;++h)r[t[h]]=i;return r},Xe.parseNode=function(t,i,s,h){var n;for(n=i.firstElementChild;n;n=n.nextElementSibling){var r=t[n.namespaceURI];if(void 0!==r){var e=r[n.localName];void 0!==e&&e.call(h,n,s)}}},Xe.pushParseAndPop=function(t,i,s,h,n){return h.push(t),Xe.parseNode(i,s,h,n),h.pop()},Xe.serialize=function(t,i,s,h,n,r){for(var e,o,a=(void 0!==n?n:s).length,u=0;u<a;++u)void 0!==(e=s[u])&&void 0!==(o=i.call(r,e,h,void 0!==n?n[u]:void 0))&&t[o.namespaceURI][o.localName].call(r,o,e,h)},Xe.pushSerializeAndPop=function(t,i,s,h,n,r,e){return n.push(t),Xe.serialize(i,s,h,n,r,e),n.pop()};var qe={loadFeaturesXhr:function(t,i,s,h){return function(n,r,e){var o=new XMLHttpRequest;o.open("GET","function"==typeof t?t(n,r,e):t,!0),i.getType()==Ue&&(o.responseType="arraybuffer"),o.onload=function(){if(!o.status||o.status>=200&&o.status<300){var t,n=i.getType();"json"==n||"text"==n?t=o.responseText:"xml"==n?(t=o.responseXML)||(t=Xe.parse(o.responseText)):n==Ue&&(t=o.response),t?s.call(this,i.readFeatures(t,{featureProjection:e}),i.readProjection(t),i.getLastExtent()):h.call(this)}else h.call(this)}.bind(this),o.onerror=function(){h.call(this)}.bind(this),o.send()}},xhr:function(t,i){return qe.loadFeaturesXhr(t,i,(function(t){this.addFeatures(t)}),di.nullFunction)}},Be={all:function(){return[[-1/0,-1/0,1/0,1/0]]},bbox:function(t){return[t]},tile:function(t){return function(i,s){var h=t.getZForResolution(s),n=t.getTileRangeForExtentAndZ(i,h),r=[],e=[h,0,0];for(e[1]=n.minX;e[1]<=n.maxX;++e[1])for(e[2]=n.minY;e[2]<=n.maxY;++e[2])r.push(t.getTileCoordExtent(e));return r}}},Ye="addfeature",He="removefeature",Je=function(t){var i=t||{};Le.call(this,{attributions:i.attributions,logo:i.logo,projection:void 0,state:Oh,wrapX:void 0===i.wrapX||i.wrapX}),this.loader_=di.nullFunction,this.format_=i.format,this.overlaps_=null==i.overlaps||i.overlaps,this.url_=i.url,void 0!==i.loader?this.loader_=i.loader:void 0!==this.url_&&(qi(this.format_,7),this.loader_=qe.xhr(this.url_,this.format_)),this.strategy_=void 0!==i.strategy?i.strategy:Be.all;var s,h,n=void 0===i.useSpatialIndex||i.useSpatialIndex;this.featuresRtree_=n?new ie:null,this.loadedExtentsRtree_=new ie,this.nullGeometryFeatures_={},this.idIndex_={},this.undefIdIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,i.features instanceof Xs?h=(s=i.features).getArray():Array.isArray(i.features)&&(h=i.features),n||void 0!==s||(s=new Xs(h)),void 0!==h&&this.addFeaturesInternal(h),void 0!==s&&this.bindFeaturesCollection_(s)};di.inherits(Je,Le),Je.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},Je.prototype.addFeatureInternal=function(t){var i=di.getUid(t).toString();if(this.addToIndex_(i,t)){this.setupChangeEvents_(i,t);var s=t.getGeometry();if(s){var h=s.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(h,t)}else this.nullGeometryFeatures_[i]=t;this.dispatchEvent(new Je.Event(Ye,t))}},Je.prototype.setupChangeEvents_=function(t,i){this.featureChangeKeys_[t]=[Ai.listen(i,Ri,this.handleFeatureChange_,this),Ai.listen(i,Ci,this.handleFeatureChange_,this)]},Je.prototype.addToIndex_=function(t,i){var s=!0,h=i.getId();return void 0!==h?h.toString()in this.idIndex_?s=!1:this.idIndex_[h.toString()]=i:(qi(!(t in this.undefIdIndex_),30),this.undefIdIndex_[t]=i),s},Je.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},Je.prototype.addFeaturesInternal=function(t){var i,s,h,n,r=[],e=[],o=[];for(s=0,h=t.length;s<h;s++)i=di.getUid(n=t[s]).toString(),this.addToIndex_(i,n)&&e.push(n);for(s=0,h=e.length;s<h;s++){i=di.getUid(n=e[s]).toString(),this.setupChangeEvents_(i,n);var a=n.getGeometry();if(a){var u=a.getExtent();r.push(u),o.push(n)}else this.nullGeometryFeatures_[i]=n}for(this.featuresRtree_&&this.featuresRtree_.load(r,o),s=0,h=e.length;s<h;s++)this.dispatchEvent(new Je.Event(Ye,e[s]))},Je.prototype.bindFeaturesCollection_=function(t){var i=!1;Ai.listen(this,Ye,(function(s){i||(i=!0,t.push(s.feature),i=!1)})),Ai.listen(this,He,(function(s){i||(i=!0,t.remove(s.feature),i=!1)})),Ai.listen(t,js,(function(t){i||(i=!0,this.addFeature(t.element),i=!1)}),this),Ai.listen(t,Us,(function(t){i||(i=!0,this.removeFeature(t.element),i=!1)}),this),this.featuresCollection_=t},Je.prototype.clear=function(t){if(t){for(var i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(Ai.unlistenByKey);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.undefIdIndex_={})}else if(this.featuresRtree_)for(var s in this.featuresRtree_.forEach(this.removeFeatureInternal,this),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.loadedExtentsRtree_.clear(),this.nullGeometryFeatures_={};var h=new Je.Event("clear");this.dispatchEvent(h),this.changed()},Je.prototype.forEachFeature=function(t,i){return this.featuresRtree_?this.featuresRtree_.forEach(t,i):this.featuresCollection_?this.featuresCollection_.forEach(t,i):void 0},Je.prototype.forEachFeatureAtCoordinateDirect=function(t,i,s){return this.forEachFeatureInExtent([t[0],t[1],t[0],t[1]],(function(h){return h.getGeometry().intersectsCoordinate(t)?i.call(s,h):void 0}))},Je.prototype.forEachFeatureInExtent=function(t,i,s){return this.featuresRtree_?this.featuresRtree_.forEachInExtent(t,i,s):this.featuresCollection_?this.featuresCollection_.forEach(i,s):void 0},Je.prototype.forEachFeatureIntersectingExtent=function(t,i,s){return this.forEachFeatureInExtent(t,(function(h){if(h.getGeometry().intersectsExtent(t)){var n=i.call(s,h);if(n)return n}}))},Je.prototype.getFeaturesCollection=function(){return this.featuresCollection_},Je.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Si.isEmpty(this.nullGeometryFeatures_)||hs.extend(t,Si.getValues(this.nullGeometryFeatures_))),t},Je.prototype.getFeaturesAtCoordinate=function(t){var i=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){i.push(t)})),i},Je.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)},Je.prototype.getClosestFeatureToCoordinate=function(t,i){var s=t[0],h=t[1],n=null,r=[NaN,NaN],e=1/0,o=[-1/0,-1/0,1/0,1/0],a=i||as.TRUE;return this.featuresRtree_.forEachInExtent(o,(function(t){if(a(t)){var i=t.getGeometry(),u=e;if((e=i.closestPointXY(s,h,r,e))<u){n=t;var f=Math.sqrt(e);o[0]=s-f,o[1]=h-f,o[2]=s+f,o[3]=h+f}}})),n},Je.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},Je.prototype.getFeatureById=function(t){var i=this.idIndex_[t.toString()];return void 0!==i?i:null},Je.prototype.getFormat=function(){return this.format_},Je.prototype.getOverlaps=function(){return this.overlaps_},Je.prototype.getResolutions=function(){},Je.prototype.getUrl=function(){return this.url_},Je.prototype.handleFeatureChange_=function(t){var i=t.target,s=di.getUid(i).toString(),h=i.getGeometry();if(h){var n=h.getExtent();s in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[s],this.featuresRtree_&&this.featuresRtree_.insert(n,i)):this.featuresRtree_&&this.featuresRtree_.update(n,i)}else s in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(i),this.nullGeometryFeatures_[s]=i);var r=i.getId();if(void 0!==r){var e=r.toString();s in this.undefIdIndex_?(delete this.undefIdIndex_[s],this.idIndex_[e]=i):this.idIndex_[e]!==i&&(this.removeFromIdIndex_(i),this.idIndex_[e]=i)}else s in this.undefIdIndex_||(this.removeFromIdIndex_(i),this.undefIdIndex_[s]=i);this.changed(),this.dispatchEvent(new Je.Event("changefeature",i))},Je.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Si.isEmpty(this.nullGeometryFeatures_)},Je.prototype.loadFeatures=function(t,i,s){var h,n,r=this.loadedExtentsRtree_,e=this.strategy_(t,i);for(h=0,n=e.length;h<n;++h){var o=e[h];r.forEachInExtent(o,(function(t){return rs.containsExtent(t.extent,o)}))||(this.loader_.call(this,o,i,s),r.insert(o,{extent:o.slice()}))}},Je.prototype.removeLoadedExtent=function(t){var i,s=this.loadedExtentsRtree_;s.forEachInExtent(t,(function(s){if(rs.equals(s.extent,t))return i=s,!0})),i&&s.remove(i)},Je.prototype.removeFeature=function(t){var i=di.getUid(t).toString();i in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[i]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},Je.prototype.removeFeatureInternal=function(t){var i=di.getUid(t).toString();this.featureChangeKeys_[i].forEach(Ai.unlistenByKey),delete this.featureChangeKeys_[i];var s=t.getId();void 0!==s?delete this.idIndex_[s.toString()]:delete this.undefIdIndex_[i],this.dispatchEvent(new Je.Event(He,t))},Je.prototype.removeFromIdIndex_=function(t){var i=!1;for(var s in this.idIndex_)if(this.idIndex_[s]===t){delete this.idIndex_[s],i=!0;break}return i},Je.prototype.setLoader=function(t){this.loader_=t},di.inherits(Je.Event=function(t,i){zi.call(this,t),this.feature=i},zi);var Ze="preload",Ke="useInterimTilesOnError",Qe=function(t){var i=t||{},s=Si.assign({},i);delete s.preload,delete s.useInterimTilesOnError,Qh.call(this,s),this.setPreload(void 0!==i.preload?i.preload:0),this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),this.type=En};di.inherits(Qe,Qh),Qe.prototype.getPreload=function(){return this.get(Ze)},Qe.prototype.setPreload=function(t){this.set(Ze,t)},Qe.prototype.getUseInterimTilesOnError=function(){return this.get(Ke)},Qe.prototype.setUseInterimTilesOnError=function(t){this.set(Ke,t)};var $e=function(t){var i=t||{},s=Si.assign({},i);delete s.style,delete s.renderBuffer,delete s.updateWhileAnimating,delete s.updateWhileInteracting,Qh.call(this,s),this.declutter_=void 0!==i.declutter&&i.declutter,this.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(i.style),this.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,this.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,this.renderMode_=i.renderMode||"vector",this.type=Cn};di.inherits($e,Qh),$e.prototype.getDeclutter=function(){return this.declutter_},$e.prototype.setDeclutter=function(t){this.declutter_=t},$e.prototype.getRenderBuffer=function(){return this.renderBuffer_},$e.prototype.getRenderOrder=function(){return this.get($e.Property_.RENDER_ORDER)},$e.prototype.getStyle=function(){return this.style_},$e.prototype.getStyleFunction=function(){return this.styleFunction_},$e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},$e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},$e.prototype.setRenderOrder=function(t){this.set($e.Property_.RENDER_ORDER,t)},$e.prototype.setStyle=function(t){this.style_=void 0!==t?t:be.defaultFunction,this.styleFunction_=null===t?void 0:be.createFunction(this.style_),this.changed()},$e.prototype.getRenderMode=function(){return this.renderMode_},$e.Property_={RENDER_ORDER:"renderOrder"};var to="degrees",io="metric",so=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-scale-line";this.innerElement_=document.createElement("DIV"),this.innerElement_.className=s+"-inner",this.element_=document.createElement("DIV"),this.element_.className=s+" "+Hh.CLASS_UNSELECTABLE,this.element_.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==i.minWidth?i.minWidth:64,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",qh.call(this,{element:this.element_,render:i.render?i.render:so.render,target:i.target}),Ai.listen(this,Ui.getChangeEventType(so.Property_.UNITS),this.handleUnitsChanged_,this),this.setUnits(i.units||io)};di.inherits(so,qh),so.LEADING_DIGITS=[1,2,5],so.prototype.getUnits=function(){return this.get(so.Property_.UNITS)},so.render=function(t){var i=t.frameState;this.viewState_=i?i.viewState:null,this.updateElement_()},so.prototype.handleUnitsChanged_=function(){this.updateElement_()},so.prototype.setUnits=function(t){this.set(so.Property_.UNITS,t)},so.prototype.updateElement_=function(){var t=this.viewState_;if(t){var i=t.center,s=t.projection,h=this.getUnits(),n=ws.getPointResolution(s,t.resolution,i,h==to?vs.DEGREES:vs.METERS);h!=to&&(n*=s.getMetersPerUnit());var r=this.minWidth_*n,e="";if(h==to){var o=ws.METERS_PER_UNIT[vs.DEGREES];s.getUnits()==vs.DEGREES?r*=o:n/=o,r<o/60?(e="″",n*=3600):r<o?(e="′",n*=60):e="°"}else"imperial"==h?r<.9144?(e="in",n/=.0254):r<1609.344?(e="ft",n/=.3048):(e="mi",n/=1609.344):"nautical"==h?(n/=1852,e="nm"):h==io?r<.001?(e="μm",n*=1e6):r<1?(e="mm",n*=1e3):r<1e3?e="m":(e="km",n/=1e3):"us"==h?r<.9144?(e="in",n*=39.37):r<1609.344?(e="ft",n/=.30480061):(e="mi",n/=1609.3472):qi(!1,33);for(var a,u,f=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));;){if(a=so.LEADING_DIGITS[(f%3+3)%3]*Math.pow(10,Math.floor(f/3)),u=Math.round(a/n),isNaN(u))return this.element_.style.display="none",void(this.renderedVisible_=!1);if(u>=this.minWidth_)break;++f}var c=a+" "+e;this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},so.Property_={UNITS:"units"};var ho="fraction",no=function(t,i,s,h,n,r){ki.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==h&&(this.image_.crossOrigin=h),this.canvas_=r?document.createElement("CANVAS"):null,this.color_=r,this.imageListenerKeys_=null,this.imageState_=n,this.size_=s,this.src_=i,this.tainting_=!1,2==this.imageState_&&this.determineTainting_()};di.inherits(no,ki),no.get=function(t,i,s,h,n,r){var e=Gn.iconImageCache,o=e.get(i,h,r);return o||(o=new no(t,i,s,h,n,r),e.set(i,h,r,o)),o},no.prototype.determineTainting_=function(){var t=xh(1,1);try{t.drawImage(this.image_,0,0),t.getImageData(0,0,1,1)}catch(i){this.tainting_=!0}},no.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Ri)},no.prototype.handleImageError_=function(){this.imageState_=3,this.unlistenImage_(),this.dispatchChangeEvent_()},no.prototype.handleImageLoad_=function(){this.imageState_=2,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.determineTainting_(),this.replaceColor_(),this.dispatchChangeEvent_()},no.prototype.getImage=function(){return this.canvas_?this.canvas_:this.image_},no.prototype.getImageState=function(){return this.imageState_},no.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.tainting_){var t=this.size_[0],i=this.size_[1],s=xh(t,i);s.fillRect(0,0,t,i),this.hitDetectionImage_=s.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},no.prototype.getSize=function(){return this.size_},no.prototype.getSrc=function(){return this.src_},no.prototype.load=function(){if(0==this.imageState_){this.imageState_=1,this.imageListenerKeys_=[Ai.listenOnce(this.image_,Li,this.handleImageError_,this),Ai.listenOnce(this.image_,Di,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}},no.prototype.replaceColor_=function(){if(!this.tainting_&&null!==this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var i=t.getImageData(0,0,this.image_.width,this.image_.height),s=i.data,h=this.color_[0]/255,n=this.color_[1]/255,r=this.color_[2]/255,e=0,o=s.length;e<o;e+=4)s[e]*=h,s[e+1]*=n,s[e+2]*=r;t.putImageData(i,0,0)}},no.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ai.unlistenByKey),this.imageListenerKeys_=null};var ro="bottom-left",eo="bottom-right",oo="top-left",ao="top-right",uo=function(t){var i=t||{};this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:oo,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:ho,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:ho,this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var s=void 0!==i.img?i.img:null,h=void 0!==i.imgSize?i.imgSize:null,n=i.src;qi(!(void 0!==n&&s),4),qi(!s||s&&h,5),void 0!==n&&0!==n.length||!s||(n=s.src||di.getUid(s).toString()),qi(void 0!==n&&n.length>0,6);var r=void 0!==i.src?0:2;this.color_=void 0!==i.color?Rn.asArray(i.color):null,this.iconImage_=no.get(s,n,h,this.crossOrigin_,r,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:oo,this.origin_=null,this.size_=void 0!==i.size?i.size:null,ge.call(this,{opacity:void 0!==i.opacity?i.opacity:1,rotation:void 0!==i.rotation?i.rotation:0,scale:void 0!==i.scale?i.scale:1,snapToPixel:void 0===i.snapToPixel||i.snapToPixel,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView})};di.inherits(uo,ge),uo.prototype.clone=function(){return new uo({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},uo.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,i=this.getSize();if(this.anchorXUnits_==ho||this.anchorYUnits_==ho){if(!i)return null;t=this.anchor_.slice(),this.anchorXUnits_==ho&&(t[0]*=i[0]),this.anchorYUnits_==ho&&(t[1]*=i[1])}if(this.anchorOrigin_!=oo){if(!i)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=ao&&this.anchorOrigin_!=eo||(t[0]=-t[0]+i[0]),this.anchorOrigin_!=ro&&this.anchorOrigin_!=eo||(t[1]=-t[1]+i[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},uo.prototype.getColor=function(){return this.color_},uo.prototype.getImage=function(t){return this.iconImage_.getImage(t)},uo.prototype.getImageSize=function(){return this.iconImage_.getSize()},uo.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},uo.prototype.getImageState=function(){return this.iconImage_.getImageState()},uo.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},uo.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=oo){var i=this.getSize(),s=this.iconImage_.getSize();if(!i||!s)return null;t=t.slice(),this.offsetOrigin_!=ao&&this.offsetOrigin_!=eo||(t[0]=s[0]-i[0]-t[0]),this.offsetOrigin_!=ro&&this.offsetOrigin_!=eo||(t[1]=s[1]-i[1]-t[1])}return this.origin_=t,this.origin_},uo.prototype.getSrc=function(){return this.iconImage_.getSrc()},uo.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},uo.prototype.listenImageChange=function(t,i){return Ai.listen(this.iconImage_,Ri,t,i)},uo.prototype.load=function(){this.iconImage_.load()},uo.prototype.unlistenImageChange=function(t,i){Ai.unlisten(this.iconImage_,Ri,t,i)},window.proj4=ht,window.proj4.defs("EPSG:2056","+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs");const fo={anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",scale:.5,src:`${window.stzhComponents.pathMedia}/olmap/marker.png`},co=Object.assign(Object.assign({},fo),{src:`${window.stzhComponents.pathMedia}/olmap/marker-active.png`}),lo=Object.assign(Object.assign({},fo),{anchor:[.5,.5],src:`${window.stzhComponents.pathMedia}/olmap/marker-position.png`}),vo=class{constructor(s){t(this,s),this.stzhInitialized=i(this,"stzhInitialized",7),this.stzhPostRender=i(this,"stzhPostRender",7),this.stzhMoveStart=i(this,"stzhMoveStart",7),this.stzhMoveEnd=i(this,"stzhMoveEnd",7),this.handlePostRender=()=>{this.stzhPostRender.emit({component:"stzh-olmap"})},this.handleMoveStart=()=>{this.stzhMoveStart.emit({component:"stzh-olmap"})},this.handleMoveEnd=()=>{this.stzhMoveEnd.emit({component:"stzh-olmap"})},this.handleInsideModalOpen=()=>{this.map&&requestAnimationFrame((()=>{this.map.updateSize()}))},this.handlePrintButtonClick=()=>{this.printIframe||(this.printIframe=document.createElement("iframe"),Object.assign(this.printIframe.style,{height:"0px",width:"0px",position:"absolute",border:"none"}),this.element.append(this.printIframe)),this.printIframe.innerHTML="";const t=this.printIframe.contentWindow,i=this.constructor.style.replace('@charset "UTF-8";',""),s=Array.from(document.querySelectorAll("link")).map((t=>t.outerHTML));let h;this.map.once("postcompose",(function(t){h=t.context.canvas.toDataURL("image/png")})),this.map.renderSync(),t.document.body.innerHTML=`\n ${s.join("")}\n\n <style type="text/css">\n ${i}\n </style>\n\n <div class="stzh-olmap__map stzh-olmap__map--print">\n <img class="stzh-olmap__print-image" src="${h}">\n ${this.element.querySelector(".ol-scale-line.ol-unselectable").outerHTML}\n </div>\n `,setTimeout((()=>{try{t.document.execCommand("print",!1,null)}catch(i){t.print()}}),1e3)},this.localization=void 0,this.hostname="www.ogc.stadt-zuerich.ch",this.scaleControl=!0,this.layerControl=!0,this.printControl=!0,this.locationControl=!1,this.layer="streets",this.zoom=7,this.center=[2683311,1247082],this.centerMarker=!0,this.resolutions=[67.73333333333,33.8666666667,16.9333333333,8.4666666667,4.2333333333,2.1166666667,1.0583333333,.5291666667,.2645833333,.1322916667,.0661458333],this.layers={streets:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-streets.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"basiskarte_zuerich_gebaeudeschraegansicht",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}},satellite:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-satellite.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"orthofoto",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}}}}zoomWatcher(t){this.map&&this.map.getView().setZoom(t)}scaleControlWatcher(t){this.map&&(t?(this.scaleControlOl=new so({units:"metric"}),this.map.addControl(this.scaleControlOl)):(this.scaleControl&&this.map.removeControl(this.scaleControlOl),this.scaleControlOl=null))}printControlWatcher(t){this.map&&(t?(this.printControlElement=document.createElement("button"),this.printControlElement.className="ol-print",this.printControlElement.ariaLabel=this.localization.printLabel,this.printControlElement.addEventListener("click",this.handlePrintButtonClick),this.printControlElement.innerHTML='<stzh-icon name="print" class="ol-print__icon"></stzh-icon>',this.printControlOl=new qh({element:this.printControlElement}),this.map.addControl(this.printControlOl)):(this.printControlOl&&this.map.removeControl(this.printControlOl),this.printControlOl=null,this.printControlElement=null))}layerControlWatcher(t){this.map&&1!==this.layersArray.length&&(t?(this.layerControlElement=document.createElement("button"),this.layerControlElement.className="ol-layer",this.layerControlElement.addEventListener("click",(()=>{this.layer="streets"===this.layer?"satellite":"streets"})),this.layerControlImageElement=document.createElement("img"),this.layerControlImageElement.className="ol-layer__thumbnail",this.layerControlImageElement.setAttribute("role","presentation"),this.layerControlImageElement.setAttribute("alt",""),this.layerControlTextElement=document.createElement("span"),this.layerControlTextElement.className="ol-layer__text",this.layerControlElement.appendChild(this.layerControlImageElement),this.layerControlElement.appendChild(this.layerControlTextElement),this.layerControlOl=new qh({element:this.layerControlElement}),this.map.addControl(this.layerControlOl)):(this.layerControlOl&&this.map.removeControl(this.layerControlOl),this.layerControlOl=null,this.layerControlElement=null,this.layerControlImageElement=null,this.layerControlTextElement=null))}locationControlWatcher(t){if(this.map)if(t){this.locationControlElement=document.createElement("button"),this.locationControlElement.className="ol-location",this.locationControlElement.innerHTML='<stzh-icon name="target-bullet" class="ol-location__icon"></stzh-icon>',this.locationControlElement.addEventListener("click",(()=>{this.geolocation.getTracking()?this.disableLocationTracking():this.enableLocationTracking()})),this.locationControlOl=new qh({element:this.locationControlElement}),this.geolocation=new Vs({projection:this.map.getView().getProjection()}),this.positionMarkerOl=new xe,this.positionMarkerOl.setId("position");const t=new be({image:new uo(lo)});this.positionMarkerOl.setStyle(t),this.positionLayer.getSource().addFeature(this.positionMarkerOl),this.geolocation.on("change:position",(()=>{const t=this.geolocation.getPosition();this.positionMarkerOl.setGeometry(new ks(t)),rs.containsExtent(this.layers[this.layer].options.extent,this.positionMarkerOl.getGeometry().getExtent())&&this.map.getView().setCenter(t)})),this.geolocation.on("change:tracking",(()=>{const t=this.geolocation.getTracking();this.positionMarkerOl.setGeometry(null),this.setLocationControlState(t)})),this.geolocation.on("error",(()=>{this.setLocationControlState(!1)})),this.map.addControl(this.locationControlOl)}else this.disableLocationTracking(),this.locationControlOl&&this.map.removeControl(this.locationControlOl),this.positionMarkerOl&&this.positionLayer.getSource().removeFeature(this.positionMarkerOl),this.locationControlOl=null,this.locationControlElement=null,this.geolocation=null,this.positionMarkerOl=null}layerWatcher(t){this.map&&Object.entries(this.rasterLayers).forEach((([i,s])=>{if(i===t){s.setVisible(!0),this.map.getView().set("projection",this.projections[t]);const h=this.layersArray.find((([t])=>t!==this.layer));if(h&&(this.layerControlImageElement&&(this.layerControlImageElement.src=h[1].thumbnailUrl),this.layerControlTextElement)){let t="";"streets"===i?t=this.localization.streetsLayerTitle:"satellite"===i&&(t=this.localization.satelliteLayerTitle),this.layerControlTextElement.textContent=h[1].title||t}}else s.setVisible(!1)}))}centerWatcher(t){this.map.getView().setCenter(t),this.centerMarkerOl&&this.centerMarkerOl.setGeometry(new ks(t))}async centerMarkerWatcher(t){t?this.centerMarkerOl=await this.addIconMarker(this.center):this.centerMarkerOl&&this.removeIconMarker(this.centerMarkerOl)}async getMap(){return this.map}async addIconMarker(t){const i=new xe({geometry:new ks(t)}),s=new be({image:new uo(fo)});return i.setStyle(s),this.iconLayer.getSource().addFeature(i),i}async removeIconMarker(t){return this.iconLayer.getSource().removeFeature(t)}async setIconMarkerActive(t){t.setStyle(new be({image:new uo(co)}))}async setIconMarkerInactive(t){t.setStyle(new be({image:new uo(fo)}))}async enableLocationTracking(){this.setLocationControlState(!0),this.geolocation&&this.geolocation.setTracking(!0)}async disableLocationTracking(){this.setLocationControlState(!1),this.geolocation&&this.geolocation.setTracking(!1)}setLocationControlState(t){this.positionLayer&&this.positionLayer.setVisible(t),this.locationControlElement&&this.locationControlElement.classList.toggle("active",t)}createMap(){const t=document.createElement("stzh-icon");t.ariaLabel=this.localization.zoomInLabel,t.name="plus";const i=document.createElement("stzh-icon");return i.ariaLabel=this.localization.zoomOutLabel,i.name="minus",new pe({controls:hn({zoomOptions:{zoomInLabel:t,zoomOutLabel:i,zoomInTipLabel:"",zoomOutTipLabel:""}}),interactions:wn({mouseWheelZoom:!1}),loadTilesWhileAnimating:!0,loadTilesWhileInteracting:!0,target:this.mapElement,logo:!1})}createRasterLayer(t,i){return new Qe({title:"wmts",type:"base",extent:i.extent,source:this.createLayerSource(t,i)})}createLayerSource(t,i){return this.projections||(this.projections={}),this.projections[t]=new Ms({code:"EPSG:2056",extent:i.extent}),this.creatRasterSource(t,i)}creatRasterSource(t,i){const{url:s,layer:h,matrixSet:n,origin:r}=i,e=[];for(let a=0;a<this.resolutions.length;a++)e.push(a);const o=new Ge({origin:r,resolutions:this.resolutions,matrixIds:e,tileSize:[512,512]});return new je({url:s,tileGrid:o,style:"default",projection:this.projections[t],crossOrigin:"anonymous",layer:h,matrixSet:n,requestEncoding:"REST"})}createIconLayer(){return new $e({source:new Je({})})}initMap(){if(this.map=this.createMap(),this.map.on("postrender",this.handlePostRender),this.map.on("movestart",this.handleMoveStart),this.map.on("moveend",this.handleMoveEnd),this.layersArray=Object.entries(this.layers),this.layersArray.length>2)throw new Error("There are only two different layers allowed.");this.rasterLayers={},this.layersArray.forEach((([t,i])=>{i.options.url=i.options.url.replace(/{hostname}/gi,this.hostname),this.rasterLayers[t]=this.createRasterLayer(t,i.options),this.map.addLayer(this.rasterLayers[t])})),this.positionLayer=this.createIconLayer(),this.positionLayer.setVisible(!1),this.map.addLayer(this.positionLayer),this.iconLayer=this.createIconLayer(),this.map.addLayer(this.iconLayer);const t=new bh({center:this.center,projection:this.projections[this.layer],zoom:this.zoom,resolutions:this.resolutions});this.map.setView(t),this.scaleControlWatcher(this.scaleControl),this.printControlWatcher(this.printControl),this.locationControlWatcher(this.locationControl),this.layerControlWatcher(this.layerControl),this.layerWatcher(this.layer),this.centerWatcher(this.center),this.centerMarkerWatcher(this.centerMarker),this.stzhInitialized.emit({component:"stzh-olmap"})}componentShouldUpdate(t,i,s){return["hostname","localization","layers","resolutions"].includes(s)}async componentWillLoad(){this.localization||(this.localization=await r(this.element,"olmap"))}componentWillUpdate(){this.map&&(this.map.setTarget(null),this.map=null)}componentDidRender(){this.map||this.initMap()}connectedCallback(){const t=this.element.closest("stzh-dialog");t&&t.addEventListener("stzhOpen",this.handleInsideModalOpen)}disconnectedCallback(){this.map&&(this.map.setTarget(null),this.map=null);const t=this.element.closest("stzh-dialog");t&&t.removeEventListener("stzhOpen",this.handleInsideModalOpen)}render(){return s(h,null,s("div",{class:{"stzh-olmap":!0}},s("div",{ref:t=>this.mapElement=t,class:"stzh-olmap__map"})))}get element(){return n(this)}static get watchers(){return{zoom:["zoomWatcher"],scaleControl:["scaleControlWatcher"],printControl:["printControlWatcher"],layerControl:["layerControlWatcher"],locationControl:["locationControlWatcher"],layer:["layerWatcher"],center:["centerWatcher"],centerMarker:["centerMarkerWatcher"]}}};vo.style=":host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}stzh-olmap{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block;position:relative;width:100%;height:18.75rem}stzh-olmap[hidden]{display:none}stzh-olmap *,stzh-olmap *::before,stzh-olmap *::after{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (min-width: 800px){stzh-olmap{height:25rem}}.stzh-olmap__map{position:absolute;width:100%;height:100%;top:0;left:0}.stzh-olmap__map--print{margin-top:var(--stzh-space-xxlarge);max-width:100%;height:auto}.stzh-olmap__print-image{display:block;max-width:100%}.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:normal;font-size:var(--stzh-font-deca-font-size);line-height:var(--stzh-font-deca-text-line-height);letter-spacing:var(--stzh-font-deca-text-letter-spacing);position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;border-radius:0;color:var(--stzh-color-primary, var(--stzh-color-zueriblue));-webkit-transition:all var(--stzh-base-transition-animation-speed) ease;transition:all var(--stzh-base-transition-animation-speed) ease;background-color:var(--stzh-color-white);width:2.5rem;height:2.375rem;cursor:pointer}.stzh-olmap .ol-print stzh-icon,.stzh-olmap .ol-location stzh-icon,.stzh-olmap .ol-zoom-in stzh-icon,.stzh-olmap .ol-zoom-out stzh-icon{--size:var(--stzh-icon-size-small)}.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover{color:var(--stzh-color-white);background:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom{position:absolute;right:0.625rem;-webkit-box-shadow:var(--stzh-box-shadow-popover);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-form-input-border-radius)}@media screen and (min-width: 800px){.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom{right:1.25rem}}.stzh-olmap .ol-layer{left:0.625rem;bottom:0.625rem;right:auto;padding:var(--stzh-space-xxxsmall);border:none}@media screen and (min-width: 800px){.stzh-olmap .ol-layer{left:1.25rem;bottom:1.25rem}}.stzh-olmap .ol-layer__thumbnail{width:4.6875rem;height:4.6875rem;display:block}.stzh-olmap .ol-layer__text{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:normal;font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;bottom:0;left:0;right:0;text-align:left;background-color:var(--stzh-color-white);color:var(--stzh-color-primary, var(--stzh-color-zueriblue));padding-left:calc(var(--stzh-space-xxxsmall) + 0.0625rem);padding-right:calc(var(--stzh-space-xxxsmall) + 0.0625rem)}.stzh-olmap .ol-layer:hover .ol-layer__text{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-olmap .ol-location{bottom:calc(3.75rem + 7.125rem + var(--stzh-space-small) * 2)}@media screen and (min-width: 800px){.stzh-olmap .ol-location{bottom:calc(4.375rem + 7.125rem + var(--stzh-space-small) * 2)}}.stzh-olmap .ol-location.active{background:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));color:var(--stzh-color-white)}.stzh-olmap .ol-zoom{bottom:calc(3.75rem + 2.375rem + var(--stzh-space-small));background-color:var(--stzh-color-grey13)}@media screen and (min-width: 800px){.stzh-olmap .ol-zoom{bottom:calc(4.375rem + 2.375rem + var(--stzh-space-small))}}.stzh-olmap .ol-zoom-in{margin-bottom:0.0625rem}.stzh-olmap .ol-print{bottom:3.75rem}@media screen and (min-width: 800px){.stzh-olmap .ol-print{bottom:4.375rem}}.stzh-olmap .ol-rotate,.stzh-olmap .ol-attribution{display:none}.stzh-olmap .ol-scale-line{position:absolute;bottom:0;right:0;padding:var(--stzh-space-xxsmall);background:var(--stzh-color-white);border-top-left-radius:var(--stzh-form-input-border-radius)}.stzh-olmap .ol-scale-line-inner{font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);border:0.0625rem solid var(--stzh-color-grey55);border-top:0;color:var(--stzh-color-grey55);text-align:center}";export{vo as stzh_olmap}
7
+ */ss.prototype.geodesicArea=function(t){return ss.getArea_(t,this.radius)},ss.prototype.haversineDistance=function(t,i){return ss.getDistance_(t,i,this.radius)},ss.prototype.offset=function(t,i,s){var h=Bi.toRadians(t[1]),n=Bi.toRadians(t[0]),r=i/this.radius,e=Math.asin(Math.sin(h)*Math.cos(r)+Math.cos(h)*Math.sin(r)*Math.cos(s)),o=n+Math.atan2(Math.sin(s)*Math.sin(r)*Math.cos(h),Math.cos(r)-Math.sin(h)*Math.sin(e));return[Bi.toDegrees(o),Bi.toDegrees(e)]},ss.DEFAULT_RADIUS=6371008.8,ss.getLength=function(t,i){var s,h,n,r,e,o,a=i||{},u=a.radius||ss.DEFAULT_RADIUS,f=a.projection||"EPSG:3857",c=(t=t.clone().transform(f,"EPSG:4326")).getType(),l=0;switch(c){case Yi:case Ki:break;case Hi:case Ji:s=t.getCoordinates(),l=ss.getLength_(s,u);break;case Qi:case Zi:for(n=0,r=(s=t.getCoordinates()).length;n<r;++n)l+=ss.getLength_(s[n],u);break;case $i:for(n=0,r=(s=t.getCoordinates()).length;n<r;++n)for(e=0,o=(h=s[n]).length;e<o;++e)l+=ss.getLength_(h[e],u);break;case ts:var v=t.getGeometries();for(n=0,r=v.length;n<r;++n)l+=ss.getLength(v[n],i);break;default:throw new Error("Unsupported geometry type: "+c)}return l},ss.getLength_=function(t,i){for(var s=0,h=0,n=t.length;h<n-1;++h)s+=ss.getDistance_(t[h],t[h+1],i);return s},ss.getDistance_=function(t,i,s){var h=Bi.toRadians(t[1]),n=Bi.toRadians(i[1]),r=(n-h)/2,e=Bi.toRadians(i[0]-t[0])/2,o=Math.sin(r)*Math.sin(r)+Math.sin(e)*Math.sin(e)*Math.cos(h)*Math.cos(n);return 2*s*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))},ss.getArea=function(t,i){var s,h,n,r,e,o,a=i||{},u=a.radius||ss.DEFAULT_RADIUS,f=a.projection||"EPSG:3857",c=(t=t.clone().transform(f,"EPSG:4326")).getType(),l=0;switch(c){case Yi:case Ki:case Hi:case Qi:case Ji:break;case Zi:for(s=t.getCoordinates(),l=Math.abs(ss.getArea_(s[0],u)),n=1,r=s.length;n<r;++n)l-=Math.abs(ss.getArea_(s[n],u));break;case $i:for(n=0,r=(s=t.getCoordinates()).length;n<r;++n)for(h=s[n],l+=Math.abs(ss.getArea_(h[0],u)),e=1,o=h.length;e<o;++e)l-=Math.abs(ss.getArea_(h[e],u));break;case ts:var v=t.getGeometries();for(n=0,r=v.length;n<r;++n)l+=ss.getArea(v[n],i);break;default:throw new Error("Unsupported geometry type: "+c)}return l},ss.getArea_=function(t,i){for(var s=0,h=t.length,n=t[h-1][0],r=t[h-1][1],e=0;e<h;e++){var o=t[e][0],a=t[e][1];s+=Bi.toRadians(o-n)*(2+Math.sin(Bi.toRadians(r))+Math.sin(Bi.toRadians(a))),n=o,r=a}return s*i*i/2};var hs={binarySearch:function(t,i,s){for(var h,n,r=s||hs.numberSafeCompareFunction,e=0,o=t.length,a=!1;e<o;)(n=+r(t[h=e+(o-e>>1)],i))<0?e=h+1:(o=h,a=!n);return a?e:~e},numberSafeCompareFunction:function(t,i){return t>i?1:t<i?-1:0},includes:function(t,i){return t.indexOf(i)>=0},linearFindNearest:function(t,i,s){var h,n=t.length;if(t[0]<=i)return 0;if(i<=t[n-1])return n-1;if(s>0){for(h=1;h<n;++h)if(t[h]<i)return h-1}else if(s<0){for(h=1;h<n;++h)if(t[h]<=i)return h}else for(h=1;h<n;++h){if(t[h]==i)return h;if(t[h]<i)return t[h-1]-i<i-t[h]?h-1:h}return n-1},reverseSubArray:function(t,i,s){for(;i<s;){var h=t[i];t[i]=t[s],t[s]=h,++i,--s}},extend:function(t,i){var s,h=Array.isArray(i)?i:[i],n=h.length;for(s=0;s<n;s++)t[t.length]=h[s]},remove:function(t,i){var s=t.indexOf(i),h=s>-1;return h&&t.splice(s,1),h},find:function(t,i){for(var s,h=t.length>>>0,n=0;n<h;n++)if(i(s=t[n],n,t))return s;return null},equals:function(t,i){var s=t.length;if(s!==i.length)return!1;for(var h=0;h<s;h++)if(t[h]!==i[h])return!1;return!0},stableSort:function(t,i){var s,h=t.length,n=Array(t.length);for(s=0;s<h;s++)n[s]={index:s,value:t[s]};for(n.sort((function(t,s){return i(t.value,s.value)||t.index-s.index})),s=0;s<t.length;s++)t[s]=n[s].value},findIndex:function(t,i){var s;return t.every((function(h,n){return s=n,!i(h,n,t)}))?-1:s},isSorted:function(t,i,s){var h=i||hs.numberSafeCompareFunction;return t.every((function(i,n){if(0===n)return!0;var r=h(t[n-1],i);return!(r>0||s&&0===r)}))}},ns="top-left",rs={boundingExtent:function(t){for(var i=rs.createEmpty(),s=0,h=t.length;s<h;++s)rs.extendCoordinate(i,t[s]);return i},boundingExtentXYs_:function(t,i,s){var h=Math.min.apply(null,t),n=Math.min.apply(null,i),r=Math.max.apply(null,t),e=Math.max.apply(null,i);return rs.createOrUpdate(h,n,r,e,s)},buffer:function(t,i,s){return s?(s[0]=t[0]-i,s[1]=t[1]-i,s[2]=t[2]+i,s[3]=t[3]+i,s):[t[0]-i,t[1]-i,t[2]+i,t[3]+i]},clone:function(t,i){return i?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i):t.slice()},closestSquaredDistanceXY:function(t,i,s){var h,n;return(h=i<t[0]?t[0]-i:t[2]<i?i-t[2]:0)*h+(n=s<t[1]?t[1]-s:t[3]<s?s-t[3]:0)*n},containsCoordinate:function(t,i){return rs.containsXY(t,i[0],i[1])},containsExtent:function(t,i){return t[0]<=i[0]&&i[2]<=t[2]&&t[1]<=i[1]&&i[3]<=t[3]},containsXY:function(t,i,s){return t[0]<=i&&i<=t[2]&&t[1]<=s&&s<=t[3]},coordinateRelationship:function(t,i){var s=i[0],h=i[1],n=0;return s<t[0]?n|=16:s>t[2]&&(n|=4),h<t[1]?n|=8:h>t[3]&&(n|=2),0===n&&(n=1),n},createEmpty:function(){return[1/0,1/0,-1/0,-1/0]},createOrUpdate:function(t,i,s,h,n){return n?(n[0]=t,n[1]=i,n[2]=s,n[3]=h,n):[t,i,s,h]},createOrUpdateEmpty:function(t){return rs.createOrUpdate(1/0,1/0,-1/0,-1/0,t)},createOrUpdateFromCoordinate:function(t,i){var s=t[0],h=t[1];return rs.createOrUpdate(s,h,s,h,i)},createOrUpdateFromCoordinates:function(t,i){var s=rs.createOrUpdateEmpty(i);return rs.extendCoordinates(s,t)},createOrUpdateFromFlatCoordinates:function(t,i,s,h,n){var r=rs.createOrUpdateEmpty(n);return rs.extendFlatCoordinates(r,t,i,s,h)},createOrUpdateFromRings:function(t,i){var s=rs.createOrUpdateEmpty(i);return rs.extendRings(s,t)},equals:function(t,i){return t[0]==i[0]&&t[2]==i[2]&&t[1]==i[1]&&t[3]==i[3]},extend:function(t,i){return i[0]<t[0]&&(t[0]=i[0]),i[2]>t[2]&&(t[2]=i[2]),i[1]<t[1]&&(t[1]=i[1]),i[3]>t[3]&&(t[3]=i[3]),t},extendCoordinate:function(t,i){i[0]<t[0]&&(t[0]=i[0]),i[0]>t[2]&&(t[2]=i[0]),i[1]<t[1]&&(t[1]=i[1]),i[1]>t[3]&&(t[3]=i[1])},extendCoordinates:function(t,i){var s,h;for(s=0,h=i.length;s<h;++s)rs.extendCoordinate(t,i[s]);return t},extendFlatCoordinates:function(t,i,s,h,n){for(;s<h;s+=n)rs.extendXY(t,i[s],i[s+1]);return t},extendRings:function(t,i){var s,h;for(s=0,h=i.length;s<h;++s)rs.extendCoordinates(t,i[s]);return t},extendXY:function(t,i,s){t[0]=Math.min(t[0],i),t[1]=Math.min(t[1],s),t[2]=Math.max(t[2],i),t[3]=Math.max(t[3],s)},forEachCorner:function(t,i,s){var h;return(h=i.call(s,rs.getBottomLeft(t)))||(h=i.call(s,rs.getBottomRight(t)))||(h=i.call(s,rs.getTopRight(t)))?h:(h=i.call(s,rs.getTopLeft(t)))||!1},getArea:function(t){var i=0;return rs.isEmpty(t)||(i=rs.getWidth(t)*rs.getHeight(t)),i},getBottomLeft:function(t){return[t[0],t[1]]},getBottomRight:function(t){return[t[2],t[1]]},getCenter:function(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]},getCorner:function(t,i){var s;return"bottom-left"===i?s=rs.getBottomLeft(t):"bottom-right"===i?s=rs.getBottomRight(t):i===ns?s=rs.getTopLeft(t):"top-right"===i?s=rs.getTopRight(t):qi(!1,13),s},getEnlargedArea:function(t,i){var s=Math.min(t[0],i[0]),h=Math.min(t[1],i[1]);return(Math.max(t[2],i[2])-s)*(Math.max(t[3],i[3])-h)},getForViewAndSize:function(t,i,s,h,n){var r=i*h[0]/2,e=i*h[1]/2,o=Math.cos(s),a=Math.sin(s),u=r*o,f=r*a,c=e*o,l=e*a,v=t[0],d=t[1],M=v-u+l,m=v-u-l,p=v+u-l,g=v+u+l,_=d-f-c,w=d-f+c,y=d+f+c,b=d+f-c;return rs.createOrUpdate(Math.min(M,m,p,g),Math.min(_,w,y,b),Math.max(M,m,p,g),Math.max(_,w,y,b),n)},getHeight:function(t){return t[3]-t[1]},getIntersectionArea:function(t,i){var s=rs.getIntersection(t,i);return rs.getArea(s)},getIntersection:function(t,i,s){var h=s||rs.createEmpty();return rs.intersects(t,i)&&(h[0]=t[0]>i[0]?t[0]:i[0],h[1]=t[1]>i[1]?t[1]:i[1],h[2]=t[2]<i[2]?t[2]:i[2],h[3]=t[3]<i[3]?t[3]:i[3]),h},getMargin:function(t){return rs.getWidth(t)+rs.getHeight(t)},getSize:function(t){return[t[2]-t[0],t[3]-t[1]]},getTopLeft:function(t){return[t[0],t[3]]},getTopRight:function(t){return[t[2],t[3]]},getWidth:function(t){return t[2]-t[0]},intersects:function(t,i){return t[0]<=i[2]&&t[2]>=i[0]&&t[1]<=i[3]&&t[3]>=i[1]},isEmpty:function(t){return t[2]<t[0]||t[3]<t[1]},returnOrUpdate:function(t,i){return i?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i):t},scaleFromCenter:function(t,i){var s=(t[2]-t[0])/2*(i-1),h=(t[3]-t[1])/2*(i-1);t[0]-=s,t[2]+=s,t[1]-=h,t[3]+=h},intersectsSegment:function(t,i,s){var h=!1,n=rs.coordinateRelationship(t,i),r=rs.coordinateRelationship(t,s);if(1===n||1===r)h=!0;else{var e,o,a=t[0],u=t[1],f=t[2],c=t[3],l=s[0],v=s[1],d=(v-i[1])/(l-i[0]);2&r&&!(2&n)&&(h=(e=l-(v-c)/d)>=a&&e<=f),h||!(4&r)||4&n||(h=(o=v-(l-f)*d)>=u&&o<=c),h||!(8&r)||8&n||(h=(e=l-(v-u)/d)>=a&&e<=f),h||!(16&r)||16&n||(h=(o=v-(l-a)*d)>=u&&o<=c)}return h},applyTransform:function(t,i,s){var h=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return i(h,h,2),rs.boundingExtentXYs_([h[0],h[2],h[4],h[6]],[h[1],h[3],h[5],h[7]],s)}},es="XY",os="XYZM",as={TRUE:function(){return!0},FALSE:function(){return!1}},us=function(t,i,s,h,n,r){var e,o=r||[],a=0;for(e=i;e<s;e+=h){var u=t[e],f=t[e+1];o[a++]=n[0]*u+n[2]*f+n[4],o[a++]=n[1]*u+n[3]*f+n[5]}return r&&o.length!=a&&(o.length=a),o},fs=function(t,i,s,h,n,r,e){for(var o=e||[],a=Math.cos(n),u=Math.sin(n),f=r[0],c=r[1],l=0,v=i;v<s;v+=h){var d=t[v]-f,M=t[v+1]-c;o[l++]=f+d*a-M*u,o[l++]=c+d*u+M*a;for(var m=v+2;m<v+h;++m)o[l++]=t[m]}return e&&o.length!=l&&(o.length=l),o},cs=function(t,i,s,h,n,r,e,o){for(var a=o||[],u=e[0],f=e[1],c=0,l=i;l<s;l+=h){var v=t[l+1]-f;a[c++]=u+n*(t[l]-u),a[c++]=f+r*v;for(var d=l+2;d<l+h;++d)a[c++]=t[d]}return o&&a.length!=c&&(a.length=c),a},ls=function(t,i,s,h,n,r,e){var o,a,u=e||[],f=0;for(o=i;o<s;o+=h)for(u[f++]=t[o]+n,u[f++]=t[o+1]+r,a=o+2;a<o+h;++a)u[f++]=t[a];return e&&u.length!=f&&(u.length=f),u},vs={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft",METERS_PER_UNIT:{}};vs.METERS_PER_UNIT[vs.DEGREES]=2*Math.PI*6370997/360,vs.METERS_PER_UNIT[vs.FEET]=.3048,vs.METERS_PER_UNIT[vs.METERS]=1,vs.METERS_PER_UNIT[vs.USFEET]=1200/3937;var ds={cache_:null,set:function(t){ds.cache_=t},get:function(){return ds.cache_||window.proj4}},Ms=function(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit;var i=t.code;if(di.ENABLE_PROJ4JS){var s=ds.get();if("function"==typeof s){var h=s.defs(i);void 0!==h&&(void 0!==h.axis&&void 0===t.axisOrientation&&(this.axisOrientation_=h.axis),void 0===t.metersPerUnit&&(this.metersPerUnit_=h.to_meter),void 0===t.units&&(this.units_=h.units))}}};Ms.prototype.canWrapX=function(){return this.canWrapX_},Ms.prototype.getCode=function(){return this.code_},Ms.prototype.getExtent=function(){return this.extent_},Ms.prototype.getUnits=function(){return this.units_},Ms.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||vs.METERS_PER_UNIT[this.units_]},Ms.prototype.getWorldExtent=function(){return this.worldExtent_},Ms.prototype.getAxisOrientation=function(){return this.axisOrientation_},Ms.prototype.isGlobal=function(){return this.global_},Ms.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},Ms.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},Ms.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},Ms.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},Ms.prototype.setWorldExtent=function(t){this.worldExtent_=t},Ms.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},Ms.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var ms={Projection_:function(t){Ms.call(this,{code:t,units:vs.METERS,extent:ms.EXTENT,global:!0,worldExtent:ms.WORLD_EXTENT,getPointResolution:function(t,i){return t/Bi.cosh(i[1]/ms.RADIUS)}})}};di.inherits(ms.Projection_,Ms),ms.RADIUS=6378137,ms.HALF_SIZE=Math.PI*ms.RADIUS,ms.EXTENT=[-ms.HALF_SIZE,-ms.HALF_SIZE,ms.HALF_SIZE,ms.HALF_SIZE],ms.WORLD_EXTENT=[-180,-85,180,85],ms.PROJECTIONS=[new ms.Projection_("EPSG:3857"),new ms.Projection_("EPSG:102100"),new ms.Projection_("EPSG:102113"),new ms.Projection_("EPSG:900913"),new ms.Projection_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new ms.Projection_("urn:ogc:def:crs:EPSG::3857"),new ms.Projection_("http://www.opengis.net/gml/srs/epsg.xml#3857")],ms.fromEPSG4326=function(t,i,s){var h=t.length,n=s>1?s:2,r=i;void 0===r&&(r=n>2?t.slice():new Array(h));for(var e=ms.HALF_SIZE,o=0;o<h;o+=n){r[o]=e*t[o]/180;var a=ms.RADIUS*Math.log(Math.tan(Math.PI*(t[o+1]+90)/360));a>e?a=e:a<-e&&(a=-e),r[o+1]=a}return r},ms.toEPSG4326=function(t,i,s){var h=t.length,n=s>1?s:2,r=i;void 0===r&&(r=n>2?t.slice():new Array(h));for(var e=0;e<h;e+=n)r[e]=180*t[e]/ms.HALF_SIZE,r[e+1]=360*Math.atan(Math.exp(t[e+1]/ms.RADIUS))/Math.PI-90;return r};var ps={Projection_:function(t,i){Ms.call(this,{code:t,units:vs.DEGREES,extent:ps.EXTENT,axisOrientation:i,global:!0,metersPerUnit:ps.METERS_PER_UNIT,worldExtent:ps.EXTENT})}};di.inherits(ps.Projection_,Ms),ps.RADIUS=6378137,ps.EXTENT=[-180,-90,180,90],ps.METERS_PER_UNIT=Math.PI*ps.RADIUS/180,ps.PROJECTIONS=[new ps.Projection_("CRS:84"),new ps.Projection_("EPSG:4326","neu"),new ps.Projection_("urn:ogc:def:crs:EPSG::4326","neu"),new ps.Projection_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new ps.Projection_("urn:ogc:def:crs:OGC:1.3:CRS84"),new ps.Projection_("urn:ogc:def:crs:OGC:2:84"),new ps.Projection_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ps.Projection_("urn:x-ogc:def:crs:EPSG:4326","neu")];var gs={cache_:{},clear:function(){gs.cache_={}},get:function(t){return gs.cache_[t]||null},add:function(t,i){gs.cache_[t]=i}},_s={cache_:{},clear:function(){_s.cache_={}},add:function(t,i,s){var h=t.getCode(),n=i.getCode(),r=_s.cache_;h in r||(r[h]={}),r[h][n]=s},remove:function(t,i){var s=t.getCode(),h=i.getCode(),n=_s.cache_,r=n[s][h];return delete n[s][h],Si.isEmpty(n[s])&&delete n[s],r},get:function(t,i){var s,h=_s.cache_;return t in h&&i in h[t]&&(s=h[t][i]),s}},ws={};ws.METERS_PER_UNIT=vs.METERS_PER_UNIT,ws.SPHERE_=new ss(ss.DEFAULT_RADIUS),di.ENABLE_PROJ4JS&&(ws.setProj4=function(t){ds.set(t)}),ws.getPointResolution=function(t,i,s,h){var n,r=(t=ws.get(t)).getPointResolutionFunc();if(r)n=r(i,s);else if(t.getUnits()==vs.DEGREES&&!h||h==vs.DEGREES)n=i;else{var e=ws.getTransformFromProjections(t,ws.get("EPSG:4326")),o=[s[0]-i/2,s[1],s[0]+i/2,s[1],s[0],s[1]-i/2,s[0],s[1]+i/2];o=e(o,o,2),n=(ws.SPHERE_.haversineDistance(o.slice(0,2),o.slice(2,4))+ws.SPHERE_.haversineDistance(o.slice(4,6),o.slice(6,8)))/2;var a=h?vs.METERS_PER_UNIT[h]:t.getMetersPerUnit();void 0!==a&&(n/=a)}return n},ws.addEquivalentProjections=function(t){ws.addProjections(t),t.forEach((function(i){t.forEach((function(t){i!==t&&_s.add(i,t,ws.cloneTransform)}))}))},ws.addEquivalentTransforms=function(t,i,s,h){t.forEach((function(t){i.forEach((function(i){_s.add(t,i,s),_s.add(i,t,h)}))}))},ws.addProjection=function(t){gs.add(t.getCode(),t),_s.add(t,t,ws.cloneTransform)},ws.addProjections=function(t){t.forEach(ws.addProjection)},ws.clearAllProjections=function(){gs.clear(),_s.clear()},ws.createProjection=function(t,i){return t?"string"==typeof t?ws.get(t):t:ws.get(i)},ws.addCoordinateTransforms=function(t,i,s,h){var n=ws.get(t),r=ws.get(i);_s.add(n,r,ws.createTransformFromCoordinateTransform(s)),_s.add(r,n,ws.createTransformFromCoordinateTransform(h))},ws.createTransformFromCoordinateTransform=function(t){return function(i,s,h){var n,r,e,o=i.length,a=void 0!==h?h:2,u=void 0!==s?s:new Array(o);for(r=0;r<o;r+=a)for(n=t([i[r],i[r+1]]),u[r]=n[0],u[r+1]=n[1],e=a-1;e>=2;--e)u[r+e]=i[r+e];return u}},ws.fromLonLat=function(t,i){return ws.transform(t,"EPSG:4326",void 0!==i?i:"EPSG:3857")},ws.toLonLat=function(t,i){var s=ws.transform(t,void 0!==i?i:"EPSG:3857","EPSG:4326"),h=s[0];return(h<-180||h>180)&&(s[0]=Bi.modulo(h+180,360)-180),s},ws.get=function(t){var i=null;if(t instanceof Ms)i=t;else if("string"==typeof t){var s=t;if(i=gs.get(s),di.ENABLE_PROJ4JS&&!i){var h=ds.get();"function"==typeof h&&void 0!==h.defs(s)&&(i=new Ms({code:s}),ws.addProjection(i))}}return i},ws.equivalent=function(t,i){if(t===i)return!0;var s=t.getUnits()===i.getUnits();return(t.getCode()===i.getCode()||ws.getTransformFromProjections(t,i)===ws.cloneTransform)&&s},ws.getTransform=function(t,i){var s=ws.get(t),h=ws.get(i);return ws.getTransformFromProjections(s,h)},ws.getTransformFromProjections=function(t,i){var s=t.getCode(),h=i.getCode(),n=_s.get(s,h);if(di.ENABLE_PROJ4JS&&!n){var r=ds.get();if("function"==typeof r){var e=r.defs(s),o=r.defs(h);if(void 0!==e&&void 0!==o){if(e===o)ws.addEquivalentProjections([i,t]);else{var a=r(h,s);ws.addCoordinateTransforms(i,t,a.forward,a.inverse)}n=_s.get(s,h)}}}return n||(n=ws.identityTransform),n},ws.identityTransform=function(t,i){if(void 0!==i&&t!==i){for(var s=0,h=t.length;s<h;++s)i[s]=t[s];t=i}return t},ws.cloneTransform=function(t,i){var s;if(void 0!==i){for(var h=0,n=t.length;h<n;++h)i[h]=t[h];s=i}else s=t.slice();return s},ws.transform=function(t,i,s){return ws.getTransform(i,s)(t,void 0,t.length)},ws.transformExtent=function(t,i,s){var h=ws.getTransform(i,s);return rs.applyTransform(t,h)},ws.transformWithProjections=function(t,i,s){return ws.getTransformFromProjections(i,s)(t)},ws.addCommon=function(){ws.addEquivalentProjections(ms.PROJECTIONS),ws.addEquivalentProjections(ps.PROJECTIONS),ws.addEquivalentTransforms(ps.PROJECTIONS,ms.PROJECTIONS,ms.fromEPSG4326,ms.toEPSG4326)},ws.addCommon();var ys={};ys.tmp_=new Array(6),ys.create=function(){return[1,0,0,1,0,0]},ys.reset=function(t){return ys.set(t,1,0,0,1,0,0)},ys.multiply=function(t,i){var s=t[0],h=t[1],n=t[2],r=t[3],e=t[4],o=t[5],a=i[0],u=i[1],f=i[2],c=i[3],l=i[4],v=i[5];return t[0]=s*a+n*u,t[1]=h*a+r*u,t[2]=s*f+n*c,t[3]=h*f+r*c,t[4]=s*l+n*v+e,t[5]=h*l+r*v+o,t},ys.set=function(t,i,s,h,n,r,e){return t[0]=i,t[1]=s,t[2]=h,t[3]=n,t[4]=r,t[5]=e,t},ys.setFromArray=function(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t},ys.apply=function(t,i){var s=i[0],h=i[1];return i[0]=t[0]*s+t[2]*h+t[4],i[1]=t[1]*s+t[3]*h+t[5],i},ys.rotate=function(t,i){var s=Math.cos(i),h=Math.sin(i);return ys.multiply(t,ys.set(ys.tmp_,s,h,-h,s,0,0))},ys.scale=function(t,i,s){return ys.multiply(t,ys.set(ys.tmp_,i,0,0,s,0,0))},ys.translate=function(t,i,s){return ys.multiply(t,ys.set(ys.tmp_,1,0,0,1,i,s))},ys.compose=function(t,i,s,h,n,r,e,o){var a=Math.sin(r),u=Math.cos(r);return t[0]=h*u,t[1]=n*a,t[2]=-h*a,t[3]=n*u,t[4]=e*h*u-o*h*a+i,t[5]=e*n*a+o*n*u+s,t},ys.invert=function(t){var i=ys.determinant(t);qi(0!==i,32);var s=t[0],h=t[1],n=t[2],r=t[3],e=t[4],o=t[5];return t[0]=r/i,t[1]=-h/i,t[2]=-n/i,t[3]=s/i,t[4]=(n*o-r*e)/i,t[5]=-(s*o-h*e)/i,t},ys.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};var bs=function(){Ui.call(this),this.extent_=rs.createEmpty(),this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.tmpTransform_=ys.create()};di.inherits(bs,Ui),bs.prototype.clone=function(){},bs.prototype.closestPointXY=function(){},bs.prototype.getClosestPoint=function(t,i){var s=i||[NaN,NaN];return this.closestPointXY(t[0],t[1],s,1/0),s},bs.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},bs.prototype.computeExtent=function(){},bs.prototype.containsXY=as.FALSE,bs.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),rs.returnOrUpdate(this.extent_,t)},bs.prototype.rotate=function(){},bs.prototype.scale=function(){},bs.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},bs.prototype.getSimplifiedGeometry=function(){},bs.prototype.getType=function(){},bs.prototype.applyTransform=function(){},bs.prototype.intersectsExtent=function(){},bs.prototype.translate=function(){},bs.prototype.transform=function(t,i){var s=this.tmpTransform_,h=(t=ws.get(t)).getUnits()==vs.TILE_PIXELS?function(h,n,r){var e=t.getExtent(),o=t.getWorldExtent(),a=rs.getHeight(o)/rs.getHeight(e);return ys.compose(s,o[0],o[3],a,-a,0,0,0),us(h,0,h.length,r,s,n),ws.getTransform(t,i)(h,n,r)}:ws.getTransform(t,i);return this.applyTransform(h),this};var xs=function(){bs.call(this),this.layout=es,this.stride=2,this.flatCoordinates=null};di.inherits(xs,bs),xs.getLayoutForStride_=function(t){var i;return 2==t?i=es:3==t?i="XYZ":4==t&&(i=os),i},xs.getStrideForLayout=function(t){var i;return t==es?i=2:"XYZ"==t||"XYM"==t?i=3:t==os&&(i=4),i},xs.prototype.containsXY=as.FALSE,xs.prototype.computeExtent=function(t){return rs.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},xs.prototype.getCoordinates=function(){},xs.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},xs.prototype.getFlatCoordinates=function(){return this.flatCoordinates},xs.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},xs.prototype.getLayout=function(){return this.layout},xs.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(Si.clear(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i))return this.simplifiedGeometryCache[i];var s=this.getSimplifiedGeometryInternal(t);return s.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[i]=s,s):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},xs.prototype.getSimplifiedGeometryInternal=function(){return this},xs.prototype.getStride=function(){return this.stride},xs.prototype.setFlatCoordinatesInternal=function(t,i){this.stride=xs.getStrideForLayout(t),this.layout=t,this.flatCoordinates=i},xs.prototype.setCoordinates=function(){},xs.prototype.setLayout=function(t,i,s){var h;if(t)h=xs.getStrideForLayout(t);else{var n;for(n=0;n<s;++n){if(0===i.length)return this.layout=es,void(this.stride=2);i=i[0]}t=xs.getLayoutForStride_(h=i.length)}this.layout=t,this.stride=h},xs.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},xs.prototype.rotate=function(t,i){var s=this.getFlatCoordinates();if(s){var h=this.getStride();fs(s,0,s.length,h,t,i,s),this.changed()}},xs.prototype.scale=function(t,i,s){var h=i;void 0===h&&(h=t);var n=s;n||(n=rs.getCenter(this.getExtent()));var r=this.getFlatCoordinates();if(r){var e=this.getStride();cs(r,0,r.length,e,t,h,n,r),this.changed()}},xs.prototype.translate=function(t,i){var s=this.getFlatCoordinates();if(s){var h=this.getStride();ls(s,0,s.length,h,t,i,s),this.changed()}},xs.transform2D=function(t,i,s){var h=t.getFlatCoordinates();if(h){var n=t.getStride();return us(h,0,h.length,n,i,s)}return null};var Es={linearRing:function(t,i,s,h){for(var n=0,r=t[s-h],e=t[s-h+1];i<s;i+=h){var o=t[i],a=t[i+1];n+=e*o-r*a,r=o,e=a}return n/2},linearRings:function(t,i,s,h){var n,r,e=0;for(n=0,r=s.length;n<r;++n){var o=s[n];e+=Es.linearRing(t,i,o,h),i=o}return e},linearRingss:function(t,i,s,h){var n,r,e=0;for(n=0,r=s.length;n<r;++n){var o=s[n];e+=Es.linearRings(t,i,o,h),i=o[o.length-1]}return e}},Cs={point:function(t,i,s,h,n,r,e){var o,a,u=t[i],f=t[i+1],c=t[s]-u,l=t[s+1]-f;if(0===c&&0===l)a=i;else{var v=((n-u)*c+(r-f)*l)/(c*c+l*l);if(v>1)a=s;else{if(v>0){for(o=0;o<h;++o)e[o]=Bi.lerp(t[i+o],t[s+o],v);return void(e.length=h)}a=i}}for(o=0;o<h;++o)e[o]=t[a+o];e.length=h},getMaxSquaredDelta:function(t,i,s,h,n){var r=t[i],e=t[i+1];for(i+=h;i<s;i+=h){var o=t[i],a=t[i+1],u=Bi.squaredDistance(r,e,o,a);u>n&&(n=u),r=o,e=a}return n},getsMaxSquaredDelta:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r){var o=s[r];n=Cs.getMaxSquaredDelta(t,i,o,h,n),i=o}return n},getssMaxSquaredDelta:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r){var o=s[r];n=Cs.getsMaxSquaredDelta(t,i,o,h,n),i=o[o.length-1]}return n},getClosestPoint:function(t,i,s,h,n,r,e,o,a,u,f){if(i==s)return u;var c,l;if(0===n){if((l=Bi.squaredDistance(e,o,t[i],t[i+1]))<u){for(c=0;c<h;++c)a[c]=t[i+c];return a.length=h,l}return u}for(var v=f||[NaN,NaN],d=i+h;d<s;)if(Cs.point(t,d-h,d,h,e,o,v),(l=Bi.squaredDistance(e,o,v[0],v[1]))<u){for(u=l,c=0;c<h;++c)a[c]=v[c];a.length=h,d+=h}else d+=h*Math.max((Math.sqrt(l)-Math.sqrt(u))/n|0,1);if(r&&(Cs.point(t,s-h,i,h,e,o,v),(l=Bi.squaredDistance(e,o,v[0],v[1]))<u)){for(u=l,c=0;c<h;++c)a[c]=v[c];a.length=h}return u},getsClosestPoint:function(t,i,s,h,n,r,e,o,a,u,f){var c,l,v=f||[NaN,NaN];for(c=0,l=s.length;c<l;++c){var d=s[c];u=Cs.getClosestPoint(t,i,d,h,n,r,e,o,a,u,v),i=d}return u},getssClosestPoint:function(t,i,s,h,n,r,e,o,a,u,f){var c,l,v=f||[NaN,NaN];for(c=0,l=s.length;c<l;++c){var d=s[c];u=Cs.getsClosestPoint(t,i,d,h,n,r,e,o,a,u,v),i=d[d.length-1]}return u}},Ss={coordinate:function(t,i,s){var h,n;for(h=0,n=s.length;h<n;++h)t[i++]=s[h];return i},coordinates:function(t,i,s,h){var n,r;for(n=0,r=s.length;n<r;++n){var e,o=s[n];for(e=0;e<h;++e)t[i++]=o[e]}return i},coordinatess:function(t,i,s,h,n){var r,e,o=n||[],a=0;for(r=0,e=s.length;r<e;++r){var u=Ss.coordinates(t,i,s[r],h);o[a++]=u,i=u}return o.length=a,o},coordinatesss:function(t,i,s,h,n){var r,e,o=n||[],a=0;for(r=0,e=s.length;r<e;++r){var u=Ss.coordinatess(t,i,s[r],h,o[a]);o[a++]=u,i=u[u.length-1]}return o.length=a,o}},zs={coordinates:function(t,i,s,h,n){var r,e=void 0!==n?n:[],o=0;for(r=i;r<s;r+=h)e[o++]=t.slice(r,r+h);return e.length=o,e},coordinatess:function(t,i,s,h,n){var r,e,o=void 0!==n?n:[],a=0;for(r=0,e=s.length;r<e;++r){var u=s[r];o[a++]=zs.coordinates(t,i,u,h,o[a]),i=u}return o.length=a,o},coordinatesss:function(t,i,s,h,n){var r,e,o=void 0!==n?n:[],a=0;for(r=0,e=s.length;r<e;++r){var u=s[r];o[a++]=zs.coordinatess(t,i,u,h,o[a]),i=u[u.length-1]}return o.length=a,o}},As={lineString:function(t,i,s,h,n,r,e){var o=void 0!==e?e:[];return r||(s=As.radialDistance(t,i,s,h,n,o,0),t=o,i=0,h=2),o.length=As.douglasPeucker(t,i,s,h,n,o,0),o},douglasPeucker:function(t,i,s,h,n,r,e){var o=(s-i)/h;if(o<3){for(;i<s;i+=h)r[e++]=t[i],r[e++]=t[i+1];return e}var a=new Array(o);a[0]=1,a[o-1]=1;for(var u,f=[i,s-h],c=0;f.length>0;){var l=f.pop(),v=f.pop(),d=0,M=t[v],m=t[v+1],p=t[l],g=t[l+1];for(u=v+h;u<l;u+=h){var _=Bi.squaredSegmentDistance(t[u],t[u+1],M,m,p,g);_>d&&(c=u,d=_)}d>n&&(a[(c-i)/h]=1,v+h<c&&f.push(v,c),c+h<l&&f.push(c,l))}for(u=0;u<o;++u)a[u]&&(r[e++]=t[i+u*h],r[e++]=t[i+u*h+1]);return e},douglasPeuckers:function(t,i,s,h,n,r,e,o){var a,u;for(a=0,u=s.length;a<u;++a){var f=s[a];e=As.douglasPeucker(t,i,f,h,n,r,e),o.push(e),i=f}return e},douglasPeuckerss:function(t,i,s,h,n,r,e,o){var a,u;for(a=0,u=s.length;a<u;++a){var f=s[a],c=[];e=As.douglasPeuckers(t,i,f,h,n,r,e,c),o.push(c),i=f[f.length-1]}return e},radialDistance:function(t,i,s,h,n,r,e){if(s<=i+h){for(;i<s;i+=h)r[e++]=t[i],r[e++]=t[i+1];return e}var o=t[i],a=t[i+1];r[e++]=o,r[e++]=a;var u=o,f=a;for(i+=h;i<s;i+=h)Bi.squaredDistance(o,a,u=t[i],f=t[i+1])>n&&(r[e++]=u,r[e++]=f,o=u,a=f);return u==o&&f==a||(r[e++]=u,r[e++]=f),e},snap:function(t,i){return i*Math.round(t/i)},quantize:function(t,i,s,h,n,r,e){if(i==s)return e;var o,a,u=As.snap(t[i],n),f=As.snap(t[i+1],n);i+=h,r[e++]=u,r[e++]=f;do{if(o=As.snap(t[i],n),a=As.snap(t[i+1],n),(i+=h)==s)return r[e++]=o,r[e++]=a,e}while(o==u&&a==f);for(;i<s;){var c,l;if(c=As.snap(t[i],n),l=As.snap(t[i+1],n),i+=h,c!=o||l!=a){var v=o-u,d=a-f,M=c-u,m=l-f;v*m==d*M&&(v<0&&M<v||v==M||v>0&&M>v)&&(d<0&&m<d||d==m||d>0&&m>d)?(o=c,a=l):(r[e++]=o,r[e++]=a,u=o,f=a,o=c,a=l)}}return r[e++]=o,r[e++]=a,e},quantizes:function(t,i,s,h,n,r,e,o){var a,u;for(a=0,u=s.length;a<u;++a){var f=s[a];e=As.quantize(t,i,f,h,n,r,e),o.push(e),i=f}return e},quantizess:function(t,i,s,h,n,r,e,o){var a,u;for(a=0,u=s.length;a<u;++a){var f=s[a],c=[];e=As.quantizes(t,i,f,h,n,r,e,c),o.push(c),i=f[f.length-1]}return e}},ks=function(t,i){xs.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(t,i)};di.inherits(ks,xs),ks.prototype.clone=function(){var t=new ks(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},ks.prototype.closestPointXY=function(t,i,s,h){return h<rs.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Cs.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Cs.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,i,s,h))},ks.prototype.getArea=function(){return Es.linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},ks.prototype.getCoordinates=function(){return zs.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},ks.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=As.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new ks(null);return s.setFlatCoordinates(es,i),s},ks.prototype.getType=function(){return Ji},ks.prototype.intersectsExtent=function(){},ks.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ss.coordinates(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(es,null)},ks.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var Ns=function(t,i){xs.call(this),this.setCoordinates(t,i)};di.inherits(Ns,xs),Ns.prototype.clone=function(){var t=new Ns(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},Ns.prototype.closestPointXY=function(t,i,s,h){var n=this.flatCoordinates,r=Bi.squaredDistance(t,i,n[0],n[1]);if(r<h){var e,o=this.stride;for(e=0;e<o;++e)s[e]=n[e];return s.length=o,r}return h},Ns.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},Ns.prototype.computeExtent=function(t){return rs.createOrUpdateFromCoordinate(this.flatCoordinates,t)},Ns.prototype.getType=function(){return Yi},Ns.prototype.intersectsExtent=function(t){return rs.containsXY(t,this.flatCoordinates[0],this.flatCoordinates[1])},Ns.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ss.coordinate(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(es,null)},Ns.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var Rs={linearRingContainsExtent:function(t,i,s,h,n){return!rs.forEachCorner(n,(function(n){return!Rs.linearRingContainsXY(t,i,s,h,n[0],n[1])}))},linearRingContainsXY:function(t,i,s,h,n,r){for(var e=0,o=t[s-h],a=t[s-h+1];i<s;i+=h){var u=t[i],f=t[i+1];a<=r?f>r&&(u-o)*(r-a)-(n-o)*(f-a)>0&&e++:f<=r&&(u-o)*(r-a)-(n-o)*(f-a)<0&&e--,o=u,a=f}return 0!==e},linearRingsContainsXY:function(t,i,s,h,n,r){if(0===s.length)return!1;if(!Rs.linearRingContainsXY(t,i,s[0],h,n,r))return!1;var e,o;for(e=1,o=s.length;e<o;++e)if(Rs.linearRingContainsXY(t,s[e-1],s[e],h,n,r))return!1;return!0},linearRingssContainsXY:function(t,i,s,h,n,r){if(0===s.length)return!1;var e,o;for(e=0,o=s.length;e<o;++e){var a=s[e];if(Rs.linearRingsContainsXY(t,i,a,h,n,r))return!0;i=a[a.length-1]}return!1}},Ps={linearRings:function(t,i,s,h,n,r,e){for(var o,a,u,f,c,l,v,d=n[r+1],M=[],m=0,p=s.length;m<p;++m){var g=s[m];for(f=t[g-h],l=t[g-h+1],o=i;o<g;o+=h)c=t[o],v=t[o+1],(d<=l&&v<=d||l<=d&&d<=v)&&M.push(u=(d-l)/(v-l)*(c-f)+f),f=c,l=v}var _=NaN,w=-1/0;for(M.sort(hs.numberSafeCompareFunction),f=M[0],o=1,a=M.length;o<a;++o){c=M[o];var y=Math.abs(c-f);y>w&&Rs.linearRingsContainsXY(t,i,s,h,u=(f+c)/2,d)&&(_=u,w=y),f=c}return isNaN(_)&&(_=n[r]),e?(e.push(_,d,w),e):[_,d,w]},linearRingss:function(t,i,s,h,n){var r,e,o=[];for(r=0,e=s.length;r<e;++r){var a=s[r];o=Ps.linearRings(t,i,a,h,n,2*r,o),i=a[a.length-1]}return o}},Ts=function(t,i,s,h,n,r){for(var e,o=[t[i],t[i+1]],a=[];i+h<s;i+=h){if(a[0]=t[i+h],a[1]=t[i+h+1],e=n.call(r,o,a))return e;o[0]=a[0],o[1]=a[1]}return!1},Os={lineString:function(t,i,s,h,n){var r=rs.extendFlatCoordinates(rs.createEmpty(),t,i,s,h);return!!rs.intersects(n,r)&&(!!rs.containsExtent(n,r)||r[0]>=n[0]&&r[2]<=n[2]||r[1]>=n[1]&&r[3]<=n[3]||Ts(t,i,s,h,(function(t,i){return rs.intersectsSegment(n,t,i)})))},lineStrings:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r){if(Os.lineString(t,i,s[r],h,n))return!0;i=s[r]}return!1},linearRing:function(t,i,s,h,n){return!!(Os.lineString(t,i,s,h,n)||Rs.linearRingContainsXY(t,i,s,h,n[0],n[1])||Rs.linearRingContainsXY(t,i,s,h,n[0],n[3])||Rs.linearRingContainsXY(t,i,s,h,n[2],n[1])||Rs.linearRingContainsXY(t,i,s,h,n[2],n[3]))},linearRings:function(t,i,s,h,n){if(!Os.linearRing(t,i,s[0],h,n))return!1;if(1===s.length)return!0;var r,e;for(r=1,e=s.length;r<e;++r)if(Rs.linearRingContainsExtent(t,s[r-1],s[r],h,n))return!1;return!0},linearRingss:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r){var o=s[r];if(Os.linearRings(t,i,o,h,n))return!0;i=o[o.length-1]}return!1}},Ls=function(t,i,s,h){for(;i<s-h;){var n;for(n=0;n<h;++n){var r=t[i+n];t[i+n]=t[s-h+n],t[s-h+n]=r}i+=h,s-=h}},Fs={linearRingIsClockwise:function(t,i,s,h){for(var n=0,r=t[s-h],e=t[s-h+1];i<s;i+=h){var o=t[i],a=t[i+1];n+=(o-r)*(a+e),r=o,e=a}return n>0},linearRingsAreOriented:function(t,i,s,h,n){var r,e,o=void 0!==n&&n;for(r=0,e=s.length;r<e;++r){var a=s[r],u=Fs.linearRingIsClockwise(t,i,a,h);if(0===r){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;i=a}return!0},linearRingssAreOriented:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r)if(!Fs.linearRingsAreOriented(t,i,s[r],h,n))return!1;return!0},orientLinearRings:function(t,i,s,h,n){var r,e,o=void 0!==n&&n;for(r=0,e=s.length;r<e;++r){var a=s[r],u=Fs.linearRingIsClockwise(t,i,a,h);(0===r?o&&u||!o&&!u:o&&!u||!o&&u)&&Ls(t,i,a,h),i=a}return i},orientLinearRingss:function(t,i,s,h,n){var r,e;for(r=0,e=s.length;r<e;++r)i=Fs.orientLinearRings(t,i,s[r],h,n);return i}},Is=function(t,i){xs.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,this.setCoordinates(t,i)};di.inherits(Is,xs),Is.prototype.appendLinearRing=function(t){this.flatCoordinates?hs.extend(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},Is.prototype.clone=function(){var t=new Is(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice()),t},Is.prototype.closestPointXY=function(t,i,s,h){return h<rs.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Cs.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Cs.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,i,s,h))},Is.prototype.containsXY=function(t,i){return Rs.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)},Is.prototype.getArea=function(){return Es.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},Is.prototype.getCoordinates=function(t){var i;return void 0!==t?(i=this.getOrientedFlatCoordinates().slice(),Fs.orientLinearRings(i,0,this.ends_,this.stride,t)):i=this.flatCoordinates,zs.coordinatess(i,0,this.ends_,this.stride)},Is.prototype.getEnds=function(){return this.ends_},Is.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=rs.getCenter(this.getExtent());this.flatInteriorPoint_=Ps.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},Is.prototype.getInteriorPoint=function(){return new Ns(this.getFlatInteriorPoint(),"XYM")},Is.prototype.getLinearRingCount=function(){return this.ends_.length},Is.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t)return null;var i=new ks(null);return i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t])),i},Is.prototype.getLinearRings=function(){var t,i,s=this.layout,h=this.flatCoordinates,n=this.ends_,r=[],e=0;for(t=0,i=n.length;t<i;++t){var o=n[t],a=new ks(null);a.setFlatCoordinates(s,h.slice(e,o)),r.push(a),e=o}return r},Is.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Fs.linearRingsAreOriented(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Fs.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},Is.prototype.getSimplifiedGeometryInternal=function(t){var i=[],s=[];i.length=As.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,s);var h=new Is(null);return h.setFlatCoordinates(es,i,s),h},Is.prototype.getType=function(){return Zi},Is.prototype.intersectsExtent=function(t){return Os.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},Is.prototype.setCoordinates=function(t,i){if(t){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var s=Ss.coordinatess(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===s.length?0:s[s.length-1],this.changed()}else this.setFlatCoordinates(es,null,this.ends_)},Is.prototype.setFlatCoordinates=function(t,i,s){this.setFlatCoordinatesInternal(t,i),this.ends_=s,this.changed()},Is.circular=function(t,i,s,h){var n,r=h||32,e=[];for(n=0;n<r;++n)hs.extend(e,t.offset(i,s,2*Math.PI*n/r));e.push(e[0],e[1]);var o=new Is(null);return o.setFlatCoordinates(es,e,[e.length]),o},Is.fromExtent=function(t){var i=t[0],s=t[1],h=t[2],n=t[3],r=[i,s,i,n,h,n,h,s,i,s],e=new Is(null);return e.setFlatCoordinates(es,r,[r.length]),e},Is.fromCircle=function(t,i,s){for(var h=i||32,n=t.getStride(),r=t.getLayout(),e=new Is(null,r),o=n*(h+1),a=new Array(o),u=0;u<o;u++)a[u]=0;return e.setFlatCoordinates(r,a,[a.length]),Is.makeRegular(e,t.getCenter(),t.getRadius(),s),e},Is.makeRegular=function(t,i,s,h){for(var n,r,e=t.getFlatCoordinates(),o=t.getLayout(),a=t.getStride(),u=t.getEnds(),f=e.length/a-1,c=h||0,l=0;l<=f;++l)r=l*a,n=c+2*Bi.modulo(l,f)*Math.PI/f,e[r]=i[0]+s*Math.cos(n),e[r+1]=i[1]+s*Math.sin(n);t.setFlatCoordinates(o,e,u)};var Ds={ONE:1,SRC_ALPHA:770,COLOR_ATTACHMENT0:36064,COLOR_BUFFER_BIT:16384,TRIANGLES:4,TRIANGLE_STRIP:5,ONE_MINUS_SRC_ALPHA:771,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,CULL_FACE:2884,BLEND:3042,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126,RGBA:6408,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,LINK_STATUS:35714,LINEAR:9729,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE0:33984,CLAMP_TO_EDGE:33071,COMPILE_STATUS:35713,FRAMEBUFFER:36160,CONTEXT_IDS_:["experimental-webgl","webgl","webkit-3d","moz-webgl"],getContext:function(t,i){var s,h,n=Ds.CONTEXT_IDS_.length;for(h=0;h<n;++h)try{if(s=t.getContext(Ds.CONTEXT_IDS_[h],i))return s}catch(r){}return null}},Ws={},Gs="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";Ws.FIREFOX=-1!==Gs.indexOf("firefox"),Ws.SAFARI=-1!==Gs.indexOf("safari")&&-1==Gs.indexOf("chrom"),Ws.WEBKIT=-1!==Gs.indexOf("webkit")&&-1==Gs.indexOf("edge"),Ws.MAC=-1!==Gs.indexOf("macintosh"),Ws.DEVICE_PIXEL_RATIO=window.devicePixelRatio||1,Ws.CANVAS_LINE_DASH=!1,Ws.CANVAS=di.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in window))return!1;try{var t=document.createElement("CANVAS").getContext("2d");return!!t&&(void 0!==t.setLineDash&&(Ws.CANVAS_LINE_DASH=!0),!0)}catch(i){return!1}}(),Ws.DEVICE_ORIENTATION="DeviceOrientationEvent"in window,Ws.GEOLOCATION="geolocation"in navigator,Ws.TOUCH=di.ASSUME_TOUCH||"ontouchstart"in window,Ws.POINTER="PointerEvent"in window,Ws.MSPOINTER=!!navigator.msPointerEnabled,function(){if(di.ENABLE_WEBGL){var t,i=!1,s=[];if("WebGLRenderingContext"in window)try{var h=document.createElement("CANVAS"),n=Ds.getContext(h,{failIfMajorPerformanceCaveat:!0});n&&(i=!0,t=n.getParameter(n.MAX_TEXTURE_SIZE),s=n.getSupportedExtensions())}catch(r){}Ws.WEBGL=i,di.WEBGL_EXTENSIONS=s,di.WEBGL_MAX_TEXTURE_SIZE=t}}();var Vs=function(t){Ui.call(this);var i=t||{};this.position_=null,this.transform_=ws.identityTransform,this.sphere_=new ss(ps.RADIUS),this.watchId_=void 0,zi.listen(this,Ui.getChangeEventType(yi),this.handleProjectionChanged_,this),zi.listen(this,Ui.getChangeEventType(xi),this.handleTrackingChanged_,this),void 0!==i.projection&&this.setProjection(i.projection),void 0!==i.trackingOptions&&this.setTrackingOptions(i.trackingOptions),this.setTracking(void 0!==i.tracking&&i.tracking)};di.inherits(Vs,Ui),Vs.prototype.disposeInternal=function(){this.setTracking(!1),Ui.prototype.disposeInternal.call(this)},Vs.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=ws.getTransformFromProjections(ws.get("EPSG:4326"),t),this.position_&&this.set(wi,this.transform_(this.position_)))},Vs.prototype.handleTrackingChanged_=function(){if(Ws.GEOLOCATION){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},Vs.prototype.positionChange_=function(t){var i=t.coords;this.set(Mi,i.accuracy),this.set(pi,null===i.altitude?void 0:i.altitude),this.set(gi,null===i.altitudeAccuracy?void 0:i.altitudeAccuracy),this.set(_i,null===i.heading?void 0:Bi.toRadians(i.heading)),this.position_?(this.position_[0]=i.longitude,this.position_[1]=i.latitude):this.position_=[i.longitude,i.latitude];var s=this.transform_(this.position_);this.set(wi,s),this.set(bi,null===i.speed?void 0:i.speed);var h=Is.circular(this.sphere_,this.position_,i.accuracy);h.applyTransform(this.transform_),this.set(mi,h),this.changed()},Vs.prototype.positionError_=function(t){t.type=Li,this.setTracking(!1),this.dispatchEvent(t)},Vs.prototype.getAccuracy=function(){return this.get(Mi)},Vs.prototype.getAccuracyGeometry=function(){return this.get(mi)||null},Vs.prototype.getAltitude=function(){return this.get(pi)},Vs.prototype.getAltitudeAccuracy=function(){return this.get(gi)},Vs.prototype.getHeading=function(){return this.get(_i)},Vs.prototype.getPosition=function(){return this.get(wi)},Vs.prototype.getProjection=function(){return this.get(yi)},Vs.prototype.getSpeed=function(){return this.get(bi)},Vs.prototype.getTracking=function(){return this.get(xi)},Vs.prototype.getTrackingOptions=function(){return this.get(Ei)},Vs.prototype.setProjection=function(t){this.set(yi,ws.get(t))},Vs.prototype.setTracking=function(t){this.set(xi,t)},Vs.prototype.setTrackingOptions=function(t){this.set(Ei,t)};var js="add",Us="remove",Xs=function(t,i){if(Ui.call(this),this.unique_=!!(i||{}).unique,this.array_=t||[],this.unique_)for(var s=0,h=this.array_.length;s<h;++s)this.assertUnique_(this.array_[s],s);this.updateLength_()};di.inherits(Xs,Ui),Xs.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},Xs.prototype.extend=function(t){var i,s;for(i=0,s=t.length;i<s;++i)this.push(t[i]);return this},Xs.prototype.forEach=function(t,i){for(var s=i?t.bind(i):t,h=this.array_,n=0,r=h.length;n<r;++n)s(h[n],n,h)},Xs.prototype.getArray=function(){return this.array_},Xs.prototype.item=function(t){return this.array_[t]},Xs.prototype.getLength=function(){return this.get(Xs.Property_.LENGTH)},Xs.prototype.insertAt=function(t,i){this.unique_&&this.assertUnique_(i),this.array_.splice(t,0,i),this.updateLength_(),this.dispatchEvent(new Xs.Event(js,i))},Xs.prototype.pop=function(){return this.removeAt(this.getLength()-1)},Xs.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var i=this.getLength();return this.insertAt(i,t),this.getLength()},Xs.prototype.remove=function(t){var i,s,h=this.array_;for(i=0,s=h.length;i<s;++i)if(h[i]===t)return this.removeAt(i)},Xs.prototype.removeAt=function(t){var i=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Xs.Event(Us,i)),i},Xs.prototype.setAt=function(t,i){var s=this.getLength();if(t<s){this.unique_&&this.assertUnique_(i,t);var h=this.array_[t];this.array_[t]=i,this.dispatchEvent(new Xs.Event(Us,h)),this.dispatchEvent(new Xs.Event(js,i))}else{var n;for(n=s;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,i)}},Xs.prototype.updateLength_=function(){this.set(Xs.Property_.LENGTH,this.array_.length)},Xs.prototype.assertUnique_=function(t,i){for(var s=0,h=this.array_.length;s<h;++s)if(this.array_[s]===t&&s!==i)throw new Xi(58)},Xs.Property_={LENGTH:"length"},di.inherits(Xs.Event=function(t,i){ki.call(this,t),this.element=i},ki);var qs=function(t,i,s){ki.call(this,t),this.map=i,this.frameState=void 0!==s?s:null};di.inherits(qs,ki);var Bs=function(t,i,s,h,n){qs.call(this,t,i,n),this.originalEvent=s,this.pixel=i.getEventPixel(s),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==h&&h};di.inherits(Bs,qs),Bs.prototype.preventDefault=function(){qs.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},Bs.prototype.stopPropagation=function(){qs.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()};var Ys={SINGLECLICK:"singleclick",CLICK:Ti,DBLCLICK:Oi,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Hs=function(t,i,s,h,n){Bs.call(this,t,i,s.originalEvent,h,n),this.pointerEvent=s};di.inherits(Hs,Bs);var Js="pointermove",Zs="pointerdown",Ks=function(t,i){this.dispatcher=t,this.mapping_=i};Ks.prototype.getEvents=function(){return Object.keys(this.mapping_)},Ks.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var Qs=function(t){Ks.call(this,t,{mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout}),this.pointerMap=t.pointerMap,this.lastTouches=[]};di.inherits(Qs,Ks),Qs.POINTER_ID=1,Qs.POINTER_TYPE="mouse",Qs.DEDUP_DIST=25,Qs.prototype.isEventSimulatedFromTouch_=function(t){for(var i,s=this.lastTouches,h=t.clientX,n=t.clientY,r=0,e=s.length;r<e&&(i=s[r]);r++){var o=Math.abs(h-i[0]),a=Math.abs(n-i[1]);if(o<=Qs.DEDUP_DIST&&a<=Qs.DEDUP_DIST)return!0}return!1},Qs.prepareEvent=function(t,i){var s=i.cloneEvent(t,t),h=s.preventDefault;return s.preventDefault=function(){t.preventDefault(),h()},s.pointerId=Qs.POINTER_ID,s.isPrimary=!0,s.pointerType=Qs.POINTER_TYPE,s},Qs.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){Qs.POINTER_ID.toString()in this.pointerMap&&this.cancel(t);var i=Qs.prepareEvent(t,this.dispatcher);this.pointerMap[Qs.POINTER_ID.toString()]=t,this.dispatcher.down(i,t)}},Qs.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.move(i,t)}},Qs.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=this.pointerMap[Qs.POINTER_ID.toString()];if(i&&i.button===t.button){var s=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.up(s,t),this.cleanupMouse()}}},Qs.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.enterOver(i,t)}},Qs.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.leaveOut(i,t)}},Qs.prototype.cancel=function(t){var i=Qs.prepareEvent(t,this.dispatcher);this.dispatcher.cancel(i,t),this.cleanupMouse()},Qs.prototype.cleanupMouse=function(){delete this.pointerMap[Qs.POINTER_ID.toString()]};var $s=function(t){Ks.call(this,t,{MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture}),this.pointerMap=t.pointerMap,this.POINTER_TYPES=["","unavailable","touch","pen","mouse"]};di.inherits($s,Ks),$s.prototype.prepareEvent_=function(t){var i=t;return"number"==typeof t.pointerType&&((i=this.dispatcher.cloneEvent(t,t)).pointerType=this.POINTER_TYPES[t.pointerType]),i},$s.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},$s.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var i=this.prepareEvent_(t);this.dispatcher.down(i,t)},$s.prototype.msPointerMove=function(t){var i=this.prepareEvent_(t);this.dispatcher.move(i,t)},$s.prototype.msPointerUp=function(t){var i=this.prepareEvent_(t);this.dispatcher.up(i,t),this.cleanup(t.pointerId)},$s.prototype.msPointerOut=function(t){var i=this.prepareEvent_(t);this.dispatcher.leaveOut(i,t)},$s.prototype.msPointerOver=function(t){var i=this.prepareEvent_(t);this.dispatcher.enterOver(i,t)},$s.prototype.msPointerCancel=function(t){var i=this.prepareEvent_(t);this.dispatcher.cancel(i,t),this.cleanup(t.pointerId)},$s.prototype.msLostPointerCapture=function(t){var i=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(i)},$s.prototype.msGotPointerCapture=function(t){var i=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(i)};var th=function(t){Ks.call(this,t,{pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture})};di.inherits(th,Ks),th.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)},th.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};var ih=function(t,i,s){ki.call(this,t),this.originalEvent=i;var h=s||{};this.buttons=this.getButtons_(h),this.pressure=this.getPressure_(h,this.buttons),this.bubbles="bubbles"in h&&h.bubbles,this.cancelable="cancelable"in h&&h.cancelable,this.view="view"in h?h.view:null,this.detail="detail"in h?h.detail:null,this.screenX="screenX"in h?h.screenX:0,this.screenY="screenY"in h?h.screenY:0,this.clientX="clientX"in h?h.clientX:0,this.clientY="clientY"in h?h.clientY:0,this.ctrlKey="ctrlKey"in h&&h.ctrlKey,this.altKey="altKey"in h&&h.altKey,this.shiftKey="shiftKey"in h&&h.shiftKey,this.metaKey="metaKey"in h&&h.metaKey,this.button="button"in h?h.button:0,this.relatedTarget="relatedTarget"in h?h.relatedTarget:null,this.pointerId="pointerId"in h?h.pointerId:0,this.width="width"in h?h.width:0,this.height="height"in h?h.height:0,this.tiltX="tiltX"in h?h.tiltX:0,this.tiltY="tiltY"in h?h.tiltY:0,this.pointerType="pointerType"in h?h.pointerType:"",this.hwTimestamp="hwTimestamp"in h?h.hwTimestamp:0,this.isPrimary="isPrimary"in h&&h.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})};di.inherits(ih,ki),ih.prototype.getButtons_=function(t){var i;if(t.buttons||ih.HAS_BUTTONS)i=t.buttons;else switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}return i},ih.prototype.getPressure_=function(t,i){return t.pressure?t.pressure:i?.5:0},ih.HAS_BUTTONS=!1,function(){try{var t=new MouseEvent("click",{buttons:1});ih.HAS_BUTTONS=1===t.buttons}catch(i){}}();var sh=function(t,i){Ks.call(this,t,{touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel}),this.pointerMap=t.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_=void 0};di.inherits(sh,Ks),sh.DEDUP_TIMEOUT=2500,sh.CLICK_COUNT_TIMEOUT=200,sh.POINTER_TYPE="touch",sh.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},sh.prototype.setPrimaryTouch_=function(t){var i=Object.keys(this.pointerMap).length;(0===i||1===i&&Qs.POINTER_ID.toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},sh.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},sh.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),sh.CLICK_COUNT_TIMEOUT)},sh.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},sh.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},sh.prototype.touchToPointer_=function(t,i){var s=this.dispatcher.cloneEvent(t,i);return s.pointerId=i.identifier+2,s.bubbles=!0,s.cancelable=!0,s.detail=this.clickCount_,s.button=0,s.buttons=1,s.width=i.webkitRadiusX||i.radiusX||0,s.height=i.webkitRadiusY||i.radiusY||0,s.pressure=i.webkitForce||i.force||.5,s.isPrimary=this.isPrimaryTouch_(i),s.pointerType=sh.POINTER_TYPE,s.clientX=i.clientX,s.clientY=i.clientY,s.screenX=i.screenX,s.screenY=i.screenY,s},sh.prototype.processTouches_=function(t,i){var s,h,n=Array.prototype.slice.call(t.changedTouches),r=n.length;function e(){t.preventDefault()}for(s=0;s<r;++s)(h=this.touchToPointer_(t,n[s])).preventDefault=e,i.call(this,t,h)},sh.prototype.findTouch_=function(t,i){for(var s=t.length,h=0;h<s;h++)if(t[h].identifier===i)return!0;return!1},sh.prototype.vacuumTouches_=function(t){var i=t.touches,s=Object.keys(this.pointerMap),h=s.length;if(h>=i.length){var n,r,e,o=[];for(n=0;n<h;++n)e=this.pointerMap[r=s[n]],r==Qs.POINTER_ID||this.findTouch_(i,r-2)||o.push(e.out);for(n=0;n<o.length;++n)this.cancelOut_(t,o[n])}},sh.prototype.touchstart=function(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)},sh.prototype.overDown_=function(t,i){this.pointerMap[i.pointerId]={target:i.target,out:i,outTarget:i.target},this.dispatcher.over(i,t),this.dispatcher.enter(i,t),this.dispatcher.down(i,t)},sh.prototype.touchmove=function(t){t.preventDefault(),this.processTouches_(t,this.moveOverOut_)},sh.prototype.moveOverOut_=function(t,i){var s=i,h=this.pointerMap[s.pointerId];if(h){var n=h.out,r=h.outTarget;this.dispatcher.move(s,t),n&&r!==s.target&&(n.relatedTarget=s.target,s.relatedTarget=r,n.target=r,s.target?(this.dispatcher.leaveOut(n,t),this.dispatcher.enterOver(s,t)):(s.target=r,s.relatedTarget=null,this.cancelOut_(t,s))),h.out=s,h.outTarget=s.target}},sh.prototype.touchend=function(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)},sh.prototype.upOut_=function(t,i){this.dispatcher.up(i,t),this.dispatcher.out(i,t),this.dispatcher.leave(i,t),this.cleanUpPointer_(i)},sh.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)},sh.prototype.cancelOut_=function(t,i){this.dispatcher.cancel(i,t),this.dispatcher.out(i,t),this.dispatcher.leave(i,t),this.cleanUpPointer_(i)},sh.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId],this.removePrimaryPointer_(t)},sh.prototype.dedupSynthMouse_=function(t){var i=this.mouseSource.lastTouches,s=t.changedTouches[0];if(this.isPrimaryTouch_(s)){var h=[s.clientX,s.clientY];i.push(h),setTimeout((function(){hs.remove(i,h)}),sh.DEDUP_TIMEOUT)}};var hh=function(t){Ni.call(this),this.element_=t,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()};di.inherits(hh,Ni),hh.prototype.registerSources=function(){if(Ws.POINTER)this.registerSource("native",new th(this));else if(Ws.MSPOINTER)this.registerSource("ms",new $s(this));else{var t=new Qs(this);this.registerSource("mouse",t),Ws.TOUCH&&this.registerSource("touch",new sh(this,t))}this.register_()},hh.prototype.registerSource=function(t,i){var s=i,h=s.getEvents();h&&(h.forEach((function(t){var i=s.getHandlerForEvent(t);i&&(this.eventMap_[t]=i.bind(s))}),this),this.eventSourceList_.push(s))},hh.prototype.register_=function(){for(var t=this.eventSourceList_.length,i=0;i<t;i++)this.addEvents_(this.eventSourceList_[i].getEvents())},hh.prototype.unregister_=function(){for(var t=this.eventSourceList_.length,i=0;i<t;i++)this.removeEvents_(this.eventSourceList_[i].getEvents())},hh.prototype.eventHandler_=function(t){var i=this.eventMap_[t.type];i&&i(t)},hh.prototype.addEvents_=function(t){t.forEach((function(t){zi.listen(this.element_,t,this.eventHandler_,this)}),this)},hh.prototype.removeEvents_=function(t){t.forEach((function(t){zi.unlisten(this.element_,t,this.eventHandler_,this)}),this)},hh.prototype.cloneEvent=function(t,i){for(var s,h={},n=0,r=hh.CLONE_PROPS.length;n<r;n++)h[s=hh.CLONE_PROPS[n][0]]=t[s]||i[s]||hh.CLONE_PROPS[n][1];return h},hh.prototype.down=function(t,i){this.fireEvent(Zs,t,i)},hh.prototype.move=function(t,i){this.fireEvent(Js,t,i)},hh.prototype.up=function(t,i){this.fireEvent("pointerup",t,i)},hh.prototype.enter=function(t,i){t.bubbles=!1,this.fireEvent("pointerenter",t,i)},hh.prototype.leave=function(t,i){t.bubbles=!1,this.fireEvent("pointerleave",t,i)},hh.prototype.over=function(t,i){t.bubbles=!0,this.fireEvent("pointerover",t,i)},hh.prototype.out=function(t,i){t.bubbles=!0,this.fireEvent("pointerout",t,i)},hh.prototype.cancel=function(t,i){this.fireEvent("pointercancel",t,i)},hh.prototype.leaveOut=function(t,i){this.out(t,i),this.contains_(t.target,t.relatedTarget)||this.leave(t,i)},hh.prototype.enterOver=function(t,i){this.over(t,i),this.contains_(t.target,t.relatedTarget)||this.enter(t,i)},hh.prototype.contains_=function(t,i){return!(!t||!i)&&t.contains(i)},hh.prototype.makeEvent=function(t,i,s){return new ih(t,s,i)},hh.prototype.fireEvent=function(t,i,s){var h=this.makeEvent(t,i,s);this.dispatchEvent(h)},hh.prototype.fireNativeEvent=function(t){var i=this.makeEvent(t.type,t,t);this.dispatchEvent(i)},hh.prototype.wrapMouseEvent=function(t,i){return this.makeEvent(t,Qs.prepareEvent(i,this),i)},hh.prototype.disposeInternal=function(){this.unregister_(),Ni.prototype.disposeInternal.call(this)},hh.CLONE_PROPS=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]];var nh=function(t,i){Ni.call(this),this.map_=t,this.clickTimeoutId_=0,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=i?i*Ws.DEVICE_PIXEL_RATIO:Ws.DEVICE_PIXEL_RATIO,this.down_=null;var s=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new hh(s),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=zi.listen(this.pointerEventHandler_,Zs,this.handlePointerDown_,this),this.relayedListenerKey_=zi.listen(this.pointerEventHandler_,Js,this.relayEvent_,this)};di.inherits(nh,Ni),nh.prototype.emulateClick_=function(t){var i=new Hs(Ys.CLICK,this.map_,t);this.dispatchEvent(i),0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=0,i=new Hs(Ys.DBLCLICK,this.map_,t),this.dispatchEvent(i)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var i=new Hs(Ys.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)},nh.prototype.updateActivePointers_=function(t){var i=t;i.type==Ys.POINTERUP||i.type==Ys.POINTERCANCEL?delete this.trackedTouches_[i.pointerId]:i.type==Ys.POINTERDOWN&&(this.trackedTouches_[i.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},nh.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var i=new Hs(Ys.POINTERUP,this.map_,t);this.dispatchEvent(i),i.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(zi.unlistenByKey),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},nh.prototype.isMouseActionButton_=function(t){return 0===t.button},nh.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var i=new Hs(Ys.POINTERDOWN,this.map_,t);this.dispatchEvent(i),this.down_=t,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new hh(document),this.dragListenerKeys_.push(zi.listen(this.documentPointerEventHandler_,Ys.POINTERMOVE,this.handlePointerMove_,this),zi.listen(this.documentPointerEventHandler_,Ys.POINTERUP,this.handlePointerUp_,this),zi.listen(this.pointerEventHandler_,Ys.POINTERCANCEL,this.handlePointerUp_,this)))},nh.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var i=new Hs(Ys.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(i)}t.preventDefault()},nh.prototype.relayEvent_=function(t){var i=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Hs(t.type,this.map_,t,i))},nh.prototype.isMoving_=function(t){return Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},nh.prototype.disposeInternal=function(){this.relayedListenerKey_&&(zi.unlistenByKey(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(zi.unlistenByKey(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(zi.unlistenByKey),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),Ni.prototype.disposeInternal.call(this)};var rh="postrender",eh="layergroup",oh="size",ah="target",uh="view",fh=function(t,i){this.priorityFunction_=t,this.keyFunction_=i,this.elements_=[],this.priorities_=[],this.queuedElements_={}};fh.DROP=1/0,fh.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Si.clear(this.queuedElements_)},fh.prototype.dequeue=function(){var t=this.elements_,i=this.priorities_,s=t[0];1==t.length?(t.length=0,i.length=0):(t[0]=t.pop(),i[0]=i.pop(),this.siftUp_(0));var h=this.keyFunction_(s);return delete this.queuedElements_[h],s},fh.prototype.enqueue=function(t){qi(!(this.keyFunction_(t)in this.queuedElements_),31);var i=this.priorityFunction_(t);return i!=fh.DROP&&(this.elements_.push(t),this.priorities_.push(i),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},fh.prototype.getCount=function(){return this.elements_.length},fh.prototype.getLeftChildIndex_=function(t){return 2*t+1},fh.prototype.getRightChildIndex_=function(t){return 2*t+2},fh.prototype.getParentIndex_=function(t){return t-1>>1},fh.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},fh.prototype.isEmpty=function(){return 0===this.elements_.length},fh.prototype.isKeyQueued=function(t){return t in this.queuedElements_},fh.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},fh.prototype.siftUp_=function(t){for(var i=this.elements_,s=this.priorities_,h=i.length,n=i[t],r=s[t],e=t;t<h>>1;){var o=this.getLeftChildIndex_(t),a=this.getRightChildIndex_(t),u=a<h&&s[a]<s[o]?a:o;i[t]=i[u],s[t]=s[u],t=u}i[t]=n,s[t]=r,this.siftDown_(e,t)},fh.prototype.siftDown_=function(t,i){for(var s=this.elements_,h=this.priorities_,n=s[i],r=h[i];i>t;){var e=this.getParentIndex_(i);if(!(h[e]>r))break;s[i]=s[e],h[i]=h[e],i=e}s[i]=n,h[i]=r},fh.prototype.reprioritize=function(){var t,i,s,h=this.priorityFunction_,n=this.elements_,r=this.priorities_,e=0,o=n.length;for(i=0;i<o;++i)(s=h(t=n[i]))==fh.DROP?delete this.queuedElements_[this.keyFunction_(t)]:(r[e]=s,n[e++]=t);n.length=e,r.length=e,this.heapify_()};var ch=function(t,i){fh.call(this,(function(i){return t.apply(null,i)}),(function(t){return t[0].getKey()})),this.tileChangeCallback_=i,this.tilesLoading_=0,this.tilesLoadingKeys_={}};di.inherits(ch,fh),ch.prototype.enqueue=function(t){var i=fh.prototype.enqueue.call(this,t);return i&&zi.listen(t[0],Ri,this.handleTileChange,this),i},ch.prototype.getTilesLoading=function(){return this.tilesLoading_},ch.prototype.handleTileChange=function(t){var i=t.target,s=i.getState();if(2===s||3===s||4===s||5===s){zi.unlisten(i,Ri,this.handleTileChange,this);var h=i.getKey();h in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[h],--this.tilesLoading_),this.tileChangeCallback_()}},ch.prototype.loadMoreTiles=function(t,i){for(var s,h,n,r=0,e=!1;this.tilesLoading_<t&&r<i&&this.getCount()>0;)n=(h=this.dequeue()[0]).getKey(),5===(s=h.getState())?e=!0:0!==s||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++r,h.load());0===r&&e&&this.tileChangeCallback_()};var lh={createExtent:function(t){return function(i){return i?[Bi.clamp(i[0],t[0],t[2]),Bi.clamp(i[1],t[1],t[3])]:void 0}},none:function(t){return t}},vh=function(t){return function(i,s,h){if(void 0!==i){var n=hs.linearFindNearest(t,i,h);n=Bi.clamp(n+s,0,t.length-1);var r=Math.floor(n);return n!=r&&r<t.length-1?t[r]/Math.pow(t[r]/t[r+1],n-r):t[r]}}},dh=function(t,i,s){return function(h,n,r){if(void 0!==h){var e=-r/2+.5,o=Math.floor(Math.log(i/h)/Math.log(t)+e),a=Math.max(o+n,0);return void 0!==s&&(a=Math.min(a,s)),i/Math.pow(t,a)}}},Mh={disable:function(t){return void 0!==t?0:void 0},none:function(t,i){return void 0!==t?t+i:void 0},createSnapToN:function(t){var i=2*Math.PI/t;return function(t,s){return void 0!==t?t=Math.floor((t+s)/i+.5)*i:void 0}},createSnapToZero:function(t){var i=t||Bi.toRadians(5);return function(t,s){return void 0!==t?Math.abs(t+s)<=i?0:t+s:void 0}}},mh="center",ph="resolution",gh="rotation",_h=function(t,i,s){var h=void 0!==s?t.toFixed(s):""+t,n=h.indexOf(".");return(n=-1===n?h.length:n)>i?h:new Array(1+i-n).join("0")+h},wh={add:function(t,i){return t[0]+=i[0],t[1]+=i[1],t},closestOnCircle:function(t,i){var s=i.getRadius(),h=i.getCenter(),n=h[0],r=h[1],e=t[0]-n,o=t[1]-r;0===e&&0===o&&(e=1);var a=Math.sqrt(e*e+o*o);return[n+s*e/a,r+s*o/a]},closestOnSegment:function(t,i){var s,h,n=i[0],r=i[1],e=n[0],o=n[1],a=r[0],u=r[1],f=a-e,c=u-o,l=0===f&&0===c?0:(f*(t[0]-e)+c*(t[1]-o))/(f*f+c*c||0);return l<=0?(s=e,h=o):l>=1?(s=a,h=u):(s=e+l*f,h=o+l*c),[s,h]},createStringXY:function(t){return function(i){return wh.toStringXY(i,t)}},degreesToStringHDMS:function(t,i,s){var h=Bi.modulo(i+180,360)-180,n=Math.abs(3600*h),r=s||0,e=Math.pow(10,r),o=Math.floor(n/3600),a=Math.floor((n-3600*o)/60),u=n-3600*o-60*a;return(u=Math.ceil(u*e)/e)>=60&&(u=0,a+=1),a>=60&&(a=0,o+=1),o+"° "+_h(a,2)+"′ "+_h(u,2,r)+"″"+(0==h?"":" "+t.charAt(h<0?1:0))},format:function(t,i,s){return t?i.replace("{x}",t[0].toFixed(s)).replace("{y}",t[1].toFixed(s)):""},equals:function(t,i){for(var s=!0,h=t.length-1;h>=0;--h)if(t[h]!=i[h]){s=!1;break}return s},rotate:function(t,i){var s=Math.cos(i),h=Math.sin(i),n=t[1]*s+t[0]*h;return t[0]=t[0]*s-t[1]*h,t[1]=n,t},scale:function(t,i){return t[0]*=i,t[1]*=i,t},sub:function(t,i){return t[0]-=i[0],t[1]-=i[1],t},squaredDistance:function(t,i){var s=t[0]-i[0],h=t[1]-i[1];return s*s+h*h},distance:function(t,i){return Math.sqrt(wh.squaredDistance(t,i))},squaredDistanceToSegment:function(t,i){return wh.squaredDistance(t,wh.closestOnSegment(t,i))},toStringHDMS:function(t,i){return t?wh.degreesToStringHDMS("NS",t[1],i)+" "+wh.degreesToStringHDMS("EW",t[0],i):""},toStringXY:function(t,i){return wh.format(t,"{x}, {y}",i)}},yh={easeIn:function(t){return Math.pow(t,3)},easeOut:function(t){return 1-yh.easeIn(1-t)},inAndOut:function(t){return 3*t*t-2*t*t*t},linear:function(t){return t},upAndDown:function(t){return t<.5?yh.inAndOut(2*t):1-yh.inAndOut(2*(t-.5))}},bh=function(t){Ui.call(this);var i=Si.assign({},t);this.hints_=[0,0],this.animations_=[],this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=ws.createProjection(i.projection,"EPSG:3857"),this.applyOptions_(i)};di.inherits(bh,Ui),bh.prototype.applyOptions_=function(t){var i={};i[mh]=void 0!==t.center?t.center:null;var s=bh.createResolutionConstraint_(t);this.maxResolution_=s.maxResolution,this.minResolution_=s.minResolution,this.zoomFactor_=s.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=s.minZoom;var h=bh.createCenterConstraint_(t),n=s.constraint,r=bh.createRotationConstraint_(t);this.constraints_={center:h,resolution:n,rotation:r},void 0!==t.resolution?i[ph]=t.resolution:void 0!==t.zoom&&(i[ph]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_),this.resolutions_&&(i[ph]=Bi.clamp(Number(this.getResolution()||i[ph]),this.minResolution_,this.maxResolution_))),i[gh]=void 0!==t.rotation?t.rotation:0,this.setProperties(i),this.options_=t},bh.prototype.getUpdatedOptions_=function(t){var i=Si.assign({},this.options_);return void 0!==i.resolution?i.resolution=this.getResolution():i.zoom=this.getZoom(),i.center=this.getCenter(),i.rotation=this.getRotation(),Si.assign({},i,t)},bh.prototype.animate=function(t){var i,s=arguments.length;if(s>1&&"function"==typeof arguments[s-1]&&(i=arguments[s-1],--s),!this.isDef()){var h=arguments[s-1];return h.center&&this.setCenter(h.center),void 0!==h.zoom&&this.setZoom(h.zoom),void 0!==h.rotation&&this.setRotation(h.rotation),void(i&&i(!0))}for(var n=Date.now(),r=this.getCenter().slice(),e=this.getResolution(),o=this.getRotation(),a=[],u=0;u<s;++u){var f=arguments[u],c={start:n,complete:!1,anchor:f.anchor,duration:void 0!==f.duration?f.duration:1e3,easing:f.easing||yh.inAndOut};if(f.center&&(c.sourceCenter=r,c.targetCenter=f.center,r=c.targetCenter),void 0!==f.zoom?(c.sourceResolution=e,c.targetResolution=this.constrainResolution(this.maxResolution_,f.zoom-this.minZoom_,0),e=c.targetResolution):f.resolution&&(c.sourceResolution=e,c.targetResolution=f.resolution,e=c.targetResolution),void 0!==f.rotation){c.sourceRotation=o;var l=Bi.modulo(f.rotation-o+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=o+l,o=c.targetRotation}c.callback=i,bh.isNoopAnimation(c)?c.complete=!0:n+=c.duration,a.push(c)}this.animations_.push(a),this.setHint(0,1),this.updateAnimations_()},bh.prototype.getAnimating=function(){return this.hints_[0]>0},bh.prototype.getInteracting=function(){return this.hints_[1]>0},bh.prototype.cancelAnimations=function(){this.setHint(0,-this.hints_[0]);for(var t=0,i=this.animations_.length;t<i;++t){var s=this.animations_[t];s[0].callback&&s[0].callback(!1)}this.animations_.length=0},bh.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),i=!1,s=this.animations_.length-1;s>=0;--s){for(var h=this.animations_[s],n=!0,r=0,e=h.length;r<e;++r){var o=h[r];if(!o.complete){var a=o.duration>0?(t-o.start)/o.duration:1;a>=1?(o.complete=!0,a=1):n=!1;var u=o.easing(a);if(o.sourceCenter){var f=o.sourceCenter[0],c=o.sourceCenter[1];this.set(mh,[f+u*(o.targetCenter[0]-f),c+u*(o.targetCenter[1]-c)])}if(o.sourceResolution&&o.targetResolution){var l=1===u?o.targetResolution:o.sourceResolution+u*(o.targetResolution-o.sourceResolution);o.anchor&&this.set(mh,this.calculateCenterZoom(l,o.anchor)),this.set(ph,l)}if(void 0!==o.sourceRotation&&void 0!==o.targetRotation){var v=1===u?Bi.modulo(o.targetRotation+Math.PI,2*Math.PI)-Math.PI:o.sourceRotation+u*(o.targetRotation-o.sourceRotation);o.anchor&&this.set(mh,this.calculateCenterRotate(v,o.anchor)),this.set(gh,v)}if(i=!0,!o.complete)break}}if(n){this.animations_[s]=null,this.setHint(0,-1);var d=h[0].callback;d&&d(!0)}}this.animations_=this.animations_.filter(Boolean),i&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},bh.prototype.calculateCenterRotate=function(t,i){var s,h=this.getCenter();return void 0!==h&&(wh.rotate(s=[h[0]-i[0],h[1]-i[1]],t-this.getRotation()),wh.add(s,i)),s},bh.prototype.calculateCenterZoom=function(t,i){var s,h=this.getCenter(),n=this.getResolution();return void 0!==h&&void 0!==n&&(s=[i[0]-t*(i[0]-h[0])/n,i[1]-t*(i[1]-h[1])/n]),s},bh.prototype.getSizeFromViewport_=function(){var t=[100,100],i='.ol-viewport[data-view="'+di.getUid(this)+'"]',s=document.querySelector(i);if(s){var h=getComputedStyle(s);t[0]=parseInt(h.width,10),t[1]=parseInt(h.height,10)}return t},bh.prototype.constrainCenter=function(t){return this.constraints_.center(t)},bh.prototype.constrainResolution=function(t,i,s){return this.constraints_.resolution(t,i||0,s||0)},bh.prototype.constrainRotation=function(t,i){return this.constraints_.rotation(t,i||0)},bh.prototype.getCenter=function(){return this.get(mh)},bh.prototype.getConstraints=function(){return this.constraints_},bh.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},bh.prototype.calculateExtent=function(t){var i=t||this.getSizeFromViewport_(),s=this.getCenter();qi(s,1);var h=this.getResolution();qi(void 0!==h,2);var n=this.getRotation();return qi(void 0!==n,3),rs.getForViewAndSize(s,h,n,i)},bh.prototype.getMaxResolution=function(){return this.maxResolution_},bh.prototype.getMinResolution=function(){return this.minResolution_},bh.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},bh.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},bh.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},bh.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},bh.prototype.getProjection=function(){return this.projection_},bh.prototype.getResolution=function(){return this.get(ph)},bh.prototype.getResolutions=function(){return this.resolutions_},bh.prototype.getResolutionForExtent=function(t,i){var s=i||this.getSizeFromViewport_(),h=rs.getWidth(t)/s[0],n=rs.getHeight(t)/s[1];return Math.max(h,n)},bh.prototype.getResolutionForValueFunction=function(t){var i=t||2,s=this.maxResolution_,h=Math.log(s/this.minResolution_)/Math.log(i);return function(t){return s/Math.pow(i,t*h)}},bh.prototype.getRotation=function(){return this.get(gh)},bh.prototype.getValueForResolutionFunction=function(t){var i=t||2,s=this.maxResolution_,h=Math.log(s/this.minResolution_)/Math.log(i);return function(t){return Math.log(s/t)/Math.log(i)/h}},bh.prototype.getState=function(){var t=this.getCenter(),i=this.getProjection(),s=this.getResolution(),h=this.getRotation();return{center:t.slice(),projection:void 0!==i?i:null,resolution:s,rotation:h,zoom:this.getZoom()}},bh.prototype.getZoom=function(){var t,i=this.getResolution();return void 0!==i&&(t=this.getZoomForResolution(i)),t},bh.prototype.getZoomForResolution=function(t){var i,s,h=this.minZoom_||0;if(this.resolutions_){var n=hs.linearFindNearest(this.resolutions_,t,1);h=n,i=this.resolutions_[n],s=n==this.resolutions_.length-1?2:i/this.resolutions_[n+1]}else i=this.maxResolution_,s=this.zoomFactor_;return h+Math.log(i/t)/Math.log(s)},bh.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},bh.prototype.fit=function(t,i){var s,h=i||{},n=h.size;n||(n=this.getSizeFromViewport_()),t instanceof xs?t.getType()===is?(t=t.getExtent(),(s=Is.fromExtent(t)).rotate(this.getRotation(),rs.getCenter(t))):s=t:(qi(Array.isArray(t),24),qi(!rs.isEmpty(t),25),s=Is.fromExtent(t));var r,e=void 0!==h.padding?h.padding:[0,0,0,0],o=void 0===h.constrainResolution||h.constrainResolution,a=void 0!==h.nearest&&h.nearest;r=void 0!==h.minResolution?h.minResolution:void 0!==h.maxZoom?this.constrainResolution(this.maxResolution_,h.maxZoom-this.minZoom_,0):0;for(var u=s.getFlatCoordinates(),f=this.getRotation(),c=Math.cos(-f),l=Math.sin(-f),v=1/0,d=1/0,M=-1/0,m=-1/0,p=s.getStride(),g=0,_=u.length;g<_;g+=p){var w=u[g]*c-u[g+1]*l,y=u[g]*l+u[g+1]*c;v=Math.min(v,w),d=Math.min(d,y),M=Math.max(M,w),m=Math.max(m,y)}var b=this.getResolutionForExtent([v,d,M,m],[n[0]-e[1]-e[3],n[1]-e[0]-e[2]]);if(b=isNaN(b)?r:Math.max(b,r),o){var x=this.constrainResolution(b,0,0);!a&&x<b&&(x=this.constrainResolution(x,-1,0)),b=x}var E=(v+M)/2,C=(d+m)/2,S=[(E+=(e[1]-e[3])/2*b)*c-(C+=(e[0]-e[2])/2*b)*(l=-l),C*c+E*l],z=h.callback?h.callback:di.nullFunction;void 0!==h.duration?this.animate({resolution:b,center:S,duration:h.duration,easing:h.easing},z):(this.setResolution(b),this.setCenter(S),setTimeout(z.bind(void 0,!0),0))},bh.prototype.centerOn=function(t,i,s){var h=this.getRotation(),n=Math.cos(-h),r=Math.sin(-h),e=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r,a=this.getResolution();this.setCenter([(e+=(i[0]/2-s[0])*a)*n-(o+=(s[1]-i[1]/2)*a)*(r=-r),o*n+e*r])},bh.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},bh.prototype.rotate=function(t,i){if(void 0!==i){var s=this.calculateCenterRotate(t,i);this.setCenter(s)}this.setRotation(t)},bh.prototype.setCenter=function(t){this.set(mh,t),this.getAnimating()&&this.cancelAnimations()},bh.prototype.setHint=function(t,i){return this.hints_[t]+=i,this.changed(),this.hints_[t]},bh.prototype.setResolution=function(t){this.set(ph,t),this.getAnimating()&&this.cancelAnimations()},bh.prototype.setRotation=function(t){this.set(gh,t),this.getAnimating()&&this.cancelAnimations()},bh.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},bh.createCenterConstraint_=function(t){return void 0!==t.extent?lh.createExtent(t.extent):lh.none},bh.createResolutionConstraint_=function(t){var i,s,h,n=void 0!==t.minZoom?t.minZoom:di.DEFAULT_MIN_ZOOM,r=void 0!==t.maxZoom?t.maxZoom:28,e=void 0!==t.zoomFactor?t.zoomFactor:2;if(void 0!==t.resolutions){var o=t.resolutions;s=o[n],h=void 0!==o[r]?o[r]:o[o.length-1],i=vh(o)}else{var a=ws.createProjection(t.projection,"EPSG:3857"),u=a.getExtent(),f=(u?Math.max(rs.getWidth(u),rs.getHeight(u)):360*ws.METERS_PER_UNIT[vs.DEGREES]/a.getMetersPerUnit())/di.DEFAULT_TILE_SIZE/Math.pow(2,di.DEFAULT_MIN_ZOOM),c=f/Math.pow(2,28-di.DEFAULT_MIN_ZOOM);void 0!==(s=t.maxResolution)?n=0:s=f/Math.pow(e,n),void 0===(h=t.minResolution)&&(h=void 0!==t.maxZoom?void 0!==t.maxResolution?s/Math.pow(e,r):f/Math.pow(e,r):c),r=n+Math.floor(Math.log(s/h)/Math.log(e)),h=s/Math.pow(e,r-n),i=dh(e,s,r-n)}return{constraint:i,maxResolution:s,minResolution:h,minZoom:n,zoomFactor:e}},bh.createRotationConstraint_=function(t){if(void 0===t.enableRotation||t.enableRotation){var i=t.constrainRotation;return void 0===i||!0===i?Mh.createSnapToZero():!1===i?Mh.none:"number"==typeof i?Mh.createSnapToN(i):Mh.none}return Mh.disable},bh.isNoopAnimation=function(t){return!(t.sourceCenter&&t.targetCenter&&!wh.equals(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation};var xh=function(t,i){var s=document.createElement("CANVAS");return t&&(s.width=t),i&&(s.height=i),s.getContext("2d")},Eh=function(t,i){var s=i.parentNode;s&&s.replaceChild(t,i)},Ch=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null},Sh="opacity",zh="visible",Ah="extent",kh="zIndex",Nh="maxResolution",Rh="minResolution",Ph="source",Th=function(t){Ui.call(this);var i=Si.assign({},t);i[Sh]=void 0!==t.opacity?t.opacity:1,i[zh]=void 0===t.visible||t.visible,i[kh]=void 0!==t.zIndex?t.zIndex:0,i[Nh]=void 0!==t.maxResolution?t.maxResolution:1/0,i[Rh]=void 0!==t.minResolution?t.minResolution:0,this.setProperties(i),this.state_={layer:this,managed:!0}};di.inherits(Th,Ui),Th.prototype.getType=function(){return this.type},Th.prototype.getLayerState=function(){return this.state_.opacity=Bi.clamp(this.getOpacity(),0,1),this.state_.sourceState=this.getSourceState(),this.state_.visible=this.getVisible(),this.state_.extent=this.getExtent(),this.state_.zIndex=this.getZIndex(),this.state_.maxResolution=this.getMaxResolution(),this.state_.minResolution=Math.max(this.getMinResolution(),0),this.state_},Th.prototype.getLayersArray=function(){},Th.prototype.getLayerStatesArray=function(){},Th.prototype.getExtent=function(){return this.get(Ah)},Th.prototype.getMaxResolution=function(){return this.get(Nh)},Th.prototype.getMinResolution=function(){return this.get(Rh)},Th.prototype.getOpacity=function(){return this.get(Sh)},Th.prototype.getSourceState=function(){},Th.prototype.getVisible=function(){return this.get(zh)},Th.prototype.getZIndex=function(){return this.get(kh)},Th.prototype.setExtent=function(t){this.set(Ah,t)},Th.prototype.setMaxResolution=function(t){this.set(Nh,t)},Th.prototype.setMinResolution=function(t){this.set(Rh,t)},Th.prototype.setOpacity=function(t){this.set(Sh,t)},Th.prototype.setVisible=function(t){this.set(zh,t)},Th.prototype.setZIndex=function(t){this.set(kh,t)};var Oh="ready",Lh=function(t){var i=t||{},s=Si.assign({},i);delete s.layers;var h=i.layers;Th.call(this,s),this.layersListenerKeys_=[],this.listenerKeys_={},zi.listen(this,Ui.getChangeEventType(Lh.Property_.LAYERS),this.handleLayersChanged_,this),h?Array.isArray(h)?h=new Xs(h.slice(),{unique:!0}):qi(h instanceof Xs,43):h=new Xs(void 0,{unique:!0}),this.setLayers(h)};di.inherits(Lh,Th),Lh.prototype.handleLayerChange_=function(){this.changed()},Lh.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(zi.unlistenByKey),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var i in this.layersListenerKeys_.push(zi.listen(t,js,this.handleLayersAdd_,this),zi.listen(t,Us,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[i].forEach(zi.unlistenByKey);Si.clear(this.listenerKeys_);var s,h,n,r=t.getArray();for(s=0,h=r.length;s<h;s++)this.listenerKeys_[di.getUid(n=r[s]).toString()]=[zi.listen(n,Ci,this.handleLayerChange_,this),zi.listen(n,Ri,this.handleLayerChange_,this)];this.changed()},Lh.prototype.handleLayersAdd_=function(t){var i=t.element,s=di.getUid(i).toString();this.listenerKeys_[s]=[zi.listen(i,Ci,this.handleLayerChange_,this),zi.listen(i,Ri,this.handleLayerChange_,this)],this.changed()},Lh.prototype.handleLayersRemove_=function(t){var i=di.getUid(t.element).toString();this.listenerKeys_[i].forEach(zi.unlistenByKey),delete this.listenerKeys_[i],this.changed()},Lh.prototype.getLayers=function(){return this.get(Lh.Property_.LAYERS)},Lh.prototype.setLayers=function(t){this.set(Lh.Property_.LAYERS,t)},Lh.prototype.getLayersArray=function(t){var i=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(i)})),i},Lh.prototype.getLayerStatesArray=function(t){var i=void 0!==t?t:[],s=i.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(i)}));var h,n,r,e=this.getLayerState();for(h=s,n=i.length;h<n;h++)(r=i[h]).opacity*=e.opacity,r.visible=r.visible&&e.visible,r.maxResolution=Math.min(r.maxResolution,e.maxResolution),r.minResolution=Math.max(r.minResolution,e.minResolution),void 0!==e.extent&&(r.extent=void 0!==r.extent?rs.getIntersection(r.extent,e.extent):e.extent);return i},Lh.prototype.getSourceState=function(){return Oh},Lh.Property_={LAYERS:"layers"};var Fh="MAP_RENDERER",Ih="LAYER_RENDERER",Dh={mapRendererPlugins_:[],getMapRendererPlugins:function(){return Dh.mapRendererPlugins_},layerRendererPlugins_:[],getLayerRendererPlugins:function(){return Dh.layerRendererPlugins_},register:function(t,i){switch(t){case Fh:Dh.mapRendererPlugins_.push(i);break;case Ih:Dh.layerRendererPlugins_.push(i);break;default:throw new Error("Unsupported plugin type: "+t)}},registerMultiple:function(t,i){for(var s=0,h=i.length;s<h;++s)Dh.register(t,i[s])}},Wh="canvas",Gh="webgl",Vh=function(t){return t[0]>0&&t[1]>0},jh=function(t,i,s){return void 0===s&&(s=[0,0]),s[0]=t[0]*i+.5|0,s[1]=t[1]*i+.5|0,s},Uh=function(t,i){return Array.isArray(t)?t:(void 0===i?i=[t,t]:i[0]=i[1]=t,i)},Xh=function(t){Ui.call(this);var i=Xh.createOptionsInternal(t);this.loadTilesWhileAnimating_=void 0!==t.loadTilesWhileAnimating&&t.loadTilesWhileAnimating,this.loadTilesWhileInteracting_=void 0!==t.loadTilesWhileInteracting&&t.loadTilesWhileInteracting,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:Ws.DEVICE_PIXEL_RATIO,this.logos_=i.logos,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_.call(this,Date.now())}.bind(this),this.coordinateToPixelTransform_=ys.create(),this.pixelToCoordinateTransform_=ys.create(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("DIV"),this.viewport_.className="ol-viewport"+(Ws.TOUCH?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.viewport_.style.msTouchAction="none",this.viewport_.style.touchAction="none",this.overlayContainer_=document.createElement("DIV"),this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("DIV"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";for(var s=[Ti,Oi,"mousedown","touchstart","MSPointerDown",Ys.POINTERDOWN,Wi,Vi],h=0,n=s.length;h<n;++h)zi.listen(this.overlayContainerStopEvent_,s[h],ki.stopPropagation);for(var r in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new nh(this,t.moveTolerance),Ys)zi.listen(this.mapBrowserEventHandler_,Ys[r],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=i.keyboardEventTarget,this.keyHandlerKeys_=null,zi.listen(this.viewport_,Vi,this.handleBrowserEvent,this),zi.listen(this.viewport_,Wi,this.handleBrowserEvent,this),this.controls=i.controls||new Xs,this.interactions=i.interactions||new Xs,this.overlays_=i.overlays,this.overlayIdIndex_={},this.renderer_=i.mapRendererPlugin.create(this.viewport_,this),this.focus_=null,this.postRenderFunctions_=[],this.tileQueue_=new ch(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.skippedFeatureUids_={},zi.listen(this,Ui.getChangeEventType(eh),this.handleLayerGroupChanged_,this),zi.listen(this,Ui.getChangeEventType(uh),this.handleViewChanged_,this),zi.listen(this,Ui.getChangeEventType(oh),this.handleSizeChanged_,this),zi.listen(this,Ui.getChangeEventType(ah),this.handleTargetChanged_,this),this.setProperties(i.values),this.controls.forEach((function(t){t.setMap(this)}),this),zi.listen(this.controls,js,(function(t){t.element.setMap(this)}),this),zi.listen(this.controls,Us,(function(t){t.element.setMap(null)}),this),this.interactions.forEach((function(t){t.setMap(this)}),this),zi.listen(this.interactions,js,(function(t){t.element.setMap(this)}),this),zi.listen(this.interactions,Us,(function(t){t.element.setMap(null)}),this),this.overlays_.forEach(this.addOverlayInternal_,this),zi.listen(this.overlays_,js,(function(t){this.addOverlayInternal_(t.element)}),this),zi.listen(this.overlays_,Us,(function(t){var i=t.element.getId();void 0!==i&&delete this.overlayIdIndex_[i.toString()],t.element.setMap(null)}),this)};di.inherits(Xh,Ui),Xh.prototype.addControl=function(t){this.getControls().push(t)},Xh.prototype.addInteraction=function(t){this.getInteractions().push(t)},Xh.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},Xh.prototype.addOverlay=function(t){this.getOverlays().push(t)},Xh.prototype.addOverlayInternal_=function(t){var i=t.getId();void 0!==i&&(this.overlayIdIndex_[i.toString()]=t),t.setMap(this)},Xh.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),zi.unlisten(this.viewport_,Vi,this.handleBrowserEvent,this),zi.unlisten(this.viewport_,Wi,this.handleBrowserEvent,this),void 0!==this.handleResize_&&(window.removeEventListener(Gi,this.handleResize_,!1),this.handleResize_=void 0),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),this.setTarget(null),Ui.prototype.disposeInternal.call(this)},Xh.prototype.forEachFeatureAtPixel=function(t,i,s){if(this.frameState_){var h=this.getCoordinateFromPixel(t);return this.renderer_.forEachFeatureAtCoordinate(h,this.frameState_,void 0!==(s=void 0!==s?s:{}).hitTolerance?s.hitTolerance*this.frameState_.pixelRatio:0,i,null,void 0!==s.layerFilter?s.layerFilter:as.TRUE,null)}},Xh.prototype.getFeaturesAtPixel=function(t,i){var s=null;return this.forEachFeatureAtPixel(t,(function(t){s||(s=[]),s.push(t)}),i),s},Xh.prototype.forEachLayerAtPixel=function(t,i,s,h,n){if(this.frameState_)return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,void 0!==s?s:null,void 0!==h?h:as.TRUE,void 0!==n?n:null)},Xh.prototype.hasFeatureAtPixel=function(t,i){if(!this.frameState_)return!1;var s=this.getCoordinateFromPixel(t);return this.renderer_.hasFeatureAtCoordinate(s,this.frameState_,void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,void 0!==i.layerFilter?i.layerFilter:as.TRUE,null)},Xh.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},Xh.prototype.getEventPixel=function(t){var i=this.viewport_.getBoundingClientRect(),s=t.changedTouches?t.changedTouches[0]:t;return[s.clientX-i.left,s.clientY-i.top]},Xh.prototype.getTarget=function(){return this.get(ah)},Xh.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},Xh.prototype.getCoordinateFromPixel=function(t){var i=this.frameState_;return i?ys.apply(i.pixelToCoordinateTransform,t.slice()):null},Xh.prototype.getControls=function(){return this.controls},Xh.prototype.getOverlays=function(){return this.overlays_},Xh.prototype.getOverlayById=function(t){var i=this.overlayIdIndex_[t.toString()];return void 0!==i?i:null},Xh.prototype.getInteractions=function(){return this.interactions},Xh.prototype.getLayerGroup=function(){return this.get(eh)},Xh.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},Xh.prototype.getPixelFromCoordinate=function(t){var i=this.frameState_;return i?ys.apply(i.coordinateToPixelTransform,t.slice(0,2)):null},Xh.prototype.getRenderer=function(){return this.renderer_},Xh.prototype.getSize=function(){return this.get(oh)},Xh.prototype.getView=function(){return this.get(uh)},Xh.prototype.getViewport=function(){return this.viewport_},Xh.prototype.getOverlayContainer=function(){return this.overlayContainer_},Xh.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},Xh.prototype.getTilePriority=function(t,i,s,h){var n=this.frameState_;if(!n||!(i in n.wantedTiles))return fh.DROP;if(!n.wantedTiles[i][t.getKey()])return fh.DROP;var r=s[0]-n.focus[0],e=s[1]-n.focus[1];return 65536*Math.log(h)+Math.sqrt(r*r+e*e)/h},Xh.prototype.handleBrowserEvent=function(t,i){var s=new Bs(i||t.type,this,t);this.handleMapBrowserEvent(s)},Xh.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){this.focus_=t.coordinate,t.frameState=this.frameState_;var i,s=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(i=s.length-1;i>=0;i--){var h=s[i];if(h.getActive()&&!h.handleEvent(t))break}}},Xh.prototype.handlePostRender=function(){var t=this.frameState_,i=this.tileQueue_;if(!i.isEmpty()){var s=16,h=s;if(t){var n=t.viewHints;n[0]&&(s=this.loadTilesWhileAnimating_?8:0,h=2),n[1]&&(s=this.loadTilesWhileInteracting_?8:0,h=2)}i.getTilesLoading()<s&&(i.reprioritize(),i.loadMoreTiles(s,h))}var r,e,o=this.postRenderFunctions_;for(r=0,e=o.length;r<e;++r)o[r](this,t);o.length=0},Xh.prototype.handleSizeChanged_=function(){this.render()},Xh.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var i=0,s=this.keyHandlerKeys_.length;i<s;++i)zi.unlistenByKey(this.keyHandlerKeys_[i]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);var h=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[zi.listen(h,Fi,this.handleBrowserEvent,this),zi.listen(h,Ii,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(Gi,this.handleResize_,!1))}else this.renderer_.removeLayerRenderers(),Ch(this.viewport_),void 0!==this.handleResize_&&(window.removeEventListener(Gi,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},Xh.prototype.handleTileChange_=function(){this.render()},Xh.prototype.handleViewPropertyChanged_=function(){this.render()},Xh.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(zi.unlistenByKey(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(zi.unlistenByKey(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",di.getUid(t)),this.viewPropertyListenerKey_=zi.listen(t,Ci,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=zi.listen(t,Ri,this.handleViewPropertyChanged_,this)),this.render()},Xh.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(zi.unlistenByKey),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[zi.listen(t,Ci,this.render,this),zi.listen(t,Ri,this.render,this)]),this.render()},Xh.prototype.isRendered=function(){return!!this.frameState_},Xh.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},Xh.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},Xh.prototype.removeControl=function(t){return this.getControls().remove(t)},Xh.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},Xh.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},Xh.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},Xh.prototype.renderFrame_=function(t){var i,s,h,n=this.getSize(),r=this.getView(),e=rs.createEmpty(),o=this.frameState_,a=null;if(void 0!==n&&Vh(n)&&r&&r.isDef()){var u=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),f=this.getLayerGroup().getLayerStatesArray(),c={};for(i=0,s=f.length;i<s;++i)c[di.getUid(f[i].layer)]=f[i];var l=(h=r.getState()).center,v=h.resolution/this.pixelRatio_;l[0]=Math.round(l[0]/v)*v,l[1]=Math.round(l[1]/v)*v,a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:e,focus:this.focus_?this.focus_:l,index:this.frameIndex_++,layerStates:c,layerStatesArray:f,logos:Si.assign({},this.logos_),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:h,viewHints:u,wantedTiles:{}}}a&&(a.extent=rs.getForViewAndSize(h.center,h.resolution,h.rotation,a.size,e)),this.frameState_=a,this.renderer_.renderFrame(a),a&&(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),o&&(!this.previousExtent_||!rs.isEmpty(this.previousExtent_)&&!rs.equals(a.extent,this.previousExtent_))&&(this.dispatchEvent(new qs("movestart",this,o)),this.previousExtent_=rs.createOrUpdateEmpty(this.previousExtent_)),this.previousExtent_&&!a.viewHints[0]&&!a.viewHints[1]&&!rs.equals(a.extent,this.previousExtent_)&&(this.dispatchEvent(new qs("moveend",this,a)),rs.clone(a.extent,this.previousExtent_))),this.dispatchEvent(new qs(rh,this,a)),setTimeout(this.handlePostRender.bind(this),0)},Xh.prototype.setLayerGroup=function(t){this.set(eh,t)},Xh.prototype.setSize=function(t){this.set(oh,t)},Xh.prototype.setTarget=function(t){this.set(ah,t)},Xh.prototype.setView=function(t){this.set(uh,t)},Xh.prototype.skipFeature=function(t){var i=di.getUid(t).toString();this.skippedFeatureUids_[i]=!0,this.render()},Xh.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var i=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth)])}else this.setSize(void 0)},Xh.prototype.unskipFeature=function(t){var i=di.getUid(t).toString();delete this.skippedFeatureUids_[i],this.render()},Xh.DEFAULT_RENDERER_TYPES=[Wh,Gh],Xh.LOGO_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszWWMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvYasvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvXH1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1VkbMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLPVcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqTacrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaarldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+HizeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDnBAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSFhYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJREFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxCBrb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7ahgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCnB3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDgq82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC",Xh.createOptionsInternal=function(t){var i=null;void 0!==t.keyboardEventTarget&&(i="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var s={},h={};if(void 0===t.logo||"boolean"==typeof t.logo&&t.logo)h[Xh.LOGO_URL]="https://openlayers.org/";else{var n=t.logo;"string"==typeof n?h[n]="":n instanceof HTMLElement?h[di.getUid(n).toString()]=n:n&&(qi("string"==typeof n.href,44),qi("string"==typeof n.src,45),h[n.src]=n.href)}var r,e,o=t.layers instanceof Lh?t.layers:new Lh({layers:t.layers});s[eh]=o,s[ah]=t.target,s[uh]=void 0!==t.view?t.view:new bh,void 0!==t.renderer?(Array.isArray(t.renderer)?r=t.renderer:"string"==typeof t.renderer?r=[t.renderer]:qi(!1,46),r.indexOf("dom")>=0&&(r=r.concat(Xh.DEFAULT_RENDERER_TYPES))):r=Xh.DEFAULT_RENDERER_TYPES;var a,u,f,c=Dh.getMapRendererPlugins();t:for(var l=0,v=r.length;l<v;++l)for(var d=r[l],M=0,m=c.length;M<m;++M){var p=c[M];if(p.handles(d)){e=p;break t}}if(!e)throw new Error("Unable to create a map renderer for types: "+r.join(", "));return void 0!==t.controls&&(Array.isArray(t.controls)?a=new Xs(t.controls.slice()):(qi(t.controls instanceof Xs,47),a=t.controls)),void 0!==t.interactions&&(Array.isArray(t.interactions)?u=new Xs(t.interactions.slice()):(qi(t.interactions instanceof Xs,48),u=t.interactions)),void 0!==t.overlays?Array.isArray(t.overlays)?f=new Xs(t.overlays.slice()):(qi(t.overlays instanceof Xs,49),f=t.overlays):f=new Xs,{controls:a,interactions:u,keyboardEventTarget:i,logos:h,overlays:f,mapRendererPlugin:e,values:s}};var qh=function(t){Ui.call(this),this.element=t.element?t.element:null,this.target_=null,this.map_=null,this.listenerKeys=[],this.render=t.render?t.render:di.nullFunction,t.target&&this.setTarget(t.target)};di.inherits(qh,Ui),qh.prototype.disposeInternal=function(){Ch(this.element),Ui.prototype.disposeInternal.call(this)},qh.prototype.getMap=function(){return this.map_},qh.prototype.setMap=function(t){this.map_&&Ch(this.element);for(var i=0,s=this.listenerKeys.length;i<s;++i)zi.unlistenByKey(this.listenerKeys[i]);this.listenerKeys.length=0,this.map_=t,this.map_&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==di.nullFunction&&this.listenerKeys.push(zi.listen(t,rh,this.render,this)),t.render())},qh.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t};var Bh,Yh,Hh={CLASS_HIDDEN:"ol-hidden",CLASS_SELECTABLE:"ol-selectable",CLASS_UNSELECTABLE:"ol-unselectable",CLASS_UNSUPPORTED:"ol-unsupported",CLASS_CONTROL:"ol-control"};Hh.getFontFamilies=(Yh={},function(t){if(Bh||(Bh=document.createElement("div").style),!(t in Yh)){Bh.font=t;var i=Bh.fontFamily;if(Bh.font="",!i)return null;Yh[t]=i.split(/,\s?/)}return Yh[t]});var Jh="postcompose",Zh="precompose",Kh="render",Qh=function(t){var i=Si.assign({},t);delete i.source,Th.call(this,i),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,t.map&&this.setMap(t.map),zi.listen(this,Ui.getChangeEventType(Ph),this.handleSourcePropertyChange_,this),this.setSource(t.source?t.source:null)};di.inherits(Qh,Th),Qh.visibleAtResolution=function(t,i){return t.visible&&i>=t.minResolution&&i<t.maxResolution},Qh.prototype.getLayersArray=function(t){var i=t||[];return i.push(this),i},Qh.prototype.getLayerStatesArray=function(t){var i=t||[];return i.push(this.getLayerState()),i},Qh.prototype.getSource=function(){return this.get(Ph)||null},Qh.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},Qh.prototype.handleSourceChange_=function(){this.changed()},Qh.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(zi.unlistenByKey(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=zi.listen(t,Ri,this.handleSourceChange_,this)),this.changed()},Qh.prototype.setMap=function(t){this.mapPrecomposeKey_&&(zi.unlistenByKey(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(zi.unlistenByKey(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=zi.listen(t,Zh,(function(t){var i=this.getLayerState();i.managed=!1,i.zIndex=1/0,t.frameState.layerStatesArray.push(i),t.frameState.layerStates[di.getUid(this)]=i}),this),this.mapRenderKey_=zi.listen(this,Ri,t.render,t),this.changed())},Qh.prototype.setSource=function(t){this.set(Ph,t)};var $h=function(t){var i=t||{};this.ulElement_=document.createElement("UL"),this.logoLi_=document.createElement("LI"),this.ulElement_.appendChild(this.logoLi_),this.logoLi_.style.display="none",this.collapsed_=void 0===i.collapsed||i.collapsed,this.collapsible_=void 0===i.collapsible||i.collapsible,this.collapsible_||(this.collapsed_=!1);var s=void 0!==i.className?i.className:"ol-attribution",h=void 0!==i.tipLabel?i.tipLabel:"Attributions",n=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;var r=void 0!==i.label?i.label:"i";"string"==typeof r?(this.label_=document.createElement("span"),this.label_.textContent=r):this.label_=r;var e=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,o=document.createElement("button");o.setAttribute("type","button"),o.title=h,o.appendChild(e),zi.listen(o,Ti,this.handleClick_,this);var a=s+" "+Hh.CLASS_UNSELECTABLE+" "+Hh.CLASS_CONTROL+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible"),u=document.createElement("div");u.className=a,u.appendChild(this.ulElement_),u.appendChild(o),qh.call(this,{element:u,render:i.render?i.render:$h.render,target:i.target}),this.renderedAttributions_=[],this.renderedVisible_=!0,this.logoElements_={}};di.inherits($h,qh),$h.prototype.getSourceAttributions_=function(t){for(var i={},s=[],h=t.layerStatesArray,n=t.viewState.resolution,r=0,e=h.length;r<e;++r){var o=h[r];if(Qh.visibleAtResolution(o,n)){var a=o.layer.getSource();if(a){var u=a.getAttributions2();if(u){var f=u(t);if(f)if(Array.isArray(f))for(var c=0,l=f.length;c<l;++c)f[c]in i||(s.push(f[c]),i[f[c]]=!0);else f in i||(s.push(f),i[f]=!0)}}}}return s},$h.render=function(t){this.updateElement_(t.frameState)},$h.prototype.updateElement_=function(t){if(t){var i=this.getSourceAttributions_(t);if(!hs.equals(i,this.renderedAttributions_)){for(;this.ulElement_.lastChild!==this.logoLi_;)this.ulElement_.removeChild(this.ulElement_.lastChild);for(var s=0,h=i.length;s<h;++s){var n=document.createElement("LI");n.innerHTML=i[s],this.ulElement_.appendChild(n)}0===i.length&&this.renderedAttributions_.length>0?this.element.classList.add("ol-logo-only"):0===this.renderedAttributions_.length&&i.length>0&&this.element.classList.remove("ol-logo-only");var r=i.length>0||!Si.isEmpty(t.logos);this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),this.renderedAttributions_=i,this.insertLogos_(t)}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},$h.prototype.insertLogos_=function(t){var i,s,h,n,r=t.logos,e=this.logoElements_;for(i in e)i in r||(Ch(e[i]),delete e[i]);for(n in r){var o=r[n];o instanceof HTMLElement&&(this.logoLi_.appendChild(o),e[n]=o),n in e||((s=new Image).src=n,""===o?h=s:((h=document.createElement("a")).href=o,h.appendChild(s)),this.logoLi_.appendChild(h),e[n]=h)}this.logoLi_.style.display=Si.isEmpty(r)?"none":""},$h.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},$h.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Eh(this.collapseLabel_,this.label_):Eh(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},$h.prototype.getCollapsible=function(){return this.collapsible_},$h.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},$h.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},$h.prototype.getCollapsed=function(){return this.collapsed_};var tn=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-rotate",h=void 0!==i.label?i.label:"⇧";this.label_=null,"string"==typeof h?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=h):(this.label_=h,this.label_.classList.add("ol-compass"));var n=i.tipLabel?i.tipLabel:"Reset rotation",r=document.createElement("button");r.className=s+"-reset",r.setAttribute("type","button"),r.title=n,r.appendChild(this.label_),zi.listen(r,Ti,tn.prototype.handleClick_,this);var e=s+" "+Hh.CLASS_UNSELECTABLE+" "+Hh.CLASS_CONTROL,o=document.createElement("div");o.className=e,o.appendChild(r);var a=i.render?i.render:tn.render;this.callResetNorth_=i.resetNorth?i.resetNorth:void 0,qh.call(this,{element:o,render:a,target:i.target}),this.duration_=void 0!==i.duration?i.duration:250,this.autoHide_=void 0===i.autoHide||i.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Hh.CLASS_HIDDEN)};di.inherits(tn,qh),tn.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},tn.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(this.duration_>0?t.animate({rotation:0,duration:this.duration_,easing:yh.easeOut}):t.setRotation(0))},tn.render=function(t){var i=t.frameState;if(i){var s=i.viewState.rotation;if(s!=this.rotation_){var h="rotate("+s+"rad)";if(this.autoHide_){var n=this.element.classList.contains(Hh.CLASS_HIDDEN);n||0!==s?n&&0!==s&&this.element.classList.remove(Hh.CLASS_HIDDEN):this.element.classList.add(Hh.CLASS_HIDDEN)}this.label_.style.msTransform=h,this.label_.style.webkitTransform=h,this.label_.style.transform=h}this.rotation_=s}};var sn=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-zoom",h=void 0!==i.delta?i.delta:1,n=void 0!==i.zoomInLabel?i.zoomInLabel:"+",r=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",e=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",o=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",a=document.createElement("button");a.className=s+"-in",a.setAttribute("type","button"),a.title=e,a.appendChild("string"==typeof n?document.createTextNode(n):n),zi.listen(a,Ti,sn.prototype.handleClick_.bind(this,h));var u=document.createElement("button");u.className=s+"-out",u.setAttribute("type","button"),u.title=o,u.appendChild("string"==typeof r?document.createTextNode(r):r),zi.listen(u,Ti,sn.prototype.handleClick_.bind(this,-h));var f=s+" "+Hh.CLASS_UNSELECTABLE+" "+Hh.CLASS_CONTROL,c=document.createElement("div");c.className=f,c.appendChild(a),c.appendChild(u),qh.call(this,{element:c,target:i.target}),this.duration_=void 0!==i.duration?i.duration:250};di.inherits(sn,qh),sn.prototype.handleClick_=function(t,i){i.preventDefault(),this.zoomByDelta_(t)},sn.prototype.zoomByDelta_=function(t){var i=this.getMap().getView();if(i){var s=i.getResolution();if(s){var h=i.constrainResolution(s,t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:h,duration:this.duration_,easing:yh.easeOut})):i.setResolution(h)}}};var hn=function(t){var i=t||{},s=new Xs;return(void 0===i.zoom||i.zoom)&&s.push(new sn(i.zoomOptions)),(void 0===i.rotate||i.rotate)&&s.push(new tn(i.rotateOptions)),(void 0===i.attribution||i.attribution)&&s.push(new $h(i.attributionOptions)),s},nn=function(t,i,s){this.decay_=t,this.minVelocity_=i,this.delay_=s,this.points_=[],this.angle_=0,this.initialVelocity_=0};nn.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},nn.prototype.update=function(t,i){this.points_.push(t,i,Date.now())},nn.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,i=this.points_.length-3;if(this.points_[i+2]<t)return!1;for(var s=i-3;s>0&&this.points_[s+2]>t;)s-=3;var h=this.points_[i+2]-this.points_[s+2];if(h<1e3/60)return!1;var n=this.points_[i]-this.points_[s],r=this.points_[i+1]-this.points_[s+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/h,this.initialVelocity_>this.minVelocity_},nn.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},nn.prototype.getAngle=function(){return this.angle_};var rn="active",en=function(t){Ui.call(this),this.map_=null,this.setActive(!0),this.handleEvent=t.handleEvent};di.inherits(en,Ui),en.prototype.getActive=function(){return this.get(rn)},en.prototype.getMap=function(){return this.map_},en.prototype.setActive=function(t){this.set(rn,t)},en.prototype.setMap=function(t){this.map_=t},en.pan=function(t,i,s){var h=t.getCenter();if(h){var n=t.constrainCenter([h[0]+i[0],h[1]+i[1]]);s?t.animate({duration:s,easing:yh.linear,center:n}):t.setCenter(n)}},en.rotate=function(t,i,s,h){i=t.constrainRotation(i,0),en.rotateWithoutConstraints(t,i,s,h)},en.rotateWithoutConstraints=function(t,i,s,h){if(void 0!==i){var n=t.getRotation(),r=t.getCenter();void 0!==n&&r&&h>0?t.animate({rotation:i,anchor:s,duration:h,easing:yh.easeOut}):t.rotate(i,s)}},en.zoom=function(t,i,s,h,n){i=t.constrainResolution(i,0,n),en.zoomWithoutConstraints(t,i,s,h)},en.zoomByDelta=function(t,i,s,h){var n=t.getResolution(),r=t.constrainResolution(n,i,0);if(void 0!==r){var e=t.getResolutions();r=Bi.clamp(r,t.getMinResolution()||e[e.length-1],t.getMaxResolution()||e[0])}if(s&&void 0!==r&&r!==n){var o=t.getCenter(),a=t.calculateCenterZoom(r,s);a=t.constrainCenter(a),s=[(r*o[0]-n*a[0])/(r-n),(r*o[1]-n*a[1])/(r-n)]}en.zoomWithoutConstraints(t,r,s,h)},en.zoomWithoutConstraints=function(t,i,s,h){if(i){var n=t.getResolution(),r=t.getCenter();if(void 0!==n&&r&&i!==n&&h)t.animate({resolution:i,anchor:s,duration:h,easing:yh.easeOut});else{if(s){var e=t.calculateCenterZoom(i,s);t.setCenter(e)}t.setResolution(i)}}};var on=function(t){var i=t||{};this.delta_=i.delta?i.delta:1,en.call(this,{handleEvent:on.handleEvent}),this.duration_=void 0!==i.duration?i.duration:250};di.inherits(on,en),on.handleEvent=function(t){var i=!1;if(t.type==Ys.DBLCLICK){var s=t.coordinate,h=t.originalEvent.shiftKey?-this.delta_:this.delta_,n=t.map.getView();en.zoomByDelta(n,h,s,this.duration_),t.preventDefault(),i=!0}return!i};var an={altKeyOnly:function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey},altShiftKeysOnly:function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey}};an.always=as.TRUE,an.click=function(t){return t.type==Ys.CLICK},an.mouseActionButton=function(t){var i=t.originalEvent;return 0==i.button&&!(Ws.WEBKIT&&Ws.MAC&&i.ctrlKey)},an.never=as.FALSE,an.pointerMove=function(t){return"pointermove"==t.type},an.singleClick=function(t){return t.type==Ys.SINGLECLICK},an.doubleClick=function(t){return t.type==Ys.DBLCLICK},an.noModifierKeys=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey},an.platformModifierKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&(Ws.MAC?i.metaKey:i.ctrlKey)&&!i.shiftKey},an.shiftKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey},an.targetNotEditable=function(t){var i=t.originalEvent.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i},an.mouseOnly=function(t){return qi(t.pointerEvent,56),"mouse"==t.pointerEvent.pointerType},an.primaryAction=function(t){var i=t.pointerEvent;return i.isPrimary&&0===i.button};var un=function(t){var i=t||{};en.call(this,{handleEvent:i.handleEvent?i.handleEvent:un.handleEvent}),this.handleDownEvent_=i.handleDownEvent?i.handleDownEvent:un.handleDownEvent,this.handleDragEvent_=i.handleDragEvent?i.handleDragEvent:un.handleDragEvent,this.handleMoveEvent_=i.handleMoveEvent?i.handleMoveEvent:un.handleMoveEvent,this.handleUpEvent_=i.handleUpEvent?i.handleUpEvent:un.handleUpEvent,this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]};di.inherits(un,en),un.centroid=function(t){for(var i=t.length,s=0,h=0,n=0;n<i;n++)s+=t[n].clientX,h+=t[n].clientY;return[s/i,h/i]},un.prototype.isPointerDraggingEvent_=function(t){var i=t.type;return i===Ys.POINTERDOWN||i===Ys.POINTERDRAG||i===Ys.POINTERUP},un.prototype.updateTrackedPointers_=function(t){if(this.isPointerDraggingEvent_(t)){var i=t.pointerEvent,s=i.pointerId.toString();t.type==Ys.POINTERUP?delete this.trackedPointers_[s]:(t.type==Ys.POINTERDOWN||s in this.trackedPointers_)&&(this.trackedPointers_[s]=i),this.targetPointers=Si.getValues(this.trackedPointers_)}},un.handleDragEvent=di.nullFunction,un.handleUpEvent=as.FALSE,un.handleDownEvent=as.FALSE,un.handleMoveEvent=di.nullFunction,un.handleEvent=function(t){if(!(t instanceof Hs))return!0;var i=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Ys.POINTERDRAG)this.handleDragEvent_(t);else if(t.type==Ys.POINTERUP){var s=this.handleUpEvent_(t);this.handlingDownUpSequence=s&&this.targetPointers.length>0}}else if(t.type==Ys.POINTERDOWN){var h=this.handleDownEvent_(t);this.handlingDownUpSequence=h,i=this.shouldStopEvent(h)}else t.type==Ys.POINTERMOVE&&this.handleMoveEvent_(t);return!i},un.prototype.shouldStopEvent=function(t){return t};var fn=function(t){un.call(this,{handleDownEvent:fn.handleDownEvent_,handleDragEvent:fn.handleDragEvent_,handleUpEvent:fn.handleUpEvent_});var i=t||{};this.kinetic_=i.kinetic,this.lastCentroid=null,this.condition_=i.condition?i.condition:an.noModifierKeys,this.noKinetic_=!1};di.inherits(fn,un),fn.handleDragEvent_=function(t){var i=this.targetPointers,s=un.centroid(i);if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){var h=this.lastCentroid[0]-s[0],n=s[1]-this.lastCentroid[1],r=t.map.getView(),e=r.getState(),o=[h,n];wh.scale(o,e.resolution),wh.rotate(o,e.rotation),wh.add(o,e.center),o=r.constrainCenter(o),r.setCenter(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=i.length},fn.handleUpEvent_=function(t){var i=t.map,s=i.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var h=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=s.getCenter(),e=i.getPixelFromCoordinate(r),o=i.getCoordinateFromPixel([e[0]-h*Math.cos(n),e[1]-h*Math.sin(n)]);s.animate({center:s.constrainCenter(o),duration:500,easing:yh.easeOut})}return s.setHint(1,-1),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},fn.handleDownEvent_=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var i=t.map.getView();return this.lastCentroid=null,this.handlingDownUpSequence||i.setHint(1,1),i.getAnimating()&&i.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},fn.prototype.shouldStopEvent=as.FALSE;var cn=function(t){var i=t||{};un.call(this,{handleDownEvent:cn.handleDownEvent_,handleDragEvent:cn.handleDragEvent_,handleUpEvent:cn.handleUpEvent_}),this.condition_=i.condition?i.condition:an.altShiftKeysOnly,this.lastAngle_=void 0,this.duration_=void 0!==i.duration?i.duration:250};di.inherits(cn,un),cn.handleDragEvent_=function(t){if(an.mouseOnly(t)){var i=t.map,s=i.getView();if(s.getConstraints().rotation!==Mh.disable){var h=i.getSize(),n=t.pixel,r=Math.atan2(h[1]/2-n[1],n[0]-h[0]/2);if(void 0!==this.lastAngle_){var e=r-this.lastAngle_,o=s.getRotation();en.rotateWithoutConstraints(s,o-e)}this.lastAngle_=r}}},cn.handleUpEvent_=function(t){if(!an.mouseOnly(t))return!0;var i=t.map.getView();i.setHint(1,-1);var s=i.getRotation();return en.rotate(i,s,void 0,this.duration_),!1},cn.handleDownEvent_=function(t){return!(!an.mouseOnly(t)||!an.mouseActionButton(t)||!this.condition_(t)||(t.map.getView().setHint(1,1),this.lastAngle_=void 0,0))},cn.prototype.shouldStopEvent=as.FALSE;var ln=function(t){this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null};di.inherits(ln,Ai),ln.prototype.disposeInternal=function(){this.setMap(null)},ln.prototype.render_=function(){var t=this.startPixel_,i=this.endPixel_,s="px",h=this.element_.style;h.left=Math.min(t[0],i[0])+s,h.top=Math.min(t[1],i[1])+s,h.width=Math.abs(i[0]-t[0])+s,h.height=Math.abs(i[1]-t[1])+s},ln.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var i=this.element_.style;i.left=i.top=i.width=i.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},ln.prototype.setPixels=function(t,i){this.startPixel_=t,this.endPixel_=i,this.createOrUpdateGeometry(),this.render_()},ln.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,i=this.endPixel_,s=[t,[t[0],i[1]],i,[i[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new Is([s])},ln.prototype.getGeometry=function(){return this.geometry_};var vn=function(t){un.call(this,{handleDownEvent:vn.handleDownEvent_,handleDragEvent:vn.handleDragEvent_,handleUpEvent:vn.handleUpEvent_});var i=t||{};this.box_=new ln(i.className||"ol-dragbox"),this.minArea_=void 0!==i.minArea?i.minArea:64,this.startPixel_=null,this.condition_=i.condition?i.condition:an.always,this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:vn.defaultBoxEndCondition};di.inherits(vn,un),vn.defaultBoxEndCondition=function(t,i,s){var h=s[0]-i[0],n=s[1]-i[1];return h*h+n*n>=this.minArea_},vn.handleDragEvent_=function(t){an.mouseOnly(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new vn.Event(vn.EventType_.BOXDRAG,t.coordinate,t)))},vn.prototype.getGeometry=function(){return this.box_.getGeometry()},vn.prototype.onBoxEnd=di.nullFunction,vn.handleUpEvent_=function(t){return!an.mouseOnly(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new vn.Event(vn.EventType_.BOXEND,t.coordinate,t))),!1)},vn.handleDownEvent_=function(t){return!(!an.mouseOnly(t)||!an.mouseActionButton(t)||!this.condition_(t)||(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new vn.Event(vn.EventType_.BOXSTART,t.coordinate,t)),0))},vn.EventType_={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"},vn.Event=function(t,i,s){ki.call(this,t),this.coordinate=i,this.mapBrowserEvent=s},di.inherits(vn.Event,ki);var dn=function(t){var i=t||{},s=i.condition?i.condition:an.shiftKeyOnly;this.duration_=void 0!==i.duration?i.duration:200,this.out_=void 0!==i.out&&i.out,vn.call(this,{condition:s,className:i.className||"ol-dragzoom"})};di.inherits(dn,vn),dn.prototype.onBoxEnd=function(){var t=this.getMap(),i=t.getView(),s=t.getSize(),h=this.getGeometry().getExtent();if(this.out_){var n=i.calculateExtent(s),r=rs.createOrUpdateFromCoordinates([t.getPixelFromCoordinate(rs.getBottomLeft(h)),t.getPixelFromCoordinate(rs.getTopRight(h))]),e=i.getResolutionForExtent(r,s);rs.scaleFromCenter(n,1/e),h=n}var o=i.constrainResolution(i.getResolutionForExtent(h,s)),a=rs.getCenter(h);a=i.constrainCenter(a),i.animate({resolution:o,center:a,duration:this.duration_,easing:yh.easeOut})};var Mn=function(t){en.call(this,{handleEvent:Mn.handleEvent});var i=t||{};this.defaultCondition_=function(t){return an.noModifierKeys(t)&&an.targetNotEditable(t)},this.condition_=void 0!==i.condition?i.condition:this.defaultCondition_,this.duration_=void 0!==i.duration?i.duration:100,this.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128};di.inherits(Mn,en),Mn.handleEvent=function(t){var i=!1;if(t.type==Fi){var s=t.originalEvent.keyCode;if(this.condition_(t)&&(40==s||37==s||39==s||38==s)){var h=t.map.getView(),n=h.getResolution()*this.pixelDelta_,r=0,e=0;40==s?e=-n:37==s?r=-n:39==s?r=n:e=n;var o=[r,e];wh.rotate(o,h.getRotation()),en.pan(h,o,this.duration_),t.preventDefault(),i=!0}}return!i};var mn=function(t){en.call(this,{handleEvent:mn.handleEvent});var i=t||{};this.condition_=i.condition?i.condition:an.targetNotEditable,this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:100};di.inherits(mn,en),mn.handleEvent=function(t){var i=!1;if(t.type==Fi||t.type==Ii){var s=t.originalEvent.charCode;if(this.condition_(t)&&(s=="+".charCodeAt(0)||s=="-".charCodeAt(0))){var h=t.map,n=s=="+".charCodeAt(0)?this.delta_:-this.delta_,r=h.getView();en.zoomByDelta(r,n,void 0,this.duration_),t.preventDefault(),i=!0}}return!i};var pn=function(t){en.call(this,{handleEvent:pn.handleEvent});var i=t||{};this.delta_=0,this.duration_=void 0!==i.duration?i.duration:250,this.timeout_=void 0!==i.timeout?i.timeout:80,this.useAnchor_=void 0===i.useAnchor||i.useAnchor,this.constrainResolution_=i.constrainResolution||!1,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_=void 0,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5};di.inherits(pn,en),pn.handleEvent=function(t){var i=t.type;if(i!==Vi&&i!==Wi)return!0;t.preventDefault();var s,h=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Vi?(s=n.deltaY,Ws.FIREFOX&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=Ws.DEVICE_PIXEL_RATIO),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)):t.type==Wi&&(s=-n.wheelDeltaY,Ws.SAFARI&&(s/=3)),0===s)return!1;var r=Date.now();if(void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?pn.Mode_.TRACKPAD:pn.Mode_.WHEEL),this.mode_===pn.Mode_.TRACKPAD){var e=h.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):e.setHint(1,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var o=e.getResolution()*Math.pow(2,s/this.trackpadDeltaPerZoom_),a=e.getMinResolution(),u=e.getMaxResolution(),f=0;if(o<a?(o=Math.max(o,a/this.trackpadZoomBuffer_),f=1):o>u&&(o=Math.min(o,u*this.trackpadZoomBuffer_),f=-1),this.lastAnchor_){var c=e.calculateCenterZoom(o,this.lastAnchor_);e.setCenter(e.constrainCenter(c))}return e.setResolution(o),0===f&&this.constrainResolution_&&e.animate({resolution:e.constrainResolution(o,s>0?-1:1),easing:yh.easeOut,anchor:this.lastAnchor_,duration:this.duration_}),f>0?e.animate({resolution:a,easing:yh.easeOut,anchor:this.lastAnchor_,duration:500}):f<0&&e.animate({resolution:u,easing:yh.easeOut,anchor:this.lastAnchor_,duration:500}),this.startTime_=r,!1}this.delta_+=s;var l=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,h),l),!1},pn.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(1,-1)},pn.prototype.handleWheelZoom_=function(t){var i=t.getView();i.getAnimating()&&i.cancelAnimations();var s=di.MOUSEWHEELZOOM_MAXDELTA,h=Bi.clamp(this.delta_,-s,s);en.zoomByDelta(i,-h,this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},pn.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},pn.Mode_={TRACKPAD:"trackpad",WHEEL:"wheel"};var gn=function(t){un.call(this,{handleDownEvent:gn.handleDownEvent_,handleDragEvent:gn.handleDragEvent_,handleUpEvent:gn.handleUpEvent_});var i=t||{};this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==i.threshold?i.threshold:.3,this.duration_=void 0!==i.duration?i.duration:250};di.inherits(gn,un),gn.handleDragEvent_=function(t){var i=0,s=this.targetPointers[0],h=this.targetPointers[1],n=Math.atan2(h.clientY-s.clientY,h.clientX-s.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),i=r}this.lastAngle_=n;var e=t.map,o=e.getView();if(o.getConstraints().rotation!==Mh.disable){var a=e.getViewport().getBoundingClientRect(),u=un.centroid(this.targetPointers);if(u[0]-=a.left,u[1]-=a.top,this.anchor_=e.getCoordinateFromPixel(u),this.rotating_){var f=o.getRotation();e.render(),en.rotateWithoutConstraints(o,f+i,this.anchor_)}}},gn.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map.getView();if(i.setHint(1,-1),this.rotating_){var s=i.getRotation();en.rotate(i,s,this.anchor_,this.duration_)}return!1}return!0},gn.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||i.getView().setHint(1,1),!0}return!1},gn.prototype.shouldStopEvent=as.FALSE;var _n=function(t){un.call(this,{handleDownEvent:_n.handleDownEvent_,handleDragEvent:_n.handleDragEvent_,handleUpEvent:_n.handleUpEvent_});var i=t||{};this.constrainResolution_=i.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==i.duration?i.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1};di.inherits(_n,un),_n.handleDragEvent_=function(t){var i=1,s=this.targetPointers[0],h=this.targetPointers[1],n=s.clientX-h.clientX,r=s.clientY-h.clientY,e=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(i=this.lastDistance_/e),this.lastDistance_=e;var o=t.map,a=o.getView(),u=a.getResolution(),f=a.getMaxResolution(),c=a.getMinResolution(),l=u*i;l>f?(i=f/u,l=f):l<c&&(i=c/u,l=c),1!=i&&(this.lastScaleDelta_=i);var v=o.getViewport().getBoundingClientRect(),d=un.centroid(this.targetPointers);d[0]-=v.left,d[1]-=v.top,this.anchor_=o.getCoordinateFromPixel(d),o.render(),en.zoomWithoutConstraints(a,l,this.anchor_)},_n.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map.getView();i.setHint(1,-1);var s=i.getResolution();return(this.constrainResolution_||s<i.getMinResolution()||s>i.getMaxResolution())&&en.zoom(i,s,this.anchor_,this.duration_,this.lastScaleDelta_-1),!1}return!0},_n.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||i.getView().setHint(1,1),!0}return!1},_n.prototype.shouldStopEvent=as.FALSE;var wn=function(t){var i=t||{},s=new Xs,h=new nn(-.005,.05,100);return(void 0===i.altShiftDragRotate||i.altShiftDragRotate)&&s.push(new cn),(void 0===i.doubleClickZoom||i.doubleClickZoom)&&s.push(new on({delta:i.zoomDelta,duration:i.zoomDuration})),(void 0===i.dragPan||i.dragPan)&&s.push(new fn({kinetic:h})),(void 0===i.pinchRotate||i.pinchRotate)&&s.push(new gn),(void 0===i.pinchZoom||i.pinchZoom)&&s.push(new _n({constrainResolution:i.constrainResolution,duration:i.zoomDuration})),(void 0===i.keyboard||i.keyboard)&&(s.push(new Mn),s.push(new mn({delta:i.zoomDelta,duration:i.zoomDuration}))),(void 0===i.mouseWheelZoom||i.mouseWheelZoom)&&s.push(new pn({constrainResolution:i.constrainResolution,duration:i.zoomDuration})),(void 0===i.shiftDragZoom||i.shiftDragZoom)&&s.push(new dn({duration:i.zoomDuration})),s},yn=function(t,i,s,h){Ni.call(this),this.extent=t,this.pixelRatio_=s,this.resolution=i,this.state=h};di.inherits(yn,Ni),yn.prototype.changed=function(){this.dispatchEvent(Ri)},yn.prototype.getExtent=function(){return this.extent},yn.prototype.getImage=function(){},yn.prototype.getPixelRatio=function(){return this.pixelRatio_},yn.prototype.getResolution=function(){return this.resolution},yn.prototype.getState=function(){return this.state},yn.prototype.load=function(){};var bn=function(t,i,s,h,n){this.loader_=void 0!==n?n:null,yn.call(this,t,i,s,void 0!==n?0:2),this.canvas_=h,this.error_=null};di.inherits(bn,yn),bn.prototype.getError=function(){return this.error_},bn.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=3):this.state=2,this.changed()},bn.prototype.load=function(){0==this.state&&(this.state=1,this.changed(),this.loader_(this.handleLoad_.bind(this)))},bn.prototype.getImage=function(){return this.canvas_};var xn="IMAGE",En="TILE",Cn="VECTOR",Sn=function(t,i,s,h,n){ki.call(this,t),this.vectorContext=i,this.frameState=s,this.context=h,this.glContext=n};di.inherits(Sn,ki);var zn=function(t){Ni.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null};di.inherits(zn,Ni),zn.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},zn.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Pi)},zn.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},zn.prototype.forEach=function(t,i){for(var s=this.oldest_;s;)t.call(i,s.value_,s.key_,this),s=s.newer},zn.prototype.get=function(t){var i=this.entries_[t];return qi(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},zn.prototype.remove=function(t){var i=this.entries_[t];return qi(void 0!==i,15),i===this.newest_?(this.newest_=i.older,this.newest_&&(this.newest_.newer=null)):i===this.oldest_?(this.oldest_=i.newer,this.oldest_&&(this.oldest_.older=null)):(i.newer.older=i.older,i.older.newer=i.newer),delete this.entries_[t],--this.count_,i.value_},zn.prototype.getCount=function(){return this.count_},zn.prototype.getKeys=function(){var t,i=new Array(this.count_),s=0;for(t=this.newest_;t;t=t.older)i[s++]=t.key_;return i},zn.prototype.getValues=function(){var t,i=new Array(this.count_),s=0;for(t=this.newest_;t;t=t.older)i[s++]=t.value_;return i},zn.prototype.peekLast=function(){return this.oldest_.value_},zn.prototype.peekLastKey=function(){return this.oldest_.key_},zn.prototype.peekFirstKey=function(){return this.newest_.key_},zn.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},zn.prototype.replace=function(t,i){this.get(t),this.entries_[t].value_=i},zn.prototype.set=function(t,i){qi(!(t in this.entries_),16);var s={key_:t,newer:null,older:this.newest_,value_:i};this.newest_?this.newest_.newer=s:this.oldest_=s,this.newest_=s,this.entries_[t]=s,++this.count_},zn.prototype.prune=function(){for(;this.canExpireCache();)this.pop()};var An,kn,Nn={defaultFont:"10px sans-serif",defaultFillStyle:[0,0,0,1],defaultLineCap:"round",defaultLineDash:[],defaultLineDashOffset:0,defaultLineJoin:"round",defaultMiterLimit:10,defaultStrokeStyle:[0,0,0,1],defaultTextAlign:"center",defaultTextBaseline:"middle",defaultPadding:[0,0,0,0],defaultLineWidth:1};Nn.labelCache=new zn,Nn.checkedFonts_={},Nn.measureContext_=null,Nn.textHeights_={},Nn.checkFont=function(){var t,i,s=Nn.checkedFonts_,h=Nn.labelCache,n="wmytzilWMYTZIL@#/&?$%10";function r(t){var s=Nn.getMeasureContext();s.font="32px monospace",i=s.measureText(n).width;var h=!0;return"monospace"!=t&&(s.font="32px "+t+",monospace",h=s.measureText(n).width!=i),h}function e(){var i=!0;for(var n in s)s[n]<60&&(r(n)?(s[n]=60,Si.clear(Nn.textHeights_),Nn.measureContext_=null,h.clear()):(++s[n],i=!1));i&&(window.clearInterval(t),t=void 0)}return function(i){var h=Hh.getFontFamilies(i);if(h)for(var n=0,o=h.length;n<o;++n){var a=h[n];a in s||(s[a]=60,r(a)||(s[a]=0,void 0===t&&(t=window.setInterval(e,32))))}}}(),Nn.getMeasureContext=function(){var t=Nn.measureContext_;return t||(t=Nn.measureContext_=xh(1,1)),t},Nn.measureTextHeight=(kn=Nn.textHeights_,function(t){var i=kn[t];return null==i&&(An||((An=document.createElement("span")).textContent="M",An.style.margin=An.style.padding="0 !important",An.style.position="absolute !important",An.style.left="-99999px !important"),An.style.font=t,document.body.appendChild(An),i=kn[t]=An.offsetHeight,document.body.removeChild(An)),i}),Nn.measureTextWidth=function(t,i){var s=Nn.getMeasureContext();return t!=s.font&&(s.font=t),s.measureText(i).width},Nn.rotateAtOffset=function(t,i,s,h){0!==i&&(t.translate(s,h),t.rotate(i),t.translate(-s,-h))},Nn.resetTransform_=ys.create(),Nn.drawImage=function(t,i,s,h,n,r,e,o,a,u,f){var c;1!=s&&(t.globalAlpha=(c=t.globalAlpha)*s),i&&t.setTransform.apply(t,i),t.drawImage(h,n,r,e,o,a,u,e*f,o*f),c&&(t.globalAlpha=c),i&&t.setTransform.apply(t,Nn.resetTransform_)};var Rn={HEX_COLOR_RE_:/^#(?:[0-9a-f]{3,4}){1,2}$/i,NAMED_COLOR_RE_:/^([a-z]*)$/i,asArray:function(t){return Array.isArray(t)?t:Rn.fromString(t)},asString:function(t){return"string"==typeof t?t:Rn.toString(t)},fromNamed:function(t){var i=document.createElement("div");i.style.color=t,document.body.appendChild(i);var s=getComputedStyle(i).color;return document.body.removeChild(i),s}};Rn.fromString=function(){var t={},i=0;return function(s){var h;if(t.hasOwnProperty(s))h=t[s];else{if(i>=1024){var n,r=0;for(n in t)0==(3&r++)&&(delete t[n],--i)}h=Rn.fromStringInternal_(s),t[s]=h,++i}return h}}(),Rn.fromStringInternal_=function(t){var i,s,h,n,r,e;if(Rn.NAMED_COLOR_RE_.exec(t)&&(t=Rn.fromNamed(t)),Rn.HEX_COLOR_RE_.exec(t)){var o,a=t.length-1;o=a<=4?1:2;var u=4===a||8===a;i=parseInt(t.substr(1+0*o,o),16),s=parseInt(t.substr(1+1*o,o),16),h=parseInt(t.substr(1+2*o,o),16),n=u?parseInt(t.substr(1+3*o,o),16):255,1==o&&(i=(i<<4)+i,s=(s<<4)+s,h=(h<<4)+h,u&&(n=(n<<4)+n)),r=[i,s,h,n/255]}else 0==t.indexOf("rgba(")?(e=t.slice(5,-1).split(",").map(Number),r=Rn.normalize(e)):0==t.indexOf("rgb(")?((e=t.slice(4,-1).split(",").map(Number)).push(1),r=Rn.normalize(e)):qi(!1,14);return r},Rn.normalize=function(t,i){var s=i||[];return s[0]=Bi.clamp(t[0]+.5|0,0,255),s[1]=Bi.clamp(t[1]+.5|0,0,255),s[2]=Bi.clamp(t[2]+.5|0,0,255),s[3]=Bi.clamp(t[3],0,1),s},Rn.toString=function(t){var i=t[0];i!=(0|i)&&(i=i+.5|0);var s=t[1];s!=(0|s)&&(s=s+.5|0);var h=t[2];return h!=(0|h)&&(h=h+.5|0),"rgba("+i+","+s+","+h+","+(void 0===t[3]?1:t[3])+")"};var Pn={asColorLike:function(t){return Pn.isColorLike(t)?t:Rn.asString(t)},isColorLike:function(t){return"string"==typeof t||t instanceof CanvasPattern||t instanceof CanvasGradient}},Tn=function(){};Tn.prototype.drawCustom=function(){},Tn.prototype.drawGeometry=function(){},Tn.prototype.setStyle=function(){},Tn.prototype.drawCircle=function(){},Tn.prototype.drawFeature=function(){},Tn.prototype.drawGeometryCollection=function(){},Tn.prototype.drawLineString=function(){},Tn.prototype.drawMultiLineString=function(){},Tn.prototype.drawMultiPoint=function(){},Tn.prototype.drawMultiPolygon=function(){},Tn.prototype.drawPoint=function(){},Tn.prototype.drawPolygon=function(){},Tn.prototype.drawText=function(){},Tn.prototype.setFillStrokeStyle=function(){},Tn.prototype.setImageStyle=function(){},Tn.prototype.setTextStyle=function(){};var On=function(t,i,s,h,n){Tn.call(this),this.context_=t,this.pixelRatio_=i,this.extent_=s,this.transform_=h,this.viewRotation_=n,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageSnapToPixel_=!1,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=ys.create()};di.inherits(On,Tn),On.prototype.drawImages_=function(t,i,s){if(this.image_){var h=us(t,i,s,2,this.transform_,this.pixelCoordinates_),n=this.context_,r=this.tmpLocalTransform_,e=n.globalAlpha;1!=this.imageOpacity_&&(n.globalAlpha=e*this.imageOpacity_);var o,a,u=this.imageRotation_;for(this.imageRotateWithView_&&(u+=this.viewRotation_),o=0,a=h.length;o<a;o+=2){var f=h[o]-this.imageAnchorX_,c=h[o+1]-this.imageAnchorY_;if(this.imageSnapToPixel_&&(f=Math.round(f),c=Math.round(c)),0!==u||1!=this.imageScale_){var l=f+this.imageAnchorX_,v=c+this.imageAnchorY_;ys.compose(r,l,v,this.imageScale_,this.imageScale_,u,-l,-v),n.setTransform.apply(n,r)}n.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,f,c,this.imageWidth_,this.imageHeight_)}0===u&&1==this.imageScale_||n.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(n.globalAlpha=e)}},On.prototype.drawText_=function(t,i,s,h){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=us(t,i,s,h,this.transform_,this.pixelCoordinates_),r=this.context_,e=this.textRotation_;for(this.textRotateWithView_&&(e+=this.viewRotation_);i<s;i+=h){var o=n[i]+this.textOffsetX_,a=n[i+1]+this.textOffsetY_;if(0!==e||1!=this.textScale_){var u=ys.compose(this.tmpLocalTransform_,o,a,this.textScale_,this.textScale_,e,-o,-a);r.setTransform.apply(r,u)}this.textStrokeState_&&r.strokeText(this.text_,o,a),this.textFillState_&&r.fillText(this.text_,o,a)}0===e&&1==this.textScale_||r.setTransform(1,0,0,1,0,0)}},On.prototype.moveToLineTo_=function(t,i,s,h,n){var r=this.context_,e=us(t,i,s,h,this.transform_,this.pixelCoordinates_);r.moveTo(e[0],e[1]);var o=e.length;n&&(o-=2);for(var a=2;a<o;a+=2)r.lineTo(e[a],e[a+1]);return n&&r.closePath(),s},On.prototype.drawRings_=function(t,i,s,h){var n,r;for(n=0,r=s.length;n<r;++n)i=this.moveToLineTo_(t,i,s[n],h,!0);return i},On.prototype.drawCircle=function(t){if(rs.intersects(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=xs.transform2D(t,this.transform_,this.pixelCoordinates_),s=i[2]-i[0],h=i[3]-i[1],n=Math.sqrt(s*s+h*h),r=this.context_;r.beginPath(),r.arc(i[0],i[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},On.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},On.prototype.drawGeometry=function(t){switch(t.getType()){case Yi:this.drawPoint(t);break;case Hi:this.drawLineString(t);break;case Zi:this.drawPolygon(t);break;case Ki:this.drawMultiPoint(t);break;case Qi:this.drawMultiLineString(t);break;case $i:this.drawMultiPolygon(t);break;case ts:this.drawGeometryCollection(t);break;case is:this.drawCircle(t)}},On.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);s&&rs.intersects(this.extent_,s.getExtent())&&(this.setStyle(i),this.drawGeometry(s))},On.prototype.drawGeometryCollection=function(t){var i,s,h=t.getGeometriesArray();for(i=0,s=h.length;i<s;++i)this.drawGeometry(h[i])},On.prototype.drawPoint=function(t){var i=t.getFlatCoordinates(),s=t.getStride();this.image_&&this.drawImages_(i,0,i.length,s),""!==this.text_&&this.drawText_(i,0,i.length,s)},On.prototype.drawMultiPoint=function(t){var i=t.getFlatCoordinates(),s=t.getStride();this.image_&&this.drawImages_(i,0,i.length,s),""!==this.text_&&this.drawText_(i,0,i.length,s)},On.prototype.drawLineString=function(t){if(rs.intersects(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,s=t.getFlatCoordinates();i.beginPath(),this.moveToLineTo_(s,0,s.length,t.getStride(),!1),i.stroke()}if(""!==this.text_){var h=t.getFlatMidpoint();this.drawText_(h,0,2,2)}}},On.prototype.drawMultiLineString=function(t){var i=t.getExtent();if(rs.intersects(this.extent_,i)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var s,h,n=this.context_,r=t.getFlatCoordinates(),e=0,o=t.getEnds(),a=t.getStride();for(n.beginPath(),s=0,h=o.length;s<h;++s)e=this.moveToLineTo_(r,e,o[s],a,!1);n.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},On.prototype.drawPolygon=function(t){if(rs.intersects(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=this.context_;i.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&i.fill(),this.strokeState_&&i.stroke()}if(""!==this.text_){var s=t.getFlatInteriorPoint();this.drawText_(s,0,2,2)}}},On.prototype.drawMultiPolygon=function(t){if(rs.intersects(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i,s,h=this.context_,n=t.getOrientedFlatCoordinates(),r=0,e=t.getEndss(),o=t.getStride();for(h.beginPath(),i=0,s=e.length;i<s;++i)r=this.drawRings_(n,r,e[i],o);this.fillState_&&h.fill(),this.strokeState_&&h.stroke()}if(""!==this.text_){var a=t.getFlatInteriorPoints();this.drawText_(a,0,a.length,2)}}},On.prototype.setContextFillState_=function(t){var i=this.context_,s=this.contextFillState_;s?s.fillStyle!=t.fillStyle&&(s.fillStyle=i.fillStyle=t.fillStyle):(i.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},On.prototype.setContextStrokeState_=function(t){var i=this.context_,s=this.contextStrokeState_;s?(s.lineCap!=t.lineCap&&(s.lineCap=i.lineCap=t.lineCap),Ws.CANVAS_LINE_DASH&&(hs.equals(s.lineDash,t.lineDash)||i.setLineDash(s.lineDash=t.lineDash),s.lineDashOffset!=t.lineDashOffset&&(s.lineDashOffset=i.lineDashOffset=t.lineDashOffset)),s.lineJoin!=t.lineJoin&&(s.lineJoin=i.lineJoin=t.lineJoin),s.lineWidth!=t.lineWidth&&(s.lineWidth=i.lineWidth=t.lineWidth),s.miterLimit!=t.miterLimit&&(s.miterLimit=i.miterLimit=t.miterLimit),s.strokeStyle!=t.strokeStyle&&(s.strokeStyle=i.strokeStyle=t.strokeStyle)):(i.lineCap=t.lineCap,Ws.CANVAS_LINE_DASH&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineJoin=t.lineJoin,i.lineWidth=t.lineWidth,i.miterLimit=t.miterLimit,i.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},On.prototype.setContextTextState_=function(t){var i=this.context_,s=this.contextTextState_,h=t.textAlign?t.textAlign:Nn.defaultTextAlign;s?(s.font!=t.font&&(s.font=i.font=t.font),s.textAlign!=h&&(s.textAlign=h),s.textBaseline!=t.textBaseline&&(s.textBaseline=i.textBaseline=t.textBaseline)):(i.font=t.font,i.textAlign=h,i.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:h,textBaseline:t.textBaseline})},On.prototype.setFillStrokeStyle=function(t,i){if(t){var s=t.getColor();this.fillState_={fillStyle:Pn.asColorLike(s||Nn.defaultFillStyle)}}else this.fillState_=null;if(i){var h=i.getColor(),n=i.getLineCap(),r=i.getLineDash(),e=i.getLineDashOffset(),o=i.getLineJoin(),a=i.getWidth(),u=i.getMiterLimit();this.strokeState_={lineCap:void 0!==n?n:Nn.defaultLineCap,lineDash:r||Nn.defaultLineDash,lineDashOffset:e||Nn.defaultLineDashOffset,lineJoin:void 0!==o?o:Nn.defaultLineJoin,lineWidth:this.pixelRatio_*(void 0!==a?a:Nn.defaultLineWidth),miterLimit:void 0!==u?u:Nn.defaultMiterLimit,strokeStyle:Pn.asColorLike(h||Nn.defaultStrokeStyle)}}else this.strokeState_=null},On.prototype.setImageStyle=function(t){if(t){var i=t.getAnchor(),s=t.getImage(1),h=t.getOrigin(),n=t.getSize();this.imageAnchorX_=i[0],this.imageAnchorY_=i[1],this.imageHeight_=n[1],this.image_=s,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=h[0],this.imageOriginY_=h[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageSnapToPixel_=t.getSnapToPixel(),this.imageWidth_=n[0]}else this.image_=null},On.prototype.setTextStyle=function(t){if(t){var i=t.getFill();if(i){var s=i.getColor();this.textFillState_={fillStyle:Pn.asColorLike(s||Nn.defaultFillStyle)}}else this.textFillState_=null;var h=t.getStroke();if(h){var n=h.getColor(),r=h.getLineCap(),e=h.getLineDash(),o=h.getLineDashOffset(),a=h.getLineJoin(),u=h.getWidth(),f=h.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:Nn.defaultLineCap,lineDash:e||Nn.defaultLineDash,lineDashOffset:o||Nn.defaultLineDashOffset,lineJoin:void 0!==a?a:Nn.defaultLineJoin,lineWidth:void 0!==u?u:Nn.defaultLineWidth,miterLimit:void 0!==f?f:Nn.defaultMiterLimit,strokeStyle:Pn.asColorLike(n||Nn.defaultStrokeStyle)}}else this.textStrokeState_=null;var c=t.getFont(),l=t.getOffsetX(),v=t.getOffsetY(),d=t.getRotateWithView(),M=t.getRotation(),m=t.getScale(),p=t.getText(),g=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==c?c:Nn.defaultFont,textAlign:void 0!==g?g:Nn.defaultTextAlign,textBaseline:void 0!==_?_:Nn.defaultTextBaseline},this.text_=void 0!==p?p:"",this.textOffsetX_=void 0!==l?this.pixelRatio_*l:0,this.textOffsetY_=void 0!==v?this.pixelRatio_*v:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==M?M:0,this.textScale_=this.pixelRatio_*(void 0!==m?m:1)}else this.text_=""};var Ln=function(t){ji.call(this),this.layer_=t};di.inherits(Ln,ji),Ln.prototype.forEachFeatureAtCoordinate=di.nullFunction,Ln.prototype.hasFeatureAtCoordinate=as.FALSE,Ln.prototype.createLoadedTileFinder=function(t,i,s){return function(h,n){return t.forEachLoadedTile(i,h,n,(function(t){s[h]||(s[h]={}),s[h][t.tileCoord.toString()]=t}))}},Ln.prototype.getLayer=function(){return this.layer_},Ln.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},Ln.prototype.loadImage=function(t){var i=t.getState();return 2!=i&&3!=i&&zi.listen(t,Ri,this.handleImageChange_,this),0==i&&(t.load(),i=t.getState()),2==i},Ln.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Oh&&this.changed()},Ln.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var s=function(t,i,s){var h=di.getUid(t).toString();h in s.usedTiles&&t.expireCache(s.viewState.projection,s.usedTiles[h])}.bind(null,i);t.postRenderFunctions.push(s)}},Ln.prototype.updateLogos=function(t,i){var s=i.getLogo();void 0!==s&&("string"==typeof s?t.logos[s]="":s&&(qi("string"==typeof s.href,44),qi("string"==typeof s.src,45),t.logos[s.src]=s.href))},Ln.prototype.updateUsedTiles=function(t,i,s,h){var n=di.getUid(i).toString(),r=s.toString();n in t?r in t[n]?t[n][r].extend(h):t[n][r]=h:(t[n]={},t[n][r]=h)},Ln.prototype.manageTilePyramid=function(t,i,s,h,n,r,e,o,a,u){var f=di.getUid(i).toString();f in t.wantedTiles||(t.wantedTiles[f]={});var c,l,v,d,M,m,p=t.wantedTiles[f],g=t.tileQueue;for(m=s.getMinZoom();m<=e;++m)for(l=s.getTileRangeForExtentAndZ(r,m,l),v=s.getResolution(m),d=l.minX;d<=l.maxX;++d)for(M=l.minY;M<=l.maxY;++M)e-m<=o?(0==(c=i.getTile(m,d,M,h,n)).getState()&&(p[c.getKey()]=!0,g.isKeyQueued(c.getKey())||g.enqueue([c,f,s.getTileCoordCenter(c.tileCoord),v])),void 0!==a&&a.call(u,c)):i.useTile(m,d,M,n)};var Fn=function(t){Ln.call(this,t),this.transform_=ys.create()};di.inherits(Fn,Ln),Fn.prototype.clip=function(t,i,s){var h=i.pixelRatio,n=i.size[0]*h,r=i.size[1]*h,e=i.viewState.rotation,o=rs.getTopLeft(s),a=rs.getTopRight(s),u=rs.getBottomRight(s),f=rs.getBottomLeft(s);ys.apply(i.coordinateToPixelTransform,o),ys.apply(i.coordinateToPixelTransform,a),ys.apply(i.coordinateToPixelTransform,u),ys.apply(i.coordinateToPixelTransform,f),t.save(),Nn.rotateAtOffset(t,-e,n/2,r/2),t.beginPath(),t.moveTo(o[0]*h,o[1]*h),t.lineTo(a[0]*h,a[1]*h),t.lineTo(u[0]*h,u[1]*h),t.lineTo(f[0]*h,f[1]*h),t.clip(),Nn.rotateAtOffset(t,e,n/2,r/2)},Fn.prototype.dispatchComposeEvent_=function(t,i,s,h){var n=this.getLayer();if(n.hasListener(t)){var r=s.size[0]*s.pixelRatio,e=s.size[1]*s.pixelRatio,o=s.viewState.rotation;Nn.rotateAtOffset(i,-o,r/2,e/2);var a=void 0!==h?h:this.getTransform(s,0),u=new On(i,s.pixelRatio,s.extent,a,s.viewState.rotation),f=new Sn(t,u,s,i,null);n.dispatchEvent(f),Nn.rotateAtOffset(i,o,r/2,e/2)}},Fn.prototype.forEachLayerAtCoordinate=function(t,i,s,h){return this.forEachFeatureAtCoordinate(t,i,0,as.TRUE,this)?s.call(h,this.getLayer(),null):void 0},Fn.prototype.postCompose=function(t,i,s,h){this.dispatchComposeEvent_(Jh,t,i,h)},Fn.prototype.preCompose=function(t,i,s){this.dispatchComposeEvent_(Zh,t,i,s)},Fn.prototype.dispatchRenderEvent=function(t,i,s){this.dispatchComposeEvent_(Kh,t,i,s)},Fn.prototype.getTransform=function(t,i){var s=t.viewState,h=t.pixelRatio,n=h/s.resolution;return ys.compose(this.transform_,h*t.size[0]/2,h*t.size[1]/2,n,-n,-s.rotation,-s.center[0]+i,-s.center[1])},Fn.prototype.composeFrame=function(){},Fn.prototype.prepareFrame=function(){};var In=function(t){Fn.call(this,t),this.coordinateToCanvasPixelTransform=ys.create(),this.hitCanvasContext_=null};di.inherits(In,Fn),In.prototype.composeFrame=function(t,i,s){this.preCompose(s,t);var h=this.getImage();if(h){var n=i.extent,r=void 0!==n&&!rs.containsExtent(n,t.extent)&&rs.intersects(n,t.extent);r&&this.clip(s,t,n);var e=this.getImageTransform(),o=s.globalAlpha;s.globalAlpha=i.opacity;var a=e[5],u=h.width*e[0],f=h.height*e[3];s.drawImage(h,0,0,+h.width,+h.height,Math.round(e[4]),Math.round(a),Math.round(u),Math.round(f)),s.globalAlpha=o,r&&s.restore()}this.postCompose(s,t,i)},In.prototype.getImage=function(){},In.prototype.getImageTransform=function(){},In.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var r=this.getLayer();return r.getSource().forEachFeatureAtCoordinate(t,i.viewState.resolution,i.viewState.rotation,s,i.skippedFeatureUids,(function(t){return h.call(n,t,r)}))},In.prototype.forEachLayerAtCoordinate=function(t,i,s,h){if(this.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==di.nullFunction)return Fn.prototype.forEachLayerAtCoordinate.apply(this,arguments);var n=ys.apply(this.coordinateToCanvasPixelTransform,t.slice());wh.scale(n,i.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=xh(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),n[0],n[1],1,1,0,0,1,1);var r=this.hitCanvasContext_.getImageData(0,0,1,1).data;return r[3]>0?s.call(h,this.getLayer(),r):void 0}};var Dn=function(t){In.call(this,t),this.image_=null,this.imageTransform_=ys.create(),this.skippedFeatures_=[],this.vectorRenderer_=null};di.inherits(Dn,In),Dn.handles=function(t,i){return t===Wh&&(i.getType()===xn||i.getType()===Cn&&"image"===i.getRenderMode())},Dn.create=function(t,i){var s=new Dn(i);if(i.getType()===Cn)for(var h=Dh.getLayerRendererPlugins(),n=0,r=h.length;n<r;++n){var e=h[n];e!==Dn&&e.handles(Wh,i)&&s.setVectorRenderer(e.create(t,i))}return s},Dn.prototype.getImage=function(){return this.image_?this.image_.getImage():null},Dn.prototype.getImageTransform=function(){return this.imageTransform_},Dn.prototype.prepareFrame=function(t,i){var s,h=t.pixelRatio,n=t.size,r=t.viewState,e=r.center,o=r.resolution,a=this.getLayer().getSource(),u=t.viewHints,f=t.extent;if(void 0!==i.extent&&(f=rs.getIntersection(f,i.extent)),!u[0]&&!u[1]&&!rs.isEmpty(f)){var c=r.projection;if(!di.ENABLE_RASTER_REPROJECTION){var l=a.getProjection();l&&(c=l)}var v=this.vectorRenderer_;if(v){var d=v.context,M=Si.assign({},t,{size:[rs.getWidth(f)/o,rs.getHeight(f)/o],viewState:Si.assign({},t.viewState,{rotation:0})}),m=Object.keys(M.skippedFeatureUids).sort();!v.prepareFrame(M,i)||!v.replayGroupChanged&&hs.equals(m,this.skippedFeatures_)||(d.canvas.width=M.size[0]*h,d.canvas.height=M.size[1]*h,v.composeFrame(M,i,d),this.image_=new bn(f,o,h,d.canvas),this.skippedFeatures_=m)}else(s=a.getImage(f,o,h,c))&&this.loadImage(s)&&(this.image_=s)}if(this.image_){var p=(s=this.image_).getExtent(),g=s.getResolution(),_=s.getPixelRatio(),w=h*g/(o*_),y=ys.compose(this.imageTransform_,h*n[0]/2,h*n[1]/2,w,w,0,_*(p[0]-e[0])/g,_*(e[1]-p[3])/g);ys.compose(this.coordinateToCanvasPixelTransform,h*n[0]/2-y[4],h*n[1]/2-y[5],h/o,-h/o,0,-e[0],-e[1]),this.updateLogos(t,a),this.renderedResolution=g*h/_}return!!this.image_},Dn.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,s,h,n):In.prototype.forEachFeatureAtCoordinate.call(this,t,i,s,h,n)},Dn.prototype.setVectorRenderer=function(t){this.vectorRenderer_=t};var Wn=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};Wn.getKey=function(t,i,s){return i+":"+t+":"+(s?Rn.asString(s):"null")},Wn.prototype.clear=function(){this.cache_={},this.cacheSize_=0},Wn.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t,i=0;for(t in this.cache_)0!=(3&i++)||this.cache_[t].hasListener()||(delete this.cache_[t],--this.cacheSize_)}},Wn.prototype.get=function(t,i,s){var h=Wn.getKey(t,i,s);return h in this.cache_?this.cache_[h]:null},Wn.prototype.set=function(t,i,s,h){var n=Wn.getKey(t,i,s);this.cache_[n]=h,++this.cacheSize_},Wn.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var Gn={};Gn.iconImageCache=new Wn;var Vn=function(t,i){Ai.call(this),this.map_=i,this.layerRenderers_={},this.layerRendererListeners_={}};di.inherits(Vn,Ai),Vn.prototype.calculateMatrices2D=function(t){var i=t.viewState,s=t.coordinateToPixelTransform,h=t.pixelToCoordinateTransform;ys.compose(s,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]),ys.invert(ys.setFromArray(h,s))},Vn.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},Vn.expireIconCache_=function(){Gn.iconImageCache.expire()},Vn.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,r,e){var o,a=i.viewState,u=a.resolution;function f(t,s){var r=di.getUid(t).toString(),e=i.layerStates[di.getUid(s)].managed;if(!(r in i.skippedFeatureUids)||e)return h.call(n,t,e?s:null)}var c=a.projection,l=t;if(c.canWrapX()){var v=c.getExtent(),d=rs.getWidth(v),M=t[0];(M<v[0]||M>v[2])&&(l=[M+d*Math.ceil((v[0]-M)/d),t[1]])}var m,p=i.layerStatesArray;for(m=p.length-1;m>=0;--m){var g=p[m],_=g.layer;if(Qh.visibleAtResolution(g,u)&&r.call(e,_)){var w=this.getLayerRenderer(_);if(_.getSource()&&(o=w.forEachFeatureAtCoordinate(_.getSource().getWrapX()?l:t,i,s,f,n)),o)return o}}},Vn.prototype.forEachLayerAtPixel=function(){},Vn.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n){return void 0!==this.forEachFeatureAtCoordinate(t,i,s,as.TRUE,this,h,n)},Vn.prototype.getLayerRenderer=function(t){var i=di.getUid(t).toString();if(i in this.layerRenderers_)return this.layerRenderers_[i];for(var s,h=Dh.getLayerRendererPlugins(),n=this.getType(),r=0,e=h.length;r<e;++r){var o=h[r];if(o.handles(n,t)){s=o.create(this,t);break}}if(!s)throw new Error("Unable to create renderer for layer: "+t.getType());return this.layerRenderers_[i]=s,this.layerRendererListeners_[i]=zi.listen(s,Ri,this.handleLayerRendererChange_,this),s},Vn.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]},Vn.prototype.getLayerRenderers=function(){return this.layerRenderers_},Vn.prototype.getMap=function(){return this.map_},Vn.prototype.getType=function(){},Vn.prototype.handleLayerRendererChange_=function(){this.map_.render()},Vn.prototype.removeLayerRendererByKey_=function(t){var i=this.layerRenderers_[t];return delete this.layerRenderers_[t],zi.unlistenByKey(this.layerRendererListeners_[t]),delete this.layerRendererListeners_[t],i},Vn.prototype.renderFrame=di.nullFunction,Vn.prototype.removeUnusedLayerRenderers_=function(t,i){var s;for(s in this.layerRenderers_)i&&s in i.layerStates||this.removeLayerRendererByKey_(s).dispose()},Vn.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(Vn.expireIconCache_)},Vn.prototype.scheduleRemoveUnusedLayerRenderers=function(t){var i;for(i in this.layerRenderers_)if(!(i in t.layerStates))return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))},Vn.sortByZIndex=function(t,i){return t.zIndex-i.zIndex};var jn=function(t,i){Vn.call(this,t,i),this.context_=xh(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=Hh.CLASS_UNSELECTABLE,t.insertBefore(this.canvas_,t.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=ys.create()};di.inherits(jn,Vn),jn.handles=function(t){return t===Wh},jn.create=function(t,i){return new jn(t,i)},jn.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap(),h=this.context_;if(s.hasListener(t)){var n=i.extent,r=i.pixelRatio,e=i.viewState.rotation,o=this.getTransform(i),a=new On(h,r,n,o,e),u=new Sn(t,a,i,h,null);s.dispatchEvent(u)}},jn.prototype.getTransform=function(t){var i=t.viewState,s=t.pixelRatio/i.resolution;return ys.compose(this.transform_,this.canvas_.width/2,this.canvas_.height/2,s,-s,-i.rotation,-i.center[0],-i.center[1])},jn.prototype.getType=function(){return Wh},jn.prototype.renderFrame=function(t){if(t){var i=this.context_,s=t.pixelRatio,h=Math.round(t.size[0]*s),n=Math.round(t.size[1]*s);this.canvas_.width!=h||this.canvas_.height!=n?(this.canvas_.width=h,this.canvas_.height=n):i.clearRect(0,0,h,n);var r=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchComposeEvent_(Zh,t);var e=t.layerStatesArray;hs.stableSort(e,Vn.sortByZIndex),r&&(i.save(),Nn.rotateAtOffset(i,r,h/2,n/2));var o,a,u,f,c=t.viewState.resolution;for(o=0,a=e.length;o<a;++o)u=this.getLayerRenderer((f=e[o]).layer),Qh.visibleAtResolution(f,c)&&f.sourceState==Oh&&u.prepareFrame(t,f)&&u.composeFrame(t,f,i);r&&i.restore(),this.dispatchComposeEvent_(Jh,t),this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},jn.prototype.forEachLayerAtPixel=function(t,i,s,h,n,r){var e,o,a=i.viewState.resolution,u=i.layerStatesArray,f=u.length,c=ys.apply(i.pixelToCoordinateTransform,t.slice());for(o=f-1;o>=0;--o){var l=u[o],v=l.layer;if(Qh.visibleAtResolution(l,a)&&n.call(r,v)&&(e=this.getLayerRenderer(v).forEachLayerAtCoordinate(c,i,s,h)))return e}};var Un=function(t,i,s,h){this.minX=t,this.maxX=i,this.minY=s,this.maxY=h};Un.createOrUpdate=function(t,i,s,h,n){return void 0!==n?(n.minX=t,n.maxX=i,n.minY=s,n.maxY=h,n):new Un(t,i,s,h)},Un.prototype.contains=function(t){return this.containsXY(t[1],t[2])},Un.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},Un.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY},Un.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},Un.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},Un.prototype.getHeight=function(){return this.maxY-this.minY+1},Un.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},Un.prototype.getWidth=function(){return this.maxX-this.minX+1},Un.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var Xn=function(t){In.call(this,t),this.context=null===this.context?null:xh(),this.renderedExtent_=null,this.renderedTiles=[],this.tmpExtent=rs.createEmpty(),this.tmpTileRange_=new Un(0,0,0,0),this.imageTransform_=ys.create(),this.zDirection=0};di.inherits(Xn,In),Xn.handles=function(t,i){return t===Wh&&i.getType()===En},Xn.create=function(t,i){return new Xn(i)},Xn.prototype.isDrawableTile_=function(t){var i=t.getState(),s=this.getLayer().getUseInterimTilesOnError();return 2==i||4==i||3==i&&!s},Xn.prototype.prepareFrame=function(t,i){var s=t.pixelRatio,h=t.size,n=t.viewState,r=n.projection,e=n.resolution,o=n.center,a=this.getLayer(),u=a.getSource(),f=u.getRevision(),c=u.getTileGridForProjection(r),l=c.getZForResolution(e,this.zDirection),v=c.getResolution(l),d=Math.round(e/v)||1,M=t.extent;if(void 0!==i.extent&&(M=rs.getIntersection(M,i.extent)),rs.isEmpty(M))return!1;var m=c.getTileRangeForExtentAndZ(M,l),p=c.getTileRangeExtent(l,m),g=u.getTilePixelRatio(s),_={};_[l]={};var w,y,b,x=this.createLoadedTileFinder(u,r,_),E=this.tmpExtent,C=this.tmpTileRange_,S=!1;for(y=m.minX;y<=m.maxX;++y)for(b=m.minY;b<=m.maxY;++b){if(3==(w=u.getTile(l,y,b,s,r)).getState()&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(S=!0):w.setState(2)),this.isDrawableTile_(w)||(w=w.getInterimTile()),this.isDrawableTile_(w)){var z=di.getUid(this);if(2==w.getState()){_[l][w.tileCoord.toString()]=w;var A=w.inTransition(z);S||!A&&-1!==this.renderedTiles.indexOf(w)||(S=!0)}if(1===w.getAlpha(z,t.time))continue}var k=c.getTileCoordChildTileRange(w.tileCoord,C,E),N=!1;k&&(N=x(l+1,k)),N||c.forEachTileCoordParentTileRange(w.tileCoord,x,null,C,E)}var R=v*s/g*d,P=t.viewHints,T=P[0]||P[1];if(!(this.renderedResolution&&Date.now()-t.time>16&&T)&&(S||!this.renderedExtent_||!rs.containsExtent(this.renderedExtent_,M)||this.renderedRevision!=f||d!=this.oversampling_||!T&&R!=this.renderedResolution)){var O=this.context;if(O){var L=u.getTilePixelSize(l,s,r),F=Math.round(m.getWidth()*L[0]/d),I=Math.round(m.getHeight()*L[1]/d),D=O.canvas;D.width!=F||D.height!=I?(this.oversampling_=d,D.width=F,D.height=I):(this.renderedExtent_&&!rs.equals(p,this.renderedExtent_)&&O.clearRect(0,0,F,I),d=this.oversampling_)}this.renderedTiles.length=0;var W,G,V,j,U,X,q,B,Y=Object.keys(_).map(Number);for(Y.sort((function(t,i){return t===l?1:i===l?-1:t>i?1:t<i?-1:0})),j=0,U=Y.length;j<U;++j)for(var H in G=u.getTilePixelSize(V=Y[j],s,r),W=c.getResolution(V)/v,q=g*u.getGutter(r),B=_[V])X=c.getTileCoordExtent((w=B[H]).getTileCoord(),E),this.drawTileImage(w,t,i,y=(X[0]-p[0])/v*g/d,b=(p[3]-X[3])/v*g/d,G[0]*W/d,G[1]*W/d,q,l===V),this.renderedTiles.push(w);this.renderedRevision=f,this.renderedResolution=v*s/g*d,this.renderedExtent_=p}var J=this.renderedResolution/e,Z=ys.compose(this.imageTransform_,s*h[0]/2,s*h[1]/2,J,J,0,(this.renderedExtent_[0]-o[0])/this.renderedResolution*s,(o[1]-this.renderedExtent_[3])/this.renderedResolution*s);return ys.compose(this.coordinateToCanvasPixelTransform,s*h[0]/2-Z[4],s*h[1]/2-Z[5],s/e,-s/e,0,-o[0],-o[1]),this.updateUsedTiles(t.usedTiles,u,l,m),this.manageTilePyramid(t,u,c,s,r,M,l,a.getPreload()),this.scheduleExpireCache(t,u),this.updateLogos(t,u),this.renderedTiles.length>0},Xn.prototype.drawTileImage=function(t,i,s,h,n,r,e,o,a){var u=t.getImage(this.getLayer());if(u){var f=di.getUid(this),c=a?t.getAlpha(f,i.time):1;1!==c||this.getLayer().getSource().getOpaque(i.viewState.projection)||this.context.clearRect(h,n,r,e);var l=c!==this.context.globalAlpha;l&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(u,o,o,u.width-2*o,u.height-2*o,h,n,r,e),l&&this.context.restore(),1!==c?i.animate=!0:a&&t.endTransition(f)}},Xn.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},Xn.prototype.getImageTransform=function(){return this.imageTransform_};var qn=e((function(t){t.exports=function(){function t(s,h,n,r,e){for(;r>n;){if(r-n>600){var o=r-n+1,a=h-n+1,u=Math.log(o),f=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*f*(o-f)/o)*(a-o/2<0?-1:1);t(s,h,Math.max(n,Math.floor(h-a*f/o+c)),Math.min(r,Math.floor(h+(o-a)*f/o+c)),e)}var l=s[h],v=n,d=r;for(i(s,n,h),e(s[r],l)>0&&i(s,n,r);v<d;){for(i(s,v,d),v++,d--;e(s[v],l)<0;)v++;for(;e(s[d],l)>0;)d--}0===e(s[n],l)?i(s,n,d):i(s,++d,r),d<=h&&(n=d+1),h<=d&&(r=d-1)}}function i(t,i,s){var h=t[i];t[i]=t[s],t[s]=h}function s(t,i){return t<i?-1:t>i?1:0}return function(i,h,n,r,e){t(i,h,n||0,r||i.length-1,e||s)}}()})),Bn=Yn;function Yn(t,i){if(!(this instanceof Yn))return new Yn(t,i);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),i&&this._initFormat(i),this.clear()}function Hn(t,i,s){if(!s)return i.indexOf(t);for(var h=0;h<i.length;h++)if(s(t,i[h]))return h;return-1}function Jn(t,i){Zn(t,0,t.children.length,i,t)}function Zn(t,i,s,h,n){n||(n=nr(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var r,e=i;e<s;e++)r=t.children[e],Kn(n,t.leaf?h(r):r);return n}function Kn(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function Qn(t,i){return t.minX-i.minX}function $n(t,i){return t.minY-i.minY}function tr(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ir(t){return t.maxX-t.minX+(t.maxY-t.minY)}function sr(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function hr(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function nr(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function rr(t,i,s,h,n){for(var r,e=[i,s];e.length;)(s=e.pop())-(i=e.pop())<=h||(r=i+Math.ceil((s-i)/h/2)*h,qn(t,r,i,s,n),e.push(i,r,r,s))}Yn.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,s=[],h=this.toBBox;if(!hr(t,i))return s;for(var n,r,e,o,a=[];i;){for(n=0,r=i.children.length;n<r;n++)e=i.children[n],hr(t,o=i.leaf?h(e):e)&&(i.leaf?s.push(e):sr(t,o)?this._all(e,s):a.push(e));i=a.pop()}return s},collides:function(t){var i=this.data,s=this.toBBox;if(!hr(t,i))return!1;for(var h,n,r,e,o=[];i;){for(h=0,n=i.children.length;h<n;h++)if(r=i.children[h],hr(t,e=i.leaf?s(r):r)){if(i.leaf||sr(t,e))return!0;o.push(r)}i=o.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0,s=t.length;i<s;i++)this.insert(t[i]);return this}var h=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===h.height)this._splitRoot(this.data,h);else{if(this.data.height<h.height){var n=this.data;this.data=h,h=n}this._insert(h,this.data.height-h.height-1,!0)}else this.data=h;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=nr([]),this},remove:function(t,i){if(!t)return this;for(var s,h,n,r,e=this.data,o=this.toBBox(t),a=[],u=[];e||a.length;){if(e||(e=a.pop(),h=a[a.length-1],s=u.pop(),r=!0),e.leaf&&-1!==(n=Hn(t,e.children,i)))return e.children.splice(n,1),a.push(e),this._condense(a),this;r||e.leaf||!sr(e,o)?h?(s++,e=h.children[s],r=!1):e=null:(a.push(e),u.push(s),s=0,h=e,e=e.children[0])}return this},toBBox:function(t){return t},compareMinX:Qn,compareMinY:$n,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,i){for(var s=[];t;)t.leaf?i.push.apply(i,t.children):s.push.apply(s,t.children),t=s.pop();return i},_build:function(t,i,s,h){var n,r=s-i+1,e=this._maxEntries;if(r<=e)return Jn(n=nr(t.slice(i,s+1)),this.toBBox),n;h||(h=Math.ceil(Math.log(r)/Math.log(e)),e=Math.ceil(r/Math.pow(e,h-1))),(n=nr([])).leaf=!1,n.height=h;var o,a,u,f,c=Math.ceil(r/e),l=c*Math.ceil(Math.sqrt(e));for(rr(t,i,s,l,this.compareMinX),o=i;o<=s;o+=l)for(rr(t,o,u=Math.min(o+l-1,s),c,this.compareMinY),a=o;a<=u;a+=c)f=Math.min(a+c-1,u),n.children.push(this._build(t,a,f,h-1));return Jn(n,this.toBBox),n},_chooseSubtree:function(t,i,s,h){for(var n,r,e,o,a,u,f,c,l,v;h.push(i),!i.leaf&&h.length-1!==s;){for(f=c=1/0,n=0,r=i.children.length;n<r;n++)a=tr(e=i.children[n]),l=t,v=e,(u=(Math.max(v.maxX,l.maxX)-Math.min(v.minX,l.minX))*(Math.max(v.maxY,l.maxY)-Math.min(v.minY,l.minY))-a)<c?(c=u,f=a<f?a:f,o=e):u===c&&a<f&&(f=a,o=e);i=o||i.children[0]}return i},_insert:function(t,i,s){var h=s?t:(0,this.toBBox)(t),n=[],r=this._chooseSubtree(h,this.data,i,n);for(r.children.push(t),Kn(r,h);i>=0&&n[i].children.length>this._maxEntries;)this._split(n,i),i--;this._adjustParentBBoxes(h,n,i)},_split:function(t,i){var s=t[i],h=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,h);var r=this._chooseSplitIndex(s,n,h),e=nr(s.children.splice(r,s.children.length-r));e.height=s.height,e.leaf=s.leaf,Jn(s,this.toBBox),Jn(e,this.toBBox),i?t[i-1].children.push(e):this._splitRoot(s,e)},_splitRoot:function(t,i){this.data=nr([t,i]),this.data.height=t.height+1,this.data.leaf=!1,Jn(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,s){var h,n,r,e,o,a,u,f,c,l,v,d,M,m;for(a=u=1/0,h=i;h<=s-i;h++)c=n=Zn(t,0,h,this.toBBox),l=r=Zn(t,h,s,this.toBBox),void 0,void 0,void 0,void 0,v=Math.max(c.minX,l.minX),d=Math.max(c.minY,l.minY),M=Math.min(c.maxX,l.maxX),m=Math.min(c.maxY,l.maxY),e=Math.max(0,M-v)*Math.max(0,m-d),o=tr(n)+tr(r),e<a?(a=e,f=h,u=o<u?o:u):e===a&&o<u&&(u=o,f=h);return f},_chooseSplitAxis:function(t,i,s){var h=t.leaf?this.compareMinX:Qn,n=t.leaf?this.compareMinY:$n;this._allDistMargin(t,i,s,h)<this._allDistMargin(t,i,s,n)&&t.children.sort(h)},_allDistMargin:function(t,i,s,h){t.children.sort(h);var n,r,e=this.toBBox,o=Zn(t,0,i,e),a=Zn(t,s-i,s,e),u=ir(o)+ir(a);for(n=i;n<s-i;n++)r=t.children[n],Kn(o,t.leaf?e(r):r),u+=ir(o);for(n=s-i-1;n>=i;n--)r=t.children[n],Kn(a,t.leaf?e(r):r),u+=ir(a);return u},_adjustParentBBoxes:function(t,i,s){for(var h=s;h>=0;h--)Kn(i[h],t)},_condense:function(t){for(var i,s=t.length-1;s>=0;s--)0===t[s].children.length?s>0?(i=t[s-1].children).splice(i.indexOf(t[s]),1):this.clear():Jn(t[s],this.toBBox)},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0])),this.compareMinY=new Function("a","b",i.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var er=function(){};er.prototype.getReplay=function(){},er.prototype.isEmpty=function(){};var or="Circle",ar="Default",ur="Image",fr="LineString",cr="Polygon",lr="Text",vr={lineString:function(t,i,s,h){var n,r=t[i],e=t[i+1],o=0;for(n=i+h;n<s;n+=h){var a=t[n],u=t[n+1];o+=Math.sqrt((a-r)*(a-r)+(u-e)*(u-e)),r=a,e=u}return o},linearRing:function(t,i,s,h){var n=vr.lineString(t,i,s,h),r=t[s-h]-t[i],e=t[s-h+1]-t[i+1];return n+Math.sqrt(r*r+e*e)}},dr=function(t,i,s,h,n,r,e,o){for(var a,u,f=[],c=t[i]>t[s-h],l=n.length,v=t[i],d=t[i+1],M=t[i+=h],m=t[i+1],p=0,g=Math.sqrt(Math.pow(M-v,2)+Math.pow(m-d,2)),_="",w=0,y=0;y<l;++y){var b=n.charAt(c?l-y-1:y),x=r(_=c?b+_:_+b)-w;w+=x;for(var E=e+x/2;i<s-h&&p+g<E;)v=M,d=m,M=t[i+=h],m=t[i+1],p+=g,g=Math.sqrt(Math.pow(M-v,2)+Math.pow(m-d,2));var C=E-p,S=Math.atan2(m-d,M-v);if(c&&(S+=S>0?-Math.PI:Math.PI),void 0!==u){var z=S-u;if(z+=z>Math.PI?-2*Math.PI:z<-Math.PI?2*Math.PI:0,Math.abs(z)>o)return null}var A=C/g,k=Bi.lerp(v,M,A),N=Bi.lerp(d,m,A);u==S?(c&&(a[0]=k,a[1]=N,a[2]=x/2),a[4]=_):(w=x,a=[k,N,x/2,S,_=b],c?f.unshift(a):f.push(a),u=S),e+=x}return f},Mr=11,mr=12,pr={};pr.ORDER=[cr,or,fr,ur,lr,ar],pr.TEXT_ALIGN={},pr.TEXT_ALIGN.left=0,pr.TEXT_ALIGN.end=0,pr.TEXT_ALIGN.center=.5,pr.TEXT_ALIGN.right=1,pr.TEXT_ALIGN.start=1,pr.TEXT_ALIGN.top=0,pr.TEXT_ALIGN.middle=.5,pr.TEXT_ALIGN.hanging=.2,pr.TEXT_ALIGN.alphabetic=.8,pr.TEXT_ALIGN.ideographic=.8,pr.TEXT_ALIGN.bottom=1;var gr=function(t,i,s,h,n,r){Tn.call(this),this.declutterTree=r,this.tmpExtent_=rs.createEmpty(),this.tolerance=t,this.maxExtent=i,this.overlaps=n,this.pixelRatio=h,this.maxLineWidth=0,this.resolution=s,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=ys.create(),this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0,this.tmpLocalTransform_=ys.create(),this.resetTransform_=ys.create()};di.inherits(gr,Tn),gr.prototype.replayTextBackground_=function(t,i,s,h,n,r,e){t.beginPath(),t.moveTo.apply(t,i),t.lineTo.apply(t,s),t.lineTo.apply(t,h),t.lineTo.apply(t,n),t.lineTo.apply(t,i),r&&(this.fillOrigin_=r[2],this.fill_(t)),e&&(this.setStrokeStyle_(t,e),t.stroke())},gr.prototype.replayImage_=function(t,i,s,h,n,r,e,o,a,u,f,c,l,v,d,M,m,p){var g=m||p,_=this.tmpLocalTransform_;i-=n*=l,s-=r*=l,v&&(i=Math.round(i),s=Math.round(s));var w,y,b,x,E=d+u>h.width?h.width-u:d,C=o+f>h.height?h.height-f:o,S=this.tmpExtent_,z=M[3]+E*l+M[1],A=M[0]+C*l+M[2],k=i-M[3],N=s-M[0];(g||0!==c)&&(w=[k,N],y=[k+z,N],b=[k+z,N+A],x=[k,N+A]);var R=null;if(0!==c){var P=i+n,T=s+r;R=ys.compose(_,P,T,1,1,c,-P,-T),rs.createOrUpdateEmpty(S),rs.extendCoordinate(S,ys.apply(_,w)),rs.extendCoordinate(S,ys.apply(_,y)),rs.extendCoordinate(S,ys.apply(_,b)),rs.extendCoordinate(S,ys.apply(_,x))}else rs.createOrUpdate(k,N,k+z,N+A,S);var O=t.canvas,L=S[0]<=O.width&&S[2]>=0&&S[1]<=O.height&&S[3]>=0;if(e){if(!L&&1==e[4])return;rs.extend(e,S);var F=L?[t,R?R.slice(0):null,a,h,u,f,E,C,i,s,l]:null;F&&g&&F.push(m,p,w,y,b,x),e.push(F)}else L&&(g&&this.replayTextBackground_(t,w,y,b,x,m,p),Nn.drawImage(t,R,a,h,u,f,E,C,i,s,l))},gr.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return 1==i?t:t.map((function(t){return t*i}))},gr.prototype.appendFlatCoordinates=function(t,i,s,h,n,r){var e=this.coordinates.length,o=this.getBufferedMaxExtent();r&&(i+=h);var a,u,f,c=[t[i],t[i+1]],l=[NaN,NaN],v=!0;for(a=i+h;a<s;a+=h)l[0]=t[a],l[1]=t[a+1],(f=rs.coordinateRelationship(o,l))!==u?(v&&(this.coordinates[e++]=c[0],this.coordinates[e++]=c[1]),this.coordinates[e++]=l[0],this.coordinates[e++]=l[1],v=!1):1===f?(this.coordinates[e++]=l[0],this.coordinates[e++]=l[1],v=!1):v=!0,c[0]=l[0],c[1]=l[1],u=f;return(n&&v||a===i+h)&&(this.coordinates[e++]=c[0],this.coordinates[e++]=c[1]),e},gr.prototype.drawCustomCoordinates_=function(t,i,s,h,n){for(var r=0,e=s.length;r<e;++r){var o=s[r],a=this.appendFlatCoordinates(t,i,o,h,!1,!1);n.push(a),i=o}return i},gr.prototype.drawCustom=function(t,i,s){this.beginGeometry(t,i);var h,n,r,e,o,a=t.getType(),u=t.getStride(),f=this.coordinates.length;if(a==$i){h=t.getOrientedFlatCoordinates(),e=[];var c=t.getEndss();o=0;for(var l=0,v=c.length;l<v;++l){var d=[];o=this.drawCustomCoordinates_(h,o,c[l],u,d),e.push(d)}this.instructions.push([4,f,e,t,s,zs.coordinatesss])}else a==Zi||a==Qi?(r=[],h=a==Zi?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),o=this.drawCustomCoordinates_(h,0,t.getEnds(),u,r),this.instructions.push([4,f,r,t,s,zs.coordinatess])):a==Hi||a==Ki?(h=t.getFlatCoordinates(),n=this.appendFlatCoordinates(h,0,h.length,u,!1,!1),this.instructions.push([4,f,n,t,s,zs.coordinates])):a==Yi&&(h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),this.instructions.push([4,f,n=this.coordinates.length,t,s]));this.endGeometry(t,i)},gr.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[0,i,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[0,i,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},gr.prototype.fill_=function(t){if(this.fillOrigin_){var i=ys.apply(this.renderedTransform_,this.fillOrigin_.slice());t.translate(i[0],i[1]),t.rotate(this.viewRotation_)}t.fill(),this.fillOrigin_&&t.setTransform.apply(t,Nn.resetTransform_)},gr.prototype.setStrokeStyle_=function(t,i){t.strokeStyle=i[1],t.lineWidth=i[2],t.lineCap=i[3],t.lineJoin=i[4],t.miterLimit=i[5],Ws.CANVAS_LINE_DASH&&(t.lineDashOffset=i[7],t.setLineDash(i[6]))},gr.prototype.renderDeclutter_=function(t,i){if(t&&t.length>5){var s=t[4];if(1==s||s==t.length-5){var h={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};if(!this.declutterTree.collides(h)){this.declutterTree.insert(h);for(var n=Nn.drawImage,r=5,e=t.length;r<e;++r){var o=t[r];o&&(o.length>11&&this.replayTextBackground_(o[0],o[13],o[14],o[15],o[16],o[11],o[12]),n.apply(void 0,o))}}t.length=5,rs.createOrUpdateEmpty(t)}}},gr.prototype.replay_=function(t,i,s,h,n,r){var e;this.pixelCoordinates_&&hs.equals(i,this.renderedTransform_)?e=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),e=us(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),ys.setFromArray(this.renderedTransform_,i));for(var o,a,u,f,c,l,v,d,M,m=!Si.isEmpty(s),p=0,g=h.length,_=0,w=0,y=0,b=null,x=null,E=this.coordinateCache_,C=this.viewRotation_,S={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:C},z=this.instructions!=h||this.overlaps?0:200;p<g;){var A,k,N,R=h[p];switch(R[0]){case 0:A=R[1],m&&s[di.getUid(A).toString()]||!A.getGeometry()?p=R[2]:void 0===r||rs.intersects(r,A.getGeometry().getExtent())?++p:p=R[2]+1;break;case 1:w>z&&(this.fill_(t),w=0),y>z&&(t.stroke(),y=0),w||y||(t.beginPath(),f=c=NaN),++p;break;case 2:var P=e[_=R[1]],T=e[_+1],O=e[_+2]-P,L=e[_+3]-T,F=Math.sqrt(O*O+L*L);t.moveTo(P+F,T),t.arc(P,T,F,0,2*Math.PI,!0),++p;break;case 3:t.closePath(),++p;break;case 4:_=R[1],o=R[2];var I=R[4],D=6==R.length?R[5]:void 0;S.geometry=R[3],S.feature=A,p in E||(E[p]=[]);var W=E[p];D?D(e,_,o,2,W):(W[0]=e[_],W[1]=e[_+1],W.length=2),I(W,S),++p;break;case 6:_=R[1],o=R[2],M=R[3],a=R[4],u=R[5],d=n?null:R[6];var G,V,j,U=R[7],X=R[8],q=R[9],B=R[10],Y=R[12],H=R[13],J=R[14],Z=R[15];for(R.length>16?(G=R[16],V=R[17],j=R[18]):(G=Nn.defaultPadding,V=j=!1),R[11]&&(Y+=C);_<o;_+=2)this.replayImage_(t,e[_],e[_+1],M,a,u,d,U,X,q,B,Y,H,J,Z,G,V?b:null,j?x:null);this.renderDeclutter_(d,A),++p;break;case 5:var K=R[1],Q=R[2],$=R[3];d=n?null:R[4];var tt=R[5],it=R[6],st=R[7],ht=R[8],nt=R[9],rt=R[10],et=R[11],ot=R[12],at=R[13],ut=R[14],ft=vr.lineString(e,K,Q,2),ct=ht(ot);if(tt||ct<=ft){var lt=dr(e,K,Q,2,ot,ht,(ft-ct)*pr.TEXT_ALIGN[this.textStates[at].textAlign],st);if(lt){var vt,dt,Mt,mt;if(rt)for(vt=0,dt=lt.length;vt<dt;++vt)Mt=this.getImage((mt=lt[vt])[4],at,"",rt),this.replayImage_(t,mt[0],mt[1],Mt,a=mt[2]+et,u=$*Mt.height+2*(.5-$)*et-nt,d,Mt.height,1,0,0,mt[3],ut,!1,Mt.width,Nn.defaultPadding,null,null);if(it)for(vt=0,dt=lt.length;vt<dt;++vt)Mt=this.getImage((mt=lt[vt])[4],at,it,""),this.replayImage_(t,mt[0],mt[1],Mt,a=mt[2],u=$*Mt.height-nt,d,Mt.height,1,0,0,mt[3],ut,!1,Mt.width,Nn.defaultPadding,null,null)}}this.renderDeclutter_(d,A),++p;break;case 7:if(void 0!==n){var pt=n(A=R[1]);if(pt)return pt}++p;break;case 8:z?w++:this.fill_(t),++p;break;case 9:for(o=R[2],v=(N=e[(_=R[1])+1])+.5|0,(l=(k=e[_])+.5|0)===f&&v===c||(t.moveTo(k,N),f=l,c=v),_+=2;_<o;_+=2)l=(k=e[_])+.5|0,v=(N=e[_+1])+.5|0,_!=o-2&&l===f&&v===c||(t.lineTo(k,N),f=l,c=v);++p;break;case 10:b=R,this.fillOrigin_=R[2],w&&(this.fill_(t),w=0,y&&(t.stroke(),y=0)),t.fillStyle=R[1],++p;break;case Mr:x=R,y&&(t.stroke(),y=0),this.setStrokeStyle_(t,R),++p;break;case mr:z?y++:t.stroke(),++p;break;default:++p}}w&&this.fill_(t),y&&t.stroke()},gr.prototype.replay=function(t,i,s,h){this.viewRotation_=s,this.replay_(t,i,h,this.instructions,void 0,void 0)},gr.prototype.replayHitDetection=function(t,i,s,h,n,r){return this.viewRotation_=s,this.replay_(t,i,h,this.hitDetectionInstructions,n,r)},gr.prototype.reverseHitDetectionInstructions=function(){var t,i=this.hitDetectionInstructions;i.reverse();var s,h,n=i.length,r=-1;for(t=0;t<n;++t)7==(h=(s=i[t])[0])?r=t:0==h&&(s[2]=t,hs.reverseSubArray(this.hitDetectionInstructions,r,t),r=-1)},gr.prototype.setFillStrokeStyle=function(t,i){var s=this.state;if(t){var h=t.getColor();s.fillStyle=Pn.asColorLike(h||Nn.defaultFillStyle)}else s.fillStyle=void 0;if(i){var n=i.getColor();s.strokeStyle=Pn.asColorLike(n||Nn.defaultStrokeStyle);var r=i.getLineCap();s.lineCap=void 0!==r?r:Nn.defaultLineCap;var e=i.getLineDash();s.lineDash=e?e.slice():Nn.defaultLineDash;var o=i.getLineDashOffset();s.lineDashOffset=o||Nn.defaultLineDashOffset;var a=i.getLineJoin();s.lineJoin=void 0!==a?a:Nn.defaultLineJoin;var u=i.getWidth();s.lineWidth=void 0!==u?u:Nn.defaultLineWidth;var f=i.getMiterLimit();s.miterLimit=void 0!==f?f:Nn.defaultMiterLimit,s.lineWidth>this.maxLineWidth&&(this.maxLineWidth=s.lineWidth,this.bufferedMaxExtent_=null)}else s.strokeStyle=void 0,s.lineCap=void 0,s.lineDash=null,s.lineDashOffset=void 0,s.lineJoin=void 0,s.lineWidth=void 0,s.miterLimit=void 0},gr.prototype.applyFill=function(t,i){var s=t.fillStyle,h=[10,s];if("string"!=typeof s){var n=i.getExtent();h.push([n[0],n[3]])}this.instructions.push(h)},gr.prototype.applyStroke=function(t){this.instructions.push([Mr,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])},gr.prototype.updateFillStyle=function(t,i,s){var h=t.fillStyle;"string"==typeof h&&t.currentFillStyle==h||(i.call(this,t,s),t.currentFillStyle=h)},gr.prototype.updateStrokeStyle=function(t,i){var s=t.strokeStyle,h=t.lineCap,n=t.lineDash,r=t.lineDashOffset,e=t.lineJoin,o=t.lineWidth,a=t.miterLimit;(t.currentStrokeStyle!=s||t.currentLineCap!=h||n!=t.currentLineDash&&!hs.equals(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=e||t.currentLineWidth!=o||t.currentMiterLimit!=a)&&(i.call(this,t),t.currentStrokeStyle=s,t.currentLineCap=h,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=e,t.currentLineWidth=o,t.currentMiterLimit=a)},gr.prototype.endGeometry=function(t,i){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var s=[7,i];this.instructions.push(s),this.hitDetectionInstructions.push(s)},gr.prototype.finish=di.nullFunction,gr.prototype.getBufferedMaxExtent=function(){return this.bufferedMaxExtent_||(this.bufferedMaxExtent_=rs.clone(this.maxExtent),this.maxLineWidth>0&&rs.buffer(this.bufferedMaxExtent_,this.resolution*(this.maxLineWidth+1)/2,this.bufferedMaxExtent_)),this.bufferedMaxExtent_};var _r=function(t,i,s,h,n,r){gr.call(this,t,i,s,h,n,r),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.snapToPixel_=void 0,this.width_=void 0};di.inherits(_r,gr),_r.prototype.drawCoordinates_=function(t,i,s,h){return this.appendFlatCoordinates(t,i,s,h,!1,!1)},_r.prototype.drawPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var s=t.getFlatCoordinates(),h=t.getStride(),n=this.coordinates.length,r=this.drawCoordinates_(s,0,s.length,h);this.instructions.push([6,n,r,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([6,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,i)}},_r.prototype.drawMultiPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var s=t.getFlatCoordinates(),h=t.getStride(),n=this.coordinates.length,r=this.drawCoordinates_(s,0,s.length,h);this.instructions.push([6,n,r,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([6,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,i)}},_r.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.snapToPixel_=void 0,this.width_=void 0},_r.prototype.setImageStyle=function(t,i){var s=t.getAnchor(),h=t.getSize(),n=t.getHitDetectionImage(1),r=t.getImage(1),e=t.getOrigin();this.anchorX_=s[0],this.anchorY_=s[1],this.declutterGroup_=i,this.hitDetectionImage_=n,this.image_=r,this.height_=h[1],this.opacity_=t.getOpacity(),this.originX_=e[0],this.originY_=e[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.snapToPixel_=t.getSnapToPixel(),this.width_=h[0]};var wr=function(t,i,s,h,n,r){gr.call(this,t,i,s,h,n,r)};di.inherits(wr,gr),wr.prototype.drawFlatCoordinates_=function(t,i,s,h){var n=[9,this.coordinates.length,this.appendFlatCoordinates(t,i,s,h,!1,!1)];return this.instructions.push(n),this.hitDetectionInstructions.push(n),s},wr.prototype.drawLineString=function(t,i){var s=this.state;if(void 0!==s.strokeStyle&&void 0!==s.lineWidth){this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[1]);var h=t.getFlatCoordinates(),n=t.getStride();this.drawFlatCoordinates_(h,0,h.length,n),this.hitDetectionInstructions.push([mr]),this.endGeometry(t,i)}},wr.prototype.drawMultiLineString=function(t,i){var s=this.state;if(void 0!==s.strokeStyle&&void 0!==s.lineWidth){this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[1]);var h,n,r=t.getEnds(),e=t.getFlatCoordinates(),o=t.getStride(),a=0;for(h=0,n=r.length;h<n;++h)a=this.drawFlatCoordinates_(e,a,r[h],o);this.hitDetectionInstructions.push([mr]),this.endGeometry(t,i)}},wr.prototype.finish=function(){var t=this.state;null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push([mr]),this.reverseHitDetectionInstructions(),this.state=null},wr.prototype.applyStroke=function(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push([mr]),t.lastStroke=this.coordinates.length),t.lastStroke=0,gr.prototype.applyStroke.call(this,t),this.instructions.push([1])};var yr=function(t,i,s,h,n,r){gr.call(this,t,i,s,h,n,r)};di.inherits(yr,gr),yr.prototype.drawFlatCoordinatess_=function(t,i,s,h){var n=this.state,r=void 0!==n.fillStyle,e=null!=n.strokeStyle,o=s.length,a=[1];this.instructions.push(a),this.hitDetectionInstructions.push(a);for(var u=0;u<o;++u){var f=s[u],c=[9,this.coordinates.length,this.appendFlatCoordinates(t,i,f,h,!0,!e)];if(this.instructions.push(c),this.hitDetectionInstructions.push(c),e){var l=[3];this.instructions.push(l),this.hitDetectionInstructions.push(l)}i=f}var v=[8];if(this.hitDetectionInstructions.push(v),r&&this.instructions.push(v),e){var d=[mr];this.instructions.push(d),this.hitDetectionInstructions.push(d)}return i},yr.prototype.drawCircle=function(t,i){var s=this.state;if(void 0!==s.fillStyle||void 0!==s.strokeStyle){this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Rn.asString(Nn.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length;this.appendFlatCoordinates(h,0,h.length,n,!1,!1);var e=[1],o=[2,r];this.instructions.push(e,o),this.hitDetectionInstructions.push(e,o);var a=[8];if(this.hitDetectionInstructions.push(a),void 0!==s.fillStyle&&this.instructions.push(a),void 0!==s.strokeStyle){var u=[mr];this.instructions.push(u),this.hitDetectionInstructions.push(u)}this.endGeometry(t,i)}},yr.prototype.drawPolygon=function(t,i){var s=this.state;this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Rn.asString(Nn.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h=t.getEnds(),n=t.getOrientedFlatCoordinates(),r=t.getStride();this.drawFlatCoordinatess_(n,0,h,r),this.endGeometry(t,i)},yr.prototype.drawMultiPolygon=function(t,i){var s=this.state;if(void 0!==s.fillStyle||void 0!==s.strokeStyle){this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Rn.asString(Nn.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Mr,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h,n,r=t.getEndss(),e=t.getOrientedFlatCoordinates(),o=t.getStride(),a=0;for(h=0,n=r.length;h<n;++h)a=this.drawFlatCoordinatess_(e,a,r[h],o);this.endGeometry(t,i)}},yr.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(0!==t){var i,s,h=this.coordinates;for(i=0,s=h.length;i<s;++i)h[i]=As.snap(h[i],t)}},yr.prototype.setFillStrokeStyles_=function(t){var i=this.state;void 0!==i.fillStyle&&this.updateFillStyle(i,this.applyFill,t),void 0!==i.strokeStyle&&this.updateStrokeStyle(i,this.applyStroke)};var br=function(t,i,s,h,n){var r,e,o,a,u,f,c,l,v,d=s,M=s,m=0,p=0,g=s;for(r=s;r<h;r+=n){var _=i[r],w=i[r+1];void 0!==a&&(l=_-a,v=w-u,o=Math.sqrt(l*l+v*v),void 0!==f&&(p+=e,Math.acos((f*l+c*v)/(e*o))>t&&(p>m&&(m=p,d=g,M=r),p=0,g=r-n)),e=o,f=l,c=v),a=_,u=w}return(p+=o)>m?[g,r]:[d,M]},xr=function(t,i,s,h,n,r){gr.call(this,t,i,s,h,n,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Nn.labelCache.prune()};di.inherits(xr,gr),xr.measureTextWidths=function(t,i,s){var h,n,r=i.length,e=0;for(n=0;n<r;++n)h=Nn.measureTextWidth(t,i[n]),e=Math.max(e,h),s.push(h);return e},xr.prototype.drawText=function(t,i){var s=this.textState_;if(""!==this.text_&&s&&(this.textFillState_||this.textStrokeState_)){var h,n,r=this.coordinates.length,e=t.getType(),o=null,a=2,u=2;if("line"===s.placement){if(!rs.intersects(this.getBufferedMaxExtent(),t.getExtent()))return;var f;if(o=t.getFlatCoordinates(),u=t.getStride(),e==Hi)f=[o.length];else if(e==Qi)f=t.getEnds();else if(e==Zi)f=t.getEnds().slice(0,1);else if(e==$i){var c=t.getEndss();for(f=[],h=0,n=c.length;h<n;++h)f.push(c[h][0])}this.beginGeometry(t,i);for(var l,v=s.textAlign,d=0,M=0,m=f.length;M<m;++M){if(null==v){var p=br(s.maxAngle,o,d,f[M],u);d=p[0],l=p[1]}else l=f[M];for(h=d;h<l;h+=u)this.coordinates.push(o[h],o[h+1]);d=f[M],this.drawChars_(r,a=this.coordinates.length,this.declutterGroup_),r=a}this.endGeometry(t,i)}else{var g=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),_=g.width/this.pixelRatio;switch(e){case Yi:case Ki:a=(o=t.getFlatCoordinates()).length;break;case Hi:o=t.getFlatMidpoint();break;case is:o=t.getCenter();break;case Qi:a=(o=t.getFlatMidpoints()).length;break;case Zi:if(o=t.getFlatInteriorPoint(),!s.overflow&&o[2]/this.resolution<_)return;u=3;break;case $i:var w=t.getFlatInteriorPoints();for(o=[],h=0,n=w.length;h<n;h+=3)(s.overflow||w[h+2]/this.resolution>=_)&&o.push(w[h],w[h+1]);if(0==(a=o.length))return}a=this.appendFlatCoordinates(o,0,a,u,!1,!1),this.beginGeometry(t,i),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),this.updateFillStyle(this.state,this.applyFill,t),this.updateStrokeStyle(this.state,this.applyStroke)),this.drawTextImage_(g,r,a),this.endGeometry(t,i)}}},xr.prototype.getImage=function(t,i,s,h){var n,r=h+i+t+s+this.pixelRatio,e=Nn.labelCache;if(!e.containsKey(r)){var o=h?this.strokeStates[h]||this.textStrokeState_:null,a=s?this.fillStates[s]||this.textFillState_:null,u=this.textStates[i]||this.textState_,f=u.scale*this.pixelRatio,c=pr.TEXT_ALIGN[u.textAlign||Nn.defaultTextAlign],l=h&&o.lineWidth?o.lineWidth:0,v=t.split("\n"),d=v.length,M=[],m=xr.measureTextWidths(u.font,v,M),p=Nn.measureTextHeight(u.font),g=p*d,_=xh(Math.ceil((m+l)*f),Math.ceil((g+l)*f));e.set(r,n=_.canvas),1!=f&&_.scale(f,f),_.font=u.font,h&&(_.strokeStyle=o.strokeStyle,_.lineWidth=l*(Ws.SAFARI?f:1),_.lineCap=o.lineCap,_.lineJoin=o.lineJoin,_.miterLimit=o.miterLimit,Ws.CANVAS_LINE_DASH&&o.lineDash.length&&(_.setLineDash(o.lineDash),_.lineDashOffset=o.lineDashOffset)),s&&(_.fillStyle=a.fillStyle),_.textBaseline="middle",_.textAlign="center";var w,y=.5-c,b=c*n.width/f+y*l;if(h)for(w=0;w<d;++w)_.strokeText(v[w],b+y*M[w],.5*(l+p)+w*p);if(s)for(w=0;w<d;++w)_.fillText(v[w],b+y*M[w],.5*(l+p)+w*p)}return e.get(r)},xr.prototype.drawTextImage_=function(t,i,s){var h=this.textState_,n=this.textStrokeState_,r=this.pixelRatio,e=pr.TEXT_ALIGN[h.textAlign||Nn.defaultTextAlign],o=pr.TEXT_ALIGN[h.textBaseline],a=n&&n.lineWidth?n.lineWidth:0,u=e*t.width/r+2*(.5-e)*a,f=o*t.height/r+2*(.5-o)*a;this.instructions.push([6,i,s,t,(u-this.textOffsetX_)*r,(f-this.textOffsetY_)*r,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,!0,t.width,h.padding==Nn.defaultPadding?Nn.defaultPadding:h.padding.map((function(t){return t*r})),!!h.backgroundFill,!!h.backgroundStroke]),this.hitDetectionInstructions.push([6,i,s,t,(u-this.textOffsetX_)*r,(f-this.textOffsetY_)*r,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/r,!0,t.width,h.padding,!!h.backgroundFill,!!h.backgroundStroke])},xr.prototype.drawChars_=function(t,i,s){var h=this.textStrokeState_,n=this.textState_,r=this.textFillState_,e=this.strokeKey_;h&&(e in this.strokeStates||(this.strokeStates[e]={strokeStyle:h.strokeStyle,lineCap:h.lineCap,lineDashOffset:h.lineDashOffset,lineWidth:h.lineWidth,lineJoin:h.lineJoin,miterLimit:h.miterLimit,lineDash:h.lineDash}));var o=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||Nn.defaultTextAlign,scale:n.scale});var a=this.fillKey_;r&&(a in this.fillStates||(this.fillStates[a]={fillStyle:r.fillStyle}));var u=this.pixelRatio,f=pr.TEXT_ALIGN[n.textBaseline],c=this.textOffsetY_*u,l=this.text_,v=n.font,d=n.scale,M=h?h.lineWidth*d/2:0,m=this.widths_[v];m||(this.widths_[v]=m={}),this.instructions.push([5,t,i,f,s,n.overflow,a,n.maxAngle,function(t){var i=m[t];return i||(i=m[t]=Nn.measureTextWidth(v,t)),i*d*u},c,e,M*u,l,o,1]),this.hitDetectionInstructions.push([5,t,i,f,s,n.overflow,a,n.maxAngle,function(t){var i=m[t];return i||(i=m[t]=Nn.measureTextWidth(v,t)),i*d},c,e,M,l,o,1/u])},xr.prototype.setTextStyle=function(t,i){var s,h,n;if(t){this.declutterGroup_=i;var r=t.getFill();r?((h=this.textFillState_)||(h=this.textFillState_={}),h.fillStyle=Pn.asColorLike(r.getColor()||Nn.defaultFillStyle)):h=this.textFillState_=null;var e=t.getStroke();if(e){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var o=e.getLineDash(),a=e.getLineDashOffset(),u=e.getWidth(),f=e.getMiterLimit();n.lineCap=e.getLineCap()||Nn.defaultLineCap,n.lineDash=o?o.slice():Nn.defaultLineDash,n.lineDashOffset=void 0===a?Nn.defaultLineDashOffset:a,n.lineJoin=e.getLineJoin()||Nn.defaultLineJoin,n.lineWidth=void 0===u?Nn.defaultLineWidth:u,n.miterLimit=void 0===f?Nn.defaultMiterLimit:f,n.strokeStyle=Pn.asColorLike(e.getColor()||Nn.defaultStrokeStyle)}else n=this.textStrokeState_=null;s=this.textState_;var c=t.getFont()||Nn.defaultFont;Nn.checkFont(c);var l=t.getScale();s.overflow=t.getOverflow(),s.font=c,s.maxAngle=t.getMaxAngle(),s.placement=t.getPlacement(),s.textAlign=t.getTextAlign(),s.textBaseline=t.getTextBaseline()||Nn.defaultTextBaseline,s.backgroundFill=t.getBackgroundFill(),s.backgroundStroke=t.getBackgroundStroke(),s.padding=t.getPadding()||Nn.defaultPadding,s.scale=void 0===l?1:l;var v=t.getOffsetX(),d=t.getOffsetY(),M=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===v?0:v,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==M&&M,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:di.getUid(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=s.font+s.scale+(s.textAlign||"?"),this.fillKey_=h?"string"==typeof h.fillStyle?h.fillStyle:"|"+di.getUid(h.fillStyle):""}else this.text_=""};var Er=function(t,i,s,h,n,r,e){er.call(this),this.declutterTree_=r,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=n,this.pixelRatio_=h,this.resolution_=s,this.renderBuffer_=e,this.replaysByZIndex_={},this.hitDetectionContext_=xh(1,1),this.hitDetectionTransform_=ys.create()};di.inherits(Er,er),Er.circleArrayCache_={0:[[!0]]},Er.fillCircleArrayRowToMiddle_=function(t,i,s){var h,n=Math.floor(t.length/2);if(i>=n)for(h=n;h<i;h++)t[h][s]=!0;else if(i<n)for(h=i+1;h<n;h++)t[h][s]=!0},Er.getCircleArray_=function(t){if(void 0!==Er.circleArrayCache_[t])return Er.circleArrayCache_[t];for(var i=2*t+1,s=new Array(i),h=0;h<i;h++)s[h]=new Array(i);for(var n=t,r=0,e=0;n>=r;)Er.fillCircleArrayRowToMiddle_(s,t+n,t+r),Er.fillCircleArrayRowToMiddle_(s,t+r,t+n),Er.fillCircleArrayRowToMiddle_(s,t-r,t+n),Er.fillCircleArrayRowToMiddle_(s,t-n,t+r),Er.fillCircleArrayRowToMiddle_(s,t-n,t-r),Er.fillCircleArrayRowToMiddle_(s,t-r,t-n),Er.fillCircleArrayRowToMiddle_(s,t+r,t-n),Er.fillCircleArrayRowToMiddle_(s,t+n,t-r),2*((e+=1+2*++r)-n)+1>0&&(e+=1-2*(n-=1));return Er.circleArrayCache_[t]=s,s},Er.replayDeclutter=function(t,i,s){for(var h=Object.keys(t).map(Number).sort(hs.numberSafeCompareFunction),n={},r=0,e=h.length;r<e;++r)for(var o=t[h[r].toString()],a=0,u=o.length;a<u;){var f=o[a++],c=o[a++];f.replay(i,c,s,n)}},Er.prototype.addDeclutter=function(t){var i=null;return this.declutterTree_&&(t?(i=this.declutterGroup_)[4]++:(i=this.declutterGroup_=rs.createEmpty()).push(1)),i},Er.prototype.clip=function(t,i){var s=this.getClipCoords(i);t.beginPath(),t.moveTo(s[0],s[1]),t.lineTo(s[2],s[3]),t.lineTo(s[4],s[5]),t.lineTo(s[6],s[7]),t.clip()},Er.prototype.hasReplays=function(t){for(var i in this.replaysByZIndex_)for(var s=this.replaysByZIndex_[i],h=0,n=t.length;h<n;++h)if(t[h]in s)return!0;return!1},Er.prototype.finish=function(){var t;for(t in this.replaysByZIndex_){var i,s=this.replaysByZIndex_[t];for(i in s)s[i].finish()}},Er.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,r,e){var o,a=2*(h=Math.round(h))+1,u=ys.compose(this.hitDetectionTransform_,h+.5,h+.5,1/i,-1/i,-s,-t[0],-t[1]),f=this.hitDetectionContext_;f.canvas.width!==a||f.canvas.height!==a?(f.canvas.width=a,f.canvas.height=a):f.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(o=rs.createEmpty(),rs.extendCoordinate(o,t),rs.buffer(o,i*(this.renderBuffer_+h),o));var c,l,v=Er.getCircleArray_(h);function d(t){for(var i=f.getImageData(0,0,a,a).data,s=0;s<a;s++)for(var h=0;h<a;h++){var n;if(v[s][h]&&i[4*(h*a+s)+3]>0)return(!c||l!=ur&&l!=lr||-1!==c.indexOf(t))&&(n=r(t)),n||void f.clearRect(0,0,a,a)}}this.declutterTree_&&(c=this.declutterTree_.all().map((function(t){return t.value})));var M,m,p,g,_,w=Object.keys(this.replaysByZIndex_).map(Number);for(w.sort(hs.numberSafeCompareFunction),M=w.length-1;M>=0;--M){var y=w[M].toString();for(p=this.replaysByZIndex_[y],m=pr.ORDER.length-1;m>=0;--m)if(void 0!==(g=p[l=pr.ORDER[m]]))if(!e||l!=ur&&l!=lr){if(_=g.replayHitDetection(f,u,s,n,d,o))return _}else{var b=e[y];b?b.push(g,u.slice(0)):e[y]=[g,u.slice(0)]}}},Er.prototype.getClipCoords=function(t){var i=this.maxExtent_,s=i[0],h=i[1],n=i[2],r=i[3],e=[s,h,s,r,n,r,n,h];return us(e,0,8,2,t,e),e},Er.prototype.getReplay=function(t,i){var s=void 0!==t?t.toString():"0",h=this.replaysByZIndex_[s];void 0===h&&(this.replaysByZIndex_[s]=h={});var n=h[i];return void 0===n&&(n=new(0,Er.BATCH_CONSTRUCTORS_[i])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),h[i]=n),n},Er.prototype.getReplays=function(){return this.replaysByZIndex_},Er.prototype.isEmpty=function(){return Si.isEmpty(this.replaysByZIndex_)},Er.prototype.replay=function(t,i,s,h,n,r){var e=Object.keys(this.replaysByZIndex_).map(Number);e.sort(hs.numberSafeCompareFunction),t.save(),this.clip(t,i);var o,a,u,f,c,l,v=n||pr.ORDER;for(o=0,a=e.length;o<a;++o){var d=e[o].toString();for(c=this.replaysByZIndex_[d],u=0,f=v.length;u<f;++u){var M=v[u];if(void 0!==(l=c[M]))if(!r||M!=ur&&M!=lr)l.replay(t,i,s,h);else{var m=r[d];m?m.push(l,i.slice(0)):r[d]=[l,i.slice(0)]}}}t.restore()},Er.BATCH_CONSTRUCTORS_={Circle:yr,Default:gr,Image:_r,LineString:wr,Polygon:yr,Text:xr};var Cr={defaultOrder:function(t,i){return di.getUid(t)-di.getUid(i)},getSquaredTolerance:function(t,i){var s=Cr.getTolerance(t,i);return s*s},getTolerance:function(t,i){return di.SIMPLIFY_TOLERANCE*t/i},renderCircleGeometry_:function(t,i,s,h){var n=s.getFill(),r=s.getStroke();if(n||r){var e=t.getReplay(s.getZIndex(),or);e.setFillStrokeStyle(n,r),e.drawCircle(i,h)}var o=s.getText();if(o){var a=t.getReplay(s.getZIndex(),lr);a.setTextStyle(o,t.addDeclutter(!1)),a.drawText(i,h)}},renderFeature:function(t,i,s,h,n,r){var e,o,a=!1;return(e=s.getImage())&&(2==(o=e.getImageState())||3==o?e.unlistenImageChange(n,r):(0==o&&e.load(),o=e.getImageState(),e.listenImageChange(n,r),a=!0)),Cr.renderFeature_(t,i,s,h),a},renderFeature_:function(t,i,s,h){var n=s.getGeometryFunction()(i);if(n){var r=n.getSimplifiedGeometry(h);s.getRenderer()?Cr.renderGeometry_(t,r,s,i):(0,Cr.GEOMETRY_RENDERERS_[r.getType()])(t,r,s,i)}},renderGeometry_:function(t,i,s,h){if(i.getType()!=ts)t.getReplay(s.getZIndex(),ar).drawCustom(i,h,s.getRenderer());else for(var n=i.getGeometries(),r=0,e=n.length;r<e;++r)Cr.renderGeometry_(t,n[r],s,h)},renderGeometryCollectionGeometry_:function(t,i,s,h){var n,r,e=i.getGeometriesArray();for(n=0,r=e.length;n<r;++n)(0,Cr.GEOMETRY_RENDERERS_[e[n].getType()])(t,e[n],s,h)},renderLineStringGeometry_:function(t,i,s,h){var n=s.getStroke();if(n){var r=t.getReplay(s.getZIndex(),fr);r.setFillStrokeStyle(null,n),r.drawLineString(i,h)}var e=s.getText();if(e){var o=t.getReplay(s.getZIndex(),lr);o.setTextStyle(e,t.addDeclutter(!1)),o.drawText(i,h)}},renderMultiLineStringGeometry_:function(t,i,s,h){var n=s.getStroke();if(n){var r=t.getReplay(s.getZIndex(),fr);r.setFillStrokeStyle(null,n),r.drawMultiLineString(i,h)}var e=s.getText();if(e){var o=t.getReplay(s.getZIndex(),lr);o.setTextStyle(e,t.addDeclutter(!1)),o.drawText(i,h)}},renderMultiPolygonGeometry_:function(t,i,s,h){var n=s.getFill(),r=s.getStroke();if(r||n){var e=t.getReplay(s.getZIndex(),cr);e.setFillStrokeStyle(n,r),e.drawMultiPolygon(i,h)}var o=s.getText();if(o){var a=t.getReplay(s.getZIndex(),lr);a.setTextStyle(o,t.addDeclutter(!1)),a.drawText(i,h)}},renderPointGeometry_:function(t,i,s,h){var n=s.getImage();if(n){if(2!=n.getImageState())return;var r=t.getReplay(s.getZIndex(),ur);r.setImageStyle(n,t.addDeclutter(!1)),r.drawPoint(i,h)}var e=s.getText();if(e){var o=t.getReplay(s.getZIndex(),lr);o.setTextStyle(e,t.addDeclutter(!!n)),o.drawText(i,h)}},renderMultiPointGeometry_:function(t,i,s,h){var n=s.getImage();if(n){if(2!=n.getImageState())return;var r=t.getReplay(s.getZIndex(),ur);r.setImageStyle(n,t.addDeclutter(!1)),r.drawMultiPoint(i,h)}var e=s.getText();if(e){var o=t.getReplay(s.getZIndex(),lr);o.setTextStyle(e,t.addDeclutter(!!n)),o.drawText(i,h)}},renderPolygonGeometry_:function(t,i,s,h){var n=s.getFill(),r=s.getStroke();if(n||r){var e=t.getReplay(s.getZIndex(),cr);e.setFillStrokeStyle(n,r),e.drawPolygon(i,h)}var o=s.getText();if(o){var a=t.getReplay(s.getZIndex(),lr);a.setTextStyle(o,t.addDeclutter(!1)),a.drawText(i,h)}}};Cr.GEOMETRY_RENDERERS_={Point:Cr.renderPointGeometry_,LineString:Cr.renderLineStringGeometry_,Polygon:Cr.renderPolygonGeometry_,MultiPoint:Cr.renderMultiPointGeometry_,MultiLineString:Cr.renderMultiLineStringGeometry_,MultiPolygon:Cr.renderMultiPolygonGeometry_,GeometryCollection:Cr.renderGeometryCollectionGeometry_,Circle:Cr.renderCircleGeometry_};var Sr=function(t){Fn.call(this,t),this.declutterTree_=t.getDeclutter()?Bn(9):null,this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=rs.createEmpty(),this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.context=xh(),zi.listen(Nn.labelCache,Pi,this.handleFontsChanged_,this)};di.inherits(Sr,Fn),Sr.handles=function(t,i){return t===Wh&&i.getType()===Cn},Sr.create=function(t,i){return new Sr(i)},Sr.prototype.disposeInternal=function(){zi.unlisten(Nn.labelCache,Pi,this.handleFontsChanged_,this),Fn.prototype.disposeInternal.call(this)},Sr.prototype.composeFrame=function(t,i,s){var h=t.extent,n=t.pixelRatio,r=i.managed?t.skippedFeatureUids:{},e=t.viewState,o=e.projection,a=e.rotation,u=o.getExtent(),f=this.getLayer().getSource(),c=this.getTransform(t,0);this.preCompose(s,t,c);var l=i.extent,v=void 0!==l;v&&this.clip(s,t,l);var d=this.replayGroup_;if(d&&!d.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var M,m=this.getLayer(),p=0,g=0,_=1!==i.opacity,w=m.hasListener(Kh);if(_||w){var y=s.canvas.width,b=s.canvas.height;if(a){var x=Math.round(Math.sqrt(y*y+b*b));p=(x-y)/2,g=(x-b)/2,y=b=x}this.context.canvas.width=y,this.context.canvas.height=b,M=this.context}else M=s;var E=M.globalAlpha;_||(M.globalAlpha=i.opacity),M!=s&&M.translate(p,g);var C=t.size[0]*n,S=t.size[1]*n;if(Nn.rotateAtOffset(M,-a,C/2,S/2),d.replay(M,c,a,r),f.getWrapX()&&o.canWrapX()&&!rs.containsExtent(u,h)){for(var z=h[0],A=rs.getWidth(u),k=0;z<u[0];)--k,c=this.getTransform(t,A*k),d.replay(M,c,a,r),z+=A;for(k=0,z=h[2];z>u[2];)++k,c=this.getTransform(t,A*k),d.replay(M,c,a,r),z-=A;c=this.getTransform(t,0)}if(Nn.rotateAtOffset(M,a,C/2,S/2),M!=s){if(w&&this.dispatchRenderEvent(M,t,c),_){var N=s.globalAlpha;s.globalAlpha=i.opacity,s.drawImage(M.canvas,-p,-g),s.globalAlpha=N}else s.drawImage(M.canvas,-p,-g);M.translate(-p,-g)}_||(M.globalAlpha=E)}v&&s.restore(),this.postCompose(s,t,i,c)},Sr.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){if(this.replayGroup_){var r=i.viewState.resolution,e=i.viewState.rotation,o=this.getLayer(),a={};return this.replayGroup_.forEachFeatureAtCoordinate(t,r,e,s,{},(function(t){var i=di.getUid(t).toString();if(!(i in a))return a[i]=!0,h.call(n,t,o)}),null)}},Sr.prototype.handleFontsChanged_=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},Sr.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Sr.prototype.prepareFrame=function(t){var i=this.getLayer(),s=i.getSource();this.updateLogos(t,s);var h=t.viewHints[0],n=t.viewHints[1],r=i.getUpdateWhileAnimating(),e=i.getUpdateWhileInteracting();if(!this.dirty_&&!r&&h||!e&&n)return!0;var o=t.extent,a=t.viewState,u=a.projection,f=a.resolution,c=t.pixelRatio,l=i.getRevision(),v=i.getRenderBuffer(),d=i.getRenderOrder();void 0===d&&(d=Cr.defaultOrder);var M=rs.buffer(o,v*f),m=a.projection.getExtent();if(s.getWrapX()&&a.projection.canWrapX()&&!rs.containsExtent(m,t.extent)){var p=rs.getWidth(m),g=Math.max(rs.getWidth(M)/2,p);M[0]=m[0]-g,M[2]=m[2]+g}if(!this.dirty_&&this.renderedResolution_==f&&this.renderedRevision_==l&&this.renderedRenderOrder_==d&&rs.containsExtent(this.renderedExtent_,M))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var _=new Er(Cr.getTolerance(f,c),M,f,c,s.getOverlaps(),this.declutterTree_,i.getRenderBuffer());s.loadFeatures(M,f,u);var w=function(t){var s,h=t.getStyleFunction();if(h?s=h.call(t,f):(h=i.getStyleFunction())&&(s=h(t,f)),s){var n=this.renderFeature(t,f,c,s,_);this.dirty_=this.dirty_||n}}.bind(this);if(d){var y=[];s.forEachFeatureInExtent(M,(function(t){y.push(t)}),this),y.sort(d);for(var b=0,x=y.length;b<x;++b)w(y[b])}else s.forEachFeatureInExtent(M,w,this);return _.finish(),this.renderedResolution_=f,this.renderedRevision_=l,this.renderedRenderOrder_=d,this.renderedExtent_=M,this.replayGroup_=_,this.replayGroupChanged=!0,!0},Sr.prototype.renderFeature=function(t,i,s,h,n){if(!h)return!1;var r=!1;if(Array.isArray(h))for(var e=0,o=h.length;e<o;++e)r=Cr.renderFeature(n,t,h[e],Cr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||r;else r=Cr.renderFeature(n,t,h,Cr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this);return r};var zr="vector",Ar=function(t){this.context=null,Xn.call(this,t),this.declutterTree_=t.getDeclutter()?Bn(9):null,this.dirty_=!1,this.tmpTransform_=ys.create(),this.zDirection=t.getRenderMode()==zr?1:0,zi.listen(Nn.labelCache,Pi,this.handleFontsChanged_,this)};di.inherits(Ar,Xn),Ar.handles=function(t,i){return t===Wh&&"VECTOR_TILE"===i.getType()},Ar.create=function(t,i){return new Ar(i)},Ar.IMAGE_REPLAYS={image:[cr,or,fr,ur,lr],hybrid:[cr,fr]},Ar.VECTOR_REPLAYS={image:[ar],hybrid:[ur,lr,ar],vector:pr.ORDER},Ar.prototype.disposeInternal=function(){zi.unlisten(Nn.labelCache,Pi,this.handleFontsChanged_,this),Xn.prototype.disposeInternal.call(this)},Ar.prototype.prepareFrame=function(t,i){var s=this.getLayer(),h=s.getRevision();if(this.renderedLayerRevision_!=h){this.renderedTiles.length=0;var n=s.getRenderMode();this.context||n==zr||(this.context=xh()),this.context&&n==zr&&(this.context=null)}return this.renderedLayerRevision_=h,Xn.prototype.prepareFrame.apply(this,arguments)},Ar.prototype.createReplayGroup_=function(t,i){var s=this.getLayer(),h=i.pixelRatio,n=i.viewState.projection,r=s.getRevision(),e=s.getRenderOrder()||null,o=t.getReplayState(s);if(o.dirty||o.renderedRevision!=r||o.renderedRenderOrder!=e){for(var a=s.getSource(),u=a.getTileGrid(),f=a.getTileGridForProjection(n),c=f.getResolution(t.tileCoord[0]),l=f.getTileCoordExtent(t.wrappedTileCoord),v=0,d=t.tileKeys.length;v<d;++v){var M=t.getTile(t.tileKeys[v]);if(3!=M.getState()){var m=u.getTileCoordExtent(M.tileCoord),p=rs.getIntersection(l,m),g=rs.equals(m,p)?null:rs.buffer(p,s.getRenderBuffer()*c),_=M.getProjection(),w=!1;ws.equivalent(n,_)||(w=!0,M.setProjection(n)),o.dirty=!1;var y,b=new Er(0,p,c,h,a.getOverlaps(),this.declutterTree_,s.getRenderBuffer()),x=Cr.getSquaredTolerance(c,h),E=function(t){var i,h=t.getStyleFunction();if(h?i=h.call(t,c):(h=s.getStyleFunction())&&(i=h(t,c)),i){var n=this.renderFeature(t,x,i,b);this.dirty_=this.dirty_||n,o.dirty=o.dirty||n}},C=M.getFeatures();e&&e!==o.renderedRenderOrder&&C.sort(e);for(var S=0,z=C.length;S<z;++S)y=C[S],w&&(_.getUnits()==vs.TILE_PIXELS&&(_.setWorldExtent(m),_.setExtent(M.getExtent())),y.getGeometry().transform(_,n)),g&&!rs.intersects(g,y.getGeometry().getExtent())||E.call(this,y);for(var A in b.finish(),b.getReplays());M.setReplayGroup(s,t.tileCoord.toString(),b)}}o.renderedRevision=r,o.renderedRenderOrder=e}},Ar.prototype.drawTileImage=function(t,i,s,h,n,r,e,o,a){var u=t;this.createReplayGroup_(u,i),this.context&&(this.renderTileImage_(u,i,s),Xn.prototype.drawTileImage.apply(this,arguments))},Ar.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var r=i.viewState.resolution,e=i.viewState.rotation;s=null==s?0:s;var o,a,u,f,c,l,v,d=this.getLayer(),M={},m=this.renderedTiles,p=d.getSource().getTileGridForProjection(i.viewState.projection);for(u=0,f=m.length;u<f;++u)if(v=p.getTileCoordExtent((l=m[u]).wrappedTileCoord,this.tmpExtent),o=rs.buffer(v,s*r,o),rs.containsCoordinate(o,t))for(var g=0,_=l.tileKeys.length;g<_;++g){var w=l.getTile(l.tileKeys[g]);3!=w.getState()&&(c=w.getReplayGroup(d,l.tileCoord.toString()),a=a||c.forEachFeatureAtCoordinate(t,r,e,s,{},(function(t){var i=di.getUid(t).toString();if(!(i in M))return M[i]=!0,h.call(n,t,d)}),null))}return a},Ar.prototype.getReplayTransform_=function(t,i){var s=this.getLayer().getSource().getTileGrid(),h=t.tileCoord,n=s.getResolution(h[0]),r=i.viewState,e=i.pixelRatio,o=r.resolution/e,a=s.getTileCoordExtent(h,this.tmpExtent),u=r.center,f=rs.getTopLeft(a),c=i.size,l=Math.round(e*c[0]/2),v=Math.round(e*c[1]/2);return ys.compose(this.tmpTransform_,l,v,n/o,n/o,r.rotation,(f[0]-u[0])/n,(u[1]-f[1])/n)},Ar.prototype.handleFontsChanged_=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},Ar.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Ar.prototype.postCompose=function(t,i,s){var h,n,r=this.getLayer(),e=r.getDeclutter()?{}:null,o=r.getSource(),a=r.getRenderMode(),u=Ar.VECTOR_REPLAYS[a],f=i.pixelRatio,c=i.viewState.rotation,l=i.size;c&&(h=Math.round(f*l[0]/2),n=Math.round(f*l[1]/2),Nn.rotateAtOffset(t,-c,h,n)),e&&this.declutterTree_.clear();for(var v=this.renderedTiles,d=o.getTileGridForProjection(i.viewState.projection),M=[],m=[],p=v.length-1;p>=0;--p){var g=v[p];if(5!=g.getState())for(var _=g.tileCoord,w=d.getTileCoordExtent(_)[0]-d.getTileCoordExtent(g.wrappedTileCoord)[0],y=void 0,b=0,x=g.tileKeys.length;b<x;++b){var E=g.getTile(g.tileKeys[b]);if(3!=E.getState()){var C=E.getReplayGroup(r,_.toString());if(a==zr||C.hasReplays(u)){y||(y=this.getTransform(i,w));var S=E.tileCoord[0],z=C.getClipCoords(y);t.save(),t.globalAlpha=s.opacity;for(var A=0,k=M.length;A<k;++A){var N=M[A];S<m[A]&&(t.beginPath(),t.moveTo(z[0],z[1]),t.lineTo(z[2],z[3]),t.lineTo(z[4],z[5]),t.lineTo(z[6],z[7]),t.moveTo(N[6],N[7]),t.lineTo(N[4],N[5]),t.lineTo(N[2],N[3]),t.lineTo(N[0],N[1]),t.clip())}C.replay(t,y,c,{},u,e),t.restore(),M.push(z),m.push(S)}}}}e&&Er.replayDeclutter(e,t,c),c&&Nn.rotateAtOffset(t,c,h,n),Xn.prototype.postCompose.apply(this,arguments)},Ar.prototype.renderFeature=function(t,i,s,h){if(!s)return!1;var n=!1;if(Array.isArray(s))for(var r=0,e=s.length;r<e;++r)n=Cr.renderFeature(h,t,s[r],i,this.handleStyleImageChange_,this)||n;else n=Cr.renderFeature(h,t,s,i,this.handleStyleImageChange_,this);return n},Ar.prototype.renderTileImage_=function(t,i){var s=this.getLayer(),h=t.getReplayState(s),n=s.getRevision(),r=Ar.IMAGE_REPLAYS[s.getRenderMode()];if(r&&h.renderedTileRevision!==n){h.renderedTileRevision=n;var e=t.wrappedTileCoord,o=e[0],a=i.pixelRatio,u=s.getSource(),f=u.getTileGridForProjection(i.viewState.projection),c=f.getResolution(o),l=t.getContext(s),v=u.getTilePixelSize(o,a,i.viewState.projection);l.canvas.width=v[0],l.canvas.height=v[1];for(var d=f.getTileCoordExtent(e),M=0,m=t.tileKeys.length;M<m;++M){var p=t.getTile(t.tileKeys[M]);if(3!=p.getState()){var g=a/c,_=ys.reset(this.tmpTransform_);ys.scale(_,g,-g),ys.translate(_,-d[0],-d[3]),p.getReplayGroup(s,t.tileCoord.toString()).replay(l,_,0,{},r)}}}};var kr=function(t){this.source_=t};kr.prototype.getType=function(){},kr.prototype.getSource=function(){return this.source_},kr.prototype.isAnimated=as.FALSE;var Nr=function(t){kr.call(this,t)};di.inherits(Nr,kr),Nr.prototype.getType=function(){return Ds.FRAGMENT_SHADER};var Rr=function(t){kr.call(this,t)};di.inherits(Rr,kr),Rr.prototype.getType=function(){return Ds.VERTEX_SHADER};var Pr={};Pr.fragment=new Nr(di.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n":"precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}"),Pr.vertex=new Rr(di.DEBUG_WEBGL?"varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n":"varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}");var Tr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_lineWidth=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_lineWidth":"k"),this.u_pixelRatio=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_pixelRatio":"l"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"m"),this.u_fillColor=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_fillColor":"n"),this.u_strokeColor=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_strokeColor":"o"),this.u_size=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_size":"p"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"e"),this.a_instruction=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_instruction":"f"),this.a_radius=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_radius":"g")},Or=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Lr=function(t,i){return t[0]=i[0],t[1]=i[1],t[4]=i[2],t[5]=i[3],t[12]=i[4],t[13]=i[5],t},Fr=function(t,i){Tn.call(this),this.tolerance=t,this.maxExtent=i,this.origin=rs.getCenter(i),this.projectionMatrix_=ys.create(),this.offsetRotateMatrix_=ys.create(),this.offsetScaleMatrix_=ys.create(),this.tmpMat4_=Or(),this.indices=[],this.indicesBuffer=null,this.startIndices=[],this.startIndicesFeature=[],this.vertices=[],this.verticesBuffer=null,this.lineStringReplay=void 0};di.inherits(Fr,Tn),Fr.prototype.getDeleteResourcesFunction=function(){},Fr.prototype.finish=function(){},Fr.prototype.setUpProgram=function(){},Fr.prototype.shutDownProgram=function(){},Fr.prototype.drawReplay=function(){},Fr.prototype.drawHitDetectionReplayOneByOne=function(){},Fr.prototype.drawHitDetectionReplay=function(t,i,s,h,n,r){return n?this.drawHitDetectionReplayOneByOne(t,i,s,h,r):this.drawHitDetectionReplayAll(t,i,s,h)},Fr.prototype.drawHitDetectionReplayAll=function(t,i,s,h){return t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawReplay(t,i,s,!0),h(null)||void 0},Fr.prototype.replay=function(t,i,s,h,n,r,e,o,a,u,f){var c,l,v,d,M,m,p,g,_=t.getGL();this.lineStringReplay&&(c=_.isEnabled(_.STENCIL_TEST),l=_.getParameter(_.STENCIL_FUNC),v=_.getParameter(_.STENCIL_VALUE_MASK),d=_.getParameter(_.STENCIL_REF),M=_.getParameter(_.STENCIL_WRITEMASK),m=_.getParameter(_.STENCIL_FAIL),p=_.getParameter(_.STENCIL_PASS_DEPTH_PASS),g=_.getParameter(_.STENCIL_PASS_DEPTH_FAIL),_.enable(_.STENCIL_TEST),_.clear(_.STENCIL_BUFFER_BIT),_.stencilMask(255),_.stencilFunc(_.ALWAYS,1,255),_.stencilOp(_.KEEP,_.KEEP,_.REPLACE),this.lineStringReplay.replay(t,i,s,h,n,r,e,o,a,u,f),_.stencilMask(0),_.stencilFunc(_.NOTEQUAL,1,255)),t.bindBuffer(Ds.ARRAY_BUFFER,this.verticesBuffer),t.bindBuffer(Ds.ELEMENT_ARRAY_BUFFER,this.indicesBuffer);var w=this.setUpProgram(_,t,n,r),y=ys.reset(this.projectionMatrix_);ys.scale(y,2/(s*n[0]),2/(s*n[1])),ys.rotate(y,-h),ys.translate(y,-(i[0]-this.origin[0]),-(i[1]-this.origin[1]));var b=ys.reset(this.offsetScaleMatrix_);ys.scale(b,2/n[0],2/n[1]);var x,E=ys.reset(this.offsetRotateMatrix_);return 0!==h&&ys.rotate(E,-h),_.uniformMatrix4fv(w.u_projectionMatrix,!1,Lr(this.tmpMat4_,y)),_.uniformMatrix4fv(w.u_offsetScaleMatrix,!1,Lr(this.tmpMat4_,b)),_.uniformMatrix4fv(w.u_offsetRotateMatrix,!1,Lr(this.tmpMat4_,E)),_.uniform1f(w.u_opacity,e),void 0===a?this.drawReplay(_,t,o,!1):x=this.drawHitDetectionReplay(_,t,o,a,u,f),this.shutDownProgram(_,w),this.lineStringReplay&&(c||_.disable(_.STENCIL_TEST),_.clear(_.STENCIL_BUFFER_BIT),_.stencilFunc(l,d,v),_.stencilMask(M),_.stencilOp(m,g,p)),x},Fr.prototype.drawElements=function(t,i,s,h){t.drawElements(Ds.TRIANGLES,h-s,i.hasOESElementIndexUint?Ds.UNSIGNED_INT:Ds.UNSIGNED_SHORT,s*(i.hasOESElementIndexUint?4:2))};var Ir={defaultFont:"10px sans-serif",defaultFillStyle:[0,0,0,1],defaultLineCap:"round",defaultLineDash:[],defaultLineDashOffset:0,defaultLineJoin:"round",defaultMiterLimit:10,defaultStrokeStyle:[0,0,0,1],defaultTextAlign:.5,defaultTextBaseline:.5,defaultLineWidth:1,triangleIsCounterClockwise:function(t,i,s,h,n,r){var e=(s-t)*(r-i)-(n-t)*(h-i);return e<=Ir.EPSILON&&e>=-Ir.EPSILON?void 0:e>0}};Ir.EPSILON=Number.EPSILON||2220446049250313e-31;var Dr=function(t,i){this.arr_=void 0!==t?t:[],this.usage_=void 0!==i?i:Dr.Usage_.STATIC_DRAW};Dr.prototype.getArray=function(){return this.arr_},Dr.prototype.getUsage=function(){return this.usage_},Dr.Usage_={STATIC_DRAW:Ds.STATIC_DRAW,STREAM_DRAW:Ds.STREAM_DRAW,DYNAMIC_DRAW:Ds.DYNAMIC_DRAW};var Wr=function(t,i){Fr.call(this,t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.radius_=0,this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:void 0,lineWidth:void 0,changed:!1}};di.inherits(Wr,Fr),Wr.prototype.drawCoordinates_=function(t,i,s,h){var n,r,e=this.vertices.length,o=this.indices.length,a=e/4;for(n=i,r=s;n<r;n+=h)this.vertices[e++]=t[n],this.vertices[e++]=t[n+1],this.vertices[e++]=0,this.vertices[e++]=this.radius_,this.vertices[e++]=t[n],this.vertices[e++]=t[n+1],this.vertices[e++]=1,this.vertices[e++]=this.radius_,this.vertices[e++]=t[n],this.vertices[e++]=t[n+1],this.vertices[e++]=2,this.vertices[e++]=this.radius_,this.vertices[e++]=t[n],this.vertices[e++]=t[n+1],this.vertices[e++]=3,this.vertices[e++]=this.radius_,this.indices[o++]=a,this.indices[o++]=a+1,this.indices[o++]=a+2,this.indices[o++]=a+2,this.indices[o++]=a+3,this.indices[o++]=a,a+=4},Wr.prototype.drawCircle=function(t,i){var s=t.getRadius(),h=t.getStride();if(s){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.radius_=s;var n=t.getFlatCoordinates();n=ls(n,0,2,h,-this.origin[0],-this.origin[1]),this.drawCoordinates_(n,0,2,h)}else if(this.state_.changed&&(this.styles_.pop(),this.styles_.length)){var r=this.styles_[this.styles_.length-1];this.state_.fillColor=r[0],this.state_.strokeColor=r[1],this.state_.lineWidth=r[2],this.state_.changed=!1}},Wr.prototype.finish=function(){this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},Wr.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer;return function(){t.deleteBuffer(i),t.deleteBuffer(s)}},Wr.prototype.setUpProgram=function(t,i,s,h){var n,r=i.getProgram(Pr.fragment,Pr.vertex);return this.defaultLocations_?n=this.defaultLocations_:(n=new Tr(t,r),this.defaultLocations_=n),i.useProgram(r),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Ds.FLOAT,!1,16,0),t.enableVertexAttribArray(n.a_instruction),t.vertexAttribPointer(n.a_instruction,1,Ds.FLOAT,!1,16,8),t.enableVertexAttribArray(n.a_radius),t.vertexAttribPointer(n.a_radius,1,Ds.FLOAT,!1,16,12),t.uniform2fv(n.u_size,s),t.uniform1f(n.u_pixelRatio,h),n},Wr.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_instruction),t.disableVertexAttribArray(i.a_radius)},Wr.prototype.drawReplay=function(t,i,s){var h,n,r,e;if(Si.isEmpty(s))for(r=this.startIndices[this.startIndices.length-1],h=this.styleIndices_.length-1;h>=0;--h)n=this.styleIndices_[h],this.setFillStyle_(t,(e=this.styles_[h])[0]),this.setStrokeStyle_(t,e[1],e[2]),this.drawElements(t,i,n,r),r=n;else this.drawReplaySkipping_(t,i,s)},Wr.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var r,e,o,a,u,f,c;for(o=this.startIndices[1+(c=this.startIndices.length-2)],r=this.styleIndices_.length-1;r>=0;--r)for(this.setFillStyle_(t,(a=this.styles_[r])[0]),this.setStrokeStyle_(t,a[1],a[2]),u=this.styleIndices_[r];c>=0&&this.startIndices[c]>=u;){if(e=this.startIndices[c],void 0===s[di.getUid(f=this.startIndicesFeature[c]).toString()]&&f.getGeometry()&&(void 0===n||rs.intersects(n,f.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,e,o);var l=h(f);if(l)return l}c--,o=e}},Wr.prototype.drawReplaySkipping_=function(t,i,s){var h,n,r,e,o,a,u;for(r=n=this.startIndices[1+(a=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setFillStyle_(t,(e=this.styles_[h])[0]),this.setStrokeStyle_(t,e[1],e[2]),o=this.styleIndices_[h];a>=0&&this.startIndices[a]>=o;)u=this.startIndices[a],s[di.getUid(this.startIndicesFeature[a]).toString()]&&(n!==r&&this.drawElements(t,i,n,r),r=u),a--,n=u;n!==r&&this.drawElements(t,i,n,r),n=r=o}},Wr.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_fillColor,i)},Wr.prototype.setStrokeStyle_=function(t,i,s){t.uniform4fv(this.defaultLocations_.u_strokeColor,i),t.uniform1f(this.defaultLocations_.u_lineWidth,s)},Wr.prototype.setFillStrokeStyle=function(t,i){var s,h;if(i){var n=i.getLineDash();this.state_.lineDash=n||Ir.defaultLineDash;var r=i.getLineDashOffset();this.state_.lineDashOffset=r||Ir.defaultLineDashOffset,s=(s=i.getColor())instanceof CanvasGradient||s instanceof CanvasPattern?Ir.defaultStrokeStyle:Rn.asArray(s).map((function(t,i){return 3!=i?t/255:t}))||Ir.defaultStrokeStyle,h=void 0!==(h=i.getWidth())?h:Ir.defaultLineWidth}else s=[0,0,0,0],h=0;var e=t?t.getColor():[0,0,0,0];e=e instanceof CanvasGradient||e instanceof CanvasPattern?Ir.defaultFillStyle:Rn.asArray(e).map((function(t,i){return 3!=i?t/255:t}))||Ir.defaultFillStyle,this.state_.strokeColor&&hs.equals(this.state_.strokeColor,s)&&this.state_.fillColor&&hs.equals(this.state_.fillColor,e)&&this.state_.lineWidth===h||(this.state_.changed=!0,this.state_.fillColor=e,this.state_.strokeColor=s,this.state_.lineWidth=h,this.styles_.push([e,s,h]))};var Gr={};Gr.fragment=new Nr(di.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),Gr.vertex=new Rr(di.DEBUG_WEBGL?"varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n":"varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}");var Vr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"k"),this.u_image=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_image":"l"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"c"),this.a_texCoord=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_texCoord":"d"),this.a_offsets=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_offsets":"e"),this.a_opacity=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_opacity":"f"),this.a_rotateWithView=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_rotateWithView":"g")},jr="webglcontextlost",Ur="webglcontextrestored",Xr=function(t,i){this.canvas_=t,this.gl_=i,this.bufferCache_={},this.shaderCache_={},this.programCache_={},this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null,this.hasOESElementIndexUint=hs.includes(di.WEBGL_EXTENSIONS,"OES_element_index_uint"),this.hasOESElementIndexUint&&i.getExtension("OES_element_index_uint"),zi.listen(this.canvas_,jr,this.handleWebGLContextLost,this),zi.listen(this.canvas_,Ur,this.handleWebGLContextRestored,this)};di.inherits(Xr,Ai),Xr.prototype.bindBuffer=function(t,i){var s=this.getGL(),h=i.getArray(),n=String(di.getUid(i));if(n in this.bufferCache_)s.bindBuffer(t,this.bufferCache_[n].buffer);else{var r,e=s.createBuffer();s.bindBuffer(t,e),t==Ds.ARRAY_BUFFER?r=new Float32Array(h):t==Ds.ELEMENT_ARRAY_BUFFER&&(r=this.hasOESElementIndexUint?new Uint32Array(h):new Uint16Array(h)),s.bufferData(t,r,i.getUsage()),this.bufferCache_[n]={buf:i,buffer:e}}},Xr.prototype.deleteBuffer=function(t){var i=this.getGL(),s=String(di.getUid(t)),h=this.bufferCache_[s];i.isContextLost()||i.deleteBuffer(h.buffer),delete this.bufferCache_[s]},Xr.prototype.disposeInternal=function(){zi.unlistenAll(this.canvas_);var t=this.getGL();if(!t.isContextLost()){var i;for(i in this.bufferCache_)t.deleteBuffer(this.bufferCache_[i].buffer);for(i in this.programCache_)t.deleteProgram(this.programCache_[i]);for(i in this.shaderCache_)t.deleteShader(this.shaderCache_[i]);t.deleteFramebuffer(this.hitDetectionFramebuffer_),t.deleteRenderbuffer(this.hitDetectionRenderbuffer_),t.deleteTexture(this.hitDetectionTexture_)}},Xr.prototype.getCanvas=function(){return this.canvas_},Xr.prototype.getGL=function(){return this.gl_},Xr.prototype.getHitDetectionFramebuffer=function(){return this.hitDetectionFramebuffer_||this.initHitDetectionFramebuffer_(),this.hitDetectionFramebuffer_},Xr.prototype.getShader=function(t){var i=String(di.getUid(t));if(i in this.shaderCache_)return this.shaderCache_[i];var s=this.getGL(),h=s.createShader(t.getType());return s.shaderSource(h,t.getSource()),s.compileShader(h),this.shaderCache_[i]=h,h},Xr.prototype.getProgram=function(t,i){var s=di.getUid(t)+"/"+di.getUid(i);if(s in this.programCache_)return this.programCache_[s];var h=this.getGL(),n=h.createProgram();return h.attachShader(n,this.getShader(t)),h.attachShader(n,this.getShader(i)),h.linkProgram(n),this.programCache_[s]=n,n},Xr.prototype.handleWebGLContextLost=function(){Si.clear(this.bufferCache_),Si.clear(this.shaderCache_),Si.clear(this.programCache_),this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null},Xr.prototype.handleWebGLContextRestored=function(){},Xr.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_,i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i);var s=Xr.createEmptyTexture(t,1,1),h=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,h),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,h),t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.hitDetectionFramebuffer_=i,this.hitDetectionTexture_=s,this.hitDetectionRenderbuffer_=h},Xr.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,!0)},Xr.createTexture_=function(t,i,s){var h=t.createTexture();return t.bindTexture(t.TEXTURE_2D,h),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),void 0!==i&&t.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_WRAP_S,i),void 0!==s&&t.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_WRAP_T,s),h},Xr.createEmptyTexture=function(t,i,s,h,n){var r=Xr.createTexture_(t,h,n);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i,s,0,t.RGBA,t.UNSIGNED_BYTE,null),r},Xr.createTexture=function(t,i,s,h){var n=Xr.createTexture_(t,s,h);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i),n};var qr=function(t,i){Fr.call(this,t,i),this.anchorX=void 0,this.anchorY=void 0,this.groupIndices=[],this.hitDetectionGroupIndices=[],this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.defaultLocations=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.width=void 0};di.inherits(qr,Fr),qr.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer,h=this.getTextures(!0),n=t.getGL();return function(){var r,e;if(!n.isContextLost())for(r=0,e=h.length;r<e;++r)n.deleteTexture(h[r]);t.deleteBuffer(i),t.deleteBuffer(s)}},qr.prototype.drawCoordinates=function(t,i,s,h){var n,r,e,o,a,u,f=this.anchorX,c=this.anchorY,l=this.height,v=this.imageHeight,d=this.imageWidth,M=this.opacity,m=this.originX,p=this.originY,g=this.rotateWithView?1:0,_=-this.rotation,w=this.scale,y=this.width,b=Math.cos(_),x=Math.sin(_),E=this.indices.length,C=this.vertices.length;for(n=i;n<s;n+=h)u=t[n+1]-this.origin[1],r=C/8,e=-w*f,o=-w*(l-c),this.vertices[C++]=a=t[n]-this.origin[0],this.vertices[C++]=u,this.vertices[C++]=e*b-o*x,this.vertices[C++]=e*x+o*b,this.vertices[C++]=m/d,this.vertices[C++]=(p+l)/v,this.vertices[C++]=M,this.vertices[C++]=g,e=w*(y-f),o=-w*(l-c),this.vertices[C++]=a,this.vertices[C++]=u,this.vertices[C++]=e*b-o*x,this.vertices[C++]=e*x+o*b,this.vertices[C++]=(m+y)/d,this.vertices[C++]=(p+l)/v,this.vertices[C++]=M,this.vertices[C++]=g,e=w*(y-f),o=w*c,this.vertices[C++]=a,this.vertices[C++]=u,this.vertices[C++]=e*b-o*x,this.vertices[C++]=e*x+o*b,this.vertices[C++]=(m+y)/d,this.vertices[C++]=p/v,this.vertices[C++]=M,this.vertices[C++]=g,e=-w*f,o=w*c,this.vertices[C++]=a,this.vertices[C++]=u,this.vertices[C++]=e*b-o*x,this.vertices[C++]=e*x+o*b,this.vertices[C++]=m/d,this.vertices[C++]=p/v,this.vertices[C++]=M,this.vertices[C++]=g,this.indices[E++]=r,this.indices[E++]=r+1,this.indices[E++]=r+2,this.indices[E++]=r,this.indices[E++]=r+2,this.indices[E++]=r+3;return C},qr.prototype.createTextures=function(t,i,s,h){var n,r,e,o,a=i.length;for(o=0;o<a;++o)(e=di.getUid(r=i[o]).toString())in s?n=s[e]:(n=Xr.createTexture(h,r,Ds.CLAMP_TO_EDGE,Ds.CLAMP_TO_EDGE),s[e]=n),t[o]=n},qr.prototype.setUpProgram=function(t,i){var s,h=i.getProgram(Gr.fragment,Gr.vertex);return this.defaultLocations?s=this.defaultLocations:(s=new Vr(t,h),this.defaultLocations=s),i.useProgram(h),t.enableVertexAttribArray(s.a_position),t.vertexAttribPointer(s.a_position,2,Ds.FLOAT,!1,32,0),t.enableVertexAttribArray(s.a_offsets),t.vertexAttribPointer(s.a_offsets,2,Ds.FLOAT,!1,32,8),t.enableVertexAttribArray(s.a_texCoord),t.vertexAttribPointer(s.a_texCoord,2,Ds.FLOAT,!1,32,16),t.enableVertexAttribArray(s.a_opacity),t.vertexAttribPointer(s.a_opacity,1,Ds.FLOAT,!1,32,24),t.enableVertexAttribArray(s.a_rotateWithView),t.vertexAttribPointer(s.a_rotateWithView,1,Ds.FLOAT,!1,32,28),s},qr.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_offsets),t.disableVertexAttribArray(i.a_texCoord),t.disableVertexAttribArray(i.a_opacity),t.disableVertexAttribArray(i.a_rotateWithView)},qr.prototype.drawReplay=function(t,i,s,h){var n,r,e,o=h?this.getHitDetectionTextures():this.getTextures(),a=h?this.hitDetectionGroupIndices:this.groupIndices;if(Si.isEmpty(s))for(n=0,r=o.length,e=0;n<r;++n){t.bindTexture(Ds.TEXTURE_2D,o[n]);var u=a[n];this.drawElements(t,i,e,u),e=u}else this.drawReplaySkipping(t,i,s,o,a)},qr.prototype.drawReplaySkipping=function(t,i,s,h,n){var r,e,o=0;for(r=0,e=h.length;r<e;++r){t.bindTexture(Ds.TEXTURE_2D,h[r]);for(var a=r>0?n[r-1]:0,u=n[r],f=a,c=a;o<this.startIndices.length&&this.startIndices[o]<=u;)void 0!==s[di.getUid(this.startIndicesFeature[o]).toString()]?(f!==c&&this.drawElements(t,i,f,c),c=f=o===this.startIndices.length-1?u:this.startIndices[o+1]):c=o===this.startIndices.length-1?u:this.startIndices[o+1],o++;f!==c&&this.drawElements(t,i,f,c)}},qr.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var r,e,o,a,u,f=this.startIndices.length-1,c=this.getHitDetectionTextures();for(r=c.length-1;r>=0;--r)for(t.bindTexture(Ds.TEXTURE_2D,c[r]),e=r>0?this.hitDetectionGroupIndices[r-1]:0,a=this.hitDetectionGroupIndices[r];f>=0&&this.startIndices[f]>=e;){if(o=this.startIndices[f],void 0===s[di.getUid(u=this.startIndicesFeature[f]).toString()]&&u.getGeometry()&&(void 0===n||rs.intersects(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,o,a);var l=h(u);if(l)return l}a=o,f--}},qr.prototype.finish=function(){this.anchorX=void 0,this.anchorY=void 0,this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.indices=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.vertices=null,this.width=void 0},qr.prototype.getTextures=function(){},qr.prototype.getHitDetectionTextures=function(){};var Br=function(t,i){qr.call(this,t,i),this.images_=[],this.hitDetectionImages_=[],this.textures_=[],this.hitDetectionTextures_=[]};di.inherits(Br,qr),Br.prototype.drawMultiPoint=function(t,i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var s=t.getFlatCoordinates(),h=t.getStride();this.drawCoordinates(s,0,s.length,h)},Br.prototype.drawPoint=function(t,i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var s=t.getFlatCoordinates(),h=t.getStride();this.drawCoordinates(s,0,s.length,h)},Br.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices.push(this.indices.length),this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices);var s={};this.createTextures(this.textures_,this.images_,s,i),this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,s,i),this.images_=null,this.hitDetectionImages_=null,qr.prototype.finish.call(this,t)},Br.prototype.setImageStyle=function(t){var i=t.getAnchor(),s=t.getImage(1),h=t.getImageSize(),n=t.getHitDetectionImage(1),r=t.getOpacity(),e=t.getOrigin(),o=t.getRotateWithView(),a=t.getRotation(),u=t.getSize(),f=t.getScale();0===this.images_.length?this.images_.push(s):di.getUid(this.images_[this.images_.length-1])!=di.getUid(s)&&(this.groupIndices.push(this.indices.length),this.images_.push(s)),0===this.hitDetectionImages_.length?this.hitDetectionImages_.push(n):di.getUid(this.hitDetectionImages_[this.hitDetectionImages_.length-1])!=di.getUid(n)&&(this.hitDetectionGroupIndices.push(this.indices.length),this.hitDetectionImages_.push(n)),this.anchorX=i[0],this.anchorY=i[1],this.height=u[1],this.imageHeight=h[1],this.imageWidth=h[0],this.opacity=r,this.originX=e[0],this.originY=e[1],this.rotation=a,this.rotateWithView=o,this.scale=f,this.width=u[0]},Br.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_},Br.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var Yr=function(t,i,s,h){var n=s-h;return t[i]===t[n]&&t[i+1]===t[n+1]&&(s-i)/h>3&&!!Es.linearRing(t,i,s,h)},Hr={};Hr.fragment=new Nr(di.DEBUG_WEBGL?"precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),Hr.vertex=new Rr(di.DEBUG_WEBGL?"varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n":"varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}");var Jr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_lineWidth=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_lineWidth":"k"),this.u_miterLimit=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_miterLimit":"l"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"m"),this.u_color=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_color":"n"),this.u_size=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_size":"o"),this.u_pixelRatio=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_pixelRatio":"p"),this.a_lastPos=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_lastPos":"d"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"e"),this.a_nextPos=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_nextPos":"f"),this.a_direction=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_direction":"g")},Zr=function(t,i){Fr.call(this,t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0,changed:!1}};di.inherits(Zr,Fr),Zr.prototype.drawCoordinates_=function(t,i,s,h){var n,r,e,o,a,u,f,c,l=this.vertices.length,v=this.indices.length,d="bevel"===this.state_.lineJoin?0:"miter"===this.state_.lineJoin?1:2,M="butt"===this.state_.lineCap?0:"square"===this.state_.lineCap?1:2,m=Yr(t,i,s,h),p=v,g=1;for(n=i,r=s;n<r;n+=h){if(a=l/7,u=f,f=c||[t[n],t[n+1]],n===i){if(c=[t[n+h],t[n+h+1]],s-i==2*h&&hs.equals(f,c))break;if(!m){M&&(l=this.addVertices_([0,0],f,c,g*Zr.Instruction_.BEGIN_LINE_CAP*M,l),l=this.addVertices_([0,0],f,c,-g*Zr.Instruction_.BEGIN_LINE_CAP*M,l),this.indices[v++]=a+2,this.indices[v++]=a,this.indices[v++]=a+1,this.indices[v++]=a+1,this.indices[v++]=a+3,this.indices[v++]=a+2),l=this.addVertices_([0,0],f,c,g*Zr.Instruction_.BEGIN_LINE*(M||1),l),p=(l=this.addVertices_([0,0],f,c,-g*Zr.Instruction_.BEGIN_LINE*(M||1),l))/7-1;continue}u=[t[s-2*h],t[s-2*h+1]],e=c}else{if(n===s-h){if(m){c=e;break}l=this.addVertices_(u=u||[0,0],f,[0,0],g*Zr.Instruction_.END_LINE*(M||1),l),l=this.addVertices_(u,f,[0,0],-g*Zr.Instruction_.END_LINE*(M||1),l),this.indices[v++]=a,this.indices[v++]=p-1,this.indices[v++]=p,this.indices[v++]=p,this.indices[v++]=a+1,this.indices[v++]=a,M&&(l=this.addVertices_(u,f,[0,0],g*Zr.Instruction_.END_LINE_CAP*M,l),l=this.addVertices_(u,f,[0,0],-g*Zr.Instruction_.END_LINE_CAP*M,l),this.indices[v++]=a+2,this.indices[v++]=a,this.indices[v++]=a+1,this.indices[v++]=a+1,this.indices[v++]=a+3,this.indices[v++]=a+2);break}c=[t[n+h],t[n+h+1]]}o=Ir.triangleIsCounterClockwise(u[0],u[1],f[0],f[1],c[0],c[1])?-1:1,l=this.addVertices_(u,f,c,o*Zr.Instruction_.BEVEL_FIRST*(d||1),l),l=this.addVertices_(u,f,c,o*Zr.Instruction_.BEVEL_SECOND*(d||1),l),l=this.addVertices_(u,f,c,-o*Zr.Instruction_.MITER_BOTTOM*(d||1),l),n>i&&(this.indices[v++]=a,this.indices[v++]=p-1,this.indices[v++]=p,this.indices[v++]=a+2,this.indices[v++]=a,this.indices[v++]=g*o>0?p:p-1),this.indices[v++]=a,this.indices[v++]=a+2,this.indices[v++]=a+1,p=a+2,g=o,d&&(l=this.addVertices_(u,f,c,o*Zr.Instruction_.MITER_TOP*d,l),this.indices[v++]=a+1,this.indices[v++]=a+3,this.indices[v++]=a)}m&&(a=a||l/7,o=Fs.linearRingIsClockwise([u[0],u[1],f[0],f[1],c[0],c[1]],0,6,2)?1:-1,l=this.addVertices_(u,f,c,o*Zr.Instruction_.BEVEL_FIRST*(d||1),l),l=this.addVertices_(u,f,c,-o*Zr.Instruction_.MITER_BOTTOM*(d||1),l),this.indices[v++]=a,this.indices[v++]=p-1,this.indices[v++]=p,this.indices[v++]=a+1,this.indices[v++]=a,this.indices[v++]=g*o>0?p:p-1)},Zr.prototype.addVertices_=function(t,i,s,h,n){return this.vertices[n++]=t[0],this.vertices[n++]=t[1],this.vertices[n++]=i[0],this.vertices[n++]=i[1],this.vertices[n++]=s[0],this.vertices[n++]=s[1],this.vertices[n++]=h,n},Zr.prototype.isValid_=function(t,i,s,h){var n=s-i;return!(n<2*h||n===2*h&&hs.equals([t[i],t[i+1]],[t[i+h],t[i+h+1]]))},Zr.prototype.drawLineString=function(t,i){var s=t.getFlatCoordinates(),h=t.getStride();this.isValid_(s,0,s.length,h)&&(s=ls(s,0,s.length,h,-this.origin[0],-this.origin[1]),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.drawCoordinates_(s,0,s.length,h))},Zr.prototype.drawMultiLineString=function(t,i){var s=this.indices.length,h=t.getEnds();h.unshift(0);var n,r,e=t.getFlatCoordinates(),o=t.getStride();if(h.length>1)for(n=1,r=h.length;n<r;++n)if(this.isValid_(e,h[n-1],h[n],o)){var a=ls(e,h[n-1],h[n],o,-this.origin[0],-this.origin[1]);this.drawCoordinates_(a,0,a.length,o)}this.indices.length>s&&(this.startIndices.push(s),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(s),this.state_.changed=!1))},Zr.prototype.drawPolygonCoordinates=function(t,i,s){var h,n;if(Yr(t,0,t.length,s)||(t.push(t[0]),t.push(t[1])),this.drawCoordinates_(t,0,t.length,s),i.length)for(h=0,n=i.length;h<n;++h)Yr(i[h],0,i[h].length,s)||(i[h].push(i[h][0]),i[h].push(i[h][1])),this.drawCoordinates_(i[h],0,i[h].length,s)},Zr.prototype.setPolygonStyle=function(t,i){var s=void 0===i?this.indices.length:i;this.startIndices.push(s),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(s),this.state_.changed=!1)},Zr.prototype.getCurrentIndex=function(){return this.indices.length},Zr.prototype.finish=function(){this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},Zr.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer;return function(){t.deleteBuffer(i),t.deleteBuffer(s)}},Zr.prototype.setUpProgram=function(t,i,s,h){var n,r=i.getProgram(Hr.fragment,Hr.vertex);return this.defaultLocations_?n=this.defaultLocations_:(n=new Jr(t,r),this.defaultLocations_=n),i.useProgram(r),t.enableVertexAttribArray(n.a_lastPos),t.vertexAttribPointer(n.a_lastPos,2,Ds.FLOAT,!1,28,0),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Ds.FLOAT,!1,28,8),t.enableVertexAttribArray(n.a_nextPos),t.vertexAttribPointer(n.a_nextPos,2,Ds.FLOAT,!1,28,16),t.enableVertexAttribArray(n.a_direction),t.vertexAttribPointer(n.a_direction,1,Ds.FLOAT,!1,28,24),t.uniform2fv(n.u_size,s),t.uniform1f(n.u_pixelRatio,h),n},Zr.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_lastPos),t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_nextPos),t.disableVertexAttribArray(i.a_direction)},Zr.prototype.drawReplay=function(t,i,s,h){var n,r,e,o,a=t.getParameter(t.DEPTH_FUNC),u=t.getParameter(t.DEPTH_WRITEMASK);if(h||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Si.isEmpty(s))for(e=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)r=this.styleIndices_[n],this.setStrokeStyle_(t,(o=this.styles_[n])[0],o[1],o[2]),this.drawElements(t,i,r,e),t.clear(t.DEPTH_BUFFER_BIT),e=r;else this.drawReplaySkipping_(t,i,s);h||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(u),t.depthFunc(a))},Zr.prototype.drawReplaySkipping_=function(t,i,s){var h,n,r,e,o,a,u;for(r=n=this.startIndices[1+(a=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setStrokeStyle_(t,(e=this.styles_[h])[0],e[1],e[2]),o=this.styleIndices_[h];a>=0&&this.startIndices[a]>=o;)u=this.startIndices[a],s[di.getUid(this.startIndicesFeature[a]).toString()]&&(n!==r&&(this.drawElements(t,i,n,r),t.clear(t.DEPTH_BUFFER_BIT)),r=u),a--,n=u;n!==r&&(this.drawElements(t,i,n,r),t.clear(t.DEPTH_BUFFER_BIT)),n=r=o}},Zr.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var r,e,o,a,u,f,c;for(o=this.startIndices[1+(c=this.startIndices.length-2)],r=this.styleIndices_.length-1;r>=0;--r)for(this.setStrokeStyle_(t,(a=this.styles_[r])[0],a[1],a[2]),u=this.styleIndices_[r];c>=0&&this.startIndices[c]>=u;){if(e=this.startIndices[c],void 0===s[di.getUid(f=this.startIndicesFeature[c]).toString()]&&f.getGeometry()&&(void 0===n||rs.intersects(n,f.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,e,o);var l=h(f);if(l)return l}c--,o=e}},Zr.prototype.setStrokeStyle_=function(t,i,s,h){t.uniform4fv(this.defaultLocations_.u_color,i),t.uniform1f(this.defaultLocations_.u_lineWidth,s),t.uniform1f(this.defaultLocations_.u_miterLimit,h)},Zr.prototype.setFillStrokeStyle=function(t,i){var s=i.getLineCap();this.state_.lineCap=void 0!==s?s:Ir.defaultLineCap;var h=i.getLineDash();this.state_.lineDash=h||Ir.defaultLineDash;var n=i.getLineDashOffset();this.state_.lineDashOffset=n||Ir.defaultLineDashOffset;var r=i.getLineJoin();this.state_.lineJoin=void 0!==r?r:Ir.defaultLineJoin;var e=i.getColor();e=e instanceof CanvasGradient||e instanceof CanvasPattern?Ir.defaultStrokeStyle:Rn.asArray(e).map((function(t,i){return 3!=i?t/255:t}))||Ir.defaultStrokeStyle;var o=i.getWidth();o=void 0!==o?o:Ir.defaultLineWidth;var a=i.getMiterLimit();a=void 0!==a?a:Ir.defaultMiterLimit,this.state_.strokeColor&&hs.equals(this.state_.strokeColor,e)&&this.state_.lineWidth===o&&this.state_.miterLimit===a||(this.state_.changed=!0,this.state_.strokeColor=e,this.state_.lineWidth=o,this.state_.miterLimit=a,this.styles_.push([e,o,a]))},Zr.Instruction_={ROUND:2,BEGIN_LINE:3,END_LINE:5,BEGIN_LINE_CAP:7,END_LINE_CAP:11,BEVEL_FIRST:13,BEVEL_SECOND:17,MITER_BOTTOM:19,MITER_TOP:23};var Kr={};Kr.fragment=new Nr(di.DEBUG_WEBGL?"precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),Kr.vertex=new Rr(di.DEBUG_WEBGL?"\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n":"attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}");var Qr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"b"),this.u_offsetScaleMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetScaleMatrix":"c"),this.u_offsetRotateMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_offsetRotateMatrix":"d"),this.u_color=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_color":"e"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"f"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"a")},$r=function(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.lineCap_=i.lineCap,this.lineDash_=void 0!==i.lineDash?i.lineDash:null,this.lineDashOffset_=i.lineDashOffset,this.lineJoin_=i.lineJoin,this.miterLimit_=i.miterLimit,this.width_=i.width,this.checksum_=void 0};$r.prototype.clone=function(){var t=this.getColor();return new $r({color:t&&t.slice?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},$r.prototype.getColor=function(){return this.color_},$r.prototype.getLineCap=function(){return this.lineCap_},$r.prototype.getLineDash=function(){return this.lineDash_},$r.prototype.getLineDashOffset=function(){return this.lineDashOffset_},$r.prototype.getLineJoin=function(){return this.lineJoin_},$r.prototype.getMiterLimit=function(){return this.miterLimit_},$r.prototype.getWidth=function(){return this.width_},$r.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},$r.prototype.setLineCap=function(t){this.lineCap_=t,this.checksum_=void 0},$r.prototype.setLineDash=function(t){this.lineDash_=t,this.checksum_=void 0},$r.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t,this.checksum_=void 0},$r.prototype.setLineJoin=function(t){this.lineJoin_=t,this.checksum_=void 0},$r.prototype.setMiterLimit=function(t){this.miterLimit_=t,this.checksum_=void 0},$r.prototype.setWidth=function(t){this.width_=t,this.checksum_=void 0},$r.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.checksum_+=this.color_?"string"==typeof this.color_?this.color_:di.getUid(this.color_).toString():"-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var te=function(t){this.first_=void 0,this.last_=void 0,this.head_=void 0,this.circular_=void 0===t||t,this.length_=0};te.prototype.insertItem=function(t){var i={prev:void 0,next:void 0,data:t},s=this.head_;if(s){var h=s.next;i.prev=s,i.next=h,s.next=i,h&&(h.prev=i),s===this.last_&&(this.last_=i)}else this.first_=i,this.last_=i,this.circular_&&(i.next=i,i.prev=i);this.head_=i,this.length_++},te.prototype.removeItem=function(){var t=this.head_;if(t){var i=t.next,s=t.prev;i&&(i.prev=s),s&&(s.next=i),this.head_=i||s,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===t?this.first_=this.head_:this.last_===t&&(this.last_=s?this.head_.prev:this.head_),this.length_--}},te.prototype.firstItem=function(){if(this.head_=this.first_,this.head_)return this.head_.data},te.prototype.lastItem=function(){if(this.head_=this.last_,this.head_)return this.head_.data},te.prototype.nextItem=function(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data},te.prototype.getNextItem=function(){if(this.head_&&this.head_.next)return this.head_.next.data},te.prototype.prevItem=function(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data},te.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev)return this.head_.prev.data},te.prototype.getCurrItem=function(){if(this.head_)return this.head_.data},te.prototype.setFirstItem=function(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)},te.prototype.concat=function(t){if(t.head_){if(this.head_){var i=this.head_.next;this.head_.next=t.first_,t.first_.prev=this.head_,i.prev=t.last_,t.last_.next=i,this.length_+=t.length_}else this.head_=t.head_,this.first_=t.first_,this.last_=t.last_,this.length_=t.length_;t.head_=void 0,t.first_=void 0,t.last_=void 0,t.length_=0}},te.prototype.getLength=function(){return this.length_};var ie=function(t){this.rbush_=Bn(t),this.items_={}};ie.prototype.insert=function(t,i){var s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(s),this.items_[di.getUid(i)]=s},ie.prototype.load=function(t,i){for(var s=new Array(i.length),h=0,n=i.length;h<n;h++){var r=t[h],e=i[h],o={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:e};s[h]=o,this.items_[di.getUid(e)]=o}this.rbush_.load(s)},ie.prototype.remove=function(t){var i=di.getUid(t),s=this.items_[i];return delete this.items_[i],null!==this.rbush_.remove(s)},ie.prototype.update=function(t,i){var s=this.items_[di.getUid(i)];rs.equals([s.minX,s.minY,s.maxX,s.maxY],t)||(this.remove(i),this.insert(t,i))},ie.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},ie.prototype.getInExtent=function(t){return this.rbush_.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}).map((function(t){return t.value}))},ie.prototype.forEach=function(t,i){return this.forEach_(this.getAll(),t,i)},ie.prototype.forEachInExtent=function(t,i,s){return this.forEach_(this.getInExtent(t),i,s)},ie.prototype.forEach_=function(t,i,s){for(var h,n=0,r=t.length;n<r;n++)if(h=i.call(s,t[n]))return h;return h},ie.prototype.isEmpty=function(){return Si.isEmpty(this.items_)},ie.prototype.clear=function(){this.rbush_.clear(),this.items_={}},ie.prototype.getExtent=function(t){var i=this.rbush_.data;return rs.createOrUpdate(i.minX,i.minY,i.maxX,i.maxY,t)},ie.prototype.concat=function(t){for(var i in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[0|i]=t.items_[0|i]};var se=function(t,i){Fr.call(this,t,i),this.lineStringReplay=new Zr(t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={fillColor:null,changed:!1}};di.inherits(se,Fr),se.prototype.drawCoordinates_=function(t,i,s){var h=new te,n=new ie;this.processFlatCoordinates_(t,s,h,n,!0);var r=this.getMaxCoords_(h);if(i.length){var e,o,a=[];for(e=0,o=i.length;e<o;++e){var u={list:new te,maxCoords:void 0,rtree:new ie};a.push(u),this.processFlatCoordinates_(i[e],s,u.list,u.rtree,!1),this.classifyPoints_(u.list,u.rtree,!0),u.maxCoords=this.getMaxCoords_(u.list)}for(a.sort((function(t,i){return i.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-i.maxCoords[1]:i.maxCoords[0]-t.maxCoords[0]})),e=0;e<a.length;++e){var f,c=a[e].list,l=c.firstItem(),v=l;do{if(this.getIntersections_(v,n).length){f=!0;break}v=c.nextItem()}while(l!==v);f||this.bridgeHole_(c,a[e].maxCoords[0],h,r[0],n)&&(n.concat(a[e].rtree),this.classifyPoints_(h,n,!1))}}else this.classifyPoints_(h,n,!1);this.triangulate_(h,n)},se.prototype.processFlatCoordinates_=function(t,i,s,h,n){var r,e,o,a,u,f=Fs.linearRingIsClockwise(t,0,t.length,i),c=this.vertices.length/2,l=[],v=[];if(n===f){for(a=o=this.createPoint_(t[0],t[1],c++),r=i,e=t.length;r<e;r+=i)u=this.createPoint_(t[r],t[r+1],c++),v.push(this.insertItem_(a,u,s)),l.push([Math.min(a.x,u.x),Math.min(a.y,u.y),Math.max(a.x,u.x),Math.max(a.y,u.y)]),a=u;v.push(this.insertItem_(u,o,s)),l.push([Math.min(a.x,u.x),Math.min(a.y,u.y),Math.max(a.x,u.x),Math.max(a.y,u.y)])}else{var d=t.length-i;for(a=o=this.createPoint_(t[d],t[d+1],c++),r=d-i,e=0;r>=e;r-=i)u=this.createPoint_(t[r],t[r+1],c++),v.push(this.insertItem_(a,u,s)),l.push([Math.min(a.x,u.x),Math.min(a.y,u.y),Math.max(a.x,u.x),Math.max(a.y,u.y)]),a=u;v.push(this.insertItem_(u,o,s)),l.push([Math.min(a.x,u.x),Math.min(a.y,u.y),Math.max(a.x,u.x),Math.max(a.y,u.y)])}h.load(l,v)},se.prototype.getMaxCoords_=function(t){var i=t.firstItem(),s=i,h=[s.p0.x,s.p0.y];do{(s=t.nextItem()).p0.x>h[0]&&(h=[s.p0.x,s.p0.y])}while(s!==i);return h},se.prototype.classifyPoints_=function(t,i,s){var h=t.firstItem(),n=h,r=t.nextItem(),e=!1;do{var o=s?Ir.triangleIsCounterClockwise(r.p1.x,r.p1.y,n.p1.x,n.p1.y,n.p0.x,n.p0.y):Ir.triangleIsCounterClockwise(n.p0.x,n.p0.y,n.p1.x,n.p1.y,r.p1.x,r.p1.y);void 0===o?(this.removeItem_(n,r,t,i),e=!0,r===h&&(h=t.getNextItem()),r=n,t.prevItem()):n.p1.reflex!==o&&(n.p1.reflex=o,e=!0),n=r,r=t.nextItem()}while(n!==h);return e},se.prototype.bridgeHole_=function(t,i,s,h,n){for(var r=t.firstItem();r.p1.x!==i;)r=t.nextItem();var e,o,a,u,f=r.p1,c={x:h,y:f.y,i:-1},l=1/0,v=this.getIntersections_({p0:f,p1:c},n,!0);for(e=0,o=v.length;e<o;++e){var d=v[e],M=this.calculateIntersection_(f,c,d.p0,d.p1,!0),m=Math.abs(f.x-M[0]);m<l&&void 0!==Ir.triangleIsCounterClockwise(f.x,f.y,d.p0.x,d.p0.y,d.p1.x,d.p1.y)&&(l=m,u={x:M[0],y:M[1],i:-1},r=d)}if(l===1/0)return!1;if(a=r.p1,l>0){var p=this.getPointsInTriangle_(f,u,r.p1,n);if(p.length){var g=1/0;for(e=0,o=p.length;e<o;++e){var _=p[e],w=Math.atan2(f.y-_.y,c.x-_.x);(w<g||w===g&&_.x<a.x)&&(g=w,a=_)}}}for(r=s.firstItem();r.p1.x!==a.x||r.p1.y!==a.y;)r=s.nextItem();var y={x:f.x,y:f.y,i:f.i,reflex:void 0},b={x:r.p1.x,y:r.p1.y,i:r.p1.i,reflex:void 0};return t.getNextItem().p0=y,this.insertItem_(f,r.p1,t,n),this.insertItem_(b,y,t,n),r.p1=b,t.setFirstItem(),s.concat(t),!0},se.prototype.triangulate_=function(t,i){for(var s=!1,h=this.isSimple_(t,i);t.getLength()>3;)if(h){if(!this.clipEars_(t,i,h,s)&&!this.classifyPoints_(t,i,s)&&!this.resolveSelfIntersections_(t,i,!0))break}else if(!this.clipEars_(t,i,h,s)&&!this.classifyPoints_(t,i,s)&&!this.resolveSelfIntersections_(t,i)){if(!(h=this.isSimple_(t,i))){this.splitPolygon_(t,i);break}s=!this.isClockwise_(t),this.classifyPoints_(t,i,s)}if(3===t.getLength()){var n=this.indices.length;this.indices[n++]=t.getPrevItem().p0.i,this.indices[n++]=t.getCurrItem().p0.i,this.indices[n++]=t.getNextItem().p0.i}},se.prototype.clipEars_=function(t,i,s,h){var n,r,e,o=this.indices.length,a=t.firstItem(),u=t.getPrevItem(),f=a,c=t.nextItem(),l=t.getNextItem(),v=!1;do{var d;n=f.p0,e=c.p1,!1===(r=f.p1).reflex&&(d=s?0===this.getPointsInTriangle_(n,r,e,i,!0).length:h?this.diagonalIsInside_(l.p1,e,r,n,u.p0):this.diagonalIsInside_(u.p0,n,r,e,l.p1),(s||0===this.getIntersections_({p0:n,p1:e},i).length)&&d&&(s||!1===n.reflex||!1===e.reflex||Fs.linearRingIsClockwise([u.p0.x,u.p0.y,n.x,n.y,r.x,r.y,e.x,e.y,l.p1.x,l.p1.y],0,10,2)===!h)&&(this.indices[o++]=n.i,this.indices[o++]=r.i,this.indices[o++]=e.i,this.removeItem_(f,c,t,i),c===a&&(a=l),v=!0)),u=t.getPrevItem(),f=t.getCurrItem(),c=t.nextItem(),l=t.getNextItem()}while(f!==a&&t.getLength()>3);return v},se.prototype.resolveSelfIntersections_=function(t,i,s){var h=t.firstItem();t.nextItem();var n=h,r=t.nextItem(),e=!1;do{var o=this.calculateIntersection_(n.p0,n.p1,r.p0,r.p1,s);if(o){var a,u=!1,f=this.indices.length,c=this.vertices.length/2,l=t.prevItem();if(t.removeItem(),i.remove(l),u=l===h,s?(o[0]===n.p0.x&&o[1]===n.p0.y?(t.prevItem(),r.p0=a=n.p0,i.remove(n),u=u||n===h):(n.p1=a=r.p1,i.remove(r),u=u||r===h),t.removeItem()):(a=this.createPoint_(o[0],o[1],c),n.p1=a,r.p0=a,i.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n),i.update([Math.min(r.p0.x,r.p1.x),Math.min(r.p0.y,r.p1.y),Math.max(r.p0.x,r.p1.x),Math.max(r.p0.y,r.p1.y)],r)),this.indices[f++]=l.p0.i,this.indices[f++]=l.p1.i,this.indices[f++]=a.i,e=!0,u)break}n=t.getPrevItem(),r=t.nextItem()}while(n!==h);return e},se.prototype.isSimple_=function(t,i){var s=t.firstItem(),h=s;do{if(this.getIntersections_(h,i).length)return!1;h=t.nextItem()}while(h!==s);return!0},se.prototype.isClockwise_=function(t){var i=2*t.getLength(),s=new Array(i),h=t.firstItem(),n=h,r=0;do{s[r++]=n.p0.x,s[r++]=n.p0.y,n=t.nextItem()}while(n!==h);return Fs.linearRingIsClockwise(s,0,i,2)},se.prototype.splitPolygon_=function(t,i){var s=t.firstItem(),h=s;do{var n=this.getIntersections_(h,i);if(n.length){var r=n[0],e=this.vertices.length/2,o=this.calculateIntersection_(h.p0,h.p1,r.p0,r.p1),a=this.createPoint_(o[0],o[1],e),u=new te,f=new ie;this.insertItem_(a,h.p1,u,f),h.p1=a,i.update([Math.min(h.p0.x,a.x),Math.min(h.p0.y,a.y),Math.max(h.p0.x,a.x),Math.max(h.p0.y,a.y)],h);for(var c=t.nextItem();c!==r;)this.insertItem_(c.p0,c.p1,u,f),i.remove(c),t.removeItem(),c=t.getCurrItem();this.insertItem_(r.p0,a,u,f),r.p0=a,i.update([Math.min(r.p1.x,a.x),Math.min(r.p1.y,a.y),Math.max(r.p1.x,a.x),Math.max(r.p1.y,a.y)],r),this.classifyPoints_(t,i,!1),this.triangulate_(t,i),this.classifyPoints_(u,f,!1),this.triangulate_(u,f);break}h=t.nextItem()}while(h!==s)},se.prototype.createPoint_=function(t,i,s){var h=this.vertices.length;return this.vertices[h++]=t,this.vertices[h++]=i,{x:t,y:i,i:s,reflex:void 0}},se.prototype.insertItem_=function(t,i,s,h){var n={p0:t,p1:i};return s.insertItem(n),h&&h.insert([Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x,i.x),Math.max(t.y,i.y)],n),n},se.prototype.removeItem_=function(t,i,s,h){s.getCurrItem()===i&&(s.removeItem(),t.p1=i.p1,h.remove(i),h.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t))},se.prototype.getPointsInTriangle_=function(t,i,s,h,n){var r,e,o,a,u=[],f=h.getInExtent([Math.min(t.x,i.x,s.x),Math.min(t.y,i.y,s.y),Math.max(t.x,i.x,s.x),Math.max(t.y,i.y,s.y)]);for(r=0,e=f.length;r<e;++r)for(o in f[r])"object"!=typeof(a=f[r][o])||n&&!a.reflex||a.x===t.x&&a.y===t.y||a.x===i.x&&a.y===i.y||a.x===s.x&&a.y===s.y||-1!==u.indexOf(a)||!Rs.linearRingContainsXY([t.x,t.y,i.x,i.y,s.x,s.y],0,6,2,a.x,a.y)||u.push(a);return u},se.prototype.getIntersections_=function(t,i,s){var h,n,r=t.p0,e=t.p1,o=i.getInExtent([Math.min(r.x,e.x),Math.min(r.y,e.y),Math.max(r.x,e.x),Math.max(r.y,e.y)]),a=[];for(h=0,n=o.length;h<n;++h){var u=o[h];t!==u&&(s||u.p0!==e||u.p1!==r)&&this.calculateIntersection_(r,e,u.p0,u.p1,s)&&a.push(u)}return a},se.prototype.calculateIntersection_=function(t,i,s,h,n){var r=(h.y-s.y)*(i.x-t.x)-(h.x-s.x)*(i.y-t.y);if(0!==r){var e=((h.x-s.x)*(t.y-s.y)-(h.y-s.y)*(t.x-s.x))/r,o=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/r;if(!n&&e>Ir.EPSILON&&e<1-Ir.EPSILON&&o>Ir.EPSILON&&o<1-Ir.EPSILON||n&&e>=0&&e<=1&&o>=0&&o<=1)return[t.x+e*(i.x-t.x),t.y+e*(i.y-t.y)]}},se.prototype.diagonalIsInside_=function(t,i,s,h,n){if(void 0===i.reflex||void 0===h.reflex)return!1;var r=(s.x-h.x)*(i.y-h.y)>(s.y-h.y)*(i.x-h.x),e=(n.x-h.x)*(i.y-h.y)<(n.y-h.y)*(i.x-h.x),o=(t.x-i.x)*(h.y-i.y)>(t.y-i.y)*(h.x-i.x),a=(s.x-i.x)*(h.y-i.y)<(s.y-i.y)*(h.x-i.x);return(h.reflex?e||r:e&&r)&&(i.reflex?a||o:a&&o)},se.prototype.drawMultiPolygon=function(t,i){var s,h,n,r,e=t.getEndss(),o=t.getStride(),a=this.indices.length,u=this.lineStringReplay.getCurrentIndex(),f=t.getFlatCoordinates(),c=0;for(s=0,h=e.length;s<h;++s){var l=e[s];if(l.length>0){var v=ls(f,c,l[0],o,-this.origin[0],-this.origin[1]);if(v.length){var d,M=[];for(n=1,r=l.length;n<r;++n)l[n]!==l[n-1]&&(d=ls(f,l[n-1],l[n],o,-this.origin[0],-this.origin[1]),M.push(d));this.lineStringReplay.drawPolygonCoordinates(v,M,o),this.drawCoordinates_(v,M,o)}}c=l[l.length-1]}this.indices.length>a&&(this.startIndices.push(a),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(a),this.state_.changed=!1)),this.lineStringReplay.getCurrentIndex()>u&&this.lineStringReplay.setPolygonStyle(i,u)},se.prototype.drawPolygon=function(t,i){var s=t.getEnds(),h=t.getStride();if(s.length>0){var n=t.getFlatCoordinates().map(Number),r=ls(n,0,s[0],h,-this.origin[0],-this.origin[1]);if(r.length){var e,o,a,u=[];for(e=1,o=s.length;e<o;++e)s[e]!==s[e-1]&&(a=ls(n,s[e-1],s[e],h,-this.origin[0],-this.origin[1]),u.push(a));this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.lineStringReplay.setPolygonStyle(i),this.lineStringReplay.drawPolygonCoordinates(r,u,h),this.drawCoordinates_(r,u,h)}}},se.prototype.finish=function(t){this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices),this.startIndices.push(this.indices.length),this.lineStringReplay.finish(t),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},se.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer,h=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(i),t.deleteBuffer(s),h()}},se.prototype.setUpProgram=function(t,i){var s,h=i.getProgram(Kr.fragment,Kr.vertex);return this.defaultLocations_?s=this.defaultLocations_:(s=new Qr(t,h),this.defaultLocations_=s),i.useProgram(h),t.enableVertexAttribArray(s.a_position),t.vertexAttribPointer(s.a_position,2,Ds.FLOAT,!1,8,0),s},se.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position)},se.prototype.drawReplay=function(t,i,s,h){var n,r,e,o=t.getParameter(t.DEPTH_FUNC),a=t.getParameter(t.DEPTH_WRITEMASK);if(h||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Si.isEmpty(s))for(e=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)r=this.styleIndices_[n],this.setFillStyle_(t,this.styles_[n]),this.drawElements(t,i,r,e),e=r;else this.drawReplaySkipping_(t,i,s);h||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(a),t.depthFunc(o))},se.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var r,e,o,a,u,f;for(o=this.startIndices[1+(f=this.startIndices.length-2)],r=this.styleIndices_.length-1;r>=0;--r)for(this.setFillStyle_(t,this.styles_[r]),a=this.styleIndices_[r];f>=0&&this.startIndices[f]>=a;){if(e=this.startIndices[f],void 0===s[di.getUid(u=this.startIndicesFeature[f]).toString()]&&u.getGeometry()&&(void 0===n||rs.intersects(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,e,o);var c=h(u);if(c)return c}f--,o=e}},se.prototype.drawReplaySkipping_=function(t,i,s){var h,n,r,e,o,a;for(r=n=this.startIndices[1+(o=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setFillStyle_(t,this.styles_[h]),e=this.styleIndices_[h];o>=0&&this.startIndices[o]>=e;)a=this.startIndices[o],s[di.getUid(this.startIndicesFeature[o]).toString()]&&(n!==r&&(this.drawElements(t,i,n,r),t.clear(t.DEPTH_BUFFER_BIT)),r=a),o--,n=a;n!==r&&(this.drawElements(t,i,n,r),t.clear(t.DEPTH_BUFFER_BIT)),n=r=e}},se.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_color,i)},se.prototype.setFillStrokeStyle=function(t,i){var s=t?t.getColor():[0,0,0,0];if(s=s instanceof CanvasGradient||s instanceof CanvasPattern?Ir.defaultFillStyle:Rn.asArray(s).map((function(t,i){return 3!=i?t/255:t}))||Ir.defaultFillStyle,this.state_.fillColor&&hs.equals(s,this.state_.fillColor)||(this.state_.fillColor=s,this.state_.changed=!0,this.styles_.push(s)),i)this.lineStringReplay.setFillStrokeStyle(null,i);else{var h=new $r({color:[0,0,0,0],lineWidth:0});this.lineStringReplay.setFillStrokeStyle(null,h)}};var he=function(t,i){this.space_=i,this.emptyBlocks_=[{x:0,y:0,width:t,height:t}],this.entries_={},this.context_=xh(t,t),this.canvas_=this.context_.canvas};he.prototype.get=function(t){return this.entries_[t]||null},he.prototype.add=function(t,i,s,h,n){var r,e,o;for(e=0,o=this.emptyBlocks_.length;e<o;++e)if((r=this.emptyBlocks_[e]).width>=i+this.space_&&r.height>=s+this.space_){var a={offsetX:r.x+this.space_,offsetY:r.y+this.space_,image:this.canvas_};return this.entries_[t]=a,h.call(n,this.context_,r.x+this.space_,r.y+this.space_),this.split_(e,r,i+this.space_,s+this.space_),a}return null},he.prototype.split_=function(t,i,s,h){i.width-s>i.height-h?this.updateBlocks_(t,{x:i.x+s,y:i.y,width:i.width-s,height:i.height},{x:i.x,y:i.y+h,width:s,height:i.height-h}):this.updateBlocks_(t,{x:i.x+s,y:i.y,width:i.width-s,height:h},{x:i.x,y:i.y+h,width:i.width,height:i.height-h})},he.prototype.updateBlocks_=function(t,i,s){var h=[t,1];i.width>0&&i.height>0&&h.push(i),s.width>0&&s.height>0&&h.push(s),this.emptyBlocks_.splice.apply(this.emptyBlocks_,h)};var ne=function(t){var i=t||{};this.currentSize_=void 0!==i.initialSize?i.initialSize:di.INITIAL_ATLAS_SIZE,this.maxSize_=void 0!==i.maxSize?i.maxSize:-1!=di.MAX_ATLAS_SIZE?di.MAX_ATLAS_SIZE:void 0!==di.WEBGL_MAX_TEXTURE_SIZE?di.WEBGL_MAX_TEXTURE_SIZE:2048,this.space_=void 0!==i.space?i.space:1,this.atlases_=[new he(this.currentSize_,this.space_)],this.currentHitSize_=this.currentSize_,this.hitAtlases_=[new he(this.currentHitSize_,this.space_)]};ne.prototype.getInfo=function(t){var i=this.getInfo_(this.atlases_,t);if(!i)return null;var s=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(i,s)},ne.prototype.getInfo_=function(t,i){var s,h,n;for(h=0,n=t.length;h<n;++h)if(s=t[h].get(i))return s;return null},ne.prototype.mergeInfos_=function(t,i){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:i.image}},ne.prototype.add=function(t,i,s,h,n,r){if(i+this.space_>this.maxSize_||s+this.space_>this.maxSize_)return null;var e=this.add_(!1,t,i,s,h,r);if(!e)return null;var o=this.add_(!0,t,i,s,void 0!==n?n:di.nullFunction,r);return this.mergeInfos_(e,o)},ne.prototype.add_=function(t,i,s,h,n,r){var e,o,a,u,f=t?this.hitAtlases_:this.atlases_;for(a=0,u=f.length;a<u;++a){if(o=(e=f[a]).add(i,s,h,n,r))return o;var c;o||a!==u-1||(t?(c=Math.min(2*this.currentHitSize_,this.maxSize_),this.currentHitSize_=c):(c=Math.min(2*this.currentSize_,this.maxSize_),this.currentSize_=c),e=new he(c,this.space_),f.push(e),++u)}return null};var re=function(t,i){qr.call(this,t,i),this.images_=[],this.textures_=[],this.measureCanvas_=xh(0,0).canvas,this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.atlases_={},this.currAtlas_=void 0,this.scale=1,this.opacity=1};di.inherits(re,qr),re.prototype.drawText=function(t,i){if(this.text_){var s=null,h=2,n=2;switch(t.getType()){case Yi:case Ki:h=(s=t.getFlatCoordinates()).length,n=t.getStride();break;case is:s=t.getCenter();break;case Hi:s=t.getFlatMidpoint();break;case Qi:h=(s=t.getFlatMidpoints()).length;break;case Zi:s=t.getFlatInteriorPoint();break;case $i:h=(s=t.getFlatInteriorPoints()).length}this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var r,e,o,a,u,f,c,l,v=this.currAtlas_,d=this.text_.split("\n"),M=this.getTextSize_(d),m=Math.round(M[0]*this.textAlign_-this.offsetX_),p=Math.round(M[1]*this.textBaseline_-this.offsetY_),g=this.state_.lineWidth/2*this.state_.scale;for(r=0,e=d.length;r<e;++r)for(u=0,f=v.height*r,o=0,a=(c=d[r].split("")).length;o<a;++o){if(l=v.atlas.getInfo(c[o])){var _=l.image;this.anchorX=m-u,this.anchorY=p-f,this.originX=0===o?l.offsetX-g:l.offsetX,this.originY=l.offsetY,this.height=v.height,this.width=0===o||o===c.length-1?v.width[c[o]]+g:v.width[c[o]],this.imageHeight=_.height,this.imageWidth=_.width,0===this.images_.length?this.images_.push(_):di.getUid(this.images_[this.images_.length-1])!=di.getUid(_)&&(this.groupIndices.push(this.indices.length),this.images_.push(_)),this.drawText_(s,0,h,n)}u+=this.width}}},re.prototype.getTextSize_=function(t){var i=this,s=this.currAtlas_,h=t.length*s.height;return[t.map((function(t){var h,n,r=0;for(h=0,n=t.length;h<n;++h){var e=t[h];s.width[e]||i.addCharToAtlas_(e),r+=s.width[e]?s.width[e]:0}return r})).reduce((function(t,i){return Math.max(t,i)})),h]},re.prototype.drawText_=function(t,i,s,h){var n,r;for(n=i,r=s;n<r;n+=h)this.drawCoordinates(t,i,s,h)},re.prototype.addCharToAtlas_=function(t){if(1===t.length){var i=this.currAtlas_,s=this.state_,h=this.measureCanvas_.getContext("2d");h.font=s.font;var n=Math.ceil(h.measureText(t).width*s.scale);i.atlas.add(t,n,i.height,(function(i,h,n){i.font=s.font,i.fillStyle=s.fillColor,i.strokeStyle=s.strokeColor,i.lineWidth=s.lineWidth,i.lineCap=s.lineCap,i.lineJoin=s.lineJoin,i.miterLimit=s.miterLimit,i.textAlign="left",i.textBaseline="top",Ws.CANVAS_LINE_DASH&&s.lineDash&&(i.setLineDash(s.lineDash),i.lineDashOffset=s.lineDashOffset),1!==s.scale&&i.setTransform(s.scale,0,0,s.scale,0,0),s.strokeColor&&i.strokeText(t,h,n),s.fillColor&&i.fillText(t,h,n)}))&&(i.width[t]=n)}},re.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices=this.groupIndices,this.verticesBuffer=new Dr(this.vertices),this.indicesBuffer=new Dr(this.indices),this.createTextures(this.textures_,this.images_,{},i),this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.images_=null,this.atlases_={},this.currAtlas_=void 0,qr.prototype.finish.call(this,t)},re.prototype.setTextStyle=function(t){var i=this.state_,s=t.getFill(),h=t.getStroke();if(t&&t.getText()&&(s||h)){if(s){var n=s.getColor();i.fillColor=Pn.asColorLike(n||Ir.defaultFillStyle)}else i.fillColor=null;if(h){var r=h.getColor();i.strokeColor=Pn.asColorLike(r||Ir.defaultStrokeStyle),i.lineWidth=h.getWidth()||Ir.defaultLineWidth,i.lineCap=h.getLineCap()||Ir.defaultLineCap,i.lineDashOffset=h.getLineDashOffset()||Ir.defaultLineDashOffset,i.lineJoin=h.getLineJoin()||Ir.defaultLineJoin,i.miterLimit=h.getMiterLimit()||Ir.defaultMiterLimit;var e=h.getLineDash();i.lineDash=e?e.slice():Ir.defaultLineDash}else i.strokeColor=null,i.lineWidth=0;i.font=t.getFont()||Ir.defaultFont,i.scale=t.getScale()||1,this.text_=t.getText();var o=pr.TEXT_ALIGN[t.getTextAlign()],a=pr.TEXT_ALIGN[t.getTextBaseline()];this.textAlign_=void 0===o?Ir.defaultTextAlign:o,this.textBaseline_=void 0===a?Ir.defaultTextBaseline:a,this.offsetX_=t.getOffsetX()||0,this.offsetY_=t.getOffsetY()||0,this.rotateWithView=!!t.getRotateWithView(),this.rotation=t.getRotation()||0,this.currAtlas_=this.getAtlas_(i)}else this.text_=""},re.prototype.getAtlas_=function(t){var i,s=[];for(i in t)(t[i]||0===t[i])&&(Array.isArray(t[i])?s=s.concat(t[i]):s.push(t[i]));var h=this.calculateHash_(s);if(!this.atlases_[h]){var n=this.measureCanvas_.getContext("2d");n.font=t.font;var r=Math.ceil((1.5*n.measureText("M").width+t.lineWidth/2)*t.scale);this.atlases_[h]={atlas:new ne({space:t.lineWidth+1}),width:{},height:r}}return this.atlases_[h]},re.prototype.calculateHash_=function(t){var i,s,h="";for(i=0,s=t.length;i<s;++i)h+=t[i];return h},re.prototype.getTextures=function(){return this.textures_},re.prototype.getHitDetectionTextures=function(){return this.textures_};var ee=function(t,i,s){er.call(this),this.maxExtent_=i,this.tolerance_=t,this.renderBuffer_=s,this.replaysByZIndex_={}};di.inherits(ee,er),ee.prototype.addDeclutter=function(){},ee.prototype.getDeleteResourcesFunction=function(t){var i,s=[];for(i in this.replaysByZIndex_){var h,n=this.replaysByZIndex_[i];for(h in n)s.push(n[h].getDeleteResourcesFunction(t))}return function(){for(var t,i=s.length,h=0;h<i;h++)t=s[h].apply(this,arguments);return t}},ee.prototype.finish=function(t){var i;for(i in this.replaysByZIndex_){var s,h=this.replaysByZIndex_[i];for(s in h)h[s].finish(t)}},ee.prototype.getReplay=function(t,i){var s=void 0!==t?t.toString():"0",h=this.replaysByZIndex_[s];void 0===h&&(this.replaysByZIndex_[s]=h={});var n=h[i];return void 0===n&&(n=new(0,ee.BATCH_CONSTRUCTORS_[i])(this.tolerance_,this.maxExtent_),h[i]=n),n},ee.prototype.isEmpty=function(){return Si.isEmpty(this.replaysByZIndex_)},ee.prototype.replay=function(t,i,s,h,n,r,e,o){var a,u,f,c,l,v,d=Object.keys(this.replaysByZIndex_).map(Number);for(d.sort(hs.numberSafeCompareFunction),a=0,u=d.length;a<u;++a)for(l=this.replaysByZIndex_[d[a].toString()],f=0,c=pr.ORDER.length;f<c;++f)void 0!==(v=l[pr.ORDER[f]])&&v.replay(t,i,s,h,n,r,e,o,void 0,!1)},ee.prototype.replayHitDetection_=function(t,i,s,h,n,r,e,o,a,u,f){var c,l,v,d,M,m,p=Object.keys(this.replaysByZIndex_).map(Number);for(p.sort((function(t,i){return i-t})),c=0,l=p.length;c<l;++c)for(d=this.replaysByZIndex_[p[c].toString()],v=pr.ORDER.length-1;v>=0;--v)if(void 0!==(M=d[pr.ORDER[v]])&&(m=M.replay(t,i,s,h,n,r,e,o,a,u,f)))return m},ee.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,r,e,o,a,u){var f,c=i.getGL();return c.bindFramebuffer(c.FRAMEBUFFER,i.getHitDetectionFramebuffer()),void 0!==this.renderBuffer_&&(f=rs.buffer(rs.createOrUpdateFromCoordinate(t),h*this.renderBuffer_)),this.replayHitDetection_(i,t,h,n,ee.HIT_DETECTION_SIZE_,e,o,a,(function(t){var i=new Uint8Array(4);if(c.readPixels(0,0,1,1,c.RGBA,c.UNSIGNED_BYTE,i),i[3]>0){var s=u(t);if(s)return s}}),!0,f)},ee.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n,r,e,o,a){var u=i.getGL();return u.bindFramebuffer(u.FRAMEBUFFER,i.getHitDetectionFramebuffer()),void 0!==this.replayHitDetection_(i,t,h,n,ee.HIT_DETECTION_SIZE_,e,o,a,(function(){var t=new Uint8Array(4);return u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,t),t[3]>0}),!1)},ee.HIT_DETECTION_SIZE_=[1,1],ee.BATCH_CONSTRUCTORS_={Circle:Wr,Image:Br,LineString:Zr,Polygon:se,Text:re};var oe=function(t,i,s,h,n,r,e){Tn.call(this),this.context_=t,this.center_=i,this.extent_=r,this.pixelRatio_=e,this.size_=n,this.rotation_=h,this.resolution_=s,this.imageStyle_=null,this.fillStyle_=null,this.strokeStyle_=null,this.textStyle_=null};di.inherits(oe,Tn),oe.prototype.drawText_=function(t,i){var s=this.context_,h=t.getReplay(0,lr);h.setTextStyle(this.textStyle_),h.drawText(i,null),h.finish(s),h.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),h.getDeleteResourcesFunction(s)()},oe.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},oe.prototype.drawGeometry=function(t){switch(t.getType()){case Yi:this.drawPoint(t,null);break;case Hi:this.drawLineString(t,null);break;case Zi:this.drawPolygon(t,null);break;case Ki:this.drawMultiPoint(t,null);break;case Qi:this.drawMultiLineString(t,null);break;case $i:this.drawMultiPolygon(t,null);break;case ts:this.drawGeometryCollection(t,null);break;case is:this.drawCircle(t,null)}},oe.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);s&&rs.intersects(this.extent_,s.getExtent())&&(this.setStyle(i),this.drawGeometry(s))},oe.prototype.drawGeometryCollection=function(t){var i,s,h=t.getGeometriesArray();for(i=0,s=h.length;i<s;++i)this.drawGeometry(h[i])},oe.prototype.drawPoint=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,ur);n.setImageStyle(this.imageStyle_),n.drawPoint(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawMultiPoint=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,ur);n.setImageStyle(this.imageStyle_),n.drawMultiPoint(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawLineString=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,fr);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawLineString(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawMultiLineString=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,fr);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawMultiLineString(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawPolygon=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,cr);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawPolygon(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawMultiPolygon=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,cr);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawMultiPolygon(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.drawCircle=function(t,i){var s=this.context_,h=new ee(1,this.extent_),n=h.getReplay(0,or);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawCircle(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},oe.prototype.setImageStyle=function(t){this.imageStyle_=t},oe.prototype.setFillStrokeStyle=function(t,i){this.fillStyle_=t,this.strokeStyle_=i},oe.prototype.setTextStyle=function(t){this.textStyle_=t};var ae={};ae.fragment=new Nr(di.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n":"precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}"),ae.vertex=new Rr(di.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}");var ue=function(t,i){this.u_texCoordMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_texCoordMatrix":"d"),this.u_projectionMatrix=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_projectionMatrix":"e"),this.u_opacity=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_opacity":"f"),this.u_texture=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_texture":"g"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"b"),this.a_texCoord=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_texCoord":"c")},fe=function(t,i){Ln.call(this,i),this.mapRenderer=t,this.arrayBuffer_=new Dr([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0,this.texCoordMatrix=ys.create(),this.projectionMatrix=ys.create(),this.tmpMat4_=Or(),this.defaultLocations_=null};di.inherits(fe,Ln),fe.prototype.bindFramebuffer=function(t,i){var s=this.mapRenderer.getGL();if(void 0===this.framebufferDimension||this.framebufferDimension!=i){var h=function(t,i,s){t.isContextLost()||(t.deleteFramebuffer(i),t.deleteTexture(s))}.bind(null,s,this.framebuffer,this.texture);t.postRenderFunctions.push(h);var n=Xr.createEmptyTexture(s,i,i),r=s.createFramebuffer();s.bindFramebuffer(Ds.FRAMEBUFFER,r),s.framebufferTexture2D(Ds.FRAMEBUFFER,Ds.COLOR_ATTACHMENT0,Ds.TEXTURE_2D,n,0),this.texture=n,this.framebuffer=r,this.framebufferDimension=i}else s.bindFramebuffer(Ds.FRAMEBUFFER,this.framebuffer)},fe.prototype.composeFrame=function(t,i,s){this.dispatchComposeEvent_(Zh,s,t),s.bindBuffer(Ds.ARRAY_BUFFER,this.arrayBuffer_);var h,n=s.getGL(),r=s.getProgram(ae.fragment,ae.vertex);this.defaultLocations_?h=this.defaultLocations_:(h=new ue(n,r),this.defaultLocations_=h),s.useProgram(r)&&(n.enableVertexAttribArray(h.a_position),n.vertexAttribPointer(h.a_position,2,Ds.FLOAT,!1,16,0),n.enableVertexAttribArray(h.a_texCoord),n.vertexAttribPointer(h.a_texCoord,2,Ds.FLOAT,!1,16,8),n.uniform1i(h.u_texture,0)),n.uniformMatrix4fv(h.u_texCoordMatrix,!1,Lr(this.tmpMat4_,this.getTexCoordMatrix())),n.uniformMatrix4fv(h.u_projectionMatrix,!1,Lr(this.tmpMat4_,this.getProjectionMatrix())),n.uniform1f(h.u_opacity,i.opacity),n.bindTexture(Ds.TEXTURE_2D,this.getTexture()),n.drawArrays(Ds.TRIANGLE_STRIP,0,4),this.dispatchComposeEvent_(Jh,s,t)},fe.prototype.dispatchComposeEvent_=function(t,i,s){var h=this.getLayer();if(h.hasListener(t)){var n=s.viewState,r=new oe(i,n.center,n.resolution,n.rotation,s.size,s.extent,s.pixelRatio),e=new Sn(t,r,s,null,i);h.dispatchEvent(e)}},fe.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix},fe.prototype.getTexture=function(){return this.texture},fe.prototype.getProjectionMatrix=function(){return this.projectionMatrix},fe.prototype.handleWebGLContextLost=function(){this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0},fe.prototype.prepareFrame=function(){},fe.prototype.forEachLayerAtPixel=function(){};var ce=function(t,i){fe.call(this,t,i),this.image_=null,this.hitCanvasContext_=null,this.hitTransformationMatrix_=null};di.inherits(ce,fe),ce.handles=function(t,i){return t===Gh&&i.getType()===xn},ce.create=function(t,i){return new ce(t,i)},ce.prototype.createTexture_=function(t){var i=t.getImage(),s=this.mapRenderer.getGL();return Xr.createTexture(s,i,Ds.CLAMP_TO_EDGE,Ds.CLAMP_TO_EDGE)},ce.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var r=this.getLayer();return r.getSource().forEachFeatureAtCoordinate(t,i.viewState.resolution,i.viewState.rotation,s,i.skippedFeatureUids,(function(t){return h.call(n,t,r)}))},ce.prototype.prepareFrame=function(t,i){var s=this.mapRenderer.getGL(),h=t.pixelRatio,n=t.viewState,r=n.center,e=n.resolution,o=n.rotation,a=this.image_,u=this.texture,f=this.getLayer().getSource(),c=t.viewHints,l=t.extent;if(void 0!==i.extent&&(l=rs.getIntersection(l,i.extent)),!c[0]&&!c[1]&&!rs.isEmpty(l)){var v=n.projection;if(!di.ENABLE_RASTER_REPROJECTION){var d=f.getProjection();d&&(v=d)}var M=f.getImage(l,e,h,v);if(M&&this.loadImage(M)&&(a=M,u=this.createTexture_(M),this.texture)){var m=function(t,i){t.isContextLost()||t.deleteTexture(i)}.bind(null,s,this.texture);t.postRenderFunctions.push(m)}}if(a){var p=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(p.width,p.height,h,r,e,o,a.getExtent()),this.hitTransformationMatrix_=null;var g=this.texCoordMatrix;ys.reset(g),ys.scale(g,1,-1),ys.translate(g,0,-1),this.image_=a,this.texture=u,this.updateLogos(t,f)}return!!a},ce.prototype.updateProjectionMatrix_=function(t,i,s,h,n,r,e){var o=t*n,a=i*n,u=this.projectionMatrix;ys.reset(u),ys.scale(u,2*s/o,2*s/a),ys.rotate(u,-r),ys.translate(u,e[0]-h[0],e[1]-h[1]),ys.scale(u,(e[2]-e[0])/2,(e[3]-e[1])/2),ys.translate(u,1,1)},ce.prototype.hasFeatureAtCoordinate=function(t,i){return void 0!==this.forEachFeatureAtCoordinate(t,i,0,as.TRUE,this)},ce.prototype.forEachLayerAtPixel=function(t,i,s,h){if(this.image_&&this.image_.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==di.nullFunction){var n=ys.apply(i.pixelToCoordinateTransform,t.slice());return this.forEachFeatureAtCoordinate(n,i,0,as.TRUE,this)?s.call(h,this.getLayer(),null):void 0}var r=[this.image_.getImage().width,this.image_.getImage().height];this.hitTransformationMatrix_||(this.hitTransformationMatrix_=this.getHitTransformationMatrix_(i.size,r));var e=ys.apply(this.hitTransformationMatrix_,t.slice());if(!(e[0]<0||e[0]>r[0]||e[1]<0||e[1]>r[1])){this.hitCanvasContext_||(this.hitCanvasContext_=xh(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.image_.getImage(),e[0],e[1],1,1,0,0,1,1);var o=this.hitCanvasContext_.getImageData(0,0,1,1).data;return o[3]>0?s.call(h,this.getLayer(),o):void 0}}},ce.prototype.getHitTransformationMatrix_=function(t,i){var s=ys.create();ys.translate(s,-1,-1),ys.scale(s,2/t[0],2/t[1]),ys.translate(s,0,t[1]),ys.scale(s,1,-1);var h=ys.invert(this.projectionMatrix.slice()),n=ys.create();return ys.translate(n,0,i[1]),ys.scale(n,1,-1),ys.scale(n,i[0]/2,i[1]/2),ys.translate(n,1,1),ys.multiply(n,h),ys.multiply(n,s),n};var le=function(t,i){Vn.call(this,t,i),this.canvas_=document.createElement("CANVAS"),this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=Hh.CLASS_UNSELECTABLE,t.insertBefore(this.canvas_,t.childNodes[0]||null),this.clipTileCanvasWidth_=0,this.clipTileCanvasHeight_=0,this.clipTileContext_=xh(),this.renderedVisible_=!0,this.gl_=Ds.getContext(this.canvas_,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0}),this.context_=new Xr(this.canvas_,this.gl_),zi.listen(this.canvas_,jr,this.handleWebGLContextLost,this),zi.listen(this.canvas_,Ur,this.handleWebGLContextRestored,this),this.textureCache_=new zn,this.focus_=null,this.tileTextureQueue_=new fh(function(t){var i=t[1],s=t[2],h=i[0]-this.focus_[0],n=i[1]-this.focus_[1];return 65536*Math.log(s)+Math.sqrt(h*h+n*n)/s}.bind(this),(function(t){return t[0].getKey()})),this.loadNextTileTexture_=function(){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var t=this.tileTextureQueue_.dequeue();this.bindTileTexture(t[0],t[3],t[4],Ds.LINEAR,Ds.LINEAR)}return!1}.bind(this),this.textureCacheFrameMarkerCount_=0,this.initializeGL_()};di.inherits(le,Vn),le.handles=function(t){return Ws.WEBGL&&t===Gh},le.create=function(t,i){return new le(t,i)},le.prototype.bindTileTexture=function(t,i,s,h,n){var r=this.getGL(),e=t.getKey();if(this.textureCache_.containsKey(e)){var o=this.textureCache_.get(e);r.bindTexture(Ds.TEXTURE_2D,o.texture),o.magFilter!=h&&(r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_MAG_FILTER,h),o.magFilter=h),o.minFilter!=n&&(r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_MIN_FILTER,n),o.minFilter=n)}else{var a=r.createTexture();if(r.bindTexture(Ds.TEXTURE_2D,a),s>0){var u=this.clipTileContext_.canvas,f=this.clipTileContext_;this.clipTileCanvasWidth_!==i[0]||this.clipTileCanvasHeight_!==i[1]?(u.width=i[0],u.height=i[1],this.clipTileCanvasWidth_=i[0],this.clipTileCanvasHeight_=i[1]):f.clearRect(0,0,i[0],i[1]),f.drawImage(t.getImage(),s,s,i[0],i[1],0,0,i[0],i[1]),r.texImage2D(Ds.TEXTURE_2D,0,Ds.RGBA,Ds.RGBA,Ds.UNSIGNED_BYTE,u)}else r.texImage2D(Ds.TEXTURE_2D,0,Ds.RGBA,Ds.RGBA,Ds.UNSIGNED_BYTE,t.getImage());r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_MAG_FILTER,h),r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_MIN_FILTER,n),r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_WRAP_S,Ds.CLAMP_TO_EDGE),r.texParameteri(Ds.TEXTURE_2D,Ds.TEXTURE_WRAP_T,Ds.CLAMP_TO_EDGE),this.textureCache_.set(e,{texture:a,magFilter:h,minFilter:n})}},le.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();if(s.hasListener(t)){var h=this.context_,n=i.viewState,r=new oe(h,n.center,n.resolution,n.rotation,i.size,i.extent,i.pixelRatio),e=new Sn(t,r,i,null,h);s.dispatchEvent(e)}},le.prototype.disposeInternal=function(){var t=this.getGL();t.isContextLost()||this.textureCache_.forEach((function(i){i&&t.deleteTexture(i.texture)})),this.context_.dispose(),Vn.prototype.disposeInternal.call(this)},le.prototype.expireCache_=function(t,i){for(var s,h=this.getGL();this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>di.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK;){if(s=this.textureCache_.peekLast())h.deleteTexture(s.texture);else{if(+this.textureCache_.peekLastKey()==i.index)break;--this.textureCacheFrameMarkerCount_}this.textureCache_.pop()}},le.prototype.getContext=function(){return this.context_},le.prototype.getGL=function(){return this.gl_},le.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_},le.prototype.getType=function(){return Gh},le.prototype.handleWebGLContextLost=function(t){t.preventDefault(),this.textureCache_.clear(),this.textureCacheFrameMarkerCount_=0;var i=this.getLayerRenderers();for(var s in i)i[s].handleWebGLContextLost()},le.prototype.handleWebGLContextRestored=function(){this.initializeGL_(),this.getMap().render()},le.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(Ds.TEXTURE0),t.blendFuncSeparate(Ds.SRC_ALPHA,Ds.ONE_MINUS_SRC_ALPHA,Ds.ONE,Ds.ONE_MINUS_SRC_ALPHA),t.disable(Ds.CULL_FACE),t.disable(Ds.DEPTH_TEST),t.disable(Ds.SCISSOR_TEST),t.disable(Ds.STENCIL_TEST)},le.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())},le.prototype.renderFrame=function(t){var i=this.getContext(),s=this.getGL();if(s.isContextLost())return!1;if(!t)return this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1),!1;this.focus_=t.focus,this.textureCache_.set((-t.index).toString(),null),++this.textureCacheFrameMarkerCount_,this.dispatchComposeEvent_(Zh,t);var h=[],n=t.layerStatesArray;hs.stableSort(n,Vn.sortByZIndex);var r,e,o,a=t.viewState.resolution;for(r=0,e=n.length;r<e;++r)Qh.visibleAtResolution(o=n[r],a)&&o.sourceState==Oh&&this.getLayerRenderer(o.layer).prepareFrame(t,o,i)&&h.push(o);var u=t.size[0]*t.pixelRatio,f=t.size[1]*t.pixelRatio;for(this.canvas_.width==u&&this.canvas_.height==f||(this.canvas_.width=u,this.canvas_.height=f),s.bindFramebuffer(Ds.FRAMEBUFFER,null),s.clearColor(0,0,0,0),s.clear(Ds.COLOR_BUFFER_BIT),s.enable(Ds.BLEND),s.viewport(0,0,this.canvas_.width,this.canvas_.height),r=0,e=h.length;r<e;++r)this.getLayerRenderer((o=h[r]).layer).composeFrame(t,o,i);this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.calculateMatrices2D(t),this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>di.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK&&t.postRenderFunctions.push(this.expireCache_.bind(this)),this.tileTextureQueue_.isEmpty()||(t.postRenderFunctions.push(this.loadNextTileTexture_),t.animate=!0),this.dispatchComposeEvent_(Jh,t),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)},le.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,r,e){var o;if(this.getGL().isContextLost())return!1;var a,u=i.viewState,f=i.layerStatesArray;for(a=f.length-1;a>=0;--a){var c=f[a],l=c.layer;if(Qh.visibleAtResolution(c,u.resolution)&&r.call(e,l)&&(o=this.getLayerRenderer(l).forEachFeatureAtCoordinate(t,i,s,h,n)))return o}},le.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n){var r=!1;if(this.getGL().isContextLost())return!1;var e,o=i.viewState,a=i.layerStatesArray;for(e=a.length-1;e>=0;--e){var u=a[e],f=u.layer;if(Qh.visibleAtResolution(u,o.resolution)&&h.call(n,f)&&(r=this.getLayerRenderer(f).hasFeatureAtCoordinate(t,i)))return!0}return r},le.prototype.forEachLayerAtPixel=function(t,i,s,h,n){if(this.getGL().isContextLost())return!1;var r,e,o=i.viewState,a=i.layerStatesArray;for(e=a.length-1;e>=0;--e){var u=a[e],f=u.layer;if(Qh.visibleAtResolution(u,o.resolution)&&n.call(h,f)&&(r=this.getLayerRenderer(f).forEachLayerAtPixel(t,i,s,h)))return r}};var ve={};ve.fragment=new Nr(di.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n":"precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}"),ve.vertex=new Rr(di.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}");var de=function(t,i){this.u_tileOffset=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_tileOffset":"d"),this.u_texture=t.getUniformLocation(i,di.DEBUG_WEBGL?"u_texture":"e"),this.a_position=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_position":"b"),this.a_texCoord=t.getAttribLocation(i,di.DEBUG_WEBGL?"a_texCoord":"c")},Me=function(t,i){fe.call(this,t,i),this.fragmentShader_=ve.fragment,this.vertexShader_=ve.vertex,this.locations_=null,this.renderArrayBuffer_=new Dr([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]),this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,this.tmpSize_=[0,0]};di.inherits(Me,fe),Me.handles=function(t,i){return t===Gh&&i.getType()===En},Me.create=function(t,i){return new Me(t,i)},Me.prototype.disposeInternal=function(){this.mapRenderer.getContext().deleteBuffer(this.renderArrayBuffer_),fe.prototype.disposeInternal.call(this)},Me.prototype.createLoadedTileFinder=function(t,i,s){var h=this.mapRenderer;return function(n,r){return t.forEachLoadedTile(i,n,r,(function(t){var i=h.isTileTextureLoaded(t);return i&&(s[n]||(s[n]={}),s[n][t.tileCoord.toString()]=t),i}))}},Me.prototype.handleWebGLContextLost=function(){fe.prototype.handleWebGLContextLost.call(this),this.locations_=null},Me.prototype.prepareFrame=function(t,i,s){var h,n=this.mapRenderer,r=s.getGL(),e=t.viewState,o=e.projection,a=this.getLayer(),u=a.getSource(),f=u.getTileGridForProjection(o),c=f.getZForResolution(e.resolution),l=f.getResolution(c),v=u.getTilePixelSize(c,t.pixelRatio,o),d=v[0]/Uh(f.getTileSize(c),this.tmpSize_)[0],M=l/d,m=u.getTilePixelRatio(d)*u.getGutter(o),p=e.center,g=t.extent,_=f.getTileRangeForExtentAndZ(g,c);if(this.renderedTileRange_&&this.renderedTileRange_.equals(_)&&this.renderedRevision_==u.getRevision())h=this.renderedFramebufferExtent_;else{var w=_.getSize(),y=Math.max(w[0]*v[0],w[1]*v[1]),b=Bi.roundUpToPowerOfTwo(y),x=M*b,E=f.getOrigin(c),C=E[0]+_.minX*v[0]*M,S=E[1]+_.minY*v[1]*M;h=[C,S,C+x,S+x],this.bindFramebuffer(t,b),r.viewport(0,0,b,b),r.clearColor(0,0,0,0),r.clear(Ds.COLOR_BUFFER_BIT),r.disable(Ds.BLEND);var z=s.getProgram(this.fragmentShader_,this.vertexShader_);s.useProgram(z),this.locations_||(this.locations_=new de(r,z)),s.bindBuffer(Ds.ARRAY_BUFFER,this.renderArrayBuffer_),r.enableVertexAttribArray(this.locations_.a_position),r.vertexAttribPointer(this.locations_.a_position,2,Ds.FLOAT,!1,16,0),r.enableVertexAttribArray(this.locations_.a_texCoord),r.vertexAttribPointer(this.locations_.a_texCoord,2,Ds.FLOAT,!1,16,8),r.uniform1i(this.locations_.u_texture,0);var A={};A[c]={};var k,N,R,P,T,O,L=this.createLoadedTileFinder(u,o,A),F=a.getUseInterimTilesOnError(),I=!0,D=rs.createEmpty(),W=new Un(0,0,0,0);for(P=_.minX;P<=_.maxX;++P)for(T=_.minY;T<=_.maxY;++T)if(N=u.getTile(c,P,T,d,o),void 0===i.extent||(O=f.getTileCoordExtent(N.tileCoord,D),rs.intersects(O,i.extent))){if(2==(R=N.getState())||4==R||3==R&&!F||(N=N.getInterimTile()),2==(R=N.getState())){if(n.isTileTextureLoaded(N)){A[c][N.tileCoord.toString()]=N;continue}}else if(4==R||3==R&&!F)continue;I=!1,f.forEachTileCoordParentTileRange(N.tileCoord,L,null,W,D)||(k=f.getTileCoordChildTileRange(N.tileCoord,W,D))&&L(c+1,k)}var G=Object.keys(A).map(Number);G.sort(hs.numberSafeCompareFunction);var V,j,U,X,q=new Float32Array(4);for(V=0,j=G.length;V<j;++V)for(U in X=A[G[V]])O=f.getTileCoordExtent((N=X[U]).tileCoord,D),q[0]=2*(O[2]-O[0])/x,q[1]=2*(O[3]-O[1])/x,q[2]=2*(O[0]-h[0])/x-1,q[3]=2*(O[1]-h[1])/x-1,r.uniform4fv(this.locations_.u_tileOffset,q),n.bindTileTexture(N,v,m*d,Ds.LINEAR,Ds.LINEAR),r.drawArrays(Ds.TRIANGLE_STRIP,0,4);I?(this.renderedTileRange_=_,this.renderedFramebufferExtent_=h,this.renderedRevision_=u.getRevision()):(this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,t.animate=!0)}this.updateUsedTiles(t.usedTiles,u,c,_);var B=n.getTileTextureQueue();this.manageTilePyramid(t,u,f,d,o,g,c,a.getPreload(),(function(t){2!=t.getState()||n.isTileTextureLoaded(t)||B.isKeyQueued(t.getKey())||B.enqueue([t,f.getTileCoordCenter(t.tileCoord),f.getResolution(t.tileCoord[0]),v,m*d])}),this),this.scheduleExpireCache(t,u),this.updateLogos(t,u);var Y=this.texCoordMatrix;return ys.reset(Y),ys.translate(Y,(Math.round(p[0]/l)*l-h[0])/(h[2]-h[0]),(Math.round(p[1]/l)*l-h[1])/(h[3]-h[1])),0!==e.rotation&&ys.rotate(Y,e.rotation),ys.scale(Y,t.size[0]*e.resolution/(h[2]-h[0]),t.size[1]*e.resolution/(h[3]-h[1])),ys.translate(Y,-.5,-.5),!0},Me.prototype.forEachLayerAtPixel=function(t,i,s,h){if(this.framebuffer){var n=ys.apply(this.texCoordMatrix,[t[0]/i.size[0],(i.size[1]-t[1])/i.size[1]].slice()),r=[n[0]*this.framebufferDimension,n[1]*this.framebufferDimension],e=this.mapRenderer.getContext().getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer);var o=new Uint8Array(4);return e.readPixels(r[0],r[1],1,1,e.RGBA,e.UNSIGNED_BYTE,o),o[3]>0?s.call(h,this.getLayer(),o):void 0}};var me=function(t,i){fe.call(this,t,i),this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=rs.createEmpty(),this.renderedRenderOrder_=null,this.replayGroup_=null,this.layerState_=null};di.inherits(me,fe),me.handles=function(t,i){return t===Gh&&i.getType()===Cn},me.create=function(t,i){return new me(t,i)},me.prototype.composeFrame=function(t,i,s){this.layerState_=i;var h=t.viewState,n=this.replayGroup_,r=t.size,e=t.pixelRatio,o=this.mapRenderer.getGL();n&&!n.isEmpty()&&(o.enable(o.SCISSOR_TEST),o.scissor(0,0,r[0]*e,r[1]*e),n.replay(s,h.center,h.resolution,h.rotation,r,e,i.opacity,i.managed?t.skippedFeatureUids:{}),o.disable(o.SCISSOR_TEST))},me.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var i=this.mapRenderer.getContext();t.getDeleteResourcesFunction(i)(),this.replayGroup_=null}fe.prototype.disposeInternal.call(this)},me.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){if(this.replayGroup_&&this.layerState_){var r=this.mapRenderer.getContext(),e=i.viewState,o=this.getLayer(),a={};return this.replayGroup_.forEachFeatureAtCoordinate(t,r,e.center,e.resolution,e.rotation,i.size,i.pixelRatio,this.layerState_.opacity,{},(function(t){var i=di.getUid(t).toString();if(!(i in a))return a[i]=!0,h.call(n,t,o)}))}},me.prototype.hasFeatureAtCoordinate=function(t,i){if(this.replayGroup_&&this.layerState_){var s=this.mapRenderer.getContext(),h=i.viewState;return this.replayGroup_.hasFeatureAtCoordinate(t,s,h.center,h.resolution,h.rotation,i.size,i.pixelRatio,this.layerState_.opacity,i.skippedFeatureUids)}return!1},me.prototype.forEachLayerAtPixel=function(t,i,s,h){var n=ys.apply(i.pixelToCoordinateTransform,t.slice());return this.hasFeatureAtCoordinate(n,i)?s.call(h,this.getLayer(),null):void 0},me.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},me.prototype.prepareFrame=function(t,i,s){var h=this.getLayer(),n=h.getSource();this.updateLogos(t,n);var r=t.viewHints[0],e=t.viewHints[1],o=h.getUpdateWhileAnimating(),a=h.getUpdateWhileInteracting();if(!this.dirty_&&!o&&r||!a&&e)return!0;var u=t.extent,f=t.viewState,c=f.projection,l=f.resolution,v=t.pixelRatio,d=h.getRevision(),M=h.getRenderBuffer(),m=h.getRenderOrder();void 0===m&&(m=Cr.defaultOrder);var p=rs.buffer(u,M*l);if(!this.dirty_&&this.renderedResolution_==l&&this.renderedRevision_==d&&this.renderedRenderOrder_==m&&rs.containsExtent(this.renderedExtent_,p))return!0;this.replayGroup_&&t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(s)),this.dirty_=!1;var g=new ee(Cr.getTolerance(l,v),p,h.getRenderBuffer());n.loadFeatures(p,l,c);var _=function(t){var i,s=t.getStyleFunction();if(s?i=s.call(t,l):(s=h.getStyleFunction())&&(i=s(t,l)),i){var n=this.renderFeature(t,l,v,i,g);this.dirty_=this.dirty_||n}};if(m){var w=[];n.forEachFeatureInExtent(p,(function(t){w.push(t)}),this),w.sort(m),w.forEach(_,this)}else n.forEachFeatureInExtent(p,_,this);return g.finish(s),this.renderedResolution_=l,this.renderedRevision_=d,this.renderedRenderOrder_=m,this.renderedExtent_=p,this.replayGroup_=g,!0},me.prototype.renderFeature=function(t,i,s,h,n){if(!h)return!1;var r=!1;if(Array.isArray(h))for(var e=h.length-1;e>=0;--e)r=Cr.renderFeature(n,t,h[e],Cr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||r;else r=Cr.renderFeature(n,t,h,Cr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||r;return r},di.ENABLE_CANVAS&&(Dh.register(Fh,jn),Dh.registerMultiple(Ih,[Dn,Xn,Sr,Ar])),di.ENABLE_WEBGL&&(Dh.register(Fh,le),Dh.registerMultiple(Ih,[ce,Me,me]));var pe=function(t){(t=Si.assign({},t)).controls||(t.controls=hn()),t.interactions||(t.interactions=wn()),Xh.call(this,t)};di.inherits(pe,Xh);var ge=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.snapToPixel_=t.snapToPixel};ge.prototype.getOpacity=function(){return this.opacity_},ge.prototype.getRotateWithView=function(){return this.rotateWithView_},ge.prototype.getRotation=function(){return this.rotation_},ge.prototype.getScale=function(){return this.scale_},ge.prototype.getSnapToPixel=function(){return this.snapToPixel_},ge.prototype.getAnchor=function(){},ge.prototype.getImage=function(){},ge.prototype.getHitDetectionImage=function(){},ge.prototype.getImageState=function(){},ge.prototype.getImageSize=function(){},ge.prototype.getHitDetectionImageSize=function(){},ge.prototype.getOrigin=function(){},ge.prototype.getSize=function(){},ge.prototype.setOpacity=function(t){this.opacity_=t},ge.prototype.setRotateWithView=function(t){this.rotateWithView_=t},ge.prototype.setRotation=function(t){this.rotation_=t},ge.prototype.setScale=function(t){this.scale_=t},ge.prototype.setSnapToPixel=function(t){this.snapToPixel_=t},ge.prototype.listenImageChange=function(){},ge.prototype.load=function(){},ge.prototype.unlistenImageChange=function(){};var _e=function(t){this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_),ge.call(this,{opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:1,snapToPixel:void 0===t.snapToPixel||t.snapToPixel})};di.inherits(_e,ge),_e.prototype.clone=function(){var t=new _e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},_e.prototype.getAnchor=function(){return this.anchor_},_e.prototype.getAngle=function(){return this.angle_},_e.prototype.getFill=function(){return this.fill_},_e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_},_e.prototype.getImage=function(){return this.canvas_},_e.prototype.getImageSize=function(){return this.imageSize_},_e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},_e.prototype.getImageState=function(){return 2},_e.prototype.getOrigin=function(){return this.origin_},_e.prototype.getPoints=function(){return this.points_},_e.prototype.getRadius=function(){return this.radius_},_e.prototype.getRadius2=function(){return this.radius2_},_e.prototype.getSize=function(){return this.size_},_e.prototype.getStroke=function(){return this.stroke_},_e.prototype.listenImageChange=function(){},_e.prototype.load=function(){},_e.prototype.unlistenImageChange=function(){},_e.prototype.render_=function(t){var i,s,h="",n="",r=0,e=null,o=0,a=0;this.stroke_&&(null===(s=this.stroke_.getColor())&&(s=Nn.defaultStrokeStyle),s=Pn.asColorLike(s),void 0===(a=this.stroke_.getWidth())&&(a=Nn.defaultLineWidth),e=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),Ws.CANVAS_LINE_DASH||(e=null,o=0),void 0===(n=this.stroke_.getLineJoin())&&(n=Nn.defaultLineJoin),void 0===(h=this.stroke_.getLineCap())&&(h=Nn.defaultLineCap),void 0===(r=this.stroke_.getMiterLimit())&&(r=Nn.defaultMiterLimit));var u=2*(this.radius_+a)+1,f={strokeStyle:s,strokeWidth:a,size:u,lineCap:h,lineDash:e,lineDashOffset:o,lineJoin:n,miterLimit:r};if(void 0===t){var c=xh(u,u);this.canvas_=c.canvas,i=u=this.canvas_.width,this.draw_(f,c,0,0),this.createHitDetectionCanvas_(f)}else{u=Math.round(u);var l,v=!this.fill_;v&&(l=this.drawHitDetectionCanvas_.bind(this,f));var d=this.getChecksum(),M=t.add(d,u,u,this.draw_.bind(this,f),l);this.canvas_=M.image,this.origin_=[M.offsetX,M.offsetY],i=M.image.width,v?(this.hitDetectionCanvas_=M.hitImage,this.hitDetectionImageSize_=[M.hitImage.width,M.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[i,i])}this.anchor_=[u/2,u/2],this.size_=[u,u],this.imageSize_=[i,i]},_e.prototype.draw_=function(t,i,s,h){var n,r,e;i.setTransform(1,0,0,1,0,0),i.translate(s,h),i.beginPath();var o=this.points_;if(o===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var a=void 0!==this.radius2_?this.radius2_:this.radius_;for(a!==this.radius_&&(o*=2),n=0;n<=o;n++)r=2*n*Math.PI/o-Math.PI/2+this.angle_,i.lineTo(t.size/2+(e=n%2==0?this.radius_:a)*Math.cos(r),t.size/2+e*Math.sin(r))}if(this.fill_){var u=this.fill_.getColor();null===u&&(u=Nn.defaultFillStyle),i.fillStyle=Pn.asColorLike(u),i.fill()}this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineCap=t.lineCap,i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke()),i.closePath()},_e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var i=xh(t.size,t.size);this.hitDetectionCanvas_=i.canvas,this.drawHitDetectionCanvas_(t,i,0,0)}},_e.prototype.drawHitDetectionCanvas_=function(t,i,s,h){i.setTransform(1,0,0,1,0,0),i.translate(s,h),i.beginPath();var n=this.points_;if(n===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var r,e,o,a=void 0!==this.radius2_?this.radius2_:this.radius_;for(a!==this.radius_&&(n*=2),r=0;r<=n;r++)o=2*r*Math.PI/n-Math.PI/2+this.angle_,i.lineTo(t.size/2+(e=r%2==0?this.radius_:a)*Math.cos(o),t.size/2+e*Math.sin(o))}i.fillStyle=Nn.defaultFillStyle,i.fill(),this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.stroke()),i.closePath()},_e.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-",i=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||t!=this.checksums_[1]||i!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var s="r"+t+i+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[s,t,i,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var we=function(t){var i=t||{};_e.call(this,{points:1/0,fill:i.fill,radius:i.radius,snapToPixel:i.snapToPixel,stroke:i.stroke,atlasManager:i.atlasManager})};di.inherits(we,_e),we.prototype.clone=function(){var t=new we({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},we.prototype.setRadius=function(t){this.radius_=t,this.render_(this.atlasManager_)};var ye=function(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.checksum_=void 0};ye.prototype.clone=function(){var t=this.getColor();return new ye({color:t&&t.slice?t.slice():t||void 0})},ye.prototype.getColor=function(){return this.color_},ye.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},ye.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_=this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient?di.getUid(this.color_).toString():"f"+(this.color_?Rn.asString(this.color_):"-")),this.checksum_};var be=function(t){var i=t||{};this.geometry_=null,this.geometryFunction_=be.defaultGeometryFunction,void 0!==i.geometry&&this.setGeometry(i.geometry),this.fill_=void 0!==i.fill?i.fill:null,this.image_=void 0!==i.image?i.image:null,this.renderer_=void 0!==i.renderer?i.renderer:null,this.stroke_=void 0!==i.stroke?i.stroke:null,this.text_=void 0!==i.text?i.text:null,this.zIndex_=i.zIndex};be.prototype.clone=function(){var t=this.getGeometry();return t&&t.clone&&(t=t.clone()),new be({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},be.prototype.getRenderer=function(){return this.renderer_},be.prototype.setRenderer=function(t){this.renderer_=t},be.prototype.getGeometry=function(){return this.geometry_},be.prototype.getGeometryFunction=function(){return this.geometryFunction_},be.prototype.getFill=function(){return this.fill_},be.prototype.setFill=function(t){this.fill_=t},be.prototype.getImage=function(){return this.image_},be.prototype.setImage=function(t){this.image_=t},be.prototype.getStroke=function(){return this.stroke_},be.prototype.setStroke=function(t){this.stroke_=t},be.prototype.getText=function(){return this.text_},be.prototype.setText=function(t){this.text_=t},be.prototype.getZIndex=function(){return this.zIndex_},be.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(i){return i.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=be.defaultGeometryFunction,this.geometry_=t},be.prototype.setZIndex=function(t){this.zIndex_=t},be.createFunction=function(t){var i,s;return"function"==typeof t?i=t:(Array.isArray(t)?s=t:(qi(t instanceof be,41),s=[t]),i=function(){return s}),i},be.default_=null,be.defaultFunction=function(){if(!be.default_){var t=new ye({color:"rgba(255,255,255,0.4)"}),i=new $r({color:"#3399CC",width:1.25});be.default_=[new be({image:new we({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return be.default_},be.createDefaultEditing=function(){var t={},i=[255,255,255,1],s=[0,153,255,1];return t[Zi]=[new be({fill:new ye({color:[255,255,255,.5]})})],t[$i]=t[Zi],t[Hi]=[new be({stroke:new $r({color:i,width:5})}),new be({stroke:new $r({color:s,width:3})})],t[Qi]=t[Hi],t[is]=t[Zi].concat(t[Hi]),t[Yi]=[new be({image:new we({radius:6,fill:new ye({color:s}),stroke:new $r({color:i,width:1.5})}),zIndex:1/0})],t[Ki]=t[Yi],t[ts]=t[Zi].concat(t[Hi],t[Yi]),t},be.defaultGeometryFunction=function(t){return t.getGeometry()};var xe=function(t){Ui.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,zi.listen(this,Ui.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),void 0!==t&&(t instanceof bs||!t?this.setGeometry(t):this.setProperties(t))};di.inherits(xe,Ui),xe.prototype.clone=function(){var t=new xe(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var s=this.getStyle();return s&&t.setStyle(s),t},xe.prototype.getGeometry=function(){return this.get(this.geometryName_)},xe.prototype.getId=function(){return this.id_},xe.prototype.getGeometryName=function(){return this.geometryName_},xe.prototype.getStyle=function(){return this.style_},xe.prototype.getStyleFunction=function(){return this.styleFunction_},xe.prototype.handleGeometryChange_=function(){this.changed()},xe.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(zi.unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=zi.listen(t,Ri,this.handleGeometryChange_,this)),this.changed()},xe.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},xe.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?xe.createStyleFunction(t):void 0,this.changed()},xe.prototype.setId=function(t){this.id_=t,this.changed()},xe.prototype.setGeometryName=function(t){zi.unlisten(this,Ui.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,zi.listen(this,Ui.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},xe.createStyleFunction=function(t){var i,s;return"function"==typeof t?i=2==t.length?function(i){return t(this,i)}:t:(Array.isArray(t)?s=t:(qi(t instanceof be,41),s=[t]),i=function(){return s}),i};var Ee={createOrUpdate:function(t,i,s,h){return void 0!==h?(h[0]=t,h[1]=i,h[2]=s,h):[t,i,s]},getKeyZXY:function(t,i,s){return t+"/"+i+"/"+s},getKey:function(t){return Ee.getKeyZXY(t[0],t[1],t[2])},fromKey:function(t){return t.split("/").map(Number)},hash:function(t){return(t[1]<<t[0])+t[2]},quadKey:function(t){var i,s,h=t[0],n=new Array(h),r=1<<h-1;for(i=0;i<h;++i)s=48,t[1]&r&&(s+=1),t[2]&r&&(s+=2),n[i]=String.fromCharCode(s),r>>=1;return n.join("")},withinExtentAndZ:function(t,i){var s=t[0],h=t[1],n=t[2];if(i.getMinZoom()>s||s>i.getMaxZoom())return!1;var r,e=i.getExtent();return!(r=e?i.getTileRangeForExtentAndZ(e,s):i.getFullTileRange(s))||r.containsXY(h,n)}},Ce={createFromTemplate:function(t,i){var s=/\{z\}/g,h=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(e){return e?t.replace(s,e[0].toString()).replace(h,e[1].toString()).replace(n,(function(){return(-e[2]-1).toString()})).replace(r,(function(){var t=i.getFullTileRange(e[0]);return qi(t,55),(t.getHeight()+e[2]).toString()})):void 0}},createFromTemplates:function(t,i){for(var s=t.length,h=new Array(s),n=0;n<s;++n)h[n]=Ce.createFromTemplate(t[n],i);return Ce.createFromTileUrlFunctions(h)},createFromTileUrlFunctions:function(t){return 1===t.length?t[0]:function(i,s,h){if(i){var n=Ee.hash(i),r=Bi.modulo(n,t.length);return t[r](i,s,h)}}},nullTileUrlFunction:function(){},expandUrl:function(t){var i=[],s=/\{([a-z])-([a-z])\}/.exec(t);if(s){var h,n=s[1].charCodeAt(0),r=s[2].charCodeAt(0);for(h=n;h<=r;++h)i.push(t.replace(s[0],String.fromCharCode(h)));return i}if(s=s=/\{(\d+)-(\d+)\}/.exec(t)){for(var e=parseInt(s[2],10),o=parseInt(s[1],10);o<=e;o++)i.push(t.replace(s[0],o.toString()));return i}return i.push(t),i}},Se=function(t,i,s){Ni.call(this);var h=s||{};this.tileCoord=t,this.state=i,this.interimTile=null,this.key="",this.transition_=void 0===h.transition?250:h.transition,this.transitionStarts_={}};di.inherits(Se,Ni),Se.prototype.changed=function(){this.dispatchEvent(Ri)},Se.prototype.getKey=function(){return this.key+"/"+this.tileCoord},Se.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return t;t=t.interimTile}while(t);return this},Se.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,i=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?i=t:0==t.getState()?i.interimTile=t.interimTile:i=t,t=i.interimTile}while(t)}},Se.prototype.getTileCoord=function(){return this.tileCoord},Se.prototype.getState=function(){return this.state},Se.prototype.setState=function(t){this.state=t,this.changed()},Se.prototype.load=function(){},Se.prototype.getAlpha=function(t,i){if(!this.transition_)return 1;var s=this.transitionStarts_[t];if(s){if(-1===s)return 1}else this.transitionStarts_[t]=s=i;var h=i-s+1e3/60;return h>=this.transition_?1:yh.easeIn(h/this.transition_)},Se.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},Se.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)};var ze=function(t,i,s,h,n,r){Se.call(this,t,i,r),this.crossOrigin_=h,this.src_=s,this.image_=new Image,null!==h&&(this.image_.crossOrigin=h),this.imageListenerKeys_=null,this.tileLoadFunction_=n};di.inherits(ze,Se),ze.prototype.disposeInternal=function(){1==this.state&&(this.unlistenImage_(),this.image_=ze.getBlankImage()),this.interimTile&&this.interimTile.dispose(),this.state=5,this.changed(),Se.prototype.disposeInternal.call(this)},ze.prototype.getImage=function(){return this.image_},ze.prototype.getKey=function(){return this.src_},ze.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.image_=ze.getBlankImage(),this.changed()},ze.prototype.handleImageLoad_=function(){this.state=this.image_.naturalWidth&&this.image_.naturalHeight?2:4,this.unlistenImage_(),this.changed()},ze.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.imageListenerKeys_=[zi.listenOnce(this.image_,Li,this.handleImageError_,this),zi.listenOnce(this.image_,Di,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},ze.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(zi.unlistenByKey),this.imageListenerKeys_=null},ze.getBlankImage=function(){var t=xh(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas};var Ae=function(t){zn.call(this,t)};di.inherits(Ae,zn),Ae.prototype.expireCache=function(t){for(var i,s;this.canExpireCache()&&(!((s=(i=this.peekLast()).tileCoord[0].toString())in t)||!t[s].contains(i.tileCoord));)this.pop().dispose()},Ae.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),i=Ee.fromKey(t)[0];this.forEach((function(t){t.tileCoord[0]!==i&&(this.remove(Ee.getKey(t.tileCoord)),t.dispose())}),this)}};var ke={calculateSourceResolution:function(t,i,s,h){var n=ws.transform(s,i,t),r=ws.getPointResolution(i,h,s),e=i.getMetersPerUnit();void 0!==e&&(r*=e);var o=t.getMetersPerUnit();void 0!==o&&(r/=o);var a=t.getExtent();if(!a||rs.containsCoordinate(a,n)){var u=ws.getPointResolution(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r},enlargeClipPoint_:function(t,i,s,h){var n=s-t,r=h-i,e=Math.sqrt(n*n+r*r);return[Math.round(s+n/e),Math.round(h+r/e)]},render:function(t,i,s,h,n,r,e,o,a,u,f){var c=xh(Math.round(s*t),Math.round(s*i));if(0===a.length)return c.canvas;c.scale(s,s);var l=rs.createEmpty();a.forEach((function(t){rs.extend(l,t.extent)}));var v=rs.getWidth(l),d=rs.getHeight(l),M=xh(Math.round(s*v/h),Math.round(s*d/h)),m=s/h;a.forEach((function(t){var i=t.extent[0]-l[0],s=-(t.extent[3]-l[3]),h=rs.getWidth(t.extent),n=rs.getHeight(t.extent);M.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,i*m,s*m,h*m,n*m)}));var p=rs.getTopLeft(e);return o.getTriangles().forEach((function(t){var i=t.source,n=t.target,e=i[0][0],o=i[0][1],a=i[1][0],u=i[1][1],f=i[2][0],v=i[2][1],d=(n[0][0]-p[0])/r,m=-(n[0][1]-p[1])/r,g=(n[1][0]-p[0])/r,_=-(n[1][1]-p[1])/r,w=(n[2][0]-p[0])/r,y=-(n[2][1]-p[1])/r,b=e,x=o;e=0,o=0;var E=Bi.solveLinearSystem([[a-=b,u-=x,0,0,g-d],[f-=b,v-=x,0,0,w-d],[0,0,a,u,_-m],[0,0,f,v,y-m]]);if(E){c.save(),c.beginPath();var C=(d+g+w)/3,S=(m+_+y)/3,z=ke.enlargeClipPoint_(C,S,d,m),A=ke.enlargeClipPoint_(C,S,g,_),k=ke.enlargeClipPoint_(C,S,w,y);c.moveTo(A[0],A[1]),c.lineTo(z[0],z[1]),c.lineTo(k[0],k[1]),c.clip(),c.transform(E[0],E[2],E[1],E[3],d,m),c.translate(l[0]-b,l[3]-x),c.scale(h/s,-h/s),c.drawImage(M.canvas,0,0),c.restore()}})),f&&(c.save(),c.strokeStyle="black",c.lineWidth=1,o.getTriangles().forEach((function(t){var i=t.target,s=(i[0][0]-p[0])/r,h=-(i[0][1]-p[1])/r,n=(i[1][0]-p[0])/r,e=-(i[1][1]-p[1])/r,o=(i[2][0]-p[0])/r,a=-(i[2][1]-p[1])/r;c.beginPath(),c.moveTo(n,e),c.lineTo(s,h),c.lineTo(o,a),c.closePath(),c.stroke()})),c.restore()),c.canvas}},Ne=function(t,i,s,h,n){this.sourceProj_=t,this.targetProj_=i;var r={},e=ws.getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];return r[i]||(r[i]=e(t)),r[i]},this.maxSourceExtent_=h,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!h&&!!this.sourceProj_.getExtent()&&rs.getWidth(h)==rs.getWidth(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?rs.getWidth(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?rs.getWidth(this.targetProj_.getExtent()):null;var o=rs.getTopLeft(s),a=rs.getTopRight(s),u=rs.getBottomRight(s),f=rs.getBottomLeft(s),c=this.transformInv_(o),l=this.transformInv_(a),v=this.transformInv_(u),d=this.transformInv_(f);if(this.addQuad_(o,a,u,f,c,l,v,d,di.RASTER_REPROJECTION_MAX_SUBDIVISION),this.wrapsXInSource_){var M=1/0;this.triangles_.forEach((function(t){M=Math.min(M,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach((function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-M>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];i[0][0]-M>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-M>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-M>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);var s=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-s<this.sourceWorldWidth_/2&&(t.source=i)}}),this)}r={}};Ne.prototype.addTriangle_=function(t,i,s,h,n,r){this.triangles_.push({source:[h,n,r],target:[t,i,s]})},Ne.prototype.addQuad_=function(t,i,s,h,n,r,e,o,a){var u=rs.boundingExtent([n,r,e,o]),f=this.sourceWorldWidth_?rs.getWidth(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,l=this.sourceProj_.canWrapX()&&f>.5&&f<1,v=!1;if(a>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var d=rs.boundingExtent([t,i,s,h]);v|=rs.getWidth(d)/this.targetWorldWidth_>di.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}!l&&this.sourceProj_.isGlobal()&&f&&(v|=f>di.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH)}if(v||!this.maxSourceExtent_||rs.intersects(u,this.maxSourceExtent_)){if(!(v||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(o[0])&&isFinite(o[1]))){if(!(a>0))return;v=!0}if(a>0){if(!v){var M,m=this.transformInv_([(t[0]+s[0])/2,(t[1]+s[1])/2]);M=l?(Bi.modulo(n[0],c)+Bi.modulo(e[0],c))/2-Bi.modulo(m[0],c):(n[0]+e[0])/2-m[0];var p=(n[1]+e[1])/2-m[1];v=M*M+p*p>this.errorThresholdSquared_}if(v){if(Math.abs(t[0]-s[0])<=Math.abs(t[1]-s[1])){var g=[(i[0]+s[0])/2,(i[1]+s[1])/2],_=this.transformInv_(g),w=[(h[0]+t[0])/2,(h[1]+t[1])/2],y=this.transformInv_(w);this.addQuad_(t,i,g,w,n,r,_,y,a-1),this.addQuad_(w,g,s,h,y,_,e,o,a-1)}else{var b=[(t[0]+i[0])/2,(t[1]+i[1])/2],x=this.transformInv_(b),E=[(s[0]+h[0])/2,(s[1]+h[1])/2],C=this.transformInv_(E);this.addQuad_(t,b,E,h,n,x,C,o,a-1),this.addQuad_(b,i,s,E,x,r,e,C,a-1)}return}}if(l){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,s,h,n,e,o),this.addTriangle_(t,i,s,n,r,e)}},Ne.prototype.calculateSourceExtent=function(){var t=rs.createEmpty();return this.triangles_.forEach((function(i){var s=i.source;rs.extendCoordinate(t,s[0]),rs.extendCoordinate(t,s[1]),rs.extendCoordinate(t,s[2])})),t},Ne.prototype.getTriangles=function(){return this.triangles_};var Re=function(t,i,s,h,n,r,e,o,a,u,f){Se.call(this,n,0),this.renderEdges_=void 0!==f&&f,this.pixelRatio_=e,this.gutter_=o,this.canvas_=null,this.sourceTileGrid_=i,this.targetTileGrid_=h,this.wrappedTileCoord_=r||n,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var c=h.getTileCoordExtent(this.wrappedTileCoord_),l=this.targetTileGrid_.getExtent(),v=this.sourceTileGrid_.getExtent(),d=l?rs.getIntersection(c,l):c;if(0!==rs.getArea(d)){var M=t.getExtent();M&&(v=v?rs.getIntersection(v,M):M);var m=h.getResolution(this.wrappedTileCoord_[0]),p=rs.getCenter(d),g=ke.calculateSourceResolution(t,s,p,m);if(!isFinite(g)||g<=0)this.state=4;else if(this.triangulation_=new Ne(t,s,d,v,g*(void 0!==u?u:di.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD)),0!==this.triangulation_.getTriangles().length){this.sourceZ_=i.getZForResolution(g);var _=this.triangulation_.calculateSourceExtent();if(v&&(t.canWrapX()?(_[1]=Bi.clamp(_[1],v[1],v[3]),_[3]=Bi.clamp(_[3],v[1],v[3])):_=rs.getIntersection(_,v)),rs.getArea(_)){for(var w=i.getTileRangeForExtentAndZ(_,this.sourceZ_),y=w.minX;y<=w.maxX;y++)for(var b=w.minY;b<=w.maxY;b++){var x=a(this.sourceZ_,y,b,e);x&&this.sourceTiles_.push(x)}0===this.sourceTiles_.length&&(this.state=4)}else this.state=4}else this.state=4}else this.state=4};di.inherits(Re,Se),Re.prototype.disposeInternal=function(){1==this.state&&this.unlistenSources_(),Se.prototype.disposeInternal.call(this)},Re.prototype.getImage=function(){return this.canvas_},Re.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach((function(i){i&&2==i.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(i.tileCoord),image:i.getImage()})}),this),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var i=this.wrappedTileCoord_[0],s=this.targetTileGrid_.getTileSize(i),h="number"==typeof s?s:s[0],n="number"==typeof s?s:s[1],r=this.targetTileGrid_.getResolution(i),e=this.sourceTileGrid_.getResolution(this.sourceZ_),o=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=ke.render(h,n,this.pixelRatio_,e,this.sourceTileGrid_.getExtent(),r,o,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=2}this.changed()},Re.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach((function(i){var s,h=i.getState();0!=h&&1!=h||(t++,s=zi.listen(i,Ri,(function(){var h=i.getState();2!=h&&3!=h&&4!=h||(zi.unlistenByKey(s),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this),this.sourcesListenerKeys_.push(s))}),this),this.sourceTiles_.forEach((function(t){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},Re.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(zi.unlistenByKey),this.sourcesListenerKeys_=null};var Pe=function(t){var i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,qi(hs.isSorted(this.resolutions_,(function(t,i){return i-t}),!0),17),!t.origins)for(var s=0,h=this.resolutions_.length-1;s<h;++s)if(i){if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=void 0;break}}else i=this.resolutions_[s]/this.resolutions_[s+1];this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,qi(this.origins_.length==this.resolutions_.length,20));var n=t.extent;void 0===n||this.origin_||this.origins_||(this.origin_=rs.getTopLeft(n)),qi(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,qi(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:di.DEFAULT_TILE_SIZE,qi(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==n?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t){return new Un(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))}),this):n&&this.calculateTileRanges_(n)};Pe.tmpTileCoord_=[0,0,0],Pe.prototype.forEachTileCoord=function(t,i,s){for(var h=this.getTileRangeForExtentAndZ(t,i),n=h.minX,r=h.maxX;n<=r;++n)for(var e=h.minY,o=h.maxY;e<=o;++e)s([i,n,e])},Pe.prototype.forEachTileCoordParentTileRange=function(t,i,s,h,n){var r,e,o,a=null,u=t[0]-1;for(2===this.zoomFactor_?(e=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);u>=this.minZoom;){if(2===this.zoomFactor_?(e=Math.floor(e/2),o=Math.floor(o/2),r=Un.createOrUpdate(e,e,o,o,h)):r=this.getTileRangeForExtentAndZ(a,u,h),i.call(s,u,r))return!0;--u}return!1},Pe.prototype.getExtent=function(){return this.extent_},Pe.prototype.getMaxZoom=function(){return this.maxZoom},Pe.prototype.getMinZoom=function(){return this.minZoom},Pe.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},Pe.prototype.getResolution=function(t){return this.resolutions_[t]},Pe.prototype.getResolutions=function(){return this.resolutions_},Pe.prototype.getTileCoordChildTileRange=function(t,i,s){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var h=2*t[1],n=2*t[2];return Un.createOrUpdate(h,h+1,n,n+1,i)}var r=this.getTileCoordExtent(t,s);return this.getTileRangeForExtentAndZ(r,t[0]+1,i)}return null},Pe.prototype.getTileRangeExtent=function(t,i,s){var h=this.getOrigin(t),n=this.getResolution(t),r=Uh(this.getTileSize(t),this.tmpSize_);return rs.createOrUpdate(h[0]+i.minX*r[0]*n,h[1]+i.minY*r[1]*n,h[0]+(i.maxX+1)*r[0]*n,h[1]+(i.maxY+1)*r[1]*n,s)},Pe.prototype.getTileRangeForExtentAndZ=function(t,i,s){var h=Pe.tmpTileCoord_;this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,h);var n=h[1],r=h[2];return this.getTileCoordForXYAndZ_(t[2],t[3],i,!0,h),Un.createOrUpdate(n,h[1],r,h[2],s)},Pe.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]),s=this.getResolution(t[0]),h=Uh(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*h[0]*s,i[1]+(t[2]+.5)*h[1]*s]},Pe.prototype.getTileCoordExtent=function(t,i){var s=this.getOrigin(t[0]),h=this.getResolution(t[0]),n=Uh(this.getTileSize(t[0]),this.tmpSize_),r=s[0]+t[1]*n[0]*h,e=s[1]+t[2]*n[1]*h;return rs.createOrUpdate(r,e,r+n[0]*h,e+n[1]*h,i)},Pe.prototype.getTileCoordForCoordAndResolution=function(t,i,s){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,!1,s)},Pe.prototype.getTileCoordForXYAndResolution_=function(t,i,s,h,n){var r=this.getZForResolution(s),e=s/this.getResolution(r),o=this.getOrigin(r),a=Uh(this.getTileSize(r),this.tmpSize_),u=h?0:.5,f=Math.floor((t-o[0])/s+(h?.5:0)),c=Math.floor((i-o[1])/s+u),l=e*f/a[0],v=e*c/a[1];return h?(l=Math.ceil(l)-1,v=Math.ceil(v)-1):(l=Math.floor(l),v=Math.floor(v)),Ee.createOrUpdate(r,l,v,n)},Pe.prototype.getTileCoordForXYAndZ_=function(t,i,s,h,n){var r=this.getOrigin(s),e=this.getResolution(s),o=Uh(this.getTileSize(s),this.tmpSize_),a=h?0:.5,u=Math.floor((t-r[0])/e+(h?.5:0)),f=Math.floor((i-r[1])/e+a),c=u/o[0],l=f/o[1];return h?(c=Math.ceil(c)-1,l=Math.ceil(l)-1):(c=Math.floor(c),l=Math.floor(l)),Ee.createOrUpdate(s,c,l,n)},Pe.prototype.getTileCoordForCoordAndZ=function(t,i,s){return this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,s)},Pe.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},Pe.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},Pe.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},Pe.prototype.getZForResolution=function(t,i){var s=hs.linearFindNearest(this.resolutions_,t,i||0);return Bi.clamp(s,this.minZoom,this.maxZoom)},Pe.prototype.calculateTileRanges_=function(t){for(var i=this.resolutions_.length,s=new Array(i),h=this.minZoom;h<i;++h)s[h]=this.getTileRangeForExtentAndZ(t,h);this.fullTileRanges_=s};var Te={getForProjection:function(t){var i=t.getDefaultTileGrid();return i||(i=Te.createForProjection(t),t.setDefaultTileGrid(i)),i},wrapX:function(t,i,s){var h=i[0],n=t.getTileCoordCenter(i),r=Te.extentFromProjection(s);if(rs.containsCoordinate(r,n))return i;var e=rs.getWidth(r),o=Math.ceil((r[0]-n[0])/e);return n[0]+=e*o,t.getTileCoordForCoordAndZ(n,h)},createForExtent:function(t,i,s,h){var n=void 0!==h?h:ns,r=Te.resolutionsFromExtent(t,i,s);return new Pe({extent:t,origin:rs.getCorner(t,n),resolutions:r,tileSize:s})},createXYZ:function(t){var i={};return Si.assign(i,void 0!==t?t:{}),void 0===i.extent&&(i.extent=ws.get("EPSG:3857").getExtent()),i.resolutions=Te.resolutionsFromExtent(i.extent,i.maxZoom,i.tileSize),delete i.maxZoom,new Pe(i)},resolutionsFromExtent:function(t,i,s){for(var h=void 0!==i?i:di.DEFAULT_MAX_ZOOM,n=rs.getHeight(t),r=rs.getWidth(t),e=Uh(void 0!==s?s:di.DEFAULT_TILE_SIZE),o=Math.max(r/e[0],n/e[1]),a=h+1,u=new Array(a),f=0;f<a;++f)u[f]=o/Math.pow(2,f);return u},createForProjection:function(t,i,s,h){var n=Te.extentFromProjection(t);return Te.createForExtent(n,i,s,h)},extentFromProjection:function(t){var i=(t=ws.get(t)).getExtent();if(!i){var s=180*ws.METERS_PER_UNIT[vs.DEGREES]/t.getMetersPerUnit();i=rs.createOrUpdate(-s,-s,s,s)}return i}},Oe=function(t){this.html_=t.html,this.tileRanges_=t.tileRanges?t.tileRanges:null};Oe.prototype.getHTML=function(){return this.html_},Oe.prototype.intersectsAnyTileRange=function(t,i,s){if(!this.tileRanges_)return!0;var h,n,r,e;for(e in t){var o;if(e in this.tileRanges_)for(r=t[e],h=0,n=this.tileRanges_[e].length;h<n;++h){if((o=this.tileRanges_[e][h]).intersects(r))return!0;var a=i.getTileRangeForExtentAndZ(Te.extentFromProjection(s),parseInt(e,10)),u=a.getWidth();if(r.minX<a.minX||r.maxX>a.maxX){if(o.intersects(new Un(Bi.modulo(r.minX,u),Bi.modulo(r.maxX,u),r.minY,r.maxY)))return!0;if(r.getWidth()>u&&o.intersects(a))return!0}}}return!1};var Le=function(t){Ui.call(this),this.projection_=ws.get(t.projection),this.attributions_=null,this.attributions2_=this.adaptAttributions_(t.attributions),this.logo_=t.logo,this.state_=void 0!==t.state?t.state:Oh,this.wrapX_=void 0!==t.wrapX&&t.wrapX};di.inherits(Le,Ui),Le.prototype.adaptAttributions_=function(t){if(!t)return null;if(t instanceof Oe)return this.attributions_=[t],function(){return[t.getHTML()]};if(Array.isArray(t)){if(t[0]instanceof Oe){this.attributions_=t;var i=t.map((function(t){return t.getHTML()}));return function(){return i}}return this.attributions_=t.map((function(t){return new Oe({html:t})})),function(){return t}}return"function"==typeof t?t:(this.attributions_=[new Oe({html:t})],function(){return[t]})},Le.prototype.forEachFeatureAtCoordinate=di.nullFunction,Le.prototype.getAttributions=function(){return this.attributions_},Le.prototype.getAttributions2=function(){return this.attributions2_},Le.prototype.getLogo=function(){return this.logo_},Le.prototype.getProjection=function(){return this.projection_},Le.prototype.getResolutions=function(){},Le.prototype.getState=function(){return this.state_},Le.prototype.getWrapX=function(){return this.wrapX_},Le.prototype.refresh=function(){this.changed()},Le.prototype.setAttributions=function(t){this.attributions2_=this.adaptAttributions_(t),this.changed()},Le.prototype.setLogo=function(t){this.logo_=t},Le.prototype.setState=function(t){this.state_=t,this.changed()};var Fe=function(t){Le.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX}),this.opaque_=void 0!==t.opaque&&t.opaque,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.tileCache=new Ae(t.cacheSize),this.tmpSize=[0,0],this.key_="",this.tileOptions={transition:t.transition}};di.inherits(Fe,Le),Fe.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},Fe.prototype.expireCache=function(t,i){var s=this.getTileCacheForProjection(t);s&&s.expireCache(i)},Fe.prototype.forEachLoadedTile=function(t,i,s,h){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,e,o,a=!0,u=s.minX;u<=s.maxX;++u)for(var f=s.minY;f<=s.maxY;++f)e=Ee.getKeyZXY(i,u,f),o=!1,n.containsKey(e)&&(o=2===(r=n.get(e)).getState())&&(o=!1!==h(r)),o||(a=!1);return a},Fe.prototype.getGutter=function(){return 0},Fe.prototype.getKey=function(){return this.key_},Fe.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},Fe.prototype.getOpaque=function(){return this.opaque_},Fe.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},Fe.prototype.getTile=function(){},Fe.prototype.getTileGrid=function(){return this.tileGrid},Fe.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Te.getForProjection(t)},Fe.prototype.getTileCacheForProjection=function(t){var i=this.getProjection();return i&&!ws.equivalent(i,t)?null:this.tileCache},Fe.prototype.getTilePixelRatio=function(){return this.tilePixelRatio_},Fe.prototype.getTilePixelSize=function(t,i,s){var h=this.getTileGridForProjection(s),n=this.getTilePixelRatio(i),r=Uh(h.getTileSize(t),this.tmpSize);return 1==n?r:jh(r,n,this.tmpSize)},Fe.prototype.getTileCoordForTileUrlFunction=function(t,i){var s=void 0!==i?i:this.getProjection(),h=this.getTileGridForProjection(s);return this.getWrapX()&&s.isGlobal()&&(t=Te.wrapX(h,t,s)),Ee.withinExtentAndZ(t,h)?t:null},Fe.prototype.refresh=function(){this.tileCache.clear(),this.changed()},Fe.prototype.useTile=di.nullFunction,di.inherits(Fe.Event=function(t,i){ki.call(this,t),this.tile=i},ki);var Ie=function(t){Fe.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition}),this.tileLoadFunction=t.tileLoadFunction,this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Ce.nullTileUrlFunction,this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),t.tileUrlFunction&&this.setTileUrlFunction(t.tileUrlFunction),this.tileLoadingKeys_={}};di.inherits(Ie,Fe),Ie.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},Ie.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},Ie.prototype.getUrls=function(){return this.urls},Ie.prototype.handleTileChange=function(t){var i,s=t.target,h=di.getUid(s),n=s.getState();1==n?(this.tileLoadingKeys_[h]=!0,i="tileloadstart"):h in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[h],i=3==n?"tileloaderror":2==n||5==n?"tileloadend":void 0),null!=i&&this.dispatchEvent(new Fe.Event(i,s))},Ie.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},Ie.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==i?this.setKey(i):this.changed()},Ie.prototype.setUrl=function(t){var i=this.urls=Ce.expandUrl(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Ce.createFromTemplates(i,this.tileGrid),t)},Ie.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Ce.createFromTemplates(t,this.tileGrid),i)},Ie.prototype.useTile=function(t,i,s){var h=Ee.getKeyZXY(t,i,s);this.tileCache.containsKey(h)&&this.tileCache.get(h)};var De=function(t){Ie.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:De.defaultTileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:ze,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1};di.inherits(De,Ie),De.prototype.canExpireCache=function(){if(!di.ENABLE_RASTER_REPROJECTION)return Ie.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},De.prototype.expireCache=function(t,i){if(di.ENABLE_RASTER_REPROJECTION){var s=this.getTileCacheForProjection(t);for(var h in this.tileCache.expireCache(this.tileCache==s?i:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[h];n.expireCache(n==s?i:{})}}else Ie.prototype.expireCache.call(this,t,i)},De.prototype.getGutter=function(t){return di.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!ws.equivalent(this.getProjection(),t)?0:this.getGutterInternal()},De.prototype.getGutterInternal=function(){return 0},De.prototype.getOpaque=function(t){return!(di.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!ws.equivalent(this.getProjection(),t))&&Ie.prototype.getOpaque.call(this,t)},De.prototype.getTileGridForProjection=function(t){if(!di.ENABLE_RASTER_REPROJECTION)return Ie.prototype.getTileGridForProjection.call(this,t);var i=this.getProjection();if(!this.tileGrid||i&&!ws.equivalent(i,t)){var s=di.getUid(t).toString();return s in this.tileGridForProjection||(this.tileGridForProjection[s]=Te.getForProjection(t)),this.tileGridForProjection[s]}return this.tileGrid},De.prototype.getTileCacheForProjection=function(t){if(!di.ENABLE_RASTER_REPROJECTION)return Ie.prototype.getTileCacheForProjection.call(this,t);var i=this.getProjection();if(!i||ws.equivalent(i,t))return this.tileCache;var s=di.getUid(t).toString();return s in this.tileCacheForProjection||(this.tileCacheForProjection[s]=new Ae(this.tileCache.highWaterMark)),this.tileCacheForProjection[s]},De.prototype.createTile_=function(t,i,s,h,n,r){var e=[t,i,s],o=this.getTileCoordForTileUrlFunction(e,n),a=o?this.tileUrlFunction(o,h,n):void 0,u=new this.tileClass(e,void 0!==a?0:4,void 0!==a?a:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,zi.listen(u,Ri,this.handleTileChange,this),u},De.prototype.getTile=function(t,i,s,h,n){var r=this.getProjection();if(di.ENABLE_RASTER_REPROJECTION&&r&&n&&!ws.equivalent(r,n)){var e,o=this.getTileCacheForProjection(n),a=[t,i,s],u=Ee.getKey(a);o.containsKey(u)&&(e=o.get(u));var f=this.getKey();if(e&&e.key==f)return e;var c=this.getTileGridForProjection(r),l=this.getTileGridForProjection(n),v=this.getTileCoordForTileUrlFunction(a,n),d=new Re(r,c,n,l,a,v,this.getTilePixelRatio(h),this.getGutterInternal(),function(t,i,s,h){return this.getTileInternal(t,i,s,h,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return d.key=f,e?(d.interimTile=e,d.refreshInterimChain(),o.replace(u,d)):o.set(u,d),d}return this.getTileInternal(t,i,s,h,r||n)},De.prototype.getTileInternal=function(t,i,s,h,n){var r=null,e=Ee.getKeyZXY(t,i,s),o=this.getKey();if(this.tileCache.containsKey(e)){if((r=this.tileCache.get(e)).key!=o){var a=r;(r=this.createTile_(t,i,s,h,n,o)).interimTile=0==a.getState()?a.interimTile:a,r.refreshInterimChain(),this.tileCache.replace(e,r)}}else r=this.createTile_(t,i,s,h,n,o),this.tileCache.set(e,r);return r},De.prototype.setRenderReprojectionEdges=function(t){if(di.ENABLE_RASTER_REPROJECTION&&this.renderReprojectionEdges_!=t){for(var i in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[i].clear();this.changed()}},De.prototype.setTileGridForProjection=function(t,i){if(di.ENABLE_RASTER_REPROJECTION){var s=ws.get(t);if(s){var h=di.getUid(s).toString();h in this.tileGridForProjection||(this.tileGridForProjection[h]=i)}}},De.defaultTileLoadFunction=function(t,i){t.getImage().src=i};var We="KVP",Ge=function(t){this.matrixIds_=t.matrixIds,Pe.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};di.inherits(Ge,Pe),Ge.prototype.getMatrixId=function(t){return this.matrixIds_[t]},Ge.prototype.getMatrixIds=function(){return this.matrixIds_},Ge.createFromCapabilitiesMatrixSet=function(t,i,s){var h=[],n=[],r=[],e=[],o=[],a=void 0!==s?s:[],u="TileMatrix",f="Identifier",c="ScaleDenominator",l="TopLeftCorner",v=t.SupportedCRS,d=ws.get(v.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ws.get(v),M=d.getMetersPerUnit(),m="ne"==d.getAxisOrientation().substr(0,2);return t[u].sort((function(t,i){return i[c]-t[c]})),t[u].forEach((function(t){if(!(a.length>0)||hs.find(a,(function(i){return t[f]==i[u]}))){n.push(t[f]);var i=28e-5*t[c]/M,s=t.TileWidth,v=t.TileHeight;r.push(m?[t[l][1],t[l][0]]:t[l]),h.push(i),e.push(s==v?s:[s,v]),o.push([t.MatrixWidth,-t.MatrixHeight])}})),new Ge({extent:i,origins:r,resolutions:h,matrixIds:n,tileSizes:e,sizes:o})};var Ve=function(t,i){var s=[];Object.keys(i).forEach((function(t){null!=i[t]&&s.push(t+"="+encodeURIComponent(i[t]))}));var h=s.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+h},je=function(t){this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style;var i=t.urls;void 0===i&&void 0!==t.url&&(i=Ce.expandUrl(t.url)),this.requestEncoding_=void 0!==t.requestEncoding?t.requestEncoding:We;var s=this.requestEncoding_,h=t.tileGrid,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};s==We&&Si.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_});var r=this.dimensions_;this.createFromWMTSTemplate_=function(t){return t=s==We?Ve(t,n):t.replace(/\{(\w+?)\}/g,(function(t,i){return i.toLowerCase()in n?n[i.toLowerCase()]:t})),function(i){if(i){var n={TileMatrix:h.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};Si.assign(n,r);var e=t;return s==We?Ve(e,n):e.replace(/\{(\w+?)\}/g,(function(t,i){return n[i]}))}}};var e=i&&i.length>0?Ce.createFromTileUrlFunctions(i.map(this.createFromWMTSTemplate_)):Ce.nullTileUrlFunction;De.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:h,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:e,urls:i,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition}),this.setKey(this.getKeyForDimensions_())};di.inherits(je,De),je.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Ce.createFromTileUrlFunctions(t.map(this.createFromWMTSTemplate_.bind(this))),i)},je.prototype.getDimensions=function(){return this.dimensions_},je.prototype.getFormat=function(){return this.format_},je.prototype.getLayer=function(){return this.layer_},je.prototype.getMatrixSet=function(){return this.matrixSet_},je.prototype.getRequestEncoding=function(){return this.requestEncoding_},je.prototype.getStyle=function(){return this.style_},je.prototype.getVersion=function(){return this.version_},je.prototype.getKeyForDimensions_=function(){var t=0,i=[];for(var s in this.dimensions_)i[t++]=s+"-"+this.dimensions_[s];return i.join("/")},je.prototype.updateDimensions=function(t){Si.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},je.optionsFromCapabilities=function(t,i){var s=hs.find(t.Contents.Layer,(function(t){return t.Identifier==i.layer}));if(null===s)return null;var h,n,r,e=t.Contents.TileMatrixSet;(h=s.TileMatrixSetLink.length>1?hs.findIndex(s.TileMatrixSetLink,"projection"in i?function(t){var s=hs.find(e,(function(i){return i.Identifier==t.TileMatrixSet})).SupportedCRS,h=ws.get(s.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ws.get(s),n=ws.get(i.projection);return h&&n?ws.equivalent(h,n):s==i.projection}:function(t){return t.TileMatrixSet==i.matrixSet}):0)<0&&(h=0),n=s.TileMatrixSetLink[h].TileMatrixSet,r=s.TileMatrixSetLink[h].TileMatrixSetLimits;var o=s.Format[0];"format"in i&&(o=i.format),(h=hs.findIndex(s.Style,(function(t){return"style"in i?t.Title==i.style:t.isDefault})))<0&&(h=0);var a=s.Style[h].Identifier,u={};"Dimension"in s&&s.Dimension.forEach((function(t){var i=t.Default;void 0===i&&(i=t.Value[0]),u[t.Identifier]=i}));var f,c=hs.find(t.Contents.TileMatrixSet,(function(t){return t.Identifier==n})),l=c.SupportedCRS;if(l&&(f=ws.get(l.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ws.get(l)),"projection"in i){var v=ws.get(i.projection);v&&(f&&!ws.equivalent(v,f)||(f=v))}var d,M,m=s.WGS84BoundingBox;if(void 0!==m){var p=ws.get("EPSG:4326").getExtent();M=m[0]==p[0]&&m[2]==p[2],d=ws.transformExtent(m,"EPSG:4326",f);var g=f.getExtent();g&&(rs.containsExtent(g,d)||(d=void 0))}var _=Ge.createFromCapabilitiesMatrixSet(c,d,r),w=[],y=i.requestEncoding;if(y=void 0!==y?y:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var b=t.OperationsMetadata.GetTile.DCP.HTTP.Get,x=0,E=b.length;x<E;++x)if(b[x].Constraint){var C=hs.find(b[x].Constraint,(function(t){return"GetEncoding"==t.name})).AllowedValues.Value;if(""===y&&(y=C[0]),y!==We)break;hs.includes(C,We)&&w.push(b[x].href)}else b[x].href&&(y=We,w.push(b[x].href));return 0===w.length&&(y="REST",s.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(o=t.format,w.push(t.template))}))),{urls:w,layer:i.layer,matrixSet:n,format:o,projection:f,requestEncoding:y,tileGrid:_,style:a,dimensions:u,wrapX:M,crossOrigin:i.crossOrigin}};var Ue="arraybuffer",Xe={};Xe.DOCUMENT=document.implementation.createDocument("","",null),Xe.createElementNS=function(t,i){return Xe.DOCUMENT.createElementNS(t,i)},Xe.getAllTextContent=function(t,i){return Xe.getAllTextContent_(t,i,[]).join("")},Xe.getAllTextContent_=function(t,i,s){var h;if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)s.push(i?String(t.nodeValue).replace(/(\r\n|\r|\n)/g,""):t.nodeValue);else for(h=t.firstChild;h;h=h.nextSibling)Xe.getAllTextContent_(h,i,s);return s},Xe.isDocument=function(t){return t instanceof Document},Xe.isNode=function(t){return t instanceof Node},Xe.getAttributeNS=function(t,i,s){return t.getAttributeNS(i,s)||""},Xe.setAttributeNS=function(t,i,s,h){t.setAttributeNS(i,s,h)},Xe.parse=function(t){return(new DOMParser).parseFromString(t,"application/xml")},Xe.makeArrayExtender=function(t,i){return function(s,h){var n=t.call(i,s,h);void 0!==n&&hs.extend(h[h.length-1],n)}},Xe.makeArrayPusher=function(t,i){return function(s,h){var n=t.call(void 0!==i?i:this,s,h);void 0!==n&&h[h.length-1].push(n)}},Xe.makeReplacer=function(t,i){return function(s,h){var n=t.call(void 0!==i?i:this,s,h);void 0!==n&&(h[h.length-1]=n)}},Xe.makeObjectPropertyPusher=function(t,i,s){return function(h,n){var r=t.call(void 0!==s?s:this,h,n);if(void 0!==r){var e=n[n.length-1],o=void 0!==i?i:h.localName;(o in e?e[o]:e[o]=[]).push(r)}}},Xe.makeObjectPropertySetter=function(t,i,s){return function(h,n){var r=t.call(void 0!==s?s:this,h,n);void 0!==r&&(n[n.length-1][void 0!==i?i:h.localName]=r)}},Xe.makeChildAppender=function(t,i){return function(s,h,n){t.call(void 0!==i?i:this,s,h,n),n[n.length-1].node.appendChild(s)}},Xe.makeArraySerializer=function(t){var i,s;return function(h,n,r){if(void 0===i){i={};var e={};e[h.localName]=t,i[h.namespaceURI]=e,s=Xe.makeSimpleNodeFactory(h.localName)}Xe.serialize(i,s,n,r)}},Xe.makeSimpleNodeFactory=function(t,i){var s=t;return function(t,h,n){var r=s;void 0===r&&(r=n);var e=i;return void 0===i&&(e=h[h.length-1].node.namespaceURI),Xe.createElementNS(e,r)}},Xe.OBJECT_PROPERTY_NODE_FACTORY=Xe.makeSimpleNodeFactory(),Xe.makeSequence=function(t,i){for(var s=i.length,h=new Array(s),n=0;n<s;++n)h[n]=t[i[n]];return h},Xe.makeStructureNS=function(t,i,s){var h,n,r=void 0!==s?s:{};for(h=0,n=t.length;h<n;++h)r[t[h]]=i;return r},Xe.parseNode=function(t,i,s,h){var n;for(n=i.firstElementChild;n;n=n.nextElementSibling){var r=t[n.namespaceURI];if(void 0!==r){var e=r[n.localName];void 0!==e&&e.call(h,n,s)}}},Xe.pushParseAndPop=function(t,i,s,h,n){return h.push(t),Xe.parseNode(i,s,h,n),h.pop()},Xe.serialize=function(t,i,s,h,n,r){for(var e,o,a=(void 0!==n?n:s).length,u=0;u<a;++u)void 0!==(e=s[u])&&void 0!==(o=i.call(r,e,h,void 0!==n?n[u]:void 0))&&t[o.namespaceURI][o.localName].call(r,o,e,h)},Xe.pushSerializeAndPop=function(t,i,s,h,n,r,e){return n.push(t),Xe.serialize(i,s,h,n,r,e),n.pop()};var qe={loadFeaturesXhr:function(t,i,s,h){return function(n,r,e){var o=new XMLHttpRequest;o.open("GET","function"==typeof t?t(n,r,e):t,!0),i.getType()==Ue&&(o.responseType="arraybuffer"),o.onload=function(){if(!o.status||o.status>=200&&o.status<300){var t,n=i.getType();"json"==n||"text"==n?t=o.responseText:"xml"==n?(t=o.responseXML)||(t=Xe.parse(o.responseText)):n==Ue&&(t=o.response),t?s.call(this,i.readFeatures(t,{featureProjection:e}),i.readProjection(t),i.getLastExtent()):h.call(this)}else h.call(this)}.bind(this),o.onerror=function(){h.call(this)}.bind(this),o.send()}},xhr:function(t,i){return qe.loadFeaturesXhr(t,i,(function(t){this.addFeatures(t)}),di.nullFunction)}},Be={all:function(){return[[-1/0,-1/0,1/0,1/0]]},bbox:function(t){return[t]},tile:function(t){return function(i,s){var h=t.getZForResolution(s),n=t.getTileRangeForExtentAndZ(i,h),r=[],e=[h,0,0];for(e[1]=n.minX;e[1]<=n.maxX;++e[1])for(e[2]=n.minY;e[2]<=n.maxY;++e[2])r.push(t.getTileCoordExtent(e));return r}}},Ye="addfeature",He="removefeature",Je=function(t){var i=t||{};Le.call(this,{attributions:i.attributions,logo:i.logo,projection:void 0,state:Oh,wrapX:void 0===i.wrapX||i.wrapX}),this.loader_=di.nullFunction,this.format_=i.format,this.overlaps_=null==i.overlaps||i.overlaps,this.url_=i.url,void 0!==i.loader?this.loader_=i.loader:void 0!==this.url_&&(qi(this.format_,7),this.loader_=qe.xhr(this.url_,this.format_)),this.strategy_=void 0!==i.strategy?i.strategy:Be.all;var s,h,n=void 0===i.useSpatialIndex||i.useSpatialIndex;this.featuresRtree_=n?new ie:null,this.loadedExtentsRtree_=new ie,this.nullGeometryFeatures_={},this.idIndex_={},this.undefIdIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,i.features instanceof Xs?h=(s=i.features).getArray():Array.isArray(i.features)&&(h=i.features),n||void 0!==s||(s=new Xs(h)),void 0!==h&&this.addFeaturesInternal(h),void 0!==s&&this.bindFeaturesCollection_(s)};di.inherits(Je,Le),Je.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},Je.prototype.addFeatureInternal=function(t){var i=di.getUid(t).toString();if(this.addToIndex_(i,t)){this.setupChangeEvents_(i,t);var s=t.getGeometry();if(s){var h=s.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(h,t)}else this.nullGeometryFeatures_[i]=t;this.dispatchEvent(new Je.Event(Ye,t))}},Je.prototype.setupChangeEvents_=function(t,i){this.featureChangeKeys_[t]=[zi.listen(i,Ri,this.handleFeatureChange_,this),zi.listen(i,Ci,this.handleFeatureChange_,this)]},Je.prototype.addToIndex_=function(t,i){var s=!0,h=i.getId();return void 0!==h?h.toString()in this.idIndex_?s=!1:this.idIndex_[h.toString()]=i:(qi(!(t in this.undefIdIndex_),30),this.undefIdIndex_[t]=i),s},Je.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},Je.prototype.addFeaturesInternal=function(t){var i,s,h,n,r=[],e=[],o=[];for(s=0,h=t.length;s<h;s++)i=di.getUid(n=t[s]).toString(),this.addToIndex_(i,n)&&e.push(n);for(s=0,h=e.length;s<h;s++){i=di.getUid(n=e[s]).toString(),this.setupChangeEvents_(i,n);var a=n.getGeometry();if(a){var u=a.getExtent();r.push(u),o.push(n)}else this.nullGeometryFeatures_[i]=n}for(this.featuresRtree_&&this.featuresRtree_.load(r,o),s=0,h=e.length;s<h;s++)this.dispatchEvent(new Je.Event(Ye,e[s]))},Je.prototype.bindFeaturesCollection_=function(t){var i=!1;zi.listen(this,Ye,(function(s){i||(i=!0,t.push(s.feature),i=!1)})),zi.listen(this,He,(function(s){i||(i=!0,t.remove(s.feature),i=!1)})),zi.listen(t,js,(function(t){i||(i=!0,this.addFeature(t.element),i=!1)}),this),zi.listen(t,Us,(function(t){i||(i=!0,this.removeFeature(t.element),i=!1)}),this),this.featuresCollection_=t},Je.prototype.clear=function(t){if(t){for(var i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(zi.unlistenByKey);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.undefIdIndex_={})}else if(this.featuresRtree_)for(var s in this.featuresRtree_.forEach(this.removeFeatureInternal,this),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.loadedExtentsRtree_.clear(),this.nullGeometryFeatures_={};var h=new Je.Event("clear");this.dispatchEvent(h),this.changed()},Je.prototype.forEachFeature=function(t,i){return this.featuresRtree_?this.featuresRtree_.forEach(t,i):this.featuresCollection_?this.featuresCollection_.forEach(t,i):void 0},Je.prototype.forEachFeatureAtCoordinateDirect=function(t,i,s){return this.forEachFeatureInExtent([t[0],t[1],t[0],t[1]],(function(h){return h.getGeometry().intersectsCoordinate(t)?i.call(s,h):void 0}))},Je.prototype.forEachFeatureInExtent=function(t,i,s){return this.featuresRtree_?this.featuresRtree_.forEachInExtent(t,i,s):this.featuresCollection_?this.featuresCollection_.forEach(i,s):void 0},Je.prototype.forEachFeatureIntersectingExtent=function(t,i,s){return this.forEachFeatureInExtent(t,(function(h){if(h.getGeometry().intersectsExtent(t)){var n=i.call(s,h);if(n)return n}}))},Je.prototype.getFeaturesCollection=function(){return this.featuresCollection_},Je.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Si.isEmpty(this.nullGeometryFeatures_)||hs.extend(t,Si.getValues(this.nullGeometryFeatures_))),t},Je.prototype.getFeaturesAtCoordinate=function(t){var i=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){i.push(t)})),i},Je.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)},Je.prototype.getClosestFeatureToCoordinate=function(t,i){var s=t[0],h=t[1],n=null,r=[NaN,NaN],e=1/0,o=[-1/0,-1/0,1/0,1/0],a=i||as.TRUE;return this.featuresRtree_.forEachInExtent(o,(function(t){if(a(t)){var i=t.getGeometry(),u=e;if((e=i.closestPointXY(s,h,r,e))<u){n=t;var f=Math.sqrt(e);o[0]=s-f,o[1]=h-f,o[2]=s+f,o[3]=h+f}}})),n},Je.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},Je.prototype.getFeatureById=function(t){var i=this.idIndex_[t.toString()];return void 0!==i?i:null},Je.prototype.getFormat=function(){return this.format_},Je.prototype.getOverlaps=function(){return this.overlaps_},Je.prototype.getResolutions=function(){},Je.prototype.getUrl=function(){return this.url_},Je.prototype.handleFeatureChange_=function(t){var i=t.target,s=di.getUid(i).toString(),h=i.getGeometry();if(h){var n=h.getExtent();s in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[s],this.featuresRtree_&&this.featuresRtree_.insert(n,i)):this.featuresRtree_&&this.featuresRtree_.update(n,i)}else s in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(i),this.nullGeometryFeatures_[s]=i);var r=i.getId();if(void 0!==r){var e=r.toString();s in this.undefIdIndex_?(delete this.undefIdIndex_[s],this.idIndex_[e]=i):this.idIndex_[e]!==i&&(this.removeFromIdIndex_(i),this.idIndex_[e]=i)}else s in this.undefIdIndex_||(this.removeFromIdIndex_(i),this.undefIdIndex_[s]=i);this.changed(),this.dispatchEvent(new Je.Event("changefeature",i))},Je.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Si.isEmpty(this.nullGeometryFeatures_)},Je.prototype.loadFeatures=function(t,i,s){var h,n,r=this.loadedExtentsRtree_,e=this.strategy_(t,i);for(h=0,n=e.length;h<n;++h){var o=e[h];r.forEachInExtent(o,(function(t){return rs.containsExtent(t.extent,o)}))||(this.loader_.call(this,o,i,s),r.insert(o,{extent:o.slice()}))}},Je.prototype.removeLoadedExtent=function(t){var i,s=this.loadedExtentsRtree_;s.forEachInExtent(t,(function(s){if(rs.equals(s.extent,t))return i=s,!0})),i&&s.remove(i)},Je.prototype.removeFeature=function(t){var i=di.getUid(t).toString();i in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[i]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},Je.prototype.removeFeatureInternal=function(t){var i=di.getUid(t).toString();this.featureChangeKeys_[i].forEach(zi.unlistenByKey),delete this.featureChangeKeys_[i];var s=t.getId();void 0!==s?delete this.idIndex_[s.toString()]:delete this.undefIdIndex_[i],this.dispatchEvent(new Je.Event(He,t))},Je.prototype.removeFromIdIndex_=function(t){var i=!1;for(var s in this.idIndex_)if(this.idIndex_[s]===t){delete this.idIndex_[s],i=!0;break}return i},Je.prototype.setLoader=function(t){this.loader_=t},di.inherits(Je.Event=function(t,i){ki.call(this,t),this.feature=i},ki);var Ze="preload",Ke="useInterimTilesOnError",Qe=function(t){var i=t||{},s=Si.assign({},i);delete s.preload,delete s.useInterimTilesOnError,Qh.call(this,s),this.setPreload(void 0!==i.preload?i.preload:0),this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),this.type=En};di.inherits(Qe,Qh),Qe.prototype.getPreload=function(){return this.get(Ze)},Qe.prototype.setPreload=function(t){this.set(Ze,t)},Qe.prototype.getUseInterimTilesOnError=function(){return this.get(Ke)},Qe.prototype.setUseInterimTilesOnError=function(t){this.set(Ke,t)};var $e=function(t){var i=t||{},s=Si.assign({},i);delete s.style,delete s.renderBuffer,delete s.updateWhileAnimating,delete s.updateWhileInteracting,Qh.call(this,s),this.declutter_=void 0!==i.declutter&&i.declutter,this.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(i.style),this.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,this.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,this.renderMode_=i.renderMode||"vector",this.type=Cn};di.inherits($e,Qh),$e.prototype.getDeclutter=function(){return this.declutter_},$e.prototype.setDeclutter=function(t){this.declutter_=t},$e.prototype.getRenderBuffer=function(){return this.renderBuffer_},$e.prototype.getRenderOrder=function(){return this.get($e.Property_.RENDER_ORDER)},$e.prototype.getStyle=function(){return this.style_},$e.prototype.getStyleFunction=function(){return this.styleFunction_},$e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},$e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},$e.prototype.setRenderOrder=function(t){this.set($e.Property_.RENDER_ORDER,t)},$e.prototype.setStyle=function(t){this.style_=void 0!==t?t:be.defaultFunction,this.styleFunction_=null===t?void 0:be.createFunction(this.style_),this.changed()},$e.prototype.getRenderMode=function(){return this.renderMode_},$e.Property_={RENDER_ORDER:"renderOrder"};var to="degrees",io="metric",so=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-scale-line";this.innerElement_=document.createElement("DIV"),this.innerElement_.className=s+"-inner",this.element_=document.createElement("DIV"),this.element_.className=s+" "+Hh.CLASS_UNSELECTABLE,this.element_.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==i.minWidth?i.minWidth:64,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",qh.call(this,{element:this.element_,render:i.render?i.render:so.render,target:i.target}),zi.listen(this,Ui.getChangeEventType(so.Property_.UNITS),this.handleUnitsChanged_,this),this.setUnits(i.units||io)};di.inherits(so,qh),so.LEADING_DIGITS=[1,2,5],so.prototype.getUnits=function(){return this.get(so.Property_.UNITS)},so.render=function(t){var i=t.frameState;this.viewState_=i?i.viewState:null,this.updateElement_()},so.prototype.handleUnitsChanged_=function(){this.updateElement_()},so.prototype.setUnits=function(t){this.set(so.Property_.UNITS,t)},so.prototype.updateElement_=function(){var t=this.viewState_;if(t){var i=t.center,s=t.projection,h=this.getUnits(),n=ws.getPointResolution(s,t.resolution,i,h==to?vs.DEGREES:vs.METERS);h!=to&&(n*=s.getMetersPerUnit());var r=this.minWidth_*n,e="";if(h==to){var o=ws.METERS_PER_UNIT[vs.DEGREES];s.getUnits()==vs.DEGREES?r*=o:n/=o,r<o/60?(e="″",n*=3600):r<o?(e="′",n*=60):e="°"}else"imperial"==h?r<.9144?(e="in",n/=.0254):r<1609.344?(e="ft",n/=.3048):(e="mi",n/=1609.344):"nautical"==h?(n/=1852,e="nm"):h==io?r<.001?(e="μm",n*=1e6):r<1?(e="mm",n*=1e3):r<1e3?e="m":(e="km",n/=1e3):"us"==h?r<.9144?(e="in",n*=39.37):r<1609.344?(e="ft",n/=.30480061):(e="mi",n/=1609.3472):qi(!1,33);for(var a,u,f=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));;){if(a=so.LEADING_DIGITS[(f%3+3)%3]*Math.pow(10,Math.floor(f/3)),u=Math.round(a/n),isNaN(u))return this.element_.style.display="none",void(this.renderedVisible_=!1);if(u>=this.minWidth_)break;++f}var c=a+" "+e;this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},so.Property_={UNITS:"units"};var ho="fraction",no=function(t,i,s,h,n,r){Ni.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==h&&(this.image_.crossOrigin=h),this.canvas_=r?document.createElement("CANVAS"):null,this.color_=r,this.imageListenerKeys_=null,this.imageState_=n,this.size_=s,this.src_=i,this.tainting_=!1,2==this.imageState_&&this.determineTainting_()};di.inherits(no,Ni),no.get=function(t,i,s,h,n,r){var e=Gn.iconImageCache,o=e.get(i,h,r);return o||(o=new no(t,i,s,h,n,r),e.set(i,h,r,o)),o},no.prototype.determineTainting_=function(){var t=xh(1,1);try{t.drawImage(this.image_,0,0),t.getImageData(0,0,1,1)}catch(i){this.tainting_=!0}},no.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Ri)},no.prototype.handleImageError_=function(){this.imageState_=3,this.unlistenImage_(),this.dispatchChangeEvent_()},no.prototype.handleImageLoad_=function(){this.imageState_=2,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.determineTainting_(),this.replaceColor_(),this.dispatchChangeEvent_()},no.prototype.getImage=function(){return this.canvas_?this.canvas_:this.image_},no.prototype.getImageState=function(){return this.imageState_},no.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.tainting_){var t=this.size_[0],i=this.size_[1],s=xh(t,i);s.fillRect(0,0,t,i),this.hitDetectionImage_=s.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},no.prototype.getSize=function(){return this.size_},no.prototype.getSrc=function(){return this.src_},no.prototype.load=function(){if(0==this.imageState_){this.imageState_=1,this.imageListenerKeys_=[zi.listenOnce(this.image_,Li,this.handleImageError_,this),zi.listenOnce(this.image_,Di,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}},no.prototype.replaceColor_=function(){if(!this.tainting_&&null!==this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var i=t.getImageData(0,0,this.image_.width,this.image_.height),s=i.data,h=this.color_[0]/255,n=this.color_[1]/255,r=this.color_[2]/255,e=0,o=s.length;e<o;e+=4)s[e]*=h,s[e+1]*=n,s[e+2]*=r;t.putImageData(i,0,0)}},no.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(zi.unlistenByKey),this.imageListenerKeys_=null};var ro="bottom-left",eo="bottom-right",oo="top-left",ao="top-right",uo=function(t){var i=t||{};this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:oo,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:ho,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:ho,this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var s=void 0!==i.img?i.img:null,h=void 0!==i.imgSize?i.imgSize:null,n=i.src;qi(!(void 0!==n&&s),4),qi(!s||s&&h,5),void 0!==n&&0!==n.length||!s||(n=s.src||di.getUid(s).toString()),qi(void 0!==n&&n.length>0,6);var r=void 0!==i.src?0:2;this.color_=void 0!==i.color?Rn.asArray(i.color):null,this.iconImage_=no.get(s,n,h,this.crossOrigin_,r,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:oo,this.origin_=null,this.size_=void 0!==i.size?i.size:null,ge.call(this,{opacity:void 0!==i.opacity?i.opacity:1,rotation:void 0!==i.rotation?i.rotation:0,scale:void 0!==i.scale?i.scale:1,snapToPixel:void 0===i.snapToPixel||i.snapToPixel,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView})};di.inherits(uo,ge),uo.prototype.clone=function(){return new uo({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},uo.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,i=this.getSize();if(this.anchorXUnits_==ho||this.anchorYUnits_==ho){if(!i)return null;t=this.anchor_.slice(),this.anchorXUnits_==ho&&(t[0]*=i[0]),this.anchorYUnits_==ho&&(t[1]*=i[1])}if(this.anchorOrigin_!=oo){if(!i)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=ao&&this.anchorOrigin_!=eo||(t[0]=-t[0]+i[0]),this.anchorOrigin_!=ro&&this.anchorOrigin_!=eo||(t[1]=-t[1]+i[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},uo.prototype.getColor=function(){return this.color_},uo.prototype.getImage=function(t){return this.iconImage_.getImage(t)},uo.prototype.getImageSize=function(){return this.iconImage_.getSize()},uo.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},uo.prototype.getImageState=function(){return this.iconImage_.getImageState()},uo.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},uo.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=oo){var i=this.getSize(),s=this.iconImage_.getSize();if(!i||!s)return null;t=t.slice(),this.offsetOrigin_!=ao&&this.offsetOrigin_!=eo||(t[0]=s[0]-i[0]-t[0]),this.offsetOrigin_!=ro&&this.offsetOrigin_!=eo||(t[1]=s[1]-i[1]-t[1])}return this.origin_=t,this.origin_},uo.prototype.getSrc=function(){return this.iconImage_.getSrc()},uo.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},uo.prototype.listenImageChange=function(t,i){return zi.listen(this.iconImage_,Ri,t,i)},uo.prototype.load=function(){this.iconImage_.load()},uo.prototype.unlistenImageChange=function(t,i){zi.unlisten(this.iconImage_,Ri,t,i)},window.proj4=ht,window.proj4.defs("EPSG:2056","+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs");const fo={anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",scale:.5,src:`${window.stzhComponents.pathMedia}/olmap/marker.png`},co=Object.assign(Object.assign({},fo),{src:`${window.stzhComponents.pathMedia}/olmap/marker-active.png`}),lo=Object.assign(Object.assign({},fo),{anchor:[.5,.5],src:`${window.stzhComponents.pathMedia}/olmap/marker-position.png`}),vo=class{constructor(s){t(this,s),this.stzhInitialized=i(this,"stzhInitialized",7),this.stzhPostRender=i(this,"stzhPostRender",7),this.stzhMoveStart=i(this,"stzhMoveStart",7),this.stzhMoveEnd=i(this,"stzhMoveEnd",7),this.geoPositionChanged=!1,this.handlePostRender=()=>{this.stzhPostRender.emit({component:"stzh-olmap"})},this.handleMoveStart=()=>{this.stzhMoveStart.emit({component:"stzh-olmap"})},this.handleMoveEnd=()=>{this.stzhMoveEnd.emit({component:"stzh-olmap"})},this.handleInsideModalOpen=()=>{this.map&&requestAnimationFrame((()=>{this.map.updateSize()}))},this.handlePrintButtonClick=()=>{this.printIframe||(this.printIframe=document.createElement("iframe"),Object.assign(this.printIframe.style,{height:"0px",width:"0px",position:"absolute",border:"none"}),this.element.append(this.printIframe)),this.printIframe.innerHTML="";const t=this.printIframe.contentWindow,i=this.constructor.style.replace('@charset "UTF-8";',""),s=Array.from(document.querySelectorAll("link")).map((t=>t.outerHTML));let h;this.map.once("postcompose",(function(t){h=t.context.canvas.toDataURL("image/png")})),this.map.renderSync(),t.document.body.innerHTML=`\n ${s.join("")}\n\n <style type="text/css">\n ${i}\n </style>\n\n <div class="stzh-olmap__map stzh-olmap__map--print">\n <img class="stzh-olmap__print-image" src="${h}">\n ${this.element.querySelector(".ol-scale-line.ol-unselectable").outerHTML}\n </div>\n `,setTimeout((()=>{try{t.document.execCommand("print",!1,null)}catch(i){t.print()}}),1e3)},this.localization=void 0,this.hostname="www.ogc.stadt-zuerich.ch",this.scaleControl=!0,this.layerControl=!0,this.printControl=!0,this.locationControl=!1,this.layer="streets",this.zoom=7,this.zoomLocation=7,this.center=[2683311,1247082],this.centerMarker=!0,this.resolutions=[67.73333333333,33.8666666667,16.9333333333,8.4666666667,4.2333333333,2.1166666667,1.0583333333,.5291666667,.2645833333,.1322916667,.0661458333],this.layers={streets:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-streets.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"basiskarte_zuerich_gebaeudeschraegansicht",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}},satellite:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-satellite.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"orthofoto",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}}}}zoomWatcher(t){this.map&&this.map.getView().setZoom(t)}scaleControlWatcher(t){this.map&&(t?(this.scaleControlOl=new so({units:"metric"}),this.map.addControl(this.scaleControlOl)):(this.scaleControl&&this.map.removeControl(this.scaleControlOl),this.scaleControlOl=null))}printControlWatcher(t){this.map&&(t?(this.printControlElement=document.createElement("button"),this.printControlElement.className="ol-print",this.printControlElement.ariaLabel=this.localization.printLabel,this.printControlElement.addEventListener("click",this.handlePrintButtonClick),this.printControlElement.innerHTML='<stzh-icon name="print" class="ol-print__icon"></stzh-icon>',this.printControlOl=new qh({element:this.printControlElement}),this.map.addControl(this.printControlOl)):(this.printControlOl&&this.map.removeControl(this.printControlOl),this.printControlOl=null,this.printControlElement=null))}layerControlWatcher(t){this.map&&1!==this.layersArray.length&&(t?(this.layerControlElement=document.createElement("button"),this.layerControlElement.className="ol-layer",this.layerControlElement.addEventListener("click",(()=>{this.layer="streets"===this.layer?"satellite":"streets"})),this.layerControlImageElement=document.createElement("img"),this.layerControlImageElement.className="ol-layer__thumbnail",this.layerControlImageElement.setAttribute("role","presentation"),this.layerControlImageElement.setAttribute("alt",""),this.layerControlTextElement=document.createElement("span"),this.layerControlTextElement.className="ol-layer__text",this.layerControlElement.appendChild(this.layerControlImageElement),this.layerControlElement.appendChild(this.layerControlTextElement),this.layerControlOl=new qh({element:this.layerControlElement}),this.map.addControl(this.layerControlOl)):(this.layerControlOl&&this.map.removeControl(this.layerControlOl),this.layerControlOl=null,this.layerControlElement=null,this.layerControlImageElement=null,this.layerControlTextElement=null))}locationControlWatcher(t){if(this.map)if(t){this.locationControlElement=document.createElement("button"),this.locationControlElement.className="ol-location",this.locationControlElement.innerHTML='<stzh-icon name="target-bullet" class="ol-location__icon"></stzh-icon>',this.locationControlElement.addEventListener("click",(()=>{this.geolocation.getTracking()?this.disableLocationTracking():this.enableLocationTracking()})),this.locationControlOl=new qh({element:this.locationControlElement}),this.geolocation=new Vs({projection:this.map.getView().getProjection()}),this.positionMarkerOl=new xe,this.positionMarkerOl.setId("position");const t=new be({image:new uo(lo)});this.positionMarkerOl.setStyle(t),this.positionLayer.getSource().addFeature(this.positionMarkerOl),this.geolocation.on("change:position",(()=>{const t=this.geolocation.getPosition();this.positionMarkerOl.setGeometry(new Ns(t)),!this.geoPositionChanged&&rs.containsExtent(this.layers[this.layer].options.extent,this.positionMarkerOl.getGeometry().getExtent())&&(this.geoPositionChanged=!0,this.map.getView().setCenter(t),this.zoomLocation&&this.map.getView().setZoom(this.zoomLocation))})),this.geolocation.on("change:tracking",(()=>{const t=this.geolocation.getTracking();this.positionMarkerOl.setGeometry(null),this.setLocationControlState(t)})),this.geolocation.on("error",(()=>{this.setLocationControlState(!1)})),this.map.addControl(this.locationControlOl)}else this.disableLocationTracking(),this.locationControlOl&&this.map.removeControl(this.locationControlOl),this.positionMarkerOl&&this.positionLayer.getSource().removeFeature(this.positionMarkerOl),this.locationControlOl=null,this.locationControlElement=null,this.geolocation=null,this.positionMarkerOl=null}layerWatcher(t){this.map&&Object.entries(this.rasterLayers).forEach((([i,s])=>{if(i===t){s.setVisible(!0),this.map.getView().set("projection",this.projections[t]);const h=this.layersArray.find((([t])=>t!==this.layer));if(h&&(this.layerControlImageElement&&(this.layerControlImageElement.src=h[1].thumbnailUrl),this.layerControlTextElement)){let t="";"streets"===i?t=this.localization.streetsLayerTitle:"satellite"===i&&(t=this.localization.satelliteLayerTitle),this.layerControlTextElement.textContent=h[1].title||t}}else s.setVisible(!1)}))}centerWatcher(t){this.map.getView().setCenter(t),this.centerMarkerOl&&this.centerMarkerOl.setGeometry(new Ns(t))}async centerMarkerWatcher(t){t?this.centerMarkerOl=await this.addIconMarker(this.center):this.centerMarkerOl&&this.removeIconMarker(this.centerMarkerOl)}async getMap(){return this.map}async addIconMarker(t){const i=new xe({geometry:new Ns(t)}),s=new be({image:new uo(fo)});return i.setStyle(s),this.iconLayer.getSource().addFeature(i),i}async removeIconMarker(t){return this.iconLayer.getSource().removeFeature(t)}async setIconMarkerActive(t){t.setStyle(new be({image:new uo(co)}))}async setIconMarkerInactive(t){t.setStyle(new be({image:new uo(fo)}))}async enableLocationTracking(t=!0){this.setLocationControlState(!0),t&&(this.geoPositionChanged=!1),this.geolocation&&this.geolocation.setTracking(!0)}async disableLocationTracking(){this.setLocationControlState(!1),this.geolocation&&this.geolocation.setTracking(!1)}handleLoad(){this.map&&requestAnimationFrame((()=>{this.map.updateSize()}))}setLocationControlState(t){this.positionLayer&&this.positionLayer.setVisible(t),this.locationControlElement&&this.locationControlElement.classList.toggle("active",t)}createMap(){const t=document.createElement("stzh-icon");t.ariaLabel=this.localization.zoomInLabel,t.name="plus";const i=document.createElement("stzh-icon");i.ariaLabel=this.localization.zoomOutLabel,i.name="minus";const s=document.createElement("div");s.innerHTML='<svg width="16" height="24" viewBox="0 0 16 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.0011 22.5728L13.2809 12.0132H2.72134L8.0011 22.5728Z" fill="#DEDEDE" stroke="#BFBFBF" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" fill="#D0021B"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="#D0021B" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="black" stroke-opacity="0.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n';const h=document.createElement("span");return h.innerText=this.localization.rotateLabel,s.appendChild(h),new pe({controls:hn({zoomOptions:{zoomInLabel:t,zoomOutLabel:i,zoomInTipLabel:"",zoomOutTipLabel:""},rotateOptions:{label:s,tipLabel:""}}),interactions:wn({mouseWheelZoom:!1}),loadTilesWhileAnimating:!0,loadTilesWhileInteracting:!0,target:this.mapElement,logo:!1})}createRasterLayer(t,i){return new Qe({title:"wmts",type:"base",extent:i.extent,source:this.createLayerSource(t,i)})}createLayerSource(t,i){return this.projections||(this.projections={}),this.projections[t]=new Ms({code:"EPSG:2056",extent:i.extent}),this.creatRasterSource(t,i)}creatRasterSource(t,i){const{url:s,layer:h,matrixSet:n,origin:r}=i,e=[];for(let a=0;a<this.resolutions.length;a++)e.push(a);const o=new Ge({origin:r,resolutions:this.resolutions,matrixIds:e,tileSize:[512,512]});return new je({url:s,tileGrid:o,style:"default",projection:this.projections[t],crossOrigin:"anonymous",layer:h,matrixSet:n,requestEncoding:"REST"})}createIconLayer(){return new $e({source:new Je({})})}initMap(){if(this.map=this.createMap(),this.map.on("postrender",this.handlePostRender),this.map.on("movestart",this.handleMoveStart),this.map.on("moveend",this.handleMoveEnd),this.layersArray=Object.entries(this.layers),this.layersArray.length>2)throw new Error("There are only two different layers allowed.");this.rasterLayers={},this.layersArray.forEach((([t,i])=>{i.options.url=i.options.url.replace(/{hostname}/gi,this.hostname),this.rasterLayers[t]=this.createRasterLayer(t,i.options),this.map.addLayer(this.rasterLayers[t])})),this.positionLayer=this.createIconLayer(),this.positionLayer.setVisible(!1),this.map.addLayer(this.positionLayer),this.iconLayer=this.createIconLayer(),this.map.addLayer(this.iconLayer);const t=new bh({center:this.center,projection:this.projections[this.layer],zoom:this.zoom,resolutions:this.resolutions});this.map.setView(t),this.scaleControlWatcher(this.scaleControl),this.printControlWatcher(this.printControl),this.locationControlWatcher(this.locationControl),this.layerControlWatcher(this.layerControl),this.layerWatcher(this.layer),this.centerWatcher(this.center),this.centerMarkerWatcher(this.centerMarker),requestAnimationFrame((()=>{this.map.updateSize(),this.stzhInitialized.emit({component:"stzh-olmap"})}))}componentShouldUpdate(t,i,s){return["hostname","localization","layers","resolutions"].includes(s)}async componentWillLoad(){this.localization||(this.localization=await r(this.element,"olmap"))}componentWillUpdate(){this.map&&(this.map.setTarget(null),this.map=null)}componentDidRender(){this.map||this.initMap()}connectedCallback(){const t=this.element.closest("stzh-dialog");t&&t.addEventListener("stzhOpen",this.handleInsideModalOpen)}disconnectedCallback(){this.map&&(this.map.setTarget(null),this.map=null);const t=this.element.closest("stzh-dialog");t&&t.removeEventListener("stzhOpen",this.handleInsideModalOpen)}render(){return s(h,null,s("div",{class:{"stzh-olmap":!0,"stzh-olmap--has-no-layer-control":!this.layerControl,"stzh-olmap--has-no-print-control":!this.printControl,"stzh-olmap--has-location-control":this.locationControl}},s("div",{ref:t=>this.mapElement=t,class:"stzh-olmap__map"})))}get element(){return n(this)}static get watchers(){return{zoom:["zoomWatcher"],scaleControl:["scaleControlWatcher"],printControl:["printControlWatcher"],layerControl:["layerControlWatcher"],locationControl:["locationControlWatcher"],layer:["layerWatcher"],center:["centerWatcher"],centerMarker:["centerMarkerWatcher"]}}};vo.style=':host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}stzh-olmap{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block;position:relative;width:100%;height:18.75rem}stzh-olmap[hidden]{display:none}stzh-olmap *,stzh-olmap *::before,stzh-olmap *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}@media screen and (min-width: 800px){stzh-olmap{height:25rem}}.stzh-olmap{}.stzh-olmap__map{position:absolute;width:100%;height:100%;top:0;left:0}.stzh-olmap__map--print{margin-top:var(--stzh-space-xxlarge);max-width:100%;height:auto}.stzh-olmap__print-image{display:block;max-width:100%}.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:normal;font-size:var(--stzh-font-deca-font-size);line-height:var(--stzh-font-deca-text-line-height);letter-spacing:var(--stzh-font-deca-text-letter-spacing);position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;border-radius:0;color:var(--stzh-color-primary, var(--stzh-color-zueriblue));-webkit-transition:all var(--stzh-base-transition-animation-speed) ease;transition:all var(--stzh-base-transition-animation-speed) ease;background-color:var(--stzh-color-white);width:var(--stzh-form-input-small-height);height:var(--stzh-form-input-small-height);cursor:pointer}.stzh-olmap .ol-print stzh-icon,.stzh-olmap .ol-location stzh-icon,.stzh-olmap .ol-zoom-in stzh-icon,.stzh-olmap .ol-zoom-out stzh-icon,.stzh-olmap .ol-rotate-reset stzh-icon{--size:var(--stzh-icon-size-small)}.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:var(--stzh-color-white);background:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{position:absolute;right:var(--stzh-space-xsmall);bottom:var(--stzh-space-xsmall);-webkit-box-shadow:var(--stzh-box-shadow-popover);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-form-input-border-radius)}@media screen and (min-width: 800px){.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{right:var(--stzh-space-large);bottom:var(--stzh-space-large)}}.stzh-olmap .ol-layer{left:var(--stzh-space-xsmall);right:auto;padding:var(--stzh-space-xxxsmall);border:none;cursor:pointer}@media screen and (min-width: 800px){.stzh-olmap .ol-layer{left:var(--stzh-space-large)}}.stzh-olmap .ol-layer__thumbnail{width:4.75rem;height:4.75rem;display:block}.stzh-olmap .ol-layer__text{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:normal;font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;bottom:0;left:0;right:0;text-align:left;background-color:var(--stzh-color-white);color:var(--stzh-color-primary, var(--stzh-color-zueriblue));padding-left:calc(var(--stzh-space-xxxsmall) + 0.0625rem);padding-right:calc(var(--stzh-space-xxxsmall) + 0.0625rem)}.stzh-olmap .ol-layer:hover .ol-layer__text{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-olmap .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2)}.stzh-olmap .ol-location.active{background:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));border-color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark));color:var(--stzh-color-white)}.stzh-olmap .ol-zoom{margin-bottom:calc(var(--stzh-form-input-small-height) + var(--stzh-space-xsmall));background-color:var(--stzh-color-grey13)}.stzh-olmap .ol-zoom-in{margin-bottom:0.0625rem}.stzh-olmap .ol-rotate-reset{width:var(--stzh-space-xxlarge);height:var(--stzh-space-xxlarge);border-radius:50%;-webkit-box-shadow:none;box-shadow:none;border:0.0625rem solid var(--stzh-color-grey13);margin-right:calc((var(--stzh-form-input-small-height) - var(--stzh-space-xxlarge)) / 2);margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2)}.stzh-olmap .ol-rotate-reset span{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-olmap .ol-rotate-reset svg{width:0.99rem;height:1.32188rem}.stzh-olmap .ol-hidden .ol-rotate-reset{opacity:0}.stzh-olmap .ol-compass{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.stzh-olmap .ol-scale-line{position:absolute;bottom:var(--stzh-space-xsmall);margin-left:calc(4.75rem + var(--stzh-space-xxxsmall) + var(--stzh-space-xsmall));left:var(--stzh-space-xsmall)}@media screen and (min-width: 800px){.stzh-olmap .ol-scale-line{bottom:var(--stzh-space-large);left:var(--stzh-space-large)}}.stzh-olmap .ol-scale-line-inner{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:relative;color:var(--stzh-color-black);text-align:center;-webkit-filter:drop-shadow(-0.0625rem 0px 0px white) drop-shadow(0.0625rem 0px 0px white) drop-shadow(0px -0.0625rem 0px white) drop-shadow(0px 0.0625rem 0px white);filter:drop-shadow(-0.0625rem 0px 0px white) drop-shadow(0.0625rem 0px 0px white) drop-shadow(0px -0.0625rem 0px white) drop-shadow(0px 0.0625rem 0px white)}.stzh-olmap .ol-scale-line-inner::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:0.28125rem;border:0.0625rem solid var(--stzh-color-black);border-top:0}.stzh-olmap .ol-attribution{display:none}.stzh-olmap--has-no-layer-control .ol-scale-line{margin-left:0}.stzh-olmap--has-no-print-control .ol-zoom{margin-bottom:0}.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall))}.stzh-olmap--has-location-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 4 + var(--stzh-space-xsmall) * 3)}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall) * 2)}';export{vo as stzh_olmap}