@nasa-terra/components 0.0.198 → 0.0.199

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 (1291) hide show
  1. package/cdn/chunks/GeoTIFF.VXDS234A.js +20754 -0
  2. package/cdn/chunks/chunk.2EWZDAYT.js +29 -0
  3. package/cdn/chunks/chunk.2JJELSL5.js +47 -0
  4. package/cdn/chunks/chunk.2T337UTK.js +19 -0
  5. package/cdn/chunks/chunk.2XG73ITG.js +357 -0
  6. package/cdn/chunks/chunk.33GFCE5N.js +19 -0
  7. package/cdn/chunks/chunk.3JXVH2NE.js +377 -0
  8. package/cdn/chunks/chunk.3VUC5O5G.js +33 -0
  9. package/cdn/chunks/chunk.3XZ3WU77.js +35 -0
  10. package/cdn/chunks/chunk.44VCJ6SW.js +29 -0
  11. package/cdn/chunks/chunk.4HXIWAKE.js +29 -0
  12. package/cdn/chunks/chunk.4KHGJTYG.js +310 -0
  13. package/cdn/chunks/chunk.4LAXKCHJ.js +19 -0
  14. package/cdn/chunks/chunk.4N76TU2N.js +60 -0
  15. package/cdn/chunks/chunk.55WRSCJY.js +978 -0
  16. package/cdn/chunks/chunk.573DB434.js +39 -0
  17. package/cdn/chunks/chunk.5BH3C4GN.js +19 -0
  18. package/cdn/chunks/chunk.5BVN7II7.js +19 -0
  19. package/cdn/chunks/chunk.5DLA37YX.js +19 -0
  20. package/cdn/chunks/chunk.5LFN6KT3.js +416 -0
  21. package/cdn/chunks/chunk.5MB6A5RU.js +19 -0
  22. package/cdn/chunks/chunk.5ZT2BS3I.js +60 -0
  23. package/cdn/chunks/chunk.66IWKBC6.js +364 -0
  24. package/cdn/chunks/chunk.6D2IDMCW.js +106 -0
  25. package/cdn/chunks/chunk.6JG52BSF.js +35 -0
  26. package/cdn/chunks/chunk.6O7XOHAP.js +32 -0
  27. package/cdn/chunks/chunk.6Z7GRBWL.js +277 -0
  28. package/cdn/chunks/chunk.76A5M5WG.js +33 -0
  29. package/cdn/chunks/chunk.7BSMV3XV.js +36 -0
  30. package/cdn/chunks/chunk.7C3LJSTD.js +19 -0
  31. package/cdn/chunks/chunk.7G65ACMK.js +19 -0
  32. package/cdn/chunks/chunk.7GIH3FHL.js +29 -0
  33. package/cdn/chunks/chunk.7KYOVGMU.js +32 -0
  34. package/cdn/chunks/chunk.7UCNMWYE.js +1975 -0
  35. package/cdn/chunks/chunk.7Y2VDUYC.js +62 -0
  36. package/cdn/chunks/chunk.ABFNT6U4.js +32 -0
  37. package/cdn/chunks/chunk.ADFH5ULU.js +29 -0
  38. package/cdn/chunks/chunk.ADHCB3BO.js +538 -0
  39. package/cdn/chunks/chunk.AH7EQF7K.js +29 -0
  40. package/cdn/chunks/chunk.AO7RPFJO.js +19 -0
  41. package/cdn/chunks/chunk.AQB2ML3I.js +537 -0
  42. package/cdn/chunks/chunk.AYFA4HPN.js +4735 -0
  43. package/cdn/chunks/chunk.B3ADFXJY.js +32 -0
  44. package/cdn/chunks/chunk.B3GLOTII.js +92 -0
  45. package/cdn/chunks/chunk.B6YC7R6P.js +29 -0
  46. package/cdn/chunks/chunk.BFDVUZHC.js +35 -0
  47. package/cdn/chunks/chunk.BJRAF4ZX.js +19 -0
  48. package/cdn/chunks/chunk.BNGXQNNQ.js +29 -0
  49. package/cdn/chunks/chunk.BOZ3VKJO.js +19 -0
  50. package/cdn/chunks/chunk.BW44PXWN.js +657 -0
  51. package/cdn/chunks/chunk.COHRXEHA.js +29 -0
  52. package/cdn/chunks/chunk.CRQDFPSH.js +37 -0
  53. package/cdn/chunks/chunk.CX65AHTW.js +104 -0
  54. package/cdn/chunks/chunk.CX6JSAGB.js +19 -0
  55. package/cdn/chunks/chunk.DEHDGGWE.js +19 -0
  56. package/cdn/chunks/chunk.DMULXFKY.js +32 -0
  57. package/cdn/chunks/chunk.DO3V7V6I.js +259 -0
  58. package/cdn/chunks/chunk.DYRKSW2X.js +99 -0
  59. package/cdn/chunks/chunk.E4ONM7EQ.js +224 -0
  60. package/cdn/chunks/chunk.E6L6YVTU.js +19 -0
  61. package/cdn/chunks/chunk.ECR75TPC.js +19 -0
  62. package/cdn/chunks/chunk.EHRAILYE.js +19 -0
  63. package/cdn/chunks/chunk.EHVXLTCB.js +190 -0
  64. package/cdn/chunks/chunk.EKXY4PGP.js +29 -0
  65. package/cdn/chunks/chunk.FI4YBHHD.js +1339 -0
  66. package/cdn/chunks/chunk.FIREC5CC.js +478 -0
  67. package/cdn/chunks/chunk.FQ7GYAM6.js +450 -0
  68. package/cdn/chunks/chunk.FQBIIKY5.js +19 -0
  69. package/cdn/chunks/chunk.FSGSFI2L.js +162 -0
  70. package/cdn/chunks/chunk.G7AGZVJM.js +32 -0
  71. package/cdn/chunks/chunk.GA4QBBRX.js +19 -0
  72. package/cdn/chunks/chunk.GEVOOPOP.js +32 -0
  73. package/cdn/chunks/chunk.GF56J2LC.js +29 -0
  74. package/cdn/chunks/chunk.GGODQ75Z.js +359 -0
  75. package/cdn/chunks/chunk.GP5CKNVX.js +19 -0
  76. package/cdn/chunks/chunk.GTZLRBU6.js +15 -0
  77. package/cdn/chunks/chunk.GWUGCYFL.js +19 -0
  78. package/cdn/chunks/chunk.H6KRH5P2.js +17685 -0
  79. package/cdn/chunks/chunk.HCUUZMUR.js +610 -0
  80. package/cdn/chunks/chunk.HETFTQ32.js +36 -0
  81. package/cdn/chunks/chunk.HFQ4URSA.js +29 -0
  82. package/cdn/chunks/chunk.HHFSBJ5G.js +19 -0
  83. package/cdn/chunks/chunk.HJHZJEFY.js +19 -0
  84. package/cdn/chunks/chunk.HQL5JPO6.js +29 -0
  85. package/cdn/chunks/chunk.HRRDY7XJ.js +19 -0
  86. package/cdn/chunks/chunk.HT4VXYXY.js +37 -0
  87. package/cdn/chunks/chunk.HUVHJ5KI.js +19 -0
  88. package/cdn/chunks/chunk.HVDW2G5B.js +19 -0
  89. package/cdn/chunks/chunk.HVKGLK5J.js +78 -0
  90. package/cdn/chunks/chunk.I4B5GFUI.js +30 -0
  91. package/cdn/chunks/chunk.I4GAKXVS.js +82 -0
  92. package/cdn/chunks/chunk.I74CWXDT.js +29 -0
  93. package/cdn/chunks/chunk.IJRMB4PM.js +19 -0
  94. package/cdn/chunks/chunk.IK2SGPIW.js +5463 -0
  95. package/cdn/chunks/chunk.IYBWOV2C.js +1660 -0
  96. package/cdn/chunks/chunk.J52GFLCR.js +110 -0
  97. package/cdn/chunks/chunk.JHM6GLII.js +599 -0
  98. package/cdn/chunks/chunk.JJRD2OTY.js +293 -0
  99. package/cdn/chunks/chunk.JTRGBBGG.js +29 -0
  100. package/cdn/chunks/chunk.JXSQUWZZ.js +19 -0
  101. package/cdn/chunks/chunk.JYF5D5R5.js +19 -0
  102. package/cdn/chunks/chunk.K4QMVYIR.js +443 -0
  103. package/cdn/chunks/chunk.K56RZQTE.js +155 -0
  104. package/cdn/chunks/chunk.KB3G2WCI.js +34 -0
  105. package/cdn/chunks/chunk.KF4FXYKE.js +19 -0
  106. package/cdn/chunks/chunk.KHDL2CAQ.js +230 -0
  107. package/cdn/chunks/chunk.KHRT3JCC.js +29 -0
  108. package/cdn/chunks/chunk.KPSIXCYD.js +29 -0
  109. package/cdn/chunks/chunk.KX7SACHH.js +68 -0
  110. package/cdn/chunks/chunk.KZCBK6S4.js +19 -0
  111. package/cdn/chunks/chunk.L3TQOLJO.js +74 -0
  112. package/cdn/chunks/chunk.L67UJNXB.js +41 -0
  113. package/cdn/chunks/chunk.LGRZMWVK.js +35 -0
  114. package/cdn/chunks/chunk.LIPFUNWP.js +38 -0
  115. package/cdn/chunks/chunk.LWZNG7WV.js +29 -0
  116. package/cdn/chunks/chunk.LXQGTI2B.js +32 -0
  117. package/cdn/chunks/chunk.M43ZJHCX.js +33 -0
  118. package/cdn/chunks/chunk.M6QQY2ST.js +17603 -0
  119. package/cdn/chunks/chunk.MLJM2THR.js +19 -0
  120. package/cdn/chunks/chunk.MNP4CXLJ.js +19 -0
  121. package/cdn/chunks/chunk.MUXCPAHQ.js +543 -0
  122. package/cdn/chunks/chunk.MZKOUZD2.js +123 -0
  123. package/cdn/chunks/chunk.N2L7WOXF.js +29 -0
  124. package/cdn/chunks/chunk.N2SCVTHV.js +29 -0
  125. package/cdn/chunks/chunk.NCROEX7Z.js +29 -0
  126. package/cdn/chunks/chunk.NH4YMQJT.js +298 -0
  127. package/cdn/chunks/chunk.NIKJGSH5.js +19 -0
  128. package/cdn/chunks/chunk.NIQW247C.js +19 -0
  129. package/cdn/chunks/chunk.NKD2XOGT.js +33 -0
  130. package/cdn/chunks/chunk.NNUQZHMT.js +32 -0
  131. package/cdn/chunks/chunk.O3E7K42P.js +278 -0
  132. package/cdn/chunks/chunk.O3JICBSZ.js +904 -0
  133. package/cdn/chunks/chunk.O6V37MUB.js +19 -0
  134. package/cdn/chunks/chunk.OCOILS4L.js +531 -0
  135. package/cdn/chunks/chunk.OO345KKC.js +19 -0
  136. package/cdn/chunks/chunk.P5NZ7ZES.js +19 -0
  137. package/cdn/chunks/chunk.PB7O3LZB.js +2713 -0
  138. package/cdn/chunks/chunk.PDZ25A5I.js +19 -0
  139. package/cdn/chunks/chunk.PF6HHPHM.js +1691 -0
  140. package/cdn/chunks/chunk.PHX2Z4JM.js +113 -0
  141. package/cdn/chunks/chunk.PIEJ3UF6.js +592 -0
  142. package/cdn/chunks/chunk.PJPMBXC4.js +19 -0
  143. package/cdn/chunks/chunk.PKAVFPZ7.js +36 -0
  144. package/cdn/chunks/chunk.PNEWL4NR.js +925 -0
  145. package/cdn/chunks/chunk.PR55CF2E.js +19 -0
  146. package/cdn/chunks/chunk.PVARN7ER.js +86 -0
  147. package/cdn/chunks/chunk.Q4B4QXYW.js +19 -0
  148. package/cdn/chunks/chunk.Q7FVA2QA.js +234 -0
  149. package/cdn/chunks/chunk.QNGVGHSM.js +616 -0
  150. package/cdn/chunks/chunk.QSXNN4K7.js +29 -0
  151. package/cdn/chunks/chunk.QU5NA6A2.js +34 -0
  152. package/cdn/chunks/chunk.QUXBL6PU.js +19 -0
  153. package/cdn/chunks/chunk.QWKEI3FC.js +49 -0
  154. package/cdn/chunks/chunk.RCUE3PFX.js +19 -0
  155. package/cdn/chunks/chunk.RGMOIMLO.js +19 -0
  156. package/cdn/chunks/chunk.RHKWK57F.js +32 -0
  157. package/cdn/chunks/chunk.RK7LHY6Q.js +1197 -0
  158. package/cdn/chunks/chunk.RPETTG3O.js +19 -0
  159. package/cdn/chunks/chunk.RYLQ7J4S.js +134 -0
  160. package/cdn/chunks/chunk.S43EHJMQ.js +276 -0
  161. package/cdn/chunks/chunk.S5FXMDJD.js +136 -0
  162. package/cdn/chunks/chunk.SE55TMVG.js +143 -0
  163. package/cdn/chunks/chunk.SPVQ3TUO.js +188 -0
  164. package/cdn/chunks/chunk.STAMGMYS.js +19 -0
  165. package/cdn/chunks/chunk.SYUADFIF.js +151 -0
  166. package/cdn/chunks/chunk.SZVIFQRJ.js +71 -0
  167. package/cdn/chunks/chunk.T47BZXNK.js +19 -0
  168. package/cdn/chunks/chunk.TAGA7EGX.js +348 -0
  169. package/cdn/chunks/chunk.TG3YYWRJ.js +672 -0
  170. package/cdn/chunks/chunk.TOSFVKE4.js +36 -0
  171. package/cdn/chunks/chunk.TTCE562V.js +29 -0
  172. package/cdn/chunks/chunk.TTUIBJR7.js +29 -0
  173. package/cdn/chunks/chunk.TXCVCIZI.js +35 -0
  174. package/cdn/chunks/chunk.TZQ63Z3H.js +36 -0
  175. package/cdn/chunks/chunk.UBVO3Z7U.js +32 -0
  176. package/cdn/chunks/chunk.UI5WWHT7.js +19 -0
  177. package/cdn/chunks/chunk.UKCY4NE5.js +33 -0
  178. package/cdn/chunks/chunk.UKKNHVT2.js +2546 -0
  179. package/cdn/chunks/chunk.URQOTCAU.js +29 -0
  180. package/cdn/chunks/chunk.UUUD46S3.js +1862 -0
  181. package/cdn/chunks/chunk.VEIJLCDU.js +29 -0
  182. package/cdn/chunks/chunk.VKNIBCZI.js +19 -0
  183. package/cdn/chunks/chunk.VRMWYJMN.js +37 -0
  184. package/cdn/chunks/chunk.VSLVNJ6A.js +158 -0
  185. package/cdn/chunks/chunk.W36EIIQD.js +19 -0
  186. package/cdn/chunks/chunk.W4NGS5VZ.js +29 -0
  187. package/cdn/chunks/chunk.W5DRTC2Y.js +19 -0
  188. package/cdn/chunks/chunk.W7DYWM5I.js +32 -0
  189. package/cdn/chunks/chunk.WEGQDDNL.js +83 -0
  190. package/cdn/chunks/chunk.WHARISEG.js +29 -0
  191. package/cdn/chunks/chunk.WHHJJOQT.js +19 -0
  192. package/cdn/chunks/chunk.WNFL2Q36.js +524 -0
  193. package/cdn/chunks/chunk.WY6BZ6AK.js +138 -0
  194. package/cdn/chunks/chunk.WY7ZAZXA.js +19 -0
  195. package/cdn/chunks/chunk.X37TJUYW.js +19 -0
  196. package/cdn/chunks/chunk.X5GEXAXL.js +19 -0
  197. package/cdn/chunks/chunk.X76WQYYW.js +19 -0
  198. package/cdn/chunks/chunk.XVQCMA3M.js +32 -0
  199. package/cdn/chunks/chunk.XWYVG7GK.js +19 -0
  200. package/cdn/chunks/chunk.Y66HDAOP.js +32 -0
  201. package/cdn/chunks/chunk.YF7FICS7.js +19 -0
  202. package/cdn/chunks/chunk.YHKRAHVP.js +231 -0
  203. package/cdn/chunks/chunk.YPKEC5IK.js +29 -0
  204. package/cdn/chunks/chunk.YQ4SKOIN.js +132 -0
  205. package/cdn/chunks/chunk.Z3RVDKOC.js +15 -0
  206. package/cdn/chunks/chunk.Z44HWXXJ.js +195 -0
  207. package/cdn/chunks/chunk.ZAARA5NN.js +29 -0
  208. package/cdn/chunks/chunk.ZCVWVO2H.js +266 -0
  209. package/cdn/chunks/chunk.ZHIZCLYJ.js +93 -0
  210. package/cdn/chunks/chunk.ZL336EPZ.js +631 -0
  211. package/cdn/chunks/chunk.ZLI235RR.js +19 -0
  212. package/cdn/chunks/chunk.ZRV6GVL5.js +19 -0
  213. package/cdn/chunks/chunk.ZS67HYGB.js +56075 -0
  214. package/cdn/chunks/chunk.ZSELDXE4.js +19 -0
  215. package/cdn/chunks/chunk.ZZUDFWQK.js +19 -0
  216. package/cdn/chunks/lerc.WZVXX72L.js +2097 -0
  217. package/cdn/components/accordion/accordion.component.js +3 -3
  218. package/cdn/components/accordion/accordion.js +4 -4
  219. package/cdn/components/alert/alert.component.js +2 -2
  220. package/cdn/components/alert/alert.js +3 -3
  221. package/cdn/components/avatar/avatar.component.js +3 -3
  222. package/cdn/components/avatar/avatar.js +4 -4
  223. package/cdn/components/badge/badge.component.js +2 -2
  224. package/cdn/components/badge/badge.js +3 -3
  225. package/cdn/components/banner/banner.component.js +2 -2
  226. package/cdn/components/banner/banner.js +3 -3
  227. package/cdn/components/breadcrumb/breadcrumb.component.js +2 -2
  228. package/cdn/components/breadcrumb/breadcrumb.js +3 -3
  229. package/cdn/components/breadcrumbs/breadcrumbs.component.js +2 -2
  230. package/cdn/components/breadcrumbs/breadcrumbs.js +3 -3
  231. package/cdn/components/browse-variables/browse-variables.component.js +11 -11
  232. package/cdn/components/browse-variables/browse-variables.js +12 -12
  233. package/cdn/components/button/button.component.js +3 -3
  234. package/cdn/components/button/button.js +4 -4
  235. package/cdn/components/button-group/button-group.component.js +2 -2
  236. package/cdn/components/button-group/button-group.js +3 -3
  237. package/cdn/components/caption/caption.component.js +2 -2
  238. package/cdn/components/caption/caption.js +3 -3
  239. package/cdn/components/card/card.component.js +2 -2
  240. package/cdn/components/card/card.js +3 -3
  241. package/cdn/components/checkbox/checkbox.component.js +4 -4
  242. package/cdn/components/checkbox/checkbox.js +5 -5
  243. package/cdn/components/chip/chip.component.js +2 -2
  244. package/cdn/components/chip/chip.js +3 -3
  245. package/cdn/components/combobox/combobox.component.js +4 -4
  246. package/cdn/components/combobox/combobox.js +5 -5
  247. package/cdn/components/data-access/data-access.component.js +35 -25
  248. package/cdn/components/data-access/data-access.js +36 -26
  249. package/cdn/components/data-grid/data-grid.component.js +3 -3
  250. package/cdn/components/data-grid/data-grid.js +4 -4
  251. package/cdn/components/data-rods/data-rods.component.js +39 -29
  252. package/cdn/components/data-rods/data-rods.js +40 -30
  253. package/cdn/components/data-subsetter/data-subsetter.component.js +48 -38
  254. package/cdn/components/data-subsetter/data-subsetter.js +49 -39
  255. package/cdn/components/data-subsetter/notebooks/subsetter-notebook.js +1 -1
  256. package/cdn/components/data-subsetter-history/data-subsetter-history.component.js +50 -40
  257. package/cdn/components/data-subsetter-history/data-subsetter-history.js +51 -41
  258. package/cdn/components/date-picker/date-picker.component.js +7 -7
  259. package/cdn/components/date-picker/date-picker.js +8 -8
  260. package/cdn/components/date-range-slider/date-range-slider.component.js +2 -2
  261. package/cdn/components/date-range-slider/date-range-slider.js +3 -3
  262. package/cdn/components/dialog/dialog.component.js +4 -4
  263. package/cdn/components/dialog/dialog.js +5 -5
  264. package/cdn/components/divider/divider.component.js +2 -2
  265. package/cdn/components/divider/divider.js +3 -3
  266. package/cdn/components/dropdown/dropdown.component.js +3 -3
  267. package/cdn/components/dropdown/dropdown.js +4 -4
  268. package/cdn/components/earthdata-login/earthdata-login.component.js +10 -10
  269. package/cdn/components/earthdata-login/earthdata-login.js +11 -11
  270. package/cdn/components/file-upload/file-upload.component.js +2 -2
  271. package/cdn/components/file-upload/file-upload.js +3 -3
  272. package/cdn/components/harmony-history/harmony-history.component.js +6 -6
  273. package/cdn/components/harmony-history/harmony-history.js +7 -7
  274. package/cdn/components/icon/icon.component.js +2 -2
  275. package/cdn/components/icon/icon.js +3 -3
  276. package/cdn/components/input/input.component.js +3 -3
  277. package/cdn/components/input/input.js +4 -4
  278. package/cdn/components/loader/loader.component.js +2 -2
  279. package/cdn/components/loader/loader.js +3 -3
  280. package/cdn/components/login/login.component.js +8 -8
  281. package/cdn/components/login/login.js +9 -9
  282. package/cdn/components/map/controls/draw-toolbar.control.js +3 -1
  283. package/cdn/components/map/layers/base.layer.d.ts +7 -0
  284. package/cdn/components/map/layers/base.layer.js +12 -0
  285. package/cdn/components/map/layers/borders.layer.d.ts +6 -0
  286. package/cdn/components/map/layers/borders.layer.js +14 -0
  287. package/cdn/components/map/layers/bordersStyleConfig.d.ts +29 -0
  288. package/cdn/components/map/layers/bordersStyleConfig.js +7 -0
  289. package/cdn/components/map/layers/labels.layer.d.ts +6 -0
  290. package/cdn/components/map/layers/labels.layer.js +14 -0
  291. package/cdn/components/map/layers/labelsStyleConfig.d.ts +2337 -0
  292. package/cdn/components/map/layers/labelsStyleConfig.js +7 -0
  293. package/cdn/components/map/map.component.d.ts +42 -0
  294. package/cdn/components/map/map.component.js +17 -7
  295. package/cdn/components/map/map.js +18 -8
  296. package/cdn/components/map/map.service.d.ts +50 -1
  297. package/cdn/components/map/map.service.js +14 -4
  298. package/cdn/components/map/map.styles.js +1 -1
  299. package/cdn/components/menu/menu.component.js +2 -2
  300. package/cdn/components/menu/menu.js +3 -3
  301. package/cdn/components/menu-item/menu-item.component.js +5 -5
  302. package/cdn/components/menu-item/menu-item.js +6 -6
  303. package/cdn/components/option/option.component.js +3 -3
  304. package/cdn/components/option/option.js +4 -4
  305. package/cdn/components/pagination/pagination.component.js +3 -3
  306. package/cdn/components/pagination/pagination.js +4 -4
  307. package/cdn/components/plot/plot.component.js +2 -2
  308. package/cdn/components/plot/plot.js +3 -3
  309. package/cdn/components/plot-toolbar/notebooks/time-averaged-map-notebook.js +1 -1
  310. package/cdn/components/plot-toolbar/notebooks/time-series-notebook.js +1 -1
  311. package/cdn/components/plot-toolbar/plot-toolbar.component.js +25 -15
  312. package/cdn/components/plot-toolbar/plot-toolbar.js +26 -16
  313. package/cdn/components/popup/popup.component.js +2 -2
  314. package/cdn/components/popup/popup.js +3 -3
  315. package/cdn/components/progress-bar/progress-bar.component.js +2 -2
  316. package/cdn/components/progress-bar/progress-bar.js +3 -3
  317. package/cdn/components/radio/radio.component.js +2 -2
  318. package/cdn/components/radio/radio.js +3 -3
  319. package/cdn/components/radio-group/radio-group.component.js +2 -2
  320. package/cdn/components/radio-group/radio-group.js +3 -3
  321. package/cdn/components/scroll-hint/scroll-hint.component.js +3 -3
  322. package/cdn/components/scroll-hint/scroll-hint.js +4 -4
  323. package/cdn/components/select/select.component.js +5 -5
  324. package/cdn/components/select/select.js +6 -6
  325. package/cdn/components/site-header/site-header.component.js +3 -3
  326. package/cdn/components/site-header/site-header.js +3 -3
  327. package/cdn/components/site-navigation/site-navigation.component.js +2 -2
  328. package/cdn/components/site-navigation/site-navigation.js +2 -2
  329. package/cdn/components/skeleton/skeleton.component.js +2 -2
  330. package/cdn/components/skeleton/skeleton.js +3 -3
  331. package/cdn/components/slider/slider.component.js +2 -2
  332. package/cdn/components/slider/slider.js +3 -3
  333. package/cdn/components/spatial-picker/spatial-picker.component.js +22 -12
  334. package/cdn/components/spatial-picker/spatial-picker.js +23 -13
  335. package/cdn/components/status-indicator/status-indicator.component.js +2 -2
  336. package/cdn/components/status-indicator/status-indicator.js +3 -3
  337. package/cdn/components/stepper/stepper.component.js +2 -2
  338. package/cdn/components/stepper/stepper.js +3 -3
  339. package/cdn/components/stepper-step/stepper-step.component.js +3 -3
  340. package/cdn/components/stepper-step/stepper-step.js +4 -4
  341. package/cdn/components/tab/tab.component.js +3 -3
  342. package/cdn/components/tab/tab.js +4 -4
  343. package/cdn/components/tab-panel/tab-panel.component.js +2 -2
  344. package/cdn/components/tab-panel/tab-panel.js +3 -3
  345. package/cdn/components/tabs/tabs.component.js +3 -3
  346. package/cdn/components/tabs/tabs.js +4 -4
  347. package/cdn/components/tag/tag.component.js +3 -3
  348. package/cdn/components/tag/tag.js +4 -4
  349. package/cdn/components/textarea/textarea.component.js +2 -2
  350. package/cdn/components/textarea/textarea.js +3 -3
  351. package/cdn/components/time-average-map/time-average-map.component.d.ts +12 -8
  352. package/cdn/components/time-average-map/time-average-map.component.js +32 -22
  353. package/cdn/components/time-average-map/time-average-map.controller.d.ts +5 -0
  354. package/cdn/components/time-average-map/time-average-map.controller.js +1 -1
  355. package/cdn/components/time-average-map/time-average-map.js +33 -23
  356. package/cdn/components/time-average-map/time-average-map.styles.js +1 -1
  357. package/cdn/components/time-series/time-series.component.js +31 -21
  358. package/cdn/components/time-series/time-series.controller.d.ts +5 -0
  359. package/cdn/components/time-series/time-series.controller.js +1 -1
  360. package/cdn/components/time-series/time-series.js +32 -22
  361. package/cdn/components/toast/toast.component.js +3 -3
  362. package/cdn/components/toast/toast.js +4 -4
  363. package/cdn/components/toggle/toggle.component.js +2 -2
  364. package/cdn/components/toggle/toggle.js +3 -3
  365. package/cdn/components/tooltip/tooltip.component.js +3 -3
  366. package/cdn/components/tooltip/tooltip.js +4 -4
  367. package/cdn/components/variable-combobox/variable-combobox.component.js +8 -8
  368. package/cdn/components/variable-combobox/variable-combobox.js +9 -9
  369. package/cdn/components/variable-keyword-search/variable-keyword-search.component.js +7 -7
  370. package/cdn/components/variable-keyword-search/variable-keyword-search.js +8 -8
  371. package/cdn/custom-elements.json +6691 -6612
  372. package/cdn/events/events.d.ts +1 -1
  373. package/cdn/events/terra-map-change.d.ts +6 -0
  374. package/cdn/react/accordion/index.js +4 -4
  375. package/cdn/react/alert/index.js +3 -3
  376. package/cdn/react/avatar/index.js +4 -4
  377. package/cdn/react/badge/index.js +3 -3
  378. package/cdn/react/banner/index.js +3 -3
  379. package/cdn/react/breadcrumb/index.js +3 -3
  380. package/cdn/react/breadcrumbs/index.js +3 -3
  381. package/cdn/react/browse-variables/index.js +12 -12
  382. package/cdn/react/button/index.js +4 -4
  383. package/cdn/react/button-group/index.js +3 -3
  384. package/cdn/react/caption/index.js +3 -3
  385. package/cdn/react/card/index.js +3 -3
  386. package/cdn/react/checkbox/index.js +5 -5
  387. package/cdn/react/chip/index.js +3 -3
  388. package/cdn/react/combobox/index.js +5 -5
  389. package/cdn/react/data-access/index.js +36 -26
  390. package/cdn/react/data-grid/index.js +4 -4
  391. package/cdn/react/data-rods/index.js +40 -30
  392. package/cdn/react/data-subsetter/index.js +49 -39
  393. package/cdn/react/data-subsetter-history/index.js +51 -41
  394. package/cdn/react/date-picker/index.js +8 -8
  395. package/cdn/react/date-range-slider/index.js +3 -3
  396. package/cdn/react/dialog/index.js +5 -5
  397. package/cdn/react/divider/index.js +3 -3
  398. package/cdn/react/dropdown/index.js +4 -4
  399. package/cdn/react/earthdata-login/index.js +11 -11
  400. package/cdn/react/file-upload/index.js +3 -3
  401. package/cdn/react/harmony-history/index.js +7 -7
  402. package/cdn/react/icon/index.js +3 -3
  403. package/cdn/react/index.d.ts +20 -20
  404. package/cdn/react/index.js +232 -222
  405. package/cdn/react/input/index.js +4 -4
  406. package/cdn/react/loader/index.js +3 -3
  407. package/cdn/react/login/index.js +9 -9
  408. package/cdn/react/map/index.js +18 -8
  409. package/cdn/react/menu/index.js +3 -3
  410. package/cdn/react/menu-item/index.js +6 -6
  411. package/cdn/react/option/index.js +4 -4
  412. package/cdn/react/pagination/index.js +4 -4
  413. package/cdn/react/plot/index.js +3 -3
  414. package/cdn/react/plot-toolbar/index.js +26 -16
  415. package/cdn/react/popup/index.js +3 -3
  416. package/cdn/react/progress-bar/index.js +3 -3
  417. package/cdn/react/radio/index.js +3 -3
  418. package/cdn/react/radio-group/index.js +3 -3
  419. package/cdn/react/scroll-hint/index.js +4 -4
  420. package/cdn/react/select/index.js +6 -6
  421. package/cdn/react/site-header/index.js +4 -4
  422. package/cdn/react/site-navigation/index.js +3 -3
  423. package/cdn/react/skeleton/index.js +3 -3
  424. package/cdn/react/slider/index.js +3 -3
  425. package/cdn/react/spatial-picker/index.js +23 -13
  426. package/cdn/react/status-indicator/index.js +3 -3
  427. package/cdn/react/stepper/index.js +3 -3
  428. package/cdn/react/stepper-step/index.js +4 -4
  429. package/cdn/react/tab/index.js +4 -4
  430. package/cdn/react/tab-panel/index.js +3 -3
  431. package/cdn/react/tabs/index.js +4 -4
  432. package/cdn/react/tag/index.js +4 -4
  433. package/cdn/react/textarea/index.js +3 -3
  434. package/cdn/react/time-average-map/index.js +33 -23
  435. package/cdn/react/time-series/index.js +32 -22
  436. package/cdn/react/toast/index.js +4 -4
  437. package/cdn/react/toggle/index.js +3 -3
  438. package/cdn/react/tooltip/index.js +4 -4
  439. package/cdn/react/variable-combobox/index.js +9 -9
  440. package/cdn/react/variable-keyword-search/index.js +8 -8
  441. package/cdn/terra-ui-components.js +229 -219
  442. package/cdn/types/vue/index.d.ts +890 -870
  443. package/cdn/vscode.html-custom-data.json +625 -619
  444. package/cdn/web-types.json +2087 -2074
  445. package/dist/chunks/chunk.2HEXM6MX.js +154 -0
  446. package/dist/chunks/chunk.2XFQ7HNR.js +1 -0
  447. package/dist/chunks/chunk.2ZDFC7XD.js +5 -0
  448. package/dist/chunks/chunk.3AF4SJ26.js +780 -0
  449. package/dist/chunks/chunk.3CP7SY7X.js +1 -0
  450. package/dist/chunks/chunk.3NAZF34U.js +1 -0
  451. package/dist/chunks/chunk.3R2J27ZS.js +25 -0
  452. package/dist/chunks/chunk.3XRKWNW5.js +1 -0
  453. package/dist/chunks/chunk.3YJGZAO5.js +1 -0
  454. package/dist/chunks/chunk.447IKCOD.js +1 -0
  455. package/dist/chunks/chunk.44AWWV54.js +30 -0
  456. package/dist/chunks/chunk.46DYUPBX.js +22 -0
  457. package/dist/chunks/chunk.4E2BUN4F.js +1 -0
  458. package/dist/chunks/chunk.4NDKE3PZ.js +1 -0
  459. package/dist/chunks/chunk.4RFJMMAN.js +1 -0
  460. package/dist/chunks/chunk.4SRXQYLE.js +39 -0
  461. package/dist/chunks/chunk.4ZQUOM75.js +80 -0
  462. package/dist/chunks/chunk.5DDZRQCR.js +26 -0
  463. package/dist/chunks/chunk.5DJQBDNY.js +99 -0
  464. package/dist/chunks/chunk.5GJQRKUS.js +1 -0
  465. package/dist/chunks/chunk.5GTOXSEK.js +24 -0
  466. package/dist/chunks/chunk.5HY3BVXE.js +23 -0
  467. package/dist/chunks/chunk.5MNSQC5Z.js +43 -0
  468. package/dist/chunks/chunk.5S57Z6MY.js +1 -0
  469. package/dist/chunks/chunk.63KFBVDZ.js +125 -0
  470. package/dist/chunks/chunk.66FVHWWG.js +1 -0
  471. package/dist/chunks/chunk.6C3T5LR6.js +1 -0
  472. package/dist/chunks/chunk.6D4YDDOH.js +148 -0
  473. package/dist/chunks/chunk.6OVOBLEB.js +1 -0
  474. package/dist/chunks/chunk.6QWTHDDS.js +1 -0
  475. package/dist/chunks/chunk.6TIISOSM.js +1 -0
  476. package/dist/chunks/chunk.6UUXXIO5.js +1 -0
  477. package/dist/chunks/chunk.6YB2WV52.js +9 -0
  478. package/dist/chunks/chunk.6YNWYAON.js +1 -0
  479. package/dist/chunks/chunk.74UO2S6X.js +26 -0
  480. package/dist/chunks/chunk.75Q2DUI4.js +145 -0
  481. package/dist/chunks/chunk.7DCDWHIP.js +1 -0
  482. package/dist/chunks/chunk.7KOIBYPW.js +1 -0
  483. package/dist/chunks/chunk.7LW5MDPV.js +1 -0
  484. package/dist/chunks/chunk.7RSJSUF5.js +122 -0
  485. package/dist/chunks/chunk.7VL5XLTF.js +1 -0
  486. package/dist/chunks/chunk.7ZTODERJ.js +61 -0
  487. package/dist/chunks/chunk.A4JPZBCU.js +1 -0
  488. package/dist/chunks/chunk.A6XZHXKG.js +17 -0
  489. package/dist/chunks/chunk.ABDHAYTU.js +1 -0
  490. package/dist/chunks/chunk.AF4KKKIK.js +176 -0
  491. package/dist/chunks/chunk.AOJ7CENL.js +1 -0
  492. package/dist/chunks/chunk.ATX7REBU.js +1 -0
  493. package/dist/chunks/chunk.AUBMY7XI.js +8 -0
  494. package/dist/chunks/chunk.AV5MTWD4.js +1 -0
  495. package/dist/chunks/chunk.AWA2ZGEV.js +300 -0
  496. package/dist/chunks/chunk.AXXCXZWY.js +1 -0
  497. package/dist/chunks/chunk.AYEBTFZT.js +433 -0
  498. package/dist/chunks/chunk.B5FLJR3A.js +37 -0
  499. package/dist/chunks/chunk.BCI323BR.js +1 -0
  500. package/dist/chunks/chunk.BQ2TQQGG.js +1 -0
  501. package/dist/chunks/chunk.BRSDDKYM.js +33 -0
  502. package/dist/chunks/chunk.BYWODPGT.js +1 -0
  503. package/dist/chunks/chunk.C5S23DNK.js +1 -0
  504. package/dist/chunks/chunk.CBLMIMXD.js +20 -0
  505. package/dist/chunks/chunk.CC3TFKZ5.js +1 -0
  506. package/dist/chunks/chunk.CLGMXYFG.js +1 -0
  507. package/dist/chunks/chunk.CLQSO2B3.js +1 -0
  508. package/dist/chunks/chunk.CMABIFU7.js +1 -0
  509. package/dist/chunks/chunk.CS5XSAK7.js +1 -0
  510. package/dist/chunks/chunk.D5GCNDYG.js +1 -0
  511. package/dist/chunks/chunk.DANE2DV4.js +1 -0
  512. package/dist/chunks/chunk.DBLKA334.js +1 -0
  513. package/dist/chunks/chunk.DHUDN5NR.js +1 -0
  514. package/dist/chunks/chunk.DK636C4K.js +19 -0
  515. package/dist/chunks/chunk.DSIIF7K6.js +1 -0
  516. package/dist/chunks/chunk.DUG6LPDO.js +1 -0
  517. package/dist/chunks/chunk.DXULPI2C.js +1 -0
  518. package/dist/chunks/chunk.ECXCY3XX.js +12 -0
  519. package/dist/chunks/chunk.EFQ4VOA6.js +1 -0
  520. package/dist/chunks/chunk.EHEFJ4UM.js +35 -0
  521. package/dist/chunks/chunk.EPMIYG6Y.js +113 -0
  522. package/dist/chunks/chunk.F5HERH3C.js +1 -0
  523. package/dist/chunks/chunk.FEBNDE5C.js +1 -0
  524. package/dist/chunks/chunk.FSHLOPG4.js +1 -0
  525. package/dist/chunks/chunk.FTC6BJLL.js +47 -0
  526. package/dist/chunks/chunk.FWNUKBYM.js +1 -0
  527. package/dist/chunks/chunk.GCKLOHLJ.js +1 -0
  528. package/dist/chunks/chunk.GQT3QXWD.js +1 -0
  529. package/dist/chunks/chunk.GSCUNOLU.js +30 -0
  530. package/dist/chunks/chunk.GUIMVPU3.js +1 -0
  531. package/dist/chunks/chunk.GXCYLTXI.js +1 -0
  532. package/dist/chunks/chunk.H2EZ7VOW.js +1 -0
  533. package/dist/chunks/chunk.H2MRWWA5.js +1 -0
  534. package/dist/chunks/chunk.H4WCUAI5.js +1 -0
  535. package/dist/chunks/chunk.H6HYWCWZ.js +55 -0
  536. package/dist/chunks/chunk.HKXBQIJC.js +1 -0
  537. package/dist/chunks/chunk.HLRV2WXA.js +1 -0
  538. package/dist/chunks/chunk.HPSHJNUL.js +1 -0
  539. package/dist/chunks/chunk.HQE6JQ36.js +1 -0
  540. package/dist/chunks/chunk.HTRDWX5D.js +1 -0
  541. package/dist/chunks/chunk.I2H5CL5B.js +1 -0
  542. package/dist/chunks/chunk.I2VZCTPD.js +1 -0
  543. package/dist/chunks/chunk.I3ABET54.js +1 -0
  544. package/dist/chunks/chunk.I4XNSZMV.js +14 -0
  545. package/dist/chunks/chunk.IDRV4QVY.js +75 -0
  546. package/dist/chunks/chunk.IHH2EMZT.js +280 -0
  547. package/dist/chunks/chunk.IX4DTAAR.js +1 -0
  548. package/dist/chunks/chunk.IYYXOBVJ.js +1 -0
  549. package/dist/chunks/chunk.J6YMXA4V.js +1 -0
  550. package/dist/chunks/chunk.JF64QOIK.js +1 -0
  551. package/dist/chunks/chunk.JMGGBACY.js +1 -0
  552. package/dist/chunks/chunk.JPRIHHL3.js +1 -0
  553. package/dist/chunks/chunk.JUV3F76R.js +35 -0
  554. package/dist/chunks/chunk.K67524WR.js +1 -0
  555. package/dist/chunks/chunk.K6KJNAUI.js +1 -0
  556. package/dist/chunks/chunk.KCCCUPQI.js +74 -0
  557. package/dist/chunks/chunk.KDP7MFSQ.js +1 -0
  558. package/dist/chunks/chunk.KG3775TI.js +1 -0
  559. package/dist/chunks/chunk.KG4H7K5W.js +11 -0
  560. package/dist/chunks/chunk.KIXW3H6F.js +1 -0
  561. package/dist/chunks/chunk.KRQB5VTT.js +1 -0
  562. package/dist/chunks/chunk.KSEX673E.js +1 -0
  563. package/dist/chunks/chunk.KUPSLOUX.js +1 -0
  564. package/dist/chunks/chunk.L2IUPHO3.js +1 -0
  565. package/dist/chunks/chunk.LCGVUMKQ.js +43 -0
  566. package/dist/chunks/chunk.LFHFYBLO.js +1 -0
  567. package/dist/chunks/chunk.LICY6WJT.js +4 -0
  568. package/dist/chunks/chunk.LKQ44YSQ.js +1 -0
  569. package/dist/chunks/chunk.M4G2JEW2.js +1 -0
  570. package/dist/chunks/chunk.MBOEFHQI.js +55 -0
  571. package/dist/chunks/chunk.MCR2VZQP.js +1 -0
  572. package/dist/chunks/chunk.MGN6FPMX.js +1 -0
  573. package/dist/chunks/chunk.MOWA5ULN.js +1 -0
  574. package/dist/chunks/chunk.MPDRWVZL.js +1 -0
  575. package/dist/chunks/chunk.MSBCPIGA.js +1 -0
  576. package/dist/chunks/chunk.N4IMML6I.js +121 -0
  577. package/dist/chunks/chunk.NRTWU3TW.js +1 -0
  578. package/dist/chunks/chunk.NW27EPOF.js +5 -0
  579. package/dist/chunks/chunk.NXSYWMFP.js +1 -0
  580. package/dist/chunks/chunk.NZNJPDVW.js +1 -0
  581. package/dist/chunks/chunk.OAALYDNZ.js +1 -0
  582. package/dist/chunks/chunk.OANTUX24.js +48 -0
  583. package/dist/chunks/chunk.OFOCDP2M.js +1 -0
  584. package/dist/chunks/chunk.OJUQFN4A.js +27 -0
  585. package/dist/chunks/chunk.OPBZIY2A.js +1 -0
  586. package/dist/chunks/chunk.OT6SFBQX.js +1 -0
  587. package/dist/chunks/chunk.OWZEKFKL.js +1 -0
  588. package/dist/chunks/chunk.OZUKFWGD.js +1 -0
  589. package/dist/chunks/chunk.P5XWJ5HC.js +1 -0
  590. package/dist/chunks/chunk.PR7E6KYS.js +1 -0
  591. package/dist/chunks/chunk.PTN44XCI.js +572 -0
  592. package/dist/chunks/chunk.PWT5JMOP.js +1 -0
  593. package/dist/chunks/chunk.QBXUVQTY.js +1 -0
  594. package/dist/chunks/chunk.QIS56XCC.js +1 -0
  595. package/dist/chunks/chunk.QP5FZIRF.js +1 -0
  596. package/dist/chunks/chunk.QQV7OIO7.js +55 -0
  597. package/dist/chunks/chunk.QS2CNV3Q.js +1 -0
  598. package/dist/chunks/chunk.QUULVCZU.js +1 -0
  599. package/dist/chunks/chunk.R4JAF7DS.js +1 -0
  600. package/dist/chunks/chunk.RFRYQSE5.js +41 -0
  601. package/dist/chunks/chunk.RIDJTVHV.js +1 -0
  602. package/dist/chunks/chunk.RNGOVZGF.js +9 -0
  603. package/dist/chunks/chunk.RRTP2FHP.js +1 -0
  604. package/dist/chunks/chunk.RW66TULD.js +1 -0
  605. package/dist/chunks/chunk.RXSKPOBF.js +1 -0
  606. package/dist/chunks/chunk.RYL27WYB.js +1 -0
  607. package/dist/chunks/chunk.SAHUIO3P.js +1 -0
  608. package/dist/chunks/chunk.SPNO75Q4.js +514 -0
  609. package/dist/chunks/chunk.SY3HGJA3.js +100 -0
  610. package/dist/chunks/chunk.SYGSWLVD.js +1 -0
  611. package/dist/chunks/chunk.TAQ6A3B7.js +2 -0
  612. package/dist/chunks/chunk.TQZFMQPE.js +11 -0
  613. package/dist/chunks/chunk.TSOQGANL.js +1 -0
  614. package/dist/chunks/chunk.TTWUGVNW.js +1 -0
  615. package/dist/chunks/chunk.UCO7ADVP.js +64 -0
  616. package/dist/chunks/chunk.UFJISWXG.js +1 -0
  617. package/dist/chunks/chunk.UFYFMNUK.js +1 -0
  618. package/dist/chunks/chunk.UIQXEV7N.js +67 -0
  619. package/dist/chunks/chunk.UZHA3QCH.js +1190 -0
  620. package/dist/chunks/chunk.UZI5DYPK.js +41 -0
  621. package/dist/chunks/chunk.UZZBJV4T.js +1 -0
  622. package/dist/chunks/chunk.V34PEB3H.js +1 -0
  623. package/dist/chunks/chunk.V4X3J7H5.js +1 -0
  624. package/dist/chunks/chunk.VILSXY2Q.js +1 -0
  625. package/dist/chunks/chunk.VSPWNHOW.js +1 -0
  626. package/dist/chunks/chunk.VT3KMZ66.js +1 -0
  627. package/dist/chunks/chunk.VZESRFZQ.js +62 -0
  628. package/dist/chunks/chunk.W57YAS2G.js +1 -0
  629. package/dist/chunks/chunk.WDHC6FGQ.js +157 -0
  630. package/dist/chunks/chunk.WE4PQXFD.js +65 -0
  631. package/dist/chunks/chunk.WG457PDK.js +1 -0
  632. package/dist/chunks/chunk.WJQTKD6X.js +1 -0
  633. package/dist/chunks/chunk.WKNEHZOD.js +16 -0
  634. package/dist/chunks/chunk.WQFHYRFG.js +1 -0
  635. package/dist/chunks/chunk.WTDZWPN3.js +1 -0
  636. package/dist/chunks/chunk.WZYEI2K3.js +1 -0
  637. package/dist/chunks/chunk.X266J3HR.js +1 -0
  638. package/dist/chunks/chunk.X74E6IXG.js +1 -0
  639. package/dist/chunks/chunk.XA6IYBQ4.js +1 -0
  640. package/dist/chunks/chunk.XAZE2FE3.js +1 -0
  641. package/dist/chunks/chunk.XJKVDKZL.js +1 -0
  642. package/dist/chunks/chunk.XUAILPGW.js +1 -0
  643. package/dist/chunks/chunk.XV7MX5O2.js +1 -0
  644. package/dist/chunks/chunk.YA5FFFLQ.js +20 -0
  645. package/dist/chunks/chunk.YDXNKY2Y.js +1 -0
  646. package/dist/chunks/chunk.YOFBYVP5.js +6 -0
  647. package/dist/chunks/chunk.YR5SSBSW.js +299 -0
  648. package/dist/chunks/chunk.YUDIM7TE.js +1 -0
  649. package/dist/chunks/chunk.YX5E2IPT.js +1 -0
  650. package/dist/chunks/chunk.ZRR3M7ZR.js +8 -0
  651. package/dist/chunks/chunk.ZUZ7QHWU.js +1 -0
  652. package/dist/components/accordion/accordion.component.js +1 -1
  653. package/dist/components/accordion/accordion.js +1 -1
  654. package/dist/components/alert/alert.component.js +1 -1
  655. package/dist/components/alert/alert.js +1 -1
  656. package/dist/components/avatar/avatar.component.js +1 -1
  657. package/dist/components/avatar/avatar.js +1 -1
  658. package/dist/components/badge/badge.component.js +1 -1
  659. package/dist/components/badge/badge.js +1 -1
  660. package/dist/components/banner/banner.component.js +1 -1
  661. package/dist/components/banner/banner.js +1 -1
  662. package/dist/components/breadcrumb/breadcrumb.component.js +1 -1
  663. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  664. package/dist/components/breadcrumbs/breadcrumbs.component.js +1 -1
  665. package/dist/components/breadcrumbs/breadcrumbs.js +1 -1
  666. package/dist/components/browse-variables/browse-variables.component.js +1 -1
  667. package/dist/components/browse-variables/browse-variables.js +1 -1
  668. package/dist/components/button/button.component.js +1 -1
  669. package/dist/components/button/button.js +1 -1
  670. package/dist/components/button-group/button-group.component.js +1 -1
  671. package/dist/components/button-group/button-group.js +1 -1
  672. package/dist/components/caption/caption.component.js +1 -1
  673. package/dist/components/caption/caption.js +1 -1
  674. package/dist/components/card/card.component.js +1 -1
  675. package/dist/components/card/card.js +1 -1
  676. package/dist/components/checkbox/checkbox.component.js +1 -1
  677. package/dist/components/checkbox/checkbox.js +1 -1
  678. package/dist/components/chip/chip.component.js +1 -1
  679. package/dist/components/chip/chip.js +1 -1
  680. package/dist/components/combobox/combobox.component.js +1 -1
  681. package/dist/components/combobox/combobox.js +1 -1
  682. package/dist/components/data-access/data-access.component.js +1 -1
  683. package/dist/components/data-access/data-access.js +1 -1
  684. package/dist/components/data-grid/data-grid.component.js +1 -1
  685. package/dist/components/data-grid/data-grid.js +1 -1
  686. package/dist/components/data-rods/data-rods.component.js +1 -1
  687. package/dist/components/data-rods/data-rods.js +1 -1
  688. package/dist/components/data-subsetter/data-subsetter.component.js +1 -1
  689. package/dist/components/data-subsetter/data-subsetter.js +1 -1
  690. package/dist/components/data-subsetter/notebooks/subsetter-notebook.js +1 -1
  691. package/dist/components/data-subsetter-history/data-subsetter-history.component.js +1 -1
  692. package/dist/components/data-subsetter-history/data-subsetter-history.js +1 -1
  693. package/dist/components/date-picker/date-picker.component.js +1 -1
  694. package/dist/components/date-picker/date-picker.js +1 -1
  695. package/dist/components/date-range-slider/date-range-slider.component.js +1 -1
  696. package/dist/components/date-range-slider/date-range-slider.js +1 -1
  697. package/dist/components/dialog/dialog.component.js +1 -1
  698. package/dist/components/dialog/dialog.js +1 -1
  699. package/dist/components/divider/divider.component.js +1 -1
  700. package/dist/components/divider/divider.js +1 -1
  701. package/dist/components/dropdown/dropdown.component.js +1 -1
  702. package/dist/components/dropdown/dropdown.js +1 -1
  703. package/dist/components/earthdata-login/earthdata-login.component.js +1 -1
  704. package/dist/components/earthdata-login/earthdata-login.js +1 -1
  705. package/dist/components/file-upload/file-upload.component.js +1 -1
  706. package/dist/components/file-upload/file-upload.js +1 -1
  707. package/dist/components/harmony-history/harmony-history.component.js +1 -1
  708. package/dist/components/harmony-history/harmony-history.js +1 -1
  709. package/dist/components/icon/icon.component.js +1 -1
  710. package/dist/components/icon/icon.js +1 -1
  711. package/dist/components/input/input.component.js +1 -1
  712. package/dist/components/input/input.js +1 -1
  713. package/dist/components/loader/loader.component.js +1 -1
  714. package/dist/components/loader/loader.js +1 -1
  715. package/dist/components/login/login.component.js +1 -1
  716. package/dist/components/login/login.js +1 -1
  717. package/dist/components/map/layers/base.layer.d.ts +7 -0
  718. package/dist/components/map/layers/base.layer.js +1 -0
  719. package/dist/components/map/layers/borders.layer.d.ts +6 -0
  720. package/dist/components/map/layers/borders.layer.js +1 -0
  721. package/dist/components/map/layers/bordersStyleConfig.d.ts +29 -0
  722. package/dist/components/map/layers/bordersStyleConfig.js +1 -0
  723. package/dist/components/map/layers/labels.layer.d.ts +6 -0
  724. package/dist/components/map/layers/labels.layer.js +1 -0
  725. package/dist/components/map/layers/labelsStyleConfig.d.ts +2337 -0
  726. package/dist/components/map/layers/labelsStyleConfig.js +1 -0
  727. package/dist/components/map/map.component.d.ts +42 -0
  728. package/dist/components/map/map.component.js +1 -1
  729. package/dist/components/map/map.js +1 -1
  730. package/dist/components/map/map.service.d.ts +50 -1
  731. package/dist/components/map/map.service.js +1 -1
  732. package/dist/components/map/map.styles.js +1 -1
  733. package/dist/components/menu/menu.component.js +1 -1
  734. package/dist/components/menu/menu.js +1 -1
  735. package/dist/components/menu-item/menu-item.component.js +1 -1
  736. package/dist/components/menu-item/menu-item.js +1 -1
  737. package/dist/components/option/option.component.js +1 -1
  738. package/dist/components/option/option.js +1 -1
  739. package/dist/components/pagination/pagination.component.js +1 -1
  740. package/dist/components/pagination/pagination.js +1 -1
  741. package/dist/components/plot/plot.component.js +1 -1
  742. package/dist/components/plot/plot.js +1 -1
  743. package/dist/components/plot-toolbar/notebooks/time-averaged-map-notebook.js +1 -1
  744. package/dist/components/plot-toolbar/notebooks/time-series-notebook.js +1 -1
  745. package/dist/components/plot-toolbar/plot-toolbar.component.js +1 -1
  746. package/dist/components/plot-toolbar/plot-toolbar.js +1 -1
  747. package/dist/components/popup/popup.component.js +1 -1
  748. package/dist/components/popup/popup.js +1 -1
  749. package/dist/components/progress-bar/progress-bar.component.js +1 -1
  750. package/dist/components/progress-bar/progress-bar.js +1 -1
  751. package/dist/components/radio/radio.component.js +1 -1
  752. package/dist/components/radio/radio.js +1 -1
  753. package/dist/components/radio-group/radio-group.component.js +1 -1
  754. package/dist/components/radio-group/radio-group.js +1 -1
  755. package/dist/components/scroll-hint/scroll-hint.component.js +1 -1
  756. package/dist/components/scroll-hint/scroll-hint.js +1 -1
  757. package/dist/components/select/select.component.js +1 -1
  758. package/dist/components/select/select.js +1 -1
  759. package/dist/components/site-header/site-header.component.js +1 -1
  760. package/dist/components/site-header/site-header.js +1 -1
  761. package/dist/components/site-navigation/site-navigation.component.js +1 -1
  762. package/dist/components/site-navigation/site-navigation.js +1 -1
  763. package/dist/components/skeleton/skeleton.component.js +1 -1
  764. package/dist/components/skeleton/skeleton.js +1 -1
  765. package/dist/components/slider/slider.component.js +1 -1
  766. package/dist/components/slider/slider.js +1 -1
  767. package/dist/components/spatial-picker/spatial-picker.component.js +1 -1
  768. package/dist/components/spatial-picker/spatial-picker.js +1 -1
  769. package/dist/components/status-indicator/status-indicator.component.js +1 -1
  770. package/dist/components/status-indicator/status-indicator.js +1 -1
  771. package/dist/components/stepper/stepper.component.js +1 -1
  772. package/dist/components/stepper/stepper.js +1 -1
  773. package/dist/components/stepper-step/stepper-step.component.js +1 -1
  774. package/dist/components/stepper-step/stepper-step.js +1 -1
  775. package/dist/components/tab/tab.component.js +1 -1
  776. package/dist/components/tab/tab.js +1 -1
  777. package/dist/components/tab-panel/tab-panel.component.js +1 -1
  778. package/dist/components/tab-panel/tab-panel.js +1 -1
  779. package/dist/components/tabs/tabs.component.js +1 -1
  780. package/dist/components/tabs/tabs.js +1 -1
  781. package/dist/components/tag/tag.component.js +1 -1
  782. package/dist/components/tag/tag.js +1 -1
  783. package/dist/components/textarea/textarea.component.js +1 -1
  784. package/dist/components/textarea/textarea.js +1 -1
  785. package/dist/components/time-average-map/time-average-map.component.d.ts +12 -8
  786. package/dist/components/time-average-map/time-average-map.component.js +1 -1
  787. package/dist/components/time-average-map/time-average-map.controller.d.ts +5 -0
  788. package/dist/components/time-average-map/time-average-map.controller.js +1 -1
  789. package/dist/components/time-average-map/time-average-map.js +1 -1
  790. package/dist/components/time-average-map/time-average-map.styles.js +1 -1
  791. package/dist/components/time-series/time-series.component.js +1 -1
  792. package/dist/components/time-series/time-series.controller.d.ts +5 -0
  793. package/dist/components/time-series/time-series.controller.js +1 -1
  794. package/dist/components/time-series/time-series.js +1 -1
  795. package/dist/components/toast/toast.component.js +1 -1
  796. package/dist/components/toast/toast.js +1 -1
  797. package/dist/components/toggle/toggle.component.js +1 -1
  798. package/dist/components/toggle/toggle.js +1 -1
  799. package/dist/components/tooltip/tooltip.component.js +1 -1
  800. package/dist/components/tooltip/tooltip.js +1 -1
  801. package/dist/components/variable-combobox/variable-combobox.component.js +1 -1
  802. package/dist/components/variable-combobox/variable-combobox.js +1 -1
  803. package/dist/components/variable-keyword-search/variable-keyword-search.component.js +1 -1
  804. package/dist/components/variable-keyword-search/variable-keyword-search.js +1 -1
  805. package/dist/custom-elements.json +6691 -6612
  806. package/dist/events/events.d.ts +1 -1
  807. package/dist/events/terra-map-change.d.ts +6 -0
  808. package/dist/react/accordion/index.js +1 -1
  809. package/dist/react/alert/index.js +1 -1
  810. package/dist/react/avatar/index.js +1 -1
  811. package/dist/react/badge/index.js +1 -1
  812. package/dist/react/banner/index.js +1 -1
  813. package/dist/react/breadcrumb/index.js +1 -1
  814. package/dist/react/breadcrumbs/index.js +1 -1
  815. package/dist/react/browse-variables/index.js +1 -1
  816. package/dist/react/button/index.js +1 -1
  817. package/dist/react/button-group/index.js +1 -1
  818. package/dist/react/caption/index.js +1 -1
  819. package/dist/react/card/index.js +1 -1
  820. package/dist/react/checkbox/index.js +1 -1
  821. package/dist/react/chip/index.js +1 -1
  822. package/dist/react/combobox/index.js +1 -1
  823. package/dist/react/data-access/index.js +1 -1
  824. package/dist/react/data-grid/index.js +1 -1
  825. package/dist/react/data-rods/index.js +1 -1
  826. package/dist/react/data-subsetter/index.js +1 -1
  827. package/dist/react/data-subsetter-history/index.js +1 -1
  828. package/dist/react/date-picker/index.js +1 -1
  829. package/dist/react/date-range-slider/index.js +1 -1
  830. package/dist/react/dialog/index.js +1 -1
  831. package/dist/react/divider/index.js +1 -1
  832. package/dist/react/dropdown/index.js +1 -1
  833. package/dist/react/earthdata-login/index.js +1 -1
  834. package/dist/react/file-upload/index.js +1 -1
  835. package/dist/react/harmony-history/index.js +1 -1
  836. package/dist/react/icon/index.js +1 -1
  837. package/dist/react/index.d.ts +20 -20
  838. package/dist/react/index.js +1 -1
  839. package/dist/react/input/index.js +1 -1
  840. package/dist/react/loader/index.js +1 -1
  841. package/dist/react/login/index.js +1 -1
  842. package/dist/react/map/index.js +1 -1
  843. package/dist/react/menu/index.js +1 -1
  844. package/dist/react/menu-item/index.js +1 -1
  845. package/dist/react/option/index.js +1 -1
  846. package/dist/react/pagination/index.js +1 -1
  847. package/dist/react/plot/index.js +1 -1
  848. package/dist/react/plot-toolbar/index.js +1 -1
  849. package/dist/react/popup/index.js +1 -1
  850. package/dist/react/progress-bar/index.js +1 -1
  851. package/dist/react/radio/index.js +1 -1
  852. package/dist/react/radio-group/index.js +1 -1
  853. package/dist/react/scroll-hint/index.js +1 -1
  854. package/dist/react/select/index.js +1 -1
  855. package/dist/react/site-header/index.js +1 -1
  856. package/dist/react/site-navigation/index.js +1 -1
  857. package/dist/react/skeleton/index.js +1 -1
  858. package/dist/react/slider/index.js +1 -1
  859. package/dist/react/spatial-picker/index.js +1 -1
  860. package/dist/react/status-indicator/index.js +1 -1
  861. package/dist/react/stepper/index.js +1 -1
  862. package/dist/react/stepper-step/index.js +1 -1
  863. package/dist/react/tab/index.js +1 -1
  864. package/dist/react/tab-panel/index.js +1 -1
  865. package/dist/react/tabs/index.js +1 -1
  866. package/dist/react/tag/index.js +1 -1
  867. package/dist/react/textarea/index.js +1 -1
  868. package/dist/react/time-average-map/index.js +1 -1
  869. package/dist/react/time-series/index.js +1 -1
  870. package/dist/react/toast/index.js +1 -1
  871. package/dist/react/toggle/index.js +1 -1
  872. package/dist/react/tooltip/index.js +1 -1
  873. package/dist/react/variable-combobox/index.js +1 -1
  874. package/dist/react/variable-keyword-search/index.js +1 -1
  875. package/dist/terra-ui-components.js +1 -1
  876. package/dist/terra_ui_components-0.0.199-py3-none-any.whl +0 -0
  877. package/dist/terra_ui_components-0.0.199.tar.gz +0 -0
  878. package/dist/types/vue/index.d.ts +890 -870
  879. package/dist/vscode.html-custom-data.json +625 -619
  880. package/dist/web-types.json +2087 -2074
  881. package/package.json +2 -1
  882. package/cdn/chunks/GeoTIFF.NRJSPXBW.js +0 -21958
  883. package/cdn/chunks/chunk.25SASHHO.js +0 -60
  884. package/cdn/chunks/chunk.27NEXEZY.js +0 -19
  885. package/cdn/chunks/chunk.2FFK57ZH.js +0 -1264
  886. package/cdn/chunks/chunk.2FGK3J7F.js +0 -29
  887. package/cdn/chunks/chunk.2FSQRD2X.js +0 -32
  888. package/cdn/chunks/chunk.2P5VNQ3Q.js +0 -36
  889. package/cdn/chunks/chunk.34EBDDZ2.js +0 -19
  890. package/cdn/chunks/chunk.3AK225D4.js +0 -35
  891. package/cdn/chunks/chunk.3DB6PNAX.js +0 -36
  892. package/cdn/chunks/chunk.3IYEHDGU.js +0 -19
  893. package/cdn/chunks/chunk.3KHEMQPI.js +0 -19
  894. package/cdn/chunks/chunk.3Q2LDNOY.js +0 -276
  895. package/cdn/chunks/chunk.3RCH7UZU.js +0 -19
  896. package/cdn/chunks/chunk.3UIUIYCO.js +0 -32
  897. package/cdn/chunks/chunk.3VQHJIOH.js +0 -277
  898. package/cdn/chunks/chunk.4FFCJHOF.js +0 -29
  899. package/cdn/chunks/chunk.4GDEK6CA.js +0 -1975
  900. package/cdn/chunks/chunk.4KGQA5PY.js +0 -657
  901. package/cdn/chunks/chunk.4OGJ2ZSG.js +0 -195
  902. package/cdn/chunks/chunk.4VSXBUU6.js +0 -377
  903. package/cdn/chunks/chunk.4Z7MSJL7.js +0 -19
  904. package/cdn/chunks/chunk.53FLKCIC.js +0 -19
  905. package/cdn/chunks/chunk.5ASO3OUZ.js +0 -138
  906. package/cdn/chunks/chunk.5D655ZE7.js +0 -19
  907. package/cdn/chunks/chunk.5ETTKUDG.js +0 -188
  908. package/cdn/chunks/chunk.5IQUQXEQ.js +0 -19
  909. package/cdn/chunks/chunk.5LXVG2NR.js +0 -2713
  910. package/cdn/chunks/chunk.5SWFG3T6.js +0 -151
  911. package/cdn/chunks/chunk.673RMALO.js +0 -104
  912. package/cdn/chunks/chunk.6EVMKXR5.js +0 -32
  913. package/cdn/chunks/chunk.6HUTR57W.js +0 -19
  914. package/cdn/chunks/chunk.6JSHABDB.js +0 -32
  915. package/cdn/chunks/chunk.763TTBY7.js +0 -93
  916. package/cdn/chunks/chunk.763WHPEC.js +0 -132
  917. package/cdn/chunks/chunk.7BKQAOA6.js +0 -904
  918. package/cdn/chunks/chunk.7EKX7V3C.js +0 -32
  919. package/cdn/chunks/chunk.7T7SZ2MG.js +0 -224
  920. package/cdn/chunks/chunk.7UOLOECG.js +0 -19
  921. package/cdn/chunks/chunk.7XXKTRE2.js +0 -62
  922. package/cdn/chunks/chunk.AAQP4ZRG.js +0 -36
  923. package/cdn/chunks/chunk.ACM6IUFA.js +0 -29
  924. package/cdn/chunks/chunk.ACQRX6KA.js +0 -2546
  925. package/cdn/chunks/chunk.AE7GQ2OH.js +0 -162
  926. package/cdn/chunks/chunk.AOAMCCLA.js +0 -230
  927. package/cdn/chunks/chunk.AOCKA5FE.js +0 -19
  928. package/cdn/chunks/chunk.AQ5UEM6S.js +0 -136
  929. package/cdn/chunks/chunk.ATCMXTT6.js +0 -155
  930. package/cdn/chunks/chunk.AXUUEQIQ.js +0 -19
  931. package/cdn/chunks/chunk.BDDP57YT.js +0 -616
  932. package/cdn/chunks/chunk.BIO3CT7R.js +0 -19
  933. package/cdn/chunks/chunk.BX4XMEDL.js +0 -32
  934. package/cdn/chunks/chunk.C4Q3HQT3.js +0 -19
  935. package/cdn/chunks/chunk.CCVZBOJU.js +0 -19
  936. package/cdn/chunks/chunk.CFWEN4DK.js +0 -19
  937. package/cdn/chunks/chunk.CKRCCLC4.js +0 -1197
  938. package/cdn/chunks/chunk.COOTH73Y.js +0 -158
  939. package/cdn/chunks/chunk.CQQ7A6TB.js +0 -19
  940. package/cdn/chunks/chunk.CSSDZBIW.js +0 -29
  941. package/cdn/chunks/chunk.CVCOATX4.js +0 -29
  942. package/cdn/chunks/chunk.CYHEIQK4.js +0 -19
  943. package/cdn/chunks/chunk.D5MA5XD2.js +0 -19
  944. package/cdn/chunks/chunk.D65VLQ5F.js +0 -925
  945. package/cdn/chunks/chunk.DDAV4MHH.js +0 -33
  946. package/cdn/chunks/chunk.DTCGB6MX.js +0 -29
  947. package/cdn/chunks/chunk.DVOT5I62.js +0 -266
  948. package/cdn/chunks/chunk.E23DSFKG.js +0 -19
  949. package/cdn/chunks/chunk.E3AMPHJV.js +0 -29
  950. package/cdn/chunks/chunk.ED45RVQ7.js +0 -134
  951. package/cdn/chunks/chunk.EN2T3RPZ.js +0 -19
  952. package/cdn/chunks/chunk.EQ6SQSU4.js +0 -113
  953. package/cdn/chunks/chunk.F3KZAEMI.js +0 -86
  954. package/cdn/chunks/chunk.FAHOVJJQ.js +0 -19
  955. package/cdn/chunks/chunk.FETH5QYA.js +0 -92
  956. package/cdn/chunks/chunk.FGO5SZJJ.js +0 -29
  957. package/cdn/chunks/chunk.FOWCYICQ.js +0 -19
  958. package/cdn/chunks/chunk.FP46ENK2.js +0 -106
  959. package/cdn/chunks/chunk.FQDDBEJS.js +0 -478
  960. package/cdn/chunks/chunk.FRXGVFPM.js +0 -32
  961. package/cdn/chunks/chunk.G2JFFI24.js +0 -19
  962. package/cdn/chunks/chunk.G6U6RXJS.js +0 -82
  963. package/cdn/chunks/chunk.GB6CFGNH.js +0 -29
  964. package/cdn/chunks/chunk.GGTQYGC5.js +0 -458
  965. package/cdn/chunks/chunk.GJEUR34A.js +0 -32
  966. package/cdn/chunks/chunk.GL4VHOZ6.js +0 -631
  967. package/cdn/chunks/chunk.GMM3EOD6.js +0 -9743
  968. package/cdn/chunks/chunk.GN3JMZRR.js +0 -29
  969. package/cdn/chunks/chunk.GQBAO7NT.js +0 -29
  970. package/cdn/chunks/chunk.GXV3SI3E.js +0 -310
  971. package/cdn/chunks/chunk.H4E67GBN.js +0 -32
  972. package/cdn/chunks/chunk.HP5JGXDX.js +0 -19
  973. package/cdn/chunks/chunk.HPESON7W.js +0 -443
  974. package/cdn/chunks/chunk.HPFSUZ5Z.js +0 -294
  975. package/cdn/chunks/chunk.HTRP2HMU.js +0 -19
  976. package/cdn/chunks/chunk.IOPMJDF5.js +0 -19
  977. package/cdn/chunks/chunk.IPOUZRQQ.js +0 -33
  978. package/cdn/chunks/chunk.J2MEB73Q.js +0 -19
  979. package/cdn/chunks/chunk.J2YY5O2V.js +0 -543
  980. package/cdn/chunks/chunk.J534EJQR.js +0 -19
  981. package/cdn/chunks/chunk.J5YZLQZG.js +0 -19
  982. package/cdn/chunks/chunk.JALTEGNG.js +0 -19
  983. package/cdn/chunks/chunk.JERVD5PR.js +0 -30
  984. package/cdn/chunks/chunk.JINQBHNW.js +0 -60
  985. package/cdn/chunks/chunk.JJOHTWOC.js +0 -36
  986. package/cdn/chunks/chunk.JZPB2P2H.js +0 -34
  987. package/cdn/chunks/chunk.JZXYV4F3.js +0 -19
  988. package/cdn/chunks/chunk.KDMCTX4V.js +0 -19
  989. package/cdn/chunks/chunk.KJ2GVCPZ.js +0 -29
  990. package/cdn/chunks/chunk.KJUPXC55.js +0 -41
  991. package/cdn/chunks/chunk.KLHRICOA.js +0 -19
  992. package/cdn/chunks/chunk.LBDLTKYA.js +0 -34
  993. package/cdn/chunks/chunk.LBTS6K2C.js +0 -19
  994. package/cdn/chunks/chunk.LJNSIKDU.js +0 -74
  995. package/cdn/chunks/chunk.LMEJH2BQ.js +0 -234
  996. package/cdn/chunks/chunk.LOTR636L.js +0 -19
  997. package/cdn/chunks/chunk.LP56SNNW.js +0 -19
  998. package/cdn/chunks/chunk.LQUILBH4.js +0 -19
  999. package/cdn/chunks/chunk.LRWHUN6Q.js +0 -19
  1000. package/cdn/chunks/chunk.LSLLV44U.js +0 -35
  1001. package/cdn/chunks/chunk.LWN6Z2MT.js +0 -610
  1002. package/cdn/chunks/chunk.M67NQHER.js +0 -259
  1003. package/cdn/chunks/chunk.MVC3GRDP.js +0 -524
  1004. package/cdn/chunks/chunk.MZPYNFAK.js +0 -19
  1005. package/cdn/chunks/chunk.NAYEMU6V.js +0 -594
  1006. package/cdn/chunks/chunk.NBV7BO7K.js +0 -35
  1007. package/cdn/chunks/chunk.NBVGG52Y.js +0 -19
  1008. package/cdn/chunks/chunk.NCBYWOID.js +0 -33
  1009. package/cdn/chunks/chunk.NEXXYMR2.js +0 -29
  1010. package/cdn/chunks/chunk.NGS4A7JM.js +0 -960
  1011. package/cdn/chunks/chunk.NPWYBDA7.js +0 -19
  1012. package/cdn/chunks/chunk.O4C2GKGK.js +0 -357
  1013. package/cdn/chunks/chunk.O7LDEO3Y.js +0 -36
  1014. package/cdn/chunks/chunk.OKZX2FLN.js +0 -190
  1015. package/cdn/chunks/chunk.OMDMKCSO.js +0 -68
  1016. package/cdn/chunks/chunk.OMV3UFK5.js +0 -19
  1017. package/cdn/chunks/chunk.OUPRETB6.js +0 -537
  1018. package/cdn/chunks/chunk.OWEAZGNG.js +0 -29
  1019. package/cdn/chunks/chunk.P3IZXZD7.js +0 -19
  1020. package/cdn/chunks/chunk.P4PYSONI.js +0 -1985
  1021. package/cdn/chunks/chunk.P5L2C7D6.js +0 -33
  1022. package/cdn/chunks/chunk.PAFDTAPQ.js +0 -71
  1023. package/cdn/chunks/chunk.PFTM3PHG.js +0 -110
  1024. package/cdn/chunks/chunk.PZT47FKK.js +0 -19
  1025. package/cdn/chunks/chunk.Q7SENWN7.js +0 -32
  1026. package/cdn/chunks/chunk.QAEFL5ZA.js +0 -29
  1027. package/cdn/chunks/chunk.QJUVPP3K.js +0 -19
  1028. package/cdn/chunks/chunk.QLB2HRLZ.js +0 -19
  1029. package/cdn/chunks/chunk.QWF3B66L.js +0 -29
  1030. package/cdn/chunks/chunk.QXZWFB45.js +0 -19
  1031. package/cdn/chunks/chunk.QZU24DVR.js +0 -47
  1032. package/cdn/chunks/chunk.R3DMTQZ7.js +0 -99
  1033. package/cdn/chunks/chunk.R77CTO6K.js +0 -32
  1034. package/cdn/chunks/chunk.R7LMVJAZ.js +0 -83
  1035. package/cdn/chunks/chunk.RCOD7FFJ.js +0 -278
  1036. package/cdn/chunks/chunk.RKS4PEGG.js +0 -330
  1037. package/cdn/chunks/chunk.RRPDBZZG.js +0 -19
  1038. package/cdn/chunks/chunk.RT45YBDH.js +0 -19
  1039. package/cdn/chunks/chunk.S6FUVU5G.js +0 -19
  1040. package/cdn/chunks/chunk.SKBS4BJN.js +0 -24561
  1041. package/cdn/chunks/chunk.SPWQ65KD.js +0 -29
  1042. package/cdn/chunks/chunk.SR3N2FYU.js +0 -78
  1043. package/cdn/chunks/chunk.STHBAAN2.js +0 -538
  1044. package/cdn/chunks/chunk.SX3JRN4T.js +0 -599
  1045. package/cdn/chunks/chunk.TDMPHDKJ.js +0 -19
  1046. package/cdn/chunks/chunk.TFXTRVKP.js +0 -29
  1047. package/cdn/chunks/chunk.TKY6BLP4.js +0 -19
  1048. package/cdn/chunks/chunk.TUOTP4CD.js +0 -19
  1049. package/cdn/chunks/chunk.UDHCKILF.js +0 -29
  1050. package/cdn/chunks/chunk.UI656UYI.js +0 -56075
  1051. package/cdn/chunks/chunk.UQSFYHDF.js +0 -29
  1052. package/cdn/chunks/chunk.UXFIJ2ZX.js +0 -293
  1053. package/cdn/chunks/chunk.UYNLPW2B.js +0 -298
  1054. package/cdn/chunks/chunk.VH3CFXFW.js +0 -39
  1055. package/cdn/chunks/chunk.VIBJ6GTB.js +0 -231
  1056. package/cdn/chunks/chunk.VU5YCBI7.js +0 -29
  1057. package/cdn/chunks/chunk.VZZ5VWGT.js +0 -515
  1058. package/cdn/chunks/chunk.WIYWTJBS.js +0 -29
  1059. package/cdn/chunks/chunk.WJ6P74RX.js +0 -672
  1060. package/cdn/chunks/chunk.WOGYXGQJ.js +0 -29
  1061. package/cdn/chunks/chunk.WRH6KGLB.js +0 -32
  1062. package/cdn/chunks/chunk.WVFK7SEA.js +0 -19
  1063. package/cdn/chunks/chunk.WY7Z4HZC.js +0 -19
  1064. package/cdn/chunks/chunk.WZWTQD7Z.js +0 -29
  1065. package/cdn/chunks/chunk.X2VWBUE3.js +0 -19
  1066. package/cdn/chunks/chunk.X4BGAKNR.js +0 -123
  1067. package/cdn/chunks/chunk.X4HGAHKQ.js +0 -35
  1068. package/cdn/chunks/chunk.X7YHUN2A.js +0 -19
  1069. package/cdn/chunks/chunk.XA72A6DU.js +0 -19
  1070. package/cdn/chunks/chunk.XC7Z44CM.js +0 -19
  1071. package/cdn/chunks/chunk.XFCD7OFY.js +0 -33
  1072. package/cdn/chunks/chunk.XLQG5E2P.js +0 -37
  1073. package/cdn/chunks/chunk.XTGUW4UW.js +0 -35
  1074. package/cdn/chunks/chunk.XUTJ666V.js +0 -19
  1075. package/cdn/chunks/chunk.XWRI2TBI.js +0 -19
  1076. package/cdn/chunks/chunk.YGLWUTM5.js +0 -29
  1077. package/cdn/chunks/chunk.YNXKSK2K.js +0 -29
  1078. package/cdn/chunks/chunk.YSK7YOI2.js +0 -359
  1079. package/cdn/chunks/chunk.Z2ZM5DA2.js +0 -37
  1080. package/cdn/chunks/chunk.Z7HEB67J.js +0 -29
  1081. package/cdn/chunks/chunk.ZEFZMBN5.js +0 -29
  1082. package/cdn/chunks/chunk.ZKIDCWMN.js +0 -32
  1083. package/cdn/chunks/chunk.ZLKXOXOU.js +0 -49
  1084. package/cdn/chunks/chunk.ZMRWSDKT.js +0 -29
  1085. package/cdn/chunks/chunk.ZQFRHM65.js +0 -32
  1086. package/cdn/chunks/chunk.ZYWUJLL7.js +0 -29
  1087. package/cdn/chunks/lerc.4U2WA6NV.js +0 -2097
  1088. package/dist/chunks/chunk.24SX4FMU.js +0 -1
  1089. package/dist/chunks/chunk.2GXQG2C6.js +0 -1
  1090. package/dist/chunks/chunk.2XKK72BX.js +0 -1
  1091. package/dist/chunks/chunk.2XPGS7YP.js +0 -48
  1092. package/dist/chunks/chunk.2ZYNR23M.js +0 -1
  1093. package/dist/chunks/chunk.36HLLZYQ.js +0 -1
  1094. package/dist/chunks/chunk.3CU7KNNE.js +0 -1
  1095. package/dist/chunks/chunk.3ITVVL3P.js +0 -1
  1096. package/dist/chunks/chunk.3W34LXSN.js +0 -1
  1097. package/dist/chunks/chunk.4GQ4J4RQ.js +0 -47
  1098. package/dist/chunks/chunk.4QD3ZYJY.js +0 -24
  1099. package/dist/chunks/chunk.4R2LB5BK.js +0 -1
  1100. package/dist/chunks/chunk.4UFR7QMC.js +0 -1
  1101. package/dist/chunks/chunk.52ODFIC3.js +0 -1
  1102. package/dist/chunks/chunk.55EGVUKA.js +0 -8
  1103. package/dist/chunks/chunk.5FJJ7CKA.js +0 -1
  1104. package/dist/chunks/chunk.5GXF4QPJ.js +0 -1
  1105. package/dist/chunks/chunk.5HMYUJA4.js +0 -11
  1106. package/dist/chunks/chunk.5TC6SHQD.js +0 -1
  1107. package/dist/chunks/chunk.5Y2ANPPB.js +0 -121
  1108. package/dist/chunks/chunk.64BYIJHY.js +0 -1
  1109. package/dist/chunks/chunk.6ETTLWXK.js +0 -1
  1110. package/dist/chunks/chunk.6FH4FIIS.js +0 -157
  1111. package/dist/chunks/chunk.6NISHRMO.js +0 -1
  1112. package/dist/chunks/chunk.6OIEAUAO.js +0 -9
  1113. package/dist/chunks/chunk.6SIPIJUK.js +0 -19
  1114. package/dist/chunks/chunk.6XQYLPLE.js +0 -1
  1115. package/dist/chunks/chunk.6ZY5ELEO.js +0 -1
  1116. package/dist/chunks/chunk.73NL7DL3.js +0 -1
  1117. package/dist/chunks/chunk.75UA5KEJ.js +0 -1
  1118. package/dist/chunks/chunk.7L35TYU5.js +0 -1
  1119. package/dist/chunks/chunk.7NFE6ZZV.js +0 -1
  1120. package/dist/chunks/chunk.7SDRQM32.js +0 -1
  1121. package/dist/chunks/chunk.7YCJNGUN.js +0 -148
  1122. package/dist/chunks/chunk.A4MX5WMW.js +0 -43
  1123. package/dist/chunks/chunk.A673HJFE.js +0 -1
  1124. package/dist/chunks/chunk.AFIUQX3S.js +0 -20
  1125. package/dist/chunks/chunk.AGRACYBL.js +0 -1
  1126. package/dist/chunks/chunk.AOIZBSP4.js +0 -14
  1127. package/dist/chunks/chunk.AXF5M76D.js +0 -35
  1128. package/dist/chunks/chunk.BOTQGLFI.js +0 -1190
  1129. package/dist/chunks/chunk.BQC5WG2F.js +0 -1
  1130. package/dist/chunks/chunk.BS64IZTS.js +0 -1
  1131. package/dist/chunks/chunk.BXVCOWUZ.js +0 -122
  1132. package/dist/chunks/chunk.BYA3HDVE.js +0 -154
  1133. package/dist/chunks/chunk.C3X67ZLF.js +0 -1
  1134. package/dist/chunks/chunk.CBBP6HID.js +0 -1
  1135. package/dist/chunks/chunk.CFCILO2Y.js +0 -1
  1136. package/dist/chunks/chunk.CLLARK3K.js +0 -27
  1137. package/dist/chunks/chunk.CNWVGJYN.js +0 -127
  1138. package/dist/chunks/chunk.CO4V5XB7.js +0 -1
  1139. package/dist/chunks/chunk.CXDMJZ4A.js +0 -1
  1140. package/dist/chunks/chunk.D2RDQWCD.js +0 -1
  1141. package/dist/chunks/chunk.DA3J4VXR.js +0 -145
  1142. package/dist/chunks/chunk.DBNR7FR7.js +0 -1
  1143. package/dist/chunks/chunk.DCBVJQPK.js +0 -1
  1144. package/dist/chunks/chunk.DCM3VMX3.js +0 -1
  1145. package/dist/chunks/chunk.DD4HJH47.js +0 -6
  1146. package/dist/chunks/chunk.DDWDUBXM.js +0 -30
  1147. package/dist/chunks/chunk.DMWYZA3Y.js +0 -1
  1148. package/dist/chunks/chunk.DPTTMTMJ.js +0 -1
  1149. package/dist/chunks/chunk.DXEDGBWD.js +0 -11
  1150. package/dist/chunks/chunk.EJZK2KGV.js +0 -1
  1151. package/dist/chunks/chunk.ELNLFTBC.js +0 -8
  1152. package/dist/chunks/chunk.F3CMUMHO.js +0 -1
  1153. package/dist/chunks/chunk.F6QDIBZ2.js +0 -1
  1154. package/dist/chunks/chunk.FB7XCQPI.js +0 -1
  1155. package/dist/chunks/chunk.FC7OUKJM.js +0 -1
  1156. package/dist/chunks/chunk.FCBH4XA6.js +0 -20
  1157. package/dist/chunks/chunk.FDOGNNGJ.js +0 -1
  1158. package/dist/chunks/chunk.FJYHLRCI.js +0 -1
  1159. package/dist/chunks/chunk.FKPKXR4K.js +0 -1
  1160. package/dist/chunks/chunk.FQUY53QY.js +0 -1
  1161. package/dist/chunks/chunk.FR7BDEKN.js +0 -1
  1162. package/dist/chunks/chunk.FVAIGJMJ.js +0 -1
  1163. package/dist/chunks/chunk.G3QY2X2J.js +0 -1
  1164. package/dist/chunks/chunk.GCRALU2G.js +0 -30
  1165. package/dist/chunks/chunk.GJA52HAR.js +0 -1
  1166. package/dist/chunks/chunk.GJBPFJ2K.js +0 -1
  1167. package/dist/chunks/chunk.GVJLQQRL.js +0 -55
  1168. package/dist/chunks/chunk.H5C34R7T.js +0 -1
  1169. package/dist/chunks/chunk.H633XPHC.js +0 -1
  1170. package/dist/chunks/chunk.HIK6ESFZ.js +0 -1
  1171. package/dist/chunks/chunk.HVOJ5I2Q.js +0 -1
  1172. package/dist/chunks/chunk.I3MPRNEW.js +0 -1
  1173. package/dist/chunks/chunk.IIFFGPR4.js +0 -1
  1174. package/dist/chunks/chunk.IQHS4SSB.js +0 -22
  1175. package/dist/chunks/chunk.IRXHB5LN.js +0 -1
  1176. package/dist/chunks/chunk.IUTF6RLJ.js +0 -1
  1177. package/dist/chunks/chunk.J4OEX4V7.js +0 -1
  1178. package/dist/chunks/chunk.J54CLY55.js +0 -176
  1179. package/dist/chunks/chunk.JJ2RKYZX.js +0 -1
  1180. package/dist/chunks/chunk.JKHYEFZ7.js +0 -67
  1181. package/dist/chunks/chunk.JLLYBW5K.js +0 -1
  1182. package/dist/chunks/chunk.JNEOJDFH.js +0 -1
  1183. package/dist/chunks/chunk.JNGVL46L.js +0 -1
  1184. package/dist/chunks/chunk.JPRQO25T.js +0 -1
  1185. package/dist/chunks/chunk.JYCCPLLK.js +0 -1
  1186. package/dist/chunks/chunk.KTR74BUH.js +0 -9
  1187. package/dist/chunks/chunk.KX3QK6AG.js +0 -1
  1188. package/dist/chunks/chunk.LAV7B5HQ.js +0 -75
  1189. package/dist/chunks/chunk.LCVY7UI3.js +0 -1
  1190. package/dist/chunks/chunk.LFSREVFB.js +0 -1
  1191. package/dist/chunks/chunk.LIL2OD6B.js +0 -1
  1192. package/dist/chunks/chunk.LK4BRRBC.js +0 -1
  1193. package/dist/chunks/chunk.LMSZJF64.js +0 -1
  1194. package/dist/chunks/chunk.LNU5A3P4.js +0 -1
  1195. package/dist/chunks/chunk.LX4TKJE4.js +0 -1
  1196. package/dist/chunks/chunk.MCGELDAA.js +0 -300
  1197. package/dist/chunks/chunk.MITQ2OXL.js +0 -1
  1198. package/dist/chunks/chunk.MJR76YOH.js +0 -1
  1199. package/dist/chunks/chunk.MLKC2NGO.js +0 -23
  1200. package/dist/chunks/chunk.MPNC775E.js +0 -1
  1201. package/dist/chunks/chunk.MWFVVSXA.js +0 -41
  1202. package/dist/chunks/chunk.NLRMSHFU.js +0 -26
  1203. package/dist/chunks/chunk.NOEBPPRY.js +0 -1
  1204. package/dist/chunks/chunk.NOZEVQR4.js +0 -1
  1205. package/dist/chunks/chunk.NX7IFT72.js +0 -1
  1206. package/dist/chunks/chunk.OGDWQJZD.js +0 -280
  1207. package/dist/chunks/chunk.OIJKFVKH.js +0 -80
  1208. package/dist/chunks/chunk.OPCENTDH.js +0 -1
  1209. package/dist/chunks/chunk.OVJTQS3R.js +0 -1
  1210. package/dist/chunks/chunk.OY3LFRUC.js +0 -1
  1211. package/dist/chunks/chunk.P34GHQPV.js +0 -299
  1212. package/dist/chunks/chunk.P4DO532S.js +0 -1
  1213. package/dist/chunks/chunk.P4MGQ55S.js +0 -1
  1214. package/dist/chunks/chunk.P6F4F5QD.js +0 -1
  1215. package/dist/chunks/chunk.P6ZQBWYA.js +0 -498
  1216. package/dist/chunks/chunk.PJ6I3F64.js +0 -1
  1217. package/dist/chunks/chunk.PKDR4N72.js +0 -1
  1218. package/dist/chunks/chunk.PNDOGBBH.js +0 -35
  1219. package/dist/chunks/chunk.PPMANAS7.js +0 -25
  1220. package/dist/chunks/chunk.PSO4FXBN.js +0 -1
  1221. package/dist/chunks/chunk.PURJ6A7V.js +0 -12
  1222. package/dist/chunks/chunk.PXBLOJC2.js +0 -26
  1223. package/dist/chunks/chunk.Q2WAGLNI.js +0 -1
  1224. package/dist/chunks/chunk.Q4KUQYWO.js +0 -1
  1225. package/dist/chunks/chunk.QDDRKEFK.js +0 -1
  1226. package/dist/chunks/chunk.QGIQ5722.js +0 -1
  1227. package/dist/chunks/chunk.QIRR5SHU.js +0 -1
  1228. package/dist/chunks/chunk.QX7ATWZI.js +0 -1
  1229. package/dist/chunks/chunk.QYVIUHVB.js +0 -38
  1230. package/dist/chunks/chunk.R5W2QDX7.js +0 -1
  1231. package/dist/chunks/chunk.RAHGHMXI.js +0 -1
  1232. package/dist/chunks/chunk.RDYM773Z.js +0 -1
  1233. package/dist/chunks/chunk.RK2WIN35.js +0 -1
  1234. package/dist/chunks/chunk.ROUAWWLV.js +0 -1
  1235. package/dist/chunks/chunk.RVOEFT5U.js +0 -1
  1236. package/dist/chunks/chunk.RZU3COUL.js +0 -1
  1237. package/dist/chunks/chunk.S3AX4H3V.js +0 -64
  1238. package/dist/chunks/chunk.S5DZSTMC.js +0 -1
  1239. package/dist/chunks/chunk.S5QAVZ6U.js +0 -17
  1240. package/dist/chunks/chunk.S6VRSSO6.js +0 -1
  1241. package/dist/chunks/chunk.SD6CXJRC.js +0 -2
  1242. package/dist/chunks/chunk.SHFZMIFP.js +0 -39
  1243. package/dist/chunks/chunk.SJ53VOP3.js +0 -1
  1244. package/dist/chunks/chunk.SMIYI4II.js +0 -5
  1245. package/dist/chunks/chunk.SMKE3JC5.js +0 -74
  1246. package/dist/chunks/chunk.SPXXTRWH.js +0 -1
  1247. package/dist/chunks/chunk.SXS6TOEP.js +0 -1
  1248. package/dist/chunks/chunk.T2YVRM7D.js +0 -1
  1249. package/dist/chunks/chunk.TAOFCQZQ.js +0 -1
  1250. package/dist/chunks/chunk.TFVXGDQM.js +0 -37
  1251. package/dist/chunks/chunk.TKVQOZQV.js +0 -1
  1252. package/dist/chunks/chunk.TLSNSBFZ.js +0 -1
  1253. package/dist/chunks/chunk.TQPOCOGE.js +0 -62
  1254. package/dist/chunks/chunk.UL54RDR4.js +0 -1
  1255. package/dist/chunks/chunk.UNHHJHFU.js +0 -1
  1256. package/dist/chunks/chunk.UQN3GWLF.js +0 -1
  1257. package/dist/chunks/chunk.UWTZQQSB.js +0 -1
  1258. package/dist/chunks/chunk.V36IF7ZI.js +0 -1
  1259. package/dist/chunks/chunk.V6SKIMFL.js +0 -43
  1260. package/dist/chunks/chunk.VB25KRVB.js +0 -1
  1261. package/dist/chunks/chunk.VMJ66H2K.js +0 -55
  1262. package/dist/chunks/chunk.VVGU3MRZ.js +0 -61
  1263. package/dist/chunks/chunk.WGDASVED.js +0 -1
  1264. package/dist/chunks/chunk.WSQAOKNW.js +0 -572
  1265. package/dist/chunks/chunk.WTWPPELF.js +0 -1
  1266. package/dist/chunks/chunk.WUVKUAFQ.js +0 -1
  1267. package/dist/chunks/chunk.WXPNSREU.js +0 -55
  1268. package/dist/chunks/chunk.WZMBYYJZ.js +0 -1
  1269. package/dist/chunks/chunk.X35TMCUS.js +0 -4
  1270. package/dist/chunks/chunk.X4FGTGNS.js +0 -33
  1271. package/dist/chunks/chunk.XB2SWVUB.js +0 -1
  1272. package/dist/chunks/chunk.XM6WREG5.js +0 -1
  1273. package/dist/chunks/chunk.XUX7B3MY.js +0 -113
  1274. package/dist/chunks/chunk.XV2F2D73.js +0 -780
  1275. package/dist/chunks/chunk.XXD4ILGD.js +0 -1
  1276. package/dist/chunks/chunk.XYAXUANC.js +0 -1
  1277. package/dist/chunks/chunk.Y6VOJNJH.js +0 -441
  1278. package/dist/chunks/chunk.YASIML6Z.js +0 -5
  1279. package/dist/chunks/chunk.YKXFFCAA.js +0 -65
  1280. package/dist/chunks/chunk.YYECXERO.js +0 -1
  1281. package/dist/chunks/chunk.ZBOS3NT4.js +0 -1
  1282. package/dist/chunks/chunk.ZE3GRFIA.js +0 -16
  1283. package/dist/chunks/chunk.ZH2NCLUA.js +0 -100
  1284. package/dist/chunks/chunk.ZH45GJVZ.js +0 -1
  1285. package/dist/chunks/chunk.ZNF2N7SP.js +0 -1
  1286. package/dist/chunks/chunk.ZNJUJR6V.js +0 -99
  1287. package/dist/chunks/chunk.ZR77WP3G.js +0 -1
  1288. package/dist/chunks/chunk.ZVIT7ATK.js +0 -1
  1289. package/dist/chunks/chunk.ZZTRPSS7.js +0 -1
  1290. package/dist/terra_ui_components-0.0.198-py3-none-any.whl +0 -0
  1291. package/dist/terra_ui_components-0.0.198.tar.gz +0 -0
