@performant-software/core-data 1.2.0-beta.27 → 1.2.0-beta.28

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 (2979) hide show
  1. package/dist/index.cjs.js +2 -0
  2. package/dist/index.cjs.js.map +1 -0
  3. package/dist/index.cjs10.js +2 -0
  4. package/dist/index.cjs10.js.map +1 -0
  5. package/dist/index.cjs100.js +2 -0
  6. package/dist/index.cjs100.js.map +1 -0
  7. package/dist/index.cjs101.js +2 -0
  8. package/dist/index.cjs101.js.map +1 -0
  9. package/dist/index.cjs102.js +2 -0
  10. package/dist/index.cjs102.js.map +1 -0
  11. package/dist/index.cjs103.js +2 -0
  12. package/dist/index.cjs103.js.map +1 -0
  13. package/dist/index.cjs104.js +2 -0
  14. package/dist/index.cjs104.js.map +1 -0
  15. package/dist/index.cjs105.js +2 -0
  16. package/dist/index.cjs105.js.map +1 -0
  17. package/dist/index.cjs106.js +2 -0
  18. package/dist/index.cjs106.js.map +1 -0
  19. package/dist/index.cjs107.js +7 -0
  20. package/dist/index.cjs107.js.map +1 -0
  21. package/dist/index.cjs108.js +7 -0
  22. package/dist/index.cjs108.js.map +1 -0
  23. package/dist/index.cjs109.js +2 -0
  24. package/dist/index.cjs109.js.map +1 -0
  25. package/dist/index.cjs11.js +2 -0
  26. package/dist/index.cjs11.js.map +1 -0
  27. package/dist/index.cjs110.js +7 -0
  28. package/dist/index.cjs110.js.map +1 -0
  29. package/dist/index.cjs111.js +7 -0
  30. package/dist/index.cjs111.js.map +1 -0
  31. package/dist/index.cjs112.js +7 -0
  32. package/dist/index.cjs112.js.map +1 -0
  33. package/dist/index.cjs113.js +7 -0
  34. package/dist/index.cjs113.js.map +1 -0
  35. package/dist/index.cjs114.js +2 -0
  36. package/dist/index.cjs114.js.map +1 -0
  37. package/dist/index.cjs115.js +10 -0
  38. package/dist/index.cjs115.js.map +1 -0
  39. package/dist/index.cjs116.js +20 -0
  40. package/dist/index.cjs116.js.map +1 -0
  41. package/dist/index.cjs117.js +2 -0
  42. package/dist/index.cjs117.js.map +1 -0
  43. package/dist/index.cjs118.js +2 -0
  44. package/dist/index.cjs118.js.map +1 -0
  45. package/dist/index.cjs119.js +2 -0
  46. package/dist/index.cjs119.js.map +1 -0
  47. package/dist/index.cjs12.js +2 -0
  48. package/dist/index.cjs12.js.map +1 -0
  49. package/dist/index.cjs120.js +2 -0
  50. package/dist/index.cjs120.js.map +1 -0
  51. package/dist/index.cjs121.js +2 -0
  52. package/dist/index.cjs121.js.map +1 -0
  53. package/dist/index.cjs122.js +2 -0
  54. package/dist/index.cjs122.js.map +1 -0
  55. package/dist/index.cjs123.js +2 -0
  56. package/dist/index.cjs123.js.map +1 -0
  57. package/dist/index.cjs124.js +2 -0
  58. package/dist/index.cjs124.js.map +1 -0
  59. package/dist/index.cjs125.js +2 -0
  60. package/dist/index.cjs125.js.map +1 -0
  61. package/dist/index.cjs126.js +2 -0
  62. package/dist/index.cjs126.js.map +1 -0
  63. package/dist/index.cjs127.js +2 -0
  64. package/dist/index.cjs127.js.map +1 -0
  65. package/dist/index.cjs128.js +2 -0
  66. package/dist/index.cjs128.js.map +1 -0
  67. package/dist/index.cjs129.js +2 -0
  68. package/dist/index.cjs129.js.map +1 -0
  69. package/dist/index.cjs13.js +2 -0
  70. package/dist/index.cjs13.js.map +1 -0
  71. package/dist/index.cjs130.js +2 -0
  72. package/dist/index.cjs130.js.map +1 -0
  73. package/dist/index.cjs131.js +2 -0
  74. package/dist/index.cjs131.js.map +1 -0
  75. package/dist/index.cjs132.js +2 -0
  76. package/dist/index.cjs132.js.map +1 -0
  77. package/dist/index.cjs133.js +2 -0
  78. package/dist/index.cjs133.js.map +1 -0
  79. package/dist/index.cjs134.js +2 -0
  80. package/dist/index.cjs134.js.map +1 -0
  81. package/dist/index.cjs135.js +2 -0
  82. package/dist/index.cjs135.js.map +1 -0
  83. package/dist/index.cjs136.js +2 -0
  84. package/dist/index.cjs136.js.map +1 -0
  85. package/dist/index.cjs137.js +2 -0
  86. package/dist/index.cjs137.js.map +1 -0
  87. package/dist/index.cjs138.js +2 -0
  88. package/dist/index.cjs138.js.map +1 -0
  89. package/dist/index.cjs139.js +2 -0
  90. package/dist/index.cjs139.js.map +1 -0
  91. package/dist/index.cjs14.js +2 -0
  92. package/dist/index.cjs14.js.map +1 -0
  93. package/dist/index.cjs140.js +9 -0
  94. package/dist/index.cjs140.js.map +1 -0
  95. package/dist/index.cjs141.js +27 -0
  96. package/dist/index.cjs141.js.map +1 -0
  97. package/dist/index.cjs142.js +2 -0
  98. package/dist/index.cjs142.js.map +1 -0
  99. package/dist/index.cjs143.js +2 -0
  100. package/dist/index.cjs143.js.map +1 -0
  101. package/dist/index.cjs144.js +2 -0
  102. package/dist/index.cjs144.js.map +1 -0
  103. package/dist/index.cjs145.js +2 -0
  104. package/dist/index.cjs145.js.map +1 -0
  105. package/dist/index.cjs146.js +8 -0
  106. package/dist/index.cjs146.js.map +1 -0
  107. package/dist/index.cjs147.js +2 -0
  108. package/dist/index.cjs147.js.map +1 -0
  109. package/dist/index.cjs148.js +2 -0
  110. package/dist/index.cjs148.js.map +1 -0
  111. package/dist/index.cjs149.js +2 -0
  112. package/dist/index.cjs149.js.map +1 -0
  113. package/dist/index.cjs15.js +2 -0
  114. package/dist/index.cjs15.js.map +1 -0
  115. package/dist/index.cjs150.js +2 -0
  116. package/dist/index.cjs150.js.map +1 -0
  117. package/dist/index.cjs151.js +2 -0
  118. package/dist/index.cjs151.js.map +1 -0
  119. package/dist/index.cjs152.js +2 -0
  120. package/dist/index.cjs152.js.map +1 -0
  121. package/dist/index.cjs153.js +2 -0
  122. package/dist/index.cjs153.js.map +1 -0
  123. package/dist/index.cjs154.js +2 -0
  124. package/dist/index.cjs154.js.map +1 -0
  125. package/dist/index.cjs155.js +2 -0
  126. package/dist/index.cjs155.js.map +1 -0
  127. package/dist/index.cjs156.js +2 -0
  128. package/dist/index.cjs156.js.map +1 -0
  129. package/dist/index.cjs157.js +2 -0
  130. package/dist/index.cjs157.js.map +1 -0
  131. package/dist/index.cjs158.js +2 -0
  132. package/dist/index.cjs158.js.map +1 -0
  133. package/dist/index.cjs159.js +2 -0
  134. package/dist/index.cjs159.js.map +1 -0
  135. package/dist/index.cjs16.js +2 -0
  136. package/dist/index.cjs16.js.map +1 -0
  137. package/dist/index.cjs160.js +2 -0
  138. package/dist/index.cjs160.js.map +1 -0
  139. package/dist/index.cjs161.js +2 -0
  140. package/dist/index.cjs161.js.map +1 -0
  141. package/dist/index.cjs162.js +2 -0
  142. package/dist/index.cjs162.js.map +1 -0
  143. package/dist/index.cjs163.js +2 -0
  144. package/dist/index.cjs163.js.map +1 -0
  145. package/dist/index.cjs164.js +2 -0
  146. package/dist/index.cjs164.js.map +1 -0
  147. package/dist/index.cjs165.js +2 -0
  148. package/dist/index.cjs165.js.map +1 -0
  149. package/dist/index.cjs166.js +2 -0
  150. package/dist/index.cjs166.js.map +1 -0
  151. package/dist/index.cjs167.js +2 -0
  152. package/dist/index.cjs167.js.map +1 -0
  153. package/dist/index.cjs168.js +2 -0
  154. package/dist/index.cjs168.js.map +1 -0
  155. package/dist/index.cjs169.js +2 -0
  156. package/dist/index.cjs169.js.map +1 -0
  157. package/dist/index.cjs17.js +2 -0
  158. package/dist/index.cjs17.js.map +1 -0
  159. package/dist/index.cjs170.js +2 -0
  160. package/dist/index.cjs170.js.map +1 -0
  161. package/dist/index.cjs171.js +2 -0
  162. package/dist/index.cjs171.js.map +1 -0
  163. package/dist/index.cjs172.js +2 -0
  164. package/dist/index.cjs172.js.map +1 -0
  165. package/dist/index.cjs173.js +2 -0
  166. package/dist/index.cjs173.js.map +1 -0
  167. package/dist/index.cjs174.js +2 -0
  168. package/dist/index.cjs174.js.map +1 -0
  169. package/dist/index.cjs175.js +581 -0
  170. package/dist/index.cjs175.js.map +1 -0
  171. package/dist/index.cjs176.js +2 -0
  172. package/dist/index.cjs176.js.map +1 -0
  173. package/dist/index.cjs177.js +2 -0
  174. package/dist/index.cjs177.js.map +1 -0
  175. package/dist/index.cjs178.js +2 -0
  176. package/dist/index.cjs178.js.map +1 -0
  177. package/dist/index.cjs179.js +2 -0
  178. package/dist/index.cjs179.js.map +1 -0
  179. package/dist/index.cjs18.js +2 -0
  180. package/dist/index.cjs18.js.map +1 -0
  181. package/dist/index.cjs180.js +2 -0
  182. package/dist/index.cjs180.js.map +1 -0
  183. package/dist/index.cjs181.js +2 -0
  184. package/dist/index.cjs181.js.map +1 -0
  185. package/dist/index.cjs182.js +2 -0
  186. package/dist/index.cjs182.js.map +1 -0
  187. package/dist/index.cjs183.js +2 -0
  188. package/dist/index.cjs183.js.map +1 -0
  189. package/dist/index.cjs184.js +2 -0
  190. package/dist/index.cjs184.js.map +1 -0
  191. package/dist/index.cjs185.js +2 -0
  192. package/dist/index.cjs185.js.map +1 -0
  193. package/dist/index.cjs186.js +2 -0
  194. package/dist/index.cjs186.js.map +1 -0
  195. package/dist/index.cjs187.js +2 -0
  196. package/dist/index.cjs187.js.map +1 -0
  197. package/dist/index.cjs188.js +2 -0
  198. package/dist/index.cjs188.js.map +1 -0
  199. package/dist/index.cjs189.js +2 -0
  200. package/dist/index.cjs189.js.map +1 -0
  201. package/dist/index.cjs19.js +2 -0
  202. package/dist/index.cjs19.js.map +1 -0
  203. package/dist/index.cjs190.js +2 -0
  204. package/dist/index.cjs190.js.map +1 -0
  205. package/dist/index.cjs191.js +2 -0
  206. package/dist/index.cjs191.js.map +1 -0
  207. package/dist/index.cjs192.js +2 -0
  208. package/dist/index.cjs192.js.map +1 -0
  209. package/dist/index.cjs193.js +2 -0
  210. package/dist/index.cjs193.js.map +1 -0
  211. package/dist/index.cjs194.js +2 -0
  212. package/dist/index.cjs194.js.map +1 -0
  213. package/dist/index.cjs195.js +2 -0
  214. package/dist/index.cjs195.js.map +1 -0
  215. package/dist/index.cjs196.js +2 -0
  216. package/dist/index.cjs196.js.map +1 -0
  217. package/dist/index.cjs197.js +2 -0
  218. package/dist/index.cjs197.js.map +1 -0
  219. package/dist/index.cjs198.js +2 -0
  220. package/dist/index.cjs198.js.map +1 -0
  221. package/dist/index.cjs199.js +2 -0
  222. package/dist/index.cjs199.js.map +1 -0
  223. package/dist/index.cjs2.js +2 -0
  224. package/dist/index.cjs2.js.map +1 -0
  225. package/dist/index.cjs20.js +7 -0
  226. package/dist/index.cjs20.js.map +1 -0
  227. package/dist/index.cjs200.js +2 -0
  228. package/dist/index.cjs200.js.map +1 -0
  229. package/dist/index.cjs201.js +2 -0
  230. package/dist/index.cjs201.js.map +1 -0
  231. package/dist/index.cjs202.js +2 -0
  232. package/dist/index.cjs202.js.map +1 -0
  233. package/dist/index.cjs203.js +2 -0
  234. package/dist/index.cjs203.js.map +1 -0
  235. package/dist/index.cjs204.js +2 -0
  236. package/dist/index.cjs204.js.map +1 -0
  237. package/dist/index.cjs205.js +2 -0
  238. package/dist/index.cjs205.js.map +1 -0
  239. package/dist/index.cjs206.js +2 -0
  240. package/dist/index.cjs206.js.map +1 -0
  241. package/dist/index.cjs207.js +2 -0
  242. package/dist/index.cjs207.js.map +1 -0
  243. package/dist/index.cjs208.js +2 -0
  244. package/dist/index.cjs208.js.map +1 -0
  245. package/dist/index.cjs209.js +2 -0
  246. package/dist/index.cjs209.js.map +1 -0
  247. package/dist/index.cjs21.js +7 -0
  248. package/dist/index.cjs21.js.map +1 -0
  249. package/dist/index.cjs210.js +2 -0
  250. package/dist/index.cjs210.js.map +1 -0
  251. package/dist/index.cjs211.js +2 -0
  252. package/dist/index.cjs211.js.map +1 -0
  253. package/dist/index.cjs212.js +2 -0
  254. package/dist/index.cjs212.js.map +1 -0
  255. package/dist/index.cjs213.js +2 -0
  256. package/dist/index.cjs213.js.map +1 -0
  257. package/dist/index.cjs214.js +2 -0
  258. package/dist/index.cjs214.js.map +1 -0
  259. package/dist/index.cjs215.js +2 -0
  260. package/dist/index.cjs215.js.map +1 -0
  261. package/dist/index.cjs216.js +2 -0
  262. package/dist/index.cjs216.js.map +1 -0
  263. package/dist/index.cjs217.js +2 -0
  264. package/dist/index.cjs217.js.map +1 -0
  265. package/dist/index.cjs218.js +2 -0
  266. package/dist/index.cjs218.js.map +1 -0
  267. package/dist/index.cjs219.js +2 -0
  268. package/dist/index.cjs219.js.map +1 -0
  269. package/dist/index.cjs22.js +2 -0
  270. package/dist/index.cjs22.js.map +1 -0
  271. package/dist/index.cjs220.js +2 -0
  272. package/dist/index.cjs220.js.map +1 -0
  273. package/dist/index.cjs221.js +2 -0
  274. package/dist/index.cjs221.js.map +1 -0
  275. package/dist/index.cjs222.js +2 -0
  276. package/dist/index.cjs222.js.map +1 -0
  277. package/dist/index.cjs223.js +2 -0
  278. package/dist/index.cjs223.js.map +1 -0
  279. package/dist/index.cjs224.js +2 -0
  280. package/dist/index.cjs224.js.map +1 -0
  281. package/dist/index.cjs225.js +2 -0
  282. package/dist/index.cjs225.js.map +1 -0
  283. package/dist/index.cjs226.js +2 -0
  284. package/dist/index.cjs226.js.map +1 -0
  285. package/dist/index.cjs227.js +2 -0
  286. package/dist/index.cjs227.js.map +1 -0
  287. package/dist/index.cjs228.js +2 -0
  288. package/dist/index.cjs228.js.map +1 -0
  289. package/dist/index.cjs229.js +2 -0
  290. package/dist/index.cjs229.js.map +1 -0
  291. package/dist/index.cjs23.js +2 -0
  292. package/dist/index.cjs23.js.map +1 -0
  293. package/dist/index.cjs230.js +2 -0
  294. package/dist/index.cjs230.js.map +1 -0
  295. package/dist/index.cjs231.js +2 -0
  296. package/dist/index.cjs231.js.map +1 -0
  297. package/dist/index.cjs232.js +2 -0
  298. package/dist/index.cjs232.js.map +1 -0
  299. package/dist/index.cjs233.js +2 -0
  300. package/dist/index.cjs233.js.map +1 -0
  301. package/dist/index.cjs234.js +14 -0
  302. package/dist/index.cjs234.js.map +1 -0
  303. package/dist/index.cjs235.js +2 -0
  304. package/dist/index.cjs235.js.map +1 -0
  305. package/dist/index.cjs236.js +2 -0
  306. package/dist/index.cjs236.js.map +1 -0
  307. package/dist/index.cjs237.js +2 -0
  308. package/dist/index.cjs237.js.map +1 -0
  309. package/dist/index.cjs238.js +2 -0
  310. package/dist/index.cjs238.js.map +1 -0
  311. package/dist/index.cjs239.js +2 -0
  312. package/dist/index.cjs239.js.map +1 -0
  313. package/dist/index.cjs24.js +2 -0
  314. package/dist/index.cjs24.js.map +1 -0
  315. package/dist/index.cjs240.js +2 -0
  316. package/dist/index.cjs240.js.map +1 -0
  317. package/dist/index.cjs241.js +2 -0
  318. package/dist/index.cjs241.js.map +1 -0
  319. package/dist/index.cjs242.js +2 -0
  320. package/dist/index.cjs242.js.map +1 -0
  321. package/dist/index.cjs243.js +2 -0
  322. package/dist/index.cjs243.js.map +1 -0
  323. package/dist/index.cjs244.js +2 -0
  324. package/dist/index.cjs244.js.map +1 -0
  325. package/dist/index.cjs245.js +2 -0
  326. package/dist/index.cjs245.js.map +1 -0
  327. package/dist/index.cjs246.js +2 -0
  328. package/dist/index.cjs246.js.map +1 -0
  329. package/dist/index.cjs247.js +2 -0
  330. package/dist/index.cjs247.js.map +1 -0
  331. package/dist/index.cjs248.js +2 -0
  332. package/dist/index.cjs248.js.map +1 -0
  333. package/dist/index.cjs249.js +2 -0
  334. package/dist/index.cjs249.js.map +1 -0
  335. package/dist/index.cjs25.js +2 -0
  336. package/dist/index.cjs25.js.map +1 -0
  337. package/dist/index.cjs250.js +2 -0
  338. package/dist/index.cjs250.js.map +1 -0
  339. package/dist/index.cjs251.js +2 -0
  340. package/dist/index.cjs251.js.map +1 -0
  341. package/dist/index.cjs252.js +2 -0
  342. package/dist/index.cjs252.js.map +1 -0
  343. package/dist/index.cjs253.js +2 -0
  344. package/dist/index.cjs253.js.map +1 -0
  345. package/dist/index.cjs254.js +2 -0
  346. package/dist/index.cjs254.js.map +1 -0
  347. package/dist/index.cjs255.js +2 -0
  348. package/dist/index.cjs255.js.map +1 -0
  349. package/dist/index.cjs256.js +2 -0
  350. package/dist/index.cjs256.js.map +1 -0
  351. package/dist/index.cjs257.js +2 -0
  352. package/dist/index.cjs257.js.map +1 -0
  353. package/dist/index.cjs258.js +2 -0
  354. package/dist/index.cjs258.js.map +1 -0
  355. package/dist/index.cjs259.js +2 -0
  356. package/dist/index.cjs259.js.map +1 -0
  357. package/dist/index.cjs26.js +2 -0
  358. package/dist/index.cjs26.js.map +1 -0
  359. package/dist/index.cjs260.js +2 -0
  360. package/dist/index.cjs260.js.map +1 -0
  361. package/dist/index.cjs261.js +2 -0
  362. package/dist/index.cjs261.js.map +1 -0
  363. package/dist/index.cjs262.js +2 -0
  364. package/dist/index.cjs262.js.map +1 -0
  365. package/dist/index.cjs263.js +2 -0
  366. package/dist/index.cjs263.js.map +1 -0
  367. package/dist/index.cjs264.js +2 -0
  368. package/dist/index.cjs264.js.map +1 -0
  369. package/dist/index.cjs265.js +2 -0
  370. package/dist/index.cjs265.js.map +1 -0
  371. package/dist/index.cjs266.js +2 -0
  372. package/dist/index.cjs266.js.map +1 -0
  373. package/dist/index.cjs267.js +2 -0
  374. package/dist/index.cjs267.js.map +1 -0
  375. package/dist/index.cjs268.js +2 -0
  376. package/dist/index.cjs268.js.map +1 -0
  377. package/dist/index.cjs269.js +2 -0
  378. package/dist/index.cjs269.js.map +1 -0
  379. package/dist/index.cjs27.js +2 -0
  380. package/dist/index.cjs27.js.map +1 -0
  381. package/dist/index.cjs270.js +2 -0
  382. package/dist/index.cjs270.js.map +1 -0
  383. package/dist/index.cjs271.js +2 -0
  384. package/dist/index.cjs271.js.map +1 -0
  385. package/dist/index.cjs272.js +2 -0
  386. package/dist/index.cjs272.js.map +1 -0
  387. package/dist/index.cjs273.js +2 -0
  388. package/dist/index.cjs273.js.map +1 -0
  389. package/dist/index.cjs274.js +2 -0
  390. package/dist/index.cjs274.js.map +1 -0
  391. package/dist/index.cjs275.js +2 -0
  392. package/dist/index.cjs275.js.map +1 -0
  393. package/dist/index.cjs276.js +2 -0
  394. package/dist/index.cjs276.js.map +1 -0
  395. package/dist/index.cjs277.js +2 -0
  396. package/dist/index.cjs277.js.map +1 -0
  397. package/dist/index.cjs278.js +2 -0
  398. package/dist/index.cjs278.js.map +1 -0
  399. package/dist/index.cjs279.js +2 -0
  400. package/dist/index.cjs279.js.map +1 -0
  401. package/dist/index.cjs28.js +2 -0
  402. package/dist/index.cjs28.js.map +1 -0
  403. package/dist/index.cjs280.js +2 -0
  404. package/dist/index.cjs280.js.map +1 -0
  405. package/dist/index.cjs281.js +2 -0
  406. package/dist/index.cjs281.js.map +1 -0
  407. package/dist/index.cjs282.js +2 -0
  408. package/dist/index.cjs282.js.map +1 -0
  409. package/dist/index.cjs283.js +2 -0
  410. package/dist/index.cjs283.js.map +1 -0
  411. package/dist/index.cjs284.js +2 -0
  412. package/dist/index.cjs284.js.map +1 -0
  413. package/dist/index.cjs285.js +2 -0
  414. package/dist/index.cjs285.js.map +1 -0
  415. package/dist/index.cjs286.js +2 -0
  416. package/dist/index.cjs286.js.map +1 -0
  417. package/dist/index.cjs287.js +2 -0
  418. package/dist/index.cjs287.js.map +1 -0
  419. package/dist/index.cjs288.js +2 -0
  420. package/dist/index.cjs288.js.map +1 -0
  421. package/dist/index.cjs289.js +2 -0
  422. package/dist/index.cjs289.js.map +1 -0
  423. package/dist/index.cjs29.js +2 -0
  424. package/dist/index.cjs29.js.map +1 -0
  425. package/dist/index.cjs290.js +2 -0
  426. package/dist/index.cjs290.js.map +1 -0
  427. package/dist/index.cjs291.js +7 -0
  428. package/dist/index.cjs291.js.map +1 -0
  429. package/dist/index.cjs292.js +2 -0
  430. package/dist/index.cjs292.js.map +1 -0
  431. package/dist/index.cjs293.js +3 -0
  432. package/dist/index.cjs293.js.map +1 -0
  433. package/dist/index.cjs294.js +4 -0
  434. package/dist/index.cjs294.js.map +1 -0
  435. package/dist/index.cjs295.js +2 -0
  436. package/dist/index.cjs295.js.map +1 -0
  437. package/dist/index.cjs296.js +2 -0
  438. package/dist/index.cjs296.js.map +1 -0
  439. package/dist/index.cjs297.js +9 -0
  440. package/dist/index.cjs297.js.map +1 -0
  441. package/dist/index.cjs298.js +14 -0
  442. package/dist/index.cjs298.js.map +1 -0
  443. package/dist/index.cjs299.js +2 -0
  444. package/dist/index.cjs299.js.map +1 -0
  445. package/dist/index.cjs3.js +2 -0
  446. package/dist/index.cjs3.js.map +1 -0
  447. package/dist/index.cjs30.js +2 -0
  448. package/dist/index.cjs30.js.map +1 -0
  449. package/dist/index.cjs300.js +18 -0
  450. package/dist/index.cjs300.js.map +1 -0
  451. package/dist/index.cjs301.js +2 -0
  452. package/dist/index.cjs301.js.map +1 -0
  453. package/dist/index.cjs302.js +2 -0
  454. package/dist/index.cjs302.js.map +1 -0
  455. package/dist/index.cjs303.js +2 -0
  456. package/dist/index.cjs303.js.map +1 -0
  457. package/dist/index.cjs304.js +2 -0
  458. package/dist/index.cjs304.js.map +1 -0
  459. package/dist/index.cjs305.js +2 -0
  460. package/dist/index.cjs305.js.map +1 -0
  461. package/dist/index.cjs306.js +2 -0
  462. package/dist/index.cjs306.js.map +1 -0
  463. package/dist/index.cjs307.js +2 -0
  464. package/dist/index.cjs307.js.map +1 -0
  465. package/dist/index.cjs308.js +2 -0
  466. package/dist/index.cjs308.js.map +1 -0
  467. package/dist/index.cjs309.js +2 -0
  468. package/dist/index.cjs309.js.map +1 -0
  469. package/dist/index.cjs31.js +2 -0
  470. package/dist/index.cjs31.js.map +1 -0
  471. package/dist/index.cjs310.js +2 -0
  472. package/dist/index.cjs310.js.map +1 -0
  473. package/dist/index.cjs311.js +2 -0
  474. package/dist/index.cjs311.js.map +1 -0
  475. package/dist/index.cjs312.js +2 -0
  476. package/dist/index.cjs312.js.map +1 -0
  477. package/dist/index.cjs313.js +2 -0
  478. package/dist/index.cjs313.js.map +1 -0
  479. package/dist/index.cjs314.js +2 -0
  480. package/dist/index.cjs314.js.map +1 -0
  481. package/dist/index.cjs315.js +2 -0
  482. package/dist/index.cjs315.js.map +1 -0
  483. package/dist/index.cjs316.js +2 -0
  484. package/dist/index.cjs316.js.map +1 -0
  485. package/dist/index.cjs317.js +2 -0
  486. package/dist/index.cjs317.js.map +1 -0
  487. package/dist/index.cjs318.js +2 -0
  488. package/dist/index.cjs318.js.map +1 -0
  489. package/dist/index.cjs319.js +2 -0
  490. package/dist/index.cjs319.js.map +1 -0
  491. package/dist/index.cjs32.js +2 -0
  492. package/dist/index.cjs32.js.map +1 -0
  493. package/dist/index.cjs320.js +10 -0
  494. package/dist/index.cjs320.js.map +1 -0
  495. package/dist/index.cjs321.js +20 -0
  496. package/dist/index.cjs321.js.map +1 -0
  497. package/dist/index.cjs322.js +2 -0
  498. package/dist/index.cjs322.js.map +1 -0
  499. package/dist/index.cjs323.js +2 -0
  500. package/dist/index.cjs323.js.map +1 -0
  501. package/dist/index.cjs324.js +2 -0
  502. package/dist/index.cjs324.js.map +1 -0
  503. package/dist/index.cjs325.js +2 -0
  504. package/dist/index.cjs325.js.map +1 -0
  505. package/dist/index.cjs326.js +2 -0
  506. package/dist/index.cjs326.js.map +1 -0
  507. package/dist/index.cjs327.js +2 -0
  508. package/dist/index.cjs327.js.map +1 -0
  509. package/dist/index.cjs328.js +2 -0
  510. package/dist/index.cjs328.js.map +1 -0
  511. package/dist/index.cjs329.js +2 -0
  512. package/dist/index.cjs329.js.map +1 -0
  513. package/dist/index.cjs33.js +2 -0
  514. package/dist/index.cjs33.js.map +1 -0
  515. package/dist/index.cjs330.js +2 -0
  516. package/dist/index.cjs330.js.map +1 -0
  517. package/dist/index.cjs331.js +2 -0
  518. package/dist/index.cjs331.js.map +1 -0
  519. package/dist/index.cjs332.js +2 -0
  520. package/dist/index.cjs332.js.map +1 -0
  521. package/dist/index.cjs333.js +2 -0
  522. package/dist/index.cjs333.js.map +1 -0
  523. package/dist/index.cjs334.js +2 -0
  524. package/dist/index.cjs334.js.map +1 -0
  525. package/dist/index.cjs335.js +2 -0
  526. package/dist/index.cjs335.js.map +1 -0
  527. package/dist/index.cjs336.js +2 -0
  528. package/dist/index.cjs336.js.map +1 -0
  529. package/dist/index.cjs337.js +2 -0
  530. package/dist/index.cjs337.js.map +1 -0
  531. package/dist/index.cjs338.js +2 -0
  532. package/dist/index.cjs338.js.map +1 -0
  533. package/dist/index.cjs339.js +2 -0
  534. package/dist/index.cjs339.js.map +1 -0
  535. package/dist/index.cjs34.js +2 -0
  536. package/dist/index.cjs34.js.map +1 -0
  537. package/dist/index.cjs340.js +2 -0
  538. package/dist/index.cjs340.js.map +1 -0
  539. package/dist/index.cjs341.js +2 -0
  540. package/dist/index.cjs341.js.map +1 -0
  541. package/dist/index.cjs342.js +2 -0
  542. package/dist/index.cjs342.js.map +1 -0
  543. package/dist/index.cjs343.js +2 -0
  544. package/dist/index.cjs343.js.map +1 -0
  545. package/dist/index.cjs344.js +2 -0
  546. package/dist/index.cjs344.js.map +1 -0
  547. package/dist/index.cjs345.js +2 -0
  548. package/dist/index.cjs345.js.map +1 -0
  549. package/dist/index.cjs346.js +2 -0
  550. package/dist/index.cjs346.js.map +1 -0
  551. package/dist/index.cjs347.js +2 -0
  552. package/dist/index.cjs347.js.map +1 -0
  553. package/dist/index.cjs348.js +2 -0
  554. package/dist/index.cjs348.js.map +1 -0
  555. package/dist/index.cjs349.js +2 -0
  556. package/dist/index.cjs349.js.map +1 -0
  557. package/dist/index.cjs35.js +2 -0
  558. package/dist/index.cjs35.js.map +1 -0
  559. package/dist/index.cjs350.js +2 -0
  560. package/dist/index.cjs350.js.map +1 -0
  561. package/dist/index.cjs351.js +2 -0
  562. package/dist/index.cjs351.js.map +1 -0
  563. package/dist/index.cjs352.js +2 -0
  564. package/dist/index.cjs352.js.map +1 -0
  565. package/dist/index.cjs353.js +2 -0
  566. package/dist/index.cjs353.js.map +1 -0
  567. package/dist/index.cjs354.js +2 -0
  568. package/dist/index.cjs354.js.map +1 -0
  569. package/dist/index.cjs355.js +2 -0
  570. package/dist/index.cjs355.js.map +1 -0
  571. package/dist/index.cjs356.js +2 -0
  572. package/dist/index.cjs356.js.map +1 -0
  573. package/dist/index.cjs357.js +2 -0
  574. package/dist/index.cjs357.js.map +1 -0
  575. package/dist/index.cjs358.js +2 -0
  576. package/dist/index.cjs358.js.map +1 -0
  577. package/dist/index.cjs359.js +2 -0
  578. package/dist/index.cjs359.js.map +1 -0
  579. package/dist/index.cjs36.js +2 -0
  580. package/dist/index.cjs36.js.map +1 -0
  581. package/dist/index.cjs360.js +2 -0
  582. package/dist/index.cjs360.js.map +1 -0
  583. package/dist/index.cjs361.js +2 -0
  584. package/dist/index.cjs361.js.map +1 -0
  585. package/dist/index.cjs362.js +2 -0
  586. package/dist/index.cjs362.js.map +1 -0
  587. package/dist/index.cjs363.js +2 -0
  588. package/dist/index.cjs363.js.map +1 -0
  589. package/dist/index.cjs364.js +2 -0
  590. package/dist/index.cjs364.js.map +1 -0
  591. package/dist/index.cjs365.js +2 -0
  592. package/dist/index.cjs365.js.map +1 -0
  593. package/dist/index.cjs366.js +2 -0
  594. package/dist/index.cjs366.js.map +1 -0
  595. package/dist/index.cjs367.js +2 -0
  596. package/dist/index.cjs367.js.map +1 -0
  597. package/dist/index.cjs368.js +7 -0
  598. package/dist/index.cjs368.js.map +1 -0
  599. package/dist/index.cjs369.js +7 -0
  600. package/dist/index.cjs369.js.map +1 -0
  601. package/dist/index.cjs37.js +2 -0
  602. package/dist/index.cjs37.js.map +1 -0
  603. package/dist/index.cjs370.js +2 -0
  604. package/dist/index.cjs370.js.map +1 -0
  605. package/dist/index.cjs371.js +2 -0
  606. package/dist/index.cjs371.js.map +1 -0
  607. package/dist/index.cjs372.js +2 -0
  608. package/dist/index.cjs372.js.map +1 -0
  609. package/dist/index.cjs373.js +2 -0
  610. package/dist/index.cjs373.js.map +1 -0
  611. package/dist/index.cjs374.js +2 -0
  612. package/dist/index.cjs374.js.map +1 -0
  613. package/dist/index.cjs375.js +2 -0
  614. package/dist/index.cjs375.js.map +1 -0
  615. package/dist/index.cjs376.js +2 -0
  616. package/dist/index.cjs376.js.map +1 -0
  617. package/dist/index.cjs377.js +2 -0
  618. package/dist/index.cjs377.js.map +1 -0
  619. package/dist/index.cjs378.js +2 -0
  620. package/dist/index.cjs378.js.map +1 -0
  621. package/dist/index.cjs379.js +2 -0
  622. package/dist/index.cjs379.js.map +1 -0
  623. package/dist/index.cjs38.js +2 -0
  624. package/dist/index.cjs38.js.map +1 -0
  625. package/dist/index.cjs380.js +2 -0
  626. package/dist/index.cjs380.js.map +1 -0
  627. package/dist/index.cjs381.js +2 -0
  628. package/dist/index.cjs381.js.map +1 -0
  629. package/dist/index.cjs382.js +2 -0
  630. package/dist/index.cjs382.js.map +1 -0
  631. package/dist/index.cjs383.js +2 -0
  632. package/dist/index.cjs383.js.map +1 -0
  633. package/dist/index.cjs384.js +2 -0
  634. package/dist/index.cjs384.js.map +1 -0
  635. package/dist/index.cjs385.js +2 -0
  636. package/dist/index.cjs385.js.map +1 -0
  637. package/dist/index.cjs386.js +2 -0
  638. package/dist/index.cjs386.js.map +1 -0
  639. package/dist/index.cjs387.js +2 -0
  640. package/dist/index.cjs387.js.map +1 -0
  641. package/dist/index.cjs388.js +2 -0
  642. package/dist/index.cjs388.js.map +1 -0
  643. package/dist/index.cjs389.js +2 -0
  644. package/dist/index.cjs389.js.map +1 -0
  645. package/dist/index.cjs39.js +2 -0
  646. package/dist/index.cjs39.js.map +1 -0
  647. package/dist/index.cjs390.js +2 -0
  648. package/dist/index.cjs390.js.map +1 -0
  649. package/dist/index.cjs391.js +2 -0
  650. package/dist/index.cjs391.js.map +1 -0
  651. package/dist/index.cjs392.js +2 -0
  652. package/dist/index.cjs392.js.map +1 -0
  653. package/dist/index.cjs393.js +2 -0
  654. package/dist/index.cjs393.js.map +1 -0
  655. package/dist/index.cjs394.js +2 -0
  656. package/dist/index.cjs394.js.map +1 -0
  657. package/dist/index.cjs395.js +2 -0
  658. package/dist/index.cjs395.js.map +1 -0
  659. package/dist/index.cjs396.js +2 -0
  660. package/dist/index.cjs396.js.map +1 -0
  661. package/dist/index.cjs397.js +2 -0
  662. package/dist/index.cjs397.js.map +1 -0
  663. package/dist/index.cjs398.js +2 -0
  664. package/dist/index.cjs398.js.map +1 -0
  665. package/dist/index.cjs399.js +2 -0
  666. package/dist/index.cjs399.js.map +1 -0
  667. package/dist/index.cjs4.js +2 -0
  668. package/dist/index.cjs4.js.map +1 -0
  669. package/dist/index.cjs40.js +2 -0
  670. package/dist/index.cjs40.js.map +1 -0
  671. package/dist/index.cjs400.js +2 -0
  672. package/dist/index.cjs400.js.map +1 -0
  673. package/dist/index.cjs401.js +2 -0
  674. package/dist/index.cjs401.js.map +1 -0
  675. package/dist/index.cjs402.js +2 -0
  676. package/dist/index.cjs402.js.map +1 -0
  677. package/dist/index.cjs403.js +2 -0
  678. package/dist/index.cjs403.js.map +1 -0
  679. package/dist/index.cjs404.js +2 -0
  680. package/dist/index.cjs404.js.map +1 -0
  681. package/dist/index.cjs405.js +2 -0
  682. package/dist/index.cjs405.js.map +1 -0
  683. package/dist/index.cjs406.js +2 -0
  684. package/dist/index.cjs406.js.map +1 -0
  685. package/dist/index.cjs407.js +2 -0
  686. package/dist/index.cjs407.js.map +1 -0
  687. package/dist/index.cjs408.js +2 -0
  688. package/dist/index.cjs408.js.map +1 -0
  689. package/dist/index.cjs409.js +2 -0
  690. package/dist/index.cjs409.js.map +1 -0
  691. package/dist/index.cjs41.js +2 -0
  692. package/dist/index.cjs41.js.map +1 -0
  693. package/dist/index.cjs410.js +2 -0
  694. package/dist/index.cjs410.js.map +1 -0
  695. package/dist/index.cjs411.js +7 -0
  696. package/dist/index.cjs411.js.map +1 -0
  697. package/dist/index.cjs412.js +2 -0
  698. package/dist/index.cjs412.js.map +1 -0
  699. package/dist/index.cjs413.js +2 -0
  700. package/dist/index.cjs413.js.map +1 -0
  701. package/dist/index.cjs414.js +2 -0
  702. package/dist/index.cjs414.js.map +1 -0
  703. package/dist/index.cjs415.js +2 -0
  704. package/dist/index.cjs415.js.map +1 -0
  705. package/dist/index.cjs416.js +2 -0
  706. package/dist/index.cjs416.js.map +1 -0
  707. package/dist/index.cjs417.js +2 -0
  708. package/dist/index.cjs417.js.map +1 -0
  709. package/dist/index.cjs418.js +2 -0
  710. package/dist/index.cjs418.js.map +1 -0
  711. package/dist/index.cjs419.js +2 -0
  712. package/dist/index.cjs419.js.map +1 -0
  713. package/dist/index.cjs42.js +2 -0
  714. package/dist/index.cjs42.js.map +1 -0
  715. package/dist/index.cjs420.js +2 -0
  716. package/dist/index.cjs420.js.map +1 -0
  717. package/dist/index.cjs421.js +2 -0
  718. package/dist/index.cjs421.js.map +1 -0
  719. package/dist/index.cjs422.js +2 -0
  720. package/dist/index.cjs422.js.map +1 -0
  721. package/dist/index.cjs423.js +3 -0
  722. package/dist/index.cjs423.js.map +1 -0
  723. package/dist/index.cjs424.js +5 -0
  724. package/dist/index.cjs424.js.map +1 -0
  725. package/dist/index.cjs425.js +3 -0
  726. package/dist/index.cjs425.js.map +1 -0
  727. package/dist/index.cjs426.js +2 -0
  728. package/dist/index.cjs426.js.map +1 -0
  729. package/dist/index.cjs427.js +2 -0
  730. package/dist/index.cjs427.js.map +1 -0
  731. package/dist/index.cjs428.js +3 -0
  732. package/dist/index.cjs428.js.map +1 -0
  733. package/dist/index.cjs429.js +2 -0
  734. package/dist/index.cjs429.js.map +1 -0
  735. package/dist/index.cjs43.js +2 -0
  736. package/dist/index.cjs43.js.map +1 -0
  737. package/dist/index.cjs430.js +2 -0
  738. package/dist/index.cjs430.js.map +1 -0
  739. package/dist/index.cjs431.js +2 -0
  740. package/dist/index.cjs431.js.map +1 -0
  741. package/dist/index.cjs432.js +2 -0
  742. package/dist/index.cjs432.js.map +1 -0
  743. package/dist/index.cjs433.js +2 -0
  744. package/dist/index.cjs433.js.map +1 -0
  745. package/dist/index.cjs434.js +2 -0
  746. package/dist/index.cjs434.js.map +1 -0
  747. package/dist/index.cjs435.js +2 -0
  748. package/dist/index.cjs435.js.map +1 -0
  749. package/dist/index.cjs436.js +2 -0
  750. package/dist/index.cjs436.js.map +1 -0
  751. package/dist/index.cjs437.js +2 -0
  752. package/dist/index.cjs437.js.map +1 -0
  753. package/dist/index.cjs438.js +2 -0
  754. package/dist/index.cjs438.js.map +1 -0
  755. package/dist/index.cjs439.js +2 -0
  756. package/dist/index.cjs439.js.map +1 -0
  757. package/dist/index.cjs44.js +2 -0
  758. package/dist/index.cjs44.js.map +1 -0
  759. package/dist/index.cjs440.js +2 -0
  760. package/dist/index.cjs440.js.map +1 -0
  761. package/dist/index.cjs441.js +2 -0
  762. package/dist/index.cjs441.js.map +1 -0
  763. package/dist/index.cjs442.js +2 -0
  764. package/dist/index.cjs442.js.map +1 -0
  765. package/dist/index.cjs443.js +2 -0
  766. package/dist/index.cjs443.js.map +1 -0
  767. package/dist/index.cjs444.js +2 -0
  768. package/dist/index.cjs444.js.map +1 -0
  769. package/dist/index.cjs445.js +2 -0
  770. package/dist/index.cjs445.js.map +1 -0
  771. package/dist/index.cjs446.js +2 -0
  772. package/dist/index.cjs446.js.map +1 -0
  773. package/dist/index.cjs447.js +2 -0
  774. package/dist/index.cjs447.js.map +1 -0
  775. package/dist/index.cjs448.js +2 -0
  776. package/dist/index.cjs448.js.map +1 -0
  777. package/dist/index.cjs449.js +2 -0
  778. package/dist/index.cjs449.js.map +1 -0
  779. package/dist/index.cjs45.js +2 -0
  780. package/dist/index.cjs45.js.map +1 -0
  781. package/dist/index.cjs450.js +2 -0
  782. package/dist/index.cjs450.js.map +1 -0
  783. package/dist/index.cjs451.js +2 -0
  784. package/dist/index.cjs451.js.map +1 -0
  785. package/dist/index.cjs452.js +2 -0
  786. package/dist/index.cjs452.js.map +1 -0
  787. package/dist/index.cjs453.js +2 -0
  788. package/dist/index.cjs453.js.map +1 -0
  789. package/dist/index.cjs454.js +2 -0
  790. package/dist/index.cjs454.js.map +1 -0
  791. package/dist/index.cjs455.js +2 -0
  792. package/dist/index.cjs455.js.map +1 -0
  793. package/dist/index.cjs456.js +2 -0
  794. package/dist/index.cjs456.js.map +1 -0
  795. package/dist/index.cjs457.js +2 -0
  796. package/dist/index.cjs457.js.map +1 -0
  797. package/dist/index.cjs458.js +2 -0
  798. package/dist/index.cjs458.js.map +1 -0
  799. package/dist/index.cjs459.js +2 -0
  800. package/dist/index.cjs459.js.map +1 -0
  801. package/dist/index.cjs46.js +2 -0
  802. package/dist/index.cjs46.js.map +1 -0
  803. package/dist/index.cjs460.js +2 -0
  804. package/dist/index.cjs460.js.map +1 -0
  805. package/dist/index.cjs461.js +2 -0
  806. package/dist/index.cjs461.js.map +1 -0
  807. package/dist/index.cjs462.js +2 -0
  808. package/dist/index.cjs462.js.map +1 -0
  809. package/dist/index.cjs463.js +2 -0
  810. package/dist/index.cjs463.js.map +1 -0
  811. package/dist/index.cjs464.js +2 -0
  812. package/dist/index.cjs464.js.map +1 -0
  813. package/dist/index.cjs465.js +2 -0
  814. package/dist/index.cjs465.js.map +1 -0
  815. package/dist/index.cjs466.js +2 -0
  816. package/dist/index.cjs466.js.map +1 -0
  817. package/dist/index.cjs467.js +2 -0
  818. package/dist/index.cjs467.js.map +1 -0
  819. package/dist/index.cjs468.js +2 -0
  820. package/dist/index.cjs468.js.map +1 -0
  821. package/dist/index.cjs469.js +2 -0
  822. package/dist/index.cjs469.js.map +1 -0
  823. package/dist/index.cjs47.js +2 -0
  824. package/dist/index.cjs47.js.map +1 -0
  825. package/dist/index.cjs470.js +2 -0
  826. package/dist/index.cjs470.js.map +1 -0
  827. package/dist/index.cjs471.js +2 -0
  828. package/dist/index.cjs471.js.map +1 -0
  829. package/dist/index.cjs472.js +2 -0
  830. package/dist/index.cjs472.js.map +1 -0
  831. package/dist/index.cjs473.js +2 -0
  832. package/dist/index.cjs473.js.map +1 -0
  833. package/dist/index.cjs474.js +2 -0
  834. package/dist/index.cjs474.js.map +1 -0
  835. package/dist/index.cjs475.js +2 -0
  836. package/dist/index.cjs475.js.map +1 -0
  837. package/dist/index.cjs476.js +2 -0
  838. package/dist/index.cjs476.js.map +1 -0
  839. package/dist/index.cjs477.js +14 -0
  840. package/dist/index.cjs477.js.map +1 -0
  841. package/dist/index.cjs478.js +2 -0
  842. package/dist/index.cjs478.js.map +1 -0
  843. package/dist/index.cjs479.js +2 -0
  844. package/dist/index.cjs479.js.map +1 -0
  845. package/dist/index.cjs48.js +2 -0
  846. package/dist/index.cjs48.js.map +1 -0
  847. package/dist/index.cjs480.js +2 -0
  848. package/dist/index.cjs480.js.map +1 -0
  849. package/dist/index.cjs481.js +2 -0
  850. package/dist/index.cjs481.js.map +1 -0
  851. package/dist/index.cjs482.js +2 -0
  852. package/dist/index.cjs482.js.map +1 -0
  853. package/dist/index.cjs483.js +2 -0
  854. package/dist/index.cjs483.js.map +1 -0
  855. package/dist/index.cjs484.js +2 -0
  856. package/dist/index.cjs484.js.map +1 -0
  857. package/dist/index.cjs485.js +2 -0
  858. package/dist/index.cjs485.js.map +1 -0
  859. package/dist/index.cjs486.js +2 -0
  860. package/dist/index.cjs486.js.map +1 -0
  861. package/dist/index.cjs487.js +2 -0
  862. package/dist/index.cjs487.js.map +1 -0
  863. package/dist/index.cjs488.js +2 -0
  864. package/dist/index.cjs488.js.map +1 -0
  865. package/dist/index.cjs489.js +2 -0
  866. package/dist/index.cjs489.js.map +1 -0
  867. package/dist/index.cjs49.js +2 -0
  868. package/dist/index.cjs49.js.map +1 -0
  869. package/dist/index.cjs490.js +2 -0
  870. package/dist/index.cjs490.js.map +1 -0
  871. package/dist/index.cjs491.js +2 -0
  872. package/dist/index.cjs491.js.map +1 -0
  873. package/dist/index.cjs492.js +2 -0
  874. package/dist/index.cjs492.js.map +1 -0
  875. package/dist/index.cjs493.js +2 -0
  876. package/dist/index.cjs493.js.map +1 -0
  877. package/dist/index.cjs494.js +2 -0
  878. package/dist/index.cjs494.js.map +1 -0
  879. package/dist/index.cjs495.js +2 -0
  880. package/dist/index.cjs495.js.map +1 -0
  881. package/dist/index.cjs496.js +2 -0
  882. package/dist/index.cjs496.js.map +1 -0
  883. package/dist/index.cjs497.js +2 -0
  884. package/dist/index.cjs497.js.map +1 -0
  885. package/dist/index.cjs498.js +2 -0
  886. package/dist/index.cjs498.js.map +1 -0
  887. package/dist/index.cjs499.js +2 -0
  888. package/dist/index.cjs499.js.map +1 -0
  889. package/dist/index.cjs5.js +2 -0
  890. package/dist/index.cjs5.js.map +1 -0
  891. package/dist/index.cjs50.js +2 -0
  892. package/dist/index.cjs50.js.map +1 -0
  893. package/dist/index.cjs500.js +2 -0
  894. package/dist/index.cjs500.js.map +1 -0
  895. package/dist/index.cjs501.js +2 -0
  896. package/dist/index.cjs501.js.map +1 -0
  897. package/dist/index.cjs502.js +2 -0
  898. package/dist/index.cjs502.js.map +1 -0
  899. package/dist/index.cjs503.js +2 -0
  900. package/dist/index.cjs503.js.map +1 -0
  901. package/dist/index.cjs504.js +2 -0
  902. package/dist/index.cjs504.js.map +1 -0
  903. package/dist/index.cjs505.js +2 -0
  904. package/dist/index.cjs505.js.map +1 -0
  905. package/dist/index.cjs506.js +2 -0
  906. package/dist/index.cjs506.js.map +1 -0
  907. package/dist/index.cjs507.js +2 -0
  908. package/dist/index.cjs507.js.map +1 -0
  909. package/dist/index.cjs508.js +2 -0
  910. package/dist/index.cjs508.js.map +1 -0
  911. package/dist/index.cjs509.js +2 -0
  912. package/dist/index.cjs509.js.map +1 -0
  913. package/dist/index.cjs51.js +2 -0
  914. package/dist/index.cjs51.js.map +1 -0
  915. package/dist/index.cjs510.js +2 -0
  916. package/dist/index.cjs510.js.map +1 -0
  917. package/dist/index.cjs511.js +2 -0
  918. package/dist/index.cjs511.js.map +1 -0
  919. package/dist/index.cjs512.js +2 -0
  920. package/dist/index.cjs512.js.map +1 -0
  921. package/dist/index.cjs513.js +2 -0
  922. package/dist/index.cjs513.js.map +1 -0
  923. package/dist/index.cjs514.js +2 -0
  924. package/dist/index.cjs514.js.map +1 -0
  925. package/dist/index.cjs515.js +2 -0
  926. package/dist/index.cjs515.js.map +1 -0
  927. package/dist/index.cjs516.js +2 -0
  928. package/dist/index.cjs516.js.map +1 -0
  929. package/dist/index.cjs517.js +2 -0
  930. package/dist/index.cjs517.js.map +1 -0
  931. package/dist/index.cjs518.js +2 -0
  932. package/dist/index.cjs518.js.map +1 -0
  933. package/dist/index.cjs519.js +2 -0
  934. package/dist/index.cjs519.js.map +1 -0
  935. package/dist/index.cjs52.js +2 -0
  936. package/dist/index.cjs52.js.map +1 -0
  937. package/dist/index.cjs520.js +2 -0
  938. package/dist/index.cjs520.js.map +1 -0
  939. package/dist/index.cjs521.js +2 -0
  940. package/dist/index.cjs521.js.map +1 -0
  941. package/dist/index.cjs522.js +2 -0
  942. package/dist/index.cjs522.js.map +1 -0
  943. package/dist/index.cjs523.js +2 -0
  944. package/dist/index.cjs523.js.map +1 -0
  945. package/dist/index.cjs524.js +2 -0
  946. package/dist/index.cjs524.js.map +1 -0
  947. package/dist/index.cjs525.js +2 -0
  948. package/dist/index.cjs525.js.map +1 -0
  949. package/dist/index.cjs526.js +2 -0
  950. package/dist/index.cjs526.js.map +1 -0
  951. package/dist/index.cjs527.js +2 -0
  952. package/dist/index.cjs527.js.map +1 -0
  953. package/dist/index.cjs528.js +2 -0
  954. package/dist/index.cjs528.js.map +1 -0
  955. package/dist/index.cjs529.js +2 -0
  956. package/dist/index.cjs529.js.map +1 -0
  957. package/dist/index.cjs53.js +2 -0
  958. package/dist/index.cjs53.js.map +1 -0
  959. package/dist/index.cjs530.js +2 -0
  960. package/dist/index.cjs530.js.map +1 -0
  961. package/dist/index.cjs531.js +2 -0
  962. package/dist/index.cjs531.js.map +1 -0
  963. package/dist/index.cjs532.js +2 -0
  964. package/dist/index.cjs532.js.map +1 -0
  965. package/dist/index.cjs533.js +2 -0
  966. package/dist/index.cjs533.js.map +1 -0
  967. package/dist/index.cjs534.js +2 -0
  968. package/dist/index.cjs534.js.map +1 -0
  969. package/dist/index.cjs535.js +2 -0
  970. package/dist/index.cjs535.js.map +1 -0
  971. package/dist/index.cjs536.js +2 -0
  972. package/dist/index.cjs536.js.map +1 -0
  973. package/dist/index.cjs537.js +2 -0
  974. package/dist/index.cjs537.js.map +1 -0
  975. package/dist/index.cjs538.js +2 -0
  976. package/dist/index.cjs538.js.map +1 -0
  977. package/dist/index.cjs539.js +5 -0
  978. package/dist/index.cjs539.js.map +1 -0
  979. package/dist/index.cjs54.js +2 -0
  980. package/dist/index.cjs54.js.map +1 -0
  981. package/dist/index.cjs540.js +2 -0
  982. package/dist/index.cjs540.js.map +1 -0
  983. package/dist/index.cjs541.js +2 -0
  984. package/dist/index.cjs541.js.map +1 -0
  985. package/dist/index.cjs542.js +2 -0
  986. package/dist/index.cjs542.js.map +1 -0
  987. package/dist/index.cjs543.js +2 -0
  988. package/dist/index.cjs543.js.map +1 -0
  989. package/dist/index.cjs544.js +2 -0
  990. package/dist/index.cjs544.js.map +1 -0
  991. package/dist/index.cjs545.js +2 -0
  992. package/dist/index.cjs545.js.map +1 -0
  993. package/dist/index.cjs546.js +2 -0
  994. package/dist/index.cjs546.js.map +1 -0
  995. package/dist/index.cjs547.js +2 -0
  996. package/dist/index.cjs547.js.map +1 -0
  997. package/dist/index.cjs548.js +2 -0
  998. package/dist/index.cjs548.js.map +1 -0
  999. package/dist/index.cjs549.js +2 -0
  1000. package/dist/index.cjs549.js.map +1 -0
  1001. package/dist/index.cjs55.js +2 -0
  1002. package/dist/index.cjs55.js.map +1 -0
  1003. package/dist/index.cjs550.js +2 -0
  1004. package/dist/index.cjs550.js.map +1 -0
  1005. package/dist/index.cjs551.js +2 -0
  1006. package/dist/index.cjs551.js.map +1 -0
  1007. package/dist/index.cjs552.js +2 -0
  1008. package/dist/index.cjs552.js.map +1 -0
  1009. package/dist/index.cjs553.js +2 -0
  1010. package/dist/index.cjs553.js.map +1 -0
  1011. package/dist/index.cjs554.js +2 -0
  1012. package/dist/index.cjs554.js.map +1 -0
  1013. package/dist/index.cjs555.js +2 -0
  1014. package/dist/index.cjs555.js.map +1 -0
  1015. package/dist/index.cjs556.js +2 -0
  1016. package/dist/index.cjs556.js.map +1 -0
  1017. package/dist/index.cjs557.js +2 -0
  1018. package/dist/index.cjs557.js.map +1 -0
  1019. package/dist/index.cjs558.js +2 -0
  1020. package/dist/index.cjs558.js.map +1 -0
  1021. package/dist/index.cjs559.js +2 -0
  1022. package/dist/index.cjs559.js.map +1 -0
  1023. package/dist/index.cjs56.js +2 -0
  1024. package/dist/index.cjs56.js.map +1 -0
  1025. package/dist/index.cjs560.js +2 -0
  1026. package/dist/index.cjs560.js.map +1 -0
  1027. package/dist/index.cjs561.js +2 -0
  1028. package/dist/index.cjs561.js.map +1 -0
  1029. package/dist/index.cjs562.js +6 -0
  1030. package/dist/index.cjs562.js.map +1 -0
  1031. package/dist/index.cjs563.js +2 -0
  1032. package/dist/index.cjs563.js.map +1 -0
  1033. package/dist/index.cjs564.js +2 -0
  1034. package/dist/index.cjs564.js.map +1 -0
  1035. package/dist/index.cjs565.js +2 -0
  1036. package/dist/index.cjs565.js.map +1 -0
  1037. package/dist/index.cjs566.js +13 -0
  1038. package/dist/index.cjs566.js.map +1 -0
  1039. package/dist/index.cjs567.js +2 -0
  1040. package/dist/index.cjs567.js.map +1 -0
  1041. package/dist/index.cjs568.js +2 -0
  1042. package/dist/index.cjs568.js.map +1 -0
  1043. package/dist/index.cjs569.js +2 -0
  1044. package/dist/index.cjs569.js.map +1 -0
  1045. package/dist/index.cjs57.js +2 -0
  1046. package/dist/index.cjs57.js.map +1 -0
  1047. package/dist/index.cjs570.js +2 -0
  1048. package/dist/index.cjs570.js.map +1 -0
  1049. package/dist/index.cjs571.js +2 -0
  1050. package/dist/index.cjs571.js.map +1 -0
  1051. package/dist/index.cjs572.js +2 -0
  1052. package/dist/index.cjs572.js.map +1 -0
  1053. package/dist/index.cjs573.js +2 -0
  1054. package/dist/index.cjs573.js.map +1 -0
  1055. package/dist/index.cjs574.js +3 -0
  1056. package/dist/index.cjs574.js.map +1 -0
  1057. package/dist/index.cjs575.js +2 -0
  1058. package/dist/index.cjs575.js.map +1 -0
  1059. package/dist/index.cjs576.js +2 -0
  1060. package/dist/index.cjs576.js.map +1 -0
  1061. package/dist/index.cjs577.js +2 -0
  1062. package/dist/index.cjs577.js.map +1 -0
  1063. package/dist/index.cjs578.js +2 -0
  1064. package/dist/index.cjs578.js.map +1 -0
  1065. package/dist/index.cjs579.js +2 -0
  1066. package/dist/index.cjs579.js.map +1 -0
  1067. package/dist/index.cjs58.js +2 -0
  1068. package/dist/index.cjs58.js.map +1 -0
  1069. package/dist/index.cjs580.js +2 -0
  1070. package/dist/index.cjs580.js.map +1 -0
  1071. package/dist/index.cjs581.js +2 -0
  1072. package/dist/index.cjs581.js.map +1 -0
  1073. package/dist/index.cjs582.js +2 -0
  1074. package/dist/index.cjs582.js.map +1 -0
  1075. package/dist/index.cjs583.js +2 -0
  1076. package/dist/index.cjs583.js.map +1 -0
  1077. package/dist/index.cjs584.js +2 -0
  1078. package/dist/index.cjs584.js.map +1 -0
  1079. package/dist/index.cjs585.js +2 -0
  1080. package/dist/index.cjs585.js.map +1 -0
  1081. package/dist/index.cjs586.js +2 -0
  1082. package/dist/index.cjs586.js.map +1 -0
  1083. package/dist/index.cjs587.js +2 -0
  1084. package/dist/index.cjs587.js.map +1 -0
  1085. package/dist/index.cjs588.js +2 -0
  1086. package/dist/index.cjs588.js.map +1 -0
  1087. package/dist/index.cjs589.js +2 -0
  1088. package/dist/index.cjs589.js.map +1 -0
  1089. package/dist/index.cjs59.js +2 -0
  1090. package/dist/index.cjs59.js.map +1 -0
  1091. package/dist/index.cjs590.js +2 -0
  1092. package/dist/index.cjs590.js.map +1 -0
  1093. package/dist/index.cjs591.js +2 -0
  1094. package/dist/index.cjs591.js.map +1 -0
  1095. package/dist/index.cjs592.js +2 -0
  1096. package/dist/index.cjs592.js.map +1 -0
  1097. package/dist/index.cjs593.js +2 -0
  1098. package/dist/index.cjs593.js.map +1 -0
  1099. package/dist/index.cjs594.js +2 -0
  1100. package/dist/index.cjs594.js.map +1 -0
  1101. package/dist/index.cjs595.js +2 -0
  1102. package/dist/index.cjs595.js.map +1 -0
  1103. package/dist/index.cjs596.js +2 -0
  1104. package/dist/index.cjs596.js.map +1 -0
  1105. package/dist/index.cjs597.js +2 -0
  1106. package/dist/index.cjs597.js.map +1 -0
  1107. package/dist/index.cjs598.js +2 -0
  1108. package/dist/index.cjs598.js.map +1 -0
  1109. package/dist/index.cjs599.js +2 -0
  1110. package/dist/index.cjs599.js.map +1 -0
  1111. package/dist/index.cjs6.js +2 -0
  1112. package/dist/index.cjs6.js.map +1 -0
  1113. package/dist/index.cjs60.js +2 -0
  1114. package/dist/index.cjs60.js.map +1 -0
  1115. package/dist/index.cjs600.js +2 -0
  1116. package/dist/index.cjs600.js.map +1 -0
  1117. package/dist/index.cjs601.js +39 -0
  1118. package/dist/index.cjs601.js.map +1 -0
  1119. package/dist/index.cjs602.js +2 -0
  1120. package/dist/index.cjs602.js.map +1 -0
  1121. package/dist/index.cjs603.js +2 -0
  1122. package/dist/index.cjs603.js.map +1 -0
  1123. package/dist/index.cjs604.js +2 -0
  1124. package/dist/index.cjs604.js.map +1 -0
  1125. package/dist/index.cjs605.js +2 -0
  1126. package/dist/index.cjs605.js.map +1 -0
  1127. package/dist/index.cjs606.js +2 -0
  1128. package/dist/index.cjs606.js.map +1 -0
  1129. package/dist/index.cjs607.js +2 -0
  1130. package/dist/index.cjs607.js.map +1 -0
  1131. package/dist/index.cjs608.js +2 -0
  1132. package/dist/index.cjs608.js.map +1 -0
  1133. package/dist/index.cjs609.js +2 -0
  1134. package/dist/index.cjs609.js.map +1 -0
  1135. package/dist/index.cjs61.js +2 -0
  1136. package/dist/index.cjs61.js.map +1 -0
  1137. package/dist/index.cjs610.js +2 -0
  1138. package/dist/index.cjs610.js.map +1 -0
  1139. package/dist/index.cjs611.js +2 -0
  1140. package/dist/index.cjs611.js.map +1 -0
  1141. package/dist/index.cjs612.js +2 -0
  1142. package/dist/index.cjs612.js.map +1 -0
  1143. package/dist/index.cjs613.js +10 -0
  1144. package/dist/index.cjs613.js.map +1 -0
  1145. package/dist/index.cjs614.js +20 -0
  1146. package/dist/index.cjs614.js.map +1 -0
  1147. package/dist/index.cjs615.js +2 -0
  1148. package/dist/index.cjs615.js.map +1 -0
  1149. package/dist/index.cjs616.js +2 -0
  1150. package/dist/index.cjs616.js.map +1 -0
  1151. package/dist/index.cjs617.js +2 -0
  1152. package/dist/index.cjs617.js.map +1 -0
  1153. package/dist/index.cjs618.js +2 -0
  1154. package/dist/index.cjs618.js.map +1 -0
  1155. package/dist/index.cjs619.js +2 -0
  1156. package/dist/index.cjs619.js.map +1 -0
  1157. package/dist/index.cjs62.js +2 -0
  1158. package/dist/index.cjs62.js.map +1 -0
  1159. package/dist/index.cjs620.js +2 -0
  1160. package/dist/index.cjs620.js.map +1 -0
  1161. package/dist/index.cjs621.js +2 -0
  1162. package/dist/index.cjs621.js.map +1 -0
  1163. package/dist/index.cjs622.js +2 -0
  1164. package/dist/index.cjs622.js.map +1 -0
  1165. package/dist/index.cjs623.js +2 -0
  1166. package/dist/index.cjs623.js.map +1 -0
  1167. package/dist/index.cjs624.js +2 -0
  1168. package/dist/index.cjs624.js.map +1 -0
  1169. package/dist/index.cjs625.js +2 -0
  1170. package/dist/index.cjs625.js.map +1 -0
  1171. package/dist/index.cjs626.js +2 -0
  1172. package/dist/index.cjs626.js.map +1 -0
  1173. package/dist/index.cjs627.js +2 -0
  1174. package/dist/index.cjs627.js.map +1 -0
  1175. package/dist/index.cjs628.js +2 -0
  1176. package/dist/index.cjs628.js.map +1 -0
  1177. package/dist/index.cjs629.js +2 -0
  1178. package/dist/index.cjs629.js.map +1 -0
  1179. package/dist/index.cjs63.js +2 -0
  1180. package/dist/index.cjs63.js.map +1 -0
  1181. package/dist/index.cjs630.js +2 -0
  1182. package/dist/index.cjs630.js.map +1 -0
  1183. package/dist/index.cjs631.js +2 -0
  1184. package/dist/index.cjs631.js.map +1 -0
  1185. package/dist/index.cjs632.js +2 -0
  1186. package/dist/index.cjs632.js.map +1 -0
  1187. package/dist/index.cjs633.js +2 -0
  1188. package/dist/index.cjs633.js.map +1 -0
  1189. package/dist/index.cjs634.js +2 -0
  1190. package/dist/index.cjs634.js.map +1 -0
  1191. package/dist/index.cjs635.js +2 -0
  1192. package/dist/index.cjs635.js.map +1 -0
  1193. package/dist/index.cjs636.js +2 -0
  1194. package/dist/index.cjs636.js.map +1 -0
  1195. package/dist/index.cjs637.js +2 -0
  1196. package/dist/index.cjs637.js.map +1 -0
  1197. package/dist/index.cjs638.js +2 -0
  1198. package/dist/index.cjs638.js.map +1 -0
  1199. package/dist/index.cjs639.js +2 -0
  1200. package/dist/index.cjs639.js.map +1 -0
  1201. package/dist/index.cjs64.js +2 -0
  1202. package/dist/index.cjs64.js.map +1 -0
  1203. package/dist/index.cjs640.js +2 -0
  1204. package/dist/index.cjs640.js.map +1 -0
  1205. package/dist/index.cjs641.js +2 -0
  1206. package/dist/index.cjs641.js.map +1 -0
  1207. package/dist/index.cjs642.js +2 -0
  1208. package/dist/index.cjs642.js.map +1 -0
  1209. package/dist/index.cjs643.js +2 -0
  1210. package/dist/index.cjs643.js.map +1 -0
  1211. package/dist/index.cjs644.js +2 -0
  1212. package/dist/index.cjs644.js.map +1 -0
  1213. package/dist/index.cjs645.js +2 -0
  1214. package/dist/index.cjs645.js.map +1 -0
  1215. package/dist/index.cjs646.js +2 -0
  1216. package/dist/index.cjs646.js.map +1 -0
  1217. package/dist/index.cjs647.js +2 -0
  1218. package/dist/index.cjs647.js.map +1 -0
  1219. package/dist/index.cjs648.js +2 -0
  1220. package/dist/index.cjs648.js.map +1 -0
  1221. package/dist/index.cjs649.js +2 -0
  1222. package/dist/index.cjs649.js.map +1 -0
  1223. package/dist/index.cjs65.js +2 -0
  1224. package/dist/index.cjs65.js.map +1 -0
  1225. package/dist/index.cjs650.js +2 -0
  1226. package/dist/index.cjs650.js.map +1 -0
  1227. package/dist/index.cjs651.js +2 -0
  1228. package/dist/index.cjs651.js.map +1 -0
  1229. package/dist/index.cjs652.js +2 -0
  1230. package/dist/index.cjs652.js.map +1 -0
  1231. package/dist/index.cjs653.js +2 -0
  1232. package/dist/index.cjs653.js.map +1 -0
  1233. package/dist/index.cjs654.js +2 -0
  1234. package/dist/index.cjs654.js.map +1 -0
  1235. package/dist/index.cjs655.js +2 -0
  1236. package/dist/index.cjs655.js.map +1 -0
  1237. package/dist/index.cjs656.js +2 -0
  1238. package/dist/index.cjs656.js.map +1 -0
  1239. package/dist/index.cjs657.js +2 -0
  1240. package/dist/index.cjs657.js.map +1 -0
  1241. package/dist/index.cjs658.js +2 -0
  1242. package/dist/index.cjs658.js.map +1 -0
  1243. package/dist/index.cjs659.js +2 -0
  1244. package/dist/index.cjs659.js.map +1 -0
  1245. package/dist/index.cjs66.js +2 -0
  1246. package/dist/index.cjs66.js.map +1 -0
  1247. package/dist/index.cjs660.js +2 -0
  1248. package/dist/index.cjs660.js.map +1 -0
  1249. package/dist/index.cjs661.js +2 -0
  1250. package/dist/index.cjs661.js.map +1 -0
  1251. package/dist/index.cjs662.js +2 -0
  1252. package/dist/index.cjs662.js.map +1 -0
  1253. package/dist/index.cjs663.js +2 -0
  1254. package/dist/index.cjs663.js.map +1 -0
  1255. package/dist/index.cjs664.js +10 -0
  1256. package/dist/index.cjs664.js.map +1 -0
  1257. package/dist/index.cjs665.js +20 -0
  1258. package/dist/index.cjs665.js.map +1 -0
  1259. package/dist/index.cjs666.js +2 -0
  1260. package/dist/index.cjs666.js.map +1 -0
  1261. package/dist/index.cjs667.js +2 -0
  1262. package/dist/index.cjs667.js.map +1 -0
  1263. package/dist/index.cjs668.js +2 -0
  1264. package/dist/index.cjs668.js.map +1 -0
  1265. package/dist/index.cjs669.js +2 -0
  1266. package/dist/index.cjs669.js.map +1 -0
  1267. package/dist/index.cjs67.js +2 -0
  1268. package/dist/index.cjs67.js.map +1 -0
  1269. package/dist/index.cjs670.js +2 -0
  1270. package/dist/index.cjs670.js.map +1 -0
  1271. package/dist/index.cjs671.js +2 -0
  1272. package/dist/index.cjs671.js.map +1 -0
  1273. package/dist/index.cjs672.js +2 -0
  1274. package/dist/index.cjs672.js.map +1 -0
  1275. package/dist/index.cjs673.js +2 -0
  1276. package/dist/index.cjs673.js.map +1 -0
  1277. package/dist/index.cjs674.js +2 -0
  1278. package/dist/index.cjs674.js.map +1 -0
  1279. package/dist/index.cjs675.js +2 -0
  1280. package/dist/index.cjs675.js.map +1 -0
  1281. package/dist/index.cjs676.js +2 -0
  1282. package/dist/index.cjs676.js.map +1 -0
  1283. package/dist/index.cjs677.js +2 -0
  1284. package/dist/index.cjs677.js.map +1 -0
  1285. package/dist/index.cjs678.js +2 -0
  1286. package/dist/index.cjs678.js.map +1 -0
  1287. package/dist/index.cjs679.js +2 -0
  1288. package/dist/index.cjs679.js.map +1 -0
  1289. package/dist/index.cjs68.js +2 -0
  1290. package/dist/index.cjs68.js.map +1 -0
  1291. package/dist/index.cjs680.js +2 -0
  1292. package/dist/index.cjs680.js.map +1 -0
  1293. package/dist/index.cjs681.js +2 -0
  1294. package/dist/index.cjs681.js.map +1 -0
  1295. package/dist/index.cjs682.js +2 -0
  1296. package/dist/index.cjs682.js.map +1 -0
  1297. package/dist/index.cjs683.js +2 -0
  1298. package/dist/index.cjs683.js.map +1 -0
  1299. package/dist/index.cjs684.js +2 -0
  1300. package/dist/index.cjs684.js.map +1 -0
  1301. package/dist/index.cjs685.js +2 -0
  1302. package/dist/index.cjs685.js.map +1 -0
  1303. package/dist/index.cjs686.js +4 -0
  1304. package/dist/index.cjs686.js.map +1 -0
  1305. package/dist/index.cjs687.js +2 -0
  1306. package/dist/index.cjs687.js.map +1 -0
  1307. package/dist/index.cjs688.js +2 -0
  1308. package/dist/index.cjs688.js.map +1 -0
  1309. package/dist/index.cjs689.js +2 -0
  1310. package/dist/index.cjs689.js.map +1 -0
  1311. package/dist/index.cjs69.js +2 -0
  1312. package/dist/index.cjs69.js.map +1 -0
  1313. package/dist/index.cjs690.js +2 -0
  1314. package/dist/index.cjs690.js.map +1 -0
  1315. package/dist/index.cjs691.js +2 -0
  1316. package/dist/index.cjs691.js.map +1 -0
  1317. package/dist/index.cjs692.js +2 -0
  1318. package/dist/index.cjs692.js.map +1 -0
  1319. package/dist/index.cjs693.js +2 -0
  1320. package/dist/index.cjs693.js.map +1 -0
  1321. package/dist/index.cjs694.js +2 -0
  1322. package/dist/index.cjs694.js.map +1 -0
  1323. package/dist/index.cjs695.js +2 -0
  1324. package/dist/index.cjs695.js.map +1 -0
  1325. package/dist/index.cjs696.js +2 -0
  1326. package/dist/index.cjs696.js.map +1 -0
  1327. package/dist/index.cjs697.js +2 -0
  1328. package/dist/index.cjs697.js.map +1 -0
  1329. package/dist/index.cjs698.js +2 -0
  1330. package/dist/index.cjs698.js.map +1 -0
  1331. package/dist/index.cjs699.js +2 -0
  1332. package/dist/index.cjs699.js.map +1 -0
  1333. package/dist/index.cjs7.js +2 -0
  1334. package/dist/index.cjs7.js.map +1 -0
  1335. package/dist/index.cjs70.js +2 -0
  1336. package/dist/index.cjs70.js.map +1 -0
  1337. package/dist/index.cjs700.js +2 -0
  1338. package/dist/index.cjs700.js.map +1 -0
  1339. package/dist/index.cjs701.js +2 -0
  1340. package/dist/index.cjs701.js.map +1 -0
  1341. package/dist/index.cjs702.js +2 -0
  1342. package/dist/index.cjs702.js.map +1 -0
  1343. package/dist/index.cjs703.js +2 -0
  1344. package/dist/index.cjs703.js.map +1 -0
  1345. package/dist/index.cjs704.js +2 -0
  1346. package/dist/index.cjs704.js.map +1 -0
  1347. package/dist/index.cjs705.js +2 -0
  1348. package/dist/index.cjs705.js.map +1 -0
  1349. package/dist/index.cjs706.js +2 -0
  1350. package/dist/index.cjs706.js.map +1 -0
  1351. package/dist/index.cjs707.js +2 -0
  1352. package/dist/index.cjs707.js.map +1 -0
  1353. package/dist/index.cjs708.js +2 -0
  1354. package/dist/index.cjs708.js.map +1 -0
  1355. package/dist/index.cjs709.js +2 -0
  1356. package/dist/index.cjs709.js.map +1 -0
  1357. package/dist/index.cjs71.js +2 -0
  1358. package/dist/index.cjs71.js.map +1 -0
  1359. package/dist/index.cjs710.js +2 -0
  1360. package/dist/index.cjs710.js.map +1 -0
  1361. package/dist/index.cjs711.js +2 -0
  1362. package/dist/index.cjs711.js.map +1 -0
  1363. package/dist/index.cjs712.js +3 -0
  1364. package/dist/index.cjs712.js.map +1 -0
  1365. package/dist/index.cjs713.js +2 -0
  1366. package/dist/index.cjs713.js.map +1 -0
  1367. package/dist/index.cjs714.js +2 -0
  1368. package/dist/index.cjs714.js.map +1 -0
  1369. package/dist/index.cjs715.js +2 -0
  1370. package/dist/index.cjs715.js.map +1 -0
  1371. package/dist/index.cjs716.js +2 -0
  1372. package/dist/index.cjs716.js.map +1 -0
  1373. package/dist/index.cjs717.js +2 -0
  1374. package/dist/index.cjs717.js.map +1 -0
  1375. package/dist/index.cjs718.js +2 -0
  1376. package/dist/index.cjs718.js.map +1 -0
  1377. package/dist/index.cjs719.js +2 -0
  1378. package/dist/index.cjs719.js.map +1 -0
  1379. package/dist/index.cjs72.js +2 -0
  1380. package/dist/index.cjs72.js.map +1 -0
  1381. package/dist/index.cjs720.js +5 -0
  1382. package/dist/index.cjs720.js.map +1 -0
  1383. package/dist/index.cjs721.js +2 -0
  1384. package/dist/index.cjs721.js.map +1 -0
  1385. package/dist/index.cjs722.js +2 -0
  1386. package/dist/index.cjs722.js.map +1 -0
  1387. package/dist/index.cjs723.js +2 -0
  1388. package/dist/index.cjs723.js.map +1 -0
  1389. package/dist/index.cjs724.js +2 -0
  1390. package/dist/index.cjs724.js.map +1 -0
  1391. package/dist/index.cjs725.js +9 -0
  1392. package/dist/index.cjs725.js.map +1 -0
  1393. package/dist/index.cjs726.js +9 -0
  1394. package/dist/index.cjs726.js.map +1 -0
  1395. package/dist/index.cjs727.js +6 -0
  1396. package/dist/index.cjs727.js.map +1 -0
  1397. package/dist/index.cjs728.js +2 -0
  1398. package/dist/index.cjs728.js.map +1 -0
  1399. package/dist/index.cjs729.js +2 -0
  1400. package/dist/index.cjs729.js.map +1 -0
  1401. package/dist/index.cjs73.js +2 -0
  1402. package/dist/index.cjs73.js.map +1 -0
  1403. package/dist/index.cjs730.js +2 -0
  1404. package/dist/index.cjs730.js.map +1 -0
  1405. package/dist/index.cjs731.js +39 -0
  1406. package/dist/index.cjs731.js.map +1 -0
  1407. package/dist/index.cjs732.js +2 -0
  1408. package/dist/index.cjs732.js.map +1 -0
  1409. package/dist/index.cjs733.js +2 -0
  1410. package/dist/index.cjs733.js.map +1 -0
  1411. package/dist/index.cjs734.js +2 -0
  1412. package/dist/index.cjs734.js.map +1 -0
  1413. package/dist/index.cjs735.js +2 -0
  1414. package/dist/index.cjs735.js.map +1 -0
  1415. package/dist/index.cjs736.js +2 -0
  1416. package/dist/index.cjs736.js.map +1 -0
  1417. package/dist/index.cjs737.js +2 -0
  1418. package/dist/index.cjs737.js.map +1 -0
  1419. package/dist/index.cjs738.js +2 -0
  1420. package/dist/index.cjs738.js.map +1 -0
  1421. package/dist/index.cjs739.js +2 -0
  1422. package/dist/index.cjs739.js.map +1 -0
  1423. package/dist/index.cjs74.js +2 -0
  1424. package/dist/index.cjs74.js.map +1 -0
  1425. package/dist/index.cjs740.js +2 -0
  1426. package/dist/index.cjs740.js.map +1 -0
  1427. package/dist/index.cjs741.js +2 -0
  1428. package/dist/index.cjs741.js.map +1 -0
  1429. package/dist/index.cjs742.js +2 -0
  1430. package/dist/index.cjs742.js.map +1 -0
  1431. package/dist/index.cjs743.js +2 -0
  1432. package/dist/index.cjs743.js.map +1 -0
  1433. package/dist/index.cjs75.js +2 -0
  1434. package/dist/index.cjs75.js.map +1 -0
  1435. package/dist/index.cjs76.js +2 -0
  1436. package/dist/index.cjs76.js.map +1 -0
  1437. package/dist/index.cjs77.js +2 -0
  1438. package/dist/index.cjs77.js.map +1 -0
  1439. package/dist/index.cjs78.js +2 -0
  1440. package/dist/index.cjs78.js.map +1 -0
  1441. package/dist/index.cjs79.js +2 -0
  1442. package/dist/index.cjs79.js.map +1 -0
  1443. package/dist/index.cjs8.js +3 -0
  1444. package/dist/index.cjs8.js.map +1 -0
  1445. package/dist/index.cjs80.js +2 -0
  1446. package/dist/index.cjs80.js.map +1 -0
  1447. package/dist/index.cjs81.js +2 -0
  1448. package/dist/index.cjs81.js.map +1 -0
  1449. package/dist/index.cjs82.js +581 -0
  1450. package/dist/index.cjs82.js.map +1 -0
  1451. package/dist/index.cjs83.js +2 -0
  1452. package/dist/index.cjs83.js.map +1 -0
  1453. package/dist/index.cjs84.js +2 -0
  1454. package/dist/index.cjs84.js.map +1 -0
  1455. package/dist/index.cjs85.js +2 -0
  1456. package/dist/index.cjs85.js.map +1 -0
  1457. package/dist/index.cjs86.js +2 -0
  1458. package/dist/index.cjs86.js.map +1 -0
  1459. package/dist/index.cjs87.js +5 -0
  1460. package/dist/index.cjs87.js.map +1 -0
  1461. package/dist/index.cjs88.js +2 -0
  1462. package/dist/index.cjs88.js.map +1 -0
  1463. package/dist/index.cjs89.js +2 -0
  1464. package/dist/index.cjs89.js.map +1 -0
  1465. package/dist/index.cjs9.js +2 -0
  1466. package/dist/index.cjs9.js.map +1 -0
  1467. package/dist/index.cjs90.js +2 -0
  1468. package/dist/index.cjs90.js.map +1 -0
  1469. package/dist/index.cjs91.js +2 -0
  1470. package/dist/index.cjs91.js.map +1 -0
  1471. package/dist/index.cjs92.js +2 -0
  1472. package/dist/index.cjs92.js.map +1 -0
  1473. package/dist/index.cjs93.js +2 -0
  1474. package/dist/index.cjs93.js.map +1 -0
  1475. package/dist/index.cjs94.js +2 -0
  1476. package/dist/index.cjs94.js.map +1 -0
  1477. package/dist/index.cjs95.js +2 -0
  1478. package/dist/index.cjs95.js.map +1 -0
  1479. package/dist/index.cjs96.js +2 -0
  1480. package/dist/index.cjs96.js.map +1 -0
  1481. package/dist/index.cjs97.js +2 -0
  1482. package/dist/index.cjs97.js.map +1 -0
  1483. package/dist/index.cjs98.js +2 -0
  1484. package/dist/index.cjs98.js.map +1 -0
  1485. package/dist/index.cjs99.js +2 -0
  1486. package/dist/index.cjs99.js.map +1 -0
  1487. package/dist/index.es.js +28 -0
  1488. package/dist/index.es.js.map +1 -0
  1489. package/dist/index.es10.js +73 -0
  1490. package/dist/index.es10.js.map +1 -0
  1491. package/dist/index.es100.js +167 -0
  1492. package/dist/index.es100.js.map +1 -0
  1493. package/dist/index.es101.js +337 -0
  1494. package/dist/index.es101.js.map +1 -0
  1495. package/dist/index.es102.js +2 -0
  1496. package/dist/index.es102.js.map +1 -0
  1497. package/dist/index.es103.js +50 -0
  1498. package/dist/index.es103.js.map +1 -0
  1499. package/dist/index.es104.js +231 -0
  1500. package/dist/index.es104.js.map +1 -0
  1501. package/dist/index.es105.js +20 -0
  1502. package/dist/index.es105.js.map +1 -0
  1503. package/dist/index.es106.js +2 -0
  1504. package/dist/index.es106.js.map +1 -0
  1505. package/dist/index.es107.js +16 -0
  1506. package/dist/index.es107.js.map +1 -0
  1507. package/dist/index.es108.js +14 -0
  1508. package/dist/index.es108.js.map +1 -0
  1509. package/dist/index.es109.js +246 -0
  1510. package/dist/index.es109.js.map +1 -0
  1511. package/dist/index.es11.js +25 -0
  1512. package/dist/index.es11.js.map +1 -0
  1513. package/dist/index.es110.js +20 -0
  1514. package/dist/index.es110.js.map +1 -0
  1515. package/dist/index.es111.js +16 -0
  1516. package/dist/index.es111.js.map +1 -0
  1517. package/dist/index.es112.js +15 -0
  1518. package/dist/index.es112.js.map +1 -0
  1519. package/dist/index.es113.js +18 -0
  1520. package/dist/index.es113.js.map +1 -0
  1521. package/dist/index.es114.js +5 -0
  1522. package/dist/index.es114.js.map +1 -0
  1523. package/dist/index.es115.js +33 -0
  1524. package/dist/index.es115.js.map +1 -0
  1525. package/dist/index.es116.js +605 -0
  1526. package/dist/index.es116.js.map +1 -0
  1527. package/dist/index.es117.js +14 -0
  1528. package/dist/index.es117.js.map +1 -0
  1529. package/dist/index.es118.js +9 -0
  1530. package/dist/index.es118.js.map +1 -0
  1531. package/dist/index.es119.js +8 -0
  1532. package/dist/index.es119.js.map +1 -0
  1533. package/dist/index.es12.js +25 -0
  1534. package/dist/index.es12.js.map +1 -0
  1535. package/dist/index.es120.js +28 -0
  1536. package/dist/index.es120.js.map +1 -0
  1537. package/dist/index.es121.js +10 -0
  1538. package/dist/index.es121.js.map +1 -0
  1539. package/dist/index.es122.js +17 -0
  1540. package/dist/index.es122.js.map +1 -0
  1541. package/dist/index.es123.js +89 -0
  1542. package/dist/index.es123.js.map +1 -0
  1543. package/dist/index.es124.js +19 -0
  1544. package/dist/index.es124.js.map +1 -0
  1545. package/dist/index.es125.js +38 -0
  1546. package/dist/index.es125.js.map +1 -0
  1547. package/dist/index.es126.js +137 -0
  1548. package/dist/index.es126.js.map +1 -0
  1549. package/dist/index.es127.js +189 -0
  1550. package/dist/index.es127.js.map +1 -0
  1551. package/dist/index.es128.js +15 -0
  1552. package/dist/index.es128.js.map +1 -0
  1553. package/dist/index.es129.js +82 -0
  1554. package/dist/index.es129.js.map +1 -0
  1555. package/dist/index.es13.js +25 -0
  1556. package/dist/index.es13.js.map +1 -0
  1557. package/dist/index.es130.js +45 -0
  1558. package/dist/index.es130.js.map +1 -0
  1559. package/dist/index.es131.js +21 -0
  1560. package/dist/index.es131.js.map +1 -0
  1561. package/dist/index.es132.js +13 -0
  1562. package/dist/index.es132.js.map +1 -0
  1563. package/dist/index.es133.js +50 -0
  1564. package/dist/index.es133.js.map +1 -0
  1565. package/dist/index.es134.js +54 -0
  1566. package/dist/index.es134.js.map +1 -0
  1567. package/dist/index.es135.js +508 -0
  1568. package/dist/index.es135.js.map +1 -0
  1569. package/dist/index.es136.js +108 -0
  1570. package/dist/index.es136.js.map +1 -0
  1571. package/dist/index.es137.js +90 -0
  1572. package/dist/index.es137.js.map +1 -0
  1573. package/dist/index.es138.js +378 -0
  1574. package/dist/index.es138.js.map +1 -0
  1575. package/dist/index.es139.js +126 -0
  1576. package/dist/index.es139.js.map +1 -0
  1577. package/dist/index.es14.js +25 -0
  1578. package/dist/index.es14.js.map +1 -0
  1579. package/dist/index.es140.js +681 -0
  1580. package/dist/index.es140.js.map +1 -0
  1581. package/dist/index.es141.js +16852 -0
  1582. package/dist/index.es141.js.map +1 -0
  1583. package/dist/index.es142.js +154 -0
  1584. package/dist/index.es142.js.map +1 -0
  1585. package/dist/index.es143.js +10 -0
  1586. package/dist/index.es143.js.map +1 -0
  1587. package/dist/index.es144.js +192 -0
  1588. package/dist/index.es144.js.map +1 -0
  1589. package/dist/index.es145.js +813 -0
  1590. package/dist/index.es145.js.map +1 -0
  1591. package/dist/index.es146.js +10074 -0
  1592. package/dist/index.es146.js.map +1 -0
  1593. package/dist/index.es147.js +101 -0
  1594. package/dist/index.es147.js.map +1 -0
  1595. package/dist/index.es148.js +20 -0
  1596. package/dist/index.es148.js.map +1 -0
  1597. package/dist/index.es149.js +61 -0
  1598. package/dist/index.es149.js.map +1 -0
  1599. package/dist/index.es15.js +9 -0
  1600. package/dist/index.es15.js.map +1 -0
  1601. package/dist/index.es150.js +10 -0
  1602. package/dist/index.es150.js.map +1 -0
  1603. package/dist/index.es151.js +1562 -0
  1604. package/dist/index.es151.js.map +1 -0
  1605. package/dist/index.es152.js +36 -0
  1606. package/dist/index.es152.js.map +1 -0
  1607. package/dist/index.es153.js +5 -0
  1608. package/dist/index.es153.js.map +1 -0
  1609. package/dist/index.es154.js +5 -0
  1610. package/dist/index.es154.js.map +1 -0
  1611. package/dist/index.es155.js +2105 -0
  1612. package/dist/index.es155.js.map +1 -0
  1613. package/dist/index.es156.js +15 -0
  1614. package/dist/index.es156.js.map +1 -0
  1615. package/dist/index.es157.js +9 -0
  1616. package/dist/index.es157.js.map +1 -0
  1617. package/dist/index.es158.js +13 -0
  1618. package/dist/index.es158.js.map +1 -0
  1619. package/dist/index.es159.js +17 -0
  1620. package/dist/index.es159.js.map +1 -0
  1621. package/dist/index.es16.js +2 -0
  1622. package/dist/index.es16.js.map +1 -0
  1623. package/dist/index.es160.js +17 -0
  1624. package/dist/index.es160.js.map +1 -0
  1625. package/dist/index.es161.js +17 -0
  1626. package/dist/index.es161.js.map +1 -0
  1627. package/dist/index.es162.js +56 -0
  1628. package/dist/index.es162.js.map +1 -0
  1629. package/dist/index.es163.js +34 -0
  1630. package/dist/index.es163.js.map +1 -0
  1631. package/dist/index.es164.js +4 -0
  1632. package/dist/index.es164.js.map +1 -0
  1633. package/dist/index.es165.js +4 -0
  1634. package/dist/index.es165.js.map +1 -0
  1635. package/dist/index.es166.js +7 -0
  1636. package/dist/index.es166.js.map +1 -0
  1637. package/dist/index.es167.js +15 -0
  1638. package/dist/index.es167.js.map +1 -0
  1639. package/dist/index.es168.js +11 -0
  1640. package/dist/index.es168.js.map +1 -0
  1641. package/dist/index.es169.js +4 -0
  1642. package/dist/index.es169.js.map +1 -0
  1643. package/dist/index.es17.js +203 -0
  1644. package/dist/index.es17.js.map +1 -0
  1645. package/dist/index.es170.js +4 -0
  1646. package/dist/index.es170.js.map +1 -0
  1647. package/dist/index.es171.js +7 -0
  1648. package/dist/index.es171.js.map +1 -0
  1649. package/dist/index.es172.js +6 -0
  1650. package/dist/index.es172.js.map +1 -0
  1651. package/dist/index.es173.js +6 -0
  1652. package/dist/index.es173.js.map +1 -0
  1653. package/dist/index.es174.js +4 -0
  1654. package/dist/index.es174.js.map +1 -0
  1655. package/dist/index.es175.js +18527 -0
  1656. package/dist/index.es175.js.map +1 -0
  1657. package/dist/index.es176.js +20 -0
  1658. package/dist/index.es176.js.map +1 -0
  1659. package/dist/index.es177.js +17 -0
  1660. package/dist/index.es177.js.map +1 -0
  1661. package/dist/index.es178.js +17 -0
  1662. package/dist/index.es178.js.map +1 -0
  1663. package/dist/index.es179.js +40 -0
  1664. package/dist/index.es179.js.map +1 -0
  1665. package/dist/index.es18.js +2934 -0
  1666. package/dist/index.es18.js.map +1 -0
  1667. package/dist/index.es180.js +14 -0
  1668. package/dist/index.es180.js.map +1 -0
  1669. package/dist/index.es181.js +13 -0
  1670. package/dist/index.es181.js.map +1 -0
  1671. package/dist/index.es182.js +88 -0
  1672. package/dist/index.es182.js.map +1 -0
  1673. package/dist/index.es183.js +7 -0
  1674. package/dist/index.es183.js.map +1 -0
  1675. package/dist/index.es184.js +17 -0
  1676. package/dist/index.es184.js.map +1 -0
  1677. package/dist/index.es185.js +18 -0
  1678. package/dist/index.es185.js.map +1 -0
  1679. package/dist/index.es186.js +276 -0
  1680. package/dist/index.es186.js.map +1 -0
  1681. package/dist/index.es187.js +18 -0
  1682. package/dist/index.es187.js.map +1 -0
  1683. package/dist/index.es188.js +22 -0
  1684. package/dist/index.es188.js.map +1 -0
  1685. package/dist/index.es189.js +8 -0
  1686. package/dist/index.es189.js.map +1 -0
  1687. package/dist/index.es19.js +2 -0
  1688. package/dist/index.es19.js.map +1 -0
  1689. package/dist/index.es190.js +7 -0
  1690. package/dist/index.es190.js.map +1 -0
  1691. package/dist/index.es191.js +7 -0
  1692. package/dist/index.es191.js.map +1 -0
  1693. package/dist/index.es192.js +8 -0
  1694. package/dist/index.es192.js.map +1 -0
  1695. package/dist/index.es193.js +7 -0
  1696. package/dist/index.es193.js.map +1 -0
  1697. package/dist/index.es194.js +6 -0
  1698. package/dist/index.es194.js.map +1 -0
  1699. package/dist/index.es195.js +6 -0
  1700. package/dist/index.es195.js.map +1 -0
  1701. package/dist/index.es196.js +6 -0
  1702. package/dist/index.es196.js.map +1 -0
  1703. package/dist/index.es197.js +6 -0
  1704. package/dist/index.es197.js.map +1 -0
  1705. package/dist/index.es198.js +6 -0
  1706. package/dist/index.es198.js.map +1 -0
  1707. package/dist/index.es199.js +6 -0
  1708. package/dist/index.es199.js.map +1 -0
  1709. package/dist/index.es2.js +2 -0
  1710. package/dist/index.es2.js.map +1 -0
  1711. package/dist/index.es20.js +16 -0
  1712. package/dist/index.es20.js.map +1 -0
  1713. package/dist/index.es200.js +6 -0
  1714. package/dist/index.es200.js.map +1 -0
  1715. package/dist/index.es201.js +13 -0
  1716. package/dist/index.es201.js.map +1 -0
  1717. package/dist/index.es202.js +7 -0
  1718. package/dist/index.es202.js.map +1 -0
  1719. package/dist/index.es203.js +9 -0
  1720. package/dist/index.es203.js.map +1 -0
  1721. package/dist/index.es204.js +9 -0
  1722. package/dist/index.es204.js.map +1 -0
  1723. package/dist/index.es205.js +13 -0
  1724. package/dist/index.es205.js.map +1 -0
  1725. package/dist/index.es206.js +15 -0
  1726. package/dist/index.es206.js.map +1 -0
  1727. package/dist/index.es207.js +16 -0
  1728. package/dist/index.es207.js.map +1 -0
  1729. package/dist/index.es208.js +89 -0
  1730. package/dist/index.es208.js.map +1 -0
  1731. package/dist/index.es209.js +6 -0
  1732. package/dist/index.es209.js.map +1 -0
  1733. package/dist/index.es21.js +15 -0
  1734. package/dist/index.es21.js.map +1 -0
  1735. package/dist/index.es210.js +18 -0
  1736. package/dist/index.es210.js.map +1 -0
  1737. package/dist/index.es211.js +15 -0
  1738. package/dist/index.es211.js.map +1 -0
  1739. package/dist/index.es212.js +10 -0
  1740. package/dist/index.es212.js.map +1 -0
  1741. package/dist/index.es213.js +10 -0
  1742. package/dist/index.es213.js.map +1 -0
  1743. package/dist/index.es214.js +10 -0
  1744. package/dist/index.es214.js.map +1 -0
  1745. package/dist/index.es215.js +11 -0
  1746. package/dist/index.es215.js.map +1 -0
  1747. package/dist/index.es216.js +7 -0
  1748. package/dist/index.es216.js.map +1 -0
  1749. package/dist/index.es217.js +7 -0
  1750. package/dist/index.es217.js.map +1 -0
  1751. package/dist/index.es218.js +7 -0
  1752. package/dist/index.es218.js.map +1 -0
  1753. package/dist/index.es219.js +10 -0
  1754. package/dist/index.es219.js.map +1 -0
  1755. package/dist/index.es22.js +8 -0
  1756. package/dist/index.es22.js.map +1 -0
  1757. package/dist/index.es220.js +10 -0
  1758. package/dist/index.es220.js.map +1 -0
  1759. package/dist/index.es221.js +7 -0
  1760. package/dist/index.es221.js.map +1 -0
  1761. package/dist/index.es222.js +11 -0
  1762. package/dist/index.es222.js.map +1 -0
  1763. package/dist/index.es223.js +16 -0
  1764. package/dist/index.es223.js.map +1 -0
  1765. package/dist/index.es224.js +14 -0
  1766. package/dist/index.es224.js.map +1 -0
  1767. package/dist/index.es225.js +7 -0
  1768. package/dist/index.es225.js.map +1 -0
  1769. package/dist/index.es226.js +9 -0
  1770. package/dist/index.es226.js.map +1 -0
  1771. package/dist/index.es227.js +6 -0
  1772. package/dist/index.es227.js.map +1 -0
  1773. package/dist/index.es228.js +11 -0
  1774. package/dist/index.es228.js.map +1 -0
  1775. package/dist/index.es229.js +11 -0
  1776. package/dist/index.es229.js.map +1 -0
  1777. package/dist/index.es23.js +31 -0
  1778. package/dist/index.es23.js.map +1 -0
  1779. package/dist/index.es230.js +11 -0
  1780. package/dist/index.es230.js.map +1 -0
  1781. package/dist/index.es231.js +12 -0
  1782. package/dist/index.es231.js.map +1 -0
  1783. package/dist/index.es232.js +7 -0
  1784. package/dist/index.es232.js.map +1 -0
  1785. package/dist/index.es233.js +7 -0
  1786. package/dist/index.es233.js.map +1 -0
  1787. package/dist/index.es234.js +61 -0
  1788. package/dist/index.es234.js.map +1 -0
  1789. package/dist/index.es235.js +17 -0
  1790. package/dist/index.es235.js.map +1 -0
  1791. package/dist/index.es236.js +9 -0
  1792. package/dist/index.es236.js.map +1 -0
  1793. package/dist/index.es237.js +9 -0
  1794. package/dist/index.es237.js.map +1 -0
  1795. package/dist/index.es238.js +12 -0
  1796. package/dist/index.es238.js.map +1 -0
  1797. package/dist/index.es239.js +20 -0
  1798. package/dist/index.es239.js.map +1 -0
  1799. package/dist/index.es24.js +11 -0
  1800. package/dist/index.es24.js.map +1 -0
  1801. package/dist/index.es240.js +17 -0
  1802. package/dist/index.es240.js.map +1 -0
  1803. package/dist/index.es241.js +8 -0
  1804. package/dist/index.es241.js.map +1 -0
  1805. package/dist/index.es242.js +9 -0
  1806. package/dist/index.es242.js.map +1 -0
  1807. package/dist/index.es243.js +12 -0
  1808. package/dist/index.es243.js.map +1 -0
  1809. package/dist/index.es244.js +10 -0
  1810. package/dist/index.es244.js.map +1 -0
  1811. package/dist/index.es245.js +10 -0
  1812. package/dist/index.es245.js.map +1 -0
  1813. package/dist/index.es246.js +12 -0
  1814. package/dist/index.es246.js.map +1 -0
  1815. package/dist/index.es247.js +6 -0
  1816. package/dist/index.es247.js.map +1 -0
  1817. package/dist/index.es248.js +6 -0
  1818. package/dist/index.es248.js.map +1 -0
  1819. package/dist/index.es249.js +14 -0
  1820. package/dist/index.es249.js.map +1 -0
  1821. package/dist/index.es25.js +8 -0
  1822. package/dist/index.es25.js.map +1 -0
  1823. package/dist/index.es250.js +8 -0
  1824. package/dist/index.es250.js.map +1 -0
  1825. package/dist/index.es251.js +7 -0
  1826. package/dist/index.es251.js.map +1 -0
  1827. package/dist/index.es252.js +12 -0
  1828. package/dist/index.es252.js.map +1 -0
  1829. package/dist/index.es253.js +9 -0
  1830. package/dist/index.es253.js.map +1 -0
  1831. package/dist/index.es254.js +20 -0
  1832. package/dist/index.es254.js.map +1 -0
  1833. package/dist/index.es255.js +15 -0
  1834. package/dist/index.es255.js.map +1 -0
  1835. package/dist/index.es256.js +6 -0
  1836. package/dist/index.es256.js.map +1 -0
  1837. package/dist/index.es257.js +6 -0
  1838. package/dist/index.es257.js.map +1 -0
  1839. package/dist/index.es258.js +12 -0
  1840. package/dist/index.es258.js.map +1 -0
  1841. package/dist/index.es259.js +10 -0
  1842. package/dist/index.es259.js.map +1 -0
  1843. package/dist/index.es26.js +13 -0
  1844. package/dist/index.es26.js.map +1 -0
  1845. package/dist/index.es260.js +16 -0
  1846. package/dist/index.es260.js.map +1 -0
  1847. package/dist/index.es261.js +16 -0
  1848. package/dist/index.es261.js.map +1 -0
  1849. package/dist/index.es262.js +10 -0
  1850. package/dist/index.es262.js.map +1 -0
  1851. package/dist/index.es263.js +9 -0
  1852. package/dist/index.es263.js.map +1 -0
  1853. package/dist/index.es264.js +9 -0
  1854. package/dist/index.es264.js.map +1 -0
  1855. package/dist/index.es265.js +20 -0
  1856. package/dist/index.es265.js.map +1 -0
  1857. package/dist/index.es266.js +20 -0
  1858. package/dist/index.es266.js.map +1 -0
  1859. package/dist/index.es267.js +8 -0
  1860. package/dist/index.es267.js.map +1 -0
  1861. package/dist/index.es268.js +20 -0
  1862. package/dist/index.es268.js.map +1 -0
  1863. package/dist/index.es269.js +26 -0
  1864. package/dist/index.es269.js.map +1 -0
  1865. package/dist/index.es27.js +20 -0
  1866. package/dist/index.es27.js.map +1 -0
  1867. package/dist/index.es270.js +9 -0
  1868. package/dist/index.es270.js.map +1 -0
  1869. package/dist/index.es271.js +8 -0
  1870. package/dist/index.es271.js.map +1 -0
  1871. package/dist/index.es272.js +9 -0
  1872. package/dist/index.es272.js.map +1 -0
  1873. package/dist/index.es273.js +8 -0
  1874. package/dist/index.es273.js.map +1 -0
  1875. package/dist/index.es274.js +15 -0
  1876. package/dist/index.es274.js.map +1 -0
  1877. package/dist/index.es275.js +9 -0
  1878. package/dist/index.es275.js.map +1 -0
  1879. package/dist/index.es276.js +8 -0
  1880. package/dist/index.es276.js.map +1 -0
  1881. package/dist/index.es277.js +8 -0
  1882. package/dist/index.es277.js.map +1 -0
  1883. package/dist/index.es278.js +8 -0
  1884. package/dist/index.es278.js.map +1 -0
  1885. package/dist/index.es279.js +8 -0
  1886. package/dist/index.es279.js.map +1 -0
  1887. package/dist/index.es28.js +8 -0
  1888. package/dist/index.es28.js.map +1 -0
  1889. package/dist/index.es280.js +8 -0
  1890. package/dist/index.es280.js.map +1 -0
  1891. package/dist/index.es281.js +8 -0
  1892. package/dist/index.es281.js.map +1 -0
  1893. package/dist/index.es282.js +16 -0
  1894. package/dist/index.es282.js.map +1 -0
  1895. package/dist/index.es283.js +18 -0
  1896. package/dist/index.es283.js.map +1 -0
  1897. package/dist/index.es284.js +12 -0
  1898. package/dist/index.es284.js.map +1 -0
  1899. package/dist/index.es285.js +10 -0
  1900. package/dist/index.es285.js.map +1 -0
  1901. package/dist/index.es286.js +10 -0
  1902. package/dist/index.es286.js.map +1 -0
  1903. package/dist/index.es287.js +12 -0
  1904. package/dist/index.es287.js.map +1 -0
  1905. package/dist/index.es288.js +31 -0
  1906. package/dist/index.es288.js.map +1 -0
  1907. package/dist/index.es289.js +76 -0
  1908. package/dist/index.es289.js.map +1 -0
  1909. package/dist/index.es29.js +8 -0
  1910. package/dist/index.es29.js.map +1 -0
  1911. package/dist/index.es290.js +9 -0
  1912. package/dist/index.es290.js.map +1 -0
  1913. package/dist/index.es291.js +20 -0
  1914. package/dist/index.es291.js.map +1 -0
  1915. package/dist/index.es292.js +74 -0
  1916. package/dist/index.es292.js.map +1 -0
  1917. package/dist/index.es293.js +71 -0
  1918. package/dist/index.es293.js.map +1 -0
  1919. package/dist/index.es294.js +74 -0
  1920. package/dist/index.es294.js.map +1 -0
  1921. package/dist/index.es295.js +5 -0
  1922. package/dist/index.es295.js.map +1 -0
  1923. package/dist/index.es296.js +5 -0
  1924. package/dist/index.es296.js.map +1 -0
  1925. package/dist/index.es297.js +94 -0
  1926. package/dist/index.es297.js.map +1 -0
  1927. package/dist/index.es298.js +89 -0
  1928. package/dist/index.es298.js.map +1 -0
  1929. package/dist/index.es299.js +45 -0
  1930. package/dist/index.es299.js.map +1 -0
  1931. package/dist/index.es3.js +11 -0
  1932. package/dist/index.es3.js.map +1 -0
  1933. package/dist/index.es30.js +8 -0
  1934. package/dist/index.es30.js.map +1 -0
  1935. package/dist/index.es300.js +71 -0
  1936. package/dist/index.es300.js.map +1 -0
  1937. package/dist/index.es301.js +5 -0
  1938. package/dist/index.es301.js.map +1 -0
  1939. package/dist/index.es302.js +1637 -0
  1940. package/dist/index.es302.js.map +1 -0
  1941. package/dist/index.es303.js +38 -0
  1942. package/dist/index.es303.js.map +1 -0
  1943. package/dist/index.es304.js +269 -0
  1944. package/dist/index.es304.js.map +1 -0
  1945. package/dist/index.es305.js +200 -0
  1946. package/dist/index.es305.js.map +1 -0
  1947. package/dist/index.es306.js +38 -0
  1948. package/dist/index.es306.js.map +1 -0
  1949. package/dist/index.es307.js +14 -0
  1950. package/dist/index.es307.js.map +1 -0
  1951. package/dist/index.es308.js +220 -0
  1952. package/dist/index.es308.js.map +1 -0
  1953. package/dist/index.es309.js +7 -0
  1954. package/dist/index.es309.js.map +1 -0
  1955. package/dist/index.es31.js +10 -0
  1956. package/dist/index.es31.js.map +1 -0
  1957. package/dist/index.es310.js +24 -0
  1958. package/dist/index.es310.js.map +1 -0
  1959. package/dist/index.es311.js +26 -0
  1960. package/dist/index.es311.js.map +1 -0
  1961. package/dist/index.es312.js +183 -0
  1962. package/dist/index.es312.js.map +1 -0
  1963. package/dist/index.es313.js +20 -0
  1964. package/dist/index.es313.js.map +1 -0
  1965. package/dist/index.es314.js +385 -0
  1966. package/dist/index.es314.js.map +1 -0
  1967. package/dist/index.es315.js +520 -0
  1968. package/dist/index.es315.js.map +1 -0
  1969. package/dist/index.es316.js +9 -0
  1970. package/dist/index.es316.js.map +1 -0
  1971. package/dist/index.es317.js +121 -0
  1972. package/dist/index.es317.js.map +1 -0
  1973. package/dist/index.es318.js +109 -0
  1974. package/dist/index.es318.js.map +1 -0
  1975. package/dist/index.es319.js +5 -0
  1976. package/dist/index.es319.js.map +1 -0
  1977. package/dist/index.es32.js +10 -0
  1978. package/dist/index.es32.js.map +1 -0
  1979. package/dist/index.es320.js +33 -0
  1980. package/dist/index.es320.js.map +1 -0
  1981. package/dist/index.es321.js +605 -0
  1982. package/dist/index.es321.js.map +1 -0
  1983. package/dist/index.es322.js +31 -0
  1984. package/dist/index.es322.js.map +1 -0
  1985. package/dist/index.es323.js +49 -0
  1986. package/dist/index.es323.js.map +1 -0
  1987. package/dist/index.es324.js +40 -0
  1988. package/dist/index.es324.js.map +1 -0
  1989. package/dist/index.es325.js +13 -0
  1990. package/dist/index.es325.js.map +1 -0
  1991. package/dist/index.es326.js +13 -0
  1992. package/dist/index.es326.js.map +1 -0
  1993. package/dist/index.es327.js +31 -0
  1994. package/dist/index.es327.js.map +1 -0
  1995. package/dist/index.es328.js +13 -0
  1996. package/dist/index.es328.js.map +1 -0
  1997. package/dist/index.es329.js +15 -0
  1998. package/dist/index.es329.js.map +1 -0
  1999. package/dist/index.es33.js +7 -0
  2000. package/dist/index.es33.js.map +1 -0
  2001. package/dist/index.es330.js +7 -0
  2002. package/dist/index.es330.js.map +1 -0
  2003. package/dist/index.es331.js +276 -0
  2004. package/dist/index.es331.js.map +1 -0
  2005. package/dist/index.es332.js +18 -0
  2006. package/dist/index.es332.js.map +1 -0
  2007. package/dist/index.es333.js +11 -0
  2008. package/dist/index.es333.js.map +1 -0
  2009. package/dist/index.es334.js +6 -0
  2010. package/dist/index.es334.js.map +1 -0
  2011. package/dist/index.es335.js +8 -0
  2012. package/dist/index.es335.js.map +1 -0
  2013. package/dist/index.es336.js +25 -0
  2014. package/dist/index.es336.js.map +1 -0
  2015. package/dist/index.es337.js +7 -0
  2016. package/dist/index.es337.js.map +1 -0
  2017. package/dist/index.es338.js +14 -0
  2018. package/dist/index.es338.js.map +1 -0
  2019. package/dist/index.es339.js +13 -0
  2020. package/dist/index.es339.js.map +1 -0
  2021. package/dist/index.es34.js +7 -0
  2022. package/dist/index.es34.js.map +1 -0
  2023. package/dist/index.es340.js +12 -0
  2024. package/dist/index.es340.js.map +1 -0
  2025. package/dist/index.es341.js +7 -0
  2026. package/dist/index.es341.js.map +1 -0
  2027. package/dist/index.es342.js +22 -0
  2028. package/dist/index.es342.js.map +1 -0
  2029. package/dist/index.es343.js +12 -0
  2030. package/dist/index.es343.js.map +1 -0
  2031. package/dist/index.es344.js +26 -0
  2032. package/dist/index.es344.js.map +1 -0
  2033. package/dist/index.es345.js +10 -0
  2034. package/dist/index.es345.js.map +1 -0
  2035. package/dist/index.es346.js +15 -0
  2036. package/dist/index.es346.js.map +1 -0
  2037. package/dist/index.es347.js +12 -0
  2038. package/dist/index.es347.js.map +1 -0
  2039. package/dist/index.es348.js +9 -0
  2040. package/dist/index.es348.js.map +1 -0
  2041. package/dist/index.es349.js +25 -0
  2042. package/dist/index.es349.js.map +1 -0
  2043. package/dist/index.es35.js +10 -0
  2044. package/dist/index.es35.js.map +1 -0
  2045. package/dist/index.es350.js +15 -0
  2046. package/dist/index.es350.js.map +1 -0
  2047. package/dist/index.es351.js +7 -0
  2048. package/dist/index.es351.js.map +1 -0
  2049. package/dist/index.es352.js +9 -0
  2050. package/dist/index.es352.js.map +1 -0
  2051. package/dist/index.es353.js +10 -0
  2052. package/dist/index.es353.js.map +1 -0
  2053. package/dist/index.es354.js +16 -0
  2054. package/dist/index.es354.js.map +1 -0
  2055. package/dist/index.es355.js +12 -0
  2056. package/dist/index.es355.js.map +1 -0
  2057. package/dist/index.es356.js +12 -0
  2058. package/dist/index.es356.js.map +1 -0
  2059. package/dist/index.es357.js +20 -0
  2060. package/dist/index.es357.js.map +1 -0
  2061. package/dist/index.es358.js +8 -0
  2062. package/dist/index.es358.js.map +1 -0
  2063. package/dist/index.es359.js +151 -0
  2064. package/dist/index.es359.js.map +1 -0
  2065. package/dist/index.es36.js +18 -0
  2066. package/dist/index.es36.js.map +1 -0
  2067. package/dist/index.es360.js +87 -0
  2068. package/dist/index.es360.js.map +1 -0
  2069. package/dist/index.es361.js +11 -0
  2070. package/dist/index.es361.js.map +1 -0
  2071. package/dist/index.es362.js +31 -0
  2072. package/dist/index.es362.js.map +1 -0
  2073. package/dist/index.es363.js +32 -0
  2074. package/dist/index.es363.js.map +1 -0
  2075. package/dist/index.es364.js +8 -0
  2076. package/dist/index.es364.js.map +1 -0
  2077. package/dist/index.es365.js +9 -0
  2078. package/dist/index.es365.js.map +1 -0
  2079. package/dist/index.es366.js +5 -0
  2080. package/dist/index.es366.js.map +1 -0
  2081. package/dist/index.es367.js +5 -0
  2082. package/dist/index.es367.js.map +1 -0
  2083. package/dist/index.es368.js +43 -0
  2084. package/dist/index.es368.js.map +1 -0
  2085. package/dist/index.es369.js +21 -0
  2086. package/dist/index.es369.js.map +1 -0
  2087. package/dist/index.es37.js +15 -0
  2088. package/dist/index.es37.js.map +1 -0
  2089. package/dist/index.es370.js +11 -0
  2090. package/dist/index.es370.js.map +1 -0
  2091. package/dist/index.es371.js +8 -0
  2092. package/dist/index.es371.js.map +1 -0
  2093. package/dist/index.es372.js +7 -0
  2094. package/dist/index.es372.js.map +1 -0
  2095. package/dist/index.es373.js +6 -0
  2096. package/dist/index.es373.js.map +1 -0
  2097. package/dist/index.es374.js +6 -0
  2098. package/dist/index.es374.js.map +1 -0
  2099. package/dist/index.es375.js +12 -0
  2100. package/dist/index.es375.js.map +1 -0
  2101. package/dist/index.es376.js +25 -0
  2102. package/dist/index.es376.js.map +1 -0
  2103. package/dist/index.es377.js +25 -0
  2104. package/dist/index.es377.js.map +1 -0
  2105. package/dist/index.es378.js +17 -0
  2106. package/dist/index.es378.js.map +1 -0
  2107. package/dist/index.es379.js +20 -0
  2108. package/dist/index.es379.js.map +1 -0
  2109. package/dist/index.es38.js +18 -0
  2110. package/dist/index.es38.js.map +1 -0
  2111. package/dist/index.es380.js +9 -0
  2112. package/dist/index.es380.js.map +1 -0
  2113. package/dist/index.es381.js +12 -0
  2114. package/dist/index.es381.js.map +1 -0
  2115. package/dist/index.es382.js +10 -0
  2116. package/dist/index.es382.js.map +1 -0
  2117. package/dist/index.es383.js +25 -0
  2118. package/dist/index.es383.js.map +1 -0
  2119. package/dist/index.es384.js +13 -0
  2120. package/dist/index.es384.js.map +1 -0
  2121. package/dist/index.es385.js +12 -0
  2122. package/dist/index.es385.js.map +1 -0
  2123. package/dist/index.es386.js +7 -0
  2124. package/dist/index.es386.js.map +1 -0
  2125. package/dist/index.es387.js +14 -0
  2126. package/dist/index.es387.js.map +1 -0
  2127. package/dist/index.es388.js +12 -0
  2128. package/dist/index.es388.js.map +1 -0
  2129. package/dist/index.es389.js +26 -0
  2130. package/dist/index.es389.js.map +1 -0
  2131. package/dist/index.es39.js +10 -0
  2132. package/dist/index.es39.js.map +1 -0
  2133. package/dist/index.es390.js +15 -0
  2134. package/dist/index.es390.js.map +1 -0
  2135. package/dist/index.es391.js +22 -0
  2136. package/dist/index.es391.js.map +1 -0
  2137. package/dist/index.es392.js +7 -0
  2138. package/dist/index.es392.js.map +1 -0
  2139. package/dist/index.es393.js +21 -0
  2140. package/dist/index.es393.js.map +1 -0
  2141. package/dist/index.es394.js +15 -0
  2142. package/dist/index.es394.js.map +1 -0
  2143. package/dist/index.es395.js +7 -0
  2144. package/dist/index.es395.js.map +1 -0
  2145. package/dist/index.es396.js +8 -0
  2146. package/dist/index.es396.js.map +1 -0
  2147. package/dist/index.es397.js +7 -0
  2148. package/dist/index.es397.js.map +1 -0
  2149. package/dist/index.es398.js +11 -0
  2150. package/dist/index.es398.js.map +1 -0
  2151. package/dist/index.es399.js +10 -0
  2152. package/dist/index.es399.js.map +1 -0
  2153. package/dist/index.es4.js +81 -0
  2154. package/dist/index.es4.js.map +1 -0
  2155. package/dist/index.es40.js +8 -0
  2156. package/dist/index.es40.js.map +1 -0
  2157. package/dist/index.es400.js +264 -0
  2158. package/dist/index.es400.js.map +1 -0
  2159. package/dist/index.es401.js +86 -0
  2160. package/dist/index.es401.js.map +1 -0
  2161. package/dist/index.es402.js +340 -0
  2162. package/dist/index.es402.js.map +1 -0
  2163. package/dist/index.es403.js +13 -0
  2164. package/dist/index.es403.js.map +1 -0
  2165. package/dist/index.es404.js +48 -0
  2166. package/dist/index.es404.js.map +1 -0
  2167. package/dist/index.es405.js +5 -0
  2168. package/dist/index.es405.js.map +1 -0
  2169. package/dist/index.es406.js +5 -0
  2170. package/dist/index.es406.js.map +1 -0
  2171. package/dist/index.es407.js +5 -0
  2172. package/dist/index.es407.js.map +1 -0
  2173. package/dist/index.es408.js +5 -0
  2174. package/dist/index.es408.js.map +1 -0
  2175. package/dist/index.es409.js +5 -0
  2176. package/dist/index.es409.js.map +1 -0
  2177. package/dist/index.es41.js +7 -0
  2178. package/dist/index.es41.js.map +1 -0
  2179. package/dist/index.es410.js +5 -0
  2180. package/dist/index.es410.js.map +1 -0
  2181. package/dist/index.es411.js +46 -0
  2182. package/dist/index.es411.js.map +1 -0
  2183. package/dist/index.es412.js +16 -0
  2184. package/dist/index.es412.js.map +1 -0
  2185. package/dist/index.es413.js +352 -0
  2186. package/dist/index.es413.js.map +1 -0
  2187. package/dist/index.es414.js +227 -0
  2188. package/dist/index.es414.js.map +1 -0
  2189. package/dist/index.es415.js +42 -0
  2190. package/dist/index.es415.js.map +1 -0
  2191. package/dist/index.es416.js +11 -0
  2192. package/dist/index.es416.js.map +1 -0
  2193. package/dist/index.es417.js +44 -0
  2194. package/dist/index.es417.js.map +1 -0
  2195. package/dist/index.es418.js +22 -0
  2196. package/dist/index.es418.js.map +1 -0
  2197. package/dist/index.es419.js +23 -0
  2198. package/dist/index.es419.js.map +1 -0
  2199. package/dist/index.es42.js +21 -0
  2200. package/dist/index.es42.js.map +1 -0
  2201. package/dist/index.es420.js +13 -0
  2202. package/dist/index.es420.js.map +1 -0
  2203. package/dist/index.es421.js +20 -0
  2204. package/dist/index.es421.js.map +1 -0
  2205. package/dist/index.es422.js +27 -0
  2206. package/dist/index.es422.js.map +1 -0
  2207. package/dist/index.es423.js +136 -0
  2208. package/dist/index.es423.js.map +1 -0
  2209. package/dist/index.es424.js +23 -0
  2210. package/dist/index.es424.js.map +1 -0
  2211. package/dist/index.es425.js +22 -0
  2212. package/dist/index.es425.js.map +1 -0
  2213. package/dist/index.es426.js +22 -0
  2214. package/dist/index.es426.js.map +1 -0
  2215. package/dist/index.es427.js +38 -0
  2216. package/dist/index.es427.js.map +1 -0
  2217. package/dist/index.es428.js +221 -0
  2218. package/dist/index.es428.js.map +1 -0
  2219. package/dist/index.es429.js +48 -0
  2220. package/dist/index.es429.js.map +1 -0
  2221. package/dist/index.es43.js +21 -0
  2222. package/dist/index.es43.js.map +1 -0
  2223. package/dist/index.es430.js +16 -0
  2224. package/dist/index.es430.js.map +1 -0
  2225. package/dist/index.es431.js +10 -0
  2226. package/dist/index.es431.js.map +1 -0
  2227. package/dist/index.es432.js +21 -0
  2228. package/dist/index.es432.js.map +1 -0
  2229. package/dist/index.es433.js +13 -0
  2230. package/dist/index.es433.js.map +1 -0
  2231. package/dist/index.es434.js +8 -0
  2232. package/dist/index.es434.js.map +1 -0
  2233. package/dist/index.es435.js +7 -0
  2234. package/dist/index.es435.js.map +1 -0
  2235. package/dist/index.es436.js +7 -0
  2236. package/dist/index.es436.js.map +1 -0
  2237. package/dist/index.es437.js +8 -0
  2238. package/dist/index.es437.js.map +1 -0
  2239. package/dist/index.es438.js +7 -0
  2240. package/dist/index.es438.js.map +1 -0
  2241. package/dist/index.es439.js +6 -0
  2242. package/dist/index.es439.js.map +1 -0
  2243. package/dist/index.es44.js +17 -0
  2244. package/dist/index.es44.js.map +1 -0
  2245. package/dist/index.es440.js +6 -0
  2246. package/dist/index.es440.js.map +1 -0
  2247. package/dist/index.es441.js +6 -0
  2248. package/dist/index.es441.js.map +1 -0
  2249. package/dist/index.es442.js +6 -0
  2250. package/dist/index.es442.js.map +1 -0
  2251. package/dist/index.es443.js +6 -0
  2252. package/dist/index.es443.js.map +1 -0
  2253. package/dist/index.es444.js +6 -0
  2254. package/dist/index.es444.js.map +1 -0
  2255. package/dist/index.es445.js +6 -0
  2256. package/dist/index.es445.js.map +1 -0
  2257. package/dist/index.es446.js +13 -0
  2258. package/dist/index.es446.js.map +1 -0
  2259. package/dist/index.es447.js +9 -0
  2260. package/dist/index.es447.js.map +1 -0
  2261. package/dist/index.es448.js +9 -0
  2262. package/dist/index.es448.js.map +1 -0
  2263. package/dist/index.es449.js +13 -0
  2264. package/dist/index.es449.js.map +1 -0
  2265. package/dist/index.es45.js +9 -0
  2266. package/dist/index.es45.js.map +1 -0
  2267. package/dist/index.es450.js +15 -0
  2268. package/dist/index.es450.js.map +1 -0
  2269. package/dist/index.es451.js +16 -0
  2270. package/dist/index.es451.js.map +1 -0
  2271. package/dist/index.es452.js +89 -0
  2272. package/dist/index.es452.js.map +1 -0
  2273. package/dist/index.es453.js +6 -0
  2274. package/dist/index.es453.js.map +1 -0
  2275. package/dist/index.es454.js +18 -0
  2276. package/dist/index.es454.js.map +1 -0
  2277. package/dist/index.es455.js +10 -0
  2278. package/dist/index.es455.js.map +1 -0
  2279. package/dist/index.es456.js +10 -0
  2280. package/dist/index.es456.js.map +1 -0
  2281. package/dist/index.es457.js +10 -0
  2282. package/dist/index.es457.js.map +1 -0
  2283. package/dist/index.es458.js +11 -0
  2284. package/dist/index.es458.js.map +1 -0
  2285. package/dist/index.es459.js +7 -0
  2286. package/dist/index.es459.js.map +1 -0
  2287. package/dist/index.es46.js +10 -0
  2288. package/dist/index.es46.js.map +1 -0
  2289. package/dist/index.es460.js +7 -0
  2290. package/dist/index.es460.js.map +1 -0
  2291. package/dist/index.es461.js +7 -0
  2292. package/dist/index.es461.js.map +1 -0
  2293. package/dist/index.es462.js +10 -0
  2294. package/dist/index.es462.js.map +1 -0
  2295. package/dist/index.es463.js +10 -0
  2296. package/dist/index.es463.js.map +1 -0
  2297. package/dist/index.es464.js +7 -0
  2298. package/dist/index.es464.js.map +1 -0
  2299. package/dist/index.es465.js +11 -0
  2300. package/dist/index.es465.js.map +1 -0
  2301. package/dist/index.es466.js +16 -0
  2302. package/dist/index.es466.js.map +1 -0
  2303. package/dist/index.es467.js +14 -0
  2304. package/dist/index.es467.js.map +1 -0
  2305. package/dist/index.es468.js +7 -0
  2306. package/dist/index.es468.js.map +1 -0
  2307. package/dist/index.es469.js +9 -0
  2308. package/dist/index.es469.js.map +1 -0
  2309. package/dist/index.es47.js +13 -0
  2310. package/dist/index.es47.js.map +1 -0
  2311. package/dist/index.es470.js +6 -0
  2312. package/dist/index.es470.js.map +1 -0
  2313. package/dist/index.es471.js +11 -0
  2314. package/dist/index.es471.js.map +1 -0
  2315. package/dist/index.es472.js +11 -0
  2316. package/dist/index.es472.js.map +1 -0
  2317. package/dist/index.es473.js +11 -0
  2318. package/dist/index.es473.js.map +1 -0
  2319. package/dist/index.es474.js +12 -0
  2320. package/dist/index.es474.js.map +1 -0
  2321. package/dist/index.es475.js +7 -0
  2322. package/dist/index.es475.js.map +1 -0
  2323. package/dist/index.es476.js +7 -0
  2324. package/dist/index.es476.js.map +1 -0
  2325. package/dist/index.es477.js +61 -0
  2326. package/dist/index.es477.js.map +1 -0
  2327. package/dist/index.es478.js +17 -0
  2328. package/dist/index.es478.js.map +1 -0
  2329. package/dist/index.es479.js +9 -0
  2330. package/dist/index.es479.js.map +1 -0
  2331. package/dist/index.es48.js +7 -0
  2332. package/dist/index.es48.js.map +1 -0
  2333. package/dist/index.es480.js +9 -0
  2334. package/dist/index.es480.js.map +1 -0
  2335. package/dist/index.es481.js +12 -0
  2336. package/dist/index.es481.js.map +1 -0
  2337. package/dist/index.es482.js +20 -0
  2338. package/dist/index.es482.js.map +1 -0
  2339. package/dist/index.es483.js +17 -0
  2340. package/dist/index.es483.js.map +1 -0
  2341. package/dist/index.es484.js +8 -0
  2342. package/dist/index.es484.js.map +1 -0
  2343. package/dist/index.es485.js +12 -0
  2344. package/dist/index.es485.js.map +1 -0
  2345. package/dist/index.es486.js +10 -0
  2346. package/dist/index.es486.js.map +1 -0
  2347. package/dist/index.es487.js +12 -0
  2348. package/dist/index.es487.js.map +1 -0
  2349. package/dist/index.es488.js +6 -0
  2350. package/dist/index.es488.js.map +1 -0
  2351. package/dist/index.es489.js +6 -0
  2352. package/dist/index.es489.js.map +1 -0
  2353. package/dist/index.es49.js +22 -0
  2354. package/dist/index.es49.js.map +1 -0
  2355. package/dist/index.es490.js +14 -0
  2356. package/dist/index.es490.js.map +1 -0
  2357. package/dist/index.es491.js +8 -0
  2358. package/dist/index.es491.js.map +1 -0
  2359. package/dist/index.es492.js +7 -0
  2360. package/dist/index.es492.js.map +1 -0
  2361. package/dist/index.es493.js +12 -0
  2362. package/dist/index.es493.js.map +1 -0
  2363. package/dist/index.es494.js +9 -0
  2364. package/dist/index.es494.js.map +1 -0
  2365. package/dist/index.es495.js +6 -0
  2366. package/dist/index.es495.js.map +1 -0
  2367. package/dist/index.es496.js +6 -0
  2368. package/dist/index.es496.js.map +1 -0
  2369. package/dist/index.es497.js +10 -0
  2370. package/dist/index.es497.js.map +1 -0
  2371. package/dist/index.es498.js +16 -0
  2372. package/dist/index.es498.js.map +1 -0
  2373. package/dist/index.es499.js +16 -0
  2374. package/dist/index.es499.js.map +1 -0
  2375. package/dist/index.es5.js +154 -0
  2376. package/dist/index.es5.js.map +1 -0
  2377. package/dist/index.es50.js +20 -0
  2378. package/dist/index.es50.js.map +1 -0
  2379. package/dist/index.es500.js +9 -0
  2380. package/dist/index.es500.js.map +1 -0
  2381. package/dist/index.es501.js +9 -0
  2382. package/dist/index.es501.js.map +1 -0
  2383. package/dist/index.es502.js +20 -0
  2384. package/dist/index.es502.js.map +1 -0
  2385. package/dist/index.es503.js +20 -0
  2386. package/dist/index.es503.js.map +1 -0
  2387. package/dist/index.es504.js +8 -0
  2388. package/dist/index.es504.js.map +1 -0
  2389. package/dist/index.es505.js +20 -0
  2390. package/dist/index.es505.js.map +1 -0
  2391. package/dist/index.es506.js +26 -0
  2392. package/dist/index.es506.js.map +1 -0
  2393. package/dist/index.es507.js +9 -0
  2394. package/dist/index.es507.js.map +1 -0
  2395. package/dist/index.es508.js +8 -0
  2396. package/dist/index.es508.js.map +1 -0
  2397. package/dist/index.es509.js +9 -0
  2398. package/dist/index.es509.js.map +1 -0
  2399. package/dist/index.es51.js +9 -0
  2400. package/dist/index.es51.js.map +1 -0
  2401. package/dist/index.es510.js +8 -0
  2402. package/dist/index.es510.js.map +1 -0
  2403. package/dist/index.es511.js +15 -0
  2404. package/dist/index.es511.js.map +1 -0
  2405. package/dist/index.es512.js +9 -0
  2406. package/dist/index.es512.js.map +1 -0
  2407. package/dist/index.es513.js +8 -0
  2408. package/dist/index.es513.js.map +1 -0
  2409. package/dist/index.es514.js +8 -0
  2410. package/dist/index.es514.js.map +1 -0
  2411. package/dist/index.es515.js +8 -0
  2412. package/dist/index.es515.js.map +1 -0
  2413. package/dist/index.es516.js +8 -0
  2414. package/dist/index.es516.js.map +1 -0
  2415. package/dist/index.es517.js +8 -0
  2416. package/dist/index.es517.js.map +1 -0
  2417. package/dist/index.es518.js +8 -0
  2418. package/dist/index.es518.js.map +1 -0
  2419. package/dist/index.es519.js +18 -0
  2420. package/dist/index.es519.js.map +1 -0
  2421. package/dist/index.es52.js +15 -0
  2422. package/dist/index.es52.js.map +1 -0
  2423. package/dist/index.es520.js +10 -0
  2424. package/dist/index.es520.js.map +1 -0
  2425. package/dist/index.es521.js +10 -0
  2426. package/dist/index.es521.js.map +1 -0
  2427. package/dist/index.es522.js +12 -0
  2428. package/dist/index.es522.js.map +1 -0
  2429. package/dist/index.es523.js +5 -0
  2430. package/dist/index.es523.js.map +1 -0
  2431. package/dist/index.es524.js +5 -0
  2432. package/dist/index.es524.js.map +1 -0
  2433. package/dist/index.es525.js +324 -0
  2434. package/dist/index.es525.js.map +1 -0
  2435. package/dist/index.es526.js +78 -0
  2436. package/dist/index.es526.js.map +1 -0
  2437. package/dist/index.es527.js +6 -0
  2438. package/dist/index.es527.js.map +1 -0
  2439. package/dist/index.es528.js +19 -0
  2440. package/dist/index.es528.js.map +1 -0
  2441. package/dist/index.es529.js +14 -0
  2442. package/dist/index.es529.js.map +1 -0
  2443. package/dist/index.es53.js +8 -0
  2444. package/dist/index.es53.js.map +1 -0
  2445. package/dist/index.es530.js +34 -0
  2446. package/dist/index.es530.js.map +1 -0
  2447. package/dist/index.es531.js +5 -0
  2448. package/dist/index.es531.js.map +1 -0
  2449. package/dist/index.es532.js +6 -0
  2450. package/dist/index.es532.js.map +1 -0
  2451. package/dist/index.es533.js +10 -0
  2452. package/dist/index.es533.js.map +1 -0
  2453. package/dist/index.es534.js +7 -0
  2454. package/dist/index.es534.js.map +1 -0
  2455. package/dist/index.es535.js +20 -0
  2456. package/dist/index.es535.js.map +1 -0
  2457. package/dist/index.es536.js +8 -0
  2458. package/dist/index.es536.js.map +1 -0
  2459. package/dist/index.es537.js +6 -0
  2460. package/dist/index.es537.js.map +1 -0
  2461. package/dist/index.es538.js +27 -0
  2462. package/dist/index.es538.js.map +1 -0
  2463. package/dist/index.es539.js +110 -0
  2464. package/dist/index.es539.js.map +1 -0
  2465. package/dist/index.es54.js +31 -0
  2466. package/dist/index.es54.js.map +1 -0
  2467. package/dist/index.es540.js +19 -0
  2468. package/dist/index.es540.js.map +1 -0
  2469. package/dist/index.es541.js +25 -0
  2470. package/dist/index.es541.js.map +1 -0
  2471. package/dist/index.es542.js +28 -0
  2472. package/dist/index.es542.js.map +1 -0
  2473. package/dist/index.es543.js +12 -0
  2474. package/dist/index.es543.js.map +1 -0
  2475. package/dist/index.es544.js +25 -0
  2476. package/dist/index.es544.js.map +1 -0
  2477. package/dist/index.es545.js +7 -0
  2478. package/dist/index.es545.js.map +1 -0
  2479. package/dist/index.es546.js +28 -0
  2480. package/dist/index.es546.js.map +1 -0
  2481. package/dist/index.es547.js +34 -0
  2482. package/dist/index.es547.js.map +1 -0
  2483. package/dist/index.es548.js +24 -0
  2484. package/dist/index.es548.js.map +1 -0
  2485. package/dist/index.es549.js +69 -0
  2486. package/dist/index.es549.js.map +1 -0
  2487. package/dist/index.es55.js +11 -0
  2488. package/dist/index.es55.js.map +1 -0
  2489. package/dist/index.es550.js +63 -0
  2490. package/dist/index.es550.js.map +1 -0
  2491. package/dist/index.es551.js +30 -0
  2492. package/dist/index.es551.js.map +1 -0
  2493. package/dist/index.es552.js +36 -0
  2494. package/dist/index.es552.js.map +1 -0
  2495. package/dist/index.es553.js +5 -0
  2496. package/dist/index.es553.js.map +1 -0
  2497. package/dist/index.es554.js +6 -0
  2498. package/dist/index.es554.js.map +1 -0
  2499. package/dist/index.es555.js +11 -0
  2500. package/dist/index.es555.js.map +1 -0
  2501. package/dist/index.es556.js +9 -0
  2502. package/dist/index.es556.js.map +1 -0
  2503. package/dist/index.es557.js +63 -0
  2504. package/dist/index.es557.js.map +1 -0
  2505. package/dist/index.es558.js +9 -0
  2506. package/dist/index.es558.js.map +1 -0
  2507. package/dist/index.es559.js +11 -0
  2508. package/dist/index.es559.js.map +1 -0
  2509. package/dist/index.es56.js +8 -0
  2510. package/dist/index.es56.js.map +1 -0
  2511. package/dist/index.es560.js +7 -0
  2512. package/dist/index.es560.js.map +1 -0
  2513. package/dist/index.es561.js +7 -0
  2514. package/dist/index.es561.js.map +1 -0
  2515. package/dist/index.es562.js +164 -0
  2516. package/dist/index.es562.js.map +1 -0
  2517. package/dist/index.es563.js +8 -0
  2518. package/dist/index.es563.js.map +1 -0
  2519. package/dist/index.es564.js +5 -0
  2520. package/dist/index.es564.js.map +1 -0
  2521. package/dist/index.es565.js +91 -0
  2522. package/dist/index.es565.js.map +1 -0
  2523. package/dist/index.es566.js +197 -0
  2524. package/dist/index.es566.js.map +1 -0
  2525. package/dist/index.es567.js +91 -0
  2526. package/dist/index.es567.js.map +1 -0
  2527. package/dist/index.es568.js +16 -0
  2528. package/dist/index.es568.js.map +1 -0
  2529. package/dist/index.es569.js +322 -0
  2530. package/dist/index.es569.js.map +1 -0
  2531. package/dist/index.es57.js +13 -0
  2532. package/dist/index.es57.js.map +1 -0
  2533. package/dist/index.es570.js +228 -0
  2534. package/dist/index.es570.js.map +1 -0
  2535. package/dist/index.es571.js +5 -0
  2536. package/dist/index.es571.js.map +1 -0
  2537. package/dist/index.es572.js +359 -0
  2538. package/dist/index.es572.js.map +1 -0
  2539. package/dist/index.es573.js +5 -0
  2540. package/dist/index.es573.js.map +1 -0
  2541. package/dist/index.es574.js +41 -0
  2542. package/dist/index.es574.js.map +1 -0
  2543. package/dist/index.es575.js +54 -0
  2544. package/dist/index.es575.js.map +1 -0
  2545. package/dist/index.es576.js +65 -0
  2546. package/dist/index.es576.js.map +1 -0
  2547. package/dist/index.es577.js +64 -0
  2548. package/dist/index.es577.js.map +1 -0
  2549. package/dist/index.es578.js +76 -0
  2550. package/dist/index.es578.js.map +1 -0
  2551. package/dist/index.es579.js +53 -0
  2552. package/dist/index.es579.js.map +1 -0
  2553. package/dist/index.es58.js +20 -0
  2554. package/dist/index.es58.js.map +1 -0
  2555. package/dist/index.es580.js +92 -0
  2556. package/dist/index.es580.js.map +1 -0
  2557. package/dist/index.es581.js +5 -0
  2558. package/dist/index.es581.js.map +1 -0
  2559. package/dist/index.es582.js +5 -0
  2560. package/dist/index.es582.js.map +1 -0
  2561. package/dist/index.es583.js +5 -0
  2562. package/dist/index.es583.js.map +1 -0
  2563. package/dist/index.es584.js +5 -0
  2564. package/dist/index.es584.js.map +1 -0
  2565. package/dist/index.es585.js +5 -0
  2566. package/dist/index.es585.js.map +1 -0
  2567. package/dist/index.es586.js +5 -0
  2568. package/dist/index.es586.js.map +1 -0
  2569. package/dist/index.es587.js +5 -0
  2570. package/dist/index.es587.js.map +1 -0
  2571. package/dist/index.es588.js +10 -0
  2572. package/dist/index.es588.js.map +1 -0
  2573. package/dist/index.es589.js +7 -0
  2574. package/dist/index.es589.js.map +1 -0
  2575. package/dist/index.es59.js +8 -0
  2576. package/dist/index.es59.js.map +1 -0
  2577. package/dist/index.es590.js +6 -0
  2578. package/dist/index.es590.js.map +1 -0
  2579. package/dist/index.es591.js +12 -0
  2580. package/dist/index.es591.js.map +1 -0
  2581. package/dist/index.es592.js +17 -0
  2582. package/dist/index.es592.js.map +1 -0
  2583. package/dist/index.es593.js +15 -0
  2584. package/dist/index.es593.js.map +1 -0
  2585. package/dist/index.es594.js +22 -0
  2586. package/dist/index.es594.js.map +1 -0
  2587. package/dist/index.es595.js +21 -0
  2588. package/dist/index.es595.js.map +1 -0
  2589. package/dist/index.es596.js +15 -0
  2590. package/dist/index.es596.js.map +1 -0
  2591. package/dist/index.es597.js +49 -0
  2592. package/dist/index.es597.js.map +1 -0
  2593. package/dist/index.es598.js +26 -0
  2594. package/dist/index.es598.js.map +1 -0
  2595. package/dist/index.es599.js +11 -0
  2596. package/dist/index.es599.js.map +1 -0
  2597. package/dist/index.es6.js +80 -0
  2598. package/dist/index.es6.js.map +1 -0
  2599. package/dist/index.es60.js +8 -0
  2600. package/dist/index.es60.js.map +1 -0
  2601. package/dist/index.es600.js +9 -0
  2602. package/dist/index.es600.js.map +1 -0
  2603. package/dist/index.es601.js +58 -0
  2604. package/dist/index.es601.js.map +1 -0
  2605. package/dist/index.es602.js +12 -0
  2606. package/dist/index.es602.js.map +1 -0
  2607. package/dist/index.es603.js +17 -0
  2608. package/dist/index.es603.js.map +1 -0
  2609. package/dist/index.es604.js +63 -0
  2610. package/dist/index.es604.js.map +1 -0
  2611. package/dist/index.es605.js +68 -0
  2612. package/dist/index.es605.js.map +1 -0
  2613. package/dist/index.es606.js +46 -0
  2614. package/dist/index.es606.js.map +1 -0
  2615. package/dist/index.es607.js +69 -0
  2616. package/dist/index.es607.js.map +1 -0
  2617. package/dist/index.es608.js +79 -0
  2618. package/dist/index.es608.js.map +1 -0
  2619. package/dist/index.es609.js +7 -0
  2620. package/dist/index.es609.js.map +1 -0
  2621. package/dist/index.es61.js +8 -0
  2622. package/dist/index.es61.js.map +1 -0
  2623. package/dist/index.es610.js +16 -0
  2624. package/dist/index.es610.js.map +1 -0
  2625. package/dist/index.es611.js +63 -0
  2626. package/dist/index.es611.js.map +1 -0
  2627. package/dist/index.es612.js +5 -0
  2628. package/dist/index.es612.js.map +1 -0
  2629. package/dist/index.es613.js +33 -0
  2630. package/dist/index.es613.js.map +1 -0
  2631. package/dist/index.es614.js +602 -0
  2632. package/dist/index.es614.js.map +1 -0
  2633. package/dist/index.es615.js +5 -0
  2634. package/dist/index.es615.js.map +1 -0
  2635. package/dist/index.es616.js +5 -0
  2636. package/dist/index.es616.js.map +1 -0
  2637. package/dist/index.es617.js +89 -0
  2638. package/dist/index.es617.js.map +1 -0
  2639. package/dist/index.es618.js +37 -0
  2640. package/dist/index.es618.js.map +1 -0
  2641. package/dist/index.es619.js +40 -0
  2642. package/dist/index.es619.js.map +1 -0
  2643. package/dist/index.es62.js +10 -0
  2644. package/dist/index.es62.js.map +1 -0
  2645. package/dist/index.es620.js +67 -0
  2646. package/dist/index.es620.js.map +1 -0
  2647. package/dist/index.es621.js +31 -0
  2648. package/dist/index.es621.js.map +1 -0
  2649. package/dist/index.es622.js +31 -0
  2650. package/dist/index.es622.js.map +1 -0
  2651. package/dist/index.es623.js +31 -0
  2652. package/dist/index.es623.js.map +1 -0
  2653. package/dist/index.es624.js +5 -0
  2654. package/dist/index.es624.js.map +1 -0
  2655. package/dist/index.es625.js +5 -0
  2656. package/dist/index.es625.js.map +1 -0
  2657. package/dist/index.es626.js +12 -0
  2658. package/dist/index.es626.js.map +1 -0
  2659. package/dist/index.es627.js +37 -0
  2660. package/dist/index.es627.js.map +1 -0
  2661. package/dist/index.es628.js +37 -0
  2662. package/dist/index.es628.js.map +1 -0
  2663. package/dist/index.es629.js +8 -0
  2664. package/dist/index.es629.js.map +1 -0
  2665. package/dist/index.es63.js +10 -0
  2666. package/dist/index.es63.js.map +1 -0
  2667. package/dist/index.es630.js +5 -0
  2668. package/dist/index.es630.js.map +1 -0
  2669. package/dist/index.es631.js +5 -0
  2670. package/dist/index.es631.js.map +1 -0
  2671. package/dist/index.es632.js +112 -0
  2672. package/dist/index.es632.js.map +1 -0
  2673. package/dist/index.es633.js +148 -0
  2674. package/dist/index.es633.js.map +1 -0
  2675. package/dist/index.es634.js +5 -0
  2676. package/dist/index.es634.js.map +1 -0
  2677. package/dist/index.es635.js +9 -0
  2678. package/dist/index.es635.js.map +1 -0
  2679. package/dist/index.es636.js +9 -0
  2680. package/dist/index.es636.js.map +1 -0
  2681. package/dist/index.es637.js +51 -0
  2682. package/dist/index.es637.js.map +1 -0
  2683. package/dist/index.es638.js +5 -0
  2684. package/dist/index.es638.js.map +1 -0
  2685. package/dist/index.es639.js +5 -0
  2686. package/dist/index.es639.js.map +1 -0
  2687. package/dist/index.es64.js +7 -0
  2688. package/dist/index.es64.js.map +1 -0
  2689. package/dist/index.es640.js +5 -0
  2690. package/dist/index.es640.js.map +1 -0
  2691. package/dist/index.es641.js +12 -0
  2692. package/dist/index.es641.js.map +1 -0
  2693. package/dist/index.es642.js +17 -0
  2694. package/dist/index.es642.js.map +1 -0
  2695. package/dist/index.es643.js +7 -0
  2696. package/dist/index.es643.js.map +1 -0
  2697. package/dist/index.es644.js +26 -0
  2698. package/dist/index.es644.js.map +1 -0
  2699. package/dist/index.es645.js +5 -0
  2700. package/dist/index.es645.js.map +1 -0
  2701. package/dist/index.es646.js +5 -0
  2702. package/dist/index.es646.js.map +1 -0
  2703. package/dist/index.es647.js +11 -0
  2704. package/dist/index.es647.js.map +1 -0
  2705. package/dist/index.es648.js +74 -0
  2706. package/dist/index.es648.js.map +1 -0
  2707. package/dist/index.es649.js +20 -0
  2708. package/dist/index.es649.js.map +1 -0
  2709. package/dist/index.es65.js +7 -0
  2710. package/dist/index.es65.js.map +1 -0
  2711. package/dist/index.es650.js +8 -0
  2712. package/dist/index.es650.js.map +1 -0
  2713. package/dist/index.es651.js +24 -0
  2714. package/dist/index.es651.js.map +1 -0
  2715. package/dist/index.es652.js +52 -0
  2716. package/dist/index.es652.js.map +1 -0
  2717. package/dist/index.es653.js +58 -0
  2718. package/dist/index.es653.js.map +1 -0
  2719. package/dist/index.es654.js +12 -0
  2720. package/dist/index.es654.js.map +1 -0
  2721. package/dist/index.es655.js +60 -0
  2722. package/dist/index.es655.js.map +1 -0
  2723. package/dist/index.es656.js +19 -0
  2724. package/dist/index.es656.js.map +1 -0
  2725. package/dist/index.es657.js +14 -0
  2726. package/dist/index.es657.js.map +1 -0
  2727. package/dist/index.es658.js +17 -0
  2728. package/dist/index.es658.js.map +1 -0
  2729. package/dist/index.es659.js +54 -0
  2730. package/dist/index.es659.js.map +1 -0
  2731. package/dist/index.es66.js +10 -0
  2732. package/dist/index.es66.js.map +1 -0
  2733. package/dist/index.es660.js +61 -0
  2734. package/dist/index.es660.js.map +1 -0
  2735. package/dist/index.es661.js +12 -0
  2736. package/dist/index.es661.js.map +1 -0
  2737. package/dist/index.es662.js +12 -0
  2738. package/dist/index.es662.js.map +1 -0
  2739. package/dist/index.es663.js +9 -0
  2740. package/dist/index.es663.js.map +1 -0
  2741. package/dist/index.es664.js +33 -0
  2742. package/dist/index.es664.js.map +1 -0
  2743. package/dist/index.es665.js +602 -0
  2744. package/dist/index.es665.js.map +1 -0
  2745. package/dist/index.es666.js +5 -0
  2746. package/dist/index.es666.js.map +1 -0
  2747. package/dist/index.es667.js +344 -0
  2748. package/dist/index.es667.js.map +1 -0
  2749. package/dist/index.es668.js +5 -0
  2750. package/dist/index.es668.js.map +1 -0
  2751. package/dist/index.es669.js +5 -0
  2752. package/dist/index.es669.js.map +1 -0
  2753. package/dist/index.es67.js +18 -0
  2754. package/dist/index.es67.js.map +1 -0
  2755. package/dist/index.es670.js +202 -0
  2756. package/dist/index.es670.js.map +1 -0
  2757. package/dist/index.es671.js +163 -0
  2758. package/dist/index.es671.js.map +1 -0
  2759. package/dist/index.es672.js +5 -0
  2760. package/dist/index.es672.js.map +1 -0
  2761. package/dist/index.es673.js +5 -0
  2762. package/dist/index.es673.js.map +1 -0
  2763. package/dist/index.es674.js +88 -0
  2764. package/dist/index.es674.js.map +1 -0
  2765. package/dist/index.es675.js +111 -0
  2766. package/dist/index.es675.js.map +1 -0
  2767. package/dist/index.es676.js +5 -0
  2768. package/dist/index.es676.js.map +1 -0
  2769. package/dist/index.es677.js +5 -0
  2770. package/dist/index.es677.js.map +1 -0
  2771. package/dist/index.es678.js +16 -0
  2772. package/dist/index.es678.js.map +1 -0
  2773. package/dist/index.es679.js +31 -0
  2774. package/dist/index.es679.js.map +1 -0
  2775. package/dist/index.es68.js +15 -0
  2776. package/dist/index.es68.js.map +1 -0
  2777. package/dist/index.es680.js +8 -0
  2778. package/dist/index.es680.js.map +1 -0
  2779. package/dist/index.es681.js +26 -0
  2780. package/dist/index.es681.js.map +1 -0
  2781. package/dist/index.es682.js +6 -0
  2782. package/dist/index.es682.js.map +1 -0
  2783. package/dist/index.es683.js +25 -0
  2784. package/dist/index.es683.js.map +1 -0
  2785. package/dist/index.es684.js +14 -0
  2786. package/dist/index.es684.js.map +1 -0
  2787. package/dist/index.es685.js +7 -0
  2788. package/dist/index.es685.js.map +1 -0
  2789. package/dist/index.es686.js +175 -0
  2790. package/dist/index.es686.js.map +1 -0
  2791. package/dist/index.es687.js +108 -0
  2792. package/dist/index.es687.js.map +1 -0
  2793. package/dist/index.es688.js +31 -0
  2794. package/dist/index.es688.js.map +1 -0
  2795. package/dist/index.es689.js +325 -0
  2796. package/dist/index.es689.js.map +1 -0
  2797. package/dist/index.es69.js +18 -0
  2798. package/dist/index.es69.js.map +1 -0
  2799. package/dist/index.es690.js +8 -0
  2800. package/dist/index.es690.js.map +1 -0
  2801. package/dist/index.es691.js +5 -0
  2802. package/dist/index.es691.js.map +1 -0
  2803. package/dist/index.es692.js +5 -0
  2804. package/dist/index.es692.js.map +1 -0
  2805. package/dist/index.es693.js +5 -0
  2806. package/dist/index.es693.js.map +1 -0
  2807. package/dist/index.es694.js +5 -0
  2808. package/dist/index.es694.js.map +1 -0
  2809. package/dist/index.es695.js +5 -0
  2810. package/dist/index.es695.js.map +1 -0
  2811. package/dist/index.es696.js +55 -0
  2812. package/dist/index.es696.js.map +1 -0
  2813. package/dist/index.es697.js +119 -0
  2814. package/dist/index.es697.js.map +1 -0
  2815. package/dist/index.es698.js +5 -0
  2816. package/dist/index.es698.js.map +1 -0
  2817. package/dist/index.es699.js +5 -0
  2818. package/dist/index.es699.js.map +1 -0
  2819. package/dist/index.es7.js +139 -0
  2820. package/dist/index.es7.js.map +1 -0
  2821. package/dist/index.es70.js +10 -0
  2822. package/dist/index.es70.js.map +1 -0
  2823. package/dist/index.es700.js +5 -0
  2824. package/dist/index.es700.js.map +1 -0
  2825. package/dist/index.es701.js +5 -0
  2826. package/dist/index.es701.js.map +1 -0
  2827. package/dist/index.es702.js +31 -0
  2828. package/dist/index.es702.js.map +1 -0
  2829. package/dist/index.es703.js +32 -0
  2830. package/dist/index.es703.js.map +1 -0
  2831. package/dist/index.es704.js +8 -0
  2832. package/dist/index.es704.js.map +1 -0
  2833. package/dist/index.es705.js +91 -0
  2834. package/dist/index.es705.js.map +1 -0
  2835. package/dist/index.es706.js +48 -0
  2836. package/dist/index.es706.js.map +1 -0
  2837. package/dist/index.es707.js +46 -0
  2838. package/dist/index.es707.js.map +1 -0
  2839. package/dist/index.es708.js +5 -0
  2840. package/dist/index.es708.js.map +1 -0
  2841. package/dist/index.es709.js +5 -0
  2842. package/dist/index.es709.js.map +1 -0
  2843. package/dist/index.es71.js +8 -0
  2844. package/dist/index.es71.js.map +1 -0
  2845. package/dist/index.es710.js +5 -0
  2846. package/dist/index.es710.js.map +1 -0
  2847. package/dist/index.es711.js +11 -0
  2848. package/dist/index.es711.js.map +1 -0
  2849. package/dist/index.es712.js +331 -0
  2850. package/dist/index.es712.js.map +1 -0
  2851. package/dist/index.es713.js +54 -0
  2852. package/dist/index.es713.js.map +1 -0
  2853. package/dist/index.es714.js +23 -0
  2854. package/dist/index.es714.js.map +1 -0
  2855. package/dist/index.es715.js +36 -0
  2856. package/dist/index.es715.js.map +1 -0
  2857. package/dist/index.es716.js +5 -0
  2858. package/dist/index.es716.js.map +1 -0
  2859. package/dist/index.es717.js +8 -0
  2860. package/dist/index.es717.js.map +1 -0
  2861. package/dist/index.es718.js +6 -0
  2862. package/dist/index.es718.js.map +1 -0
  2863. package/dist/index.es719.js +27 -0
  2864. package/dist/index.es719.js.map +1 -0
  2865. package/dist/index.es72.js +7 -0
  2866. package/dist/index.es72.js.map +1 -0
  2867. package/dist/index.es720.js +110 -0
  2868. package/dist/index.es720.js.map +1 -0
  2869. package/dist/index.es721.js +19 -0
  2870. package/dist/index.es721.js.map +1 -0
  2871. package/dist/index.es722.js +9 -0
  2872. package/dist/index.es722.js.map +1 -0
  2873. package/dist/index.es723.js +5 -0
  2874. package/dist/index.es723.js.map +1 -0
  2875. package/dist/index.es724.js +5 -0
  2876. package/dist/index.es724.js.map +1 -0
  2877. package/dist/index.es725.js +80 -0
  2878. package/dist/index.es725.js.map +1 -0
  2879. package/dist/index.es726.js +96 -0
  2880. package/dist/index.es726.js.map +1 -0
  2881. package/dist/index.es727.js +56 -0
  2882. package/dist/index.es727.js.map +1 -0
  2883. package/dist/index.es728.js +12 -0
  2884. package/dist/index.es728.js.map +1 -0
  2885. package/dist/index.es729.js +8 -0
  2886. package/dist/index.es729.js.map +1 -0
  2887. package/dist/index.es73.js +21 -0
  2888. package/dist/index.es73.js.map +1 -0
  2889. package/dist/index.es730.js +56 -0
  2890. package/dist/index.es730.js.map +1 -0
  2891. package/dist/index.es731.js +58 -0
  2892. package/dist/index.es731.js.map +1 -0
  2893. package/dist/index.es732.js +12 -0
  2894. package/dist/index.es732.js.map +1 -0
  2895. package/dist/index.es733.js +17 -0
  2896. package/dist/index.es733.js.map +1 -0
  2897. package/dist/index.es734.js +63 -0
  2898. package/dist/index.es734.js.map +1 -0
  2899. package/dist/index.es735.js +68 -0
  2900. package/dist/index.es735.js.map +1 -0
  2901. package/dist/index.es736.js +7 -0
  2902. package/dist/index.es736.js.map +1 -0
  2903. package/dist/index.es737.js +26 -0
  2904. package/dist/index.es737.js.map +1 -0
  2905. package/dist/index.es738.js +5 -0
  2906. package/dist/index.es738.js.map +1 -0
  2907. package/dist/index.es739.js +5 -0
  2908. package/dist/index.es739.js.map +1 -0
  2909. package/dist/index.es74.js +21 -0
  2910. package/dist/index.es74.js.map +1 -0
  2911. package/dist/index.es740.js +26 -0
  2912. package/dist/index.es740.js.map +1 -0
  2913. package/dist/index.es741.js +16 -0
  2914. package/dist/index.es741.js.map +1 -0
  2915. package/dist/index.es742.js +31 -0
  2916. package/dist/index.es742.js.map +1 -0
  2917. package/dist/index.es743.js +8 -0
  2918. package/dist/index.es743.js.map +1 -0
  2919. package/dist/index.es75.js +17 -0
  2920. package/dist/index.es75.js.map +1 -0
  2921. package/dist/index.es76.js +9 -0
  2922. package/dist/index.es76.js.map +1 -0
  2923. package/dist/index.es77.js +10 -0
  2924. package/dist/index.es77.js.map +1 -0
  2925. package/dist/index.es78.js +13 -0
  2926. package/dist/index.es78.js.map +1 -0
  2927. package/dist/index.es79.js +7 -0
  2928. package/dist/index.es79.js.map +1 -0
  2929. package/dist/index.es8.js +133 -0
  2930. package/dist/index.es8.js.map +1 -0
  2931. package/dist/index.es80.js +22 -0
  2932. package/dist/index.es80.js.map +1 -0
  2933. package/dist/index.es81.js +13 -0
  2934. package/dist/index.es81.js.map +1 -0
  2935. package/dist/index.es82.js +18527 -0
  2936. package/dist/index.es82.js.map +1 -0
  2937. package/dist/index.es83.js +58 -0
  2938. package/dist/index.es83.js.map +1 -0
  2939. package/dist/index.es84.js +64 -0
  2940. package/dist/index.es84.js.map +1 -0
  2941. package/dist/index.es85.js +52 -0
  2942. package/dist/index.es85.js.map +1 -0
  2943. package/dist/index.es86.js +12 -0
  2944. package/dist/index.es86.js.map +1 -0
  2945. package/dist/index.es87.js +12186 -0
  2946. package/dist/index.es87.js.map +1 -0
  2947. package/dist/index.es88.js +4 -0
  2948. package/dist/index.es88.js.map +1 -0
  2949. package/dist/index.es89.js +4 -0
  2950. package/dist/index.es89.js.map +1 -0
  2951. package/dist/index.es9.js +57 -0
  2952. package/dist/index.es9.js.map +1 -0
  2953. package/dist/index.es90.js +39 -0
  2954. package/dist/index.es90.js.map +1 -0
  2955. package/dist/index.es91.js +4 -0
  2956. package/dist/index.es91.js.map +1 -0
  2957. package/dist/index.es92.js +26 -0
  2958. package/dist/index.es92.js.map +1 -0
  2959. package/dist/index.es93.js +3 -0
  2960. package/dist/index.es93.js.map +1 -0
  2961. package/dist/index.es94.js +4 -0
  2962. package/dist/index.es94.js.map +1 -0
  2963. package/dist/index.es95.js +3 -0
  2964. package/dist/index.es95.js.map +1 -0
  2965. package/dist/index.es96.js +35 -0
  2966. package/dist/index.es96.js.map +1 -0
  2967. package/dist/index.es97.js +16 -0
  2968. package/dist/index.es97.js.map +1 -0
  2969. package/dist/index.es98.js +17 -0
  2970. package/dist/index.es98.js.map +1 -0
  2971. package/dist/index.es99.js +12 -0
  2972. package/dist/index.es99.js.map +1 -0
  2973. package/dist/style.css +1 -0
  2974. package/package.json +14 -14
  2975. package/postcss.config.js +3 -1
  2976. package/src/components/PlaceMarker.js +0 -6
  2977. package/types/components/PlaceMarker.js.flow +0 -6
  2978. package/vite.config.js +39 -0
  2979. package/webpack.config.js +0 -57
@@ -0,0 +1,581 @@
1
+ "use strict";const rd=require("./index.cjs365.js"),sd=require("./index.cjs367.js");(function(nc,ad){(function(Qa,tn){nc.exports=tn()})(rd.commonjsGlobal,function(){var Qa,tn,gl;function _l(u,Hi){if(!Qa)Qa=Hi;else if(!tn)tn=Hi;else{var it="var sharedChunk = {}; ("+Qa+")(sharedChunk); ("+tn+")(sharedChunk);",Ji={};Qa(Ji),gl=Hi(Ji),typeof window<"u"&&(gl.workerUrl=window.URL.createObjectURL(new Blob([it],{type:"text/javascript"})))}}_l(["exports"],function(u){function Hi(i,t,r,a){return new(r||(r=Promise))(function(o,p){function d(x){try{_(a.next(x))}catch(b){p(b)}}function f(x){try{_(a.throw(x))}catch(b){p(b)}}function _(x){var b;x.done?o(x.value):(b=x.value,b instanceof r?b:new r(function(T){T(b)})).then(d,f)}_((a=a.apply(i,t||[])).next())})}function it(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Ji=ui;function ui(i,t){this.x=i,this.y=t}ui.prototype={clone:function(){return new ui(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,t){return this.clone()._rotateAround(i,t)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var t=i.x-this.x,r=i.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,t){return Math.atan2(this.x*t-this.y*i,this.x*i+this.y*t)},_matMult:function(i){var t=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=t,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var t=Math.cos(i),r=Math.sin(i),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,t){var r=Math.cos(i),a=Math.sin(i),o=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ui.convert=function(i){return i instanceof ui?i:Array.isArray(i)?new ui(i[0],i[1]):i};var Bt=it(Ji),ls=Rs;function Rs(i,t,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=a}Rs.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)<t)return r;var p=this.sampleCurveDerivativeX(r);if(Math.abs(p)<1e-6)break;r-=o/p}var d=0,f=1;for(r=i,a=0;a<20&&(o=this.sampleCurveX(r),!(Math.abs(o-i)<t));a++)i>o?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var us=it(ls);let ti,Ee;function ca(){return ti==null&&(ti=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ti}function Tr(){if(Ee==null&&(Ee=!1,ca())){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let r=0;r<5*5;r++){const a=4*r;i.fillStyle=`rgb(${a},${a+1},${a+2})`,i.fillRect(r%5,Math.floor(r/5),1,1)}const t=i.getImageData(0,0,5,5).data;for(let r=0;r<5*5*4;r++)if(r%4!=3&&t[r]!==r){Ee=!0;break}}}return Ee||!1}function Os(i,t,r,a){const o=new us(i,t,r,a);return function(p){return o.solve(p)}}const hs=Os(.25,.1,.25,1);function Ki(i,t,r){return Math.min(r,Math.max(t,i))}function Vs(i,t,r){const a=r-t,o=((i-t)%a+a)%a+t;return o===t?r:o}function $e(i,...t){for(const r of t)for(const a in r)i[a]=r[a];return i}let pa=1;function me(i,t,r){const a={};for(const o in i)a[o]=t.call(r||this,i[o],o,i);return a}function cs(i,t,r){const a={};for(const o in i)t.call(r||this,i[o],o,i)&&(a[o]=i[o]);return a}function $i(i){return Array.isArray(i)?i.map($i):typeof i=="object"&&i?me(i,$i):i}const Ar={};function ei(i){Ar[i]||(typeof console<"u"&&console.warn(i),Ar[i]=!0)}function vi(i,t,r){return(r.y-i.y)*(t.x-i.x)>(t.y-i.y)*(r.x-i.x)}function ur(i){let t=0;for(let r,a,o=0,p=i.length,d=p-1;o<p;d=o++)r=i[o],a=i[d],t+=(a.x-r.x)*(r.y+a.y);return t}function ki(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let Ur=null;function Us(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const da="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Ns(i,t,r,a,o){return Hi(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const p=new VideoFrame(i,{timestamp:0});try{const d=p==null?void 0:p.format;if(!d||!d.startsWith("BGR")&&!d.startsWith("RGB"))throw new Error(`Unrecognized format ${d}`);const f=d.startsWith("BGR"),_=new Uint8ClampedArray(a*o*4);if(yield p.copyTo(_,function(x,b,T,I,C){const E=4*Math.max(-b,0),D=(Math.max(0,T)-T)*I*4+E,V=4*I,$=Math.max(0,b),J=Math.max(0,T);return{rect:{x:$,y:J,width:Math.min(x.width,b+I)-$,height:Math.min(x.height,T+C)-J},layout:[{offset:D,stride:V}]}}(i,t,r,a,o)),f)for(let x=0;x<_.length;x+=4){const b=_[x];_[x]=_[x+2],_[x+2]=b}return _}finally{p.close()}})}let Wi,ue,hi,Nr;const ps={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){const t=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(i,t=0){return this.getImageCanvasContext(i).getImageData(-t,-t,i.width+2*t,i.height+2*t)},getImageCanvasContext(i){const t=window.document.createElement("canvas"),r=t.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return t.width=i.width,t.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(hi||(hi=document.createElement("a")),hi.href=i,hi.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Nr==null&&(Nr=matchMedia("(prefers-reduced-motion: reduce)")),Nr.matches)}},ds={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Ir extends Error{constructor(t,r,a,o){super(`AJAXError: ${r} (${t}): ${a}`),this.status=t,this.statusText=r,this.url=a,this.body=o}}const qi=ki()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Mi=i=>ds.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function $s(i,t){const r=new AbortController,a=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:qi(),signal:r.signal});let o=!1,p=!1;return i.type==="json"&&a.headers.set("Accept","application/json"),p||fetch(a).then(d=>d.ok?(f=>{(i.type==="arrayBuffer"||i.type==="image"?f.arrayBuffer():i.type==="json"?f.json():f.text()).then(_=>{p||(o=!0,t(null,_,f.headers.get("Cache-Control"),f.headers.get("Expires")))}).catch(_=>{p||t(new Error(_.message))})})(d):d.blob().then(f=>t(new Ir(d.status,d.statusText,i.url,f)))).catch(d=>{d.code!==20&&t(new Error(d.message))}),{cancel:()=>{p=!0,o||r.abort()}}}const zr=function(i,t){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(ki()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,t);if(!ki())return(Mi(i.url)||$s)(i,t)}if(!(/^file:/.test(r=i.url)||/^file:/.test(qi())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return $s(i,t);if(ki()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,t,void 0,!0)}var r;return function(a,o){const p=new XMLHttpRequest;p.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(p.responseType="arraybuffer");for(const d in a.headers)p.setRequestHeader(d,a.headers[d]);return a.type==="json"&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials=a.credentials==="include",p.onerror=()=>{o(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||p.status===0)&&p.response!==null){let d=p.response;if(a.type==="json")try{d=JSON.parse(p.response)}catch(f){return o(f)}o(null,d,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else{const d=new Blob([p.response],{type:p.getResponseHeader("Content-Type")});o(new Ir(p.status,p.statusText,a.url,d))}},p.send(a.body),{cancel:()=>p.abort()}}(i,t)},qs=function(i,t){return zr($e(i,{type:"arrayBuffer"}),t)};function hr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const t=new URL(i),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function fs(i,t,r){r[i]&&r[i].indexOf(t)!==-1||(r[i]=r[i]||[],r[i].push(t))}function $r(i,t,r){if(r&&r[i]){const a=r[i].indexOf(t);a!==-1&&r[i].splice(a,1)}}class Pr{constructor(t,r={}){$e(this,r),this.type=t}}class Cr extends Pr{constructor(t,r={}){super("error",$e({error:t},r))}}class qr{on(t,r){return this._listeners=this._listeners||{},fs(t,r,this._listeners),this}off(t,r){return $r(t,r,this._listeners),$r(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},fs(t,r,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,r){typeof t=="string"&&(t=new Pr(t,r||{}));const a=t.type;if(this.listens(a)){t.target=this;const o=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const f of o)f.call(this,t);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const f of p)$r(a,f,this._oneTimeListeners),f.call(this,t);const d=this._eventedParent;d&&($e(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(t))}else t instanceof Cr&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var rt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const ci=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Di(i,t){const r={};for(const a in i)a!=="ref"&&(r[a]=i[a]);return ci.forEach(a=>{a in t&&(r[a]=t[a])}),r}function ne(i,t){if(Array.isArray(i)){if(!Array.isArray(t)||i.length!==t.length)return!1;for(let r=0;r<i.length;r++)if(!ne(i[r],t[r]))return!1;return!0}if(typeof i=="object"&&i!==null&&t!==null){if(typeof t!="object"||Object.keys(i).length!==Object.keys(t).length)return!1;for(const r in i)if(!ne(i[r],t[r]))return!1;return!0}return i===t}const Wt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Yi(i,t,r){r.push({command:Wt.addSource,args:[i,t[i]]})}function ms(i,t,r){t.push({command:Wt.removeSource,args:[i]}),r[i]=!0}function cr(i,t,r,a){ms(i,r,a),Yi(i,t,r)}function fa(i,t,r){let a;for(a in i[r])if(Object.prototype.hasOwnProperty.call(i[r],a)&&a!=="data"&&!ne(i[r][a],t[r][a]))return!1;for(a in t[r])if(Object.prototype.hasOwnProperty.call(t[r],a)&&a!=="data"&&!ne(i[r][a],t[r][a]))return!1;return!0}function gs(i,t,r,a,o,p){let d;for(d in t=t||{},i=i||{})Object.prototype.hasOwnProperty.call(i,d)&&(ne(i[d],t[d])||r.push({command:p,args:[a,d,t[d],o]}));for(d in t)Object.prototype.hasOwnProperty.call(t,d)&&!Object.prototype.hasOwnProperty.call(i,d)&&(ne(i[d],t[d])||r.push({command:p,args:[a,d,t[d],o]}))}function Er(i){return i.id}function jr(i,t){return i[t.id]=t,i}class ft{constructor(t,r,a,o){this.message=(t?`${t}: `:"")+a,o&&(this.identifier=o),r!=null&&r.__line__&&(this.line=r.__line__)}}function Qi(i,...t){for(const r of t)for(const a in r)i[a]=r[a];return i}class ve extends Error{constructor(t,r){super(r),this.message=r,this.key=t}}class Gr{constructor(t,r=[]){this.parent=t,this.bindings={};for(const[a,o]of r)this.bindings[a]=o}concat(t){return new Gr(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const pr={kind:"null"},gt={kind:"number"},Nt={kind:"string"},Rt={kind:"boolean"},ii={kind:"color"},tr={kind:"object"},Vt={kind:"value"},dr={kind:"collator"},F={kind:"formatted"},A={kind:"padding"},z={kind:"resolvedImage"},k={kind:"variableAnchorOffsetCollection"};function O(i,t){return{kind:"array",itemType:i,N:t}}function U(i){if(i.kind==="array"){const t=U(i.itemType);return typeof i.N=="number"?`array<${t}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${t}>`}return i.kind}const K=[pr,gt,Nt,Rt,ii,F,tr,O(Vt),A,z,k];function G(i,t){if(t.kind==="error")return null;if(i.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!G(i.itemType,t.itemType))&&(typeof i.N!="number"||i.N===t.N))return null}else{if(i.kind===t.kind)return null;if(i.kind==="value"){for(const r of K)if(!G(r,t))return null}}return`Expected ${U(i)} but found ${U(t)} instead.`}function q(i,t){return t.some(r=>r.kind===i.kind)}function X(i,t){return t.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function st(i,t){return i.kind==="array"&&t.kind==="array"?i.itemType.kind===t.itemType.kind&&typeof i.N=="number":i.kind===t.kind}const at=.96422,lt=.82521,Et=4/29,Ft=6/29,Tt=3*Ft*Ft,Mt=Ft*Ft*Ft,Ot=Math.PI/180,ee=180/Math.PI;function se(i){return(i%=360)<0&&(i+=360),i}function Kt([i,t,r,a]){let o,p;const d=He((.2225045*(i=Jt(i))+.7168786*(t=Jt(t))+.0606169*(r=Jt(r)))/1);i===t&&t===r?o=p=d:(o=He((.4360747*i+.3850649*t+.1430804*r)/at),p=He((.0139322*i+.0971045*t+.7141733*r)/lt));const f=116*d-16;return[f<0?0:f,500*(o-d),200*(d-p),a]}function Jt(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function He(i){return i>Mt?Math.pow(i,1/3):i/Tt+Et}function oe([i,t,r,a]){let o=(i+16)/116,p=isNaN(t)?o:o+t/500,d=isNaN(r)?o:o-r/200;return o=1*qe(o),p=at*qe(p),d=lt*qe(d),[ke(3.1338561*p-1.6168667*o-.4906146*d),ke(-.9787684*p+1.9161415*o+.033454*d),ke(.0719453*p-.2289914*o+1.4052427*d),a]}function ke(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function qe(i){return i>Ft?i*i*i:Tt*(i-Et)}function Li(i){return parseInt(i.padEnd(2,i),16)/255}function lo(i,t){return _s(t?i/100:i,0,1)}function _s(i,t,r){return Math.min(Math.max(t,i),r)}function ys(i){return!i.some(Number.isNaN)}const yl={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class ie{constructor(t,r,a,o=1,p=!0){this.r=t,this.g=r,this.b=a,this.a=o,p||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[t,r,a,o]))}static parse(t){if(t instanceof ie)return t;if(typeof t!="string")return;const r=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=yl[a];if(o){const[d,f,_]=o;return[d/255,f/255,_/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const d=a.length<6?1:2;let f=1;return[Li(a.slice(f,f+=d)),Li(a.slice(f,f+=d)),Li(a.slice(f,f+=d)),Li(a.slice(f,f+d)||"ff")]}if(a.startsWith("rgb")){const d=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,_,x,b,T,I,C,E,D,V,$,J]=d,j=[b||" ",C||" ",V].join("");if(j===" "||j===" /"||j===",,"||j===",,,"){const W=[x,I,D].join(""),Q=W==="%%%"?100:W===""?255:0;if(Q){const ot=[_s(+_/Q,0,1),_s(+T/Q,0,1),_s(+E/Q,0,1),$?lo(+$,J):1];if(ys(ot))return ot}}return}}const p=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[d,f,_,x,b,T,I,C,E]=p,D=[_||" ",b||" ",I].join("");if(D===" "||D===" /"||D===",,"||D===",,,"){const V=[+f,_s(+x,0,100),_s(+T,0,100),C?lo(+C,E):1];if(ys(V))return function([$,J,j,W]){function Q(ot){const bt=(ot+$/30)%12,It=J*Math.min(j,1-j);return j-It*Math.max(-1,Math.min(bt-3,9-bt,1))}return $=se($),J/=100,j/=100,[Q(0),Q(8),Q(4),W]}(V)}}}(t);return r?new ie(...r,!1):void 0}get rgb(){const{r:t,g:r,b:a,a:o}=this,p=o||1/0;return this.overwriteGetter("rgb",[t/p,r/p,a/p,o])}get hcl(){return this.overwriteGetter("hcl",function(t){const[r,a,o,p]=Kt(t),d=Math.sqrt(a*a+o*o);return[Math.round(1e4*d)?se(Math.atan2(o,a)*ee):NaN,d,r,p]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Kt(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){const[t,r,a,o]=this.rgb;return`rgba(${[t,r,a].map(p=>Math.round(255*p)).join(",")},${o})`}}ie.black=new ie(0,0,0,1),ie.white=new ie(1,1,1,1),ie.transparent=new ie(0,0,0,0),ie.red=new ie(1,0,0,1);class en{constructor(t,r,a){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ma{constructor(t,r,a,o,p){this.text=t,this.image=r,this.scale=a,this.fontStack=o,this.textColor=p}}class Je{constructor(t){this.sections=t}static fromString(t){return new Je([new ma(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof Je?t:Je.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class bi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof bi)return t;if(typeof t=="number")return new bi([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new bi(t)}}toString(){return JSON.stringify(this.values)}}const xl=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Bi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Bi)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r<t.length;r+=2){const a=t[r],o=t[r+1];if(typeof a!="string"||!xl.has(a)||!Array.isArray(o)||o.length!==2||typeof o[0]!="number"||typeof o[1]!="number")return}return new Bi(t)}}toString(){return JSON.stringify(this.values)}}class je{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new je({name:t,available:!1}):null}}function ga(i,t,r,a){return typeof i=="number"&&i>=0&&i<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,t,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,t,r,a]:[i,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function xs(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof ie||i instanceof en||i instanceof Je||i instanceof bi||i instanceof Bi||i instanceof je)return!0;if(Array.isArray(i)){for(const t of i)if(!xs(t))return!1;return!0}if(typeof i=="object"){for(const t in i)if(!xs(i[t]))return!1;return!0}return!1}function ge(i){if(i===null)return pr;if(typeof i=="string")return Nt;if(typeof i=="boolean")return Rt;if(typeof i=="number")return gt;if(i instanceof ie)return ii;if(i instanceof en)return dr;if(i instanceof Je)return F;if(i instanceof bi)return A;if(i instanceof Bi)return k;if(i instanceof je)return z;if(Array.isArray(i)){const t=i.length;let r;for(const a of i){const o=ge(a);if(r){if(r===o)continue;r=Vt;break}r=o}return O(r||Vt,t)}return tr}function Yt(i){const t=typeof i;return i===null?"":t==="string"||t==="number"||t==="boolean"?String(i):i instanceof ie||i instanceof Je||i instanceof bi||i instanceof Bi||i instanceof je?i.toString():JSON.stringify(i)}class Zr{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!xs(t[1]))return r.error("invalid value");const a=t[1];let o=ge(a);const p=r.expectedType;return o.kind!=="array"||o.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(o=p),new Zr(o,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class be{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const _a={string:Nt,number:gt,boolean:Rt,object:tr};class Fi{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let a,o=1;const p=t[0];if(p==="array"){let f,_;if(t.length>2){const x=t[1];if(typeof x!="string"||!(x in _a)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=_a[x],o++}else f=Vt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=t[2],o++}a=O(f,_)}else{if(!_a[p])throw new Error(`Types doesn't contain name = ${p}`);a=_a[p]}const d=[];for(;o<t.length;o++){const f=r.parse(t[o],o,Vt);if(!f)return null;d.push(f)}return new Fi(a,d)}evaluate(t){for(let r=0;r<this.args.length;r++){const a=this.args[r].evaluate(t);if(!G(this.type,ge(a)))return a;if(r===this.args.length-1)throw new be(`Expected value to be of type ${U(this.type)}, but found ${U(ge(a))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const rn={"to-boolean":Rt,"to-color":ii,"to-number":gt,"to-string":Nt};class kr{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const a=t[0];if(!rn[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&t.length!==2)return r.error("Expected one argument.");const o=rn[a],p=[];for(let d=1;d<t.length;d++){const f=r.parse(t[d],d,Vt);if(!f)return null;p.push(f)}return new kr(o,p)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let r,a;for(const o of this.args){if(r=o.evaluate(t),a=null,r instanceof ie)return r;if(typeof r=="string"){const p=t.parseColor(r);if(p)return p}else if(Array.isArray(r)&&(a=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:ga(r[0],r[1],r[2],r[3]),!a))return new ie(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new be(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(t);const o=bi.parse(r);if(o)return o}throw new be(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const a of this.args){r=a.evaluate(t);const o=Bi.parse(r);if(o)return o}throw new be(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(t),r===null)return 0;const o=Number(r);if(!isNaN(o))return o}throw new be(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Je.fromString(Yt(this.args[0].evaluate(t)));case"resolvedImage":return je.fromString(Yt(this.args[0].evaluate(t)));default:return Yt(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const uo=["Unknown","Point","LineString","Polygon"];class sn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?uo[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache[t];return r||(r=this._parseColorCache[t]=ie.parse(t)),r}}class ya{constructor(t,r,a=[],o,p=new Gr,d=[]){this.registry=t,this.path=a,this.key=a.map(f=>`[${f}]`).join(""),this.scope=p,this.errors=d,this.expectedType=o,this._isConstant=r}parse(t,r,a,o,p={}){return r?this.concat(r,a,o)._parse(t,p):this._parse(t,p)}_parse(t,r){function a(o,p,d){return d==="assert"?new Fi(p,[o]):d==="coerce"?new kr(p,[o]):o}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const o=t[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[o];if(p){let d=p.parse(t,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,_=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||_.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||_.kind!=="value"&&_.kind!=="string")if(f.kind!=="padding"||_.kind!=="value"&&_.kind!=="number"&&_.kind!=="array")if(f.kind!=="variableAnchorOffsetCollection"||_.kind!=="value"&&_.kind!=="array"){if(this.checkSubtype(f,_))return null}else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"assert")}if(!(d instanceof Zr)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new sn;try{d=new Zr(d.type,d.evaluate(f))}catch(_){return this.error(_.message),null}}return d}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,a){const o=typeof t=="number"?this.path.concat(t):this.path,p=a?this.scope.concat(a):this.scope;return new ya(this.registry,this._isConstant,o,r||null,p,this.errors)}error(t,...r){const a=`${this.key}${r.map(o=>`[${o}]`).join("")}`;this.errors.push(new ve(a,t))}checkSubtype(t,r){const a=G(t,r);return a&&this.error(a),a}}class xa{constructor(t,r,a){this.type=dr,this.locale=a,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");const a=t[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");const o=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Rt);if(!o)return null;const p=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Rt);if(!p)return null;let d=null;return a.locale&&(d=r.parse(a.locale,1,Nt),!d)?null:new xa(o,p,d)}evaluate(t){return new en(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}const Mr=8192;function an(i,t){i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.max(i[2],t[0]),i[3]=Math.max(i[3],t[1])}function js(i,t){return!(i[0]<=t[0]||i[2]>=t[2]||i[1]<=t[1]||i[3]>=t[3])}function ho(i,t){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,o=Math.pow(2,t.z);return[Math.round(r*o*Mr),Math.round(a*o*Mr)]}function vl(i,t,r){const a=i[0]-t[0],o=i[1]-t[1],p=i[0]-r[0],d=i[1]-r[1];return a*d-p*o==0&&a*p<=0&&o*d<=0}function nn(i,t){let r=!1;for(let d=0,f=t.length;d<f;d++){const _=t[d];for(let x=0,b=_.length;x<b-1;x++){if(vl(i,_[x],_[x+1]))return!1;(o=_[x])[1]>(a=i)[1]!=(p=_[x+1])[1]>a[1]&&a[0]<(p[0]-o[0])*(a[1]-o[1])/(p[1]-o[1])+o[0]&&(r=!r)}}var a,o,p;return r}function on(i,t){for(let r=0;r<t.length;r++)if(nn(i,t[r]))return!0;return!1}function co(i,t,r,a){const o=a[0]-r[0],p=a[1]-r[1],d=(i[0]-r[0])*p-o*(i[1]-r[1]),f=(t[0]-r[0])*p-o*(t[1]-r[1]);return d>0&&f<0||d<0&&f>0}function bl(i,t,r){for(const x of r)for(let b=0;b<x.length-1;++b)if((f=[(d=x[b+1])[0]-(p=x[b])[0],d[1]-p[1]])[0]*(_=[(o=t)[0]-(a=i)[0],o[1]-a[1]])[1]-f[1]*_[0]!=0&&co(a,o,p,d)&&co(p,d,a,o))return!0;var a,o,p,d,f,_;return!1}function po(i,t){for(let r=0;r<i.length;++r)if(!nn(i[r],t))return!1;for(let r=0;r<i.length-1;++r)if(bl(i[r],i[r+1],t))return!1;return!0}function fo(i,t){for(let r=0;r<t.length;r++)if(po(i,t[r]))return!0;return!1}function va(i,t,r){const a=[];for(let o=0;o<i.length;o++){const p=[];for(let d=0;d<i[o].length;d++){const f=ho(i[o][d],r);an(t,f),p.push(f)}a.push(p)}return a}function mo(i,t,r){const a=[];for(let o=0;o<i.length;o++){const p=va(i[o],t,r);a.push(p)}return a}function go(i,t,r,a){if(i[0]<r[0]||i[0]>r[2]){const o=.5*a;let p=i[0]-r[0]>o?-a:r[0]-i[0]>o?a:0;p===0&&(p=i[0]-r[2]>o?-a:r[2]-i[0]>o?a:0),i[0]+=p}an(t,i)}function ln(i,t,r,a){const o=Math.pow(2,a.z)*Mr,p=[a.x*Mr,a.y*Mr],d=[];for(const f of i)for(const _ of f){const x=[_.x+p[0],_.y+p[1]];go(x,t,r,o),d.push(x)}return d}function un(i,t,r,a){const o=Math.pow(2,a.z)*Mr,p=[a.x*Mr,a.y*Mr],d=[];for(const _ of i){const x=[];for(const b of _){const T=[b.x+p[0],b.y+p[1]];an(t,T),x.push(T)}d.push(x)}if(t[2]-t[0]<=o/2){(f=t)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const _ of d)for(const x of _)go(x,t,r,o)}var f;return d}class Xr{constructor(t,r){this.type=Rt,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(xs(t[1])){const a=t[1];if(a.type==="FeatureCollection")for(let o=0;o<a.features.length;++o){const p=a.features[o].geometry.type;if(p==="Polygon"||p==="MultiPolygon")return new Xr(a,a.features[o].geometry)}else if(a.type==="Feature"){const o=a.geometry.type;if(o==="Polygon"||o==="MultiPolygon")return new Xr(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new Xr(a,a)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,a){const o=[1/0,1/0,-1/0,-1/0],p=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(a.type==="Polygon"){const f=va(a.coordinates,p,d),_=ln(r.geometry(),o,p,d);if(!js(o,p))return!1;for(const x of _)if(!nn(x,f))return!1}if(a.type==="MultiPolygon"){const f=mo(a.coordinates,p,d),_=ln(r.geometry(),o,p,d);if(!js(o,p))return!1;for(const x of _)if(!on(x,f))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,a){const o=[1/0,1/0,-1/0,-1/0],p=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(a.type==="Polygon"){const f=va(a.coordinates,p,d),_=un(r.geometry(),o,p,d);if(!js(o,p))return!1;for(const x of _)if(!po(x,f))return!1}if(a.type==="MultiPolygon"){const f=mo(a.coordinates,p,d),_=un(r.geometry(),o,p,d);if(!js(o,p))return!1;for(const x of _)if(!fo(x,f))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class ba{constructor(t,r){this.type=r.type,this.name=t,this.boundExpression=r}static parse(t,r){if(t.length!==2||typeof t[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const a=t[1];return r.scope.has(a)?new ba(a,r.scope.get(a)):r.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class Ri{constructor(t,r,a,o){this.name=t,this.type=r,this._evaluate=a,this.args=o}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){const a=t[0],o=Ri.definitions[a];if(!o)return r.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(o)?o[0]:o.type,d=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,f=d.filter(([x])=>!Array.isArray(x)||x.length===t.length-1);let _=null;for(const[x,b]of f){_=new ya(r.registry,wa,r.path,null,r.scope);const T=[];let I=!1;for(let C=1;C<t.length;C++){const E=t[C],D=Array.isArray(x)?x[C-1]:x.type,V=_.parse(E,1+T.length,D);if(!V){I=!0;break}T.push(V)}if(!I)if(Array.isArray(x)&&x.length!==T.length)_.error(`Expected ${x.length} arguments, but found ${T.length} instead.`);else{for(let C=0;C<T.length;C++){const E=Array.isArray(x)?x[C]:x.type,D=T[C];_.concat(C+1).checkSubtype(E,D.type)}if(_.errors.length===0)return new Ri(a,p,b,T)}}if(f.length===1)r.errors.push(..._.errors);else{const x=(f.length?f:d).map(([T])=>{return I=T,Array.isArray(I)?`(${I.map(U).join(", ")})`:`(${U(I.type)}...)`;var I}).join(" | "),b=[];for(let T=1;T<t.length;T++){const I=r.parse(t[T],1+b.length);if(!I)return null;b.push(U(I.type))}r.error(`Expected arguments of type ${x}, but found (${b.join(", ")}) instead.`)}return null}static register(t,r){Ri.definitions=r;for(const a in r)t[a]=Ri}}function wa(i){if(i instanceof ba)return wa(i.boundExpression);if(i instanceof Ri&&i.name==="error"||i instanceof xa||i instanceof Xr)return!1;const t=i instanceof kr||i instanceof Fi;let r=!0;return i.eachChild(a=>{r=t?r&&wa(a):r&&a instanceof Zr}),!!r&&Sa(i)&&Ta(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Sa(i){if(i instanceof Ri&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Xr)return!1;let t=!0;return i.eachChild(r=>{t&&!Sa(r)&&(t=!1)}),t}function Gs(i){if(i instanceof Ri&&i.name==="feature-state")return!1;let t=!0;return i.eachChild(r=>{t&&!Gs(r)&&(t=!1)}),t}function Ta(i,t){if(i instanceof Ri&&t.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(a=>{r&&!Ta(a,t)&&(r=!1)}),r}function vs(i,t){const r=i.length-1;let a,o,p=0,d=r,f=0;for(;p<=d;)if(f=Math.floor((p+d)/2),a=i[f],o=i[f+1],a<=t){if(f===r||t<o)return f;p=f+1}else{if(!(a>t))throw new be("Input is not a number.");d=f-1}return 0}class Dr{constructor(t,r,a){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(const[o,p]of a)this.labels.push(o),this.outputs.push(p)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(t[1],1,gt);if(!a)return null;const o=[];let p=null;r.expectedType&&r.expectedType.kind!=="value"&&(p=r.expectedType);for(let d=1;d<t.length;d+=2){const f=d===1?-1/0:t[d],_=t[d+1],x=d,b=d+1;if(typeof f!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(o.length&&o[o.length-1][0]>=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const T=r.parse(_,b,p);if(!T)return null;p=p||T.type,o.push([f,T])}return new Dr(p,a,o)}evaluate(t){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(t);const o=this.input.evaluate(t);if(o<=r[0])return a[0].evaluate(t);const p=r.length;return o>=r[p-1]?a[p-1].evaluate(t):a[vs(r,o)].evaluate(t)}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Xt(i,t,r){return i+r*(t-i)}function Aa(i,t,r){return i.map((a,o)=>Xt(a,t[o],r))}const wi={number:Xt,color:function(i,t,r,a="rgb"){switch(a){case"rgb":{const[o,p,d,f]=Aa(i.rgb,t.rgb,r);return new ie(o,p,d,f,!1)}case"hcl":{const[o,p,d,f]=i.hcl,[_,x,b,T]=t.hcl;let I,C;if(isNaN(o)||isNaN(_))isNaN(o)?isNaN(_)?I=NaN:(I=_,d!==1&&d!==0||(C=x)):(I=o,b!==1&&b!==0||(C=p));else{let J=_-o;_>o&&J>180?J-=360:_<o&&o-_>180&&(J+=360),I=o+r*J}const[E,D,V,$]=function([J,j,W,Q]){return J=isNaN(J)?0:J*Ot,oe([W,Math.cos(J)*j,Math.sin(J)*j,Q])}([I,C??Xt(p,x,r),Xt(d,b,r),Xt(f,T,r)]);return new ie(E,D,V,$,!1)}case"lab":{const[o,p,d,f]=oe(Aa(i.lab,t.lab,r));return new ie(o,p,d,f,!1)}}},array:Aa,padding:function(i,t,r){return new bi(Aa(i.values,t.values,r))},variableAnchorOffsetCollection:function(i,t,r){const a=i.values,o=t.values;if(a.length!==o.length)throw new be(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${t.toString()}`);const p=[];for(let d=0;d<a.length;d+=2){if(a[d]!==o[d])throw new be(`Cannot interpolate values containing mismatched anchors. from[${d}]: ${a[d]}, to[${d}]: ${o[d]}`);p.push(a[d]);const[f,_]=a[d+1],[x,b]=o[d+1];p.push([Xt(f,x,r),Xt(_,b,r)])}return new Bi(p)}};class Si{constructor(t,r,a,o,p){this.type=t,this.operator=r,this.interpolation=a,this.input=o,this.labels=[],this.outputs=[];for(const[d,f]of p)this.labels.push(d),this.outputs.push(f)}static interpolationFactor(t,r,a,o){let p=0;if(t.name==="exponential")p=hn(r,t.base,a,o);else if(t.name==="linear")p=hn(r,1,a,o);else if(t.name==="cubic-bezier"){const d=t.controlPoints;p=new us(d[0],d[1],d[2],d[3]).solve(hn(r,1,a,o))}return p}static parse(t,r){let[a,o,p,...d]=t;if(!Array.isArray(o)||o.length===0)return r.error("Expected an interpolation type expression.",1);if(o[0]==="linear")o={name:"linear"};else if(o[0]==="exponential"){const x=o[1];if(typeof x!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:x}}else{if(o[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const x=o.slice(1);if(x.length!==4||x.some(b=>typeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:x}}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(p=r.parse(p,2,gt),!p)return null;const f=[];let _=null;a==="interpolate-hcl"||a==="interpolate-lab"?_=ii:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x<d.length;x+=2){const b=d[x],T=d[x+1],I=x+3,C=x+4;if(typeof b!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',I);if(f.length&&f[f.length-1][0]>=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',I);const E=r.parse(T,C,_);if(!E)return null;_=_||E.type,f.push([b,E])}return st(_,gt)||st(_,ii)||st(_,A)||st(_,k)||st(_,O(gt))?new Si(_,a,o,p,f):r.error(`Type ${U(_)} is not interpolatable.`)}evaluate(t){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(t);const o=this.input.evaluate(t);if(o<=r[0])return a[0].evaluate(t);const p=r.length;if(o>=r[p-1])return a[p-1].evaluate(t);const d=vs(r,o),f=Si.interpolationFactor(this.interpolation,o,r[d],r[d+1]),_=a[d].evaluate(t),x=a[d+1].evaluate(t);switch(this.operator){case"interpolate":return wi[this.type.kind](_,x,f);case"interpolate-hcl":return wi.color(_,x,f,"hcl");case"interpolate-lab":return wi.color(_,x,f,"lab")}}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function hn(i,t,r,a){const o=a-r,p=i-r;return o===0?0:t===1?p/o:(Math.pow(t,p)-1)/(Math.pow(t,o)-1)}class Ia{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let a=null;const o=r.expectedType;o&&o.kind!=="value"&&(a=o);const p=[];for(const f of t.slice(1)){const _=r.parse(f,1+p.length,a,void 0,{typeAnnotation:"omit"});if(!_)return null;a=a||_.type,p.push(_)}if(!a)throw new Error("No output type");const d=o&&p.some(f=>G(o,f.type));return new Ia(d?Vt:a,p)}evaluate(t){let r,a=null,o=0;for(const p of this.args)if(o++,a=p.evaluate(t),a&&a instanceof je&&!a.available&&(r||(r=a.name),a=null,o===this.args.length&&(a=r)),a!==null)break;return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}class za{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let p=1;p<t.length-1;p+=2){const d=t[p];if(typeof d!="string")return r.error(`Expected string, but found ${typeof d} instead.`,p);if(/[^a-zA-Z0-9_]/.test(d))return r.error("Variable names must contain only alphanumeric characters or '_'.",p);const f=r.parse(t[p+1],p+1);if(!f)return null;a.push([d,f])}const o=r.parse(t[t.length-1],t.length-1,r.expectedType,a);return o?new za(a,o):null}outputDefined(){return this.result.outputDefined()}}class cn{constructor(t,r,a){this.type=t,this.index=r,this.input=a}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,gt),o=r.parse(t[2],2,O(r.expectedType||Vt));return a&&o?new cn(o.type.itemType,a,o):null}evaluate(t){const r=this.index.evaluate(t),a=this.input.evaluate(t);if(r<0)throw new be(`Array index out of bounds: ${r} < 0.`);if(r>=a.length)throw new be(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new be(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class pn{constructor(t,r){this.type=Rt,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,Vt),o=r.parse(t[2],2,Vt);return a&&o?q(a.type,[Rt,Nt,gt,pr,Vt])?new pn(a,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${U(a.type)} instead`):null}evaluate(t){const r=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!a)return!1;if(!X(r,["boolean","string","number","null"]))throw new be(`Expected first argument to be of type boolean, string, number or null, but found ${U(ge(r))} instead.`);if(!X(a,["string","array"]))throw new be(`Expected second argument to be of type array or string, but found ${U(ge(a))} instead.`);return a.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Pa{constructor(t,r,a){this.type=gt,this.needle=t,this.haystack=r,this.fromIndex=a}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,Vt),o=r.parse(t[2],2,Vt);if(!a||!o)return null;if(!q(a.type,[Rt,Nt,gt,pr,Vt]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${U(a.type)} instead`);if(t.length===4){const p=r.parse(t[3],3,gt);return p?new Pa(a,o,p):null}return new Pa(a,o)}evaluate(t){const r=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!X(r,["boolean","string","number","null"]))throw new be(`Expected first argument to be of type boolean, string, number or null, but found ${U(ge(r))} instead.`);if(!X(a,["string","array"]))throw new be(`Expected second argument to be of type array or string, but found ${U(ge(a))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(t);return a.indexOf(r,o)}return a.indexOf(r)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class dn{constructor(t,r,a,o,p,d){this.inputType=t,this.type=r,this.input=a,this.cases=o,this.outputs=p,this.otherwise=d}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let a,o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const p={},d=[];for(let x=2;x<t.length-1;x+=2){let b=t[x];const T=t[x+1];Array.isArray(b)||(b=[b]);const I=r.concat(x);if(b.length===0)return I.error("Expected at least one branch label.");for(const E of b){if(typeof E!="number"&&typeof E!="string")return I.error("Branch labels must be numbers or strings.");if(typeof E=="number"&&Math.abs(E)>Number.MAX_SAFE_INTEGER)return I.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof E=="number"&&Math.floor(E)!==E)return I.error("Numeric branch labels must be integer values.");if(a){if(I.checkSubtype(a,ge(E)))return null}else a=ge(E);if(p[String(E)]!==void 0)return I.error("Branch labels must be unique.");p[String(E)]=d.length}const C=r.parse(T,x,o);if(!C)return null;o=o||C.type,d.push(C)}const f=r.parse(t[1],1,Vt);if(!f)return null;const _=r.parse(t[t.length-1],t.length-1,o);return _?f.type.kind!=="value"&&r.concat(1).checkSubtype(a,f.type)?null:new dn(a,o,f,p,d,_):null}evaluate(t){const r=this.input.evaluate(t);return(ge(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class fn{constructor(t,r,a){this.type=t,this.branches=r,this.otherwise=a}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const o=[];for(let d=1;d<t.length-1;d+=2){const f=r.parse(t[d],d,Rt);if(!f)return null;const _=r.parse(t[d+1],d+1,a);if(!_)return null;o.push([f,_]),a=a||_.type}const p=r.parse(t[t.length-1],t.length-1,a);if(!p)return null;if(!a)throw new Error("Can't infer output type");return new fn(a,o,p)}evaluate(t){for(const[r,a]of this.branches)if(r.evaluate(t))return a.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[r,a]of this.branches)t(r),t(a);t(this.otherwise)}outputDefined(){return this.branches.every(([t,r])=>r.outputDefined())&&this.otherwise.outputDefined()}}class Ca{constructor(t,r,a,o){this.type=t,this.input=r,this.beginIndex=a,this.endIndex=o}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,Vt),o=r.parse(t[2],2,gt);if(!a||!o)return null;if(!q(a.type,[O(Vt),Nt,Vt]))return r.error(`Expected first argument to be of type array or string, but found ${U(a.type)} instead`);if(t.length===4){const p=r.parse(t[3],3,gt);return p?new Ca(a.type,a,o,p):null}return new Ca(a.type,a,o)}evaluate(t){const r=this.input.evaluate(t),a=this.beginIndex.evaluate(t);if(!X(r,["string","array"]))throw new be(`Expected first argument to be of type array or string, but found ${U(ge(r))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(t);return r.slice(a,o)}return r.slice(a)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function _o(i,t){return i==="=="||i==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function yo(i,t,r,a){return a.compare(t,r)===0}function bs(i,t,r){const a=i!=="=="&&i!=="!=";return class ac{constructor(p,d,f){this.type=Rt,this.lhs=p,this.rhs=d,this.collator=f,this.hasUntypedArgument=p.type.kind==="value"||d.type.kind==="value"}static parse(p,d){if(p.length!==3&&p.length!==4)return d.error("Expected two or three arguments.");const f=p[0];let _=d.parse(p[1],1,Vt);if(!_)return null;if(!_o(f,_.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${U(_.type)}'.`);let x=d.parse(p[2],2,Vt);if(!x)return null;if(!_o(f,x.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${U(x.type)}'.`);if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${U(_.type)}' and '${U(x.type)}'.`);a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new Fi(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Fi(_.type,[x])));let b=null;if(p.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(p[3],3,dr),!b)return null}return new ac(_,x,b)}evaluate(p){const d=this.lhs.evaluate(p),f=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const _=ge(d),x=ge(f);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new be(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const _=ge(d),x=ge(f);if(_.kind!=="string"||x.kind!=="string")return t(p,d,f)}return this.collator?r(p,d,f,this.collator.evaluate(p)):t(p,d,f)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}}}const wl=bs("==",function(i,t,r){return t===r},yo),Sl=bs("!=",function(i,t,r){return t!==r},function(i,t,r,a){return!yo(0,t,r,a)}),Tl=bs("<",function(i,t,r){return t<r},function(i,t,r,a){return a.compare(t,r)<0}),Al=bs(">",function(i,t,r){return t>r},function(i,t,r,a){return a.compare(t,r)>0}),Il=bs("<=",function(i,t,r){return t<=r},function(i,t,r,a){return a.compare(t,r)<=0}),zl=bs(">=",function(i,t,r){return t>=r},function(i,t,r,a){return a.compare(t,r)>=0});class mn{constructor(t,r,a,o,p){this.type=Nt,this.number=t,this.locale=r,this.currency=a,this.minFractionDigits=o,this.maxFractionDigits=p}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");const a=r.parse(t[1],1,gt);if(!a)return null;const o=t[2];if(typeof o!="object"||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let p=null;if(o.locale&&(p=r.parse(o.locale,1,Nt),!p))return null;let d=null;if(o.currency&&(d=r.parse(o.currency,1,Nt),!d))return null;let f=null;if(o["min-fraction-digits"]&&(f=r.parse(o["min-fraction-digits"],1,gt),!f))return null;let _=null;return o["max-fraction-digits"]&&(_=r.parse(o["max-fraction-digits"],1,gt),!_)?null:new mn(a,p,d,f,_)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Ea{constructor(t){this.type=F,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const o=[];let p=!1;for(let d=1;d<=t.length-1;++d){const f=t[d];if(p&&typeof f=="object"&&!Array.isArray(f)){p=!1;let _=null;if(f["font-scale"]&&(_=r.parse(f["font-scale"],1,gt),!_))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,O(Nt)),!x))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,ii),!b))return null;const T=o[o.length-1];T.scale=_,T.font=x,T.textColor=b}else{const _=r.parse(t[d],1,Vt);if(!_)return null;const x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,o.push({content:_,scale:null,font:null,textColor:null})}}return new Ea(o)}evaluate(t){return new Je(this.sections.map(r=>{const a=r.content.evaluate(t);return ge(a)===z?new ma("",a,null,null,null):new ma(Yt(a),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null)}))}eachChild(t){for(const r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}outputDefined(){return!1}}class gn{constructor(t){this.type=z,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");const a=r.parse(t[1],1,Nt);return a?new gn(a):r.error("No image name provided.")}evaluate(t){const r=this.input.evaluate(t),a=je.fromString(r);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(r)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}}class _n{constructor(t){this.type=gt,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=r.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${U(a.type)} instead.`):new _n(a):null}evaluate(t){const r=this.input.evaluate(t);if(typeof r=="string"||Array.isArray(r))return r.length;throw new be(`Expected value to be of type string or array, but found ${U(ge(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const ws={"==":wl,"!=":Sl,">":Al,"<":Tl,">=":zl,"<=":Il,array:Fi,at:cn,boolean:Fi,case:fn,coalesce:Ia,collator:xa,format:Ea,image:gn,in:pn,"index-of":Pa,interpolate:Si,"interpolate-hcl":Si,"interpolate-lab":Si,length:_n,let:za,literal:Zr,match:dn,number:Fi,"number-format":mn,object:Fi,slice:Ca,step:Dr,string:Fi,"to-boolean":kr,"to-color":kr,"to-number":kr,"to-string":kr,var:ba,within:Xr};function xo(i,[t,r,a,o]){t=t.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const p=o?o.evaluate(i):1,d=ga(t,r,a,p);if(d)throw new be(d);return new ie(t/255,r/255,a/255,p,!1)}function vo(i,t){return i in t}function yn(i,t){const r=t[i];return r===void 0?null:r}function Hr(i){return{type:i}}function bo(i){return{result:"success",value:i}}function Lr(i){return{result:"error",value:i}}function Ss(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function wo(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function xn(i){return!!i.expression&&i.expression.interpolated}function Qt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function _e(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Pl(i){return i}function Ht(i,t){const r=t.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",o=a||!(a||i.property!==void 0),p=i.type||(xn(t)?"exponential":"interval");if(r||t.type==="padding"){const b=r?ie.parse:bi.parse;(i=Qi({},i)).stops&&(i.stops=i.stops.map(T=>[T[0],b(T[1])])),i.default=b(i.default?i.default:t.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,_,x;if(p==="exponential")f=Zs;else if(p==="interval")f=de;else if(p==="categorical"){f=ye,_=Object.create(null);for(const b of i.stops)_[b[0]]=b[1];x=typeof i.stops[0][0]}else{if(p!=="identity")throw new Error(`Unknown function type "${p}"`);f=So}if(a){const b={},T=[];for(let E=0;E<i.stops.length;E++){const D=i.stops[E],V=D[0].zoom;b[V]===void 0&&(b[V]={zoom:V,type:i.type,property:i.property,default:i.default,stops:[]},T.push(V)),b[V].stops.push([D[0].value,D[1]])}const I=[];for(const E of T)I.push([b[E].zoom,Ht(b[E],t)]);const C={name:"linear"};return{kind:"composite",interpolationType:C,interpolationFactor:Si.interpolationFactor.bind(void 0,C),zoomStops:I.map(E=>E[0]),evaluate:({zoom:E},D)=>Zs({stops:I,base:i.base},t,E).evaluate(E,D)}}if(o){const b=p==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:Si.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(T=>T[0]),evaluate:({zoom:T})=>f(i,t,T,_,x)}}return{kind:"source",evaluate(b,T){const I=T&&T.properties?T.properties[i.property]:void 0;return I===void 0?Jr(i.default,t.default):f(i,t,I,_,x)}}}function Jr(i,t,r){return i!==void 0?i:t!==void 0?t:r!==void 0?r:void 0}function ye(i,t,r,a,o){return Jr(typeof r===o?a[r]:void 0,i.default,t.default)}function de(i,t,r){if(Qt(r)!=="number")return Jr(i.default,t.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const o=vs(i.stops.map(p=>p[0]),r);return i.stops[o][1]}function Zs(i,t,r){const a=i.base!==void 0?i.base:1;if(Qt(r)!=="number")return Jr(i.default,t.default);const o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const p=vs(i.stops.map(b=>b[0]),r),d=function(b,T,I,C){const E=C-I,D=b-I;return E===0?0:T===1?D/E:(Math.pow(T,D)-1)/(Math.pow(T,E)-1)}(r,a,i.stops[p][0],i.stops[p+1][0]),f=i.stops[p][1],_=i.stops[p+1][1],x=wi[t.type]||Pl;return typeof f.evaluate=="function"?{evaluate(...b){const T=f.evaluate.apply(void 0,b),I=_.evaluate.apply(void 0,b);if(T!==void 0&&I!==void 0)return x(T,I,d,i.colorSpace)}}:x(f,_,d,i.colorSpace)}function So(i,t,r){switch(t.type){case"color":r=ie.parse(r);break;case"formatted":r=Je.fromString(r.toString());break;case"resolvedImage":r=je.fromString(r.toString());break;case"padding":r=bi.parse(r);break;default:Qt(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return Jr(r,i.default,t.default)}Ri.register(ws,{error:[{kind:"error"},[Nt],(i,[t])=>{throw new be(t.evaluate(i))}],typeof:[Nt,[Vt],(i,[t])=>U(ge(t.evaluate(i)))],"to-rgba":[O(gt,4),[ii],(i,[t])=>{const[r,a,o,p]=t.evaluate(i).rgb;return[255*r,255*a,255*o,p]}],rgb:[ii,[gt,gt,gt],xo],rgba:[ii,[gt,gt,gt,gt],xo],has:{type:Rt,overloads:[[[Nt],(i,[t])=>vo(t.evaluate(i),i.properties())],[[Nt,tr],(i,[t,r])=>vo(t.evaluate(i),r.evaluate(i))]]},get:{type:Vt,overloads:[[[Nt],(i,[t])=>yn(t.evaluate(i),i.properties())],[[Nt,tr],(i,[t,r])=>yn(t.evaluate(i),r.evaluate(i))]]},"feature-state":[Vt,[Nt],(i,[t])=>yn(t.evaluate(i),i.featureState||{})],properties:[tr,[],i=>i.properties()],"geometry-type":[Nt,[],i=>i.geometryType()],id:[Vt,[],i=>i.id()],zoom:[gt,[],i=>i.globals.zoom],"heatmap-density":[gt,[],i=>i.globals.heatmapDensity||0],"line-progress":[gt,[],i=>i.globals.lineProgress||0],accumulated:[Vt,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[gt,Hr(gt),(i,t)=>{let r=0;for(const a of t)r+=a.evaluate(i);return r}],"*":[gt,Hr(gt),(i,t)=>{let r=1;for(const a of t)r*=a.evaluate(i);return r}],"-":{type:gt,overloads:[[[gt,gt],(i,[t,r])=>t.evaluate(i)-r.evaluate(i)],[[gt],(i,[t])=>-t.evaluate(i)]]},"/":[gt,[gt,gt],(i,[t,r])=>t.evaluate(i)/r.evaluate(i)],"%":[gt,[gt,gt],(i,[t,r])=>t.evaluate(i)%r.evaluate(i)],ln2:[gt,[],()=>Math.LN2],pi:[gt,[],()=>Math.PI],e:[gt,[],()=>Math.E],"^":[gt,[gt,gt],(i,[t,r])=>Math.pow(t.evaluate(i),r.evaluate(i))],sqrt:[gt,[gt],(i,[t])=>Math.sqrt(t.evaluate(i))],log10:[gt,[gt],(i,[t])=>Math.log(t.evaluate(i))/Math.LN10],ln:[gt,[gt],(i,[t])=>Math.log(t.evaluate(i))],log2:[gt,[gt],(i,[t])=>Math.log(t.evaluate(i))/Math.LN2],sin:[gt,[gt],(i,[t])=>Math.sin(t.evaluate(i))],cos:[gt,[gt],(i,[t])=>Math.cos(t.evaluate(i))],tan:[gt,[gt],(i,[t])=>Math.tan(t.evaluate(i))],asin:[gt,[gt],(i,[t])=>Math.asin(t.evaluate(i))],acos:[gt,[gt],(i,[t])=>Math.acos(t.evaluate(i))],atan:[gt,[gt],(i,[t])=>Math.atan(t.evaluate(i))],min:[gt,Hr(gt),(i,t)=>Math.min(...t.map(r=>r.evaluate(i)))],max:[gt,Hr(gt),(i,t)=>Math.max(...t.map(r=>r.evaluate(i)))],abs:[gt,[gt],(i,[t])=>Math.abs(t.evaluate(i))],round:[gt,[gt],(i,[t])=>{const r=t.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[gt,[gt],(i,[t])=>Math.floor(t.evaluate(i))],ceil:[gt,[gt],(i,[t])=>Math.ceil(t.evaluate(i))],"filter-==":[Rt,[Nt,Vt],(i,[t,r])=>i.properties()[t.value]===r.value],"filter-id-==":[Rt,[Vt],(i,[t])=>i.id()===t.value],"filter-type-==":[Rt,[Nt],(i,[t])=>i.geometryType()===t.value],"filter-<":[Rt,[Nt,Vt],(i,[t,r])=>{const a=i.properties()[t.value],o=r.value;return typeof a==typeof o&&a<o}],"filter-id-<":[Rt,[Vt],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r<a}],"filter->":[Rt,[Nt,Vt],(i,[t,r])=>{const a=i.properties()[t.value],o=r.value;return typeof a==typeof o&&a>o}],"filter-id->":[Rt,[Vt],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r>a}],"filter-<=":[Rt,[Nt,Vt],(i,[t,r])=>{const a=i.properties()[t.value],o=r.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[Rt,[Vt],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r<=a}],"filter->=":[Rt,[Nt,Vt],(i,[t,r])=>{const a=i.properties()[t.value],o=r.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[Rt,[Vt],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r>=a}],"filter-has":[Rt,[Vt],(i,[t])=>t.value in i.properties()],"filter-has-id":[Rt,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Rt,[O(Nt)],(i,[t])=>t.value.indexOf(i.geometryType())>=0],"filter-id-in":[Rt,[O(Vt)],(i,[t])=>t.value.indexOf(i.id())>=0],"filter-in-small":[Rt,[Nt,O(Vt)],(i,[t,r])=>r.value.indexOf(i.properties()[t.value])>=0],"filter-in-large":[Rt,[Nt,O(Vt)],(i,[t,r])=>function(a,o,p,d){for(;p<=d;){const f=p+d>>1;if(o[f]===a)return!0;o[f]>a?d=f-1:p=f+1}return!1}(i.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Rt,overloads:[[[Rt,Rt],(i,[t,r])=>t.evaluate(i)&&r.evaluate(i)],[Hr(Rt),(i,t)=>{for(const r of t)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Rt,overloads:[[[Rt,Rt],(i,[t,r])=>t.evaluate(i)||r.evaluate(i)],[Hr(Rt),(i,t)=>{for(const r of t)if(r.evaluate(i))return!0;return!1}]]},"!":[Rt,[Rt],(i,[t])=>!t.evaluate(i)],"is-supported-script":[Rt,[Nt],(i,[t])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(t.evaluate(i))}],upcase:[Nt,[Nt],(i,[t])=>t.evaluate(i).toUpperCase()],downcase:[Nt,[Nt],(i,[t])=>t.evaluate(i).toLowerCase()],concat:[Nt,Hr(Vt),(i,t)=>t.map(r=>Yt(r.evaluate(i))).join("")],"resolved-locale":[Nt,[dr],(i,[t])=>t.evaluate(i).resolvedLocale()]});class vn{constructor(t,r){var a;this.expression=t,this._warningHistory={},this._evaluator=new sn,this._defaultValue=r?(a=r).type==="color"&&_e(a.default)?new ie(0,0,0,0):a.type==="color"?ie.parse(a.default)||null:a.type==="padding"?bi.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?Bi.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(t,r,a,o,p,d){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=o,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(t,r,a,o,p,d){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=o,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=d||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new be(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function ka(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in ws}function Ma(i,t){const r=new ya(ws,wa,[],t?function(o){const p={color:ii,string:Nt,number:gt,enum:Nt,boolean:Rt,formatted:F,padding:A,resolvedImage:z,variableAnchorOffsetCollection:k};return o.type==="array"?O(p[o.value]||Vt,o.length):p[o.type]}(t):void 0),a=r.parse(i,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?bo(new vn(a,t)):Lr(r.errors)}class bn{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!Gs(r.expression)}evaluateWithoutErrorHandling(t,r,a,o,p,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,a,o,p,d)}evaluate(t,r,a,o,p,d){return this._styleExpression.evaluate(t,r,a,o,p,d)}}class Da{constructor(t,r,a,o){this.kind=t,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!Gs(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(t,r,a,o,p,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,a,o,p,d)}evaluate(t,r,a,o,p,d){return this._styleExpression.evaluate(t,r,a,o,p,d)}interpolationFactor(t,r,a){return this.interpolationType?Si.interpolationFactor(this.interpolationType,t,r,a):0}}function wn(i,t){const r=Ma(i,t);if(r.result==="error")return r;const a=r.value.expression,o=Sa(a);if(!o&&!Ss(t))return Lr([new ve("","data expressions not supported")]);const p=Ta(a,["zoom"]);if(!p&&!wo(t))return Lr([new ve("","zoom expressions not supported")]);const d=Hs(a);return d||p?d instanceof ve?Lr([d]):d instanceof Si&&!xn(t)?Lr([new ve("",'"interpolate" expressions cannot be used with this property')]):bo(d?new Da(o?"camera":"composite",r.value,d.labels,d instanceof Si?d.interpolation:void 0):new bn(o?"constant":"source",r.value)):Lr([new ve("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xs{constructor(t,r){this._parameters=t,this._specification=r,Qi(this,Ht(this._parameters,this._specification))}static deserialize(t){return new Xs(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Hs(i){let t=null;if(i instanceof za)t=Hs(i.result);else if(i instanceof Ia){for(const r of i.args)if(t=Hs(r),t)break}else(i instanceof Dr||i instanceof Si)&&i.input instanceof Ri&&i.input.name==="zoom"&&(t=i);return t instanceof ve||i.eachChild(r=>{const a=Hs(r);a instanceof ve?t=a:!t&&a?t=new ve("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new ve("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function Js(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const t of i.slice(1))if(!Js(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Cl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Sn(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Js(i)||(i=La(i));const t=Ma(i,Cl);if(t.result==="error")throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,a,o)=>t.value.evaluate(r,a,{},o),needGeometry:To(i)}}function El(i,t){return i<t?-1:i>t?1:0}function To(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let t=1;t<i.length;t++)if(To(i[t]))return!0;return!1}function La(i){if(!i)return!0;const t=i[0];return i.length<=1?t!=="any":t==="=="?Tn(i[1],i[2],"=="):t==="!="?Ks(Tn(i[1],i[2],"==")):t==="<"||t===">"||t==="<="||t===">="?Tn(i[1],i[2],t):t==="any"?(r=i.slice(1),["any"].concat(r.map(La))):t==="all"?["all"].concat(i.slice(1).map(La)):t==="none"?["all"].concat(i.slice(1).map(La).map(Ks)):t==="in"?Ao(i[1],i.slice(2)):t==="!in"?Ks(Ao(i[1],i.slice(2))):t==="has"?Io(i[1]):t==="!has"?Ks(Io(i[1])):t!=="within"||i;var r}function Tn(i,t,r){switch(i){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,i,t]}}function Ao(i,t){if(t.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",i,["literal",t.sort(El)]]:["filter-in-small",i,["literal",t]]}}function Io(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Ks(i){return["!",i]}function Ba(i){const t=typeof i;if(t==="number"||t==="boolean"||t==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let o="[";for(const p of i)o+=`${Ba(p)},`;return`${o}]`}const r=Object.keys(i).sort();let a="{";for(let o=0;o<r.length;o++)a+=`${JSON.stringify(r[o])}:${Ba(i[r[o]])},`;return`${a}}`}function Fa(i){let t="";for(const r of ci)t+=`/${Ba(i[r])}`;return t}function zo(i){const t=i.value;return t?[new ft(i.key,t,"constants have been deprecated as of v8")]:[]}function we(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Kr(i){if(Array.isArray(i))return i.map(Kr);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const t={};for(const r in i)t[r]=Kr(i[r]);return t}return we(i)}function pi(i){const t=i.key,r=i.value,a=i.valueSpec||{},o=i.objectElementValidators||{},p=i.style,d=i.styleSpec,f=i.validateSpec;let _=[];const x=Qt(r);if(x!=="object")return[new ft(t,r,`object expected, ${x} found`)];for(const b in r){const T=b.split(".")[0],I=a[T]||a["*"];let C;if(o[T])C=o[T];else if(a[T])C=f;else if(o["*"])C=o["*"];else{if(!a["*"]){_.push(new ft(t,r[b],`unknown property "${b}"`));continue}C=f}_=_.concat(C({key:(t&&`${t}.`)+b,value:r[b],valueSpec:I,style:p,styleSpec:d,object:r,objectKey:b,validateSpec:f},r))}for(const b in a)o[b]||a[b].required&&a[b].default===void 0&&r[b]===void 0&&_.push(new ft(t,r,`missing required property "${b}"`));return _}function Ts(i){const t=i.value,r=i.valueSpec,a=i.style,o=i.styleSpec,p=i.key,d=i.arrayElementValidator||i.validateSpec;if(Qt(t)!=="array")return[new ft(p,t,`array expected, ${Qt(t)} found`)];if(r.length&&t.length!==r.length)return[new ft(p,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new ft(p,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let f={type:r.value,values:r.values};o.$version<7&&(f.function=r.function),Qt(r.value)==="object"&&(f=r.value);let _=[];for(let x=0;x<t.length;x++)_=_.concat(d({array:t,arrayIndex:x,value:t[x],valueSpec:f,validateSpec:i.validateSpec,style:a,styleSpec:o,key:`${p}[${x}]`}));return _}function Ws(i){const t=i.key,r=i.value,a=i.valueSpec;let o=Qt(r);return o==="number"&&r!=r&&(o="NaN"),o!=="number"?[new ft(t,r,`number expected, ${o} found`)]:"minimum"in a&&r<a.minimum?[new ft(t,r,`${r} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&r>a.maximum?[new ft(t,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function Ra(i){const t=i.valueSpec,r=we(i.value.type);let a,o,p,d={};const f=r!=="categorical"&&i.value.property===void 0,_=!f,x=Qt(i.value.stops)==="array"&&Qt(i.value.stops[0])==="array"&&Qt(i.value.stops[0][0])==="object",b=pi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(C){if(r==="identity")return[new ft(C.key,C.value,'identity function may not have a "stops" property')];let E=[];const D=C.value;return E=E.concat(Ts({key:C.key,value:D,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:T})),Qt(D)==="array"&&D.length===0&&E.push(new ft(C.key,D,"array must have at least one stop")),E},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:t,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return r==="identity"&&f&&b.push(new ft(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new ft(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!xn(i.valueSpec)&&b.push(new ft(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!Ss(i.valueSpec)?b.push(new ft(i.key,i.value,"property functions not supported")):f&&!wo(i.valueSpec)&&b.push(new ft(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||b.push(new ft(i.key,i.value,'"property" property is required')),b;function T(C){let E=[];const D=C.value,V=C.key;if(Qt(D)!=="array")return[new ft(V,D,`array expected, ${Qt(D)} found`)];if(D.length!==2)return[new ft(V,D,`array length 2 expected, length ${D.length} found`)];if(x){if(Qt(D[0])!=="object")return[new ft(V,D,`object expected, ${Qt(D[0])} found`)];if(D[0].zoom===void 0)return[new ft(V,D,"object stop key must have zoom")];if(D[0].value===void 0)return[new ft(V,D,"object stop key must have value")];if(p&&p>we(D[0].zoom))return[new ft(V,D[0].zoom,"stop zoom values must appear in ascending order")];we(D[0].zoom)!==p&&(p=we(D[0].zoom),o=void 0,d={}),E=E.concat(pi({key:`${V}[0]`,value:D[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:Ws,value:I}}))}else E=E.concat(I({key:`${V}[0]`,value:D[0],valueSpec:{},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},D));return ka(Kr(D[1]))?E.concat([new ft(`${V}[1]`,D[1],"expressions are not allowed in function stops.")]):E.concat(C.validateSpec({key:`${V}[1]`,value:D[1],valueSpec:t,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function I(C,E){const D=Qt(C.value),V=we(C.value),$=C.value!==null?C.value:E;if(a){if(D!==a)return[new ft(C.key,$,`${D} stop domain type must match previous stop domain type ${a}`)]}else a=D;if(D!=="number"&&D!=="string"&&D!=="boolean")return[new ft(C.key,$,"stop domain value must be a number, string, or boolean")];if(D!=="number"&&r!=="categorical"){let J=`number expected, ${D} found`;return Ss(t)&&r===void 0&&(J+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ft(C.key,$,J)]}return r!=="categorical"||D!=="number"||isFinite(V)&&Math.floor(V)===V?r!=="categorical"&&D==="number"&&o!==void 0&&V<o?[new ft(C.key,$,"stop domain values must appear in ascending order")]:(o=V,r==="categorical"&&V in d?[new ft(C.key,$,"stop domain values must be unique")]:(d[V]=!0,[])):[new ft(C.key,$,`integer expected, found ${V}`)]}}function Wr(i){const t=(i.expressionContext==="property"?wn:Ma)(Kr(i.value),i.valueSpec);if(t.result==="error")return t.value.map(a=>new ft(`${i.key}${a.key}`,i.value,a.message));const r=t.value.expression||t.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new ft(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Gs(r))return[new ft(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Gs(r))return[new ft(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Ta(r,["zoom","feature-state"]))return[new ft(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Sa(r))return[new ft(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ys(i){const t=i.key,r=i.value,a=i.valueSpec,o=[];return Array.isArray(a.values)?a.values.indexOf(we(r))===-1&&o.push(new ft(t,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(we(r))===-1&&o.push(new ft(t,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function As(i){return Js(Kr(i.value))?Wr(Qi({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Po(i)}function Po(i){const t=i.value,r=i.key;if(Qt(t)!=="array")return[new ft(r,t,`array expected, ${Qt(t)} found`)];const a=i.styleSpec;let o,p=[];if(t.length<1)return[new ft(r,t,"filter array must have at least 1 element")];switch(p=p.concat(Ys({key:`${r}[0]`,value:t[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),we(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&we(t[1])==="$type"&&p.push(new ft(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&p.push(new ft(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(o=Qt(t[1]),o!=="string"&&p.push(new ft(`${r}[1]`,t[1],`string expected, ${o} found`)));for(let d=2;d<t.length;d++)o=Qt(t[d]),we(t[1])==="$type"?p=p.concat(Ys({key:`${r}[${d}]`,value:t[d],valueSpec:a.geometry_type,style:i.style,styleSpec:i.styleSpec})):o!=="string"&&o!=="number"&&o!=="boolean"&&p.push(new ft(`${r}[${d}]`,t[d],`string, number, or boolean expected, ${o} found`));break;case"any":case"all":case"none":for(let d=1;d<t.length;d++)p=p.concat(Po({key:`${r}[${d}]`,value:t[d],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":o=Qt(t[1]),t.length!==2?p.push(new ft(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):o!=="string"&&p.push(new ft(`${r}[1]`,t[1],`string expected, ${o} found`));break;case"within":o=Qt(t[1]),t.length!==2?p.push(new ft(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):o!=="object"&&p.push(new ft(`${r}[1]`,t[1],`object expected, ${o} found`))}return p}function Co(i,t){const r=i.key,a=i.validateSpec,o=i.style,p=i.styleSpec,d=i.value,f=i.objectKey,_=p[`${t}_${i.layerType}`];if(!_)return[];const x=f.match(/^(.*)-transition$/);if(t==="paint"&&x&&_[x[1]]&&_[x[1]].transition)return a({key:r,value:d,valueSpec:p.transition,style:o,styleSpec:p});const b=i.valueSpec||_[f];if(!b)return[new ft(r,d,`unknown property "${f}"`)];let T;if(Qt(d)==="string"&&Ss(b)&&!b.tokens&&(T=/^{([^}]+)}$/.exec(d)))return[new ft(r,d,`"${f}" does not support interpolation syntax
2
+ Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(T[1])} }\`.`)];const I=[];return i.layerType==="symbol"&&(f==="text-field"&&o&&!o.glyphs&&I.push(new ft(r,d,'use of "text-field" requires a style "glyphs" property')),f==="text-font"&&_e(Kr(d))&&we(d.type)==="identity"&&I.push(new ft(r,d,'"text-font" does not support identity functions'))),I.concat(a({key:i.key,value:d,valueSpec:b,style:o,styleSpec:p,expressionContext:"property",propertyType:t,propertyKey:f}))}function Eo(i){return Co(i,"paint")}function ko(i){return Co(i,"layout")}function Mo(i){let t=[];const r=i.value,a=i.key,o=i.style,p=i.styleSpec;r.type||r.ref||t.push(new ft(a,r,'either "type" or "ref" is required'));let d=we(r.type);const f=we(r.ref);if(r.id){const _=we(r.id);for(let x=0;x<i.arrayIndex;x++){const b=o.layers[x];we(b.id)===_&&t.push(new ft(a,r.id,`duplicate layer id "${r.id}", previously used at line ${b.id.__line__}`))}}if("ref"in r){let _;["type","source","source-layer","filter","layout"].forEach(x=>{x in r&&t.push(new ft(a,r[x],`"${x}" is prohibited for ref layers`))}),o.layers.forEach(x=>{we(x.id)===f&&(_=x)}),_?_.ref?t.push(new ft(a,r.ref,"ref cannot reference another ref layer")):d=we(_.type):t.push(new ft(a,r.ref,`ref layer "${f}" not found`))}else if(d!=="background")if(r.source){const _=o.sources&&o.sources[r.source],x=_&&we(_.type);_?x==="vector"&&d==="raster"?t.push(new ft(a,r.source,`layer "${r.id}" requires a raster source`)):x!=="raster-dem"&&d==="hillshade"?t.push(new ft(a,r.source,`layer "${r.id}" requires a raster-dem source`)):x==="raster"&&d!=="raster"?t.push(new ft(a,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&d!=="hillshade"?t.push(new ft(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&_.lineMetrics||t.push(new ft(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ft(a,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new ft(a,r.source,`source "${r.source}" not found`))}else t.push(new ft(a,r,'missing required property "source"'));return t=t.concat(pi({key:a,value:r,valueSpec:p.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:p.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:As,layout:_=>pi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>ko(Qi({layerType:d},x))}}),paint:_=>pi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>Eo(Qi({layerType:d},x))}})}})),t}function er(i){const t=i.value,r=i.key,a=Qt(t);return a!=="string"?[new ft(r,t,`string expected, ${a} found`)]:[]}const Qs={promoteId:function({key:i,value:t}){if(Qt(t)==="string")return er({key:i,value:t});{const r=[];for(const a in t)r.push(...er({key:`${i}.${a}`,value:t[a]}));return r}}};function Ti(i){const t=i.value,r=i.key,a=i.styleSpec,o=i.style,p=i.validateSpec;if(!t.type)return[new ft(r,t,'"type" is required')];const d=we(t.type);let f;switch(d){case"vector":case"raster":return f=pi({key:r,value:t,valueSpec:a[`source_${d.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:Qs,validateSpec:p}),f;case"raster-dem":return f=function(_){var x;const b=(x=_.sourceName)!==null&&x!==void 0?x:"",T=_.value,I=_.styleSpec,C=I.source_raster_dem,E=_.style;let D=[];const V=Qt(T);if(T===void 0)return D;if(V!=="object")return D.push(new ft("source_raster_dem",T,`object expected, ${V} found`)),D;const $=we(T.encoding)==="custom",J=["redFactor","greenFactor","blueFactor","baseShift"],j=_.value.encoding?`"${_.value.encoding}"`:"Default";for(const W in T)!$&&J.includes(W)?D.push(new ft(W,T[W],`In "${b}": "${W}" is only valid when "encoding" is set to "custom". ${j} encoding found`)):C[W]?D=D.concat(_.validateSpec({key:W,value:T[W],valueSpec:C[W],validateSpec:_.validateSpec,style:E,styleSpec:I})):D.push(new ft(W,T[W],`unknown property "${W}"`));return D}({sourceName:r,value:t,style:i.style,styleSpec:a,validateSpec:p}),f;case"geojson":if(f=pi({key:r,value:t,valueSpec:a.source_geojson,style:o,styleSpec:a,validateSpec:p,objectElementValidators:Qs}),t.cluster)for(const _ in t.clusterProperties){const[x,b]=t.clusterProperties[_],T=typeof x=="string"?[x,["accumulated"],["get",_]]:x;f.push(...Wr({key:`${r}.${_}.map`,value:b,validateSpec:p,expressionContext:"cluster-map"})),f.push(...Wr({key:`${r}.${_}.reduce`,value:T,validateSpec:p,expressionContext:"cluster-reduce"}))}return f;case"video":return pi({key:r,value:t,valueSpec:a.source_video,style:o,validateSpec:p,styleSpec:a});case"image":return pi({key:r,value:t,valueSpec:a.source_image,style:o,validateSpec:p,styleSpec:a});case"canvas":return[new ft(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ys({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:o,validateSpec:p,styleSpec:a})}}function ta(i){const t=i.value,r=i.styleSpec,a=r.light,o=i.style;let p=[];const d=Qt(t);if(t===void 0)return p;if(d!=="object")return p=p.concat([new ft("light",t,`object expected, ${d} found`)]),p;for(const f in t){const _=f.match(/^(.*)-transition$/);p=p.concat(_&&a[_[1]]&&a[_[1]].transition?i.validateSpec({key:f,value:t[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:o,styleSpec:r}):a[f]?i.validateSpec({key:f,value:t[f],valueSpec:a[f],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new ft(f,t[f],`unknown property "${f}"`)])}return p}function Do(i){const t=i.value,r=i.styleSpec,a=r.terrain,o=i.style;let p=[];const d=Qt(t);if(t===void 0)return p;if(d!=="object")return p=p.concat([new ft("terrain",t,`object expected, ${d} found`)]),p;for(const f in t)p=p.concat(a[f]?i.validateSpec({key:f,value:t[f],valueSpec:a[f],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new ft(f,t[f],`unknown property "${f}"`)]);return p}function Lo(i){let t=[];const r=i.value,a=i.key;if(Array.isArray(r)){const o=[],p=[];for(const d in r)r[d].id&&o.includes(r[d].id)&&t.push(new ft(a,r,`all the sprites' ids must be unique, but ${r[d].id} is duplicated`)),o.push(r[d].id),r[d].url&&p.includes(r[d].url)&&t.push(new ft(a,r,`all the sprites' URLs must be unique, but ${r[d].url} is duplicated`)),p.push(r[d].url),t=t.concat(pi({key:`${a}[${d}]`,value:r[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return t}return er({key:a,value:r})}const Bo={"*":()=>[],array:Ts,boolean:function(i){const t=i.value,r=i.key,a=Qt(t);return a!=="boolean"?[new ft(r,t,`boolean expected, ${a} found`)]:[]},number:Ws,color:function(i){const t=i.key,r=i.value,a=Qt(r);return a!=="string"?[new ft(t,r,`color expected, ${a} found`)]:ie.parse(String(r))?[]:[new ft(t,r,`color expected, "${r}" found`)]},constants:zo,enum:Ys,filter:As,function:Ra,layer:Mo,object:pi,source:Ti,light:ta,terrain:Do,string:er,formatted:function(i){return er(i).length===0?[]:Wr(i)},resolvedImage:function(i){return er(i).length===0?[]:Wr(i)},padding:function(i){const t=i.key,r=i.value;if(Qt(r)==="array"){if(r.length<1||r.length>4)return[new ft(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const a={type:"number"};let o=[];for(let p=0;p<r.length;p++)o=o.concat(i.validateSpec({key:`${t}[${p}]`,value:r[p],validateSpec:i.validateSpec,valueSpec:a}));return o}return Ws({key:t,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(i){const t=i.key,r=i.value,a=Qt(r),o=i.styleSpec;if(a!=="array"||r.length<1||r.length%2!=0)return[new ft(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let p=[];for(let d=0;d<r.length;d+=2)p=p.concat(Ys({key:`${t}[${d}]`,value:r[d],valueSpec:o.layout_symbol["text-anchor"]})),p=p.concat(Ts({key:`${t}[${d+1}]`,value:r[d+1],valueSpec:{length:2,value:"number"},validateSpec:i.validateSpec,style:i.style,styleSpec:o}));return p},sprite:Lo};function fr(i){const t=i.value,r=i.valueSpec,a=i.styleSpec;return i.validateSpec=fr,r.expression&&_e(we(t))?Ra(i):r.expression&&ka(Kr(t))?Wr(i):r.type&&Bo[r.type]?Bo[r.type](i):pi(Qi({},i,{valueSpec:r.type?a[r.type]:r}))}function Fo(i){const t=i.value,r=i.key,a=er(i);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new ft(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new ft(r,t,'"glyphs" url must include a "{range}" token'))),a}function Oi(i,t=rt){let r=[];return r=r.concat(fr({key:"",value:i,valueSpec:t.$root,styleSpec:t,style:i,validateSpec:fr,objectElementValidators:{glyphs:Fo,"*":()=>[]}})),i.constants&&(r=r.concat(zo({key:"constants",value:i.constants,style:i,styleSpec:t,validateSpec:fr}))),Oa(r)}function mr(i){return function(t){return i({...t,validateSpec:fr})}}function Oa(i){return[].concat(i).sort((t,r)=>t.line-r.line)}function gr(i){return function(...t){return Oa(i.apply(this,t))}}Oi.source=gr(mr(Ti)),Oi.sprite=gr(mr(Lo)),Oi.glyphs=gr(mr(Fo)),Oi.light=gr(mr(ta)),Oi.terrain=gr(mr(Do)),Oi.layer=gr(mr(Mo)),Oi.filter=gr(mr(As)),Oi.paintProperty=gr(mr(Eo)),Oi.layoutProperty=gr(mr(ko));const _r=Oi,kl=_r.light,An=_r.paintProperty,Ro=_r.layoutProperty;function Va(i,t){let r=!1;if(t&&t.length)for(const a of t)i.fire(new Cr(new Error(a.message))),r=!0;return r}class Is{constructor(t,r,a){const o=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const d=new Int32Array(this.arrayBuffer);t=d[0],this.d=(r=d[1])+2*(a=d[2]);for(let _=0;_<this.d*this.d;_++){const x=d[3+_],b=d[3+_+1];o.push(x===b?null:d.subarray(x,b))}const f=d[3+o.length+1];this.keys=d.subarray(d[3+o.length],f),this.bboxes=d.subarray(f),this.insert=this._insertReadonly}else{this.d=r+2*a;for(let d=0;d<this.d*this.d;d++)o.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=a,this.scale=r/t,this.uid=0;const p=a/r*t;this.min=-p,this.max=t+p}insert(t,r,a,o,p){this._forEachCell(r,a,o,p,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(o),this.bboxes.push(p)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,r,a,o,p,d){this.cells[p].push(d)}query(t,r,a,o,p){const d=this.min,f=this.max;if(t<=d&&r<=d&&f<=a&&f<=o&&!p)return Array.prototype.slice.call(this.keys);{const _=[];return this._forEachCell(t,r,a,o,this._queryCell,_,{},p),_}}_queryCell(t,r,a,o,p,d,f,_){const x=this.cells[p];if(x!==null){const b=this.keys,T=this.bboxes;for(let I=0;I<x.length;I++){const C=x[I];if(f[C]===void 0){const E=4*C;(_?_(T[E+0],T[E+1],T[E+2],T[E+3]):t<=T[E+2]&&r<=T[E+3]&&a>=T[E+0]&&o>=T[E+1])?(f[C]=!0,d.push(b[C])):f[C]=!1}}}}_forEachCell(t,r,a,o,p,d,f,_){const x=this._convertToCellCoord(t),b=this._convertToCellCoord(r),T=this._convertToCellCoord(a),I=this._convertToCellCoord(o);for(let C=x;C<=T;C++)for(let E=b;E<=I;E++){const D=this.d*E+C;if((!_||_(this._convertFromCellCoord(C),this._convertFromCellCoord(E),this._convertFromCellCoord(C+1),this._convertFromCellCoord(E+1)))&&p.call(this,t,r,a,o,D,d,f,_))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,r=3+this.cells.length+1+1;let a=0;for(let d=0;d<this.cells.length;d++)a+=this.cells[d].length;const o=new Int32Array(r+a+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;let p=r;for(let d=0;d<t.length;d++){const f=t[d];o[3+d]=p,o.set(f,p),p+=f.length}return o[3+t.length]=p,o.set(this.keys,p),p+=this.keys.length,o[3+t.length+1]=p,o.set(this.bboxes,p),p+=this.bboxes.length,o.buffer}static serialize(t,r){const a=t.toArrayBuffer();return r&&r.push(a),{buffer:a}}static deserialize(t){return new Is(t.buffer)}}const yr={};function wt(i,t,r={}){if(yr[i])throw new Error(`${i} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:i,writeable:!1}),yr[i]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}wt("Object",Object),wt("TransferableGridIndex",Is),wt("Color",ie),wt("Error",Error),wt("AJAXError",Ir),wt("ResolvedImage",je),wt("StylePropertyFunction",Xs),wt("StyleExpression",vn,{omit:["_evaluator"]}),wt("ZoomDependentExpression",Da),wt("ZoomConstantExpression",bn),wt("CompoundExpression",Ri,{omit:["_evaluate"]});for(const i in ws)ws[i]._classRegistryKey||wt(`Expression_${i}`,ws[i]);function Ua(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function Br(i,t){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob)return i;if(Ua(i)||Us(i))return t&&t.push(i),i;if(ArrayBuffer.isView(i)){const r=i;return t&&t.push(r.buffer),r}if(i instanceof ImageData)return t&&t.push(i.data.buffer),i;if(Array.isArray(i)){const r=[];for(const a of i)r.push(Br(a,t));return r}if(typeof i=="object"){const r=i.constructor,a=r._classRegistryKey;if(!a)throw new Error("can't serialize object of unregistered class");if(!yr[a])throw new Error(`${a} is not registered.`);const o=r.serialize?r.serialize(i,t):{};if(r.serialize){if(t&&o===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const p in i){if(!i.hasOwnProperty(p)||yr[a].omit.indexOf(p)>=0)continue;const d=i[p];o[p]=yr[a].shallow.indexOf(p)>=0?d:Br(d,t)}i instanceof Error&&(o.message=i.message)}if(o.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(o.$name=a),o}throw new Error("can't serialize object of type "+typeof i)}function zs(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Ua(i)||Us(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(zs);if(typeof i=="object"){const t=i.$name||"Object";if(!yr[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=yr[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const o of Object.keys(i)){if(o==="$name")continue;const p=i[o];a[o]=yr[t].shallow.indexOf(o)>=0?p:zs(p)}return a}throw new Error("can't deserialize object of type "+typeof i)}class Oo{constructor(){this.first=!0}update(t,r){const a=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<a&&(this.lastIntegerZoom=a,this.lastIntegerZoomTime=r),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=a,!0))}}const vt={"Latin-1 Supplement":i=>i>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function In(i){for(const t of i)if(Pn(t.charCodeAt(0)))return!0;return!1}function zn(i){for(const t of i)if(!Ml(t.charCodeAt(0)))return!1;return!0}function Ml(i){return!(vt.Arabic(i)||vt["Arabic Supplement"](i)||vt["Arabic Extended-A"](i)||vt["Arabic Presentation Forms-A"](i)||vt["Arabic Presentation Forms-B"](i))}function Pn(i){return!(i!==746&&i!==747&&(i<4352||!(vt["Bopomofo Extended"](i)||vt.Bopomofo(i)||vt["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||vt["CJK Compatibility Ideographs"](i)||vt["CJK Compatibility"](i)||vt["CJK Radicals Supplement"](i)||vt["CJK Strokes"](i)||!(!vt["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||vt["CJK Unified Ideographs Extension A"](i)||vt["CJK Unified Ideographs"](i)||vt["Enclosed CJK Letters and Months"](i)||vt["Hangul Compatibility Jamo"](i)||vt["Hangul Jamo Extended-A"](i)||vt["Hangul Jamo Extended-B"](i)||vt["Hangul Jamo"](i)||vt["Hangul Syllables"](i)||vt.Hiragana(i)||vt["Ideographic Description Characters"](i)||vt.Kanbun(i)||vt["Kangxi Radicals"](i)||vt["Katakana Phonetic Extensions"](i)||vt.Katakana(i)&&i!==12540||!(!vt["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!vt["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||vt["Unified Canadian Aboriginal Syllabics"](i)||vt["Unified Canadian Aboriginal Syllabics Extended"](i)||vt["Vertical Forms"](i)||vt["Yijing Hexagram Symbols"](i)||vt["Yi Syllables"](i)||vt["Yi Radicals"](i))))}function Vo(i){return!(Pn(i)||function(t){return!!(vt["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||vt["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||vt["Letterlike Symbols"](t)||vt["Number Forms"](t)||vt["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||vt["Control Pictures"](t)&&t!==9251||vt["Optical Character Recognition"](t)||vt["Enclosed Alphanumerics"](t)||vt["Geometric Shapes"](t)||vt["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||vt["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||vt["CJK Symbols and Punctuation"](t)||vt.Katakana(t)||vt["Private Use Area"](t)||vt["CJK Compatibility Forms"](t)||vt["Small Form Variants"](t)||vt["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(i))}function Uo(i){return i>=1424&&i<=2303||vt["Arabic Presentation Forms-A"](i)||vt["Arabic Presentation Forms-B"](i)}function No(i,t){return!(!t&&Uo(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||vt.Khmer(i))}function Dl(i){for(const t of i)if(Uo(t.charCodeAt(0)))return!0;return!1}const Cn="deferred",En="loading",kn="loaded";let Mn=null,di="unavailable",Fr=null;const ea=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(di="error"),Mn&&Mn(i)};function Dn(){ia.fire(new Pr("pluginStateChange",{pluginStatus:di,pluginURL:Fr}))}const ia=new qr,Ln=function(){return di},$o=function(){if(di!==Cn||!Fr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");di=En,Dn(),Fr&&qs({url:Fr},i=>{i?ea(i):(di=kn,Dn())})},Ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>di===kn||Ai.applyArabicShaping!=null,isLoading:()=>di===En,setState(i){if(!ki())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");di=i.pluginStatus,Fr=i.pluginURL},isParsed(){if(!ki())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ai.applyArabicShaping!=null&&Ai.processBidirectionalText!=null&&Ai.processStyledBidirectionalText!=null},getPluginURL(){if(!ki())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Fr}};class he{constructor(t,r){this.zoom=t,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Oo,this.transition={})}isSupportedScript(t){return function(r,a){for(const o of r)if(!No(o.charCodeAt(0),a))return!1;return!0}(t,Ai.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,r=t-Math.floor(t),a=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class Na{constructor(t,r){this.property=t,this.value=r,this.expression=function(a,o){if(_e(a))return new Xs(a,o);if(ka(a)){const p=wn(a,o);if(p.result==="error")throw new Error(p.value.map(d=>`${d.key}: ${d.message}`).join(", "));return p.value}{let p=a;return o.type==="color"&&typeof a=="string"?p=ie.parse(a):o.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?o.type==="variableAnchorOffsetCollection"&&Array.isArray(a)&&(p=Bi.parse(a)):p=bi.parse(a),{kind:"constant",evaluate:()=>p}}}(r===void 0?t.specification.default:r,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,r,a){return this.property.possiblyEvaluate(this,t,r,a)}}class Bn{constructor(t){this.property=t,this.value=new Na(t,void 0)}transitioned(t,r){return new jo(this.property,this.value,r,$e({},t.transition,this.transition),t.now)}untransitioned(){return new jo(this.property,this.value,null,{},0)}}class qo{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return $i(this._values[t].value.value)}setValue(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Bn(this._values[t].property)),this._values[t].value=new Na(this._values[t].property,r===null?void 0:$i(r))}getTransition(t){return $i(this._values[t].transition)}setTransition(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Bn(this._values[t].property)),this._values[t].transition=$i(r)||void 0}serialize(){const t={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(t[r]=a);const o=this.getTransition(r);o!==void 0&&(t[`${r}-transition`]=o)}return t}transitioned(t,r){const a=new Go(this._properties);for(const o of Object.keys(this._values))a._values[o]=this._values[o].transitioned(t,r._values[o]);return a}untransitioned(){const t=new Go(this._properties);for(const r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}}class jo{constructor(t,r,a,o,p){this.property=t,this.value=r,this.begin=p+o.delay||0,this.end=this.begin+o.duration||0,t.specification.transition&&(o.delay||o.duration)&&(this.prior=a)}possiblyEvaluate(t,r,a){const o=t.now||0,p=this.value.possiblyEvaluate(t,r,a),d=this.prior;if(d){if(o>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(o<this.begin)return d.possiblyEvaluate(t,r,a);{const f=(o-this.begin)/(this.end-this.begin);return this.property.interpolate(d.possiblyEvaluate(t,r,a),p,function(_){if(_<=0)return 0;if(_>=1)return 1;const x=_*_,b=x*_;return 4*(_<.5?b:3*(_-x)+b-.75)}(f))}}return p}}class Go{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,a){const o=new $a(this._properties);for(const p of Object.keys(this._values))o._values[p]=this._values[p].possiblyEvaluate(t,r,a);return o}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class Ll{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return this._values[t].value!==void 0}getValue(t){return $i(this._values[t].value)}setValue(t,r){this._values[t]=new Na(this._values[t].property,r===null?void 0:$i(r))}serialize(){const t={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(t[r]=a)}return t}possiblyEvaluate(t,r,a){const o=new $a(this._properties);for(const p of Object.keys(this._values))o._values[p]=this._values[p].possiblyEvaluate(t,r,a);return o}}class ri{constructor(t,r,a){this.property=t,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,r,a,o){return this.property.evaluate(this.value,this.parameters,t,r,a,o)}}class $a{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Ct{constructor(t){this.specification=t}possiblyEvaluate(t,r){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,a){const o=wi[this.specification.type];return o?o(t,r,a):t}}class Dt{constructor(t,r){this.specification=t,this.overrides=r}possiblyEvaluate(t,r,a,o){return new ri(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(r,null,{},a,o)}:t.expression,r)}interpolate(t,r,a){if(t.value.kind!=="constant"||r.value.kind!=="constant")return t;if(t.value.value===void 0||r.value.value===void 0)return new ri(this,{kind:"constant",value:void 0},t.parameters);const o=wi[this.specification.type];if(o){const p=o(t.value.value,r.value.value,a);return new ri(this,{kind:"constant",value:p},t.parameters)}return t}evaluate(t,r,a,o,p,d){return t.kind==="constant"?t.value:t.evaluate(r,a,o,p,d)}}class ra extends Dt{possiblyEvaluate(t,r,a,o){if(t.value===void 0)return new ri(this,{kind:"constant",value:void 0},r);if(t.expression.kind==="constant"){const p=t.expression.evaluate(r,null,{},a,o),d=t.property.specification.type==="resolvedImage"&&typeof p!="string"?p.name:p,f=this._calculate(d,d,d,r);return new ri(this,{kind:"constant",value:f},r)}if(t.expression.kind==="camera"){const p=this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r);return new ri(this,{kind:"constant",value:p},r)}return new ri(this,t.expression,r)}evaluate(t,r,a,o,p,d){if(t.kind==="source"){const f=t.evaluate(r,a,o,p,d);return this._calculate(f,f,f,r)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},a,o),t.evaluate({zoom:Math.floor(r.zoom)},a,o),t.evaluate({zoom:Math.floor(r.zoom)+1},a,o),r):t.value}_calculate(t,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:a,to:r}}interpolate(t){return t}}class Fn{constructor(t){this.specification=t}possiblyEvaluate(t,r,a,o){if(t.value!==void 0){if(t.expression.kind==="constant"){const p=t.expression.evaluate(r,null,{},a,o);return this._calculate(p,p,p,r)}return this._calculate(t.expression.evaluate(new he(Math.floor(r.zoom-1),r)),t.expression.evaluate(new he(Math.floor(r.zoom),r)),t.expression.evaluate(new he(Math.floor(r.zoom+1),r)),r)}}_calculate(t,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:a,to:r}}interpolate(t){return t}}class Rn{constructor(t){this.specification=t}possiblyEvaluate(t,r,a,o){return!!t.expression.evaluate(r,null,{},a,o)}interpolate(){return!1}}class ze{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in t){const a=t[r];a.specification.overridable&&this.overridableProperties.push(r);const o=this.defaultPropertyValues[r]=new Na(a,void 0),p=this.defaultTransitionablePropertyValues[r]=new Bn(a);this.defaultTransitioningPropertyValues[r]=p.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=o.possiblyEvaluate({})}}}wt("DataDrivenProperty",Dt),wt("DataConstantProperty",Ct),wt("CrossFadedDataDrivenProperty",ra),wt("CrossFadedProperty",Fn),wt("ColorRampProperty",Rn);const On="-transition";class Vi extends qr{constructor(t,r){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new Ll(r.layout)),r.paint)){this._transitionablePaint=new qo(r.paint);for(const a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(const a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new $a(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,r,a={}){r!=null&&this._validate(Ro,`layers.${this.id}.layout.${t}`,t,r,a)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,r):this.visibility=r)}getPaintProperty(t){return t.endsWith(On)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,r,a={}){if(r!=null&&this._validate(An,`layers.${this.id}.paint.${t}`,t,r,a))return!1;if(t.endsWith(On))return this._transitionablePaint.setTransition(t.slice(0,-11),r||void 0),!1;{const o=this._transitionablePaint._values[t],p=o.property.specification["property-type"]==="cross-faded-data-driven",d=o.value.isDataDriven(),f=o.value;this._transitionablePaint.setValue(t,r),this._handleSpecialPaintPropertyUpdate(t);const _=this._transitionablePaint._values[t].value;return _.isDataDriven()||d||p||this._handleOverridablePaintPropertyUpdate(t,f,_)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,r,a){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,r){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,r)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),cs(t,(r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length))}_validate(t,r,a,o,p={}){return(!p||p.validate!==!1)&&Va(this,t.call(_r,{key:r,layerType:this.type,objectKey:a,value:o,styleSpec:rt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const r=this.paint.get(t);if(r instanceof ri&&Ss(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const Zo={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Yr{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Se{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function xe(i,t=1){let r=0,a=0;return{members:i.map(o=>{const p=Zo[o.type].BYTES_PER_ELEMENT,d=r=Ps(r,Math.max(t,p)),f=o.components||1;return a=Math.max(a,p),r+=p*f,{name:o.name,type:o.type,components:f,offset:d}}),size:Ps(r,Math.max(a,t)),alignment:t}}function Ps(i,t){return Math.ceil(i/t)*t}class sa extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r){const a=this.length;return this.resize(a+1),this.emplace(a,t,r)}emplace(t,r,a){const o=2*t;return this.int16[o+0]=r,this.int16[o+1]=a,t}}sa.prototype.bytesPerElement=4,wt("StructArrayLayout2i4",sa);class aa extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,r,a)}emplace(t,r,a,o){const p=3*t;return this.int16[p+0]=r,this.int16[p+1]=a,this.int16[p+2]=o,t}}aa.prototype.bytesPerElement=6,wt("StructArrayLayout3i6",aa);class Qr extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,o){const p=this.length;return this.resize(p+1),this.emplace(p,t,r,a,o)}emplace(t,r,a,o,p){const d=4*t;return this.int16[d+0]=r,this.int16[d+1]=a,this.int16[d+2]=o,this.int16[d+3]=p,t}}Qr.prototype.bytesPerElement=8,wt("StructArrayLayout4i8",Qr);class Vn extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,o,p,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,a,o,p,d)}emplace(t,r,a,o,p,d,f){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=p,this.int16[_+4]=d,this.int16[_+5]=f,t}}Vn.prototype.bytesPerElement=12,wt("StructArrayLayout2i4i12",Vn);class Un extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,o,p,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,a,o,p,d)}emplace(t,r,a,o,p,d,f){const _=4*t,x=8*t;return this.int16[_+0]=r,this.int16[_+1]=a,this.uint8[x+4]=o,this.uint8[x+5]=p,this.uint8[x+6]=d,this.uint8[x+7]=f,t}}Un.prototype.bytesPerElement=8,wt("StructArrayLayout2i4ub8",Un);class Cs extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r){const a=this.length;return this.resize(a+1),this.emplace(a,t,r)}emplace(t,r,a){const o=2*t;return this.float32[o+0]=r,this.float32[o+1]=a,t}}Cs.prototype.bytesPerElement=8,wt("StructArrayLayout2f8",Cs);class Nn extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a,o,p,d,f,_,x,b){const T=this.length;return this.resize(T+1),this.emplace(T,t,r,a,o,p,d,f,_,x,b)}emplace(t,r,a,o,p,d,f,_,x,b,T){const I=10*t;return this.uint16[I+0]=r,this.uint16[I+1]=a,this.uint16[I+2]=o,this.uint16[I+3]=p,this.uint16[I+4]=d,this.uint16[I+5]=f,this.uint16[I+6]=_,this.uint16[I+7]=x,this.uint16[I+8]=b,this.uint16[I+9]=T,t}}Nn.prototype.bytesPerElement=20,wt("StructArrayLayout10ui20",Nn);class $n extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a,o,p,d,f,_,x,b,T,I){const C=this.length;return this.resize(C+1),this.emplace(C,t,r,a,o,p,d,f,_,x,b,T,I)}emplace(t,r,a,o,p,d,f,_,x,b,T,I,C){const E=12*t;return this.int16[E+0]=r,this.int16[E+1]=a,this.int16[E+2]=o,this.int16[E+3]=p,this.uint16[E+4]=d,this.uint16[E+5]=f,this.uint16[E+6]=_,this.uint16[E+7]=x,this.int16[E+8]=b,this.int16[E+9]=T,this.int16[E+10]=I,this.int16[E+11]=C,t}}$n.prototype.bytesPerElement=24,wt("StructArrayLayout4i4ui4i24",$n);class te extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,r,a)}emplace(t,r,a,o){const p=3*t;return this.float32[p+0]=r,this.float32[p+1]=a,this.float32[p+2]=o,t}}te.prototype.bytesPerElement=12,wt("StructArrayLayout3f12",te);class h extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint32[1*t+0]=r,t}}h.prototype.bytesPerElement=4,wt("StructArrayLayout1ul4",h);class e extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a,o,p,d,f,_,x){const b=this.length;return this.resize(b+1),this.emplace(b,t,r,a,o,p,d,f,_,x)}emplace(t,r,a,o,p,d,f,_,x,b){const T=10*t,I=5*t;return this.int16[T+0]=r,this.int16[T+1]=a,this.int16[T+2]=o,this.int16[T+3]=p,this.int16[T+4]=d,this.int16[T+5]=f,this.uint32[I+3]=_,this.uint16[T+8]=x,this.uint16[T+9]=b,t}}e.prototype.bytesPerElement=20,wt("StructArrayLayout6i1ul2ui20",e);class s extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,o,p,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,a,o,p,d)}emplace(t,r,a,o,p,d,f){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=p,this.int16[_+4]=d,this.int16[_+5]=f,t}}s.prototype.bytesPerElement=12,wt("StructArrayLayout2i2i2i12",s);class n extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,o,p){const d=this.length;return this.resize(d+1),this.emplace(d,t,r,a,o,p)}emplace(t,r,a,o,p,d){const f=4*t,_=8*t;return this.float32[f+0]=r,this.float32[f+1]=a,this.float32[f+2]=o,this.int16[_+6]=p,this.int16[_+7]=d,t}}n.prototype.bytesPerElement=16,wt("StructArrayLayout2f1f2i16",n);class l extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a,o){const p=this.length;return this.resize(p+1),this.emplace(p,t,r,a,o)}emplace(t,r,a,o,p){const d=12*t,f=3*t;return this.uint8[d+0]=r,this.uint8[d+1]=a,this.float32[f+1]=o,this.float32[f+2]=p,t}}l.prototype.bytesPerElement=12,wt("StructArrayLayout2ub2f12",l);class c extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,r,a)}emplace(t,r,a,o){const p=3*t;return this.uint16[p+0]=r,this.uint16[p+1]=a,this.uint16[p+2]=o,t}}c.prototype.bytesPerElement=6,wt("StructArrayLayout3ui6",c);class m extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a,o,p,d,f,_,x,b,T,I,C,E,D,V,$){const J=this.length;return this.resize(J+1),this.emplace(J,t,r,a,o,p,d,f,_,x,b,T,I,C,E,D,V,$)}emplace(t,r,a,o,p,d,f,_,x,b,T,I,C,E,D,V,$,J){const j=24*t,W=12*t,Q=48*t;return this.int16[j+0]=r,this.int16[j+1]=a,this.uint16[j+2]=o,this.uint16[j+3]=p,this.uint32[W+2]=d,this.uint32[W+3]=f,this.uint32[W+4]=_,this.uint16[j+10]=x,this.uint16[j+11]=b,this.uint16[j+12]=T,this.float32[W+7]=I,this.float32[W+8]=C,this.uint8[Q+36]=E,this.uint8[Q+37]=D,this.uint8[Q+38]=V,this.uint32[W+10]=$,this.int16[j+22]=J,t}}m.prototype.bytesPerElement=48,wt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",m);class g extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a,o,p,d,f,_,x,b,T,I,C,E,D,V,$,J,j,W,Q,ot,bt,It,xt,yt,dt,St){const mt=this.length;return this.resize(mt+1),this.emplace(mt,t,r,a,o,p,d,f,_,x,b,T,I,C,E,D,V,$,J,j,W,Q,ot,bt,It,xt,yt,dt,St)}emplace(t,r,a,o,p,d,f,_,x,b,T,I,C,E,D,V,$,J,j,W,Q,ot,bt,It,xt,yt,dt,St,mt){const ct=32*t,kt=16*t;return this.int16[ct+0]=r,this.int16[ct+1]=a,this.int16[ct+2]=o,this.int16[ct+3]=p,this.int16[ct+4]=d,this.int16[ct+5]=f,this.int16[ct+6]=_,this.int16[ct+7]=x,this.uint16[ct+8]=b,this.uint16[ct+9]=T,this.uint16[ct+10]=I,this.uint16[ct+11]=C,this.uint16[ct+12]=E,this.uint16[ct+13]=D,this.uint16[ct+14]=V,this.uint16[ct+15]=$,this.uint16[ct+16]=J,this.uint16[ct+17]=j,this.uint16[ct+18]=W,this.uint16[ct+19]=Q,this.uint16[ct+20]=ot,this.uint16[ct+21]=bt,this.uint16[ct+22]=It,this.uint32[kt+12]=xt,this.float32[kt+13]=yt,this.float32[kt+14]=dt,this.uint16[ct+30]=St,this.uint16[ct+31]=mt,t}}g.prototype.bytesPerElement=64,wt("StructArrayLayout8i15ui1ul2f2ui64",g);class y extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.float32[1*t+0]=r,t}}y.prototype.bytesPerElement=4,wt("StructArrayLayout1f4",y);class v extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,r,a)}emplace(t,r,a,o){const p=3*t;return this.uint16[6*t+0]=r,this.float32[p+1]=a,this.float32[p+2]=o,t}}v.prototype.bytesPerElement=12,wt("StructArrayLayout1ui2f12",v);class w extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,r,a)}emplace(t,r,a,o){const p=4*t;return this.uint32[2*t+0]=r,this.uint16[p+2]=a,this.uint16[p+3]=o,t}}w.prototype.bytesPerElement=8,wt("StructArrayLayout1ul2ui8",w);class S extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r){const a=this.length;return this.resize(a+1),this.emplace(a,t,r)}emplace(t,r,a){const o=2*t;return this.uint16[o+0]=r,this.uint16[o+1]=a,t}}S.prototype.bytesPerElement=4,wt("StructArrayLayout2ui4",S);class P extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint16[1*t+0]=r,t}}P.prototype.bytesPerElement=2,wt("StructArrayLayout1ui2",P);class L extends Se{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a,o){const p=this.length;return this.resize(p+1),this.emplace(p,t,r,a,o)}emplace(t,r,a,o,p){const d=4*t;return this.float32[d+0]=r,this.float32[d+1]=a,this.float32[d+2]=o,this.float32[d+3]=p,t}}L.prototype.bytesPerElement=16,wt("StructArrayLayout4f16",L);class B extends Yr{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Bt(this.anchorPointX,this.anchorPointY)}}B.prototype.size=20;class R extends e{get(t){return new B(this,t)}}wt("CollisionBoxArray",R);class M extends Yr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}M.prototype.size=48;class Z extends m{get(t){return new M(this,t)}}wt("PlacedSymbolArray",Z);class Y extends Yr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Y.prototype.size=64;class N extends g{get(t){return new Y(this,t)}}wt("SymbolInstanceArray",N);class H extends y{getoffsetX(t){return this.float32[1*t+0]}}wt("GlyphOffsetArray",H);class tt extends aa{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}wt("SymbolLineVertexArray",tt);class et extends Yr{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}et.prototype.size=12;class nt extends v{get(t){return new et(this,t)}}wt("TextAnchorOffsetArray",nt);class ht extends Yr{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}ht.prototype.size=8;class ut extends w{get(t){return new ht(this,t)}}wt("FeatureIndexArray",ut);class pt extends sa{}class At extends sa{}class jt extends sa{}class _t extends Vn{}class Lt extends Un{}class zt extends Cs{}class re extends Nn{}class qt extends $n{}class Ut extends te{}class Gt extends h{}class Te extends s{}class le extends l{}class Ge extends c{}class Le extends S{}const Pe=xe([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ii}=Pe;class ce{constructor(t=[]){this.segments=t}prepareSegment(t,r,a,o){let p=this.segments[this.segments.length-1];return t>ce.MAX_VERTEX_ARRAY_LENGTH&&ei(`Max vertices per segment is ${ce.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!p||p.vertexLength+t>ce.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==o)&&(p={vertexOffset:r.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},o!==void 0&&(p.sortKey=o),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const t of this.segments)for(const r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,a,o){return new ce([{vertexOffset:t,primitiveOffset:r,vertexLength:a,primitiveLength:o,vaos:{},sortKey:0}])}}function ir(i,t){return 256*(i=Ki(Math.floor(i),0,255))+Ki(Math.floor(t),0,255)}ce.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,wt("SegmentVector",ce);const rr=xe([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Rr={exports:{}},ts={exports:{}};ts.exports=function(i,t){var r,a,o,p,d,f,_,x;for(a=i.length-(r=3&i.length),o=t,d=3432918353,f=461845907,x=0;x<a;)_=255&i.charCodeAt(x)|(255&i.charCodeAt(++x))<<8|(255&i.charCodeAt(++x))<<16|(255&i.charCodeAt(++x))<<24,++x,o=27492+(65535&(p=5*(65535&(o=(o^=_=(65535&(_=(_=(65535&_)*d+(((_>>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(_=0,r){case 3:_^=(255&i.charCodeAt(x+2))<<16;case 2:_^=(255&i.charCodeAt(x+1))<<8;case 1:o^=_=(65535&(_=(_=(65535&(_^=255&i.charCodeAt(x)))*d+(((_>>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0};var Es=ts.exports,Ke={exports:{}};Ke.exports=function(i,t){for(var r,a=i.length,o=t^a,p=0;a>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(p)|(255&i.charCodeAt(++p))<<8|(255&i.charCodeAt(++p))<<16|(255&i.charCodeAt(++p))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:o^=(255&i.charCodeAt(p+2))<<16;case 2:o^=(255&i.charCodeAt(p+1))<<8;case 1:o=1540483477*(65535&(o^=255&i.charCodeAt(p)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0};var Ze=Es,si=Ke.exports;Rr.exports=Ze,Rr.exports.murmur3=Ze,Rr.exports.murmur2=si;var es=it(Rr.exports);class Ae{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,a,o){this.ids.push(Be(t)),this.positions.push(r,a,o)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Be(t);let a=0,o=this.ids.length-1;for(;a<o;){const d=a+o>>1;this.ids[d]>=r?o=d:a=d+1}const p=[];for(;this.ids[a]===r;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(t,r){const a=new Float64Array(t.ids),o=new Uint32Array(t.positions);return fi(a,o,0,a.length-1),r&&r.push(a.buffer,o.buffer),{ids:a,positions:o}}static deserialize(t){const r=new Ae;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}}function Be(i){const t=+i;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:es(String(i))}function fi(i,t,r,a){for(;r<a;){const o=i[r+a>>1];let p=r-1,d=a+1;for(;;){do p++;while(i[p]<o);do d--;while(i[d]>o);if(p>=d)break;Ie(i,p,d),Ie(t,3*p,3*d),Ie(t,3*p+1,3*d+1),Ie(t,3*p+2,3*d+2)}d-r<a-d?(fi(i,t,r,d),r=d+1):(fi(i,t,d+1,a),a=d)}}function Ie(i,t,r){const a=i[t];i[t]=i[r],i[r]=a}wt("FeaturePositionMap",Ae);class is{constructor(t,r){this.gl=t.gl,this.location=r}}class qa extends is{constructor(t,r){super(t,r),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class Xo extends is{constructor(t,r){super(t,r),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class Ho extends is{constructor(t,r){super(t,r),this.current=ie.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const Bl=new Float32Array(16);function qn(i){return[ir(255*i.r,255*i.g),ir(255*i.b,255*i.a)]}class sr{constructor(t,r,a){this.value=t,this.uniformNames=r.map(o=>`u_${o}`),this.type=a}setUniform(t,r,a){t.set(a.constantOr(this.value))}getBinding(t,r,a){return this.type==="color"?new Ho(t,r):new qa(t,r)}}class rs{constructor(t,r){this.uniformNames=r.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setUniform(t,r,a,o){const p=o==="u_pattern_to"?this.patternTo:o==="u_pattern_from"?this.patternFrom:o==="u_pixel_ratio_to"?this.pixelRatioTo:o==="u_pixel_ratio_from"?this.pixelRatioFrom:null;p&&t.set(p)}getBinding(t,r,a){return a.substr(0,9)==="u_pattern"?new Xo(t,r):new qa(t,r)}}class ar{constructor(t,r,a,o){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map(p=>({name:`a_${p}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new o}populatePaintArray(t,r,a,o,p){const d=this.paintVertexArray.length,f=this.expression.evaluate(new he(0),r,{},o,[],p);this.paintVertexArray.resize(t),this._setPaintValue(d,t,f)}updatePaintArray(t,r,a,o){const p=this.expression.evaluate({zoom:0},a,o);this._setPaintValue(t,r,p)}_setPaintValue(t,r,a){if(this.type==="color"){const o=qn(a);for(let p=t;p<r;p++)this.paintVertexArray.emplace(p,o[0],o[1])}else{for(let o=t;o<r;o++)this.paintVertexArray.emplace(o,a);this.maxValue=Math.max(this.maxValue,Math.abs(a))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ui{constructor(t,r,a,o,p,d){this.expression=t,this.uniformNames=r.map(f=>`u_${f}_t`),this.type=a,this.useIntegerZoom=o,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(t,r,a,o,p){const d=this.expression.evaluate(new he(this.zoom),r,{},o,[],p),f=this.expression.evaluate(new he(this.zoom+1),r,{},o,[],p),_=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(_,t,d,f)}updatePaintArray(t,r,a,o){const p=this.expression.evaluate({zoom:this.zoom},a,o),d=this.expression.evaluate({zoom:this.zoom+1},a,o);this._setPaintValue(t,r,p,d)}_setPaintValue(t,r,a,o){if(this.type==="color"){const p=qn(a),d=qn(o);for(let f=t;f<r;f++)this.paintVertexArray.emplace(f,p[0],p[1],d[0],d[1])}else{for(let p=t;p<r;p++)this.paintVertexArray.emplace(p,a,o);this.maxValue=Math.max(this.maxValue,Math.abs(a),Math.abs(o))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,r){const a=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,o=Ki(this.expression.interpolationFactor(a,this.zoom,this.zoom+1),0,1);t.set(o)}getBinding(t,r,a){return new qa(t,r)}}class nr{constructor(t,r,a,o,p,d){this.expression=t,this.type=r,this.useIntegerZoom=a,this.zoom=o,this.layerId=d,this.zoomInPaintVertexArray=new p,this.zoomOutPaintVertexArray=new p}populatePaintArray(t,r,a){const o=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(o,t,r.patterns&&r.patterns[this.layerId],a)}updatePaintArray(t,r,a,o,p){this._setPaintValues(t,r,a.patterns&&a.patterns[this.layerId],p)}_setPaintValues(t,r,a,o){if(!o||!a)return;const{min:p,mid:d,max:f}=a,_=o[p],x=o[d],b=o[f];if(_&&x&&b)for(let T=t;T<r;T++)this.zoomInPaintVertexArray.emplace(T,x.tl[0],x.tl[1],x.br[0],x.br[1],_.tl[0],_.tl[1],_.br[0],_.br[1],x.pixelRatio,_.pixelRatio),this.zoomOutPaintVertexArray.emplace(T,x.tl[0],x.tl[1],x.br[0],x.br[1],b.tl[0],b.tl[1],b.br[0],b.br[1],x.pixelRatio,b.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,rr.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,rr.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class jn{constructor(t,r,a){this.binders={},this._buffers=[];const o=[];for(const p in t.paint._values){if(!a(p))continue;const d=t.paint.get(p);if(!(d instanceof ri&&Ss(d.property.specification)))continue;const f=lc(p,t.type),_=d.value,x=d.property.specification.type,b=d.property.useIntegerZoom,T=d.property.specification["property-type"],I=T==="cross-faded"||T==="cross-faded-data-driven";if(_.kind==="constant")this.binders[p]=I?new rs(_.value,f):new sr(_.value,f,x),o.push(`/u_${p}`);else if(_.kind==="source"||I){const C=Au(p,x,"source");this.binders[p]=I?new nr(_,x,b,r,C,t.id):new ar(_,f,x,C),o.push(`/a_${p}`)}else{const C=Au(p,x,"composite");this.binders[p]=new Ui(_,f,x,b,r,C),o.push(`/z_${p}`)}}this.cacheKey=o.sort().join("")}getMaxValue(t){const r=this.binders[t];return r instanceof ar||r instanceof Ui?r.maxValue:0}populatePaintArrays(t,r,a,o,p){for(const d in this.binders){const f=this.binders[d];(f instanceof ar||f instanceof Ui||f instanceof nr)&&f.populatePaintArray(t,r,a,o,p)}}setConstantPatternPositions(t,r){for(const a in this.binders){const o=this.binders[a];o instanceof rs&&o.setConstantPatternPositions(t,r)}}updatePaintArrays(t,r,a,o,p){let d=!1;for(const f in t){const _=r.getPositions(f);for(const x of _){const b=a.feature(x.index);for(const T in this.binders){const I=this.binders[T];if((I instanceof ar||I instanceof Ui||I instanceof nr)&&I.expression.isStateDependent===!0){const C=o.paint.get(T);I.expression=C.value,I.updatePaintArray(x.start,x.end,b,t[f],p),d=!0}}}}return d}defines(){const t=[];for(const r in this.binders){const a=this.binders[r];(a instanceof sr||a instanceof rs)&&t.push(...a.uniformNames.map(o=>`#define HAS_UNIFORM_${o}`))}return t}getBinderAttributes(){const t=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof ar||a instanceof Ui)for(let o=0;o<a.paintVertexAttributes.length;o++)t.push(a.paintVertexAttributes[o].name);else if(a instanceof nr)for(let o=0;o<rr.members.length;o++)t.push(rr.members[o].name)}return t}getBinderUniforms(){const t=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof sr||a instanceof rs||a instanceof Ui)for(const o of a.uniformNames)t.push(o)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,r){const a=[];for(const o in this.binders){const p=this.binders[o];if(p instanceof sr||p instanceof rs||p instanceof Ui){for(const d of p.uniformNames)if(r[d]){const f=p.getBinding(t,r[d],d);a.push({name:d,property:o,binding:f})}}}return a}setUniforms(t,r,a,o){for(const{name:p,property:d,binding:f}of r)this.binders[d].setUniform(f,o,a.get(d),p)}updatePaintBuffers(t){this._buffers=[];for(const r in this.binders){const a=this.binders[r];if(t&&a instanceof nr){const o=t.fromScale===2?a.zoomInPaintVertexBuffer:a.zoomOutPaintVertexBuffer;o&&this._buffers.push(o)}else(a instanceof ar||a instanceof Ui)&&a.paintVertexBuffer&&this._buffers.push(a.paintVertexBuffer)}}upload(t){for(const r in this.binders){const a=this.binders[r];(a instanceof ar||a instanceof Ui||a instanceof nr)&&a.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const r=this.binders[t];(r instanceof ar||r instanceof Ui||r instanceof nr)&&r.destroy()}}}class xr{constructor(t,r,a=()=>!0){this.programConfigurations={};for(const o of t)this.programConfigurations[o.id]=new jn(o,r,a);this.needsUpload=!1,this._featureMap=new Ae,this._bufferOffset=0}populatePaintArrays(t,r,a,o,p,d){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(t,r,o,p,d);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,a,o){for(const p of a)this.needsUpload=this.programConfigurations[p.id].updatePaintArrays(t,this._featureMap,r,p,o)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function lc(i,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${t}-`,"").replace(/-/g,"_")]}function Au(i,t,r){const a={color:{source:Cs,composite:L},number:{source:y,composite:Cs}},o=function(p){return{"line-pattern":{source:re,composite:re},"fill-pattern":{source:re,composite:re},"fill-extrusion-pattern":{source:re,composite:re}}[p]}(i);return o&&o[r]||a[t][r]}wt("ConstantBinder",sr),wt("CrossFadedConstantBinder",rs),wt("SourceExpressionBinder",ar),wt("CrossFadedCompositeBinder",nr),wt("CompositeExpressionBinder",Ui),wt("ProgramConfiguration",jn,{omit:["_buffers"]}),wt("ProgramConfigurationSet",xr);const Me=8192,Fl=Math.pow(2,14)-1,Iu=-Fl-1;function na(i){const t=Me/i.extent,r=i.loadGeometry();for(let a=0;a<r.length;a++){const o=r[a];for(let p=0;p<o.length;p++){const d=o[p],f=Math.round(d.x*t),_=Math.round(d.y*t);d.x=Ki(f,Iu,Fl),d.y=Ki(_,Iu,Fl),(f<d.x||f>d.x+1||_<d.y||_>d.y+1)&&ei("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function oa(i,t){return{type:i.type,id:i.id,properties:i.properties,geometry:t?na(i):[]}}function Jo(i,t,r,a,o){i.emplaceBack(2*t+(a+1)/2,2*r+(o+1)/2)}class Rl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new At,this.indexArray=new Ge,this.segments=new ce,this.programConfigurations=new xr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){const o=this.layers[0],p=[];let d=null,f=!1;o.type==="circle"&&(d=o.layout.get("circle-sort-key"),f=!d.isConstant());for(const{feature:_,id:x,index:b,sourceLayerIndex:T}of t){const I=this.layers[0]._featureFilter.needGeometry,C=oa(_,I);if(!this.layers[0]._featureFilter.filter(new he(this.zoom),C,a))continue;const E=f?d.evaluate(C,{},a):void 0,D={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:b,geometry:I?C.geometry:na(_),patterns:{},sortKey:E};p.push(D)}f&&p.sort((_,x)=>_.sortKey-x.sortKey);for(const _ of p){const{geometry:x,index:b,sourceLayerIndex:T}=_,I=t[b].feature;this.addFeature(_,x,b,a),r.featureIndex.insert(I,x,b,T,this.index)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ii),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,a,o){for(const p of r)for(const d of p){const f=d.x,_=d.y;if(f<0||f>=Me||_<0||_>=Me)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),b=x.vertexLength;Jo(this.layoutVertexArray,f,_,-1,-1),Jo(this.layoutVertexArray,f,_,1,-1),Jo(this.layoutVertexArray,f,_,1,1),Jo(this.layoutVertexArray,f,_,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{},o)}}function zu(i,t){for(let r=0;r<i.length;r++)if(ja(t,i[r]))return!0;for(let r=0;r<t.length;r++)if(ja(i,t[r]))return!0;return!!Ol(i,t)}function uc(i,t,r){return!!ja(i,t)||!!Vl(t,i,r)}function Pu(i,t){if(i.length===1)return Eu(t,i[0]);for(let r=0;r<t.length;r++){const a=t[r];for(let o=0;o<a.length;o++)if(ja(i,a[o]))return!0}for(let r=0;r<i.length;r++)if(Eu(t,i[r]))return!0;for(let r=0;r<t.length;r++)if(Ol(i,t[r]))return!0;return!1}function hc(i,t,r){if(i.length>1){if(Ol(i,t))return!0;for(let a=0;a<t.length;a++)if(Vl(t[a],i,r))return!0}for(let a=0;a<i.length;a++)if(Vl(i[a],t,r))return!0;return!1}function Ol(i,t){if(i.length===0||t.length===0)return!1;for(let r=0;r<i.length-1;r++){const a=i[r],o=i[r+1];for(let p=0;p<t.length-1;p++)if(cc(a,o,t[p],t[p+1]))return!0}return!1}function cc(i,t,r,a){return vi(i,r,a)!==vi(t,r,a)&&vi(i,t,r)!==vi(i,t,a)}function Vl(i,t,r){const a=r*r;if(t.length===1)return i.distSqr(t[0])<a;for(let o=1;o<t.length;o++)if(Cu(i,t[o-1],t[o])<a)return!0;return!1}function Cu(i,t,r){const a=t.distSqr(r);if(a===0)return i.distSqr(t);const o=((i.x-t.x)*(r.x-t.x)+(i.y-t.y)*(r.y-t.y))/a;return i.distSqr(o<0?t:o>1?r:r.sub(t)._mult(o)._add(t))}function Eu(i,t){let r,a,o,p=!1;for(let d=0;d<i.length;d++){r=i[d];for(let f=0,_=r.length-1;f<r.length;_=f++)a=r[f],o=r[_],a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(p=!p)}return p}function ja(i,t){let r=!1;for(let a=0,o=i.length-1;a<i.length;o=a++){const p=i[a],d=i[o];p.y>t.y!=d.y>t.y&&t.x<(d.x-p.x)*(t.y-p.y)/(d.y-p.y)+p.x&&(r=!r)}return r}function pc(i,t,r){const a=r[0],o=r[2];if(i.x<a.x&&t.x<a.x||i.x>o.x&&t.x>o.x||i.y<a.y&&t.y<a.y||i.y>o.y&&t.y>o.y)return!1;const p=vi(i,t,r[0]);return p!==vi(i,t,r[1])||p!==vi(i,t,r[2])||p!==vi(i,t,r[3])}function Gn(i,t,r){const a=t.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(i)}function Ko(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Wo(i,t,r,a,o){if(!t[0]&&!t[1])return i;const p=Bt.convert(t)._mult(o);r==="viewport"&&p._rotate(-a);const d=[];for(let f=0;f<i.length;f++)d.push(i[f].sub(p));return d}let ku,Mu;wt("CircleBucket",Rl,{omit:["layers"]});var dc={get paint(){return Mu=Mu||new ze({"circle-radius":new Dt(rt.paint_circle["circle-radius"]),"circle-color":new Dt(rt.paint_circle["circle-color"]),"circle-blur":new Dt(rt.paint_circle["circle-blur"]),"circle-opacity":new Dt(rt.paint_circle["circle-opacity"]),"circle-translate":new Ct(rt.paint_circle["circle-translate"]),"circle-translate-anchor":new Ct(rt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ct(rt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ct(rt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Dt(rt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Dt(rt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Dt(rt.paint_circle["circle-stroke-opacity"])})},get layout(){return ku=ku||new ze({"circle-sort-key":new Dt(rt.layout_circle["circle-sort-key"])})}},mi=1e-6,Ga=typeof Float32Array<"u"?Float32Array:Array;function Ul(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Du(i,t,r){var a=t[0],o=t[1],p=t[2],d=t[3],f=t[4],_=t[5],x=t[6],b=t[7],T=t[8],I=t[9],C=t[10],E=t[11],D=t[12],V=t[13],$=t[14],J=t[15],j=r[0],W=r[1],Q=r[2],ot=r[3];return i[0]=j*a+W*f+Q*T+ot*D,i[1]=j*o+W*_+Q*I+ot*V,i[2]=j*p+W*x+Q*C+ot*$,i[3]=j*d+W*b+Q*E+ot*J,i[4]=(j=r[4])*a+(W=r[5])*f+(Q=r[6])*T+(ot=r[7])*D,i[5]=j*o+W*_+Q*I+ot*V,i[6]=j*p+W*x+Q*C+ot*$,i[7]=j*d+W*b+Q*E+ot*J,i[8]=(j=r[8])*a+(W=r[9])*f+(Q=r[10])*T+(ot=r[11])*D,i[9]=j*o+W*_+Q*I+ot*V,i[10]=j*p+W*x+Q*C+ot*$,i[11]=j*d+W*b+Q*E+ot*J,i[12]=(j=r[12])*a+(W=r[13])*f+(Q=r[14])*T+(ot=r[15])*D,i[13]=j*o+W*_+Q*I+ot*V,i[14]=j*p+W*x+Q*C+ot*$,i[15]=j*d+W*b+Q*E+ot*J,i}Math.hypot||(Math.hypot=function(){for(var i=0,t=arguments.length;t--;)i+=arguments[t]*arguments[t];return Math.sqrt(i)});var Zn,fc=Du;function Yo(i,t,r){var a=t[0],o=t[1],p=t[2],d=t[3];return i[0]=r[0]*a+r[4]*o+r[8]*p+r[12]*d,i[1]=r[1]*a+r[5]*o+r[9]*p+r[13]*d,i[2]=r[2]*a+r[6]*o+r[10]*p+r[14]*d,i[3]=r[3]*a+r[7]*o+r[11]*p+r[15]*d,i}Zn=new Ga(4),Ga!=Float32Array&&(Zn[0]=0,Zn[1]=0,Zn[2]=0,Zn[3]=0);class mc extends Vi{constructor(t){super(t,dc)}createBucket(t){return new Rl(t)}queryRadius(t){const r=t;return Gn("circle-radius",this,r)+Gn("circle-stroke-width",this,r)+Ko(this.paint.get("circle-translate"))}queryIntersectsFeature(t,r,a,o,p,d,f,_){const x=Wo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),d.angle,f),b=this.paint.get("circle-radius").evaluate(r,a)+this.paint.get("circle-stroke-width").evaluate(r,a),T=this.paint.get("circle-pitch-alignment")==="map",I=T?x:function(E,D){return E.map(V=>Lu(V,D))}(x,_),C=T?b*f:b;for(const E of o)for(const D of E){const V=T?D:Lu(D,_);let $=C;const J=Yo([],[D.x,D.y,0,1],_);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?$*=J[3]/d.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&($*=d.cameraToCenterDistance/J[3]),uc(I,V,$))return!0}return!1}}function Lu(i,t){const r=Yo([],[i.x,i.y,0,1],t);return new Bt(r[0]/r[3],r[1]/r[3])}class Bu extends Rl{}let Fu;wt("HeatmapBucket",Bu,{omit:["layers"]});var gc={get paint(){return Fu=Fu||new ze({"heatmap-radius":new Dt(rt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Dt(rt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ct(rt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Rn(rt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ct(rt.paint_heatmap["heatmap-opacity"])})}};function Nl(i,{width:t,height:r},a,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==t*r*a)throw new RangeError(`mismatched image size. expected: ${o.length} but got: ${t*r*a}`)}else o=new Uint8Array(t*r*a);return i.width=t,i.height=r,i.data=o,i}function Ru(i,{width:t,height:r},a){if(t===i.width&&r===i.height)return;const o=Nl({},{width:t,height:r},a);$l(i,o,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,t),height:Math.min(i.height,r)},a),i.width=t,i.height=r,i.data=o.data}function $l(i,t,r,a,o,p){if(o.width===0||o.height===0)return t;if(o.width>i.width||o.height>i.height||r.x>i.width-o.width||r.y>i.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>t.width||o.height>t.height||a.x>t.width-o.width||a.y>t.height-o.height)throw new RangeError("out of range destination coordinates for image copy");const d=i.data,f=t.data;if(d===f)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_<o.height;_++){const x=((r.y+_)*i.width+r.x)*p,b=((a.y+_)*t.width+a.x)*p;for(let T=0;T<o.width*p;T++)f[b+T]=d[x+T]}return t}class Xn{constructor(t,r){Nl(this,t,1,r)}resize(t){Ru(this,t,1)}clone(){return new Xn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,a,o,p){$l(t,r,a,o,p,1)}}class ji{constructor(t,r){Nl(this,t,4,r)}resize(t){Ru(this,t,4)}replace(t,r){r?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new ji({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,a,o,p){$l(t,r,a,o,p,4)}}function Ou(i){const t={},r=i.resolution||256,a=i.clips?i.clips.length:1,o=i.image||new ji({width:r,height:a});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const p=(d,f,_)=>{t[i.evaluationKey]=_;const x=i.expression.evaluate(t);o.data[d+f+0]=Math.floor(255*x.r/x.a),o.data[d+f+1]=Math.floor(255*x.g/x.a),o.data[d+f+2]=Math.floor(255*x.b/x.a),o.data[d+f+3]=Math.floor(255*x.a)};if(i.clips)for(let d=0,f=0;d<a;++d,f+=4*r)for(let _=0,x=0;_<r;_++,x+=4){const b=_/(r-1),{start:T,end:I}=i.clips[d];p(f,x,T*(1-b)+I*b)}else for(let d=0,f=0;d<r;d++,f+=4)p(0,f,d/(r-1));return o}wt("AlphaImage",Xn),wt("RGBAImage",ji);class _c extends Vi{createBucket(t){return new Bu(t)}constructor(t){super(t,gc),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Ou({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Vu;var yc={get paint(){return Vu=Vu||new ze({"hillshade-illumination-direction":new Ct(rt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ct(rt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ct(rt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ct(rt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ct(rt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ct(rt.paint_hillshade["hillshade-accent-color"])})}};class xc extends Vi{constructor(t){super(t,yc)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const vc=xe([{name:"a_pos",components:2,type:"Int16"}],4),{members:bc}=vc;var ql={exports:{}};function Qo(i,t,r){r=r||2;var a,o,p,d,f,_,x,b=t&&t.length,T=b?t[0]*r:i.length,I=Uu(i,0,T,r,!0),C=[];if(!I||I.next===I.prev)return C;if(b&&(I=function(D,V,$,J){var j,W,Q,ot=[];for(j=0,W=V.length;j<W;j++)(Q=Uu(D,V[j]*J,j<W-1?V[j+1]*J:D.length,J,!1))===Q.next&&(Q.steiner=!0),ot.push(Cc(Q));for(ot.sort(Ic),j=0;j<ot.length;j++)$=zc(ot[j],$);return $}(i,t,I,r)),i.length>80*r){a=p=i[0],o=d=i[1];for(var E=r;E<T;E+=r)(f=i[E])<a&&(a=f),(_=i[E+1])<o&&(o=_),f>p&&(p=f),_>d&&(d=_);x=(x=Math.max(p-a,d-o))!==0?32767/x:0}return Hn(I,C,r,a,o,x,0),C}function Uu(i,t,r,a,o){var p,d;if(o===Zl(i,t,r,a)>0)for(p=t;p<r;p+=a)d=qu(p,i[p],i[p+1],d);else for(p=r-a;p>=t;p-=a)d=qu(p,i[p],i[p+1],d);return d&&tl(d,d.next)&&(Kn(d),d=d.next),d}function la(i,t){if(!i)return i;t||(t=i);var r,a=i;do if(r=!1,a.steiner||!tl(a,a.next)&&Ce(a.prev,a,a.next)!==0)a=a.next;else{if(Kn(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function Hn(i,t,r,a,o,p,d){if(i){!d&&p&&function(b,T,I,C){var E=b;do E.z===0&&(E.z=jl(E.x,E.y,T,I,C)),E.prevZ=E.prev,E.nextZ=E.next,E=E.next;while(E!==b);E.prevZ.nextZ=null,E.prevZ=null,function(D){var V,$,J,j,W,Q,ot,bt,It=1;do{for($=D,D=null,W=null,Q=0;$;){for(Q++,J=$,ot=0,V=0;V<It&&(ot++,J=J.nextZ);V++);for(bt=It;ot>0||bt>0&&J;)ot!==0&&(bt===0||!J||$.z<=J.z)?(j=$,$=$.nextZ,ot--):(j=J,J=J.nextZ,bt--),W?W.nextZ=j:D=j,j.prevZ=W,W=j;$=J}W.nextZ=null,It*=2}while(Q>1)}(E)}(i,a,o,p);for(var f,_,x=i;i.prev!==i.next;)if(f=i.prev,_=i.next,p?Sc(i,a,o,p):wc(i))t.push(f.i/r|0),t.push(i.i/r|0),t.push(_.i/r|0),Kn(i),i=_.next,x=_.next;else if((i=_)===x){d?d===1?Hn(i=Tc(la(i),t,r),t,r,a,o,p,2):d===2&&Ac(i,t,r,a,o,p):Hn(la(i),t,r,a,o,p,1);break}}}function wc(i){var t=i.prev,r=i,a=i.next;if(Ce(t,r,a)>=0)return!1;for(var o=t.x,p=r.x,d=a.x,f=t.y,_=r.y,x=a.y,b=o<p?o<d?o:d:p<d?p:d,T=f<_?f<x?f:x:_<x?_:x,I=o>p?o>d?o:d:p>d?p:d,C=f>_?f>x?f:x:_>x?_:x,E=a.next;E!==t;){if(E.x>=b&&E.x<=I&&E.y>=T&&E.y<=C&&Za(o,f,p,_,d,x,E.x,E.y)&&Ce(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function Sc(i,t,r,a){var o=i.prev,p=i,d=i.next;if(Ce(o,p,d)>=0)return!1;for(var f=o.x,_=p.x,x=d.x,b=o.y,T=p.y,I=d.y,C=f<_?f<x?f:x:_<x?_:x,E=b<T?b<I?b:I:T<I?T:I,D=f>_?f>x?f:x:_>x?_:x,V=b>T?b>I?b:I:T>I?T:I,$=jl(C,E,t,r,a),J=jl(D,V,t,r,a),j=i.prevZ,W=i.nextZ;j&&j.z>=$&&W&&W.z<=J;){if(j.x>=C&&j.x<=D&&j.y>=E&&j.y<=V&&j!==o&&j!==d&&Za(f,b,_,T,x,I,j.x,j.y)&&Ce(j.prev,j,j.next)>=0||(j=j.prevZ,W.x>=C&&W.x<=D&&W.y>=E&&W.y<=V&&W!==o&&W!==d&&Za(f,b,_,T,x,I,W.x,W.y)&&Ce(W.prev,W,W.next)>=0))return!1;W=W.nextZ}for(;j&&j.z>=$;){if(j.x>=C&&j.x<=D&&j.y>=E&&j.y<=V&&j!==o&&j!==d&&Za(f,b,_,T,x,I,j.x,j.y)&&Ce(j.prev,j,j.next)>=0)return!1;j=j.prevZ}for(;W&&W.z<=J;){if(W.x>=C&&W.x<=D&&W.y>=E&&W.y<=V&&W!==o&&W!==d&&Za(f,b,_,T,x,I,W.x,W.y)&&Ce(W.prev,W,W.next)>=0)return!1;W=W.nextZ}return!0}function Tc(i,t,r){var a=i;do{var o=a.prev,p=a.next.next;!tl(o,p)&&Nu(o,a,a.next,p)&&Jn(o,p)&&Jn(p,o)&&(t.push(o.i/r|0),t.push(a.i/r|0),t.push(p.i/r|0),Kn(a),Kn(a.next),a=i=p),a=a.next}while(a!==i);return la(a)}function Ac(i,t,r,a,o,p){var d=i;do{for(var f=d.next.next;f!==d.prev;){if(d.i!==f.i&&Ec(d,f)){var _=$u(d,f);return d=la(d,d.next),_=la(_,_.next),Hn(d,t,r,a,o,p,0),void Hn(_,t,r,a,o,p,0)}f=f.next}d=d.next}while(d!==i)}function Ic(i,t){return i.x-t.x}function zc(i,t){var r=function(o,p){var d,f=p,_=o.x,x=o.y,b=-1/0;do{if(x<=f.y&&x>=f.next.y&&f.next.y!==f.y){var T=f.x+(x-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(T<=_&&T>b&&(b=T,d=f.x<f.next.x?f:f.next,T===_))return d}f=f.next}while(f!==p);if(!d)return null;var I,C=d,E=d.x,D=d.y,V=1/0;f=d;do _>=f.x&&f.x>=E&&_!==f.x&&Za(x<D?_:b,x,E,D,x<D?b:_,x,f.x,f.y)&&(I=Math.abs(x-f.y)/(_-f.x),Jn(f,o)&&(I<V||I===V&&(f.x>d.x||f.x===d.x&&Pc(d,f)))&&(d=f,V=I)),f=f.next;while(f!==C);return d}(i,t);if(!r)return t;var a=$u(r,i);return la(a,a.next),la(r,r.next)}function Pc(i,t){return Ce(i.prev,i,t.prev)<0&&Ce(t.next,i,i.next)<0}function jl(i,t,r,a,o){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*o|0)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Cc(i){var t=i,r=i;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==i);return r}function Za(i,t,r,a,o,p,d,f){return(o-d)*(t-f)>=(i-d)*(p-f)&&(i-d)*(a-f)>=(r-d)*(t-f)&&(r-d)*(p-f)>=(o-d)*(a-f)}function Ec(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(r,a){var o=r;do{if(o.i!==r.i&&o.next.i!==r.i&&o.i!==a.i&&o.next.i!==a.i&&Nu(o,o.next,r,a))return!0;o=o.next}while(o!==r);return!1}(i,t)&&(Jn(i,t)&&Jn(t,i)&&function(r,a){var o=r,p=!1,d=(r.x+a.x)/2,f=(r.y+a.y)/2;do o.y>f!=o.next.y>f&&o.next.y!==o.y&&d<(o.next.x-o.x)*(f-o.y)/(o.next.y-o.y)+o.x&&(p=!p),o=o.next;while(o!==r);return p}(i,t)&&(Ce(i.prev,i,t.prev)||Ce(i,t.prev,t))||tl(i,t)&&Ce(i.prev,i,i.next)>0&&Ce(t.prev,t,t.next)>0)}function Ce(i,t,r){return(t.y-i.y)*(r.x-t.x)-(t.x-i.x)*(r.y-t.y)}function tl(i,t){return i.x===t.x&&i.y===t.y}function Nu(i,t,r,a){var o=il(Ce(i,t,r)),p=il(Ce(i,t,a)),d=il(Ce(r,a,i)),f=il(Ce(r,a,t));return o!==p&&d!==f||!(o!==0||!el(i,r,t))||!(p!==0||!el(i,a,t))||!(d!==0||!el(r,i,a))||!(f!==0||!el(r,t,a))}function el(i,t,r){return t.x<=Math.max(i.x,r.x)&&t.x>=Math.min(i.x,r.x)&&t.y<=Math.max(i.y,r.y)&&t.y>=Math.min(i.y,r.y)}function il(i){return i>0?1:i<0?-1:0}function Jn(i,t){return Ce(i.prev,i,i.next)<0?Ce(i,t,i.next)>=0&&Ce(i,i.prev,t)>=0:Ce(i,t,i.prev)<0||Ce(i,i.next,t)<0}function $u(i,t){var r=new Gl(i.i,i.x,i.y),a=new Gl(t.i,t.x,t.y),o=i.next,p=t.prev;return i.next=t,t.prev=i,r.next=o,o.prev=r,a.next=r,r.prev=a,p.next=a,a.prev=p,a}function qu(i,t,r,a){var o=new Gl(i,t,r);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function Kn(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Gl(i,t,r){this.i=i,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Zl(i,t,r,a){for(var o=0,p=t,d=r-a;p<r;p+=a)o+=(i[d]-i[p])*(i[p+1]+i[d+1]),d=p;return o}ql.exports=Qo,ql.exports.default=Qo,Qo.deviation=function(i,t,r,a){var o=t&&t.length,p=Math.abs(Zl(i,0,o?t[0]*r:i.length,r));if(o)for(var d=0,f=t.length;d<f;d++)p-=Math.abs(Zl(i,t[d]*r,d<f-1?t[d+1]*r:i.length,r));var _=0;for(d=0;d<a.length;d+=3){var x=a[d]*r,b=a[d+1]*r,T=a[d+2]*r;_+=Math.abs((i[x]-i[T])*(i[b+1]-i[x+1])-(i[x]-i[b])*(i[T+1]-i[x+1]))}return p===0&&_===0?0:Math.abs((_-p)/p)},Qo.flatten=function(i){for(var t=i[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,o=0;o<i.length;o++){for(var p=0;p<i[o].length;p++)for(var d=0;d<t;d++)r.vertices.push(i[o][p][d]);o>0&&r.holes.push(a+=i[o-1].length)}return r};var ju=it(ql.exports);function kc(i,t,r,a,o){Gu(i,t,r||0,a||i.length-1,o||Mc)}function Gu(i,t,r,a,o){for(;a>r;){if(a-r>600){var p=a-r+1,d=t-r+1,f=Math.log(p),_=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*_*(p-_)/p)*(d-p/2<0?-1:1);Gu(i,t,Math.max(r,Math.floor(t-d*_/p+x)),Math.min(a,Math.floor(t+(p-d)*_/p+x)),o)}var b=i[t],T=r,I=a;for(Wn(i,r,t),o(i[a],b)>0&&Wn(i,r,a);T<I;){for(Wn(i,T,I),T++,I--;o(i[T],b)<0;)T++;for(;o(i[I],b)>0;)I--}o(i[r],b)===0?Wn(i,r,I):Wn(i,++I,a),I<=t&&(r=I+1),t<=I&&(a=I-1)}}function Wn(i,t,r){var a=i[t];i[t]=i[r],i[r]=a}function Mc(i,t){return i<t?-1:i>t?1:0}function Xl(i,t){const r=i.length;if(r<=1)return[i];const a=[];let o,p;for(let d=0;d<r;d++){const f=ur(i[d]);f!==0&&(i[d].area=Math.abs(f),p===void 0&&(p=f<0),p===f<0?(o&&a.push(o),o=[i[d]]):o.push(i[d]))}if(o&&a.push(o),t>1)for(let d=0;d<a.length;d++)a[d].length<=t||(kc(a[d],t,1,a[d].length-1,Dc),a[d]=a[d].slice(0,t));return a}function Dc(i,t){return t.area-i.area}function Hl(i,t,r){const a=r.patternDependencies;let o=!1;for(const p of t){const d=p.paint.get(`${i}-pattern`);d.isConstant()||(o=!0);const f=d.constantOr(null);f&&(o=!0,a[f.to]=!0,a[f.from]=!0)}return o}function Jl(i,t,r,a,o){const p=o.patternDependencies;for(const d of t){const f=d.paint.get(`${i}-pattern`).value;if(f.kind!=="constant"){let _=f.evaluate({zoom:a-1},r,{},o.availableImages),x=f.evaluate({zoom:a},r,{},o.availableImages),b=f.evaluate({zoom:a+1},r,{},o.availableImages);_=_&&_.name?_.name:_,x=x&&x.name?x.name:x,b=b&&b.name?b.name:b,p[_]=!0,p[x]=!0,p[b]=!0,r.patterns[d.id]={min:_,mid:x,max:b}}}return r}class Kl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new jt,this.indexArray=new Ge,this.indexArray2=new Le,this.programConfigurations=new xr(t.layers,t.zoom),this.segments=new ce,this.segments2=new ce,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){this.hasPattern=Hl("fill",this.layers,r);const o=this.layers[0].layout.get("fill-sort-key"),p=!o.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of t){const T=this.layers[0]._featureFilter.needGeometry,I=oa(f,T);if(!this.layers[0]._featureFilter.filter(new he(this.zoom),I,a))continue;const C=p?o.evaluate(I,{},a,r.availableImages):void 0,E={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:T?I.geometry:na(f),patterns:{},sortKey:C};d.push(E)}p&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const T=Jl("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(f,_,x,a,{});r.featureIndex.insert(t[x].feature,_,x,b,this.index)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}addFeatures(t,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,bc),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,a,o,p){for(const d of Xl(r,500)){let f=0;for(const C of d)f+=C.length;const _=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],T=[];for(const C of d){if(C.length===0)continue;C!==d[0]&&T.push(b.length/2);const E=this.segments2.prepareSegment(C.length,this.layoutVertexArray,this.indexArray2),D=E.vertexLength;this.layoutVertexArray.emplaceBack(C[0].x,C[0].y),this.indexArray2.emplaceBack(D+C.length-1,D),b.push(C[0].x),b.push(C[0].y);for(let V=1;V<C.length;V++)this.layoutVertexArray.emplaceBack(C[V].x,C[V].y),this.indexArray2.emplaceBack(D+V-1,D+V),b.push(C[V].x),b.push(C[V].y);E.vertexLength+=C.length,E.primitiveLength+=C.length}const I=ju(b,T);for(let C=0;C<I.length;C+=3)this.indexArray.emplaceBack(x+I[C],x+I[C+1],x+I[C+2]);_.vertexLength+=f,_.primitiveLength+=I.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,o)}}let Zu,Xu;wt("FillBucket",Kl,{omit:["layers","patternFeatures"]});var Lc={get paint(){return Xu=Xu||new ze({"fill-antialias":new Ct(rt.paint_fill["fill-antialias"]),"fill-opacity":new Dt(rt.paint_fill["fill-opacity"]),"fill-color":new Dt(rt.paint_fill["fill-color"]),"fill-outline-color":new Dt(rt.paint_fill["fill-outline-color"]),"fill-translate":new Ct(rt.paint_fill["fill-translate"]),"fill-translate-anchor":new Ct(rt.paint_fill["fill-translate-anchor"]),"fill-pattern":new ra(rt.paint_fill["fill-pattern"])})},get layout(){return Zu=Zu||new ze({"fill-sort-key":new Dt(rt.layout_fill["fill-sort-key"])})}};class Bc extends Vi{constructor(t){super(t,Lc)}recalculate(t,r){super.recalculate(t,r);const a=this.paint._values["fill-outline-color"];a.value.kind==="constant"&&a.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Kl(t)}queryRadius(){return Ko(this.paint.get("fill-translate"))}queryIntersectsFeature(t,r,a,o,p,d,f){return Pu(Wo(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),d.angle,f),o)}isTileClipped(){return!0}}const Fc=xe([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Rc=xe([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Oc}=Fc;var ks={},Vc=Ji,Hu=Xa;function Xa(i,t,r,a,o){this.properties={},this.extent=r,this.type=0,this._pbf=i,this._geometry=-1,this._keys=a,this._values=o,i.readFields(Uc,this,t)}function Uc(i,t,r){i==1?t.id=r.readVarint():i==2?function(a,o){for(var p=a.readVarint()+a.pos;a.pos<p;){var d=o._keys[a.readVarint()],f=o._values[a.readVarint()];o.properties[d]=f}}(r,t):i==3?t.type=r.readVarint():i==4&&(t._geometry=r.pos)}function Nc(i){for(var t,r,a=0,o=0,p=i.length,d=p-1;o<p;d=o++)a+=((r=i[d]).x-(t=i[o]).x)*(t.y+r.y);return a}Xa.types=["Unknown","Point","LineString","Polygon"],Xa.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var t,r=i.readVarint()+i.pos,a=1,o=0,p=0,d=0,f=[];i.pos<r;){if(o<=0){var _=i.readVarint();a=7&_,o=_>>3}if(o--,a===1||a===2)p+=i.readSVarint(),d+=i.readSVarint(),a===1&&(t&&f.push(t),t=[]),t.push(new Vc(p,d));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&f.push(t),f},Xa.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var t=i.readVarint()+i.pos,r=1,a=0,o=0,p=0,d=1/0,f=-1/0,_=1/0,x=-1/0;i.pos<t;){if(a<=0){var b=i.readVarint();r=7&b,a=b>>3}if(a--,r===1||r===2)(o+=i.readSVarint())<d&&(d=o),o>f&&(f=o),(p+=i.readSVarint())<_&&(_=p),p>x&&(x=p);else if(r!==7)throw new Error("unknown command "+r)}return[d,_,f,x]},Xa.prototype.toGeoJSON=function(i,t,r){var a,o,p=this.extent*Math.pow(2,r),d=this.extent*i,f=this.extent*t,_=this.loadGeometry(),x=Xa.types[this.type];function b(C){for(var E=0;E<C.length;E++){var D=C[E];C[E]=[360*(D.x+d)/p-180,360/Math.PI*Math.atan(Math.exp((180-360*(D.y+f)/p)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(a=0;a<_.length;a++)T[a]=_[a][0];b(_=T);break;case 2:for(a=0;a<_.length;a++)b(_[a]);break;case 3:for(_=function(C){var E=C.length;if(E<=1)return[C];for(var D,V,$=[],J=0;J<E;J++){var j=Nc(C[J]);j!==0&&(V===void 0&&(V=j<0),V===j<0?(D&&$.push(D),D=[C[J]]):D.push(C[J]))}return D&&$.push(D),$}(_),a=0;a<_.length;a++)for(o=0;o<_[a].length;o++)b(_[a][o])}_.length===1?_=_[0]:x="Multi"+x;var I={type:"Feature",geometry:{type:x,coordinates:_},properties:this.properties};return"id"in this&&(I.id=this.id),I};var $c=Hu,Ju=Ku;function Ku(i,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(qc,this,t),this.length=this._features.length}function qc(i,t,r){i===15?t.version=r.readVarint():i===1?t.name=r.readString():i===5?t.extent=r.readVarint():i===2?t._features.push(r.pos):i===3?t._keys.push(r.readString()):i===4&&t._values.push(function(a){for(var o=null,p=a.readVarint()+a.pos;a.pos<p;){var d=a.readVarint()>>3;o=d===1?a.readString():d===2?a.readFloat():d===3?a.readDouble():d===4?a.readVarint64():d===5?a.readVarint():d===6?a.readSVarint():d===7?a.readBoolean():null}return o}(r))}Ku.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var t=this._pbf.readVarint()+this._pbf.pos;return new $c(this._pbf,t,this.extent,this._keys,this._values)};var jc=Ju;function Gc(i,t,r){if(i===3){var a=new jc(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}ks.VectorTile=function(i,t){this.layers=i.readFields(Gc,{},t)},ks.VectorTileFeature=Hu,ks.VectorTileLayer=Ju;const Zc=ks.VectorTileFeature.types,Wl=Math.pow(2,13);function Yn(i,t,r,a,o,p,d,f){i.emplaceBack(t,r,2*Math.floor(a*Wl)+d,o*Wl*2,p*Wl*2,Math.round(f))}class Yl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new _t,this.centroidVertexArray=new pt,this.indexArray=new Ge,this.programConfigurations=new xr(t.layers,t.zoom),this.segments=new ce,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){this.features=[],this.hasPattern=Hl("fill-extrusion",this.layers,r);for(const{feature:o,id:p,index:d,sourceLayerIndex:f}of t){const _=this.layers[0]._featureFilter.needGeometry,x=oa(o,_);if(!this.layers[0]._featureFilter.filter(new he(this.zoom),x,a))continue;const b={id:p,sourceLayerIndex:f,index:d,geometry:_?x.geometry:na(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(Jl("fill-extrusion",this.layers,b,this.zoom,r)):this.addFeature(b,b.geometry,d,a,{}),r.featureIndex.insert(o,b.geometry,d,f,this.index,!0)}}addFeatures(t,r,a){for(const o of this.features){const{geometry:p}=o;this.addFeature(o,p,o.index,r,a)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Oc),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Rc.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,a,o,p){const d={x:0,y:0,vertexCount:0};for(const f of Xl(r,500)){let _=0;for(const E of f)_+=E.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const E of f){if(E.length===0||Hc(E))continue;let D=0;for(let V=0;V<E.length;V++){const $=E[V];if(V>=1){const J=E[V-1];if(!Xc($,J)){x.vertexLength+4>ce.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const j=$.sub(J)._perp()._unit(),W=J.dist($);D+W>32768&&(D=0),Yn(this.layoutVertexArray,$.x,$.y,j.x,j.y,0,0,D),Yn(this.layoutVertexArray,$.x,$.y,j.x,j.y,0,1,D),d.x+=2*$.x,d.y+=2*$.y,d.vertexCount+=2,D+=W,Yn(this.layoutVertexArray,J.x,J.y,j.x,j.y,0,0,D),Yn(this.layoutVertexArray,J.x,J.y,j.x,j.y,0,1,D),d.x+=2*J.x,d.y+=2*J.y,d.vertexCount+=2;const Q=x.vertexLength;this.indexArray.emplaceBack(Q,Q+2,Q+1),this.indexArray.emplaceBack(Q+1,Q+2,Q+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+_>ce.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray)),Zc[t.type]!=="Polygon")continue;const b=[],T=[],I=x.vertexLength;for(const E of f)if(E.length!==0){E!==f[0]&&T.push(b.length/2);for(let D=0;D<E.length;D++){const V=E[D];Yn(this.layoutVertexArray,V.x,V.y,0,0,1,1,0),d.x+=V.x,d.y+=V.y,d.vertexCount+=1,b.push(V.x),b.push(V.y)}}const C=ju(b,T);for(let E=0;E<C.length;E+=3)this.indexArray.emplaceBack(I+C[E],I+C[E+2],I+C[E+1]);x.primitiveLength+=C.length/3,x.vertexLength+=_}for(let f=0;f<d.vertexCount;f++)this.centroidVertexArray.emplaceBack(Math.floor(d.x/d.vertexCount),Math.floor(d.y/d.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,o)}}function Xc(i,t){return i.x===t.x&&(i.x<0||i.x>Me)||i.y===t.y&&(i.y<0||i.y>Me)}function Hc(i){return i.every(t=>t.x<0)||i.every(t=>t.x>Me)||i.every(t=>t.y<0)||i.every(t=>t.y>Me)}let Wu;wt("FillExtrusionBucket",Yl,{omit:["layers","features"]});var Jc={get paint(){return Wu=Wu||new ze({"fill-extrusion-opacity":new Ct(rt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Dt(rt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ct(rt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ct(rt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ra(rt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Dt(rt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Dt(rt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ct(rt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Kc extends Vi{constructor(t){super(t,Jc)}createBucket(t){return new Yl(t)}queryRadius(){return Ko(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,r,a,o,p,d,f,_){const x=Wo(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),d.angle,f),b=this.paint.get("fill-extrusion-height").evaluate(r,a),T=this.paint.get("fill-extrusion-base").evaluate(r,a),I=function(E,D,V,$){const J=[];for(const j of E){const W=[j.x,j.y,0,1];Yo(W,W,D),J.push(new Bt(W[0]/W[3],W[1]/W[3]))}return J}(x,_),C=function(E,D,V,$){const J=[],j=[],W=$[8]*D,Q=$[9]*D,ot=$[10]*D,bt=$[11]*D,It=$[8]*V,xt=$[9]*V,yt=$[10]*V,dt=$[11]*V;for(const St of E){const mt=[],ct=[];for(const kt of St){const Pt=kt.x,$t=kt.y,pe=$[0]*Pt+$[4]*$t+$[12],fe=$[1]*Pt+$[5]*$t+$[13],Re=$[2]*Pt+$[6]*$t+$[14],Ni=$[3]*Pt+$[7]*$t+$[15],gi=Re+ot,De=Ni+bt,Xe=pe+It,Ye=fe+xt,_i=Re+yt,yi=Ni+dt,Oe=new Bt((pe+W)/De,(fe+Q)/De);Oe.z=gi/De,mt.push(Oe);const Ve=new Bt(Xe/yi,Ye/yi);Ve.z=_i/yi,ct.push(Ve)}J.push(mt),j.push(ct)}return[J,j]}(o,T,b,_);return function(E,D,V){let $=1/0;Pu(V,D)&&($=Yu(V,D[0]));for(let J=0;J<D.length;J++){const j=D[J],W=E[J];for(let Q=0;Q<j.length-1;Q++){const ot=j[Q],bt=[ot,j[Q+1],W[Q+1],W[Q],ot];zu(V,bt)&&($=Math.min($,Yu(V,bt)))}}return $!==1/0&&$}(C[0],C[1],I)}}function Qn(i,t){return i.x*t.x+i.y*t.y}function Yu(i,t){if(i.length===1){let r=0;const a=t[r++];let o;for(;!o||a.equals(o);)if(o=t[r++],!o)return 1/0;for(;r<t.length;r++){const p=t[r],d=i[0],f=o.sub(a),_=p.sub(a),x=d.sub(a),b=Qn(f,f),T=Qn(f,_),I=Qn(_,_),C=Qn(x,f),E=Qn(x,_),D=b*I-T*T,V=(I*C-T*E)/D,$=(b*E-T*C)/D,J=a.z*(1-V-$)+o.z*V+p.z*$;if(isFinite(J))return J}return 1/0}{let r=1/0;for(const a of t)r=Math.min(r,a.z);return r}}const Wc=xe([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Yc}=Wc,Qc=xe([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:tp}=Qc,ep=ks.VectorTileFeature.types,ip=Math.cos(Math.PI/180*37.5),Qu=Math.pow(2,14)/.5;class Ql{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Lt,this.layoutVertexArray2=new zt,this.indexArray=new Ge,this.programConfigurations=new xr(t.layers,t.zoom),this.segments=new ce,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){this.hasPattern=Hl("line",this.layers,r);const o=this.layers[0].layout.get("line-sort-key"),p=!o.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of t){const T=this.layers[0]._featureFilter.needGeometry,I=oa(f,T);if(!this.layers[0]._featureFilter.filter(new he(this.zoom),I,a))continue;const C=p?o.evaluate(I,{},a):void 0,E={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:T?I.geometry:na(f),patterns:{},sortKey:C};d.push(E)}p&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const T=Jl("line",this.layers,f,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(f,_,x,a,{});r.featureIndex.insert(t[x].feature,_,x,b,this.index)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}addFeatures(t,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,tp)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Yc),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,r,a,o,p){const d=this.layers[0].layout,f=d.get("line-join").evaluate(t,{}),_=d.get("line-cap"),x=d.get("line-miter-limit"),b=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const T of r)this.addLine(T,t,f,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,o)}addLine(t,r,a,o,p,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let $=0;$<t.length-1;$++)this.totalDistance+=t[$].dist(t[$+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const f=ep[r.type]==="Polygon";let _=t.length;for(;_>=2&&t[_-1].equals(t[_-2]);)_--;let x=0;for(;x<_-1&&t[x].equals(t[x+1]);)x++;if(_<(f?3:2))return;a==="bevel"&&(p=1.05);const b=this.overscaling<=16?15*Me/(512*this.overscaling):0,T=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray);let I,C,E,D,V;this.e1=this.e2=-1,f&&(I=t[_-2],V=t[x].sub(I)._unit()._perp());for(let $=x;$<_;$++){if(E=$===_-1?f?t[x+1]:void 0:t[$+1],E&&t[$].equals(E))continue;V&&(D=V),I&&(C=I),I=t[$],V=E?E.sub(I)._unit()._perp():D,D=D||V;let J=D.add(V);J.x===0&&J.y===0||J._unit();const j=D.x*V.x+D.y*V.y,W=J.x*V.x+J.y*V.y,Q=W!==0?1/W:1/0,ot=2*Math.sqrt(2-2*W),bt=W<ip&&C&&E,It=D.x*V.y-D.y*V.x>0;if(bt&&$>x){const dt=I.dist(C);if(dt>2*b){const St=I.sub(I.sub(C)._mult(b/dt)._round());this.updateDistance(C,St),this.addCurrentVertex(St,D,0,0,T),C=St}}const xt=C&&E;let yt=xt?a:f?"butt":o;if(xt&&yt==="round"&&(Q<d?yt="miter":Q<=2&&(yt="fakeround")),yt==="miter"&&Q>p&&(yt="bevel"),yt==="bevel"&&(Q>2&&(yt="flipbevel"),Q<p&&(yt="miter")),C&&this.updateDistance(C,I),yt==="miter")J._mult(Q),this.addCurrentVertex(I,J,0,0,T);else if(yt==="flipbevel"){if(Q>100)J=V.mult(-1);else{const dt=Q*D.add(V).mag()/D.sub(V).mag();J._perp()._mult(dt*(It?-1:1))}this.addCurrentVertex(I,J,0,0,T),this.addCurrentVertex(I,J.mult(-1),0,0,T)}else if(yt==="bevel"||yt==="fakeround"){const dt=-Math.sqrt(Q*Q-1),St=It?dt:0,mt=It?0:dt;if(C&&this.addCurrentVertex(I,D,St,mt,T),yt==="fakeround"){const ct=Math.round(180*ot/Math.PI/20);for(let kt=1;kt<ct;kt++){let Pt=kt/ct;if(Pt!==.5){const pe=Pt-.5;Pt+=Pt*pe*(Pt-1)*((1.0904+j*(j*(3.55645-1.43519*j)-3.2452))*pe*pe+(.848013+j*(.215638*j-1.06021)))}const $t=V.sub(D)._mult(Pt)._add(D)._unit()._mult(It?-1:1);this.addHalfVertex(I,$t.x,$t.y,!1,It,0,T)}}E&&this.addCurrentVertex(I,V,-St,-mt,T)}else if(yt==="butt")this.addCurrentVertex(I,J,0,0,T);else if(yt==="square"){const dt=C?1:-1;this.addCurrentVertex(I,J,dt,dt,T)}else yt==="round"&&(C&&(this.addCurrentVertex(I,D,0,0,T),this.addCurrentVertex(I,D,1,1,T,!0)),E&&(this.addCurrentVertex(I,V,-1,-1,T,!0),this.addCurrentVertex(I,V,0,0,T)));if(bt&&$<_-1){const dt=I.dist(E);if(dt>2*b){const St=I.add(E.sub(I)._mult(b/dt)._round());this.updateDistance(I,St),this.addCurrentVertex(St,V,0,0,T),I=St}}}}addCurrentVertex(t,r,a,o,p,d=!1){const f=r.y*o-r.x,_=-r.y-r.x*o;this.addHalfVertex(t,r.x+r.y*a,r.y-r.x*a,d,!1,a,p),this.addHalfVertex(t,f,_,d,!0,-o,p),this.distance>Qu/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,a,o,p,d))}addHalfVertex({x:t,y:r},a,o,p,d,f,_){const x=.5*(this.lineClips?this.scaledDistance*(Qu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(p?1:0),(r<<1)+(d?1:0),Math.round(63*a)+128,Math.round(63*o)+128,1+(f===0?0:f<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const b=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),_.primitiveLength++),d?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}}let th,eh;wt("LineBucket",Ql,{omit:["layers","patternFeatures"]});var ih={get paint(){return eh=eh||new ze({"line-opacity":new Dt(rt.paint_line["line-opacity"]),"line-color":new Dt(rt.paint_line["line-color"]),"line-translate":new Ct(rt.paint_line["line-translate"]),"line-translate-anchor":new Ct(rt.paint_line["line-translate-anchor"]),"line-width":new Dt(rt.paint_line["line-width"]),"line-gap-width":new Dt(rt.paint_line["line-gap-width"]),"line-offset":new Dt(rt.paint_line["line-offset"]),"line-blur":new Dt(rt.paint_line["line-blur"]),"line-dasharray":new Fn(rt.paint_line["line-dasharray"]),"line-pattern":new ra(rt.paint_line["line-pattern"]),"line-gradient":new Rn(rt.paint_line["line-gradient"])})},get layout(){return th=th||new ze({"line-cap":new Ct(rt.layout_line["line-cap"]),"line-join":new Dt(rt.layout_line["line-join"]),"line-miter-limit":new Ct(rt.layout_line["line-miter-limit"]),"line-round-limit":new Ct(rt.layout_line["line-round-limit"]),"line-sort-key":new Dt(rt.layout_line["line-sort-key"])})}};class rp extends Dt{possiblyEvaluate(t,r){return r=new he(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(t,r)}evaluate(t,r,a,o){return r=$e({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(t,r,a,o)}}let rl;class sp extends Vi{constructor(t){super(t,ih),this.gradientVersion=0,rl||(rl=new rp(ih.paint.properties["line-width"].specification),rl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(a){return a._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof Dr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,r){super.recalculate(t,r),this.paint._values["line-floorwidth"]=rl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Ql(t)}queryRadius(t){const r=t,a=rh(Gn("line-width",this,r),Gn("line-gap-width",this,r)),o=Gn("line-offset",this,r);return a/2+Math.abs(o)+Ko(this.paint.get("line-translate"))}queryIntersectsFeature(t,r,a,o,p,d,f){const _=Wo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),d.angle,f),x=f/2*rh(this.paint.get("line-width").evaluate(r,a),this.paint.get("line-gap-width").evaluate(r,a)),b=this.paint.get("line-offset").evaluate(r,a);return b&&(o=function(T,I){const C=[];for(let E=0;E<T.length;E++){const D=T[E],V=[];for(let $=0;$<D.length;$++){const J=D[$-1],j=D[$],W=D[$+1],Q=$===0?new Bt(0,0):j.sub(J)._unit()._perp(),ot=$===D.length-1?new Bt(0,0):W.sub(j)._unit()._perp(),bt=Q._add(ot)._unit(),It=bt.x*ot.x+bt.y*ot.y;It!==0&&bt._mult(1/It),V.push(bt._mult(I)._add(j))}C.push(V)}return C}(o,b*f)),function(T,I,C){for(let E=0;E<I.length;E++){const D=I[E];if(T.length>=3){for(let V=0;V<D.length;V++)if(ja(T,D[V]))return!0}if(hc(T,D,C))return!0}return!1}(_,o,x)}isTileClipped(){return!0}}function rh(i,t){return t>0?t+2*i:i}const ap=xe([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),np=xe([{name:"a_projected_pos",components:3,type:"Float32"}],4);xe([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const op=xe([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);xe([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const sh=xe([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),lp=xe([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function up(i,t,r){return i.sections.forEach(a=>{a.text=function(o,p,d){const f=p.layout.get("text-transform").evaluate(d,{});return f==="uppercase"?o=o.toLocaleUpperCase():f==="lowercase"&&(o=o.toLocaleLowerCase()),Ai.applyArabicShaping&&(o=Ai.applyArabicShaping(o)),o}(a.text,t,r)}),i}xe([{name:"triangle",components:3,type:"Uint16"}]),xe([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),xe([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),xe([{type:"Float32",name:"offsetX"}]),xe([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),xe([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const to={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Fe=24,ah=ae,nh=function(i,t,r,a,o){var p,d,f=8*o-a-1,_=(1<<f)-1,x=_>>1,b=-7,T=r?o-1:0,I=r?-1:1,C=i[t+T];for(T+=I,p=C&(1<<-b)-1,C>>=-b,b+=f;b>0;p=256*p+i[t+T],T+=I,b-=8);for(d=p&(1<<-b)-1,p>>=-b,b+=a;b>0;d=256*d+i[t+T],T+=I,b-=8);if(p===0)p=1-x;else{if(p===_)return d?NaN:1/0*(C?-1:1);d+=Math.pow(2,a),p-=x}return(C?-1:1)*d*Math.pow(2,p-a)},oh=function(i,t,r,a,o,p){var d,f,_,x=8*p-o-1,b=(1<<x)-1,T=b>>1,I=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=a?0:p-1,E=a?1:-1,D=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,d=b):(d=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-d))<1&&(d--,_*=2),(t+=d+T>=1?I/_:I*Math.pow(2,1-T))*_>=2&&(d++,_/=2),d+T>=b?(f=0,d=b):d+T>=1?(f=(t*_-1)*Math.pow(2,o),d+=T):(f=t*Math.pow(2,T-1)*Math.pow(2,o),d=0));o>=8;i[r+C]=255&f,C+=E,f/=256,o-=8);for(d=d<<o|f,x+=o;x>0;i[r+C]=255&d,C+=E,d/=256,x-=8);i[r+C-E]|=128*D};function ae(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}ae.Varint=0,ae.Fixed64=1,ae.Bytes=2,ae.Fixed32=5;var tu=4294967296,lh=1/tu,uh=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ss(i){return i.type===ae.Bytes?i.readVarint()+i.pos:i.pos+1}function hp(i,t,r){return r?4294967296*t+(i>>>0):4294967296*(t>>>0)+(i>>>0)}function hh(i,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var o=r.pos-1;o>=i;o--)r.buf[o+a]=r.buf[o]}function cp(i,t){for(var r=0;r<i.length;r++)t.writeVarint(i[r])}function pp(i,t){for(var r=0;r<i.length;r++)t.writeSVarint(i[r])}function dp(i,t){for(var r=0;r<i.length;r++)t.writeFloat(i[r])}function fp(i,t){for(var r=0;r<i.length;r++)t.writeDouble(i[r])}function mp(i,t){for(var r=0;r<i.length;r++)t.writeBoolean(i[r])}function gp(i,t){for(var r=0;r<i.length;r++)t.writeFixed32(i[r])}function _p(i,t){for(var r=0;r<i.length;r++)t.writeSFixed32(i[r])}function yp(i,t){for(var r=0;r<i.length;r++)t.writeFixed64(i[r])}function xp(i,t){for(var r=0;r<i.length;r++)t.writeSFixed64(i[r])}function sl(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16)+16777216*i[t+3]}function Ha(i,t,r){i[r]=t,i[r+1]=t>>>8,i[r+2]=t>>>16,i[r+3]=t>>>24}function ch(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16)+(i[t+3]<<24)}ae.prototype={destroy:function(){this.buf=null},readFields:function(i,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),o=a>>3,p=this.pos;this.type=7&a,i(o,t,this),this.pos===p&&this.skip(a)}return t},readMessage:function(i,t){return this.readFields(i,t,this.readVarint()+this.pos)},readFixed32:function(){var i=sl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=ch(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=sl(this.buf,this.pos)+sl(this.buf,this.pos+4)*tu;return this.pos+=8,i},readSFixed64:function(){var i=sl(this.buf,this.pos)+ch(this.buf,this.pos+4)*tu;return this.pos+=8,i},readFloat:function(){var i=nh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=nh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:function(o,p,d){var f,_,x=d.buf;if(f=(112&(_=x[d.pos++]))>>4,_<128||(f|=(127&(_=x[d.pos++]))<<3,_<128)||(f|=(127&(_=x[d.pos++]))<<10,_<128)||(f|=(127&(_=x[d.pos++]))<<17,_<128)||(f|=(127&(_=x[d.pos++]))<<24,_<128)||(f|=(1&(_=x[d.pos++]))<<31,_<128))return hp(o,f,p);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=a[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,t=this.pos;return this.pos=i,i-t>=12&&uh?function(r,a,o){return uh.decode(r.subarray(a,o))}(this.buf,t,i):function(r,a,o){for(var p="",d=a;d<o;){var f,_,x,b=r[d],T=null,I=b>239?4:b>223?3:b>191?2:1;if(d+I>o)break;I===1?b<128&&(T=b):I===2?(192&(f=r[d+1]))==128&&(T=(31&b)<<6|63&f)<=127&&(T=null):I===3?(_=r[d+2],(192&(f=r[d+1]))==128&&(192&_)==128&&((T=(15&b)<<12|(63&f)<<6|63&_)<=2047||T>=55296&&T<=57343)&&(T=null)):I===4&&(_=r[d+2],x=r[d+3],(192&(f=r[d+1]))==128&&(192&_)==128&&(192&x)==128&&((T=(15&b)<<18|(63&f)<<12|(63&_)<<6|63&x)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,I=1):T>65535&&(T-=65536,p+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),p+=String.fromCharCode(T),d+=I}return p}(this.buf,t,i)},readBytes:function(){var i=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,i);return this.pos=i,t},readPackedVarint:function(i,t){if(this.type!==ae.Bytes)return i.push(this.readVarint(t));var r=ss(this);for(i=i||[];this.pos<r;)i.push(this.readVarint(t));return i},readPackedSVarint:function(i){if(this.type!==ae.Bytes)return i.push(this.readSVarint());var t=ss(this);for(i=i||[];this.pos<t;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==ae.Bytes)return i.push(this.readBoolean());var t=ss(this);for(i=i||[];this.pos<t;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==ae.Bytes)return i.push(this.readFloat());var t=ss(this);for(i=i||[];this.pos<t;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==ae.Bytes)return i.push(this.readDouble());var t=ss(this);for(i=i||[];this.pos<t;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==ae.Bytes)return i.push(this.readFixed32());var t=ss(this);for(i=i||[];this.pos<t;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==ae.Bytes)return i.push(this.readSFixed32());var t=ss(this);for(i=i||[];this.pos<t;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==ae.Bytes)return i.push(this.readFixed64());var t=ss(this);for(i=i||[];this.pos<t;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==ae.Bytes)return i.push(this.readSFixed64());var t=ss(this);for(i=i||[];this.pos<t;)i.push(this.readSFixed64());return i},skip:function(i){var t=7&i;if(t===ae.Varint)for(;this.buf[this.pos++]>127;);else if(t===ae.Bytes)this.pos=this.readVarint()+this.pos;else if(t===ae.Fixed32)this.pos+=4;else{if(t!==ae.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(i,t){this.writeVarint(i<<3|t)},realloc:function(i){for(var t=this.length||16;t<this.pos+i;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),Ha(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),Ha(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),Ha(this.buf,-1&i,this.pos),Ha(this.buf,Math.floor(i*lh),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),Ha(this.buf,-1&i,this.pos),Ha(this.buf,Math.floor(i*lh),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(t,r){var a,o;if(t>=0?(a=t%4294967296|0,o=t/4294967296|0):(o=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,o=o+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(p,d,f){f.buf[f.pos++]=127&p|128,p>>>=7,f.buf[f.pos++]=127&p|128,p>>>=7,f.buf[f.pos++]=127&p|128,p>>>=7,f.buf[f.pos++]=127&p|128,f.buf[f.pos]=127&(p>>>=7)}(a,0,r),function(p,d){var f=(7&p)<<4;d.buf[d.pos++]|=f|((p>>>=3)?128:0),p&&(d.buf[d.pos++]=127&p|((p>>>=7)?128:0),p&&(d.buf[d.pos++]=127&p|((p>>>=7)?128:0),p&&(d.buf[d.pos++]=127&p|((p>>>=7)?128:0),p&&(d.buf[d.pos++]=127&p|((p>>>=7)?128:0),p&&(d.buf[d.pos++]=127&p)))))}(o,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var t=this.pos;this.pos=function(a,o,p){for(var d,f,_=0;_<o.length;_++){if((d=o.charCodeAt(_))>55295&&d<57344){if(!f){d>56319||_+1===o.length?(a[p++]=239,a[p++]=191,a[p++]=189):f=d;continue}if(d<56320){a[p++]=239,a[p++]=191,a[p++]=189,f=d;continue}d=f-55296<<10|d-56320|65536,f=null}else f&&(a[p++]=239,a[p++]=191,a[p++]=189,f=null);d<128?a[p++]=d:(d<2048?a[p++]=d>>6|192:(d<65536?a[p++]=d>>12|224:(a[p++]=d>>18|240,a[p++]=d>>12&63|128),a[p++]=d>>6&63|128),a[p++]=63&d|128)}return p}(this.buf,i,this.pos);var r=this.pos-t;r>=128&&hh(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),oh(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),oh(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var t=i.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=i[r]},writeRawMessage:function(i,t){this.pos++;var r=this.pos;i(t,this);var a=this.pos-r;a>=128&&hh(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,t,r){this.writeTag(i,ae.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(i,t){t.length&&this.writeMessage(i,cp,t)},writePackedSVarint:function(i,t){t.length&&this.writeMessage(i,pp,t)},writePackedBoolean:function(i,t){t.length&&this.writeMessage(i,mp,t)},writePackedFloat:function(i,t){t.length&&this.writeMessage(i,dp,t)},writePackedDouble:function(i,t){t.length&&this.writeMessage(i,fp,t)},writePackedFixed32:function(i,t){t.length&&this.writeMessage(i,gp,t)},writePackedSFixed32:function(i,t){t.length&&this.writeMessage(i,_p,t)},writePackedFixed64:function(i,t){t.length&&this.writeMessage(i,yp,t)},writePackedSFixed64:function(i,t){t.length&&this.writeMessage(i,xp,t)},writeBytesField:function(i,t){this.writeTag(i,ae.Bytes),this.writeBytes(t)},writeFixed32Field:function(i,t){this.writeTag(i,ae.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(i,t){this.writeTag(i,ae.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(i,t){this.writeTag(i,ae.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(i,t){this.writeTag(i,ae.Fixed64),this.writeSFixed64(t)},writeVarintField:function(i,t){this.writeTag(i,ae.Varint),this.writeVarint(t)},writeSVarintField:function(i,t){this.writeTag(i,ae.Varint),this.writeSVarint(t)},writeStringField:function(i,t){this.writeTag(i,ae.Bytes),this.writeString(t)},writeFloatField:function(i,t){this.writeTag(i,ae.Fixed32),this.writeFloat(t)},writeDoubleField:function(i,t){this.writeTag(i,ae.Fixed64),this.writeDouble(t)},writeBooleanField:function(i,t){this.writeVarintField(i,!!t)}};var eu=it(ah);const iu=3;function vp(i,t,r){i===1&&r.readMessage(bp,t)}function bp(i,t,r){if(i===3){const{id:a,bitmap:o,width:p,height:d,left:f,top:_,advance:x}=r.readMessage(wp,{});t.push({id:a,bitmap:new Xn({width:p+2*iu,height:d+2*iu},o),metrics:{width:p,height:d,left:f,top:_,advance:x}})}}function wp(i,t,r){i===1?t.id=r.readVarint():i===2?t.bitmap=r.readBytes():i===3?t.width=r.readVarint():i===4?t.height=r.readVarint():i===5?t.left=r.readSVarint():i===6?t.top=r.readSVarint():i===7&&(t.advance=r.readVarint())}const ph=iu;function dh(i){let t=0,r=0;for(const d of i)t+=d.w*d.h,r=Math.max(r,d.w);i.sort((d,f)=>f.h-d.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let o=0,p=0;for(const d of i)for(let f=a.length-1;f>=0;f--){const _=a[f];if(!(d.w>_.w||d.h>_.h)){if(d.x=_.x,d.y=_.y,p=Math.max(p,d.y+d.h),o=Math.max(o,d.x+d.w),d.w===_.w&&d.h===_.h){const x=a.pop();f<a.length&&(a[f]=x)}else d.h===_.h?(_.x+=d.w,_.w-=d.w):d.w===_.w?(_.y+=d.h,_.h-=d.h):(a.push({x:_.x+d.w,y:_.y,w:_.w-d.w,h:d.h}),_.y+=d.h,_.h-=d.h);break}}return{w:o,h:p,fill:t/(o*p)||0}}const zi=1;class ru{constructor(t,{pixelRatio:r,version:a,stretchX:o,stretchY:p,content:d}){this.paddedRect=t,this.pixelRatio=r,this.stretchX=o,this.stretchY=p,this.content=d,this.version=a}get tl(){return[this.paddedRect.x+zi,this.paddedRect.y+zi]}get br(){return[this.paddedRect.x+this.paddedRect.w-zi,this.paddedRect.y+this.paddedRect.h-zi]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*zi)/this.pixelRatio,(this.paddedRect.h-2*zi)/this.pixelRatio]}}class fh{constructor(t,r){const a={},o={};this.haveRenderCallbacks=[];const p=[];this.addImages(t,a,p),this.addImages(r,o,p);const{w:d,h:f}=dh(p),_=new ji({width:d||1,height:f||1});for(const x in t){const b=t[x],T=a[x].paddedRect;ji.copy(b.data,_,{x:0,y:0},{x:T.x+zi,y:T.y+zi},b.data)}for(const x in r){const b=r[x],T=o[x].paddedRect,I=T.x+zi,C=T.y+zi,E=b.data.width,D=b.data.height;ji.copy(b.data,_,{x:0,y:0},{x:I,y:C},b.data),ji.copy(b.data,_,{x:0,y:D-1},{x:I,y:C-1},{width:E,height:1}),ji.copy(b.data,_,{x:0,y:0},{x:I,y:C+D},{width:E,height:1}),ji.copy(b.data,_,{x:E-1,y:0},{x:I-1,y:C},{width:1,height:D}),ji.copy(b.data,_,{x:0,y:0},{x:I+E,y:C},{width:1,height:D})}this.image=_,this.iconPositions=a,this.patternPositions=o}addImages(t,r,a){for(const o in t){const p=t[o],d={x:0,y:0,w:p.data.width+2*zi,h:p.data.height+2*zi};a.push(d),r[o]=new ru(d,p),p.hasRenderCallback&&this.haveRenderCallbacks.push(o)}}patchUpdatedImages(t,r){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in t.updatedImages)this.patchUpdatedImage(this.iconPositions[a],t.getImage(a),r),this.patchUpdatedImage(this.patternPositions[a],t.getImage(a),r)}patchUpdatedImage(t,r,a){if(!t||!r||t.version===r.version)return;t.version=r.version;const[o,p]=t.tl;a.update(r.data,void 0,{x:o,y:p})}}var Ms;wt("ImagePosition",ru),wt("ImageAtlas",fh),u.ai=void 0,(Ms=u.ai||(u.ai={}))[Ms.none=0]="none",Ms[Ms.horizontal=1]="horizontal",Ms[Ms.vertical=2]="vertical",Ms[Ms.horizontalOnly=3]="horizontalOnly";const eo=-17;class io{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,r){const a=new io;return a.scale=t||1,a.fontStack=r,a}static forImage(t){const r=new io;return r.imageName=t,r}}class Ja{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,r){const a=new Ja;for(let o=0;o<t.sections.length;o++){const p=t.sections[o];p.image?a.addImageSection(p):a.addTextSection(p,r)}return a}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let r="";for(let a=0;a<t.length;a++){const o=t.charCodeAt(a+1)||null,p=t.charCodeAt(a-1)||null;r+=o&&Vo(o)&&!to[t[a+1]]||p&&Vo(p)&&!to[t[a-1]]||!to[t[a]]?t[a]:to[t[a]]}return r}(this.text)}trim(){let t=0;for(let a=0;a<this.text.length&&nl[this.text.charCodeAt(a)];a++)t++;let r=this.text.length;for(let a=this.text.length-1;a>=0&&a>=t&&nl[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)}substring(t,r){const a=new Ja;return a.text=this.text.substring(t,r),a.sectionIndex=this.sectionIndex.slice(t,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}addTextSection(t,r){this.text+=t.text,this.sections.push(io.forText(t.scale,t.fontStack||r));const a=this.sections.length-1;for(let o=0;o<t.text.length;++o)this.sectionIndex.push(a)}addImageSection(t){const r=t.image?t.image.name:"";if(r.length===0)return void ei("Can't add FormattedSection with an empty image.");const a=this.getNextImageSectionCharCode();a?(this.text+=String.fromCharCode(a),this.sections.push(io.forImage(r)),this.sectionIndex.push(this.sections.length-1)):ei("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function al(i,t,r,a,o,p,d,f,_,x,b,T,I,C,E,D){const V=Ja.fromFeature(i,o);let $;T===u.ai.vertical&&V.verticalizePunctuation();const{processBidirectionalText:J,processStyledBidirectionalText:j}=Ai;if(J&&V.sections.length===1){$=[];const ot=J(V.toString(),su(V,x,p,t,a,C,E));for(const bt of ot){const It=new Ja;It.text=bt,It.sections=V.sections;for(let xt=0;xt<bt.length;xt++)It.sectionIndex.push(0);$.push(It)}}else if(j){$=[];const ot=j(V.text,V.sectionIndex,su(V,x,p,t,a,C,E));for(const bt of ot){const It=new Ja;It.text=bt[0],It.sectionIndex=bt[1],It.sections=V.sections,$.push(It)}}else $=function(ot,bt){const It=[],xt=ot.text;let yt=0;for(const dt of bt)It.push(ot.substring(yt,dt)),yt=dt;return yt<xt.length&&It.push(ot.substring(yt,xt.length)),It}(V,su(V,x,p,t,a,C,E));const W=[],Q={positionedLines:W,text:V.toString(),top:b[1],bottom:b[1],left:b[0],right:b[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(ot,bt,It,xt,yt,dt,St,mt,ct,kt,Pt,$t){let pe=0,fe=eo,Re=0,Ni=0;const gi=mt==="right"?1:mt==="left"?0:.5;let De=0;for(const Oe of yt){Oe.trim();const Ve=Oe.getMaxScale(),ai=(Ve-1)*Fe,xi={positionedGlyphs:[],lineOffset:0};ot.positionedLines[De]=xi;const ni=xi.positionedGlyphs;let Pi=0;if(!Oe.length()){fe+=dt,++De;continue}for(let Ue=0;Ue<Oe.length();Ue++){const Zt=Oe.getSection(Ue),oi=Oe.getSectionIndex(Ue),Qe=Oe.getCharCode(Ue);let Ne=0,or=null,vr=null,br=null,as=Fe;const lr=!(ct===u.ai.horizontal||!Pt&&!Pn(Qe)||Pt&&(nl[Qe]||(Xe=Qe,vt.Arabic(Xe)||vt["Arabic Supplement"](Xe)||vt["Arabic Extended-A"](Xe)||vt["Arabic Presentation Forms-A"](Xe)||vt["Arabic Presentation Forms-B"](Xe))));if(Zt.imageName){const Zi=xt[Zt.imageName];if(!Zi)continue;br=Zt.imageName,ot.iconsInText=ot.iconsInText||!0,vr=Zi.paddedRect;const Ei=Zi.displaySize;Zt.scale=Zt.scale*Fe/$t,or={width:Ei[0],height:Ei[1],left:zi,top:-ph,advance:lr?Ei[1]:Ei[0]},Ne=ai+(Fe-Ei[1]*Zt.scale),as=or.advance;const ns=lr?Ei[0]*Zt.scale-Fe*Ve:Ei[1]*Zt.scale-Fe*Ve;ns>0&&ns>Pi&&(Pi=ns)}else{const Zi=It[Zt.fontStack],Ei=Zi&&Zi[Qe];if(Ei&&Ei.rect)vr=Ei.rect,or=Ei.metrics;else{const ns=bt[Zt.fontStack],oo=ns&&ns[Qe];if(!oo)continue;or=oo.metrics}Ne=(Ve-Zt.scale)*Fe}lr?(ot.verticalizable=!0,ni.push({glyph:Qe,imageName:br,x:pe,y:fe+Ne,vertical:lr,scale:Zt.scale,fontStack:Zt.fontStack,sectionIndex:oi,metrics:or,rect:vr}),pe+=as*Zt.scale+kt):(ni.push({glyph:Qe,imageName:br,x:pe,y:fe+Ne,vertical:lr,scale:Zt.scale,fontStack:Zt.fontStack,sectionIndex:oi,metrics:or,rect:vr}),pe+=or.advance*Zt.scale+kt)}ni.length!==0&&(Re=Math.max(pe-kt,Re),Ap(ni,0,ni.length-1,gi,Pi)),pe=0;const Ci=dt*Ve+Pi;xi.lineOffset=Math.max(Pi,ai),fe+=Ci,Ni=Math.max(Ci,Ni),++De}var Xe;const Ye=fe-eo,{horizontalAlign:_i,verticalAlign:yi}=au(St);(function(Oe,Ve,ai,xi,ni,Pi,Ci,Ue,Zt){const oi=(Ve-ai)*ni;let Qe=0;Qe=Pi!==Ci?-Ue*xi-eo:(-xi*Zt+.5)*Ci;for(const Ne of Oe)for(const or of Ne.positionedGlyphs)or.x+=oi,or.y+=Qe})(ot.positionedLines,gi,_i,yi,Re,Ni,dt,Ye,yt.length),ot.top+=-yi*Ye,ot.bottom=ot.top+Ye,ot.left+=-_i*Re,ot.right=ot.left+Re}(Q,t,r,a,$,d,f,_,T,x,I,D),!function(ot){for(const bt of ot)if(bt.positionedGlyphs.length!==0)return!1;return!0}(W)&&Q}const nl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Sp={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function mh(i,t,r,a,o,p){if(t.imageName){const d=a[t.imageName];return d?d.displaySize[0]*t.scale*Fe/p+o:0}{const d=r[t.fontStack],f=d&&d[i];return f?f.metrics.advance*t.scale+o:0}}function gh(i,t,r,a){const o=Math.pow(i-t,2);return a?i<t?o/2:2*o:o+Math.abs(r)*r}function Tp(i,t,r){let a=0;return i===10&&(a-=1e4),r&&(a+=150),i!==40&&i!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function _h(i,t,r,a,o,p){let d=null,f=gh(t,r,o,p);for(const _ of a){const x=gh(t-_.x,r,o,p)+_.badness;x<=f&&(d=_,f=x)}return{index:i,x:t,priorBreak:d,badness:f}}function yh(i){return i?yh(i.priorBreak).concat(i.index):[]}function su(i,t,r,a,o,p,d){if(p!=="point")return[];if(!i)return[];const f=[],_=function(I,C,E,D,V,$){let J=0;for(let j=0;j<I.length();j++){const W=I.getSection(j);J+=mh(I.getCharCode(j),W,D,V,C,$)}return J/Math.max(1,Math.ceil(J/E))}(i,t,r,a,o,d),x=i.text.indexOf("​")>=0;let b=0;for(let I=0;I<i.length();I++){const C=i.getSection(I),E=i.getCharCode(I);if(nl[E]||(b+=mh(E,C,a,o,t,d)),I<i.length()-1){const D=!((T=E)<11904||!(vt["Bopomofo Extended"](T)||vt.Bopomofo(T)||vt["CJK Compatibility Forms"](T)||vt["CJK Compatibility Ideographs"](T)||vt["CJK Compatibility"](T)||vt["CJK Radicals Supplement"](T)||vt["CJK Strokes"](T)||vt["CJK Symbols and Punctuation"](T)||vt["CJK Unified Ideographs Extension A"](T)||vt["CJK Unified Ideographs"](T)||vt["Enclosed CJK Letters and Months"](T)||vt["Halfwidth and Fullwidth Forms"](T)||vt.Hiragana(T)||vt["Ideographic Description Characters"](T)||vt["Kangxi Radicals"](T)||vt["Katakana Phonetic Extensions"](T)||vt.Katakana(T)||vt["Vertical Forms"](T)||vt["Yi Radicals"](T)||vt["Yi Syllables"](T)));(Sp[E]||D||C.imageName)&&f.push(_h(I+1,b,_,f,Tp(E,i.getCharCode(I+1),D&&x),!1))}}var T;return yh(_h(i.length(),b,_,f,0,!0))}function au(i){let t=.5,r=.5;switch(i){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Ap(i,t,r,a,o){if(!a&&!o)return;const p=i[r],d=(i[r].x+p.metrics.advance*p.scale)*a;for(let f=t;f<=r;f++)i[f].x-=d,i[f].y+=o}function Ip(i,t,r){const{horizontalAlign:a,verticalAlign:o}=au(r),p=t[0]-i.displaySize[0]*a,d=t[1]-i.displaySize[1]*o;return{image:i,top:d,bottom:d+i.displaySize[1],left:p,right:p+i.displaySize[0]}}function xh(i,t,r,a,o,p){const d=i.image;let f;if(d.content){const V=d.content,$=d.pixelRatio||1;f=[V[0]/$,V[1]/$,d.displaySize[0]-V[2]/$,d.displaySize[1]-V[3]/$]}const _=t.left*p,x=t.right*p;let b,T,I,C;r==="width"||r==="both"?(C=o[0]+_-a[3],T=o[0]+x+a[1]):(C=o[0]+(_+x-d.displaySize[0])/2,T=C+d.displaySize[0]);const E=t.top*p,D=t.bottom*p;return r==="height"||r==="both"?(b=o[1]+E-a[0],I=o[1]+D+a[2]):(b=o[1]+(E+D-d.displaySize[1])/2,I=b+d.displaySize[1]),{image:d,top:b,right:T,bottom:I,left:C,collisionPadding:f}}const ro=255,Or=128,Ds=ro*Or;function vh(i,t){const{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new he(i+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:o}=r;let p=0;for(;p<a.length&&a[p]<=i;)p++;p=Math.max(0,p-1);let d=p;for(;d<a.length&&a[d]<i+1;)d++;d=Math.min(a.length-1,d);const f=a[p],_=a[d];return r.kind==="composite"?{kind:"composite",minZoom:f,maxZoom:_,interpolationType:o}:{kind:"camera",minZoom:f,maxZoom:_,minSize:r.evaluate(new he(f)),maxSize:r.evaluate(new he(_)),interpolationType:o}}}function nu(i,t,r){let a="never";const o=i.get(t);return o?a=o:i.get(r)&&(a="always"),a}const zp=ks.VectorTileFeature.types,Pp=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ol(i,t,r,a,o,p,d,f,_,x,b,T,I){const C=f?Math.min(Ds,Math.round(f[0])):0,E=f?Math.min(Ds,Math.round(f[1])):0;i.emplaceBack(t,r,Math.round(32*a),Math.round(32*o),p,d,(C<<1)+(_?1:0),E,16*x,16*b,256*T,256*I)}function ou(i,t,r){i.emplaceBack(t.x,t.y,r),i.emplaceBack(t.x,t.y,r),i.emplaceBack(t.x,t.y,r),i.emplaceBack(t.x,t.y,r)}function Cp(i){for(const t of i.sections)if(Dl(t.text))return!0;return!1}class lu{constructor(t){this.layoutVertexArray=new qt,this.indexArray=new Ge,this.programConfigurations=t,this.segments=new ce,this.dynamicLayoutVertexArray=new Ut,this.opacityVertexArray=new Gt,this.hasVisibleVertices=!1,this.placedSymbolArray=new Z}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,r,a,o){this.isEmpty()||(a&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ap.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,np.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Pp,!0),this.opacityVertexBuffer.itemSize=1),(a||o)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}wt("SymbolBuffers",lu);class uu{constructor(t,r,a){this.layoutVertexArray=new t,this.layoutAttributes=r,this.indexArray=new a,this.segments=new ce,this.collisionVertexArray=new le}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,op.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}wt("CollisionBuffers",uu);class Ka{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(d=>d.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Ul([]),this.placementViewportMatrix=Ul([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=vh(this.zoom,r["text-size"]),this.iconSizeData=vh(this.zoom,r["icon-size"]);const a=this.layers[0].layout,o=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=nu(a,"text-overlap","text-allow-overlap")!=="never"||nu(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&!o.isConstant(),this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map(d=>u.ai[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=t.sourceID}createArrays(){this.text=new lu(new xr(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new lu(new xr(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new H,this.lineVertexArray=new tt,this.symbolInstances=new N,this.textAnchorOffsets=new nt}calculateGlyphDependencies(t,r,a,o,p){for(let d=0;d<t.length;d++)if(r[t.charCodeAt(d)]=!0,(a||o)&&p){const f=to[t.charAt(d)];f&&(r[f.charCodeAt(0)]=!0)}}populate(t,r,a){const o=this.layers[0],p=o.layout,d=p.get("text-font"),f=p.get("text-field"),_=p.get("icon-image"),x=(f.value.kind!=="constant"||f.value.value instanceof Je&&!f.value.value.isEmpty()||f.value.value.toString().length>0)&&(d.value.kind!=="constant"||d.value.value.length>0),b=_.value.kind!=="constant"||!!_.value.value||Object.keys(_.parameters).length>0,T=p.get("symbol-sort-key");if(this.features=[],!x&&!b)return;const I=r.iconDependencies,C=r.glyphDependencies,E=r.availableImages,D=new he(this.zoom);for(const{feature:V,id:$,index:J,sourceLayerIndex:j}of t){const W=o._featureFilter.needGeometry,Q=oa(V,W);if(!o._featureFilter.filter(D,Q,a))continue;let ot,bt;if(W||(Q.geometry=na(V)),x){const xt=o.getValueAndResolveTokens("text-field",Q,a,E),yt=Je.factory(xt);Cp(yt)&&(this.hasRTLText=!0),(!this.hasRTLText||Ln()==="unavailable"||this.hasRTLText&&Ai.isParsed())&&(ot=up(yt,o,Q))}if(b){const xt=o.getValueAndResolveTokens("icon-image",Q,a,E);bt=xt instanceof je?xt:je.fromString(xt)}if(!ot&&!bt)continue;const It=this.sortFeaturesByKey?T.evaluate(Q,{},a):void 0;if(this.features.push({id:$,text:ot,icon:bt,index:J,sourceLayerIndex:j,geometry:Q.geometry,properties:V.properties,type:zp[V.type],sortKey:It}),bt&&(I[bt.name]=!0),ot){const xt=d.evaluate(Q,{},a).join(","),yt=p.get("text-rotation-alignment")!=="viewport"&&p.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(u.ai.vertical)>=0;for(const dt of ot.sections)if(dt.image)I[dt.image.name]=!0;else{const St=In(ot.toString()),mt=dt.fontStack||xt,ct=C[mt]=C[mt]||{};this.calculateGlyphDependencies(dt.text,ct,yt,this.allowVerticalPlacement,St)}}}p.get("symbol-placement")==="line"&&(this.features=function(V){const $={},J={},j=[];let W=0;function Q(xt){j.push(V[xt]),W++}function ot(xt,yt,dt){const St=J[xt];return delete J[xt],J[yt]=St,j[St].geometry[0].pop(),j[St].geometry[0]=j[St].geometry[0].concat(dt[0]),St}function bt(xt,yt,dt){const St=$[yt];return delete $[yt],$[xt]=St,j[St].geometry[0].shift(),j[St].geometry[0]=dt[0].concat(j[St].geometry[0]),St}function It(xt,yt,dt){const St=dt?yt[0][yt[0].length-1]:yt[0][0];return`${xt}:${St.x}:${St.y}`}for(let xt=0;xt<V.length;xt++){const yt=V[xt],dt=yt.geometry,St=yt.text?yt.text.toString():null;if(!St){Q(xt);continue}const mt=It(St,dt),ct=It(St,dt,!0);if(mt in J&&ct in $&&J[mt]!==$[ct]){const kt=bt(mt,ct,dt),Pt=ot(mt,ct,j[kt].geometry);delete $[mt],delete J[ct],J[It(St,j[Pt].geometry,!0)]=Pt,j[kt].geometry=null}else mt in J?ot(mt,ct,dt):ct in $?bt(mt,ct,dt):(Q(xt),$[mt]=W-1,J[ct]=W-1)}return j.filter(xt=>xt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((V,$)=>V.sortKey-$.sortKey)}update(t,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,a))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){const a=this.lineVertexArray.length;if(t.segment!==void 0){let o=t.dist(r[t.segment+1]),p=t.dist(r[t.segment]);const d={};for(let f=t.segment+1;f<r.length;f++)d[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:o},f<r.length-1&&(o+=r[f+1].dist(r[f]));for(let f=t.segment||0;f>=0;f--)d[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:p},f>0&&(p+=r[f-1].dist(r[f]));for(let f=0;f<r.length;f++){const _=d[f];this.lineVertexArray.emplaceBack(_.x,_.y,_.tileUnitDistanceFromAnchor)}}return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(t,r,a,o,p,d,f,_,x,b,T,I){const C=t.indexArray,E=t.layoutVertexArray,D=t.segments.prepareSegment(4*r.length,E,C,this.canOverlap?d.sortKey:void 0),V=this.glyphOffsetArray.length,$=D.vertexLength,J=this.allowVerticalPlacement&&f===u.ai.vertical?Math.PI/2:0,j=d.text&&d.text.sections;for(let W=0;W<r.length;W++){const{tl:Q,tr:ot,bl:bt,br:It,tex:xt,pixelOffsetTL:yt,pixelOffsetBR:dt,minFontScaleX:St,minFontScaleY:mt,glyphOffset:ct,isSDF:kt,sectionIndex:Pt}=r[W],$t=D.vertexLength,pe=ct[1];ol(E,_.x,_.y,Q.x,pe+Q.y,xt.x,xt.y,a,kt,yt.x,yt.y,St,mt),ol(E,_.x,_.y,ot.x,pe+ot.y,xt.x+xt.w,xt.y,a,kt,dt.x,yt.y,St,mt),ol(E,_.x,_.y,bt.x,pe+bt.y,xt.x,xt.y+xt.h,a,kt,yt.x,dt.y,St,mt),ol(E,_.x,_.y,It.x,pe+It.y,xt.x+xt.w,xt.y+xt.h,a,kt,dt.x,dt.y,St,mt),ou(t.dynamicLayoutVertexArray,_,J),C.emplaceBack($t,$t+1,$t+2),C.emplaceBack($t+1,$t+2,$t+3),D.vertexLength+=4,D.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ct[0]),W!==r.length-1&&Pt===r[W+1].sectionIndex||t.programConfigurations.populatePaintArrays(E.length,d,d.index,{},I,j&&j[Pt])}t.placedSymbolArray.emplaceBack(_.x,_.y,V,this.glyphOffsetArray.length-V,$,x,b,_.segment,a?a[0]:0,a?a[1]:0,o[0],o[1],f,0,!1,0,T)}_addCollisionDebugVertex(t,r,a,o,p,d){return r.emplaceBack(0,0),t.emplaceBack(a.x,a.y,o,p,Math.round(d.x),Math.round(d.y))}addCollisionDebugVertices(t,r,a,o,p,d,f){const _=p.segments.prepareSegment(4,p.layoutVertexArray,p.indexArray),x=_.vertexLength,b=p.layoutVertexArray,T=p.collisionVertexArray,I=f.anchorX,C=f.anchorY;this._addCollisionDebugVertex(b,T,d,I,C,new Bt(t,r)),this._addCollisionDebugVertex(b,T,d,I,C,new Bt(a,r)),this._addCollisionDebugVertex(b,T,d,I,C,new Bt(a,o)),this._addCollisionDebugVertex(b,T,d,I,C,new Bt(t,o)),_.vertexLength+=4;const E=p.indexArray;E.emplaceBack(x,x+1),E.emplaceBack(x+1,x+2),E.emplaceBack(x+2,x+3),E.emplaceBack(x+3,x),_.primitiveLength+=4}addDebugCollisionBoxes(t,r,a,o){for(let p=t;p<r;p++){const d=this.collisionBoxArray.get(p);this.addCollisionDebugVertices(d.x1,d.y1,d.x2,d.y2,o?this.textCollisionBox:this.iconCollisionBox,d.anchorPoint,a)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new uu(Te,sh.members,Le),this.iconCollisionBox=new uu(Te,sh.members,Le);for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(t,r,a,o,p,d,f,_,x){const b={};for(let T=r;T<a;T++){const I=t.get(T);b.textBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},b.textFeatureIndex=I.featureIndex;break}for(let T=o;T<p;T++){const I=t.get(T);b.verticalTextBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},b.verticalTextFeatureIndex=I.featureIndex;break}for(let T=d;T<f;T++){const I=t.get(T);b.iconBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},b.iconFeatureIndex=I.featureIndex;break}for(let T=_;T<x;T++){const I=t.get(T);b.verticalIconBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},b.verticalIconFeatureIndex=I.featureIndex;break}return b}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const a=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,a.textBoxStartIndex,a.textBoxEndIndex,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a.iconBoxStartIndex,a.iconBoxEndIndex,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){const a=t.placedSymbolArray.get(r),o=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;p<o;p+=4)t.indexArray.emplaceBack(p,p+1,p+2),t.indexArray.emplaceBack(p+1,p+2,p+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const r=Math.sin(t),a=Math.cos(t),o=[],p=[],d=[];for(let f=0;f<this.symbolInstances.length;++f){d.push(f);const _=this.symbolInstances.get(f);o.push(0|Math.round(r*_.anchorX+a*_.anchorY)),p.push(_.featureIndex)}return d.sort((f,_)=>o[f]-o[_]||p[_]-p[f]),d}addToSortKeyRanges(t,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((o,p,d)=>{o>=0&&d.indexOf(o)===p&&this.addIndicesForPlacedSymbol(this.text,o)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let bh,wh;wt("SymbolBucket",Ka,{omit:["layers","collisionBoxArray","features","compareText"]}),Ka.MAX_GLYPHS=65535,Ka.addDynamicAttributes=ou;var hu={get paint(){return wh=wh||new ze({"icon-opacity":new Dt(rt.paint_symbol["icon-opacity"]),"icon-color":new Dt(rt.paint_symbol["icon-color"]),"icon-halo-color":new Dt(rt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Dt(rt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Dt(rt.paint_symbol["icon-halo-blur"]),"icon-translate":new Ct(rt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ct(rt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Dt(rt.paint_symbol["text-opacity"]),"text-color":new Dt(rt.paint_symbol["text-color"],{runtimeType:ii,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Dt(rt.paint_symbol["text-halo-color"]),"text-halo-width":new Dt(rt.paint_symbol["text-halo-width"]),"text-halo-blur":new Dt(rt.paint_symbol["text-halo-blur"]),"text-translate":new Ct(rt.paint_symbol["text-translate"]),"text-translate-anchor":new Ct(rt.paint_symbol["text-translate-anchor"])})},get layout(){return bh=bh||new ze({"symbol-placement":new Ct(rt.layout_symbol["symbol-placement"]),"symbol-spacing":new Ct(rt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ct(rt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Dt(rt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ct(rt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ct(rt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ct(rt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ct(rt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ct(rt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ct(rt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Dt(rt.layout_symbol["icon-size"]),"icon-text-fit":new Ct(rt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ct(rt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Dt(rt.layout_symbol["icon-image"]),"icon-rotate":new Dt(rt.layout_symbol["icon-rotate"]),"icon-padding":new Dt(rt.layout_symbol["icon-padding"]),"icon-keep-upright":new Ct(rt.layout_symbol["icon-keep-upright"]),"icon-offset":new Dt(rt.layout_symbol["icon-offset"]),"icon-anchor":new Dt(rt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ct(rt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ct(rt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ct(rt.layout_symbol["text-rotation-alignment"]),"text-field":new Dt(rt.layout_symbol["text-field"]),"text-font":new Dt(rt.layout_symbol["text-font"]),"text-size":new Dt(rt.layout_symbol["text-size"]),"text-max-width":new Dt(rt.layout_symbol["text-max-width"]),"text-line-height":new Ct(rt.layout_symbol["text-line-height"]),"text-letter-spacing":new Dt(rt.layout_symbol["text-letter-spacing"]),"text-justify":new Dt(rt.layout_symbol["text-justify"]),"text-radial-offset":new Dt(rt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ct(rt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Dt(rt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Dt(rt.layout_symbol["text-anchor"]),"text-max-angle":new Ct(rt.layout_symbol["text-max-angle"]),"text-writing-mode":new Ct(rt.layout_symbol["text-writing-mode"]),"text-rotate":new Dt(rt.layout_symbol["text-rotate"]),"text-padding":new Ct(rt.layout_symbol["text-padding"]),"text-keep-upright":new Ct(rt.layout_symbol["text-keep-upright"]),"text-transform":new Dt(rt.layout_symbol["text-transform"]),"text-offset":new Dt(rt.layout_symbol["text-offset"]),"text-allow-overlap":new Ct(rt.layout_symbol["text-allow-overlap"]),"text-overlap":new Ct(rt.layout_symbol["text-overlap"]),"text-ignore-placement":new Ct(rt.layout_symbol["text-ignore-placement"]),"text-optional":new Ct(rt.layout_symbol["text-optional"])})}};class Sh{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:pr,this.defaultValue=t}evaluate(t){if(t.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}wt("FormatSectionOverride",Sh,{omit:["defaultValue"]});class ll extends Vi{constructor(t){super(t,hu)}recalculate(t,r){if(super.recalculate(t,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const a=this.layout.get("text-writing-mode");if(a){const o=[];for(const p of a)o.indexOf(p)<0&&o.push(p);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,a,o){const p=this.layout.get(t).evaluate(r,{},a,o),d=this._unevaluatedLayout._values[t];return d.isDataDriven()||ka(d.value)||!p?p:function(f,_){return _.replace(/{([^{}]+)}/g,(x,b)=>f&&b in f?String(f[b]):"")}(r.properties,p)}createBucket(t){return new Ka(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of hu.paint.overridableProperties){if(!ll.hasPaintOverride(this.layout,t))continue;const r=this.paint.get(t),a=new Sh(r),o=new vn(a,r.property.specification);let p=null;p=r.value.kind==="constant"||r.value.kind==="source"?new bn("source",o):new Da("composite",o,r.value.zoomStops),this.paint._values[t]=new ri(r.property,p,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&ll.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){const a=t.get("text-field"),o=hu.paint.properties[r];let p=!1;const d=f=>{for(const _ of f)if(o.overrides&&o.overrides.hasOverride(_))return void(p=!0)};if(a.value.kind==="constant"&&a.value.value instanceof Je)d(a.value.value.sections);else if(a.value.kind==="source"){const f=x=>{p||(x instanceof Zr&&ge(x.value)===F?d(x.value.sections):x instanceof Ea?d(x.sections):x.eachChild(f))},_=a.value;_._styleExpression&&f(_._styleExpression.expression)}return p}}let Th;var Ep={get paint(){return Th=Th||new ze({"background-color":new Ct(rt.paint_background["background-color"]),"background-pattern":new Fn(rt.paint_background["background-pattern"]),"background-opacity":new Ct(rt.paint_background["background-opacity"])})}};class kp extends Vi{constructor(t){super(t,Ep)}}let Ah;var Mp={get paint(){return Ah=Ah||new ze({"raster-opacity":new Ct(rt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ct(rt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ct(rt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ct(rt.paint_raster["raster-brightness-max"]),"raster-saturation":new Ct(rt.paint_raster["raster-saturation"]),"raster-contrast":new Ct(rt.paint_raster["raster-contrast"]),"raster-resampling":new Ct(rt.paint_raster["raster-resampling"]),"raster-fade-duration":new Ct(rt.paint_raster["raster-fade-duration"])})}};class Dp extends Vi{constructor(t){super(t,Mp)}}class Lp extends Vi{constructor(t){super(t,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Bp{constructor(t){this._callback=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const cu=63710088e-1;class Ls{constructor(t,r){if(isNaN(t)||isNaN(r))throw new Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ls(Vs(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const r=Math.PI/180,a=this.lat*r,o=t.lat*r,p=Math.sin(a)*Math.sin(o)+Math.cos(a)*Math.cos(o)*Math.cos((t.lng-this.lng)*r);return cu*Math.acos(Math.min(p,1))}static convert(t){if(t instanceof Ls)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new Ls(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new Ls(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Ih=2*Math.PI*cu;function zh(i){return Ih*Math.cos(i*Math.PI/180)}function Ph(i){return(180+i)/360}function Ch(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Eh(i,t){return i/zh(t)}function kh(i){return 360*i-180}function pu(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class ul{constructor(t,r,a=0){this.x=+t,this.y=+r,this.z=+a}static fromLngLat(t,r=0){const a=Ls.convert(t);return new ul(Ph(a.lng),Ch(a.lat),Eh(r,a.lat))}toLngLat(){return new Ls(kh(this.x),pu(this.y))}toAltitude(){return this.z*zh(pu(this.y))}meterInMercatorCoordinateUnits(){return 1/Ih*(t=pu(this.y),1/Math.cos(t*Math.PI/180));var t}}function Mh(i,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class du{constructor(t,r,a){if(t<0||t>25||a<0||a>=Math.pow(2,t)||r<0||r>=Math.pow(2,t))throw new Error(`x=${r}, y=${a}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=r,this.y=a,this.key=so(0,t,t,r,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,a){const o=(d=this.y,f=this.z,_=Mh(256*(p=this.x),256*(d=Math.pow(2,f)-d-1),f),x=Mh(256*(p+1),256*(d+1),f),_[0]+","+_[1]+","+x[0]+","+x[1]);var p,d,f,_,x;const b=function(T,I,C){let E,D="";for(let V=T;V>0;V--)E=1<<V-1,D+=(I&E?1:0)+(C&E?2:0);return D}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(a==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,o)}isChildOf(t){const r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){const r=Math.pow(2,this.z);return new Bt((t.x*r-this.x)*Me,(t.y*r-this.y)*Me)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Dh{constructor(t,r){this.wrap=t,this.canonical=r,this.key=so(t,r.z,r.z,r.x,r.y)}}class Gi{constructor(t,r,a,o,p){if(t<a)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${a}`);this.overscaledZ=t,this.wrap=r,this.canonical=new du(a,+o,+p),this.key=so(r,t,a,o,p)}clone(){return new Gi(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-t;return t>this.canonical.z?new Gi(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Gi(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(t,r){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-t;return t>this.canonical.z?so(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):so(this.wrap*+r,t,t,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const r=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new Gi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,a=2*this.canonical.x,o=2*this.canonical.y;return[new Gi(r,this.wrap,r,a,o),new Gi(r,this.wrap,r,a+1,o),new Gi(r,this.wrap,r,a,o+1),new Gi(r,this.wrap,r,a+1,o+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new Gi(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new Gi(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Dh(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new ul(t.x-this.wrap,t.y))}}function so(i,t,r,a,o){(i*=2)<0&&(i=-1*i-1);const p=1<<r;return(p*p*i+p*o+a).toString(36)+r.toString(36)+t.toString(36)}wt("CanonicalTileID",du),wt("OverscaledTileID",Gi,{omit:["posMatrix"]});class Lh{constructor(t,r,a,o=1,p=1,d=1,f=0){if(this.uid=t,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(a&&!["mapbox","terrarium","custom"].includes(a))return void ei(`"${a}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;const _=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),a){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=o,this.greenFactor=p,this.blueFactor=d,this.baseShift=f;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let x=0;x<_;x++)this.data[this._idx(-1,x)]=this.data[this._idx(0,x)],this.data[this._idx(_,x)]=this.data[this._idx(_-1,x)],this.data[this._idx(x,-1)]=this.data[this._idx(x,0)],this.data[this._idx(x,_)]=this.data[this._idx(x,_-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(_,-1)]=this.data[this._idx(_-1,0)],this.data[this._idx(-1,_)]=this.data[this._idx(0,_-1)],this.data[this._idx(_,_)]=this.data[this._idx(_-1,_-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let x=0;x<_;x++)for(let b=0;b<_;b++){const T=this.get(x,b);T>this.max&&(this.max=T),T<this.min&&(this.min=T)}}get(t,r){const a=new Uint8Array(this.data.buffer),o=4*this._idx(t,r);return this.unpack(a[o],a[o+1],a[o+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,r){if(t<-1||t>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(t+1)}unpack(t,r,a){return t*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new ji({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,r,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let o=r*this.dim,p=r*this.dim+this.dim,d=a*this.dim,f=a*this.dim+this.dim;switch(r){case-1:o=p-1;break;case 1:p=o+1}switch(a){case-1:d=f-1;break;case 1:f=d+1}const _=-r*this.dim,x=-a*this.dim;for(let b=d;b<f;b++)for(let T=o;T<p;T++)this.data[this._idx(T,b)]=t.data[this._idx(T+_,b+x)]}}wt("DEMData",Lh);class Bh{constructor(t){this._stringToNumber={},this._numberToString=[];for(let r=0;r<t.length;r++){const a=t[r];this._stringToNumber[a]=r,this._numberToString[r]=a}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class Fh{constructor(t,r,a,o,p){this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=a,t._y=o,this.properties=t.properties,this.id=p}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(t[r]=this[r]);return t}}class Rh{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Is(Me,16,0),this.grid3D=new Is(Me,16,0),this.featureIndexArray=new ut,this.promoteId=r}insert(t,r,a,o,p,d){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,o,p);const _=d?this.grid3D:this.grid;for(let x=0;x<r.length;x++){const b=r[x],T=[1/0,1/0,-1/0,-1/0];for(let I=0;I<b.length;I++){const C=b[I];T[0]=Math.min(T[0],C.x),T[1]=Math.min(T[1],C.y),T[2]=Math.max(T[2],C.x),T[3]=Math.max(T[3],C.y)}T[0]<Me&&T[1]<Me&&T[2]>=0&&T[3]>=0&&_.insert(f,T[0],T[1],T[2],T[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ks.VectorTile(new eu(this.rawTileData)).layers,this.sourceLayerCoder=new Bh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,r,a,o){this.loadVTLayers();const p=t.params||{},d=Me/t.tileSize/t.scale,f=Sn(p.filter),_=t.queryGeometry,x=t.queryPadding*d,b=Vh(_),T=this.grid.query(b.minX-x,b.minY-x,b.maxX+x,b.maxY+x),I=Vh(t.cameraQueryGeometry),C=this.grid3D.query(I.minX-x,I.minY-x,I.maxX+x,I.maxY+x,(V,$,J,j)=>function(W,Q,ot,bt,It){for(const yt of W)if(Q<=yt.x&&ot<=yt.y&&bt>=yt.x&&It>=yt.y)return!0;const xt=[new Bt(Q,ot),new Bt(Q,It),new Bt(bt,It),new Bt(bt,ot)];if(W.length>2){for(const yt of xt)if(ja(W,yt))return!0}for(let yt=0;yt<W.length-1;yt++)if(pc(W[yt],W[yt+1],xt))return!0;return!1}(t.cameraQueryGeometry,V-x,$-x,J+x,j+x));for(const V of C)T.push(V);T.sort(Fp);const E={};let D;for(let V=0;V<T.length;V++){const $=T[V];if($===D)continue;D=$;const J=this.featureIndexArray.get($);let j=null;this.loadMatchingFeature(E,J.bucketIndex,J.sourceLayerIndex,J.featureIndex,f,p.layers,p.availableImages,r,a,o,(W,Q,ot)=>(j||(j=na(W)),Q.queryIntersectsFeature(_,W,ot,j,this.z,t.transform,d,t.pixelPosMatrix)))}return E}loadMatchingFeature(t,r,a,o,p,d,f,_,x,b,T){const I=this.bucketLayerIDs[r];if(d&&!function(V,$){for(let J=0;J<V.length;J++)if($.indexOf(V[J])>=0)return!0;return!1}(d,I))return;const C=this.sourceLayerCoder.decode(a),E=this.vtLayers[C].feature(o);if(p.needGeometry){const V=oa(E,!0);if(!p.filter(new he(this.tileID.overscaledZ),V,this.tileID.canonical))return}else if(!p.filter(new he(this.tileID.overscaledZ),E))return;const D=this.getId(E,C);for(let V=0;V<I.length;V++){const $=I[V];if(d&&d.indexOf($)<0)continue;const J=_[$];if(!J)continue;let j={};D&&b&&(j=b.getState(J.sourceLayer||"_geojsonTileLayer",D));const W=$e({},x[$]);W.paint=Oh(W.paint,J.paint,E,j,f),W.layout=Oh(W.layout,J.layout,E,j,f);const Q=!T||T(E,J,j);if(!Q)continue;const ot=new Fh(E,this.z,this.x,this.y,D);ot.layer=W;let bt=t[$];bt===void 0&&(bt=t[$]=[]),bt.push({featureIndex:o,feature:ot,intersectionZ:Q})}}lookupSymbolFeatures(t,r,a,o,p,d,f,_){const x={};this.loadVTLayers();const b=Sn(p);for(const T of t)this.loadMatchingFeature(x,a,o,T,b,d,f,_,r);return x}hasLayer(t){for(const r of this.bucketLayerIDs)for(const a of r)if(t===a)return!0;return!1}getId(t,r){let a=t.id;return this.promoteId&&(a=t.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[r]],typeof a=="boolean"&&(a=Number(a))),a}}function Oh(i,t,r,a,o){return me(i,(p,d)=>{const f=t instanceof $a?t.get(d):null;return f&&f.evaluate?f.evaluate(r,a,o):f})}function Vh(i){let t=1/0,r=1/0,a=-1/0,o=-1/0;for(const p of i)t=Math.min(t,p.x),r=Math.min(r,p.y),a=Math.max(a,p.x),o=Math.max(o,p.y);return{minX:t,minY:r,maxX:a,maxY:o}}function Fp(i,t){return t-i}function Uh(i,t,r,a,o){const p=[];for(let d=0;d<i.length;d++){const f=i[d];let _;for(let x=0;x<f.length-1;x++){let b=f[x],T=f[x+1];b.x<t&&T.x<t||(b.x<t?b=new Bt(t,b.y+(t-b.x)/(T.x-b.x)*(T.y-b.y))._round():T.x<t&&(T=new Bt(t,b.y+(t-b.x)/(T.x-b.x)*(T.y-b.y))._round()),b.y<r&&T.y<r||(b.y<r?b=new Bt(b.x+(r-b.y)/(T.y-b.y)*(T.x-b.x),r)._round():T.y<r&&(T=new Bt(b.x+(r-b.y)/(T.y-b.y)*(T.x-b.x),r)._round()),b.x>=a&&T.x>=a||(b.x>=a?b=new Bt(a,b.y+(a-b.x)/(T.x-b.x)*(T.y-b.y))._round():T.x>=a&&(T=new Bt(a,b.y+(a-b.x)/(T.x-b.x)*(T.y-b.y))._round()),b.y>=o&&T.y>=o||(b.y>=o?b=new Bt(b.x+(o-b.y)/(T.y-b.y)*(T.x-b.x),o)._round():T.y>=o&&(T=new Bt(b.x+(o-b.y)/(T.y-b.y)*(T.x-b.x),o)._round()),_&&b.equals(_[_.length-1])||(_=[b],p.push(_)),_.push(T)))))}}return p}wt("FeatureIndex",Rh,{omit:["rawTileData","sourceLayerCoder"]});class Bs extends Bt{constructor(t,r,a,o){super(t,r),this.angle=a,o!==void 0&&(this.segment=o)}clone(){return new Bs(this.x,this.y,this.angle,this.segment)}}function Nh(i,t,r,a,o){if(t.segment===void 0||r===0)return!0;let p=t,d=t.segment+1,f=0;for(;f>-r/2;){if(d--,d<0)return!1;f-=i[d].dist(p),p=i[d]}f+=i[d].dist(i[d+1]),d++;const _=[];let x=0;for(;f<r/2;){const b=i[d],T=i[d+1];if(!T)return!1;let I=i[d-1].angleTo(b)-b.angleTo(T);for(I=Math.abs((I+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:f,angleDelta:I}),x+=I;f-_[0].distance>a;)x-=_.shift().angleDelta;if(x>o)return!1;d++,f+=b.dist(T)}return!0}function $h(i){let t=0;for(let r=0;r<i.length-1;r++)t+=i[r].dist(i[r+1]);return t}function qh(i,t,r){return i?.6*t*r:0}function jh(i,t){return Math.max(i?i.right-i.left:0,t?t.right-t.left:0)}function Rp(i,t,r,a,o,p){const d=qh(r,o,p),f=jh(r,a)*p;let _=0;const x=$h(i)/2;for(let b=0;b<i.length-1;b++){const T=i[b],I=i[b+1],C=T.dist(I);if(_+C>x){const E=(x-_)/C,D=wi.number(T.x,I.x,E),V=wi.number(T.y,I.y,E),$=new Bs(D,V,I.angleTo(T),b);return $._round(),!d||Nh(i,$,f,d,t)?$:void 0}_+=C}}function Op(i,t,r,a,o,p,d,f,_){const x=qh(a,p,d),b=jh(a,o),T=b*d,I=i[0].x===0||i[0].x===_||i[0].y===0||i[0].y===_;return t-T<t/4&&(t=T+t/4),Gh(i,I?t/2*f%t:(b/2+2*p)*d*f%t,t,x,r,T,I,!1,_)}function Gh(i,t,r,a,o,p,d,f,_){const x=p/2,b=$h(i);let T=0,I=t-r,C=[];for(let E=0;E<i.length-1;E++){const D=i[E],V=i[E+1],$=D.dist(V),J=V.angleTo(D);for(;I+r<T+$;){I+=r;const j=(I-T)/$,W=wi.number(D.x,V.x,j),Q=wi.number(D.y,V.y,j);if(W>=0&&W<_&&Q>=0&&Q<_&&I-x>=0&&I+x<=b){const ot=new Bs(W,Q,J,E);ot._round(),a&&!Nh(i,ot,p,a,o)||C.push(ot)}}T+=$}return f||C.length||d||(C=Gh(i,T/2,r,a,o,p,d,!0,_)),C}wt("Anchor",Bs);const Wa=zi;function Zh(i,t,r,a){const o=[],p=i.image,d=p.pixelRatio,f=p.paddedRect.w-2*Wa,_=p.paddedRect.h-2*Wa,x=i.right-i.left,b=i.bottom-i.top,T=p.stretchX||[[0,f]],I=p.stretchY||[[0,_]],C=(dt,St)=>dt+St[1]-St[0],E=T.reduce(C,0),D=I.reduce(C,0),V=f-E,$=_-D;let J=0,j=E,W=0,Q=D,ot=0,bt=V,It=0,xt=$;if(p.content&&a){const dt=p.content;J=hl(T,0,dt[0]),W=hl(I,0,dt[1]),j=hl(T,dt[0],dt[2]),Q=hl(I,dt[1],dt[3]),ot=dt[0]-J,It=dt[1]-W,bt=dt[2]-dt[0]-j,xt=dt[3]-dt[1]-Q}const yt=(dt,St,mt,ct)=>{const kt=cl(dt.stretch-J,j,x,i.left),Pt=pl(dt.fixed-ot,bt,dt.stretch,E),$t=cl(St.stretch-W,Q,b,i.top),pe=pl(St.fixed-It,xt,St.stretch,D),fe=cl(mt.stretch-J,j,x,i.left),Re=pl(mt.fixed-ot,bt,mt.stretch,E),Ni=cl(ct.stretch-W,Q,b,i.top),gi=pl(ct.fixed-It,xt,ct.stretch,D),De=new Bt(kt,$t),Xe=new Bt(fe,$t),Ye=new Bt(fe,Ni),_i=new Bt(kt,Ni),yi=new Bt(Pt/d,pe/d),Oe=new Bt(Re/d,gi/d),Ve=t*Math.PI/180;if(Ve){const ni=Math.sin(Ve),Pi=Math.cos(Ve),Ci=[Pi,-ni,ni,Pi];De._matMult(Ci),Xe._matMult(Ci),_i._matMult(Ci),Ye._matMult(Ci)}const ai=dt.stretch+dt.fixed,xi=St.stretch+St.fixed;return{tl:De,tr:Xe,bl:_i,br:Ye,tex:{x:p.paddedRect.x+Wa+ai,y:p.paddedRect.y+Wa+xi,w:mt.stretch+mt.fixed-ai,h:ct.stretch+ct.fixed-xi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:yi,pixelOffsetBR:Oe,minFontScaleX:bt/d/x,minFontScaleY:xt/d/b,isSDF:r}};if(a&&(p.stretchX||p.stretchY)){const dt=Xh(T,V,E),St=Xh(I,$,D);for(let mt=0;mt<dt.length-1;mt++){const ct=dt[mt],kt=dt[mt+1];for(let Pt=0;Pt<St.length-1;Pt++)o.push(yt(ct,St[Pt],kt,St[Pt+1]))}}else o.push(yt({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:f+1},{fixed:0,stretch:_+1}));return o}function hl(i,t,r){let a=0;for(const o of i)a+=Math.max(t,Math.min(r,o[1]))-Math.max(t,Math.min(r,o[0]));return a}function Xh(i,t,r){const a=[{fixed:-Wa,stretch:0}];for(const[o,p]of i){const d=a[a.length-1];a.push({fixed:o-d.stretch,stretch:d.stretch}),a.push({fixed:o-d.stretch,stretch:d.stretch+(p-o)})}return a.push({fixed:t+Wa,stretch:r}),a}function cl(i,t,r,a){return i/t*r+a}function pl(i,t,r,a){return i-t*r/a}class dl{constructor(t,r,a,o,p,d,f,_,x,b){if(this.boxStartIndex=t.length,x){let T=d.top,I=d.bottom;const C=d.collisionPadding;C&&(T-=C[1],I+=C[3]);let E=I-T;E>0&&(E=Math.max(10,E),this.circleDiameter=E)}else{let T=d.top*f-_[0],I=d.bottom*f+_[2],C=d.left*f-_[3],E=d.right*f+_[1];const D=d.collisionPadding;if(D&&(C-=D[0]*f,T-=D[1]*f,E+=D[2]*f,I+=D[3]*f),b){const V=new Bt(C,T),$=new Bt(E,T),J=new Bt(C,I),j=new Bt(E,I),W=b*Math.PI/180;V._rotate(W),$._rotate(W),J._rotate(W),j._rotate(W),C=Math.min(V.x,$.x,J.x,j.x),E=Math.max(V.x,$.x,J.x,j.x),T=Math.min(V.y,$.y,J.y,j.y),I=Math.max(V.y,$.y,J.y,j.y)}t.emplaceBack(r.x,r.y,C,T,E,I,a,o,p)}this.boxEndIndex=t.length}}class Vp{constructor(t=[],r=Up){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:r,compare:a}=this,o=r[t];for(;t>0;){const p=t-1>>1,d=r[p];if(a(o,d)>=0)break;r[t]=d,t=p}r[t]=o}_down(t){const{data:r,compare:a}=this,o=this.length>>1,p=r[t];for(;t<o;){let d=1+(t<<1),f=r[d];const _=d+1;if(_<this.length&&a(r[_],f)<0&&(d=_,f=r[_]),a(f,p)>=0)break;r[t]=f,t=d}r[t]=p}}function Up(i,t){return i<t?-1:i>t?1:0}function Np(i,t=1,r=!1){let a=1/0,o=1/0,p=-1/0,d=-1/0;const f=i[0];for(let C=0;C<f.length;C++){const E=f[C];(!C||E.x<a)&&(a=E.x),(!C||E.y<o)&&(o=E.y),(!C||E.x>p)&&(p=E.x),(!C||E.y>d)&&(d=E.y)}const _=Math.min(p-a,d-o);let x=_/2;const b=new Vp([],$p);if(_===0)return new Bt(a,o);for(let C=a;C<p;C+=_)for(let E=o;E<d;E+=_)b.push(new Ya(C+x,E+x,x,i));let T=function(C){let E=0,D=0,V=0;const $=C[0];for(let J=0,j=$.length,W=j-1;J<j;W=J++){const Q=$[J],ot=$[W],bt=Q.x*ot.y-ot.x*Q.y;D+=(Q.x+ot.x)*bt,V+=(Q.y+ot.y)*bt,E+=3*bt}return new Ya(D/E,V/E,0,C)}(i),I=b.length;for(;b.length;){const C=b.pop();(C.d>T.d||!T.d)&&(T=C,r&&console.log("found best %d after %d probes",Math.round(1e4*C.d)/1e4,I)),C.max-T.d<=t||(x=C.h/2,b.push(new Ya(C.p.x-x,C.p.y-x,x,i)),b.push(new Ya(C.p.x+x,C.p.y-x,x,i)),b.push(new Ya(C.p.x-x,C.p.y+x,x,i)),b.push(new Ya(C.p.x+x,C.p.y+x,x,i)),I+=4)}return r&&(console.log(`num probes: ${I}`),console.log(`best distance: ${T.d}`)),T.p}function $p(i,t){return t.max-i.max}function Ya(i,t,r,a){this.p=new Bt(i,t),this.h=r,this.d=function(o,p){let d=!1,f=1/0;for(let _=0;_<p.length;_++){const x=p[_];for(let b=0,T=x.length,I=T-1;b<T;I=b++){const C=x[b],E=x[I];C.y>o.y!=E.y>o.y&&o.x<(E.x-C.x)*(o.y-C.y)/(E.y-C.y)+C.x&&(d=!d),f=Math.min(f,Cu(o,C,E))}}return(d?1:-1)*Math.sqrt(f)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var We;u.aq=void 0,(We=u.aq||(u.aq={}))[We.center=1]="center",We[We.left=2]="left",We[We.right=3]="right",We[We.top=4]="top",We[We.bottom=5]="bottom",We[We["top-left"]=6]="top-left",We[We["top-right"]=7]="top-right",We[We["bottom-left"]=8]="bottom-left",We[We["bottom-right"]=9]="bottom-right";const Fs=7,fu=Number.POSITIVE_INFINITY;function Hh(i,t){return t[1]!==fu?function(r,a,o){let p=0,d=0;switch(a=Math.abs(a),o=Math.abs(o),r){case"top-right":case"top-left":case"top":d=o-Fs;break;case"bottom-right":case"bottom-left":case"bottom":d=-o+Fs}switch(r){case"top-right":case"bottom-right":case"right":p=-a;break;case"top-left":case"bottom-left":case"left":p=a}return[p,d]}(i,t[0],t[1]):function(r,a){let o=0,p=0;a<0&&(a=0);const d=a/Math.SQRT2;switch(r){case"top-right":case"top-left":p=d-Fs;break;case"bottom-right":case"bottom-left":p=-d+Fs;break;case"bottom":p=-a+Fs;break;case"top":p=a-Fs}switch(r){case"top-right":case"bottom-right":o=-d;break;case"top-left":case"bottom-left":o=d;break;case"left":o=a;break;case"right":o=-a}return[o,p]}(i,t[0])}function Jh(i,t,r){var a;const o=i.layout,p=(a=o.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(t,{},r);if(p){const f=p.values,_=[];for(let x=0;x<f.length;x+=2){const b=_[x]=f[x],T=f[x+1].map(I=>I*Fe);b.startsWith("top")?T[1]-=Fs:b.startsWith("bottom")&&(T[1]+=Fs),_[x+1]=T}return new Bi(_)}const d=o.get("text-variable-anchor");if(d){let f;f=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[o.get("text-radial-offset").evaluate(t,{},r)*Fe,fu]:o.get("text-offset").evaluate(t,{},r).map(x=>x*Fe);const _=[];for(const x of d)_.push(x,Hh(x,f));return new Bi(_)}return null}function mu(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function qp(i,t,r,a,o,p,d,f,_,x,b){let T=p.textMaxSize.evaluate(t,{});T===void 0&&(T=d);const I=i.layers[0].layout,C=I.get("icon-offset").evaluate(t,{},b),E=Wh(r.horizontal),D=d/24,V=i.tilePixelRatio*D,$=i.tilePixelRatio*T/24,J=i.tilePixelRatio*f,j=i.tilePixelRatio*I.get("symbol-spacing"),W=I.get("text-padding")*i.tilePixelRatio,Q=function(ct,kt,Pt,$t=1){const pe=ct.get("icon-padding").evaluate(kt,{},Pt),fe=pe&&pe.values;return[fe[0]*$t,fe[1]*$t,fe[2]*$t,fe[3]*$t]}(I,t,b,i.tilePixelRatio),ot=I.get("text-max-angle")/180*Math.PI,bt=I.get("text-rotation-alignment")!=="viewport"&&I.get("symbol-placement")!=="point",It=I.get("icon-rotation-alignment")==="map"&&I.get("symbol-placement")!=="point",xt=I.get("symbol-placement"),yt=j/2,dt=I.get("icon-text-fit");let St;a&&dt!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(St=xh(a,r.vertical,dt,I.get("icon-text-fit-padding"),C,D)),E&&(a=xh(a,E,dt,I.get("icon-text-fit-padding"),C,D)));const mt=(ct,kt)=>{kt.x<0||kt.x>=Me||kt.y<0||kt.y>=Me||function(Pt,$t,pe,fe,Re,Ni,gi,De,Xe,Ye,_i,yi,Oe,Ve,ai,xi,ni,Pi,Ci,Ue,Zt,oi,Qe,Ne,or){const vr=Pt.addToLineVertexArray($t,pe);let br,as,lr,Zi,Ei=0,ns=0,oo=0,ec=0,Su=-1,Tu=-1;const os={};let ic=es("");if(Pt.allowVerticalPlacement&&fe.vertical){const li=De.layout.get("text-rotate").evaluate(Zt,{},Ne)+90;lr=new dl(Xe,$t,Ye,_i,yi,fe.vertical,Oe,Ve,ai,li),gi&&(Zi=new dl(Xe,$t,Ye,_i,yi,gi,ni,Pi,ai,li))}if(Re){const li=De.layout.get("icon-rotate").evaluate(Zt,{}),Xi=De.layout.get("icon-text-fit")!=="none",ua=Zh(Re,li,Qe,Xi),Sr=gi?Zh(gi,li,Qe,Xi):void 0;as=new dl(Xe,$t,Ye,_i,yi,Re,ni,Pi,!1,li),Ei=4*ua.length;const ha=Pt.iconSizeData;let Vr=null;ha.kind==="source"?(Vr=[Or*De.layout.get("icon-size").evaluate(Zt,{})],Vr[0]>Ds&&ei(`${Pt.layerIds[0]}: Value for "icon-size" is >= ${ro}. Reduce your "icon-size".`)):ha.kind==="composite"&&(Vr=[Or*oi.compositeIconSizes[0].evaluate(Zt,{},Ne),Or*oi.compositeIconSizes[1].evaluate(Zt,{},Ne)],(Vr[0]>Ds||Vr[1]>Ds)&&ei(`${Pt.layerIds[0]}: Value for "icon-size" is >= ${ro}. Reduce your "icon-size".`)),Pt.addSymbols(Pt.icon,ua,Vr,Ue,Ci,Zt,u.ai.none,$t,vr.lineStartIndex,vr.lineLength,-1,Ne),Su=Pt.icon.placedSymbolArray.length-1,Sr&&(ns=4*Sr.length,Pt.addSymbols(Pt.icon,Sr,Vr,Ue,Ci,Zt,u.ai.vertical,$t,vr.lineStartIndex,vr.lineLength,-1,Ne),Tu=Pt.icon.placedSymbolArray.length-1)}const rc=Object.keys(fe.horizontal);for(const li of rc){const Xi=fe.horizontal[li];if(!br){ic=es(Xi.text);const Sr=De.layout.get("text-rotate").evaluate(Zt,{},Ne);br=new dl(Xe,$t,Ye,_i,yi,Xi,Oe,Ve,ai,Sr)}const ua=Xi.positionedLines.length===1;if(oo+=Kh(Pt,$t,Xi,Ni,De,ai,Zt,xi,vr,fe.vertical?u.ai.horizontal:u.ai.horizontalOnly,ua?rc:[li],os,Su,oi,Ne),ua)break}fe.vertical&&(ec+=Kh(Pt,$t,fe.vertical,Ni,De,ai,Zt,xi,vr,u.ai.vertical,["vertical"],os,Tu,oi,Ne));const Zp=br?br.boxStartIndex:Pt.collisionBoxArray.length,Xp=br?br.boxEndIndex:Pt.collisionBoxArray.length,Hp=lr?lr.boxStartIndex:Pt.collisionBoxArray.length,Jp=lr?lr.boxEndIndex:Pt.collisionBoxArray.length,Kp=as?as.boxStartIndex:Pt.collisionBoxArray.length,Wp=as?as.boxEndIndex:Pt.collisionBoxArray.length,Yp=Zi?Zi.boxStartIndex:Pt.collisionBoxArray.length,Qp=Zi?Zi.boxEndIndex:Pt.collisionBoxArray.length;let wr=-1;const ml=(li,Xi)=>li&&li.circleDiameter?Math.max(li.circleDiameter,Xi):Xi;wr=ml(br,wr),wr=ml(lr,wr),wr=ml(as,wr),wr=ml(Zi,wr);const sc=wr>-1?1:0;sc&&(wr*=or/Fe),Pt.glyphOffsetArray.length>=Ka.MAX_GLYPHS&&ei("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Zt.sortKey!==void 0&&Pt.addToSortKeyRanges(Pt.symbolInstances.length,Zt.sortKey);const td=Jh(De,Zt,Ne),[ed,id]=function(li,Xi){const ua=li.length,Sr=Xi==null?void 0:Xi.values;if((Sr==null?void 0:Sr.length)>0)for(let ha=0;ha<Sr.length;ha+=2){const Vr=Sr[ha+1];li.emplaceBack(u.aq[Sr[ha]],Vr[0],Vr[1])}return[ua,li.length]}(Pt.textAnchorOffsets,td);Pt.symbolInstances.emplaceBack($t.x,$t.y,os.right>=0?os.right:-1,os.center>=0?os.center:-1,os.left>=0?os.left:-1,os.vertical||-1,Su,Tu,ic,Zp,Xp,Hp,Jp,Kp,Wp,Yp,Qp,Ye,oo,ec,Ei,ns,sc,0,Oe,wr,ed,id)}(i,kt,ct,r,a,o,St,i.layers[0],i.collisionBoxArray,t.index,t.sourceLayerIndex,i.index,V,[W,W,W,W],bt,_,J,Q,It,C,t,p,x,b,d)};if(xt==="line")for(const ct of Uh(t.geometry,0,0,Me,Me)){const kt=Op(ct,j,ot,r.vertical||E,a,24,$,i.overscaling,Me);for(const Pt of kt)E&&jp(i,E.text,yt,Pt)||mt(ct,Pt)}else if(xt==="line-center"){for(const ct of t.geometry)if(ct.length>1){const kt=Rp(ct,ot,r.vertical||E,a,24,$);kt&&mt(ct,kt)}}else if(t.type==="Polygon")for(const ct of Xl(t.geometry,0)){const kt=Np(ct,16);mt(ct[0],new Bs(kt.x,kt.y,0))}else if(t.type==="LineString")for(const ct of t.geometry)mt(ct,new Bs(ct[0].x,ct[0].y,0));else if(t.type==="Point")for(const ct of t.geometry)for(const kt of ct)mt([kt],new Bs(kt.x,kt.y,0))}function Kh(i,t,r,a,o,p,d,f,_,x,b,T,I,C,E){const D=function(J,j,W,Q,ot,bt,It,xt){const yt=Q.layout.get("text-rotate").evaluate(bt,{})*Math.PI/180,dt=[];for(const St of j.positionedLines)for(const mt of St.positionedGlyphs){if(!mt.rect)continue;const ct=mt.rect||{};let kt=ph+1,Pt=!0,$t=1,pe=0;const fe=(ot||xt)&&mt.vertical,Re=mt.metrics.advance*mt.scale/2;if(xt&&j.verticalizable&&(pe=St.lineOffset/2-(mt.imageName?-(Fe-mt.metrics.width*mt.scale)/2:(mt.scale-1)*Fe)),mt.imageName){const Ue=It[mt.imageName];Pt=Ue.sdf,$t=Ue.pixelRatio,kt=zi/$t}const Ni=ot?[mt.x+Re,mt.y]:[0,0];let gi=ot?[0,0]:[mt.x+Re+W[0],mt.y+W[1]-pe],De=[0,0];fe&&(De=gi,gi=[0,0]);const Xe=mt.metrics.isDoubleResolution?2:1,Ye=(mt.metrics.left-kt)*mt.scale-Re+gi[0],_i=(-mt.metrics.top-kt)*mt.scale+gi[1],yi=Ye+ct.w/Xe*mt.scale/$t,Oe=_i+ct.h/Xe*mt.scale/$t,Ve=new Bt(Ye,_i),ai=new Bt(yi,_i),xi=new Bt(Ye,Oe),ni=new Bt(yi,Oe);if(fe){const Ue=new Bt(-Re,Re-eo),Zt=-Math.PI/2,oi=Fe/2-Re,Qe=new Bt(5-eo-oi,-(mt.imageName?oi:0)),Ne=new Bt(...De);Ve._rotateAround(Zt,Ue)._add(Qe)._add(Ne),ai._rotateAround(Zt,Ue)._add(Qe)._add(Ne),xi._rotateAround(Zt,Ue)._add(Qe)._add(Ne),ni._rotateAround(Zt,Ue)._add(Qe)._add(Ne)}if(yt){const Ue=Math.sin(yt),Zt=Math.cos(yt),oi=[Zt,-Ue,Ue,Zt];Ve._matMult(oi),ai._matMult(oi),xi._matMult(oi),ni._matMult(oi)}const Pi=new Bt(0,0),Ci=new Bt(0,0);dt.push({tl:Ve,tr:ai,bl:xi,br:ni,tex:ct,writingMode:j.writingMode,glyphOffset:Ni,sectionIndex:mt.sectionIndex,isSDF:Pt,pixelOffsetTL:Pi,pixelOffsetBR:Ci,minFontScaleX:0,minFontScaleY:0})}return dt}(0,r,f,o,p,d,a,i.allowVerticalPlacement),V=i.textSizeData;let $=null;V.kind==="source"?($=[Or*o.layout.get("text-size").evaluate(d,{})],$[0]>Ds&&ei(`${i.layerIds[0]}: Value for "text-size" is >= ${ro}. Reduce your "text-size".`)):V.kind==="composite"&&($=[Or*C.compositeTextSizes[0].evaluate(d,{},E),Or*C.compositeTextSizes[1].evaluate(d,{},E)],($[0]>Ds||$[1]>Ds)&&ei(`${i.layerIds[0]}: Value for "text-size" is >= ${ro}. Reduce your "text-size".`)),i.addSymbols(i.text,D,$,f,p,d,x,t,_.lineStartIndex,_.lineLength,I,E);for(const J of b)T[J]=i.text.placedSymbolArray.length-1;return 4*D.length}function Wh(i){for(const t in i)return i[t];return null}function jp(i,t,r,a){const o=i.compareText;if(t in o){const p=o[t];for(let d=p.length-1;d>=0;d--)if(a.dist(p[d])<r)return!0}else o[t]=[];return o[t].push(a),!1}const Yh=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class gu{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,a]=new Uint8Array(t,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=a>>4;if(o!==1)throw new Error(`Got v${o} data when expected v1.`);const p=Yh[15&a];if(!p)throw new Error("Unrecognized array type.");const[d]=new Uint16Array(t,2,1),[f]=new Uint32Array(t,4,1);return new gu(f,d,p,t)}constructor(t,r=64,a=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const p=Yh.indexOf(this.ArrayType),d=2*t*this.ArrayType.BYTES_PER_ELEMENT,f=t*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-f%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+f+_,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+d+f+_),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+f+_,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=r,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return _u(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,a,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:d,nodeSize:f}=this,_=[0,p.length-1,0],x=[];for(;_.length;){const b=_.pop()||0,T=_.pop()||0,I=_.pop()||0;if(T-I<=f){for(let V=I;V<=T;V++){const $=d[2*V],J=d[2*V+1];$>=t&&$<=a&&J>=r&&J<=o&&x.push(p[V])}continue}const C=I+T>>1,E=d[2*C],D=d[2*C+1];E>=t&&E<=a&&D>=r&&D<=o&&x.push(p[C]),(b===0?t<=E:r<=D)&&(_.push(I),_.push(C-1),_.push(1-b)),(b===0?a>=E:o>=D)&&(_.push(C+1),_.push(T),_.push(1-b))}return x}within(t,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:p,nodeSize:d}=this,f=[0,o.length-1,0],_=[],x=a*a;for(;f.length;){const b=f.pop()||0,T=f.pop()||0,I=f.pop()||0;if(T-I<=d){for(let V=I;V<=T;V++)tc(p[2*V],p[2*V+1],t,r)<=x&&_.push(o[V]);continue}const C=I+T>>1,E=p[2*C],D=p[2*C+1];tc(E,D,t,r)<=x&&_.push(o[C]),(b===0?t-a<=E:r-a<=D)&&(f.push(I),f.push(C-1),f.push(1-b)),(b===0?t+a>=E:r+a>=D)&&(f.push(C+1),f.push(T),f.push(1-b))}return _}}function _u(i,t,r,a,o,p){if(o-a<=r)return;const d=a+o>>1;Qh(i,t,d,a,o,p),_u(i,t,r,a,d-1,1-p),_u(i,t,r,d+1,o,1-p)}function Qh(i,t,r,a,o,p){for(;o>a;){if(o-a>600){const x=o-a+1,b=r-a+1,T=Math.log(x),I=.5*Math.exp(2*T/3),C=.5*Math.sqrt(T*I*(x-I)/x)*(b-x/2<0?-1:1);Qh(i,t,r,Math.max(a,Math.floor(r-b*I/x+C)),Math.min(o,Math.floor(r+(x-b)*I/x+C)),p)}const d=t[2*r+p];let f=a,_=o;for(ao(i,t,a,r),t[2*o+p]>d&&ao(i,t,a,o);f<_;){for(ao(i,t,f,_),f++,_--;t[2*f+p]<d;)f++;for(;t[2*_+p]>d;)_--}t[2*a+p]===d?ao(i,t,a,_):(_++,ao(i,t,_,o)),_<=r&&(a=_+1),r<=_&&(o=_-1)}}function ao(i,t,r,a){yu(i,r,a),yu(t,2*r,2*a),yu(t,2*r+1,2*a+1)}function yu(i,t,r){const a=i[t];i[t]=i[r],i[r]=a}function tc(i,t,r,a){const o=i-r,p=t-a;return o*o+p*p}var xu;u.bh=void 0,(xu=u.bh||(u.bh={})).create="create",xu.load="load",xu.fullLoad="fullLoad";let fl=null,no=[];const vu=1e3/60,bu="loadTime",wu="fullLoadTime",Gp={mark(i){performance.mark(i)},frame(i){const t=i;fl!=null&&no.push(t-fl),fl=t},clearMetrics(){fl=null,no=[],performance.clearMeasures(bu),performance.clearMeasures(wu);for(const i in u.bh)performance.clearMarks(u.bh[i])},getPerformanceMetrics(){performance.measure(bu,u.bh.create,u.bh.load),performance.measure(wu,u.bh.create,u.bh.fullLoad);const i=performance.getEntriesByName(bu)[0].duration,t=performance.getEntriesByName(wu)[0].duration,r=no.length,a=1/(no.reduce((p,d)=>p+d,0)/r/1e3),o=no.filter(p=>p>vu).reduce((p,d)=>p+(d-vu)/vu,0);return{loadTime:i,fullLoadTime:t,fps:a,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}};u.$=function(i,t,r){var a,o,p,d,f,_,x,b,T,I,C,E,D=r[0],V=r[1],$=r[2];return t===i?(i[12]=t[0]*D+t[4]*V+t[8]*$+t[12],i[13]=t[1]*D+t[5]*V+t[9]*$+t[13],i[14]=t[2]*D+t[6]*V+t[10]*$+t[14],i[15]=t[3]*D+t[7]*V+t[11]*$+t[15]):(o=t[1],p=t[2],d=t[3],f=t[4],_=t[5],x=t[6],b=t[7],T=t[8],I=t[9],C=t[10],E=t[11],i[0]=a=t[0],i[1]=o,i[2]=p,i[3]=d,i[4]=f,i[5]=_,i[6]=x,i[7]=b,i[8]=T,i[9]=I,i[10]=C,i[11]=E,i[12]=a*D+f*V+T*$+t[12],i[13]=o*D+_*V+I*$+t[13],i[14]=p*D+x*V+C*$+t[14],i[15]=d*D+b*V+E*$+t[15]),i},u.A=Ga,u.B=wi,u.C=class{constructor(i,t,r){this.receive=a=>{const o=a.data,p=o.id;if(p&&(!o.targetMapId||this.mapId===o.targetMapId))if(o.type==="<cancel>"){delete this.tasks[p];const d=this.cancelCallbacks[p];delete this.cancelCallbacks[p],d&&d()}else ki()||o.mustQueue?(this.tasks[p]=o,this.taskQueue.push(p),this.invoker.trigger()):this.processTask(p,o)},this.process=()=>{if(!this.taskQueue.length)return;const a=this.taskQueue.shift(),o=this.tasks[a];delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),o&&this.processTask(a,o)},this.target=i,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Bp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ki()?i:window}send(i,t,r,a,o=!1){const p=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[p]=r);const d=[],f={id:p,type:i,hasCallback:!!r,targetMapId:a,mustQueue:o,sourceMapId:this.mapId,data:Br(t,d)};return this.target.postMessage(f,{transfer:d}),{cancel:()=>{r&&delete this.callbacks[p],this.target.postMessage({id:p,type:"<cancel>",targetMapId:a,sourceMapId:this.mapId})}}}processTask(i,t){if(t.type==="<response>"){const r=this.callbacks[i];delete this.callbacks[i],r&&(t.error?r(zs(t.error)):r(null,zs(t.data)))}else{let r=!1;const a=[],o=t.hasCallback?(f,_)=>{r=!0,delete this.cancelCallbacks[i];const x={id:i,type:"<response>",sourceMapId:this.mapId,error:f?Br(f):null,data:Br(_,a)};this.target.postMessage(x,{transfer:a})}:f=>{r=!0};let p=null;const d=zs(t.data);if(this.parent[t.type])p=this.parent[t.type](t.sourceMapId,d,o);else if("getWorkerSource"in this.parent){const f=t.type.split(".");p=this.parent.getWorkerSource(t.sourceMapId,f[0],d.source)[f[1]](d,o)}else o(new Error(`Could not find function ${t.type}`));!r&&p&&p.cancel&&(this.cancelCallbacks[i]=p.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},u.D=Ct,u.E=qr,u.F=function(i,t){const r={};for(let a=0;a<t.length;a++){const o=t[a];o in i&&(r[o]=i[o])}return r},u.G=Ph,u.H=Ch,u.I=ru,u.J=ca,u.K=Tr,u.L=Ls,u.M=Ns,u.N=Me,u.O=Gi,u.P=Bt,u.Q=xe,u.R=ji,u.S=ce,u.T=qo,u.U=ul,u.V=class extends Qr{},u.W=du,u.X=function(i,t){const r=window.document.createElement("video");r.muted=!0,r.onloadstart=function(){t(null,r)};for(let a=0;a<i.length;a++){const o=window.document.createElement("source");hr(i[a])||(r.crossOrigin="Anonymous"),o.src=i[a],r.appendChild(o)}return{cancel:()=>{}}},u.Y=ft,u.Z=function(){var i=new Ga(16);return Ga!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},u._=Hi,u.a=Us,u.a$=class extends P{},u.a0=function(i,t,r){var a=r[0],o=r[1],p=r[2];return i[0]=t[0]*a,i[1]=t[1]*a,i[2]=t[2]*a,i[3]=t[3]*a,i[4]=t[4]*o,i[5]=t[5]*o,i[6]=t[6]*o,i[7]=t[7]*o,i[8]=t[8]*p,i[9]=t[9]*p,i[10]=t[10]*p,i[11]=t[11]*p,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i},u.a1=Du,u.a2=function(){return pa++},u.a3=R,u.a4=Ka,u.a5=function(){Ai.isLoading()||Ai.isLoaded()||Ln()!=="deferred"||$o()},u.a6=Sn,u.a7=oa,u.a8=he,u.a9=Fh,u.aA=ea,u.aB=function(i){i=i.slice();const t=Object.create(null);for(let r=0;r<i.length;r++)t[i[r].id]=i[r];for(let r=0;r<i.length;r++)"ref"in i[r]&&(i[r]=Di(i[r],t[i[r].ref]));return i},u.aC=function(i){if(i.type==="custom")return new Lp(i);switch(i.type){case"background":return new kp(i);case"circle":return new mc(i);case"fill":return new Bc(i);case"fill-extrusion":return new Kc(i);case"heatmap":return new _c(i);case"hillshade":return new xc(i);case"line":return new sp(i);case"raster":return new Dp(i);case"symbol":return new ll(i)}},u.aD=$i,u.aE=function(i,t){if(!i)return[{command:Wt.setStyle,args:[t]}];let r=[];try{if(!ne(i.version,t.version))return[{command:Wt.setStyle,args:[t]}];ne(i.center,t.center)||r.push({command:Wt.setCenter,args:[t.center]}),ne(i.zoom,t.zoom)||r.push({command:Wt.setZoom,args:[t.zoom]}),ne(i.bearing,t.bearing)||r.push({command:Wt.setBearing,args:[t.bearing]}),ne(i.pitch,t.pitch)||r.push({command:Wt.setPitch,args:[t.pitch]}),ne(i.sprite,t.sprite)||r.push({command:Wt.setSprite,args:[t.sprite]}),ne(i.glyphs,t.glyphs)||r.push({command:Wt.setGlyphs,args:[t.glyphs]}),ne(i.transition,t.transition)||r.push({command:Wt.setTransition,args:[t.transition]}),ne(i.light,t.light)||r.push({command:Wt.setLight,args:[t.light]});const a={},o=[];(function(d,f,_,x){let b;for(b in f=f||{},d=d||{})Object.prototype.hasOwnProperty.call(d,b)&&(Object.prototype.hasOwnProperty.call(f,b)||ms(b,_,x));for(b in f)Object.prototype.hasOwnProperty.call(f,b)&&(Object.prototype.hasOwnProperty.call(d,b)?ne(d[b],f[b])||(d[b].type==="geojson"&&f[b].type==="geojson"&&fa(d,f,b)?_.push({command:Wt.setGeoJSONSourceData,args:[b,f[b].data]}):cr(b,f,_,x)):Yi(b,f,_))})(i.sources,t.sources,o,a);const p=[];i.layers&&i.layers.forEach(d=>{a[d.source]?r.push({command:Wt.removeLayer,args:[d.id]}):p.push(d)}),r=r.concat(o),function(d,f,_){f=f||[];const x=(d=d||[]).map(Er),b=f.map(Er),T=d.reduce(jr,{}),I=f.reduce(jr,{}),C=x.slice(),E=Object.create(null);let D,V,$,J,j,W,Q;for(D=0,V=0;D<x.length;D++)$=x[D],Object.prototype.hasOwnProperty.call(I,$)?V++:(_.push({command:Wt.removeLayer,args:[$]}),C.splice(C.indexOf($,V),1));for(D=0,V=0;D<b.length;D++)$=b[b.length-1-D],C[C.length-1-D]!==$&&(Object.prototype.hasOwnProperty.call(T,$)?(_.push({command:Wt.removeLayer,args:[$]}),C.splice(C.lastIndexOf($,C.length-V),1)):V++,W=C[C.length-D],_.push({command:Wt.addLayer,args:[I[$],W]}),C.splice(C.length-D,0,$),E[$]=!0);for(D=0;D<b.length;D++)if($=b[D],J=T[$],j=I[$],!E[$]&&!ne(J,j))if(ne(J.source,j.source)&&ne(J["source-layer"],j["source-layer"])&&ne(J.type,j.type)){for(Q in gs(J.layout,j.layout,_,$,null,Wt.setLayoutProperty),gs(J.paint,j.paint,_,$,null,Wt.setPaintProperty),ne(J.filter,j.filter)||_.push({command:Wt.setFilter,args:[$,j.filter]}),ne(J.minzoom,j.minzoom)&&ne(J.maxzoom,j.maxzoom)||_.push({command:Wt.setLayerZoomRange,args:[$,j.minzoom,j.maxzoom]}),J)Object.prototype.hasOwnProperty.call(J,Q)&&Q!=="layout"&&Q!=="paint"&&Q!=="filter"&&Q!=="metadata"&&Q!=="minzoom"&&Q!=="maxzoom"&&(Q.indexOf("paint.")===0?gs(J[Q],j[Q],_,$,Q.slice(6),Wt.setPaintProperty):ne(J[Q],j[Q])||_.push({command:Wt.setLayerProperty,args:[$,Q,j[Q]]}));for(Q in j)Object.prototype.hasOwnProperty.call(j,Q)&&!Object.prototype.hasOwnProperty.call(J,Q)&&Q!=="layout"&&Q!=="paint"&&Q!=="filter"&&Q!=="metadata"&&Q!=="minzoom"&&Q!=="maxzoom"&&(Q.indexOf("paint.")===0?gs(J[Q],j[Q],_,$,Q.slice(6),Wt.setPaintProperty):ne(J[Q],j[Q])||_.push({command:Wt.setLayerProperty,args:[$,Q,j[Q]]}))}else _.push({command:Wt.removeLayer,args:[$]}),W=C[C.lastIndexOf($)+1],_.push({command:Wt.addLayer,args:[j,W]})}(p,t.layers,r)}catch(a){console.warn("Unable to compute style diff:",a),r=[{command:Wt.setStyle,args:[t]}]}return r},u.aF=function(i){const t=[],r=i.id;return r===void 0&&t.push({message:`layers.${r}: missing required property "id"`}),i.render===void 0&&t.push({message:`layers.${r}: missing required method "render"`}),i.renderingMode&&i.renderingMode!=="2d"&&i.renderingMode!=="3d"&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},u.aG=function i(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let a=0;a<t.length;a++)if(!i(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(const a in t)if(!i(t[a],r[a]))return!1;return!0}return t===r},u.aH=me,u.aI=cs,u.aJ=ia,u.aK=function(i){return i({pluginStatus:di,pluginURL:Fr}),ia.on("pluginStateChange",i),i},u.aL=class extends is{constructor(i,t){super(i,t),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},u.aM=qa,u.aN=class extends is{constructor(i,t){super(i,t),this.current=Bl}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let t=1;t<16;t++)if(i[t]!==this.current[t]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},u.aO=Xo,u.aP=class extends is{constructor(i,t){super(i,t),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},u.aQ=class extends is{constructor(i,t){super(i,t),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},u.aR=Ho,u.aS=function(i,t,r,a,o,p,d){var f=1/(t-r),_=1/(a-o),x=1/(p-d);return i[0]=-2*f,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*_,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*x,i[11]=0,i[12]=(t+r)*f,i[13]=(o+a)*_,i[14]=(d+p)*x,i[15]=1,i},u.aT=ie,u.aU=fc,u.aV=class extends n{},u.aW=lp,u.aX=class extends c{},u.aY=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},u.aZ=Ou,u.a_=pt,u.aa=function(i){const t={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,a,o,p)=>{const d=o||p;return t[a]=!d||d.toLowerCase(),""}),t["max-age"]){const r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t},u.ab=function(i,t){const r=[];for(const a in i)a in t||r.push(a);return r},u.ac=function(i){if(Ur==null){const t=i.navigator?i.navigator.userAgent:null;Ur=!!i.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Ur},u.ad=Ki,u.ae=function(i,t,r){var a=Math.sin(r),o=Math.cos(r),p=t[0],d=t[1],f=t[2],_=t[3],x=t[4],b=t[5],T=t[6],I=t[7];return t!==i&&(i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[0]=p*o+x*a,i[1]=d*o+b*a,i[2]=f*o+T*a,i[3]=_*o+I*a,i[4]=x*o-p*a,i[5]=b*o-d*a,i[6]=T*o-f*a,i[7]=I*o-_*a,i},u.af=function(i){var t=new Ga(16);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[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t},u.ag=Yo,u.ah=function(i,t){let r=0,a=0;if(i.kind==="constant")a=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:o,minZoom:p,maxZoom:d}=i,f=o?Ki(Si.interpolationFactor(o,t,p,d),0,1):0;i.kind==="camera"?a=wi.number(i.minSize,i.maxSize,f):r=f}return{uSizeT:r,uSize:a}},u.aj=function(i,{uSize:t,uSizeT:r},{lowerSize:a,upperSize:o}){return i.kind==="source"?a/Or:i.kind==="composite"?wi.number(a/Or,o/Or,r):t},u.ak=ou,u.al=function(i,t,r,a){const o=t.y-i.y,p=t.x-i.x,d=a.y-r.y,f=a.x-r.x,_=d*p-f*o;if(_===0)return null;const x=(f*(i.y-r.y)-d*(i.x-r.x))/_;return new Bt(i.x+x*p,i.y+x*o)},u.am=Uh,u.an=zu,u.ao=Ul,u.ap=Fe,u.ar=nu,u.as=function(i,t){var r=t[0],a=t[1],o=t[2],p=t[3],d=t[4],f=t[5],_=t[6],x=t[7],b=t[8],T=t[9],I=t[10],C=t[11],E=t[12],D=t[13],V=t[14],$=t[15],J=r*f-a*d,j=r*_-o*d,W=r*x-p*d,Q=a*_-o*f,ot=a*x-p*f,bt=o*x-p*_,It=b*D-T*E,xt=b*V-I*E,yt=b*$-C*E,dt=T*V-I*D,St=T*$-C*D,mt=I*$-C*V,ct=J*mt-j*St+W*dt+Q*yt-ot*xt+bt*It;return ct?(i[0]=(f*mt-_*St+x*dt)*(ct=1/ct),i[1]=(o*St-a*mt-p*dt)*ct,i[2]=(D*bt-V*ot+$*Q)*ct,i[3]=(I*ot-T*bt-C*Q)*ct,i[4]=(_*yt-d*mt-x*xt)*ct,i[5]=(r*mt-o*yt+p*xt)*ct,i[6]=(V*W-E*bt-$*j)*ct,i[7]=(b*bt-I*W+C*j)*ct,i[8]=(d*St-f*yt+x*It)*ct,i[9]=(a*yt-r*St-p*It)*ct,i[10]=(E*ot-D*W+$*J)*ct,i[11]=(T*W-b*ot-C*J)*ct,i[12]=(f*xt-d*dt-_*It)*ct,i[13]=(r*dt-a*xt+o*It)*ct,i[14]=(D*j-E*Q-V*J)*ct,i[15]=(b*Q-T*j+I*J)*ct,i):null},u.at=mu,u.au=au,u.av=gu,u.aw=function(){const i={},t=rt.$version;for(const r in rt.$root){const a=rt.$root[r];if(a.required){let o=null;o=r==="version"?t:a.type==="array"?[]:{},o!=null&&(i[r]=o)}}return i},u.ax=Wt,u.ay=Oo,u.az=qi,u.b=function(i,t){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).then(a=>{t(null,a)}).catch(a=>{t(new Error(`Could not load image because of ${a.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},u.b0=Ge,u.b1=function(i,t){var r=i[0],a=i[1],o=i[2],p=i[3],d=i[4],f=i[5],_=i[6],x=i[7],b=i[8],T=i[9],I=i[10],C=i[11],E=i[12],D=i[13],V=i[14],$=i[15],J=t[0],j=t[1],W=t[2],Q=t[3],ot=t[4],bt=t[5],It=t[6],xt=t[7],yt=t[8],dt=t[9],St=t[10],mt=t[11],ct=t[12],kt=t[13],Pt=t[14],$t=t[15];return Math.abs(r-J)<=mi*Math.max(1,Math.abs(r),Math.abs(J))&&Math.abs(a-j)<=mi*Math.max(1,Math.abs(a),Math.abs(j))&&Math.abs(o-W)<=mi*Math.max(1,Math.abs(o),Math.abs(W))&&Math.abs(p-Q)<=mi*Math.max(1,Math.abs(p),Math.abs(Q))&&Math.abs(d-ot)<=mi*Math.max(1,Math.abs(d),Math.abs(ot))&&Math.abs(f-bt)<=mi*Math.max(1,Math.abs(f),Math.abs(bt))&&Math.abs(_-It)<=mi*Math.max(1,Math.abs(_),Math.abs(It))&&Math.abs(x-xt)<=mi*Math.max(1,Math.abs(x),Math.abs(xt))&&Math.abs(b-yt)<=mi*Math.max(1,Math.abs(b),Math.abs(yt))&&Math.abs(T-dt)<=mi*Math.max(1,Math.abs(T),Math.abs(dt))&&Math.abs(I-St)<=mi*Math.max(1,Math.abs(I),Math.abs(St))&&Math.abs(C-mt)<=mi*Math.max(1,Math.abs(C),Math.abs(mt))&&Math.abs(E-ct)<=mi*Math.max(1,Math.abs(E),Math.abs(ct))&&Math.abs(D-kt)<=mi*Math.max(1,Math.abs(D),Math.abs(kt))&&Math.abs(V-Pt)<=mi*Math.max(1,Math.abs(V),Math.abs(Pt))&&Math.abs($-$t)<=mi*Math.max(1,Math.abs($),Math.abs($t))},u.b2=function(i,t){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i},u.b3=function(i,t,r){return i[0]=t[0]*r[0],i[1]=t[1]*r[1],i[2]=t[2]*r[2],i[3]=t[3]*r[3],i},u.b4=function(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]*t[3]},u.b5=Vs,u.b6=Dh,u.b7=Eh,u.b8=function(i,t,r,a,o){var p,d=1/Math.tan(t/2);return i[0]=d/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,o!=null&&o!==1/0?(i[10]=(o+a)*(p=1/(a-o)),i[14]=2*o*a*p):(i[10]=-1,i[14]=-2*a),i},u.b9=function(i,t,r){var a=Math.sin(r),o=Math.cos(r),p=t[4],d=t[5],f=t[6],_=t[7],x=t[8],b=t[9],T=t[10],I=t[11];return t!==i&&(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[4]=p*o+x*a,i[5]=d*o+b*a,i[6]=f*o+T*a,i[7]=_*o+I*a,i[8]=x*o-p*a,i[9]=b*o-d*a,i[10]=T*o-f*a,i[11]=I*o-_*a,i},u.bA=Ji,u.bB=ah,u.bC=Ma,u.bD=Ai,u.ba=Os,u.bb=hs,u.bc=function(i,t){return i[0]=t[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},u.bd=class extends aa{},u.be=cu,u.bf=kh,u.bg=Gp,u.bi=Ir,u.bj=function(i,t,r=!1){if(di===Cn||di===En||di===kn)throw new Error("setRTLTextPlugin cannot be called multiple times.");Fr=ps.resolveURL(i),di=Cn,Mn=t,Dn(),r||$o()},u.bk=Ln,u.bl=function(i,t){const r={};for(let o=0;o<i.length;o++){const p=t&&t[i[o].id]||Fa(i[o]);t&&(t[i[o].id]=p);let d=r[p];d||(d=r[p]=[]),d.push(i[o])}const a=[];for(const o in r)a.push(r[o]);return a},u.bm=wt,u.bn=Bh,u.bo=Rh,u.bp=fh,u.bq=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=Me/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const t=i.bucket.layers[0],r=t.layout,a=t._unevaluatedLayout._values,o={layoutIconSize:a["icon-size"].possiblyEvaluate(new he(i.bucket.zoom+1),i.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new he(i.bucket.zoom+1),i.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new he(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:x,maxZoom:b}=i.bucket.textSizeData;o.compositeTextSizes=[a["text-size"].possiblyEvaluate(new he(x),i.canonical),a["text-size"].possiblyEvaluate(new he(b),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:x,maxZoom:b}=i.bucket.iconSizeData;o.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new he(x),i.canonical),a["icon-size"].possiblyEvaluate(new he(b),i.canonical)]}const p=r.get("text-line-height")*Fe,d=r.get("text-rotation-alignment")!=="viewport"&&r.get("symbol-placement")!=="point",f=r.get("text-keep-upright"),_=r.get("text-size");for(const x of i.bucket.features){const b=r.get("text-font").evaluate(x,{},i.canonical).join(","),T=_.evaluate(x,{},i.canonical),I=o.layoutTextSize.evaluate(x,{},i.canonical),C=o.layoutIconSize.evaluate(x,{},i.canonical),E={horizontal:{},vertical:void 0},D=x.text;let V,$=[0,0];if(D){const W=D.toString(),Q=r.get("text-letter-spacing").evaluate(x,{},i.canonical)*Fe,ot=zn(W)?Q:0,bt=r.get("text-anchor").evaluate(x,{},i.canonical),It=Jh(t,x,i.canonical);if(!It){const mt=r.get("text-radial-offset").evaluate(x,{},i.canonical);$=mt?Hh(bt,[mt*Fe,fu]):r.get("text-offset").evaluate(x,{},i.canonical).map(ct=>ct*Fe)}let xt=d?"center":r.get("text-justify").evaluate(x,{},i.canonical);const yt=r.get("symbol-placement"),dt=yt==="point"?r.get("text-max-width").evaluate(x,{},i.canonical)*Fe:0,St=()=>{i.bucket.allowVerticalPlacement&&In(W)&&(E.vertical=al(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,dt,p,bt,"left",ot,$,u.ai.vertical,!0,yt,I,T))};if(!d&&It){const mt=new Set;if(xt==="auto")for(let kt=0;kt<It.values.length;kt+=2)mt.add(mu(It.values[kt]));else mt.add(xt);let ct=!1;for(const kt of mt)if(!E.horizontal[kt])if(ct)E.horizontal[kt]=E.horizontal[0];else{const Pt=al(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,dt,p,"center",kt,ot,$,u.ai.horizontal,!1,yt,I,T);Pt&&(E.horizontal[kt]=Pt,ct=Pt.positionedLines.length===1)}St()}else{xt==="auto"&&(xt=mu(bt));const mt=al(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,dt,p,bt,xt,ot,$,u.ai.horizontal,!1,yt,I,T);mt&&(E.horizontal[xt]=mt),St(),In(W)&&d&&f&&(E.vertical=al(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,dt,p,bt,xt,ot,$,u.ai.vertical,!1,yt,I,T))}}let J=!1;if(x.icon&&x.icon.name){const W=i.imageMap[x.icon.name];W&&(V=Ip(i.imagePositions[x.icon.name],r.get("icon-offset").evaluate(x,{},i.canonical),r.get("icon-anchor").evaluate(x,{},i.canonical)),J=!!W.sdf,i.bucket.sdfIcons===void 0?i.bucket.sdfIcons=J:i.bucket.sdfIcons!==J&&ei("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(W.pixelRatio!==i.bucket.pixelRatio||r.get("icon-rotate").constantOr(1)!==0)&&(i.bucket.iconsNeedLinear=!0))}const j=Wh(E.horizontal)||E.vertical;i.bucket.iconsInText=!!j&&j.iconsInText,(j||V)&&qp(i.bucket,x,E,V,i.imageMap,o,I,C,$,J,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},u.br=Ql,u.bs=Kl,u.bt=Yl,u.bu=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},u.bv=eu,u.bw=ks,u.bx=function(i,t,r,a,o){return Hi(this,void 0,void 0,function*(){if(Tr())try{return yield Ns(i,t,r,a,o)}catch{}return function(p,d,f,_,x){const b=p.width,T=p.height;Wi&&ue||(Wi=new OffscreenCanvas(b,T),ue=Wi.getContext("2d",{willReadFrequently:!0})),Wi.width=b,Wi.height=T,ue.drawImage(p,0,0,b,T);const I=ue.getImageData(d,f,_,x);return ue.clearRect(0,0,b,T),I.data}(i,t,r,a,o)})},u.by=Lh,u.bz=it,u.c=ds,u.d=function(i,t){const r=new Image;r.onload=()=>{t(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=da})},r.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const a=new Blob([new Uint8Array(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(a):da},u.e=$e,u.f=function(i,t){return zr($e(i,{type:"json"}),t)},u.g=Mi,u.h=ps,u.i=ki,u.j=Cr,u.k=Pr,u.l=qs,u.m=zr,u.n=function(i){return new eu(i).readFields(vp,[])},u.o=function(i,t,r){if(!i.length)return r(null,[]);let a=i.length;const o=new Array(i.length);let p=null;i.forEach((d,f)=>{t(d,(_,x)=>{_&&(p=_),o[f]=x,--a==0&&r(p,o)})})},u.p=dh,u.q=Xn,u.r=ze,u.s=hr,u.t=kl,u.u=vt,u.v=rt,u.w=ei,u.x=Va,u.y=_r,u.z=function([i,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(t)*Math.sin(r),y:i*Math.sin(t)*Math.sin(r),z:i*Math.cos(r)}}}),_l(["./shared"],function(u){class Hi{constructor(A){this.keyCache={},A&&this.replace(A)}replace(A){this._layerConfigs={},this._layers={},this.update(A,[])}update(A,z){for(const O of A){this._layerConfigs[O.id]=O;const U=this._layers[O.id]=u.aC(O);U._featureFilter=u.a6(U.filter),this.keyCache[O.id]&&delete this.keyCache[O.id]}for(const O of z)delete this.keyCache[O],delete this._layerConfigs[O],delete this._layers[O];this.familiesBySource={};const k=u.bl(Object.values(this._layerConfigs),this.keyCache);for(const O of k){const U=O.map(at=>this._layers[at.id]),K=U[0];if(K.visibility==="none")continue;const G=K.source||"";let q=this.familiesBySource[G];q||(q=this.familiesBySource[G]={});const X=K.sourceLayer||"_geojsonTileLayer";let st=q[X];st||(st=q[X]=[]),st.push(U)}}}class it{constructor(A){const z={},k=[];for(const G in A){const q=A[G],X=z[G]={};for(const st in q){const at=q[+st];if(!at||at.bitmap.width===0||at.bitmap.height===0)continue;const lt={x:0,y:0,w:at.bitmap.width+2,h:at.bitmap.height+2};k.push(lt),X[st]={rect:lt,metrics:at.metrics}}}const{w:O,h:U}=u.p(k),K=new u.q({width:O||1,height:U||1});for(const G in A){const q=A[G];for(const X in q){const st=q[+X];if(!st||st.bitmap.width===0||st.bitmap.height===0)continue;const at=z[G][X].rect;u.q.copy(st.bitmap,K,{x:0,y:0},{x:at.x+1,y:at.y+1},st.bitmap)}}this.image=K,this.positions=z}}u.bm("GlyphAtlas",it);class Ji{constructor(A){this.tileID=new u.O(A.tileID.overscaledZ,A.tileID.wrap,A.tileID.canonical.z,A.tileID.canonical.x,A.tileID.canonical.y),this.uid=A.uid,this.zoom=A.zoom,this.pixelRatio=A.pixelRatio,this.tileSize=A.tileSize,this.source=A.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=A.showCollisionBoxes,this.collectResourceTiming=!!A.collectResourceTiming,this.returnDependencies=!!A.returnDependencies,this.promoteId=A.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(A,z,k,O,U){this.status="parsing",this.data=A,this.collisionBoxArray=new u.a3;const K=new u.bn(Object.keys(A.layers).sort()),G=new u.bo(this.tileID,this.promoteId);G.bucketLayerIDs=[];const q={},X={featureIndex:G,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:k},st=z.familiesBySource[this.source];for(const Kt in st){const Jt=A.layers[Kt];if(!Jt)continue;Jt.version===1&&u.w(`Vector tile source "${this.source}" layer "${Kt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const He=K.encode(Kt),oe=[];for(let ke=0;ke<Jt.length;ke++){const qe=Jt.feature(ke),Li=G.getId(qe,Kt);oe.push({feature:qe,id:Li,index:ke,sourceLayerIndex:He})}for(const ke of st[Kt]){const qe=ke[0];qe.source!==this.source&&u.w(`layer.source = ${qe.source} does not equal this.source = ${this.source}`),qe.minzoom&&this.zoom<Math.floor(qe.minzoom)||qe.maxzoom&&this.zoom>=qe.maxzoom||qe.visibility!=="none"&&(ui(ke,this.zoom,k),(q[qe.id]=qe.createBucket({index:G.bucketLayerIDs.length,layers:ke,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:He,sourceID:this.source})).populate(oe,X,this.tileID.canonical),G.bucketLayerIDs.push(ke.map(Li=>Li.id)))}}let at,lt,Et,Ft;const Tt=u.aH(X.glyphDependencies,Kt=>Object.keys(Kt).map(Number));this.inFlightDependencies.forEach(Kt=>Kt==null?void 0:Kt.cancel()),this.inFlightDependencies=[];const Mt=++this.dependencySentinel;Object.keys(Tt).length?this.inFlightDependencies.push(O.send("getGlyphs",{uid:this.uid,stacks:Tt,source:this.source,tileID:this.tileID,type:"glyphs"},(Kt,Jt)=>{Mt===this.dependencySentinel&&(at||(at=Kt,lt=Jt,se.call(this)))})):lt={};const Ot=Object.keys(X.iconDependencies);Ot.length?this.inFlightDependencies.push(O.send("getImages",{icons:Ot,source:this.source,tileID:this.tileID,type:"icons"},(Kt,Jt)=>{Mt===this.dependencySentinel&&(at||(at=Kt,Et=Jt,se.call(this)))})):Et={};const ee=Object.keys(X.patternDependencies);function se(){if(at)return U(at);if(lt&&Et&&Ft){const Kt=new it(lt),Jt=new u.bp(Et,Ft);for(const He in q){const oe=q[He];oe instanceof u.a4?(ui(oe.layers,this.zoom,k),u.bq({bucket:oe,glyphMap:lt,glyphPositions:Kt.positions,imageMap:Et,imagePositions:Jt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):oe.hasPattern&&(oe instanceof u.br||oe instanceof u.bs||oe instanceof u.bt)&&(ui(oe.layers,this.zoom,k),oe.addFeatures(X,this.tileID.canonical,Jt.patternPositions))}this.status="done",U(null,{buckets:Object.values(q).filter(He=>!He.isEmpty()),featureIndex:G,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Kt.image,imageAtlas:Jt,glyphMap:this.returnDependencies?lt:null,iconMap:this.returnDependencies?Et:null,glyphPositions:this.returnDependencies?Kt.positions:null})}}ee.length?this.inFlightDependencies.push(O.send("getImages",{icons:ee,source:this.source,tileID:this.tileID,type:"patterns"},(Kt,Jt)=>{Mt===this.dependencySentinel&&(at||(at=Kt,Ft=Jt,se.call(this)))})):Ft={},se.call(this)}}function ui(F,A,z){const k=new u.a8(A);for(const O of F)O.recalculate(k,z)}function Bt(F,A){const z=u.l(F.request,(k,O,U,K)=>{if(k)A(k);else if(O)try{const G=new u.bw.VectorTile(new u.bv(O));A(null,{vectorTile:G,rawData:O,cacheControl:U,expires:K})}catch(G){const q=new Uint8Array(O);let X=`Unable to parse the tile at ${F.request.url}, `;X+=q[0]===31&&q[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${G.messge}`,A(new Error(X))}});return()=>{z.cancel(),A()}}class ls{constructor(A,z,k,O){this.actor=A,this.layerIndex=z,this.availableImages=k,this.loadVectorData=O||Bt,this.fetching={},this.loading={},this.loaded={}}loadTile(A,z){const k=A.uid;this.loading||(this.loading={});const O=!!(A&&A.request&&A.request.collectResourceTiming)&&new u.bu(A.request),U=this.loading[k]=new Ji(A);U.abort=this.loadVectorData(A,(K,G)=>{if(delete this.loading[k],K||!G)return U.status="done",this.loaded[k]=U,z(K);const q=G.rawData,X={};G.expires&&(X.expires=G.expires),G.cacheControl&&(X.cacheControl=G.cacheControl);const st={};if(O){const at=O.finish();at&&(st.resourceTiming=JSON.parse(JSON.stringify(at)))}U.vectorTile=G.vectorTile,U.parse(G.vectorTile,this.layerIndex,this.availableImages,this.actor,(at,lt)=>{if(delete this.fetching[k],at||!lt)return z(at);z(null,u.e({rawTileData:q.slice(0)},lt,X,st))}),this.loaded=this.loaded||{},this.loaded[k]=U,this.fetching[k]={rawTileData:q,cacheControl:X,resourceTiming:st}})}reloadTile(A,z){const k=this.loaded,O=A.uid;if(k&&k[O]){const U=k[O];U.showCollisionBoxes=A.showCollisionBoxes,U.status==="parsing"?U.parse(U.vectorTile,this.layerIndex,this.availableImages,this.actor,(K,G)=>{if(K||!G)return z(K,G);let q;if(this.fetching[O]){const{rawTileData:X,cacheControl:st,resourceTiming:at}=this.fetching[O];delete this.fetching[O],q=u.e({rawTileData:X.slice(0)},G,st,at)}else q=G;z(null,q)}):U.status==="done"&&(U.vectorTile?U.parse(U.vectorTile,this.layerIndex,this.availableImages,this.actor,z):z())}}abortTile(A,z){const k=this.loading,O=A.uid;k&&k[O]&&k[O].abort&&(k[O].abort(),delete k[O]),z()}removeTile(A,z){const k=this.loaded,O=A.uid;k&&k[O]&&delete k[O],z()}}class Rs{constructor(){this.loaded={}}loadTile(A,z){return u._(this,void 0,void 0,function*(){const{uid:k,encoding:O,rawImageData:U,redFactor:K,greenFactor:G,blueFactor:q,baseShift:X}=A,st=U.width+2,at=U.height+2,lt=u.a(U)?new u.R({width:st,height:at},yield u.bx(U,-1,-1,st,at)):U,Et=new u.by(k,lt,O,K,G,q,X);this.loaded=this.loaded||{},this.loaded[k]=Et,z(null,Et)})}removeTile(A){const z=this.loaded,k=A.uid;z&&z[k]&&delete z[k]}}function us(F,A){if(F.length!==0){ti(F[0],A);for(var z=1;z<F.length;z++)ti(F[z],!A)}}function ti(F,A){for(var z=0,k=0,O=0,U=F.length,K=U-1;O<U;K=O++){var G=(F[O][0]-F[K][0])*(F[K][1]+F[O][1]),q=z+G;k+=Math.abs(z)>=Math.abs(G)?z-q+G:G-q+z,z=q}z+k>=0!=!!A&&F.reverse()}var Ee=u.bz(function F(A,z){var k,O=A&&A.type;if(O==="FeatureCollection")for(k=0;k<A.features.length;k++)F(A.features[k],z);else if(O==="GeometryCollection")for(k=0;k<A.geometries.length;k++)F(A.geometries[k],z);else if(O==="Feature")F(A.geometry,z);else if(O==="Polygon")us(A.coordinates,z);else if(O==="MultiPolygon")for(k=0;k<A.coordinates.length;k++)us(A.coordinates[k],z);return A});const ca=u.bw.VectorTileFeature.prototype.toGeoJSON;var Tr={exports:{}},Os=u.bA,hs=u.bw.VectorTileFeature,Ki=Vs;function Vs(F,A){this.options=A||{},this.features=F,this.length=F.length}function $e(F,A){this.id=typeof F.id=="number"?F.id:void 0,this.type=F.type,this.rawGeometry=F.type===1?[F.geometry]:F.geometry,this.properties=F.tags,this.extent=A||4096}Vs.prototype.feature=function(F){return new $e(this.features[F],this.options.extent)},$e.prototype.loadGeometry=function(){var F=this.rawGeometry;this.geometry=[];for(var A=0;A<F.length;A++){for(var z=F[A],k=[],O=0;O<z.length;O++)k.push(new Os(z[O][0],z[O][1]));this.geometry.push(k)}return this.geometry},$e.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var F=this.geometry,A=1/0,z=-1/0,k=1/0,O=-1/0,U=0;U<F.length;U++)for(var K=F[U],G=0;G<K.length;G++){var q=K[G];A=Math.min(A,q.x),z=Math.max(z,q.x),k=Math.min(k,q.y),O=Math.max(O,q.y)}return[A,k,z,O]},$e.prototype.toGeoJSON=hs.prototype.toGeoJSON;var pa=u.bB,me=Ki;function cs(F){var A=new pa;return function(z,k){for(var O in z.layers)k.writeMessage(3,$i,z.layers[O])}(F,A),A.finish()}function $i(F,A){var z;A.writeVarintField(15,F.version||1),A.writeStringField(1,F.name||""),A.writeVarintField(5,F.extent||4096);var k={keys:[],values:[],keycache:{},valuecache:{}};for(z=0;z<F.length;z++)k.feature=F.feature(z),A.writeMessage(2,Ar,k);var O=k.keys;for(z=0;z<O.length;z++)A.writeStringField(3,O[z]);var U=k.values;for(z=0;z<U.length;z++)A.writeMessage(4,Ur,U[z])}function Ar(F,A){var z=F.feature;z.id!==void 0&&A.writeVarintField(1,z.id),A.writeMessage(2,ei,F),A.writeVarintField(3,z.type),A.writeMessage(4,ki,z)}function ei(F,A){var z=F.feature,k=F.keys,O=F.values,U=F.keycache,K=F.valuecache;for(var G in z.properties){var q=z.properties[G],X=U[G];if(q!==null){X===void 0&&(k.push(G),U[G]=X=k.length-1),A.writeVarint(X);var st=typeof q;st!=="string"&&st!=="boolean"&&st!=="number"&&(q=JSON.stringify(q));var at=st+":"+q,lt=K[at];lt===void 0&&(O.push(q),K[at]=lt=O.length-1),A.writeVarint(lt)}}}function vi(F,A){return(A<<3)+(7&F)}function ur(F){return F<<1^F>>31}function ki(F,A){for(var z=F.loadGeometry(),k=F.type,O=0,U=0,K=z.length,G=0;G<K;G++){var q=z[G],X=1;k===1&&(X=q.length),A.writeVarint(vi(1,X));for(var st=k===3?q.length-1:q.length,at=0;at<st;at++){at===1&&k!==1&&A.writeVarint(vi(2,st-1));var lt=q[at].x-O,Et=q[at].y-U;A.writeVarint(ur(lt)),A.writeVarint(ur(Et)),O+=lt,U+=Et}k===3&&A.writeVarint(vi(7,1))}}function Ur(F,A){var z=typeof F;z==="string"?A.writeStringField(1,F):z==="boolean"?A.writeBooleanField(7,F):z==="number"&&(F%1!=0?A.writeDoubleField(3,F):F<0?A.writeSVarintField(6,F):A.writeVarintField(5,F))}Tr.exports=cs,Tr.exports.fromVectorTileJs=cs,Tr.exports.fromGeojsonVt=function(F,A){A=A||{};var z={};for(var k in F)z[k]=new me(F[k].features,A),z[k].name=k,z[k].version=A.version,z[k].extent=A.extent;return cs({layers:z})},Tr.exports.GeoJSONWrapper=me;var Us=u.bz(Tr.exports);const da={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:F=>F},Ns=Math.fround||(Wi=new Float32Array(1),F=>(Wi[0]=+F,Wi[0]));var Wi;const ue=3,hi=5,Nr=6;class ps{constructor(A){this.options=Object.assign(Object.create(da),A),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(A){const{log:z,minZoom:k,maxZoom:O}=this.options;z&&console.time("total time");const U=`prepare ${A.length} points`;z&&console.time(U),this.points=A;const K=[];for(let q=0;q<A.length;q++){const X=A[q];if(!X.geometry)continue;const[st,at]=X.geometry.coordinates,lt=Ns(qi(st)),Et=Ns(Mi(at));K.push(lt,Et,1/0,q,-1,1),this.options.reduce&&K.push(0)}let G=this.trees[O+1]=this._createTree(K);z&&console.timeEnd(U);for(let q=O;q>=k;q--){const X=+Date.now();G=this.trees[q]=this._createTree(this._cluster(G,q)),z&&console.log("z%d: %d clusters in %dms",q,G.numItems,+Date.now()-X)}return z&&console.timeEnd("total time"),this}getClusters(A,z){let k=((A[0]+180)%360+360)%360-180;const O=Math.max(-90,Math.min(90,A[1]));let U=A[2]===180?180:((A[2]+180)%360+360)%360-180;const K=Math.max(-90,Math.min(90,A[3]));if(A[2]-A[0]>=360)k=-180,U=180;else if(k>U){const at=this.getClusters([k,O,180,K],z),lt=this.getClusters([-180,O,U,K],z);return at.concat(lt)}const G=this.trees[this._limitZoom(z)],q=G.range(qi(k),Mi(K),qi(U),Mi(O)),X=G.data,st=[];for(const at of q){const lt=this.stride*at;st.push(X[lt+hi]>1?ds(X,lt,this.clusterProps):this.points[X[lt+ue]])}return st}getChildren(A){const z=this._getOriginId(A),k=this._getOriginZoom(A),O="No cluster with the specified id.",U=this.trees[k];if(!U)throw new Error(O);const K=U.data;if(z*this.stride>=K.length)throw new Error(O);const G=this.options.radius/(this.options.extent*Math.pow(2,k-1)),q=U.within(K[z*this.stride],K[z*this.stride+1],G),X=[];for(const st of q){const at=st*this.stride;K[at+4]===A&&X.push(K[at+hi]>1?ds(K,at,this.clusterProps):this.points[K[at+ue]])}if(X.length===0)throw new Error(O);return X}getLeaves(A,z,k){const O=[];return this._appendLeaves(O,A,z=z||10,k=k||0,0),O}getTile(A,z,k){const O=this.trees[this._limitZoom(A)],U=Math.pow(2,A),{extent:K,radius:G}=this.options,q=G/K,X=(k-q)/U,st=(k+1+q)/U,at={features:[]};return this._addTileFeatures(O.range((z-q)/U,X,(z+1+q)/U,st),O.data,z,k,U,at),z===0&&this._addTileFeatures(O.range(1-q/U,X,1,st),O.data,U,k,U,at),z===U-1&&this._addTileFeatures(O.range(0,X,q/U,st),O.data,-1,k,U,at),at.features.length?at:null}getClusterExpansionZoom(A){let z=this._getOriginZoom(A)-1;for(;z<=this.options.maxZoom;){const k=this.getChildren(A);if(z++,k.length!==1)break;A=k[0].properties.cluster_id}return z}_appendLeaves(A,z,k,O,U){const K=this.getChildren(z);for(const G of K){const q=G.properties;if(q&&q.cluster?U+q.point_count<=O?U+=q.point_count:U=this._appendLeaves(A,q.cluster_id,k,O,U):U<O?U++:A.push(G),A.length===k)break}return U}_createTree(A){const z=new u.av(A.length/this.stride|0,this.options.nodeSize,Float32Array);for(let k=0;k<A.length;k+=this.stride)z.add(A[k],A[k+1]);return z.finish(),z.data=A,z}_addTileFeatures(A,z,k,O,U,K){for(const G of A){const q=G*this.stride,X=z[q+hi]>1;let st,at,lt;if(X)st=Ir(z,q,this.clusterProps),at=z[q],lt=z[q+1];else{const Tt=this.points[z[q+ue]];st=Tt.properties;const[Mt,Ot]=Tt.geometry.coordinates;at=qi(Mt),lt=Mi(Ot)}const Et={type:1,geometry:[[Math.round(this.options.extent*(at*U-k)),Math.round(this.options.extent*(lt*U-O))]],tags:st};let Ft;Ft=X||this.options.generateId?z[q+ue]:this.points[z[q+ue]].id,Ft!==void 0&&(Et.id=Ft),K.features.push(Et)}}_limitZoom(A){return Math.max(this.options.minZoom,Math.min(Math.floor(+A),this.options.maxZoom+1))}_cluster(A,z){const{radius:k,extent:O,reduce:U,minPoints:K}=this.options,G=k/(O*Math.pow(2,z)),q=A.data,X=[],st=this.stride;for(let at=0;at<q.length;at+=st){if(q[at+2]<=z)continue;q[at+2]=z;const lt=q[at],Et=q[at+1],Ft=A.within(q[at],q[at+1],G),Tt=q[at+hi];let Mt=Tt;for(const Ot of Ft){const ee=Ot*st;q[ee+2]>z&&(Mt+=q[ee+hi])}if(Mt>Tt&&Mt>=K){let Ot,ee=lt*Tt,se=Et*Tt,Kt=-1;const Jt=((at/st|0)<<5)+(z+1)+this.points.length;for(const He of Ft){const oe=He*st;if(q[oe+2]<=z)continue;q[oe+2]=z;const ke=q[oe+hi];ee+=q[oe]*ke,se+=q[oe+1]*ke,q[oe+4]=Jt,U&&(Ot||(Ot=this._map(q,at,!0),Kt=this.clusterProps.length,this.clusterProps.push(Ot)),U(Ot,this._map(q,oe)))}q[at+4]=Jt,X.push(ee/Mt,se/Mt,1/0,Jt,-1,Mt),U&&X.push(Kt)}else{for(let Ot=0;Ot<st;Ot++)X.push(q[at+Ot]);if(Mt>1)for(const Ot of Ft){const ee=Ot*st;if(!(q[ee+2]<=z)){q[ee+2]=z;for(let se=0;se<st;se++)X.push(q[ee+se])}}}}return X}_getOriginId(A){return A-this.points.length>>5}_getOriginZoom(A){return(A-this.points.length)%32}_map(A,z,k){if(A[z+hi]>1){const K=this.clusterProps[A[z+Nr]];return k?Object.assign({},K):K}const O=this.points[A[z+ue]].properties,U=this.options.map(O);return k&&U===O?Object.assign({},U):U}}function ds(F,A,z){return{type:"Feature",id:F[A+ue],properties:Ir(F,A,z),geometry:{type:"Point",coordinates:[(k=F[A],360*(k-.5)),$s(F[A+1])]}};var k}function Ir(F,A,z){const k=F[A+hi],O=k>=1e4?`${Math.round(k/1e3)}k`:k>=1e3?Math.round(k/100)/10+"k":k,U=F[A+Nr],K=U===-1?{}:Object.assign({},z[U]);return Object.assign(K,{cluster:!0,cluster_id:F[A+ue],point_count:k,point_count_abbreviated:O})}function qi(F){return F/360+.5}function Mi(F){const A=Math.sin(F*Math.PI/180),z=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return z<0?0:z>1?1:z}function $s(F){const A=(180-360*F)*Math.PI/180;return 360*Math.atan(Math.exp(A))/Math.PI-90}function zr(F,A,z,k){for(var O,U=k,K=z-A>>1,G=z-A,q=F[A],X=F[A+1],st=F[z],at=F[z+1],lt=A+3;lt<z;lt+=3){var Et=qs(F[lt],F[lt+1],q,X,st,at);if(Et>U)O=lt,U=Et;else if(Et===U){var Ft=Math.abs(lt-K);Ft<G&&(O=lt,G=Ft)}}U>k&&(O-A>3&&zr(F,A,O,k),F[O+2]=U,z-O>3&&zr(F,O,z,k))}function qs(F,A,z,k,O,U){var K=O-z,G=U-k;if(K!==0||G!==0){var q=((F-z)*K+(A-k)*G)/(K*K+G*G);q>1?(z=O,k=U):q>0&&(z+=K*q,k+=G*q)}return(K=F-z)*K+(G=A-k)*G}function hr(F,A,z,k){var O={id:F===void 0?null:F,type:A,geometry:z,tags:k,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(U){var K=U.geometry,G=U.type;if(G==="Point"||G==="MultiPoint"||G==="LineString")fs(U,K);else if(G==="Polygon"||G==="MultiLineString")for(var q=0;q<K.length;q++)fs(U,K[q]);else if(G==="MultiPolygon")for(q=0;q<K.length;q++)for(var X=0;X<K[q].length;X++)fs(U,K[q][X])}(O),O}function fs(F,A){for(var z=0;z<A.length;z+=3)F.minX=Math.min(F.minX,A[z]),F.minY=Math.min(F.minY,A[z+1]),F.maxX=Math.max(F.maxX,A[z]),F.maxY=Math.max(F.maxY,A[z+1])}function $r(F,A,z,k){if(A.geometry){var O=A.geometry.coordinates,U=A.geometry.type,K=Math.pow(z.tolerance/((1<<z.maxZoom)*z.extent),2),G=[],q=A.id;if(z.promoteId?q=A.properties[z.promoteId]:z.generateId&&(q=k||0),U==="Point")Pr(O,G);else if(U==="MultiPoint")for(var X=0;X<O.length;X++)Pr(O[X],G);else if(U==="LineString")Cr(O,G,K,!1);else if(U==="MultiLineString"){if(z.lineMetrics){for(X=0;X<O.length;X++)Cr(O[X],G=[],K,!1),F.push(hr(q,"LineString",G,A.properties));return}qr(O,G,K,!1)}else if(U==="Polygon")qr(O,G,K,!0);else{if(U!=="MultiPolygon"){if(U==="GeometryCollection"){for(X=0;X<A.geometry.geometries.length;X++)$r(F,{id:q,geometry:A.geometry.geometries[X],properties:A.properties},z,k);return}throw new Error("Input data is not a valid GeoJSON object.")}for(X=0;X<O.length;X++){var st=[];qr(O[X],st,K,!0),G.push(st)}}F.push(hr(q,U,G,A.properties))}}function Pr(F,A){A.push(rt(F[0])),A.push(ci(F[1])),A.push(0)}function Cr(F,A,z,k){for(var O,U,K=0,G=0;G<F.length;G++){var q=rt(F[G][0]),X=ci(F[G][1]);A.push(q),A.push(X),A.push(0),G>0&&(K+=k?(O*X-q*U)/2:Math.sqrt(Math.pow(q-O,2)+Math.pow(X-U,2))),O=q,U=X}var st=A.length-3;A[2]=1,zr(A,0,st,z),A[st+2]=1,A.size=Math.abs(K),A.start=0,A.end=A.size}function qr(F,A,z,k){for(var O=0;O<F.length;O++){var U=[];Cr(F[O],U,z,k),A.push(U)}}function rt(F){return F/360+.5}function ci(F){var A=Math.sin(F*Math.PI/180),z=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return z<0?0:z>1?1:z}function Di(F,A,z,k,O,U,K,G){if(k/=A,U>=(z/=A)&&K<k)return F;if(K<z||U>=k)return null;for(var q=[],X=0;X<F.length;X++){var st=F[X],at=st.geometry,lt=st.type,Et=O===0?st.minX:st.minY,Ft=O===0?st.maxX:st.maxY;if(Et>=z&&Ft<k)q.push(st);else if(!(Ft<z||Et>=k)){var Tt=[];if(lt==="Point"||lt==="MultiPoint")ne(at,Tt,z,k,O);else if(lt==="LineString")Wt(at,Tt,z,k,O,!1,G.lineMetrics);else if(lt==="MultiLineString")ms(at,Tt,z,k,O,!1);else if(lt==="Polygon")ms(at,Tt,z,k,O,!0);else if(lt==="MultiPolygon")for(var Mt=0;Mt<at.length;Mt++){var Ot=[];ms(at[Mt],Ot,z,k,O,!0),Ot.length&&Tt.push(Ot)}if(Tt.length){if(G.lineMetrics&&lt==="LineString"){for(Mt=0;Mt<Tt.length;Mt++)q.push(hr(st.id,lt,Tt[Mt],st.tags));continue}lt!=="LineString"&&lt!=="MultiLineString"||(Tt.length===1?(lt="LineString",Tt=Tt[0]):lt="MultiLineString"),lt!=="Point"&&lt!=="MultiPoint"||(lt=Tt.length===3?"Point":"MultiPoint"),q.push(hr(st.id,lt,Tt,st.tags))}}}return q.length?q:null}function ne(F,A,z,k,O){for(var U=0;U<F.length;U+=3){var K=F[U+O];K>=z&&K<=k&&(A.push(F[U]),A.push(F[U+1]),A.push(F[U+2]))}}function Wt(F,A,z,k,O,U,K){for(var G,q,X=Yi(F),st=O===0?fa:gs,at=F.start,lt=0;lt<F.length-3;lt+=3){var Et=F[lt],Ft=F[lt+1],Tt=F[lt+2],Mt=F[lt+3],Ot=F[lt+4],ee=O===0?Et:Ft,se=O===0?Mt:Ot,Kt=!1;K&&(G=Math.sqrt(Math.pow(Et-Mt,2)+Math.pow(Ft-Ot,2))),ee<z?se>z&&(q=st(X,Et,Ft,Mt,Ot,z),K&&(X.start=at+G*q)):ee>k?se<k&&(q=st(X,Et,Ft,Mt,Ot,k),K&&(X.start=at+G*q)):cr(X,Et,Ft,Tt),se<z&&ee>=z&&(q=st(X,Et,Ft,Mt,Ot,z),Kt=!0),se>k&&ee<=k&&(q=st(X,Et,Ft,Mt,Ot,k),Kt=!0),!U&&Kt&&(K&&(X.end=at+G*q),A.push(X),X=Yi(F)),K&&(at+=G)}var Jt=F.length-3;Et=F[Jt],Ft=F[Jt+1],Tt=F[Jt+2],(ee=O===0?Et:Ft)>=z&&ee<=k&&cr(X,Et,Ft,Tt),Jt=X.length-3,U&&Jt>=3&&(X[Jt]!==X[0]||X[Jt+1]!==X[1])&&cr(X,X[0],X[1],X[2]),X.length&&A.push(X)}function Yi(F){var A=[];return A.size=F.size,A.start=F.start,A.end=F.end,A}function ms(F,A,z,k,O,U){for(var K=0;K<F.length;K++)Wt(F[K],A,z,k,O,U,!1)}function cr(F,A,z,k){F.push(A),F.push(z),F.push(k)}function fa(F,A,z,k,O,U){var K=(U-A)/(k-A);return F.push(U),F.push(z+(O-z)*K),F.push(1),K}function gs(F,A,z,k,O,U){var K=(U-z)/(O-z);return F.push(A+(k-A)*K),F.push(U),F.push(1),K}function Er(F,A){for(var z=[],k=0;k<F.length;k++){var O,U=F[k],K=U.type;if(K==="Point"||K==="MultiPoint"||K==="LineString")O=jr(U.geometry,A);else if(K==="MultiLineString"||K==="Polygon"){O=[];for(var G=0;G<U.geometry.length;G++)O.push(jr(U.geometry[G],A))}else if(K==="MultiPolygon")for(O=[],G=0;G<U.geometry.length;G++){for(var q=[],X=0;X<U.geometry[G].length;X++)q.push(jr(U.geometry[G][X],A));O.push(q)}z.push(hr(U.id,K,O,U.tags))}return z}function jr(F,A){var z=[];z.size=F.size,F.start!==void 0&&(z.start=F.start,z.end=F.end);for(var k=0;k<F.length;k+=3)z.push(F[k]+A,F[k+1],F[k+2]);return z}function ft(F,A){if(F.transformed)return F;var z,k,O,U=1<<F.z,K=F.x,G=F.y;for(z=0;z<F.features.length;z++){var q=F.features[z],X=q.geometry,st=q.type;if(q.geometry=[],st===1)for(k=0;k<X.length;k+=2)q.geometry.push(Qi(X[k],X[k+1],A,U,K,G));else for(k=0;k<X.length;k++){var at=[];for(O=0;O<X[k].length;O+=2)at.push(Qi(X[k][O],X[k][O+1],A,U,K,G));q.geometry.push(at)}}return F.transformed=!0,F}function Qi(F,A,z,k,O,U){return[Math.round(z*(F*k-O)),Math.round(z*(A*k-U))]}function ve(F,A,z,k,O){for(var U=A===O.maxZoom?0:O.tolerance/((1<<A)*O.extent),K={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:z,y:k,z:A,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},G=0;G<F.length;G++){K.numFeatures++,Gr(K,F[G],U,O);var q=F[G].minX,X=F[G].minY,st=F[G].maxX,at=F[G].maxY;q<K.minX&&(K.minX=q),X<K.minY&&(K.minY=X),st>K.maxX&&(K.maxX=st),at>K.maxY&&(K.maxY=at)}return K}function Gr(F,A,z,k){var O=A.geometry,U=A.type,K=[];if(U==="Point"||U==="MultiPoint")for(var G=0;G<O.length;G+=3)K.push(O[G]),K.push(O[G+1]),F.numPoints++,F.numSimplified++;else if(U==="LineString")pr(K,O,F,z,!1,!1);else if(U==="MultiLineString"||U==="Polygon")for(G=0;G<O.length;G++)pr(K,O[G],F,z,U==="Polygon",G===0);else if(U==="MultiPolygon")for(var q=0;q<O.length;q++){var X=O[q];for(G=0;G<X.length;G++)pr(K,X[G],F,z,!0,G===0)}if(K.length){var st=A.tags||null;if(U==="LineString"&&k.lineMetrics){for(var at in st={},A.tags)st[at]=A.tags[at];st.mapbox_clip_start=O.start/O.size,st.mapbox_clip_end=O.end/O.size}var lt={geometry:K,type:U==="Polygon"||U==="MultiPolygon"?3:U==="LineString"||U==="MultiLineString"?2:1,tags:st};A.id!==null&&(lt.id=A.id),F.features.push(lt)}}function pr(F,A,z,k,O,U){var K=k*k;if(k>0&&A.size<(O?K:k))z.numPoints+=A.length/3;else{for(var G=[],q=0;q<A.length;q+=3)(k===0||A[q+2]>K)&&(z.numSimplified++,G.push(A[q]),G.push(A[q+1])),z.numPoints++;O&&function(X,st){for(var at=0,lt=0,Et=X.length,Ft=Et-2;lt<Et;Ft=lt,lt+=2)at+=(X[lt]-X[Ft])*(X[lt+1]+X[Ft+1]);if(at>0===st)for(lt=0,Et=X.length;lt<Et/2;lt+=2){var Tt=X[lt],Mt=X[lt+1];X[lt]=X[Et-2-lt],X[lt+1]=X[Et-1-lt],X[Et-2-lt]=Tt,X[Et-1-lt]=Mt}}(G,U),F.push(G)}}function gt(F,A){var z=(A=this.options=function(O,U){for(var K in U)O[K]=U[K];return O}(Object.create(this.options),A)).debug;if(z&&console.time("preprocess data"),A.maxZoom<0||A.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(A.promoteId&&A.generateId)throw new Error("promoteId and generateId cannot be used together.");var k=function(O,U){var K=[];if(O.type==="FeatureCollection")for(var G=0;G<O.features.length;G++)$r(K,O.features[G],U,G);else $r(K,O.type==="Feature"?O:{geometry:O},U);return K}(F,A);this.tiles={},this.tileCoords=[],z&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",A.indexMaxZoom,A.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),k=function(O,U){var K=U.buffer/U.extent,G=O,q=Di(O,1,-1-K,K,0,-1,2,U),X=Di(O,1,1-K,2+K,0,-1,2,U);return(q||X)&&(G=Di(O,1,-K,1+K,0,-1,2,U)||[],q&&(G=Er(q,1).concat(G)),X&&(G=G.concat(Er(X,-1)))),G}(k,A),k.length&&this.splitTile(k,0,0,0),z&&(k.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Nt(F,A,z){return 32*((1<<F)*z+A)+F}function Rt(F,A){return A?F.properties[A]:F.id}function ii(F,A){if(F==null)return!0;if(F.type==="Feature")return Rt(F,A)!=null;if(F.type==="FeatureCollection"){const z=new Set;for(const k of F.features){const O=Rt(k,A);if(O==null||z.has(O))return!1;z.add(O)}return!0}return!1}function tr(F,A){const z=new Map;if(F!=null)if(F.type==="Feature")z.set(Rt(F,A),F);else for(const k of F.features)z.set(Rt(k,A),k);return z}gt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},gt.prototype.splitTile=function(F,A,z,k,O,U,K){for(var G=[F,A,z,k],q=this.options,X=q.debug;G.length;){k=G.pop(),z=G.pop(),A=G.pop(),F=G.pop();var st=1<<A,at=Nt(A,z,k),lt=this.tiles[at];if(!lt&&(X>1&&console.time("creation"),lt=this.tiles[at]=ve(F,A,z,k,q),this.tileCoords.push({z:A,x:z,y:k}),X)){X>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",A,z,k,lt.numFeatures,lt.numPoints,lt.numSimplified),console.timeEnd("creation"));var Et="z"+A;this.stats[Et]=(this.stats[Et]||0)+1,this.total++}if(lt.source=F,O){if(A===q.maxZoom||A===O)continue;var Ft=1<<O-A;if(z!==Math.floor(U/Ft)||k!==Math.floor(K/Ft))continue}else if(A===q.indexMaxZoom||lt.numPoints<=q.indexMaxPoints)continue;if(lt.source=null,F.length!==0){X>1&&console.time("clipping");var Tt,Mt,Ot,ee,se,Kt,Jt=.5*q.buffer/q.extent,He=.5-Jt,oe=.5+Jt,ke=1+Jt;Tt=Mt=Ot=ee=null,se=Di(F,st,z-Jt,z+oe,0,lt.minX,lt.maxX,q),Kt=Di(F,st,z+He,z+ke,0,lt.minX,lt.maxX,q),F=null,se&&(Tt=Di(se,st,k-Jt,k+oe,1,lt.minY,lt.maxY,q),Mt=Di(se,st,k+He,k+ke,1,lt.minY,lt.maxY,q),se=null),Kt&&(Ot=Di(Kt,st,k-Jt,k+oe,1,lt.minY,lt.maxY,q),ee=Di(Kt,st,k+He,k+ke,1,lt.minY,lt.maxY,q),Kt=null),X>1&&console.timeEnd("clipping"),G.push(Tt||[],A+1,2*z,2*k),G.push(Mt||[],A+1,2*z,2*k+1),G.push(Ot||[],A+1,2*z+1,2*k),G.push(ee||[],A+1,2*z+1,2*k+1)}}},gt.prototype.getTile=function(F,A,z){var k=this.options,O=k.extent,U=k.debug;if(F<0||F>24)return null;var K=1<<F,G=Nt(F,A=(A%K+K)%K,z);if(this.tiles[G])return ft(this.tiles[G],O);U>1&&console.log("drilling down to z%d-%d-%d",F,A,z);for(var q,X=F,st=A,at=z;!q&&X>0;)X--,st=Math.floor(st/2),at=Math.floor(at/2),q=this.tiles[Nt(X,st,at)];return q&&q.source?(U>1&&console.log("found parent tile z%d-%d-%d",X,st,at),U>1&&console.time("drilling down"),this.splitTile(q.source,X,st,at,F,A,z),U>1&&console.timeEnd("drilling down"),this.tiles[G]?ft(this.tiles[G],O):null):null};class Vt extends ls{constructor(A,z,k,O){super(A,z,k),this._dataUpdateable=new Map,this.loadGeoJSON=(U,K)=>{const{promoteId:G}=U;if(U.request)return u.f(U.request,(q,X,st,at)=>{this._dataUpdateable=ii(X,G)?tr(X,G):void 0,K(q,X,st,at)});if(typeof U.data=="string")try{const q=JSON.parse(U.data);this._dataUpdateable=ii(q,G)?tr(q,G):void 0,K(null,q)}catch{K(new Error(`Input data given to '${U.source}' is not a valid GeoJSON object.`))}else U.dataDiff?this._dataUpdateable?(function(q,X,st){var at,lt,Et,Ft;if(X.removeAll&&q.clear(),X.remove)for(const Tt of X.remove)q.delete(Tt);if(X.add)for(const Tt of X.add){const Mt=Rt(Tt,st);Mt!=null&&q.set(Mt,Tt)}if(X.update)for(const Tt of X.update){let Mt=q.get(Tt.id);if(Mt==null)continue;const Ot=!Tt.removeAllProperties&&(((at=Tt.removeProperties)===null||at===void 0?void 0:at.length)>0||((lt=Tt.addOrUpdateProperties)===null||lt===void 0?void 0:lt.length)>0);if((Tt.newGeometry||Tt.removeAllProperties||Ot)&&(Mt=Object.assign({},Mt),q.set(Tt.id,Mt),Ot&&(Mt.properties=Object.assign({},Mt.properties))),Tt.newGeometry&&(Mt.geometry=Tt.newGeometry),Tt.removeAllProperties)Mt.properties={};else if(((Et=Tt.removeProperties)===null||Et===void 0?void 0:Et.length)>0)for(const ee of Tt.removeProperties)Object.prototype.hasOwnProperty.call(Mt.properties,ee)&&delete Mt.properties[ee];if(((Ft=Tt.addOrUpdateProperties)===null||Ft===void 0?void 0:Ft.length)>0)for(const{key:ee,value:se}of Tt.addOrUpdateProperties)Mt.properties[ee]=se}}(this._dataUpdateable,U.dataDiff,G),K(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):K(new Error(`Cannot update existing geojson data in ${U.source}`)):K(new Error(`Input data given to '${U.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,O&&(this.loadGeoJSON=O)}loadGeoJSONTile(A,z){const k=A.tileID.canonical;if(!this._geoJSONIndex)return z(null,null);const O=this._geoJSONIndex.getTile(k.z,k.x,k.y);if(!O)return z(null,null);const U=new class{constructor(G){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=u.N,this.length=G.length,this._features=G}feature(G){return new class{constructor(q){this._feature=q,this.extent=u.N,this.type=q.type,this.properties=q.tags,"id"in q&&!isNaN(q.id)&&(this.id=parseInt(q.id,10))}loadGeometry(){if(this._feature.type===1){const q=[];for(const X of this._feature.geometry)q.push([new u.P(X[0],X[1])]);return q}{const q=[];for(const X of this._feature.geometry){const st=[];for(const at of X)st.push(new u.P(at[0],at[1]));q.push(st)}return q}}toGeoJSON(q,X,st){return ca.call(this,q,X,st)}}(this._features[G])}}(O.features);let K=Us(U);K.byteOffset===0&&K.byteLength===K.buffer.byteLength||(K=new Uint8Array(K)),z(null,{vectorTile:U,rawData:K.buffer})}loadData(A,z){var k;(k=this._pendingRequest)===null||k===void 0||k.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const O=!!(A&&A.request&&A.request.collectResourceTiming)&&new u.bu(A.request);this._pendingCallback=z,this._pendingRequest=this.loadGeoJSON(A,(U,K)=>{if(delete this._pendingCallback,delete this._pendingRequest,U||!K)return z(U);if(typeof K!="object")return z(new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`));{Ee(K,!0);try{if(A.filter){const q=u.bC(A.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(q.result==="error")throw new Error(q.value.map(X=>`${X.key}: ${X.message}`).join(", "));K={type:"FeatureCollection",features:K.features.filter(X=>q.value.evaluate({zoom:0},X))}}this._geoJSONIndex=A.cluster?new ps(function({superclusterOptions:q,clusterProperties:X}){if(!X||!q)return q;const st={},at={},lt={accumulated:null,zoom:0},Et={properties:null},Ft=Object.keys(X);for(const Tt of Ft){const[Mt,Ot]=X[Tt],ee=u.bC(Ot),se=u.bC(typeof Mt=="string"?[Mt,["accumulated"],["get",Tt]]:Mt);st[Tt]=ee.value,at[Tt]=se.value}return q.map=Tt=>{Et.properties=Tt;const Mt={};for(const Ot of Ft)Mt[Ot]=st[Ot].evaluate(lt,Et);return Mt},q.reduce=(Tt,Mt)=>{Et.properties=Mt;for(const Ot of Ft)lt.accumulated=Tt[Ot],Tt[Ot]=at[Ot].evaluate(lt,Et)},q}(A)).load(K.features):function(q,X){return new gt(q,X)}(K,A.geojsonVtOptions)}catch(q){return z(q)}this.loaded={};const G={};if(O){const q=O.finish();q&&(G.resourceTiming={},G.resourceTiming[A.source]=JSON.parse(JSON.stringify(q)))}z(null,G)}})}reloadTile(A,z){const k=this.loaded;return k&&k[A.uid]?super.reloadTile(A,z):this.loadTile(A,z)}removeSource(A,z){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),z()}getClusterExpansionZoom(A,z){try{z(null,this._geoJSONIndex.getClusterExpansionZoom(A.clusterId))}catch(k){z(k)}}getClusterChildren(A,z){try{z(null,this._geoJSONIndex.getChildren(A.clusterId))}catch(k){z(k)}}getClusterLeaves(A,z){try{z(null,this._geoJSONIndex.getLeaves(A.clusterId,A.limit,A.offset))}catch(k){z(k)}}}class dr{constructor(A){this.self=A,this.actor=new u.C(A,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:ls,geojson:Vt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(z,k)=>{if(this.workerSourceTypes[z])throw new Error(`Worker source with name "${z}" already registered.`);this.workerSourceTypes[z]=k},this.self.registerRTLTextPlugin=z=>{if(u.bD.isParsed())throw new Error("RTL text plugin already registered.");u.bD.applyArabicShaping=z.applyArabicShaping,u.bD.processBidirectionalText=z.processBidirectionalText,u.bD.processStyledBidirectionalText=z.processStyledBidirectionalText}}setReferrer(A,z){this.referrer=z}setImages(A,z,k){this.availableImages[A]=z;for(const O in this.workerSources[A]){const U=this.workerSources[A][O];for(const K in U)U[K].availableImages=z}k()}setLayers(A,z,k){this.getLayerIndex(A).replace(z),k()}updateLayers(A,z,k){this.getLayerIndex(A).update(z.layers,z.removedIds),k()}loadTile(A,z,k){this.getWorkerSource(A,z.type,z.source).loadTile(z,k)}loadDEMTile(A,z,k){this.getDEMWorkerSource(A,z.source).loadTile(z,k)}reloadTile(A,z,k){this.getWorkerSource(A,z.type,z.source).reloadTile(z,k)}abortTile(A,z,k){this.getWorkerSource(A,z.type,z.source).abortTile(z,k)}removeTile(A,z,k){this.getWorkerSource(A,z.type,z.source).removeTile(z,k)}removeDEMTile(A,z){this.getDEMWorkerSource(A,z.source).removeTile(z)}removeSource(A,z,k){if(!this.workerSources[A]||!this.workerSources[A][z.type]||!this.workerSources[A][z.type][z.source])return;const O=this.workerSources[A][z.type][z.source];delete this.workerSources[A][z.type][z.source],O.removeSource!==void 0?O.removeSource(z,k):k()}loadWorkerSource(A,z,k){try{this.self.importScripts(z.url),k()}catch(O){k(O.toString())}}syncRTLPluginState(A,z,k){try{u.bD.setState(z);const O=u.bD.getPluginURL();if(u.bD.isLoaded()&&!u.bD.isParsed()&&O!=null){this.self.importScripts(O);const U=u.bD.isParsed();k(U?void 0:new Error(`RTL Text Plugin failed to import scripts from ${O}`),U)}}catch(O){k(O.toString())}}getAvailableImages(A){let z=this.availableImages[A];return z||(z=[]),z}getLayerIndex(A){let z=this.layerIndexes[A];return z||(z=this.layerIndexes[A]=new Hi),z}getWorkerSource(A,z,k){return this.workerSources[A]||(this.workerSources[A]={}),this.workerSources[A][z]||(this.workerSources[A][z]={}),this.workerSources[A][z][k]||(this.workerSources[A][z][k]=new this.workerSourceTypes[z]({send:(O,U,K)=>{this.actor.send(O,U,K,A)}},this.getLayerIndex(A),this.getAvailableImages(A))),this.workerSources[A][z][k]}getDEMWorkerSource(A,z){return this.demWorkerSources[A]||(this.demWorkerSources[A]={}),this.demWorkerSources[A][z]||(this.demWorkerSources[A][z]=new Rs),this.demWorkerSources[A][z]}}return u.i()&&(self.worker=new dr(self)),dr}),_l(["./shared"],function(u){var Hi="3.6.2";class it{static testProp(e){if(!it.docStyle)return e[0];for(let s=0;s<e.length;s++)if(e[s]in it.docStyle)return e[s];return e[0]}static create(e,s,n){const l=window.document.createElement(e);return s!==void 0&&(l.className=s),n&&n.appendChild(l),l}static createNS(e,s){return window.document.createElementNS(e,s)}static disableDrag(){it.docStyle&&it.selectProp&&(it.userSelect=it.docStyle[it.selectProp],it.docStyle[it.selectProp]="none")}static enableDrag(){it.docStyle&&it.selectProp&&(it.docStyle[it.selectProp]=it.userSelect)}static setTransform(e,s){e.style[it.transformProp]=s}static addEventListener(e,s,n,l={}){e.addEventListener(s,n,"passive"in l?l:l.capture)}static removeEventListener(e,s,n,l={}){e.removeEventListener(s,n,"passive"in l?l:l.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",it.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",it.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",it.suppressClickInternal,!0)},0)}static mousePos(e,s){const n=e.getBoundingClientRect();return new u.P(s.clientX-n.left-e.clientLeft,s.clientY-n.top-e.clientTop)}static touchPos(e,s){const n=e.getBoundingClientRect(),l=[];for(let c=0;c<s.length;c++)l.push(new u.P(s[c].clientX-n.left-e.clientLeft,s[c].clientY-n.top-e.clientTop));return l}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}}it.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,it.selectProp=it.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),it.transformProp=it.testProp(["transform","WebkitTransform"]);const Ji={supported:!1,testSupport:function(h){!ls&&Bt&&(Rs?us(h):ui=h)}};let ui,Bt,ls=!1,Rs=!1;function us(h){const e=h.createTexture();h.bindTexture(h.TEXTURE_2D,e);try{if(h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,Bt),h.isContextLost())return;Ji.supported=!0}catch{}h.deleteTexture(e),ls=!0}var ti,Ee;typeof document<"u"&&(Bt=document.createElement("img"),Bt.onload=function(){ui&&us(ui),ui=null,Rs=!0},Bt.onerror=function(){ls=!0,ui=null},Bt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(h){let e,s,n,l;h.resetRequestQueue=()=>{e=[],s=0,n=0,l={}},h.addThrottleControl=v=>{const w=n++;return l[w]=v,w},h.removeThrottleControl=v=>{delete l[v],g()},h.getImage=(v,w,S=!0)=>{Ji.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*");const P={requestParameters:v,supportImageRefresh:S,callback:w,cancelled:!1,completed:!1,cancel:()=>{P.completed||P.cancelled||(P.cancelled=!0,P.innerRequest&&(P.innerRequest.cancel(),s--),g())}};return e.push(P),g(),P};const c=v=>{const{requestParameters:w,supportImageRefresh:S,callback:P}=v;return u.e(w,{type:"image"}),(S!==!1||u.i()||u.g(w.url)||w.headers&&!Object.keys(w.headers).reduce((L,B)=>L&&B==="accept",!0)?u.m:y)(w,(L,B,R,M)=>{m(v,P,L,B,R,M)})},m=(v,w,S,P,L,B)=>{S?w(S):P instanceof HTMLImageElement||u.a(P)?w(null,P):P&&((R,M)=>{typeof createImageBitmap=="function"?u.b(R,M):u.d(R,M)})(P,(R,M)=>{R!=null?w(R):M!=null&&w(null,M,{cacheControl:L,expires:B})}),v.cancelled||(v.completed=!0,s--,g())},g=()=>{const v=(()=>{const w=Object.keys(l);let S=!1;if(w.length>0){for(const P of w)if(S=l[P](),S)break}return S})()?u.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:u.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let w=s;w<v&&e.length>0;w++){const S=e.shift();if(S.cancelled){w--;continue}const P=c(S);s++,S.innerRequest=P}},y=(v,w)=>{const S=new Image,P=v.url;let L=!1;const B=v.credentials;return B&&B==="include"?S.crossOrigin="use-credentials":(B&&B==="same-origin"||!u.s(P))&&(S.crossOrigin="anonymous"),S.fetchPriority="high",S.onload=()=>{w(null,S),S.onerror=S.onload=null},S.onerror=()=>{L||w(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),S.onerror=S.onload=null},S.src=P,{cancel:()=>{L=!0,S.src=""}}}}(ti||(ti={})),ti.resetRequestQueue(),function(h){h.Glyphs="Glyphs",h.Image="Image",h.Source="Source",h.SpriteImage="SpriteImage",h.SpriteJSON="SpriteJSON",h.Style="Style",h.Tile="Tile",h.Unknown="Unknown"}(Ee||(Ee={}));class ca{constructor(e){this._transformRequestFn=e}transformRequest(e,s){return this._transformRequestFn&&this._transformRequestFn(e,s)||{url:e}}normalizeSpriteURL(e,s,n){const l=function(c){const m=c.match(Tr);if(!m)throw new Error(`Unable to parse URL "${c}"`);return{protocol:m[1],authority:m[2],path:m[3]||"/",params:m[4]?m[4].split("&"):[]}}(e);return l.path+=`${s}${n}`,function(c){const m=c.params.length?`?${c.params.join("&")}`:"";return`${c.protocol}://${c.authority}${c.path}${m}`}(l)}setTransformRequest(e){this._transformRequestFn=e}}const Tr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Os(h){var e=new u.A(3);return e[0]=h[0],e[1]=h[1],e[2]=h[2],e}var hs,Ki=function(h,e,s){return h[0]=e[0]-s[0],h[1]=e[1]-s[1],h[2]=e[2]-s[2],h};hs=new u.A(3),u.A!=Float32Array&&(hs[0]=0,hs[1]=0,hs[2]=0);var Vs=function(h){var e=h[0],s=h[1];return e*e+s*s};function $e(h){const e=[];if(typeof h=="string")e.push({id:"default",url:h});else if(h&&h.length>0){const s=[];for(const{id:n,url:l}of h){const c=`${n}${l}`;s.indexOf(c)===-1&&(s.push(c),e.push({id:n,url:l}))}}return e}function pa(h,e,s,n,l){if(n)return void h(n);if(l!==Object.values(e).length||l!==Object.values(s).length)return;const c={};for(const m in e){c[m]={};const g=u.h.getImageCanvasContext(s[m]),y=e[m];for(const v in y){const{width:w,height:S,x:P,y:L,sdf:B,pixelRatio:R,stretchX:M,stretchY:Z,content:Y}=y[v];c[m][v]={data:null,pixelRatio:R,sdf:B,stretchX:M,stretchY:Z,content:Y,spriteData:{width:w,height:S,x:P,y:L,context:g}}}}h(null,c)}(function(){var h=new u.A(2);u.A!=Float32Array&&(h[0]=0,h[1]=0)})();class me{constructor(e,s,n,l){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(s,l)}update(e,s,n){const{width:l,height:c}=e,m=!(this.size&&this.size[0]===l&&this.size[1]===c||n),{context:g}=this,{gl:y}=g;if(this.useMipmap=!!(s&&s.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1),g.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!s||s.premultiply!==!1)),m)this.size=[l,c],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||u.a(e)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,e):y.texImage2D(y.TEXTURE_2D,0,this.format,l,c,0,this.format,y.UNSIGNED_BYTE,e.data);else{const{x:v,y:w}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||u.a(e)?y.texSubImage2D(y.TEXTURE_2D,0,v,w,y.RGBA,y.UNSIGNED_BYTE,e):y.texSubImage2D(y.TEXTURE_2D,0,v,w,l,c,y.RGBA,y.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(e,s,n){const{context:l}=this,{gl:c}=l;c.bindTexture(c.TEXTURE_2D,this.texture),n!==c.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=c.LINEAR),e!==this.filter&&(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,e),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,n||e),this.filter=e),s!==this.wrap&&(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,s),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,s),this.wrap=s)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function cs(h){const{userImage:e}=h;return!!(e&&e.render&&e.render())&&(h.data.replace(new Uint8Array(e.data.buffer)),!0)}class $i extends u.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:s,callback:n}of this.requestors)this._notify(s,n);this.requestors=[]}}getImage(e){const s=this.images[e];if(s&&!s.data&&s.spriteData){const n=s.spriteData;s.data=new u.R({width:n.width,height:n.height},n.context.getImageData(n.x,n.y,n.width,n.height).data),s.spriteData=null}return s}addImage(e,s){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,s)&&(this.images[e]=s)}_validate(e,s){let n=!0;const l=s.data||s.spriteData;return this._validateStretch(s.stretchX,l&&l.width)||(this.fire(new u.j(new Error(`Image "${e}" has invalid "stretchX" value`))),n=!1),this._validateStretch(s.stretchY,l&&l.height)||(this.fire(new u.j(new Error(`Image "${e}" has invalid "stretchY" value`))),n=!1),this._validateContent(s.content,s)||(this.fire(new u.j(new Error(`Image "${e}" has invalid "content" value`))),n=!1),n}_validateStretch(e,s){if(!e)return!0;let n=0;for(const l of e){if(l[0]<n||l[1]<l[0]||s<l[1])return!1;n=l[1]}return!0}_validateContent(e,s){if(!e)return!0;if(e.length!==4)return!1;const n=s.spriteData,l=n&&n.width||s.data.width,c=n&&n.height||s.data.height;return!(e[0]<0||l<e[0]||e[1]<0||c<e[1]||e[2]<0||l<e[2]||e[3]<0||c<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,s,n=!0){const l=this.getImage(e);if(n&&(l.data.width!==s.data.width||l.data.height!==s.data.height))throw new Error(`size mismatch between old image (${l.data.width}x${l.data.height}) and new image (${s.data.width}x${s.data.height}).`);s.version=l.version+1,this.images[e]=s,this.updatedImages[e]=!0}removeImage(e){const s=this.images[e];delete this.images[e],delete this.patterns[e],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e,s){let n=!0;if(!this.isLoaded())for(const l of e)this.images[l]||(n=!1);this.isLoaded()||n?this._notify(e,s):this.requestors.push({ids:e,callback:s})}_notify(e,s){const n={};for(const l of e){let c=this.getImage(l);c||(this.fire(new u.k("styleimagemissing",{id:l})),c=this.getImage(l)),c?n[l]={data:c.data.clone(),pixelRatio:c.pixelRatio,sdf:c.sdf,version:c.version,stretchX:c.stretchX,stretchY:c.stretchY,content:c.content,hasRenderCallback:!!(c.userImage&&c.userImage.render)}:u.w(`Image "${l}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}s(null,n)}getPixelSize(){const{width:e,height:s}=this.atlasImage;return{width:e,height:s}}getPattern(e){const s=this.patterns[e],n=this.getImage(e);if(!n)return null;if(s&&s.position.version===n.version)return s.position;if(s)s.position.version=n.version;else{const l={w:n.data.width+2,h:n.data.height+2,x:0,y:0},c=new u.I(l,n);this.patterns[e]={bin:l,position:c}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const s=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new me(e,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const c in this.patterns)e.push(this.patterns[c].bin);const{w:s,h:n}=u.p(e),l=this.atlasImage;l.resize({width:s||1,height:n||1});for(const c in this.patterns){const{bin:m}=this.patterns[c],g=m.x+1,y=m.y+1,v=this.getImage(c).data,w=v.width,S=v.height;u.R.copy(v,l,{x:0,y:0},{x:g,y},{width:w,height:S}),u.R.copy(v,l,{x:0,y:S-1},{x:g,y:y-1},{width:w,height:1}),u.R.copy(v,l,{x:0,y:0},{x:g,y:y+S},{width:w,height:1}),u.R.copy(v,l,{x:w-1,y:0},{x:g-1,y},{width:1,height:S}),u.R.copy(v,l,{x:0,y:0},{x:g+w,y},{width:1,height:S})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const s of e){if(this.callbackDispatchedThisFrame[s])continue;this.callbackDispatchedThisFrame[s]=!0;const n=this.getImage(s);n||u.w(`Image with ID: "${s}" was not found`),cs(n)&&this.updateImage(s,n)}}}const Ar=1e20;function ei(h,e,s,n,l,c,m,g,y){for(let v=e;v<e+n;v++)vi(h,s*c+v,c,l,m,g,y);for(let v=s;v<s+l;v++)vi(h,v*c+e,1,n,m,g,y)}function vi(h,e,s,n,l,c,m){c[0]=0,m[0]=-Ar,m[1]=Ar,l[0]=h[e];for(let g=1,y=0,v=0;g<n;g++){l[g]=h[e+g*s];const w=g*g;do{const S=c[y];v=(l[g]-l[S]+w-S*S)/(g-S)/2}while(v<=m[y]&&--y>-1);y++,c[y]=g,m[y]=v,m[y+1]=Ar}for(let g=0,y=0;g<n;g++){for(;m[y+1]<g;)y++;const v=c[y],w=g-v;h[e+g*s]=l[v]+w*w}}class ur{constructor(e,s){this.requestManager=e,this.localIdeographFontFamily=s,this.entries={}}setURL(e){this.url=e}getGlyphs(e,s){const n=[];for(const l in e)for(const c of e[l])n.push({stack:l,id:c});u.o(n,({stack:l,id:c},m)=>{let g=this.entries[l];g||(g=this.entries[l]={glyphs:{},requests:{},ranges:{}});let y=g.glyphs[c];if(y!==void 0)return void m(null,{stack:l,id:c,glyph:y});if(y=this._tinySDF(g,l,c),y)return g.glyphs[c]=y,void m(null,{stack:l,id:c,glyph:y});const v=Math.floor(c/256);if(256*v>65535)return void m(new Error("glyphs > 65535 not supported"));if(g.ranges[v])return void m(null,{stack:l,id:c,glyph:y});if(!this.url)return void m(new Error("glyphsUrl is not set"));let w=g.requests[v];w||(w=g.requests[v]=[],ur.loadGlyphRange(l,v,this.url,this.requestManager,(S,P)=>{if(P){for(const L in P)this._doesCharSupportLocalGlyph(+L)||(g.glyphs[+L]=P[+L]);g.ranges[v]=!0}for(const L of w)L(S,P);delete g.requests[v]})),w.push((S,P)=>{S?m(S):P&&m(null,{stack:l,id:c,glyph:P[c]||null})})},(l,c)=>{if(l)s(l);else if(c){const m={};for(const{stack:g,id:y,glyph:v}of c)(m[g]||(m[g]={}))[y]=v&&{id:v.id,bitmap:v.bitmap.clone(),metrics:v.metrics};s(null,m)}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&(u.u["CJK Unified Ideographs"](e)||u.u["Hangul Syllables"](e)||u.u.Hiragana(e)||u.u.Katakana(e))}_tinySDF(e,s,n){const l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(n))return;let c=e.tinySDF;if(!c){let g="400";/bold/i.test(s)?g="900":/medium/i.test(s)?g="500":/light/i.test(s)&&(g="200"),c=e.tinySDF=new ur.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:g})}const m=c.draw(String.fromCharCode(n));return{id:n,bitmap:new u.q({width:m.width||60,height:m.height||60},m.data),metrics:{width:m.glyphWidth/2||24,height:m.glyphHeight/2||24,left:m.glyphLeft/2+.5||0,top:m.glyphTop/2-27.5||-8,advance:m.glyphAdvance/2||24,isDoubleResolution:!0}}}}ur.loadGlyphRange=function(h,e,s,n,l){const c=256*e,m=c+255,g=n.transformRequest(s.replace("{fontstack}",h).replace("{range}",`${c}-${m}`),Ee.Glyphs);u.l(g,(y,v)=>{if(y)l(y);else if(v){const w={};for(const S of u.n(v))w[S.id]=S;l(null,w)}})},ur.TinySDF=class{constructor({fontSize:h=24,buffer:e=3,radius:s=8,cutoff:n=.25,fontFamily:l="sans-serif",fontWeight:c="normal",fontStyle:m="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=s;const g=this.size=h+4*e,y=this._createCanvas(g),v=this.ctx=y.getContext("2d",{willReadFrequently:!0});v.font=`${m} ${c} ${h}px ${l}`,v.textBaseline="alphabetic",v.textAlign="left",v.fillStyle="black",this.gridOuter=new Float64Array(g*g),this.gridInner=new Float64Array(g*g),this.f=new Float64Array(g),this.z=new Float64Array(g+1),this.v=new Uint16Array(g)}_createCanvas(h){const e=document.createElement("canvas");return e.width=e.height=h,e}draw(h){const{width:e,actualBoundingBoxAscent:s,actualBoundingBoxDescent:n,actualBoundingBoxLeft:l,actualBoundingBoxRight:c}=this.ctx.measureText(h),m=Math.ceil(s),g=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-l))),y=Math.min(this.size-this.buffer,m+Math.ceil(n)),v=g+2*this.buffer,w=y+2*this.buffer,S=Math.max(v*w,0),P=new Uint8ClampedArray(S),L={data:P,width:v,height:w,glyphWidth:g,glyphHeight:y,glyphTop:m,glyphLeft:0,glyphAdvance:e};if(g===0||y===0)return L;const{ctx:B,buffer:R,gridInner:M,gridOuter:Z}=this;B.clearRect(R,R,g,y),B.fillText(h,R,R+m);const Y=B.getImageData(R,R,g,y);Z.fill(Ar,0,S),M.fill(0,0,S);for(let N=0;N<y;N++)for(let H=0;H<g;H++){const tt=Y.data[4*(N*g+H)+3]/255;if(tt===0)continue;const et=(N+R)*v+H+R;if(tt===1)Z[et]=0,M[et]=Ar;else{const nt=.5-tt;Z[et]=nt>0?nt*nt:0,M[et]=nt<0?nt*nt:0}}ei(Z,0,0,v,w,v,this.f,this.v,this.z),ei(M,R,R,g,y,v,this.f,this.v,this.z);for(let N=0;N<S;N++){const H=Math.sqrt(Z[N])-Math.sqrt(M[N]);P[N]=Math.round(255-255*(H/this.radius+this.cutoff))}return L}};class ki{constructor(){this.specification=u.v.light.position}possiblyEvaluate(e,s){return u.z(e.expression.evaluate(s))}interpolate(e,s,n){return{x:u.B.number(e.x,s.x,n),y:u.B.number(e.y,s.y,n),z:u.B.number(e.z,s.z,n)}}}let Ur;class Us extends u.E{constructor(e){super(),Ur=Ur||new u.r({anchor:new u.D(u.v.light.anchor),position:new ki,color:new u.D(u.v.light.color),intensity:new u.D(u.v.light.intensity)}),this._transitionable=new u.T(Ur),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,s={}){if(!this._validate(u.t,e,s))for(const n in e){const l=e[n];n.endsWith("-transition")?this._transitionable.setTransition(n.slice(0,-11),l):this._transitionable.setValue(n,l)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,s,n){return(!n||n.validate!==!1)&&u.x(this,e.call(u.y,u.e({value:s,style:{glyphs:!0,sprite:!0},styleSpec:u.v})))}}class da{constructor(e,s){this.width=e,this.height=s,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,s){const n=e.join(",")+String(s);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(e,s)),this.dashEntry[n]}getDashRanges(e,s,n){const l=[];let c=e.length%2==1?-e[e.length-1]*n:0,m=e[0]*n,g=!0;l.push({left:c,right:m,isDash:g,zeroLength:e[0]===0});let y=e[0];for(let v=1;v<e.length;v++){g=!g;const w=e[v];c=y*n,y+=w,m=y*n,l.push({left:c,right:m,isDash:g,zeroLength:w===0})}return l}addRoundDash(e,s,n){const l=s/2;for(let c=-n;c<=n;c++){const m=this.width*(this.nextRow+n+c);let g=0,y=e[g];for(let v=0;v<this.width;v++){v/y.right>1&&(y=e[++g]);const w=Math.abs(v-y.left),S=Math.abs(v-y.right),P=Math.min(w,S);let L;const B=c/n*(l+1);if(y.isDash){const R=l-Math.abs(B);L=Math.sqrt(P*P+R*R)}else L=l-Math.sqrt(P*P+B*B);this.data[m+v]=Math.max(0,Math.min(255,L+128))}}}addRegularDash(e){for(let g=e.length-1;g>=0;--g){const y=e[g],v=e[g+1];y.zeroLength?e.splice(g,1):v&&v.isDash===y.isDash&&(v.left=y.left,e.splice(g,1))}const s=e[0],n=e[e.length-1];s.isDash===n.isDash&&(s.left=n.left-this.width,n.right=s.right+this.width);const l=this.width*this.nextRow;let c=0,m=e[c];for(let g=0;g<this.width;g++){g/m.right>1&&(m=e[++c]);const y=Math.abs(g-m.left),v=Math.abs(g-m.right),w=Math.min(y,v);this.data[l+g]=Math.max(0,Math.min(255,(m.isDash?w:-w)+128))}}addDash(e,s){const n=s?7:0,l=2*n+1;if(this.nextRow+l>this.height)return u.w("LineAtlas out of space"),null;let c=0;for(let g=0;g<e.length;g++)c+=e[g];if(c!==0){const g=this.width/c,y=this.getDashRanges(e,this.width,g);s?this.addRoundDash(y,g,n):this.addRegularDash(y)}const m={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:c};return this.nextRow+=l,this.dirty=!0,m}bind(e){const s=e.gl;this.texture?(s.bindTexture(s.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,s.texSubImage2D(s.TEXTURE_2D,0,0,0,this.width,this.height,s.ALPHA,s.UNSIGNED_BYTE,this.data))):(this.texture=s.createTexture(),s.bindTexture(s.TEXTURE_2D,this.texture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texImage2D(s.TEXTURE_2D,0,s.ALPHA,this.width,this.height,0,s.ALPHA,s.UNSIGNED_BYTE,this.data))}}class Ns{constructor(e,s,n){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=n;const l=this.workerPool.acquire(n);for(let c=0;c<l.length;c++){const m=new u.C(l[c],s,n);m.name=`Worker ${c}`,this.actors.push(m)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,s,n){u.o(this.actors,(l,c)=>{l.send(e,s,c)},n=n||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach(s=>{s.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}}function Wi(h,e,s){const n=function(l,c){if(l)return s(l);if(c){const m=u.F(u.e(c,h),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);c.vector_layers&&(m.vectorLayers=c.vector_layers,m.vectorLayerIds=m.vectorLayers.map(g=>g.id)),s(null,m)}};return h.url?u.f(e.transformRequest(h.url,Ee.Source),n):u.h.frame(()=>n(null,h))}class ue{constructor(e,s){e&&(s?this.setSouthWest(e).setNorthEast(s):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof u.L?new u.L(e.lng,e.lat):u.L.convert(e),this}setSouthWest(e){return this._sw=e instanceof u.L?new u.L(e.lng,e.lat):u.L.convert(e),this}extend(e){const s=this._sw,n=this._ne;let l,c;if(e instanceof u.L)l=e,c=e;else{if(!(e instanceof ue))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(ue.convert(e)):this.extend(u.L.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(u.L.convert(e)):this;if(l=e._sw,c=e._ne,!l||!c)return this}return s||n?(s.lng=Math.min(l.lng,s.lng),s.lat=Math.min(l.lat,s.lat),n.lng=Math.max(c.lng,n.lng),n.lat=Math.max(c.lat,n.lat)):(this._sw=new u.L(l.lng,l.lat),this._ne=new u.L(c.lng,c.lat)),this}getCenter(){return new u.L((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new u.L(this.getWest(),this.getNorth())}getSouthEast(){return new u.L(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:s,lat:n}=u.L.convert(e);let l=this._sw.lng<=s&&s<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=s&&s>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&l}static convert(e){return e instanceof ue?e:e&&new ue(e)}static fromLngLat(e,s=0){const n=360*s/40075017,l=n/Math.cos(Math.PI/180*e.lat);return new ue(new u.L(e.lng-l,e.lat-n),new u.L(e.lng+l,e.lat+n))}}class hi{constructor(e,s,n){this.bounds=ue.convert(this.validateBounds(e)),this.minzoom=s||0,this.maxzoom=n||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const s=Math.pow(2,e.z),n=Math.floor(u.G(this.bounds.getWest())*s),l=Math.floor(u.H(this.bounds.getNorth())*s),c=Math.ceil(u.G(this.bounds.getEast())*s),m=Math.ceil(u.H(this.bounds.getSouth())*s);return e.x>=n&&e.x<c&&e.y>=l&&e.y<m}}class Nr extends u.E{constructor(e,s,n,l){if(super(),this.load=()=>{this._loaded=!1,this.fire(new u.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Wi(this._options,this.map._requestManager,(c,m)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),c?this.fire(new u.j(c)):m&&(u.e(this,m),m.bounds&&(this.tileBounds=new hi(m.bounds,this.minzoom,this.maxzoom)),this.fire(new u.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new u.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>u.e({},this._options),this.id=e,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.e(this,u.F(s,["url","scheme","tileSize","promoteId"])),this._options=u.e({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.cancel(),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(e,s){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l={request:this.map._requestManager.transformRequest(n,Ee.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function c(m,g){return delete e.request,e.aborted?s(null):m&&m.status!==404?s(m):(g&&g.resourceTiming&&(e.resourceTiming=g.resourceTiming),this.map._refreshExpiredTiles&&g&&e.setExpiryData(g),e.loadVectorData(g,this.map.painter),s(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}l.request.collectResourceTiming=this._collectResourceTiming,e.actor&&e.state!=="expired"?e.state==="loading"?e.reloadCallback=s:e.request=e.actor.send("reloadTile",l,c.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",l,c.bind(this)))}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id},void 0)}unloadTile(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class ps extends u.E{constructor(e,s,n,l){super(),this.id=e,this.dispatcher=n,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.e({type:"raster"},s),u.e(this,u.F(s,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new u.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Wi(this._options,this.map._requestManager,(e,s)=>{this._tileJSONRequest=null,this._loaded=!0,e?this.fire(new u.j(e)):s&&(u.e(this,s),s.bounds&&(this.tileBounds=new hi(s.bounds,this.minzoom,this.maxzoom)),this.fire(new u.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new u.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.cancel(),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}serialize(){return u.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e,s){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.request=ti.getImage(this.map._requestManager.transformRequest(n,Ee.Tile),(l,c,m)=>{if(delete e.request,e.aborted)e.state="unloaded",s(null);else if(l)e.state="errored",s(l);else if(c){this.map._refreshExpiredTiles&&m&&e.setExpiryData(m);const g=this.map.painter.context,y=g.gl;e.texture=this.map.painter.getTileTexture(c.width),e.texture?e.texture.update(c,{useMipmap:!0}):(e.texture=new me(g,c,y.RGBA,{useMipmap:!0}),e.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST),g.extTextureFilterAnisotropic&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax)),e.state="loaded",s(null)}},this.map._refreshExpiredTiles)}abortTile(e,s){e.request&&(e.request.cancel(),delete e.request),s()}unloadTile(e,s){e.texture&&this.map.painter.saveTileTexture(e.texture),s()}hasTransition(){return!1}}class ds extends ps{constructor(e,s,n,l){super(e,s,n,l),this.type="raster-dem",this.maxzoom=22,this._options=u.e({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox",this.redFactor=s.redFactor,this.greenFactor=s.greenFactor,this.blueFactor=s.blueFactor,this.baseShift=s.baseShift}loadTile(e,s){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l=this.map._requestManager.transformRequest(n,Ee.Tile);function c(m,g){m&&(e.state="errored",s(m)),g&&(e.dem=g,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded",s(null))}e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.request=ti.getImage(l,(m,g,y)=>u._(this,void 0,void 0,function*(){if(delete e.request,e.aborted)e.state="unloaded",s(null);else if(m)e.state="errored",s(m);else if(g){this.map._refreshExpiredTiles&&e.setExpiryData(y);const v=u.a(g)&&u.J()?g:yield function(S){return u._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&u.K()){const P=S.width+2,L=S.height+2;try{return new u.R({width:P,height:L},yield u.M(S,-1,-1,P,L))}catch{}}return u.h.getImageData(S,1)})}(g),w={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:v,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};e.actor&&e.state!=="expired"||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",w,c))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(e){const s=e.canonical,n=Math.pow(2,s.z),l=(s.x-1+n)%n,c=s.x===0?e.wrap-1:e.wrap,m=(s.x+1+n)%n,g=s.x+1===n?e.wrap+1:e.wrap,y={};return y[new u.O(e.overscaledZ,c,s.z,l,s.y).key]={backfilled:!1},y[new u.O(e.overscaledZ,g,s.z,m,s.y).key]={backfilled:!1},s.y>0&&(y[new u.O(e.overscaledZ,c,s.z,l,s.y-1).key]={backfilled:!1},y[new u.O(e.overscaledZ,e.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},y[new u.O(e.overscaledZ,g,s.z,m,s.y-1).key]={backfilled:!1}),s.y+1<n&&(y[new u.O(e.overscaledZ,c,s.z,l,s.y+1).key]={backfilled:!1},y[new u.O(e.overscaledZ,e.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},y[new u.O(e.overscaledZ,g,s.z,m,s.y+1).key]={backfilled:!1}),y}unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&e.actor.send("removeDEMTile",{uid:e.uid,source:this.id})}}class Ir extends u.E{constructor(e,s,n,l){super(),this.load=()=>{this._updateWorkerData()},this.serialize=()=>u.e({},this._options,{type:this.type,data:this._data}),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=n.getActor(),this.setEventedParent(l),this._data=s.data,this._options=u.e({},s),this._collectResourceTiming=s.collectResourceTiming,s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;const c=u.N/this.tileSize;this.workerOptions=u.e({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*c,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*c,extent:u.N,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?s.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:u.N,radius:(s.clusterRadius||50)*c,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=e.clusterRadius),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(e,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},s),this}getClusterChildren(e,s){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},s),this}getClusterLeaves(e,s,n,l){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:s,offset:n},l),this}_updateWorkerData(e){const s=u.e({},this.workerOptions);e?s.dataDiff=e:typeof this._data=="string"?(s.request=this.map._requestManager.transformRequest(u.h.resolveURL(this._data),Ee.Source),s.request.collectResourceTiming=this._collectResourceTiming):s.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new u.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,s,(n,l)=>{if(this._pendingLoads--,this._removed||l&&l.abandoned)return void this.fire(new u.k("dataabort",{dataType:"source"}));let c=null;if(l&&l.resourceTiming&&l.resourceTiming[this.id]&&(c=l.resourceTiming[this.id].slice(0)),n)return void this.fire(new u.j(n));const m={dataType:"source"};this._collectResourceTiming&&c&&c.length>0&&u.e(m,{resourceTiming:c}),this.fire(new u.k("data",Object.assign(Object.assign({},m),{sourceDataType:"metadata"}))),this.fire(new u.k("data",Object.assign(Object.assign({},m),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(e,s){const n=e.actor?"reloadTile":"loadTile";e.actor=this.actor;const l={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(n,l,(c,m)=>(delete e.request,e.unloadVectorData(),e.aborted?s(null):c?s(c):(e.loadVectorData(m,this.map.painter,n==="reloadTile"),s(null))))}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var qi=u.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Mi extends u.E{constructor(e,s,n,l){super(),this.load=(c,m)=>{this._loaded=!1,this.fire(new u.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=ti.getImage(this.map._requestManager.transformRequest(this.url,Ee.Image),(g,y)=>{this._request=null,this._loaded=!0,g?this.fire(new u.j(g)):y&&(this.image=y,c&&(this.coordinates=c),m&&m(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const c=this.map.painter.context,m=c.gl;this.boundsBuffer||(this.boundsBuffer=c.createVertexBuffer(this._boundsArray,qi.members)),this.boundsSegments||(this.boundsSegments=u.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new me(c,this.image,m.RGBA),this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE));let g=!1;for(const y in this.tiles){const v=this.tiles[y];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,g=!0)}g&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=e,this.dispatcher=n,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=s}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=e.url,this.load(e.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(e){this.coordinates=e;const s=e.map(u.U.fromLngLat);this.tileID=function(l){let c=1/0,m=1/0,g=-1/0,y=-1/0;for(const P of l)c=Math.min(c,P.x),m=Math.min(m,P.y),g=Math.max(g,P.x),y=Math.max(y,P.y);const v=Math.max(g-c,y-m),w=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),S=Math.pow(2,w);return new u.W(w,Math.floor((c+g)/2*S),Math.floor((m+y)/2*S))}(s),this.minzoom=this.maxzoom=this.tileID.z;const n=s.map(l=>this.tileID.getTilePoint(l)._round());return this._boundsArray=new u.V,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,u.N,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,u.N),this._boundsArray.emplaceBack(n[2].x,n[2].y,u.N,u.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new u.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(e,s){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},s(null)):(e.state="errored",s(null))}hasTransition(){return!1}}class $s extends Mi{constructor(e,s,n,l){super(e,s,n,l),this.load=()=>{this._loaded=!1;const c=this.options;this.urls=[];for(const m of c.urls)this.urls.push(this.map._requestManager.transformRequest(m,Ee.Source).url);u.X(this.urls,(m,g)=>{this._loaded=!0,m?this.fire(new u.j(m)):g&&(this.video=g,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const c=this.map.painter.context,m=c.gl;this.boundsBuffer||(this.boundsBuffer=c.createVertexBuffer(this._boundsArray,qi.members)),this.boundsSegments||(this.boundsSegments=u.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE),m.texSubImage2D(m.TEXTURE_2D,0,0,0,m.RGBA,m.UNSIGNED_BYTE,this.video)):(this.texture=new me(c,this.video,m.RGBA),this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE));let g=!1;for(const y in this.tiles){const v=this.tiles[y];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,g=!0)}g&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=s}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const s=this.video.seekable;e<s.start(0)||e>s.end(0)?this.fire(new u.j(new u.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${s.start(0)} and ${s.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class zr extends Mi{constructor(e,s,n,l){super(e,s,n,l),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new u.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},this.prepare=()=>{let c=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,c=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,c=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const m=this.map.painter.context,g=m.gl;this.boundsBuffer||(this.boundsBuffer=m.createVertexBuffer(this._boundsArray,qi.members)),this.boundsSegments||(this.boundsSegments=u.S.simpleSegment(0,0,4,2)),this.texture?(c||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new me(m,this.canvas,g.RGBA,{premultiply:!0});let y=!1;for(const v in this.tiles){const w=this.tiles[v];w.state!=="loaded"&&(w.state="loaded",w.texture=this.texture,y=!0)}y&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some(c=>!Array.isArray(c)||c.length!==2||c.some(m=>typeof m!="number"))||this.fire(new u.j(new u.Y(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.j(new u.Y(`sources.${e}`,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new u.j(new u.Y(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof HTMLCanvasElement||this.fire(new u.j(new u.Y(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new u.j(new u.Y(`sources.${e}`,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const qs={},hr=h=>{switch(h){case"geojson":return Ir;case"image":return Mi;case"raster":return ps;case"raster-dem":return ds;case"vector":return Nr;case"video":return $s;case"canvas":return zr}return qs[h]};function fs(h,e){const s=u.Z();return u.$(s,s,[1,1,0]),u.a0(s,s,[.5*h.width,.5*h.height,1]),u.a1(s,s,h.calculatePosMatrix(e.toUnwrapped()))}function $r(h,e,s,n,l,c){const m=function(S,P,L){if(S)for(const B of S){const R=P[B];if(R&&R.source===L&&R.type==="fill-extrusion")return!0}else for(const B in P){const R=P[B];if(R.source===L&&R.type==="fill-extrusion")return!0}return!1}(l&&l.layers,e,h.id),g=c.maxPitchScaleFactor(),y=h.tilesIn(n,g,m);y.sort(Pr);const v=[];for(const S of y)v.push({wrappedTileID:S.tileID.wrapped().key,queryResults:S.tile.queryRenderedFeatures(e,s,h._state,S.queryGeometry,S.cameraQueryGeometry,S.scale,l,c,g,fs(h.transform,S.tileID))});const w=function(S){const P={},L={};for(const B of S){const R=B.queryResults,M=B.wrappedTileID,Z=L[M]=L[M]||{};for(const Y in R){const N=R[Y],H=Z[Y]=Z[Y]||{},tt=P[Y]=P[Y]||[];for(const et of N)H[et.featureIndex]||(H[et.featureIndex]=!0,tt.push(et))}}return P}(v);for(const S in w)w[S].forEach(P=>{const L=P.feature,B=h.getFeatureState(L.layer["source-layer"],L.id);L.source=L.layer.source,L.layer["source-layer"]&&(L.sourceLayer=L.layer["source-layer"]),L.state=B});return w}function Pr(h,e){const s=h.tileID,n=e.tileID;return s.overscaledZ-n.overscaledZ||s.canonical.y-n.canonical.y||s.wrap-n.wrap||s.canonical.x-n.canonical.x}class Cr{constructor(e,s){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=u.a2(),this.uses=0,this.tileSize=s,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const s=e+this.timeAdded;s<this.fadeEndTime||(this.fadeEndTime=s)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,s,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(l,c){const m={};if(!c)return m;for(const g of l){const y=g.layerIds.map(v=>c.getLayer(v)).filter(Boolean);if(y.length!==0){g.layers=y,g.stateDependentLayerIds&&(g.stateDependentLayers=g.stateDependentLayerIds.map(v=>y.filter(w=>w.id===v)[0]));for(const v of y)m[v.id]=g}}return m}(e.buckets,s.style),this.hasSymbolBuckets=!1;for(const l in this.buckets){const c=this.buckets[l];if(c instanceof u.a4){if(this.hasSymbolBuckets=!0,!n)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const l in this.buckets){const c=this.buckets[l];if(c instanceof u.a4&&c.hasRTLText){this.hasRTLText=!0,u.a5();break}}this.queryPadding=0;for(const l in this.buckets){const c=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,s.style.getLayer(l).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new u.a3}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const n in this.buckets){const l=this.buckets[n];l.uploadPending()&&l.upload(e)}const s=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new me(e,this.imageAtlas.image,s.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new me(e,this.glyphAtlasImage,s.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,s,n,l,c,m,g,y,v,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:c,scale:m,tileSize:this.tileSize,pixelPosMatrix:w,transform:y,params:g,queryPadding:this.queryPadding*v},e,s,n):{}}querySourceFeatures(e,s){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const l=n.loadVTLayers(),c=s&&s.sourceLayer?s.sourceLayer:"",m=l._geojsonTileLayer||l[c];if(!m)return;const g=u.a6(s&&s.filter),{z:y,x:v,y:w}=this.tileID.canonical,S={z:y,x:v,y:w};for(let P=0;P<m.length;P++){const L=m.feature(P);if(g.needGeometry){const M=u.a7(L,!0);if(!g.filter(new u.a8(this.tileID.overscaledZ),M,this.tileID.canonical))continue}else if(!g.filter(new u.a8(this.tileID.overscaledZ),L))continue;const B=n.getId(L,c),R=new u.a9(L,y,v,w,B);R.tile=S,e.push(R)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const s=this.expirationTime;if(e.cacheControl){const n=u.aa(e.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const n=Date.now();let l=!1;if(this.expirationTime>n)l=!1;else if(s)if(this.expirationTime<s)l=!0;else{const c=this.expirationTime-s;c?this.expirationTime=n+Math.max(c,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,s){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;const n=this.latestFeatureIndex.loadVTLayers();for(const l in this.buckets){if(!s.style.hasLayer(l))continue;const c=this.buckets[l],m=c.layers[0].sourceLayer||"_geojsonTileLayer",g=n[m],y=e[m];if(!g||!y||Object.keys(y).length===0)continue;c.update(y,g,this.imageAtlas&&this.imageAtlas.patternPositions||{});const v=s&&s.style&&s.style.getLayer(l);v&&(this.queryPadding=Math.max(this.queryPadding,v.queryRadius(c)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<u.h.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=u.h.now()+e}setDependencies(e,s){const n={};for(const l of s)n[l]=!0;this.dependencies[e]=n}hasDependency(e,s){for(const n of e){const l=this.dependencies[n];if(l){for(const c of s)if(l[c])return!0}}return!1}}class qr{constructor(e,s){this.max=e,this.onRemove=s,this.reset()}reset(){for(const e in this.data)for(const s of this.data[e])s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value);return this.data={},this.order=[],this}add(e,s,n){const l=e.wrapped().key;this.data[l]===void 0&&(this.data[l]=[]);const c={value:s,timeout:void 0};if(n!==void 0&&(c.timeout=setTimeout(()=>{this.remove(e,c)},n)),this.data[l].push(c),this.order.push(l),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const s=this.data[e].shift();return s.timeout&&clearTimeout(s.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),s.value}getByKey(e){const s=this.data[e];return s?s[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,s){if(!this.has(e))return this;const n=e.wrapped().key,l=s===void 0?0:this.data[n].indexOf(s),c=this.data[n][l];return this.data[n].splice(l,1),c.timeout&&clearTimeout(c.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(c.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this}filter(e){const s=[];for(const n in this.data)for(const l of this.data[n])e(l.value)||s.push(l);for(const n of s)this.remove(n.value.tileID,n)}}class rt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,s,n){const l=String(s);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][l]=this.stateChanges[e][l]||{},u.e(this.stateChanges[e][l],n),this.deletedStates[e]===null){this.deletedStates[e]={};for(const c in this.state[e])c!==l&&(this.deletedStates[e][c]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][l]===null){this.deletedStates[e][l]={};for(const c in this.state[e][l])n[c]||(this.deletedStates[e][l][c]=null)}else for(const c in n)this.deletedStates[e]&&this.deletedStates[e][l]&&this.deletedStates[e][l][c]===null&&delete this.deletedStates[e][l][c]}removeFeatureState(e,s,n){if(this.deletedStates[e]===null)return;const l=String(s);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&s!==void 0)this.deletedStates[e][l]!==null&&(this.deletedStates[e][l]=this.deletedStates[e][l]||{},this.deletedStates[e][l][n]=null);else if(s!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][l])for(n in this.deletedStates[e][l]={},this.stateChanges[e][l])this.deletedStates[e][l][n]=null;else this.deletedStates[e][l]=null;else this.deletedStates[e]=null}getState(e,s){const n=String(s),l=u.e({},(this.state[e]||{})[n],(this.stateChanges[e]||{})[n]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const c=this.deletedStates[e][s];if(c===null)return{};for(const m in c)delete l[m]}return l}initializeTileState(e,s){e.setFeatureState(this.state,s)}coalesceChanges(e,s){const n={};for(const l in this.stateChanges){this.state[l]=this.state[l]||{};const c={};for(const m in this.stateChanges[l])this.state[l][m]||(this.state[l][m]={}),u.e(this.state[l][m],this.stateChanges[l][m]),c[m]=this.state[l][m];n[l]=c}for(const l in this.deletedStates){this.state[l]=this.state[l]||{};const c={};if(this.deletedStates[l]===null)for(const m in this.state[l])c[m]={},this.state[l][m]={};else for(const m in this.deletedStates[l]){if(this.deletedStates[l][m]===null)this.state[l][m]={};else for(const g of Object.keys(this.deletedStates[l][m]))delete this.state[l][m][g];c[m]=this.state[l][m]}n[l]=n[l]||{},u.e(n[l],c)}if(this.stateChanges={},this.deletedStates={},Object.keys(n).length!==0)for(const l in e)e[l].setFeatureState(n,s)}}class ci extends u.E{constructor(e,s,n){super(),this.id=e,this.dispatcher=n,this.on("data",l=>{l.dataType==="source"&&l.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&l.dataType==="source"&&l.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((l,c,m,g)=>{const y=new(hr(c.type))(l,c,m,g);if(y.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${y.id}`);return y})(e,s,n,this),this._tiles={},this._cache=new qr(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new rt,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const s=this._tiles[e];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,s){return this._source.loadTile(e,s)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){this._source.abortTile&&this._source.abortTile(e,()=>{}),this._source.fire(new u.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const s in this._tiles){const n=this._tiles[s];n.upload(e),n.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(Di).map(e=>e.key)}getRenderableIds(e){const s=[];for(const n in this._tiles)this._isIdRenderable(n,e)&&s.push(this._tiles[n]);return e?s.sort((n,l)=>{const c=n.tileID,m=l.tileID,g=new u.P(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),y=new u.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-m.overscaledZ||y.y-g.y||y.x-g.x}).map(n=>n.tileID.key):s.map(n=>n.tileID).sort(Di).map(n=>n.key)}hasRenderableParent(e){const s=this.findLoadedParent(e,0);return!!s&&this._isIdRenderable(s.tileID.key)}_isIdRenderable(e,s){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(s||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(e,"reloading")}}_reloadTile(e,s){const n=this._tiles[e];n&&(n.state!=="loading"&&(n.state=s),this._loadTile(n,this._tileLoaded.bind(this,n,e,s)))}_tileLoaded(e,s,n,l){if(l)return e.state="errored",void(l.status!==404?this._source.fire(new u.j(l,{tile:e})):this.update(this.transform,this.terrain));e.timeAdded=u.h.now(),n==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(s,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new u.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const s=this.getRenderableIds();for(let l=0;l<s.length;l++){const c=s[l];if(e.neighboringTiles&&e.neighboringTiles[c]){const m=this.getTileByID(c);n(e,m),n(m,e)}}function n(l,c){l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0;let m=c.tileID.canonical.x-l.tileID.canonical.x;const g=c.tileID.canonical.y-l.tileID.canonical.y,y=Math.pow(2,l.tileID.canonical.z),v=c.tileID.key;m===0&&g===0||Math.abs(g)>1||(Math.abs(m)>1&&(Math.abs(m+y)===1?m+=y:Math.abs(m-y)===1&&(m-=y)),c.dem&&l.dem&&(l.dem.backfillBorder(c.dem,m,g),l.neighboringTiles&&l.neighboringTiles[v]&&(l.neighboringTiles[v].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,s,n,l){for(const c in this._tiles){let m=this._tiles[c];if(l[c]||!m.hasData()||m.tileID.overscaledZ<=s||m.tileID.overscaledZ>n)continue;let g=m.tileID;for(;m&&m.tileID.overscaledZ>s+1;){const v=m.tileID.scaledTo(m.tileID.overscaledZ-1);m=this._tiles[v.key],m&&m.hasData()&&(g=v)}let y=g;for(;y.overscaledZ>s;)if(y=y.scaledTo(y.overscaledZ-1),e[y.key]){l[g.key]=g;break}}}findLoadedParent(e,s){if(e.key in this._loadedParentTiles){const n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=s?n:null}for(let n=e.overscaledZ-1;n>=s;n--){const l=e.scaledTo(n),c=this._getLoadedTile(l);if(c)return c}}_getLoadedTile(e){const s=this._tiles[e.key];return s&&s.hasData()?s:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const s=Math.ceil(e.width/this._source.tileSize)+1,n=Math.ceil(e.height/this._source.tileSize)+1,l=Math.floor(s*n*(this._maxTileCacheZoomLevels===null?u.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),c=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(c)}handleWrapJump(e){const s=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,s){const n={};for(const l in this._tiles){const c=this._tiles[l];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+s),n[c.tileID.key]=c}this._tiles=n;for(const l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(const l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}update(e,s){if(this.transform=e,this.terrain=s,!this._sourceLoaded||this._paused)return;let n;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(w=>new u.O(w.canonical.z,w.wrap,w.canonical.z,w.canonical.x,w.canonical.y)):(n=e.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:s}),this._source.hasTile&&(n=n.filter(w=>this._source.hasTile(w)))):n=[];const l=e.coveringZoomLevel(this._source),c=Math.max(l-ci.maxOverzooming,this._source.minzoom),m=Math.max(l+ci.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const w={};for(const S of n)if(S.canonical.z>this._source.minzoom){const P=S.scaledTo(S.canonical.z-1);w[P.key]=P;const L=S.scaledTo(Math.max(this._source.minzoom,Math.min(S.canonical.z,5)));w[L.key]=L}n=n.concat(Object.values(w))}const g=n.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,g&&this.fire(new u.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const y=this._updateRetainedTiles(n,l);if(ne(this._source.type)){const w={},S={},P=Object.keys(y),L=u.h.now();for(const B of P){const R=y[B],M=this._tiles[B];if(!M||M.fadeEndTime!==0&&M.fadeEndTime<=L)continue;const Z=this.findLoadedParent(R,c);Z&&(this._addTile(Z.tileID),w[Z.tileID.key]=Z.tileID),S[B]=R}this._retainLoadedChildren(S,l,m,y);for(const B in w)y[B]||(this._coveredTiles[B]=!0,y[B]=w[B]);if(s){const B={},R={};for(const M of n)this._tiles[M.key].hasData()?B[M.key]=M:R[M.key]=M;for(const M in R){const Z=R[M].children(this._source.maxzoom);this._tiles[Z[0].key]&&this._tiles[Z[1].key]&&this._tiles[Z[2].key]&&this._tiles[Z[3].key]&&(B[Z[0].key]=y[Z[0].key]=Z[0],B[Z[1].key]=y[Z[1].key]=Z[1],B[Z[2].key]=y[Z[2].key]=Z[2],B[Z[3].key]=y[Z[3].key]=Z[3],delete R[M])}for(const M in R){const Z=this.findLoadedParent(R[M],this._source.minzoom);if(Z){B[Z.tileID.key]=y[Z.tileID.key]=Z.tileID;for(const Y in B)B[Y].isChildOf(Z.tileID)&&delete B[Y]}}for(const M in this._tiles)B[M]||(this._coveredTiles[M]=!0)}}for(const w in y)this._tiles[w].clearFadeHold();const v=u.ab(this._tiles,y);for(const w of v){const S=this._tiles[w];S.hasSymbolBuckets&&!S.holdingForFade()?S.setHoldDuration(this.map._fadeDuration):S.hasSymbolBuckets&&!S.symbolFadeFinished()||this._removeTile(w)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,s){const n={},l={},c=Math.max(s-ci.maxOverzooming,this._source.minzoom),m=Math.max(s+ci.maxUnderzooming,this._source.minzoom),g={};for(const y of e){const v=this._addTile(y);n[y.key]=y,v.hasData()||s<this._source.maxzoom&&(g[y.key]=y)}this._retainLoadedChildren(g,s,m,n);for(const y of e){let v=this._tiles[y.key];if(v.hasData())continue;if(s+1>this._source.maxzoom){const S=y.children(this._source.maxzoom)[0],P=this.getTile(S);if(P&&P.hasData()){n[S.key]=S;continue}}else{const S=y.children(this._source.maxzoom);if(n[S[0].key]&&n[S[1].key]&&n[S[2].key]&&n[S[3].key])continue}let w=v.wasRequested();for(let S=y.overscaledZ-1;S>=c;--S){const P=y.scaledTo(S);if(l[P.key])break;if(l[P.key]=!0,v=this.getTile(P),!v&&w&&(v=this._addTile(P)),v){const L=v.hasData();if((w||L)&&(n[P.key]=P),w=v.wasRequested(),L)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const s=[];let n,l=this._tiles[e].tileID;for(;l.overscaledZ>0;){if(l.key in this._loadedParentTiles){n=this._loadedParentTiles[l.key];break}s.push(l.key);const c=l.scaledTo(l.overscaledZ-1);if(n=this._getLoadedTile(c),n)break;l=c}for(const c of s)this._loadedParentTiles[c]=n}}_addTile(e){let s=this._tiles[e.key];if(s)return s;s=this._cache.getAndRemove(e),s&&(this._setTileReloadTimer(e.key,s),s.tileID=e,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,s)));const n=s;return s||(s=new Cr(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,e.key,s.state))),s.uses++,this._tiles[e.key]=s,n||this._source.fire(new u.k("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s}_setTileReloadTimer(e,s){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const n=s.getExpiryTimeout();n&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},n))}_removeTile(e){const s=this._tiles[e];s&&(s.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,s,n){const l=[],c=this.transform;if(!c)return l;const m=n?c.getCameraQueryGeometry(e):e,g=e.map(B=>c.pointCoordinate(B,this.terrain)),y=m.map(B=>c.pointCoordinate(B,this.terrain)),v=this.getIds();let w=1/0,S=1/0,P=-1/0,L=-1/0;for(const B of y)w=Math.min(w,B.x),S=Math.min(S,B.y),P=Math.max(P,B.x),L=Math.max(L,B.y);for(let B=0;B<v.length;B++){const R=this._tiles[v[B]];if(R.holdingForFade())continue;const M=R.tileID,Z=Math.pow(2,c.zoom-R.tileID.overscaledZ),Y=s*R.queryPadding*u.N/R.tileSize/Z,N=[M.getTilePoint(new u.U(w,S)),M.getTilePoint(new u.U(P,L))];if(N[0].x-Y<u.N&&N[0].y-Y<u.N&&N[1].x+Y>=0&&N[1].y+Y>=0){const H=g.map(et=>M.getTilePoint(et)),tt=y.map(et=>M.getTilePoint(et));l.push({tile:R,tileID:M,queryGeometry:H,cameraQueryGeometry:tt,scale:Z})}}return l}getVisibleCoordinates(e){const s=this.getRenderableIds(e).map(n=>this._tiles[n].tileID);for(const n of s)n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped());return s}hasTransition(){if(this._source.hasTransition())return!0;if(ne(this._source.type)){const e=u.h.now();for(const s in this._tiles)if(this._tiles[s].fadeEndTime>=e)return!0}return!1}setFeatureState(e,s,n){this._state.updateState(e=e||"_geojsonTileLayer",s,n)}removeFeatureState(e,s,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",s,n)}getFeatureState(e,s){return this._state.getState(e=e||"_geojsonTileLayer",s)}setDependencies(e,s,n){const l=this._tiles[e];l&&l.setDependencies(s,n)}reloadTilesForDependencies(e,s){for(const n in this._tiles)this._tiles[n].hasDependency(e,s)&&this._reloadTile(n,"reloading");this._cache.filter(n=>!n.hasDependency(e,s))}}function Di(h,e){const s=Math.abs(2*h.wrap)-+(h.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return h.overscaledZ-e.overscaledZ||n-s||e.canonical.y-h.canonical.y||e.canonical.x-h.canonical.x}function ne(h){return h==="raster"||h==="image"||h==="video"}ci.maxOverzooming=10,ci.maxUnderzooming=3;const Wt="mapboxgl_preloaded_worker_pool";class Yi{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<Yi.workerCount;)this.workers.push(new Worker(u.c.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach(s=>{s.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Wt]}numActive(){return Object.keys(this.active).length}}const ms=Math.floor(u.h.hardwareConcurrency/2);let cr;function fa(){return cr||(cr=new Yi),cr}Yi.workerCount=u.ac(globalThis)?Math.max(Math.min(ms,3),1):1;class gs{constructor(e,s){this.reset(e,s)}reset(e,s){this.points=e||[],this._distances=[0];for(let n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(s||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(this.points.length===1)return this.points[0];e=u.ad(e,0,1);let s=1,n=this._distances[s];const l=e*this.paddedLength+this.padding;for(;n<l&&s<this._distances.length;)n=this._distances[++s];const c=s-1,m=this._distances[c],g=n-m,y=g>0?(l-m)/g:0;return this.points[c].mult(1-y).add(this.points[s].mult(y))}}function Er(h,e){let s=!0;return h==="always"||h!=="never"&&e!=="never"||(s=!1),s}class jr{constructor(e,s,n){const l=this.boxCells=[],c=this.circleCells=[];this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(s/n);for(let m=0;m<this.xCellCount*this.yCellCount;m++)l.push([]),c.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=s,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/s,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,s,n,l,c){this._forEachCell(s,n,l,c,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(s),this.bboxes.push(n),this.bboxes.push(l),this.bboxes.push(c)}insertCircle(e,s,n,l){this._forEachCell(s-l,n-l,s+l,n+l,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(s),this.circles.push(n),this.circles.push(l)}_insertBoxCell(e,s,n,l,c,m){this.boxCells[c].push(m)}_insertCircleCell(e,s,n,l,c,m){this.circleCells[c].push(m)}_query(e,s,n,l,c,m,g){if(n<0||e>this.width||l<0||s>this.height)return[];const y=[];if(e<=0&&s<=0&&this.width<=n&&this.height<=l){if(c)return[{key:null,x1:e,y1:s,x2:n,y2:l}];for(let v=0;v<this.boxKeys.length;v++)y.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(let v=0;v<this.circleKeys.length;v++){const w=this.circles[3*v],S=this.circles[3*v+1],P=this.circles[3*v+2];y.push({key:this.circleKeys[v],x1:w-P,y1:S-P,x2:w+P,y2:S+P})}}else this._forEachCell(e,s,n,l,this._queryCell,y,{hitTest:c,overlapMode:m,seenUids:{box:{},circle:{}}},g);return y}query(e,s,n,l){return this._query(e,s,n,l,!1,null)}hitTest(e,s,n,l,c,m){return this._query(e,s,n,l,!0,c,m).length>0}hitTestCircle(e,s,n,l,c){const m=e-n,g=e+n,y=s-n,v=s+n;if(g<0||m>this.width||v<0||y>this.height)return!1;const w=[];return this._forEachCell(m,y,g,v,this._queryCellCircle,w,{hitTest:!0,overlapMode:l,circle:{x:e,y:s,radius:n},seenUids:{box:{},circle:{}}},c),w.length>0}_queryCell(e,s,n,l,c,m,g,y){const{seenUids:v,hitTest:w,overlapMode:S}=g,P=this.boxCells[c];if(P!==null){const B=this.bboxes;for(const R of P)if(!v.box[R]){v.box[R]=!0;const M=4*R,Z=this.boxKeys[R];if(e<=B[M+2]&&s<=B[M+3]&&n>=B[M+0]&&l>=B[M+1]&&(!y||y(Z))&&(!w||!Er(S,Z.overlapMode))&&(m.push({key:Z,x1:B[M],y1:B[M+1],x2:B[M+2],y2:B[M+3]}),w))return!0}}const L=this.circleCells[c];if(L!==null){const B=this.circles;for(const R of L)if(!v.circle[R]){v.circle[R]=!0;const M=3*R,Z=this.circleKeys[R];if(this._circleAndRectCollide(B[M],B[M+1],B[M+2],e,s,n,l)&&(!y||y(Z))&&(!w||!Er(S,Z.overlapMode))){const Y=B[M],N=B[M+1],H=B[M+2];if(m.push({key:Z,x1:Y-H,y1:N-H,x2:Y+H,y2:N+H}),w)return!0}}}return!1}_queryCellCircle(e,s,n,l,c,m,g,y){const{circle:v,seenUids:w,overlapMode:S}=g,P=this.boxCells[c];if(P!==null){const B=this.bboxes;for(const R of P)if(!w.box[R]){w.box[R]=!0;const M=4*R,Z=this.boxKeys[R];if(this._circleAndRectCollide(v.x,v.y,v.radius,B[M+0],B[M+1],B[M+2],B[M+3])&&(!y||y(Z))&&!Er(S,Z.overlapMode))return m.push(!0),!0}}const L=this.circleCells[c];if(L!==null){const B=this.circles;for(const R of L)if(!w.circle[R]){w.circle[R]=!0;const M=3*R,Z=this.circleKeys[R];if(this._circlesCollide(B[M],B[M+1],B[M+2],v.x,v.y,v.radius)&&(!y||y(Z))&&!Er(S,Z.overlapMode))return m.push(!0),!0}}}_forEachCell(e,s,n,l,c,m,g,y){const v=this._convertToXCellCoord(e),w=this._convertToYCellCoord(s),S=this._convertToXCellCoord(n),P=this._convertToYCellCoord(l);for(let L=v;L<=S;L++)for(let B=w;B<=P;B++)if(c.call(this,e,s,n,l,this.xCellCount*B+L,m,g,y))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,s,n,l,c,m){const g=l-e,y=c-s,v=n+m;return v*v>g*g+y*y}_circleAndRectCollide(e,s,n,l,c,m,g){const y=(m-l)/2,v=Math.abs(e-(l+y));if(v>y+n)return!1;const w=(g-c)/2,S=Math.abs(s-(c+w));if(S>w+n)return!1;if(v<=y||S<=w)return!0;const P=v-y,L=S-w;return P*P+L*L<=n*n}}function ft(h,e,s,n,l){const c=u.Z();return e?(u.a0(c,c,[1/l,1/l,1]),s||u.ae(c,c,n.angle)):u.a1(c,n.labelPlaneMatrix,h),c}function Qi(h,e,s,n,l){if(e){const c=u.af(h);return u.a0(c,c,[l,l,1]),s||u.ae(c,c,-n.angle),c}return n.glCoordMatrix}function ve(h,e,s){let n;s?(n=[h.x,h.y,s(h.x,h.y),1],u.ag(n,n,e)):(n=[h.x,h.y,0,1],O(n,n,e));const l=n[3];return{point:new u.P(n[0]/l,n[1]/l),signedDistanceFromCamera:l}}function Gr(h,e){return .5+h/e*.5}function pr(h,e){const s=h[0]/h[3],n=h[1]/h[3];return s>=-e[0]&&s<=e[0]&&n>=-e[1]&&n<=e[1]}function gt(h,e,s,n,l,c,m,g,y,v){const w=n?h.textSizeData:h.iconSizeData,S=u.ah(w,s.transform.zoom),P=[256/s.width*2+1,256/s.height*2+1],L=n?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;L.clear();const B=h.lineVertexArray,R=n?h.text.placedSymbolArray:h.icon.placedSymbolArray,M=s.transform.width/s.transform.height;let Z=!1;for(let Y=0;Y<R.length;Y++){const N=R.get(Y);if(N.hidden||N.writingMode===u.ai.vertical&&!Z){k(N.numGlyphs,L);continue}let H;if(Z=!1,v?(H=[N.anchorX,N.anchorY,v(N.anchorX,N.anchorY),1],u.ag(H,H,e)):(H=[N.anchorX,N.anchorY,0,1],O(H,H,e)),!pr(H,P)){k(N.numGlyphs,L);continue}const tt=Gr(s.transform.cameraToCenterDistance,H[3]),et=u.aj(w,S,N),nt=m?et/tt:et*tt,ht=new u.P(N.anchorX,N.anchorY),ut=ve(ht,l,v).point,pt={projections:{},offsets:{}},At=ii(N,nt,!1,g,e,l,c,h.glyphOffsetArray,B,L,ut,ht,pt,M,y,v);Z=At.useVertical,(At.notEnoughRoom||Z||At.needsFlipping&&ii(N,nt,!0,g,e,l,c,h.glyphOffsetArray,B,L,ut,ht,pt,M,y,v).notEnoughRoom)&&k(N.numGlyphs,L)}n?h.text.dynamicLayoutVertexBuffer.updateData(L):h.icon.dynamicLayoutVertexBuffer.updateData(L)}function Nt(h,e,s,n,l,c,m,g,y,v,w,S,P){const L=g.glyphStartIndex+g.numGlyphs,B=g.lineStartIndex,R=g.lineStartIndex+g.lineLength,M=e.getoffsetX(g.glyphStartIndex),Z=e.getoffsetX(L-1),Y=A(h*M,s,n,l,c,m,g.segment,B,R,y,v,w,S,P);if(!Y)return null;const N=A(h*Z,s,n,l,c,m,g.segment,B,R,y,v,w,S,P);return N?{first:Y,last:N}:null}function Rt(h,e,s,n){return h===u.ai.horizontal&&Math.abs(s.y-e.y)>Math.abs(s.x-e.x)*n?{useVertical:!0}:(h===u.ai.vertical?e.y<s.y:e.x>s.x)?{needsFlipping:!0}:null}function ii(h,e,s,n,l,c,m,g,y,v,w,S,P,L,B,R){const M=e/24,Z=h.lineOffsetX*M,Y=h.lineOffsetY*M;let N;if(h.numGlyphs>1){const H=h.glyphStartIndex+h.numGlyphs,tt=h.lineStartIndex,et=h.lineStartIndex+h.lineLength,nt=Nt(M,g,Z,Y,s,w,S,h,y,c,P,B,R);if(!nt)return{notEnoughRoom:!0};const ht=ve(nt.first.point,m,R).point,ut=ve(nt.last.point,m,R).point;if(n&&!s){const pt=Rt(h.writingMode,ht,ut,L);if(pt)return pt}N=[nt.first];for(let pt=h.glyphStartIndex+1;pt<H-1;pt++)N.push(A(M*g.getoffsetX(pt),Z,Y,s,w,S,h.segment,tt,et,y,c,P,B,R));N.push(nt.last)}else{if(n&&!s){const tt=ve(S,l,R).point,et=h.lineStartIndex+h.segment+1,nt=new u.P(y.getx(et),y.gety(et)),ht=ve(nt,l,R),ut=ht.signedDistanceFromCamera>0?ht.point:tr(S,nt,tt,1,l,R),pt=Rt(h.writingMode,tt,ut,L);if(pt)return pt}const H=A(M*g.getoffsetX(h.glyphStartIndex),Z,Y,s,w,S,h.segment,h.lineStartIndex,h.lineStartIndex+h.lineLength,y,c,P,B,R);if(!H)return{notEnoughRoom:!0};N=[H]}for(const H of N)u.ak(v,H.point,H.angle);return{}}function tr(h,e,s,n,l,c){const m=ve(h.add(h.sub(e)._unit()),l,c).point,g=s.sub(m);return s.add(g._mult(n/g.mag()))}function Vt(h,e){const{projectionCache:s,lineVertexArray:n,labelPlaneMatrix:l,tileAnchorPoint:c,distanceFromAnchor:m,getElevation:g,previousVertex:y,direction:v,absOffsetX:w}=e;if(s.projections[h])return s.projections[h];const S=new u.P(n.getx(h),n.gety(h)),P=ve(S,l,g);if(P.signedDistanceFromCamera>0)return s.projections[h]=P.point,P.point;const L=h-v;return tr(m===0?c:new u.P(n.getx(L),n.gety(L)),S,y,w-m+1,l,g)}function dr(h,e,s){return h._unit()._perp()._mult(e*s)}function F(h,e,s,n,l,c,m,g){const{projectionCache:y,direction:v}=g;if(y.offsets[h])return y.offsets[h];const w=s.add(e);if(h+v<n||h+v>=l)return y.offsets[h]=w,w;const S=Vt(h+v,g),P=dr(S.sub(s),m,v),L=s.add(P),B=S.add(P);return y.offsets[h]=u.al(c,w,L,B)||w,y.offsets[h]}function A(h,e,s,n,l,c,m,g,y,v,w,S,P,L){const B=n?h-e:h+e;let R=B>0?1:-1,M=0;n&&(R*=-1,M=Math.PI),R<0&&(M+=Math.PI);let Z,Y,N=R>0?g+m:g+m+1,H=l,tt=l,et=0,nt=0;const ht=Math.abs(B),ut=[];let pt;for(;et+nt<=ht;){if(N+=R,N<g||N>=y)return null;et+=nt,tt=H,Y=Z;const _t={projectionCache:S,lineVertexArray:v,labelPlaneMatrix:w,tileAnchorPoint:c,distanceFromAnchor:et,getElevation:L,previousVertex:tt,direction:R,absOffsetX:ht};if(H=Vt(N,_t),s===0)ut.push(tt),pt=H.sub(tt);else{let Lt;const zt=H.sub(tt);Lt=zt.mag()===0?dr(Vt(N+R,_t).sub(H),s,R):dr(zt,s,R),Y||(Y=tt.add(Lt)),Z=F(N,Lt,H,g,y,Y,s,_t),ut.push(Y),pt=Z.sub(Y)}nt=pt.mag()}const At=pt._mult((ht-et)/nt)._add(Y||tt),jt=M+Math.atan2(H.y-tt.y,H.x-tt.x);return ut.push(At),{point:At,angle:P?jt:0,path:ut}}const z=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function k(h,e){for(let s=0;s<h;s++){const n=e.length;e.resize(n+4),e.float32.set(z,3*n)}}function O(h,e,s){const n=e[0],l=e[1];return h[0]=s[0]*n+s[4]*l+s[12],h[1]=s[1]*n+s[5]*l+s[13],h[3]=s[3]*n+s[7]*l+s[15],h}const U=100;class K{constructor(e,s=new jr(e.width+200,e.height+200,25),n=new jr(e.width+200,e.height+200,25)){this.transform=e,this.grid=s,this.ignoredGrid=n,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+U,this.screenBottomBoundary=e.height+U,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,s,n,l,c,m){const g=this.projectAndGetPerspectiveRatio(l,e.anchorPointX,e.anchorPointY,m),y=n*g.perspectiveRatio,v=e.x1*y+g.point.x,w=e.y1*y+g.point.y,S=e.x2*y+g.point.x,P=e.y2*y+g.point.y;return!this.isInsideGrid(v,w,S,P)||s!=="always"&&this.grid.hitTest(v,w,S,P,s,c)||g.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[v,w,S,P],offscreen:this.isOffscreen(v,w,S,P)}}placeCollisionCircles(e,s,n,l,c,m,g,y,v,w,S,P,L,B){const R=[],M=new u.P(s.anchorX,s.anchorY),Z=ve(M,m,B),Y=Gr(this.transform.cameraToCenterDistance,Z.signedDistanceFromCamera),N=(w?c/Y:c*Y)/u.ap,H=ve(M,g,B).point,tt=Nt(N,l,s.lineOffsetX*N,s.lineOffsetY*N,!1,H,M,s,n,g,{projections:{},offsets:{}},!1,B);let et=!1,nt=!1,ht=!0;if(tt){const ut=.5*P*Y+L,pt=new u.P(-100,-100),At=new u.P(this.screenRightBoundary,this.screenBottomBoundary),jt=new gs,_t=tt.first,Lt=tt.last;let zt=[];for(let Ut=_t.path.length-1;Ut>=1;Ut--)zt.push(_t.path[Ut]);for(let Ut=1;Ut<Lt.path.length;Ut++)zt.push(Lt.path[Ut]);const re=2.5*ut;if(y){const Ut=zt.map(Gt=>ve(Gt,y,B));zt=Ut.some(Gt=>Gt.signedDistanceFromCamera<=0)?[]:Ut.map(Gt=>Gt.point)}let qt=[];if(zt.length>0){const Ut=zt[0].clone(),Gt=zt[0].clone();for(let Te=1;Te<zt.length;Te++)Ut.x=Math.min(Ut.x,zt[Te].x),Ut.y=Math.min(Ut.y,zt[Te].y),Gt.x=Math.max(Gt.x,zt[Te].x),Gt.y=Math.max(Gt.y,zt[Te].y);qt=Ut.x>=pt.x&&Gt.x<=At.x&&Ut.y>=pt.y&&Gt.y<=At.y?[zt]:Gt.x<pt.x||Ut.x>At.x||Gt.y<pt.y||Ut.y>At.y?[]:u.am([zt],pt.x,pt.y,At.x,At.y)}for(const Ut of qt){jt.reset(Ut,.25*ut);let Gt=0;Gt=jt.length<=.5*ut?1:Math.ceil(jt.paddedLength/re)+1;for(let Te=0;Te<Gt;Te++){const le=Te/Math.max(Gt-1,1),Ge=jt.lerp(le),Le=Ge.x+U,Pe=Ge.y+U;R.push(Le,Pe,ut,0);const Ii=Le-ut,ce=Pe-ut,ir=Le+ut,rr=Pe+ut;if(ht=ht&&this.isOffscreen(Ii,ce,ir,rr),nt=nt||this.isInsideGrid(Ii,ce,ir,rr),e!=="always"&&this.grid.hitTestCircle(Le,Pe,ut,e,S)&&(et=!0,!v))return{circles:[],offscreen:!1,collisionDetected:et}}}}return{circles:!v&&et||!nt||Y<this.perspectiveRatioCutoff?[]:R,offscreen:ht,collisionDetected:et}}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const s=[];let n=1/0,l=1/0,c=-1/0,m=-1/0;for(const w of e){const S=new u.P(w.x+U,w.y+U);n=Math.min(n,S.x),l=Math.min(l,S.y),c=Math.max(c,S.x),m=Math.max(m,S.y),s.push(S)}const g=this.grid.query(n,l,c,m).concat(this.ignoredGrid.query(n,l,c,m)),y={},v={};for(const w of g){const S=w.key;if(y[S.bucketInstanceId]===void 0&&(y[S.bucketInstanceId]={}),y[S.bucketInstanceId][S.featureIndex])continue;const P=[new u.P(w.x1,w.y1),new u.P(w.x2,w.y1),new u.P(w.x2,w.y2),new u.P(w.x1,w.y2)];u.an(s,P)&&(y[S.bucketInstanceId][S.featureIndex]=!0,v[S.bucketInstanceId]===void 0&&(v[S.bucketInstanceId]=[]),v[S.bucketInstanceId].push(S.featureIndex))}return v}insertCollisionBox(e,s,n,l,c,m){(n?this.ignoredGrid:this.grid).insert({bucketInstanceId:l,featureIndex:c,collisionGroupID:m,overlapMode:s},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,s,n,l,c,m){const g=n?this.ignoredGrid:this.grid,y={bucketInstanceId:l,featureIndex:c,collisionGroupID:m,overlapMode:s};for(let v=0;v<e.length;v+=4)g.insertCircle(y,e[v],e[v+1],e[v+2])}projectAndGetPerspectiveRatio(e,s,n,l){let c;return l?(c=[s,n,l(s,n),1],u.ag(c,c,e)):(c=[s,n,0,1],O(c,c,e)),{point:new u.P((c[0]/c[3]+1)/2*this.transform.width+U,(-c[1]/c[3]+1)/2*this.transform.height+U),perspectiveRatio:.5+this.transform.cameraToCenterDistance/c[3]*.5}}isOffscreen(e,s,n,l){return n<U||e>=this.screenRightBoundary||l<U||s>this.screenBottomBoundary}isInsideGrid(e,s,n,l){return n>=0&&e<this.gridRightBoundary&&l>=0&&s<this.gridBottomBoundary}getViewportMatrix(){const e=u.ao([]);return u.$(e,e,[-100,-100,0]),e}}function G(h,e,s){return e*(u.N/(h.tileSize*Math.pow(2,s-h.tileID.overscaledZ)))}class q{constructor(e,s,n,l){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?s:-s))):l&&n?1:0,this.placed=n}isHidden(){return this.opacity===0&&!this.placed}}class X{constructor(e,s,n,l,c){this.text=new q(e?e.text:null,s,n,c),this.icon=new q(e?e.icon:null,s,l,c)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class st{constructor(e,s,n){this.text=e,this.icon=s,this.skipFade=n}}class at{constructor(){this.invProjMatrix=u.Z(),this.viewportMatrix=u.Z(),this.circles=[]}}class lt{constructor(e,s,n,l,c){this.bucketInstanceId=e,this.featureIndex=s,this.sourceLayerIndex=n,this.bucketIndex=l,this.tileID=c}}class Et{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const s=++this.maxGroupID;this.collisionGroups[e]={ID:s,predicate:n=>n.collisionGroupID===s}}return this.collisionGroups[e]}}function Ft(h,e,s,n,l){const{horizontalAlign:c,verticalAlign:m}=u.au(h);return new u.P(-(c-.5)*e+n[0]*l,-(m-.5)*s+n[1]*l)}function Tt(h,e,s,n,l,c){const{x1:m,x2:g,y1:y,y2:v,anchorPointX:w,anchorPointY:S}=h,P=new u.P(e,s);return n&&P._rotate(l?c:-c),{x1:m+P.x,y1:y+P.y,x2:g+P.x,y2:v+P.y,anchorPointX:w,anchorPointY:S}}class Mt{constructor(e,s,n,l,c){this.transform=e.clone(),this.terrain=s,this.collisionIndex=new K(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new Et(l),this.collisionCircleArrays={},this.prevPlacement=c,c&&(c.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(e,s,n,l){const c=n.getBucket(s),m=n.latestFeatureIndex;if(!c||!m||s.id!==c.layerIds[0])return;const g=n.collisionBoxArray,y=c.layers[0].layout,v=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),w=n.tileSize/u.N,S=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),P=y.get("text-pitch-alignment")==="map",L=y.get("text-rotation-alignment")==="map",B=G(n,1,this.transform.zoom),R=ft(S,P,L,this.transform,B);let M=null;if(P){const Y=Qi(S,P,L,this.transform,B);M=u.a1([],this.transform.labelPlaneMatrix,Y)}this.retainedQueryData[c.bucketInstanceId]=new lt(c.bucketInstanceId,m,c.sourceLayerIndex,c.index,n.tileID);const Z={bucket:c,layout:y,posMatrix:S,textLabelPlaneMatrix:R,labelToScreenMatrix:M,scale:v,textPixelRatio:w,holdingForFade:n.holdingForFade(),collisionBoxArray:g,partiallyEvaluatedTextSize:u.ah(c.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(c.sourceID)};if(l)for(const Y of c.sortKeyRanges){const{sortKey:N,symbolInstanceStart:H,symbolInstanceEnd:tt}=Y;e.push({sortKey:N,symbolInstanceStart:H,symbolInstanceEnd:tt,parameters:Z})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:c.symbolInstances.length,parameters:Z})}attemptAnchorPlacement(e,s,n,l,c,m,g,y,v,w,S,P,L,B,R,M){const Z=u.aq[e.textAnchor],Y=[e.textOffset0,e.textOffset1],N=Ft(Z,n,l,Y,c),H=this.collisionIndex.placeCollisionBox(Tt(s,N.x,N.y,m,g,this.transform.angle),S,y,v,w.predicate,M);if((!R||this.collisionIndex.placeCollisionBox(Tt(R,N.x,N.y,m,g,this.transform.angle),S,y,v,w.predicate,M).box.length!==0)&&H.box.length>0){let tt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[P.crossTileID]&&this.prevPlacement.placements[P.crossTileID]&&this.prevPlacement.placements[P.crossTileID].text&&(tt=this.prevPlacement.variableOffsets[P.crossTileID].anchor),P.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[P.crossTileID]={textOffset:Y,width:n,height:l,anchor:Z,textBoxScale:c,prevAnchor:tt},this.markUsedJustification(L,Z,P,B),L.allowVerticalPlacement&&(this.markUsedOrientation(L,B,P),this.placedOrientations[P.crossTileID]=B),{shift:N,placedGlyphBoxes:H}}}placeLayerBucketPart(e,s,n){const{bucket:l,layout:c,posMatrix:m,textLabelPlaneMatrix:g,labelToScreenMatrix:y,textPixelRatio:v,holdingForFade:w,collisionBoxArray:S,partiallyEvaluatedTextSize:P,collisionGroup:L}=e.parameters,B=c.get("text-optional"),R=c.get("icon-optional"),M=u.ar(c,"text-overlap","text-allow-overlap"),Z=M==="always",Y=u.ar(c,"icon-overlap","icon-allow-overlap"),N=Y==="always",H=c.get("text-rotation-alignment")==="map",tt=c.get("text-pitch-alignment")==="map",et=c.get("icon-text-fit")!=="none",nt=c.get("symbol-z-order")==="viewport-y",ht=Z&&(N||!l.hasIconData()||R),ut=N&&(Z||!l.hasTextData()||B);!l.collisionArrays&&S&&l.deserializeCollisionBoxes(S);const pt=this.retainedQueryData[l.bucketInstanceId].tileID,At=this.terrain?(_t,Lt)=>this.terrain.getElevation(pt,_t,Lt):null,jt=(_t,Lt)=>{var zt,re;if(s[_t.crossTileID])return;if(w)return void(this.placements[_t.crossTileID]=new st(!1,!1,!1));let qt=!1,Ut=!1,Gt=!0,Te=null,le={box:null,offscreen:null},Ge={box:null,offscreen:null},Le=null,Pe=null,Ii=null,ce=0,ir=0,rr=0;Lt.textFeatureIndex?ce=Lt.textFeatureIndex:_t.useRuntimeCollisionCircles&&(ce=_t.featureIndex),Lt.verticalTextFeatureIndex&&(ir=Lt.verticalTextFeatureIndex);const Rr=Lt.textBox;if(Rr){const Ke=Ae=>{let Be=u.ai.horizontal;if(l.allowVerticalPlacement&&!Ae&&this.prevPlacement){const fi=this.prevPlacement.placedOrientations[_t.crossTileID];fi&&(this.placedOrientations[_t.crossTileID]=fi,Be=fi,this.markUsedOrientation(l,Be,_t))}return Be},Ze=(Ae,Be)=>{if(l.allowVerticalPlacement&&_t.numVerticalGlyphVertices>0&&Lt.verticalTextBox){for(const fi of l.writingModes)if(fi===u.ai.vertical?(le=Be(),Ge=le):le=Ae(),le&&le.box&&le.box.length)break}else le=Ae()},si=_t.textAnchorOffsetStartIndex,es=_t.textAnchorOffsetEndIndex;if(es===si){const Ae=(Be,fi)=>{const Ie=this.collisionIndex.placeCollisionBox(Be,M,v,m,L.predicate,At);return Ie&&Ie.box&&Ie.box.length&&(this.markUsedOrientation(l,fi,_t),this.placedOrientations[_t.crossTileID]=fi),Ie};Ze(()=>Ae(Rr,u.ai.horizontal),()=>{const Be=Lt.verticalTextBox;return l.allowVerticalPlacement&&_t.numVerticalGlyphVertices>0&&Be?Ae(Be,u.ai.vertical):{box:null,offscreen:null}}),Ke(le&&le.box&&le.box.length)}else{let Ae=u.aq[(re=(zt=this.prevPlacement)===null||zt===void 0?void 0:zt.variableOffsets[_t.crossTileID])===null||re===void 0?void 0:re.anchor];const Be=(Ie,is,qa)=>{const Xo=Ie.x2-Ie.x1,Ho=Ie.y2-Ie.y1,Bl=_t.textBoxScale,qn=et&&Y==="never"?is:null;let sr={box:[],offscreen:!1},rs=M==="never"?1:2,ar="never";Ae&&rs++;for(let Ui=0;Ui<rs;Ui++){for(let nr=si;nr<es;nr++){const jn=l.textAnchorOffsets.get(nr);if(Ae&&jn.textAnchor!==Ae)continue;const xr=this.attemptAnchorPlacement(jn,Ie,Xo,Ho,Bl,H,tt,v,m,L,ar,_t,l,qa,qn,At);if(xr&&(sr=xr.placedGlyphBoxes,sr&&sr.box&&sr.box.length))return qt=!0,Te=xr.shift,sr}Ae?Ae=null:ar=M}return sr};Ze(()=>Be(Rr,Lt.iconBox,u.ai.horizontal),()=>{const Ie=Lt.verticalTextBox;return l.allowVerticalPlacement&&!(le&&le.box&&le.box.length)&&_t.numVerticalGlyphVertices>0&&Ie?Be(Ie,Lt.verticalIconBox,u.ai.vertical):{box:null,offscreen:null}}),le&&(qt=le.box,Gt=le.offscreen);const fi=Ke(le&&le.box);if(!qt&&this.prevPlacement){const Ie=this.prevPlacement.variableOffsets[_t.crossTileID];Ie&&(this.variableOffsets[_t.crossTileID]=Ie,this.markUsedJustification(l,Ie.anchor,_t,fi))}}}if(Le=le,qt=Le&&Le.box&&Le.box.length>0,Gt=Le&&Le.offscreen,_t.useRuntimeCollisionCircles){const Ke=l.text.placedSymbolArray.get(_t.centerJustifiedTextSymbolIndex),Ze=u.aj(l.textSizeData,P,Ke),si=c.get("text-padding");Pe=this.collisionIndex.placeCollisionCircles(M,Ke,l.lineVertexArray,l.glyphOffsetArray,Ze,m,g,y,n,tt,L.predicate,_t.collisionCircleDiameter,si,At),Pe.circles.length&&Pe.collisionDetected&&!n&&u.w("Collisions detected, but collision boxes are not shown"),qt=Z||Pe.circles.length>0&&!Pe.collisionDetected,Gt=Gt&&Pe.offscreen}if(Lt.iconFeatureIndex&&(rr=Lt.iconFeatureIndex),Lt.iconBox){const Ke=Ze=>{const si=et&&Te?Tt(Ze,Te.x,Te.y,H,tt,this.transform.angle):Ze;return this.collisionIndex.placeCollisionBox(si,Y,v,m,L.predicate,At)};Ge&&Ge.box&&Ge.box.length&&Lt.verticalIconBox?(Ii=Ke(Lt.verticalIconBox),Ut=Ii.box.length>0):(Ii=Ke(Lt.iconBox),Ut=Ii.box.length>0),Gt=Gt&&Ii.offscreen}const ts=B||_t.numHorizontalGlyphVertices===0&&_t.numVerticalGlyphVertices===0,Es=R||_t.numIconVertices===0;if(ts||Es?Es?ts||(Ut=Ut&&qt):qt=Ut&&qt:Ut=qt=Ut&&qt,qt&&Le&&Le.box&&this.collisionIndex.insertCollisionBox(Le.box,M,c.get("text-ignore-placement"),l.bucketInstanceId,Ge&&Ge.box&&ir?ir:ce,L.ID),Ut&&Ii&&this.collisionIndex.insertCollisionBox(Ii.box,Y,c.get("icon-ignore-placement"),l.bucketInstanceId,rr,L.ID),Pe&&(qt&&this.collisionIndex.insertCollisionCircles(Pe.circles,M,c.get("text-ignore-placement"),l.bucketInstanceId,ce,L.ID),n)){const Ke=l.bucketInstanceId;let Ze=this.collisionCircleArrays[Ke];Ze===void 0&&(Ze=this.collisionCircleArrays[Ke]=new at);for(let si=0;si<Pe.circles.length;si+=4)Ze.circles.push(Pe.circles[si+0]),Ze.circles.push(Pe.circles[si+1]),Ze.circles.push(Pe.circles[si+2]),Ze.circles.push(Pe.collisionDetected?1:0)}if(_t.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(l.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[_t.crossTileID]=new st(qt||ht,Ut||ut,Gt||l.justReloaded),s[_t.crossTileID]=!0};if(nt){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const _t=l.getSortedSymbolIndexes(this.transform.angle);for(let Lt=_t.length-1;Lt>=0;--Lt){const zt=_t[Lt];jt(l.symbolInstances.get(zt),l.collisionArrays[zt])}}else for(let _t=e.symbolInstanceStart;_t<e.symbolInstanceEnd;_t++)jt(l.symbolInstances.get(_t),l.collisionArrays[_t]);if(n&&l.bucketInstanceId in this.collisionCircleArrays){const _t=this.collisionCircleArrays[l.bucketInstanceId];u.as(_t.invProjMatrix,m),_t.viewportMatrix=this.collisionIndex.getViewportMatrix()}l.justReloaded=!1}markUsedJustification(e,s,n,l){let c;c=l===u.ai.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[u.at(s)];const m=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(const g of m)g>=0&&(e.text.placedSymbolArray.get(g).crossTileID=c>=0&&g!==c?0:n.crossTileID)}markUsedOrientation(e,s,n){const l=s===u.ai.horizontal||s===u.ai.horizontalOnly?s:0,c=s===u.ai.vertical?s:0,m=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const g of m)e.text.placedSymbolArray.get(g).placedOrientation=l;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=c)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const s=this.prevPlacement;let n=!1;this.prevZoomAdjustment=s?s.zoomAdjustment(this.transform.zoom):0;const l=s?s.symbolFadeChange(e):1,c=s?s.opacities:{},m=s?s.variableOffsets:{},g=s?s.placedOrientations:{};for(const y in this.placements){const v=this.placements[y],w=c[y];w?(this.opacities[y]=new X(w,l,v.text,v.icon),n=n||v.text!==w.text.placed||v.icon!==w.icon.placed):(this.opacities[y]=new X(null,l,v.text,v.icon,v.skipFade),n=n||v.text||v.icon)}for(const y in c){const v=c[y];if(!this.opacities[y]){const w=new X(v,l,!1,!1);w.isHidden()||(this.opacities[y]=w,n=n||v.text.placed||v.icon.placed)}}for(const y in m)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=m[y]);for(const y in g)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=g[y]);if(s&&s.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");n?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=s?s.lastPlacementChangeTime:e)}updateLayerOpacities(e,s){const n={};for(const l of s){const c=l.getBucket(e);c&&l.latestFeatureIndex&&e.id===c.layerIds[0]&&this.updateBucketOpacities(c,n,l.collisionBoxArray)}}updateBucketOpacities(e,s,n){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const l=e.layers[0],c=l.layout,m=new X(null,0,!1,!1,!0),g=c.get("text-allow-overlap"),y=c.get("icon-allow-overlap"),v=l._unevaluatedLayout.hasValue("text-variable-anchor")||l._unevaluatedLayout.hasValue("text-variable-anchor-offset"),w=c.get("text-rotation-alignment")==="map",S=c.get("text-pitch-alignment")==="map",P=c.get("icon-text-fit")!=="none",L=new X(null,0,g&&(y||!e.hasIconData()||c.get("icon-optional")),y&&(g||!e.hasTextData()||c.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);const B=(R,M,Z)=>{for(let Y=0;Y<M/4;Y++)R.opacityVertexArray.emplaceBack(Z);R.hasVisibleVertices=R.hasVisibleVertices||Z!==Li};for(let R=0;R<e.symbolInstances.length;R++){const M=e.symbolInstances.get(R),{numHorizontalGlyphVertices:Z,numVerticalGlyphVertices:Y,crossTileID:N}=M;let H=this.opacities[N];s[N]?H=m:H||(H=L,this.opacities[N]=H),s[N]=!0;const tt=M.numIconVertices>0,et=this.placedOrientations[M.crossTileID],nt=et===u.ai.vertical,ht=et===u.ai.horizontal||et===u.ai.horizontalOnly;if(Z>0||Y>0){const ut=qe(H.text);B(e.text,Z,nt?Li:ut),B(e.text,Y,ht?Li:ut);const pt=H.text.isHidden();[M.rightJustifiedTextSymbolIndex,M.centerJustifiedTextSymbolIndex,M.leftJustifiedTextSymbolIndex].forEach(_t=>{_t>=0&&(e.text.placedSymbolArray.get(_t).hidden=pt||nt?1:0)}),M.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(M.verticalPlacedTextSymbolIndex).hidden=pt||ht?1:0);const At=this.variableOffsets[M.crossTileID];At&&this.markUsedJustification(e,At.anchor,M,et);const jt=this.placedOrientations[M.crossTileID];jt&&(this.markUsedJustification(e,"left",M,jt),this.markUsedOrientation(e,jt,M))}if(tt){const ut=qe(H.icon),pt=!(P&&M.verticalPlacedIconSymbolIndex&&nt);M.placedIconSymbolIndex>=0&&(B(e.icon,M.numIconVertices,pt?ut:Li),e.icon.placedSymbolArray.get(M.placedIconSymbolIndex).hidden=H.icon.isHidden()),M.verticalPlacedIconSymbolIndex>=0&&(B(e.icon,M.numVerticalIconVertices,pt?Li:ut),e.icon.placedSymbolArray.get(M.verticalPlacedIconSymbolIndex).hidden=H.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const ut=e.collisionArrays[R];if(ut){let pt=new u.P(0,0);if(ut.textBox||ut.verticalTextBox){let jt=!0;if(v){const _t=this.variableOffsets[N];_t?(pt=Ft(_t.anchor,_t.width,_t.height,_t.textOffset,_t.textBoxScale),w&&pt._rotate(S?this.transform.angle:-this.transform.angle)):jt=!1}ut.textBox&&Ot(e.textCollisionBox.collisionVertexArray,H.text.placed,!jt||nt,pt.x,pt.y),ut.verticalTextBox&&Ot(e.textCollisionBox.collisionVertexArray,H.text.placed,!jt||ht,pt.x,pt.y)}const At=!!(!ht&&ut.verticalIconBox);ut.iconBox&&Ot(e.iconCollisionBox.collisionVertexArray,H.icon.placed,At,P?pt.x:0,P?pt.y:0),ut.verticalIconBox&&Ot(e.iconCollisionBox.collisionVertexArray,H.icon.placed,!At,P?pt.x:0,P?pt.y:0)}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){const R=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=R.invProjMatrix,e.placementViewportMatrix=R.viewportMatrix,e.collisionCircleArray=R.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,s){const n=this.zoomAtLastRecencyCheck===s?1-this.zoomAdjustment(s):1;return this.zoomAtLastRecencyCheck=s,this.commitTime+this.fadeDuration*n>e}setStale(){this.stale=!0}}function Ot(h,e,s,n,l){h.emplaceBack(e?1:0,s?1:0,n||0,l||0),h.emplaceBack(e?1:0,s?1:0,n||0,l||0),h.emplaceBack(e?1:0,s?1:0,n||0,l||0),h.emplaceBack(e?1:0,s?1:0,n||0,l||0)}const ee=Math.pow(2,25),se=Math.pow(2,24),Kt=Math.pow(2,17),Jt=Math.pow(2,16),He=Math.pow(2,9),oe=Math.pow(2,8),ke=Math.pow(2,1);function qe(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;const e=h.placed?1:0,s=Math.floor(127*h.opacity);return s*ee+e*se+s*Kt+e*Jt+s*He+e*oe+s*ke+e}const Li=0;class lo{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,s,n,l,c){const m=this._bucketParts;for(;this._currentTileIndex<e.length;)if(s.getBucketParts(m,l,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,c())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,m.sort((g,y)=>g.sortKey-y.sortKey));this._currentPartIndex<m.length;)if(s.placeLayerBucketPart(m[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,c())return!0;return!1}}class _s{constructor(e,s,n,l,c,m,g,y){this.placement=new Mt(e,s,m,g,y),this._currentPlacementIndex=n.length-1,this._forceFullPlacement=l,this._showCollisionBoxes=c,this._done=!1}isDone(){return this._done}continuePlacement(e,s,n){const l=u.h.now(),c=()=>!this._forceFullPlacement&&u.h.now()-l>2;for(;this._currentPlacementIndex>=0;){const m=s[e[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=g)&&(!m.maxzoom||m.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new lo(m)),this._inProgressLayer.continuePlacement(n[m.source],this.placement,this._showCollisionBoxes,m,c))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const ys=512/u.N/2;class yl{constructor(e,s,n){this.tileID=e,this.bucketInstanceId=n,this._symbolsByKey={};const l=new Map;for(let c=0;c<s.length;c++){const m=s.get(c),g=m.key,y=l.get(g);y?y.push(m):l.set(g,[m])}for(const[c,m]of l){const g={positions:m.map(y=>({x:Math.floor(y.anchorX*ys),y:Math.floor(y.anchorY*ys)})),crossTileIDs:m.map(y=>y.crossTileID)};if(g.positions.length>128){const y=new u.av(g.positions.length,16,Uint16Array);for(const{x:v,y:w}of g.positions)y.add(v,w);y.finish(),delete g.positions,g.index=y}this._symbolsByKey[c]=g}}getScaledCoordinates(e,s){const{x:n,y:l,z:c}=this.tileID.canonical,{x:m,y:g,z:y}=s.canonical,v=ys/Math.pow(2,y-c),w=(g*u.N+e.anchorY)*v,S=l*u.N*ys;return{x:Math.floor((m*u.N+e.anchorX)*v-n*u.N*ys),y:Math.floor(w-S)}}findMatches(e,s,n){const l=this.tileID.canonical.z<s.canonical.z?1:Math.pow(2,this.tileID.canonical.z-s.canonical.z);for(let c=0;c<e.length;c++){const m=e.get(c);if(m.crossTileID)continue;const g=this._symbolsByKey[m.key];if(!g)continue;const y=this.getScaledCoordinates(m,s);if(g.index){const v=g.index.range(y.x-l,y.y-l,y.x+l,y.y+l).sort();for(const w of v){const S=g.crossTileIDs[w];if(!n[S]){n[S]=!0,m.crossTileID=S;break}}}else if(g.positions)for(let v=0;v<g.positions.length;v++){const w=g.positions[v],S=g.crossTileIDs[v];if(Math.abs(w.x-y.x)<=l&&Math.abs(w.y-y.y)<=l&&!n[S]){n[S]=!0,m.crossTileID=S;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}}class ie{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class en{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const s=Math.round((e-this.lng)/360);if(s!==0)for(const n in this.indexes){const l=this.indexes[n],c={};for(const m in l){const g=l[m];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+s),c[g.tileID.key]=g}this.indexes[n]=c}this.lng=e}addBucket(e,s,n){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===s.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let c=0;c<s.symbolInstances.length;c++)s.symbolInstances.get(c).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const l=this.usedCrossTileIDs[e.overscaledZ];for(const c in this.indexes){const m=this.indexes[c];if(Number(c)>e.overscaledZ)for(const g in m){const y=m[g];y.tileID.isChildOf(e)&&y.findMatches(s.symbolInstances,e,l)}else{const g=m[e.scaledTo(Number(c)).key];g&&g.findMatches(s.symbolInstances,e,l)}}for(let c=0;c<s.symbolInstances.length;c++){const m=s.symbolInstances.get(c);m.crossTileID||(m.crossTileID=n.generate(),l[m.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new yl(e,s.symbolInstances,s.bucketInstanceId),!0}removeBucketCrossTileIDs(e,s){for(const n of s.getCrossTileIDsLists())for(const l of n)delete this.usedCrossTileIDs[e][l]}removeStaleBuckets(e){let s=!1;for(const n in this.indexes){const l=this.indexes[n];for(const c in l)e[l[c].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,l[c]),delete l[c],s=!0)}return s}}class ma{constructor(){this.layerIndexes={},this.crossTileIDs=new ie,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,s,n){let l=this.layerIndexes[e.id];l===void 0&&(l=this.layerIndexes[e.id]=new en);let c=!1;const m={};l.handleWrapJump(n);for(const g of s){const y=g.getBucket(e);y&&e.id===y.layerIds[0]&&(y.bucketInstanceId||(y.bucketInstanceId=++this.maxBucketInstanceId),l.addBucket(g.tileID,y,this.crossTileIDs)&&(c=!0),m[y.bucketInstanceId]=!0)}return l.removeStaleBuckets(m)&&(c=!0),c}pruneUnusedLayers(e){const s={};e.forEach(n=>{s[n]=!0});for(const n in this.layerIndexes)s[n]||delete this.layerIndexes[n]}}const Je=(h,e)=>u.x(h,e&&e.filter(s=>s.identifier!=="source.canvas")),bi=u.F(u.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),xl=u.F(u.ax,["setCenter","setZoom","setBearing","setPitch"]),Bi=u.aw();class je extends u.E{constructor(e,s={}){super(),this.map=e,this.dispatcher=new Ns(fa(),this,e._getMapId()),this.imageManager=new $i,this.imageManager.setEventedParent(this),this.glyphManager=new ur(e._requestManager,s.localIdeographFontFamily),this.lineAtlas=new da(256,512),this.crossTileSymbolIndex=new ma,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",u.az());const n=this;this._rtlTextPluginCallback=je.registerForPluginStateChange(l=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:l.pluginStatus,pluginURL:l.pluginURL},(c,m)=>{if(u.aA(c),m&&m.every(g=>g))for(const g in n.sourceCaches){const y=n.sourceCaches[g].getSource().type;y!=="vector"&&y!=="geojson"||n.sourceCaches[g].reload()}})}),this.on("data",l=>{if(l.dataType!=="source"||l.sourceDataType!=="metadata")return;const c=this.sourceCaches[l.sourceId];if(!c)return;const m=c.getSource();if(m&&m.vectorLayerIds)for(const g in this._layers){const y=this._layers[g];y.source===m.id&&this._validateLayer(y)}})}loadURL(e,s={},n){this.fire(new u.k("dataloading",{dataType:"style"})),s.validate=typeof s.validate!="boolean"||s.validate;const l=this.map._requestManager.transformRequest(e,Ee.Style);this._request=u.f(l,(c,m)=>{this._request=null,c?this.fire(new u.j(c)):m&&this._load(m,s,n)})}loadJSON(e,s={},n){this.fire(new u.k("dataloading",{dataType:"style"})),this._request=u.h.frame(()=>{this._request=null,s.validate=s.validate!==!1,this._load(e,s,n)})}loadEmpty(){this.fire(new u.k("dataloading",{dataType:"style"})),this._load(Bi,{validate:!1})}_load(e,s,n){var l;const c=s.transformStyle?s.transformStyle(n,e):e;if(!s.validate||!Je(this,u.y(c))){this._loaded=!0,this.stylesheet=c;for(const m in c.sources)this.addSource(m,c.sources[m],{validate:!1});c.sprite?this._loadSprite(c.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(c.glyphs),this._createLayers(),this.light=new Us(this.stylesheet.light),this.map.setTerrain((l=this.stylesheet.terrain)!==null&&l!==void 0?l:null),this.fire(new u.k("data",{dataType:"style"})),this.fire(new u.k("style.load"))}}_createLayers(){const e=u.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",e),this._order=e.map(s=>s.id),this._layers={},this._serializedLayers=null;for(const s of e){const n=u.aC(s);n.setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=n}}_loadSprite(e,s=!1,n=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(l,c,m,g){const y=$e(l),v=y.length,w=m>1?"@2x":"",S={},P={},L={};for(const{id:B,url:R}of y){const M=c.transformRequest(c.normalizeSpriteURL(R,w,".json"),Ee.SpriteJSON),Z=`${B}_${M.url}`;S[Z]=u.f(M,(H,tt)=>{delete S[Z],P[B]=tt,pa(g,P,L,H,v)});const Y=c.transformRequest(c.normalizeSpriteURL(R,w,".png"),Ee.SpriteImage),N=`${B}_${Y.url}`;S[N]=ti.getImage(Y,(H,tt)=>{delete S[N],L[B]=tt,pa(g,P,L,H,v)})}return{cancel(){for(const B of Object.values(S))B.cancel()}}}(e,this.map._requestManager,this.map.getPixelRatio(),(l,c)=>{if(this._spriteRequest=null,l)this.fire(new u.j(l));else if(c)for(const m in c){this._spritesImagesIds[m]=[];const g=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(y=>!(y in c)):[];for(const y of g)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(const y in c[m]){const v=m==="default"?y:`${m}:${y}`;this._spritesImagesIds[m].push(v),v in this.imageManager.images?this.imageManager.updateImage(v,c[m][y],!1):this.imageManager.addImage(v,c[m][y]),s&&(this._changedImages[v]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),s&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"})),n&&n(l)})}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}_validateLayer(e){const s=this.sourceCaches[e.source];if(!s)return;const n=e.sourceLayer;if(!n)return;const l=s.getSource();(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(n)===-1)&&this.fire(new u.j(new Error(`Source layer "${n}" does not exist on source "${l.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e){const s=this._serializedAllLayers();if(!e||e.length===0)return Object.values(s);const n=[];for(const l of e)s[l]&&n.push(s[l]);return n}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const s=Object.keys(this._layers);for(const n of s){const l=this._layers[n];l.type!=="custom"&&(e[n]=l.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const s=this._changed;if(this._changed){const l=Object.keys(this._updatedLayers),c=Object.keys(this._removedLayers);(l.length||c.length)&&this._updateWorkerLayers(l,c);for(const m in this._updatedSources){const g=this._updatedSources[m];if(g==="reload")this._reloadSource(m);else{if(g!=="clear")throw new Error(`Invalid action ${g}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}const n={};for(const l in this.sourceCaches){const c=this.sourceCaches[l];n[l]=c.used,c.used=!1}for(const l of this._order){const c=this._layers[l];c.recalculate(e,this._availableImages),!c.isHidden(e.zoom)&&c.source&&(this.sourceCaches[c.source].used=!0)}for(const l in n){const c=this.sourceCaches[l];n[l]!==c.used&&c.fire(new u.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(e),this.z=e.zoom,s&&this.fire(new u.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(e),removedIds:s})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,s={}){this._checkLoaded();const n=this.serialize();if(e=s.transformStyle?s.transformStyle(n,e):e,Je(this,u.y(e)))return!1;(e=u.aD(e)).layers=u.aB(e.layers);const l=u.aE(n,e).filter(m=>!(m.command in xl));if(l.length===0)return!1;const c=l.filter(m=>!(m.command in bi));if(c.length>0)throw new Error(`Unimplemented: ${c.map(m=>m.command).join(", ")}.`);for(const m of l)m.command!=="setTransition"&&this[m.command].apply(this,m.args);return this.stylesheet=e,this._serializedLayers=null,!0}addImage(e,s){if(this.getImage(e))return this.fire(new u.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,s),this._afterImageUpdated(e)}updateImage(e,s){this.imageManager.updateImage(e,s)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new u.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,s,n={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error(`Source "${e}" already exists.`);if(!s.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(s).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(u.y.source,`sources.${e}`,s,null,n))return;this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);const l=this.sourceCaches[e]=new ci(e,s,this.dispatcher);l.style=this,l.setEventedParent(this,()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:e})),l.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(const n in this._layers)if(this._layers[n].source===e)return this.fire(new u.j(new Error(`Source "${e}" cannot be removed while layer "${n}" is using it.`)));const s=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],s.fire(new u.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),s.setEventedParent(null),s.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,s){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error(`There is no source with this ID=${e}`);const n=this.sourceCaches[e].getSource();if(n.type!=="geojson")throw new Error(`geojsonSource.type is ${n.type}, which is !== 'geojson`);n.setData(s),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,s,n={}){this._checkLoaded();const l=e.id;if(this.getLayer(l))return void this.fire(new u.j(new Error(`Layer "${l}" already exists on this map.`)));let c;if(e.type==="custom"){if(Je(this,u.aF(e)))return;c=u.aC(e)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(l,e.source),e=u.aD(e),e=u.e(e,{source:l})),this._validate(u.y.layer,`layers.${l}`,e,{arrayIndex:-1},n))return;c=u.aC(e),this._validateLayer(c),c.setEventedParent(this,{layer:{id:l}})}const m=s?this._order.indexOf(s):this._order.length;if(s&&m===-1)this.fire(new u.j(new Error(`Cannot add layer "${l}" before non-existing layer "${s}".`)));else{if(this._order.splice(m,0,l),this._layerOrderChanged=!0,this._layers[l]=c,this._removedLayers[l]&&c.source&&c.type!=="custom"){const g=this._removedLayers[l];delete this._removedLayers[l],g.type!==c.type?this._updatedSources[c.source]="clear":(this._updatedSources[c.source]="reload",this.sourceCaches[c.source].pause())}this._updateLayer(c),c.onAdd&&c.onAdd(this.map)}}moveLayer(e,s){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new u.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===s)return;const n=this._order.indexOf(e);this._order.splice(n,1);const l=s?this._order.indexOf(s):this._order.length;s&&l===-1?this.fire(new u.j(new Error(`Cannot move layer "${e}" before non-existing layer "${s}".`))):(this._order.splice(l,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const s=this._layers[e];if(!s)return void this.fire(new u.j(new Error(`Cannot remove non-existing layer "${e}".`)));s.setEventedParent(null);const n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=s,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],s.onRemove&&s.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,s,n){this._checkLoaded();const l=this.getLayer(e);l?l.minzoom===s&&l.maxzoom===n||(s!=null&&(l.minzoom=s),n!=null&&(l.maxzoom=n),this._updateLayer(l)):this.fire(new u.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,s,n={}){this._checkLoaded();const l=this.getLayer(e);if(l){if(!u.aG(l.filter,s))return s==null?(l.filter=void 0,void this._updateLayer(l)):void(this._validate(u.y.filter,`layers.${l.id}.filter`,s,null,n)||(l.filter=u.aD(s),this._updateLayer(l)))}else this.fire(new u.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return u.aD(this.getLayer(e).filter)}setLayoutProperty(e,s,n,l={}){this._checkLoaded();const c=this.getLayer(e);c?u.aG(c.getLayoutProperty(s),n)||(c.setLayoutProperty(s,n,l),this._updateLayer(c)):this.fire(new u.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,s){const n=this.getLayer(e);if(n)return n.getLayoutProperty(s);this.fire(new u.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,s,n,l={}){this._checkLoaded();const c=this.getLayer(e);c?u.aG(c.getPaintProperty(s),n)||(c.setPaintProperty(s,n,l)&&this._updateLayer(c),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new u.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,s){return this.getLayer(e).getPaintProperty(s)}setFeatureState(e,s){this._checkLoaded();const n=e.source,l=e.sourceLayer,c=this.sourceCaches[n];if(c===void 0)return void this.fire(new u.j(new Error(`The source '${n}' does not exist in the map's style.`)));const m=c.getSource().type;m==="geojson"&&l?this.fire(new u.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||l?(e.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),c.setFeatureState(l,e.id,s)):this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,s){this._checkLoaded();const n=e.source,l=this.sourceCaches[n];if(l===void 0)return void this.fire(new u.j(new Error(`The source '${n}' does not exist in the map's style.`)));const c=l.getSource().type,m=c==="vector"?e.sourceLayer:void 0;c!=="vector"||m?s&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new u.j(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(m,e.id,s):this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const s=e.source,n=e.sourceLayer,l=this.sourceCaches[s];if(l!==void 0)return l.getSource().type!=="vector"||n?(e.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),l.getFeatureState(n,e.id)):void this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new u.j(new Error(`The source '${s}' does not exist in the map's style.`)))}getTransition(){return u.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=u.aH(this.sourceCaches,c=>c.serialize()),s=this._serializeByIds(this._order),n=this.map.getTerrain()||void 0,l=this.stylesheet;return u.aI({version:l.version,name:l.name,metadata:l.metadata,light:l.light,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,sources:e,layers:s,terrain:n},c=>c!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const s=m=>this._layers[m].type==="fill-extrusion",n={},l=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(s(g)){n[g]=m;for(const y of e){const v=y[g];if(v)for(const w of v)l.push(w)}}}l.sort((m,g)=>g.intersectionZ-m.intersectionZ);const c=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(s(g))for(let y=l.length-1;y>=0;y--){const v=l[y].feature;if(n[v.layer.id]<m)break;c.push(v),l.pop()}else for(const y of e){const v=y[g];if(v)for(const w of v)c.push(w.feature)}}return c}queryRenderedFeatures(e,s,n){s&&s.filter&&this._validate(u.y.filter,"queryRenderedFeatures.filter",s.filter,null,s);const l={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new u.j(new Error("parameters.layers must be an Array."))),[];for(const g of s.layers){const y=this._layers[g];if(!y)return this.fire(new u.j(new Error(`The layer '${g}' does not exist in the map's style and cannot be queried for features.`))),[];l[y.source]=!0}}const c=[];s.availableImages=this._availableImages;const m=this._serializedAllLayers();for(const g in this.sourceCaches)s.layers&&!l[g]||c.push($r(this.sourceCaches[g],this._layers,m,e,s,n));return this.placement&&c.push(function(g,y,v,w,S,P,L){const B={},R=P.queryRenderedSymbols(w),M=[];for(const Z of Object.keys(R).map(Number))M.push(L[Z]);M.sort(Pr);for(const Z of M){const Y=Z.featureIndex.lookupSymbolFeatures(R[Z.bucketInstanceId],y,Z.bucketIndex,Z.sourceLayerIndex,S.filter,S.layers,S.availableImages,g);for(const N in Y){const H=B[N]=B[N]||[],tt=Y[N];tt.sort((et,nt)=>{const ht=Z.featureSortOrder;if(ht){const ut=ht.indexOf(et.featureIndex);return ht.indexOf(nt.featureIndex)-ut}return nt.featureIndex-et.featureIndex});for(const et of tt)H.push(et)}}for(const Z in B)B[Z].forEach(Y=>{const N=Y.feature,H=v[g[Z].source].getFeatureState(N.layer["source-layer"],N.id);N.source=N.layer.source,N.layer["source-layer"]&&(N.sourceLayer=N.layer["source-layer"]),N.state=H});return B}(this._layers,m,this.sourceCaches,e,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)}querySourceFeatures(e,s){s&&s.filter&&this._validate(u.y.filter,"querySourceFeatures.filter",s.filter,null,s);const n=this.sourceCaches[e];return n?function(l,c){const m=l.getRenderableIds().map(v=>l.getTileByID(v)),g=[],y={};for(let v=0;v<m.length;v++){const w=m[v],S=w.tileID.canonical.key;y[S]||(y[S]=!0,w.querySourceFeatures(g,c))}return g}(n,s):[]}addSourceType(e,s,n){return hr(e)?n(new Error(`A source type called "${e}" already exists.`)):(((l,c)=>{qs[l]=c})(e,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:s.workerSourceURL},n):n(null,null))}getLight(){return this.light.getLight()}setLight(e,s={}){this._checkLoaded();const n=this.light.getLight();let l=!1;for(const m in e)if(!u.aG(e[m],n[m])){l=!0;break}if(!l)return;const c={now:u.h.now(),transition:u.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,s),this.light.updateTransitions(c)}_validate(e,s,n,l,c={}){return(!c||c.validate!==!1)&&Je(this,e.call(u.y,u.e({key:s,style:this.serialize(),value:n,styleSpec:u.v},l)))}_remove(e=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),u.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const s in this._layers)this._layers[s].setEventedParent(null);for(const s in this.sourceCaches){const n=this.sourceCaches[s];n.setEventedParent(null),n.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const s in this.sourceCaches)this.sourceCaches[s].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,s,n,l,c=!1){let m=!1,g=!1;const y={};for(const v of this._order){const w=this._layers[v];if(w.type!=="symbol")continue;if(!y[w.source]){const P=this.sourceCaches[w.source];y[w.source]=P.getRenderableIds(!0).map(L=>P.getTileByID(L)).sort((L,B)=>B.tileID.overscaledZ-L.tileID.overscaledZ||(L.tileID.isLessThan(B.tileID)?-1:1))}const S=this.crossTileSymbolIndex.addLayer(w,y[w.source],e.center.lng);m=m||S}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((c=c||this._layerOrderChanged||n===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.h.now(),e.zoom))&&(this.pauseablePlacement=new _s(e,this.map.terrain,this._order,c,s,n,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.h.now()),g=!0),m&&this.pauseablePlacement.placement.setStale()),g||m)for(const v of this._order){const w=this._layers[v];w.type==="symbol"&&this.placement.updateLayerOpacities(w,y[w.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.h.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,s,n){this.imageManager.getImages(s.icons,n),this._updateTilesForChangedImages();const l=this.sourceCaches[s.source];l&&l.setDependencies(s.tileID.key,s.type,s.icons)}getGlyphs(e,s,n){this.glyphManager.getGlyphs(s.stacks,n);const l=this.sourceCaches[s.source];l&&l.setDependencies(s.tileID.key,s.type,[""])}getResource(e,s,n){return u.m(s,n)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,s={}){this._checkLoaded(),e&&this._validate(u.y.glyphs,"glyphs",e,null,s)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,s,n={},l){this._checkLoaded();const c=[{id:e,url:s}],m=[...$e(this.stylesheet.sprite),...c];this._validate(u.y.sprite,"sprite",m,null,n)||(this.stylesheet.sprite=m,this._loadSprite(c,!0,l))}removeSprite(e){this._checkLoaded();const s=$e(this.stylesheet.sprite);if(s.find(n=>n.id===e)){if(this._spritesImagesIds[e])for(const n of this._spritesImagesIds[e])this.imageManager.removeImage(n),this._changedImages[n]=!0;s.splice(s.findIndex(n=>n.id===e),1),this.stylesheet.sprite=s.length>0?s:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}else this.fire(new u.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return $e(this.stylesheet.sprite)}setSprite(e,s={},n){this._checkLoaded(),e&&this._validate(u.y.sprite,"sprite",e,null,s)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,n):(this._unloadSprite(),n&&n(null)))}}je.registerForPluginStateChange=u.aK;var ga=u.Q([{name:"a_pos",type:"Int16",components:2}]),xs="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const ge={prelude:Yt(`#ifdef GL_ES
3
+ precision mediump float;
4
+ #else
5
+ #if !defined(lowp)
6
+ #define lowp
7
+ #endif
8
+ #if !defined(mediump)
9
+ #define mediump
10
+ #endif
11
+ #if !defined(highp)
12
+ #define highp
13
+ #endif
14
+ #endif
15
+ `,`#ifdef GL_ES
16
+ precision highp float;
17
+ #else
18
+ #if !defined(lowp)
19
+ #define lowp
20
+ #endif
21
+ #if !defined(mediump)
22
+ #define mediump
23
+ #endif
24
+ #if !defined(highp)
25
+ #define highp
26
+ #endif
27
+ #endif
28
+ vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
29
+ );}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}
30
+ #ifdef TERRAIN3D
31
+ uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
32
+ #endif
33
+ const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
34
+ #ifdef TERRAIN3D
35
+ highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
36
+ #else
37
+ return 1.0;
38
+ #endif
39
+ }float calculate_visibility(vec4 pos) {
40
+ #ifdef TERRAIN3D
41
+ vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
42
+ #else
43
+ return 1.0;
44
+ #endif
45
+ }float ele(vec2 pos) {
46
+ #ifdef TERRAIN3D
47
+ vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
48
+ #else
49
+ return 0.0;
50
+ #endif
51
+ }float get_elevation(vec2 pos) {
52
+ #ifdef TERRAIN3D
53
+ vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
54
+ #else
55
+ return 0.0;
56
+ #endif
57
+ }`),background:Yt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
58
+ #ifdef OVERDRAW_INSPECTOR
59
+ gl_FragColor=vec4(1.0);
60
+ #endif
61
+ }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Yt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
62
+ #ifdef OVERDRAW_INSPECTOR
63
+ gl_FragColor=vec4(1.0);
64
+ #endif
65
+ }`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Yt(`varying vec3 v_data;varying float v_visibility;
66
+ #pragma mapbox: define highp vec4 color
67
+ #pragma mapbox: define mediump float radius
68
+ #pragma mapbox: define lowp float blur
69
+ #pragma mapbox: define lowp float opacity
70
+ #pragma mapbox: define highp vec4 stroke_color
71
+ #pragma mapbox: define mediump float stroke_width
72
+ #pragma mapbox: define lowp float stroke_opacity
73
+ void main() {
74
+ #pragma mapbox: initialize highp vec4 color
75
+ #pragma mapbox: initialize mediump float radius
76
+ #pragma mapbox: initialize lowp float blur
77
+ #pragma mapbox: initialize lowp float opacity
78
+ #pragma mapbox: initialize highp vec4 stroke_color
79
+ #pragma mapbox: initialize mediump float stroke_width
80
+ #pragma mapbox: initialize lowp float stroke_opacity
81
+ vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
82
+ #ifdef OVERDRAW_INSPECTOR
83
+ gl_FragColor=vec4(1.0);
84
+ #endif
85
+ }`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;
86
+ #pragma mapbox: define highp vec4 color
87
+ #pragma mapbox: define mediump float radius
88
+ #pragma mapbox: define lowp float blur
89
+ #pragma mapbox: define lowp float opacity
90
+ #pragma mapbox: define highp vec4 stroke_color
91
+ #pragma mapbox: define mediump float stroke_width
92
+ #pragma mapbox: define lowp float stroke_opacity
93
+ void main(void) {
94
+ #pragma mapbox: initialize highp vec4 color
95
+ #pragma mapbox: initialize mediump float radius
96
+ #pragma mapbox: initialize lowp float blur
97
+ #pragma mapbox: initialize lowp float opacity
98
+ #pragma mapbox: initialize highp vec4 stroke_color
99
+ #pragma mapbox: initialize mediump float stroke_width
100
+ #pragma mapbox: initialize lowp float stroke_opacity
101
+ vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Yt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Yt(`uniform highp float u_intensity;varying vec2 v_extrude;
102
+ #pragma mapbox: define highp float weight
103
+ #define GAUSS_COEF 0.3989422804014327
104
+ void main() {
105
+ #pragma mapbox: initialize highp float weight
106
+ float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
107
+ #ifdef OVERDRAW_INSPECTOR
108
+ gl_FragColor=vec4(1.0);
109
+ #endif
110
+ }`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
111
+ #pragma mapbox: define highp float weight
112
+ #pragma mapbox: define mediump float radius
113
+ const highp float ZERO=1.0/255.0/16.0;
114
+ #define GAUSS_COEF 0.3989422804014327
115
+ void main(void) {
116
+ #pragma mapbox: initialize highp float weight
117
+ #pragma mapbox: initialize mediump float radius
118
+ vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Yt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
119
+ #ifdef OVERDRAW_INSPECTOR
120
+ gl_FragColor=vec4(0.0);
121
+ #endif
122
+ }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Yt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Yt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Yt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Yt(`#pragma mapbox: define highp vec4 color
123
+ #pragma mapbox: define lowp float opacity
124
+ void main() {
125
+ #pragma mapbox: initialize highp vec4 color
126
+ #pragma mapbox: initialize lowp float opacity
127
+ gl_FragColor=color*opacity;
128
+ #ifdef OVERDRAW_INSPECTOR
129
+ gl_FragColor=vec4(1.0);
130
+ #endif
131
+ }`,`attribute vec2 a_pos;uniform mat4 u_matrix;
132
+ #pragma mapbox: define highp vec4 color
133
+ #pragma mapbox: define lowp float opacity
134
+ void main() {
135
+ #pragma mapbox: initialize highp vec4 color
136
+ #pragma mapbox: initialize lowp float opacity
137
+ gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Yt(`varying vec2 v_pos;
138
+ #pragma mapbox: define highp vec4 outline_color
139
+ #pragma mapbox: define lowp float opacity
140
+ void main() {
141
+ #pragma mapbox: initialize highp vec4 outline_color
142
+ #pragma mapbox: initialize lowp float opacity
143
+ float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
144
+ #ifdef OVERDRAW_INSPECTOR
145
+ gl_FragColor=vec4(1.0);
146
+ #endif
147
+ }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
148
+ #pragma mapbox: define highp vec4 outline_color
149
+ #pragma mapbox: define lowp float opacity
150
+ void main() {
151
+ #pragma mapbox: initialize highp vec4 outline_color
152
+ #pragma mapbox: initialize lowp float opacity
153
+ gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Yt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
154
+ #pragma mapbox: define lowp float opacity
155
+ #pragma mapbox: define lowp vec4 pattern_from
156
+ #pragma mapbox: define lowp vec4 pattern_to
157
+ void main() {
158
+ #pragma mapbox: initialize lowp float opacity
159
+ #pragma mapbox: initialize mediump vec4 pattern_from
160
+ #pragma mapbox: initialize mediump vec4 pattern_to
161
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
162
+ #ifdef OVERDRAW_INSPECTOR
163
+ gl_FragColor=vec4(1.0);
164
+ #endif
165
+ }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
166
+ #pragma mapbox: define lowp float opacity
167
+ #pragma mapbox: define lowp vec4 pattern_from
168
+ #pragma mapbox: define lowp vec4 pattern_to
169
+ #pragma mapbox: define lowp float pixel_ratio_from
170
+ #pragma mapbox: define lowp float pixel_ratio_to
171
+ void main() {
172
+ #pragma mapbox: initialize lowp float opacity
173
+ #pragma mapbox: initialize mediump vec4 pattern_from
174
+ #pragma mapbox: initialize mediump vec4 pattern_to
175
+ #pragma mapbox: initialize lowp float pixel_ratio_from
176
+ #pragma mapbox: initialize lowp float pixel_ratio_to
177
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Yt(`#ifdef GL_ES
178
+ precision highp float;
179
+ #endif
180
+ uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
181
+ #pragma mapbox: define lowp float opacity
182
+ #pragma mapbox: define lowp vec4 pattern_from
183
+ #pragma mapbox: define lowp vec4 pattern_to
184
+ void main() {
185
+ #pragma mapbox: initialize lowp float opacity
186
+ #pragma mapbox: initialize mediump vec4 pattern_from
187
+ #pragma mapbox: initialize mediump vec4 pattern_to
188
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
189
+ #ifdef OVERDRAW_INSPECTOR
190
+ gl_FragColor=vec4(1.0);
191
+ #endif
192
+ }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
193
+ #pragma mapbox: define lowp float opacity
194
+ #pragma mapbox: define lowp vec4 pattern_from
195
+ #pragma mapbox: define lowp vec4 pattern_to
196
+ #pragma mapbox: define lowp float pixel_ratio_from
197
+ #pragma mapbox: define lowp float pixel_ratio_to
198
+ void main() {
199
+ #pragma mapbox: initialize lowp float opacity
200
+ #pragma mapbox: initialize mediump vec4 pattern_from
201
+ #pragma mapbox: initialize mediump vec4 pattern_to
202
+ #pragma mapbox: initialize lowp float pixel_ratio_from
203
+ #pragma mapbox: initialize lowp float pixel_ratio_to
204
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Yt(`varying vec4 v_color;void main() {gl_FragColor=v_color;
205
+ #ifdef OVERDRAW_INSPECTOR
206
+ gl_FragColor=vec4(1.0);
207
+ #endif
208
+ }`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
209
+ #ifdef TERRAIN3D
210
+ attribute vec2 a_centroid;
211
+ #endif
212
+ varying vec4 v_color;
213
+ #pragma mapbox: define highp float base
214
+ #pragma mapbox: define highp float height
215
+ #pragma mapbox: define highp vec4 color
216
+ void main() {
217
+ #pragma mapbox: initialize highp float base
218
+ #pragma mapbox: initialize highp float height
219
+ #pragma mapbox: initialize highp vec4 color
220
+ vec3 normal=a_normal_ed.xyz;
221
+ #ifdef TERRAIN3D
222
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
223
+ #else
224
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
225
+ #endif
226
+ base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Yt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
227
+ #pragma mapbox: define lowp float base
228
+ #pragma mapbox: define lowp float height
229
+ #pragma mapbox: define lowp vec4 pattern_from
230
+ #pragma mapbox: define lowp vec4 pattern_to
231
+ #pragma mapbox: define lowp float pixel_ratio_from
232
+ #pragma mapbox: define lowp float pixel_ratio_to
233
+ void main() {
234
+ #pragma mapbox: initialize lowp float base
235
+ #pragma mapbox: initialize lowp float height
236
+ #pragma mapbox: initialize mediump vec4 pattern_from
237
+ #pragma mapbox: initialize mediump vec4 pattern_to
238
+ #pragma mapbox: initialize lowp float pixel_ratio_from
239
+ #pragma mapbox: initialize lowp float pixel_ratio_to
240
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
241
+ #ifdef OVERDRAW_INSPECTOR
242
+ gl_FragColor=vec4(1.0);
243
+ #endif
244
+ }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
245
+ #ifdef TERRAIN3D
246
+ attribute vec2 a_centroid;
247
+ #endif
248
+ varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
249
+ #pragma mapbox: define lowp float base
250
+ #pragma mapbox: define lowp float height
251
+ #pragma mapbox: define lowp vec4 pattern_from
252
+ #pragma mapbox: define lowp vec4 pattern_to
253
+ #pragma mapbox: define lowp float pixel_ratio_from
254
+ #pragma mapbox: define lowp float pixel_ratio_to
255
+ void main() {
256
+ #pragma mapbox: initialize lowp float base
257
+ #pragma mapbox: initialize lowp float height
258
+ #pragma mapbox: initialize mediump vec4 pattern_from
259
+ #pragma mapbox: initialize mediump vec4 pattern_to
260
+ #pragma mapbox: initialize lowp float pixel_ratio_from
261
+ #pragma mapbox: initialize lowp float pixel_ratio_to
262
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
263
+ #ifdef TERRAIN3D
264
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
265
+ #else
266
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
267
+ #endif
268
+ base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
269
+ ? a_pos
270
+ : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Yt(`#ifdef GL_ES
271
+ precision highp float;
272
+ #endif
273
+ uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
274
+ #ifdef OVERDRAW_INSPECTOR
275
+ gl_FragColor=vec4(1.0);
276
+ #endif
277
+ }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Yt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
278
+ #define PI 3.141592653589793
279
+ void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
280
+ #ifdef OVERDRAW_INSPECTOR
281
+ gl_FragColor=vec4(1.0);
282
+ #endif
283
+ }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Yt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
284
+ #pragma mapbox: define highp vec4 color
285
+ #pragma mapbox: define lowp float blur
286
+ #pragma mapbox: define lowp float opacity
287
+ void main() {
288
+ #pragma mapbox: initialize highp vec4 color
289
+ #pragma mapbox: initialize lowp float blur
290
+ #pragma mapbox: initialize lowp float opacity
291
+ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
292
+ #ifdef OVERDRAW_INSPECTOR
293
+ gl_FragColor=vec4(1.0);
294
+ #endif
295
+ }`,`
296
+ #define scale 0.015873016
297
+ attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
298
+ #pragma mapbox: define highp vec4 color
299
+ #pragma mapbox: define lowp float blur
300
+ #pragma mapbox: define lowp float opacity
301
+ #pragma mapbox: define mediump float gapwidth
302
+ #pragma mapbox: define lowp float offset
303
+ #pragma mapbox: define mediump float width
304
+ void main() {
305
+ #pragma mapbox: initialize highp vec4 color
306
+ #pragma mapbox: initialize lowp float blur
307
+ #pragma mapbox: initialize lowp float opacity
308
+ #pragma mapbox: initialize mediump float gapwidth
309
+ #pragma mapbox: initialize lowp float offset
310
+ #pragma mapbox: initialize mediump float width
311
+ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
312
+ #ifdef TERRAIN3D
313
+ v_gamma_scale=1.0;
314
+ #else
315
+ float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
316
+ #endif
317
+ v_width2=vec2(outset,inset);}`),lineGradient:Yt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
318
+ #pragma mapbox: define lowp float blur
319
+ #pragma mapbox: define lowp float opacity
320
+ void main() {
321
+ #pragma mapbox: initialize lowp float blur
322
+ #pragma mapbox: initialize lowp float opacity
323
+ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
324
+ #ifdef OVERDRAW_INSPECTOR
325
+ gl_FragColor=vec4(1.0);
326
+ #endif
327
+ }`,`
328
+ #define scale 0.015873016
329
+ attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
330
+ #pragma mapbox: define lowp float blur
331
+ #pragma mapbox: define lowp float opacity
332
+ #pragma mapbox: define mediump float gapwidth
333
+ #pragma mapbox: define lowp float offset
334
+ #pragma mapbox: define mediump float width
335
+ void main() {
336
+ #pragma mapbox: initialize lowp float blur
337
+ #pragma mapbox: initialize lowp float opacity
338
+ #pragma mapbox: initialize mediump float gapwidth
339
+ #pragma mapbox: initialize lowp float offset
340
+ #pragma mapbox: initialize mediump float width
341
+ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
342
+ #ifdef TERRAIN3D
343
+ v_gamma_scale=1.0;
344
+ #else
345
+ float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
346
+ #endif
347
+ v_width2=vec2(outset,inset);}`),linePattern:Yt(`#ifdef GL_ES
348
+ precision highp float;
349
+ #endif
350
+ uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
351
+ #pragma mapbox: define lowp vec4 pattern_from
352
+ #pragma mapbox: define lowp vec4 pattern_to
353
+ #pragma mapbox: define lowp float pixel_ratio_from
354
+ #pragma mapbox: define lowp float pixel_ratio_to
355
+ #pragma mapbox: define lowp float blur
356
+ #pragma mapbox: define lowp float opacity
357
+ void main() {
358
+ #pragma mapbox: initialize mediump vec4 pattern_from
359
+ #pragma mapbox: initialize mediump vec4 pattern_to
360
+ #pragma mapbox: initialize lowp float pixel_ratio_from
361
+ #pragma mapbox: initialize lowp float pixel_ratio_to
362
+ #pragma mapbox: initialize lowp float blur
363
+ #pragma mapbox: initialize lowp float opacity
364
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
365
+ #ifdef OVERDRAW_INSPECTOR
366
+ gl_FragColor=vec4(1.0);
367
+ #endif
368
+ }`,`
369
+ #define scale 0.015873016
370
+ #define LINE_DISTANCE_SCALE 2.0
371
+ attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
372
+ #pragma mapbox: define lowp float blur
373
+ #pragma mapbox: define lowp float opacity
374
+ #pragma mapbox: define lowp float offset
375
+ #pragma mapbox: define mediump float gapwidth
376
+ #pragma mapbox: define mediump float width
377
+ #pragma mapbox: define lowp float floorwidth
378
+ #pragma mapbox: define lowp vec4 pattern_from
379
+ #pragma mapbox: define lowp vec4 pattern_to
380
+ #pragma mapbox: define lowp float pixel_ratio_from
381
+ #pragma mapbox: define lowp float pixel_ratio_to
382
+ void main() {
383
+ #pragma mapbox: initialize lowp float blur
384
+ #pragma mapbox: initialize lowp float opacity
385
+ #pragma mapbox: initialize lowp float offset
386
+ #pragma mapbox: initialize mediump float gapwidth
387
+ #pragma mapbox: initialize mediump float width
388
+ #pragma mapbox: initialize lowp float floorwidth
389
+ #pragma mapbox: initialize mediump vec4 pattern_from
390
+ #pragma mapbox: initialize mediump vec4 pattern_to
391
+ #pragma mapbox: initialize lowp float pixel_ratio_from
392
+ #pragma mapbox: initialize lowp float pixel_ratio_to
393
+ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
394
+ #ifdef TERRAIN3D
395
+ v_gamma_scale=1.0;
396
+ #else
397
+ float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
398
+ #endif
399
+ v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Yt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
400
+ #pragma mapbox: define highp vec4 color
401
+ #pragma mapbox: define lowp float blur
402
+ #pragma mapbox: define lowp float opacity
403
+ #pragma mapbox: define mediump float width
404
+ #pragma mapbox: define lowp float floorwidth
405
+ void main() {
406
+ #pragma mapbox: initialize highp vec4 color
407
+ #pragma mapbox: initialize lowp float blur
408
+ #pragma mapbox: initialize lowp float opacity
409
+ #pragma mapbox: initialize mediump float width
410
+ #pragma mapbox: initialize lowp float floorwidth
411
+ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
412
+ #ifdef OVERDRAW_INSPECTOR
413
+ gl_FragColor=vec4(1.0);
414
+ #endif
415
+ }`,`
416
+ #define scale 0.015873016
417
+ #define LINE_DISTANCE_SCALE 2.0
418
+ attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
419
+ #pragma mapbox: define highp vec4 color
420
+ #pragma mapbox: define lowp float blur
421
+ #pragma mapbox: define lowp float opacity
422
+ #pragma mapbox: define mediump float gapwidth
423
+ #pragma mapbox: define lowp float offset
424
+ #pragma mapbox: define mediump float width
425
+ #pragma mapbox: define lowp float floorwidth
426
+ void main() {
427
+ #pragma mapbox: initialize highp vec4 color
428
+ #pragma mapbox: initialize lowp float blur
429
+ #pragma mapbox: initialize lowp float opacity
430
+ #pragma mapbox: initialize mediump float gapwidth
431
+ #pragma mapbox: initialize lowp float offset
432
+ #pragma mapbox: initialize mediump float width
433
+ #pragma mapbox: initialize lowp float floorwidth
434
+ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
435
+ #ifdef TERRAIN3D
436
+ v_gamma_scale=1.0;
437
+ #else
438
+ float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
439
+ #endif
440
+ v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Yt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
441
+ #ifdef OVERDRAW_INSPECTOR
442
+ gl_FragColor=vec4(1.0);
443
+ #endif
444
+ }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Yt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
445
+ #pragma mapbox: define lowp float opacity
446
+ void main() {
447
+ #pragma mapbox: initialize lowp float opacity
448
+ lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
449
+ #ifdef OVERDRAW_INSPECTOR
450
+ gl_FragColor=vec4(1.0);
451
+ #endif
452
+ }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
453
+ #pragma mapbox: define lowp float opacity
454
+ void main() {
455
+ #pragma mapbox: initialize lowp float opacity
456
+ vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
457
+ camera_to_anchor_distance/u_camera_to_center_distance :
458
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Yt(`#define SDF_PX 8.0
459
+ uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
460
+ #pragma mapbox: define highp vec4 fill_color
461
+ #pragma mapbox: define highp vec4 halo_color
462
+ #pragma mapbox: define lowp float opacity
463
+ #pragma mapbox: define lowp float halo_width
464
+ #pragma mapbox: define lowp float halo_blur
465
+ void main() {
466
+ #pragma mapbox: initialize highp vec4 fill_color
467
+ #pragma mapbox: initialize highp vec4 halo_color
468
+ #pragma mapbox: initialize lowp float opacity
469
+ #pragma mapbox: initialize lowp float halo_width
470
+ #pragma mapbox: initialize lowp float halo_blur
471
+ float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);
472
+ #ifdef OVERDRAW_INSPECTOR
473
+ gl_FragColor=vec4(1.0);
474
+ #endif
475
+ }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
476
+ #pragma mapbox: define highp vec4 fill_color
477
+ #pragma mapbox: define highp vec4 halo_color
478
+ #pragma mapbox: define lowp float opacity
479
+ #pragma mapbox: define lowp float halo_width
480
+ #pragma mapbox: define lowp float halo_blur
481
+ void main() {
482
+ #pragma mapbox: initialize highp vec4 fill_color
483
+ #pragma mapbox: initialize highp vec4 halo_color
484
+ #pragma mapbox: initialize lowp float opacity
485
+ #pragma mapbox: initialize lowp float halo_width
486
+ #pragma mapbox: initialize lowp float halo_blur
487
+ vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
488
+ camera_to_anchor_distance/u_camera_to_center_distance :
489
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Yt(`#define SDF_PX 8.0
490
+ #define SDF 1.0
491
+ #define ICON 0.0
492
+ uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
493
+ #pragma mapbox: define highp vec4 fill_color
494
+ #pragma mapbox: define highp vec4 halo_color
495
+ #pragma mapbox: define lowp float opacity
496
+ #pragma mapbox: define lowp float halo_width
497
+ #pragma mapbox: define lowp float halo_blur
498
+ void main() {
499
+ #pragma mapbox: initialize highp vec4 fill_color
500
+ #pragma mapbox: initialize highp vec4 halo_color
501
+ #pragma mapbox: initialize lowp float opacity
502
+ #pragma mapbox: initialize lowp float halo_width
503
+ #pragma mapbox: initialize lowp float halo_blur
504
+ float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
505
+ #ifdef OVERDRAW_INSPECTOR
506
+ gl_FragColor=vec4(1.0);
507
+ #endif
508
+ return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
509
+ #ifdef OVERDRAW_INSPECTOR
510
+ gl_FragColor=vec4(1.0);
511
+ #endif
512
+ }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
513
+ #pragma mapbox: define highp vec4 fill_color
514
+ #pragma mapbox: define highp vec4 halo_color
515
+ #pragma mapbox: define lowp float opacity
516
+ #pragma mapbox: define lowp float halo_width
517
+ #pragma mapbox: define lowp float halo_blur
518
+ void main() {
519
+ #pragma mapbox: initialize highp vec4 fill_color
520
+ #pragma mapbox: initialize highp vec4 halo_color
521
+ #pragma mapbox: initialize lowp float opacity
522
+ #pragma mapbox: initialize lowp float halo_width
523
+ #pragma mapbox: initialize lowp float halo_blur
524
+ vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
525
+ camera_to_anchor_distance/u_camera_to_center_distance :
526
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Yt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",xs),terrainDepth:Yt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",xs),terrainCoords:Yt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",xs)};function Yt(h,e){const s=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),l=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),c=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=c?c.concat(l):l,g={};return{fragmentSource:h=h.replace(s,(y,v,w,S,P)=>(g[P]=!0,v==="define"?`
527
+ #ifndef HAS_UNIFORM_u_${P}
528
+ varying ${w} ${S} ${P};
529
+ #else
530
+ uniform ${w} ${S} u_${P};
531
+ #endif
532
+ `:`
533
+ #ifdef HAS_UNIFORM_u_${P}
534
+ ${w} ${S} ${P} = u_${P};
535
+ #endif
536
+ `)),vertexSource:e=e.replace(s,(y,v,w,S,P)=>{const L=S==="float"?"vec2":"vec4",B=P.match(/color/)?"color":L;return g[P]?v==="define"?`
537
+ #ifndef HAS_UNIFORM_u_${P}
538
+ uniform lowp float u_${P}_t;
539
+ attribute ${w} ${L} a_${P};
540
+ varying ${w} ${S} ${P};
541
+ #else
542
+ uniform ${w} ${S} u_${P};
543
+ #endif
544
+ `:B==="vec4"?`
545
+ #ifndef HAS_UNIFORM_u_${P}
546
+ ${P} = a_${P};
547
+ #else
548
+ ${w} ${S} ${P} = u_${P};
549
+ #endif
550
+ `:`
551
+ #ifndef HAS_UNIFORM_u_${P}
552
+ ${P} = unpack_mix_${B}(a_${P}, u_${P}_t);
553
+ #else
554
+ ${w} ${S} ${P} = u_${P};
555
+ #endif
556
+ `:v==="define"?`
557
+ #ifndef HAS_UNIFORM_u_${P}
558
+ uniform lowp float u_${P}_t;
559
+ attribute ${w} ${L} a_${P};
560
+ #else
561
+ uniform ${w} ${S} u_${P};
562
+ #endif
563
+ `:B==="vec4"?`
564
+ #ifndef HAS_UNIFORM_u_${P}
565
+ ${w} ${S} ${P} = a_${P};
566
+ #else
567
+ ${w} ${S} ${P} = u_${P};
568
+ #endif
569
+ `:`
570
+ #ifndef HAS_UNIFORM_u_${P}
571
+ ${w} ${S} ${P} = unpack_mix_${B}(a_${P}, u_${P}_t);
572
+ #else
573
+ ${w} ${S} ${P} = u_${P};
574
+ #endif
575
+ `}),staticAttributes:n,staticUniforms:m}}class Zr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,s,n,l,c,m,g,y,v){this.context=e;let w=this.boundPaintVertexBuffers.length!==l.length;for(let S=0;!w&&S<l.length;S++)this.boundPaintVertexBuffers[S]!==l[S]&&(w=!0);!this.vao||this.boundProgram!==s||this.boundLayoutVertexBuffer!==n||w||this.boundIndexBuffer!==c||this.boundVertexOffset!==m||this.boundDynamicVertexBuffer!==g||this.boundDynamicVertexBuffer2!==y||this.boundDynamicVertexBuffer3!==v?this.freshBind(s,n,l,c,m,g,y,v):(e.bindVertexArray.set(this.vao),g&&g.bind(),c&&c.dynamicDraw&&c.bind(),y&&y.bind(),v&&v.bind())}freshBind(e,s,n,l,c,m,g,y){const v=e.numAttributes,w=this.context,S=w.gl;this.vao&&this.destroy(),this.vao=w.createVertexArray(),w.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=s,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=l,this.boundVertexOffset=c,this.boundDynamicVertexBuffer=m,this.boundDynamicVertexBuffer2=g,this.boundDynamicVertexBuffer3=y,s.enableAttributes(S,e);for(const P of n)P.enableAttributes(S,e);m&&m.enableAttributes(S,e),g&&g.enableAttributes(S,e),y&&y.enableAttributes(S,e),s.bind(),s.setVertexAttribPointers(S,e,c);for(const P of n)P.bind(),P.setVertexAttribPointers(S,e,c);m&&(m.bind(),m.setVertexAttribPointers(S,e,c)),l&&l.bind(),g&&(g.bind(),g.setVertexAttribPointers(S,e,c)),y&&(y.bind(),y.setVertexAttribPointers(S,e,c)),w.currentNumAttributes=v}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function be(h){const e=[];for(let s=0;s<h.length;s++){if(h[s]===null)continue;const n=h[s].split(" ");e.push(n.pop())}return e}class _a{constructor(e,s,n,l,c,m){const g=e.gl;this.program=g.createProgram();const y=be(s.staticAttributes),v=n?n.getBinderAttributes():[],w=y.concat(v),S=ge.prelude.staticUniforms?be(ge.prelude.staticUniforms):[],P=s.staticUniforms?be(s.staticUniforms):[],L=n?n.getBinderUniforms():[],B=S.concat(P).concat(L),R=[];for(const et of B)R.indexOf(et)<0&&R.push(et);const M=n?n.defines():[];c&&M.push("#define OVERDRAW_INSPECTOR;"),m&&M.push("#define TERRAIN3D;");const Z=M.concat(ge.prelude.fragmentSource,s.fragmentSource).join(`
576
+ `),Y=M.concat(ge.prelude.vertexSource,s.vertexSource).join(`
577
+ `),N=g.createShader(g.FRAGMENT_SHADER);if(g.isContextLost())return void(this.failedToCreate=!0);if(g.shaderSource(N,Z),g.compileShader(N),!g.getShaderParameter(N,g.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${g.getShaderInfoLog(N)}`);g.attachShader(this.program,N);const H=g.createShader(g.VERTEX_SHADER);if(g.isContextLost())return void(this.failedToCreate=!0);if(g.shaderSource(H,Y),g.compileShader(H),!g.getShaderParameter(H,g.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${g.getShaderInfoLog(H)}`);g.attachShader(this.program,H),this.attributes={};const tt={};this.numAttributes=w.length;for(let et=0;et<this.numAttributes;et++)w[et]&&(g.bindAttribLocation(this.program,et,w[et]),this.attributes[w[et]]=et);if(g.linkProgram(this.program),!g.getProgramParameter(this.program,g.LINK_STATUS))throw new Error(`Program failed to link: ${g.getProgramInfoLog(this.program)}`);g.deleteShader(H),g.deleteShader(N);for(let et=0;et<R.length;et++){const nt=R[et];if(nt&&!tt[nt]){const ht=g.getUniformLocation(this.program,nt);ht&&(tt[nt]=ht)}}this.fixedUniforms=l(e,tt),this.terrainUniforms=((et,nt)=>({u_depth:new u.aL(et,nt.u_depth),u_terrain:new u.aL(et,nt.u_terrain),u_terrain_dim:new u.aM(et,nt.u_terrain_dim),u_terrain_matrix:new u.aN(et,nt.u_terrain_matrix),u_terrain_unpack:new u.aO(et,nt.u_terrain_unpack),u_terrain_exaggeration:new u.aM(et,nt.u_terrain_exaggeration)}))(e,tt),this.binderUniforms=n?n.getUniforms(e,tt):[]}draw(e,s,n,l,c,m,g,y,v,w,S,P,L,B,R,M,Z,Y){const N=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(l),e.setColorMode(c),e.setCullFace(m),y){e.activeTexture.set(N.TEXTURE2),N.bindTexture(N.TEXTURE_2D,y.depthTexture),e.activeTexture.set(N.TEXTURE3),N.bindTexture(N.TEXTURE_2D,y.texture);for(const tt in this.terrainUniforms)this.terrainUniforms[tt].set(y[tt])}for(const tt in this.fixedUniforms)this.fixedUniforms[tt].set(g[tt]);R&&R.setUniforms(e,this.binderUniforms,L,{zoom:B});let H=0;switch(s){case N.LINES:H=2;break;case N.TRIANGLES:H=3;break;case N.LINE_STRIP:H=1}for(const tt of P.get()){const et=tt.vaos||(tt.vaos={});(et[v]||(et[v]=new Zr)).bind(e,this,w,R?R.getPaintVertexBuffers():[],S,tt.vertexOffset,M,Z,Y),N.drawElements(s,tt.primitiveLength*H,N.UNSIGNED_SHORT,tt.primitiveOffset*H*2)}}}function Fi(h,e,s){const n=1/G(s,1,e.transform.tileZoom),l=Math.pow(2,s.tileID.overscaledZ),c=s.tileSize*Math.pow(2,e.transform.tileZoom)/l,m=c*(s.tileID.canonical.x+s.tileID.wrap*l),g=c*s.tileID.canonical.y;return{u_image:0,u_texsize:s.imageAtlasTexture.size,u_scale:[n,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[m>>16,g>>16],u_pixel_coord_lower:[65535&m,65535&g]}}const rn=(h,e,s,n)=>{const l=e.style.light,c=l.properties.get("position"),m=[c.x,c.y,c.z],g=function(){var v=new u.A(9);return u.A!=Float32Array&&(v[1]=0,v[2]=0,v[3]=0,v[5]=0,v[6]=0,v[7]=0),v[0]=1,v[4]=1,v[8]=1,v}();l.properties.get("anchor")==="viewport"&&function(v,w){var S=Math.sin(w),P=Math.cos(w);v[0]=P,v[1]=S,v[2]=0,v[3]=-S,v[4]=P,v[5]=0,v[6]=0,v[7]=0,v[8]=1}(g,-e.transform.angle),function(v,w,S){var P=w[0],L=w[1],B=w[2];v[0]=P*S[0]+L*S[3]+B*S[6],v[1]=P*S[1]+L*S[4]+B*S[7],v[2]=P*S[2]+L*S[5]+B*S[8]}(m,m,g);const y=l.properties.get("color");return{u_matrix:h,u_lightpos:m,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_vertical_gradient:+s,u_opacity:n}},kr=(h,e,s,n,l,c,m)=>u.e(rn(h,e,s,n),Fi(c,e,m),{u_height_factor:-Math.pow(2,l.overscaledZ)/m.tileSize/8}),uo=h=>({u_matrix:h}),sn=(h,e,s,n)=>u.e(uo(h),Fi(s,e,n)),ya=(h,e)=>({u_matrix:h,u_world:e}),xa=(h,e,s,n,l)=>u.e(sn(h,e,s,n),{u_world:l}),Mr=(h,e,s,n)=>{const l=h.transform;let c,m;if(n.paint.get("circle-pitch-alignment")==="map"){const g=G(s,1,l.zoom);c=!0,m=[g,g]}else c=!1,m=l.pixelsToGLUnits;return{u_camera_to_center_distance:l.cameraToCenterDistance,u_scale_with_map:+(n.paint.get("circle-pitch-scale")==="map"),u_matrix:h.translatePosMatrix(e.posMatrix,s,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+c,u_device_pixel_ratio:h.pixelRatio,u_extrude_scale:m}},an=(h,e,s)=>{const n=G(s,1,e.zoom),l=Math.pow(2,e.zoom-s.tileID.overscaledZ),c=s.tileID.overscaleFactor();return{u_matrix:h,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*l),e.pixelsToGLUnits[1]/(n*l)],u_overscale_factor:c}},js=(h,e,s=1)=>({u_matrix:h,u_color:e,u_overlay:0,u_overlay_scale:s}),ho=h=>({u_matrix:h}),vl=(h,e,s,n)=>({u_matrix:h,u_extrude_scale:G(e,1,s),u_intensity:n});function nn(h,e){const s=Math.pow(2,e.canonical.z),n=e.canonical.y;return[new u.U(0,n/s).toLngLat().lat,new u.U(0,(n+1)/s).toLngLat().lat]}const on=(h,e,s,n)=>{const l=h.transform;return{u_matrix:va(h,e,s,n),u_ratio:1/G(e,1,l.zoom),u_device_pixel_ratio:h.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},co=(h,e,s,n,l)=>u.e(on(h,e,s,l),{u_image:0,u_image_height:n}),bl=(h,e,s,n,l)=>{const c=h.transform,m=fo(e,c);return{u_matrix:va(h,e,s,l),u_texsize:e.imageAtlasTexture.size,u_ratio:1/G(e,1,c.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[m,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},po=(h,e,s,n,l,c)=>{const m=h.lineAtlas,g=fo(e,h.transform),y=s.layout.get("line-cap")==="round",v=m.getDash(n.from,y),w=m.getDash(n.to,y),S=v.width*l.fromScale,P=w.width*l.toScale;return u.e(on(h,e,s,c),{u_patternscale_a:[g/S,-v.height/2],u_patternscale_b:[g/P,-w.height/2],u_sdfgamma:m.width/(256*Math.min(S,P)*h.pixelRatio)/2,u_image:0,u_tex_y_a:v.y,u_tex_y_b:w.y,u_mix:l.t})};function fo(h,e){return 1/G(h,1,e.tileZoom)}function va(h,e,s,n){return h.translatePosMatrix(n?n.posMatrix:e.tileID.posMatrix,e,s.paint.get("line-translate"),s.paint.get("line-translate-anchor"))}const mo=(h,e,s,n,l)=>{return{u_matrix:h,u_tl_parent:e,u_scale_parent:s,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*l.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:l.paint.get("raster-brightness-min"),u_brightness_high:l.paint.get("raster-brightness-max"),u_saturation_factor:(m=l.paint.get("raster-saturation"),m>0?1-1/(1.001-m):-m),u_contrast_factor:(c=l.paint.get("raster-contrast"),c>0?1/(1-c):1+c),u_spin_weights:go(l.paint.get("raster-hue-rotate"))};var c,m};function go(h){h*=Math.PI/180;const e=Math.sin(h),s=Math.cos(h);return[(2*s+1)/3,(-Math.sqrt(3)*e-s+1)/3,(Math.sqrt(3)*e-s+1)/3]}const ln=(h,e,s,n,l,c,m,g,y,v)=>{const w=l.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:w.cameraToCenterDistance,u_pitch:w.pitch/360*2*Math.PI,u_rotate_symbol:+s,u_aspect_ratio:w.width/w.height,u_fade_change:l.options.fadeDuration?l.symbolFadeChange:1,u_matrix:c,u_label_plane_matrix:m,u_coord_matrix:g,u_is_text:+y,u_pitch_with_map:+n,u_texsize:v,u_texture:0}},un=(h,e,s,n,l,c,m,g,y,v,w)=>{const S=l.transform;return u.e(ln(h,e,s,n,l,c,m,g,y,v),{u_gamma_scale:n?Math.cos(S._pitch)*S.cameraToCenterDistance:1,u_device_pixel_ratio:l.pixelRatio,u_is_halo:+w})},Xr=(h,e,s,n,l,c,m,g,y,v)=>u.e(un(h,e,s,n,l,c,m,g,!0,y,!0),{u_texsize_icon:v,u_texture_icon:1}),ba=(h,e,s)=>({u_matrix:h,u_opacity:e,u_color:s}),Ri=(h,e,s,n,l,c)=>u.e(function(m,g,y,v){const w=y.imageManager.getPattern(m.from.toString()),S=y.imageManager.getPattern(m.to.toString()),{width:P,height:L}=y.imageManager.getPixelSize(),B=Math.pow(2,v.tileID.overscaledZ),R=v.tileSize*Math.pow(2,y.transform.tileZoom)/B,M=R*(v.tileID.canonical.x+v.tileID.wrap*B),Z=R*v.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:w.tl,u_pattern_br_a:w.br,u_pattern_tl_b:S.tl,u_pattern_br_b:S.br,u_texsize:[P,L],u_mix:g.t,u_pattern_size_a:w.displaySize,u_pattern_size_b:S.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/G(v,1,y.transform.tileZoom),u_pixel_coord_upper:[M>>16,Z>>16],u_pixel_coord_lower:[65535&M,65535&Z]}}(n,c,s,l),{u_matrix:h,u_opacity:e}),wa={fillExtrusion:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_lightpos:new u.aP(h,e.u_lightpos),u_lightintensity:new u.aM(h,e.u_lightintensity),u_lightcolor:new u.aP(h,e.u_lightcolor),u_vertical_gradient:new u.aM(h,e.u_vertical_gradient),u_opacity:new u.aM(h,e.u_opacity)}),fillExtrusionPattern:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_lightpos:new u.aP(h,e.u_lightpos),u_lightintensity:new u.aM(h,e.u_lightintensity),u_lightcolor:new u.aP(h,e.u_lightcolor),u_vertical_gradient:new u.aM(h,e.u_vertical_gradient),u_height_factor:new u.aM(h,e.u_height_factor),u_image:new u.aL(h,e.u_image),u_texsize:new u.aQ(h,e.u_texsize),u_pixel_coord_upper:new u.aQ(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new u.aQ(h,e.u_pixel_coord_lower),u_scale:new u.aP(h,e.u_scale),u_fade:new u.aM(h,e.u_fade),u_opacity:new u.aM(h,e.u_opacity)}),fill:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix)}),fillPattern:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_image:new u.aL(h,e.u_image),u_texsize:new u.aQ(h,e.u_texsize),u_pixel_coord_upper:new u.aQ(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new u.aQ(h,e.u_pixel_coord_lower),u_scale:new u.aP(h,e.u_scale),u_fade:new u.aM(h,e.u_fade)}),fillOutline:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_world:new u.aQ(h,e.u_world)}),fillOutlinePattern:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_world:new u.aQ(h,e.u_world),u_image:new u.aL(h,e.u_image),u_texsize:new u.aQ(h,e.u_texsize),u_pixel_coord_upper:new u.aQ(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new u.aQ(h,e.u_pixel_coord_lower),u_scale:new u.aP(h,e.u_scale),u_fade:new u.aM(h,e.u_fade)}),circle:(h,e)=>({u_camera_to_center_distance:new u.aM(h,e.u_camera_to_center_distance),u_scale_with_map:new u.aL(h,e.u_scale_with_map),u_pitch_with_map:new u.aL(h,e.u_pitch_with_map),u_extrude_scale:new u.aQ(h,e.u_extrude_scale),u_device_pixel_ratio:new u.aM(h,e.u_device_pixel_ratio),u_matrix:new u.aN(h,e.u_matrix)}),collisionBox:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_camera_to_center_distance:new u.aM(h,e.u_camera_to_center_distance),u_pixels_to_tile_units:new u.aM(h,e.u_pixels_to_tile_units),u_extrude_scale:new u.aQ(h,e.u_extrude_scale),u_overscale_factor:new u.aM(h,e.u_overscale_factor)}),collisionCircle:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_inv_matrix:new u.aN(h,e.u_inv_matrix),u_camera_to_center_distance:new u.aM(h,e.u_camera_to_center_distance),u_viewport_size:new u.aQ(h,e.u_viewport_size)}),debug:(h,e)=>({u_color:new u.aR(h,e.u_color),u_matrix:new u.aN(h,e.u_matrix),u_overlay:new u.aL(h,e.u_overlay),u_overlay_scale:new u.aM(h,e.u_overlay_scale)}),clippingMask:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix)}),heatmap:(h,e)=>({u_extrude_scale:new u.aM(h,e.u_extrude_scale),u_intensity:new u.aM(h,e.u_intensity),u_matrix:new u.aN(h,e.u_matrix)}),heatmapTexture:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_world:new u.aQ(h,e.u_world),u_image:new u.aL(h,e.u_image),u_color_ramp:new u.aL(h,e.u_color_ramp),u_opacity:new u.aM(h,e.u_opacity)}),hillshade:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_image:new u.aL(h,e.u_image),u_latrange:new u.aQ(h,e.u_latrange),u_light:new u.aQ(h,e.u_light),u_shadow:new u.aR(h,e.u_shadow),u_highlight:new u.aR(h,e.u_highlight),u_accent:new u.aR(h,e.u_accent)}),hillshadePrepare:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_image:new u.aL(h,e.u_image),u_dimension:new u.aQ(h,e.u_dimension),u_zoom:new u.aM(h,e.u_zoom),u_unpack:new u.aO(h,e.u_unpack)}),line:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_ratio:new u.aM(h,e.u_ratio),u_device_pixel_ratio:new u.aM(h,e.u_device_pixel_ratio),u_units_to_pixels:new u.aQ(h,e.u_units_to_pixels)}),lineGradient:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_ratio:new u.aM(h,e.u_ratio),u_device_pixel_ratio:new u.aM(h,e.u_device_pixel_ratio),u_units_to_pixels:new u.aQ(h,e.u_units_to_pixels),u_image:new u.aL(h,e.u_image),u_image_height:new u.aM(h,e.u_image_height)}),linePattern:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_texsize:new u.aQ(h,e.u_texsize),u_ratio:new u.aM(h,e.u_ratio),u_device_pixel_ratio:new u.aM(h,e.u_device_pixel_ratio),u_image:new u.aL(h,e.u_image),u_units_to_pixels:new u.aQ(h,e.u_units_to_pixels),u_scale:new u.aP(h,e.u_scale),u_fade:new u.aM(h,e.u_fade)}),lineSDF:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_ratio:new u.aM(h,e.u_ratio),u_device_pixel_ratio:new u.aM(h,e.u_device_pixel_ratio),u_units_to_pixels:new u.aQ(h,e.u_units_to_pixels),u_patternscale_a:new u.aQ(h,e.u_patternscale_a),u_patternscale_b:new u.aQ(h,e.u_patternscale_b),u_sdfgamma:new u.aM(h,e.u_sdfgamma),u_image:new u.aL(h,e.u_image),u_tex_y_a:new u.aM(h,e.u_tex_y_a),u_tex_y_b:new u.aM(h,e.u_tex_y_b),u_mix:new u.aM(h,e.u_mix)}),raster:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_tl_parent:new u.aQ(h,e.u_tl_parent),u_scale_parent:new u.aM(h,e.u_scale_parent),u_buffer_scale:new u.aM(h,e.u_buffer_scale),u_fade_t:new u.aM(h,e.u_fade_t),u_opacity:new u.aM(h,e.u_opacity),u_image0:new u.aL(h,e.u_image0),u_image1:new u.aL(h,e.u_image1),u_brightness_low:new u.aM(h,e.u_brightness_low),u_brightness_high:new u.aM(h,e.u_brightness_high),u_saturation_factor:new u.aM(h,e.u_saturation_factor),u_contrast_factor:new u.aM(h,e.u_contrast_factor),u_spin_weights:new u.aP(h,e.u_spin_weights)}),symbolIcon:(h,e)=>({u_is_size_zoom_constant:new u.aL(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aL(h,e.u_is_size_feature_constant),u_size_t:new u.aM(h,e.u_size_t),u_size:new u.aM(h,e.u_size),u_camera_to_center_distance:new u.aM(h,e.u_camera_to_center_distance),u_pitch:new u.aM(h,e.u_pitch),u_rotate_symbol:new u.aL(h,e.u_rotate_symbol),u_aspect_ratio:new u.aM(h,e.u_aspect_ratio),u_fade_change:new u.aM(h,e.u_fade_change),u_matrix:new u.aN(h,e.u_matrix),u_label_plane_matrix:new u.aN(h,e.u_label_plane_matrix),u_coord_matrix:new u.aN(h,e.u_coord_matrix),u_is_text:new u.aL(h,e.u_is_text),u_pitch_with_map:new u.aL(h,e.u_pitch_with_map),u_texsize:new u.aQ(h,e.u_texsize),u_texture:new u.aL(h,e.u_texture)}),symbolSDF:(h,e)=>({u_is_size_zoom_constant:new u.aL(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aL(h,e.u_is_size_feature_constant),u_size_t:new u.aM(h,e.u_size_t),u_size:new u.aM(h,e.u_size),u_camera_to_center_distance:new u.aM(h,e.u_camera_to_center_distance),u_pitch:new u.aM(h,e.u_pitch),u_rotate_symbol:new u.aL(h,e.u_rotate_symbol),u_aspect_ratio:new u.aM(h,e.u_aspect_ratio),u_fade_change:new u.aM(h,e.u_fade_change),u_matrix:new u.aN(h,e.u_matrix),u_label_plane_matrix:new u.aN(h,e.u_label_plane_matrix),u_coord_matrix:new u.aN(h,e.u_coord_matrix),u_is_text:new u.aL(h,e.u_is_text),u_pitch_with_map:new u.aL(h,e.u_pitch_with_map),u_texsize:new u.aQ(h,e.u_texsize),u_texture:new u.aL(h,e.u_texture),u_gamma_scale:new u.aM(h,e.u_gamma_scale),u_device_pixel_ratio:new u.aM(h,e.u_device_pixel_ratio),u_is_halo:new u.aL(h,e.u_is_halo)}),symbolTextAndIcon:(h,e)=>({u_is_size_zoom_constant:new u.aL(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aL(h,e.u_is_size_feature_constant),u_size_t:new u.aM(h,e.u_size_t),u_size:new u.aM(h,e.u_size),u_camera_to_center_distance:new u.aM(h,e.u_camera_to_center_distance),u_pitch:new u.aM(h,e.u_pitch),u_rotate_symbol:new u.aL(h,e.u_rotate_symbol),u_aspect_ratio:new u.aM(h,e.u_aspect_ratio),u_fade_change:new u.aM(h,e.u_fade_change),u_matrix:new u.aN(h,e.u_matrix),u_label_plane_matrix:new u.aN(h,e.u_label_plane_matrix),u_coord_matrix:new u.aN(h,e.u_coord_matrix),u_is_text:new u.aL(h,e.u_is_text),u_pitch_with_map:new u.aL(h,e.u_pitch_with_map),u_texsize:new u.aQ(h,e.u_texsize),u_texsize_icon:new u.aQ(h,e.u_texsize_icon),u_texture:new u.aL(h,e.u_texture),u_texture_icon:new u.aL(h,e.u_texture_icon),u_gamma_scale:new u.aM(h,e.u_gamma_scale),u_device_pixel_ratio:new u.aM(h,e.u_device_pixel_ratio),u_is_halo:new u.aL(h,e.u_is_halo)}),background:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_opacity:new u.aM(h,e.u_opacity),u_color:new u.aR(h,e.u_color)}),backgroundPattern:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_opacity:new u.aM(h,e.u_opacity),u_image:new u.aL(h,e.u_image),u_pattern_tl_a:new u.aQ(h,e.u_pattern_tl_a),u_pattern_br_a:new u.aQ(h,e.u_pattern_br_a),u_pattern_tl_b:new u.aQ(h,e.u_pattern_tl_b),u_pattern_br_b:new u.aQ(h,e.u_pattern_br_b),u_texsize:new u.aQ(h,e.u_texsize),u_mix:new u.aM(h,e.u_mix),u_pattern_size_a:new u.aQ(h,e.u_pattern_size_a),u_pattern_size_b:new u.aQ(h,e.u_pattern_size_b),u_scale_a:new u.aM(h,e.u_scale_a),u_scale_b:new u.aM(h,e.u_scale_b),u_pixel_coord_upper:new u.aQ(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new u.aQ(h,e.u_pixel_coord_lower),u_tile_units_to_pixels:new u.aM(h,e.u_tile_units_to_pixels)}),terrain:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_texture:new u.aL(h,e.u_texture),u_ele_delta:new u.aM(h,e.u_ele_delta)}),terrainDepth:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_ele_delta:new u.aM(h,e.u_ele_delta)}),terrainCoords:(h,e)=>({u_matrix:new u.aN(h,e.u_matrix),u_texture:new u.aL(h,e.u_texture),u_terrain_coords_id:new u.aM(h,e.u_terrain_coords_id),u_ele_delta:new u.aM(h,e.u_ele_delta)})};class Sa{constructor(e,s,n){this.context=e;const l=e.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const s=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),s.bufferSubData(s.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Gs={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ta{constructor(e,s,n,l){this.length=s.length,this.attributes=n,this.itemSize=s.bytesPerElement,this.dynamicDraw=l,this.context=e;const c=e.gl;this.buffer=c.createBuffer(),e.bindVertexBuffer.set(this.buffer),c.bufferData(c.ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const s=this.context.gl;this.bind(),s.bufferSubData(s.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,s){for(let n=0;n<this.attributes.length;n++){const l=s.attributes[this.attributes[n].name];l!==void 0&&e.enableVertexAttribArray(l)}}setVertexAttribPointers(e,s,n){for(let l=0;l<this.attributes.length;l++){const c=this.attributes[l],m=s.attributes[c.name];m!==void 0&&e.vertexAttribPointer(m,c.components,e[Gs[c.type]],!1,this.itemSize,c.offset+this.itemSize*(n||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const vs=new WeakMap;function Dr(h){var e;if(vs.has(h))return vs.get(h);{const s=(e=h.getParameter(h.VERSION))===null||e===void 0?void 0:e.startsWith("WebGL 2.0");return vs.set(h,s),s}}class Xt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Aa extends Xt{getDefault(){return u.aT.transparent}set(e){const s=this.current;(e.r!==s.r||e.g!==s.g||e.b!==s.b||e.a!==s.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class wi extends Xt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class Si extends Xt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class hn extends Xt{getDefault(){return[!0,!0,!0,!0]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||e[2]!==s[2]||e[3]!==s[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Ia extends Xt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class za extends Xt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class cn extends Xt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const s=this.current;(e.func!==s.func||e.ref!==s.ref||e.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class pn extends Xt{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||e[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class Pa extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;e?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=e,this.dirty=!1}}class dn extends Xt{getDefault(){return[0,1]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class fn extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;e?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=e,this.dirty=!1}}class Ca extends Xt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class _o extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;e?s.enable(s.BLEND):s.disable(s.BLEND),this.current=e,this.dirty=!1}}class yo extends Xt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class bs extends Xt{getDefault(){return u.aT.transparent}set(e){const s=this.current;(e.r!==s.r||e.g!==s.g||e.b!==s.b||e.a!==s.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class wl extends Xt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class Sl extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;e?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=e,this.dirty=!1}}class Tl extends Xt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class Al extends Xt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class Il extends Xt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class zl extends Xt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class mn extends Xt{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const s=this.current;(e[0]!==s[0]||e[1]!==s[1]||e[2]!==s[2]||e[3]!==s[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Ea extends Xt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class gn extends Xt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class _n extends Xt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.bindTexture(s.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class ws extends Xt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class xo extends Xt{getDefault(){return null}set(e){const s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class vo extends Xt{getDefault(){return null}set(e){var s;if(e===this.current&&!this.dirty)return;const n=this.gl;Dr(n)?n.bindVertexArray(e):(s=n.getExtension("OES_vertex_array_object"))===null||s===void 0||s.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class yn extends Xt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class Hr extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class bo extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class Lr extends Xt{constructor(e,s){super(e),this.context=e,this.parent=s}getDefault(){return null}}class Ss extends Lr{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class wo extends Lr{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class xn extends Lr{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Qt{constructor(e,s,n,l,c){this.context=e,this.width=s,this.height=n;const m=e.gl,g=this.framebuffer=m.createFramebuffer();if(this.colorAttachment=new Ss(e,g),l)this.depthAttachment=c?new xn(e,g):new wo(e,g);else if(c)throw new Error("Stencil cannot be setted without depth");if(m.checkFramebufferStatus(m.FRAMEBUFFER)!==m.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const e=this.context.gl,s=this.colorAttachment.get();if(s&&e.deleteTexture(s),this.depthAttachment){const n=this.depthAttachment.get();n&&e.deleteRenderbuffer(n)}e.deleteFramebuffer(this.framebuffer)}}class _e{constructor(e,s,n){this.blendFunction=e,this.blendColor=s,this.mask=n}}_e.Replace=[1,0],_e.disabled=new _e(_e.Replace,u.aT.transparent,[!1,!1,!1,!1]),_e.unblended=new _e(_e.Replace,u.aT.transparent,[!0,!0,!0,!0]),_e.alphaBlended=new _e([1,771],u.aT.transparent,[!0,!0,!0,!0]);class Pl{constructor(e){var s,n;if(this.gl=e,this.clearColor=new Aa(this),this.clearDepth=new wi(this),this.clearStencil=new Si(this),this.colorMask=new hn(this),this.depthMask=new Ia(this),this.stencilMask=new za(this),this.stencilFunc=new cn(this),this.stencilOp=new pn(this),this.stencilTest=new Pa(this),this.depthRange=new dn(this),this.depthTest=new fn(this),this.depthFunc=new Ca(this),this.blend=new _o(this),this.blendFunc=new yo(this),this.blendColor=new bs(this),this.blendEquation=new wl(this),this.cullFace=new Sl(this),this.cullFaceSide=new Tl(this),this.frontFace=new Al(this),this.program=new Il(this),this.activeTexture=new zl(this),this.viewport=new mn(this),this.bindFramebuffer=new Ea(this),this.bindRenderbuffer=new gn(this),this.bindTexture=new _n(this),this.bindVertexBuffer=new ws(this),this.bindElementBuffer=new xo(this),this.bindVertexArray=new vo(this),this.pixelStoreUnpack=new yn(this),this.pixelStoreUnpackPremultiplyAlpha=new Hr(this),this.pixelStoreUnpackFlipY=new bo(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),Dr(e)){this.HALF_FLOAT=e.HALF_FLOAT;const l=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(s=e.RGBA16F)!==null&&s!==void 0?s:l==null?void 0:l.RGBA16F_EXT,this.RGB16F=(n=e.RGB16F)!==null&&n!==void 0?n:l==null?void 0:l.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const l=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=l==null?void 0:l.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,s){return new Sa(this,e,s)}createVertexBuffer(e,s,n){return new Ta(this,e,s,n)}createRenderbuffer(e,s,n){const l=this.gl,c=l.createRenderbuffer();return this.bindRenderbuffer.set(c),l.renderbufferStorage(l.RENDERBUFFER,e,s,n),this.bindRenderbuffer.set(null),c}createFramebuffer(e,s,n,l){return new Qt(this,e,s,n,l)}clear({color:e,depth:s,stencil:n}){const l=this.gl;let c=0;e&&(c|=l.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),s!==void 0&&(c|=l.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(s),this.depthMask.set(!0)),n!==void 0&&(c|=l.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),l.clear(c)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){u.aG(e.blendFunction,_e.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return Dr(this.gl)?this.gl.createVertexArray():(e=this.gl.getExtension("OES_vertex_array_object"))===null||e===void 0?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var s;return Dr(this.gl)?this.gl.deleteVertexArray(e):(s=this.gl.getExtension("OES_vertex_array_object"))===null||s===void 0?void 0:s.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}class Ht{constructor(e,s,n){this.func=e,this.mask=s,this.range=n}}Ht.ReadOnly=!1,Ht.ReadWrite=!0,Ht.disabled=new Ht(519,Ht.ReadOnly,[0,1]);const Jr=7680;class ye{constructor(e,s,n,l,c,m){this.test=e,this.ref=s,this.mask=n,this.fail=l,this.depthFail=c,this.pass=m}}ye.disabled=new ye({func:519,mask:0},0,0,Jr,Jr,Jr);class de{constructor(e,s,n){this.enable=e,this.mode=s,this.frontFace=n}}let Zs;function So(h,e,s,n,l,c,m){const g=h.context,y=g.gl,v=h.useProgram("collisionBox"),w=[];let S=0,P=0;for(let N=0;N<n.length;N++){const H=n[N],tt=e.getTile(H),et=tt.getBucket(s);if(!et)continue;let nt=H.posMatrix;l[0]===0&&l[1]===0||(nt=h.translatePosMatrix(H.posMatrix,tt,l,c));const ht=m?et.textCollisionBox:et.iconCollisionBox,ut=et.collisionCircleArray;if(ut.length>0){const pt=u.Z(),At=nt;u.aU(pt,et.placementInvProjMatrix,h.transform.glCoordMatrix),u.aU(pt,pt,et.placementViewportMatrix),w.push({circleArray:ut,circleOffset:P,transform:At,invTransform:pt,coord:H}),S+=ut.length/4,P=S}ht&&v.draw(g,y.LINES,Ht.disabled,ye.disabled,h.colorModeForRenderPass(),de.disabled,an(nt,h.transform,tt),h.style.map.terrain&&h.style.map.terrain.getTerrainData(H),s.id,ht.layoutVertexBuffer,ht.indexBuffer,ht.segments,null,h.transform.zoom,null,null,ht.collisionVertexBuffer)}if(!m||!w.length)return;const L=h.useProgram("collisionCircle"),B=new u.aV;B.resize(4*S),B._trim();let R=0;for(const N of w)for(let H=0;H<N.circleArray.length/4;H++){const tt=4*H,et=N.circleArray[tt+0],nt=N.circleArray[tt+1],ht=N.circleArray[tt+2],ut=N.circleArray[tt+3];B.emplace(R++,et,nt,ht,ut,0),B.emplace(R++,et,nt,ht,ut,1),B.emplace(R++,et,nt,ht,ut,2),B.emplace(R++,et,nt,ht,ut,3)}(!Zs||Zs.length<2*S)&&(Zs=function(N){const H=2*N,tt=new u.aX;tt.resize(H),tt._trim();for(let et=0;et<H;et++){const nt=6*et;tt.uint16[nt+0]=4*et+0,tt.uint16[nt+1]=4*et+1,tt.uint16[nt+2]=4*et+2,tt.uint16[nt+3]=4*et+2,tt.uint16[nt+4]=4*et+3,tt.uint16[nt+5]=4*et+0}return tt}(S));const M=g.createIndexBuffer(Zs,!0),Z=g.createVertexBuffer(B,u.aW.members,!0);for(const N of w){const H={u_matrix:N.transform,u_inv_matrix:N.invTransform,u_camera_to_center_distance:(Y=h.transform).cameraToCenterDistance,u_viewport_size:[Y.width,Y.height]};L.draw(g,y.TRIANGLES,Ht.disabled,ye.disabled,h.colorModeForRenderPass(),de.disabled,H,h.style.map.terrain&&h.style.map.terrain.getTerrainData(N.coord),s.id,Z,M,u.S.simpleSegment(0,2*N.circleOffset,N.circleArray.length,N.circleArray.length/2),null,h.transform.zoom,null,null,null)}var Y;Z.destroy(),M.destroy()}de.disabled=new de(!1,1029,2305),de.backCCW=new de(!0,1029,2305);const vn=u.ao(new Float32Array(16));function ka(h,e,s,n,l,c){const{horizontalAlign:m,verticalAlign:g}=u.au(h);return new u.P((-(m-.5)*e/l+n[0])*c,(-(g-.5)*s/l+n[1])*c)}function Ma(h,e,s,n,l,c,m,g,y,v,w){const S=h.text.placedSymbolArray,P=h.text.dynamicLayoutVertexArray,L=h.icon.dynamicLayoutVertexArray,B={};P.clear();for(let R=0;R<S.length;R++){const M=S.get(R),Z=M.hidden||!M.crossTileID||h.allowVerticalPlacement&&!M.placedOrientation?null:n[M.crossTileID];if(Z){const Y=new u.P(M.anchorX,M.anchorY),N=ve(Y,s?m:c,w),H=Gr(l.cameraToCenterDistance,N.signedDistanceFromCamera);let tt=u.aj(h.textSizeData,y,M)*H/u.ap;s&&(tt*=h.tilePixelRatio/g);const{width:et,height:nt,anchor:ht,textOffset:ut,textBoxScale:pt}=Z,At=ka(ht,et,nt,ut,pt,tt),jt=s?ve(Y.add(At),c,w).point:N.point.add(e?At.rotate(-l.angle):At),_t=h.allowVerticalPlacement&&M.placedOrientation===u.ai.vertical?Math.PI/2:0;for(let Lt=0;Lt<M.numGlyphs;Lt++)u.ak(P,jt,_t);v&&M.associatedIconIndex>=0&&(B[M.associatedIconIndex]={shiftedAnchor:jt,angle:_t})}else k(M.numGlyphs,P)}if(v){L.clear();const R=h.icon.placedSymbolArray;for(let M=0;M<R.length;M++){const Z=R.get(M);if(Z.hidden)k(Z.numGlyphs,L);else{const Y=B[M];if(Y)for(let N=0;N<Z.numGlyphs;N++)u.ak(L,Y.shiftedAnchor,Y.angle);else k(Z.numGlyphs,L)}}h.icon.dynamicLayoutVertexBuffer.updateData(L)}h.text.dynamicLayoutVertexBuffer.updateData(P)}function bn(h,e,s){return s.iconsInText&&e?"symbolTextAndIcon":h?"symbolSDF":"symbolIcon"}function Da(h,e,s,n,l,c,m,g,y,v,w,S){const P=h.context,L=P.gl,B=h.transform,R=g==="map",M=y==="map",Z=g!=="viewport"&&s.layout.get("symbol-placement")!=="point",Y=R&&!M&&!Z,N=!s.layout.get("symbol-sort-key").isConstant();let H=!1;const tt=h.depthModeForSublayer(0,Ht.ReadOnly),et=s._unevaluatedLayout.hasValue("text-variable-anchor")||s._unevaluatedLayout.hasValue("text-variable-anchor-offset"),nt=[];for(const ht of n){const ut=e.getTile(ht),pt=ut.getBucket(s);if(!pt)continue;const At=l?pt.text:pt.icon;if(!At||!At.segments.get().length||!At.hasVisibleVertices)continue;const jt=At.programConfigurations.get(s.id),_t=l||pt.sdfIcons,Lt=l?pt.textSizeData:pt.iconSizeData,zt=M||B.pitch!==0,re=h.useProgram(bn(_t,l,pt),jt),qt=u.ah(Lt,B.zoom),Ut=h.style.map.terrain&&h.style.map.terrain.getTerrainData(ht);let Gt,Te,le,Ge,Le=[0,0],Pe=null;if(l)Te=ut.glyphAtlasTexture,le=L.LINEAR,Gt=ut.glyphAtlasTexture.size,pt.iconsInText&&(Le=ut.imageAtlasTexture.size,Pe=ut.imageAtlasTexture,Ge=zt||h.options.rotating||h.options.zooming||Lt.kind==="composite"||Lt.kind==="camera"?L.LINEAR:L.NEAREST);else{const Ae=s.layout.get("icon-size").constantOr(0)!==1||pt.iconsNeedLinear;Te=ut.imageAtlasTexture,le=_t||h.options.rotating||h.options.zooming||Ae||zt?L.LINEAR:L.NEAREST,Gt=ut.imageAtlasTexture.size}const Ii=G(ut,1,h.transform.zoom),ce=ft(ht.posMatrix,M,R,h.transform,Ii),ir=Qi(ht.posMatrix,M,R,h.transform,Ii),rr=et&&pt.hasTextData(),Rr=s.layout.get("icon-text-fit")!=="none"&&rr&&pt.hasIconData();if(Z){const Ae=h.style.map.terrain?(fi,Ie)=>h.style.map.terrain.getElevation(ht,fi,Ie):null,Be=s.layout.get("text-rotation-alignment")==="map";gt(pt,ht.posMatrix,h,l,ce,ir,M,v,Be,Ae)}const ts=h.translatePosMatrix(ht.posMatrix,ut,c,m),Es=Z||l&&et||Rr?vn:ce,Ke=h.translatePosMatrix(ir,ut,c,m,!0),Ze=_t&&s.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let si;si=_t?pt.iconsInText?Xr(Lt.kind,qt,Y,M,h,ts,Es,Ke,Gt,Le):un(Lt.kind,qt,Y,M,h,ts,Es,Ke,l,Gt,!0):ln(Lt.kind,qt,Y,M,h,ts,Es,Ke,l,Gt);const es={program:re,buffers:At,uniformValues:si,atlasTexture:Te,atlasTextureIcon:Pe,atlasInterpolation:le,atlasInterpolationIcon:Ge,isSDF:_t,hasHalo:Ze};if(N&&pt.canOverlap){H=!0;const Ae=At.segments.get();for(const Be of Ae)nt.push({segments:new u.S([Be]),sortKey:Be.sortKey,state:es,terrainData:Ut})}else nt.push({segments:At.segments,sortKey:0,state:es,terrainData:Ut})}H&&nt.sort((ht,ut)=>ht.sortKey-ut.sortKey);for(const ht of nt){const ut=ht.state;if(P.activeTexture.set(L.TEXTURE0),ut.atlasTexture.bind(ut.atlasInterpolation,L.CLAMP_TO_EDGE),ut.atlasTextureIcon&&(P.activeTexture.set(L.TEXTURE1),ut.atlasTextureIcon&&ut.atlasTextureIcon.bind(ut.atlasInterpolationIcon,L.CLAMP_TO_EDGE)),ut.isSDF){const pt=ut.uniformValues;ut.hasHalo&&(pt.u_is_halo=1,wn(ut.buffers,ht.segments,s,h,ut.program,tt,w,S,pt,ht.terrainData)),pt.u_is_halo=0}wn(ut.buffers,ht.segments,s,h,ut.program,tt,w,S,ut.uniformValues,ht.terrainData)}}function wn(h,e,s,n,l,c,m,g,y,v){const w=n.context;l.draw(w,w.gl.TRIANGLES,c,m,g,de.disabled,y,v,s.id,h.layoutVertexBuffer,h.indexBuffer,e,s.paint,n.transform.zoom,h.programConfigurations.get(s.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function Xs(h,e,s,n,l){if(!s||!n||!n.imageAtlas)return;const c=n.imageAtlas.patternPositions;let m=c[s.to.toString()],g=c[s.from.toString()];if(!m&&g&&(m=g),!g&&m&&(g=m),!m||!g){const y=l.getPaintProperty(e);m=c[y],g=c[y]}m&&g&&h.setConstantPatternPositions(m,g)}function Hs(h,e,s,n,l,c,m){const g=h.context.gl,y="fill-pattern",v=s.paint.get(y),w=v&&v.constantOr(1),S=s.getCrossfadeParameters();let P,L,B,R,M;m?(L=w&&!s.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",P=g.LINES):(L=w?"fillPattern":"fill",P=g.TRIANGLES);const Z=v.constantOr(null);for(const Y of n){const N=e.getTile(Y);if(w&&!N.patternsLoaded())continue;const H=N.getBucket(s);if(!H)continue;const tt=H.programConfigurations.get(s.id),et=h.useProgram(L,tt),nt=h.style.map.terrain&&h.style.map.terrain.getTerrainData(Y);w&&(h.context.activeTexture.set(g.TEXTURE0),N.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),tt.updatePaintBuffers(S)),Xs(tt,y,Z,N,s);const ht=nt?Y:null,ut=h.translatePosMatrix(ht?ht.posMatrix:Y.posMatrix,N,s.paint.get("fill-translate"),s.paint.get("fill-translate-anchor"));if(m){R=H.indexBuffer2,M=H.segments2;const pt=[g.drawingBufferWidth,g.drawingBufferHeight];B=L==="fillOutlinePattern"&&w?xa(ut,h,S,N,pt):ya(ut,pt)}else R=H.indexBuffer,M=H.segments,B=w?sn(ut,h,S,N):uo(ut);et.draw(h.context,P,l,h.stencilModeForClipping(Y),c,de.disabled,B,nt,s.id,H.layoutVertexBuffer,R,M,s.paint,h.transform.zoom,tt)}}function Js(h,e,s,n,l,c,m){const g=h.context,y=g.gl,v="fill-extrusion-pattern",w=s.paint.get(v),S=w.constantOr(1),P=s.getCrossfadeParameters(),L=s.paint.get("fill-extrusion-opacity"),B=w.constantOr(null);for(const R of n){const M=e.getTile(R),Z=M.getBucket(s);if(!Z)continue;const Y=h.style.map.terrain&&h.style.map.terrain.getTerrainData(R),N=Z.programConfigurations.get(s.id),H=h.useProgram(S?"fillExtrusionPattern":"fillExtrusion",N);S&&(h.context.activeTexture.set(y.TEXTURE0),M.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),N.updatePaintBuffers(P)),Xs(N,v,B,M,s);const tt=h.translatePosMatrix(R.posMatrix,M,s.paint.get("fill-extrusion-translate"),s.paint.get("fill-extrusion-translate-anchor")),et=s.paint.get("fill-extrusion-vertical-gradient"),nt=S?kr(tt,h,et,L,R,P,M):rn(tt,h,et,L);H.draw(g,g.gl.TRIANGLES,l,c,m,de.backCCW,nt,Y,s.id,Z.layoutVertexBuffer,Z.indexBuffer,Z.segments,s.paint,h.transform.zoom,N,h.style.map.terrain&&Z.centroidVertexBuffer)}}function Cl(h,e,s,n,l,c,m){const g=h.context,y=g.gl,v=s.fbo;if(!v)return;const w=h.useProgram("hillshade"),S=h.style.map.terrain&&h.style.map.terrain.getTerrainData(e);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,v.colorAttachment.get()),w.draw(g,y.TRIANGLES,l,c,m,de.disabled,((P,L,B,R)=>{const M=B.paint.get("hillshade-shadow-color"),Z=B.paint.get("hillshade-highlight-color"),Y=B.paint.get("hillshade-accent-color");let N=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&(N-=P.transform.angle);const H=!P.options.moving;return{u_matrix:R?R.posMatrix:P.transform.calculatePosMatrix(L.tileID.toUnwrapped(),H),u_image:0,u_latrange:nn(0,L.tileID),u_light:[B.paint.get("hillshade-exaggeration"),N],u_shadow:M,u_highlight:Z,u_accent:Y}})(h,s,n,S?e:null),S,n.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}function Sn(h,e,s,n,l,c){const m=h.context,g=m.gl,y=e.dem;if(y&&y.data){const v=y.dim,w=y.stride,S=y.getPixels();if(m.activeTexture.set(g.TEXTURE1),m.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||h.getTileTexture(w),e.demTexture){const L=e.demTexture;L.update(S,{premultiply:!1}),L.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else e.demTexture=new me(m,S,g.RGBA,{premultiply:!1}),e.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);m.activeTexture.set(g.TEXTURE0);let P=e.fbo;if(!P){const L=new me(m,{width:v,height:v,data:null},g.RGBA);L.bind(g.LINEAR,g.CLAMP_TO_EDGE),P=e.fbo=m.createFramebuffer(v,v,!0,!1),P.colorAttachment.set(L.texture)}m.bindFramebuffer.set(P.framebuffer),m.viewport.set([0,0,v,v]),h.useProgram("hillshadePrepare").draw(m,g.TRIANGLES,n,l,c,de.disabled,((L,B)=>{const R=B.stride,M=u.Z();return u.aS(M,0,u.N,-u.N,0,0,1),u.$(M,M,[0,-u.N,0]),{u_matrix:M,u_image:1,u_dimension:[R,R],u_zoom:L.overscaledZ,u_unpack:B.getUnpackVector()}})(e.tileID,y),null,s.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function El(h,e,s,n,l,c){const m=n.paint.get("raster-fade-duration");if(!c&&m>0){const g=u.h.now(),y=(g-h.timeAdded)/m,v=e?(g-e.timeAdded)/m:-1,w=s.getSource(),S=l.coveringZoomLevel({tileSize:w.tileSize,roundZoom:w.roundZoom}),P=!e||Math.abs(e.tileID.overscaledZ-S)>Math.abs(h.tileID.overscaledZ-S),L=P&&h.refreshedUponExpiration?1:u.ad(P?y:1-v,0,1);return h.refreshedUponExpiration&&y>=1&&(h.refreshedUponExpiration=!1),e?{opacity:1,mix:1-L}:{opacity:L,mix:0}}return{opacity:1,mix:0}}const To=new u.aT(1,0,0,1),La=new u.aT(0,1,0,1),Tn=new u.aT(0,0,1,1),Ao=new u.aT(1,0,1,1),Io=new u.aT(0,1,1,1);function Ks(h,e,s,n){Fa(h,0,e+s/2,h.transform.width,s,n)}function Ba(h,e,s,n){Fa(h,e-s/2,0,s,h.transform.height,n)}function Fa(h,e,s,n,l,c){const m=h.context,g=m.gl;g.enable(g.SCISSOR_TEST),g.scissor(e*h.pixelRatio,s*h.pixelRatio,n*h.pixelRatio,l*h.pixelRatio),m.clear({color:c}),g.disable(g.SCISSOR_TEST)}function zo(h,e,s){const n=h.context,l=n.gl,c=s.posMatrix,m=h.useProgram("debug"),g=Ht.disabled,y=ye.disabled,v=h.colorModeForRenderPass(),w="$debug",S=h.style.map.terrain&&h.style.map.terrain.getTerrainData(s);n.activeTexture.set(l.TEXTURE0);const P=e.getTileByID(s.key).latestRawTileData,L=Math.floor((P&&P.byteLength||0)/1024),B=e.getTile(s).tileSize,R=512/Math.min(B,512)*(s.overscaledZ/h.transform.zoom)*.5;let M=s.canonical.toString();s.overscaledZ!==s.canonical.z&&(M+=` => ${s.overscaledZ}`),function(Z,Y){Z.initDebugOverlayCanvas();const N=Z.debugOverlayCanvas,H=Z.context.gl,tt=Z.debugOverlayCanvas.getContext("2d");tt.clearRect(0,0,N.width,N.height),tt.shadowColor="white",tt.shadowBlur=2,tt.lineWidth=1.5,tt.strokeStyle="white",tt.textBaseline="top",tt.font="bold 36px Open Sans, sans-serif",tt.fillText(Y,5,5),tt.strokeText(Y,5,5),Z.debugOverlayTexture.update(N),Z.debugOverlayTexture.bind(H.LINEAR,H.CLAMP_TO_EDGE)}(h,`${M} ${L}kB`),m.draw(n,l.TRIANGLES,g,y,_e.alphaBlended,de.disabled,js(c,u.aT.transparent,R),null,w,h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments),m.draw(n,l.LINE_STRIP,g,y,v,de.disabled,js(c,u.aT.red),S,w,h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments)}function we(h,e,s){const n=h.context,l=n.gl,c=h.colorModeForRenderPass(),m=new Ht(l.LEQUAL,Ht.ReadWrite,h.depthRangeFor3D),g=h.useProgram("terrain"),y=e.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,h.width,h.height]);for(const v of s){const w=h.renderToTexture.getTexture(v),S=e.getTerrainData(v.tileID);n.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,w.texture);const P={u_matrix:h.transform.calculatePosMatrix(v.tileID.toUnwrapped()),u_texture:0,u_ele_delta:e.getMeshFrameDelta(h.transform.zoom)};g.draw(n,l.TRIANGLES,m,ye.disabled,c,de.backCCW,P,S,"terrain",y.vertexBuffer,y.indexBuffer,y.segments)}}class Kr{constructor(e,s){this.context=new Pl(e),this.transform=s,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:u.Z(),renderTime:0},this.setup(),this.numSublayers=ci.maxUnderzooming+ci.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ma}resize(e,s,n){if(this.width=Math.floor(e*n),this.height=Math.floor(s*n),this.pixelRatio=n,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const l of this.style._order)this.style._layers[l].resize()}setup(){const e=this.context,s=new u.a_;s.emplaceBack(0,0),s.emplaceBack(u.N,0),s.emplaceBack(0,u.N),s.emplaceBack(u.N,u.N),this.tileExtentBuffer=e.createVertexBuffer(s,ga.members),this.tileExtentSegments=u.S.simpleSegment(0,0,4,2);const n=new u.a_;n.emplaceBack(0,0),n.emplaceBack(u.N,0),n.emplaceBack(0,u.N),n.emplaceBack(u.N,u.N),this.debugBuffer=e.createVertexBuffer(n,ga.members),this.debugSegments=u.S.simpleSegment(0,0,4,5);const l=new u.V;l.emplaceBack(0,0,0,0),l.emplaceBack(u.N,0,u.N,0),l.emplaceBack(0,u.N,0,u.N),l.emplaceBack(u.N,u.N,u.N,u.N),this.rasterBoundsBuffer=e.createVertexBuffer(l,qi.members),this.rasterBoundsSegments=u.S.simpleSegment(0,0,4,2);const c=new u.a_;c.emplaceBack(0,0),c.emplaceBack(1,0),c.emplaceBack(0,1),c.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(c,ga.members),this.viewportSegments=u.S.simpleSegment(0,0,4,2);const m=new u.a$;m.emplaceBack(0),m.emplaceBack(1),m.emplaceBack(3),m.emplaceBack(2),m.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(m);const g=new u.b0;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(g);const y=this.context.gl;this.stencilClearMode=new ye({func:y.ALWAYS,mask:0},0,255,y.ZERO,y.ZERO,y.ZERO)}clearStencil(){const e=this.context,s=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const n=u.Z();u.aS(n,0,this.width,this.height,0,0,1),u.a0(n,n,[s.drawingBufferWidth,s.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,s.TRIANGLES,Ht.disabled,this.stencilClearMode,_e.disabled,de.disabled,ho(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,s){if(this.currentStencilSource===e.source||!e.isTileClipped()||!s||!s.length)return;this.currentStencilSource=e.source;const n=this.context,l=n.gl;this.nextStencilID+s.length>256&&this.clearStencil(),n.setColorMode(_e.disabled),n.setDepthMode(Ht.disabled);const c=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const m of s){const g=this._tileClippingMaskIDs[m.key]=this.nextStencilID++,y=this.style.map.terrain&&this.style.map.terrain.getTerrainData(m);c.draw(n,l.TRIANGLES,Ht.disabled,new ye({func:l.ALWAYS,mask:0},g,255,l.KEEP,l.KEEP,l.REPLACE),_e.disabled,de.disabled,ho(m.posMatrix),y,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,s=this.context.gl;return new ye({func:s.NOTEQUAL,mask:255},e,255,s.KEEP,s.KEEP,s.REPLACE)}stencilModeForClipping(e){const s=this.context.gl;return new ye({func:s.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,s.KEEP,s.KEEP,s.REPLACE)}stencilConfigForOverlap(e){const s=this.context.gl,n=e.sort((m,g)=>g.overscaledZ-m.overscaledZ),l=n[n.length-1].overscaledZ,c=n[0].overscaledZ-l+1;if(c>1){this.currentStencilSource=void 0,this.nextStencilID+c>256&&this.clearStencil();const m={};for(let g=0;g<c;g++)m[g+l]=new ye({func:s.GEQUAL,mask:255},g+this.nextStencilID,255,s.KEEP,s.KEEP,s.REPLACE);return this.nextStencilID+=c,[m,n]}return[{[l]:ye.disabled},n]}colorModeForRenderPass(){const e=this.context.gl;return this._showOverdrawInspector?new _e([e.CONSTANT_COLOR,e.ONE],new u.aT(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?_e.unblended:_e.alphaBlended}depthModeForSublayer(e,s,n){if(!this.opaquePassEnabledForLayer())return Ht.disabled;const l=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Ht(n||this.context.gl.LEQUAL,s,[l,l])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,s){this.style=e,this.options=s,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(u.h.now()),this.imageManager.beginFrame();const n=this.style._order,l=this.style.sourceCaches,c={},m={},g={};for(const y in l){const v=l[y];v.used&&v.prepare(this.context),c[y]=v.getVisibleCoordinates(),m[y]=c[y].slice().reverse(),g[y]=v.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let y=0;y<n.length;y++)if(this.style._layers[n[y]].is3D()){this.opaquePassCutoff=y;break}if(this.renderToTexture){this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0;const y=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!u.b1(this.terrainFacilitator.matrix,this.transform.projMatrix)||y.length)&&(u.b2(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(v,w){const S=v.context,P=S.gl,L=_e.unblended,B=new Ht(P.LEQUAL,Ht.ReadWrite,[0,1]),R=w.getTerrainMesh(),M=w.sourceCache.getRenderableTiles(),Z=v.useProgram("terrainDepth");S.bindFramebuffer.set(w.getFramebuffer("depth").framebuffer),S.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),S.clear({color:u.aT.transparent,depth:1});for(const Y of M){const N=w.getTerrainData(Y.tileID),H={u_matrix:v.transform.calculatePosMatrix(Y.tileID.toUnwrapped()),u_ele_delta:w.getMeshFrameDelta(v.transform.zoom)};Z.draw(S,P.TRIANGLES,B,ye.disabled,L,de.backCCW,H,N,"terrain",R.vertexBuffer,R.indexBuffer,R.segments)}S.bindFramebuffer.set(null),S.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain),function(v,w){const S=v.context,P=S.gl,L=_e.unblended,B=new Ht(P.LEQUAL,Ht.ReadWrite,[0,1]),R=w.getTerrainMesh(),M=w.getCoordsTexture(),Z=w.sourceCache.getRenderableTiles(),Y=v.useProgram("terrainCoords");S.bindFramebuffer.set(w.getFramebuffer("coords").framebuffer),S.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),S.clear({color:u.aT.transparent,depth:1}),w.coordsIndex=[];for(const N of Z){const H=w.getTerrainData(N.tileID);S.activeTexture.set(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,M.texture);const tt={u_matrix:v.transform.calculatePosMatrix(N.tileID.toUnwrapped()),u_terrain_coords_id:(255-w.coordsIndex.length)/255,u_texture:0,u_ele_delta:w.getMeshFrameDelta(v.transform.zoom)};Y.draw(S,P.TRIANGLES,B,ye.disabled,L,de.backCCW,tt,H,"terrain",R.vertexBuffer,R.indexBuffer,R.segments),w.coordsIndex.push(N.tileID.key)}S.bindFramebuffer.set(null),S.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain))}this.renderPass="offscreen";for(const y of n){const v=this.style._layers[y];if(!v.hasOffscreenPass()||v.isHidden(this.transform.zoom))continue;const w=m[v.source];(v.type==="custom"||w.length)&&this.renderLayer(this,l[v.source],v,w)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:s.showOverdrawInspector?u.aT.black:u.aT.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=s.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){const y=this.style._layers[n[this.currentLayer]],v=l[y.source],w=c[y.source];this._renderTileClippingMasks(y,w),this.renderLayer(this,v,y,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){const y=this.style._layers[n[this.currentLayer]],v=l[y.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(y))continue;const w=(y.type==="symbol"?g:m)[y.source];this._renderTileClippingMasks(y,c[y.source]),this.renderLayer(this,v,y,w)}if(this.options.showTileBoundaries){const y=function(v,w){let S=null;const P=Object.values(v._layers).flatMap(M=>M.source&&!M.isHidden(w)?[v.sourceCaches[M.source]]:[]),L=P.filter(M=>M.getSource().type==="vector"),B=P.filter(M=>M.getSource().type!=="vector"),R=M=>{(!S||S.getSource().maxzoom<M.getSource().maxzoom)&&(S=M)};return L.forEach(M=>R(M)),S||B.forEach(M=>R(M)),S}(this.style,this.transform.zoom);y&&function(v,w,S){for(let P=0;P<S.length;P++)zo(v,w,S[P])}(this,y,y.getVisibleCoordinates())}this.options.showPadding&&function(y){const v=y.transform.padding;Ks(y,y.transform.height-(v.top||0),3,To),Ks(y,v.bottom||0,3,La),Ba(y,v.left||0,3,Tn),Ba(y,y.transform.width-(v.right||0),3,Ao);const w=y.transform.centerPoint;(function(S,P,L,B){Fa(S,P-1,L-10,2,20,B),Fa(S,P-10,L-1,20,2,B)})(y,w.x,y.transform.height-w.y,Io)}(this),this.context.setDefault()}renderLayer(e,s,n,l){if(!n.isHidden(this.transform.zoom)&&(n.type==="background"||n.type==="custom"||(l||[]).length))switch(this.id=n.id,n.type){case"symbol":(function(c,m,g,y,v){if(c.renderPass!=="translucent")return;const w=ye.disabled,S=c.colorModeForRenderPass();(g._unevaluatedLayout.hasValue("text-variable-anchor")||g._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(P,L,B,R,M,Z,Y){const N=L.transform,H=M==="map",tt=Z==="map";for(const et of P){const nt=R.getTile(et),ht=nt.getBucket(B);if(!ht||!ht.text||!ht.text.segments.get().length)continue;const ut=u.ah(ht.textSizeData,N.zoom),pt=G(nt,1,L.transform.zoom),At=ft(et.posMatrix,tt,H,L.transform,pt),jt=B.layout.get("icon-text-fit")!=="none"&&ht.hasIconData();if(ut){const _t=Math.pow(2,N.zoom-nt.tileID.overscaledZ);Ma(ht,H,tt,Y,N,At,et.posMatrix,_t,ut,jt,L.style.map.terrain?(Lt,zt)=>L.style.map.terrain.getElevation(et,Lt,zt):null)}}}(y,c,g,m,g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),v),g.paint.get("icon-opacity").constantOr(1)!==0&&Da(c,m,g,y,!1,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),g.layout.get("icon-rotation-alignment"),g.layout.get("icon-pitch-alignment"),g.layout.get("icon-keep-upright"),w,S),g.paint.get("text-opacity").constantOr(1)!==0&&Da(c,m,g,y,!0,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.layout.get("text-keep-upright"),w,S),m.map.showCollisionBoxes&&(So(c,m,g,y,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),!0),So(c,m,g,y,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),!1))})(e,s,n,l,this.style.placement.variableOffsets);break;case"circle":(function(c,m,g,y){if(c.renderPass!=="translucent")return;const v=g.paint.get("circle-opacity"),w=g.paint.get("circle-stroke-width"),S=g.paint.get("circle-stroke-opacity"),P=!g.layout.get("circle-sort-key").isConstant();if(v.constantOr(1)===0&&(w.constantOr(1)===0||S.constantOr(1)===0))return;const L=c.context,B=L.gl,R=c.depthModeForSublayer(0,Ht.ReadOnly),M=ye.disabled,Z=c.colorModeForRenderPass(),Y=[];for(let N=0;N<y.length;N++){const H=y[N],tt=m.getTile(H),et=tt.getBucket(g);if(!et)continue;const nt=et.programConfigurations.get(g.id),ht=c.useProgram("circle",nt),ut=et.layoutVertexBuffer,pt=et.indexBuffer,At=c.style.map.terrain&&c.style.map.terrain.getTerrainData(H),jt={programConfiguration:nt,program:ht,layoutVertexBuffer:ut,indexBuffer:pt,uniformValues:Mr(c,H,tt,g),terrainData:At};if(P){const _t=et.segments.get();for(const Lt of _t)Y.push({segments:new u.S([Lt]),sortKey:Lt.sortKey,state:jt})}else Y.push({segments:et.segments,sortKey:0,state:jt})}P&&Y.sort((N,H)=>N.sortKey-H.sortKey);for(const N of Y){const{programConfiguration:H,program:tt,layoutVertexBuffer:et,indexBuffer:nt,uniformValues:ht,terrainData:ut}=N.state;tt.draw(L,B.TRIANGLES,R,M,Z,de.disabled,ht,ut,g.id,et,nt,N.segments,g.paint,c.transform.zoom,H)}})(e,s,n,l);break;case"heatmap":(function(c,m,g,y){if(g.paint.get("heatmap-opacity")!==0)if(c.renderPass==="offscreen"){const v=c.context,w=v.gl,S=ye.disabled,P=new _e([w.ONE,w.ONE],u.aT.transparent,[!0,!0,!0,!0]);(function(L,B,R){const M=L.gl;L.activeTexture.set(M.TEXTURE1),L.viewport.set([0,0,B.width/4,B.height/4]);let Z=R.heatmapFbo;if(Z)M.bindTexture(M.TEXTURE_2D,Z.colorAttachment.get()),L.bindFramebuffer.set(Z.framebuffer);else{const Y=M.createTexture();M.bindTexture(M.TEXTURE_2D,Y),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_S,M.CLAMP_TO_EDGE),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_T,M.CLAMP_TO_EDGE),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_MIN_FILTER,M.LINEAR),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_MAG_FILTER,M.LINEAR),Z=R.heatmapFbo=L.createFramebuffer(B.width/4,B.height/4,!1,!1),function(N,H,tt,et){var nt,ht;const ut=N.gl,pt=(nt=N.HALF_FLOAT)!==null&&nt!==void 0?nt:ut.UNSIGNED_BYTE,At=(ht=N.RGBA16F)!==null&&ht!==void 0?ht:ut.RGBA;ut.texImage2D(ut.TEXTURE_2D,0,At,H.width/4,H.height/4,0,ut.RGBA,pt,null),et.colorAttachment.set(tt)}(L,B,Y,Z)}})(v,c,g),v.clear({color:u.aT.transparent});for(let L=0;L<y.length;L++){const B=y[L];if(m.hasRenderableParent(B))continue;const R=m.getTile(B),M=R.getBucket(g);if(!M)continue;const Z=M.programConfigurations.get(g.id),Y=c.useProgram("heatmap",Z),{zoom:N}=c.transform;Y.draw(v,w.TRIANGLES,Ht.disabled,S,P,de.disabled,vl(B.posMatrix,R,N,g.paint.get("heatmap-intensity")),null,g.id,M.layoutVertexBuffer,M.indexBuffer,M.segments,g.paint,c.transform.zoom,Z)}v.viewport.set([0,0,c.width,c.height])}else c.renderPass==="translucent"&&(c.context.setColorMode(c.colorModeForRenderPass()),function(v,w){const S=v.context,P=S.gl,L=w.heatmapFbo;if(!L)return;S.activeTexture.set(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,L.colorAttachment.get()),S.activeTexture.set(P.TEXTURE1);let B=w.colorRampTexture;B||(B=w.colorRampTexture=new me(S,w.colorRamp,P.RGBA)),B.bind(P.LINEAR,P.CLAMP_TO_EDGE),v.useProgram("heatmapTexture").draw(S,P.TRIANGLES,Ht.disabled,ye.disabled,v.colorModeForRenderPass(),de.disabled,((R,M,Z,Y)=>{const N=u.Z();u.aS(N,0,R.width,R.height,0,0,1);const H=R.context.gl;return{u_matrix:N,u_world:[H.drawingBufferWidth,H.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:M.paint.get("heatmap-opacity")}})(v,w),null,w.id,v.viewportBuffer,v.quadTriangleIndexBuffer,v.viewportSegments,w.paint,v.transform.zoom)}(c,g))})(e,s,n,l);break;case"line":(function(c,m,g,y){if(c.renderPass!=="translucent")return;const v=g.paint.get("line-opacity"),w=g.paint.get("line-width");if(v.constantOr(1)===0||w.constantOr(1)===0)return;const S=c.depthModeForSublayer(0,Ht.ReadOnly),P=c.colorModeForRenderPass(),L=g.paint.get("line-dasharray"),B=g.paint.get("line-pattern"),R=B.constantOr(1),M=g.paint.get("line-gradient"),Z=g.getCrossfadeParameters(),Y=R?"linePattern":L?"lineSDF":M?"lineGradient":"line",N=c.context,H=N.gl;let tt=!0;for(const et of y){const nt=m.getTile(et);if(R&&!nt.patternsLoaded())continue;const ht=nt.getBucket(g);if(!ht)continue;const ut=ht.programConfigurations.get(g.id),pt=c.context.program.get(),At=c.useProgram(Y,ut),jt=tt||At.program!==pt,_t=c.style.map.terrain&&c.style.map.terrain.getTerrainData(et),Lt=B.constantOr(null);if(Lt&&nt.imageAtlas){const qt=nt.imageAtlas,Ut=qt.patternPositions[Lt.to.toString()],Gt=qt.patternPositions[Lt.from.toString()];Ut&&Gt&&ut.setConstantPatternPositions(Ut,Gt)}const zt=_t?et:null,re=R?bl(c,nt,g,Z,zt):L?po(c,nt,g,L,Z,zt):M?co(c,nt,g,ht.lineClipsArray.length,zt):on(c,nt,g,zt);if(R)N.activeTexture.set(H.TEXTURE0),nt.imageAtlasTexture.bind(H.LINEAR,H.CLAMP_TO_EDGE),ut.updatePaintBuffers(Z);else if(L&&(jt||c.lineAtlas.dirty))N.activeTexture.set(H.TEXTURE0),c.lineAtlas.bind(N);else if(M){const qt=ht.gradients[g.id];let Ut=qt.texture;if(g.gradientVersion!==qt.version){let Gt=256;if(g.stepInterpolant){const Te=m.getSource().maxzoom,le=et.canonical.z===Te?Math.ceil(1<<c.transform.maxZoom-et.canonical.z):1;Gt=u.ad(u.aY(ht.maxLineLength/u.N*1024*le),256,N.maxTextureSize)}qt.gradient=u.aZ({expression:g.gradientExpression(),evaluationKey:"lineProgress",resolution:Gt,image:qt.gradient||void 0,clips:ht.lineClipsArray}),qt.texture?qt.texture.update(qt.gradient):qt.texture=new me(N,qt.gradient,H.RGBA),qt.version=g.gradientVersion,Ut=qt.texture}N.activeTexture.set(H.TEXTURE0),Ut.bind(g.stepInterpolant?H.NEAREST:H.LINEAR,H.CLAMP_TO_EDGE)}At.draw(N,H.TRIANGLES,S,c.stencilModeForClipping(et),P,de.disabled,re,_t,g.id,ht.layoutVertexBuffer,ht.indexBuffer,ht.segments,g.paint,c.transform.zoom,ut,ht.layoutVertexBuffer2),tt=!1}})(e,s,n,l);break;case"fill":(function(c,m,g,y){const v=g.paint.get("fill-color"),w=g.paint.get("fill-opacity");if(w.constantOr(1)===0)return;const S=c.colorModeForRenderPass(),P=g.paint.get("fill-pattern"),L=c.opaquePassEnabledForLayer()&&!P.constantOr(1)&&v.constantOr(u.aT.transparent).a===1&&w.constantOr(0)===1?"opaque":"translucent";if(c.renderPass===L){const B=c.depthModeForSublayer(1,c.renderPass==="opaque"?Ht.ReadWrite:Ht.ReadOnly);Hs(c,m,g,y,B,S,!1)}if(c.renderPass==="translucent"&&g.paint.get("fill-antialias")){const B=c.depthModeForSublayer(g.getPaintProperty("fill-outline-color")?2:0,Ht.ReadOnly);Hs(c,m,g,y,B,S,!0)}})(e,s,n,l);break;case"fill-extrusion":(function(c,m,g,y){const v=g.paint.get("fill-extrusion-opacity");if(v!==0&&c.renderPass==="translucent"){const w=new Ht(c.context.gl.LEQUAL,Ht.ReadWrite,c.depthRangeFor3D);if(v!==1||g.paint.get("fill-extrusion-pattern").constantOr(1))Js(c,m,g,y,w,ye.disabled,_e.disabled),Js(c,m,g,y,w,c.stencilModeFor3D(),c.colorModeForRenderPass());else{const S=c.colorModeForRenderPass();Js(c,m,g,y,w,ye.disabled,S)}}})(e,s,n,l);break;case"hillshade":(function(c,m,g,y){if(c.renderPass!=="offscreen"&&c.renderPass!=="translucent")return;const v=c.context,w=c.depthModeForSublayer(0,Ht.ReadOnly),S=c.colorModeForRenderPass(),[P,L]=c.renderPass==="translucent"?c.stencilConfigForOverlap(y):[{},y];for(const B of L){const R=m.getTile(B);R.needsHillshadePrepare!==void 0&&R.needsHillshadePrepare&&c.renderPass==="offscreen"?Sn(c,R,g,w,ye.disabled,S):c.renderPass==="translucent"&&Cl(c,B,R,g,w,P[B.overscaledZ],S)}v.viewport.set([0,0,c.width,c.height])})(e,s,n,l);break;case"raster":(function(c,m,g,y){if(c.renderPass!=="translucent"||g.paint.get("raster-opacity")===0||!y.length)return;const v=c.context,w=v.gl,S=m.getSource(),P=c.useProgram("raster"),L=c.colorModeForRenderPass(),[B,R]=S instanceof Mi?[{},y]:c.stencilConfigForOverlap(y),M=R[R.length-1].overscaledZ,Z=!c.options.moving;for(const Y of R){const N=c.depthModeForSublayer(Y.overscaledZ-M,g.paint.get("raster-opacity")===1?Ht.ReadWrite:Ht.ReadOnly,w.LESS),H=m.getTile(Y);H.registerFadeDuration(g.paint.get("raster-fade-duration"));const tt=m.findLoadedParent(Y,0),et=El(H,tt,m,g,c.transform,c.style.map.terrain);let nt,ht;const ut=g.paint.get("raster-resampling")==="nearest"?w.NEAREST:w.LINEAR;v.activeTexture.set(w.TEXTURE0),H.texture.bind(ut,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST),v.activeTexture.set(w.TEXTURE1),tt?(tt.texture.bind(ut,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST),nt=Math.pow(2,tt.tileID.overscaledZ-H.tileID.overscaledZ),ht=[H.tileID.canonical.x*nt%1,H.tileID.canonical.y*nt%1]):H.texture.bind(ut,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST);const pt=c.style.map.terrain&&c.style.map.terrain.getTerrainData(Y),At=pt?Y:null,jt=At?At.posMatrix:c.transform.calculatePosMatrix(Y.toUnwrapped(),Z),_t=mo(jt,ht||[0,0],nt||1,et,g);S instanceof Mi?P.draw(v,w.TRIANGLES,N,ye.disabled,L,de.disabled,_t,pt,g.id,S.boundsBuffer,c.quadTriangleIndexBuffer,S.boundsSegments):P.draw(v,w.TRIANGLES,N,B[Y.overscaledZ],L,de.disabled,_t,pt,g.id,c.rasterBoundsBuffer,c.quadTriangleIndexBuffer,c.rasterBoundsSegments)}})(e,s,n,l);break;case"background":(function(c,m,g,y){const v=g.paint.get("background-color"),w=g.paint.get("background-opacity");if(w===0)return;const S=c.context,P=S.gl,L=c.transform,B=L.tileSize,R=g.paint.get("background-pattern");if(c.isPatternMissing(R))return;const M=!R&&v.a===1&&w===1&&c.opaquePassEnabledForLayer()?"opaque":"translucent";if(c.renderPass!==M)return;const Z=ye.disabled,Y=c.depthModeForSublayer(0,M==="opaque"?Ht.ReadWrite:Ht.ReadOnly),N=c.colorModeForRenderPass(),H=c.useProgram(R?"backgroundPattern":"background"),tt=y||L.coveringTiles({tileSize:B,terrain:c.style.map.terrain});R&&(S.activeTexture.set(P.TEXTURE0),c.imageManager.bind(c.context));const et=g.getCrossfadeParameters();for(const nt of tt){const ht=y?nt.posMatrix:c.transform.calculatePosMatrix(nt.toUnwrapped()),ut=R?Ri(ht,w,c,R,{tileID:nt,tileSize:B},et):ba(ht,w,v),pt=c.style.map.terrain&&c.style.map.terrain.getTerrainData(nt);H.draw(S,P.TRIANGLES,Y,Z,N,de.disabled,ut,pt,g.id,c.tileExtentBuffer,c.quadTriangleIndexBuffer,c.tileExtentSegments)}})(e,0,n,l);break;case"custom":(function(c,m,g){const y=c.context,v=g.implementation;if(c.renderPass==="offscreen"){const w=v.prerender;w&&(c.setCustomLayerDefaults(),y.setColorMode(c.colorModeForRenderPass()),w.call(v,y.gl,c.transform.customLayerMatrix()),y.setDirty(),c.setBaseState())}else if(c.renderPass==="translucent"){c.setCustomLayerDefaults(),y.setColorMode(c.colorModeForRenderPass()),y.setStencilMode(ye.disabled);const w=v.renderingMode==="3d"?new Ht(c.context.gl.LEQUAL,Ht.ReadWrite,c.depthRangeFor3D):c.depthModeForSublayer(0,Ht.ReadOnly);y.setDepthMode(w),v.render(y.gl,c.transform.customLayerMatrix()),y.setDirty(),c.setBaseState(),y.bindFramebuffer.set(null)}})(e,0,n)}}translatePosMatrix(e,s,n,l,c){if(!n[0]&&!n[1])return e;const m=c?l==="map"?this.transform.angle:0:l==="viewport"?-this.transform.angle:0;if(m){const v=Math.sin(m),w=Math.cos(m);n=[n[0]*w-n[1]*v,n[0]*v+n[1]*w]}const g=[c?n[0]:G(s,n[0],this.transform.zoom),c?n[1]:G(s,n[1],this.transform.zoom),0],y=new Float32Array(16);return u.$(y,e,g),y}saveTileTexture(e){const s=this._tileTextures[e.size[0]];s?s.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const s=this._tileTextures[e];return s&&s.length>0?s.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const s=this.imageManager.getPattern(e.from.toString()),n=this.imageManager.getPattern(e.to.toString());return!s||!n}useProgram(e,s){this.cache=this.cache||{};const n=e+(s?s.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[n]||(this.cache[n]=new _a(this.context,ge[e],s,wa[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[n]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new me(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:s}=this.context.gl;return this.width!==e||this.height!==s}}class pi{constructor(e,s){this.points=e,this.planes=s}static fromInvProjectionMatrix(e,s,n){const l=Math.pow(2,n),c=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(g=>{const y=1/(g=u.ag([],g,e))[3]/s*l;return u.b3(g,g,[y,y,1/g[3],y])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(g=>{const y=function(P,L){var B=L[0],R=L[1],M=L[2],Z=B*B+R*R+M*M;return Z>0&&(Z=1/Math.sqrt(Z)),P[0]=L[0]*Z,P[1]=L[1]*Z,P[2]=L[2]*Z,P}([],function(P,L,B){var R=L[0],M=L[1],Z=L[2],Y=B[0],N=B[1],H=B[2];return P[0]=M*H-Z*N,P[1]=Z*Y-R*H,P[2]=R*N-M*Y,P}([],Ki([],c[g[0]],c[g[1]]),Ki([],c[g[2]],c[g[1]]))),v=-((w=y)[0]*(S=c[g[1]])[0]+w[1]*S[1]+w[2]*S[2]);var w,S;return y.concat(v)});return new pi(c,m)}}class Ts{constructor(e,s){this.min=e,this.max=s,this.center=function(n,l,c){return n[0]=.5*l[0],n[1]=.5*l[1],n[2]=.5*l[2],n}([],function(n,l,c){return n[0]=l[0]+c[0],n[1]=l[1]+c[1],n[2]=l[2]+c[2],n}([],this.min,this.max))}quadrant(e){const s=[e%2==0,e<2],n=Os(this.min),l=Os(this.max);for(let c=0;c<s.length;c++)n[c]=s[c]?this.min[c]:this.center[c],l[c]=s[c]?this.center[c]:this.max[c];return l[2]=this.max[2],new Ts(n,l)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersects(e){const s=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let n=!0;for(let l=0;l<e.planes.length;l++){const c=e.planes[l];let m=0;for(let g=0;g<s.length;g++)u.b4(c,s[g])>=0&&m++;if(m===0)return 0;m!==s.length&&(n=!1)}if(n)return 2;for(let l=0;l<3;l++){let c=Number.MAX_VALUE,m=-Number.MAX_VALUE;for(let g=0;g<e.points.length;g++){const y=e.points[g][l]-this.min[l];c=Math.min(c,y),m=Math.max(m,y)}if(m<0||c>this.max[l]-this.min[l])return 0}return 1}}class Ws{constructor(e=0,s=0,n=0,l=0){if(isNaN(e)||e<0||isNaN(s)||s<0||isNaN(n)||n<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=s,this.left=n,this.right=l}interpolate(e,s,n){return s.top!=null&&e.top!=null&&(this.top=u.B.number(e.top,s.top,n)),s.bottom!=null&&e.bottom!=null&&(this.bottom=u.B.number(e.bottom,s.bottom,n)),s.left!=null&&e.left!=null&&(this.left=u.B.number(e.left,s.left,n)),s.right!=null&&e.right!=null&&(this.right=u.B.number(e.right,s.right,n)),this}getCenter(e,s){const n=u.ad((this.left+e-this.right)/2,0,e),l=u.ad((this.top+s-this.bottom)/2,0,s);return new u.P(n,l)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Ws(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Ra{constructor(e,s,n,l,c){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=c===void 0||!!c,this._minZoom=e||0,this._maxZoom=s||22,this._minPitch=n??0,this._maxPitch=l??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new u.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Ws,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const e=new Ra(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this._minEleveationForCurrentTile=e._minEleveationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new u.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const s=-u.b5(e,-180,180)*Math.PI/180;this.angle!==s&&(this._unmodified=!1,this.angle=s,this._calcMatrices(),this.rotationMatrix=function(){var n=new u.A(4);return u.A!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n}(),function(n,l,c){var m=l[0],g=l[1],y=l[2],v=l[3],w=Math.sin(c),S=Math.cos(c);n[0]=m*S+y*w,n[1]=g*S+v*w,n[2]=m*-w+y*S,n[3]=g*-w+v*S}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const s=u.ad(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==s&&(this._unmodified=!1,this._pitch=s,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const s=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==s&&(this._unmodified=!1,this._zoom=s,this.tileZoom=Math.max(0,Math.floor(s)),this.scale=this.zoomScale(s),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,s,n){this._unmodified=!1,this._edgeInsets.interpolate(e,s,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const s=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,s)}getVisibleUnwrappedCoordinates(e){const s=[new u.b6(0,e)];if(this._renderWorldCopies){const n=this.pointCoordinate(new u.P(0,0)),l=this.pointCoordinate(new u.P(this.width,0)),c=this.pointCoordinate(new u.P(this.width,this.height)),m=this.pointCoordinate(new u.P(0,this.height)),g=Math.floor(Math.min(n.x,l.x,c.x,m.x)),y=Math.floor(Math.max(n.x,l.x,c.x,m.x)),v=1;for(let w=g-v;w<=y+v;w++)w!==0&&s.push(new u.b6(w,e))}return s}coveringTiles(e){var s,n;let l=this.coveringZoomLevel(e);const c=l;if(e.minzoom!==void 0&&l<e.minzoom)return[];e.maxzoom!==void 0&&l>e.maxzoom&&(l=e.maxzoom);const m=this.pointCoordinate(this.getCameraPoint()),g=u.U.fromLngLat(this.center),y=Math.pow(2,l),v=[y*m.x,y*m.y,0],w=[y*g.x,y*g.y,0],S=pi.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,l);let P=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(P=l);const L=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,B=N=>({aabb:new Ts([N*y,0,0],[(N+1)*y,y,0]),zoom:0,x:0,y:0,wrap:N,fullyVisible:!1}),R=[],M=[],Z=l,Y=e.reparseOverscaled?c:l;if(this._renderWorldCopies)for(let N=1;N<=3;N++)R.push(B(-N)),R.push(B(N));for(R.push(B(0));R.length>0;){const N=R.pop(),H=N.x,tt=N.y;let et=N.fullyVisible;if(!et){const At=N.aabb.intersects(S);if(At===0)continue;et=At===2}const nt=e.terrain?v:w,ht=N.aabb.distanceX(nt),ut=N.aabb.distanceY(nt),pt=Math.max(Math.abs(ht),Math.abs(ut));if(N.zoom===Z||pt>L+(1<<Z-N.zoom)-2&&N.zoom>=P){const At=Z-N.zoom,jt=v[0]-.5-(H<<At),_t=v[1]-.5-(tt<<At);M.push({tileID:new u.O(N.zoom===Z?Y:N.zoom,N.wrap,N.zoom,H,tt),distanceSq:Vs([w[0]-.5-H,w[1]-.5-tt]),tileDistanceToCamera:Math.sqrt(jt*jt+_t*_t)})}else for(let At=0;At<4;At++){const jt=(H<<1)+At%2,_t=(tt<<1)+(At>>1),Lt=N.zoom+1;let zt=N.aabb.quadrant(At);if(e.terrain){const re=new u.O(Lt,N.wrap,Lt,jt,_t),qt=e.terrain.getMinMaxElevation(re),Ut=(s=qt.minElevation)!==null&&s!==void 0?s:this.elevation,Gt=(n=qt.maxElevation)!==null&&n!==void 0?n:this.elevation;zt=new Ts([zt.min[0],zt.min[1],Ut],[zt.max[0],zt.max[1],Gt])}R.push({aabb:zt,zoom:Lt,x:jt,y:_t,wrap:N.wrap,fullyVisible:et})}}return M.sort((N,H)=>N.distanceSq-H.distanceSq).map(N=>N.tileID)}resize(e,s){this.width=e,this.height=s,this.pixelsToGLUnits=[2/e,-2/s],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const s=u.ad(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new u.P(u.G(e.lng)*this.worldSize,u.H(s)*this.worldSize)}unproject(e){return new u.U(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){const s=this.pointLocation(this.centerPoint,e),n=e.getElevationForLngLatZoom(s,this.tileZoom);if(!(this.elevation-n))return;const l=this.getCameraPosition(),c=u.U.fromLngLat(l.lngLat,l.altitude),m=u.U.fromLngLat(s,n),g=c.x-m.x,y=c.y-m.y,v=c.z-m.z,w=Math.sqrt(g*g+y*y+v*v),S=this.scaleZoom(this.cameraToCenterDistance/w/this.tileSize);this._elevation=n,this._center=s,this.zoom=S}setLocationAtPoint(e,s){const n=this.pointCoordinate(s),l=this.pointCoordinate(this.centerPoint),c=this.locationCoordinate(e),m=new u.U(c.x-(n.x-l.x),c.y-(n.y-l.y));this.center=this.coordinateLocation(m),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,s){return s?this.coordinatePoint(this.locationCoordinate(e),s.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,s){return this.coordinateLocation(this.pointCoordinate(e,s))}locationCoordinate(e){return u.U.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,s){if(s){const P=s.pointCoordinate(e);if(P!=null)return P}const n=[e.x,e.y,0,1],l=[e.x,e.y,1,1];u.ag(n,n,this.pixelMatrixInverse),u.ag(l,l,this.pixelMatrixInverse);const c=n[3],m=l[3],g=n[1]/c,y=l[1]/m,v=n[2]/c,w=l[2]/m,S=v===w?0:(0-v)/(w-v);return new u.U(u.B.number(n[0]/c,l[0]/m,S)/this.worldSize,u.B.number(g,y,S)/this.worldSize)}coordinatePoint(e,s=0,n=this.pixelMatrix){const l=[e.x*this.worldSize,e.y*this.worldSize,s,1];return u.ag(l,l,n),new u.P(l[0]/l[3],l[1]/l[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return new ue().extend(this.pointLocation(new u.P(0,e))).extend(this.pointLocation(new u.P(this.width,e))).extend(this.pointLocation(new u.P(this.width,this.height))).extend(this.pointLocation(new u.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ue([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(e,s=!1){const n=e.key,l=s?this._alignedPosMatrixCache:this._posMatrixCache;if(l[n])return l[n];const c=e.canonical,m=this.worldSize/this.zoomScale(c.z),g=c.x+Math.pow(2,c.z)*e.wrap,y=u.ao(new Float64Array(16));return u.$(y,y,[g*m,c.y*m,0]),u.a0(y,y,[m/u.N,m/u.N,1]),u.a1(y,s?this.alignedProjMatrix:this.projMatrix,y),l[n]=new Float32Array(y),l[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let e,s,n,l,c=-90,m=90,g=-180,y=180;const v=this.size,w=this._unmodified;if(this.latRange){const L=this.latRange;c=u.H(L[1])*this.worldSize,m=u.H(L[0])*this.worldSize,e=m-c<v.y?v.y/(m-c):0}if(this.lngRange){const L=this.lngRange;g=u.b5(u.G(L[0])*this.worldSize,0,this.worldSize),y=u.b5(u.G(L[1])*this.worldSize,0,this.worldSize),y<g&&(y+=this.worldSize),s=y-g<v.x?v.x/(y-g):0}const S=this.point,P=Math.max(s||0,e||0);if(P)return this.center=this.unproject(new u.P(s?(y+g)/2:S.x,e?(m+c)/2:S.y)),this.zoom+=this.scaleZoom(P),this._unmodified=w,void(this._constraining=!1);if(this.latRange){const L=S.y,B=v.y/2;L-B<c&&(l=c+B),L+B>m&&(l=m-B)}if(this.lngRange){const L=(g+y)/2,B=u.b5(S.x,L-this.worldSize/2,L+this.worldSize/2),R=v.x/2;B-R<g&&(n=g+R),B+R>y&&(n=y-R)}n===void 0&&l===void 0||(this.center=this.unproject(new u.P(n!==void 0?n:S.x,l!==void 0?l:S.y)).wrap()),this._unmodified=w,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,s=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=u.b7(1,this.center.lat)*this.worldSize;let l=u.ao(new Float64Array(16));u.a0(l,l,[this.width/2,-this.height/2,1]),u.$(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=u.ao(new Float64Array(16)),u.a0(l,l,[1,-1,1]),u.$(l,l,[-1,-1,0]),u.a0(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l;const c=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),m=Math.min(this.elevation,this._minEleveationForCurrentTile),g=c-m*this._pixelPerMeter/Math.cos(this._pitch),y=m<0?g:c,v=Math.PI/2+this._pitch,w=this._fov*(.5+e.y/this.height),S=Math.sin(w)*y/Math.sin(u.ad(Math.PI-v-w,.01,Math.PI-.01)),P=this.getHorizon(),L=2*Math.atan(P/this.cameraToCenterDistance)*(.5+e.y/(2*P)),B=Math.sin(L)*y/Math.sin(u.ad(Math.PI-v-L,.01,Math.PI-.01)),R=Math.min(S,B),M=1.01*(Math.cos(Math.PI/2-this._pitch)*R+y),Z=this.height/50;l=new Float64Array(16),u.b8(l,this._fov,this.width/this.height,Z,M),l[8]=2*-e.x/this.width,l[9]=2*e.y/this.height,u.a0(l,l,[1,-1,1]),u.$(l,l,[0,0,-this.cameraToCenterDistance]),u.b9(l,l,this._pitch),u.ae(l,l,this.angle),u.$(l,l,[-s,-n,0]),this.mercatorMatrix=u.a0([],l,[this.worldSize,this.worldSize,this.worldSize]),u.a0(l,l,[1,1,this._pixelPerMeter]),this.pixelMatrix=u.a1(new Float64Array(16),this.labelPlaneMatrix,l),u.$(l,l,[0,0,-this.elevation]),this.projMatrix=l,this.invProjMatrix=u.as([],l),this.pixelMatrix3D=u.a1(new Float64Array(16),this.labelPlaneMatrix,l);const Y=this.width%2/2,N=this.height%2/2,H=Math.cos(this.angle),tt=Math.sin(this.angle),et=s-Math.round(s)+H*Y+tt*N,nt=n-Math.round(n)+H*N+tt*Y,ht=new Float64Array(l);if(u.$(ht,ht,[et>.5?et-1:et,nt>.5?nt-1:nt,0]),this.alignedProjMatrix=ht,l=u.as(new Float64Array(16),this.pixelMatrix),!l)throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new u.P(0,0)),s=[e.x*this.worldSize,e.y*this.worldSize,0,1];return u.ag(s,s,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.P(0,e))}getCameraQueryGeometry(e){const s=this.getCameraPoint();if(e.length===1)return[e[0],s];{let n=s.x,l=s.y,c=s.x,m=s.y;for(const g of e)n=Math.min(n,g.x),l=Math.min(l,g.y),c=Math.max(c,g.x),m=Math.max(m,g.y);return[new u.P(n,l),new u.P(c,l),new u.P(c,m),new u.P(n,m),new u.P(n,l)]}}}function Wr(h,e){let s,n=!1,l=null,c=null;const m=()=>{l=null,n&&(h.apply(c,s),l=setTimeout(m,e),n=!1)};return(...g)=>(n=!0,c=this,s=g,l||m(),l)}class Ys{constructor(e){this._getCurrentHash=()=>{const s=window.location.hash.replace("#","");if(this._hashName){let n;return s.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(n=l)}),(n&&n[1]||"").split("/")}return s.split("/")},this._onHashChange=()=>{const s=this._getCurrentHash();if(s.length>=3&&!s.some(n=>isNaN(n))){const n=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(s[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:n,pitch:+(s[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const s=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,s)}catch{}},this._updateHash=Wr(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(e){const s=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,l=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),c=Math.pow(10,l),m=Math.round(s.lng*c)/c,g=Math.round(s.lat*c)/c,y=this._map.getBearing(),v=this._map.getPitch();let w="";if(w+=e?`/${m}/${g}/${n}`:`${n}/${g}/${m}`,(y||v)&&(w+="/"+Math.round(10*y)/10),v&&(w+=`/${Math.round(v)}`),this._hashName){const S=this._hashName;let P=!1;const L=window.location.hash.slice(1).split("&").map(B=>{const R=B.split("=")[0];return R===S?(P=!0,`${R}=${w}`):B}).filter(B=>B);return P||L.push(`${S}=${w}`),`#${L.join("&")}`}return`#${w}`}}const As={linearity:.3,easing:u.ba(0,0,.3,1)},Po=u.e({deceleration:2500,maxSpeed:1400},As),Co=u.e({deceleration:20,maxSpeed:1400},As),Eo=u.e({deceleration:1e3,maxSpeed:360},As),ko=u.e({deceleration:1e3,maxSpeed:90},As);class Mo{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.h.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,s=u.h.now();for(;e.length>0&&s-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const s={zoom:0,bearing:0,pitch:0,pan:new u.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:c}of this._inertiaBuffer)s.zoom+=c.zoomDelta||0,s.bearing+=c.bearingDelta||0,s.pitch+=c.pitchDelta||0,c.panDelta&&s.pan._add(c.panDelta),c.around&&(s.around=c.around),c.pinchAround&&(s.pinchAround=c.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(s.pan.mag()){const c=Qs(s.pan.mag(),n,u.e({},Po,e||{}));l.offset=s.pan.mult(c.amount/s.pan.mag()),l.center=this._map.transform.center,er(l,c)}if(s.zoom){const c=Qs(s.zoom,n,Co);l.zoom=this._map.transform.zoom+c.amount,er(l,c)}if(s.bearing){const c=Qs(s.bearing,n,Eo);l.bearing=this._map.transform.bearing+u.ad(c.amount,-179,179),er(l,c)}if(s.pitch){const c=Qs(s.pitch,n,ko);l.pitch=this._map.transform.pitch+c.amount,er(l,c)}if(l.zoom||l.bearing){const c=s.pinchAround===void 0?s.around:s.pinchAround;l.around=c?this._map.unproject(c):this._map.getCenter()}return this.clear(),u.e(l,{noMoveStart:!0})}}function er(h,e){(!h.duration||h.duration<e.duration)&&(h.duration=e.duration,h.easing=e.easing)}function Qs(h,e,s){const{maxSpeed:n,linearity:l,deceleration:c}=s,m=u.ad(h*l/(e/1e3),-n,n),g=Math.abs(m)/(c*l);return{easing:s.easing,duration:1e3*g,amount:m*(g/2)}}class Ti extends u.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,s,n,l={}){const c=it.mousePos(s.getCanvasContainer(),n),m=s.unproject(c);super(e,u.e({point:c,lngLat:m,originalEvent:n},l)),this._defaultPrevented=!1,this.target=s}}class ta extends u.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,s,n){const l=e==="touchend"?n.changedTouches:n.touches,c=it.touchPos(s.getCanvasContainer(),l),m=c.map(y=>s.unproject(y)),g=c.reduce((y,v,w,S)=>y.add(v.div(S.length)),new u.P(0,0));super(e,{points:c,point:g,lngLats:m,lngLat:s.unproject(g),originalEvent:n}),this._defaultPrevented=!1}}class Do extends u.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,s,n){super(e,{originalEvent:n}),this._defaultPrevented=!1}}class Lo{constructor(e,s){this._map=e,this._clickTolerance=s.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new Do(e.type,this._map,e))}mousedown(e,s){return this._mousedownPos=s,this._firePreventable(new Ti(e.type,this._map,e))}mouseup(e){this._map.fire(new Ti(e.type,this._map,e))}click(e,s){this._mousedownPos&&this._mousedownPos.dist(s)>=this._clickTolerance||this._map.fire(new Ti(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Ti(e.type,this._map,e))}mouseover(e){this._map.fire(new Ti(e.type,this._map,e))}mouseout(e){this._map.fire(new Ti(e.type,this._map,e))}touchstart(e){return this._firePreventable(new ta(e.type,this._map,e))}touchmove(e){this._map.fire(new ta(e.type,this._map,e))}touchend(e){this._map.fire(new ta(e.type,this._map,e))}touchcancel(e){this._map.fire(new ta(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Bo{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Ti(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ti("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Ti(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class fr{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(u.P.convert(e),this._map.terrain)}}class Fo{constructor(e,s){this._map=e,this._tr=new fr(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=s.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,s){this.isEnabled()&&e.shiftKey&&e.button===0&&(it.disableDrag(),this._startPos=this._lastPos=s,this._active=!0)}mousemoveWindow(e,s){if(!this._active)return;const n=s;if(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=n,this._box||(this._box=it.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const c=Math.min(l.x,n.x),m=Math.max(l.x,n.x),g=Math.min(l.y,n.y),y=Math.max(l.y,n.y);it.setTransform(this._box,`translate(${c}px,${g}px)`),this._box.style.width=m-c+"px",this._box.style.height=y-g+"px"}mouseupWindow(e,s){if(!this._active||e.button!==0)return;const n=this._startPos,l=s;if(this.reset(),it.suppressClick(),n.x!==l.x||n.y!==l.y)return this._map.fire(new u.k("boxzoomend",{originalEvent:e})),{cameraAnimation:c=>c.fitScreenCoordinates(n,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(it.remove(this._box),this._box=null),it.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,s){return this._map.fire(new u.k(e,{originalEvent:s}))}}function Oi(h,e){if(h.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${h.length}, points ${e.length}`);const s={};for(let n=0;n<h.length;n++)s[h[n].identifier]=e[n];return s}class mr{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,s,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(l){const c=new u.P(0,0);for(const m of l)c._add(m);return c.div(l.length)}(s),this.touches=Oi(n,s)))}touchmove(e,s,n){if(this.aborted||!this.centroid)return;const l=Oi(n,s);for(const c in this.touches){const m=l[c];(!m||m.dist(this.touches[c])>30)&&(this.aborted=!0)}}touchend(e,s,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class Oa{constructor(e){this.singleTap=new mr(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,s,n){this.singleTap.touchstart(e,s,n)}touchmove(e,s,n){this.singleTap.touchmove(e,s,n)}touchend(e,s,n){const l=this.singleTap.touchend(e,s,n);if(l){const c=e.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(l)<30;if(c&&m||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class gr{constructor(e){this._tr=new fr(e),this._zoomIn=new Oa({numTouches:1,numTaps:2}),this._zoomOut=new Oa({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,s,n){this._zoomIn.touchstart(e,s,n),this._zoomOut.touchstart(e,s,n)}touchmove(e,s,n){this._zoomIn.touchmove(e,s,n),this._zoomOut.touchmove(e,s,n)}touchend(e,s,n){const l=this._zoomIn.touchend(e,s,n),c=this._zoomOut.touchend(e,s,n),m=this._tr;return l?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom+1,around:m.unproject(l)},{originalEvent:e})}):c?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom-1,around:m.unproject(c)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class _r{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const s=this._moveFunction(...e);if(s.bearingDelta||s.pitchDelta||s.around||s.panDelta)return this._active=!0,s}dragStart(e,s){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=s.length?s[0]:s,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,s){if(!this.isEnabled())return;const n=this._lastPoint;if(!n)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const l=s.length?s[0]:s;return!this._moved&&l.dist(n)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(n,l))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&it.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const kl={0:1,2:2};class An{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const s=it.mouseButton(e);this._eventButton=s}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(s,n){const l=kl[n];return s.buttons===void 0||(s.buttons&l)!==l}(e,this._eventButton)}isValidEndEvent(e){return it.mouseButton(e)===this._eventButton}}class Ro{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}const Va=h=>{h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=function(e){e.preventDefault()}},Is=({enable:h,clickTolerance:e,bearingDegreesPerPixelMoved:s=.8})=>{const n=new An({checkCorrectEvent:l=>it.mouseButton(l)===0&&l.ctrlKey||it.mouseButton(l)===2});return new _r({clickTolerance:e,move:(l,c)=>({bearingDelta:(c.x-l.x)*s}),moveStateManager:n,enable:h,assignEvents:Va})},yr=({enable:h,clickTolerance:e,pitchDegreesPerPixelMoved:s=-.5})=>{const n=new An({checkCorrectEvent:l=>it.mouseButton(l)===0&&l.ctrlKey||it.mouseButton(l)===2});return new _r({clickTolerance:e,move:(l,c)=>({pitchDelta:(c.y-l.y)*s}),moveStateManager:n,enable:h,assignEvents:Va})};class wt{constructor(e,s){this._minTouches=e.cooperativeGestures?2:1,this._clickTolerance=e.clickTolerance||1,this._map=s,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new u.P(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(e,s,n){return this._calculateTransform(e,s,n)}touchmove(e,s,n){if(this._map._cooperativeGestures&&(this._minTouches===2&&n.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(e,!1,n.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(n.length<this._minTouches))return e.preventDefault(),this._calculateTransform(e,s,n)}touchend(e,s,n){this._calculateTransform(e,s,n),this._active&&n.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,s,n){n.length>0&&(this._active=!0);const l=Oi(n,s),c=new u.P(0,0),m=new u.P(0,0);let g=0;for(const v in l){const w=l[v],S=this._touches[v];S&&(c._add(w),m._add(w.sub(S)),g++,l[v]=w)}if(this._touches=l,g<this._minTouches||!m.mag())return;const y=m.div(g);return this._sum._add(y),this._sum.mag()<this._clickTolerance?void 0:{around:c.div(g),panDelta:y}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ua{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,s,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([s[0],s[1]]))}touchmove(e,s,n){if(!this._firstTwoTouches)return;e.preventDefault();const[l,c]=this._firstTwoTouches,m=Br(n,s,l),g=Br(n,s,c);if(!m||!g)return;const y=this._aroundCenter?null:m.add(g).div(2);return this._move([m,g],y,e)}touchend(e,s,n){if(!this._firstTwoTouches)return;const[l,c]=this._firstTwoTouches,m=Br(n,s,l),g=Br(n,s,c);m&&g||(this._active&&it.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Br(h,e,s){for(let n=0;n<h.length;n++)if(h[n].identifier===s)return e[n]}function zs(h,e){return Math.log(h/e)/Math.LN2}class Oo extends Ua{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,s){const n=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(zs(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:zs(this._distance,n),pinchAround:s}}}function vt(h,e){return 180*h.angleWith(e)/Math.PI}class In extends Ua{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,s){const n=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:vt(this._vector,n),pinchAround:s}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const s=25/(Math.PI*this._minDiameter)*360,n=vt(e,this._startVector);return Math.abs(n)<s}}function zn(h){return Math.abs(h.y)>Math.abs(h.x)}class Ml extends Ua{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,s,n){super.touchstart(e,s,n),this._currentTouchCount=n.length}_start(e){this._lastPoints=e,zn(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,s,n){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const l=e[0].sub(this._lastPoints[0]),c=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,c,n.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(l.y+c.y)/2*-.5}):void 0}gestureBeginsVertically(e,s,n){if(this._valid!==void 0)return this._valid;const l=e.mag()>=2,c=s.mag()>=2;if(!l&&!c)return;if(!l||!c)return this._firstMove===void 0&&(this._firstMove=n),n-this._firstMove<100&&void 0;const m=e.y>0==s.y>0;return zn(e)&&zn(s)&&m}}const Pn={panStep:100,bearingStep:15,pitchStep:10};class Vo{constructor(e){this._tr=new fr(e);const s=Pn;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let s=0,n=0,l=0,c=0,m=0;switch(e.keyCode){case 61:case 107:case 171:case 187:s=1;break;case 189:case 109:case 173:s=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),c=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),c=1);break;case 38:e.shiftKey?l=1:(e.preventDefault(),m=-1);break;case 40:e.shiftKey?l=-1:(e.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(n=0,l=0),{cameraAnimation:g=>{const y=this._tr;g.easeTo({duration:300,easeId:"keyboardHandler",easing:Uo,zoom:s?Math.round(y.zoom)+s*(e.shiftKey?2:1):y.zoom,bearing:y.bearing+n*this._bearingStep,pitch:y.pitch+l*this._pitchStep,offset:[-c*this._panStep,-m*this._panStep],center:y.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Uo(h){return h*(2-h)}const No=4.000244140625;class Dl{constructor(e,s){this._onTimeout=n=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(n)},this._map=e,this._tr=new fr(e),this._el=e.getCanvasContainer(),this._triggerRenderFrame=s,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(e){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!e[this._map._metaKey])return;e.preventDefault()}let s=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const n=u.h.now(),l=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,s!==0&&s%No==0?this._type="wheel":s!==0&&Math.abs(s)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=s,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(l*s)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,s+=this._lastValue)),e.shiftKey&&s&&(s/=4),this._type&&(this._lastWheelEvent=e,this._delta-=s,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const s=it.mousePos(this._el,e),n=this._tr;this._around=u.L.convert(this._aroundCenter?n.center:n.unproject(s)),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(this._delta!==0){const g=this._type==="wheel"&&Math.abs(this._delta)>No?this._wheelZoomRate:this._defaultZoomRate;let y=2/(1+Math.exp(-Math.abs(this._delta*g)));this._delta<0&&y!==0&&(y=1/y);const v=typeof this._targetZoom=="number"?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(v*y))),this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const s=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,n=this._startZoom,l=this._easing;let c,m=!1;if(this._type==="wheel"&&n&&l){const g=Math.min((u.h.now()-this._lastWheelEventTime)/200,1),y=l(g);c=u.B.number(n,s,y),g<1?this._frameId||(this._frameId=!0):m=!0}else c=s,m=!0;return this._active=!0,m&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!m,zoomDelta:c-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let s=u.bb;if(this._prevEase){const n=this._prevEase,l=(u.h.now()-n.start)/n.duration,c=n.easing(l+.01)-n.easing(l),m=.27/Math.sqrt(c*c+1e-4)*.01,g=Math.sqrt(.0729-m*m);s=u.ba(m,g,.25,1)}return this._prevEase={start:u.h.now(),duration:e,easing:s},s}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Cn{constructor(e,s){this._clickZoom=e,this._tapZoom=s}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class En{constructor(e){this._tr=new fr(e),this.reset()}reset(){this._active=!1}dblclick(e,s){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(s)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class kn{constructor(){this._tap=new Oa({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,s,n){if(!this._swipePoint)if(this._tapTime){const l=s[0],c=e.timeStamp-this._tapTime<500,m=this._tapPoint.dist(l)<30;c&&m?n.length>0&&(this._swipePoint=l,this._swipeTouch=n[0].identifier):this.reset()}else this._tap.touchstart(e,s,n)}touchmove(e,s,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;const l=s[0],c=l.y-this._swipePoint.y;return this._swipePoint=l,e.preventDefault(),this._active=!0,{zoomDelta:c/128}}}else this._tap.touchmove(e,s,n)}touchend(e,s,n){if(this._tapTime)this._swipePoint&&n.length===0&&this.reset();else{const l=this._tap.touchend(e,s,n);l&&(this._tapTime=e.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Mn{constructor(e,s,n){this._el=e,this._mousePan=s,this._touchPan=n}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class di{constructor(e,s,n){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=s,this._mousePitch=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Fr{constructor(e,s,n,l){this._el=e,this._touchZoom=s,this._touchRotate=n,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const ea=h=>h.zoom||h.drag||h.pitch||h.rotate;class Dn extends u.k{}function ia(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}class Ln{constructor(e,s){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,c)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const m=l.type==="renderFrame"?void 0:l,g={needsRenderFrame:!1},y={},v={},w=l.touches,S=w?this._getMapTouches(w):void 0,P=S?it.touchPos(this._el,S):it.mousePos(this._el,l);for(const{handlerName:R,handler:M,allowed:Z}of this._handlers){if(!M.isEnabled())continue;let Y;this._blockedByActive(v,Z,R)?M.reset():M[c||l.type]&&(Y=M[c||l.type](l,P,S),this.mergeHandlerResult(g,y,Y,R,m),Y&&Y.needsRenderFrame&&this._triggerRenderFrame()),(Y||M.isActive())&&(v[R]=M)}const L={};for(const R in this._previousActiveHandlers)v[R]||(L[R]=m);this._previousActiveHandlers=v,(Object.keys(L).length||ia(g))&&(this._changes.push([g,y,L]),this._triggerRenderFrame()),(Object.keys(v).length||ia(g))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:B}=g;B&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],B(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Mo(e),this._bearingSnap=s.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(s);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,c,m]of this._listeners)it.addEventListener(l,c,l===document?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(const[e,s,n]of this._listeners)it.removeEventListener(e,s,e===document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(e){const s=this._map,n=s.getCanvasContainer();this._add("mapEvent",new Lo(s,e));const l=s.boxZoom=new Fo(s,e);this._add("boxZoom",l),e.interactive&&e.boxZoom&&l.enable();const c=new gr(s),m=new En(s);s.doubleClickZoom=new Cn(m,c),this._add("tapZoom",c),this._add("clickZoom",m),e.interactive&&e.doubleClickZoom&&s.doubleClickZoom.enable();const g=new kn;this._add("tapDragZoom",g);const y=s.touchPitch=new Ml(s);this._add("touchPitch",y),e.interactive&&e.touchPitch&&s.touchPitch.enable(e.touchPitch);const v=Is(e),w=yr(e);s.dragRotate=new di(e,v,w),this._add("mouseRotate",v,["mousePitch"]),this._add("mousePitch",w,["mouseRotate"]),e.interactive&&e.dragRotate&&s.dragRotate.enable();const S=(({enable:Z,clickTolerance:Y})=>{const N=new An({checkCorrectEvent:H=>it.mouseButton(H)===0&&!H.ctrlKey});return new _r({clickTolerance:Y,move:(H,tt)=>({around:tt,panDelta:tt.sub(H)}),activateOnStart:!0,moveStateManager:N,enable:Z,assignEvents:Va})})(e),P=new wt(e,s);s.dragPan=new Mn(n,S,P),this._add("mousePan",S),this._add("touchPan",P,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&s.dragPan.enable(e.dragPan);const L=new In,B=new Oo;s.touchZoomRotate=new Fr(n,B,L,g),this._add("touchRotate",L,["touchPan","touchZoom"]),this._add("touchZoom",B,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&s.touchZoomRotate.enable(e.touchZoomRotate);const R=s.scrollZoom=new Dl(s,()=>this._triggerRenderFrame());this._add("scrollZoom",R,["mousePan"]),e.interactive&&e.scrollZoom&&s.scrollZoom.enable(e.scrollZoom);const M=s.keyboard=new Vo(s);this._add("keyboard",M),e.interactive&&e.keyboard&&s.keyboard.enable(),this._add("blockableMapEvent",new Bo(s))}_add(e,s,n){this._handlers.push({handlerName:e,handler:s,allowed:n}),this._handlersById[e]=s}stop(e){if(!this._updatingCamera){for(const{handler:s}of this._handlers)s.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ea(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,s,n){for(const l in e)if(l!==n&&(!s||s.indexOf(l)<0))return!0;return!1}_getMapTouches(e){const s=[];for(const n of e)this._el.contains(n.target)&&s.push(n);return s}mergeHandlerResult(e,s,n,l,c){if(!n)return;u.e(e,n);const m={handlerName:l,originalEvent:n.originalEvent||c};n.zoomDelta!==void 0&&(s.zoom=m),n.panDelta!==void 0&&(s.drag=m),n.pitchDelta!==void 0&&(s.pitch=m),n.bearingDelta!==void 0&&(s.rotate=m)}_applyChanges(){const e={},s={},n={};for(const[l,c,m]of this._changes)l.panDelta&&(e.panDelta=(e.panDelta||new u.P(0,0))._add(l.panDelta)),l.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+l.pitchDelta),l.around!==void 0&&(e.around=l.around),l.pinchAround!==void 0&&(e.pinchAround=l.pinchAround),l.noInertia&&(e.noInertia=l.noInertia),u.e(s,c),u.e(n,m);this._updateMapTransform(e,s,n),this._changes=[]}_updateMapTransform(e,s,n){const l=this._map,c=l._getTransformForUpdate(),m=l.terrain;if(!(ia(e)||m&&this._terrainMovement))return this._fireEvents(s,n,!0);let{panDelta:g,zoomDelta:y,bearingDelta:v,pitchDelta:w,around:S,pinchAround:P}=e;P!==void 0&&(S=P),l._stop(!0),S=S||l.transform.centerPoint;const L=c.pointLocation(g?S.sub(g):S);v&&(c.bearing+=v),w&&(c.pitch+=w),y&&(c.zoom+=y),m?this._terrainMovement||!s.drag&&!s.zoom?s.drag&&this._terrainMovement?c.center=c.pointLocation(c.centerPoint.sub(g)):c.setLocationAtPoint(L,S):(this._terrainMovement=!0,this._map._elevationFreeze=!0,c.setLocationAtPoint(L,S),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,c.recalculateZoom(l.terrain)})):c.setLocationAtPoint(L,S),l._applyUpdatedTransform(c),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(s,n,!0)}_fireEvents(e,s,n){const l=ea(this._eventsInProgress),c=ea(e),m={};for(const w in e){const{originalEvent:S}=e[w];this._eventsInProgress[w]||(m[`${w}start`]=S),this._eventsInProgress[w]=e[w]}!l&&c&&this._fireEvent("movestart",c.originalEvent);for(const w in m)this._fireEvent(w,m[w]);c&&this._fireEvent("move",c.originalEvent);for(const w in e){const{originalEvent:S}=e[w];this._fireEvent(w,S)}const g={};let y;for(const w in this._eventsInProgress){const{handlerName:S,originalEvent:P}=this._eventsInProgress[w];this._handlersById[S].isActive()||(delete this._eventsInProgress[w],y=s[S]||P,g[`${w}end`]=y)}for(const w in g)this._fireEvent(w,g[w]);const v=ea(this._eventsInProgress);if(n&&(l||c)&&!v){this._updatingCamera=!0;const w=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),S=P=>P!==0&&-this._bearingSnap<P&&P<this._bearingSnap;!w||!w.essential&&u.h.prefersReducedMotion?(this._map.fire(new u.k("moveend",{originalEvent:y})),S(this._map.getBearing())&&this._map.resetNorth()):(S(w.bearing||this._map.getBearing())&&(w.bearing=0),w.freezeElevation=!0,this._map.easeTo(w,{originalEvent:y})),this._updatingCamera=!1}}_fireEvent(e,s){this._map.fire(new u.k(e,s?{originalEvent:s}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new Dn("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class $o extends u.E{constructor(e,s){super(),this._renderFrameCallback=()=>{const n=Math.min((u.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=s.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new u.L(this.transform.center.lng,this.transform.center.lat)}setCenter(e,s){return this.jumpTo({center:e},s)}panBy(e,s,n){return e=u.P.convert(e).mult(-1),this.panTo(this.transform.center,u.e({offset:e},s),n)}panTo(e,s,n){return this.easeTo(u.e({center:e},s),n)}getZoom(){return this.transform.zoom}setZoom(e,s){return this.jumpTo({zoom:e},s),this}zoomTo(e,s,n){return this.easeTo(u.e({zoom:e},s),n)}zoomIn(e,s){return this.zoomTo(this.getZoom()+1,e,s),this}zoomOut(e,s){return this.zoomTo(this.getZoom()-1,e,s),this}getBearing(){return this.transform.bearing}setBearing(e,s){return this.jumpTo({bearing:e},s),this}getPadding(){return this.transform.padding}setPadding(e,s){return this.jumpTo({padding:e},s),this}rotateTo(e,s,n){return this.easeTo(u.e({bearing:e},s),n)}resetNorth(e,s){return this.rotateTo(0,u.e({duration:1e3},e),s),this}resetNorthPitch(e,s){return this.easeTo(u.e({bearing:0,pitch:0,duration:1e3},e),s),this}snapToNorth(e,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,s):this}getPitch(){return this.transform.pitch}setPitch(e,s){return this.jumpTo({pitch:e},s),this}cameraForBounds(e,s){e=ue.convert(e);const n=s&&s.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,s)}_cameraForBoxAndBearing(e,s,n,l){const c={top:0,bottom:0,right:0,left:0};if(typeof(l=u.e({padding:c,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){const tt=l.padding;l.padding={top:tt,bottom:tt,right:tt,left:tt}}l.padding=u.e(c,l.padding);const m=this.transform,g=m.padding,y=m.project(u.L.convert(e)),v=m.project(u.L.convert(s)),w=y.rotate(-n*Math.PI/180),S=v.rotate(-n*Math.PI/180),P=new u.P(Math.max(w.x,S.x),Math.max(w.y,S.y)),L=new u.P(Math.min(w.x,S.x),Math.min(w.y,S.y)),B=P.sub(L),R=(m.width-(g.left+g.right+l.padding.left+l.padding.right))/B.x,M=(m.height-(g.top+g.bottom+l.padding.top+l.padding.bottom))/B.y;if(M<0||R<0)return void u.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const Z=Math.min(m.scaleZoom(m.scale*Math.min(R,M)),l.maxZoom),Y=u.P.convert(l.offset),N=new u.P((l.padding.left-l.padding.right)/2,(l.padding.top-l.padding.bottom)/2).rotate(n*Math.PI/180),H=Y.add(N).mult(m.scale/m.zoomScale(Z));return{center:m.unproject(y.add(v).div(2).sub(H)),zoom:Z,bearing:n}}fitBounds(e,s,n){return this._fitInternal(this.cameraForBounds(e,s),s,n)}fitScreenCoordinates(e,s,n,l,c){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(u.P.convert(e)),this.transform.pointLocation(u.P.convert(s)),n,l),l,c)}_fitInternal(e,s,n){return e?(delete(s=u.e(e,s)).padding,s.linear?this.easeTo(s,n):this.flyTo(s,n)):this}jumpTo(e,s){this.stop();const n=this._getTransformForUpdate();let l=!1,c=!1,m=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(l=!0,n.zoom=+e.zoom),e.center!==void 0&&(n.center=u.L.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(c=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(m=!0,n.pitch=+e.pitch),e.padding==null||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this._applyUpdatedTransform(n),this.fire(new u.k("movestart",s)).fire(new u.k("move",s)),l&&this.fire(new u.k("zoomstart",s)).fire(new u.k("zoom",s)).fire(new u.k("zoomend",s)),c&&this.fire(new u.k("rotatestart",s)).fire(new u.k("rotate",s)).fire(new u.k("rotateend",s)),m&&this.fire(new u.k("pitchstart",s)).fire(new u.k("pitch",s)).fire(new u.k("pitchend",s)),this.fire(new u.k("moveend",s))}calculateCameraOptionsFromTo(e,s,n,l=0){const c=u.U.fromLngLat(e,s),m=u.U.fromLngLat(n,l),g=m.x-c.x,y=m.y-c.y,v=m.z-c.z,w=Math.hypot(g,y,v);if(w===0)throw new Error("Can't calculate camera options with same From and To");const S=Math.hypot(g,y),P=this.transform.scaleZoom(this.transform.cameraToCenterDistance/w/this.transform.tileSize),L=180*Math.atan2(g,-y)/Math.PI;let B=180*Math.acos(S/w)/Math.PI;return B=v<0?90-B:90+B,{center:m.toLngLat(),zoom:P,pitch:B,bearing:L}}easeTo(e,s){this._stop(!1,e.easeId),((e=u.e({offset:[0,0],duration:500,easing:u.bb},e)).animate===!1||!e.essential&&u.h.prefersReducedMotion)&&(e.duration=0);const n=this._getTransformForUpdate(),l=this.getZoom(),c=this.getBearing(),m=this.getPitch(),g=this.getPadding(),y="zoom"in e?+e.zoom:l,v="bearing"in e?this._normalizeBearing(e.bearing,c):c,w="pitch"in e?+e.pitch:m,S="padding"in e?e.padding:n.padding,P=u.P.convert(e.offset);let L=n.centerPoint.add(P);const B=n.pointLocation(L),R=u.L.convert(e.center||B);this._normalizeCenter(R);const M=n.project(B),Z=n.project(R).sub(M),Y=n.zoomScale(y-l);let N,H;e.around&&(N=u.L.convert(e.around),H=n.locationPoint(N));const tt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==l,this._rotating=this._rotating||c!==v,this._pitching=this._pitching||w!==m,this._padding=!n.isPaddingEqual(S),this._easeId=e.easeId,this._prepareEase(s,e.noMoveStart,tt),this.terrain&&this._prepareElevation(R),this._ease(et=>{if(this._zooming&&(n.zoom=u.B.number(l,y,et)),this._rotating&&(n.bearing=u.B.number(c,v,et)),this._pitching&&(n.pitch=u.B.number(m,w,et)),this._padding&&(n.interpolatePadding(g,S,et),L=n.centerPoint.add(P)),this.terrain&&!e.freezeElevation&&this._updateElevation(et),N)n.setLocationAtPoint(N,H);else{const nt=n.zoomScale(n.zoom-l),ht=y>l?Math.min(2,Y):Math.max(.5,Y),ut=Math.pow(ht,1-et),pt=n.unproject(M.add(Z.mult(et*ut)).mult(nt));n.setLocationAtPoint(n.renderWorldCopies?pt.wrap():pt,L)}this._applyUpdatedTransform(n),this._fireMoveEvents(s)},et=>{this.terrain&&this._finalizeElevation(),this._afterEase(s,et)},e),this}_prepareEase(e,s,n={}){this._moving=!0,s||n.moving||this.fire(new u.k("movestart",e)),this._zooming&&!n.zooming&&this.fire(new u.k("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new u.k("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new u.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const s=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&s!==this._elevationTarget){const n=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(n-(s-(n*e+this._elevationStart))/(1-e)),this._elevationTarget=s}this.transform.elevation=u.B.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(e){if(!this.transformCameraUpdate)return;const s=e.clone(),{center:n,zoom:l,pitch:c,bearing:m,elevation:g}=this.transformCameraUpdate(s);n&&(s.center=n),l!==void 0&&(s.zoom=l),c!==void 0&&(s.pitch=c),m!==void 0&&(s.bearing=m),g!==void 0&&(s.elevation=g),this.transform.apply(s)}_fireMoveEvents(e){this.fire(new u.k("move",e)),this._zooming&&this.fire(new u.k("zoom",e)),this._rotating&&this.fire(new u.k("rotate",e)),this._pitching&&this.fire(new u.k("pitch",e))}_afterEase(e,s){if(this._easeId&&s&&this._easeId===s)return;delete this._easeId;const n=this._zooming,l=this._rotating,c=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new u.k("zoomend",e)),l&&this.fire(new u.k("rotateend",e)),c&&this.fire(new u.k("pitchend",e)),this.fire(new u.k("moveend",e))}flyTo(e,s){if(!e.essential&&u.h.prefersReducedMotion){const zt=u.F(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(zt,s)}this.stop(),e=u.e({offset:[0,0],speed:1.2,curve:1.42,easing:u.bb},e);const n=this._getTransformForUpdate(),l=this.getZoom(),c=this.getBearing(),m=this.getPitch(),g=this.getPadding(),y="zoom"in e?u.ad(+e.zoom,n.minZoom,n.maxZoom):l,v="bearing"in e?this._normalizeBearing(e.bearing,c):c,w="pitch"in e?+e.pitch:m,S="padding"in e?e.padding:n.padding,P=n.zoomScale(y-l),L=u.P.convert(e.offset);let B=n.centerPoint.add(L);const R=n.pointLocation(B),M=u.L.convert(e.center||R);this._normalizeCenter(M);const Z=n.project(R),Y=n.project(M).sub(Z);let N=e.curve;const H=Math.max(n.width,n.height),tt=H/P,et=Y.mag();if("minZoom"in e){const zt=u.ad(Math.min(e.minZoom,l,y),n.minZoom,n.maxZoom),re=H/n.zoomScale(zt-l);N=Math.sqrt(re/et*2)}const nt=N*N;function ht(zt){const re=(tt*tt-H*H+(zt?-1:1)*nt*nt*et*et)/(2*(zt?tt:H)*nt*et);return Math.log(Math.sqrt(re*re+1)-re)}function ut(zt){return(Math.exp(zt)-Math.exp(-zt))/2}function pt(zt){return(Math.exp(zt)+Math.exp(-zt))/2}const At=ht(!1);let jt=function(zt){return pt(At)/pt(At+N*zt)},_t=function(zt){return H*((pt(At)*(ut(re=At+N*zt)/pt(re))-ut(At))/nt)/et;var re},Lt=(ht(!0)-At)/N;if(Math.abs(et)<1e-6||!isFinite(Lt)){if(Math.abs(H-tt)<1e-6)return this.easeTo(e,s);const zt=tt<H?-1:1;Lt=Math.abs(Math.log(tt/H))/N,_t=function(){return 0},jt=function(re){return Math.exp(zt*N*re)}}return e.duration="duration"in e?+e.duration:1e3*Lt/("screenSpeed"in e?+e.screenSpeed/N:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=c!==v,this._pitching=w!==m,this._padding=!n.isPaddingEqual(S),this._prepareEase(s,!1),this.terrain&&this._prepareElevation(M),this._ease(zt=>{const re=zt*Lt,qt=1/jt(re);n.zoom=zt===1?y:l+n.scaleZoom(qt),this._rotating&&(n.bearing=u.B.number(c,v,zt)),this._pitching&&(n.pitch=u.B.number(m,w,zt)),this._padding&&(n.interpolatePadding(g,S,zt),B=n.centerPoint.add(L)),this.terrain&&!e.freezeElevation&&this._updateElevation(zt);const Ut=zt===1?M:n.unproject(Z.add(Y.mult(_t(re))).mult(qt));n.setLocationAtPoint(n.renderWorldCopies?Ut.wrap():Ut,B),this._applyUpdatedTransform(n),this._fireMoveEvents(s)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(s)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const n=this._onEaseEnd;delete this._onEaseEnd,n.call(this,s)}if(!e){const n=this.handlers;n&&n.stop(!1)}return this}_ease(e,s,n){n.animate===!1||n.duration===0?(e(1),s()):(this._easeStart=u.h.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,s){e=u.b5(e,-180,180);const n=Math.abs(e-s);return Math.abs(e-360-s)<n&&(e-=360),Math.abs(e+360-s)<n&&(e+=360),e}_normalizeCenter(e){const s=this.transform;if(!s.renderWorldCopies||s.lngRange)return;const n=e.lng-s.center.lng;e.lng+=n>180?-360:n<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(u.L.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}class Ai{constructor(e={}){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=s=>{!s||s.sourceDataType!=="metadata"&&s.sourceDataType!=="visibility"&&s.dataType!=="style"&&s.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options&&this.options.compact,this._container=it.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=it.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=it.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){it.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,s){const n=this._map._getUIString(`AttributionControl.${s}`);e.title=n,e.setAttribute("aria-label",n)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const s=this._map.style.sourceCaches;for(const l in s){const c=s[l];if(c.used||c.usedForTerrain){const m=c.getSource();m.attribution&&e.indexOf(m.attribution)<0&&e.push(m.attribution)}}e=e.filter(l=>String(l).trim()),e.sort((l,c)=>l.length-c.length),e=e.filter((l,c)=>{for(let m=c+1;m<e.length;m++)if(e[m].indexOf(l)>=0)return!1;return!0});const n=e.join(" | ");n!==this._attribHTML&&(this._attribHTML=n,e.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class he{constructor(e={}){this._updateCompact=()=>{const s=this._container.children;if(s.length){const n=s[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&n.classList.add("maplibregl-compact"):n.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=it.create("div","maplibregl-ctrl");const s=it.create("a","maplibregl-ctrl-logo");return s.target="_blank",s.rel="noopener nofollow",s.href="https://maplibre.org/",s.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),s.setAttribute("rel","noopener nofollow"),this._container.appendChild(s),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){it.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Na{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const s=++this._id;return this._queue.push({callback:e,id:s,cancelled:!1}),s}remove(e){const s=this._currentlyRunning,n=s?this._queue.concat(s):this._queue;for(const l of n)if(l.id===e)return void(l.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const s=this._currentlyRunning=this._queue;this._queue=[];for(const n of s)if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Bn={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var qo=u.Q([{name:"a_pos3d",type:"Int16",components:3}]);class jo extends u.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,s){this.sourceCache.update(e,s),this._renderableTilesKeys=[];const n={};for(const l of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:s}))n[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.posMatrix=new Float64Array(16),u.aS(l.posMatrix,0,u.N,0,u.N,0,1),this._tiles[l.key]=new Cr(l,this.tileSize));for(const l in this._tiles)n[l]||delete this._tiles[l]}freeRtt(e){for(const s in this._tiles){const n=this._tiles[s];(!e||n.tileID.equals(e)||n.tileID.isChildOf(e)||e.isChildOf(n.tileID))&&(n.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const s={};for(const n of this._renderableTilesKeys){const l=this._tiles[n].tileID;if(l.canonical.equals(e.canonical)){const c=e.clone();c.posMatrix=new Float64Array(16),u.aS(c.posMatrix,0,u.N,0,u.N,0,1),s[n]=c}else if(l.canonical.isChildOf(e.canonical)){const c=e.clone();c.posMatrix=new Float64Array(16);const m=l.canonical.z-e.canonical.z,g=l.canonical.x-(l.canonical.x>>m<<m),y=l.canonical.y-(l.canonical.y>>m<<m),v=u.N>>m;u.aS(c.posMatrix,0,v,0,v,0,1),u.$(c.posMatrix,c.posMatrix,[-g*v,-y*v,0]),s[n]=c}else if(e.canonical.isChildOf(l.canonical)){const c=e.clone();c.posMatrix=new Float64Array(16);const m=e.canonical.z-l.canonical.z,g=e.canonical.x-(e.canonical.x>>m<<m),y=e.canonical.y-(e.canonical.y>>m<<m),v=u.N>>m;u.aS(c.posMatrix,0,u.N,0,u.N,0,1),u.$(c.posMatrix,c.posMatrix,[g*v,y*v,0]),u.a0(c.posMatrix,c.posMatrix,[1/2**m,1/2**m,0]),s[n]=c}}return s}getSourceTile(e,s){const n=this.sourceCache._source;let l=e.overscaledZ-this.deltaZoom;if(l>n.maxzoom&&(l=n.maxzoom),l<n.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(l).key);let c=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!c||!c.dem)&&s)for(;l>=n.minzoom&&(!c||!c.dem);)c=this.sourceCache.getTileByID(e.scaledTo(l--).key);return c}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(s=>s.timeAdded>=e)}}class Go{constructor(e,s,n){this.painter=e,this.sourceCache=new jo(s),this.options=n,this.exaggeration=typeof n.exaggeration=="number"?n.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,s,n,l=u.N){var c;if(!(s>=0&&s<l&&n>=0&&n<l))return 0;const m=this.getTerrainData(e),g=(c=m.tile)===null||c===void 0?void 0:c.dem;if(!g)return 0;const y=function(B,R,M){var Z=R[0],Y=R[1];return B[0]=M[0]*Z+M[4]*Y+M[12],B[1]=M[1]*Z+M[5]*Y+M[13],B}([],[s/l*u.N,n/l*u.N],m.u_terrain_matrix),v=[y[0]*g.dim,y[1]*g.dim],w=Math.floor(v[0]),S=Math.floor(v[1]),P=v[0]-w,L=v[1]-S;return g.get(w,S)*(1-P)*(1-L)+g.get(w+1,S)*P*(1-L)+g.get(w,S+1)*(1-P)*L+g.get(w+1,S+1)*P*L}getElevationForLngLatZoom(e,s){const{tileID:n,mercatorX:l,mercatorY:c}=this._getOverscaledTileIDFromLngLatZoom(e,s);return this.getElevation(n,l%u.N,c%u.N,u.N)}getElevation(e,s,n,l=u.N){return this.getDEMElevation(e,s,n,l)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const l=this.painter.context,c=new u.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new me(l,c,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new me(l,new u.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=u.ao([])}const s=this.sourceCache.getSourceTile(e,!0);if(s&&s.dem&&(!s.demTexture||s.needsTerrainPrepare)){const l=this.painter.context;s.demTexture=this.painter.getTileTexture(s.dem.stride),s.demTexture?s.demTexture.update(s.dem.getPixels(),{premultiply:!1}):s.demTexture=new me(l,s.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),s.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),s.needsTerrainPrepare=!1}const n=s&&s+s.tileID.key+e.key;if(n&&!this._demMatrixCache[n]){const l=this.sourceCache.sourceCache._source.maxzoom;let c=e.canonical.z-s.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=l?c=e.canonical.z-l:u.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const m=e.canonical.x-(e.canonical.x>>c<<c),g=e.canonical.y-(e.canonical.y>>c<<c),y=u.bc(new Float64Array(16),[1/(u.N<<c),1/(u.N<<c),0]);u.$(y,y,[m*u.N,g*u.N,0]),this._demMatrixCache[e.key]={matrix:y,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:s&&s.dem&&s.dem.dim||1,u_terrain_matrix:n?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:s&&s.dem&&s.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(s&&s.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:s}}getFramebuffer(e){const s=this.painter,n=s.width/devicePixelRatio,l=s.height/devicePixelRatio;return!this._fbo||this._fbo.width===n&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new me(s.context,{width:n,height:l,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new me(s.context,{width:n,height:l,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=s.context.createFramebuffer(n,l,!0,!1),this._fbo.depthAttachment.set(s.context.createRenderbuffer(s.context.gl.DEPTH_COMPONENT16,n,l))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const s=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let c=0,m=0;c<this._coordsTextureSize;c++)for(let g=0;g<this._coordsTextureSize;g++,m+=4)s[m+0]=255&g,s[m+1]=255&c,s[m+2]=g>>8<<4|c>>8,s[m+3]=0;const n=new u.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(s.buffer)),l=new me(e,n,e.gl.RGBA,{premultiply:!1});return l.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(e){const s=new Uint8Array(4),n=this.painter.context,l=n.gl;n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,s),n.bindFramebuffer.set(null);const c=s[0]+(s[2]>>4<<8),m=s[1]+((15&s[2])<<8),g=this.coordsIndex[255-s[3]],y=g&&this.sourceCache.getTileByID(g);if(!y)return null;const v=this._coordsTextureSize,w=(1<<y.tileID.canonical.z)*v;return new u.U(this._allowMercatorOverflow(e,(y.tileID.canonical.x*v+c)/w),(y.tileID.canonical.y*v+m)/w,this.getElevation(y.tileID,c,m,v))}getTerrainMesh(){if(this._mesh)return this._mesh;const e=this.painter.context,s=new u.bd,n=new u.b0,l=this.meshSize,c=u.N/l,m=l*l;for(let S=0;S<=l;S++)for(let P=0;P<=l;P++)s.emplaceBack(P*c,S*c,0);for(let S=0;S<m;S+=l+1)for(let P=0;P<l;P++)n.emplaceBack(P+S,l+P+S+1,l+P+S+2),n.emplaceBack(P+S,l+P+S+2,P+S+1);const g=s.length,y=g+2*(l+1);for(const S of[0,1])for(let P=0;P<=l;P++)for(const L of[0,1])s.emplaceBack(P*c,S*u.N,L);for(let S=0;S<2*l;S+=2)n.emplaceBack(y+S,y+S+1,y+S+3),n.emplaceBack(y+S,y+S+3,y+S+2),n.emplaceBack(g+S,g+S+3,g+S+1),n.emplaceBack(g+S,g+S+2,g+S+3);const v=s.length,w=v+2*(l+1);for(const S of[0,1])for(let P=0;P<=l;P++)for(const L of[0,1])s.emplaceBack(S*u.N,P*c,L);for(let S=0;S<2*l;S+=2)n.emplaceBack(v+S,v+S+1,v+S+3),n.emplaceBack(v+S,v+S+3,v+S+2),n.emplaceBack(w+S,w+S+3,w+S+1),n.emplaceBack(w+S,w+S+2,w+S+3);return this._mesh={indexBuffer:e.createIndexBuffer(n),vertexBuffer:e.createVertexBuffer(s,qo.members),segments:u.S.simpleSegment(0,0,s.length,n.length)},this._mesh}getMeshFrameDelta(e){return 2*Math.PI*u.be/Math.pow(2,e)/5}getMinTileElevationForLngLatZoom(e,s){var n;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(e,s);return(n=this.getMinMaxElevation(l).minElevation)!==null&&n!==void 0?n:0}getMinMaxElevation(e){const s=this.getTerrainData(e).tile,n={minElevation:null,maxElevation:null};return s&&s.dem&&(n.minElevation=s.dem.min*this.exaggeration,n.maxElevation=s.dem.max*this.exaggeration),n}_getOverscaledTileIDFromLngLatZoom(e,s){const n=u.U.fromLngLat(e.wrap()),l=(1<<s)*u.N,c=n.x*l,m=n.y*l,g=Math.floor(c/u.N),y=Math.floor(m/u.N);return{tileID:new u.O(s,0,s,g,y),mercatorX:c,mercatorY:m}}_allowMercatorOverflow(e,s){const n=e.x<this.painter.width/2;let l=u.bf(s);const c=this.painter.transform.center.lng;return n&&Math.sign(l)>0&&Math.sign(c)<0||!n&&Math.sign(l)<0&&Math.sign(c)>0?(l=360*Math.sign(c)+l,u.G(l)):s}}class Ll{constructor(e,s,n){this._context=e,this._size=s,this._tileSize=n,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const s=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),n=new me(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return n.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),s.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),s.colorAttachment.set(n.texture),{id:e,fbo:s,texture:n,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(s=>e.id!==s),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const s of this._recentlyUsed)if(!this._objects[s].inUse)return this._objects[s];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(e=>!e.inUse)===!1}}const ri={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class $a{constructor(e,s){this.painter=e,this.terrain=s,this.pool=new Ll(e.context,30,s.sourceCache.tileSize*s.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,s){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(n=>!e._layers[n].isHidden(s)),this._coordsDescendingInv={};for(const n in e.sourceCaches){this._coordsDescendingInv[n]={};const l=e.sourceCaches[n].getVisibleCoordinates();for(const c of l){const m=this.terrain.sourceCache.getTerrainCoords(c);for(const g in m)this._coordsDescendingInv[n][g]||(this._coordsDescendingInv[n][g]=[]),this._coordsDescendingInv[n][g].push(m[g])}}this._coordsDescendingInvStr={};for(const n of e._order){const l=e._layers[n],c=l.source;if(ri[l.type]&&!this._coordsDescendingInvStr[c]){this._coordsDescendingInvStr[c]={};for(const m in this._coordsDescendingInv[c])this._coordsDescendingInvStr[c][m]=this._coordsDescendingInv[c][m].map(g=>g.key).sort().join()}}for(const n of this._renderableTiles)for(const l in this._coordsDescendingInvStr){const c=this._coordsDescendingInvStr[l][n.tileID.key];c&&c!==n.rttCoords[l]&&(n.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;const s=e.type,n=this.painter,l=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(ri[s]&&(this._prevType&&ri[this._prevType]||this._stacks.push([]),this._prevType=s,this._stacks[this._stacks.length-1].push(e.id),!l))return!0;if(ri[this._prevType]||ri[s]&&l){this._prevType=s;const c=this._stacks.length-1,m=this._stacks[c]||[];for(const g of this._renderableTiles){if(this.pool.isFull()&&(we(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(g),g.rtt[c]){const v=this.pool.getObjectForId(g.rtt[c].id);if(v.stamp===g.rtt[c].stamp){this.pool.useObject(v);continue}}const y=this.pool.getOrCreateFreeObject();this.pool.useObject(y),this.pool.stampObject(y),g.rtt[c]={id:y.id,stamp:y.stamp},n.context.bindFramebuffer.set(y.fbo.framebuffer),n.context.clear({color:u.aT.transparent,stencil:0}),n.currentStencilSource=void 0;for(let v=0;v<m.length;v++){const w=n.style._layers[m[v]],S=w.source?this._coordsDescendingInv[w.source][g.tileID.key]:[g.tileID];n.context.viewport.set([0,0,y.fbo.width,y.fbo.height]),n._renderTileClippingMasks(w,S),n.renderLayer(n,n.style.sourceCaches[w.source],w,S),w.source&&(g.rttCoords[w.source]=this._coordsDescendingInvStr[w.source][g.tileID.key])}}return we(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),ri[s]}return!1}}const Ct=Hi,Dt={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:u.c.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},ra=h=>{h.touchstart=h.dragStart,h.touchmoveWindow=h.dragMove,h.touchend=h.dragEnd},Fn={showCompass:!0,showZoom:!0,visualizePitch:!1};class Rn{constructor(e,s,n=!1){this.mousedown=m=>{this.startMouse(u.e({},m,{ctrlKey:!0,preventDefault:()=>m.preventDefault()}),it.mousePos(this.element,m)),it.addEventListener(window,"mousemove",this.mousemove),it.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=m=>{this.moveMouse(m,it.mousePos(this.element,m))},this.mouseup=m=>{this.mouseRotate.dragEnd(m),this.mousePitch&&this.mousePitch.dragEnd(m),this.offTemp()},this.touchstart=m=>{m.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=it.touchPos(this.element,m.targetTouches)[0],this.startTouch(m,this._startPos),it.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),it.addEventListener(window,"touchend",this.touchend))},this.touchmove=m=>{m.targetTouches.length!==1?this.reset():(this._lastPos=it.touchPos(this.element,m.targetTouches)[0],this.moveTouch(m,this._lastPos))},this.touchend=m=>{m.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const l=e.dragRotate._mouseRotate.getClickTolerance(),c=e.dragRotate._mousePitch.getClickTolerance();this.element=s,this.mouseRotate=Is({clickTolerance:l,enable:!0}),this.touchRotate=(({enable:m,clickTolerance:g,bearingDegreesPerPixelMoved:y=.8})=>{const v=new Ro;return new _r({clickTolerance:g,move:(w,S)=>({bearingDelta:(S.x-w.x)*y}),moveStateManager:v,enable:m,assignEvents:ra})})({clickTolerance:l,enable:!0}),this.map=e,n&&(this.mousePitch=yr({clickTolerance:c,enable:!0}),this.touchPitch=(({enable:m,clickTolerance:g,pitchDegreesPerPixelMoved:y=-.5})=>{const v=new Ro;return new _r({clickTolerance:g,move:(w,S)=>({pitchDelta:(S.y-w.y)*y}),moveStateManager:v,enable:m,assignEvents:ra})})({clickTolerance:c,enable:!0})),it.addEventListener(s,"mousedown",this.mousedown),it.addEventListener(s,"touchstart",this.touchstart,{passive:!1}),it.addEventListener(s,"touchcancel",this.reset)}startMouse(e,s){this.mouseRotate.dragStart(e,s),this.mousePitch&&this.mousePitch.dragStart(e,s),it.disableDrag()}startTouch(e,s){this.touchRotate.dragStart(e,s),this.touchPitch&&this.touchPitch.dragStart(e,s),it.disableDrag()}moveMouse(e,s){const n=this.map,{bearingDelta:l}=this.mouseRotate.dragMove(e,s)||{};if(l&&n.setBearing(n.getBearing()+l),this.mousePitch){const{pitchDelta:c}=this.mousePitch.dragMove(e,s)||{};c&&n.setPitch(n.getPitch()+c)}}moveTouch(e,s){const n=this.map,{bearingDelta:l}=this.touchRotate.dragMove(e,s)||{};if(l&&n.setBearing(n.getBearing()+l),this.touchPitch){const{pitchDelta:c}=this.touchPitch.dragMove(e,s)||{};c&&n.setPitch(n.getPitch()+c)}}off(){const e=this.element;it.removeEventListener(e,"mousedown",this.mousedown),it.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),it.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),it.removeEventListener(window,"touchend",this.touchend),it.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){it.enableDrag(),it.removeEventListener(window,"mousemove",this.mousemove),it.removeEventListener(window,"mouseup",this.mouseup),it.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),it.removeEventListener(window,"touchend",this.touchend)}}let ze;function On(h,e,s){if(h=new u.L(h.lng,h.lat),e){const n=new u.L(h.lng-360,h.lat),l=new u.L(h.lng+360,h.lat),c=s.locationPoint(h).distSqr(e);s.locationPoint(n).distSqr(e)<c?h=n:s.locationPoint(l).distSqr(e)<c&&(h=l)}for(;Math.abs(h.lng-s.center.lng)>180;){const n=s.locationPoint(h);if(n.x>=0&&n.y>=0&&n.x<=s.width&&n.y<=s.height)break;h.lng>s.center.lng?h.lng-=360:h.lng+=360}return h}const Vi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Zo(h,e,s){const n=h.classList;for(const l in Vi)n.remove(`maplibregl-${s}-anchor-${l}`);n.add(`maplibregl-${s}-anchor-${e}`)}class Yr extends u.E{constructor(e){if(super(),this._onKeyPress=s=>{const n=s.code,l=s.charCode||s.keyCode;n!=="Space"&&n!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=s=>{const n=s.originalEvent.target,l=this._element;this._popup&&(n===l||l.contains(n))&&this.togglePopup()},this._update=s=>{if(!this._map)return;const n=this._map.loaded()&&!this._map.isMoving();((s==null?void 0:s.type)==="terrain"||(s==null?void 0:s.type)==="render"&&!n)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=On(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let c="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?c="rotateX(0deg)":this._pitchAlignment==="map"&&(c=`rotateX(${this._map.getPitch()}deg)`),s&&s.type!=="moveend"||(this._pos=this._pos.round()),it.setTransform(this._element,`${Vi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${c} ${l}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const m=this._map.unproject(this._pos),g=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=m.distanceTo(this._lngLat)>20*g?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=s=>{if(!this._isDragging){const n=this._clickTolerance||this._map._clickTolerance;this._isDragging=s.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=s.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new u.k("dragstart"))),this.fire(new u.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new u.k("dragend")),this._state="inactive"},this._addDragHandler=s=>{this._element.contains(s.originalEvent.target)&&(s.preventDefault(),this._positionDelta=s.point.sub(this._pos).add(this._offset),this._pointerdownPos=s.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,e&&e.element)this._element=e.element,this._offset=u.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=it.create("div"),this._element.setAttribute("aria-label","Map marker");const s=it.createNS("http://www.w3.org/2000/svg","svg"),n=41,l=27;s.setAttributeNS(null,"display","block"),s.setAttributeNS(null,"height",`${n}px`),s.setAttributeNS(null,"width",`${l}px`),s.setAttributeNS(null,"viewBox",`0 0 ${l} ${n}`);const c=it.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"stroke","none"),c.setAttributeNS(null,"stroke-width","1"),c.setAttributeNS(null,"fill","none"),c.setAttributeNS(null,"fill-rule","evenodd");const m=it.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"fill-rule","nonzero");const g=it.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");const y=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const Z of y){const Y=it.createNS("http://www.w3.org/2000/svg","ellipse");Y.setAttributeNS(null,"opacity","0.04"),Y.setAttributeNS(null,"cx","10.5"),Y.setAttributeNS(null,"cy","5.80029008"),Y.setAttributeNS(null,"rx",Z.rx),Y.setAttributeNS(null,"ry",Z.ry),g.appendChild(Y)}const v=it.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"fill",this._color);const w=it.createNS("http://www.w3.org/2000/svg","path");w.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),v.appendChild(w);const S=it.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"opacity","0.25"),S.setAttributeNS(null,"fill","#000000");const P=it.createNS("http://www.w3.org/2000/svg","path");P.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),S.appendChild(P);const L=it.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"transform","translate(6.0, 7.0)"),L.setAttributeNS(null,"fill","#FFFFFF");const B=it.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(8.0, 8.0)");const R=it.createNS("http://www.w3.org/2000/svg","circle");R.setAttributeNS(null,"fill","#000000"),R.setAttributeNS(null,"opacity","0.25"),R.setAttributeNS(null,"cx","5.5"),R.setAttributeNS(null,"cy","5.5"),R.setAttributeNS(null,"r","5.4999962");const M=it.createNS("http://www.w3.org/2000/svg","circle");M.setAttributeNS(null,"fill","#FFFFFF"),M.setAttributeNS(null,"cx","5.5"),M.setAttributeNS(null,"cy","5.5"),M.setAttributeNS(null,"r","5.4999962"),B.appendChild(R),B.appendChild(M),m.appendChild(g),m.appendChild(v),m.appendChild(S),m.appendChild(L),m.appendChild(B),s.appendChild(m),s.setAttributeNS(null,"height",n*this._scale+"px"),s.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(s),this._offset=u.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",s=>{s.preventDefault()}),this._element.addEventListener("mousedown",s=>{s.preventDefault()}),Zo(this._element,this._anchor,"marker"),e&&e.className)for(const s of e.className.split(" "))this._element.classList.add(s);this._popup=null}addTo(e){return this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),it.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=u.L.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const s=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(38.1-13.5+s)],"bottom-right":[-s,-1*(38.1-13.5+s)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?e.remove():e.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(e){return this._offset=u.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const Se={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let xe=0,Ps=!1;const sa={maxWidth:100,unit:"metric"};function aa(h,e,s){const n=s&&s.maxWidth||100,l=h._container.clientHeight/2,c=h.unproject([0,l]),m=h.unproject([n,l]),g=c.distanceTo(m);if(s&&s.unit==="imperial"){const y=3.2808*g;y>5280?Qr(e,n,y/5280,h._getUIString("ScaleControl.Miles")):Qr(e,n,y,h._getUIString("ScaleControl.Feet"))}else s&&s.unit==="nautical"?Qr(e,n,g/1852,h._getUIString("ScaleControl.NauticalMiles")):g>=1e3?Qr(e,n,g/1e3,h._getUIString("ScaleControl.Kilometers")):Qr(e,n,g,h._getUIString("ScaleControl.Meters"))}function Qr(h,e,s,n){const l=function(c){const m=Math.pow(10,`${Math.floor(c)}`.length-1);let g=c/m;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:g>=1?1:function(y){const v=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*v)/v}(g),m*g}(s);h.style.width=e*(l/s)+"px",h.innerHTML=`${l}&nbsp;${n}`}const Vn={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Un=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Cs(h){if(h){if(typeof h=="number"){const e=Math.round(Math.abs(h)/Math.SQRT2);return{center:new u.P(0,0),top:new u.P(0,h),"top-left":new u.P(e,e),"top-right":new u.P(-e,e),bottom:new u.P(0,-h),"bottom-left":new u.P(e,-e),"bottom-right":new u.P(-e,-e),left:new u.P(h,0),right:new u.P(-h,0)}}if(h instanceof u.P||Array.isArray(h)){const e=u.P.convert(h);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:u.P.convert(h.center||[0,0]),top:u.P.convert(h.top||[0,0]),"top-left":u.P.convert(h["top-left"]||[0,0]),"top-right":u.P.convert(h["top-right"]||[0,0]),bottom:u.P.convert(h.bottom||[0,0]),"bottom-left":u.P.convert(h["bottom-left"]||[0,0]),"bottom-right":u.P.convert(h["bottom-right"]||[0,0]),left:u.P.convert(h.left||[0,0]),right:u.P.convert(h.right||[0,0])}}return Cs(new u.P(0,0))}const Nn={extend:(h,...e)=>u.e(h,...e),run(h){h()},logToElement(h,e=!1,s="log"){const n=window.document.getElementById(s);n&&(e&&(n.innerHTML=""),n.innerHTML+=`<br>${h}`)}},$n=Hi;class te{static get version(){return $n}static get workerCount(){return Yi.workerCount}static set workerCount(e){Yi.workerCount=e}static get maxParallelImageRequests(){return u.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(e){u.c.MAX_PARALLEL_IMAGE_REQUESTS=e}static get workerUrl(){return u.c.WORKER_URL}static set workerUrl(e){u.c.WORKER_URL=e}static addProtocol(e,s){u.c.REGISTERED_PROTOCOLS[e]=s}static removeProtocol(e){delete u.c.REGISTERED_PROTOCOLS[e]}}return te.Map=class extends $o{constructor(h){if(u.bg.mark(u.bh.create),(h=u.e({},Dt,h)).minZoom!=null&&h.maxZoom!=null&&h.minZoom>h.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(h.minPitch!=null&&h.maxPitch!=null&&h.minPitch>h.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(h.minPitch!=null&&h.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(h.maxPitch!=null&&h.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ra(h.minZoom,h.maxZoom,h.minPitch,h.maxPitch,h.renderWorldCopies),{bearingSnap:h.bearingSnap}),this._cooperativeGesturesOnWheel=e=>{this._onCooperativeGesture(e,e[this._metaKey],1)},this._contextLost=e=>{e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new u.k("webglcontextlost",{originalEvent:e}))},this._contextRestored=e=>{this._setupPainter(),this.resize(),this._update(),this.fire(new u.k("webglcontextrestored",{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=h.interactive,this._cooperativeGestures=h.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=h.maxTileCacheSize,this._maxTileCacheZoomLevels=h.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=h.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=h.preserveDrawingBuffer,this._antialias=h.antialias,this._trackResize=h.trackResize,this._bearingSnap=h.bearingSnap,this._refreshExpiredTiles=h.refreshExpiredTiles,this._fadeDuration=h.fadeDuration,this._crossSourceCollisions=h.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=h.collectResourceTiming,this._renderTaskQueue=new Na,this._controls=[],this._mapId=u.a2(),this._locale=u.e({},Bn,h.locale),this._clickTolerance=h.clickTolerance,this._overridePixelRatio=h.pixelRatio,this._maxCanvasSize=h.maxCanvasSize,this.transformCameraUpdate=h.transformCameraUpdate,this._imageQueueHandle=ti.addThrottleControl(()=>this.isMoving()),this._requestManager=new ca(h.transformRequest),typeof h.container=="string"){if(this._container=document.getElementById(h.container),!this._container)throw new Error(`Container '${h.container}' not found.`)}else{if(!(h.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=h.container}if(h.maxBounds&&this.setMaxBounds(h.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let e=!1;const s=Wr(n=>{this._trackResize&&!this._removed&&this.resize(n)._update()},50);this._resizeObserver=new ResizeObserver(n=>{e?s(n):e=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Ln(this,h),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=h.hash&&new Ys(typeof h.hash=="string"&&h.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:h.center,zoom:h.zoom,bearing:h.bearing,pitch:h.pitch}),h.bounds&&(this.resize(),this.fitBounds(h.bounds,u.e({},h.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=h.localIdeographFontFamily,this._validateStyle=h.validateStyle,h.style&&this.setStyle(h.style,{localIdeographFontFamily:h.localIdeographFontFamily}),h.attributionControl&&this.addControl(new Ai({customAttribution:h.customAttribution})),h.maplibreLogo&&this.addControl(new he,h.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",e=>{this._update(e.dataType==="style"),this.fire(new u.k(`${e.dataType}data`,e))}),this.on("dataloading",e=>{this.fire(new u.k(`${e.dataType}dataloading`,e))}),this.on("dataabort",e=>{this.fire(new u.k("sourcedataabort",e))})}_getMapId(){return this._mapId}addControl(h,e){if(e===void 0&&(e=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new u.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const s=h.onAdd(this);this._controls.push(h);const n=this._controlPositions[e];return e.indexOf("bottom")!==-1?n.insertBefore(s,n.firstChild):n.appendChild(s),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new u.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(h);return e>-1&&this._controls.splice(e,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}calculateCameraOptionsFromTo(h,e,s,n){return n==null&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(s,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,e,s,n)}resize(h){var e;const s=this._containerDimensions(),n=s[0],l=s[1],c=this._getClampedPixelRatio(n,l);if(this._resizeCanvas(n,l,c),this.painter.resize(n,l,c),this.painter.overLimit()){const g=this.painter.context.gl;this._maxCanvasSize=[g.drawingBufferWidth,g.drawingBufferHeight];const y=this._getClampedPixelRatio(n,l);this._resizeCanvas(n,l,y),this.painter.resize(n,l,y)}this.transform.resize(n,l),(e=this._requestedCameraState)===null||e===void 0||e.resize(n,l);const m=!this._moving;return m&&(this.stop(),this.fire(new u.k("movestart",h)).fire(new u.k("move",h))),this.fire(new u.k("resize",h)),m&&this.fire(new u.k("moveend",h)),this}_getClampedPixelRatio(h,e){const{0:s,1:n}=this._maxCanvasSize,l=this.getPixelRatio(),c=h*l,m=e*l;return Math.min(c>s?s/c:1,m>n?n/m:1)*l}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(ue.convert(h)),this._update()}setMinZoom(h){if((h=h??-2)>=-2&&h<=this.transform.maxZoom)return this.transform.minZoom=h,this._update(),this.getZoom()<h&&this.setZoom(h),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(h){if((h=h??22)>=this.transform.minZoom)return this.transform.maxZoom=h,this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.minPitch=h,this._update(),this.getPitch()<h&&this.setPitch(h),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(h){if((h=h??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(h>=this.transform.minPitch)return this.transform.maxPitch=h,this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.renderWorldCopies=h,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(h){return this._cooperativeGestures=h,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(h){return this.transform.locationPoint(u.L.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.pointLocation(u.P.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,e,s){if(h==="mouseenter"||h==="mouseover"){let n=!1;return{layer:e,listener:s,delegates:{mousemove:l=>{const c=this.getLayer(e)?this.queryRenderedFeatures(l.point,{layers:[e]}):[];c.length?n||(n=!0,s.call(this,new Ti(h,this,l.originalEvent,{features:c}))):n=!1},mouseout:()=>{n=!1}}}}if(h==="mouseleave"||h==="mouseout"){let n=!1;return{layer:e,listener:s,delegates:{mousemove:l=>{(this.getLayer(e)?this.queryRenderedFeatures(l.point,{layers:[e]}):[]).length?n=!0:n&&(n=!1,s.call(this,new Ti(h,this,l.originalEvent)))},mouseout:l=>{n&&(n=!1,s.call(this,new Ti(h,this,l.originalEvent)))}}}}{const n=l=>{const c=this.getLayer(e)?this.queryRenderedFeatures(l.point,{layers:[e]}):[];c.length&&(l.features=c,s.call(this,l),delete l.features)};return{layer:e,listener:s,delegates:{[h]:n}}}}on(h,e,s){if(s===void 0)return super.on(h,e);const n=this._createDelegatedListener(h,e,s);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(n);for(const l in n.delegates)this.on(l,n.delegates[l]);return this}once(h,e,s){if(s===void 0)return super.once(h,e);const n=this._createDelegatedListener(h,e,s);for(const l in n.delegates)this.once(l,n.delegates[l]);return this}off(h,e,s){return s===void 0?super.off(h,e):(this._delegatedListeners&&this._delegatedListeners[h]&&(n=>{const l=this._delegatedListeners[h];for(let c=0;c<l.length;c++){const m=l[c];if(m.layer===e&&m.listener===s){for(const g in m.delegates)this.off(g,m.delegates[g]);return l.splice(c,1),this}}})(),this)}queryRenderedFeatures(h,e){if(!this.style)return[];let s;const n=h instanceof u.P||Array.isArray(h),l=n?h:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(n?{}:h)||{},l instanceof u.P||typeof l[0]=="number")s=[u.P.convert(l)];else{const c=u.P.convert(l[0]),m=u.P.convert(l[1]);s=[c,new u.P(m.x,c.y),m,new u.P(c.x,m.y),c]}return this.style.queryRenderedFeatures(s,e,this.transform)}querySourceFeatures(h,e){return this.style.querySourceFeatures(h,e)}setStyle(h,e){return(e=u.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&h?(this._diffStyle(h,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(h,e))}setTransformRequest(h){return this._requestManager.setTransformRequest(h),this}_getUIString(h){const e=this._locale[h];if(e==null)throw new Error(`Missing UI string '${h}'`);return e}_updateStyle(h,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(h,e));const s=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new je(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,e,s):this.style.loadJSON(h,e,s),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new je(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,e){if(typeof h=="string"){const s=this._requestManager.transformRequest(h,Ee.Style);u.f(s,(n,l)=>{n?this.fire(new u.j(n)):l&&this._updateDiff(l,e)})}else typeof h=="object"&&this._updateDiff(h,e)}_updateDiff(h,e){try{this.style.setState(h,e)&&this._update(!0)}catch(s){u.w(`Unable to perform style diff: ${s.message||s.error||s}. Rebuilding the style from scratch.`),this._updateStyle(h,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():u.w("There is no style added to the map.")}addSource(h,e){return this._lazyInitEmptyStyle(),this.style.addSource(h,e),this._update(!0)}isSourceLoaded(h){const e=this.style&&this.style.sourceCaches[h];if(e!==void 0)return e.loaded();this.fire(new u.j(new Error(`There is no source with ID '${h}'`)))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){const e=this.style.sourceCaches[h.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${h.source}`);for(const s in this.style._layers){const n=this.style._layers[s];n.type==="hillshade"&&n.source===h.source&&u.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Go(this.painter,e,h),this.painter.renderToTexture=new $a(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=s=>{s.dataType==="style"?this.terrain.sourceCache.freeRtt():s.dataType==="source"&&s.tile&&(s.sourceId!==h.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(s.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new u.k("terrain",{terrain:h})),this}getTerrain(){var h,e;return(e=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const h=this.style&&this.style.sourceCaches;for(const e in h){const s=h[e]._tiles;for(const n in s){const l=s[n];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}addSourceType(h,e,s){return this._lazyInitEmptyStyle(),this.style.addSourceType(h,e,s)}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}addImage(h,e,s={}){const{pixelRatio:n=1,sdf:l=!1,stretchX:c,stretchY:m,content:g}=s;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||u.a(e))){if(e.width===void 0||e.height===void 0)return this.fire(new u.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:y,height:v,data:w}=e,S=e;return this.style.addImage(h,{data:new u.R({width:y,height:v},new Uint8Array(w)),pixelRatio:n,stretchX:c,stretchY:m,content:g,sdf:l,version:0,userImage:S}),S.onAdd&&S.onAdd(this,h),this}}{const{width:y,height:v,data:w}=u.h.getImageData(e);this.style.addImage(h,{data:new u.R({width:y,height:v},w),pixelRatio:n,stretchX:c,stretchY:m,content:g,sdf:l,version:0})}}updateImage(h,e){const s=this.style.getImage(h);if(!s)return this.fire(new u.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const n=e instanceof HTMLImageElement||u.a(e)?u.h.getImageData(e):e,{width:l,height:c,data:m}=n;if(l===void 0||c===void 0)return this.fire(new u.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==s.data.width||c!==s.data.height)return this.fire(new u.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const g=!(e instanceof HTMLImageElement||u.a(e));return s.data.replace(m,g),this.style.updateImage(h,s),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new u.j(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h,e){ti.getImage(this._requestManager.transformRequest(h,Ee.Image),e)}listImages(){return this.style.listImages()}addLayer(h,e){return this._lazyInitEmptyStyle(),this.style.addLayer(h,e),this._update(!0)}moveLayer(h,e){return this.style.moveLayer(h,e),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(h,e,s){return this.style.setLayerZoomRange(h,e,s),this._update(!0)}setFilter(h,e,s={}){return this.style.setFilter(h,e,s),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,e,s,n={}){return this.style.setPaintProperty(h,e,s,n),this._update(!0)}getPaintProperty(h,e){return this.style.getPaintProperty(h,e)}setLayoutProperty(h,e,s,n={}){return this.style.setLayoutProperty(h,e,s,n),this._update(!0)}getLayoutProperty(h,e){return this.style.getLayoutProperty(h,e)}setGlyphs(h,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,e,s={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,e,s,n=>{n||this._update(!0)}),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,e,s=>{s||this._update(!0)}),this}setLight(h,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,e),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(h,e){return this.style.setFeatureState(h,e),this._update()}removeFeatureState(h,e){return this.style.removeFeatureState(h,e),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,e=0;return this._container&&(h=this._container.clientWidth||400,e=this._container.clientHeight||300),[h,e]}_setupContainer(){const h=this._container;h.classList.add("maplibregl-map");const e=this._canvasContainer=it.create("div","maplibregl-canvas-container",h);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=it.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const s=this._containerDimensions(),n=this._getClampedPixelRatio(s[0],s[1]);this._resizeCanvas(s[0],s[1],n);const l=this._controlContainer=it.create("div","maplibregl-control-container",h),c=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(m=>{c[m]=it.create("div",`maplibregl-ctrl-${m} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=it.create("div","maplibregl-cooperative-gesture-screen",this._container);let h=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(h=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=`
578
+ <div class="maplibregl-desktop-message">${h}</div>
579
+ <div class="maplibregl-mobile-message">${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div>
580
+ `,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){it.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(h,e,s){this._canvas.width=Math.floor(s*h),this._canvas.height=Math.floor(s*e),this._canvas.style.width=`${h}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const h={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",n=>{e={requestedAttributes:h},n&&(e.statusMessage=n.statusMessage,e.type=n.type)},{once:!0});const s=this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h);if(!s){const n="Failed to initialize WebGL";throw e?(e.message=n,new Error(JSON.stringify(e))):new Error(n)}this.painter=new Kr(s,this.transform),Ji.testSupport(s)}_onCooperativeGesture(h,e,s){return!e&&s<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){const e=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let s=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const l=this.transform.zoom,c=u.h.now();this.style.zoomHistory.update(l,c);const m=new u.a8(l,{now:c,fadeDuration:e,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),g=m.crossFadingFactor();g===1&&g===this._crossFadingFactor||(s=!0,this._crossFadingFactor=g),this.style.update(m)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,e,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:e,showPadding:this.showPadding}),this.fire(new u.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,u.bg.mark(u.bh.load),this.fire(new u.k("load"))),this.style&&(this.style.hasTransitions()||s)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const n=this._sourcesDirty||this._styleDirty||this._placementDirty;return n||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.k("idle")),!this._loaded||this._fullyLoaded||n||(this._fullyLoaded=!0,u.bg.mark(u.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(const s of this._controls)s.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),ti.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),it.remove(this._canvasContainer),it.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),u.bg.clearMetrics(),this._removed=!0,this.fire(new u.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=u.h.frame(h=>{u.bg.frame(h),this._frame=null,this._render(h)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return Ct}getCameraTargetElevation(){return this.transform.elevation}},te.NavigationControl=class{constructor(h){this._updateZoomButtons=()=>{const e=this._map.getZoom(),s=e===this._map.getMaxZoom(),n=e===this._map.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},this._rotateCompassArrow=()=>{const e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,s)=>{const n=this._map._getUIString(`NavigationControl.${s}`);e.title=n,e.setAttribute("aria-label",n)},this.options=u.e({},Fn,h),this._container=it.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),it.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),it.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=it.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Rn(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){it.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,e){const s=it.create("button",h,this._container);return s.type="button",s.addEventListener("click",e),s}},te.GeolocateControl=class extends u.E{constructor(h){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new u.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new u.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const s=new u.L(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,l=this._map.getBearing(),c=u.e({bearing:l},this.options.fitBoundsOptions),m=ue.fromLngLat(s,n);this._map.fitBounds(m,c,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const s=new u.L(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Ps)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new u.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=e=>{if(this._map){if(this._container.addEventListener("contextmenu",s=>s.preventDefault()),this._geolocateButton=it.create("button","maplibregl-ctrl-geolocate",this._container),it.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",e===!1){u.w("Geolocation support is not available so the GeolocateControl will be disabled.");const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}else{const s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=it.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Yr({element:this._dotElement}),this._circleElement=it.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Yr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",s=>{s.geolocateSource||this._watchState!=="ACTIVE_LOCK"||s.originalEvent&&s.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new u.k("trackuserlocationend")))})}},this.options=u.e({},Se,h)}onAdd(h){return this._map=h,this._container=it.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(e,s=!1){ze===void 0||s?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(n=>{ze=n.state!=="denied",e(ze)}).catch(()=>{ze=!!window.navigator.geolocation,e(ze)}):(ze=!!window.navigator.geolocation,e(ze)):e(ze)}(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),it.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,xe=0,Ps=!1}_isOutOfMapMaxBounds(h){const e=this._map.getMaxBounds(),s=h.coords;return e&&(s.longitude<e.getWest()||s.longitude>e.getEast()||s.latitude<e.getSouth()||s.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const h=this._map.getBounds(),e=h.getSouthEast(),s=h.getNorthEast(),n=e.distanceTo(s),l=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return u.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new u.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":xe--,Ps=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new u.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new u.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),xe++,xe>1?(h={maximumAge:6e5,timeout:0},Ps=!0):(h=this.options.positionOptions,Ps=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},te.AttributionControl=Ai,te.LogoControl=he,te.ScaleControl=class{constructor(h){this._onMove=()=>{aa(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,aa(this._map,this._container,this.options)},this.options=u.e({},sa,h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=it.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){it.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},te.FullscreenControl=class extends u.E{constructor(h={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:u.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=it.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){it.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const h=this._fullscreenButton=it.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);it.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new u.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new u.k("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},te.TerrainControl=class{constructor(h){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=h}onAdd(h){return this._map=h,this._container=it.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=it.create("button","maplibregl-ctrl-terrain",this._container),it.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){it.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},te.Popup=class extends u.E{constructor(h){super(),this.remove=()=>(this._content&&it.remove(this._content),this._container&&(it.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new u.k("close")),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=it.create("div","maplibregl-popup",this._map.getContainer()),this._tip=it.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const m of this.options.className.split(" "))this._container.classList.add(m);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=On(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!e)return;const s=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);let n=this.options.anchor;const l=Cs(this.options.offset);if(!n){const m=this._container.offsetWidth,g=this._container.offsetHeight;let y;y=s.y+l.bottom.y<g?["top"]:s.y>this._map.transform.height-g?["bottom"]:[],s.x<m/2?y.push("left"):s.x>this._map.transform.width-m/2&&y.push("right"),n=y.length===0?"bottom":y.join("-")}const c=s.add(l[n]).round();it.setTransform(this._container,`${Vi[n]} translate(${c.x}px,${c.y}px)`),Zo(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=u.e(Object.create(Vn),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new u.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=u.L.convert(h),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){const e=document.createDocumentFragment(),s=document.createElement("body");let n;for(s.innerHTML=h;n=s.firstChild,n;)e.appendChild(n);return this.setDOMContent(e)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=it.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){this._container&&this._container.classList.add(h)}removeClassName(h){this._container&&this._container.classList.remove(h)}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}_createCloseButton(){this.options.closeButton&&(this._closeButton=it.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const h=this._container.querySelector(Un);h&&h.focus()}},te.Marker=Yr,te.Style=je,te.LngLat=u.L,te.LngLatBounds=ue,te.Point=u.P,te.MercatorCoordinate=u.U,te.Evented=u.E,te.AJAXError=u.bi,te.config=u.c,te.CanvasSource=zr,te.GeoJSONSource=Ir,te.ImageSource=Mi,te.RasterDEMTileSource=ds,te.RasterTileSource=ps,te.VectorTileSource=Nr,te.VideoSource=$s,te.setRTLTextPlugin=u.bj,te.getRTLTextPluginStatus=u.bk,te.prewarm=function(){fa().acquire(Wt)},te.clearPrewarmedResources=function(){const h=cr;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(Wt),cr=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},Nn.extend(te,{isSafari:u.ac,getPerformanceMetrics:u.bg.getPerformanceMetrics}),te});var oc=gl;return oc})})(sd.__module);
581
+ //# sourceMappingURL=index.cjs82.js.map