@@ -0,0 +1,4735 @@
1
+ import {
2
+ TimeAvgMapController
3
+ } from "./chunk.TAGA7EGX.js";
4
+ import {
5
+ time_average_map_styles_default
6
+ } from "./chunk.FQ7GYAM6.js";
7
+ import {
8
+ getFetchVariableTask
9
+ } from "./chunk.JNTHZSBA.js";
10
+ import {
11
+ getVariableEntryId
12
+ } from "./chunk.QS6LI65N.js";
13
+ import {
14
+ TerraPlotToolbar
15
+ } from "./chunk.RK7LHY6Q.js";
16
+ import {
17
+ TerraPlot
18
+ } from "./chunk.FSGSFI2L.js";
19
+ import {
20
+ extractHarmonyError,
21
+ formatHarmonyErrorMessage
22
+ } from "./chunk.USKVG5GU.js";
23
+ import {
24
+ AuthController
25
+ } from "./chunk.4JXPGYJW.js";
26
+ import {
27
+ s
28
+ } from "./chunk.BQDEKCXK.js";
29
+ import {
30
+ TerraMap
31
+ } from "./chunk.66IWKBC6.js";
32
+ import {
33
+ Draw_default
34
+ } from "./chunk.PF6HHPHM.js";
35
+ import {
36
+ create as create2,
37
+ fromTransform
38
+ } from "./chunk.FI4YBHHD.js";
39
+ import {
40
+ BooleanType,
41
+ CallExpression,
42
+ ColorType,
43
+ Feature_default,
44
+ NumberArrayType,
45
+ NumberType,
46
+ Ops,
47
+ SizeType,
48
+ StringType,
49
+ Vector_default,
50
+ Vector_default2,
51
+ isType,
52
+ newParsingContext,
53
+ parse,
54
+ typeName
55
+ } from "./chunk.M6QQY2ST.js";
56
+ import {
57
+ BaseTile_default,
58
+ ImageTile_default,
59
+ LRUCache_default,
60
+ Tile_default
61
+ } from "./chunk.IYBWOV2C.js";
62
+ import {
63
+ DataTile_default,
64
+ TileRange_default,
65
+ TileState_default,
66
+ asArrayLike,
67
+ asImageLike,
68
+ createOrUpdate,
69
+ getKey
70
+ } from "./chunk.UUUD46S3.js";
71
+ import {
72
+ EventType_default as EventType_default2,
73
+ Event_default,
74
+ Layer_default,
75
+ Point_default,
76
+ Property_default,
77
+ asArray
78
+ } from "./chunk.IK2SGPIW.js";
79
+ import {
80
+ Disposable_default,
81
+ EventType_default,
82
+ SAFARI_BUG_237906,
83
+ Target_default,
84
+ abstract,
85
+ apply,
86
+ assert,
87
+ boundingExtent,
88
+ clear,
89
+ compose,
90
+ containsCoordinate,
91
+ create,
92
+ createCanvasContext2D,
93
+ descending,
94
+ fromUserExtent,
95
+ getIntersection,
96
+ getLength,
97
+ getRotatedViewport,
98
+ getUid,
99
+ isEmpty2 as isEmpty,
100
+ reset,
101
+ rotate2 as rotate,
102
+ scale2 as scale,
103
+ toLonLat,
104
+ toSize,
105
+ translate
106
+ } from "./chunk.RCPXD7AS.js";
107
+ import {
108
+ h
109
+ } from "./chunk.ASJLND3B.js";
110
+ import {
111
+ QueryClientMixin
112
+ } from "./chunk.DOUWGQFH.js";
113
+ import {
114
+ TerraLoader
115
+ } from "./chunk.S5FXMDJD.js";
116
+ import {
117
+ formatDate
118
+ } from "./chunk.X2BIJLHO.js";
119
+ import {
120
+ TerraButton
121
+ } from "./chunk.FIREC5CC.js";
122
+ import {
123
+ TerraIcon
124
+ } from "./chunk.KHDL2CAQ.js";
125
+ import {
126
+ TerraAlert
127
+ } from "./chunk.ZCVWVO2H.js";
128
+ import {
129
+ watch
130
+ } from "./chunk.MPVZOQYA.js";
131
+ import {
132
+ TerraElement,
133
+ component_styles_default,
134
+ e,
135
+ n,
136
+ r,
137
+ undefinedStringConverter
138
+ } from "./chunk.TG3YYWRJ.js";
139
+ import {
140
+ A,
141
+ b
142
+ } from "./chunk.RRCYT4LP.js";
143
+ import {
144
+ __decorateClass,
145
+ __privateAdd,
146
+ __privateGet,
147
+ __privateMethod,
148
+ __privateSet,
149
+ __spreadProps,
150
+ __spreadValues,
151
+ init_buffer,
152
+ init_dirname,
153
+ init_process
154
+ } from "./chunk.ZEOVK2FE.js";
155
+
156
+ // src/components/time-average-map/time-average-map.component.ts
157
+ init_dirname();
158
+ init_buffer();
159
+ init_process();
160
+
161
+ // node_modules/ol/layer/WebGLTile.js
162
+ init_dirname();
163
+ init_buffer();
164
+ init_process();
165
+
166
+ // node_modules/ol/expr/gpu.js
167
+ init_dirname();
168
+ init_buffer();
169
+ init_process();
170
+
171
+ // node_modules/ol/renderer/webgl/TileLayer.js
172
+ init_dirname();
173
+ init_buffer();
174
+ init_process();
175
+
176
+ // node_modules/ol/webgl/Buffer.js
177
+ init_dirname();
178
+ init_buffer();
179
+ init_process();
180
+
181
+ // node_modules/ol/webgl.js
182
+ init_dirname();
183
+ init_buffer();
184
+ init_process();
185
+ var ARRAY_BUFFER = 34962;
186
+ var ELEMENT_ARRAY_BUFFER = 34963;
187
+ var STREAM_DRAW = 35040;
188
+ var STATIC_DRAW = 35044;
189
+ var DYNAMIC_DRAW = 35048;
190
+ var UNSIGNED_BYTE = 5121;
191
+ var UNSIGNED_SHORT = 5123;
192
+ var UNSIGNED_INT = 5125;
193
+ var FLOAT = 5126;
194
+ var CONTEXT_IDS = ["experimental-webgl", "webgl", "webkit-3d", "moz-webgl"];
195
+ function getContext(canvas, attributes) {
196
+ attributes = Object.assign(
197
+ {
198
+ preserveDrawingBuffer: true,
199
+ antialias: SAFARI_BUG_237906 ? false : true
200
+ // https://bugs.webkit.org/show_bug.cgi?id=237906
201
+ },
202
+ attributes
203
+ );
204
+ const ii = CONTEXT_IDS.length;
205
+ for (let i = 0; i < ii; ++i) {
206
+ try {
207
+ const context = canvas.getContext(CONTEXT_IDS[i], attributes);
208
+ if (context) {
209
+ return (
210
+ /** @type {!WebGLRenderingContext} */
211
+ context
212
+ );
213
+ }
214
+ } catch (e2) {
215
+ }
216
+ }
217
+ return null;
218
+ }
219
+
220
+ // node_modules/ol/webgl/Buffer.js
221
+ var BufferUsage = {
222
+ STATIC_DRAW,
223
+ STREAM_DRAW,
224
+ DYNAMIC_DRAW
225
+ };
226
+ var WebGLArrayBuffer = class {
227
+ /**
228
+ * @param {number} type Buffer type, either ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
229
+ * @param {number} [usage] Intended usage, either `STATIC_DRAW`, `STREAM_DRAW` or `DYNAMIC_DRAW`.
230
+ * Default is `STATIC_DRAW`.
231
+ */
232
+ constructor(type, usage) {
233
+ this.array_ = null;
234
+ this.type_ = type;
235
+ assert(
236
+ type === ARRAY_BUFFER || type === ELEMENT_ARRAY_BUFFER,
237
+ "A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"
238
+ );
239
+ this.usage_ = usage !== void 0 ? usage : BufferUsage.STATIC_DRAW;
240
+ }
241
+ /**
242
+ * Populates the buffer with an array of the given size (all values will be zeroes).
243
+ * @param {number} size Array size
244
+ * @return {WebGLArrayBuffer} This
245
+ */
246
+ ofSize(size) {
247
+ this.array_ = new (getArrayClassForType(this.type_))(size);
248
+ return this;
249
+ }
250
+ /**
251
+ * Populates the buffer with an array of the given size.
252
+ * @param {Array<number>} array Numerical array
253
+ * @return {WebGLArrayBuffer} This
254
+ */
255
+ fromArray(array) {
256
+ this.array_ = getArrayClassForType(this.type_).from(array);
257
+ return this;
258
+ }
259
+ /**
260
+ * Populates the buffer with a raw binary array buffer.
261
+ * @param {ArrayBuffer} buffer Raw binary buffer to populate the array with. Note that this buffer must have been
262
+ * initialized for the same typed array class.
263
+ * @return {WebGLArrayBuffer} This
264
+ */
265
+ fromArrayBuffer(buffer) {
266
+ this.array_ = new (getArrayClassForType(this.type_))(buffer);
267
+ return this;
268
+ }
269
+ /**
270
+ * @return {number} Buffer type.
271
+ */
272
+ getType() {
273
+ return this.type_;
274
+ }
275
+ /**
276
+ * Will return null if the buffer was not initialized
277
+ * @return {Float32Array|Uint32Array|null} Array.
278
+ */
279
+ getArray() {
280
+ return this.array_;
281
+ }
282
+ /**
283
+ * @param {Float32Array|Uint32Array} array Array.
284
+ */
285
+ setArray(array) {
286
+ const ArrayType = getArrayClassForType(this.type_);
287
+ if (!(array instanceof ArrayType)) {
288
+ throw new Error(`Expected ${ArrayType}`);
289
+ }
290
+ this.array_ = array;
291
+ }
292
+ /**
293
+ * @return {number} Usage.
294
+ */
295
+ getUsage() {
296
+ return this.usage_;
297
+ }
298
+ /**
299
+ * Will return 0 if the buffer is not initialized
300
+ * @return {number} Array size
301
+ */
302
+ getSize() {
303
+ return this.array_ ? this.array_.length : 0;
304
+ }
305
+ };
306
+ function getArrayClassForType(type) {
307
+ switch (type) {
308
+ case ARRAY_BUFFER:
309
+ return Float32Array;
310
+ case ELEMENT_ARRAY_BUFFER:
311
+ return Uint32Array;
312
+ default:
313
+ return Float32Array;
314
+ }
315
+ }
316
+ var Buffer_default = WebGLArrayBuffer;
317
+
318
+ // node_modules/ol/webgl/Helper.js
319
+ init_dirname();
320
+ init_buffer();
321
+ init_process();
322
+
323
+ // node_modules/ol/webgl/ContextEventType.js
324
+ init_dirname();
325
+ init_buffer();
326
+ init_process();
327
+ var ContextEventType_default = {
328
+ LOST: "webglcontextlost",
329
+ RESTORED: "webglcontextrestored"
330
+ };
331
+
332
+ // node_modules/ol/webgl/PostProcessingPass.js
333
+ init_dirname();
334
+ init_buffer();
335
+ init_process();
336
+ var DEFAULT_VERTEX_SHADER = `
337
+ precision mediump float;
338
+
339
+ attribute vec2 a_position;
340
+ varying vec2 v_texCoord;
341
+ varying vec2 v_screenCoord;
342
+
343
+ uniform vec2 u_screenSize;
344
+
345
+ void main() {
346
+ v_texCoord = a_position * 0.5 + 0.5;
347
+ v_screenCoord = v_texCoord * u_screenSize;
348
+ gl_Position = vec4(a_position, 0.0, 1.0);
349
+ }
350
+ `;
351
+ var DEFAULT_FRAGMENT_SHADER = `
352
+ precision mediump float;
353
+
354
+ uniform sampler2D u_image;
355
+ uniform float u_opacity;
356
+
357
+ varying vec2 v_texCoord;
358
+
359
+ void main() {
360
+ gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;
361
+ }
362
+ `;
363
+ var WebGLPostProcessingPass = class {
364
+ /**
365
+ * @param {Options} options Options.
366
+ */
367
+ constructor(options) {
368
+ this.gl_ = options.webGlContext;
369
+ const gl = this.gl_;
370
+ this.scaleRatio_ = options.scaleRatio || 1;
371
+ this.renderTargetTexture_ = gl.createTexture();
372
+ this.renderTargetTextureSize_ = null;
373
+ this.frameBuffer_ = gl.createFramebuffer();
374
+ this.depthBuffer_ = gl.createRenderbuffer();
375
+ const vertexShader = gl.createShader(gl.VERTEX_SHADER);
376
+ gl.shaderSource(
377
+ vertexShader,
378
+ options.vertexShader || DEFAULT_VERTEX_SHADER
379
+ );
380
+ gl.compileShader(vertexShader);
381
+ const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
382
+ gl.shaderSource(
383
+ fragmentShader,
384
+ options.fragmentShader || DEFAULT_FRAGMENT_SHADER
385
+ );
386
+ gl.compileShader(fragmentShader);
387
+ this.renderTargetProgram_ = gl.createProgram();
388
+ gl.attachShader(this.renderTargetProgram_, vertexShader);
389
+ gl.attachShader(this.renderTargetProgram_, fragmentShader);
390
+ gl.linkProgram(this.renderTargetProgram_);
391
+ this.renderTargetVerticesBuffer_ = gl.createBuffer();
392
+ const verticesArray = [-1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1];
393
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.renderTargetVerticesBuffer_);
394
+ gl.bufferData(
395
+ gl.ARRAY_BUFFER,
396
+ new Float32Array(verticesArray),
397
+ gl.STATIC_DRAW
398
+ );
399
+ this.renderTargetAttribLocation_ = gl.getAttribLocation(
400
+ this.renderTargetProgram_,
401
+ "a_position"
402
+ );
403
+ this.renderTargetUniformLocation_ = gl.getUniformLocation(
404
+ this.renderTargetProgram_,
405
+ "u_screenSize"
406
+ );
407
+ this.renderTargetOpacityLocation_ = gl.getUniformLocation(
408
+ this.renderTargetProgram_,
409
+ "u_opacity"
410
+ );
411
+ this.renderTargetTextureLocation_ = gl.getUniformLocation(
412
+ this.renderTargetProgram_,
413
+ "u_image"
414
+ );
415
+ this.uniforms_ = [];
416
+ options.uniforms && Object.keys(options.uniforms).forEach((name) => {
417
+ this.uniforms_.push({
418
+ value: options.uniforms[name],
419
+ location: gl.getUniformLocation(this.renderTargetProgram_, name)
420
+ });
421
+ });
422
+ }
423
+ getRenderTargetTexture() {
424
+ return this.renderTargetTexture_;
425
+ }
426
+ /**
427
+ * Get the WebGL rendering context
428
+ * @return {WebGLRenderingContext} The rendering context.
429
+ */
430
+ getGL() {
431
+ return this.gl_;
432
+ }
433
+ /**
434
+ * Initialize the render target texture of the post process, make sure it is at the
435
+ * right size and bind it as a render target for the next draw calls.
436
+ * The last step to be initialized will be the one where the primitives are rendered.
437
+ * @param {import("../Map.js").FrameState} frameState current frame state
438
+ */
439
+ init(frameState) {
440
+ const gl = this.getGL();
441
+ const textureSize = [
442
+ gl.drawingBufferWidth * this.scaleRatio_,
443
+ gl.drawingBufferHeight * this.scaleRatio_
444
+ ];
445
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.getFrameBuffer());
446
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this.getDepthBuffer());
447
+ gl.viewport(0, 0, textureSize[0], textureSize[1]);
448
+ if (!this.renderTargetTextureSize_ || this.renderTargetTextureSize_[0] !== textureSize[0] || this.renderTargetTextureSize_[1] !== textureSize[1]) {
449
+ this.renderTargetTextureSize_ = textureSize;
450
+ const level = 0;
451
+ const internalFormat = gl.RGBA;
452
+ const border = 0;
453
+ const format = gl.RGBA;
454
+ const type = gl.UNSIGNED_BYTE;
455
+ const data = null;
456
+ gl.bindTexture(gl.TEXTURE_2D, this.renderTargetTexture_);
457
+ gl.texImage2D(
458
+ gl.TEXTURE_2D,
459
+ level,
460
+ internalFormat,
461
+ textureSize[0],
462
+ textureSize[1],
463
+ border,
464
+ format,
465
+ type,
466
+ data
467
+ );
468
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
469
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
470
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
471
+ gl.framebufferTexture2D(
472
+ gl.FRAMEBUFFER,
473
+ gl.COLOR_ATTACHMENT0,
474
+ gl.TEXTURE_2D,
475
+ this.renderTargetTexture_,
476
+ 0
477
+ );
478
+ gl.renderbufferStorage(
479
+ gl.RENDERBUFFER,
480
+ gl.DEPTH_COMPONENT16,
481
+ textureSize[0],
482
+ textureSize[1]
483
+ );
484
+ gl.framebufferRenderbuffer(
485
+ gl.FRAMEBUFFER,
486
+ gl.DEPTH_ATTACHMENT,
487
+ gl.RENDERBUFFER,
488
+ this.depthBuffer_
489
+ );
490
+ }
491
+ }
492
+ /**
493
+ * Render to the next postprocessing pass (or to the canvas if final pass).
494
+ * @param {import("../Map.js").FrameState} frameState current frame state
495
+ * @param {WebGLPostProcessingPass} [nextPass] Next pass, optional
496
+ * @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [preCompose] Called before composing.
497
+ * @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [postCompose] Called before composing.
498
+ */
499
+ apply(frameState, nextPass, preCompose, postCompose) {
500
+ const gl = this.getGL();
501
+ const size = frameState.size;
502
+ gl.bindFramebuffer(
503
+ gl.FRAMEBUFFER,
504
+ nextPass ? nextPass.getFrameBuffer() : null
505
+ );
506
+ gl.activeTexture(gl.TEXTURE0);
507
+ gl.bindTexture(gl.TEXTURE_2D, this.renderTargetTexture_);
508
+ if (!nextPass) {
509
+ const canvasId = getUid(gl.canvas);
510
+ if (!frameState.renderTargets[canvasId]) {
511
+ const attributes = gl.getContextAttributes();
512
+ if (attributes && attributes.preserveDrawingBuffer) {
513
+ gl.clearColor(0, 0, 0, 0);
514
+ gl.clearDepth(1);
515
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
516
+ }
517
+ frameState.renderTargets[canvasId] = true;
518
+ }
519
+ }
520
+ gl.disable(gl.DEPTH_TEST);
521
+ gl.enable(gl.BLEND);
522
+ gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
523
+ gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
524
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.renderTargetVerticesBuffer_);
525
+ gl.useProgram(this.renderTargetProgram_);
526
+ gl.enableVertexAttribArray(this.renderTargetAttribLocation_);
527
+ gl.vertexAttribPointer(
528
+ this.renderTargetAttribLocation_,
529
+ 2,
530
+ gl.FLOAT,
531
+ false,
532
+ 0,
533
+ 0
534
+ );
535
+ gl.uniform2f(this.renderTargetUniformLocation_, size[0], size[1]);
536
+ gl.uniform1i(this.renderTargetTextureLocation_, 0);
537
+ const opacity = frameState.layerStatesArray[frameState.layerIndex].opacity;
538
+ gl.uniform1f(this.renderTargetOpacityLocation_, opacity);
539
+ this.applyUniforms(frameState);
540
+ if (preCompose) {
541
+ preCompose(gl, frameState);
542
+ }
543
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
544
+ if (postCompose) {
545
+ postCompose(gl, frameState);
546
+ }
547
+ }
548
+ /**
549
+ * @return {WebGLFramebuffer} Frame buffer
550
+ */
551
+ getFrameBuffer() {
552
+ return this.frameBuffer_;
553
+ }
554
+ /**
555
+ * @return {WebGLRenderbuffer} Depth buffer
556
+ */
557
+ getDepthBuffer() {
558
+ return this.depthBuffer_;
559
+ }
560
+ /**
561
+ * Sets the custom uniforms based on what was given in the constructor.
562
+ * @param {import("../Map.js").FrameState} frameState Frame state.
563
+ * @private
564
+ */
565
+ applyUniforms(frameState) {
566
+ const gl = this.getGL();
567
+ let value;
568
+ let textureSlot = 1;
569
+ this.uniforms_.forEach(function(uniform) {
570
+ value = typeof uniform.value === "function" ? uniform.value(frameState) : uniform.value;
571
+ if (value instanceof HTMLCanvasElement || value instanceof ImageData) {
572
+ if (!uniform.texture) {
573
+ uniform.texture = gl.createTexture();
574
+ }
575
+ gl.activeTexture(gl[`TEXTURE${textureSlot}`]);
576
+ gl.bindTexture(gl.TEXTURE_2D, uniform.texture);
577
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
578
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
579
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
580
+ if (value instanceof ImageData) {
581
+ gl.texImage2D(
582
+ gl.TEXTURE_2D,
583
+ 0,
584
+ gl.RGBA,
585
+ gl.RGBA,
586
+ value.width,
587
+ value.height,
588
+ 0,
589
+ gl.UNSIGNED_BYTE,
590
+ new Uint8Array(value.data)
591
+ );
592
+ } else {
593
+ gl.texImage2D(
594
+ gl.TEXTURE_2D,
595
+ 0,
596
+ gl.RGBA,
597
+ gl.RGBA,
598
+ gl.UNSIGNED_BYTE,
599
+ value
600
+ );
601
+ }
602
+ gl.uniform1i(uniform.location, textureSlot++);
603
+ } else if (Array.isArray(value)) {
604
+ switch (value.length) {
605
+ case 2:
606
+ gl.uniform2f(uniform.location, value[0], value[1]);
607
+ return;
608
+ case 3:
609
+ gl.uniform3f(uniform.location, value[0], value[1], value[2]);
610
+ return;
611
+ case 4:
612
+ gl.uniform4f(
613
+ uniform.location,
614
+ value[0],
615
+ value[1],
616
+ value[2],
617
+ value[3]
618
+ );
619
+ return;
620
+ default:
621
+ return;
622
+ }
623
+ } else if (typeof value === "number") {
624
+ gl.uniform1f(uniform.location, value);
625
+ }
626
+ });
627
+ }
628
+ };
629
+ var PostProcessingPass_default = WebGLPostProcessingPass;
630
+
631
+ // node_modules/ol/webgl/Helper.js
632
+ var DefaultUniform = {
633
+ PROJECTION_MATRIX: "u_projectionMatrix",
634
+ SCREEN_TO_WORLD_MATRIX: "u_screenToWorldMatrix",
635
+ TIME: "u_time",
636
+ ZOOM: "u_zoom",
637
+ RESOLUTION: "u_resolution",
638
+ ROTATION: "u_rotation",
639
+ VIEWPORT_SIZE_PX: "u_viewportSizePx",
640
+ PIXEL_RATIO: "u_pixelRatio",
641
+ HIT_DETECTION: "u_hitDetection"
642
+ };
643
+ var AttributeType = {
644
+ UNSIGNED_BYTE,
645
+ UNSIGNED_SHORT,
646
+ UNSIGNED_INT,
647
+ FLOAT
648
+ };
649
+ var canvasCache = {};
650
+ function getSharedCanvasCacheKey(key) {
651
+ return "shared/" + key;
652
+ }
653
+ var uniqueCanvasCacheKeyCount = 0;
654
+ function getUniqueCanvasCacheKey() {
655
+ const key = "unique/" + uniqueCanvasCacheKeyCount;
656
+ uniqueCanvasCacheKeyCount += 1;
657
+ return key;
658
+ }
659
+ function getOrCreateContext(key) {
660
+ let cacheItem = canvasCache[key];
661
+ if (!cacheItem) {
662
+ const canvas = document.createElement("canvas");
663
+ canvas.width = 1;
664
+ canvas.height = 1;
665
+ canvas.style.position = "absolute";
666
+ canvas.style.left = "0";
667
+ const context = getContext(canvas);
668
+ cacheItem = { users: 0, context };
669
+ canvasCache[key] = cacheItem;
670
+ }
671
+ cacheItem.users += 1;
672
+ return cacheItem.context;
673
+ }
674
+ function releaseCanvas(key) {
675
+ const cacheItem = canvasCache[key];
676
+ if (!cacheItem) {
677
+ return;
678
+ }
679
+ cacheItem.users -= 1;
680
+ if (cacheItem.users > 0) {
681
+ return;
682
+ }
683
+ const gl = cacheItem.context;
684
+ const extension = gl.getExtension("WEBGL_lose_context");
685
+ if (extension) {
686
+ extension.loseContext();
687
+ }
688
+ const canvas = gl.canvas;
689
+ canvas.width = 1;
690
+ canvas.height = 1;
691
+ delete canvasCache[key];
692
+ }
693
+ var WebGLHelper = class extends Disposable_default {
694
+ /**
695
+ * @param {Options} [options] Options.
696
+ */
697
+ constructor(options) {
698
+ super();
699
+ options = options || {};
700
+ this.boundHandleWebGLContextLost_ = this.handleWebGLContextLost.bind(this);
701
+ this.boundHandleWebGLContextRestored_ = this.handleWebGLContextRestored.bind(this);
702
+ this.canvasCacheKey_ = options.canvasCacheKey ? getSharedCanvasCacheKey(options.canvasCacheKey) : getUniqueCanvasCacheKey();
703
+ this.gl_ = getOrCreateContext(this.canvasCacheKey_);
704
+ this.bufferCache_ = {};
705
+ this.extensionCache_ = {};
706
+ this.currentProgram_ = null;
707
+ this.needsToBeRecreated_ = false;
708
+ const canvas = this.gl_.canvas;
709
+ canvas.addEventListener(
710
+ ContextEventType_default.LOST,
711
+ this.boundHandleWebGLContextLost_
712
+ );
713
+ canvas.addEventListener(
714
+ ContextEventType_default.RESTORED,
715
+ this.boundHandleWebGLContextRestored_
716
+ );
717
+ this.offsetRotateMatrix_ = create();
718
+ this.offsetScaleMatrix_ = create();
719
+ this.tmpMat4_ = create2();
720
+ this.uniformLocationsByProgram_ = {};
721
+ this.attribLocationsByProgram_ = {};
722
+ this.uniforms_ = [];
723
+ if (options.uniforms) {
724
+ this.setUniforms(options.uniforms);
725
+ }
726
+ this.postProcessPasses_ = options.postProcesses ? options.postProcesses.map(
727
+ (options2) => new PostProcessingPass_default({
728
+ webGlContext: this.gl_,
729
+ scaleRatio: options2.scaleRatio,
730
+ vertexShader: options2.vertexShader,
731
+ fragmentShader: options2.fragmentShader,
732
+ uniforms: options2.uniforms
733
+ })
734
+ ) : [new PostProcessingPass_default({ webGlContext: this.gl_ })];
735
+ this.shaderCompileErrors_ = null;
736
+ this.startTime_ = Date.now();
737
+ this.maxAttributeCount_ = this.gl_.getParameter(
738
+ this.gl_.MAX_VERTEX_ATTRIBS
739
+ );
740
+ }
741
+ /**
742
+ * @param {Object<string, UniformValue>} uniforms Uniform definitions.
743
+ */
744
+ setUniforms(uniforms) {
745
+ this.uniforms_ = [];
746
+ this.addUniforms(uniforms);
747
+ }
748
+ /**
749
+ * @param {Object<string, UniformValue>} uniforms Uniform definitions.
750
+ */
751
+ addUniforms(uniforms) {
752
+ for (const name in uniforms) {
753
+ this.uniforms_.push({
754
+ name,
755
+ value: uniforms[name]
756
+ });
757
+ }
758
+ }
759
+ /**
760
+ * @param {string} canvasCacheKey The canvas cache key.
761
+ * @return {boolean} The provided key matches the one this helper was constructed with.
762
+ */
763
+ canvasCacheKeyMatches(canvasCacheKey) {
764
+ return this.canvasCacheKey_ === getSharedCanvasCacheKey(canvasCacheKey);
765
+ }
766
+ /**
767
+ * Get a WebGL extension. If the extension is not supported, null is returned.
768
+ * Extensions are cached after they are enabled for the first time.
769
+ * @param {string} name The extension name.
770
+ * @return {Object|null} The extension or null if not supported.
771
+ */
772
+ getExtension(name) {
773
+ if (name in this.extensionCache_) {
774
+ return this.extensionCache_[name];
775
+ }
776
+ const extension = this.gl_.getExtension(name);
777
+ this.extensionCache_[name] = extension;
778
+ return extension;
779
+ }
780
+ /**
781
+ * Will throw if the extension is not available
782
+ * @return {ANGLE_instanced_arrays} Extension
783
+ */
784
+ getInstancedRenderingExtension_() {
785
+ const ext = this.getExtension("ANGLE_instanced_arrays");
786
+ assert(
787
+ !!ext,
788
+ "WebGL extension 'ANGLE_instanced_arrays' is required for vector rendering"
789
+ );
790
+ return ext;
791
+ }
792
+ /**
793
+ * Just bind the buffer if it's in the cache. Otherwise create
794
+ * the WebGL buffer, bind it, populate it, and add an entry to
795
+ * the cache.
796
+ * @param {import("./Buffer").default} buffer Buffer.
797
+ */
798
+ bindBuffer(buffer) {
799
+ const gl = this.gl_;
800
+ const bufferKey = getUid(buffer);
801
+ let bufferCache = this.bufferCache_[bufferKey];
802
+ if (!bufferCache) {
803
+ const webGlBuffer = gl.createBuffer();
804
+ bufferCache = {
805
+ buffer,
806
+ webGlBuffer
807
+ };
808
+ this.bufferCache_[bufferKey] = bufferCache;
809
+ }
810
+ gl.bindBuffer(buffer.getType(), bufferCache.webGlBuffer);
811
+ }
812
+ /**
813
+ * Update the data contained in the buffer array; this is required for the
814
+ * new data to be rendered
815
+ * @param {import("./Buffer").default} buffer Buffer.
816
+ */
817
+ flushBufferData(buffer) {
818
+ const gl = this.gl_;
819
+ this.bindBuffer(buffer);
820
+ gl.bufferData(buffer.getType(), buffer.getArray(), buffer.getUsage());
821
+ }
822
+ /**
823
+ * @param {import("./Buffer.js").default} buf Buffer.
824
+ */
825
+ deleteBuffer(buf) {
826
+ const bufferKey = getUid(buf);
827
+ delete this.bufferCache_[bufferKey];
828
+ }
829
+ /**
830
+ * Clean up.
831
+ * @override
832
+ */
833
+ disposeInternal() {
834
+ const canvas = this.gl_.canvas;
835
+ canvas.removeEventListener(
836
+ ContextEventType_default.LOST,
837
+ this.boundHandleWebGLContextLost_
838
+ );
839
+ canvas.removeEventListener(
840
+ ContextEventType_default.RESTORED,
841
+ this.boundHandleWebGLContextRestored_
842
+ );
843
+ releaseCanvas(this.canvasCacheKey_);
844
+ delete this.gl_;
845
+ }
846
+ /**
847
+ * Clear the buffer & set the viewport to draw.
848
+ * Post process passes will be initialized here, the first one being bound as a render target for
849
+ * subsequent draw calls.
850
+ * @param {import("../Map.js").FrameState} frameState current frame state
851
+ * @param {boolean} [disableAlphaBlend] If true, no alpha blending will happen.
852
+ * @param {boolean} [enableDepth] If true, enables depth testing.
853
+ */
854
+ prepareDraw(frameState, disableAlphaBlend, enableDepth) {
855
+ const gl = this.gl_;
856
+ const canvas = this.getCanvas();
857
+ const size = frameState.size;
858
+ const pixelRatio = frameState.pixelRatio;
859
+ if (canvas.width !== size[0] * pixelRatio || canvas.height !== size[1] * pixelRatio) {
860
+ canvas.width = size[0] * pixelRatio;
861
+ canvas.height = size[1] * pixelRatio;
862
+ canvas.style.width = size[0] + "px";
863
+ canvas.style.height = size[1] + "px";
864
+ }
865
+ for (let i = this.postProcessPasses_.length - 1; i >= 0; i--) {
866
+ this.postProcessPasses_[i].init(frameState);
867
+ }
868
+ gl.bindTexture(gl.TEXTURE_2D, null);
869
+ gl.clearColor(0, 0, 0, 0);
870
+ gl.depthRange(0, 1);
871
+ gl.clearDepth(1);
872
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
873
+ gl.enable(gl.BLEND);
874
+ gl.blendFunc(gl.ONE, disableAlphaBlend ? gl.ZERO : gl.ONE_MINUS_SRC_ALPHA);
875
+ if (enableDepth) {
876
+ gl.enable(gl.DEPTH_TEST);
877
+ gl.depthFunc(gl.LEQUAL);
878
+ } else {
879
+ gl.disable(gl.DEPTH_TEST);
880
+ }
881
+ }
882
+ /**
883
+ * @param {WebGLFramebuffer|null} frameBuffer The frame buffer.
884
+ * @param {WebGLTexture} [texture] The texture.
885
+ */
886
+ bindFrameBuffer(frameBuffer, texture) {
887
+ const gl = this.getGL();
888
+ gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);
889
+ if (texture) {
890
+ gl.framebufferTexture2D(
891
+ gl.FRAMEBUFFER,
892
+ gl.COLOR_ATTACHMENT0,
893
+ gl.TEXTURE_2D,
894
+ texture,
895
+ 0
896
+ );
897
+ }
898
+ }
899
+ /**
900
+ * Bind the frame buffer from the initial render.
901
+ */
902
+ bindInitialFrameBuffer() {
903
+ const gl = this.getGL();
904
+ const frameBuffer = this.postProcessPasses_[0].getFrameBuffer();
905
+ gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);
906
+ const texture = this.postProcessPasses_[0].getRenderTargetTexture();
907
+ gl.framebufferTexture2D(
908
+ gl.FRAMEBUFFER,
909
+ gl.COLOR_ATTACHMENT0,
910
+ gl.TEXTURE_2D,
911
+ texture,
912
+ 0
913
+ );
914
+ }
915
+ /**
916
+ * Prepare a program to use a texture.
917
+ * @param {WebGLTexture} texture The texture.
918
+ * @param {number} slot The texture slot.
919
+ * @param {string} uniformName The corresponding uniform name.
920
+ */
921
+ bindTexture(texture, slot, uniformName) {
922
+ const gl = this.gl_;
923
+ gl.activeTexture(gl.TEXTURE0 + slot);
924
+ gl.bindTexture(gl.TEXTURE_2D, texture);
925
+ gl.uniform1i(this.getUniformLocation(uniformName), slot);
926
+ }
927
+ /**
928
+ * Set up an attribute array buffer for use in the vertex shader.
929
+ * @param {import("./Buffer").default} buffer The buffer.
930
+ * @param {string} attributeName The attribute name.
931
+ * @param {number} size The number of components per attribute vertex.
932
+ */
933
+ bindAttribute(buffer, attributeName, size) {
934
+ const gl = this.getGL();
935
+ this.bindBuffer(buffer);
936
+ const index = this.getAttributeLocation(attributeName);
937
+ gl.enableVertexAttribArray(index);
938
+ gl.vertexAttribPointer(index, size, gl.FLOAT, false, 0, 0);
939
+ }
940
+ /**
941
+ * Clear the render target & bind it for future draw operations.
942
+ * This is similar to `prepareDraw`, only post processes will not be applied.
943
+ * Note: the whole viewport will be drawn to the render target, regardless of its size.
944
+ * @param {import("../Map.js").FrameState} frameState current frame state
945
+ * @param {import("./RenderTarget.js").default} renderTarget Render target to draw to
946
+ * @param {boolean} [disableAlphaBlend] If true, no alpha blending will happen.
947
+ * @param {boolean} [enableDepth] If true, enables depth testing.
948
+ */
949
+ prepareDrawToRenderTarget(frameState, renderTarget, disableAlphaBlend, enableDepth) {
950
+ const gl = this.gl_;
951
+ const size = renderTarget.getSize();
952
+ gl.bindFramebuffer(gl.FRAMEBUFFER, renderTarget.getFramebuffer());
953
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderTarget.getDepthbuffer());
954
+ gl.viewport(0, 0, size[0], size[1]);
955
+ gl.bindTexture(gl.TEXTURE_2D, renderTarget.getTexture());
956
+ gl.clearColor(0, 0, 0, 0);
957
+ gl.depthRange(0, 1);
958
+ gl.clearDepth(1);
959
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
960
+ gl.enable(gl.BLEND);
961
+ gl.blendFunc(gl.ONE, disableAlphaBlend ? gl.ZERO : gl.ONE_MINUS_SRC_ALPHA);
962
+ if (enableDepth) {
963
+ gl.enable(gl.DEPTH_TEST);
964
+ gl.depthFunc(gl.LEQUAL);
965
+ } else {
966
+ gl.disable(gl.DEPTH_TEST);
967
+ }
968
+ }
969
+ /**
970
+ * Execute a draw call based on the currently bound program, texture, buffers, attributes.
971
+ * @param {number} start Start index.
972
+ * @param {number} end End index.
973
+ */
974
+ drawElements(start, end) {
975
+ const gl = this.gl_;
976
+ this.getExtension("OES_element_index_uint");
977
+ const elementType = gl.UNSIGNED_INT;
978
+ const elementSize = 4;
979
+ const numItems = end - start;
980
+ const offsetInBytes = start * elementSize;
981
+ gl.drawElements(gl.TRIANGLES, numItems, elementType, offsetInBytes);
982
+ }
983
+ /**
984
+ * Execute a draw call similar to `drawElements`, but using instanced rendering.
985
+ * Will have no effect if `enableAttributesInstanced` was not called for this rendering pass.
986
+ * @param {number} start Start index.
987
+ * @param {number} end End index.
988
+ * @param {number} instanceCount The number of instances to render
989
+ */
990
+ drawElementsInstanced(start, end, instanceCount) {
991
+ const gl = this.gl_;
992
+ this.getExtension("OES_element_index_uint");
993
+ const ext = this.getInstancedRenderingExtension_();
994
+ const elementType = gl.UNSIGNED_INT;
995
+ const elementSize = 4;
996
+ const numItems = end - start;
997
+ const offsetInBytes = start * elementSize;
998
+ ext.drawElementsInstancedANGLE(
999
+ gl.TRIANGLES,
1000
+ numItems,
1001
+ elementType,
1002
+ offsetInBytes,
1003
+ instanceCount
1004
+ );
1005
+ for (let i = 0; i < this.maxAttributeCount_; i++) {
1006
+ ext.vertexAttribDivisorANGLE(i, 0);
1007
+ }
1008
+ }
1009
+ /**
1010
+ * Apply the successive post process passes which will eventually render to the actual canvas.
1011
+ * @param {import("../Map.js").FrameState} frameState current frame state
1012
+ * @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [preCompose] Called before composing.
1013
+ * @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [postCompose] Called before composing.
1014
+ */
1015
+ finalizeDraw(frameState, preCompose, postCompose) {
1016
+ for (let i = 0, ii = this.postProcessPasses_.length; i < ii; i++) {
1017
+ if (i === ii - 1) {
1018
+ this.postProcessPasses_[i].apply(
1019
+ frameState,
1020
+ null,
1021
+ preCompose,
1022
+ postCompose
1023
+ );
1024
+ } else {
1025
+ this.postProcessPasses_[i].apply(
1026
+ frameState,
1027
+ this.postProcessPasses_[i + 1]
1028
+ );
1029
+ }
1030
+ }
1031
+ }
1032
+ /**
1033
+ * @return {HTMLCanvasElement} Canvas.
1034
+ */
1035
+ getCanvas() {
1036
+ return (
1037
+ /** @type {HTMLCanvasElement} */
1038
+ this.gl_.canvas
1039
+ );
1040
+ }
1041
+ /**
1042
+ * Get the WebGL rendering context
1043
+ * @return {WebGLRenderingContext} The rendering context.
1044
+ */
1045
+ getGL() {
1046
+ return this.gl_;
1047
+ }
1048
+ /**
1049
+ * Sets the default matrix uniforms for a given frame state. This is called internally in `prepareDraw`.
1050
+ * @param {import("../Map.js").FrameState} frameState Frame state.
1051
+ */
1052
+ applyFrameState(frameState) {
1053
+ const size = frameState.size;
1054
+ const rotation = frameState.viewState.rotation;
1055
+ const pixelRatio = frameState.pixelRatio;
1056
+ this.setUniformFloatValue(
1057
+ DefaultUniform.TIME,
1058
+ (Date.now() - this.startTime_) * 1e-3
1059
+ );
1060
+ this.setUniformFloatValue(DefaultUniform.ZOOM, frameState.viewState.zoom);
1061
+ this.setUniformFloatValue(
1062
+ DefaultUniform.RESOLUTION,
1063
+ frameState.viewState.resolution
1064
+ );
1065
+ this.setUniformFloatValue(DefaultUniform.PIXEL_RATIO, pixelRatio);
1066
+ this.setUniformFloatVec2(DefaultUniform.VIEWPORT_SIZE_PX, [
1067
+ size[0],
1068
+ size[1]
1069
+ ]);
1070
+ this.setUniformFloatValue(DefaultUniform.ROTATION, rotation);
1071
+ }
1072
+ /**
1073
+ * Sets the `u_hitDetection` uniform.
1074
+ * @param {boolean} enabled Whether to enable the hit detection code path
1075
+ */
1076
+ applyHitDetectionUniform(enabled) {
1077
+ const loc = this.getUniformLocation(DefaultUniform.HIT_DETECTION);
1078
+ this.getGL().uniform1i(loc, enabled ? 1 : 0);
1079
+ if (enabled) {
1080
+ this.setUniformFloatValue(DefaultUniform.PIXEL_RATIO, 0.5);
1081
+ }
1082
+ }
1083
+ /**
1084
+ * Sets the custom uniforms based on what was given in the constructor. This is called internally in `prepareDraw`.
1085
+ * @param {import("../Map.js").FrameState} frameState Frame state.
1086
+ */
1087
+ applyUniforms(frameState) {
1088
+ const gl = this.gl_;
1089
+ let value;
1090
+ let textureSlot = 0;
1091
+ this.uniforms_.forEach((uniform) => {
1092
+ value = typeof uniform.value === "function" ? uniform.value(frameState) : uniform.value;
1093
+ if (value instanceof HTMLCanvasElement || value instanceof HTMLImageElement || value instanceof ImageData || value instanceof WebGLTexture) {
1094
+ if (value instanceof WebGLTexture && !uniform.texture) {
1095
+ uniform.prevValue = void 0;
1096
+ uniform.texture = value;
1097
+ } else if (!uniform.texture) {
1098
+ uniform.prevValue = void 0;
1099
+ uniform.texture = gl.createTexture();
1100
+ }
1101
+ this.bindTexture(uniform.texture, textureSlot, uniform.name);
1102
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
1103
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
1104
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
1105
+ const imageReady = !(value instanceof HTMLImageElement) || /** @type {HTMLImageElement} */
1106
+ value.complete;
1107
+ if (!(value instanceof WebGLTexture) && imageReady && uniform.prevValue !== value) {
1108
+ uniform.prevValue = value;
1109
+ gl.texImage2D(
1110
+ gl.TEXTURE_2D,
1111
+ 0,
1112
+ gl.RGBA,
1113
+ gl.RGBA,
1114
+ gl.UNSIGNED_BYTE,
1115
+ value
1116
+ );
1117
+ }
1118
+ textureSlot++;
1119
+ } else if (Array.isArray(value) && value.length === 6) {
1120
+ this.setUniformMatrixValue(
1121
+ uniform.name,
1122
+ fromTransform(this.tmpMat4_, value)
1123
+ );
1124
+ } else if (Array.isArray(value) && value.length <= 4) {
1125
+ switch (value.length) {
1126
+ case 2:
1127
+ gl.uniform2f(
1128
+ this.getUniformLocation(uniform.name),
1129
+ value[0],
1130
+ value[1]
1131
+ );
1132
+ return;
1133
+ case 3:
1134
+ gl.uniform3f(
1135
+ this.getUniformLocation(uniform.name),
1136
+ value[0],
1137
+ value[1],
1138
+ value[2]
1139
+ );
1140
+ return;
1141
+ case 4:
1142
+ gl.uniform4f(
1143
+ this.getUniformLocation(uniform.name),
1144
+ value[0],
1145
+ value[1],
1146
+ value[2],
1147
+ value[3]
1148
+ );
1149
+ return;
1150
+ default:
1151
+ return;
1152
+ }
1153
+ } else if (typeof value === "number") {
1154
+ gl.uniform1f(this.getUniformLocation(uniform.name), value);
1155
+ }
1156
+ });
1157
+ }
1158
+ /**
1159
+ * Set up a program for use. The program will be set as the current one. Then, the uniforms used
1160
+ * in the program will be set based on the current frame state and the helper configuration.
1161
+ * @param {WebGLProgram} program Program.
1162
+ * @param {import("../Map.js").FrameState} [frameState] Frame state.
1163
+ */
1164
+ useProgram(program, frameState) {
1165
+ this.disableAllAttributes_();
1166
+ const gl = this.gl_;
1167
+ gl.useProgram(program);
1168
+ this.currentProgram_ = program;
1169
+ if (frameState) {
1170
+ this.applyFrameState(frameState);
1171
+ this.applyUniforms(frameState);
1172
+ }
1173
+ }
1174
+ /**
1175
+ * Will attempt to compile a vertex or fragment shader based on source
1176
+ * On error, the shader will be returned but
1177
+ * `gl.getShaderParameter(shader, gl.COMPILE_STATUS)` will return `true`
1178
+ * Use `gl.getShaderInfoLog(shader)` to have details
1179
+ * @param {string} source Shader source
1180
+ * @param {ShaderType} type VERTEX_SHADER or FRAGMENT_SHADER
1181
+ * @return {WebGLShader} Shader object
1182
+ */
1183
+ compileShader(source, type) {
1184
+ const gl = this.gl_;
1185
+ const shader = gl.createShader(type);
1186
+ gl.shaderSource(shader, source);
1187
+ gl.compileShader(shader);
1188
+ return shader;
1189
+ }
1190
+ /**
1191
+ * Create a program for a vertex and fragment shader. Throws if shader compilation fails.
1192
+ * @param {string} fragmentShaderSource Fragment shader source.
1193
+ * @param {string} vertexShaderSource Vertex shader source.
1194
+ * @return {WebGLProgram} Program
1195
+ */
1196
+ getProgram(fragmentShaderSource, vertexShaderSource) {
1197
+ const gl = this.gl_;
1198
+ const fragmentShader = this.compileShader(
1199
+ fragmentShaderSource,
1200
+ gl.FRAGMENT_SHADER
1201
+ );
1202
+ const vertexShader = this.compileShader(
1203
+ vertexShaderSource,
1204
+ gl.VERTEX_SHADER
1205
+ );
1206
+ const program = gl.createProgram();
1207
+ gl.attachShader(program, fragmentShader);
1208
+ gl.attachShader(program, vertexShader);
1209
+ gl.linkProgram(program);
1210
+ if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
1211
+ const message = `Fragment shader compilation failed: ${gl.getShaderInfoLog(
1212
+ fragmentShader
1213
+ )}`;
1214
+ throw new Error(message);
1215
+ }
1216
+ gl.deleteShader(fragmentShader);
1217
+ if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
1218
+ const message = `Vertex shader compilation failed: ${gl.getShaderInfoLog(
1219
+ vertexShader
1220
+ )}`;
1221
+ throw new Error(message);
1222
+ }
1223
+ gl.deleteShader(vertexShader);
1224
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
1225
+ const message = `GL program linking failed: ${gl.getProgramInfoLog(
1226
+ program
1227
+ )}`;
1228
+ throw new Error(message);
1229
+ }
1230
+ return program;
1231
+ }
1232
+ /**
1233
+ * Will get the location from the shader or the cache
1234
+ * @param {string} name Uniform name
1235
+ * @return {WebGLUniformLocation} uniformLocation
1236
+ */
1237
+ getUniformLocation(name) {
1238
+ const programUid = getUid(this.currentProgram_);
1239
+ if (this.uniformLocationsByProgram_[programUid] === void 0) {
1240
+ this.uniformLocationsByProgram_[programUid] = {};
1241
+ }
1242
+ if (this.uniformLocationsByProgram_[programUid][name] === void 0) {
1243
+ this.uniformLocationsByProgram_[programUid][name] = this.gl_.getUniformLocation(this.currentProgram_, name);
1244
+ }
1245
+ return this.uniformLocationsByProgram_[programUid][name];
1246
+ }
1247
+ /**
1248
+ * Will get the location from the shader or the cache
1249
+ * @param {string} name Attribute name
1250
+ * @return {number} attribLocation
1251
+ */
1252
+ getAttributeLocation(name) {
1253
+ const programUid = getUid(this.currentProgram_);
1254
+ if (this.attribLocationsByProgram_[programUid] === void 0) {
1255
+ this.attribLocationsByProgram_[programUid] = {};
1256
+ }
1257
+ if (this.attribLocationsByProgram_[programUid][name] === void 0) {
1258
+ this.attribLocationsByProgram_[programUid][name] = this.gl_.getAttribLocation(this.currentProgram_, name);
1259
+ }
1260
+ return this.attribLocationsByProgram_[programUid][name];
1261
+ }
1262
+ /**
1263
+ * Sets the given transform to apply the rotation/translation/scaling of the given frame state.
1264
+ * The resulting transform can be used to convert world space coordinates to view coordinates in the [-1, 1] range.
1265
+ * @param {import("../Map.js").FrameState} frameState Frame state.
1266
+ * @param {import("../transform").Transform} transform Transform to update.
1267
+ * @return {import("../transform").Transform} The updated transform object.
1268
+ */
1269
+ makeProjectionTransform(frameState, transform) {
1270
+ const size = frameState.size;
1271
+ const rotation = frameState.viewState.rotation;
1272
+ const resolution = frameState.viewState.resolution;
1273
+ const center = frameState.viewState.center;
1274
+ compose(
1275
+ transform,
1276
+ 0,
1277
+ 0,
1278
+ 2 / (resolution * size[0]),
1279
+ 2 / (resolution * size[1]),
1280
+ -rotation,
1281
+ -center[0],
1282
+ -center[1]
1283
+ );
1284
+ return transform;
1285
+ }
1286
+ /**
1287
+ * Give a value for a standard float uniform
1288
+ * @param {string} uniform Uniform name
1289
+ * @param {number} value Value
1290
+ */
1291
+ setUniformFloatValue(uniform, value) {
1292
+ this.gl_.uniform1f(this.getUniformLocation(uniform), value);
1293
+ }
1294
+ /**
1295
+ * Give a value for a vec2 uniform
1296
+ * @param {string} uniform Uniform name
1297
+ * @param {Array<number>} value Array of length 4.
1298
+ */
1299
+ setUniformFloatVec2(uniform, value) {
1300
+ this.gl_.uniform2fv(this.getUniformLocation(uniform), value);
1301
+ }
1302
+ /**
1303
+ * Give a value for a vec4 uniform
1304
+ * @param {string} uniform Uniform name
1305
+ * @param {Array<number>} value Array of length 4.
1306
+ */
1307
+ setUniformFloatVec4(uniform, value) {
1308
+ this.gl_.uniform4fv(this.getUniformLocation(uniform), value);
1309
+ }
1310
+ /**
1311
+ * Give a value for a standard matrix4 uniform
1312
+ * @param {string} uniform Uniform name
1313
+ * @param {Array<number>} value Matrix value
1314
+ */
1315
+ setUniformMatrixValue(uniform, value) {
1316
+ this.gl_.uniformMatrix4fv(this.getUniformLocation(uniform), false, value);
1317
+ }
1318
+ /**
1319
+ * Disable all vertex attributes.
1320
+ * @private
1321
+ */
1322
+ disableAllAttributes_() {
1323
+ for (let i = 0; i < this.maxAttributeCount_; i++) {
1324
+ this.gl_.disableVertexAttribArray(i);
1325
+ }
1326
+ }
1327
+ /**
1328
+ * Will set the currently bound buffer to an attribute of the shader program. Used by `#enableAttributes`
1329
+ * internally.
1330
+ * @param {string} attribName Attribute name
1331
+ * @param {number} size Number of components per attributes
1332
+ * @param {number} type UNSIGNED_INT, UNSIGNED_BYTE, UNSIGNED_SHORT or FLOAT
1333
+ * @param {number} stride Stride in bytes (0 means attribs are packed)
1334
+ * @param {number} offset Offset in bytes
1335
+ * @param {boolean} instanced Whether the attribute is used for instanced rendering
1336
+ * @private
1337
+ */
1338
+ enableAttributeArray_(attribName, size, type, stride, offset, instanced) {
1339
+ const location = this.getAttributeLocation(attribName);
1340
+ if (location < 0) {
1341
+ return;
1342
+ }
1343
+ this.gl_.enableVertexAttribArray(location);
1344
+ this.gl_.vertexAttribPointer(location, size, type, false, stride, offset);
1345
+ if (instanced) {
1346
+ this.getInstancedRenderingExtension_().vertexAttribDivisorANGLE(
1347
+ location,
1348
+ 1
1349
+ );
1350
+ }
1351
+ }
1352
+ /**
1353
+ * @private
1354
+ * @param {Array<AttributeDescription>} attributes Ordered list of attributes to read from the buffer
1355
+ * @param {boolean} instanced Whether the attributes are instanced.
1356
+ */
1357
+ enableAttributes_(attributes, instanced) {
1358
+ const stride = computeAttributesStride(attributes);
1359
+ let offset = 0;
1360
+ for (let i = 0; i < attributes.length; i++) {
1361
+ const attr = attributes[i];
1362
+ if (attr.name) {
1363
+ this.enableAttributeArray_(
1364
+ attr.name,
1365
+ attr.size,
1366
+ attr.type || FLOAT,
1367
+ stride,
1368
+ offset,
1369
+ instanced
1370
+ );
1371
+ }
1372
+ offset += attr.size * getByteSizeFromType(attr.type);
1373
+ }
1374
+ }
1375
+ /**
1376
+ * Will enable the following attributes to be read from the currently bound buffer,
1377
+ * i.e. tell the GPU where to read the different attributes in the buffer. An error in the
1378
+ * size/type/order of attributes will most likely break the rendering and throw a WebGL exception.
1379
+ * @param {Array<AttributeDescription>} attributes Ordered list of attributes to read from the buffer
1380
+ */
1381
+ enableAttributes(attributes) {
1382
+ this.enableAttributes_(attributes, false);
1383
+ }
1384
+ /**
1385
+ * Will enable these attributes as instanced, meaning that they will only be read
1386
+ * once per instance instead of per vertex.
1387
+ * @param {Array<AttributeDescription>} attributes Ordered list of attributes to read from the buffer
1388
+ */
1389
+ enableAttributesInstanced(attributes) {
1390
+ this.enableAttributes_(attributes, true);
1391
+ }
1392
+ /**
1393
+ * WebGL context was lost
1394
+ * @param {WebGLContextEvent} event The context loss event.
1395
+ * @private
1396
+ */
1397
+ handleWebGLContextLost(event) {
1398
+ clear(this.bufferCache_);
1399
+ this.currentProgram_ = null;
1400
+ event.preventDefault();
1401
+ }
1402
+ /**
1403
+ * WebGL context was restored
1404
+ * @private
1405
+ */
1406
+ handleWebGLContextRestored() {
1407
+ this.needsToBeRecreated_ = true;
1408
+ }
1409
+ /**
1410
+ * Returns whether this helper needs to be recreated, as the context was lost and then restored.
1411
+ * @return {boolean} Whether this helper needs to be recreated.
1412
+ */
1413
+ needsToBeRecreated() {
1414
+ return this.needsToBeRecreated_;
1415
+ }
1416
+ /**
1417
+ * Will create or reuse a given webgl texture and apply the given size. If no image data
1418
+ * specified, the texture will be empty, otherwise image data will be used and the `size`
1419
+ * parameter will be ignored. If a Uint8Array is provided for data, a size must also be provided.
1420
+ * Note: wrap parameters are set to clamp to edge, min filter is set to linear.
1421
+ * @param {Array<number>} size Expected size of the texture
1422
+ * @param {ImageData|HTMLImageElement|HTMLCanvasElement|Uint8Array|null} data Image data/object to bind to the texture
1423
+ * @param {WebGLTexture} [texture] Existing texture to reuse
1424
+ * @param {boolean} [nearest] Use gl.NEAREST for min/mag filter.
1425
+ * @return {WebGLTexture} The generated texture
1426
+ */
1427
+ createTexture(size, data, texture, nearest) {
1428
+ const gl = this.gl_;
1429
+ texture = texture || gl.createTexture();
1430
+ const filter = nearest ? gl.NEAREST : gl.LINEAR;
1431
+ gl.bindTexture(gl.TEXTURE_2D, texture);
1432
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filter);
1433
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filter);
1434
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
1435
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
1436
+ const level = 0;
1437
+ const internalFormat = gl.RGBA;
1438
+ const border = 0;
1439
+ const format = gl.RGBA;
1440
+ const type = gl.UNSIGNED_BYTE;
1441
+ if (data instanceof Uint8Array) {
1442
+ gl.texImage2D(
1443
+ gl.TEXTURE_2D,
1444
+ level,
1445
+ internalFormat,
1446
+ size[0],
1447
+ size[1],
1448
+ border,
1449
+ format,
1450
+ type,
1451
+ data
1452
+ );
1453
+ } else if (data) {
1454
+ gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, format, type, data);
1455
+ } else {
1456
+ gl.texImage2D(
1457
+ gl.TEXTURE_2D,
1458
+ level,
1459
+ internalFormat,
1460
+ size[0],
1461
+ size[1],
1462
+ border,
1463
+ format,
1464
+ type,
1465
+ null
1466
+ );
1467
+ }
1468
+ return texture;
1469
+ }
1470
+ };
1471
+ function computeAttributesStride(attributes) {
1472
+ let stride = 0;
1473
+ for (let i = 0; i < attributes.length; i++) {
1474
+ const attr = attributes[i];
1475
+ stride += attr.size * getByteSizeFromType(attr.type);
1476
+ }
1477
+ return stride;
1478
+ }
1479
+ function getByteSizeFromType(type) {
1480
+ switch (type) {
1481
+ case AttributeType.UNSIGNED_BYTE:
1482
+ return Uint8Array.BYTES_PER_ELEMENT;
1483
+ case AttributeType.UNSIGNED_SHORT:
1484
+ return Uint16Array.BYTES_PER_ELEMENT;
1485
+ case AttributeType.UNSIGNED_INT:
1486
+ return Uint32Array.BYTES_PER_ELEMENT;
1487
+ case AttributeType.FLOAT:
1488
+ default:
1489
+ return Float32Array.BYTES_PER_ELEMENT;
1490
+ }
1491
+ }
1492
+ var Helper_default = WebGLHelper;
1493
+
1494
+ // node_modules/ol/webgl/TileTexture.js
1495
+ init_dirname();
1496
+ init_buffer();
1497
+ init_process();
1498
+
1499
+ // node_modules/ol/webgl/BaseTileRepresentation.js
1500
+ init_dirname();
1501
+ init_buffer();
1502
+ init_process();
1503
+ var BaseTileRepresentation = class extends Target_default {
1504
+ /**
1505
+ * @param {TileRepresentationOptions<TileType>} options The tile representation options.
1506
+ */
1507
+ constructor(options) {
1508
+ super();
1509
+ this.tile;
1510
+ this.handleTileChange_ = this.handleTileChange_.bind(this);
1511
+ this.gutter = options.gutter || 0;
1512
+ this.helper = options.helper;
1513
+ this.loaded = false;
1514
+ this.ready = false;
1515
+ }
1516
+ /**
1517
+ * @param {TileType} tile Tile.
1518
+ */
1519
+ setTile(tile) {
1520
+ if (tile !== this.tile) {
1521
+ if (this.tile) {
1522
+ this.tile.removeEventListener(EventType_default.CHANGE, this.handleTileChange_);
1523
+ }
1524
+ this.tile = tile;
1525
+ this.loaded = tile.getState() === TileState_default.LOADED;
1526
+ if (this.loaded) {
1527
+ this.uploadTile();
1528
+ } else {
1529
+ if (tile instanceof ImageTile_default) {
1530
+ const image = tile.getImage();
1531
+ if (image instanceof Image && !image.crossOrigin) {
1532
+ image.crossOrigin = "anonymous";
1533
+ }
1534
+ }
1535
+ tile.addEventListener(EventType_default.CHANGE, this.handleTileChange_);
1536
+ }
1537
+ }
1538
+ }
1539
+ /**
1540
+ * @abstract
1541
+ * @protected
1542
+ */
1543
+ uploadTile() {
1544
+ abstract();
1545
+ }
1546
+ setReady() {
1547
+ this.ready = true;
1548
+ this.dispatchEvent(EventType_default.CHANGE);
1549
+ }
1550
+ handleTileChange_() {
1551
+ if (this.tile.getState() === TileState_default.LOADED) {
1552
+ this.loaded = true;
1553
+ this.uploadTile();
1554
+ }
1555
+ }
1556
+ /**
1557
+ * @param {import("./Helper.js").default} helper The WebGL helper.
1558
+ */
1559
+ setHelper(helper) {
1560
+ this.helper = helper;
1561
+ if (this.helper && this.loaded) {
1562
+ this.uploadTile();
1563
+ }
1564
+ }
1565
+ /**
1566
+ * @override
1567
+ */
1568
+ disposeInternal() {
1569
+ this.setHelper(null);
1570
+ this.tile.removeEventListener(EventType_default.CHANGE, this.handleTileChange_);
1571
+ }
1572
+ };
1573
+ var BaseTileRepresentation_default = BaseTileRepresentation;
1574
+
1575
+ // node_modules/ol/webgl/TileTexture.js
1576
+ function bindAndConfigure(gl, texture, interpolate) {
1577
+ const resampleFilter = interpolate ? gl.LINEAR : gl.NEAREST;
1578
+ gl.bindTexture(gl.TEXTURE_2D, texture);
1579
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
1580
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
1581
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, resampleFilter);
1582
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, resampleFilter);
1583
+ }
1584
+ function uploadImageTexture(gl, texture, image, interpolate) {
1585
+ bindAndConfigure(gl, texture, interpolate);
1586
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
1587
+ }
1588
+ function uploadDataTexture(helper, texture, data, size, bandCount, interpolate) {
1589
+ const gl = helper.getGL();
1590
+ let textureType;
1591
+ let canInterpolate;
1592
+ if (data instanceof Float32Array) {
1593
+ textureType = gl.FLOAT;
1594
+ helper.getExtension("OES_texture_float");
1595
+ const extension = helper.getExtension("OES_texture_float_linear");
1596
+ canInterpolate = extension !== null;
1597
+ } else {
1598
+ textureType = gl.UNSIGNED_BYTE;
1599
+ canInterpolate = true;
1600
+ }
1601
+ bindAndConfigure(gl, texture, interpolate && canInterpolate);
1602
+ const bytesPerRow = data.byteLength / size[1];
1603
+ let unpackAlignment = 1;
1604
+ if (bytesPerRow % 8 === 0) {
1605
+ unpackAlignment = 8;
1606
+ } else if (bytesPerRow % 4 === 0) {
1607
+ unpackAlignment = 4;
1608
+ } else if (bytesPerRow % 2 === 0) {
1609
+ unpackAlignment = 2;
1610
+ }
1611
+ let format;
1612
+ switch (bandCount) {
1613
+ case 1: {
1614
+ format = gl.LUMINANCE;
1615
+ break;
1616
+ }
1617
+ case 2: {
1618
+ format = gl.LUMINANCE_ALPHA;
1619
+ break;
1620
+ }
1621
+ case 3: {
1622
+ format = gl.RGB;
1623
+ break;
1624
+ }
1625
+ case 4: {
1626
+ format = gl.RGBA;
1627
+ break;
1628
+ }
1629
+ default: {
1630
+ throw new Error(`Unsupported number of bands: ${bandCount}`);
1631
+ }
1632
+ }
1633
+ const oldUnpackAlignment = gl.getParameter(gl.UNPACK_ALIGNMENT);
1634
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
1635
+ gl.texImage2D(
1636
+ gl.TEXTURE_2D,
1637
+ 0,
1638
+ format,
1639
+ size[0],
1640
+ size[1],
1641
+ 0,
1642
+ format,
1643
+ textureType,
1644
+ data
1645
+ );
1646
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, oldUnpackAlignment);
1647
+ }
1648
+ var pixelContext = null;
1649
+ function createPixelContext() {
1650
+ pixelContext = createCanvasContext2D(1, 1, void 0, {
1651
+ willReadFrequently: true
1652
+ });
1653
+ }
1654
+ var TileTexture = class extends BaseTileRepresentation_default {
1655
+ /**
1656
+ * @param {import("./BaseTileRepresentation.js").TileRepresentationOptions<TileType>} options The tile texture options.
1657
+ */
1658
+ constructor(options) {
1659
+ super(options);
1660
+ this.textures = [];
1661
+ this.renderSize_ = toSize(
1662
+ options.grid.getTileSize(options.tile.tileCoord[0])
1663
+ );
1664
+ this.bandCount = NaN;
1665
+ const coords = new Buffer_default(ARRAY_BUFFER, STATIC_DRAW);
1666
+ coords.fromArray([
1667
+ 0,
1668
+ // P0
1669
+ 1,
1670
+ 1,
1671
+ // P1
1672
+ 1,
1673
+ 1,
1674
+ // P2
1675
+ 0,
1676
+ 0,
1677
+ // P3
1678
+ 0
1679
+ ]);
1680
+ this.helper.flushBufferData(coords);
1681
+ this.coords = coords;
1682
+ this.setTile(options.tile);
1683
+ }
1684
+ /**
1685
+ * @override
1686
+ * @param {import("./Helper.js").default} helper The WebGL helper.
1687
+ */
1688
+ setHelper(helper) {
1689
+ var _a;
1690
+ const gl = (_a = this.helper) == null ? void 0 : _a.getGL();
1691
+ if (gl) {
1692
+ this.helper.deleteBuffer(this.coords);
1693
+ for (let i = 0; i < this.textures.length; ++i) {
1694
+ gl.deleteTexture(this.textures[i]);
1695
+ }
1696
+ }
1697
+ super.setHelper(helper);
1698
+ if (helper) {
1699
+ helper.flushBufferData(this.coords);
1700
+ }
1701
+ }
1702
+ /**
1703
+ * @override
1704
+ */
1705
+ uploadTile() {
1706
+ const helper = this.helper;
1707
+ const gl = helper.getGL();
1708
+ const tile = this.tile;
1709
+ this.textures.length = 0;
1710
+ let data;
1711
+ if (tile instanceof ImageTile_default || tile instanceof Tile_default) {
1712
+ data = tile.getImage();
1713
+ } else {
1714
+ data = tile.getData();
1715
+ }
1716
+ const image = asImageLike(data);
1717
+ if (image) {
1718
+ const texture = gl.createTexture();
1719
+ this.textures.push(texture);
1720
+ this.bandCount = 4;
1721
+ uploadImageTexture(gl, texture, image, tile.interpolate);
1722
+ this.setReady();
1723
+ return;
1724
+ }
1725
+ data = asArrayLike(data);
1726
+ const sourceTileSize = (
1727
+ /** @type {DataTile} */
1728
+ tile.getSize()
1729
+ );
1730
+ const pixelSize = [
1731
+ sourceTileSize[0] + 2 * this.gutter,
1732
+ sourceTileSize[1] + 2 * this.gutter
1733
+ ];
1734
+ const isFloat = data instanceof Float32Array;
1735
+ const pixelCount = pixelSize[0] * pixelSize[1];
1736
+ const DataType = isFloat ? Float32Array : Uint8Array;
1737
+ const bytesPerElement = DataType.BYTES_PER_ELEMENT;
1738
+ const bytesPerRow = data.byteLength / pixelSize[1];
1739
+ this.bandCount = Math.floor(bytesPerRow / bytesPerElement / pixelSize[0]);
1740
+ const textureCount = Math.ceil(this.bandCount / 4);
1741
+ if (textureCount === 1) {
1742
+ const texture = gl.createTexture();
1743
+ this.textures.push(texture);
1744
+ uploadDataTexture(
1745
+ helper,
1746
+ texture,
1747
+ data,
1748
+ pixelSize,
1749
+ this.bandCount,
1750
+ tile.interpolate
1751
+ );
1752
+ this.setReady();
1753
+ return;
1754
+ }
1755
+ const textureDataArrays = new Array(textureCount);
1756
+ for (let textureIndex = 0; textureIndex < textureCount; ++textureIndex) {
1757
+ const texture = gl.createTexture();
1758
+ this.textures.push(texture);
1759
+ const bandCount = textureIndex < textureCount - 1 ? 4 : (this.bandCount - 1) % 4 + 1;
1760
+ textureDataArrays[textureIndex] = new DataType(pixelCount * bandCount);
1761
+ }
1762
+ let dataIndex = 0;
1763
+ let rowOffset = 0;
1764
+ const colCount = pixelSize[0] * this.bandCount;
1765
+ for (let rowIndex = 0; rowIndex < pixelSize[1]; ++rowIndex) {
1766
+ for (let colIndex = 0; colIndex < colCount; ++colIndex) {
1767
+ const dataValue = data[rowOffset + colIndex];
1768
+ const pixelIndex = Math.floor(dataIndex / this.bandCount);
1769
+ const bandIndex = colIndex % this.bandCount;
1770
+ const textureIndex = Math.floor(bandIndex / 4);
1771
+ const textureData = textureDataArrays[textureIndex];
1772
+ const bandCount = textureData.length / pixelCount;
1773
+ const textureBandIndex = bandIndex % 4;
1774
+ textureData[pixelIndex * bandCount + textureBandIndex] = dataValue;
1775
+ ++dataIndex;
1776
+ }
1777
+ rowOffset += bytesPerRow / bytesPerElement;
1778
+ }
1779
+ for (let textureIndex = 0; textureIndex < textureCount; ++textureIndex) {
1780
+ const texture = this.textures[textureIndex];
1781
+ const textureData = textureDataArrays[textureIndex];
1782
+ const bandCount = textureData.length / pixelCount;
1783
+ uploadDataTexture(
1784
+ helper,
1785
+ texture,
1786
+ textureData,
1787
+ pixelSize,
1788
+ bandCount,
1789
+ tile.interpolate
1790
+ );
1791
+ }
1792
+ this.setReady();
1793
+ }
1794
+ /**
1795
+ * @param {import("../DataTile.js").ImageLike} image The image.
1796
+ * @param {number} renderCol The column index (in rendered tile space).
1797
+ * @param {number} renderRow The row index (in rendered tile space).
1798
+ * @return {Uint8ClampedArray|null} The data.
1799
+ * @private
1800
+ */
1801
+ getImagePixelData_(image, renderCol, renderRow) {
1802
+ const gutter = this.gutter;
1803
+ const renderWidth = this.renderSize_[0];
1804
+ const renderHeight = this.renderSize_[1];
1805
+ if (!pixelContext) {
1806
+ createPixelContext();
1807
+ }
1808
+ pixelContext.clearRect(0, 0, 1, 1);
1809
+ const sourceWidth = image.width;
1810
+ const sourceHeight = image.height;
1811
+ const sourceWidthWithoutGutter = sourceWidth - 2 * gutter;
1812
+ const sourceHeightWithoutGutter = sourceHeight - 2 * gutter;
1813
+ const sourceCol = gutter + Math.floor(sourceWidthWithoutGutter * (renderCol / renderWidth));
1814
+ const sourceRow = gutter + Math.floor(sourceHeightWithoutGutter * (renderRow / renderHeight));
1815
+ let data;
1816
+ try {
1817
+ pixelContext.drawImage(image, sourceCol, sourceRow, 1, 1, 0, 0, 1, 1);
1818
+ data = pixelContext.getImageData(0, 0, 1, 1).data;
1819
+ } catch (e2) {
1820
+ pixelContext = null;
1821
+ return null;
1822
+ }
1823
+ return data;
1824
+ }
1825
+ /**
1826
+ * @param {import("../DataTile.js").ArrayLike} data The data.
1827
+ * @param {import("../size.js").Size} sourceSize The size.
1828
+ * @param {number} renderCol The column index (in rendered tile space).
1829
+ * @param {number} renderRow The row index (in rendered tile space).
1830
+ * @return {import("../DataTile.js").ArrayLike|null} The data.
1831
+ * @private
1832
+ */
1833
+ getArrayPixelData_(data, sourceSize, renderCol, renderRow) {
1834
+ const gutter = this.gutter;
1835
+ const renderWidth = this.renderSize_[0];
1836
+ const renderHeight = this.renderSize_[1];
1837
+ const sourceWidthWithoutGutter = sourceSize[0];
1838
+ const sourceHeightWithoutGutter = sourceSize[1];
1839
+ const sourceWidth = sourceWidthWithoutGutter + 2 * gutter;
1840
+ const sourceHeight = sourceHeightWithoutGutter + 2 * gutter;
1841
+ const sourceCol = gutter + Math.floor(sourceWidthWithoutGutter * (renderCol / renderWidth));
1842
+ const sourceRow = gutter + Math.floor(sourceHeightWithoutGutter * (renderRow / renderHeight));
1843
+ if (data instanceof DataView) {
1844
+ const bytesPerPixel = data.byteLength / (sourceWidth * sourceHeight);
1845
+ const offset2 = bytesPerPixel * (sourceRow * sourceWidth + sourceCol);
1846
+ const buffer = data.buffer.slice(offset2, offset2 + bytesPerPixel);
1847
+ return new DataView(buffer);
1848
+ }
1849
+ const offset = this.bandCount * (sourceRow * sourceWidth + sourceCol);
1850
+ return data.slice(offset, offset + this.bandCount);
1851
+ }
1852
+ /**
1853
+ * Get data for a pixel. If the tile is not loaded, null is returned.
1854
+ * @param {number} renderCol The column index (in rendered tile space).
1855
+ * @param {number} renderRow The row index (in rendered tile space).
1856
+ * @return {import("../DataTile.js").ArrayLike|null} The data.
1857
+ */
1858
+ getPixelData(renderCol, renderRow) {
1859
+ if (!this.loaded) {
1860
+ return null;
1861
+ }
1862
+ if (this.tile instanceof DataTile_default) {
1863
+ const data = this.tile.getData();
1864
+ const arrayData = asArrayLike(data);
1865
+ if (arrayData) {
1866
+ const sourceSize = this.tile.getSize();
1867
+ return this.getArrayPixelData_(
1868
+ arrayData,
1869
+ sourceSize,
1870
+ renderCol,
1871
+ renderRow
1872
+ );
1873
+ }
1874
+ return this.getImagePixelData_(asImageLike(data), renderCol, renderRow);
1875
+ }
1876
+ return this.getImagePixelData_(this.tile.getImage(), renderCol, renderRow);
1877
+ }
1878
+ };
1879
+ var TileTexture_default = TileTexture;
1880
+
1881
+ // node_modules/ol/renderer/webgl/TileLayerBase.js
1882
+ init_dirname();
1883
+ init_buffer();
1884
+ init_process();
1885
+
1886
+ // node_modules/ol/renderer/webgl/Layer.js
1887
+ init_dirname();
1888
+ init_buffer();
1889
+ init_process();
1890
+ var WebGLLayerRenderer = class _WebGLLayerRenderer extends Layer_default {
1891
+ /**
1892
+ * @param {LayerType} layer Layer.
1893
+ * @param {Options} [options] Options.
1894
+ */
1895
+ constructor(layer, options) {
1896
+ super(layer);
1897
+ options = options || {};
1898
+ this.inversePixelTransform_ = create();
1899
+ this.postProcesses_ = options.postProcesses;
1900
+ this.uniforms_ = options.uniforms;
1901
+ this.helper;
1902
+ this.onMapChanged_ = () => {
1903
+ this.clearCache();
1904
+ this.removeHelper();
1905
+ };
1906
+ layer.addChangeListener(Property_default.MAP, this.onMapChanged_);
1907
+ this.dispatchPreComposeEvent = this.dispatchPreComposeEvent.bind(this);
1908
+ this.dispatchPostComposeEvent = this.dispatchPostComposeEvent.bind(this);
1909
+ }
1910
+ /**
1911
+ * @param {WebGLRenderingContext} context The WebGL rendering context.
1912
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
1913
+ * @protected
1914
+ */
1915
+ dispatchPreComposeEvent(context, frameState) {
1916
+ const layer = this.getLayer();
1917
+ if (layer.hasListener(EventType_default2.PRECOMPOSE)) {
1918
+ const event = new Event_default(
1919
+ EventType_default2.PRECOMPOSE,
1920
+ void 0,
1921
+ frameState,
1922
+ context
1923
+ );
1924
+ layer.dispatchEvent(event);
1925
+ }
1926
+ }
1927
+ /**
1928
+ * @param {WebGLRenderingContext} context The WebGL rendering context.
1929
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
1930
+ * @protected
1931
+ */
1932
+ dispatchPostComposeEvent(context, frameState) {
1933
+ const layer = this.getLayer();
1934
+ if (layer.hasListener(EventType_default2.POSTCOMPOSE)) {
1935
+ const event = new Event_default(
1936
+ EventType_default2.POSTCOMPOSE,
1937
+ void 0,
1938
+ frameState,
1939
+ context
1940
+ );
1941
+ layer.dispatchEvent(event);
1942
+ }
1943
+ }
1944
+ /**
1945
+ * Reset options (only handles uniforms).
1946
+ * @param {Options} options Options.
1947
+ */
1948
+ reset(options) {
1949
+ this.uniforms_ = options.uniforms;
1950
+ if (this.helper) {
1951
+ this.helper.setUniforms(this.uniforms_);
1952
+ }
1953
+ }
1954
+ /**
1955
+ * @protected
1956
+ */
1957
+ removeHelper() {
1958
+ if (this.helper) {
1959
+ this.helper.dispose();
1960
+ delete this.helper;
1961
+ }
1962
+ }
1963
+ /**
1964
+ * Determine whether renderFrame should be called.
1965
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
1966
+ * @return {boolean} Layer is ready to be rendered.
1967
+ * @override
1968
+ */
1969
+ prepareFrame(frameState) {
1970
+ if (this.getLayer().getRenderSource()) {
1971
+ let incrementGroup = true;
1972
+ let groupNumber = -1;
1973
+ let className;
1974
+ for (let i = 0, ii = frameState.layerStatesArray.length; i < ii; i++) {
1975
+ const layer = frameState.layerStatesArray[i].layer;
1976
+ const renderer = layer.getRenderer();
1977
+ if (!(renderer instanceof _WebGLLayerRenderer)) {
1978
+ incrementGroup = true;
1979
+ continue;
1980
+ }
1981
+ const layerClassName = layer.getClassName();
1982
+ if (incrementGroup || layerClassName !== className) {
1983
+ groupNumber += 1;
1984
+ incrementGroup = false;
1985
+ }
1986
+ className = layerClassName;
1987
+ if (renderer === this) {
1988
+ break;
1989
+ }
1990
+ }
1991
+ const canvasCacheKey = "map/" + frameState.mapId + "/group/" + groupNumber;
1992
+ if (!this.helper || !this.helper.canvasCacheKeyMatches(canvasCacheKey) || this.helper.needsToBeRecreated()) {
1993
+ this.removeHelper();
1994
+ this.helper = new Helper_default({
1995
+ postProcesses: this.postProcesses_,
1996
+ uniforms: this.uniforms_,
1997
+ canvasCacheKey
1998
+ });
1999
+ if (className) {
2000
+ this.helper.getCanvas().className = className;
2001
+ }
2002
+ this.afterHelperCreated();
2003
+ }
2004
+ }
2005
+ return this.prepareFrameInternal(frameState);
2006
+ }
2007
+ /**
2008
+ * @protected
2009
+ */
2010
+ afterHelperCreated() {
2011
+ }
2012
+ /**
2013
+ * Determine whether renderFrame should be called.
2014
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2015
+ * @return {boolean} Layer is ready to be rendered.
2016
+ * @protected
2017
+ */
2018
+ prepareFrameInternal(frameState) {
2019
+ return true;
2020
+ }
2021
+ /**
2022
+ * @protected
2023
+ */
2024
+ clearCache() {
2025
+ }
2026
+ /**
2027
+ * Clean up.
2028
+ * @override
2029
+ */
2030
+ disposeInternal() {
2031
+ var _a;
2032
+ this.clearCache();
2033
+ this.removeHelper();
2034
+ (_a = this.getLayer()) == null ? void 0 : _a.removeChangeListener(
2035
+ Property_default.MAP,
2036
+ this.onMapChanged_
2037
+ );
2038
+ super.disposeInternal();
2039
+ }
2040
+ /**
2041
+ * @param {import("../../render/EventType.js").default} type Event type.
2042
+ * @param {WebGLRenderingContext} context The rendering context.
2043
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2044
+ * @private
2045
+ */
2046
+ dispatchRenderEvent_(type, context, frameState) {
2047
+ const layer = this.getLayer();
2048
+ if (layer.hasListener(type)) {
2049
+ compose(
2050
+ this.inversePixelTransform_,
2051
+ 0,
2052
+ 0,
2053
+ frameState.pixelRatio,
2054
+ -frameState.pixelRatio,
2055
+ 0,
2056
+ 0,
2057
+ -frameState.size[1]
2058
+ );
2059
+ const event = new Event_default(
2060
+ type,
2061
+ this.inversePixelTransform_,
2062
+ frameState,
2063
+ context
2064
+ );
2065
+ layer.dispatchEvent(event);
2066
+ }
2067
+ }
2068
+ /**
2069
+ * @param {WebGLRenderingContext} context The rendering context.
2070
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2071
+ * @protected
2072
+ */
2073
+ preRender(context, frameState) {
2074
+ this.dispatchRenderEvent_(EventType_default2.PRERENDER, context, frameState);
2075
+ }
2076
+ /**
2077
+ * @param {WebGLRenderingContext} context The rendering context.
2078
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2079
+ * @protected
2080
+ */
2081
+ postRender(context, frameState) {
2082
+ this.dispatchRenderEvent_(EventType_default2.POSTRENDER, context, frameState);
2083
+ }
2084
+ };
2085
+ var Layer_default2 = WebGLLayerRenderer;
2086
+
2087
+ // node_modules/ol/renderer/webgl/TileLayerBase.js
2088
+ var Uniforms = {
2089
+ TILE_TRANSFORM: "u_tileTransform",
2090
+ TRANSITION_ALPHA: "u_transitionAlpha",
2091
+ DEPTH: "u_depth",
2092
+ RENDER_EXTENT: "u_renderExtent",
2093
+ // intersection of layer, source, and view extent
2094
+ PATTERN_ORIGIN: "u_patternOrigin",
2095
+ RESOLUTION: "u_resolution",
2096
+ ZOOM: "u_zoom",
2097
+ GLOBAL_ALPHA: "u_globalAlpha",
2098
+ PROJECTION_MATRIX: "u_projectionMatrix",
2099
+ SCREEN_TO_WORLD_MATRIX: "u_screenToWorldMatrix"
2100
+ };
2101
+ function depthForZ(z) {
2102
+ return 1 / (z + 2);
2103
+ }
2104
+ function newTileRepresentationLookup() {
2105
+ return { tileIds: /* @__PURE__ */ new Set(), representationsByZ: {} };
2106
+ }
2107
+ function lookupHasTile(tileRepresentationLookup, tile) {
2108
+ return tileRepresentationLookup.tileIds.has(getUid(tile));
2109
+ }
2110
+ function addTileRepresentationToLookup(tileRepresentationLookup, tileRepresentation, z) {
2111
+ const representationsByZ = tileRepresentationLookup.representationsByZ;
2112
+ if (!(z in representationsByZ)) {
2113
+ representationsByZ[z] = /* @__PURE__ */ new Set();
2114
+ }
2115
+ representationsByZ[z].add(tileRepresentation);
2116
+ tileRepresentationLookup.tileIds.add(getUid(tileRepresentation.tile));
2117
+ }
2118
+ function getRenderExtent(frameState, extent) {
2119
+ const layerState = frameState.layerStatesArray[frameState.layerIndex];
2120
+ if (layerState.extent) {
2121
+ extent = getIntersection(
2122
+ extent,
2123
+ fromUserExtent(layerState.extent, frameState.viewState.projection)
2124
+ );
2125
+ }
2126
+ const source = (
2127
+ /** @type {import("../../source/Tile.js").default} */
2128
+ layerState.layer.getRenderSource()
2129
+ );
2130
+ if (!source.getWrapX()) {
2131
+ const gridExtent = source.getTileGridForProjection(frameState.viewState.projection).getExtent();
2132
+ if (gridExtent) {
2133
+ extent = getIntersection(extent, gridExtent);
2134
+ }
2135
+ }
2136
+ return extent;
2137
+ }
2138
+ function getCacheKey(source, tileCoord) {
2139
+ return `${getUid(source)},${source.getKey()},${getKey(tileCoord)}`;
2140
+ }
2141
+ var WebGLBaseTileLayerRenderer = class extends Layer_default2 {
2142
+ /**
2143
+ * @param {LayerType} tileLayer Tile layer.
2144
+ * @param {Options} options Options.
2145
+ */
2146
+ constructor(tileLayer, options) {
2147
+ super(tileLayer, {
2148
+ uniforms: options.uniforms,
2149
+ postProcesses: options.postProcesses
2150
+ });
2151
+ this.renderComplete = false;
2152
+ this.tileTransform_ = create();
2153
+ this.tempMat4 = create2();
2154
+ this.tempTileRange_ = new TileRange_default(0, 0, 0, 0);
2155
+ this.tempTileCoord_ = createOrUpdate(0, 0, 0);
2156
+ this.tempSize_ = [0, 0];
2157
+ const cacheSize = options.cacheSize !== void 0 ? options.cacheSize : 512;
2158
+ this.tileRepresentationCache = new LRUCache_default(cacheSize);
2159
+ this.frameState = null;
2160
+ this.renderedProjection_ = void 0;
2161
+ }
2162
+ /**
2163
+ * @param {Options} options Options.
2164
+ * @override
2165
+ */
2166
+ reset(options) {
2167
+ super.reset({
2168
+ uniforms: options.uniforms
2169
+ });
2170
+ }
2171
+ /**
2172
+ * Determine whether renderFrame should be called.
2173
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2174
+ * @return {boolean} Layer is ready to be rendered.
2175
+ * @override
2176
+ */
2177
+ prepareFrameInternal(frameState) {
2178
+ if (!this.renderedProjection_) {
2179
+ this.renderedProjection_ = frameState.viewState.projection;
2180
+ } else if (frameState.viewState.projection !== this.renderedProjection_) {
2181
+ this.clearCache();
2182
+ this.renderedProjection_ = frameState.viewState.projection;
2183
+ }
2184
+ const layer = this.getLayer();
2185
+ const source = layer.getRenderSource();
2186
+ if (!source) {
2187
+ return false;
2188
+ }
2189
+ if (isEmpty(getRenderExtent(frameState, frameState.extent))) {
2190
+ return false;
2191
+ }
2192
+ return source.getState() === "ready";
2193
+ }
2194
+ /**
2195
+ * @abstract
2196
+ * @param {import("../../webgl/BaseTileRepresentation.js").TileRepresentationOptions<TileType>} options tile representation options
2197
+ * @return {TileRepresentation} A new tile representation
2198
+ * @protected
2199
+ */
2200
+ createTileRepresentation(options) {
2201
+ return abstract();
2202
+ }
2203
+ /**
2204
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2205
+ * @param {import("../../extent.js").Extent} extent The extent to be rendered.
2206
+ * @param {number} initialZ The zoom level.
2207
+ * @param {TileRepresentationLookup} tileRepresentationLookup The zoom level.
2208
+ * @param {number} preload Number of additional levels to load.
2209
+ */
2210
+ enqueueTiles(frameState, extent, initialZ, tileRepresentationLookup, preload) {
2211
+ const viewState = frameState.viewState;
2212
+ const tileLayer = this.getLayer();
2213
+ const tileSource = tileLayer.getRenderSource();
2214
+ const tileGrid = tileSource.getTileGridForProjection(viewState.projection);
2215
+ const gutter = tileSource.getGutterForProjection(viewState.projection);
2216
+ const tileSourceKey = getUid(tileSource);
2217
+ if (!(tileSourceKey in frameState.wantedTiles)) {
2218
+ frameState.wantedTiles[tileSourceKey] = {};
2219
+ }
2220
+ const wantedTiles = frameState.wantedTiles[tileSourceKey];
2221
+ const tileRepresentationCache = this.tileRepresentationCache;
2222
+ const map = tileLayer.getMapInternal();
2223
+ const minZ = Math.max(
2224
+ initialZ - preload,
2225
+ tileGrid.getMinZoom(),
2226
+ tileGrid.getZForResolution(
2227
+ Math.min(
2228
+ tileLayer.getMaxResolution(),
2229
+ map ? map.getView().getResolutionForZoom(Math.max(tileLayer.getMinZoom(), 0)) : tileGrid.getResolution(0)
2230
+ ),
2231
+ tileSource.zDirection
2232
+ )
2233
+ );
2234
+ const rotation = viewState.rotation;
2235
+ const viewport = rotation ? getRotatedViewport(
2236
+ viewState.center,
2237
+ viewState.resolution,
2238
+ rotation,
2239
+ frameState.size
2240
+ ) : void 0;
2241
+ for (let z = initialZ; z >= minZ; --z) {
2242
+ const tileRange = tileGrid.getTileRangeForExtentAndZ(
2243
+ extent,
2244
+ z,
2245
+ this.tempTileRange_
2246
+ );
2247
+ const tileResolution = tileGrid.getResolution(z);
2248
+ for (let x = tileRange.minX; x <= tileRange.maxX; ++x) {
2249
+ for (let y = tileRange.minY; y <= tileRange.maxY; ++y) {
2250
+ if (rotation && !tileGrid.tileCoordIntersectsViewport([z, x, y], viewport)) {
2251
+ continue;
2252
+ }
2253
+ const tileCoord = createOrUpdate(z, x, y, this.tempTileCoord_);
2254
+ const cacheKey = getCacheKey(tileSource, tileCoord);
2255
+ let tileRepresentation;
2256
+ let tile;
2257
+ if (tileRepresentationCache.containsKey(cacheKey)) {
2258
+ tileRepresentation = tileRepresentationCache.get(cacheKey);
2259
+ tile = tileRepresentation.tile;
2260
+ }
2261
+ if (!tileRepresentation || tileRepresentation.tile.key !== tileSource.getKey()) {
2262
+ tile = tileSource.getTile(
2263
+ z,
2264
+ x,
2265
+ y,
2266
+ frameState.pixelRatio,
2267
+ viewState.projection
2268
+ );
2269
+ if (!tile) {
2270
+ continue;
2271
+ }
2272
+ }
2273
+ if (lookupHasTile(tileRepresentationLookup, tile)) {
2274
+ continue;
2275
+ }
2276
+ if (!tileRepresentation) {
2277
+ tileRepresentation = this.createTileRepresentation({
2278
+ tile,
2279
+ grid: tileGrid,
2280
+ helper: this.helper,
2281
+ gutter
2282
+ });
2283
+ tileRepresentationCache.set(cacheKey, tileRepresentation);
2284
+ } else {
2285
+ tileRepresentation.setTile(tile);
2286
+ }
2287
+ addTileRepresentationToLookup(
2288
+ tileRepresentationLookup,
2289
+ tileRepresentation,
2290
+ z
2291
+ );
2292
+ const tileQueueKey = tile.getKey();
2293
+ wantedTiles[tileQueueKey] = true;
2294
+ if (tile.getState() === TileState_default.IDLE) {
2295
+ if (!frameState.tileQueue.isKeyQueued(tileQueueKey)) {
2296
+ frameState.tileQueue.enqueue([
2297
+ tile,
2298
+ tileSourceKey,
2299
+ tileGrid.getTileCoordCenter(tileCoord),
2300
+ tileResolution
2301
+ ]);
2302
+ }
2303
+ }
2304
+ }
2305
+ }
2306
+ }
2307
+ }
2308
+ /**
2309
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2310
+ * @param {boolean} tilesWithAlpha True if at least one of the rendered tiles has alpha
2311
+ * @protected
2312
+ */
2313
+ beforeTilesRender(frameState, tilesWithAlpha) {
2314
+ this.helper.prepareDraw(this.frameState, !tilesWithAlpha, true);
2315
+ }
2316
+ /**
2317
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2318
+ * @return {boolean} If returns false, tile mask rendering will be skipped
2319
+ * @protected
2320
+ */
2321
+ beforeTilesMaskRender(frameState) {
2322
+ return false;
2323
+ }
2324
+ /**
2325
+ * @param {TileRepresentation} tileRepresentation Tile representation
2326
+ * @param {import("../../transform.js").Transform} tileTransform Tile transform
2327
+ * @param {import("../../Map.js").FrameState} frameState Frame state
2328
+ * @param {import("../../extent.js").Extent} renderExtent Render extent
2329
+ * @param {number} tileResolution Tile resolution
2330
+ * @param {import("../../size.js").Size} tileSize Tile size
2331
+ * @param {import("../../coordinate.js").Coordinate} tileOrigin Tile origin
2332
+ * @param {import("../../extent.js").Extent} tileExtent tile Extent
2333
+ * @param {number} depth Depth
2334
+ * @param {number} gutter Gutter
2335
+ * @param {number} alpha Alpha
2336
+ * @protected
2337
+ */
2338
+ renderTile(tileRepresentation, tileTransform, frameState, renderExtent, tileResolution, tileSize, tileOrigin, tileExtent, depth, gutter, alpha) {
2339
+ }
2340
+ /**
2341
+ * @param {TileRepresentation} tileRepresentation Tile representation
2342
+ * @param {number} tileZ Tile Z
2343
+ * @param {import("../../extent.js").Extent} extent Render extent
2344
+ * @param {number} depth Depth
2345
+ * @protected
2346
+ */
2347
+ renderTileMask(tileRepresentation, tileZ, extent, depth) {
2348
+ }
2349
+ drawTile_(frameState, tileRepresentation, tileZ, gutter, extent, alphaLookup, tileGrid) {
2350
+ if (!tileRepresentation.ready) {
2351
+ return;
2352
+ }
2353
+ const tile = tileRepresentation.tile;
2354
+ const tileCoord = tile.tileCoord;
2355
+ const tileCoordKey = getKey(tileCoord);
2356
+ const alpha = tileCoordKey in alphaLookup ? alphaLookup[tileCoordKey] : 1;
2357
+ const tileResolution = tileGrid.getResolution(tileZ);
2358
+ const tileSize = toSize(tileGrid.getTileSize(tileZ), this.tempSize_);
2359
+ const tileOrigin = tileGrid.getOrigin(tileZ);
2360
+ const tileExtent = tileGrid.getTileCoordExtent(tileCoord);
2361
+ const depth = alpha < 1 ? -1 : depthForZ(tileZ);
2362
+ if (alpha < 1) {
2363
+ frameState.animate = true;
2364
+ }
2365
+ const viewState = frameState.viewState;
2366
+ const centerX = viewState.center[0];
2367
+ const centerY = viewState.center[1];
2368
+ const tileWidthWithGutter = tileSize[0] + 2 * gutter;
2369
+ const tileHeightWithGutter = tileSize[1] + 2 * gutter;
2370
+ const aspectRatio = tileWidthWithGutter / tileHeightWithGutter;
2371
+ const centerI = (centerX - tileOrigin[0]) / (tileSize[0] * tileResolution);
2372
+ const centerJ = (tileOrigin[1] - centerY) / (tileSize[1] * tileResolution);
2373
+ const tileScale = viewState.resolution / tileResolution;
2374
+ const tileCenterI = tileCoord[1];
2375
+ const tileCenterJ = tileCoord[2];
2376
+ reset(this.tileTransform_);
2377
+ scale(
2378
+ this.tileTransform_,
2379
+ 2 / (frameState.size[0] * tileScale / tileWidthWithGutter),
2380
+ -2 / (frameState.size[1] * tileScale / tileWidthWithGutter)
2381
+ );
2382
+ rotate(this.tileTransform_, viewState.rotation);
2383
+ scale(this.tileTransform_, 1, 1 / aspectRatio);
2384
+ translate(
2385
+ this.tileTransform_,
2386
+ (tileSize[0] * (tileCenterI - centerI) - gutter) / tileWidthWithGutter,
2387
+ (tileSize[1] * (tileCenterJ - centerJ) - gutter) / tileHeightWithGutter
2388
+ );
2389
+ this.renderTile(
2390
+ /** @type {TileRepresentation} */
2391
+ tileRepresentation,
2392
+ this.tileTransform_,
2393
+ frameState,
2394
+ extent,
2395
+ tileResolution,
2396
+ tileSize,
2397
+ tileOrigin,
2398
+ tileExtent,
2399
+ depth,
2400
+ gutter,
2401
+ alpha
2402
+ );
2403
+ }
2404
+ /**
2405
+ * Render the layer.
2406
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2407
+ * @return {HTMLElement} The rendered element.
2408
+ * @override
2409
+ */
2410
+ renderFrame(frameState) {
2411
+ this.frameState = frameState;
2412
+ this.renderComplete = true;
2413
+ const gl = this.helper.getGL();
2414
+ this.preRender(gl, frameState);
2415
+ const viewState = frameState.viewState;
2416
+ const tileLayer = this.getLayer();
2417
+ const tileSource = tileLayer.getRenderSource();
2418
+ const tileGrid = tileSource.getTileGridForProjection(viewState.projection);
2419
+ const gutter = tileSource.getGutterForProjection(viewState.projection);
2420
+ const extent = getRenderExtent(frameState, frameState.extent);
2421
+ const z = tileGrid.getZForResolution(
2422
+ viewState.resolution,
2423
+ tileSource.zDirection
2424
+ );
2425
+ const tileRepresentationLookup = newTileRepresentationLookup();
2426
+ const preload = tileLayer.getPreload();
2427
+ if (frameState.nextExtent) {
2428
+ const targetZ = tileGrid.getZForResolution(
2429
+ viewState.nextResolution,
2430
+ tileSource.zDirection
2431
+ );
2432
+ const nextExtent = getRenderExtent(frameState, frameState.nextExtent);
2433
+ this.enqueueTiles(
2434
+ frameState,
2435
+ nextExtent,
2436
+ targetZ,
2437
+ tileRepresentationLookup,
2438
+ preload
2439
+ );
2440
+ }
2441
+ this.enqueueTiles(frameState, extent, z, tileRepresentationLookup, 0);
2442
+ if (preload > 0) {
2443
+ setTimeout(() => {
2444
+ this.enqueueTiles(
2445
+ frameState,
2446
+ extent,
2447
+ z - 1,
2448
+ tileRepresentationLookup,
2449
+ preload - 1
2450
+ );
2451
+ }, 0);
2452
+ }
2453
+ const alphaLookup = {};
2454
+ let blend = false;
2455
+ const representationsByZ = tileRepresentationLookup.representationsByZ;
2456
+ if (z in representationsByZ) {
2457
+ const uid = getUid(this);
2458
+ const time = frameState.time;
2459
+ for (const tileRepresentation of representationsByZ[z]) {
2460
+ const tile = tileRepresentation.tile;
2461
+ if (tile.getState() === TileState_default.EMPTY) {
2462
+ continue;
2463
+ }
2464
+ const tileCoord = tile.tileCoord;
2465
+ if (tileRepresentation.ready) {
2466
+ const alpha = tile.getAlpha(uid, time);
2467
+ if (alpha === 1) {
2468
+ tile.endTransition(uid);
2469
+ continue;
2470
+ }
2471
+ blend = true;
2472
+ const tileCoordKey = getKey(tileCoord);
2473
+ alphaLookup[tileCoordKey] = alpha;
2474
+ }
2475
+ this.renderComplete = false;
2476
+ const coveredByChildren = this.findAltTiles_(
2477
+ tileGrid,
2478
+ tileCoord,
2479
+ z + 1,
2480
+ tileRepresentationLookup
2481
+ );
2482
+ if (coveredByChildren) {
2483
+ continue;
2484
+ }
2485
+ const minZoom = tileGrid.getMinZoom();
2486
+ for (let parentZ = z - 1; parentZ >= minZoom; --parentZ) {
2487
+ const coveredByParent = this.findAltTiles_(
2488
+ tileGrid,
2489
+ tileCoord,
2490
+ parentZ,
2491
+ tileRepresentationLookup
2492
+ );
2493
+ if (coveredByParent) {
2494
+ break;
2495
+ }
2496
+ }
2497
+ }
2498
+ }
2499
+ const zs = Object.keys(representationsByZ).map(Number).sort(descending);
2500
+ const renderTileMask = this.beforeTilesMaskRender(frameState);
2501
+ if (renderTileMask) {
2502
+ for (let j = 0, jj = zs.length; j < jj; ++j) {
2503
+ const tileZ = zs[j];
2504
+ for (const tileRepresentation of representationsByZ[tileZ]) {
2505
+ const tileCoord = tileRepresentation.tile.tileCoord;
2506
+ const tileCoordKey = getKey(tileCoord);
2507
+ if (tileCoordKey in alphaLookup) {
2508
+ continue;
2509
+ }
2510
+ const tileExtent = tileGrid.getTileCoordExtent(tileCoord);
2511
+ this.renderTileMask(
2512
+ /** @type {TileRepresentation} */
2513
+ tileRepresentation,
2514
+ tileZ,
2515
+ tileExtent,
2516
+ depthForZ(tileZ)
2517
+ );
2518
+ }
2519
+ }
2520
+ }
2521
+ this.beforeTilesRender(frameState, blend);
2522
+ for (let j = 0, jj = zs.length; j < jj; ++j) {
2523
+ const tileZ = zs[j];
2524
+ for (const tileRepresentation of representationsByZ[tileZ]) {
2525
+ const tileCoord = tileRepresentation.tile.tileCoord;
2526
+ const tileCoordKey = getKey(tileCoord);
2527
+ if (tileCoordKey in alphaLookup) {
2528
+ continue;
2529
+ }
2530
+ this.drawTile_(
2531
+ frameState,
2532
+ tileRepresentation,
2533
+ tileZ,
2534
+ gutter,
2535
+ extent,
2536
+ alphaLookup,
2537
+ tileGrid
2538
+ );
2539
+ }
2540
+ }
2541
+ if (z in representationsByZ) {
2542
+ for (const tileRepresentation of representationsByZ[z]) {
2543
+ const tileCoord = tileRepresentation.tile.tileCoord;
2544
+ const tileCoordKey = getKey(tileCoord);
2545
+ if (tileCoordKey in alphaLookup) {
2546
+ this.drawTile_(
2547
+ frameState,
2548
+ tileRepresentation,
2549
+ z,
2550
+ gutter,
2551
+ extent,
2552
+ alphaLookup,
2553
+ tileGrid
2554
+ );
2555
+ }
2556
+ }
2557
+ }
2558
+ this.beforeFinalize(frameState);
2559
+ this.helper.finalizeDraw(
2560
+ frameState,
2561
+ this.dispatchPreComposeEvent,
2562
+ this.dispatchPostComposeEvent
2563
+ );
2564
+ const canvas = this.helper.getCanvas();
2565
+ const tileRepresentationCache = this.tileRepresentationCache;
2566
+ tileRepresentationCache.expireCache();
2567
+ this.postRender(gl, frameState);
2568
+ return canvas;
2569
+ }
2570
+ /**
2571
+ * @param {import("../../Map.js").FrameState} frameState Frame state.
2572
+ * @protected
2573
+ */
2574
+ beforeFinalize(frameState) {
2575
+ return;
2576
+ }
2577
+ /**
2578
+ * Look for tiles covering the provided tile coordinate at an alternate
2579
+ * zoom level. Loaded tiles will be added to the provided tile representation lookup.
2580
+ * @param {import("../../tilegrid/TileGrid.js").default} tileGrid The tile grid.
2581
+ * @param {import("../../tilecoord.js").TileCoord} tileCoord The target tile coordinate.
2582
+ * @param {number} altZ The alternate zoom level.
2583
+ * @param {TileRepresentationLookup} tileRepresentationLookup Lookup of
2584
+ * tile representations by zoom level.
2585
+ * @return {boolean} The tile coordinate is covered by loaded tiles at the alternate zoom level.
2586
+ * @private
2587
+ */
2588
+ findAltTiles_(tileGrid, tileCoord, altZ, tileRepresentationLookup) {
2589
+ const tileRange = tileGrid.getTileRangeForTileCoordAndZ(
2590
+ tileCoord,
2591
+ altZ,
2592
+ this.tempTileRange_
2593
+ );
2594
+ if (!tileRange) {
2595
+ return false;
2596
+ }
2597
+ let covered = true;
2598
+ const tileRepresentationCache = this.tileRepresentationCache;
2599
+ const source = this.getLayer().getRenderSource();
2600
+ for (let x = tileRange.minX; x <= tileRange.maxX; ++x) {
2601
+ for (let y = tileRange.minY; y <= tileRange.maxY; ++y) {
2602
+ const cacheKey = getCacheKey(source, [altZ, x, y]);
2603
+ let loaded = false;
2604
+ if (tileRepresentationCache.containsKey(cacheKey)) {
2605
+ const tileRepresentation = tileRepresentationCache.get(cacheKey);
2606
+ if (tileRepresentation.ready && !lookupHasTile(tileRepresentationLookup, tileRepresentation.tile)) {
2607
+ addTileRepresentationToLookup(
2608
+ tileRepresentationLookup,
2609
+ tileRepresentation,
2610
+ altZ
2611
+ );
2612
+ loaded = true;
2613
+ }
2614
+ }
2615
+ if (!loaded) {
2616
+ covered = false;
2617
+ }
2618
+ }
2619
+ }
2620
+ return covered;
2621
+ }
2622
+ /**
2623
+ * @override
2624
+ */
2625
+ clearCache() {
2626
+ super.clearCache();
2627
+ const tileRepresentationCache = this.tileRepresentationCache;
2628
+ tileRepresentationCache.forEach(
2629
+ (tileRepresentation) => tileRepresentation.dispose()
2630
+ );
2631
+ tileRepresentationCache.clear();
2632
+ }
2633
+ /**
2634
+ * @override
2635
+ */
2636
+ afterHelperCreated() {
2637
+ super.afterHelperCreated();
2638
+ this.tileRepresentationCache.forEach(
2639
+ (tileRepresentation) => tileRepresentation.setHelper(this.helper)
2640
+ );
2641
+ }
2642
+ /**
2643
+ * Clean up.
2644
+ * @override
2645
+ */
2646
+ disposeInternal() {
2647
+ super.disposeInternal();
2648
+ delete this.frameState;
2649
+ }
2650
+ };
2651
+ var TileLayerBase_default = WebGLBaseTileLayerRenderer;
2652
+
2653
+ // node_modules/ol/renderer/webgl/TileLayer.js
2654
+ var Uniforms2 = __spreadProps(__spreadValues({}, Uniforms), {
2655
+ TILE_TEXTURE_ARRAY: "u_tileTextures",
2656
+ TEXTURE_PIXEL_WIDTH: "u_texturePixelWidth",
2657
+ TEXTURE_PIXEL_HEIGHT: "u_texturePixelHeight",
2658
+ TEXTURE_RESOLUTION: "u_textureResolution",
2659
+ // map units per texture pixel
2660
+ TEXTURE_ORIGIN_X: "u_textureOriginX",
2661
+ // map x coordinate of left edge of texture
2662
+ TEXTURE_ORIGIN_Y: "u_textureOriginY"
2663
+ // map y coordinate of top edge of texture
2664
+ });
2665
+ var Attributes = {
2666
+ TEXTURE_COORD: "a_textureCoord"
2667
+ };
2668
+ var attributeDescriptions = [
2669
+ {
2670
+ name: Attributes.TEXTURE_COORD,
2671
+ size: 2,
2672
+ type: AttributeType.FLOAT
2673
+ }
2674
+ ];
2675
+ var WebGLTileLayerRenderer = class extends TileLayerBase_default {
2676
+ /**
2677
+ * @param {LayerType} tileLayer Tile layer.
2678
+ * @param {Options} options Options.
2679
+ */
2680
+ constructor(tileLayer, options) {
2681
+ super(tileLayer, options);
2682
+ this.program_;
2683
+ this.vertexShader_ = options.vertexShader;
2684
+ this.fragmentShader_ = options.fragmentShader;
2685
+ this.indices_ = new Buffer_default(ELEMENT_ARRAY_BUFFER, STATIC_DRAW);
2686
+ this.indices_.fromArray([0, 1, 3, 1, 2, 3]);
2687
+ this.paletteTextures_ = options.paletteTextures || [];
2688
+ }
2689
+ /**
2690
+ * @param {Options} options Options.
2691
+ * @override
2692
+ */
2693
+ reset(options) {
2694
+ super.reset(options);
2695
+ if (this.helper) {
2696
+ const gl = this.helper.getGL();
2697
+ for (const paletteTexture of this.paletteTextures_) {
2698
+ paletteTexture.delete(gl);
2699
+ }
2700
+ }
2701
+ this.vertexShader_ = options.vertexShader;
2702
+ this.fragmentShader_ = options.fragmentShader;
2703
+ this.paletteTextures_ = options.paletteTextures || [];
2704
+ if (this.helper) {
2705
+ this.program_ = this.helper.getProgram(
2706
+ this.fragmentShader_,
2707
+ this.vertexShader_
2708
+ );
2709
+ const gl = this.helper.getGL();
2710
+ for (const paletteTexture of this.paletteTextures_) {
2711
+ paletteTexture.getTexture(gl);
2712
+ }
2713
+ }
2714
+ }
2715
+ /**
2716
+ * @override
2717
+ */
2718
+ afterHelperCreated() {
2719
+ super.afterHelperCreated();
2720
+ const gl = this.helper.getGL();
2721
+ for (const paletteTexture of this.paletteTextures_) {
2722
+ paletteTexture.getTexture(gl);
2723
+ }
2724
+ this.program_ = this.helper.getProgram(
2725
+ this.fragmentShader_,
2726
+ this.vertexShader_
2727
+ );
2728
+ this.helper.flushBufferData(this.indices_);
2729
+ }
2730
+ /**
2731
+ * @override
2732
+ */
2733
+ removeHelper() {
2734
+ if (this.helper) {
2735
+ const gl = this.helper.getGL();
2736
+ for (const paletteTexture of this.paletteTextures_) {
2737
+ paletteTexture.delete(gl);
2738
+ }
2739
+ }
2740
+ super.removeHelper();
2741
+ }
2742
+ /**
2743
+ * @override
2744
+ */
2745
+ createTileRepresentation(options) {
2746
+ return new TileTexture_default(options);
2747
+ }
2748
+ /**
2749
+ * @override
2750
+ */
2751
+ beforeTilesRender(frameState, tilesWithAlpha) {
2752
+ super.beforeTilesRender(frameState, tilesWithAlpha);
2753
+ this.helper.useProgram(this.program_, frameState);
2754
+ }
2755
+ /**
2756
+ * @override
2757
+ */
2758
+ renderTile(tileTexture, tileTransform, frameState, renderExtent, tileResolution, tileSize, tileOrigin, tileExtent, depth, gutter, alpha) {
2759
+ const gl = this.helper.getGL();
2760
+ this.helper.bindBuffer(tileTexture.coords);
2761
+ this.helper.bindBuffer(this.indices_);
2762
+ this.helper.enableAttributes(attributeDescriptions);
2763
+ let textureSlot = 0;
2764
+ while (textureSlot < tileTexture.textures.length) {
2765
+ const uniformName = `${Uniforms2.TILE_TEXTURE_ARRAY}[${textureSlot}]`;
2766
+ this.helper.bindTexture(
2767
+ tileTexture.textures[textureSlot],
2768
+ textureSlot,
2769
+ uniformName
2770
+ );
2771
+ ++textureSlot;
2772
+ }
2773
+ for (let paletteIndex = 0; paletteIndex < this.paletteTextures_.length; ++paletteIndex) {
2774
+ const paletteTexture = this.paletteTextures_[paletteIndex];
2775
+ const texture = paletteTexture.getTexture(gl);
2776
+ this.helper.bindTexture(texture, textureSlot, paletteTexture.name);
2777
+ ++textureSlot;
2778
+ }
2779
+ const viewState = frameState.viewState;
2780
+ const tileWidthWithGutter = tileSize[0] + 2 * gutter;
2781
+ const tileHeightWithGutter = tileSize[1] + 2 * gutter;
2782
+ const tile = tileTexture.tile;
2783
+ const tileCoord = tile.tileCoord;
2784
+ const tileCenterI = tileCoord[1];
2785
+ const tileCenterJ = tileCoord[2];
2786
+ this.helper.setUniformMatrixValue(
2787
+ Uniforms2.TILE_TRANSFORM,
2788
+ fromTransform(this.tempMat4, tileTransform)
2789
+ );
2790
+ this.helper.setUniformFloatValue(Uniforms2.TRANSITION_ALPHA, alpha);
2791
+ this.helper.setUniformFloatValue(Uniforms2.DEPTH, depth);
2792
+ let gutterExtent = renderExtent;
2793
+ if (gutter > 0) {
2794
+ gutterExtent = tileExtent;
2795
+ getIntersection(gutterExtent, renderExtent, gutterExtent);
2796
+ }
2797
+ this.helper.setUniformFloatVec4(Uniforms2.RENDER_EXTENT, gutterExtent);
2798
+ this.helper.setUniformFloatValue(Uniforms2.RESOLUTION, viewState.resolution);
2799
+ this.helper.setUniformFloatValue(Uniforms2.ZOOM, viewState.zoom);
2800
+ this.helper.setUniformFloatValue(
2801
+ Uniforms2.TEXTURE_PIXEL_WIDTH,
2802
+ tileWidthWithGutter
2803
+ );
2804
+ this.helper.setUniformFloatValue(
2805
+ Uniforms2.TEXTURE_PIXEL_HEIGHT,
2806
+ tileHeightWithGutter
2807
+ );
2808
+ this.helper.setUniformFloatValue(
2809
+ Uniforms2.TEXTURE_RESOLUTION,
2810
+ tileResolution
2811
+ );
2812
+ this.helper.setUniformFloatValue(
2813
+ Uniforms2.TEXTURE_ORIGIN_X,
2814
+ tileOrigin[0] + tileCenterI * tileSize[0] * tileResolution - gutter * tileResolution
2815
+ );
2816
+ this.helper.setUniformFloatValue(
2817
+ Uniforms2.TEXTURE_ORIGIN_Y,
2818
+ tileOrigin[1] - tileCenterJ * tileSize[1] * tileResolution + gutter * tileResolution
2819
+ );
2820
+ this.helper.drawElements(0, this.indices_.getSize());
2821
+ }
2822
+ /**
2823
+ * @param {import("../../pixel.js").Pixel} pixel Pixel.
2824
+ * @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView} Data at the pixel location.
2825
+ * @override
2826
+ */
2827
+ getData(pixel) {
2828
+ const gl = this.helper.getGL();
2829
+ if (!gl) {
2830
+ return null;
2831
+ }
2832
+ const frameState = this.frameState;
2833
+ if (!frameState) {
2834
+ return null;
2835
+ }
2836
+ const layer = this.getLayer();
2837
+ const coordinate = apply(
2838
+ frameState.pixelToCoordinateTransform,
2839
+ pixel.slice()
2840
+ );
2841
+ const viewState = frameState.viewState;
2842
+ const layerExtent = layer.getExtent();
2843
+ if (layerExtent) {
2844
+ if (!containsCoordinate(
2845
+ fromUserExtent(layerExtent, viewState.projection),
2846
+ coordinate
2847
+ )) {
2848
+ return null;
2849
+ }
2850
+ }
2851
+ const sources = layer.getSources(
2852
+ boundingExtent([coordinate]),
2853
+ viewState.resolution
2854
+ );
2855
+ let i, source, tileGrid;
2856
+ for (i = sources.length - 1; i >= 0; --i) {
2857
+ source = sources[i];
2858
+ if (source.getState() === "ready") {
2859
+ tileGrid = source.getTileGridForProjection(viewState.projection);
2860
+ if (source.getWrapX()) {
2861
+ break;
2862
+ }
2863
+ const gridExtent = tileGrid.getExtent();
2864
+ if (!gridExtent || containsCoordinate(gridExtent, coordinate)) {
2865
+ break;
2866
+ }
2867
+ }
2868
+ }
2869
+ if (i < 0) {
2870
+ return null;
2871
+ }
2872
+ const tileTextureCache = this.tileRepresentationCache;
2873
+ for (let z = tileGrid.getZForResolution(viewState.resolution); z >= tileGrid.getMinZoom(); --z) {
2874
+ const tileCoord = tileGrid.getTileCoordForCoordAndZ(coordinate, z);
2875
+ const cacheKey = getCacheKey(source, tileCoord);
2876
+ if (!tileTextureCache.containsKey(cacheKey)) {
2877
+ continue;
2878
+ }
2879
+ const tileTexture = tileTextureCache.get(cacheKey);
2880
+ const tile = tileTexture.tile;
2881
+ if (tile.getState() === TileState_default.EMPTY) {
2882
+ return null;
2883
+ }
2884
+ if (!tileTexture.loaded) {
2885
+ continue;
2886
+ }
2887
+ const tileOrigin = tileGrid.getOrigin(z);
2888
+ const tileSize = toSize(tileGrid.getTileSize(z));
2889
+ const tileResolution = tileGrid.getResolution(z);
2890
+ const col = (coordinate[0] - tileOrigin[0]) / tileResolution - tileCoord[1] * tileSize[0];
2891
+ const row = (tileOrigin[1] - coordinate[1]) / tileResolution - tileCoord[2] * tileSize[1];
2892
+ return tileTexture.getPixelData(col, row);
2893
+ }
2894
+ return null;
2895
+ }
2896
+ /**
2897
+ * Clean up.
2898
+ * @override
2899
+ */
2900
+ disposeInternal() {
2901
+ const helper = this.helper;
2902
+ if (helper) {
2903
+ const gl = helper.getGL();
2904
+ for (const paletteTexture of this.paletteTextures_) {
2905
+ paletteTexture.delete(gl);
2906
+ }
2907
+ this.paletteTextures_.length = 0;
2908
+ gl.deleteProgram(this.program_);
2909
+ delete this.program_;
2910
+ helper.deleteBuffer(this.indices_);
2911
+ }
2912
+ super.disposeInternal();
2913
+ delete this.indices_;
2914
+ }
2915
+ };
2916
+ var TileLayer_default = WebGLTileLayerRenderer;
2917
+
2918
+ // node_modules/ol/webgl/PaletteTexture.js
2919
+ init_dirname();
2920
+ init_buffer();
2921
+ init_process();
2922
+ var PaletteTexture = class {
2923
+ /**
2924
+ * @param {string} name The name of the texture.
2925
+ * @param {Uint8Array} data The texture data.
2926
+ */
2927
+ constructor(name, data) {
2928
+ this.name = name;
2929
+ this.data = data;
2930
+ this.texture_ = null;
2931
+ }
2932
+ /**
2933
+ * @param {WebGLRenderingContext} gl Rendering context.
2934
+ * @return {WebGLTexture} The texture.
2935
+ */
2936
+ getTexture(gl) {
2937
+ if (!this.texture_) {
2938
+ const texture = gl.createTexture();
2939
+ gl.bindTexture(gl.TEXTURE_2D, texture);
2940
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
2941
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
2942
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
2943
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
2944
+ gl.texImage2D(
2945
+ gl.TEXTURE_2D,
2946
+ 0,
2947
+ gl.RGBA,
2948
+ this.data.length / 4,
2949
+ 1,
2950
+ 0,
2951
+ gl.RGBA,
2952
+ gl.UNSIGNED_BYTE,
2953
+ this.data
2954
+ );
2955
+ this.texture_ = texture;
2956
+ }
2957
+ return this.texture_;
2958
+ }
2959
+ /**
2960
+ * @param {WebGLRenderingContext} gl Rendering context.
2961
+ */
2962
+ delete(gl) {
2963
+ if (this.texture_) {
2964
+ gl.deleteTexture(this.texture_);
2965
+ }
2966
+ this.texture_ = null;
2967
+ }
2968
+ };
2969
+ var PaletteTexture_default = PaletteTexture;
2970
+
2971
+ // node_modules/ol/expr/gpu.js
2972
+ function computeOperatorFunctionName(operator, context) {
2973
+ return `operator_${operator}_${Object.keys(context.functions).length}`;
2974
+ }
2975
+ function numberToGlsl(v) {
2976
+ const s2 = v.toString();
2977
+ return s2.includes(".") ? s2 : s2 + ".0";
2978
+ }
2979
+ function arrayToGlsl(array) {
2980
+ if (array.length < 2 || array.length > 4) {
2981
+ throw new Error(
2982
+ "`formatArray` can only output `vec2`, `vec3` or `vec4` arrays."
2983
+ );
2984
+ }
2985
+ return `vec${array.length}(${array.map(numberToGlsl).join(", ")})`;
2986
+ }
2987
+ function colorToGlsl(color) {
2988
+ const array = asArray(color);
2989
+ const alpha = array.length > 3 ? array[3] : 1;
2990
+ return arrayToGlsl([array[0] / 255, array[1] / 255, array[2] / 255, alpha]);
2991
+ }
2992
+ function sizeToGlsl(size) {
2993
+ const array = toSize(size);
2994
+ return arrayToGlsl(array);
2995
+ }
2996
+ var stringToFloatMap = {};
2997
+ var stringToFloatCounter = 0;
2998
+ function getStringNumberEquivalent(string) {
2999
+ if (!(string in stringToFloatMap)) {
3000
+ stringToFloatMap[string] = stringToFloatCounter++;
3001
+ }
3002
+ return stringToFloatMap[string];
3003
+ }
3004
+ function stringToGlsl(string) {
3005
+ return numberToGlsl(getStringNumberEquivalent(string));
3006
+ }
3007
+ function uniformNameForVariable(variableName) {
3008
+ return "u_var_" + variableName;
3009
+ }
3010
+ function newCompilationContext() {
3011
+ return {
3012
+ variables: {},
3013
+ properties: {},
3014
+ functions: {},
3015
+ bandCount: 0,
3016
+ featureId: false,
3017
+ geometryType: false
3018
+ };
3019
+ }
3020
+ var GET_BAND_VALUE_FUNC = "getBandValue";
3021
+ var PALETTE_TEXTURE_ARRAY = "u_paletteTextures";
3022
+ var FEATURE_ID_PROPERTY_NAME = "featureId";
3023
+ var GEOMETRY_TYPE_PROPERTY_NAME = "geometryType";
3024
+ var UNDEFINED_PROP_VALUE = -9999999;
3025
+ function buildExpression(encoded, type, parsingContext, compilationContext) {
3026
+ const expression = parse(encoded, type, parsingContext);
3027
+ return compile(expression, type, compilationContext);
3028
+ }
3029
+ function createCompiler(output) {
3030
+ return (context, expression, type) => {
3031
+ const length = expression.args.length;
3032
+ const args = new Array(length);
3033
+ for (let i = 0; i < length; ++i) {
3034
+ args[i] = compile(expression.args[i], type, context);
3035
+ }
3036
+ return output(args, context);
3037
+ };
3038
+ }
3039
+ var compilers = {
3040
+ [Ops.Get]: (context, expression) => {
3041
+ const firstArg = (
3042
+ /** @type {LiteralExpression} */
3043
+ expression.args[0]
3044
+ );
3045
+ const propName = (
3046
+ /** @type {string} */
3047
+ firstArg.value
3048
+ );
3049
+ const isExisting = propName in context.properties;
3050
+ if (!isExisting) {
3051
+ context.properties[propName] = {
3052
+ name: propName,
3053
+ type: expression.type
3054
+ };
3055
+ }
3056
+ let result = "a_prop_" + propName;
3057
+ if (isType(expression.type, BooleanType)) {
3058
+ result = `(${result} > 0.0)`;
3059
+ }
3060
+ return result;
3061
+ },
3062
+ [Ops.Id]: (context) => {
3063
+ context.featureId = true;
3064
+ return "a_" + FEATURE_ID_PROPERTY_NAME;
3065
+ },
3066
+ [Ops.GeometryType]: (context) => {
3067
+ context.geometryType = true;
3068
+ return "a_" + GEOMETRY_TYPE_PROPERTY_NAME;
3069
+ },
3070
+ [Ops.LineMetric]: () => "currentLineMetric",
3071
+ // this variable is assumed to always be present in shaders, default is 0.
3072
+ [Ops.Var]: (context, expression) => {
3073
+ const firstArg = (
3074
+ /** @type {LiteralExpression} */
3075
+ expression.args[0]
3076
+ );
3077
+ const varName = (
3078
+ /** @type {string} */
3079
+ firstArg.value
3080
+ );
3081
+ const isExisting = varName in context.variables;
3082
+ if (!isExisting) {
3083
+ context.variables[varName] = {
3084
+ name: varName,
3085
+ type: expression.type
3086
+ };
3087
+ }
3088
+ let result = uniformNameForVariable(varName);
3089
+ if (isType(expression.type, BooleanType)) {
3090
+ result = `(${result} > 0.0)`;
3091
+ }
3092
+ return result;
3093
+ },
3094
+ [Ops.Has]: (context, expression) => {
3095
+ const firstArg = (
3096
+ /** @type {LiteralExpression} */
3097
+ expression.args[0]
3098
+ );
3099
+ const propName = (
3100
+ /** @type {string} */
3101
+ firstArg.value
3102
+ );
3103
+ const isExisting = propName in context.properties;
3104
+ if (!isExisting) {
3105
+ context.properties[propName] = {
3106
+ name: propName,
3107
+ type: expression.type
3108
+ };
3109
+ }
3110
+ return `(a_prop_${propName} != ${numberToGlsl(UNDEFINED_PROP_VALUE)})`;
3111
+ },
3112
+ [Ops.Resolution]: () => "u_resolution",
3113
+ [Ops.Zoom]: () => "u_zoom",
3114
+ [Ops.Time]: () => "u_time",
3115
+ [Ops.Any]: createCompiler((compiledArgs) => `(${compiledArgs.join(` || `)})`),
3116
+ [Ops.All]: createCompiler((compiledArgs) => `(${compiledArgs.join(` && `)})`),
3117
+ [Ops.Not]: createCompiler(([value]) => `(!${value})`),
3118
+ [Ops.Equal]: createCompiler(
3119
+ ([firstValue, secondValue]) => `(${firstValue} == ${secondValue})`
3120
+ ),
3121
+ [Ops.NotEqual]: createCompiler(
3122
+ ([firstValue, secondValue]) => `(${firstValue} != ${secondValue})`
3123
+ ),
3124
+ [Ops.GreaterThan]: createCompiler(
3125
+ ([firstValue, secondValue]) => `(${firstValue} > ${secondValue})`
3126
+ ),
3127
+ [Ops.GreaterThanOrEqualTo]: createCompiler(
3128
+ ([firstValue, secondValue]) => `(${firstValue} >= ${secondValue})`
3129
+ ),
3130
+ [Ops.LessThan]: createCompiler(
3131
+ ([firstValue, secondValue]) => `(${firstValue} < ${secondValue})`
3132
+ ),
3133
+ [Ops.LessThanOrEqualTo]: createCompiler(
3134
+ ([firstValue, secondValue]) => `(${firstValue} <= ${secondValue})`
3135
+ ),
3136
+ [Ops.Multiply]: createCompiler(
3137
+ (compiledArgs) => `(${compiledArgs.join(" * ")})`
3138
+ ),
3139
+ [Ops.Divide]: createCompiler(
3140
+ ([firstValue, secondValue]) => `(${firstValue} / ${secondValue})`
3141
+ ),
3142
+ [Ops.Add]: createCompiler((compiledArgs) => `(${compiledArgs.join(" + ")})`),
3143
+ [Ops.Subtract]: createCompiler(
3144
+ ([firstValue, secondValue]) => `(${firstValue} - ${secondValue})`
3145
+ ),
3146
+ [Ops.Clamp]: createCompiler(
3147
+ ([value, min, max]) => `clamp(${value}, ${min}, ${max})`
3148
+ ),
3149
+ [Ops.Mod]: createCompiler(([value, modulo]) => `mod(${value}, ${modulo})`),
3150
+ [Ops.Pow]: createCompiler(([value, power]) => `pow(${value}, ${power})`),
3151
+ [Ops.Abs]: createCompiler(([value]) => `abs(${value})`),
3152
+ [Ops.Floor]: createCompiler(([value]) => `floor(${value})`),
3153
+ [Ops.Ceil]: createCompiler(([value]) => `ceil(${value})`),
3154
+ [Ops.Round]: createCompiler(([value]) => `floor(${value} + 0.5)`),
3155
+ [Ops.Sin]: createCompiler(([value]) => `sin(${value})`),
3156
+ [Ops.Cos]: createCompiler(([value]) => `cos(${value})`),
3157
+ [Ops.Atan]: createCompiler(([firstValue, secondValue]) => {
3158
+ return secondValue !== void 0 ? `atan(${firstValue}, ${secondValue})` : `atan(${firstValue})`;
3159
+ }),
3160
+ [Ops.Sqrt]: createCompiler(([value]) => `sqrt(${value})`),
3161
+ [Ops.Match]: createCompiler((compiledArgs) => {
3162
+ const input = compiledArgs[0];
3163
+ const fallback = compiledArgs[compiledArgs.length - 1];
3164
+ let result = null;
3165
+ for (let i = compiledArgs.length - 3; i >= 1; i -= 2) {
3166
+ const match = compiledArgs[i];
3167
+ const output = compiledArgs[i + 1];
3168
+ result = `(${input} == ${match} ? ${output} : ${result || fallback})`;
3169
+ }
3170
+ return result;
3171
+ }),
3172
+ [Ops.Between]: createCompiler(
3173
+ ([value, min, max]) => `(${value} >= ${min} && ${value} <= ${max})`
3174
+ ),
3175
+ [Ops.Interpolate]: createCompiler(([exponent, input, ...compiledArgs]) => {
3176
+ let result = "";
3177
+ for (let i = 0; i < compiledArgs.length - 2; i += 2) {
3178
+ const stop1 = compiledArgs[i];
3179
+ const output1 = result || compiledArgs[i + 1];
3180
+ const stop2 = compiledArgs[i + 2];
3181
+ const output2 = compiledArgs[i + 3];
3182
+ let ratio;
3183
+ if (exponent === numberToGlsl(1)) {
3184
+ ratio = `(${input} - ${stop1}) / (${stop2} - ${stop1})`;
3185
+ } else {
3186
+ ratio = `(pow(${exponent}, (${input} - ${stop1})) - 1.0) / (pow(${exponent}, (${stop2} - ${stop1})) - 1.0)`;
3187
+ }
3188
+ result = `mix(${output1}, ${output2}, clamp(${ratio}, 0.0, 1.0))`;
3189
+ }
3190
+ return result;
3191
+ }),
3192
+ [Ops.Case]: createCompiler((compiledArgs) => {
3193
+ const fallback = compiledArgs[compiledArgs.length - 1];
3194
+ let result = null;
3195
+ for (let i = compiledArgs.length - 3; i >= 0; i -= 2) {
3196
+ const condition = compiledArgs[i];
3197
+ const output = compiledArgs[i + 1];
3198
+ result = `(${condition} ? ${output} : ${result || fallback})`;
3199
+ }
3200
+ return result;
3201
+ }),
3202
+ [Ops.In]: createCompiler(([needle, ...haystack], context) => {
3203
+ const funcName = computeOperatorFunctionName("in", context);
3204
+ const tests = [];
3205
+ for (let i = 0; i < haystack.length; i += 1) {
3206
+ tests.push(` if (inputValue == ${haystack[i]}) { return true; }`);
3207
+ }
3208
+ context.functions[funcName] = `bool ${funcName}(float inputValue) {
3209
+ ${tests.join("\n")}
3210
+ return false;
3211
+ }`;
3212
+ return `${funcName}(${needle})`;
3213
+ }),
3214
+ [Ops.Array]: createCompiler(
3215
+ (args) => `vec${args.length}(${args.join(", ")})`
3216
+ ),
3217
+ [Ops.Color]: createCompiler((compiledArgs) => {
3218
+ if (compiledArgs.length === 1) {
3219
+ return `vec4(vec3(${compiledArgs[0]} / 255.0), 1.0)`;
3220
+ }
3221
+ if (compiledArgs.length === 2) {
3222
+ return `vec4(vec3(${compiledArgs[0]} / 255.0), ${compiledArgs[1]})`;
3223
+ }
3224
+ const rgb = compiledArgs.slice(0, 3).map((color) => `${color} / 255.0`);
3225
+ if (compiledArgs.length === 3) {
3226
+ return `vec4(${rgb.join(", ")}, 1.0)`;
3227
+ }
3228
+ const alpha = compiledArgs[3];
3229
+ return `vec4(${rgb.join(", ")}, ${alpha})`;
3230
+ }),
3231
+ [Ops.Band]: createCompiler(([band, xOffset, yOffset], context) => {
3232
+ if (!(GET_BAND_VALUE_FUNC in context.functions)) {
3233
+ let ifBlocks = "";
3234
+ const bandCount = context.bandCount || 1;
3235
+ for (let i = 0; i < bandCount; i++) {
3236
+ const colorIndex = Math.floor(i / 4);
3237
+ let bandIndex = i % 4;
3238
+ if (i === bandCount - 1 && bandIndex === 1) {
3239
+ bandIndex = 3;
3240
+ }
3241
+ const textureName = `${Uniforms2.TILE_TEXTURE_ARRAY}[${colorIndex}]`;
3242
+ ifBlocks += ` if (band == ${i + 1}.0) {
3243
+ return texture2D(${textureName}, v_textureCoord + vec2(dx, dy))[${bandIndex}];
3244
+ }
3245
+ `;
3246
+ }
3247
+ context.functions[GET_BAND_VALUE_FUNC] = `float getBandValue(float band, float xOffset, float yOffset) {
3248
+ float dx = xOffset / ${Uniforms2.TEXTURE_PIXEL_WIDTH};
3249
+ float dy = yOffset / ${Uniforms2.TEXTURE_PIXEL_HEIGHT};
3250
+ ${ifBlocks}
3251
+ }`;
3252
+ }
3253
+ return `${GET_BAND_VALUE_FUNC}(${band}, ${xOffset != null ? xOffset : "0.0"}, ${yOffset != null ? yOffset : "0.0"})`;
3254
+ }),
3255
+ [Ops.Palette]: (context, expression) => {
3256
+ const [index, ...colors] = expression.args;
3257
+ const numColors = colors.length;
3258
+ const palette = new Uint8Array(numColors * 4);
3259
+ for (let i = 0; i < colors.length; i++) {
3260
+ const parsedValue = (
3261
+ /** @type {string | Array<number>} */
3262
+ /** @type {LiteralExpression} */
3263
+ colors[i].value
3264
+ );
3265
+ const color = asArray(parsedValue);
3266
+ const offset = i * 4;
3267
+ palette[offset] = color[0];
3268
+ palette[offset + 1] = color[1];
3269
+ palette[offset + 2] = color[2];
3270
+ palette[offset + 3] = color[3] * 255;
3271
+ }
3272
+ if (!context.paletteTextures) {
3273
+ context.paletteTextures = [];
3274
+ }
3275
+ const paletteName = `${PALETTE_TEXTURE_ARRAY}[${context.paletteTextures.length}]`;
3276
+ const paletteTexture = new PaletteTexture_default(paletteName, palette);
3277
+ context.paletteTextures.push(paletteTexture);
3278
+ const compiledIndex = compile(index, NumberType, context);
3279
+ return `texture2D(${paletteName}, vec2((${compiledIndex} + 0.5) / ${numColors}.0, 0.5))`;
3280
+ }
3281
+ // TODO: unimplemented
3282
+ // Ops.Number
3283
+ // Ops.String
3284
+ // Ops.Coalesce
3285
+ // Ops.Concat
3286
+ // Ops.ToString
3287
+ };
3288
+ function compile(expression, returnType, context) {
3289
+ if (expression instanceof CallExpression) {
3290
+ const compiler = compilers[expression.operator];
3291
+ if (compiler === void 0) {
3292
+ throw new Error(
3293
+ `No compiler defined for this operator: ${JSON.stringify(
3294
+ expression.operator
3295
+ )}`
3296
+ );
3297
+ }
3298
+ return compiler(context, expression, returnType);
3299
+ }
3300
+ if ((expression.type & NumberType) > 0) {
3301
+ return numberToGlsl(
3302
+ /** @type {number} */
3303
+ expression.value
3304
+ );
3305
+ }
3306
+ if ((expression.type & BooleanType) > 0) {
3307
+ return expression.value.toString();
3308
+ }
3309
+ if ((expression.type & StringType) > 0) {
3310
+ return stringToGlsl(expression.value.toString());
3311
+ }
3312
+ if ((expression.type & ColorType) > 0) {
3313
+ return colorToGlsl(
3314
+ /** @type {Array<number> | string} */
3315
+ expression.value
3316
+ );
3317
+ }
3318
+ if ((expression.type & NumberArrayType) > 0) {
3319
+ return arrayToGlsl(
3320
+ /** @type {Array<number>} */
3321
+ expression.value
3322
+ );
3323
+ }
3324
+ if ((expression.type & SizeType) > 0) {
3325
+ return sizeToGlsl(
3326
+ /** @type {number|import('../size.js').Size} */
3327
+ expression.value
3328
+ );
3329
+ }
3330
+ throw new Error(
3331
+ `Unexpected expression ${expression.value} (expected type ${typeName(
3332
+ returnType
3333
+ )})`
3334
+ );
3335
+ }
3336
+
3337
+ // node_modules/ol/render/webgl/compileUtil.js
3338
+ init_dirname();
3339
+ init_buffer();
3340
+ init_process();
3341
+ function expressionToGlsl(compilationContext, value, expectedType) {
3342
+ const parsingContext = newParsingContext();
3343
+ return buildExpression(
3344
+ value,
3345
+ expectedType,
3346
+ parsingContext,
3347
+ compilationContext
3348
+ );
3349
+ }
3350
+
3351
+ // node_modules/ol/layer/WebGLTile.js
3352
+ function parseStyle(style, bandCount) {
3353
+ const vertexShader = `
3354
+ attribute vec2 ${Attributes.TEXTURE_COORD};
3355
+ uniform mat4 ${Uniforms2.TILE_TRANSFORM};
3356
+ uniform float ${Uniforms2.TEXTURE_PIXEL_WIDTH};
3357
+ uniform float ${Uniforms2.TEXTURE_PIXEL_HEIGHT};
3358
+ uniform float ${Uniforms2.TEXTURE_RESOLUTION};
3359
+ uniform float ${Uniforms2.TEXTURE_ORIGIN_X};
3360
+ uniform float ${Uniforms2.TEXTURE_ORIGIN_Y};
3361
+ uniform float ${Uniforms2.DEPTH};
3362
+
3363
+ varying vec2 v_textureCoord;
3364
+ varying vec2 v_mapCoord;
3365
+
3366
+ void main() {
3367
+ v_textureCoord = ${Attributes.TEXTURE_COORD};
3368
+ v_mapCoord = vec2(
3369
+ ${Uniforms2.TEXTURE_ORIGIN_X} + ${Uniforms2.TEXTURE_RESOLUTION} * ${Uniforms2.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0],
3370
+ ${Uniforms2.TEXTURE_ORIGIN_Y} - ${Uniforms2.TEXTURE_RESOLUTION} * ${Uniforms2.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1]
3371
+ );
3372
+ gl_Position = ${Uniforms2.TILE_TRANSFORM} * vec4(${Attributes.TEXTURE_COORD}, ${Uniforms2.DEPTH}, 1.0);
3373
+ }
3374
+ `;
3375
+ const context = __spreadProps(__spreadValues({}, newCompilationContext()), {
3376
+ bandCount
3377
+ });
3378
+ const pipeline = [];
3379
+ if (style.color !== void 0) {
3380
+ const color = expressionToGlsl(context, style.color, ColorType);
3381
+ pipeline.push(`color = ${color};`);
3382
+ }
3383
+ if (style.contrast !== void 0) {
3384
+ const contrast = expressionToGlsl(context, style.contrast, NumberType);
3385
+ pipeline.push(
3386
+ `color.rgb = clamp((${contrast} + 1.0) * color.rgb - (${contrast} / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`
3387
+ );
3388
+ }
3389
+ if (style.exposure !== void 0) {
3390
+ const exposure = expressionToGlsl(context, style.exposure, NumberType);
3391
+ pipeline.push(
3392
+ `color.rgb = clamp((${exposure} + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`
3393
+ );
3394
+ }
3395
+ if (style.saturation !== void 0) {
3396
+ const saturation = expressionToGlsl(context, style.saturation, NumberType);
3397
+ pipeline.push(`
3398
+ float saturation = ${saturation} + 1.0;
3399
+ float sr = (1.0 - saturation) * 0.2126;
3400
+ float sg = (1.0 - saturation) * 0.7152;
3401
+ float sb = (1.0 - saturation) * 0.0722;
3402
+ mat3 saturationMatrix = mat3(
3403
+ sr + saturation, sr, sr,
3404
+ sg, sg + saturation, sg,
3405
+ sb, sb, sb + saturation
3406
+ );
3407
+ color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));
3408
+ `);
3409
+ }
3410
+ if (style.gamma !== void 0) {
3411
+ const gamma = expressionToGlsl(context, style.gamma, NumberType);
3412
+ pipeline.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${gamma}));`);
3413
+ }
3414
+ if (style.brightness !== void 0) {
3415
+ const brightness = expressionToGlsl(context, style.brightness, NumberType);
3416
+ pipeline.push(
3417
+ `color.rgb = clamp(color.rgb + ${brightness}, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`
3418
+ );
3419
+ }
3420
+ const uniforms = {};
3421
+ const numVariables = Object.keys(context.variables).length;
3422
+ if (numVariables > 1 && !style.variables) {
3423
+ throw new Error(
3424
+ `Missing variables in style (expected ${context.variables})`
3425
+ );
3426
+ }
3427
+ for (let i = 0; i < numVariables; ++i) {
3428
+ const variable = context.variables[Object.keys(context.variables)[i]];
3429
+ if (!(variable.name in style.variables)) {
3430
+ throw new Error(`Missing '${variable.name}' in style variables`);
3431
+ }
3432
+ const uniformName = uniformNameForVariable(variable.name);
3433
+ uniforms[uniformName] = function() {
3434
+ let value = style.variables[variable.name];
3435
+ if (typeof value === "string") {
3436
+ value = getStringNumberEquivalent(value);
3437
+ }
3438
+ return value !== void 0 ? value : -9999999;
3439
+ };
3440
+ }
3441
+ const uniformDeclarations = Object.keys(uniforms).map(function(name) {
3442
+ return `uniform float ${name};`;
3443
+ });
3444
+ const textureCount = Math.ceil(bandCount / 4);
3445
+ uniformDeclarations.push(
3446
+ `uniform sampler2D ${Uniforms2.TILE_TEXTURE_ARRAY}[${textureCount}];`
3447
+ );
3448
+ if (context.paletteTextures) {
3449
+ uniformDeclarations.push(
3450
+ `uniform sampler2D ${PALETTE_TEXTURE_ARRAY}[${context.paletteTextures.length}];`
3451
+ );
3452
+ }
3453
+ const functionDefintions = Object.keys(context.functions).map(
3454
+ function(name) {
3455
+ return context.functions[name];
3456
+ }
3457
+ );
3458
+ const fragmentShader = `
3459
+ #ifdef GL_FRAGMENT_PRECISION_HIGH
3460
+ precision highp float;
3461
+ #else
3462
+ precision mediump float;
3463
+ #endif
3464
+
3465
+ varying vec2 v_textureCoord;
3466
+ varying vec2 v_mapCoord;
3467
+ uniform vec4 ${Uniforms2.RENDER_EXTENT};
3468
+ uniform float ${Uniforms2.TRANSITION_ALPHA};
3469
+ uniform float ${Uniforms2.TEXTURE_PIXEL_WIDTH};
3470
+ uniform float ${Uniforms2.TEXTURE_PIXEL_HEIGHT};
3471
+ uniform float ${Uniforms2.RESOLUTION};
3472
+ uniform float ${Uniforms2.ZOOM};
3473
+
3474
+ ${uniformDeclarations.join("\n")}
3475
+
3476
+ ${functionDefintions.join("\n")}
3477
+
3478
+ void main() {
3479
+ if (
3480
+ v_mapCoord[0] < ${Uniforms2.RENDER_EXTENT}[0] ||
3481
+ v_mapCoord[1] < ${Uniforms2.RENDER_EXTENT}[1] ||
3482
+ v_mapCoord[0] > ${Uniforms2.RENDER_EXTENT}[2] ||
3483
+ v_mapCoord[1] > ${Uniforms2.RENDER_EXTENT}[3]
3484
+ ) {
3485
+ discard;
3486
+ }
3487
+
3488
+ vec4 color = texture2D(${Uniforms2.TILE_TEXTURE_ARRAY}[0], v_textureCoord);
3489
+
3490
+ ${pipeline.join("\n")}
3491
+
3492
+ gl_FragColor = color;
3493
+ gl_FragColor.rgb *= gl_FragColor.a;
3494
+ gl_FragColor *= ${Uniforms2.TRANSITION_ALPHA};
3495
+ }`;
3496
+ return {
3497
+ vertexShader,
3498
+ fragmentShader,
3499
+ uniforms,
3500
+ paletteTextures: context.paletteTextures
3501
+ };
3502
+ }
3503
+ var WebGLTileLayer = class extends BaseTile_default {
3504
+ /**
3505
+ * @param {Options} [options] Tile layer options.
3506
+ */
3507
+ constructor(options) {
3508
+ options = options ? Object.assign({}, options) : {};
3509
+ const style = options.style || {};
3510
+ delete options.style;
3511
+ super(options);
3512
+ this.sources_ = options.sources;
3513
+ this.renderedSource_ = null;
3514
+ this.renderedResolution_ = NaN;
3515
+ this.style_ = style;
3516
+ this.styleVariables_ = this.style_.variables || {};
3517
+ this.handleSourceUpdate_();
3518
+ this.addChangeListener(Property_default.SOURCE, this.handleSourceUpdate_);
3519
+ }
3520
+ /**
3521
+ * Gets the sources for this layer, for a given extent and resolution.
3522
+ * @param {import("../extent.js").Extent} extent Extent.
3523
+ * @param {number} resolution Resolution.
3524
+ * @return {Array<SourceType>} Sources.
3525
+ */
3526
+ getSources(extent, resolution) {
3527
+ const source = this.getSource();
3528
+ return this.sources_ ? typeof this.sources_ === "function" ? this.sources_(extent, resolution) : this.sources_ : source ? [source] : [];
3529
+ }
3530
+ /**
3531
+ * @return {SourceType} The source being rendered.
3532
+ * @override
3533
+ */
3534
+ getRenderSource() {
3535
+ return this.renderedSource_ || this.getSource();
3536
+ }
3537
+ /**
3538
+ * @return {import("../source/Source.js").State} Source state.
3539
+ * @override
3540
+ */
3541
+ getSourceState() {
3542
+ const source = this.getRenderSource();
3543
+ return source ? source.getState() : "undefined";
3544
+ }
3545
+ /**
3546
+ * @private
3547
+ */
3548
+ handleSourceUpdate_() {
3549
+ if (this.hasRenderer()) {
3550
+ this.getRenderer().clearCache();
3551
+ }
3552
+ const source = this.getSource();
3553
+ if (source) {
3554
+ if (source.getState() === "loading") {
3555
+ const onChange = () => {
3556
+ if (source.getState() === "ready") {
3557
+ source.removeEventListener("change", onChange);
3558
+ this.setStyle(this.style_);
3559
+ }
3560
+ };
3561
+ source.addEventListener("change", onChange);
3562
+ } else {
3563
+ this.setStyle(this.style_);
3564
+ }
3565
+ }
3566
+ }
3567
+ /**
3568
+ * @private
3569
+ * @return {number} The number of source bands.
3570
+ */
3571
+ getSourceBandCount_() {
3572
+ const max = Number.MAX_SAFE_INTEGER;
3573
+ const sources = this.getSources([-max, -max, max, max], max);
3574
+ return sources && sources.length && "bandCount" in sources[0] ? sources[0].bandCount : 4;
3575
+ }
3576
+ /**
3577
+ * @override
3578
+ */
3579
+ createRenderer() {
3580
+ const parsedStyle = parseStyle(this.style_, this.getSourceBandCount_());
3581
+ return new TileLayer_default(this, {
3582
+ vertexShader: parsedStyle.vertexShader,
3583
+ fragmentShader: parsedStyle.fragmentShader,
3584
+ uniforms: parsedStyle.uniforms,
3585
+ cacheSize: this.getCacheSize(),
3586
+ paletteTextures: parsedStyle.paletteTextures
3587
+ });
3588
+ }
3589
+ /**
3590
+ * @param {import("../Map").FrameState} frameState Frame state.
3591
+ * @param {Array<SourceType>} sources Sources.
3592
+ * @return {HTMLElement} Canvas.
3593
+ */
3594
+ renderSources(frameState, sources) {
3595
+ const layerRenderer = this.getRenderer();
3596
+ let canvas;
3597
+ for (let i = 0, ii = sources.length; i < ii; ++i) {
3598
+ this.renderedSource_ = sources[i];
3599
+ if (layerRenderer.prepareFrame(frameState)) {
3600
+ canvas = layerRenderer.renderFrame(frameState);
3601
+ }
3602
+ }
3603
+ return canvas;
3604
+ }
3605
+ /**
3606
+ * @param {?import("../Map.js").FrameState} frameState Frame state.
3607
+ * @param {HTMLElement} target Target which the renderer may (but need not) use
3608
+ * for rendering its content.
3609
+ * @return {HTMLElement} The rendered element.
3610
+ * @override
3611
+ */
3612
+ render(frameState, target) {
3613
+ this.rendered = true;
3614
+ const viewState = frameState.viewState;
3615
+ const sources = this.getSources(frameState.extent, viewState.resolution);
3616
+ let ready = true;
3617
+ for (let i = 0, ii = sources.length; i < ii; ++i) {
3618
+ const source = sources[i];
3619
+ const sourceState = source.getState();
3620
+ if (sourceState == "loading") {
3621
+ const onChange = () => {
3622
+ if (source.getState() == "ready") {
3623
+ source.removeEventListener("change", onChange);
3624
+ this.changed();
3625
+ }
3626
+ };
3627
+ source.addEventListener("change", onChange);
3628
+ }
3629
+ ready = ready && sourceState == "ready";
3630
+ }
3631
+ const canvas = this.renderSources(frameState, sources);
3632
+ if (this.getRenderer().renderComplete && ready) {
3633
+ this.renderedResolution_ = viewState.resolution;
3634
+ return canvas;
3635
+ }
3636
+ if (this.renderedResolution_ > 0.5 * viewState.resolution) {
3637
+ const altSources = this.getSources(
3638
+ frameState.extent,
3639
+ this.renderedResolution_
3640
+ ).filter((source) => !sources.includes(source));
3641
+ if (altSources.length > 0) {
3642
+ return this.renderSources(frameState, altSources);
3643
+ }
3644
+ }
3645
+ return canvas;
3646
+ }
3647
+ /**
3648
+ * Update the layer style. The `updateStyleVariables` function is a more efficient
3649
+ * way to update layer rendering. In cases where the whole style needs to be updated,
3650
+ * this method may be called instead. Note that calling this method will also replace
3651
+ * any previously set variables, so the new style also needs to include new variables,
3652
+ * if needed.
3653
+ * @param {Style} style The new style.
3654
+ */
3655
+ setStyle(style) {
3656
+ this.styleVariables_ = style.variables || {};
3657
+ this.style_ = style;
3658
+ if (this.hasRenderer()) {
3659
+ const parsedStyle = parseStyle(this.style_, this.getSourceBandCount_());
3660
+ const renderer = this.getRenderer();
3661
+ renderer.reset({
3662
+ vertexShader: parsedStyle.vertexShader,
3663
+ fragmentShader: parsedStyle.fragmentShader,
3664
+ uniforms: parsedStyle.uniforms,
3665
+ paletteTextures: parsedStyle.paletteTextures
3666
+ });
3667
+ this.changed();
3668
+ }
3669
+ }
3670
+ /**
3671
+ * Update any variables used by the layer style and trigger a re-render.
3672
+ * @param {Object<string, number>} variables Variables to update.
3673
+ * @api
3674
+ */
3675
+ updateStyleVariables(variables) {
3676
+ Object.assign(this.styleVariables_, variables);
3677
+ this.changed();
3678
+ }
3679
+ };
3680
+ WebGLTileLayer.prototype.dispose;
3681
+ var WebGLTile_default = WebGLTileLayer;
3682
+
3683
+ // src/components/time-average-map/time-average-map.component.ts
3684
+ var _controller, _gtLayer, _vectorSource, _vectorLayer, _draw, _handleMapError, _handlePointerMove, _handleExportImage, _drawLegend, drawLegend_fn, _getMapTitleText, getMapTitleText_fn, _wrapText, wrapText_fn, _handleOpacityChange, handleOpacityChange_fn, _handleColorMapChange, handleColorMapChange_fn, _abortJobStatusTask, abortJobStatusTask_fn, _getNumberOfPoints, getNumberOfPoints_fn, _quantizeLineString, quantizeLineString_fn, _minifyMapPopover, minifyMapPopover_fn, _cleanUpMap, cleanUpMap_fn, _getRasterValueAtCoordinate, getRasterValueAtCoordinate_fn, _handleCheckBoxToggle, handleCheckBoxToggle_fn, _isVariableNotFound, isVariableNotFound_fn, _getErrorMessage, getErrorMessage_fn;
3685
+ var TerraTimeAverageMap = class extends QueryClientMixin(TerraElement) {
3686
+ constructor() {
3687
+ super(...arguments);
3688
+ __privateAdd(this, _drawLegend);
3689
+ __privateAdd(this, _getMapTitleText);
3690
+ __privateAdd(this, _wrapText);
3691
+ __privateAdd(this, _handleOpacityChange);
3692
+ __privateAdd(this, _handleColorMapChange);
3693
+ __privateAdd(this, _abortJobStatusTask);
3694
+ __privateAdd(this, _getNumberOfPoints);
3695
+ __privateAdd(this, _quantizeLineString);
3696
+ __privateAdd(this, _minifyMapPopover);
3697
+ __privateAdd(this, _cleanUpMap);
3698
+ __privateAdd(this, _getRasterValueAtCoordinate);
3699
+ __privateAdd(this, _handleCheckBoxToggle);
3700
+ __privateAdd(this, _isVariableNotFound);
3701
+ __privateAdd(this, _getErrorMessage);
3702
+ this.long_name = "";
3703
+ this.colorMapName = "viridis";
3704
+ this.opacity = 1;
3705
+ this.noCache = false;
3706
+ this.showHelp = true;
3707
+ this.pixelValue = "N/A";
3708
+ this.pixelCoordinates = "N/A";
3709
+ this.metadata = {};
3710
+ this.toggleState = false;
3711
+ this.minimized = false;
3712
+ this.noDataValue = -9999;
3713
+ this.min = "0";
3714
+ this.max = "1";
3715
+ this.legendValues = [];
3716
+ this.timeAverageMapError = null;
3717
+ __privateAdd(this, _controller, new TimeAvgMapController(this));
3718
+ __privateAdd(this, _gtLayer, null);
3719
+ __privateAdd(this, _vectorSource, null);
3720
+ __privateAdd(this, _vectorLayer, null);
3721
+ __privateAdd(this, _draw, null);
3722
+ this._authController = new AuthController(this);
3723
+ this.colormaps = [
3724
+ "jet",
3725
+ "hsv",
3726
+ "hot",
3727
+ "cool",
3728
+ "spring",
3729
+ "summer",
3730
+ "autumn",
3731
+ "winter",
3732
+ "bone",
3733
+ "copper",
3734
+ "greys",
3735
+ "YIGnBu",
3736
+ "greens",
3737
+ "YIOrRd",
3738
+ "bluered",
3739
+ "RdBu",
3740
+ "picnic",
3741
+ "rainbow",
3742
+ "portland",
3743
+ "blackbody",
3744
+ "earth",
3745
+ "electric",
3746
+ "viridis",
3747
+ "inferno",
3748
+ "magma",
3749
+ "plasma",
3750
+ "warm",
3751
+ "cool",
3752
+ "bathymetry",
3753
+ "cdom",
3754
+ "chlorophyll",
3755
+ "density",
3756
+ "fressurface-blue",
3757
+ "freesurface-red",
3758
+ "oxygen",
3759
+ "par",
3760
+ "phase",
3761
+ "salinity",
3762
+ "temperature",
3763
+ "turbidity",
3764
+ "velocity-blue",
3765
+ "velocity-green",
3766
+ "cubhelix"
3767
+ ];
3768
+ this.plotData = {};
3769
+ this.layout = {};
3770
+ /**
3771
+ * anytime the collection or variable changes, we'll fetch the variable from the catalog to get all of it's metadata
3772
+ */
3773
+ this._fetchVariableTask = getFetchVariableTask(this, false);
3774
+ __privateAdd(this, _handleMapError, (event) => {
3775
+ const { status, code, message, context } = event.detail;
3776
+ this.timeAverageMapError = {
3777
+ code: code || String(status),
3778
+ message,
3779
+ context
3780
+ };
3781
+ });
3782
+ __privateAdd(this, _handlePointerMove, (event) => {
3783
+ if (!__privateGet(this, _gtLayer)) {
3784
+ return;
3785
+ }
3786
+ let data = __privateGet(this, _gtLayer).getData(event.detail.pixel);
3787
+ const [lon, lat] = event.detail.coordinate;
3788
+ if (!data || !(data instanceof Uint8Array || data instanceof Uint8ClampedArray || data instanceof Float32Array) || isNaN(data[0]) || data[0] === 0) {
3789
+ data = null;
3790
+ }
3791
+ this.pixelValue = data ? Number(data[0]).toExponential(3) : "N/A";
3792
+ this.pixelCoordinates = [lon, lat].map((c) => c.toFixed(3)).join(", ");
3793
+ });
3794
+ __privateAdd(this, _handleExportImage, async (event) => {
3795
+ var _a, _b;
3796
+ if (!this.innerMap) {
3797
+ console.warn("Map not initialized, cannot export image");
3798
+ return;
3799
+ }
3800
+ const format = ((_a = event.detail) == null ? void 0 : _a.format) || "png";
3801
+ try {
3802
+ await this.innerMap.renderComplete();
3803
+ const mapSize = this.innerMap.getSize();
3804
+ if (!mapSize) {
3805
+ console.warn("Map size is not available");
3806
+ return;
3807
+ }
3808
+ const mapWidth = mapSize[0];
3809
+ const mapHeight = mapSize[1];
3810
+ const { canvases: allCanvases, svgs } = (_b = this.innerMap.getCanvasElements()) != null ? _b : {
3811
+ canvases: [],
3812
+ svgs: []
3813
+ };
3814
+ if (allCanvases.length === 0 && svgs.length === 0) {
3815
+ console.warn("Could not find map canvas or SVG elements");
3816
+ return;
3817
+ }
3818
+ const finalCanvas = document.createElement("canvas");
3819
+ const ctx = finalCanvas.getContext("2d");
3820
+ if (!ctx) {
3821
+ console.warn("Could not get canvas context");
3822
+ return;
3823
+ }
3824
+ const textHeight = 80;
3825
+ finalCanvas.width = mapWidth;
3826
+ finalCanvas.height = mapHeight + textHeight;
3827
+ ctx.fillStyle = "#ffffff";
3828
+ ctx.fillRect(0, 0, finalCanvas.width, finalCanvas.height);
3829
+ for (const canvas of allCanvases) {
3830
+ ctx.drawImage(
3831
+ canvas,
3832
+ 0,
3833
+ 0,
3834
+ canvas.width,
3835
+ canvas.height,
3836
+ 0,
3837
+ textHeight,
3838
+ mapWidth,
3839
+ mapHeight
3840
+ );
3841
+ }
3842
+ for (const svg of svgs) {
3843
+ try {
3844
+ const clonedSvg = svg.cloneNode(true);
3845
+ if (!clonedSvg.hasAttribute("width")) {
3846
+ clonedSvg.setAttribute("width", String(mapWidth));
3847
+ }
3848
+ if (!clonedSvg.hasAttribute("height")) {
3849
+ clonedSvg.setAttribute("height", String(mapHeight));
3850
+ }
3851
+ const svgData = new XMLSerializer().serializeToString(clonedSvg);
3852
+ const svgBlob = new Blob([svgData], {
3853
+ type: "image/svg+xml;charset=utf-8"
3854
+ });
3855
+ const url = URL.createObjectURL(svgBlob);
3856
+ const img = new Image();
3857
+ await new Promise((resolve, reject) => {
3858
+ img.onload = () => {
3859
+ ctx.drawImage(img, 0, textHeight, mapWidth, mapHeight);
3860
+ URL.revokeObjectURL(url);
3861
+ resolve();
3862
+ };
3863
+ img.onerror = () => {
3864
+ URL.revokeObjectURL(url);
3865
+ reject(new Error("Failed to load SVG image"));
3866
+ };
3867
+ img.src = url;
3868
+ });
3869
+ } catch (error) {
3870
+ console.warn("Failed to render SVG layer:", error);
3871
+ }
3872
+ }
3873
+ const textY = 30;
3874
+ const lineHeight = 25;
3875
+ ctx.fillStyle = "#000000";
3876
+ ctx.font = "bold 18px Arial, sans-serif";
3877
+ ctx.textAlign = "left";
3878
+ ctx.textBaseline = "top";
3879
+ const titleText = __privateMethod(this, _getMapTitleText, getMapTitleText_fn).call(this);
3880
+ const lines = __privateMethod(this, _wrapText, wrapText_fn).call(this, ctx, titleText, mapWidth - 40, 16);
3881
+ lines.forEach((line, index) => {
3882
+ ctx.fillText(line, 20, textY + index * lineHeight);
3883
+ });
3884
+ await __privateMethod(this, _drawLegend, drawLegend_fn).call(this, ctx, textHeight);
3885
+ const mimeType = format === "jpg" ? "image/jpeg" : "image/png";
3886
+ const fileExtension = format === "jpg" ? "jpg" : "png";
3887
+ const quality = format === "jpg" ? 0.92 : void 0;
3888
+ finalCanvas.toBlob(
3889
+ (blob) => {
3890
+ if (!blob) {
3891
+ console.warn("Failed to create blob from canvas");
3892
+ return;
3893
+ }
3894
+ const url = URL.createObjectURL(blob);
3895
+ const a = document.createElement("a");
3896
+ const locationStr = this.location ? `_${this.location.replace(/,/g, "_")}` : "";
3897
+ const dateRange = this.startDate && this.endDate ? `_${this.startDate.split("T")[0]}_to_${this.endDate.split("T")[0]}` : "";
3898
+ const variableEntryId = getVariableEntryId(this);
3899
+ const filename = `${variableEntryId || "map"}${locationStr}${dateRange}.${fileExtension}`;
3900
+ a.href = url;
3901
+ a.download = filename;
3902
+ a.style.display = "none";
3903
+ document.body.appendChild(a);
3904
+ a.click();
3905
+ document.body.removeChild(a);
3906
+ URL.revokeObjectURL(url);
3907
+ },
3908
+ mimeType,
3909
+ quality
3910
+ );
3911
+ } catch (error) {
3912
+ console.error("Error exporting map as PNG:", error);
3913
+ }
3914
+ });
3915
+ }
3916
+ set cache(value) {
3917
+ console.warn(
3918
+ "<terra-time-average-map> `cache` is deprecated and enabled by default; use `no-cache` to disable caching instead."
3919
+ );
3920
+ this.noCache = !value;
3921
+ }
3922
+ get cache() {
3923
+ return !this.noCache;
3924
+ }
3925
+ handlePropertyChange() {
3926
+ if (!this.startDate || !this.endDate || !this.location || !this.catalogVariable) {
3927
+ return;
3928
+ }
3929
+ __privateGet(this, _controller).jobStatusTask.run();
3930
+ }
3931
+ handlePlotOptionsChange() {
3932
+ this.emit("terra-plot-options-change", {
3933
+ detail: {
3934
+ colorMapName: this.colorMapName,
3935
+ opacity: this.opacity
3936
+ }
3937
+ });
3938
+ }
3939
+ connectedCallback() {
3940
+ super.connectedCallback();
3941
+ this.addEventListener(
3942
+ "terra-time-average-map-error",
3943
+ __privateGet(this, _handleMapError)
3944
+ );
3945
+ this.addEventListener(
3946
+ "terra-plot-toolbar-export-image",
3947
+ __privateGet(this, _handleExportImage)
3948
+ );
3949
+ this.addEventListener(
3950
+ "terra-map-pointer-move",
3951
+ __privateGet(this, _handlePointerMove)
3952
+ );
3953
+ }
3954
+ async firstUpdated() {
3955
+ this._fetchVariableTask.run();
3956
+ }
3957
+ updated(changedProps) {
3958
+ var _a, _b, _c, _d;
3959
+ super.updated(changedProps);
3960
+ const taskStatus = (_b = (_a = __privateGet(this, _controller)) == null ? void 0 : _a.jobStatusTask) == null ? void 0 : _b.status;
3961
+ if (taskStatus === s.PENDING && this.timeAverageMapError) {
3962
+ this.timeAverageMapError = null;
3963
+ }
3964
+ if (taskStatus === s.ERROR && !this.timeAverageMapError) {
3965
+ const taskError = (_d = (_c = __privateGet(this, _controller)) == null ? void 0 : _c.jobStatusTask) == null ? void 0 : _d.error;
3966
+ if (taskError) {
3967
+ const errorDetails = extractHarmonyError(taskError);
3968
+ if (errorDetails.isCancellation) {
3969
+ return;
3970
+ }
3971
+ this.timeAverageMapError = {
3972
+ code: errorDetails.code,
3973
+ message: errorDetails.message,
3974
+ context: errorDetails.context
3975
+ };
3976
+ }
3977
+ }
3978
+ }
3979
+ disconnectedCallback() {
3980
+ super.disconnectedCallback();
3981
+ this.removeEventListener(
3982
+ "terra-time-average-map-error",
3983
+ __privateGet(this, _handleMapError)
3984
+ );
3985
+ this.removeEventListener(
3986
+ "terra-plot-toolbar-export-image",
3987
+ __privateGet(this, _handleExportImage)
3988
+ );
3989
+ this.removeEventListener(
3990
+ "terra-map-pointer-move",
3991
+ __privateGet(this, _handlePointerMove)
3992
+ );
3993
+ }
3994
+ /**
3995
+ * Captures the current map view as a thumbnail Blob (JPEG, 200×200).
3996
+ * Composites all OpenLayers canvas layers without text overlay or legend.
3997
+ * Returns undefined if the map is not ready.
3998
+ */
3999
+ async captureMapThumbnail(thumbWidth = 200, thumbHeight = 200) {
4000
+ var _a, _b;
4001
+ if (!this.innerMap) {
4002
+ return void 0;
4003
+ }
4004
+ try {
4005
+ await this.innerMap.renderComplete();
4006
+ const mapSize = this.innerMap.getSize();
4007
+ if (!mapSize)
4008
+ return void 0;
4009
+ const [mapWidth, mapHeight] = mapSize;
4010
+ const allCanvases = (_b = (_a = this.innerMap.getCanvasElements()) == null ? void 0 : _a.canvases) != null ? _b : [];
4011
+ if (allCanvases.length === 0)
4012
+ return void 0;
4013
+ const composite = document.createElement("canvas");
4014
+ composite.width = mapWidth;
4015
+ composite.height = mapHeight;
4016
+ const ctx = composite.getContext("2d");
4017
+ if (!ctx)
4018
+ return void 0;
4019
+ for (const canvas of allCanvases) {
4020
+ if (canvas.width > 0 && canvas.height > 0) {
4021
+ ctx.drawImage(canvas, 0, 0, mapWidth, mapHeight);
4022
+ }
4023
+ }
4024
+ const thumb = document.createElement("canvas");
4025
+ thumb.width = thumbWidth;
4026
+ thumb.height = thumbHeight;
4027
+ const thumbCtx = thumb.getContext("2d");
4028
+ if (!thumbCtx)
4029
+ return void 0;
4030
+ thumbCtx.drawImage(composite, 0, 0, thumbWidth, thumbHeight);
4031
+ return new Promise(
4032
+ (resolve, reject) => thumb.toBlob(
4033
+ (b2) => b2 ? resolve(b2) : reject(new Error("toBlob failed")),
4034
+ "image/jpeg",
4035
+ 0.8
4036
+ )
4037
+ );
4038
+ } catch (error) {
4039
+ console.error("Failed to capture map thumbnail", error);
4040
+ return void 0;
4041
+ }
4042
+ }
4043
+ async updateGeoTIFFLayer(blob) {
4044
+ var _a, _b;
4045
+ const blobUrl = URL.createObjectURL(blob);
4046
+ const { default: GeoTIFF } = await import("./GeoTIFF.VXDS234A.js");
4047
+ const gtSource = new GeoTIFF({
4048
+ sources: [
4049
+ {
4050
+ url: blobUrl,
4051
+ bands: [1],
4052
+ nodata: this.noDataValue
4053
+ }
4054
+ ],
4055
+ wrapX: true,
4056
+ // Enable wrapping so GeoTIFF is always visible when scrolling
4057
+ interpolate: false,
4058
+ normalize: false
4059
+ });
4060
+ __privateSet(this, _gtLayer, new WebGLTile_default({
4061
+ source: gtSource
4062
+ }));
4063
+ if (this.innerMap) {
4064
+ this.innerMap.removeLayer("geotiff");
4065
+ this.innerMap.addLayer(__privateGet(this, _gtLayer), { name: "geotiff" });
4066
+ }
4067
+ this.metadata = await this.fetchGeotiffMetadata(gtSource);
4068
+ this.long_name = (_a = this.metadata["long_name"]) != null ? _a : "";
4069
+ if (this.innerMap && __privateGet(this, _gtLayer)) {
4070
+ this.applyColorToLayer(gtSource, this.colorMapName);
4071
+ try {
4072
+ const view = await ((_b = __privateGet(this, _gtLayer).getSource()) == null ? void 0 : _b.getView());
4073
+ if ((view == null ? void 0 : view.extent) && view.projection) {
4074
+ this.innerMap.fitToExtent(view.extent, {
4075
+ projection: view.projection,
4076
+ padding: [50, 50, 50, 50],
4077
+ duration: 300
4078
+ });
4079
+ }
4080
+ } catch (error) {
4081
+ console.warn("Failed to fit map to GeoTIFF extent:", error);
4082
+ }
4083
+ }
4084
+ }
4085
+ async fetchGeotiffMetadata(gtSource) {
4086
+ var _a;
4087
+ await gtSource.getView();
4088
+ const internal = gtSource;
4089
+ const gtImage = internal.sourceImagery_[0][0];
4090
+ const gtMetadata = (_a = gtImage.fileDirectory) == null ? void 0 : _a.GDAL_METADATA;
4091
+ const parser = new DOMParser();
4092
+ const xmlDoc = parser.parseFromString(gtMetadata, "application/xml");
4093
+ const items = xmlDoc.querySelectorAll("Item");
4094
+ const dataObj = {};
4095
+ for (let i = 0; i < items.length; i++) {
4096
+ const item = items[i];
4097
+ const name = item.getAttribute("name");
4098
+ const value = item.textContent ? item.textContent.trim() : "";
4099
+ if (name) {
4100
+ dataObj[name] = value;
4101
+ }
4102
+ }
4103
+ console.log("Data obj: ", dataObj);
4104
+ return dataObj;
4105
+ }
4106
+ // Get the fill value from the GeoTIFF file
4107
+ getNoDataValue(gtSource) {
4108
+ let ndv = this.noDataValue;
4109
+ if (gtSource == null) {
4110
+ return ndv;
4111
+ }
4112
+ gtSource.getView().then(() => {
4113
+ var _a, _b;
4114
+ const gtImage = gtSource.sourceImagery_[0][0];
4115
+ ndv = parseFloat(
4116
+ (_b = (_a = gtImage.fileDirectory) == null ? void 0 : _a.GDAL_NODATA) != null ? _b : this.noDataValue.toString()
4117
+ );
4118
+ });
4119
+ return ndv;
4120
+ }
4121
+ async getMinMax(gtSource) {
4122
+ await gtSource.getView();
4123
+ const gtImage = gtSource.sourceImagery_[0][0];
4124
+ const rasterData = await gtImage.readRasters({ samples: [0] });
4125
+ const pixels = rasterData[0];
4126
+ let min = Infinity;
4127
+ let max = -Infinity;
4128
+ for (let i = 0; i < pixels.length; i++) {
4129
+ const val = pixels[i];
4130
+ if (!isNaN(val) && val !== this.getNoDataValue(gtSource)) {
4131
+ if (val < min)
4132
+ min = val;
4133
+ if (val > max)
4134
+ max = val;
4135
+ }
4136
+ }
4137
+ return { min, max };
4138
+ }
4139
+ // Referencing workshop example from https://openlayers.org/workshop/en/cog/colormap.html
4140
+ async getColorStops(name, min, max, steps, reverse) {
4141
+ const delta = (max - min) / (steps - 1);
4142
+ const stops = new Array(steps * 2);
4143
+ const { default: colormap } = await import("./colormap.BMZ7G2OU.js");
4144
+ const colors = colormap({
4145
+ colormap: name,
4146
+ nshades: steps,
4147
+ format: "rgba"
4148
+ });
4149
+ const dataVals = [];
4150
+ if (reverse) {
4151
+ colors.reverse();
4152
+ }
4153
+ for (let i = 0; i < steps; i++) {
4154
+ stops[i * 2] = min + i * delta;
4155
+ stops[i * 2 + 1] = colors[i];
4156
+ dataVals.push((min + i * delta).toExponential(2));
4157
+ }
4158
+ this.generatePalette(colors, dataVals, min, max);
4159
+ return stops;
4160
+ }
4161
+ generatePalette(clrs, dv, min, max) {
4162
+ this.legendValues = [];
4163
+ for (let i = clrs.length - 1; i > 0; i--) {
4164
+ const curVal = parseFloat(dv[i]);
4165
+ if (curVal >= min && curVal <= max) {
4166
+ this.legendValues.push({ value: dv[i], rgb: clrs[i] });
4167
+ }
4168
+ }
4169
+ this.min = min.toExponential(3);
4170
+ this.max = max.toExponential(3);
4171
+ }
4172
+ async applyColorToLayer(gtSource, color) {
4173
+ var _a;
4174
+ var { min, max } = await this.getMinMax(gtSource);
4175
+ let gtStyle = {
4176
+ color: [
4177
+ "case",
4178
+ ["==", ["band", 2], 0],
4179
+ [0, 0, 0, 0],
4180
+ [
4181
+ "interpolate",
4182
+ ["linear"],
4183
+ ["band", 1],
4184
+ ...await this.getColorStops(color, min, max, 72, false)
4185
+ ]
4186
+ ]
4187
+ };
4188
+ (_a = __privateGet(this, _gtLayer)) == null ? void 0 : _a.setStyle(gtStyle);
4189
+ }
4190
+ render() {
4191
+ var _a, _b, _c, _d;
4192
+ return b`
4193
+ ${__privateMethod(this, _isVariableNotFound, isVariableNotFound_fn).call(this) ? b`
4194
+ <terra-alert
4195
+ class="no-data-alert"
4196
+ variant="danger"
4197
+ open
4198
+ closable
4199
+ >
4200
+ <terra-icon
4201
+ slot="icon"
4202
+ name="outline-exclamation-triangle"
4203
+ library="heroicons"
4204
+ ></terra-icon>
4205
+ The selected variable was not found in the catalog
4206
+ </terra-alert>
4207
+ ` : ""}
4208
+ ${this.timeAverageMapError ? b`
4209
+ <terra-alert
4210
+ class="error-alert"
4211
+ variant="danger"
4212
+ open
4213
+ closable
4214
+ @terra-after-hide=${() => this.timeAverageMapError = null}
4215
+ >
4216
+ <terra-icon
4217
+ slot="icon"
4218
+ name="outline-exclamation-triangle"
4219
+ library="heroicons"
4220
+ ></terra-icon>
4221
+ ${__privateMethod(this, _getErrorMessage, getErrorMessage_fn).call(this, this.timeAverageMapError)}
4222
+ </terra-alert>
4223
+ ` : ""}
4224
+ <div class="toolbar-container">
4225
+ ${h(
4226
+ this.catalogVariable ? b`<terra-plot-toolbar
4227
+ dataType="geotiff"
4228
+ .catalogVariable=${this.catalogVariable}
4229
+ .timeSeriesData=${(_a = __privateGet(this, _controller).jobStatusTask) == null ? void 0 : _a.value}
4230
+ .location=${this.location}
4231
+ .startDate=${this.startDate}
4232
+ .endDate=${this.endDate}
4233
+ .cacheKey=${__privateGet(this, _controller).getCacheKey()}
4234
+ .variableEntryId=${getVariableEntryId(this)}
4235
+ @show-opacity-value=${__privateMethod(this, _handleOpacityChange, handleOpacityChange_fn)}
4236
+ @show-color-map=${__privateMethod(this, _handleColorMapChange, handleColorMapChange_fn)}
4237
+ @show-check-box-toggle=${__privateMethod(this, _handleCheckBoxToggle, handleCheckBoxToggle_fn)}
4238
+ .pixelValue=${this.pixelValue}
4239
+ .pixelCoordinates=${this.pixelCoordinates}
4240
+ show-date-range
4241
+ .colormaps=${this.colormaps}
4242
+ .colorMapName=${this.colorMapName}
4243
+ .opacity=${this.opacity}
4244
+ .showHelp=${this.showHelp}
4245
+ ></terra-plot-toolbar>` : b`<div class="spacer"></div>`
4246
+ )}
4247
+ </div>
4248
+
4249
+ <div class="map-container">
4250
+ <terra-map fill show-graticule></terra-map>
4251
+
4252
+ <div id="settings">
4253
+ <div>
4254
+ <strong>Value:</strong>
4255
+ <span id="pixelValue">${this.pixelValue}</span>
4256
+ </div>
4257
+
4258
+ <div>
4259
+ <strong>Coordinate: </strong>
4260
+ <span id="cursorCoordinates">${this.pixelCoordinates}</span>
4261
+ </div>
4262
+ </div>
4263
+
4264
+ <div id="legend">
4265
+ <div class="stats" id="statsMax">${this.max}</div>
4266
+ <div class="palette">
4267
+ ${this.legendValues.map(
4268
+ (value) => b`
4269
+ <div
4270
+ class="color-box"
4271
+ style="background-color: rgba(${value.rgb})"
4272
+ title="${value.value}"
4273
+ ></div>
4274
+ `
4275
+ )}
4276
+ </div>
4277
+ <div class="stats" id="statsMin">${this.min}</div>
4278
+ </div>
4279
+ </div>
4280
+
4281
+ ${this.harmonyJobId ? b`
4282
+ <div class="harmony-job-link">
4283
+ <a
4284
+ href=${`https://harmony${this.environment === "uat" /* UAT */ ? ".uat" : ""}.earthdata.nasa.gov/jobs/${this.harmonyJobId}`}
4285
+ target="_blank"
4286
+ rel="noopener noreferrer"
4287
+ >
4288
+ Request Status: ${this.harmonyJobId}
4289
+ </a>
4290
+ </div>
4291
+ ` : A}
4292
+
4293
+ <!-- Floating Popover for Plot -->
4294
+ ${this.toggleState && this.plotData && Object.keys(this.plotData).length && this.layout && Object.keys(this.layout).length ? b`
4295
+ <div class="plot-popover ${this.minimized ? "minimized" : ""}">
4296
+ <terra-plot
4297
+ style="display: ${this.minimized ? "none" : "block"}"
4298
+ .data=${this.plotData}
4299
+ plotTitle="Data Profile"
4300
+ .layout=${this.layout}
4301
+ >
4302
+ </terra-plot>
4303
+
4304
+ <terra-button
4305
+ class="minify-btn"
4306
+ @click=${__privateMethod(this, _minifyMapPopover, minifyMapPopover_fn)}
4307
+ >
4308
+ ${this.minimized ? "Restore" : "Minimize"}
4309
+ </terra-button>
4310
+ </div>
4311
+ ` : null}
4312
+
4313
+ <dialog
4314
+ ?open=${((_c = (_b = __privateGet(this, _controller)) == null ? void 0 : _b.jobStatusTask) == null ? void 0 : _c.status) === s.PENDING}
4315
+ >
4316
+ <terra-loader indeterminate variant="orbit"></terra-loader>
4317
+ <p>Plotting ${(_d = this.catalogVariable) == null ? void 0 : _d.dataFieldId}&hellip;</p>
4318
+ <terra-button @click=${__privateMethod(this, _abortJobStatusTask, abortJobStatusTask_fn)}>Cancel</terra-button>
4319
+ </dialog>
4320
+ `;
4321
+ }
4322
+ };
4323
+ _controller = new WeakMap();
4324
+ _gtLayer = new WeakMap();
4325
+ _vectorSource = new WeakMap();
4326
+ _vectorLayer = new WeakMap();
4327
+ _draw = new WeakMap();
4328
+ _handleMapError = new WeakMap();
4329
+ _handlePointerMove = new WeakMap();
4330
+ _handleExportImage = new WeakMap();
4331
+ _drawLegend = new WeakSet();
4332
+ drawLegend_fn = async function(ctx, textHeight) {
4333
+ var _a, _b;
4334
+ const legendElement = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("legend");
4335
+ if (!legendElement) {
4336
+ return;
4337
+ }
4338
+ const mapContainer = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector(".map-container");
4339
+ if (!mapContainer) {
4340
+ return;
4341
+ }
4342
+ const legendRect = legendElement.getBoundingClientRect();
4343
+ const mapRect = mapContainer.getBoundingClientRect();
4344
+ const legendX = legendRect.left - mapRect.left;
4345
+ const legendY = legendRect.top - mapRect.top + textHeight;
4346
+ const legendWidth = legendRect.width;
4347
+ const legendHeight = legendRect.height;
4348
+ ctx.fillStyle = "#ffffff";
4349
+ ctx.fillRect(legendX, legendY, legendWidth, legendHeight);
4350
+ ctx.strokeStyle = "#cccccc";
4351
+ ctx.lineWidth = 1;
4352
+ ctx.strokeRect(legendX, legendY, legendWidth, legendHeight);
4353
+ const computedStyle = window.getComputedStyle(legendElement);
4354
+ const fontSize = parseFloat(computedStyle.fontSize) || 12;
4355
+ const fontFamily = computedStyle.fontFamily || "monospace";
4356
+ const padding = parseFloat(computedStyle.padding) || 8;
4357
+ const statsMax = legendElement.querySelector("#statsMax");
4358
+ if (statsMax) {
4359
+ ctx.fillStyle = "#000000";
4360
+ ctx.font = `${fontSize}px ${fontFamily}`;
4361
+ ctx.textAlign = "center";
4362
+ ctx.textBaseline = "top";
4363
+ ctx.fillText(
4364
+ statsMax.textContent || "",
4365
+ legendX + legendWidth / 2,
4366
+ legendY + padding
4367
+ );
4368
+ }
4369
+ const palette = legendElement.querySelector(".palette");
4370
+ if (palette) {
4371
+ const paletteRect = palette.getBoundingClientRect();
4372
+ const paletteX = paletteRect.left - mapRect.left;
4373
+ const paletteY = paletteRect.top - mapRect.top + textHeight;
4374
+ const paletteWidth = paletteRect.width;
4375
+ const colorDivs = Array.from(
4376
+ palette.querySelectorAll("div")
4377
+ );
4378
+ let currentY = paletteY;
4379
+ for (const div of colorDivs) {
4380
+ const divRect = div.getBoundingClientRect();
4381
+ const divHeight = divRect.height;
4382
+ const style = div.getAttribute("style") || "";
4383
+ const bgColorMatch = style.match(
4384
+ /background-color:\s*rgba?\(([^)]+)\)/
4385
+ );
4386
+ if (bgColorMatch) {
4387
+ const colorStr = bgColorMatch[1];
4388
+ const [r2, g, b2, a = 1] = colorStr.split(",").map((s2) => parseFloat(s2.trim()));
4389
+ ctx.fillStyle = `rgba(${r2}, ${g}, ${b2}, ${a})`;
4390
+ ctx.fillRect(paletteX, currentY, paletteWidth, divHeight);
4391
+ }
4392
+ currentY += divHeight;
4393
+ }
4394
+ }
4395
+ const statsMin = legendElement.querySelector("#statsMin");
4396
+ if (statsMin) {
4397
+ ctx.fillStyle = "#000000";
4398
+ ctx.font = `${fontSize}px ${fontFamily}`;
4399
+ ctx.textAlign = "center";
4400
+ ctx.textBaseline = "bottom";
4401
+ ctx.fillText(
4402
+ statsMin.textContent || "",
4403
+ legendX + legendWidth / 2,
4404
+ legendY + legendHeight - padding
4405
+ );
4406
+ }
4407
+ };
4408
+ _getMapTitleText = new WeakSet();
4409
+ getMapTitleText_fn = function() {
4410
+ if (!this.catalogVariable) {
4411
+ return "Time Averaged Map";
4412
+ }
4413
+ const parts = [];
4414
+ parts.push("Time Averaged Map of");
4415
+ if (this.catalogVariable.dataFieldLongName) {
4416
+ parts.push(this.catalogVariable.dataFieldLongName);
4417
+ }
4418
+ if (this.catalogVariable.dataProductTimeInterval && this.catalogVariable.dataProductTimeInterval.toLowerCase() !== "not applicable") {
4419
+ parts.push(this.catalogVariable.dataProductTimeInterval);
4420
+ }
4421
+ if (this.catalogVariable.dataProductSpatialResolution && this.catalogVariable.dataProductSpatialResolution.toLowerCase() !== "not applicable") {
4422
+ parts.push(this.catalogVariable.dataProductSpatialResolution);
4423
+ }
4424
+ if (this.catalogVariable.dataProductShortName) {
4425
+ let datasetInfo = `[${this.catalogVariable.dataProductShortName}`;
4426
+ if (this.catalogVariable.dataProductVersion) {
4427
+ datasetInfo += ` v${this.catalogVariable.dataProductVersion}`;
4428
+ }
4429
+ datasetInfo += "]";
4430
+ parts.push(datasetInfo);
4431
+ }
4432
+ if (this.startDate && this.endDate) {
4433
+ const startFormatted = formatDate(this.startDate);
4434
+ const endFormatted = formatDate(this.endDate);
4435
+ parts.push(`over ${startFormatted} - ${endFormatted}`);
4436
+ }
4437
+ return parts.join(" ");
4438
+ };
4439
+ _wrapText = new WeakSet();
4440
+ wrapText_fn = function(ctx, text, maxWidth, fontSize) {
4441
+ ctx.font = `bold ${fontSize}px Arial, sans-serif`;
4442
+ const words = text.split(" ");
4443
+ const lines = [];
4444
+ let currentLine = words[0];
4445
+ for (let i = 1; i < words.length; i++) {
4446
+ const word = words[i];
4447
+ const width = ctx.measureText(currentLine + " " + word).width;
4448
+ if (width < maxWidth) {
4449
+ currentLine += " " + word;
4450
+ } else {
4451
+ lines.push(currentLine);
4452
+ currentLine = word;
4453
+ }
4454
+ }
4455
+ lines.push(currentLine);
4456
+ return lines;
4457
+ };
4458
+ _handleOpacityChange = new WeakSet();
4459
+ handleOpacityChange_fn = function(e2) {
4460
+ this.opacity = e2.detail;
4461
+ if (__privateGet(this, _gtLayer)) {
4462
+ __privateGet(this, _gtLayer).setOpacity(this.opacity);
4463
+ }
4464
+ };
4465
+ _handleColorMapChange = new WeakSet();
4466
+ handleColorMapChange_fn = function(e2) {
4467
+ const selectedColormap = e2.detail;
4468
+ if (__privateGet(this, _gtLayer) && __privateGet(this, _gtLayer).getSource()) {
4469
+ this.colorMapName = selectedColormap;
4470
+ this.applyColorToLayer(__privateGet(this, _gtLayer).getSource(), this.colorMapName);
4471
+ }
4472
+ };
4473
+ _abortJobStatusTask = new WeakSet();
4474
+ abortJobStatusTask_fn = function() {
4475
+ __privateGet(this, _controller).cancelJob();
4476
+ };
4477
+ _getNumberOfPoints = new WeakSet();
4478
+ getNumberOfPoints_fn = function(line) {
4479
+ const length = getLength(line);
4480
+ let pointCount;
4481
+ if (length > 100) {
4482
+ pointCount = length / 1e3 / 60;
4483
+ } else {
4484
+ pointCount = length / 10;
4485
+ }
4486
+ return Math.max(2, Math.round(pointCount));
4487
+ };
4488
+ _quantizeLineString = new WeakSet();
4489
+ quantizeLineString_fn = function(geo) {
4490
+ const numPoints = __privateMethod(this, _getNumberOfPoints, getNumberOfPoints_fn).call(this, geo);
4491
+ const points = [];
4492
+ for (let i = 0; i <= numPoints; i++) {
4493
+ const fraction = i / numPoints;
4494
+ points.push(geo.getCoordinateAt(fraction));
4495
+ }
4496
+ return points;
4497
+ };
4498
+ _minifyMapPopover = new WeakSet();
4499
+ minifyMapPopover_fn = function() {
4500
+ this.minimized = !this.minimized;
4501
+ };
4502
+ _cleanUpMap = new WeakSet();
4503
+ cleanUpMap_fn = function() {
4504
+ var _a;
4505
+ this.toggleState = false;
4506
+ if (this.innerMap && __privateGet(this, _draw)) {
4507
+ this.innerMap.removeInteraction(__privateGet(this, _draw));
4508
+ this.innerMap.removeLayer("profile-line");
4509
+ }
4510
+ (_a = __privateGet(this, _vectorSource)) == null ? void 0 : _a.clear();
4511
+ __privateSet(this, _draw, null);
4512
+ __privateSet(this, _vectorLayer, null);
4513
+ __privateSet(this, _vectorSource, null);
4514
+ };
4515
+ _getRasterValueAtCoordinate = new WeakSet();
4516
+ getRasterValueAtCoordinate_fn = function(coord) {
4517
+ if (!this.innerMap || !__privateGet(this, _gtLayer))
4518
+ return NaN;
4519
+ const pixel = this.innerMap.getPixelFromCoordinate(coord);
4520
+ if (!pixel)
4521
+ return NaN;
4522
+ const data = __privateGet(this, _gtLayer).getData(pixel);
4523
+ if (!data)
4524
+ return NaN;
4525
+ if (data instanceof Uint8Array || data instanceof Uint8ClampedArray || data instanceof Float32Array) {
4526
+ return !isNaN(data[0]) ? data[0] : NaN;
4527
+ }
4528
+ if (data instanceof DataView) {
4529
+ const val = data.getFloat32(0, true);
4530
+ return !isNaN(val) ? val : NaN;
4531
+ }
4532
+ return NaN;
4533
+ };
4534
+ _handleCheckBoxToggle = new WeakSet();
4535
+ handleCheckBoxToggle_fn = function(e2) {
4536
+ var isToggled = e2.detail;
4537
+ if (isToggled) {
4538
+ this.toggleState = isToggled;
4539
+ __privateSet(this, _vectorSource, new Vector_default({ wrapX: false }));
4540
+ __privateSet(this, _vectorLayer, new Vector_default2({
4541
+ source: __privateGet(this, _vectorSource)
4542
+ }));
4543
+ __privateSet(this, _draw, new Draw_default({
4544
+ source: __privateGet(this, _vectorSource),
4545
+ type: "LineString"
4546
+ }));
4547
+ if (this.innerMap) {
4548
+ this.innerMap.addLayer(__privateGet(this, _vectorLayer), {
4549
+ name: "profile-line",
4550
+ position: "top"
4551
+ });
4552
+ this.innerMap.addInteraction(__privateGet(this, _draw));
4553
+ __privateGet(this, _draw).on("drawend", (event) => {
4554
+ var _a;
4555
+ const line = event.feature.getGeometry();
4556
+ const coords = __privateMethod(this, _quantizeLineString, quantizeLineString_fn).call(this, line);
4557
+ const pointFeatures = coords.map(
4558
+ (coord) => new Feature_default({
4559
+ geometry: new Point_default(coord)
4560
+ })
4561
+ );
4562
+ (_a = __privateGet(this, _vectorSource)) == null ? void 0 : _a.addFeatures(pointFeatures);
4563
+ const rasterValues = coords.map(
4564
+ (coord) => __privateMethod(this, _getRasterValueAtCoordinate, getRasterValueAtCoordinate_fn).call(this, coord)
4565
+ );
4566
+ const xValues = coords.map((_, index) => index);
4567
+ const lonLatCoords = coords.map((coord) => {
4568
+ const [lon, lat] = toLonLat(coord);
4569
+ const val = __privateMethod(this, _getRasterValueAtCoordinate, getRasterValueAtCoordinate_fn).call(this, coord);
4570
+ const rastervalue = !isNaN(val) ? val.toExponential(4) : "N/A";
4571
+ return [
4572
+ parseFloat(lon.toFixed(2)),
4573
+ parseFloat(lat.toFixed(2)),
4574
+ rastervalue
4575
+ ];
4576
+ });
4577
+ const hoverTexts = lonLatCoords.map((coord, idx) => {
4578
+ const x = idx;
4579
+ const value = coord[2];
4580
+ return `Index: ${x}<br>Value: ${value}<br>Coordinates: [${coord[0]}, ${coord[1]}]`;
4581
+ });
4582
+ this.plotData = [
4583
+ {
4584
+ x: xValues,
4585
+ y: rasterValues,
4586
+ text: hoverTexts,
4587
+ hoverinfo: "text",
4588
+ type: "scatter",
4589
+ mode: "lines+markers",
4590
+ line: { color: "blue" }
4591
+ }
4592
+ ];
4593
+ this.layout = {
4594
+ title: "Data Profile",
4595
+ xaxis: {
4596
+ title: "Point Index"
4597
+ },
4598
+ yaxis: {
4599
+ title: `Cloud Coverage (${this.metadata["units"]})`,
4600
+ tickformat: ".2e"
4601
+ }
4602
+ };
4603
+ });
4604
+ }
4605
+ } else {
4606
+ __privateMethod(this, _cleanUpMap, cleanUpMap_fn).call(this);
4607
+ }
4608
+ };
4609
+ _isVariableNotFound = new WeakSet();
4610
+ isVariableNotFound_fn = function() {
4611
+ const variableTaskStatus = this._fetchVariableTask.status;
4612
+ if (variableTaskStatus !== s.COMPLETE) {
4613
+ return false;
4614
+ }
4615
+ const hasVariableRequest = Boolean(this.collection && this.variable);
4616
+ return hasVariableRequest && !this.catalogVariable;
4617
+ };
4618
+ _getErrorMessage = new WeakSet();
4619
+ getErrorMessage_fn = function(error) {
4620
+ return formatHarmonyErrorMessage(error);
4621
+ };
4622
+ TerraTimeAverageMap.styles = [component_styles_default, time_average_map_styles_default];
4623
+ TerraTimeAverageMap.dependencies = {
4624
+ "terra-button": TerraButton,
4625
+ "terra-icon": TerraIcon,
4626
+ "terra-plot-toolbar": TerraPlotToolbar,
4627
+ "terra-loader": TerraLoader,
4628
+ "terra-plot": TerraPlot,
4629
+ "terra-alert": TerraAlert,
4630
+ "terra-map": TerraMap
4631
+ };
4632
+ __decorateClass([
4633
+ n({ reflect: true })
4634
+ ], TerraTimeAverageMap.prototype, "collection", 2);
4635
+ __decorateClass([
4636
+ n({ reflect: true })
4637
+ ], TerraTimeAverageMap.prototype, "variable", 2);
4638
+ __decorateClass([
4639
+ n({ attribute: "start-date", reflect: true })
4640
+ ], TerraTimeAverageMap.prototype, "startDate", 2);
4641
+ __decorateClass([
4642
+ n({ attribute: "end-date", reflect: true })
4643
+ ], TerraTimeAverageMap.prototype, "endDate", 2);
4644
+ __decorateClass([
4645
+ n({ reflect: true })
4646
+ ], TerraTimeAverageMap.prototype, "location", 2);
4647
+ __decorateClass([
4648
+ n({
4649
+ attribute: "bearer-token",
4650
+ reflect: false,
4651
+ converter: undefinedStringConverter
4652
+ })
4653
+ ], TerraTimeAverageMap.prototype, "bearerToken", 2);
4654
+ __decorateClass([
4655
+ n({ type: String })
4656
+ ], TerraTimeAverageMap.prototype, "long_name", 2);
4657
+ __decorateClass([
4658
+ n({ type: String, attribute: "color-map-name", reflect: true })
4659
+ ], TerraTimeAverageMap.prototype, "colorMapName", 2);
4660
+ __decorateClass([
4661
+ n({ type: Number })
4662
+ ], TerraTimeAverageMap.prototype, "opacity", 2);
4663
+ __decorateClass([
4664
+ n({ attribute: "application-id" })
4665
+ ], TerraTimeAverageMap.prototype, "applicationId", 2);
4666
+ __decorateClass([
4667
+ n({ type: Boolean, attribute: "no-cache" })
4668
+ ], TerraTimeAverageMap.prototype, "noCache", 2);
4669
+ __decorateClass([
4670
+ n({ type: Boolean })
4671
+ ], TerraTimeAverageMap.prototype, "cache", 1);
4672
+ __decorateClass([
4673
+ n({ attribute: "job-id" })
4674
+ ], TerraTimeAverageMap.prototype, "jobId", 2);
4675
+ __decorateClass([
4676
+ n({ type: Boolean, attribute: "show-help" })
4677
+ ], TerraTimeAverageMap.prototype, "showHelp", 2);
4678
+ __decorateClass([
4679
+ r()
4680
+ ], TerraTimeAverageMap.prototype, "catalogVariable", 2);
4681
+ __decorateClass([
4682
+ r()
4683
+ ], TerraTimeAverageMap.prototype, "pixelValue", 2);
4684
+ __decorateClass([
4685
+ r()
4686
+ ], TerraTimeAverageMap.prototype, "pixelCoordinates", 2);
4687
+ __decorateClass([
4688
+ r()
4689
+ ], TerraTimeAverageMap.prototype, "metadata", 2);
4690
+ __decorateClass([
4691
+ r()
4692
+ ], TerraTimeAverageMap.prototype, "toggleState", 2);
4693
+ __decorateClass([
4694
+ r()
4695
+ ], TerraTimeAverageMap.prototype, "minimized", 2);
4696
+ __decorateClass([
4697
+ r()
4698
+ ], TerraTimeAverageMap.prototype, "noDataValue", 2);
4699
+ __decorateClass([
4700
+ r()
4701
+ ], TerraTimeAverageMap.prototype, "min", 2);
4702
+ __decorateClass([
4703
+ r()
4704
+ ], TerraTimeAverageMap.prototype, "max", 2);
4705
+ __decorateClass([
4706
+ r()
4707
+ ], TerraTimeAverageMap.prototype, "legendValues", 2);
4708
+ __decorateClass([
4709
+ r()
4710
+ ], TerraTimeAverageMap.prototype, "timeAverageMapError", 2);
4711
+ __decorateClass([
4712
+ e("terra-map")
4713
+ ], TerraTimeAverageMap.prototype, "innerMap", 2);
4714
+ __decorateClass([
4715
+ r()
4716
+ ], TerraTimeAverageMap.prototype, "colormaps", 2);
4717
+ __decorateClass([
4718
+ r()
4719
+ ], TerraTimeAverageMap.prototype, "plotData", 2);
4720
+ __decorateClass([
4721
+ r()
4722
+ ], TerraTimeAverageMap.prototype, "layout", 2);
4723
+ __decorateClass([
4724
+ r()
4725
+ ], TerraTimeAverageMap.prototype, "harmonyJobId", 2);
4726
+ __decorateClass([
4727
+ watch(["startDate", "endDate", "location", "catalogVariable"])
4728
+ ], TerraTimeAverageMap.prototype, "handlePropertyChange", 1);
4729
+ __decorateClass([
4730
+ watch(["colorMapName", "opacity"])
4731
+ ], TerraTimeAverageMap.prototype, "handlePlotOptionsChange", 1);
4732
+
4733
+ export {
4734
+ TerraTimeAverageMap
4735
+ };