PageSourceSearch

https://quiet-dusk-dfea.pages.dev/assets/component.client-BWvFnpxt.js

js quiet-dusk-dfea.pages.dev collected 2026-10-03 05:43:52 UTC 1,143,145 bytes, 926 lines download raw bytes

1import{r as he,j as dt,T as Py,U as My,u as Iy}from"./components-DZP3uNYy.js";import{p as cc,d as Dd,u as Ey,e as Cy}from"./index-DlhJzqRw.js";import{c as Ay}from"./client-B3dlM9RU.js";import{B as Dy,C as zy,L as Ry}from"./_index-DLJ9XbPj.js";import{e as Id,D as Ed}from"./index-ZhkFHCHQ.js";import"./index-Cr9PnSxe.js";import"./index-BtSRx8Zj.js";import"./i18next-DyZISFPe.js";const ky=new Map([["bold",he.createElement(he.Fragment,null,he.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36Zm-4,24V84H44V60ZM44,196V108H212v88Z"}))],["duotone",he.createElement(he.Fragment,null,he.createElement("path",{d:"M224,56V96H32V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),he.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V88H40V56Zm0,144H40V104H216v96Z"}))],["fill",he.createElement(he.Fragment,null,he.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V88H40V56Z"}))],["light",he.createElement(he.Fragment,null,he.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V90H38V56A2,2,0,0,1,40,54ZM216,202H40a2,2,0,0,1-2-2V102H218v98A2,2,0,0,1,216,202Z"}))],["regular",he.createElement(he.Fragment,null,he.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V88H40V56Zm0,144H40V104H216v96Z"}))],["thin",he.createElement(he.Fragment,null,he.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V92H36V56A4,4,0,0,1,40,52ZM216,204H40a4,4,0,0,1-4-4V100H220V200A4,4,0,0,1,216,204Z"}))]]),Ly=new Map([["bold",he.createElement(he.Fragment,null,he.createElement("path",{d:"M240,204H228V96a20,20,0,0,0-20-20H172V32a20,20,0,0,0-28.45-18.12l-104,48.54A20.06,20.06,0,0,0,28,80.55V204H16a12,12,0,0,0,0,24H240a12,12,0,0,0,0-24ZM204,100V204H172V100ZM52,83.09,148,38.3V204H52ZM132,112v12a12,12,0,0,1-24,0V112a12,12,0,0,1,24,0Zm-40,0v12a12,12,0,0,1-24,0V112a12,12,0,0,1,24,0Zm0,52v12a12,12,0,0,1-24,0V164a12,12,0,0,1,24,0Zm40,0v12a12,12,0,0,1-24,0V164a12,12,0,0,1,24,0Z"}))],["duotone",he.createElement(he.Fragment,null,he.createElement("path",{d:"M136,32V216H40V85.35a8,8,0,0,1,3.56-6.66l80-53.33A8,8,0,0,1,136,32Z",opacity:"0.2"}),he.createElement("path",{d:"M240,208H224V96a16,16,0,0,0-16-16H144V32a16,16,0,0,0-24.88-13.32L39.12,72A16,16,0,0,0,32,85.34V208H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM208,96V208H144V96ZM48,85.34,128,32V208H48ZM112,112v16a8,8,0,0,1-16,0V112a8,8,0,1,1,16,0Zm-32,0v16a8,8,0,0,1-16,0V112a8,8,0,1,1,16,0Zm0,56v16a8,8,0,0,1-16,0V168a8,8,0,0,1,16,0Zm32,0v16a8,8,0,0,1-16,0V168a8,8,0,0,1,16,0Z"}))],["fill",he.createElement(he.Fragment,null,he.createElement("path",{d:"M239.73,208H224V96a16,16,0,0,0-16-16H164a4,4,0,0,0-4,4V208H144V32.41a16.43,16.43,0,0,0-6.16-13,16,16,0,0,0-18.72-.69L39.12,72A16,16,0,0,0,32,85.34V208H16.27A8.18,8.18,0,0,0,8,215.47,8,8,0,0,0,16,224H240a8,8,0,0,0,8-8.53A8.18,8.18,0,0,0,239.73,208ZM76,184a8,8,0,0,1-8.53,8A8.18,8.18,0,0,1,60,183.72V168.27A8.19,8.19,0,0,1,67.47,160,8,8,0,0,1,76,168Zm0-56a8,8,0,0,1-8.53,8A8.19,8.19,0,0,1,60,127.72V112.27A8.19,8.19,0,0,1,67.47,104,8,8,0,0,1,76,112Zm40,56a8,8,0,0,1-8.53,8,8.18,8.18,0,0,1-7.47-8.26V168.27a8.19,8.19,0,0,1,7.47-8.26,8,8,0,0,1,8.53,8Zm0-56a8,8,0,0,1-8.53,8,8.19,8.19,0,0,1-7.47-8.26V112.27a8.19,8.19,0,0,1,7.47-8.26,8,8,0,0,1,8.53,8Z"}))],["light",he.createElement(he.Fragment,null,he.createElement("path",{d:"M240,210H222V96a14,14,0,0,0-14-14H142V32a14,14,0,0,0-21.77-11.64l-80,53.33A14,14,0,0,0,34,85.34V210H16a6,6,0,0,0,0,12H240a6,6,0,0,0,0-12ZM208,94a2,2,0,0,1,2,2V210H142V94ZM46,85.34a2,2,0,0,1,.89-1.66l80-53.34A2,2,0,0,1,130,32V210H46ZM110,112v16a6,6,0,0,1-12,0V112a6,6,0,0,1,12,0Zm-32,0v16a6,6,0,0,1-12,0V112a6,6,0,0,1,12,0Zm0,56v16a6,6,0,0,1-12,0V168a6,6,0,0,1,12,0Zm32,0v16a6,6,0,0,1-12,0V168a6,6,0,0,1,12,0Z"}))],["regular",he.createElement(he.Fragment,null,he.createElement("path",{d:"M240,208H224V96a16,16,0,0,0-16-16H144V32a16,16,0,0,0-24.88-13.32L39.12,72A16,16,0,0,0,32,85.34V208H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM208,96V208H144V96ZM48,85.34,128,32V208H48ZM112,112v16a8,8,0,0,1-16,0V112a8,8,0,1,1,16,0Zm-32,0v16a8,8,0,0,1-16,0V112a8,8,0,1,1,16,0Zm0,56v16a8,8,0,0,1-16,0V168a8,8,0,0,1,16,0Zm32,0v16a8,8,0,0,1-16,0V168a8,8,0,0,1,16,0Z"}))],["thin",he.createElement(he.Fragment,null,he.createElement("path",{d:"M240,212H220V96a12,12,0,0,0-12-12H140V32a12,12,0,0,0-18.66-10l-80,53.33a12,12,0,0,0-5.34,10V212H16a4,4,0,0,0,0,8H240a4,4,0,0,0,0-8ZM208,92a4,4,0,0,1,4,4V212H140V92ZM44,85.34A4,4,0,0,1,45.78,82l80-53.33A4,4,0,0,1,132,32V212H44ZM108,112v16a4,4,0,0,1-8,0V112a4,4,0,0,1,8,0Zm-32,0v16a4,4,0,0,1-8,0V112a4,4,0,0,1,8,0Zm0,56v16a4,4,0,0,1-8,0V168a4,4,0,0,1,8,0Zm32,0v16a4,4,0,0,1-8,0V168a4,4,0,0,1,8,0Z"}))]]),Fy=new Map([["bold",he.createElement(he.Fragment,null,he.createElement("path",{d:"M128,60a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,60Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,124Zm0-112a92.1,92.1,0,0,0-92,92c0,77.36,81.64,135.4,85.12,137.83a12,12,0,0,0,13.76,0,259,259,0,0,0,42.18-39C205.15,170.57,220,136.37,220,104A92.1,92.1,0,0,0,128,12Zm31.3,174.71A249.35,249.35,0,0,1,128,216.89a249.35,249.35,0,0,1-31.3-30.18C80,167.37,60,137.31,60,104a68,68,0,0,1,136,0C196,137.31,176,167.37,159.3,186.71Z"}))],["duotone",he.createElement(he.Fragment,null,he.createElement("path",{d:"M128,24a80,80,0,0,0-80,80c0,72,80,128,80,128s80-56,80-128A80,80,0,0,0,128,24Zm0,112a32,32,0,1,1,32-32A32,32,0,0,1,128,136Z",opacity:"0.2"}),he.createElement("path",{d:"M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z"}))],["fill",he.createElement(he.Fragment,null,he.createElement("path",{d:"M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z"}))],["light",he.createElement(he.Fragment,null,he.createElement("path",{d:"M128,66a38,38,0,1,0,38,38A38,38,0,0,0,128,66Zm0,64a26,26,0,1,1,26-26A26,26,0,0,1,128,130Zm0-112a86.1,86.1,0,0,0-86,86c0,30.91,14.34,63.74,41.47,94.94a252.32,252.32,0,0,0,41.09,38,6,6,0,0,0,6.88,0,252.32,252.32,0,0,0,41.09-38c27.13-31.2,41.47-64,41.47-94.94A86.1,86.1,0,0,0,128,18Zm0,206.51C113,212.93,54,163.62,54,104a74,74,0,0,1,148,0C202,163.62,143,212.93,128,224.51Z"}))],["regular",he.createElement(he.Fragment,null,he.createElement("path",{d:"M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z"}))],["thin",he.createElement(he.Fragment,null,he.createElement("path",{d:"M128,68a36,36,0,1,0,36,36A36,36,0,0,0,128,68Zm0,64a28,28,0,1,1,28-28A28,28,0,0,1,128,132Zm0-112a84.09,84.09,0,0,0-84,84c0,30.42,14.17,62.79,41,93.62a250,250,0,0,0,40.73,37.66,4,4,0,0,0,4.58,0A250,250,0,0,0,171,197.62c26.81-30.83,41-63.2,41-93.62A84.09,84.09,0,0,0,128,20Zm37.1,172.23A254.62,254.62,0,0,1,128,227a254.62,254.62,0,0,1-37.1-34.81C73.15,171.8,52,139.9,52,104a76,76,0,0,1,152,0C204,139.9,182.85,171.8,165.1,192.23Z"}))]]),By=new Map([["bold",he.createElement(he.Fragment,null,he.createElement("path",{d:"M176,156a43.78,43.78,0,0,0-29.09,11L106.1,140.8a44.07,44.07,0,0,0,0-25.6L146.91,89a43.83,43.83,0,1,0-13-20.17L93.09,95a44,44,0,1,0,0,65.94L133.9,187.2A44,44,0,1,0,176,156Zm0-120a20,20,0,1,1-20,20A20,20,0,0,1,176,36ZM64,148a20,20,0,1,1,20-20A20,20,0,0,1,64,148Zm112,72a20,20,0,1,1,20-20A20,20,0,0,1,176,220Z"}))],["duotone",he.createElement(he.Fragment,null,he.createElement("path",{d:"M208,200a32,32,0,1,1-32-32A32,32,0,0,1,208,200ZM176,88a32,32,0,1,0-32-32A32,32,0,0,0,176,88Z",opacity:"0.2"}),he.createElement("path",{d:"M176,160a39.89,39.89,0,0,0-28.62,12.09l-46.1-29.63a39.8,39.8,0,0,0,0-28.92l46.1-29.63a40,40,0,1,0-8.66-13.45l-46.1,29.63a40,40,0,1,0,0,55.82l46.1,29.63A40,40,0,1,0,176,160Zm0-128a24,24,0,1,1-24,24A24,24,0,0,1,176,32ZM64,152a24,24,0,1,1,24-24A24,24,0,0,1,64,152Zm112,72a24,24,0,1,1,24-24A24,24,0,0,1,176,224Z"}))],["fill",he.createElement(he.Fragment,null,he.createElement("path",{d:"M212,200a36,36,0,1,1-69.85-12.25l-53-34.05a36,36,0,1,1,0-51.4l53-34a36.09,36.09,0,1,1,8.67,13.45l-53,34.05a36,36,0,0,1,0,24.5l53,34.05A36,36,0,0,1,212,200Z"}))],["light",he.createElement(he.Fragment,null,he.createElement("path",{d:"M176,162a37.91,37.91,0,0,0-28.3,12.67L98.8,143.24a37.89,37.89,0,0,0,0-30.48l48.9-31.43a38,38,0,1,0-6.5-10.09L92.3,102.67a38,38,0,1,0,0,50.66l48.9,31.43A38,38,0,1,0,176,162Zm0-132a26,26,0,1,1-26,26A26,26,0,0,1,176,30ZM64,154a26,26,0,1,1,26-26A26,26,0,0,1,64,154Zm112,72a26,26,0,1,1,26-26A26,26,0,0,1,176,226Z"}))],["regular",he.createElement(he.Fragment,null,he.createElement("path",{d:"M176,160a39.89,39.89,0,0,0-28.62,12.09l-46.1-29.63a39.8,39.8,0,0,0,0-28.92l46.1-29.63a40,40,0,1,0-8.66-13.45l-46.1,29.63a40,40,0,1,0,0,55.82l46.1,29.63A40,40,0,1,0,176,160Zm0-128a24,24,0,1,1-24,24A24,24,0,0,1,176,32ZM64,152a24,24,0,1,1,24-24A24,24,0,0,1,64,152Zm112,72a24,24,0,1,1,24-24A24,24,0,0,1,176,224Z"}))],["thin",he.createElement(he.Fragment,null,he.createElement("path",{d:"M176,164a36,36,0,0,0-27.92,13.3L96.25,144a35.92,35.92,0,0,0,0-32L148.08,78.7A35.93,35.93,0,1,0,143.75,72L91.92,105.3a36,36,0,1,0,0,45.4L143.75,184A36,36,0,1,0,176,164Zm0-136a28,28,0,1,1-28,28A28,28,0,0,1,176,28ZM64,156a28,28,0,1,1,28-28A28,28,0,0,1,64,156Zm112,72a28,28,0,1,1,28-28A28,28,0,0,1,176,228Z"}))]]),Oy=new Map([["bold",he.createElement(he.Fragment,null,he.createElement("path",{d:"M160,116h48a20,20,0,0,0,20-20V48a20,20,0,0,0-20-20H160a20,20,0,0,0-20,20V60H128a28,28,0,0,0-28,28v28H76v-4A20,20,0,0,0,56,92H24A20,20,0,0,0,4,112v32a20,20,0,0,0,20,20H56a20,20,0,0,0,20-20v-4h24v28a28,28,0,0,0,28,28h12v12a20,20,0,0,0,20,20h48a20,20,0,0,0,20-20V160a20,20,0,0,0-20-20H160a20,20,0,0,0-20,20v12H128a4,4,0,0,1-4-4V88a4,4,0,0,1,4-4h12V96A20,20,0,0,0,160,116ZM52,140H28V116H52Zm112,24h40v40H164Zm0-112h40V92H164Z"}))],["duotone",he.createElement(he.Fragment,null,he.createElement("path",{d:"M64,112v32a8,8,0,0,1-8,8H24a8,8,0,0,1-8-8V112a8,8,0,0,1,8-8H56A8,8,0,0,1,64,112ZM208,40H160a8,8,0,0,0-8,8V96a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V48A8,8,0,0,0,208,40Zm0,112H160a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152Z",opacity:"0.2"}),he.createElement("path",{d:"M160,112h48a16,16,0,0,0,16-16V48a16,16,0,0,0-16-16H160a16,
116,0,0,0-16,16V64H128a24,24,0,0,0-24,24v32H72v-8A16,16,0,0,0,56,96H24A16,16,0,0,0,8,112v32a16,16,0,0,0,16,16H56a16,16,0,0,0,16-16v-8h32v32a24,24,0,0,0,24,24h16v16a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V160a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16v16H128a8,8,0,0,1-8-8V88a8,8,0,0,1,8-8h16V96A16,16,0,0,0,160,112ZM56,144H24V112H56v32Zm104,16h48v48H160Zm0-112h48V96H160Z"}))],["fill",he.createElement(he.Fragment,null,he.createElement("path",{d:"M144,96V80H128a8,8,0,0,0-8,8v80a8,8,0,0,0,8,8h16V160a16,16,0,0,1,16-16h48a16,16,0,0,1,16,16v48a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V192H128a24,24,0,0,1-24-24V136H72v8a16,16,0,0,1-16,16H24A16,16,0,0,1,8,144V112A16,16,0,0,1,24,96H56a16,16,0,0,1,16,16v8h32V88a24,24,0,0,1,24-24h16V48a16,16,0,0,1,16-16h48a16,16,0,0,1,16,16V96a16,16,0,0,1-16,16H160A16,16,0,0,1,144,96Z"}))],["light",he.createElement(he.Fragment,null,he.createElement("path",{d:"M160,110h48a14,14,0,0,0,14-14V48a14,14,0,0,0-14-14H160a14,14,0,0,0-14,14V66H128a22,22,0,0,0-22,22v34H70V112A14,14,0,0,0,56,98H24a14,14,0,0,0-14,14v32a14,14,0,0,0,14,14H56a14,14,0,0,0,14-14V134h36v34a22,22,0,0,0,22,22h18v18a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V160a14,14,0,0,0-14-14H160a14,14,0,0,0-14,14v18H128a10,10,0,0,1-10-10V88a10,10,0,0,1,10-10h18V96A14,14,0,0,0,160,110ZM58,144a2,2,0,0,1-2,2H24a2,2,0,0,1-2-2V112a2,2,0,0,1,2-2H56a2,2,0,0,1,2,2Zm100,16a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2v48a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2Zm0-112a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2V96a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2Z"}))],["regular",he.createElement(he.Fragment,null,he.createElement("path",{d:"M160,112h48a16,16,0,0,0,16-16V48a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16V64H128a24,24,0,0,0-24,24v32H72v-8A16,16,0,0,0,56,96H24A16,16,0,0,0,8,112v32a16,16,0,0,0,16,16H56a16,16,0,0,0,16-16v-8h32v32a24,24,0,0,0,24,24h16v16a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V160a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16v16H128a8,8,0,0,1-8-8V88a8,8,0,0,1,8-8h16V96A16,16,0,0,0,160,112ZM56,144H24V112H56v32Zm104,16h48v48H160Zm0-112h48V96H160Z"}))],["thin",he.createElement(he.Fragment,null,he.createElement("path",{d:"M160,108h48a12,12,0,0,0,12-12V48a12,12,0,0,0-12-12H160a12,12,0,0,0-12,12V68H128a20,20,0,0,0-20,20v36H68V112a12,12,0,0,0-12-12H24a12,12,0,0,0-12,12v32a12,12,0,0,0,12,12H56a12,12,0,0,0,12-12V132h40v36a20,20,0,0,0,20,20h20v20a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V160a12,12,0,0,0-12-12H160a12,12,0,0,0-12,12v20H128a12,12,0,0,1-12-12V88a12,12,0,0,1,12-12h20V96A12,12,0,0,0,160,108ZM60,144a4,4,0,0,1-4,4H24a4,4,0,0,1-4-4V112a4,4,0,0,1,4-4H56a4,4,0,0,1,4,4Zm96,16a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4v48a4,4,0,0,1-4,4H160a4,4,0,0,1-4-4Zm0-112a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V96a4,4,0,0,1-4,4H160a4,4,0,0,1-4-4Z"}))]]),gm=he.forwardRef((fe,Ie)=>
1he.createElement(cc,{ref:Ie,...fe,weights:ky}));gm.displayName="BrowserIcon";const _m=he.forwardRef((fe,Ie)=>he.createElement(cc,{ref:Ie,...fe,weights:Ly}));_m.displayName="BuildingsIcon";const ym=he.forwardRef((fe,Ie)=>he.createElement(cc,{ref:Ie,...fe,weights:Fy}));ym.displayName="MapPinIcon";const vm=he.forwardRef((fe,Ie)=>he.createElement(cc,{ref:Ie,...fe,weights:By}));vm.displayName="ShareNetworkIcon";const xm=he.forwardRef((fe,Ie)=>he.createElement(cc,{ref:Ie,...fe,weights:Oy}));xm.displayName="TreeStructureIcon";const Ny="#F48120",Vy="#FAAD3F",jy=["M47.34 108.53 L56.88 108.53 L56.88 134.59 L73.54 134.59 L73.54 142.94 L47.34 142.94 L47.34 108.53","M83.42,125.84v-.10c0-9.88,8-17.9,18.58-17.9s18.48,7.92,18.48,17.8v.1c0,9.88-8,17.89-18.58,17.89s-18.48-7.91-18.48-17.79m27.33,0v-.1c0-5-3.59-9.29-8.85-9.29s-8.7,4.23-8.7,9.19v.1c0,5,3.59,9.29,8.8,9.29s8.75-4.23,8.75-9.19","M132.15,127.85V108.53h9.69v19.13c0,5,2.51,7.32,6.34,7.32s6.34-2.26,6.34-7.08V108.53h9.69v19.08c0,11.11-6.34,16-16.13,16s-15.93-5-15.93-15.73","M178.8,108.53h13.27c12.29,0,19.42,7.08,19.42,17v.1c0,9.93-7.22,17.3-19.61,17.3H178.8Zm13.42,26c5.71,0,9.49-3.15,9.49-8.7v-.1c0-5.51-3.78-8.7-9.49-8.7h-3.88v17.5Z","M225.35 108.53 L252.88 108.53 L252.88 116.89 L234.89 116.89 L234.89 122.74 L251.16 122.74 L251.16 130.65 L234.89 130.65 L234.89 142.94 L225.35 142.94 L225.35 108.53","M266.15 108.53 L275.69 108.53 L275.69 134.59 L292.35 134.59 L292.35 142.94 L266.15 142.94 L266.15 108.53","M317.27,108.29h9.19l14.65,34.65H330.89l-2.51-6.14H315.11l-2.46,6.14h-10Zm8.36,21.09-3.84-9.79-3.88,9.79Z","M353.4,108.53h16.27c5.26,0,8.89,1.38,11.21,3.74a10.69,10.69,0,0,1,3,8v.1A10.89,10.89,0,0,1,376.85,131l8.21,12H374l-6.93-10.42h-4.18v10.42H353.4Zm15.83,16.52c3.24,0,5.11-1.57,5.11-4.08v-.1c0-2.7-2-4.08-5.16-4.08h-6.25v8.26Z","M397.68 108.53 L425.36 108.53 L425.36 116.64 L407.12 116.64 L407.12 121.85 L423.64 121.85 L423.64 129.38 L407.12 129.38 L407.12 134.83 L425.61 134.83 L425.61 142.94 L397.68 142.94 L397.68 108.53","M26.46,129.87A8.44,8.44,0,0,1,18.58,135c-5.21,0-8.8-4.33-8.8-9.29v-.1c0-5,3.49-9.19,8.7-9.19a8.63,8.63,0,0,1,8.18,5.7H36.72c-1.61-8.19-8.81-14.31-18.14-14.31C8,107.84,0,115.86,0,125.74v.09c0,9.89,7.86,17.8,18.48,17.8,9.08,0,16.18-5.88,18.05-13.76Z"],Uy="M360.8,90.69l1-3.6c1.24-4.28.78-8.24-1.3-11.15a11.32,11.32,0,0,0-9-4.43l-73.35-.94a1.49,1.49,0,0,1-1.16-.61,1.51,1.51,0,0,1-.15-1.33,2,2,0,0,1,1.7-1.3l74-.94c8.78-.4,18.29-7.53,21.62-16.22l4.22-11a2.51,2.51,0,0,0,.16-.94,2.35,2.35,0,0,0-.05-.52,48.21,48.21,0,0,0-92.7-5,21.69,21.69,0,0,0-34.58,15.15,22,22,0,0,0,.56,7.59,30.83,30.83,0,0,0-29.93,30.82,31.22,31.22,0,0,0,.32,4.46A1.44,1.44,0,0,0,223.68,92H359.13A1.79,1.79,0,0,0,360.8,90.69Z",Zy="M385.24,40c-.68,0-1.36,0-2,0a1.55,1.55,0,0,0-.31.07,1.14,1.14,0,0,0-.74.78l-2.89,10c-1.24,4.28-.77,8.24,1.31,11.14a11.3,11.3,0,0,0,9,4.44l15.63.94a1.44,1.44,0,0,1,1.12.6,1.5,1.5,0,0,1,.16,1.34,2,2,0,0,1-1.7,1.3l-16.24.94c-8.82.4-18.33,7.52-21.66,16.21l-1.17,3.07a.87.87,0,0,0,.77,1.18h55.94a1.49,1.49,0,0,0,1.45-1.07A40.15,40.15,0,0,0,385.24,40Z",Gy="0 0 49 22",$y="0 0 425.6 143.63",nm={variant:"full",color:"color"},Ld=he.forwardRef(({variant:fe=nm.variant,color:Ie=nm.color,className:Ue,...We},Ge)=>{const xt=fe==="glyph",k=Ie==="color"?Ny:"currentColor",h=Ie==="color"?Vy:"currentColor",ge="currentColor";return xt?dt.jsxs("svg",{ref:Ge,viewBox:Gy,fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Cloudflare logo",className:Dd(Ie==="white"&&"text-white",Ie==="black"&&"text-black",Ue),...We,children:[dt.jsx("path",{d:"M33.204 20.4C33.3649 19.9741 33.4217 19.5159 33.3695 19.0636C33.3173 18.6113 33.1577 18.1781 32.904 17.8C32.6435 17.4876 32.3239 17.2297 31.9636 17.0409C31.6032 16.8522 31.2092 16.7363 30.804 16.7L13.404 16.5C13.304 16.5 13.204 16.4 13.104 16.4C13.0808 16.3825 13.0618 16.3599 13.0488 16.3339C13.0358 16.3078 13.029 16.2791 13.029 16.25C13.029 16.2209 13.0358 16.1922 13.0488 16.1662C13.0618 16.1401 13.0808 16.1175 13.104 16.1C13.204 15.9 13.304 15.8 13.504 15.8L31.004 15.6C32.115 15.4767 33.1731 15.0597 34.0695 14.3918C34.9659 13.7239 35.6681 12.8293 36.104 11.8L37.104 9.20002C37.104 9.10002 37.204 9.00001 37.104 8.90001C36.5604 6.47843 35.2411 4.30052 33.3466 2.69721C31.4521 1.09391 29.086 0.152865 26.6079 0.0170769C24.1298 -0.118712 21.675 0.558179 19.6167 1.94489C17.5584 3.33161 16.009 5.35233 15.204 7.70002C14.159 6.95365 12.8843 6.59957 11.604 6.70002C10.4291 6.83102 9.33369 7.35777 8.497
174 8.19372C7.66179 9.02966 7.13505 10.1251 7.00404 11.3C6.93745 11.9014 6.97125 12.5097 7.10404 13.1C5.20298 13.1526 3.39743 13.9448 2.07147 15.3081C0.745511 16.6714 0.00377461 18.4982 0.00403983 20.4C-0.0123708 20.7695 0.0212659 21.1395 0.104038 21.5C0.10863 21.5781 0.141713 21.6517 0.19701 21.707C0.252307 21.7623 0.325975 21.7954 0.404041 21.8H32.504C32.704 21.8 32.904 21.7 32.904 21.5L33.204 20.4Z",fill:k}),dt.jsx("path",{d:"M38.704 9.20002H38.204C38.104 9.20002 38.004 9.30001 37.904 9.40001L37.204 11.8C37.0431 12.2259 36.9864 12.6841 37.0386 13.1364C37.0908 13.5887 37.2504 14.0219 37.504 14.4C37.7646 14.7124 38.0842 14.9704 38.4445 15.1591C38.8049 15.3479 39.1989 15.4637 39.604 15.5L43.304 15.7C43.404 15.7 43.504 15.8 43.604 15.8C43.6273 15.8175 43.6462 15.8401 43.6592 15.8662C43.6723 15.8922 43.679 15.9209 43.679 15.95C43.679 15.9791 43.6723 16.0078 43.6592 16.0339C43.6462 16.0599 43.6273 16.0826 43.604 16.1C43.504 16.3 43.404 16.4 43.204 16.4L39.404 16.6C38.293 16.7233 37.2349 17.1403 36.3386 17.8082C35.4422 18.4761 34.74 19.3707 34.304 20.4L34.104 21.3C34.004 21.4 34.104 21.6 34.304 21.6H47.504C47.5448 21.6058 47.5863 21.6021 47.6254 21.5891C47.6644 21.5761 47.6999 21.5541 47.729 21.525C47.7581 21.4959 47.7801 21.4604 47.7931 21.4214C47.8061 21.3823 47.8099 21.3408 47.804 21.3C48.0421 20.4527 48.1764 19.5797 48.204 18.7C48.1882 16.1854 47.1822 13.7782 45.404 12C43.6259 10.2218 41.2187 9.21587 38.704 9.20002Z",fill:h})]}):dt.jsxs("svg",{ref:Ge,viewBox:$y,fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Cloudflare logo",className:Dd(Ie==="color"&&"text-kumo-default",Ie==="white"&&"text-white",Ie==="black"&&"text-black",Ue),...We,children:[dt.jsx("path",{d:Uy,fill:k}),dt.jsx("path",{d:Zy,fill:h}),jy.map((pt,at)=>dt.jsx("path",{d:pt,fill:ge},at))]})});Ld.displayName="CloudflareLogo";const qy=he.forwardRef(({color:fe="color",href:Ie="https://www.cloudflare.com",className:Ue,...We},Ge)=>dt.jsxs("a",{ref:Ge,href:Ie,target:"_blank",rel:"noopener noreferrer",className:Dd("inline-flex items-center gap-2 rounded-lg py-2 pr-3 pl-2.5 text-sm font-medium","ring-1 transition-all ring-inset hover:shadow-sm",fe==="color"&&"bg-kumo-base text-kumo-default ring-kumo-hairline",fe==="black"&&"bg-white text-black ring-black/20",fe==="white"&&"bg-black text-white ring-white/20",Ue),...We,children:[dt.jsx(Ld,{variant:"glyph",color:fe,className:"h-4 w-auto"}),dt.jsxs("span",{children:["Powered by ",dt.jsx("span",{className:"font-semibold",children:"Cloudflare"})]})]}));qy.displayName="PoweredByCloudflare";var Uu={exports:{}};var Wy=Uu.exports,sm;function Hy(){return sm||(sm=1,(function(fe,Ie){(function(Ue,We){fe.exports=We()})(Wy,(function(){var Ue={},We={};function Ge(k,h,ge){if(We[k]=ge,k==="index"){var pt="var sharedModule = {}; ("+We.shared+")(sharedModule); ("+We.worker+")(sharedModule);",at={};return We.shared(at),We.index(Ue,at),typeof window<"u"&&Ue.setWorkerUrl(window.URL.createObjectURL(new Blob([pt],{type:"text/javascript"}))),Ue}}Ge("shared",["exports"],(function(k){function h(r,e,i,n){return new(i||(i=Promise))((function(s,l){function u(m){try{g(n.next(m))}catch(v){l(v)}}function p(m){try{g(n.throw(m))}catch(v){l(v)}}function g(m){var v;m.done?s(m.value):(v=m.value,v instanceof i?v:new i((function(_){_(v)}))).then(u,p)}g((n=n.apply(r,e||[])).next())}))}function ge(r,e){this.x=r,this.y=e}function pt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var at,Tt;typeof SuppressedError=="function"&&SuppressedError,ge.prototype={clone(){return new ge(this.x,this.y)},add(r){return this.clone()._add(r)},sub(r){return this.clone()._sub(r)},multByPoint(r){return this.clone()._multByPoint(r)},divByPoint(r){return this.clone()._divByPoint(r)},mult(r){return this.clone()._mult(r)},div(r){return this.clone()._div(r)},rotate(r){return this.clone()._rotate(r)},rotateAround(r,e){return this.clone()._rotateAround(r,e)},matMult(r){return this.clone()._matMult(r)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(r){return this.x===r.x&&this.y===r.y},dist(r){return Math.sqrt(this.distSqr(r))},distSqr(r){const e=r.x-this.x,i=r.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith(r){return this.angleWithSep(r.x,r.y)},angleWithSep(r,e){return Math.atan2(this.x*e-this.y*r,this.x*r+this.y*e)},_matMult(r){const e=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=e,this},_add(r){return this.x+=r.x,this.y+=r.y,this},_sub(r){return this.x-=r.x,this.y-=r.y,this},_mult(r){return this.x*=r,this.y*=r,this},_div(r){return this.x/=r,this.y/=r,this},_multByPoint(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint(r){return this.x/=r.x,this.y/=r.y,this},_unit(){return this._div(this.mag()),this},_perp(){const r=this.y;return this.y=this.x,this.x=-r,this},_rotate(r){const e=Math.cos(r),i=Math.sin(r),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this}
vendor: 4,294 bytes, line 1
1,_rotateAround(r,e){const i=Math.cos(r),n=Math.sin(r),s=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=s,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:ge},ge.convert=function(r){if(r instanceof ge)return r;if(Array.isArray(r))return new ge(+r[0],+r[1]);if(r.x!==void 0&&r.y!==void 0)return new ge(+r.x,+r.y);throw new Error("Expected [x, y] or {x, y} point format")};var Si=(function(){if(Tt)return at;function r(e,i,n,s){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(s-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=n,this.p2y=s}return Tt=1,at=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,s=0;s<8;s++){var l=this.sampleCurveX(n)-e;if(Math.abs(l)<i)return n;var u=this.sampleCurveDerivativeX(n);if(Math.abs(u)<1e-6)break;n-=l/u}var p=0,g=1;for(n=e,s=0;s<20&&(l=this.sampleCurveX(n),!(Math.abs(l-e)<i));s++)e>l?p=n:g=n,n=.5*(g-p)+p;return n},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},at})(),ft=pt(Si);let ui,je;function ii(){return ui!=null||(ui=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ui}function Ut(){if(je==null&&(je=!1,ii())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let n=0;n<25;n++){const s=4*n;e.fillStyle=`rgb(${s},${s+1},${s+2})`,e.fillRect(n%5,Math.floor(n/5),1,1)}const i=e.getImageData(0,0,5,5).data;for(let n=0;n<100;n++)if(n%4!=3&&i[n]!==n){je=!0;break}}}return je||!1}var de=1e-6,zt=typeof Float32Array<"u"?Float32Array:Array;function Dr(){var r=new zt(9);return zt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function zr(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Bt(){var r=new zt(3);return zt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function ur(r){var e=r[0],i=r[1],n=r[2];return Math.sqrt(e*e+i*i+n*n)}function Qe(r,e,i){var n=new zt(3);return n[0]=r,n[1]=e,n[2]=i,n}function W(r,e,i){return r[0]=e[0]+i[0],r[1]=e[1]+i[1],r[2]=e[2]+i[2],r}function K(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function ee(r,e,i){var n=e[0],s=e[1],l=e[2],u=i[0],p=i[1],g=i[2];return r[0]=s*g-l*p,r[1]=l*u-n*g,r[2]=n*p-s*u,r}var ve,_e=ur;function Be(r,e,i){var n=e[0],s=e[1],l=e[2],u=e[3];return r[0]=i[0]*n+i[4]*s+i[8]*l+i[12]*u,r[1]=i[1]*n+i[5]*s+i[9]*l+i[13]*u,r[2]=i[2]*n+i[6]*s+i[10]*l+i[14]*u,r[3]=i[3]*n+i[7]*s+i[11]*l+i[15]*u,r}function Re(){var r=new zt(4);return zt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function Ce(r,e,i,n){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",l=Math.PI/360;e*=l,n*=l,i*=l;var u=Math.sin(e),p=Math.cos(e),g=Math.sin(i),m=Math.cos(i),v=Math.sin(n),_=Math.cos(n);switch(s){case"xyz":r[0]=u*m*_+p*g*v,r[1]=p*g*_-u*m*v,r[2]=p*m*v+u*g*_,r[3]=p*m*_-u*g*v;break;case"xzy":r[0]=u*m*_-p*g*v,r[1]=p*g*_-u*m*v,r[2]=p*m*v+u*g*_,r[3]=p*m*_+u*g*v;break;case"yxz":r[0]=u*m*_+p*g*v,r[1]=p*g*_-u*m*v,r[2]=p*m*v-u*g*_,r[3]=p*m*_+u*g*v;break;case"yzx":r[0]=u*m*_+p*g*v,r[1]=p*g*_+u*m*v,r[2]=p*m*v-u*g*_,r[3]=p*m*_-u*g*v;break;case"zxy":r[0]=u*m*_-p*g*v,r[1]=p*g*_+u*m*v,r[2]=p*m*v+u*g*_,r[3]=p*m*_-u*g*v;break;case"zyx":r[0]=u*m*_-p*g*v,r[1]=p*g*_+u*m*v,r[2]=p*m*v-u*g*_,r[3]=p*m*_+u*g*v;break;default:throw new Error("Unknown angle order "+s)}return r}function Ve(){var r=new zt(2);return zt!=Float32Array&&(r[0]=0,r[1]=0),r}function Xe(r,e){var i=new zt(2);return i[0]=r,i[1]=e,i}Bt(),ve=new zt(4),zt!=Float32Array&&(ve[0]=0,ve[1]=0,ve[2]=0,ve[3]=0),Bt(),Qe(1,0,0),Qe(0,1,0),Re(),Re(),Dr(),Ve();const Le=8192;function bt(r,e,i){return e*(Le/(r.tileSize*Math.pow(2,i-r.tileID.overscaledZ)))}function lt(r){return r instanceof Error?r:new Error(typeof r=="string"?r:String(r))}function Pi(r,e){return(r%e+e)%e}function Mi(r,e,i){return r*(1-i)+e*i}function er(r){if(r<=0)return 0;if(r>=1)return 1;const e=r*r,i=e*r;return 4*(r<.5?i:3*(r-e)+i-.75)}
1function tr(r,e,i,n){const s=new ft(r,e,i,n);return l=>s.solve(l)}const br=tr(.25,.1,.25,1);function Yt(r,e,i){return Math.min(i,Math.max(e,r))}function wr(r,e,i){const n=i-e,s=((r-e)%n+n)%n+e;return s===e?i:s}function Ii(r,...e){for(const i of e)for(const n in i)r[n]=i[n];return r}let Hr=1;function Gi(r,e,i){const n={};for(const s in r)n[s]=e.call(this,r[s],s,r);return n}function Tr(r,e,i){const n={};for(const s in r)e.call(this,r[s],s,r)&&(n[s]=r[s]);return n}function Fe(r){return Array.isArray(r)?r.map(Fe):typeof r=="object"&&r?Gi(r,Fe):r}const Zt={};function Kt(r){Zt[r]||(typeof console<"u"&&console.warn(r),Zt[r]=!0)}function Ei(r,e,i){return(i.y-r.y)*(e.x-r.x)>(e.y-r.y)*(i.x-r.x)}function Jt(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let et=null;function Ot(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}const hr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function dr(r,e,i,n,s){return h(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const l=new VideoFrame(r,{timestamp:0});try{const u=l?.format;if(!u||!u.startsWith("BGR")&&!u.startsWith("RGB"))throw new Error(`Unrecognized format ${u}`);const p=u.startsWith("BGR"),g=new Uint8ClampedArray(n*s*4);if(yield l.copyTo(g,(function(m,v,_,T,b){const M=4*Math.max(-v,0),I=(Math.max(0,_)-_)*T*4+M,A=4*T,D=Math.max(0,v),L=Math.max(0,_);return{rect:{x:D,y:L,width:Math.min(m.width,v+T)-D,height:Math.min(m.height,_+b)-L},layout:[{offset:I,stride:A}]}})(r,e,i,n,s)),p)for(let m=0;m<g.length;m+=4){const v=g[m];g[m]=g[m+2],g[m+2]=v}return g}finally{l.close()}}))}let Qt,Ua;function _s(r,e,i,n){return r.addEventListener(e,i,n),{unsubscribe:()=>{r.removeEventListener(e,i,n)}}}function Xr(r){return r*Math.PI/180}function da(r){return r/Math.PI*180}const Vo={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},jo={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},ys="AbortError";class Pn extends Error{constructor(e=ys){super(e instanceof Error?e.message:e),this.name=ys,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function uc(r){return r instanceof Error&&r.name===ys}function vs(r){if(r.aborted)throw new Pn(r.reason)}const Yr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Rr(r){return Yr.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}const ir="global-dispatcher";class Za extends Error{constructor(e,i,n,s){super(`AJAXError: ${i} (${e}): ${n}`),this.status=e,this.statusText=i,this.url=n,this.body=s}}const Uo=()=>{var r;return Jt(self)?(r=self.worker)===null||r===void 0?void 0:r.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href},pa=function(r,e){return h(this,void 0,void 0,(function*(){var i,n;if(r.url.includes("://")&&!/^https?:|^file:/.test(r.url)){const s=Rr(r.url);if(s){const l=yield s(r,e);return l.data||r.type!=="arrayBuffer"?l:Ii(l,{data:new ArrayBuffer(0)})}if(Jt(self)&&(!((i=self.worker)===null||i===void 0)&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:ir},e)}if(!(s=>{var l;return s.startsWith("file:")||((l=Uo())===null||l===void 0?void 0:l.startsWith("file:"))&&!/^\w+:/.test(s)})(r.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return(function(s,l){return h(this,void 0,void 0,(function*(){const u=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:Uo(),referrerPolicy:s.referrerPolicy,signal:l.signal});let p,g;s.type!=="json"||u.headers.has("Accept")||u.headers.set("Accept","application/json");try{p=yield fetch(u)}catch(v){throw uc(v)?v:new Za(0,lt(v).message,s.url,new Blob)}if(!p.ok){const v=yield p.blob();throw new Za(p.status,p.statusText,s.url,v)}g=s.type==="arrayBuffer"||s.type==="image"?p.arrayBuffer():s.type==="json"?p.json():p.text();const m=yield g;return vs(l.signal),{data:m,cacheControl:p.headers.get("Cache-Control"),expires:p.headers.get("Expires"),etag:p.headers.get("ETag")}}))})(r,e);if(Jt(self)&&(!((n=self.worker)===null||n===void 0)&&n.actor))return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:ir},e)}return(function(s,l){return new Promise(((u,p)=>{var g;const m=new XMLHttpRequest;m.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(m.responseType="arraybuffer");for(const v in s.headers)m.setRequestHeader(v,s.headers[v]);s.type==="json"&&(m.responseType="text",!((g=s.headers)===null||g===void 0)&&g.Accept||m.setRequestHeader("Accept","application/json")),m.withCredentials=s.credentials==="include",m.onerror=()=>{p(new Error(m.statusText))},m.onload=()=>
1{if(!l.signal.aborted)if((m.status>=200&&m.status<300||m.status===0)&&m.response!==null){let v=m.response;if(s.type==="json")try{v=JSON.parse(m.response)}catch(_){return void p(_)}u({data:v,cacheControl:m.getResponseHeader("Cache-Control"),expires:m.getResponseHeader("Expires"),etag:m.getResponseHeader("ETag")})}else{const v=new Blob([m.response],{type:m.getResponseHeader("Content-Type")});p(new Za(m.status,m.statusText,s.url,v))}},l.signal.addEventListener("abort",(()=>{m.abort(),p(new Pn(l.signal.reason))})),m.send(s.body)}))})(r,e)}))};function pr(r){if(!r||r.indexOf("://")<=0||r.startsWith("data:image/")||r.startsWith("blob:"))return!0;const e=new URL(r),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function Ga(r,e,i){var n;!((n=i[r])===null||n===void 0)&&n.includes(e)||(i[r]||(i[r]=[]),i[r].push(e))}function fa(r,e,i){if(i?.[r]){const n=i[r].indexOf(e);n!==-1&&i[r].splice(n,1)}}class Mn{constructor(e,i={}){Ii(this,i),this.type=e}}class $a extends Mn{constructor(e,i={}){super("error",Ii({error:e},i))}}class xs{on(e,i){return this._listeners||(this._listeners={}),Ga(e,i,this._listeners),{unsubscribe:()=>{this.off(e,i)}}}off(e,i){return fa(e,i,this._listeners),fa(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners||(this._oneTimeListeners={}),Ga(e,i,this._oneTimeListeners),this):new Promise((n=>this.once(e,n)))}fire(e,i){var n,s;typeof e=="string"&&(e=new Mn(e,i||{}));const l=e.type;if(this.listens(l)){e.target=this;const u=!((n=this._listeners)===null||n===void 0)&&n[l]?this._listeners[l].slice():[];for(const m of u)m.call(this,e);const p=!((s=this._oneTimeListeners)===null||s===void 0)&&s[l]?this._oneTimeListeners[l].slice():[];for(const m of p)fa(l,m,this._oneTimeListeners),m.call(this,e);const g=this._eventedParent;g&&(Ii(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(e))}else e instanceof $a&&console.error(e.error);return this}listens(e){var i,n,s,l,u;return((n=(i=this._listeners)===null||i===void 0?void 0:i[e])===null||n===void 0?void 0:n.length)>0||((l=(s=this._oneTimeListeners)===null||s===void 0?void 0:s[e])===null||l===void 0?void 0:l.length)>0||((u=this._eventedParent)===null||u===void 0?void 0:u.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var ce={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0}
vendor: 3,304 bytes, line 1
1,clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-
vendor: 8,538 bytes, line 1
1constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",
vendor: 6,583 bytes, line 1
1expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven
vendor: 12,722 bytes, line 1
1"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}}
1;const Zo=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Go(r,e){const i={};for(const n in r)n!=="ref"&&(i[n]=r[n]);
vendor: 91,330 bytes, lines 1-2
1return Zo.forEach((n=>{n in e&&(i[n]=e[n])})),i}function ct(r,e){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(!ct(r[i],e[i]))return!1;return!0}if(typeof r=="object"&&r!==null&&e!==null){if(typeof e!="object"||Object.keys(r).length!==Object.keys(e).length)return!1;for(const i in r)if(!ct(r[i],e[i]))return!1;return!0}return r===e}function Oi(r,e){r.push(e)}function ma(r,e,i){Oi(i,{command:"addSource",args:[r,e[r]]})}function hc(r,e,i){Oi(e,{command:"removeSource",args:[r]}),i[r]=!0}function dc(r,e,i,n){hc(r,i,n),ma(r,e,i)}function $u(r,e,i){let n;for(n in r[i])if(Object.prototype.hasOwnProperty.call(r[i],n)&&n!=="data"&&!ct(r[i][n],e[i][n]))return!1;for(n in e[i])if(Object.prototype.hasOwnProperty.call(e[i],n)&&n!=="data"&&!ct(r[i][n],e[i][n]))return!1;return!0}function bs(r,e,i,n,s,l){r=r||{},e=e||{};for(const u in r)Object.prototype.hasOwnProperty.call(r,u)&&(ct(r[u],e[u])||i.push({command:l,args:[n,u,e[u],s]}));for(const u in e)Object.prototype.hasOwnProperty.call(e,u)&&!Object.prototype.hasOwnProperty.call(r,u)&&(ct(r[u],e[u])||i.push({command:l,args:[n,u,e[u],s]}))}function $o(r){return r.id}function pc(r,e){return r[e.id]=e,r}class be{constructor(e,i,n,s){this.message=(e?`${e}: `:"")+n,s&&(this.identifier=s),i!=null&&i.__line__&&(this.line=i.__line__)}}function ga(r,...e){for(const i of e)for(const n in i)r[n]=i[n];return r}class hi extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}class qo{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[n,s]of i)this.bindings[n]=s}concat(e){return new qo(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Kr={kind:"null"},Pe={kind:"number"},Ze={kind:"string"},Ye={kind:"boolean"},$i={kind:"color"},ws={kind:"projectionDefinition"},kr={kind:"object"},$e={kind:"value"},In={kind:"collator"},En={kind:"formatted"},Ts={kind:"padding"},qa={kind:"colorArray"},Cn={kind:"numberArray"},Wa={kind:"resolvedImage"},An={kind:"variableAnchorOffsetCollection"};function di(r,e){return{kind:"array",itemType:r,N:e}}function ut(r){if(r.kind==="array"){const e=ut(r.itemType);return typeof r.N=="number"?`array<${e}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${e}>`}return r.kind}const Ss=[Kr,Pe,Ze,Ye,$i,ws,En,kr,di($e),Ts,Cn,qa,Wa,An];function Ha(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Ha(r.itemType,e.itemType))&&(typeof r.N!="number"||r.N===e.N))return null}else{if(r.kind===e.kind)return null;if(r.kind==="value"){for(const i of Ss)if(!Ha(i,e))return null}}return`Expected ${ut(r)} but found ${ut(e)} instead.`}function Dn(r,e){return e.some((i=>i.kind===r.kind))}function _a(r,e){return e.some((i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r))}function fr(r,e){return r.kind==="array"&&e.kind==="array"?r.itemType.kind===e.itemType.kind&&typeof r.N=="number":r.kind===e.kind}const fc=.96422,ya=.82521,Ps=4/29,Rt=6/29,mc=3*Rt*Rt,gc=Rt*Rt*Rt,zn=Math.PI/180,_c=180/Math.PI;function yc(r){return(r%=360)<0&&(r+=360),r}function vc([r,e,i,n]){let s,l;const u=Wo((.2225045*(r=Ms(r))+.7168786*(e=Ms(e))+.0606169*(i=Ms(i)))/1);r===e&&e===i?s=l=u:(s=Wo((.4360747*r+.3850649*e+.1430804*i)/fc),l=Wo((.0139322*r+.0971045*e+.7141733*i)/ya));const p=116*u-16;return[p<0?0:p,500*(s-u),200*(u-l),n]}function Ms(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function Wo(r){return r>gc?Math.pow(r,1/3):r/mc+Ps}function Ho([r,e,i,n]){let s=(r+16)/116,l=isNaN(e)?s:s+e/500,u=isNaN(i)?s:s-i/200;return s=1*Yo(s),l=fc*Yo(l),u=ya*Yo(u),[Xo(3.1338561*l-1.6168667*s-.4906146*u),Xo(-.9787684*l+1.9161415*s+.033454*u),Xo(.0719453*l-.2289914*s+1.4052427*u),n]}function Xo(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function Yo(r){return r>Rt?r*r*r:mc*(r-Ps)}const qu=Object.hasOwn||function(r,e){return Object.prototype.hasOwnProperty.call(r,e)};function Rn(r,e){return qu(r,e)?r[e]:void 0}function Is(r){return parseInt(r.padEnd(2,r),16)/255}function xc(r,e){return Xa(e?r/100:r,0,1)}function Xa(r,e,i){return Math.min(Math.max(e,r),i)}function Ko(r){return!r.some(Number.isNaN)}const kn={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Jr(r,e,i){return r+i*(e-r)}function Ya(r,e,i){return r.map(((n,s)=>Jr(n,e[s],i)))}class He{constructor(e,i,n,s=1,l=!0){this.r=e,this.g=i,this.b=n,this.a=s,l||(this.r*=s,this.g*=s,this.b*=s,s||this.overwriteGetter("rgb",[e,i,n,s]))}static parse(e){if(e instanceof He)return e;if(typeof e!="string")return;const i=(function(n){if((n=n.toLowerCase().trim())==="transparent")return[0,0,0,0];const s=Rn(kn,n);if(s){const[u,p,g]=s;return[u/255,p/255,g/255,1]}if(n.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(n)){const u=n.length<6?1:2;let p=1;return[Is(n.slice(p,p+=u)),Is(n.slice(p,p+=u)),Is(n.slice(p,p+=u)),Is(n.slice(p,p+u)||"ff")]}if(n.startsWith("rgb")){const u=n.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[p,g,m,v,_,T,b,M,I,A,D,L]=u,R=[v||" ",b||" ",A].join("");if(R==="  "||R==="  /"||R===",,"||R===",,,"){const F=[m,T,I].join(""),O=F==="%%%"?100:F===""?255:0;if(O){const V=[Xa(+g/O,0,1),Xa(+_/O,0,1),Xa(+M/O,0,1),D?xc(+D,L):1];if(Ko(V))return V}}return}}const l=n.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(l){const[u,p,g,m,v,_,T,b,M]=l,I=[g||" ",v||" ",T].join("");if(I==="  "||I==="  /"||I===",,"||I===",,,"){const A=[+p,Xa(+m,0,100),Xa(+_,0,100),b?xc(+b,M):1];if(Ko(A))return(function([D,L,R,F]){function O(V){const Y=(V+D/30)%12,J=L*Math.min(R,1-R);return R-J*Math.max(-1,Math.min(Y-3,9-Y,1))}return D=yc(D),L/=100,R/=100,[O(0),O(8),O(4),F]})(A)}}})(e);return i?new He(...i,!1):void 0}get rgb(){const{r:e,g:i,b:n,a:s}=this,l=s||1/0;return this.overwriteGetter("rgb",[e/l,i/l,n/l,s])}get hcl(){return this.overwriteGetter("hcl",(function(e){const[i,n,s,l]=vc(e),u=Math.sqrt(n*n+s*s);return[Math.round(1e4*u)?yc(Math.atan2(s,n)*_c):NaN,u,i,l]})(this.rgb))}get lab(){return this.overwriteGetter("lab",vc(this.rgb))}overwriteGetter(e,i){return Object.defineProperty(this,e,{value:i}),i}toString(){const[e,i,n,s]=this.rgb;return`rgba(${[e,i,n].map((l=>Math.round(255*l))).join(",")},${s})`}static interpolate(e,i,n,s="rgb"){switch(s){case"rgb":{const[l,u,p,g]=Ya(e.rgb,i.rgb,n);return new He(l,u,p,g,!1)}case"hcl":{const[l,u,p,g]=e.hcl,[m,v,_,T]=i.hcl;let b,M;if(isNaN(l)||isNaN(m))isNaN(l)?isNaN(m)?b=NaN:(b=m,p!==1&&p!==0||(M=v)):(b=l,_!==1&&_!==0||(M=u));else{let R=m-l;m>l&&R>180?R-=360:m<l&&l-m>180&&(R+=360),b=l+n*R}const[I,A,D,L]=(function([R,F,O,V]){return R=isNaN(R)?0:R*zn,Ho([O,Math.cos(R)*F,Math.sin(R)*F,V])})([b,M??Jr(u,v,n),Jr(p,_,n),Jr(g,T,n)]);return new He(I,A,D,L,!1)}case"lab":{const[l,u,p,g]=Ho(Ya(e.lab,i.lab,n));return new He(l,u,p,g,!1)}}}}He.black=new He(0,0,0,1),He.white=new He(1,1,1,1),He.transparent=new He(0,0,0,0),He.red=new He(1,0,0,1);class Jo{constructor(e,i,n){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Wu=["bottom","center","top"];class Qo{constructor(e,i,n,s,l,u){this.text=e,this.image=i,this.scale=n,this.fontStack=s,this.textColor=l,this.verticalAlign=u}}class Ni{constructor(e){this.sections=e}static fromString(e){return new Ni([new Qo(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((e=>e.text.length!==0||e.image&&e.image.name.length!==0))}static factory(e){return e instanceof Ni?e:Ni.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class gi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof gi)return e;if(typeof e=="number")return new gi([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const i of e)if(typeof i!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new gi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,n){return new gi(Ya(e.values,i.values,n))}}class It{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof It)return e;if(typeof e=="number")return new It([e]);if(Array.isArray(e)){for(const i of e)if(typeof i!="number")return;return new It(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,n){return new It(Ya(e.values,i.values,n))}}class Ne{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ne)return e;if(typeof e=="string"){const n=He.parse(e);return n?new Ne([n]):void 0}if(!Array.isArray(e))return;const i=[];for(const n of e){if(typeof n!="string")return;const s=He.parse(n);if(!s)return;i.push(s)}return new Ne(i)}toString(){return JSON.stringify(this.values)}static interpolate(e,i,n,s="rgb"){const l=[];if(e.values.length!=i.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let u=0;u<e.values.length;u++)l.push(He.interpolate(e.values[u],i.values[u],n,s));return new Ne(l)}}class _t extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const Qr=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ci{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ci)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let i=0;i<e.length;i+=2){const n=e[i],s=e[i+1];if(typeof n!="string"||!Qr.has(n)||!Array.isArray(s)||s.length!==2||typeof s[0]!="number"||typeof s[1]!="number")return}return new Ci(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,n){const s=e.values,l=i.values;if(s.length!==l.length)throw new _t(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${i.toString()}`);const u=[];for(let p=0;p<s.length;p+=2){if(s[p]!==l[p])throw new _t(`Cannot interpolate values containing mismatched anchors. from[${p}]: ${s[p]}, to[${p}]: ${l[p]}`);u.push(s[p]);const[g,m]=s[p+1],[v,_]=l[p+1];u.push([Jr(g,v,n),Jr(m,_,n)])}return new Ci(u)}}class qi{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new qi({name:e,available:!1}):null}}class Ai{constructor(e,i,n){this.from=e,this.to=i,this.transition=n}static interpolate(e,i,n){return new Ai(e,i,n)}static parse(e){return e instanceof Ai?e:Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"?new Ai(e[0],e[1],e[2]):typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number"?new Ai(e.from,e.to,e.transition):typeof e=="string"?new Ai(e,e,1):void 0}}function Ka(r,e,i,n){return typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?n===void 0||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[r,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[r,e,i,n]:[r,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ea(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Ai||r instanceof He||r instanceof Jo||r instanceof Ni||r instanceof gi||r instanceof It||r instanceof Ne||r instanceof Ci||r instanceof qi)return!0;if(Array.isArray(r)){for(const e of r)if(!ea(e))return!1;return!0}if(typeof r=="object"){for(const e in r)if(!ea(r[e]))return!1;return!0}return!1}function Nt(r){if(r===null)return Kr;if(typeof r=="string")return Ze;if(typeof r=="boolean")return Ye;if(typeof r=="number")return Pe;if(r instanceof He)return $i;if(r instanceof Ai)return ws;if(r instanceof Jo)return In;if(r instanceof Ni)return En;if(r instanceof gi)return Ts;if(r instanceof It)return Cn;if(r instanceof Ne)return qa;if(r instanceof Ci)return An;if(r instanceof qi)return Wa;if(Array.isArray(r)){const e=r.length;let i;for(const n of r){const s=Nt(n);if(i){if(i===s)continue;i=$e;break}i=s}return di(i||$e,e)}return kr}function va(r){const e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof He||r instanceof Ai||r instanceof Ni||r instanceof gi||r instanceof It||r instanceof Ne||r instanceof Ci||r instanceof qi?r.toString():JSON.stringify(r)}class Sr{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ea(e[1]))return i.error("invalid value");const n=e[1];let s=Nt(n);const l=i.expectedType;return s.kind!=="array"||s.N!==0||!l||l.kind!=="array"||typeof l.N=="number"&&l.N!==0||(s=l),new Sr(s,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Es={string:Ze,number:Pe,boolean:Ye,object:kr};class Vi{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let n,s=1;const l=e[0];if(l==="array"){let p,g;if(e.length>2){const m=e[1];if(typeof m!="string"||!(m in Es)||m==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);p=Es[m],s++}else p=$e;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);g=e[2],s++}n=di(p,g)}else{if(!Es[l])throw new Error(`Types doesn't contain name = ${l}`);n=Es[l]}const u=[];for(;s<e.length;s++){const p=i.parse(e[s],s,$e);if(!p)return null;u.push(p)}return new Vi(n,u)}evaluate(e){for(let i=0;i<this.args.length;i++){const n=this.args[i].evaluate(e);if(!Ha(this.type,Nt(n)))return n;if(i===this.args.length-1)throw new _t(`Expected value to be of type ${ut(this.type)}, but found ${ut(Nt(n))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const xa={"to-boolean":Ye,"to-color":$i,"to-number":Pe,"to-string":Ze};class Lr{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[0];if(!xa[n])throw new Error(`Can't parse ${n} as it is not part of the known types`);if((n==="to-boolean"||n==="to-string")&&e.length!==2)return i.error("Expected one argument.");const s=xa[n],l=[];for(let u=1;u<e.length;u++){const p=i.parse(e[u],u,$e);if(!p)return null;l.push(p)}return new Lr(s,l)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let i,n;for(const s of this.args){if(i=s.evaluate(e),n=null,i instanceof He)return i;if(typeof i=="string"){const l=e.parseColor(i);if(l)return l}else if(Array.isArray(i)&&(n=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Ka(i[0],i[1],i[2],i[3]),!n))return new He(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new _t(n||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(const n of this.args){i=n.evaluate(e);const s=gi.parse(i);if(s)return s}throw new _t(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"numberArray":{let i;for(const n of this.args){i=n.evaluate(e);const s=It.parse(i);if(s)return s}throw new _t(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"colorArray":{let i;for(const n of this.args){i=n.evaluate(e);const s=Ne.parse(i);if(s)return s}throw new _t(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(const n of this.args){i=n.evaluate(e);const s=Ci.parse(i);if(s)return s}throw new _t(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(const n of this.args){if(i=n.evaluate(e),i===null)return 0;const s=Number(i);if(!isNaN(s))return s}throw new _t(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return Ni.fromString(va(this.args[0].evaluate(e)));case"resolvedImage":return qi.fromString(va(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return va(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const bc=["Unknown","Point","LineString","Polygon"];class el{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?bc[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let i=this._parseColorCache.get(e);return i||(i=He.parse(e),this._parseColorCache.set(e,i)),i}}class ba{constructor(e,i,n=[],s,l=new qo,u=[]){this.registry=e,this.path=n,this.key=n.map((p=>`[${p}]`)).join(""),this.scope=l,this.errors=u,this.expectedType=s,this._isConstant=i}parse(e,i,n,s,l={}){return i?this.concat(i,n,s)._parse(e,l):this._parse(e,l)}_parse(e,i){function n(s,l,u){return u==="assert"?new Vi(l,[s]):u==="coerce"?new Lr(l,[s]):s}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const s=e[0];if(typeof s!="string")return this.error(`Expression name must be a string, but found ${typeof s} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const l=this.registry[s];if(l){let u=l.parse(e,this);if(!u)return null;if(this.expectedType){const p=this.expectedType,g=u.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||g.kind!=="value"){if(p.kind==="projectionDefinition"&&["string","array"].includes(g.kind)||["color","formatted","resolvedImage"].includes(p.kind)&&["value","string"].includes(g.kind)||["padding","numberArray"].includes(p.kind)&&["value","number","array"].includes(g.kind)||p.kind==="colorArray"&&["value","string","array"].includes(g.kind)||p.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(g.kind))u=n(u,p,i.typeAnnotation||"coerce");else if(this.checkSubtype(p,g))return null}else u=n(u,p,i.typeAnnotation||"assert")}if(!(u instanceof Sr)&&u.type.kind!=="resolvedImage"&&this._isConstant(u)){const p=new el;try{u=new Sr(u.type,u.evaluate(p))}catch(g){return this.error(g.message),null}}return u}return this.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,n){const s=typeof e=="number"?this.path.concat(e):this.path,l=n?this.scope.concat(n):this.scope;return new ba(this.registry,this._isConstant,s,i||null,l,this.errors)}error(e,...i){const n=`${this.key}${i.map((s=>`[${s}]`)).join("")}`;this.errors.push(new hi(n,e))}checkSubtype(e,i){const n=Ha(e,i);return n&&this.error(n),n}}class yt{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let l=1;l<e.length-1;l+=2){const u=e[l];if(typeof u!="string")return i.error(`Expected string, but found ${typeof u} instead.`,l);if(/[^a-zA-Z0-9_]/.test(u))return i.error("Variable names must contain only alphanumeric characters or '_'.",l);const p=i.parse(e[l+1],l+1);if(!p)return null;n.push([u,p])}const s=i.parse(e[e.length-1],e.length-1,i.expectedType,n);return s?new yt(n,s):null}outputDefined(){return this.result.outputDefined()}}class Ja{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const n=e[1];return i.scope.has(n)?new Ja(n,i.scope.get(n)):i.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class tt{constructor(e,i,n){this.type=e,this.index=i,this.input=n}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,Pe),s=i.parse(e[2],2,di(i.expectedType||$e));return n&&s?new tt(s.type.itemType,n,s):null}evaluate(e){const i=this.index.evaluate(e),n=this.input.evaluate(e);if(i<0)throw new _t(`Array index out of bounds: ${i} < 0.`);if(i>=n.length)throw new _t(`Array index out of bounds: ${i} > ${n.length-1}.`);if(i!==Math.floor(i))throw new _t(`Array index must be an integer, but found ${i} instead.`);return n[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class qe{constructor(e,i){this.type=Ye,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,$e),s=i.parse(e[2],2,$e);return n&&s?Dn(n.type,[Ye,Ze,Pe,Kr,$e])?new qe(n,s):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${ut(n.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!_a(i,["boolean","string","number","null"]))throw new _t(`Expected first argument to be of type boolean, string, number or null, but found ${ut(Nt(i))} instead.`);if(!_a(n,["string","array"]))throw new _t(`Expected second argument to be of type array or string, but found ${ut(Nt(n))} instead.`);return n.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Qa{constructor(e,i,n){this.type=Pe,this.needle=e,this.haystack=i,this.fromIndex=n}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,$e),s=i.parse(e[2],2,$e);if(!n||!s)return null;if(!Dn(n.type,[Ye,Ze,Pe,Kr,$e]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${ut(n.type)} instead`);if(e.length===4){const l=i.parse(e[3],3,Pe);return l?new Qa(n,s,l):null}return new Qa(n,s)}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!_a(i,["boolean","string","number","null"]))throw new _t(`Expected first argument to be of type boolean, string, number or null, but found ${ut(Nt(i))} instead.`);let s;if(this.fromIndex&&(s=this.fromIndex.evaluate(e)),_a(n,["string"])){const l=n.indexOf(i,s);return l===-1?-1:[...n.slice(0,l)].length}if(_a(n,["array"]))return n.indexOf(i,s);throw new _t(`Expected second argument to be of type array or string, but found ${ut(Nt(n))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class it{constructor(e,i,n,s,l,u){this.inputType=e,this.type=i,this.input=n,this.cases=s,this.outputs=l,this.otherwise=u}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let n,s;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);const l={},u=[];for(let m=2;m<e.length-1;m+=2){let v=e[m];const _=e[m+1];Array.isArray(v)||(v=[v]);const T=i.concat(m);if(v.length===0)return T.error("Expected at least one branch label.");for(const M of v){if(typeof M!="number"&&typeof M!="string")return T.error("Branch labels must be numbers or strings.");if(typeof M=="number"&&Math.abs(M)>Number.MAX_SAFE_INTEGER)return T.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof M=="number"&&Math.floor(M)!==M)return T.error("Numeric branch labels must be integer values.");if(n){if(T.checkSubtype(n,Nt(M)))return null}else n=Nt(M);if(l[String(M)]!==void 0)return T.error("Branch labels must be unique.");l[String(M)]=u.length}const b=i.parse(_,m,s);if(!b)return null;s=s||b.type,u.push(b)}const p=i.parse(e[1],1,$e);if(!p)return null;const g=i.parse(e[e.length-1],e.length-1,s);return g?p.type.kind!=="value"&&i.concat(1).checkSubtype(n,p.type)?null:new it(n,s,p,l,u,g):null}evaluate(e){const i=this.input.evaluate(e);return(Nt(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class mr{constructor(e,i,n){this.type=e,this.branches=i,this.otherwise=n}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let n;i.expectedType&&i.expectedType.kind!=="value"&&(n=i.expectedType);const s=[];for(let u=1;u<e.length-1;u+=2){const p=i.parse(e[u],u,Ye);if(!p)return null;const g=i.parse(e[u+1],u+1,n);if(!g)return null;s.push([p,g]),n=n||g.type}const l=i.parse(e[e.length-1],e.length-1,n);if(!l)return null;if(!n)throw new Error("Can't infer output type");return new mr(n,s,l)}evaluate(e){for(const[i,n]of this.branches)if(i.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[i,n]of this.branches)e(i),e(n);e(this.otherwise)}outputDefined(){return this.branches.every((([e,i])=>i.outputDefined()))&&this.otherwise.outputDefined()}}class en{constructor(e,i,n,s){this.type=e,this.input=i,this.beginIndex=n,this.endIndex=s}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,$e),s=i.parse(e[2],2,Pe);if(!n||!s)return null;if(!Dn(n.type,[di($e),Ze,$e]))return i.error(`Expected first argument to be of type array or string, but found ${ut(n.type)} instead`);if(e.length===4){const l=i.parse(e[3],3,Pe);return l?new en(n.type,n,s,l):null}return new en(n.type,n,s)}evaluate(e){const i=this.input.evaluate(e),n=this.beginIndex.evaluate(e);let s;if(this.endIndex&&(s=this.endIndex.evaluate(e)),_a(i,["string"]))return[...i].slice(n,s).join("");if(_a(i,["array"]))return i.slice(n,s);throw new _t(`Expected first argument to be of type array or string, but found ${ut(Nt(i))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function wa(r,e){const i=r.length-1;let n,s,l=0,u=i,p=0;for(;l<=u;)if(p=Math.floor((l+u)/2),n=r[p],s=r[p+1],n<=e){if(p===i||e<s)return p;l=p+1}else{if(!(n>e))throw new _t("Input is not a number.");u=p-1}return 0}class tn{constructor(e,i,n){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[s,l]of n)this.labels.push(s),this.outputs.push(l)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const n=i.parse(e[1],1,Pe);if(!n)return null;const s=[];let l=null;i.expectedType&&i.expectedType.kind!=="value"&&(l=i.expectedType);for(let u=1;u<e.length;u+=2){const p=u===1?-1/0:e[u],g=e[u+1],m=u,v=u+1;if(typeof p!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',m);if(s.length&&s[s.length-1][0]>=p)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',m);const _=i.parse(g,v,l);if(!_)return null;l=l||_.type,s.push([p,_])}return new tn(l,n,s)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const l=i.length;return s>=i[l-1]?n[l-1].evaluate(e):n[wa(i,s)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function tl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Cs,wc,Tc=(function(){if(wc)return Cs;function r(e,i,n,s){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(s-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=n,this.p2y=s}return wc=1,Cs=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,s=0;s<8;s++){var l=this.sampleCurveX(n)-e;if(Math.abs(l)<i)return n;var u=this.sampleCurveDerivativeX(n);if(Math.abs(u)<1e-6)break;n-=l/u}var p=0,g=1;for(n=e,s=0;s<20&&(l=this.sampleCurveX(n),!(Math.abs(l-e)<i));s++)e>l?p=n:g=n,n=.5*(g-p)+p;return n},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Cs})(),Sc=tl(Tc);class Gt{constructor(e,i,n,s,l){this.type=e,this.operator=i,this.interpolation=n,this.input=s,this.labels=[],this.outputs=[];for(const[u,p]of l)this.labels.push(u),this.outputs.push(p)}static interpolationFactor(e,i,n,s){let l=0;if(e.name==="exponential")l=ri(i,e.base,n,s);else if(e.name==="linear")l=ri(i,1,n,s);else if(e.name==="cubic-bezier"){const u=e.controlPoints;l=new Sc(u[0],u[1],u[2],u[3]).solve(ri(i,1,n,s))}return l}static parse(e,i){let[n,s,l,...u]=e;if(!Array.isArray(s)||s.length===0)return i.error("Expected an interpolation type expression.",1);if(s[0]==="linear")s={name:"linear"};else if(s[0]==="exponential"){const m=s[1];if(typeof m!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);s={name:"exponential",base:m}}else{if(s[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(s[0])}`,1,0);{const m=s.slice(1);if(m.length!==4||m.some((v=>typeof v!="number"||v<0||v>1)))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:m}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(l=i.parse(l,2,Pe),!l)return null;const p=[];let g=null;n!=="interpolate-hcl"&&n!=="interpolate-lab"||i.expectedType==qa?i.expectedType&&i.expectedType.kind!=="value"&&(g=i.expectedType):g=$i;for(let m=0;m<u.length;m+=2){const v=u[m],_=u[m+1],T=m+3,b=m+4;if(typeof v!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',T);if(p.length&&p[p.length-1][0]>=v)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',T);const M=i.parse(_,b,g);if(!M)return null;g=g||M.type,p.push([v,M])}return fr(g,Pe)||fr(g,ws)||fr(g,$i)||fr(g,Ts)||fr(g,Cn)||fr(g,qa)||fr(g,An)||fr(g,di(Pe))?new Gt(g,n,s,l,p):i.error(`Type ${ut(g)} is not interpolatable.`)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const l=i.length;if(s>=i[l-1])return n[l-1].evaluate(e);const u=wa(i,s),p=Gt.interpolationFactor(this.interpolation,s,i[u],i[u+1]),g=n[u].evaluate(e),m=n[u+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Jr(g,m,p);case"color":return He.interpolate(g,m,p);case"padding":return gi.interpolate(g,m,p);case"colorArray":return Ne.interpolate(g,m,p);case"numberArray":return It.interpolate(g,m,p);case"variableAnchorOffsetCollection":return Ci.interpolate(g,m,p);case"array":return Ya(g,m,p);case"projectionDefinition":return Ai.interpolate(g,m,p)}case"interpolate-hcl":switch(this.type.kind){case"color":return He.interpolate(g,m,p,"hcl");case"colorArray":return Ne.interpolate(g,m,p,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return He.interpolate(g,m,p,"lab");case"colorArray":return Ne.interpolate(g,m,p,"lab")}}}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function ri(r,e,i,n){const s=n-i,l=r-i;return s===0?0:e===1?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1)}const Wi={color:He.interpolate,number:Jr,padding:gi.interpolate,numberArray:It.interpolate,colorArray:Ne.interpolate,variableAnchorOffsetCollection:Ci.interpolate,array:Ya};class Ln{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let n=null;const s=i.expectedType;s&&s.kind!=="value"&&(n=s);const l=[];for(const p of e.slice(1)){const g=i.parse(p,1+l.length,n,void 0,{typeAnnotation:"omit"});if(!g)return null;n=n||g.type,l.push(g)}if(!n)throw new Error("No output type");const u=s&&l.some((p=>Ha(s,p.type)));return new Ln(u?$e:n,l)}evaluate(e){let i,n=null,s=0;for(const l of this.args)if(s++,n=l.evaluate(e),n&&n instanceof qi&&!n.available&&(i||(i=n.name),n=null,s===this.args.length&&(n=i)),n!==null)break;return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function Fn(r,e){return r==="=="||r==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function ei(r,e,i,n){return n.compare(e,i)===0}function Ta(r,e,i){const n=r!=="=="&&r!=="!=";return class bm{constructor(l,u,p){this.type=Ye,this.lhs=l,this.rhs=u,this.collator=p,this.hasUntypedArgument=l.type.kind==="value"||u.type.kind==="value"}static parse(l,u){if(l.length!==3&&l.length!==4)return u.error("Expected two or three arguments.");const p=l[0];let g=u.parse(l[1],1,$e);if(!g)return null;if(!Fn(p,g.type))return u.concat(1).error(`"${p}" comparisons are not supported for type '${ut(g.type)}'.`);let m=u.parse(l[2],2,$e);if(!m)return null;if(!Fn(p,m.type))return u.concat(2).error(`"${p}" comparisons are not supported for type '${ut(m.type)}'.`);if(g.type.kind!==m.type.kind&&g.type.kind!=="value"&&m.type.kind!=="value")return u.error(`Cannot compare types '${ut(g.type)}' and '${ut(m.type)}'.`);n&&(g.type.kind==="value"&&m.type.kind!=="value"?g=new Vi(m.type,[g]):g.type.kind!=="value"&&m.type.kind==="value"&&(m=new Vi(g.type,[m])));let v=null;if(l.length===4){if(g.type.kind!=="string"&&m.type.kind!=="string"&&g.type.kind!=="value"&&m.type.kind!=="value")return u.error("Cannot use collator to compare non-string types.");if(v=u.parse(l[3],3,In),!v)return null}return new bm(g,m,v)}evaluate(l){const u=this.lhs.evaluate(l),p=this.rhs.evaluate(l);if(n&&this.hasUntypedArgument){const g=Nt(u),m=Nt(p);if(g.kind!==m.kind||g.kind!=="string"&&g.kind!=="number")throw new _t(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${g.kind}, ${m.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const g=Nt(u),m=Nt(p);if(g.kind!=="string"||m.kind!=="string")return e(l,u,p)}return this.collator?i(l,u,p,this.collator.evaluate(l)):e(l,u,p)}eachChild(l){l(this.lhs),l(this.rhs),this.collator&&l(this.collator)}outputDefined(){return!0}}}const il=Ta("==",(function(r,e,i){return e===i}),ei),Pc=Ta("!=",(function(r,e,i){return e!==i}),(function(r,e,i,n){return!ei(0,e,i,n)})),Hu=Ta("<",(function(r,e,i){return e<i}),(function(r,e,i,n){return n.compare(e,i)<0})),rn=Ta(">",(function(r,e,i){return e>i}),(function(r,e,i,n){return n.compare(e,i)>0})),As=Ta("<=",(function(r,e,i){return e<=i}),(function(r,e,i,n){return n.compare(e,i)<=0})),rl=Ta(">=",(function(r,e,i){return e>=i}),(function(r,e,i,n){return n.compare(e,i)>=0}));class Ds{constructor(e,i,n){this.type=In,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");const n=e[1];if(typeof n!="object"||Array.isArray(n))return i.error("Collator options argument must be an object.");const s=i.parse(n["case-sensitive"]!==void 0&&n["case-sensitive"],1,Ye);if(!s)return null;const l=i.parse(n["diacritic-sensitive"]!==void 0&&n["diacritic-sensitive"],1,Ye);if(!l)return null;let u=null;return n.locale&&(u=i.parse(n.locale,1,Ze),!u)?null:new Ds(s,l,u)}evaluate(e){return new Jo(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class zs{constructor(e,i,n,s,l,u){this.type=Ze,this.number=e,this.locale=i,this.currency=n,this.unit=s,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const n=i.parse(e[1],1,Pe);if(!n)return null;const s=e[2];if(typeof s!="object"||Array.isArray(s))return i.error("NumberFormat options argument must be an object.");let l=null;if(s.locale&&(l=i.parse(s.locale,1,Ze),!l))return null;let u=null;if(s.currency&&(u=i.parse(s.currency,1,Ze),!u))return null;let p=null;if(s.unit&&(p=i.parse(s.unit,1,Ze),!p))return null;if(u&&p)return i.error("NumberFormat options `currency` and `unit` are mutually exclusive");let g=null;if(s["min-fraction-digits"]&&(g=i.parse(s["min-fraction-digits"],1,Pe),!g))return null;let m=null;return s["max-fraction-digits"]&&(m=i.parse(s["max-fraction-digits"],1,Pe),!m)?null:new zs(n,l,u,p,g,m)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Sa{constructor(e){this.type=En,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&typeof n=="object")return i.error("First argument must be an image or text section.");const s=[];let l=!1;for(let u=1;u<=e.length-1;++u){const p=e[u];if(l&&typeof p=="object"&&!Array.isArray(p)){l=!1;let g=null;if(p["font-scale"]&&(g=i.parse(p["font-scale"],1,Pe),!g))return null;let m=null;if(p["text-font"]&&(m=i.parse(p["text-font"],1,di(Ze)),!m))return null;let v=null;if(p["text-color"]&&(v=i.parse(p["text-color"],1,$i),!v))return null;let _=null;if(p["vertical-align"]){if(typeof p["vertical-align"]=="string"&&!Wu.includes(p["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${p["vertical-align"]}' instead.`);if(_=i.parse(p["vertical-align"],1,Ze),!_)return null}const T=s[s.length-1];T.scale=g,T.font=m,T.textColor=v,T.verticalAlign=_}else{const g=i.parse(e[u],1,$e);if(!g)return null;const m=g.type.kind;if(m!=="string"&&m!=="value"&&m!=="null"&&m!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");l=!0,s.push({content:g,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Sa(s)}evaluate(e){return new Ni(this.sections.map((i=>{const n=i.content.evaluate(e);return Nt(n)===Wa?new Qo("",n,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new Qo(va(n),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)})))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor),i.verticalAlign&&e(i.verticalAlign)}outputDefined(){return!1}}class an{constructor(e){this.type=Wa,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");const n=i.parse(e[1],1,Ze);return n?new an(n):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),n=qi.fromString(i);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(i)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}}class Hi{constructor(e){this.type=Pe,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=i.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${ut(n.type)} instead.`):new Hi(n):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new _t(`Expected value to be of type string or array, but found ${ut(Nt(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const gr=8192;function Rs(r,e){const i=(180+r[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,s=Math.pow(2,e.z);return[Math.round(i*s*gr),Math.round(n*s*gr)]}function al(r,e){const i=Math.pow(2,e.z);return[(s=(r[0]/gr+e.x)/i,360*s-180),(n=(r[1]/gr+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,s}function Pa(r,e){r[0]=Math.min(r[0],e[0]),r[1]=Math.min(r[1],e[1]),r[2]=Math.max(r[2],e[0]),r[3]=Math.max(r[3],e[1])}function Bn(r,e){return!(r[0]<=e[0]||r[2]>=e[2]||r[1]<=e[1]||r[3]>=e[3])}function Xu(r,e,i){const n=r[0]-e[0],s=r[1]-e[1],l=r[0]-i[0],u=r[1]-i[1];return n*u-l*s==0&&n*l<=0&&s*u<=0}function ks(r,e,i,n){return(s=[n[0]-i[0],n[1]-i[1]])[0]*(l=[e[0]-r[0],e[1]-r[1]])[1]-s[1]*l[0]!=0&&!(!Ic(r,e,i,n)||!Ic(i,n,r,e));var s,l}function Yu(r,e,i){for(const n of i)for(let s=0;s<n.length-1;++s)if(ks(r,e,n[s],n[s+1]))return!0;return!1}function Fr(r,e,i=!1){let n=!1;for(const p of e)for(let g=0;g<p.length-1;g++){if(Xu(r,p[g],p[g+1]))return i;(l=p[g])[1]>(s=r)[1]!=(u=p[g+1])[1]>s[1]&&s[0]<(u[0]-l[0])*(s[1]-l[1])/(u[1]-l[1])+l[0]&&(n=!n)}var s,l,u;return n}function Ku(r,e){for(const i of e)if(Fr(r,i))return!0;return!1}function nl(r,e){for(const i of r)if(!Fr(i,e))return!1;for(let i=0;i<r.length-1;++i)if(Yu(r[i],r[i+1],e))return!1;return!0}function Mc(r,e){for(const i of e)if(nl(r,i))return!0;return!1}function Ic(r,e,i,n){const s=n[0]-i[0],l=n[1]-i[1],u=(r[0]-i[0])*l-s*(r[1]-i[1]),p=(e[0]-i[0])*l-s*(e[1]-i[1]);return u>0&&p<0||u<0&&p>0}function Ls(r,e,i){const n=[];for(let s=0;s<r.length;s++){const l=[];for(let u=0;u<r[s].length;u++){const p=Rs(r[s][u],i);Pa(e,p),l.push(p)}n.push(l)}return n}function Ec(r,e,i){const n=[];for(let s=0;s<r.length;s++){const l=Ls(r[s],e,i);n.push(l)}return n}function Cc(r,e,i,n){if(r[0]<i[0]||r[0]>i[2]){const s=.5*n;let l=r[0]-i[0]>s?-n:i[0]-r[0]>s?n:0;l===0&&(l=r[0]-i[2]>s?-n:i[2]-r[0]>s?n:0),r[0]+=l}Pa(e,r)}function Ac(r,e,i,n){const s=Math.pow(2,n.z)*gr,l=[n.x*gr,n.y*gr],u=[];for(const p of r)for(const g of p){const m=[g.x+l[0],g.y+l[1]];Cc(m,e,i,s),u.push(m)}return u}function Dc(r,e,i,n){const s=Math.pow(2,n.z)*gr,l=[n.x*gr,n.y*gr],u=[];for(const g of r){const m=[];for(const v of g){const _=[v.x+l[0],v.y+l[1]];Pa(e,_),m.push(_)}u.push(m)}if(e[2]-e[0]<=s/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(const g of u)for(const m of g)Cc(m,e,i,s)}var p;return u}class Ma{constructor(e,i){this.type=Ye,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ea(e[1])){const n=e[1];if(n.type==="FeatureCollection"){const s=[];for(const l of n.features){const{type:u,coordinates:p}=l.geometry;u==="Polygon"&&s.push(p),u==="MultiPolygon"&&s.push(...p)}if(s.length)return new Ma(n,{type:"MultiPolygon",coordinates:s})}else if(n.type==="Feature"){const s=n.geometry.type;if(s==="Polygon"||s==="MultiPolygon")return new Ma(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new Ma(n,n)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,n){const s=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(n.type==="Polygon"){const p=Ls(n.coordinates,l,u),g=Ac(i.geometry(),s,l,u);if(!Bn(s,l))return!1;for(const m of g)if(!Fr(m,p))return!1}if(n.type==="MultiPolygon"){const p=Ec(n.coordinates,l,u),g=Ac(i.geometry(),s,l,u);if(!Bn(s,l))return!1;for(const m of g)if(!Ku(m,p))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,n){const s=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(n.type==="Polygon"){const p=Ls(n.coordinates,l,u),g=Dc(i.geometry(),s,l,u);if(!Bn(s,l))return!1;for(const m of g)if(!nl(m,p))return!1}if(n.type==="MultiPolygon"){const p=Ec(n.coordinates,l,u),g=Dc(i.geometry(),s,l,u);if(!Bn(s,l))return!1;for(const m of g)if(!Mc(m,p))return!1}return!0})(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let sl=class{constructor(r=[],e=(i,n)=>i<n?-1:i>n?1:0){if(this.data=r,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;const r=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:e,compare:i}=this,n=e[r];for(;r>0;){const s=r-1>>1,l=e[s];if(i(n,l)>=0)break;e[r]=l,r=s}e[r]=n}_down(r){const{data:e,compare:i}=this,n=this.length>>1,s=e[r];for(;r<n;){let l=1+(r<<1);const u=l+1;if(u<this.length&&i(e[u],e[l])<0&&(l=u),i(e[l],s)>=0)break;e[r]=e[l],r=l}e[r]=s}};function ol(r,e,i=0,n=r.length-1,s=Ju){for(;n>i;){if(n-i>600){const g=n-i+1,m=e-i+1,v=Math.log(g),_=.5*Math.exp(2*v/3),T=.5*Math.sqrt(v*_*(g-_)/g)*(m-g/2<0?-1:1);ol(r,e,Math.max(i,Math.floor(e-m*_/g+T)),Math.min(n,Math.floor(e+(g-m)*_/g+T)),s)}const l=r[e];let u=i,p=n;for(nn(r,i,e),s(r[n],l)>0&&nn(r,i,n);u<p;){for(nn(r,u,p),u++,p--;s(r[u],l)<0;)u++;for(;s(r[p],l)>0;)p--}s(r[i],l)===0?nn(r,i,p):(p++,nn(r,p,n)),p<=e&&(i=p+1),e<=p&&(n=p-1)}}function nn(r,e,i){const n=r[e];r[e]=r[i],r[i]=n}function Ju(r,e){return r<e?-1:r>e?1:0}function Fs(r,e){if(r.length<=1)return[r];const i=[];let n,s;for(const l of r){const u=eh(l);u!==0&&(l.area=Math.abs(u),s===void 0&&(s=u<0),s===u<0?(n&&i.push(n),n=[l]):n.push(l))}if(n&&i.push(n),e>1)for(let l=0;l<i.length;l++)i[l].length<=e||(ol(i[l],e,1,i[l].length-1,Qu),i[l]=i[l].slice(0,e));return i}function Qu(r,e){return e.area-r.area}function eh(r){let e=0;for(let i,n,s=0,l=r.length,u=l-1;s<l;u=s++)i=r[s],n=r[u],e+=(n.x-i.x)*(i.y+n.y);return e}const On=1/298.257223563,zc=On*(2-On),Rc=Math.PI/180;class ll{constructor(e){const i=6378.137*Rc*1e3,n=Math.cos(e*Rc),s=1/(1-zc*(1-n*n)),l=Math.sqrt(s);this.kx=i*l*n,this.ky=i*l*s*(1-zc)}distance(e,i){const n=this.wrap(e[0]-i[0])*this.kx,s=(e[1]-i[1])*this.ky;return Math.sqrt(n*n+s*s)}pointOnLine(e,i){let n,s,l,u,p=1/0;for(let g=0;g<e.length-1;g++){let m=e[g][0],v=e[g][1],_=this.wrap(e[g+1][0]-m)*this.kx,T=(e[g+1][1]-v)*this.ky,b=0;_===0&&T===0||(b=(this.wrap(i[0]-m)*this.kx*_+(i[1]-v)*this.ky*T)/(_*_+T*T),b>1?(m=e[g+1][0],v=e[g+1][1]):b>0&&(m+=_/this.kx*b,v+=T/this.ky*b)),_=this.wrap(i[0]-m)*this.kx,T=(i[1]-v)*this.ky;const M=_*_+T*T;M<p&&(p=M,n=m,s=v,l=g,u=b)}return{point:[n,s],index:l,t:Math.max(0,Math.min(1,u))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function kc(r,e){return e[0]-r[0]}function sn(r){return r[1]-r[0]+1}function Pr(r,e){return r[1]>=r[0]&&r[1]<e}function cl(r,e){if(r[0]>r[1])return[null,null];const i=sn(r);if(e){if(i===2)return[r,null];const s=Math.floor(i/2);return[[r[0],r[0]+s],[r[0]+s,r[1]]]}if(i===1)return[r,null];const n=Math.floor(i/2)-1;return[[r[0],r[0]+n],[r[0]+n+1,r[1]]]}function ul(r,e){if(!Pr(e,r.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)Pa(i,r[n]);return i}function Bs(r){const e=[1/0,1/0,-1/0,-1/0];for(const i of r)for(const n of i)Pa(e,n);return e}function hl(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function dl(r,e,i){if(!hl(r)||!hl(e))return NaN;let n=0,s=0;return r[2]<e[0]&&(n=e[0]-r[2]),r[0]>e[2]&&(n=r[0]-e[2]),r[1]>e[3]&&(s=r[1]-e[3]),r[3]<e[1]&&(s=e[1]-r[3]),i.distance([0,0],[n,s])}function Ia(r,e,i){const n=i.pointOnLine(e,r);return i.distance(r,n.point)}function pl(r,e,i,n,s){const l=Math.min(Ia(r,[i,n],s),Ia(e,[i,n],s)),u=Math.min(Ia(i,[r,e],s),Ia(n,[r,e],s));return Math.min(l,u)}function Lc(r,e,i,n,s){if(!Pr(e,r.length)||!Pr(n,i.length))return 1/0;let l=1/0;for(let u=e[0];u<e[1];++u){const p=r[u],g=r[u+1];for(let m=n[0];m<n[1];++m){const v=i[m],_=i[m+1];if(ks(p,g,v,_))return 0;l=Math.min(l,pl(p,g,v,_,s))}}return l}function th(r,e,i,n,s){if(!Pr(e,r.length)||!Pr(n,i.length))return NaN;let l=1/0;for(let u=e[0];u<=e[1];++u)for(let p=n[0];p<=n[1];++p)if(l=Math.min(l,s.distance(r[u],i[p])),l===0)return l;return l}function ih(r,e,i){if(Fr(r,e,!0))return 0;let n=1/0;for(const s of e){const l=s[0],u=s[s.length-1];if(l!==u&&(n=Math.min(n,Ia(r,[u,l],i)),n===0))return n;const p=i.pointOnLine(s,r);if(n=Math.min(n,i.distance(r,p.point)),n===0)return n}return n}function rh(r,e,i,n){if(!Pr(e,r.length))return NaN;for(let l=e[0];l<=e[1];++l)if(Fr(r[l],i,!0))return 0;let s=1/0;for(let l=e[0];l<e[1];++l){const u=r[l],p=r[l+1];for(const g of i)for(let m=0,v=g.length,_=v-1;m<v;_=m++){const T=g[_],b=g[m];if(ks(u,p,T,b))return 0;s=Math.min(s,pl(u,p,T,b,n))}}return s}function Fc(r,e){for(const i of r)for(const n of i)if(Fr(n,e,!0))return!0;return!1}function st(r,e,i,n=1/0){const s=Bs(r),l=Bs(e);if(n!==1/0&&dl(s,l,i)>=n)return n;if(Bn(s,l)){if(Fc(r,e))return 0}else if(Fc(e,r))return 0;let u=1/0;for(const p of r)for(let g=0,m=p.length,v=m-1;g<m;v=g++){const _=p[v],T=p[g];for(const b of e)for(let M=0,I=b.length,A=I-1;M<I;A=M++){const D=b[A],L=b[M];if(ks(_,T,D,L))return 0;u=Math.min(u,pl(_,T,D,L,i))}}return u}function Bc(r,e,i,n,s,l){if(!l)return;const u=dl(ul(n,l),s,i);u<e&&r.push([u,l,[0,0]])}function Os(r,e,i,n,s,l,u){if(!l||!u)return;const p=dl(ul(n,l),ul(s,u),i);p<e&&r.push([p,l,u])}function Ns(r,e,i,n,s=1/0){let l=Math.min(n.distance(r[0],i[0][0]),s);if(l===0)return l;const u=new sl([[0,[0,r.length-1],[0,0]]],kc),p=Bs(i);for(;u.length>0;){const g=u.pop();if(g[0]>=l)continue;const m=g[1],v=e?50:100;if(sn(m)<=v){if(!Pr(m,r.length))return NaN;if(e){const _=rh(r,m,i,n);if(isNaN(_)||_===0)return _;l=Math.min(l,_)}else for(let _=m[0];_<=m[1];++_){const T=ih(r[_],i,n);if(l=Math.min(l,T),l===0)return 0}}else{const _=cl(m,e);Bc(u,l,n,r,p,_[0]),Bc(u,l,n,r,p,_[1])}}return l}function Vs(r,e,i,n,s,l=1/0){let u=Math.min(l,s.distance(r[0],i[0]));if(u===0)return u;const p=new sl([[0,[0,r.length-1],[0,i.length-1]]],kc);for(;p.length>0;){const g=p.pop();if(g[0]>=u)continue;const m=g[1],v=g[2],_=e?50:100,T=n?50:100;if(sn(m)<=_&&sn(v)<=T){if(!Pr(m,r.length)&&Pr(v,i.length))return NaN;let b;if(e&&n)b=Lc(r,m,i,v,s),u=Math.min(u,b);else if(e&&!n){const M=r.slice(m[0],m[1]+1);for(let I=v[0];I<=v[1];++I)if(b=Ia(i[I],M,s),u=Math.min(u,b),u===0)return u}else if(!e&&n){const M=i.slice(v[0],v[1]+1);for(let I=m[0];I<=m[1];++I)if(b=Ia(r[I],M,s),u=Math.min(u,b),u===0)return u}else b=th(r,m,i,v,s),u=Math.min(u,b)}else{const b=cl(m,e),M=cl(v,n);Os(p,u,s,r,i,b[0],M[0]),Os(p,u,s,r,i,b[0],M[1]),Os(p,u,s,r,i,b[1],M[0]),Os(p,u,s,r,i,b[1],M[1])}}return u}function fl(r){return r.type==="MultiPolygon"?r.coordinates.map((e=>({type:"Polygon",coordinates:e}))):r.type==="MultiLineString"?r.coordinates.map((e=>({type:"LineString",coordinates:e}))):r.type==="MultiPoint"?r.coordinates.map((e=>({type:"Point",coordinates:e}))):[r]}class Ea{constructor(e,i){this.type=Pe,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ea(e[1])){const n=e[1];if(n.type==="FeatureCollection")return new Ea(n,n.features.map((s=>fl(s.geometry))).flat());if(n.type==="Feature")return new Ea(n,fl(n.geometry));if("type"in n&&"coordinates"in n)return new Ea(n,fl(n))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,n){const s=i.geometry(),l=s.flat().map((g=>al([g.x,g.y],i.canonical)));if(s.length===0)return NaN;const u=new ll(l[0][1]);let p=1/0;for(const g of n){switch(g.type){case"Point":p=Math.min(p,Vs(l,!1,[g.coordinates],!1,u,p));break;case"LineString":p=Math.min(p,Vs(l,!1,g.coordinates,!0,u,p));break;case"Polygon":p=Math.min(p,Ns(l,!1,g.coordinates,u,p))}if(p===0)return p}return p})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,n){const s=i.geometry(),l=s.flat().map((g=>al([g.x,g.y],i.canonical)));if(s.length===0)return NaN;const u=new ll(l[0][1]);let p=1/0;for(const g of n){switch(g.type){case"Point":p=Math.min(p,Vs(l,!0,[g.coordinates],!1,u,p));break;case"LineString":p=Math.min(p,Vs(l,!0,g.coordinates,!0,u,p));break;case"Polygon":p=Math.min(p,Ns(l,!0,g.coordinates,u,p))}if(p===0)return p}return p})(e,this.geometries);if(e.geometryType()==="Polygon")return(function(i,n){const s=i.geometry();if(s.length===0||s[0].length===0)return NaN;const l=Fs(s,0).map((g=>g.map((m=>m.map((v=>al([v.x,v.y],i.canonical))))))),u=new ll(l[0][0][0][1]);let p=1/0;for(const g of n)for(const m of l){switch(g.type){case"Point":p=Math.min(p,Ns([g.coordinates],!1,m,u,p));break;case"LineString":p=Math.min(p,Ns(g.coordinates,!0,m,u,p));break;case"Polygon":p=Math.min(p,st(m,g.coordinates,u,p))}if(p===0)return p}return p})(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Nn{constructor(e){this.type=$e,this.key=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=e[1];return n==null?i.error("Global state property must be defined."):typeof n!="string"?i.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Nn(n)}evaluate(e){var i;const n=(i=e.globals)===null||i===void 0?void 0:i.globalState;return n&&Object.keys(n).length!==0?Rn(n,this.key):null}eachChild(){}outputDefined(){return!1}}const on={"==":il,"!=":Pc,">":rn,"<":Hu,">=":rl,"<=":As,array:Vi,at:tt,boolean:Vi,case:mr,coalesce:Ln,collator:Ds,format:Sa,image:an,in:qe,"index-of":Qa,interpolate:Gt,"interpolate-hcl":Gt,"interpolate-lab":Gt,length:Hi,let:yt,literal:Sr,match:it,number:Vi,"number-format":zs,object:Vi,slice:en,step:tn,string:Vi,"to-boolean":Lr,"to-color":Lr,"to-number":Lr,"to-string":Lr,var:Ja,within:Ma,distance:Ea,"global-state":Nn};class rr{constructor(e,i,n,s){this.name=e,this.type=i,this._evaluate=n,this.args=s}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,i){const n=e[0],s=rr.definitions[n];if(!s)return i.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const l=Array.isArray(s)?s[0]:s.type,u=Array.isArray(s)?[[s[1],s[2]]]:s.overloads,p=u.filter((([m])=>!Array.isArray(m)||m.length===e.length-1));let g=null;for(const[m,v]of p){g=new ba(i.registry,js,i.path,null,i.scope);const _=[];let T=!1;for(let b=1;b<e.length;b++){const M=e[b],I=Array.isArray(m)?m[b-1]:m.type,A=g.parse(M,1+_.length,I);if(!A){T=!0;break}_.push(A)}if(!T)if(Array.isArray(m)&&m.length!==_.length)g.error(`Expected ${m.length} arguments, but found ${_.length} instead.`);else{for(let b=0;b<_.length;b++){const M=Array.isArray(m)?m[b]:m.type,I=_[b];g.concat(b+1).checkSubtype(M,I.type)}if(g.errors.length===0)return new rr(n,l,v,_)}}if(p.length===1)i.errors.push(...g.errors);else{const m=(p.length?p:u).map((([_])=>{return T=_,Array.isArray(T)?`(${T.map(ut).join(", ")})`:`(${ut(T.type)}...)`;var T})).join(" | "),v=[];for(let _=1;_<e.length;_++){const T=i.parse(e[_],1+v.length);if(!T)return null;v.push(ut(T.type))}i.error(`Expected arguments of type ${m}, but found (${v.join(", ")}) instead.`)}return null}static register(e,i){rr.definitions=i;for(const n in i)e[n]=rr}}function Oc(r,[e,i,n,s]){e=e.evaluate(r),i=i.evaluate(r),n=n.evaluate(r);const l=s?s.evaluate(r):1,u=Ka(e,i,n,l);if(u)throw new _t(u);return new He(e/255,i/255,n/255,l,!1)}function Nc(r,e){return r in e}function ml(r,e){const i=e[r];return i===void 0?null:i}function Ca(r){return{type:r}}function js(r){if(r instanceof Ja)return js(r.boundExpression);if(r instanceof rr&&r.name==="error"||r instanceof Ds||r instanceof Ma||r instanceof Ea||r instanceof Nn)return!1;const e=r instanceof Lr||r instanceof Vi;let i=!0;return r.eachChild((n=>{i=e?i&&js(n):i&&n instanceof Sr})),!!i&&Us(r)&&Zs(r,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function Us(r){if(r instanceof rr&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof Ma||r instanceof Ea)return!1;let e=!0;return r.eachChild((i=>{e&&!Us(i)&&(e=!1)})),e}function Vn(r){if(r instanceof rr&&r.name==="feature-state")return!1;let e=!0;return r.eachChild((i=>{e&&!Vn(i)&&(e=!1)})),e}function Zs(r,e){if(r instanceof rr&&e.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild((n=>{i&&!Zs(n,e)&&(i=!1)})),i}function Vc(r){return{result:"success",value:r}}function ln(r){return{result:"error",value:r}}function cn(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function jc(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function gl(r){return!!r.expression&&r.expression.interpolated}function Ke(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Gs(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&Nt(r)===kr}function ah(r){return r}function Uc(r,e){const i=r.stops&&typeof r.stops[0][0]=="object",n=i||!(i||r.property!==void 0),s=r.type||(gl(e)?"exponential":"interval"),l=(function(v){switch(v.type){case"color":return He.parse;case"padding":return gi.parse;case"numberArray":return It.parse;case"colorArray":return Ne.parse;default:return null}})(e);if(l&&((r=ga({},r)).stops&&(r.stops=r.stops.map((v=>[v[0],l(v[1])]))),r.default=l(r.default?r.default:e.default)),r.colorSpace&&(u=r.colorSpace)!=="rgb"&&u!=="hcl"&&u!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var u;const p=(function(v){switch(v){case"exponential":return Zc;case"interval":return sh;case"categorical":return nh;case"identity":return oh;default:throw new Error(`Unknown function type "${v}"`)}})(s);let g,m;if(s==="categorical"){g=Object.create(null);for(const v of r.stops)g[v[0]]=v[1];m=typeof r.stops[0][0]}if(i){const v={},_=[];for(let M=0;M<r.stops.length;M++){const I=r.stops[M],A=I[0].zoom;v[A]===void 0&&(v[A]={zoom:A,type:r.type,property:r.property,default:r.default,stops:[]},_.push(A)),v[A].stops.push([I[0].value,I[1]])}const T=[];for(const M of _)T.push([v[M].zoom,Uc(v[M],e)]);const b={name:"linear"};return{kind:"composite",interpolationType:b,interpolationFactor:Gt.interpolationFactor.bind(void 0,b),zoomStops:T.map((M=>M[0])),evaluate:({zoom:M},I)=>Zc({stops:T,base:r.base},e,M).evaluate(M,I)}}if(n){const v=s==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:Gt.interpolationFactor.bind(void 0,v),zoomStops:r.stops.map((_=>_[0])),evaluate:({zoom:_})=>p(r,e,_,g,m)}}return{kind:"source",evaluate(v,_){const T=_&&_.properties?_.properties[r.property]:void 0;return T===void 0?jn(r.default,e.default):p(r,e,T,g,m)}}}function jn(r,e,i){return r!==void 0?r:e!==void 0?e:i!==void 0?i:void 0}function nh(r,e,i,n,s){return jn(typeof i===s?n[i]:void 0,r.default,e.default)}function sh(r,e,i){if(Ke(i)!=="number")return jn(r.default,e.default);const n=r.stops.length;if(n===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[n-1][0])return r.stops[n-1][1];const s=wa(r.stops.map((l=>l[0])),i);return r.stops[s][1]}function Zc(r,e,i){const n=r.base!==void 0?r.base:1;if(Ke(i)!=="number")return jn(r.default,e.default);const s=r.stops.length;if(s===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[s-1][0])return r.stops[s-1][1];const l=wa(r.stops.map((v=>v[0])),i),u=(function(v,_,T,b){const M=b-T,I=v-T;return M===0?0:_===1?I/M:(Math.pow(_,I)-1)/(Math.pow(_,M)-1)})(i,n,r.stops[l][0],r.stops[l+1][0]),p=r.stops[l][1],g=r.stops[l+1][1],m=Wi[e.type]||ah;return typeof p.evaluate=="function"?{evaluate(...v){const _=p.evaluate.apply(void 0,v),T=g.evaluate.apply(void 0,v);if(_!==void 0&&T!==void 0)return m(_,T,u,r.colorSpace)}}:m(p,g,u,r.colorSpace)}function oh(r,e,i){switch(e.type){case"color":i=He.parse(i);break;case"formatted":i=Ni.fromString(i.toString());break;case"resolvedImage":i=qi.fromString(i.toString());break;case"padding":i=gi.parse(i);break;case"colorArray":i=Ne.parse(i);break;case"numberArray":i=It.parse(i);break;default:Ke(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0)}return jn(i,r.default,e.default)}rr.register(on,{error:[{kind:"error"},[Ze],(r,[e])=>{throw new _t(e.evaluate(r))}],typeof:[Ze,[$e],(r,[e])=>ut(Nt(e.evaluate(r)))],"to-rgba":[di(Pe,4),[$i],(r,[e])=>{const[i,n,s,l]=e.evaluate(r).rgb;return[255*i,255*n,255*s,l]}],rgb:[$i,[Pe,Pe,Pe],Oc],rgba:[$i,[Pe,Pe,Pe,Pe],Oc],has:{type:Ye,overloads:[[[Ze],(r,[e])=>Nc(e.evaluate(r),r.properties())],[[Ze,kr],(r,[e,i])=>Nc(e.evaluate(r),i.evaluate(r))]]},get:{type:$e,overloads:[[[Ze],(r,[e])=>ml(e.evaluate(r),r.properties())],[[Ze,kr],(r,[e,i])=>ml(e.evaluate(r),i.evaluate(r))]]},"feature-state":[$e,[Ze],(r,[e])=>ml(e.evaluate(r),r.featureState||{})],properties:[kr,[],r=>r.properties()],"geometry-type":[Ze,[],r=>r.geometryType()],id:[$e,[],r=>r.id()],zoom:[Pe,[],r=>r.globals.zoom],"heatmap-density":[Pe,[],r=>r.globals.heatmapDensity||0],elevation:[Pe,[],r=>r.globals.elevation||0],"line-progress":[Pe,[],r=>r.globals.lineProgress||0],accumulated:[$e,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[Pe,Ca(Pe),(r,e)=>{let i=0;for(const n of e)i+=n.evaluate(r);return i}],"*":[Pe,Ca(Pe),(r,e)=>{let i=1;for(const n of e)i*=n.evaluate(r);return i}],"-":{type:Pe,overloads:[[[Pe,Pe],(r,[e,i])=>e.evaluate(r)-i.evaluate(r)],[[Pe],(r,[e])=>-e.evaluate(r)]]},"/":[Pe,[Pe,Pe],(r,[e,i])=>e.evaluate(r)/i.evaluate(r)],"%":[Pe,[Pe,Pe],(r,[e,i])=>e.evaluate(r)%i.evaluate(r)],ln2:[Pe,[],()=>Math.LN2],pi:[Pe,[],()=>Math.PI],e:[Pe,[],()=>Math.E],"^":[Pe,[Pe,Pe],(r,[e,i])=>Math.pow(e.evaluate(r),i.evaluate(r))],sqrt:[Pe,[Pe],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[Pe,[Pe],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[Pe,[Pe],(r,[e])=>Math.log(e.evaluate(r))],log2:[Pe,[Pe],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[Pe,[Pe],(r,[e])=>Math.sin(e.evaluate(r))],cos:[Pe,[Pe],(r,[e])=>Math.cos(e.evaluate(r))],tan:[Pe,[Pe],(r,[e])=>Math.tan(e.evaluate(r))],asin:[Pe,[Pe],(r,[e])=>Math.asin(e.evaluate(r))],acos:[Pe,[Pe],(r,[e])=>Math.acos(e.evaluate(r))],atan:[Pe,[Pe],(r,[e])=>Math.atan(e.evaluate(r))],min:[Pe,Ca(Pe),(r,e)=>Math.min(...e.map((i=>i.evaluate(r))))],max:[Pe,Ca(Pe),(r,e)=>Math.max(...e.map((i=>i.evaluate(r))))],abs:[Pe,[Pe],(r,[e])=>Math.abs(e.evaluate(r))],round:[Pe,[Pe],(r,[e])=>{const i=e.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[Pe,[Pe],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[Pe,[Pe],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[Ye,[Ze,$e],(r,[e,i])=>r.properties()[e.value]===i.value],"filter-id-==":[Ye,[$e],(r,[e])=>r.id()===e.value],"filter-type-==":[Ye,[Ze],(r,[e])=>r.geometryType()===e.value],"filter-<":[Ye,[Ze,$e],(r,[e,i])=>{const n=r.properties()[e.value],s=i.value;return typeof n==typeof s&&n<s}],"filter-id-<":[Ye,[$e],(r,[e])=>{const i=r.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[Ye,[Ze,$e],(r,[e,i])=>{const n=r.properties()[e.value],s=i.value;return typeof n==typeof s&&n>s}],"filter-id->":[Ye,[$e],(r,[e])=>{const i=r.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[Ye,[Ze,$e],(r,[e,i])=>{const n=r.properties()[e.value],s=i.value;return typeof n==typeof s&&n<=s}],"filter-id-<=":[Ye,[$e],(r,[e])=>{const i=r.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[Ye,[Ze,$e],(r,[e,i])=>{const n=r.properties()[e.value],s=i.value;return typeof n==typeof s&&n>=s}],"filter-id->=":[Ye,[$e],(r,[e])=>{const i=r.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[Ye,[$e],(r,[e])=>e.value in r.properties()],"filter-has-id":[Ye,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ye,[di(Ze)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ye,[di($e)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[Ye,[Ze,di($e)],(r,[e,i])=>i.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[Ye,[Ze,di($e)],(r,[e,i])=>(function(n,s,l,u){for(;l<=u;){const p=l+u>>1;if(s[p]===n)return!0;s[p]>n?u=p-1:l=p+1}return!1})(r.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Ye,overloads:[[[Ye,Ye],(r,[e,i])=>e.evaluate(r)&&i.evaluate(r)],[Ca(Ye),(r,e)=>{for(const i of e)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ye,overloads:[[[Ye,Ye],(r,[e,i])=>e.evaluate(r)||i.evaluate(r)],[Ca(Ye),(r,e)=>{for(const i of e)if(i.evaluate(r))return!0;return!1}]]},"!":[Ye,[Ye],(r,[e])=>!e.evaluate(r)],"is-supported-script":[Ye,[Ze],(r,[e])=>{const i=r.globals&&r.globals.isSupportedScript;return!i||i(e.evaluate(r))}],upcase:[Ze,[Ze],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[Ze,[Ze],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[Ze,Ca($e),(r,e)=>e.map((i=>va(i.evaluate(r)))).join("")],split:[di(Ze),[Ze,Ze],(r,[e,i])=>e.evaluate(r).split(i.evaluate(r))],join:[Ze,[di(Ze),Ze],(r,[e,i])=>e.evaluate(r).join(i.evaluate(r))],"resolved-locale":[Ze,[In],(r,[e])=>e.evaluate(r).resolvedLocale()]});class Un{constructor(e,i,n){this.expression=e,this._warningHistory={},this._evaluator=new el,this._defaultValue=i?(function(s){if(s.type==="color"&&Gs(s.default))return new He(0,0,0,0);switch(s.type){case"color":return He.parse(s.default)||null;case"padding":return gi.parse(s.default)||null;case"numberArray":return It.parse(s.default)||null;case"colorArray":return Ne.parse(s.default)||null;case"variableAnchorOffsetCollection":return Ci.parse(s.default)||null;case"projectionDefinition":return Ai.parse(s.default)||null;default:return s.default===void 0?null:s.default}})(i):null,this._enumValues=i&&i.type==="enum"?i.values:null,this._globalState=n}evaluateWithoutErrorHandling(e,i,n,s,l,u){return this._globalState&&(e=hn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=n,this._evaluator.canonical=s,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=u,this.expression.evaluate(this._evaluator)}evaluate(e,i,n,s,l,u){this._globalState&&(e=hn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=n||null,this._evaluator.canonical=s,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=u||null;try{const p=this.expression.evaluate(this._evaluator);if(p==null||typeof p=="number"&&p!=p)return this._defaultValue;if(this._enumValues&&!(p in this._enumValues))throw new _t(`Expected value to be one of ${Object.keys(this._enumValues).map((g=>JSON.stringify(g))).join(", ")}, but found ${JSON.stringify(p)} instead.`);return p}catch(p){return this._warningHistory[p.message]||(this._warningHistory[p.message]=!0,typeof console<"u"&&console.warn(p.message)),this._defaultValue}}}function $s(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in on}function Zn(r,e,i){const n=new ba(on,js,[],e?(function(l){const u={color:$i,string:Ze,number:Pe,enum:Ze,boolean:Ye,formatted:En,padding:Ts,numberArray:Cn,colorArray:qa,projectionDefinition:ws,resolvedImage:Wa,variableAnchorOffsetCollection:An};return l.type==="array"?di(u[l.value]||$e,l.length):u[l.type]})(e):void 0),s=n.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?Vc(new Un(s,e,i)):ln(n.errors)}class qs{constructor(e,i,n){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Vn(i.expression),this.globalStateRefs=un(i.expression),this._globalState=n}evaluateWithoutErrorHandling(e,i,n,s,l,u){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,l,u)}evaluate(e,i,n,s,l,u){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluate(e,i,n,s,l,u)}}class Ws{constructor(e,i,n,s,l){this.kind=e,this.zoomStops=n,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Vn(i.expression),this.globalStateRefs=un(i.expression),this.interpolationType=s,this._globalState=l}evaluateWithoutErrorHandling(e,i,n,s,l,u){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,l,u)}evaluate(e,i,n,s,l,u){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluate(e,i,n,s,l,u)}interpolationFactor(e,i,n){return this.interpolationType?Gt.interpolationFactor(this.interpolationType,e,i,n):0}}function Gc(r,e,i){const n=Zn(r,e,i);if(n.result==="error")return n;const s=n.value.expression,l=Us(s);if(!l&&!cn(e))return ln([new hi("","data expressions not supported")]);const u=Zs(s,["zoom"]);if(!u&&!jc(e))return ln([new hi("","zoom expressions not supported")]);const p=Aa(s);return p||u?p instanceof hi?ln([p]):p instanceof Gt&&!gl(e)?ln([new hi("",'"interpolate" expressions cannot be used with this property')]):Vc(p?new Ws(l?"camera":"composite",n.value,p.labels,p instanceof Gt?p.interpolation:void 0,i):new qs(l?"constant":"source",n.value,i)):ln([new hi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Hs{constructor(e,i){this._parameters=e,this._specification=i,ga(this,Uc(this._parameters,this._specification))}static deserialize(e){return new Hs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Aa(r){let e=null;if(r instanceof yt)e=Aa(r.result);else if(r instanceof Ln){for(const i of r.args)if(e=Aa(i),e)break}else(r instanceof tn||r instanceof Gt)&&r.input instanceof rr&&r.input.name==="zoom"&&(e=r);return e instanceof hi||r.eachChild((i=>{const n=Aa(i);n instanceof hi?e=n:!e&&n?e=new hi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new hi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function un(r,e=new Set){return r instanceof Nn&&e.add(r.key),r.eachChild((i=>{un(i,e)})),e}function hn(r,e){const{zoom:i,heatmapDensity:n,elevation:s,lineProgress:l,isSupportedScript:u,accumulated:p}=r??{};return{zoom:i,heatmapDensity:n,elevation:s,lineProgress:l,isSupportedScript:u,accumulated:p,globalState:e}}function _l(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const e of r.slice(1))if(!_l(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const lh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Gn(r,e){if(r==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};_l(r)||(r=$n(r));const i=Zn(r,lh,e);if(i.result==="error")throw new Error(i.value.map((n=>`${n.key}: ${n.message}`)).join(", "));return{filter:(n,s,l)=>i.value.evaluate(n,s,{},l),needGeometry:yl(r),getGlobalStateRefs:()=>un(i.value.expression)}}function ch(r,e){return r<e?-1:r>e?1:0}function yl(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let e=1;e<r.length;e++)if(yl(r[e]))return!0;return!1}function $n(r){if(!r)return!0;const e=r[0];return r.length<=1?e!=="any":e==="=="?vl(r[1],r[2],"=="):e==="!="?qn(vl(r[1],r[2],"==")):e==="<"||e===">"||e==="<="||e===">="?vl(r[1],r[2],e):e==="any"?(i=r.slice(1),["any"].concat(i.map($n))):e==="all"?["all"].concat(r.slice(1).map($n)):e==="none"?["all"].concat(r.slice(1).map($n).map(qn)):e==="in"?$c(r[1],r.slice(2)):e==="!in"?qn($c(r[1],r.slice(2))):e==="has"?xl(r[1]):e!=="!has"||qn(xl(r[1]));var i}function vl(r,e,i){switch(r){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,r,e]}}function $c(r,e){if(e.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((i=>typeof i!=typeof e[0]))?["filter-in-large",r,["literal",e.sort(ch)]]:["filter-in-small",r,["literal",e]]}}function xl(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function qn(r){return["!",r]}function Xs(r){const e=typeof r;if(e==="number"||e==="boolean"||e==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let s="[";for(const l of r)s+=`${Xs(l)},`;return`${s}]`}const i=Object.keys(r).sort();let n="{";for(let s=0;s<i.length;s++)n+=`${JSON.stringify(i[s])}:${Xs(r[i[s]])},`;return`${n}}`}function uh(r){let e="";for(const i of Zo)e+=`/${Xs(r[i])}`;return e}function qc(r){const e=r.value;return e?[new be(r.key,e,"constants have been deprecated as of v8")]:[]}function Vt(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function Da(r){if(Array.isArray(r))return r.map(Da);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const e={};for(const i in r)e[i]=Da(r[i]);return e}return Vt(r)}function ji(r){const e=r.key,i=r.value,n=r.valueSpec||{},s=r.objectElementValidators||{},l=r.style,u=r.styleSpec,p=r.validateSpec;let g=[];const m=Ke(i);if(m!=="object")return[new be(e,i,`object expected, ${m} found`)];for(const v in i){const _=v.split(".")[0],T=Rn(n,_)||n["*"];let b;if(Rn(s,_))b=s[_];else if(Rn(n,_)){if(i[v]===void 0)continue;b=p}else if(s["*"])b=s["*"];else{if(!n["*"]){g.push(new be(e,i[v],`unknown property "${v}"`));continue}b=p}g=g.concat(b({key:(e&&`${e}.`)+v,value:i[v],valueSpec:T,style:l,styleSpec:u,object:i,objectKey:v,validateSpec:p},i))}for(const v in n)s[v]||n[v].required&&n[v].default===void 0&&i[v]===void 0&&g.push(new be(e,i,`missing required property "${v}"`));return g}function Ys(r){const e=r.value,i=r.valueSpec,n=r.style,s=r.styleSpec,l=r.key,u=r.arrayElementValidator||r.validateSpec;if(Ke(e)!=="array")return[new be(l,e,`array expected, ${Ke(e)} found`)];if(i.length&&e.length!==i.length)return[new be(l,e,`array length ${i.length} expected, length ${e.length} found`)];let p={type:i.value,values:i.values};s.$version<7&&(p.function=i.function),Ke(i.value)==="object"&&(p=i.value);let g=[];for(let m=0;m<e.length;m++)g=g.concat(u({array:e,arrayIndex:m,value:e[m],valueSpec:p,validateSpec:r.validateSpec,style:n,styleSpec:s,key:`${l}[${m}]`}));return g}function dn(r){const e=r.key,i=r.value,n=r.valueSpec;let s=Ke(i);return s==="number"&&i!=i&&(s="NaN"),s!=="number"?[new be(e,i,`number expected, ${s} found`)]:"minimum"in n&&i<n.minimum?[new be(e,i,`${i} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&i>n.maximum?[new be(e,i,`${i} is greater than the maximum value ${n.maximum}`)]:[]}function Ks(r){const e=r.valueSpec,i=Vt(r.value.type);let n,s,l,u={};const p=i!=="categorical"&&r.value.property===void 0,g=!p,m=Ke(r.value.stops)==="array"&&Ke(r.value.stops[0])==="array"&&Ke(r.value.stops[0][0])==="object",v=ji({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(b){if(i==="identity")return[new be(b.key,b.value,'identity function may not have a "stops" property')];let M=[];const I=b.value;return M=M.concat(Ys({key:b.key,value:I,valueSpec:b.valueSpec,validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec,arrayElementValidator:_})),Ke(I)==="array"&&I.length===0&&M.push(new be(b.key,I,"array must have at least one stop")),M},default:function(b){return b.validateSpec({key:b.key,value:b.value,valueSpec:e,validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec})}}});return i==="identity"&&p&&v.push(new be(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||v.push(new be(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!gl(r.valueSpec)&&v.push(new be(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(g&&!cn(r.valueSpec)?v.push(new be(r.key,r.value,"property functions not supported")):p&&!jc(r.valueSpec)&&v.push(new be(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!m||r.value.property!==void 0||v.push(new be(r.key,r.value,'"property" property is required')),v;function _(b){let M=[];const I=b.value,A=b.key;if(Ke(I)!=="array")return[new be(A,I,`array expected, ${Ke(I)} found`)];if(I.length!==2)return[new be(A,I,`array length 2 expected, length ${I.length} found`)];if(m){if(Ke(I[0])!=="object")return[new be(A,I,`object expected, ${Ke(I[0])} found`)];if(I[0].zoom===void 0)return[new be(A,I,"object stop key must have zoom")];if(I[0].value===void 0)return[new be(A,I,"object stop key must have value")];if(l&&l>Vt(I[0].zoom))return[new be(A,I[0].zoom,"stop zoom values must appear in ascending order")];Vt(I[0].zoom)!==l&&(l=Vt(I[0].zoom),s=void 0,u={}),M=M.concat(ji({key:`${A}[0]`,value:I[0],valueSpec:{zoom:{}},validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec,objectElementValidators:{zoom:dn,value:T}}))}else M=M.concat(T({key:`${A}[0]`,value:I[0],validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec},I));return $s(Da(I[1]))?M.concat([new be(`${A}[1]`,I[1],"expressions are not allowed in function stops.")]):M.concat(b.validateSpec({key:`${A}[1]`,value:I[1],valueSpec:e,validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec}))}function T(b,M){const I=Ke(b.value),A=Vt(b.value),D=b.value!==null?b.value:M;if(n){if(I!==n)return[new be(b.key,D,`${I} stop domain type must match previous stop domain type ${n}`)]}else n=I;if(I!=="number"&&I!=="string"&&I!=="boolean")return[new be(b.key,D,"stop domain value must be a number, string, or boolean")];if(I!=="number"&&i!=="categorical"){let L=`number expected, ${I} found`;return cn(e)&&i===void 0&&(L+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new be(b.key,D,L)]}return i!=="categorical"||I!=="number"||isFinite(A)&&Math.floor(A)===A?i!=="categorical"&&I==="number"&&s!==void 0&&A<s?[new be(b.key,D,"stop domain values must appear in ascending order")]:(s=A,i==="categorical"&&A in u?[new be(b.key,D,"stop domain values must be unique")]:(u[A]=!0,[])):[new be(b.key,D,`integer expected, found ${A}`)]}}function ta(r){const e=(r.expressionContext==="property"?Gc:Zn)(Da(r.value),r.valueSpec);if(e.result==="error")return e.value.map((n=>new be(`${r.key}${n.key}`,r.value,n.message)));const i=e.value.expression||e.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new be(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Vn(i))return[new be(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!Vn(i))return[new be(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!Zs(i,["zoom","feature-state"]))return[new be(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!Us(i))return[new be(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Wn(r){const e=r.key,i=r.value,n=Ke(i);return n!=="string"?[new be(e,i,`color expected, ${n} found`)]:He.parse(String(i))?[]:[new be(e,i,`color expected, "${i}" found`)]}function za(r){const e=r.key,i=r.value,n=r.valueSpec,s=[];return Array.isArray(n.values)?n.values.indexOf(Vt(i))===-1&&s.push(new be(e,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(n.values).indexOf(Vt(i))===-1&&s.push(new be(e,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),s}function pn(r){return _l(Da(r.value))?ta(ga({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wc(r)}function Wc(r){const e=r.value,i=r.key;if(Ke(e)!=="array")return[new be(i,e,`array expected, ${Ke(e)} found`)];const n=r.styleSpec;let s,l=[];if(e.length<1)return[new be(i,e,"filter array must have at least 1 element")];switch(l=l.concat(za({key:`${i}[0]`,value:e[0],valueSpec:n.filter_operator,style:r.style,styleSpec:r.styleSpec})),Vt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Vt(e[1])==="$type"&&l.push(new be(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&l.push(new be(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(s=Ke(e[1]),s!=="string"&&l.push(new be(`${i}[1]`,e[1],`string expected, ${s} found`)));for(let u=2;u<e.length;u++)s=Ke(e[u]),Vt(e[1])==="$type"?l=l.concat(za({key:`${i}[${u}]`,value:e[u],valueSpec:n.geometry_type,style:r.style,styleSpec:r.styleSpec})):s!=="string"&&s!=="number"&&s!=="boolean"&&l.push(new be(`${i}[${u}]`,e[u],`string, number, or boolean expected, ${s} found`));break;case"any":case"all":case"none":for(let u=1;u<e.length;u++)l=l.concat(Wc({key:`${i}[${u}]`,value:e[u],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":s=Ke(e[1]),e.length!==2?l.push(new be(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):s!=="string"&&l.push(new be(`${i}[1]`,e[1],`string expected, ${s} found`))}return l}function Hc(r,e){const i=r.key,n=r.validateSpec,s=r.style,l=r.styleSpec,u=r.value,p=r.objectKey,g=l[`${e}_${r.layerType}`];if(!g)return[];const m=p.match(/^(.*)-transition$/);if(e==="paint"&&m&&g[m[1]]&&g[m[1]].transition)return n({key:i,value:u,valueSpec:l.transition,style:s,styleSpec:l});const v=r.valueSpec||g[p];if(!v)return[new be(i,u,`unknown property "${p}"`)];let _;if(Ke(u)==="string"&&cn(v)&&!v.tokens&&(_=/^{([^}]+)}$/.exec(u)))return[new be(i,u,`"${p}" does not support interpolation syntax
2Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(_[1])} }\`.`)];const T=[];return r.layerType==="symbol"&&p==="text-font"&&Gs(Da(u))&&Vt(u.type)==="identity"&&T.push(new be(i,u,'"text-font" does not support identity functions')),T.concat(n({key:r.key,value:u,valueSpec:v,style:s,styleSpec:l,expressionContext:"property",propertyType:e,propertyKey:p}))}function Xc(r){return Hc(r,"paint")}function Yc(r){return Hc(r,"layout")}function Kc(r){var e,i;let n=[];const s=r.value,l=r.key,u=r.style,p=r.styleSpec;if(Ke(s)!=="object")return[new be(l,s,`object expected, ${Ke(s)} found`)];s.type||s.ref||n.push(new be(l,s,'either "type" or "ref" is required'));let g=Vt(s.type);const m=Vt(s.ref);if(s.id){const v=Vt(s.id);for(let _=0;_<r.arrayIndex;_++){const T=u.layers[_];Vt(T.id)===v&&n.push(new be(l,s.id,`duplicate layer id "${s.id}", previously used at line ${T.id.__line__}`))}}if("ref"in s){let v;["type","source","source-layer","filter","layout"].forEach((_=>{_ in s&&n.push(new be(l,s[_],`"${_}" is prohibited for ref layers`))})),u.layers.forEach((_=>{Vt(_.id)===m&&(v=_)})),v?v.ref?n.push(new be(l,s.ref,"ref cannot reference another ref layer")):g=Vt(v.type):n.push(new be(l,s.ref,`ref layer "${m}" not found`))}else if(g!=="background")if(s.source){const v=u.sources&&u.sources[s.source],_=v&&Vt(v.type);v?_==="vector"&&g==="raster"?n.push(new be(l,s.source,`layer "${s.id}" requires a raster source`)):_!=="raster-dem"&&g==="hillshade"||_!=="raster-dem"&&g==="color-relief"?n.push(new be(l,s.source,`layer "${s.id}" requires a raster-dem source`)):_==="raster"&&g!=="raster"?n.push(new be(l,s.source,`layer "${s.id}" requires a vector source`)):_!=="vector"||s["source-layer"]?_==="raster-dem"&&g!=="hillshade"&&g!=="color-relief"?n.push(new be(l,s.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):g!=="line"||!s.paint||!s.paint["line-gradient"]||_==="geojson"&&v.lineMetrics||n.push(new be(l,s,`layer "${s.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):n.push(new be(l,s,`layer "${s.id}" must specify a "source-layer"`)):n.push(new be(l,s.source,`source "${s.source}" not found`))}else n.push(new be(l,s,'missing required property "source"'));return g==="raster"&&(!((e=s.paint)===null||e===void 0)&&e.resampling)&&(!((i=s.paint)===null||i===void 0)&&i["raster-resampling"])&&n.push(new be(l,s.paint,`layer "${s.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),n=n.concat(ji({key:l,value:s,valueSpec:p.layer,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,objectElementValidators:{"*":()=>[],type:()=>r.validateSpec({key:`${l}.type`,value:s.type,valueSpec:p.layer.type,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,object:s,objectKey:"type"}),filter:pn,layout:v=>ji({layer:s,key:v.key,value:v.value,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,objectElementValidators:{"*":_=>Yc(ga({layerType:g},_))}}),paint:v=>ji({layer:s,key:v.key,value:v.value,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,objectElementValidators:{"*":_=>Xc(ga({layerType:g},_))}})}})),n}function ia(r){const e=r.value,i=r.key,n=Ke(e);return n!=="string"?[new be(i,e,`string expected, ${n} found`)]:[]}const bl={promoteId:function({key:r,value:e}){if(Ke(e)==="string")return ia({key:r,value:e});{const i=[];for(const n in e)i.push(...ia({key:`${r}.${n}`,value:e[n]}));return i}}};function wl(r){const e=r.value,i=r.key,n=r.styleSpec,s=r.style,l=r.validateSpec;if(!e.type)return[new be(i,e,'"type" is required')];const u=Vt(e.type);let p;switch(u){case"vector":case"raster":return p=ji({key:i,value:e,valueSpec:n[`source_${u.replace("-","_")}`],style:r.style,styleSpec:n,objectElementValidators:bl,validateSpec:l}),p;case"raster-dem":return p=(function(g){var m;const v=(m=g.sourceName)!==null&&m!==void 0?m:"",_=g.value,T=g.styleSpec,b=T.source_raster_dem,M=g.style;let I=[];const A=Ke(_);if(_===void 0)return I;if(A!=="object")return I.push(new be("source_raster_dem",_,`object expected, ${A}
2 found`)),I;const D=Vt(_.encoding)==="custom",L=["redFactor","greenFactor","blueFactor","baseShift"],R=g.value.encoding?`"${g.value.encoding}"`:"Default";for(const F in _)!D&&L.includes(F)?I.push(new be(F,_[F],`In "${v}": "${F}" is only valid when "encoding" is set to "custom". ${R} encoding found`)):b[F]?I=I.concat(g.validateSpec({key:F,value:_[F],valueSpec:b[F],validateSpec:g.validateSpec,style:M,styleSpec:T})):I.push(new be(F,_[F],`unknown property "${F}"`));return I})({sourceName:i,value:e,style:r.style,styleSpec:n,validateSpec:l}),p;case"geojson":if(p=ji({key:i,value:e,valueSpec:n.source_geojson,style:s,styleSpec:n,validateSpec:l,objectElementValidators:bl}),e.cluster)for(const g in e.clusterProperties){const[m,v]=e.clusterProperties[g],_=typeof m=="string"?[m,["accumulated"],["get",g]]:m;p.push(...ta({key:`${i}.${g}.map`,value:v,expressionContext:"cluster-map"})),p.push(...ta({key:`${i}.${g}.reduce`,value:_,expressionContext:"cluster-reduce"}))}return p;case"video":return ji({key:i,value:e,valueSpec:n.source_video,style:s,validateSpec:l,styleSpec:n});case"image":return ji({key:i,value:e,valueSpec:n.source_image,style:s,validateSpec:l,styleSpec:n});case"canvas":return[new be(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return za({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Hn(r){const e=r.value,i=r.styleSpec,n=i.light,s=r.style;let l=[];const u=Ke(e);if(e===void 0)return l;if(u!=="object")return l=l.concat([new be("light",e,`object expected, ${u} found`)]),l;for(const p in e){const g=p.match(/^(.*)-transition$/);l=l.concat(g&&n[g[1]]&&n[g[1]].transition?r.validateSpec({key:p,value:e[p],valueSpec:i.transition,validateSpec:r.validateSpec,style:s,styleSpec:i}):n[p]?r.validateSpec({key:p,value:e[p],valueSpec:n[p],validateSpec:r.validateSpec,style:s,styleSpec:i}):[new be(p,e[p],`unknown property "${p}"`)])}return l}function Jc(r){const e=r.value,i=r.styleSpec,n=i.sky,s=r.style,l=Ke(e);if(e===void 0)return[];if(l!=="object")return[new be("sky",e,`object expected, ${l} found`)];let u=[];for(const p in e)u=u.concat(n[p]?r.validateSpec({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}):[new be(p,e[p],`unknown property "${p}"`)]);return u}function Tl(r){const e=r.value,i=r.styleSpec,n=i.terrain,s=r.style;let l=[];const u=Ke(e);if(e===void 0)return l;if(u!=="object")return l=l.concat([new be("terrain",e,`object expected, ${u} found`)]),l;for(const p in e)l=l.concat(n[p]?r.validateSpec({key:p,value:e[p],valueSpec:n[p],validateSpec:r.validateSpec,style:s,styleSpec:i}):[new be(p,e[p],`unknown property "${p}"`)]);return l}function Sl(r){let e=[];const i=r.value,n=r.key;if(Array.isArray(i)){const s=[],l=[];for(const u in i)i[u].id&&s.includes(i[u].id)&&e.push(new be(n,i,`all the sprites' ids must be unique, but ${i[u].id} is duplicated`)),s.push(i[u].id),i[u].url&&l.includes(i[u].url)&&e.push(new be(n,i,`all the sprites' URLs must be unique, but ${i[u].url} is duplicated`)),l.push(i[u].url),e=e.concat(ji({key:`${n}[${u}]`,value:i[u],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:r.validateSpec}));return e}return ia({key:n,value:i})}function Qc(r){return!!r&&r.constructor===Object}function Xn(r){return Qc(r.value)?[]:[new be(r.key,r.value,`object expected, ${Ke(r.value)} found`)]}const Pl={"*":()=>[],array:Ys,boolean:function(r){const e=r.value,i=r.key,n=Ke(e);return n!=="boolean"?[new be(i,e,`boolean expected, ${n} found`)]:[]},number:dn,color:Wn,constants:qc,enum:za,filter:pn,function:Ks,layer:Kc,object:ji,source:wl,light:Hn,sky:Jc,terrain:Tl,projection:function(r){const e=r.value,i=r.styleSpec,n=i.projection,s=r.style,l=Ke(e);if(e===void 0)return[];if(l!=="object")return[new be("projection",e,`object expected, ${l} found`)];let u=[];for(const p in e)u=u.concat(n[p]?r.validateSpec({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}):[new be(p,e[p],`unknown property "${p}"`)]);return u},projectionDefinition:function(r){const e=r.key;let i=r.value;i=i instanceof String?i.valueOf():i;const n=Ke(i);return n!=="array"||(function(s){return Array.isArray(s)&&s.length===3&&typeof s[0]=="string"&&typeof s[1]=="string"&&typeof s[2]=="number"})(i)||(function(s){return!!["interpolate","step","literal"].includes(s[0])})(i)?["array","string"].includes(n)?[]:[new be(e,i,`projection expected, invalid type "${n}" found`)]:[new be(e,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:ia,formatted:function(r){return ia(r).length===0?[]:ta(r)},resolvedImage:function(r){return ia(r).length===0?[]:ta(r)},padding:function(r){const e=r.key,i=r.value;if(Ke(i)==="array"){if(i.length<1||i.length>4)return[new be(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];const n={type:"number"};let s=[];for(let l=0;l<i.length;l++)s=s.concat(r.validateSpec({key:`${e}[${l}]`,value:i[l],validateSpec:r.validateSpec,valueSpec:n}));return s}return dn({key:e,value:i,valueSpec:{}}
2)},numberArray:function(r){const e=r.key,i=r.value;if(Ke(i)==="array"){const n={type:"number"};if(i.length<1)return[new be(e,i,"array length at least 1 expected, length 0 found")];let s=[];for(let l=0;l<i.length;l++)s=s.concat(r.validateSpec({key:`${e}[${l}]`,value:i[l],validateSpec:r.validateSpec,valueSpec:n}));return s}return dn({key:e,value:i,valueSpec:{}})},colorArray:function(r){const e=r.key,i=r.value;if(Ke(i)==="array"){if(i.length<1)return[new be(e,i,"array length at least 1 expected, length 0 found")];let n=[];for(let s=0;s<i.length;s++)n=n.concat(Wn({key:`${e}[${s}]`,value:i[s]}));return n}return Wn({key:e,value:i})},variableAnchorOffsetCollection:function(r){const e=r.key,i=r.value,n=Ke(i),s=r.styleSpec;if(n!=="array"||i.length<1||i.length%2!=0)return[new be(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let l=[];for(let u=0;u<i.length;u+=2)l=l.concat(za({key:`${e}[${u}]`,value:i[u],valueSpec:s.layout_symbol["text-anchor"]})),l=l.concat(Ys({key:`${e}[${u+1}]`,value:i[u+1],valueSpec:{length:2,value:"number"},validateSpec:r.validateSpec,style:r.style,styleSpec:s}));return l},sprite:Sl,state:Xn,fontFaces:function(r){const e=r.key,i=r.value,n=r.validateSpec,s=r.styleSpec,l=r.style;if(!Qc(i))return[new be(e,i,`object expected, ${Ke(i)} found`)];const u=[];for(const p in i){const g=i[p],m=Ke(g);if(m==="string")u.push(...ia({key:`${e}.${p}`,value:g}));else if(m==="array"){const v={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(const[_,T]of g.entries())u.push(...ji({key:`${e}.${p}[${_}]`,value:T,valueSpec:v,styleSpec:s,style:l,validateSpec:n}))}else u.push(new be(`${e}.${p}`,g,`string or array expected, ${m} found`))}return u}};function Yn(r){const e=r.value,i=r.valueSpec,n=r.styleSpec;return r.validateSpec=Yn,i.expression&&Gs(Vt(e))?Ks(r):i.expression&&$s(Da(e))?ta(r):i.type&&Pl[i.type]?Pl[i.type](r):ji(ga({},r,{valueSpec:i.type?n[i.type]:i}))}function fn(r){const e=r.value,i=r.key,n=ia(r);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new be(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new be(i,e,'"glyphs" url must include a "{range}" token'))),n}function ar(r,e=ce){let i=[];return i=i.concat(Yn({key:"",value:r,valueSpec:e.$root,styleSpec:e,style:r,validateSpec:Yn,objectElementValidators:{glyphs:fn,"*":()=>[]}})),r.constants&&(i=i.concat(qc({key:"constants",value:r.constants}))),eu(i)}function _r(r){return function(e){return r(Object.assign({},e,{validateSpec:Yn}))}}function eu(r){return[].concat(r).sort(((e,i)=>e.line-i.line))}function yr(r){return function(...e){return eu(r.apply(this,e))}}ar.source=yr(_r(wl)),ar.sprite=yr(_r(Sl)),ar.glyphs=yr(_r(fn)),ar.light=yr(_r(Hn)),ar.sky=yr(_r(Jc)),ar.terrain=yr(_r(Tl)),ar.state=yr(_r(Xn)),ar.layer=yr(_r(Kc)),ar.filter=yr(_r(pn)),ar.paintProperty=yr(_r(Xc)),ar.layoutProperty=yr(_r(Yc));const hh={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class dh{constructor(e,i){this._globalState=i,this.setValue(e)}evaluate(){var e;return(e=this._literalValue)!==null&&e!==void 0?e:this._compiledValue.evaluate({})}setValue(e){if(e==null||e==="visible"||e==="none")return this._literalValue=e==="none"?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);const i=Zn(e,hh,this._globalState);if(i.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,new Error(i.value.map((n=>`${n.key}: ${n.message}`)).join(", "));this._literalValue=void 0,this._compiledValue=i.value,this._globalStateRefs=un(i.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}const Kn=ce,Mr=ar,Xi=Mr.light,Jn=Mr.sky,tu=Mr.paintProperty,ph=Mr.layoutProperty;function iu(r,e){let i=!1;if(e?.length)for(const n of e)r.fire(new $a(new Error(n.message))),i=!0;return i}class Br{constructor(e,i,n){const s=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const u=new Int32Array(this.arrayBuffer);e=u[0],this.d=(i=u[1])+2*(n=u[2]);for(let g=0;g<this.d*this.d;g++){const m=u[3+g],v=u[3+g+1];s.push(m===v?null:u.subarray(m,v))}const p=u[3+s.length+1];this.keys=u.subarray(u[3+s.length],p),this.bboxes=u.subarray(p),this.insert=this._insertReadonly}else{this.d=i+2*n;for(let u=0;u<this.d*this.d;u++)s.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=e,this.padding=n,this.scale=i/e,this.uid=0;const l=n/i*e;this.min=-l,this.max=e+l}
vendor: 15,188 bytes, line 2
2insert(e,i,n,s,l){this._forEachCell(i,n,s,l,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(l)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,i,n,s,l,u){this.cells[l].push(u)}query(e,i,n,s,l){const u=this.min,p=this.max;if(e<=u&&i<=u&&p<=n&&p<=s&&!l)return[...this.keys];{const g=[];return this._forEachCell(e,i,n,s,this._queryCell,g,{},l),g}}_queryCell(e,i,n,s,l,u,p,g){const m=this.cells[l];if(m!==null){const v=this.keys,_=this.bboxes;for(const T of m)if(p[T]===void 0){const b=4*T;(g?g(_[b+0],_[b+1],_[b+2],_[b+3]):e<=_[b+2]&&i<=_[b+3]&&n>=_[b+0]&&s>=_[b+1])?(p[T]=!0,u.push(v[T])):p[T]=!1}}}_forEachCell(e,i,n,s,l,u,p,g){const m=this._convertToCellCoord(e),v=this._convertToCellCoord(i),_=this._convertToCellCoord(n),T=this._convertToCellCoord(s);for(let b=m;b<=_;b++)for(let M=v;M<=T;M++){const I=this.d*M+b;if((!g||g(this._convertFromCellCoord(b),this._convertFromCellCoord(M),this._convertFromCellCoord(b+1),this._convertFromCellCoord(M+1)))&&l.call(this,e,i,n,s,I,u,p,g))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,i=3+this.cells.length+1+1;let n=0;for(const u of this.cells)n+=u.length;const s=new Int32Array(i+n+this.keys.length+this.bboxes.length);s[0]=this.extent,s[1]=this.n,s[2]=this.padding;let l=i;for(let u=0;u<e.length;u++){const p=e[u];s[3+u]=l,s.set(p,l),l+=p.length}return s[3+e.length]=l,s.set(this.keys,l),l+=this.keys.length,s[3+e.length+1]=l,s.set(this.bboxes,l),l+=this.bboxes.length,s.buffer}static serialize(e,i){const n=e.toArrayBuffer();return i&&i.push(n),{buffer:n}}static deserialize(e){return new Br(e.buffer)}}const Ir={};function Ee(r,e,i={}){if(Ir[r])throw new Error(`${r} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:r,writeable:!1}),Ir[r]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}Ee("Object",Object),Ee("Set",Set),Ee("TransferableGridIndex",Br),Ee("Color",He),Ee("Error",Error),Ee("AJAXError",Za),Ee("ResolvedImage",qi),Ee("StylePropertyFunction",Hs),Ee("StyleExpression",Un,{omit:["_evaluator"]}),Ee("ZoomDependentExpression",Ws),Ee("ZoomConstantExpression",qs),Ee("CompoundExpression",rr,{omit:["_evaluate"]});for(const r in on)on[r]._classRegistryKey||Ee(`Expression_${r}`,on[r]);function ru(r){var e;return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||((e=r.constructor)===null||e===void 0?void 0:e.name)==="ArrayBuffer")}function Qn(r){return r.$name||r.constructor._classRegistryKey}function au(r){return!(function(e){if(e===null||typeof e!="object")return!1;const i=Qn(e);return i&&i!=="Object"})(r)&&(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||r instanceof Blob||r instanceof Error||ru(r)||Ot(r)||ArrayBuffer.isView(r)||r instanceof ImageData)}function Or(r,e){if(au(r))return(ru(r)||Ot(r))&&e&&e.push(r),ArrayBuffer.isView(r)&&e&&e.push(r.buffer),r instanceof ImageData&&e&&e.push(r.data.buffer),r;if(Array.isArray(r)){const l=[];for(const u of r)l.push(Or(u,e));return l}if(typeof r!="object")throw new Error("can't serialize object of type "+typeof r);const i=Qn(r);if(!i)throw new Error(`can't serialize object of unregistered class ${r.constructor.name}`);if(!Ir[i])throw new Error(`${i} is not registered.`);const{klass:n}=Ir[i],s=n.serialize?n.serialize(r,e):{};if(n.serialize){if(s===e?.[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const l in r){if(!r.hasOwnProperty(l)||Ir[i].omit.includes(l))continue;const u=r[l];s[l]=Ir[i].shallow.includes(l)?u:Or(u,e)}r instanceof Error&&(s.message=r.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(s.$name=i),s}function es(r){if(au(r))return r;if(Array.isArray(r))return r.map(es);if(typeof r!="object")throw new Error("can't deserialize object of type "+typeof r);const e=Qn(r)||"Object";if(!Ir[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:i}=Ir[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(r);const n=Object.create(i.prototype);for(const s of Object.keys(r)){if(s==="$name")continue;const l=r[s];n[s]=Ir[e].shallow.includes(s)?l:es(l)}return n}class Ml{constructor(){this.first=!0}update(e,i){const n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=i),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=n,!0))}}function fh(r){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(r))}function Ra(r){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(r))}function nu(r){return/\s/u.test(String.fromCodePoint(r))}function Il(r){for(const e of r)if(Ra(e.codePointAt(0)))return!0;return!1}function Js(r){for(const e of r)if(!Qs(e.codePointAt(0)))return!1;return!0}function su(r){const e=r.map((i=>{try{return new RegExp(`\\p{sc=${i}}`,"u").source}catch{return null}})).filter((i=>i));return new RegExp(e.join("|"),"u")}const El=su(["Arab","Dupl","Mong","Ougr","Syrc"]);function Qs(r){return!El.test(String.fromCodePoint(r))}function Cl(r){return!(Ra(r)||(e=r,/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))));var e}const ou=su(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Al(r){return ou.test(String.fromCodePoint(r))}function lu(r,e){return!(!e&&Al(r)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(r)))}function Dl(r){for(const e of r)if(Al(e.codePointAt(0)))return!0;return!1}const Nr=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(r){this.pluginStatus=r.pluginStatus,this.pluginURL=r.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(r){if(Nr.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=r.applyArabicShaping,this.processBidirectionalText=r.processBidirectionalText,this.processStyledBidirectionalText=r.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(r,e){return h(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(r.pluginStatus!=="loading")return this.setState(r),r;const i=r.pluginURL,n=new Promise((l=>{this.loadScriptResolve=l}));e(i);const s=new Promise((l=>setTimeout((()=>l()),this.TIMEOUT)));if(yield Promise.race([n,s]),this.isParsed()){const l={pluginStatus:"loaded",pluginURL:i};return this.setState(l),l}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${i}`)}))}};class vt{constructor(e,i){this.isSupportedScript=cu,this.zoom=e,i?(this.now=i.now||0,this.fadeDuration=i.fadeDuration||0,this.zoomHistory=i.zoomHistory||new Ml,this.transition=i.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ml,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,i=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*i}}}function cu(r){return(function(e,i){for(const n of e)if(!lu(n.codePointAt(0),i))return!1;return!0})(r,Nr.getRTLTextPluginStatus()==="loaded")}const eo="-transition";class ts{constructor(e,i,n){this.property=e,this.value=i,this.expression=(function(s,l,u){if(Gs(s))return new Hs(s,l);if($s(s)){const p=Gc(s,l,u);if(p.result==="error")throw new Error(p.value.map((g=>`${g.key}: ${g.message}`)).join(", "));return p.value}{let p=s;return l.type==="color"&&typeof s=="string"?p=He.parse(s):l.type!=="padding"||typeof s!="number"&&!Array.isArray(s)?l.type!=="numberArray"||typeof s!="number"&&!Array.isArray(s)?l.type!=="colorArray"||typeof s!="string"&&!Array.isArray(s)?l.type==="variableAnchorOffsetCollection"&&Array.isArray(s)?p=Ci.parse(s):l.type==="projectionDefinition"&&typeof s=="string"&&(p=Ai.parse(s)):p=Ne.parse(s):p=It.parse(s):p=gi.parse(s),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>p}}})(i===void 0?e.specification.default:i,e.specification,n)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,i,n){return this.property.possiblyEvaluate(this,e,i,n)}}class zl{constructor(e,i){this.property=e,this.value=new ts(e,void 0,i)}transitioned(e,i){return new kl(this.property,this.value,i,Ii({},e.transition,this.transition),e.now)}untransitioned(){return new kl(this.property,this.value,null,{},0)}}class Rl{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=i}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return Fe(this._values[e].value.value)}setValue(e,i){Object.hasOwn(this._values,e)||(this._values[e]=new zl(this._values[e].property,this._globalState)),this._values[e].value=new ts(this._values[e].property,i===null?void 0:Fe(i),this._globalState)}getTransition(e){return Fe(this._values[e].transition)}setTransition(e,i){Object.hasOwn(this._values,e)||(this._values[e]=new zl(this._values[e].property,this._globalState)),this._values[e].transition=Fe(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const n=this.getValue(i);n!==void 0&&(e[i]=n);const s=this.getTransition(i);s!==void 0&&(e[`${i}${eo}`]=s)}return e}transitioned(e,i){const n=new uu(this._properties);for(const s of Object.keys(this._values))n._values[s]=this._values[s].transitioned(e,i._values[s]);return n}untransitioned(){const e=new uu(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class kl{constructor(e,i,n,s,l){this.property=e,this.value=i,this.begin=l+s.delay||0,this.end=this.begin+s.duration||0,e.specification.transition&&(s.delay||s.duration)&&(this.prior=n)}possiblyEvaluate(e,i,n){const s=e.now||0,l=this.value.possiblyEvaluate(e,i,n),u=this.prior;if(u){if(s>this.end)return this.prior=null,l;if(this.value.isDataDriven())return this.prior=null,l;if(s<this.begin)return u.possiblyEvaluate(e,i,n);{const p=(s-this.begin)/(this.end-this.begin);return this.property.interpolate(u.possiblyEvaluate(e,i,n),l,er(p))}}return l}}class uu{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,i,n){const s=new is(this._properties);for(const l of Object.keys(this._values))s._values[l]=this._values[l].possiblyEvaluate(e,i,n);return s}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class mh{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=i}hasValue(e){return this._values[e].value!==void 0}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return Fe(this._values[e].value)}setValue(e,i){this._values[e]=new ts(this._values[e].property,i===null?void 0:Fe(i),this._globalState)}serialize(){const e={};for(const i of Object.keys(this._values)){const n=this.getValue(i);n!==void 0&&(e[i]=n)}return e}possiblyEvaluate(e,i,n){const s=new is(this._properties);for(const l of Object.keys(this._values))s._values[l]=this._values[l].possiblyEvaluate(e,i,n);return s}}class vr{constructor(e,i,n){this.property=e,this.value=i,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,i,n,s){return this.property.evaluate(this.value,this.parameters,e,i,n,s)}}class is{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class De{constructor(e){this.specification=e}
2possiblyEvaluate(e,i){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(i)}interpolate(e,i,n){const s=Wi[this.specification.type];return s?s(e,i,n):e}}class ke{constructor(e,i){this.specification=e,this.overrides=i}possiblyEvaluate(e,i,n,s){return new vr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(i,null,{},n,s)}:e.expression,i)}interpolate(e,i,n){if(e.value.kind!=="constant"||i.value.kind!=="constant")return e;if(e.value.value===void 0||i.value.value===void 0)return new vr(this,{kind:"constant",value:void 0},e.parameters);const s=Wi[this.specification.type];if(s){const l=s(e.value.value,i.value.value,n);return new vr(this,{kind:"constant",value:l},e.parameters)}return e}evaluate(e,i,n,s,l,u){return e.kind==="constant"?e.value:e.evaluate(i,n,s,l,u)}}class ra extends ke{possiblyEvaluate(e,i,n,s){if(e.value===void 0)return new vr(this,{kind:"constant",value:void 0},i);if(e.expression.kind==="constant"){const l=e.expression.evaluate(i,null,{},n,s),u=e.property.specification.type==="resolvedImage"&&typeof l!="string"?l.name:l,p=this._calculate(u,u,u,i);return new vr(this,{kind:"constant",value:p},i)}if(e.expression.kind==="camera"){const l=this._calculate(e.expression.evaluate({zoom:i.zoom-1}),e.expression.evaluate({zoom:i.zoom}),e.expression.evaluate({zoom:i.zoom+1}),i);return new vr(this,{kind:"constant",value:l},i)}return new vr(this,e.expression,i)}evaluate(e,i,n,s,l,u){if(e.kind==="source"){const p=e.evaluate(i,n,s,l,u);return this._calculate(p,p,p,i)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(i.zoom)-1},n,s),e.evaluate({zoom:Math.floor(i.zoom)},n,s),e.evaluate({zoom:Math.floor(i.zoom)+1},n,s),i):e.value}_calculate(e,i,n,s){return s.zoom>s.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:n,to:i}}interpolate(e){return e}}class hu{constructor(e){this.specification=e}possiblyEvaluate(e,i,n,s){if(e.value!==void 0){if(e.expression.kind==="constant"){const l=e.expression.evaluate(i,null,{},n,s);return this._calculate(l,l,l,i)}return this._calculate(e.expression.evaluate(new vt(Math.floor(i.zoom-1),i)),e.expression.evaluate(new vt(Math.floor(i.zoom),i)),e.expression.evaluate(new vt(Math.floor(i.zoom+1),i)),i)}}_calculate(e,i,n,s){return s.zoom>s.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:n,to:i}}interpolate(e){return e}}class mn{constructor(e){this.specification=e}possiblyEvaluate(e,i,n,s){return!!e.expression.evaluate(i,null,{},n,s)}interpolate(){return!1}}class Di{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const i in e){const n=e[i];n.specification.overridable&&this.overridableProperties.push(i);const s=this.defaultPropertyValues[i]=new ts(n,void 0,void 0),l=this.defaultTransitionablePropertyValues[i]=new zl(n,void 0);this.defaultTransitioningPropertyValues[i]=l.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=s.possiblyEvaluate({})}}}Ee("DataDrivenProperty",ke),Ee("DataConstantProperty",De),Ee("CrossFadedDataDrivenProperty",ra),Ee("CrossFadedProperty",hu),Ee("ColorRampProperty",mn);const du=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",to=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";class nr extends xs{constructor(e,i,n){if(super(),this.id=e.id,this.type=e.type,this._globalState=n,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(function(s,l){return new dh(s,l)})(this.visibility,n),e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Gn(e.filter,n)),i.layout&&(this._unevaluatedLayout=new mh(i.layout,n)),i.paint)){this._transitionablePaint=new Rl(i.paint,n);for(const s in e.paint)this.setPaintProperty(s,e.paint[s],{validate:!1});for(const s in e.layout)this.setLayoutProperty(s,e.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new is(i.paint)}}setFilter(e){this.filter=e,this._featureFilter=Gn(e,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){var i;if(e==="visibility")return this.visibility;if(!((i=this._transitionablePaint)===null||i===void 0)&&i.hasProperty(e))throw new Error(e+du);if(!this._unevaluatedLayout)throw new Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){const e=new Set;for(const i of this._visibilityExpression.getGlobalStateRefs())e.add(i);if(this._unevaluatedLayout)for(const i in this._unevaluatedLayout._values){const n=this._unevaluatedLayout._values[i];for(const s of n.getGlobalStateRefs())e.add(s)}for(const i of this._featureFilter.getGlobalStateRefs())e.add(i);return e}getPaintAffectingGlobalStateRefs(){var e;const i=new globalThis.Map;if(this._transitionablePaint)for(const n in this._transitionablePaint._values){const s=this._transitionablePaint._values[n].value;for(const l of s.getGlobalStateRefs()){const u=(e=i.get(l))!==null&&e!==void 0?e:[];u.push({name:n,value:s.value}),i.set(l,u)}}return i}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,i,n={}){var s;if(e==="visibility")return this.visibility=i,this._visibilityExpression.setValue(i),void this.recalculateVisibility();!((s=this._transitionablePaint)===null||s===void 0)&&s.hasProperty(e)?this.fire(new $a(new Error(e+du))):i!=null&&this._val
2idate(ph,`layers.${this.id}.layout.${e}`,e,i,n)||this._unevaluatedLayout.setValue(e,i)}getPaintProperty(e){var i,n;if(e.endsWith(eo)){const s=e.slice(0,-11);if(s==="visibility"||!((i=this._unevaluatedLayout)===null||i===void 0)&&i.hasProperty(s))throw new Error(e+to);return this._transitionablePaint.getTransition(s)}if(e==="visibility"||!((n=this._unevaluatedLayout)===null||n===void 0)&&n.hasProperty(e))throw new Error(e+to);return this._transitionablePaint.getValue(e)}setPaintProperty(e,i,n={}){var s;if(e==="visibility"||!((s=this._unevaluatedLayout)===null||s===void 0)&&s.hasProperty(e))return this.fire(new $a(new Error(e+to))),!1;if(i!=null&&this._validate(tu,`layers.${this.id}.paint.${e}`,e,i,n))return!1;if(e.endsWith(eo))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const l=this._transitionablePaint._values[e],u=l.property.specification["property-type"]==="cross-faded-data-driven",p=l.value.isDataDriven(),g=l.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const m=this._transitionablePaint._values[e].value;return m.isDataDriven()||p||u||this._handleOverridablePaintPropertyUpdate(e,g,m)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,i,n){return!1}isHidden(e=this.minzoom,i=!1){return!!(this.minzoom&&e<(i?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&e>=this.maxzoom)||this._evaluatedVisibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,i){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){var e,i;
vendor: 4,350 bytes, line 2
2const n={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)===null||e===void 0?void 0:e.serialize(),paint:(i=this._transitionablePaint)===null||i===void 0?void 0:i.serialize()};return this.visibility&&(n.layout||(n.layout={}),n.layout.visibility=this.visibility),Tr(n,((s,l)=>!(s===void 0||l==="layout"&&!Object.keys(s).length||l==="paint"&&!Object.keys(s).length)))}_validate(e,i,n,s,l={}){return l?.validate!==!1&&iu(this,e.call(Mr,{key:i,layerType:this.type,objectKey:n,value:s,styleSpec:ce,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof vr&&cn(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}}let Ll;var gh={get paint(){return Ll=Ll||new Di({"raster-opacity":new De(ce.paint_raster["raster-opacity"]),"raster-hue-rotate":new De(ce.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new De(ce.paint_raster["raster-brightness-min"]),"raster-brightness-max":new De(ce.paint_raster["raster-brightness-max"]),"raster-saturation":new De(ce.paint_raster["raster-saturation"]),"raster-contrast":new De(ce.paint_raster["raster-contrast"]),resampling:new De(ce.paint_raster.resampling),"raster-resampling":new De(ce.paint_raster["raster-resampling"]),"raster-fade-duration":new De(ce.paint_raster["raster-fade-duration"])})}};class _h extends nr{constructor(e,i){super(e,gh,i)}}const yh={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class rs{constructor(e,i){this._structArray=e,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Et{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,i){return e._trim(),i&&(e.isTransferred=!0,i.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const i=Object.create(this.prototype);return i.arrayBuffer=e.arrayBuffer,i.length=e.length,i.capacity=e.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}}function wt(r,e=1){let i=0,n=0;return{members:r.map((s=>{const l=yh[s.type].BYTES_PER_ELEMENT,u=i=pu(i,Math.max(e,l)),p=s.components||1;return n=Math.max(n,l),i+=l*p,{name:s.name,type:s.type,components:p,offset:u}})),size:pu(i,Math.max(n,e)),alignment:e}}function pu(r,e){return Math.ceil(r/e)*e}class as extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.int16[s+0]=i,this.int16[s+1]=n,e}}as.prototype.bytesPerElement=4,Ee("StructArrayLayout2i4",as);class io extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const l=3*e;return this.int16[l+0]=i,this.int16[l+1]=n,this.int16[l+2]=s,e}}io.prototype.bytesPerElement=6,Ee("StructArrayLayout3i6",io);class ro extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,i,n,s)}emplace(e,i,n,s,l){const u=4*e;return this.int16[u+0]=i,this.int16[u+1]=n,this.int16[u+2]=s,this.int16[u+3]=l,e}}ro.prototype.bytesPerElement=8,Ee("StructArrayLayout4i8",ro);
vendor: 13,177 bytes, line 2
2class ao extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,l,u)}emplace(e,i,n,s,l,u,p){const g=6*e;return this.int16[g+0]=i,this.int16[g+1]=n,this.int16[g+2]=s,this.int16[g+3]=l,this.int16[g+4]=u,this.int16[g+5]=p,e}}ao.prototype.bytesPerElement=12,Ee("StructArrayLayout2i4i12",ao);class Fl extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,l,u)}emplace(e,i,n,s,l,u,p){const g=4*e,m=8*e;return this.int16[g+0]=i,this.int16[g+1]=n,this.uint8[m+4]=s,this.uint8[m+5]=l,this.uint8[m+6]=u,this.uint8[m+7]=p,e}}Fl.prototype.bytesPerElement=8,Ee("StructArrayLayout2i4ub8",Fl);class ns extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.float32[s+0]=i,this.float32[s+1]=n,e}}ns.prototype.bytesPerElement=8,Ee("StructArrayLayout2f8",ns);class Vr extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u,p,g,m,v){const _=this.length;return this.resize(_+1),this.emplace(_,e,i,n,s,l,u,p,g,m,v)}emplace(e,i,n,s,l,u,p,g,m,v,_){const T=10*e;return this.uint16[T+0]=i,this.uint16[T+1]=n,this.uint16[T+2]=s,this.uint16[T+3]=l,this.uint16[T+4]=u,this.uint16[T+5]=p,this.uint16[T+6]=g,this.uint16[T+7]=m,this.uint16[T+8]=v,this.uint16[T+9]=_,e}}Vr.prototype.bytesPerElement=20,Ee("StructArrayLayout10ui20",Vr);class no extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u,p,g){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,n,s,l,u,p,g)}emplace(e,i,n,s,l,u,p,g,m){const v=8*e;return this.uint16[v+0]=i,this.uint16[v+1]=n,this.uint16[v+2]=s,this.uint16[v+3]=l,this.uint16[v+4]=u,this.uint16[v+5]=p,this.uint16[v+6]=g,this.uint16[v+7]=m,e}}no.prototype.bytesPerElement=16,Ee("StructArrayLayout8ui16",no);class ss extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u,p,g,m,v,_,T){const b=this.length;return this.resize(b+1),this.emplace(b,e,i,n,s,l,u,p,g,m,v,_,T)}emplace(e,i,n,s,l,u,p,g,m,v,_,T,b){const M=12*e;return this.int16[M+0]=i,this.int16[M+1]=n,this.int16[M+2]=s,this.int16[M+3]=l,this.uint16[M+4]=u,this.uint16[M+5]=p,this.uint16[M+6]=g,this.uint16[M+7]=m,this.int16[M+8]=v,this.int16[M+9]=_,this.int16[M+10]=T,this.int16[M+11]=b,e}}ss.prototype.bytesPerElement=24,Ee("StructArrayLayout4i4ui4i24",ss);class so extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const l=3*e;return this.float32[l+0]=i,this.float32[l+1]=n,this.float32[l+2]=s,e}}so.prototype.bytesPerElement=12,Ee("StructArrayLayout3f12",so);class os extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}os.prototype.bytesPerElement=4,Ee("StructArrayLayout1ul4",os);class Bl extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u,p,g,m){const v=this.length;return this.resize(v+1),this.emplace(v,e,i,n,s,l,u,p,g,m)}emplace(e,i,n,s,l,u,p,g,m,v){const _=10*e,T=5*e;return this.int16[_+0]=i,this.int16[_+1]=n,this.int16[_+2]=s,this.int16[_+3]=l,this.int16[_+4]=u,this.int16[_+5]=p,this.uint32[T+3]=g,this.uint16[_+8]=m,this.uint16[_+9]=v,e}}Bl.prototype.bytesPerElement=20,Ee("StructArrayLayout6i1ul2ui20",Bl);class gn extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,l,u)}emplace(e,i,n,s,l,u,p){const g=6*e;return this.int16[g+0]=i,this.int16[g+1]=n,this.int16[g+2]=s,this.int16[g+3]=l,this.int16[g+4]=u,this.int16[g+5]=p,e}}gn.prototype.bytesPerElement=12,Ee("StructArrayLayout2i2i2i12",gn);class ka extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,l)}emplace(e,i,n,s,l,u){const p=4*e,g=8*e;return this.float32[p+0]=i,this.float32[p+1]=n,this.float32[p+2]=s,this.int16[g+6]=l,this.int16[g+7]=u,e}}ka.prototype.bytesPerElement=16,Ee("StructArrayLayout2f1f2i16",ka);class Ol extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,l,u)}emplace(e,i,n,s,l,u,p){const g=16*e,m=4*e,v=8*e;return this.uint8[g+0]=i,this.uint8[g+1]=n,this.float32[m+1]=s,this.float32[m+2]=l,this.int16[v+6]=u,this.int16[v+7]=p,e}}Ol.prototype.bytesPerElement=16,Ee("StructArrayLayout2ub2f2i16",Ol);class ls extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const l=3*e;return this.uint16[l+0]=i,this.uint16[l+1]=n,this.uint16[l+2]=s,e}}ls.prototype.bytesPerElement=6,Ee("StructArrayLayout3ui6",ls);class La extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u,p,g,m,v,_,T,b,M,I,A,D){const L=this.length;return this.resize(L+1),this.emplace(L,e,i,n,s,l,u,p,g,m,v,_,T,b,M,I,A,D)}emplace(e,i,n,s,l,u,p,g,m,v,_,T,b,M,I,A,D,L){const R=24*e,F=12*e,O=48*e;return this.int16[R+0]=i,this.int16[R+1]=n,this.uint16[R+2]=s,this.uint16[R+3]=l,this.uint32[F+2]=u,this.uint32[F+3]=p,this.uint32[F+4]=g,this.uint16[R+10]=m,this.uint16[R+11]=v,this.uint16[R+12]=_,this.float32[F+7]=T,this.float32[F+8]=b,this.uint8[O+36]=M,this.uint8[O+37]=I,this.uint8[O+38]=A,this.uint32[F+10]=D,this.int16[R+22]=L,e}}La.prototype.bytesPerElement=48,Ee("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",La);class Nl extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,l,u,p,g,m,v,_,T,b,M,I,A,D,L,R,F,O,V,Y,J,re,te,oe,le){const ae=this.length;return this.resize(ae+1),this.emplace(ae,e,i,n,s,l,u,p,g,m,v,_,T,b,M,I,A,D,L,R,F,O,V,Y,J,re,te,oe,le)}emplace(e,i,n,s,l,u,p,g,m,v,_,T,b,M,I,A,D,L,R,F,O,V,Y,J,re,te,oe,le,ae){const ie=32*e,ye=16*e;return this.int16[ie+0]=i,this.int16[ie+1]=n,this.int16[ie+2]=s,this.int16[ie+3]=l,this.int16[ie+4]=u,this.int16[ie+5]=p,this.int16[ie+6]=g,this.int16[ie+7]=m,this.uint16[ie+8]=v,this.uint16[ie+9]=_,this.uint16[ie+10]=T,this.uint16[ie+11]=b,this.uint16[ie+12]=M,this.uint16[ie+13]=I,this.uint16[ie+14]=A,this.uint16[ie+15]=D,this.uint16[ie+16]=L,this.uint16[ie+17]=R,this.uint16[ie+18]=F,this.uint16[ie+19]=O,this.uint16[ie+20]=V,this.uint16[ie+21]=Y,this.uint16[ie+22]=J,this.uint32[ye+12]=re,this.float32[ye+13]=te,this.float32[ye+14]=oe,this.uint16[ie+30]=le,this.uint16[ie+31]=ae,e}}Nl.prototype.bytesPerElement=64,Ee("StructArrayLayout8i15ui1ul2f2ui64",Nl);class oo extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}oo.prototype.bytesPerElement=4,Ee("StructArrayLayout1f4",oo);class lo extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const l=3*e;return this.uint16[6*e+0]=i,this.float32[l+1]=n,this.float32[l+2]=s,e}}lo.prototype.bytesPerElement=12,Ee("StructArrayLayout1ui2f12",lo);class Vl extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const l=4*e;return this.uint32[2*e+0]=i,this.uint16[l+2]=n,this.uint16[l+3]=s,e}}Vl.prototype.bytesPerElement=8,Ee("StructArrayLayout1ul2ui8",Vl);class d extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.uint16[s+0]=i,this.uint16[s+1]=n,e}}d.prototype.bytesPerElement=4,Ee("StructArrayLayout2ui4",d);class t extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}t.prototype.bytesPerElement=2,Ee("StructArrayLayout1ui2",t);class a extends Et{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const l=this.length;return this.resize(l+1),this.emplace(l,e,i,n,s)}emplace(e,i,n,s,l){const u=4*e;return this.float32[u+0]=i,this.float32[u+1]=n,this.float32[u+2]=s,this.float32[u+3]=l,e}}a.prototype.bytesPerElement=16,Ee("StructArrayLayout4f16",a);class o extends rs{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new ge(this.anchorPointX,this.anchorPointY)}}o.prototype.size=20;class c extends Bl{get(e){return new o(this,e)}}Ee("CollisionBoxArray",c);class f extends rs{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}f.prototype.size=48;class y extends La{get(e){return new f(this,e)}}Ee("PlacedSymbolArray",y);class x extends rs{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}
vendor: 70,193 bytes, line 2
2get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}x.prototype.size=64;class w extends Nl{get(e){return new x(this,e)}}Ee("SymbolInstanceArray",w);class S extends oo{getoffsetX(e){return this.float32[1*e+0]}}Ee("GlyphOffsetArray",S);class P extends io{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Ee("SymbolLineVertexArray",P);class E extends rs{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}E.prototype.size=12;class C extends lo{get(e){return new E(this,e)}}Ee("TextAnchorOffsetArray",C);class z extends rs{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}z.prototype.size=8;class B extends Vl{get(e){return new z(this,e)}}Ee("FeatureIndexArray",B);class N extends as{}class Z extends as{}class j extends as{}class G extends ao{}class X extends Fl{}class $ extends ns{}class U extends Vr{}class H extends no{}class q extends ss{}class Q extends so{}class ne extends os{}class se extends gn{}class me extends Ol{}class pe extends ls{}class Ae extends d{}const Te=wt([{name:"a_pos",components:2,type:"Int16"}],4),{members:ue}=Te;class Me{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,i,n,s){const l=this.segments[this.segments.length-1];return e>Me.MAX_VERTEX_ARRAY_LENGTH&&Kt(`Max vertices per segment is ${Me.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${Me.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!l||l.vertexLength+e>Me.MAX_VERTEX_ARRAY_LENGTH||l.sortKey!==s?this.createNewSegment(i,n,s):l}createNewSegment(e,i,n){const s={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return n!==void 0&&(s.sortKey=n),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(s),s}getOrCreateLatestSegment(e,i,n){return this.prepareSegment(0,e,i,n)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,n,s){return new Me([{vertexOffset:e,primitiveOffset:i,vertexLength:n,primitiveLength:s,vaos:{},sortKey:0}])}}function ze(r,e){return 256*(r=Yt(Math.floor(r),0,255))+Yt(Math.floor(e),0,255)}Me.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ee("SegmentVector",Me);const ot=wt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),jt=wt([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var mt,$t,Wt,_i={exports:{}},kt={exports:{}},zi={exports:{}},pi=(function(){if(Wt)return _i.exports;Wt=1;var r=(mt||(mt=1,kt.exports=function(i,n){var s,l,u,p,g,m,v,_;for(l=i.length-(s=3&i.length),u=n,g=3432918353,m=461845907,_=0;_<l;)v=255&i.charCodeAt(_)|(255&i.charCodeAt(++_))<<8|(255&i.charCodeAt(++_))<<16|(255&i.charCodeAt(++_))<<24,++_,u=27492+(65535&(p=5*(65535&(u=(u^=v=(65535&(v=(v=(65535&v)*g+(((v>>>16)*g&65535)<<16)&4294967295)<<15|v>>>17))*m+(((v>>>16)*m&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(v=0,s){case 3:v^=(255&i.charCodeAt(_+2))<<16;case 2:v^=(255&i.charCodeAt(_+1))<<8;case 1:u^=v=(65535&(v=(v=(65535&(v^=255&i.charCodeAt(_)))*g+(((v>>>16)*g&65535)<<16)&4294967295)<<15|v>>>17))*m+(((v>>>16)*m&65535)<<16)&4294967295}return u^=i.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0}),kt.exports),e=($t||($t=1,zi.exports=function(i,n){for(var s,l=i.length,u=n^l,p=0;l>=4;)s=1540483477*(65535&(s=255&i.charCodeAt(p)|(255&i.charCodeAt(++p))<<8|(255&i.charCodeAt(++p))<<16|(255&i.charCodeAt(++p))<<24))+((1540483477*(s>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(s=1540483477*(65535&(s^=s>>>24))+((1540483477*(s>>>16)&65535)<<16)),l-=4,++p;switch(l){case 3:u^=(255&i.charCodeAt(p+2))<<16;case 2:u^=(255&i.charCodeAt(p+1))<<8;case 1:u=1540483477*(65535&(u^=255&i.charCodeAt(p)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0}),zi.exports);return _i.exports=r,_i.exports.murmur3=r,_i.exports.murmur2=e,_i.exports})(),ai=pt(pi);class yi{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,n,s){this.ids.push(aa(e)),this.positions.push(i,n,s)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const i=aa(e);let n=0,s=this.ids.length-1;for(;n<s;){const u=n+s>>1;this.ids[u]>=i?s=u:n=u+1}const l=[];for(;this.ids[n]===i;)l.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return l}static serialize(e,i){const n=new Float64Array(e.ids),s=new Uint32Array(e.positions);return na(n,s,0,n.length-1),i&&i.push(n.buffer,s.buffer),{ids:n,positions:s}}static deserialize(e){const i=new yi;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function aa(r){const e=+r;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ai(String(r))}function na(r,e,i,n){for(;i<n;){const s=r[i+n>>1];let l=i-1,u=n+1;for(;;){do l++;while(r[l]<s);do u--;while(r[u]>s);if(l>=u)break;sa(r,l,u),sa(e,3*l,3*u),sa(e,3*l+1,3*u+1),sa(e,3*l+2,3*u+2)}u-i<n-u?(na(r,e,i,u),i=u+1):(na(r,e,u+1,n),n=u)}}function sa(r,e,i){const n=r[e];r[e]=r[i],r[i]=n}Ee("FeaturePositionMap",yi);class vi{constructor(e,i){this.gl=e.gl,this.location=i}}class jr extends vi{constructor(e,i){super(e,i),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class oa extends vi{constructor(e,i){super(e,i),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class co extends vi{constructor(e,i){super(e,i),this.current=He.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const Er=new Float32Array(16);function Cr(r){return[ze(255*r.r,255*r.g),ze(255*r.b,255*r.a)]}class Yi{constructor(e,i,n){this.value=e,this.uniformNames=i.map((s=>`u_${s}`)),this.type=n}setUniform(e,i,n){e.set(n.constantOr(this.value))}getBinding(e,i,n){return this.type==="color"?new co(e,i):new jr(e,i)}}class sr{constructor(e,i){this.uniformNames=i.map((n=>`u_${n}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,i){this.pixelRatioFrom=i.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=i.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,i){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,i.y,i.height,i.width]}setUniform(e,i,n,s){let l=null;s==="u_pattern_to"?l=this.patternTo:s==="u_pattern_from"?l=this.patternFrom:s==="u_dasharray_to"?l=this.dashTo:s==="u_dasharray_from"?l=this.dashFrom:s==="u_pixel_ratio_to"?l=this.pixelRatioTo:s==="u_pixel_ratio_from"&&(l=this.pixelRatioFrom),l!==null&&e.set(l)}getBinding(e,i,n){return n.startsWith("u_pattern")||n.startsWith("u_dasharray_")?new oa(e,i):new jr(e,i)}}class Ct{constructor(e,i,n,s){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=i.map((l=>({name:`a_${l}`,type:"Float32",components:n==="color"?2:1,offset:0}))),this.paintVertexArray=new s}populatePaintArray(e,i,n){const s=this.paintVertexArray.length,l=this.expression.evaluate(new vt(0,n),i,{},n.canonical,[],n.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(s,e,l)}updatePaintArray(e,i,n,s,l){const u=this.expression.evaluate(new vt(0,l),n,s);this._setPaintValue(e,i,u)}_setPaintValue(e,i,n){if(this.type==="color"){const s=Cr(n);for(let l=e;l<i;l++)this.paintVertexArray.emplace(l,s[0],s[1])}else{for(let s=e;s<i;s++)this.paintVertexArray.emplace(s,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){var i,n;!((i=this.paintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((n=this.paintVertexBuffer)===null||n===void 0)&&n.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class St{constructor(e,i,n,s,l,u){this.expression=e,this.uniformNames=i.map((p=>`u_${p}_t`)),this.type=n,this.useIntegerZoom=s,this.zoom=l,this.maxValue=0,this.paintVertexAttributes=i.map((p=>({name:`a_${p}`,type:"Float32",components:n==="color"?4:2,offset:0}))),this.paintVertexArray=new u}populatePaintArray(e,i,n){const s=this.expression.evaluate(new vt(this.zoom,n),i,{},n.canonical,[],n.formattedSection),l=this.expression.evaluate(new vt(this.zoom+1,n),i,{},n.canonical,[],n.formattedSection),u=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(u,e,s,l)}updatePaintArray(e,i,n,s,l){const u=this.expression.evaluate(new vt(this.zoom,l),n,s),p=this.expression.evaluate(new vt(this.zoom+1,l),n,s);this._setPaintValue(e,i,u,p)}_setPaintValue(e,i,n,s){if(this.type==="color"){const l=Cr(n),u=Cr(s);for(let p=e;p<i;p++)this.paintVertexArray.emplace(p,l[0],l[1],u[0],u[1])}else{for(let l=e;l<i;l++)this.paintVertexArray.emplace(l,n,s);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(s))}}upload(e){var i,n;!((i=this.paintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((n=this.paintVertexBuffer)===null||n===void 0)&&n.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,i){const n=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,s=Yt(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(s)}getBinding(e,i,n){return new jr(e,i)}}class Ht{constructor(e,i,n,s,l,u){this.expression=e,this.type=i,this.useIntegerZoom=n,this.zoom=s,this.layerId=u,this.zoomInPaintVertexArray=new l,this.zoomOutPaintVertexArray=new l}populatePaintArray(e,i,n){const s=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(s,e,this.getPositionIds(i),n)}updatePaintArray(e,i,n,s,l){this._setPaintValues(e,i,this.getPositionIds(n),l)}_setPaintValues(e,i,n,s){const l=this.getPositions(s);if(!l||!n)return;const u=l[n.min],p=l[n.mid],g=l[n.max];if(u&&p&&g)for(let m=e;m<i;m++)this.emplace(this.zoomInPaintVertexArray,m,p,u),this.emplace(this.zoomOutPaintVertexArray,m,p,g)}upload(e){var i,n;if(!((i=this.zoomInPaintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((n=this.zoomOutPaintVertexArray)===null||n===void 0)&&n.arrayBuffer.byteLength)){const s=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,s,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,s,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class At extends Ht{getPositions(e){return e.imagePositions}getPositionIds(e){var i;return(i=e.patterns)===null||i===void 0?void 0:i[this.layerId]}getVertexAttributes(){return ot.members}emplace(e,i,n,s){e.emplace(i,n.tlbr[0],n.tlbr[1],n.tlbr[2],n.tlbr[3],s.tlbr[0],s.tlbr[1],s.tlbr[2],s.tlbr[3],n.pixelRatio,s.pixelRatio)}}class Fa extends Ht{getPositions(e){return e.dashPositions}getPositionIds(e){var i;return(i=e.dashes)===null||i===void 0?void 0:i[this.layerId]}getVertexAttributes(){return jt.members}emplace(e,i,n,s){e.emplace(i,0,n.y,n.height,n.width,0,s.y,s.height,s.width)}}class uo{constructor(e,i,n){this.binders={},this._buffers=[];const s=[];for(const l in e.paint._values){if(!n(l))continue;const u=e.paint.get(l);if(!(u instanceof vr&&cn(u.property.specification)))continue;const p=jl(l,e.type),g=u.value,m=u.property.specification.type,v=u.property.useIntegerZoom,_=u.property.specification["property-type"],T=_==="cross-faded"||_==="cross-faded-data-driven";if(g.kind==="constant")this.binders[l]=T?new sr(g.value,p):new Yi(g.value,p,m),s.push(`/u_${l}`);else if(g.kind==="source"||T){const b=fu(l,m,"source");this.binders[l]=T?l==="line-dasharray"?new Fa(g,m,v,i,b,e.id):new At(g,m,v,i,b,e.id):new Ct(g,p,m,b),s.push(`/a_${l}`)}else{const b=fu(l,m,"composite");this.binders[l]=new St(g,p,m,v,i,b),s.push(`/z_${l}`)}}this.cacheKey=s.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof Ct||i instanceof St?i.maxValue:0}populatePaintArrays(e,i,n){for(const s in this.binders){const l=this.binders[s];(l instanceof Ct||l instanceof St||l instanceof Ht)&&l.populatePaintArray(e,i,n)}}setConstantPatternPositions(e,i){for(const n in this.binders){const s=this.binders[n];s instanceof sr&&s.setConstantPatternPositions(e,i)}}setConstantDashPositions(e,i){for(const n in this.binders){const s=this.binders[n];s instanceof sr&&s.setConstantDashPositions(e,i)}}updatePaintArrays(e,i,n,s,l){let u=!1;for(const p in e){const g=i.getPositions(p);for(const m of g){const v=n.feature(m.index);for(const _ in this.binders){const T=this.binders[_];if((T instanceof Ct||T instanceof St||T instanceof Ht)&&T.expression.isStateDependent===!0){const b=s.paint.get(_);T.expression=b.value,T.updatePaintArray(m.start,m.end,v,e[p],l),u=!0}}}}return u}defines(){const e=[];for(const i in this.binders){const n=this.binders[i];(n instanceof Yi||n instanceof sr)&&e.push(...n.uniformNames.map((s=>`#define HAS_UNIFORM_${s}`)))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof Ct||n instanceof St)for(const s of n.paintVertexAttributes)e.push(s.name);else if(n instanceof Ht){const s=n.getVertexAttributes();for(const l of s)e.push(l.name)}}return e}getBinderUniforms(){const e=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof Yi||n instanceof sr||n instanceof St)for(const s of n.uniformNames)e.push(s)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,i){const n=[];for(const s in this.binders){const l=this.binders[s];if(l instanceof Yi||l instanceof sr||l instanceof St){for(const u of l.uniformNames)if(i[u]){const p=l.getBinding(e,i[u],u);n.push({name:u,property:s,binding:p})}}}return n}setUniforms(e,i,n,s){for(const{name:l,property:u,binding:p}of i)this.binders[u].setUniform(p,s,n.get(u),l)}updatePaintBuffers(e){this._buffers=[];for(const i in this.binders){const n=this.binders[i];if(e&&n instanceof Ht){const s=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;s&&this._buffers.push(s)}else(n instanceof Ct||n instanceof St)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(const i in this.binders){const n=this.binders[i];(n instanceof Ct||n instanceof St||n instanceof Ht)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const i=this.binders[e];(i instanceof Ct||i instanceof St||i instanceof Ht)&&i.destroy()}}}class Ur{constructor(e,i,n=()=>!0){this.programConfigurations={};for(const s of e)this.programConfigurations[s.id]=new uo(s,i,n);this.needsUpload=!1,this._featureMap=new yi,this._bufferOffset=0}populatePaintArrays(e,i,n,s){for(const l in this.programConfigurations)this.programConfigurations[l].populatePaintArrays(e,i,s);i.id!==void 0&&this._featureMap.add(i.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,n,s){for(const l of n)this.needsUpload=this.programConfigurations[l.id].updatePaintArrays(e,this._featureMap,i,l,s)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function jl(r,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[r]||[r.replace(`${e}-`,"").replace(/-/g,"_")]}function fu(r,e,i){const n={color:{source:ns,composite:a},number:{source:oo,composite:ns}},s=(function(l){return{"line-pattern":{source:U,composite:U},"fill-pattern":{source:U,composite:U},"fill-extrusion-pattern":{source:U,composite:U},"line-dasharray":{source:H,composite:H}}[l]})(r);return s?.[i]||n[e][i]}Ee("ConstantBinder",Yi),Ee("CrossFadedConstantBinder",sr),Ee("SourceExpressionBinder",Ct),Ee("CrossFadedPatternBinder",At),Ee("CrossFadedDasharrayBinder",Fa),Ee("CompositeExpressionBinder",St),Ee("ProgramConfiguration",uo,{omit:["_buffers"]}),Ee("ProgramConfigurationSet",Ur);const Ul=Math.pow(2,14)-1,la=-Ul-1;function ca(r){const e=Le/r.extent,i=r.loadGeometry();for(const n of i)for(const s of n){const l=Math.round(s.x*e),u=Math.round(s.y*e);s.x=Yt(l,la,Ul),s.y=Yt(u,la,Ul),(l<s.x||l>s.x+1||u<s.y||u>s.y+1)&&Kt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function ua(r,e){return{type:r.type,id:r.id,properties:r.properties,geometry:e?ca(r):[]}}const Zl=-32768;function Gl(r,e,i,n,s){r.emplaceBack(Zl+8*e+n,Zl+8*i+s)}class ho{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Z,this.indexArray=new pe,this.segments=new Me,this.programConfigurations=new Ur(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,n){const s=this.layers[0],l=[];let u=null,p=!1,g=s.type==="heatmap";if(s.type==="circle"){const v=s;u=v.layout.get("circle-sort-key"),p=!u.isConstant(),g||(g=v.paint.get("circle-pitch-alignment")==="map")}const m=g?i.subdivisionGranularity.circle:1;for(const{feature:v,id:_,index:T,sourceLayerIndex:b}of e){const M=this.layers[0]._featureFilter.needGeometry,I=ua(v,M);if(!this.layers[0]._featureFilter.filter(new vt(this.zoom),I,n))continue;const A=p?u.evaluate(I,{},n):void 0,D={id:_,properties:v.properties,type:v.type,sourceLayerIndex:b,index:T,geometry:M?I.geometry:ca(v),patterns:{},sortKey:A};l.push(D)}p&&l.sort(((v,_)=>v.sortKey-_.sortKey));for(const v of l){const{geometry:_,index:T,sourceLayerIndex:b}=v,M=e[T].feature;this.addFeature(v,_,T,n,m),i.featureIndex.insert(M,_,T,b,this.index)}}update(e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:n})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ue),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,i,n,s,l=1){let u;switch(l){case 1:u=[0,7];break;case 3:u=[0,2,5,7];break;case 5:u=[0,1,3,4,6,7];break;case 7:u=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${l}; valid values are 1, 3, 5, 7.`)}const p=u.length;for(const g of i)for(const m of g){const v=m.x,_=m.y;if(v<0||v>=Le||_<0||_>=Le)continue;const T=this.segments.prepareSegment(p*p,this.layoutVertexArray,this.indexArray,e.sortKey),b=T.vertexLength;for(let M=0;M<p;M++)for(let I=0;I<p;I++)Gl(this.layoutVertexArray,v,_,u[I],u[M]);for(let M=0;M<p-1;M++)for(let I=0;I<p-1;I++){const A=b+M*p+I,D=b+(M+1)*p+I;this.indexArray.emplaceBack(A,D+1,A+1),this.indexArray.emplaceBack(A,D,D+1)}T.vertexLength+=p*p,T.primitiveLength+=(p-1)*(p-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:{},canonical:s})}}function po(r,e){for(const i of r)if(fo(e,i))return!0;for(const i of e)if(fo(r,i))return!0;return vh(r,e)}function mu(r,e,i){return!!fo(r,e)||xh(e,r,i)}function Fd(r,e){if(r.length===1)return Od(e,r[0]);for(const i of e)for(const n of i)if(fo(r,n))return!0;for(const i of r)if(Od(e,i))return!0;for(const i of e)if(vh(r,i))return!0;return!1}function Dm(r,e,i){if(r.length>1){if(vh(r,e))return!0;for(const n of e)if(xh(n,r,i))return!0}for(const n of r)if(xh(n,e,i))return!0;return!1}function vh(r,e){if(r.length===0||e.length===0)return!1;for(let i=0;i<r.length-1;i++){const n=r[i],s=r[i+1];for(let l=0;l<e.length-1;l++)if(zm(n,s,e[l],e[l+1]))return!0}return!1}function zm(r,e,i,n){return Ei(r,i,n)!==Ei(e,i,n)&&Ei(r,e,i)!==Ei(r,e,n)}function xh(r,e,i){const n=i*i;if(e.length===1)return r.distSqr(e[0])<n;for(let s=1;s<e.length;s++)if(Bd(r,e[s-1],e[s])<n)return!0;return!1}function Bd(r,e,i){const n=e.distSqr(i);if(n===0)return r.distSqr(e);const s=((r.x-e.x)*(i.x-e.x)+(r.y-e.y)*(i.y-e.y))/n;return r.distSqr(s<0?e:s>1?i:i.sub(e)._mult(s)._add(e))}function Od(r,e){let i,n,s,l=!1;for(const u of r){i=u;for(let p=0,g=i.length-1;p<i.length;g=p++)n=i[p],s=i[g],n.y>e.y!=s.y>e.y&&e.x<(s.x-n.x)*(e.y-n.y)/(s.y-n.y)+n.x&&(l=!l)}return l}function fo(r,e){let i=!1;for(let n=0,s=r.length-1;n<r.length;s=n++){const l=r[n],u=r[s];l.y>e.y!=u.y>e.y&&e.x<(u.x-l.x)*(e.y-l.y)/(u.y-l.y)+l.x&&(i=!i)}return i}function Rm(r,e,i){const n=i[0],s=i[2];if(r.x<n.x&&e.x<n.x||r.x>s.x&&e.x>s.x||r.y<n.y&&e.y<n.y||r.y>s.y&&e.y>s.y)return!1;const l=Ei(r,e,i[0]);return l!==Ei(r,e,i[1])||l!==Ei(r,e,i[2])||l!==Ei(r,e,i[3])}function mo(r,e,i){const n=e.paint.get(r).value;return n.kind==="constant"?n.value:i.programConfigurations.get(e.id).getMaxValue(r)}function gu(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function _u(r,e,i,n,s){if(!e[0]&&!e[1])return r;const l=ge.convert(e)._mult(s);i==="viewport"&&l._rotate(-n);const u=[];for(const p of r)u.push(p.sub(l));return u}function km(r){const e=[];for(let i=0;i<r.length;i++){const n=r[i],s=e.at(-1);(i===0||s&&!n.equals(s))&&e.push(n)}return e}function Lm({queryGeometry:r,size:e},i){return mu(r,i,e)}function Fm({queryGeometry:r,size:e,transform:i,unwrappedTileID:n,getElevation:s},l){return mu(r,l,e*(i.projectTileCoordinates(l.x,l.y,n,s).signedDistanceFromCamera/i.cameraToCenterDistance))}function Bm({queryGeometry:r,size:e,transform:i,unwrappedTileID:n,getElevation:s},l){const u=i.projectTileCoordinates(l.x,l.y,n,s).signedDistanceFromCamera,p=e*(i.cameraToCenterDistance/u);return mu(r,bh(l,i,n,s),p)}function Om({queryGeometry:r,size:e,transform:i,unwrappedTileID:n,getElevation:s},l){return mu(r,bh(l,i,n,s),e)}function Nd({queryGeometry:r,size:e,transform:i,unwrappedTileID:n,getElevation:s,pitchAlignment:l="map",pitchScale:u="map"},p){const g=l==="map"?u==="map"?Lm:Fm:u==="map"?Bm:Om,m={queryGeometry:r,size:e,transform:i,unwrappedTileID:n,getElevation:s};for(const v of p)for(const _ of v)if(g(m,_))return!0;return!1}function bh(r,e,i,n){const s=e.projectTileCoordinates(r.x,r.y,i,n).point;return new ge((.5*s.x+.5)*e.width,(.5*-s.y+.5)*e.height)}let Vd,jd;Ee("CircleBucket",ho,{omit:["layers"]});var Nm={get paint(){return jd=jd||new Di({"circle-radius":new ke(ce.paint_circle["circle-radius"]),"circle-color":new ke(ce.paint_circle["circle-color"]),"circle-blur":new ke(ce.paint_circle["circle-blur"]),"circle-opacity":new ke(ce.paint_circle["circle-opacity"]),"circle-translate":new De(ce.paint_circle["circle-translate"]),"circle-translate-anchor":new De(ce.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new De(ce.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new De(ce.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ke(ce.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ke(ce.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ke(ce.paint_circle["circle-stroke-opacity"])})},get layout(){return Vd=Vd||new Di({"circle-sort-key":new ke(ce.layout_circle["circle-sort-key"])})}};class Vm extends nr{constructor(e,i){super(e,Nm,i)}createBucket(e){return new ho(e)}queryRadius(e){const i=e;return mo("circle-radius",this,i)+mo("circle-stroke-width",this,i)+gu(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:n,geometry:s,transform:l,pixelsToTileUnits:u,unwrappedTileID:p,getElevation:g}){const m=_u(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-l.bearingInRadians,u),v=this.paint.get("circle-radius").evaluate(i,n)+this.paint.get("circle-stroke-width").evaluate(i,n),_=this.paint.get("circle-pitch-scale"),T=this.paint.get("circle-pitch-alignment");let b,M;return T==="map"?(b=m,M=v*u):(b=(function(I,A,D,L){return I.map((R=>bh(R,A,D,L)))})(m,l,p,g),M=v),Nd({queryGeometry:b,size:M,transform:l,unwrappedTileID:p,getElevation:g,pitchAlignment:T,pitchScale:_},s)}}class Ud extends ho{}let Zd;Ee("HeatmapBucket",Ud,{omit:["layers"]});var jm={get paint(){return Zd=Zd||new Di({"heatmap-radius":new ke(ce.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ke(ce.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new De(ce.paint_heatmap["heatmap-intensity"]),"heatmap-color":new mn(ce.paint_heatmap["heatmap-color"]),"heatmap-opacity":new De(ce.paint_heatmap["heatmap-opacity"])})}};function wh(r,{width:e,height:i},n,s){if(s){if(s instanceof Uint8ClampedArray)s=new Uint8Array(s.buffer);else if(s.length!==e*i*n)throw new RangeError(`mismatched image size. expected: ${s.length} but got: ${e*i*n}`)}else s=new Uint8Array(e*i*n);return r.width=e,r.height=i,r.data=s,r}function Gd(r,{width:e,height:i},n){if(e===r.width&&i===r.height)return;const s=wh({},{width:e,height:i},n);Th(r,s,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,e),height:Math.min(r.height,i)},n),r.width=e,r.height=i,r.data=s.data}function Th(r,e,i,n,s,l){if(s.width===0||s.height===0)return e;if(s.width>r.width||s.height>r.height||i.x>r.width-s.width||i.y>r.height-s.height)throw new RangeError("out of range source coordinates for image copy");if(s.width>e.width||s.height>e.height||n.x>e.width-s.width||n.y>e.height-s.height)throw new RangeError("out of range destination coordinates for image copy");const u=r.data,p=e.data;if(u===p)throw new Error("srcData equals dstData, so image is already copied");for(let g=0;g<s.height;g++){const m=((i.y+g)*r.width+i.x)*l,v=((n.y+g)*e.width+n.x)*l;for(let _=0;_<s.width*l;_++)p[v+_]=u[m+_]}return e}class $l{constructor(e,i){wh(this,e,1,i)}resize(e){Gd(this,e,1)}clone(){return new $l({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,n,s,l){Th(e,i,n,s,l,1)}}class Ki{constructor(e,i){wh(this,e,4,i)}resize(e){Gd(this,e,4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Ki({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,n,s,l){Th(e,i,n,s,l,4)}setPixel(e,i,n){const s=4*(e*this.width+i);this.data[s+0]=Math.round(255*n.r/n.a),this.data[s+1]=Math.round(255*n.g/n.a),this.data[s+2]=Math.round(255*n.b/n.a),this.data[s+3]=Math.round(255*n.a)}}function $d(r){const e=new Uint8Array(r.length);for(let i=0;i<r.length;i+=4){const n=r[i+3];e[i+0]=Math.round(r[i+0]*n/255),e[i+1]=Math.round(r[i+1]*n/255),e[i+2]=Math.round(r[i+2]*n/255),e[i+3]=n}return e}function qd(r){const e={},i=r.resolution||256,n=r.clips?r.clips.length:1,s=r.image||new Ki({width:i,height:n});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);const l=(u,p,g)=>{e[r.evaluationKey]=g;const m=r.expression.evaluate(e);s.setPixel(u/4/i,p/4,m)};if(r.clips)for(let u=0,p=0;u<n;++u,p+=4*i)for(let g=0,m=0;g<i;g++,m+=4){const v=g/(i-1),{start:_,end:T}=r.clips[u];l(p,m,_*(1-v)+T*v)}else for(let u=0,p=0;u<i;u++,p+=4)l(0,p,u/(i-1));return s}Ee("AlphaImage",$l),Ee("RGBAImage",Ki);const Sh="big-fb";class Um extends nr{createBucket(e){return new Ud(e)}constructor(e,i){super(e,jm,i),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=qd({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Sh)&&this.heatmapFbos.delete(Sh)}queryRadius(e){return mo("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:n,geometry:s,transform:l,pixelsToTileUnits:u,unwrappedTileID:p,getElevation:g}){return Nd({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(i,n)*u,transform:l,unwrappedTileID:p,getElevation:g},s)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}}let Wd;var Zm={get paint(){return Wd=Wd||new Di({"hillshade-illumination-direction":new De(ce.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new De(ce.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new De(ce.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new De(ce.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new De(ce.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new De(ce.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new De(ce.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new De(ce.paint_hillshade["hillshade-method"]),resampling:new De(ce.paint_hillshade.resampling)})}};class Gm extends nr{constructor(e,i){super(e,Zm,i),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,i=this.paint.get("hillshade-illumination-altitude").values,n=this.paint.get("hillshade-highlight-color").values,s=this.paint.get("hillshade-shadow-color").values;const l=Math.max(e.length,i.length,n.length,s.length);e=e.concat(Array(l-e.length).fill(e.at(-1))),i=i.concat(Array(l-i.length).fill(i.at(-1))),n=n.concat(Array(l-n.length).fill(n.at(-1))),s=s.concat(Array(l-s.length).fill(s.at(-1)));const u=i.map(Xr);return{directionRadians:e.map(Xr),altitudeRadians:u,shadowColor:s,highlightColor:n}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}}let Hd;var $m={get paint(){return Hd=Hd||new Di({"color-relief-opacity":new De(ce["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new mn(ce["paint_color-relief"]["color-relief-color"]),resampling:new De(ce["paint_color-relief"].resampling)})}};function Xd(r){return"data"in r}class Ph{constructor(e,i,n,s){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(i,s)}update(e,i,n){var s;const{width:l,height:u}=e,p=(((s=this.size)===null||s===void 0?void 0:s[0])!==l||this.size[1]!==u)&&!n,{context:g}=this,{gl:m}=g;this.useMipmap=!!i?.useMipmap,m.bindTexture(m.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1);const v=this.format===m.RGBA&&i?.premultiply!==!1;if(p)this.size=[l,u],Xd(e)?(g.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,v,l,u,m)):(g.pixelStoreUnpackPremultiplyAlpha.set(v),this._uploadDomImage(e,m));else{const{x:_,y:T}=n||{x:0,y:0};Xd(e)?(g.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,v,_,T,l,u,m)):(g.pixelStoreUnpackPremultiplyAlpha.set(v),this._updateDomImage(e,_,T,m))}this.useMipmap&&this.isSizePowerOfTwo()&&m.generateMipmap(m.TEXTURE_2D),g.pixelStoreUnpackFlipY.setDefault(),g.pixelStoreUnpack.setDefault(),g.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,i){i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,i.UNSIGNED_BYTE,e)}_uploadRawData(e,i,n,s,l){let{data:u}=e;i&&u&&(u=$d(u)),l.texImage2D(l.TEXTURE_2D,0,this.format,n,s,0,this.format,l.UNSIGNED_BYTE,u)}_updateDomImage(e,i,n,s){s.texSubImage2D(s.TEXTURE_2D,0,i,n,s.RGBA,s.UNSIGNED_BYTE,e)}_updateRawData(e,i,n,s,l,u,p){let{data:g}=e;i&&g&&(g=$d(g)),p.texSubImage2D(p.TEXTURE_2D,0,n,s,l,u,p.RGBA,p.UNSIGNED_BYTE,g)}bind(e,i,n){const{context:s}=this,{gl:l}=s;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),l.bindTexture(l.TEXTURE_2D,this.texture),n!==l.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=l.LINEAR),e!==this.filter&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,e),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,n||e),this.filter=e),i!==this.wrap&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,i),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,i),this.wrap=i)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class Yd{constructor(e,i,n,s=1,l=1,u=1,p=0){if(this.uid=e,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(n&&!["mapbox","terrarium","custom"].includes(n))return void Kt(`"${n}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=i.height;const g=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),n){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=s,this.greenFactor=l,this.blueFactor=u,this.baseShift=p;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let m=0;m<g;m++)this.data[this._idx(-1,m)]=this.data[this._idx(0,m)],this.data[this._idx(g,m)]=this.data[this._idx(g-1,m)],this.data[this._idx(m,-1)]=this.data[this._idx(m,0)],this.data[this._idx(m,g)]=this.data[this._idx(m,g-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(g,-1)]=this.data[this._idx(g-1,0)],this.data[this._idx(-1,g)]=this.data[this._idx(0,g-1)],this.data[this._idx(g,g)]=this.data[this._idx(g-1,g-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let m=0;m<g;m++)for(let v=0;v<g;v++){const _=this.get(m,v);_>this.max&&(this.max=_),_<this.min&&(this.min=_)}}get(e,i){const n=new Uint8Array(this.data.buffer),s=4*this._idx(e,i);return this.unpack(n[s],n[s+1],n[s+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,i){if(e<-1||e>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${i}, dim: ${this.dim}`);return(i+1)*this.stride+(e+1)}unpack(e,i,n){return e*this.redFactor+i*this.greenFactor+n*this.blueFactor-this.baseShift}pack(e){return Kd(e,this.getUnpackVector())}getPixels(){return new Ki({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,i,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let s=i*this.dim,l=i*this.dim+this.dim,u=n*this.dim,p=n*this.dim+this.dim;switch(i){case-1:s=l-1;break;case 1:l=s+1}switch(n){case-1:u=p-1;break;case 1:p=u+1}const g=-i*this.dim,m=-n*this.dim;for(let v=u;v<p;v++)for(let _=s;_<l;_++)this.data[this._idx(_,v)]=e.data[this._idx(_+g,v+m)]}}function Kd(r,e){const i=e[0],n=e[1],s=e[2],l=e[3],u=Math.min(i,n,s),p=Math.round((r+l)/u);return{r:Math.floor(p*u/i)%256,g:Math.floor(p*u/n)%256,b:Math.floor(p*u/s)%256}}Ee("DEMData",Yd);class qm extends nr{constructor(e,i){super(e,$m,i)}_createColorRamp(e){const i={elevationStops:[],colorStops:[]},n=this._transitionablePaint._values["color-relief-color"].value.expression;if(n instanceof qs&&n._styleExpression.expression instanceof Gt){this.colorRampExpression=n;const u=n._styleExpression.expression;i.elevationStops=u.labels,i.colorStops=[];for(const p of i.elevationStops)i.colorStops.push(u.evaluate({globals:{elevation:p}}))}if(i.elevationStops.length<1&&(i.elevationStops=[0],i.colorStops=[He.transparent]),i.elevationStops.length<2&&(i.elevationStops.push(i.elevationStops[0]+1),i.colorStops.push(i.colorStops[0])),i.elevationStops.length<=e)return i;const s={elevationStops:[],colorStops:[]},l=(i.elevationStops.length-1)/(e-1);for(let u=0;u<i.elevationStops.length-.5;u+=l)s.elevationStops.push(i.elevationStops[Math.round(u)]),s.colorStops.push(i.colorStops[Math.round(u)]);return Kt(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${i.elevationStops.length}`),s}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,i,n){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;const s=this._createColorRamp(i),l=new Ki({width:s.colorStops.length,height:1}),u=new Ki({width:s.colorStops.length,height:1});for(let p=0;p<s.elevationStops.length;p++){const g=Kd(s.elevationStops[p],n);u.setPixel(0,p,new He(g.r/255,g.g/255,g.b/255,1)),l.setPixel(0,p,s.colorStops[p])}return this.colorRampTextures={elevationTexture:new Ph(e,u,e.gl.RGBA),colorTexture:new Ph(e,l,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}const Wm=wt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Hm}=Wm;function yu(r,e,i){const n=i.patternDependencies;let s=!1;for(const l of e){const u=l.paint.get(`${r}-pattern`);u.isConstant()||(s=!0);const p=u.constantOr(null);p&&(s=!0,n[p.to]=!0,n[p.from]=!0)}return s}function Mh(r,e,i,n,s){const{zoom:l}=n,u=s.patternDependencies;for(const p of e){const g=p.paint.get(`${r}-pattern`).value;if(g.kind!=="constant"){let m=g.evaluate({zoom:l-1},i,{},s.availableImages),v=g.evaluate({zoom:l},i,{},s.availableImages),_=g.evaluate({zoom:l+1},i,{},s.availableImages);m=m?.name?m.name:m,v=v?.name?v.name:v,_=_?.name?_.name:_,u[m]=!0,u[v]=!0,u[_]=!0,i.patterns[p.id]={min:m,mid:v,max:_}}}return i}function Jd(r,e,i,n,s){let l;if(s===(function(u,p,g,m){let v=0;for(let _=p,T=g-m;_<g;_+=m)v+=(u[T]-u[_])*(u[_+1]+u[T+1]),T=_;return v})(r,e,i,n)>0)for(let u=e;u<i;u+=n)l=ip(u/n|0,r[u],r[u+1],l);else for(let u=i-n;u>=e;u-=n)l=ip(u/n|0,r[u],r[u+1],l);return l&&go(l,l.next)&&(Xl(l),l=l.next),l}function cs(r,e){if(!r)return r;e||(e=r);let i,n=r;do if(i=!1,n.steiner||!go(n,n.next)&&qt(n.prev,n,n.next)!==0)n=n.next;else{if(Xl(n),n=e=n.prev,n===n.next)break;i=!0}while(i||n!==e);return e}function ql(r,e,i,n,s,l,u){if(!r)return;!u&&l&&(function(g,m,v,_){let T=g;do T.z===0&&(T.z=Ih(T.x,T.y,m,v,_)),T.prevZ=T.prev,T.nextZ=T.next,T=T.next;while(T!==g);T.prevZ.nextZ=null,T.prevZ=null,(function(b){let M,I=1;do{let A,D=b;b=null;let L=null;for(M=0;D;){M++;let R=D,F=0;for(let V=0;V<I&&(F++,R=R.nextZ,R);V++);let O=I;for(;F>0||O>0&&R;)F!==0&&(O===0||!R||D.z<=R.z)?(A=D,D=D.nextZ,F--):(A=R,R=R.nextZ,O--),L?L.nextZ=A:b=A,A.prevZ=L,L=A;D=R}L.nextZ=null,I*=2}while(M>1)})(T)})(r,n,s,l);let p=r;for(;r.prev!==r.next;){const g=r.prev,m=r.next;if(l?Ym(r,n,s,l):Xm(r))e.push(g.i,r.i,m.i),Xl(r),r=m.next,p=m.next;else if((r=m)===p){u?u===1?ql(r=Km(cs(r),e),e,i,n,s,l,2):u===2&&Jm(r,e,i,n,s,l):ql(cs(r),e,i,n,s,l,1);break}}}function Xm(r){const e=r.prev,i=r,n=r.next;if(qt(e,i,n)>=0)return!1;const s=e.x,l=i.x,u=n.x,p=e.y,g=i.y,m=n.y,v=Math.min(s,l,u),_=Math.min(p,g,m),T=Math.max(s,l,u),b=Math.max(p,g,m);let M=n.next;for(;M!==e;){if(M.x>=v&&M.x<=T&&M.y>=_&&M.y<=b&&Wl(s,p,l,g,u,m,M.x,M.y)&&qt(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function Ym(r,e,i,n){const s=r.prev,l=r,u=r.next;if(qt(s,l,u)>=0)return!1;const p=s.x,g=l.x,m=u.x,v=s.y,_=l.y,T=u.y,b=Math.min(p,g,m),M=Math.min(v,_,T),I=Math.max(p,g,m),A=Math.max(v,_,T),D=Ih(b,M,e,i,n),L=Ih(I,A,e,i,n);let R=r.prevZ,F=r.nextZ;for(;R&&R.z>=D&&F&&F.z<=L;){if(R.x>=b&&R.x<=I&&R.y>=M&&R.y<=A&&R!==s&&R!==u&&Wl(p,v,g,_,m,T,R.x,R.y)&&qt(R.prev,R,R.next)>=0||(R=R.prevZ,F.x>=b&&F.x<=I&&F.y>=M&&F.y<=A&&F!==s&&F!==u&&Wl(p,v,g,_,m,T,F.x,F.y)&&qt(F.prev,F,F.next)>=0))return!1;F=F.nextZ}for(;R&&R.z>=D;){if(R.x>=b&&R.x<=I&&R.y>=M&&R.y<=A&&R!==s&&R!==u&&Wl(p,v,g,_,m,T,R.x,R.y)&&qt(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;F&&F.z<=L;){if(F.x>=b&&F.x<=I&&F.y>=M&&F.y<=A&&F!==s&&F!==u&&Wl(p,v,g,_,m,T,F.x,F.y)&&qt(F.prev,F,F.next)>=0)return!1;F=F.nextZ}return!0}function Km(r,e){let i=r;do{const n=i.prev,s=i.next.next;!go(n,s)&&ep(n,i,i.next,s)&&Hl(n,s)&&Hl(s,n)&&(e.push(n.i,i.i,s.i),Xl(i),Xl(i.next),i=r=s),i=i.next}while(i!==r);return cs(i)}function Jm(r,e,i,n,s,l){let u=r;do{let p=u.next.next;for(;p!==u.prev;){if(u.i!==p.i&&rg(u,p)){let g=tp(u,p);return u=cs(u,u.next),g=cs(g,g.next),ql(u,e,i,n,s,l,0),void ql(g,e,i,n,s,l,0)}p=p.next}u=u.next}while(u!==r)}function Qm(r,e){let i=r.x-e.x;return i===0&&(i=r.y-e.y,i===0)&&(i=(r.next.y-r.y)/(r.next.x-r.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function eg(r,e){const i=(function(s,l){let u=l;const p=s.x,g=s.y;let m,v=-1/0;if(go(s,u))return u;do{if(go(s,u.next))return u.next;if(g<=u.y&&g>=u.next.y&&u.next.y!==u.y){const I=u.x+(g-u.y)*(u.next.x-u.x)/(u.next.y-u.y);if(I<=p&&I>v&&(v=I,m=u.x<u.next.x?u:u.next,I===p))return m}u=u.next}while(u!==l);if(!m)return null;const _=m,T=m.x,b=m.y;let M=1/0;u=m;do{if(p>=u.x&&u.x>=T&&p!==u.x&&Qd(g<b?p:v,g,T,b,g<b?v:p,g,u.x,u.y)){const I=Math.abs(g-u.y)/(p-u.x);Hl(u,s)&&(I<M||I===M&&(u.x>m.x||u.x===m.x&&tg(m,u)))&&(m=u,M=I)}u=u.next}while(u!==_);return m})(r,e);if(!i)return e;const n=tp(i,r);return cs(n,n.next),cs(i,i.next)}function tg(r,e){return qt(r.prev,r,e.prev)<0&&qt(e.next,r,r.next)<0}function Ih(r,e,i,n,s){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*s|0)|r<<8))|r<<4))|r<<2))|r<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ig(r){let e=r,i=r;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==r);return i}function Qd(r,e,i,n,s,l,u,p){return(s-u)*(e-p)>=(r-u)*(l-p)&&(r-u)*(n-p)>=(i-u)*(e-p)&&(i-u)*(l-p)>=(s-u)*(n-p)}function Wl(r,e,i,n,s,l,u,p){return!(r===u&&e===p)&&Qd(r,e,i,n,s,l,u,p)}function rg(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!(function(i,n){let s=i;do{if(s.i!==i.i&&s.next.i!==i.i&&s.i!==n.i&&s.next.i!==n.i&&ep(s,s.next,i,n))return!0;s=s.next}while(s!==i);return!1})(r,e)&&(Hl(r,e)&&Hl(e,r)&&(function(i,n){let s=i,l=!1;const u=(i.x+n.x)/2,p=(i.y+n.y)/2;do s.y>p!=s.next.y>p&&s.next.y!==s.y&&u<(s.next.x-s.x)*(p-s.y)/(s.next.y-s.y)+s.x&&(l=!l),s=s.next;while(s!==i);return l})(r,e)&&(qt(r.prev,r,e.prev)||qt(r,e.prev,e))||go(r,e)&&qt(r.prev,r,r.next)>0&&qt(e.prev,e,e.next)>0)}function qt(r,e,i){return(e.y-r.y)*(i.x-e.x)-(e.x-r.x)*(i.y-e.y)}function go(r,e){return r.x===e.x&&r.y===e.y}function ep(r,e,i,n){const s=xu(qt(r,e,i)),l=xu(qt(r,e,n)),u=xu(qt(i,n,r)),p=xu(qt(i,n,e));return s!==l&&u!==p||!(s!==0||!vu(r,i,e))||!(l!==0||!vu(r,n,e))||!(u!==0||!vu(i,r,n))||!(p!==0||!vu(i,e,n))}function vu(r,e,i){return e.x<=Math.max(r.x,i.x)&&e.x>=Math.min(r.x,i.x)&&e.y<=Math.max(r.y,i.y)&&e.y>=Math.min(r.y,i.y)}function xu(r){return r>0?1:r<0?-1:0}function Hl(r,e){return qt(r.prev,r,r.next)<0?qt(r,e,r.next)>=0&&qt(r,r.prev,e)>=0:qt(r,e,r.prev)<0||qt(r,r.next,e)<0}function tp(r,e){const i=Eh(r.i,r.x,r.y),n=Eh(e.i,e.x,e.y),s=r.next,l=e.prev;return r.next=e,e.prev=r,i.next=s,s.prev=i,n.next=i,i.prev=n,l.next=n,n.prev=l,n}function ip(r,e,i,n){const s=Eh(r,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function Xl(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Eh(r,e,i){return{i:r,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class _o{constructor(e,i){if(i>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=i}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}}class bu{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}}bu.noSubdivision=new bu({fill:new _o(0,0),line:new _o(0,0),tile:new _o(0,0),stencil:new _o(0,0),circle:1}),Ee("SubdivisionGranularityExpression",_o),Ee("SubdivisionGranularitySetting",bu);const yo=-32768,Yl=32767;class ag{constructor(e,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=Le/e,this._canonical=i}_getKey(e,i){return(e+=32768)<<16|i+32768}_vertexToIndex(e,i){if(e<-32768||i<-32768||e>32767||i>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const n=0|Math.round(e),s=0|Math.round(i),l=this._getKey(n,s);if(this._vertexDictionary.has(l))return this._vertexDictionary.get(l);const u=this._vertexBuffer.length/2;return this._vertexDictionary.set(l,u),this._vertexBuffer.push(n,s),u}_subdivideTrianglesScanline(e){if(this._granularity<2)return(function(s,l){const u=[];for(let p=0;p<l.length;p+=3){const g=l[p],m=l[p+1],v=l[p+2],_=s[2*g],T=s[2*g+1];(s[2*m]-_)*(s[2*v+1]-T)-(s[2*m+1]-T)*(s[2*v]-_)>0?(u.push(g),u.push(v),u.push(m)):(u.push(g),u.push(m),u.push(v))}return u})(this._vertexBuffer,e);const i=[],n=e.length;for(let s=0;s<n;s+=3){const l=[e[s+0],e[s+1],e[s+2]],u=[this._vertexBuffer[2*e[s+0]+0],this._vertexBuffer[2*e[s+0]+1],this._vertexBuffer[2*e[s+1]+0],this._vertexBuffer[2*e[s+1]+1],this._vertexBuffer[2*e[s+2]+0],this._vertexBuffer[2*e[s+2]+1]];let p=1/0,g=1/0,m=-1/0,v=-1/0;for(let I=0;I<3;I++){const A=u[2*I],D=u[2*I+1];p=Math.min(p,A),m=Math.max(m,A),g=Math.min(g,D),v=Math.max(v,D)}if(p===m||g===v)continue;const _=Math.floor(p/this._granularityCellSize),T=Math.ceil(m/this._granularityCellSize),b=Math.floor(g/this._granularityCellSize),M=Math.ceil(v/this._granularityCellSize);if(_!==T||b!==M)for(let I=b;I<M;I++){const A=this._scanlineGenerateVertexRingForCellRow(I,u,l);ng(this._vertexBuffer,A,i)}else i.push(...l)}return i}_scanlineGenerateVertexRingForCellRow(e,i,n){const s=e*this._granularityCellSize,l=s+this._granularityCellSize,u=[];for(let p=0;p<3;p++){const g=i[2*p],m=i[2*p+1],v=i[2*(p+1)%6],_=i[(2*(p+1)+1)%6],T=i[2*(p+2)%6],b=i[(2*(p+2)+1)%6],M=v-g,I=_-m,A=M===0,D=I===0,L=(s-m)/I,R=(l-m)/I,F=Math.min(L,R),O=Math.max(L,R);if(!D&&(F>=1||O<=0)||D&&(m<s||m>l)){_>=s&&_<=l&&u.push(n[(p+1)%3]);continue}!D&&F>0&&u.push(this._vertexToIndex(g+M*F,m+I*F));const V=g+M*Math.max(F,0),Y=g+M*Math.min(O,1);A||this._generateIntraEdgeVertices(u,g,m,v,_,V,Y),!D&&O<1&&u.push(this._vertexToIndex(g+M*O,m+I*O)),(D||_>=s&&_<=l)&&u.push(n[(p+1)%3]),!D&&(_<=s||_>=l)&&this._generateInterEdgeVertices(u,g,m,v,_,T,b,Y,s,l)}return u}_generateIntraEdgeVertices(e,i,n,s,l,u,p){const g=s-i,m=l-n,v=m===0,_=v?Math.min(i,s):Math.min(u,p),T=v?Math.max(i,s):Math.max(u,p),b=Math.floor(_/this._granularityCellSize)+1,M=Math.ceil(T/this._granularityCellSize)-1;if(v?i<s:u<p)for(let I=b;I<=M;I++){const A=I*this._granularityCellSize;e.push(this._vertexToIndex(A,n+m*(A-i)/g))}else for(let I=M;I>=b;I--){const A=I*this._granularityCellSize;e.push(this._vertexToIndex(A,n+m*(A-i)/g))}}_generateInterEdgeVertices(e,i,n,s,l,u,p,g,m,v){const _=l-n,T=u-s,b=p-l,M=(m-l)/b,I=(v-l)/b,A=Math.min(M,I),D=Math.max(M,I),L=s+T*A;let R=Math.floor(Math.min(L,g)/this._granularityCellSize)+1,F=Math.ceil(Math.max(L,g)/this._granularityCellSize)-1,O=g<L;const V=b===0;if(V&&(p===m||p===v))return;if(V||A>=1||D<=0){const J=n-p,re=u+(i-u)*Math.min((m-p)/J,(v-p)/J);R=Math.floor(Math.min(re,g)/this._granularityCellSize)+1,F=Math.ceil(Math.max(re,g)/this._granularityCellSize)-1,O=g<re}const Y=_>0?v:m;if(O)for(let J=R;J<=F;J++)e.push(this._vertexToIndex(J*this._granularityCellSize,Y));else for(let J=F;J>=R;J--)e.push(this._vertexToIndex(J*this._granularityCellSize,Y))}_generateOutline(e){const i=[];for(const n of e){const s=us(n,this._granularity,!0),l=this._pointArrayToIndices(s),u=[];for(let p=1;p<l.length;p++)u.push(l[p-1]),u.push(l[p]);i.push(u)}return i}_handlePoles(e){let i=!1,n=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(n=!0)),(i||n)&&this._fillPoles(e,i,n)}_ensureNoPoleVertices(){const e=this._vertexBuffer;for(let i=0;i<e.length;i+=2){const n=e[i+1];n===yo&&(e[i+1]=-32767),n===Yl&&(e[i+1]=32766)}}_generatePoleQuad(e,i,n,s,l,u){s>l!=(u===yo)?(e.push(i),e.push(n),e.push(this._vertexToIndex(s,u)),e.push(n),e.push(this._vertexToIndex(l,u)),e.push(this._vertexToIndex(s,u))):(e.push(n),e.push(i),e.push(this._vertexToIndex(s,u)),e.push(this._vertexToIndex(l,u)),e.push(n),e.push(this._vertexToIndex(s,u)))}_fillPoles(e,i,n){const s=this._vertexBuffer,l=Le,u=e.length;for(let p=2;p<u;p+=3){const g=e[p-2],m=e[p-1],v=e[p],_=s[2*g],T=s[2*g+1],b=s[2*m],M=s[2*m+1],I=s[2*v],A=s[2*v+1];i&&(T===0&&M===0&&this._generatePoleQuad(e,g,m,_,b,yo),M===0&&A===0&&this._generatePoleQuad(e,m,v,b,I,yo),A===0&&T===0&&this._generatePoleQuad(e,v,g,I,_,yo)),n&&(T===l&&M===l&&this._generatePoleQuad(e,g,m,_,b,Yl),M===l&&A===l&&this._generatePoleQuad(e,m,v,b,I,Yl),A===l&&T===l&&this._generatePoleQuad(e,v,g,I,_,Yl))}}_initializeVertices(e){for(let i=0;i<e.length;i+=2)this._vertexToIndex(e[i],e[i+1])}subdividePolygonInternal(e,i){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:n,holeIndices:s}=(function(p){const g=[],m=[];for(const v of p)if(v.length!==0){v!==p[0]&&g.push(m.length/2);for(const _ of v)m.push(_.x),m.push(_.y)}return{flattened:m,holeIndices:g}})(e);let l;this._initializeVertices(n);try{const p=(function(m,v,_=2){const T=v&&v.length,b=T?v[0]*_:m.length;let M=Jd(m,0,b,_,!0);const I=[];if(!M||M.next===M.prev)return I;let A,D,L;if(T&&(M=(function(R,F,O,V){const Y=[];for(let J=0,re=F.length;J<re;J++){const te=Jd(R,F[J]*V,J<re-1?F[J+1]*V:R.length,V,!1);te===te.next&&(te.steiner=!0),Y.push(ig(te))}Y.sort(Qm);for(let J=0;J<Y.length;J++)O=eg(Y[J],O);return O})(m,v,M,_)),m.length>80*_){A=m[0],D=m[1];let R=A,F=D;for(let O=_;O<b;O+=_){const V=m[O],Y=m[O+1];V<A&&(A=V),Y<D&&(D=Y),V>R&&(R=V),Y>F&&(F=Y)}L=Math.max(R-A,F-D),L=L!==0?32767/L:0}return ql(M,I,_,A,D,L,0),I})(n,s),g=this._convertIndices(n,p);l=this._subdivideTrianglesScanline(g)}catch(p){console.error(p)}let u=[];return i&&(u=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(l),{verticesFlattened:this._vertexBuffer,indicesTriangles:l,indicesLineList:u}}_convertIndices(e,i){const n=[];for(const s of i)n.push(this._vertexToIndex(e[2*s],e[2*s+1]));return n}_pointArrayToIndices(e){const i=[];for(const n of e)i.push(this._vertexToIndex(n.x,n.y));return i}}function rp(r,e,i,n=!0){return new ag(i,e).subdividePolygonInternal(r,n)}function us(r,e,i=!1){if(!r||r.length<1)return[];if(r.length<2)return[];const n=r[0],s=r[r.length-1],l=i&&(n.x!==s.x||n.y!==s.y);if(e<2)return l?[...r,r[0]]:[...r];const u=Math.floor(Le/e),p=[];p.push(new ge(r[0].x,r[0].y));const g=r.length,m=l?g:g-1;for(let v=0;v<m;v++){const _=r[v],T=v<g-1?r[v+1]:r[0],b=_.x,M=_.y,I=T.x,A=T.y,D=b!==I,L=M!==A;if(!D&&!L)continue;const R=I-b,F=A-M,O=Math.abs(R),V=Math.abs(F);let Y=b,J=M;for(;;){const te=R>0?(Math.floor(Y/u)+1)*u:(Math.ceil(Y/u)-1)*u,oe=F>0?(Math.floor(J/u)+1)*u:(Math.ceil(J/u)-1)*u,le=Math.abs(Y-te),ae=Math.abs(J-oe),ie=Math.abs(Y-I),ye=Math.abs(J-A),Se=D?le/O:Number.POSITIVE_INFINITY,we=L?ae/V:Number.POSITIVE_INFINITY;if((ie<=le||!D)&&(ye<=ae||!L))break;if(Se<we&&D||!L){Y=te,J+=F*Se;const xe=new ge(Y,Math.round(J));p[p.length-1].x===xe.x&&p[p.length-1].y===xe.y||p.push(xe)}else{Y+=R*we,J=oe;const xe=new ge(Math.round(Y),J);p[p.length-1].x===xe.x&&p[p.length-1].y===xe.y||p.push(xe)}}const re=new ge(I,A);p[p.length-1].x===re.x&&p[p.length-1].y===re.y||p.push(re)}return p}function ng(r,e,i){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let n=0,s=r[2*e[0]];for(let g=1;g<e.length;g++){const m=r[2*e[g]];m<s&&(s=m,n=g)}const l=e.length;let u=n,p=(u+1)%l;for(;;){const g=u-1>=0?u-1:l-1,m=(p+1)%l,v=r[2*e[g]],_=r[2*e[m]],T=r[2*e[u]],b=r[2*e[u]+1],M=r[2*e[p]+1];let I=!1;if(v<_)I=!0;else if(v>_)I=!1;else{const A=M-b,D=-(r[2*e[p]]-T),L=b<M?1:-1;((v-T)*A+(r[2*e[g]+1]-b)*D)*L>((_-T)*A+(r[2*e[m]+1]-b)*D)*L&&(I=!0)}if(I){const A=e[g],D=e[u],L=e[p];A!==D&&A!==L&&D!==L&&i.push(L,D,A),u--,u<0&&(u=l-1)}else{const A=e[m],D=e[u],L=e[p];A!==D&&A!==L&&D!==L&&i.push(L,D,A),p++,p>=l&&(p=0)}if(g===m)break}}function ap(r,e,i,n,s,l,u,p,g){const m=s.length/2,v=u&&p&&g;if(m<Me.MAX_VERTEX_ARRAY_LENGTH){const _=e.prepareSegment(m,i,n),T=_.vertexLength;for(let I=0;I<l.length;I+=3)n.emplaceBack(T+l[I],T+l[I+1],T+l[I+2]);let b,M;_.vertexLength+=m,_.primitiveLength+=l.length/3,v&&(M=u.prepareSegment(m,i,p),b=M.vertexLength,M.vertexLength+=m);for(let I=0;I<s.length;I+=2)r(s[I],s[I+1]);if(v)for(const I of g){for(let A=1;A<I.length;A+=2)p.emplaceBack(b+I[A-1],b+I[A]);M.primitiveLength+=I.length/2}}else(function(_,T,b,M,I,A){const D=[];for(let V=0;V<M.length/2;V++)D.push(-1);const L={count:0};let R=0,F=_.getOrCreateLatestSegment(T,b),O=F.vertexLength;for(let V=2;V<I.length;V+=3){const Y=I[V-2],J=I[V-1],re=I[V];let te=D[Y]<R,oe=D[J]<R,le=D[re]<R;F.vertexLength+((te?1:0)+(oe?1:0)+(le?1:0))>Me.MAX_VERTEX_ARRAY_LENGTH&&(F=_.createNewSegment(T,b),R=L.count,te=!0,oe=!0,le=!0,O=0);const ae=Kl(D,M,A,L,Y,te,F),ie=Kl(D,M,A,L,J,oe,F),ye=Kl(D,M,A,L,re,le,F);b.emplaceBack(O+ae-R,O+ie-R,O+ye-R),F.primitiveLength++}})(e,i,n,s,l,r),v&&(function(_,T,b,M,I,A){const D=[];for(let V=0;V<M.length/2;V++)D.push(-1);const L={count:0};let R=0,F=_.getOrCreateLatestSegment(T,b),O=F.vertexLength;for(const V of I)for(let Y=1;Y<V.length;Y+=2){const J=V[Y-1],re=V[Y];let te=D[J]<R,oe=D[re]<R;F.vertexLength+((te?1:0)+(oe?1:0))>Me.MAX_VERTEX_ARRAY_LENGTH&&(F=_.createNewSegment(T,b),R=L.count,te=!0,oe=!0,O=0);const le=Kl(D,M,A,L,J,te,F),ae=Kl(D,M,A,L,re,oe,F);b.emplaceBack(O+le-R,O+ae-R),F.primitiveLength++}})(u,i,p,s,g,r),e.forceNewSegmentOnNextPrepare(),u?.forceNewSegmentOnNextPrepare()}function Kl(r,e,i,n,s,l,u){if(l){const p=n.count;return i(e[2*s],e[2*s+1]),r[s]=n.count,n.count++,u.vertexLength++,p}return r[s]}class Ch{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new j,this.indexArray=new pe,this.indexArray2=new Ae,this.programConfigurations=new Ur(e.layers,e.zoom),this.segments=new Me,this.segments2=new Me,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,n){this.hasDependencies=yu("fill",this.layers,i);const s=this.layers[0].layout.get("fill-sort-key"),l=!s.isConstant(),u=[];for(const{feature:p,id:g,index:m,sourceLayerIndex:v}of e){const _=this.layers[0]._featureFilter.needGeometry,T=ua(p,_);if(!this.layers[0]._featureFilter.filter(new vt(this.zoom),T,n))continue;const b=l?s.evaluate(T,{},n,i.availableImages):void 0,M={id:g,properties:p.properties,type:p.type,sourceLayerIndex:v,index:m,geometry:_?T.geometry:ca(p),patterns:{},sortKey:b};u.push(M)}l&&u.sort(((p,g)=>p.sortKey-g.sortKey));for(const p of u){const{geometry:g,index:m,sourceLayerIndex:v}=p;if(this.hasDependencies){const _=Mh("fill",this.layers,p,{zoom:this.zoom},i);this.patternFeatures.push(_)}else this.addFeature(p,g,m,n,{},i.subdivisionGranularity);i.featureIndex.insert(e[m].feature,g,m,v,this.index)}}update(e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:n})}addFeatures(e,i,n){for(const s of this.patternFeatures)this.addFeature(s,s.geometry,s.index,i,n,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Hm),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,i,n,s,l,u){for(const p of Fs(i,500)){const g=rp(p,s,u.fill.getGranularityForZoomLevel(s.z)),m=this.layoutVertexArray;ap(((v,_)=>{m.emplaceBack(v,_)}),this.segments,this.layoutVertexArray,this.indexArray,g.verticesFlattened,g.indicesTriangles,this.segments2,this.indexArray2,g.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:l,canonical:s})}}let np,sp;Ee("FillBucket",Ch,{omit:["layers","patternFeatures"]});var sg={get paint(){return sp=sp||new Di({"fill-antialias":new De(ce.paint_fill["fill-antialias"]),"fill-opacity":new ke(ce.paint_fill["fill-opacity"]),"fill-color":new ke(ce.paint_fill["fill-color"]),"fill-outline-color":new ke(ce.paint_fill["fill-outline-color"]),"fill-translate":new De(ce.paint_fill["fill-translate"]),"fill-translate-anchor":new De(ce.paint_fill["fill-translate-anchor"]),"fill-pattern":new ra(ce.paint_fill["fill-pattern"])})},get layout(){return np=np||new Di({"fill-sort-key":new ke(ce.layout_fill["fill-sort-key"])})}};class og extends nr{constructor(e,i){super(e,sg,i)}recalculate(e,i){super.recalculate(e,i);const n=this.paint._values["fill-outline-color"];n.value.kind==="constant"&&n.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Ch(e)}queryRadius(){return gu(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:i,transform:n,pixelsToTileUnits:s}){return Fd(_u(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-n.bearingInRadians,s),i)}isTileClipped(){return!0}}const lg=wt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),cg=wt([{name:"a_centroid",components:2,type:"Int16"}],4),{members:ug}=lg;class Jl{constructor(e,i,n,s,l){this.properties={},this.extent=n,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=s,this._values=l,e.readFields(hg,this,i)}loadGeometry(){const e=this._pbf;e.pos=this._geometry;const i=e.readVarint()+e.pos,n=[];let s,l=1,u=0,p=0,g=0;for(;e.pos<i;){if(u<=0){const m=e.readVarint();l=7&m,u=m>>3}if(u--,l===1||l===2)p+=e.readSVarint(),g+=e.readSVarint(),l===1&&(s&&n.push(s),s=[]),s&&s.push(new ge(p,g));else{if(l!==7)throw new Error(`unknown command ${l}`);s&&s.push(s[0].clone())}}return s&&n.push(s),n}bbox(){const e=this._pbf;e.pos=this._geometry;const i=e.readVarint()+e.pos;let n=1,s=0,l=0,u=0,p=1/0,g=-1/0,m=1/0,v=-1/0;for(;e.pos<i;){if(s<=0){const _=e.readVarint();n=7&_,s=_>>3}if(s--,n===1||n===2)l+=e.readSVarint(),u+=e.readSVarint(),l<p&&(p=l),l>g&&(g=l),u<m&&(m=u),u>v&&(v=u);else if(n!==7)throw new Error(`unknown command ${n}`)}return[p,m,g,v]}toGeoJSON(e,i,n){const s=this.extent*Math.pow(2,n),l=this.extent*e,u=this.extent*i,p=this.loadGeometry();function g(T){return[360*(T.x+l)/s-180,360/Math.PI*Math.atan(Math.exp((1-2*(T.y+u)/s)*Math.PI))-90]}function m(T){return T.map(g)}let v;if(this.type===1){const T=[];for(const M of p)T.push(M[0]);const b=m(T);v=T.length===1?{type:"Point",coordinates:b[0]}:{type:"MultiPoint",coordinates:b}}else if(this.type===2){const T=p.map(m);v=T.length===1?{type:"LineString",coordinates:T[0]}:{type:"MultiLineString",coordinates:T}}else{if(this.type!==3)throw new Error("unknown feature type");{const T=op(p),b=[];for(const M of T)b.push(M.map(m));v=b.length===1?{type:"Polygon",coordinates:b[0]}:{type:"MultiPolygon",coordinates:b}}}const _={type:"Feature",geometry:v,properties:this.properties};return this.id!=null&&(_.id=this.id),_}}function hg(r,e,i){r===1?e.id=i.readVarint():r===2?(function(n,s){const l=n.readVarint()+n.pos;for(;n.pos<l;){const u=s._keys[n.readVarint()],p=s._values[n.readVarint()];s.properties[u]=p}})(i,e):r===3?e.type=i.readVarint():r===4&&(e._geometry=i.pos)}function op(r){const e=r.length;if(e<=1)return[r];const i=[];let n,s;for(let l=0;l<e;l++){const u=dg(r[l]);u!==0&&(s===void 0&&(s=u<0),s===u<0?(n&&i.push(n),n=[r[l]]):n&&n.push(r[l]))}return n&&i.push(n),i}function dg(r){let e=0;for(let i,n,s=0,l=r.length,u=l-1;s<l;u=s++)i=r[s],n=r[u],e+=(n.x-i.x)*(i.y+n.y);return e}Jl.types=["Unknown","Point","LineString","Polygon"];class pg{constructor(e,i){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(fg,this,i),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const i=this._pbf.readVarint()+this._pbf.pos;return new Jl(this._pbf,i,this.extent,this._keys,this._values)}}function fg(r,e,i){r===15?e.version=i.readVarint():r===1?e.name=i.readString():r===5?e.extent=i.readVarint():r===2?e._features.push(i.pos):r===3?e._keys.push(i.readString()):r===4&&e._values.push((function(n){let s=null;const l=n.readVarint()+n.pos;for(;n.pos<l;){const u=n.readVarint()>>3;s=u===1?n.readString():u===2?n.readFloat():u===3?n.readDouble():u===4?n.readVarint64():u===5?n.readVarint():u===6?n.readSVarint():u===7?n.readBoolean():null}if(s==null)throw new Error("unknown feature value");return s})(i))}class lp{constructor(e,i){this.layers=e.readFields(mg,{},i)}}function mg(r,e,i){if(r===3){const n=new pg(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}const Ah=Math.pow(2,13);function Ql(r,e,i,n,s,l,u,p){r.emplaceBack(e,i,2*Math.floor(n*Ah)+u,s*Ah*2,l*Ah*2,Math.round(p))}class Dh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new G,this.centroidVertexArray=new N,this.indexArray=new pe,this.programConfigurations=new Ur(e.layers,e.zoom),this.segments=new Me,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,n){this.features=[],this.hasDependencies=yu("fill-extrusion",this.layers,i);for(const{feature:s,id:l,index:u,sourceLayerIndex:p}of e){const g=this.layers[0]._featureFilter.needGeometry,m=ua(s,g);if(!this.layers[0]._featureFilter.filter(new vt(this.zoom),m,n))continue;const v={id:l,sourceLayerIndex:p,index:u,geometry:g?m.geometry:ca(s),properties:s.properties,type:s.type,patterns:{}};this.hasDependencies?this.features.push(Mh("fill-extrusion",this.layers,v,{zoom:this.zoom},i)):this.addFeature(v,v.geometry,u,n,{},i.subdivisionGranularity),i.featureIndex.insert(s,v.geometry,u,p,this.index,!0)}}addFeatures(e,i,n){for(const s of this.features){const{geometry:l}=s;this.addFeature(s,l,s.index,i,n,e.subdivisionGranularity)}}update(e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:n})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ug),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,cg.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,i,n,s,l,u){for(const p of Fs(i,500)){const g={x:0,y:0,sampleCount:0},m=this.layoutVertexArray.length;this.processPolygon(g,s,e,p,u);const v=this.layoutVertexArray.length-m,_=Math.floor(g.x/g.sampleCount),T=Math.floor(g.y/g.sampleCount);for(let b=0;b<v;b++)this.centroidVertexArray.emplaceBack(_,T)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:l,canonical:s})}processPolygon(e,i,n,s,l){if(s.length<1||cp(s[0]))return;for(const _ of s)_.length!==0&&gg(e,_);const u={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},p=l.fill.getGranularityForZoomLevel(i.z),g=Jl.types[n.type]==="Polygon";for(const _ of s){if(_.length===0||cp(_))continue;const T=us(_,p,g);this._generateSideFaces(T,u)}if(!g)return;const m=rp(s,i,p,!1),v=this.layoutVertexArray;ap(((_,T)=>{Ql(v,_,T,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,m.verticesFlattened,m.indicesTriangles)}_generateSideFaces(e,i){let n=0;for(let s=1;s<e.length;s++){const l=e[s],u=e[s-1];if(_g(l,u))continue;i.segment.vertexLength+4>Me.MAX_VERTEX_ARRAY_LENGTH&&(i.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const p=l.sub(u)._perp()._unit(),g=u.dist(l);n+g>32768&&(n=0),Ql(this.layoutVertexArray,l.x,l.y,p.x,p.y,0,0,n),Ql(this.layoutVertexArray,l.x,l.y,p.x,p.y,0,1,n),n+=g,Ql(this.layoutVertexArray,u.x,u.y,p.x,p.y,0,0,n),Ql(this.layoutVertexArray,u.x,u.y,p.x,p.y,0,1,n);const m=i.segment.vertexLength;this.indexArray.emplaceBack(m,m+2,m+1),this.indexArray.emplaceBack(m+1,m+2,m+3),i.segment.vertexLength+=4,i.segment.primitiveLength+=2}}}function gg(r,e){for(let i=0;i<e.length;i++){const n=e[i];i===e.length-1&&e[0].x===n.x&&e[0].y===n.y||(r.x+=n.x,r.y+=n.y,r.sampleCount++)}}function _g(r,e){return r.x===e.x&&(r.x<0||r.x>Le)||r.y===e.y&&(r.y<0||r.y>Le)}function cp(r){return r.every((e=>e.x<0))||r.every((e=>e.x>Le))||r.every((e=>e.y<0))||r.every((e=>e.y>Le))}let up;Ee("FillExtrusionBucket",Dh,{omit:["layers","features"]});var yg={get paint(){return up=up||new Di({"fill-extrusion-opacity":new De(ce["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ke(ce["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new De(ce["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new De(ce["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ra(ce["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ke(ce["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ke(ce["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new De(ce["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class vg extends nr{constructor(e,i){super(e,yg,i)}createBucket(e){return new Dh(e)}queryRadius(){return gu(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:n,geometry:s,transform:l,pixelsToTileUnits:u,pixelPosMatrix:p}){const g=_u(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-l.bearingInRadians,u),m=this.paint.get("fill-extrusion-height").evaluate(i,n),v=this.paint.get("fill-extrusion-base").evaluate(i,n),_=(function(b,M){const I=[];for(const A of b){const D=[A.x,A.y,0,1];Be(D,D,M),I.push(new ge(D[0]/D[3],D[1]/D[3]))}return I})(g,p),T=(function(b,M,I,A){const D=[],L=[],R=A[8]*M,F=A[9]*M,O=A[10]*M,V=A[11]*M,Y=A[8]*I,J=A[9]*I,re=A[10]*I,te=A[11]*I;for(const oe of b){const le=[],ae=[];for(const ie of oe){const ye=ie.x,Se=ie.y,we=A[0]*ye+A[4]*Se+A[12],xe=A[1]*ye+A[5]*Se+A[13],Oe=A[2]*ye+A[6]*Se+A[14],rt=A[3]*ye+A[7]*Se+A[15],nt=Oe+O,ht=rt+V,wi=we+Y,Lt=xe+J,ti=Oe+re,oi=rt+te,Mt=new ge((we+R)/ht,(xe+F)/ht);Mt.z=nt/ht,le.push(Mt);const mi=new ge(wi/oi,Lt/oi);mi.z=ti/oi,ae.push(mi)}D.push(le),L.push(ae)}return[D,L]})(s,v,m,p);return(function(b,M,I){let A=1/0;Fd(I,M)&&(A=hp(I,M[0]));for(let D=0;D<M.length;D++){const L=M[D],R=b[D];for(let F=0;F<L.length-1;F++){const O=L[F],V=[O,L[F+1],R[F+1],R[F],O];po(I,V)&&(A=Math.min(A,hp(I,V)))}}return A!==1/0&&A})(T[0],T[1],_)}}function ec(r,e){return r.x*e.x+r.y*e.y}function hp(r,e){if(r.length===1){let i=0;const n=e[i++];let s;for(;!s||n.equals(s);)if(s=e[i++],!s)return 1/0;for(;i<e.length;i++){const l=e[i],u=r[0],p=s.sub(n),g=l.sub(n),m=u.sub(n),v=ec(p,p),_=ec(p,g),T=ec(g,g),b=ec(m,p),M=ec(m,g),I=v*T-_*_,A=(T*b-_*M)/I,D=(v*M-_*b)/I,L=n.z*(1-A-D)+s.z*A+l.z*D;if(isFinite(L))return L}return 1/0}{let i=1/0;for(const n of e)i=Math.min(i,n.z);return i}}const dp=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array
2];class wu{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,n]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(s!==1)throw new Error(`Got v${s} data when expected v1.`);const l=dp[15&n];if(!l)throw new Error("Unrecognized array type.");const[u]=new Uint16Array(e,2,1),[p]=new Uint32Array(e,4,1);return new wu(p,u,l,e)}constructor(e,i=64,n=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const l=dp.indexOf(this.ArrayType),u=2*e*this.ArrayType.BYTES_PER_ELEMENT,p=e*this.IndexArrayType.BYTES_PER_ELEMENT,g=(8-p%8)%8;if(l<0)throw new Error(`Unexpected typed array class: ${n}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+g,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+u+p+g),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+g,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+l]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=i,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return zh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,n,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:l,coords:u,nodeSize:p}=this,g=[0,l.length-1,0],m=[];for(;g.length;){const v=g.pop()||0,_=g.pop()||0,T=g.pop()||0;if(_-T<=p){for(let A=T;A<=_;A++){const D=u[2*A],L=u[2*A+1];D>=e&&D<=n&&L>=i&&L<=s&&m.push(l[A])}continue}const b=T+_>>1,M=u[2*b],I=u[2*b+1];M>=e&&M<=n&&I>=i&&I<=s&&m.push(l[b]),(v===0?e<=M:i<=I)&&(g.push(T),g.push(b-1),g.push(1-v)),(v===0?n>=M:s>=I)&&(g.push(b+1),g.push(_),g.push(1-v))}return m}within(e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:l,nodeSize:u}=this,p=[0,s.length-1,0],g=[],m=n*n;for(;p.length;){const v=p.pop()||0,_=p.pop()||0,T=p.pop()||0;if(_-T<=u){for(let A=T;A<=_;A++)fp(l[2*A],l[2*A+1],e,i)<=m&&g.push(s[A]);continue}const b=T+_>>1,M=l[2*b],I=l[2*b+1];fp(M,I,e,i)<=m&&g.push(s[b]),(v===0?e-n<=M:i-n<=I)&&(p.push(T),p.push(b-1),p.push(1-v)),(v===0?e+n>=M:i+n>=I)&&(p.push(b+1),p.push(_),p.push(1-v))}return g}}function zh(r,e,i,n,s,l){if(s-n<=i)return;const u=n+s>>1;pp(r,e,u,n,s,l),zh(r,e,i,n,u-1,1-l),zh(r,e,i,u+1,s,1-l)}function pp(r,e,i,n,s,l){for(;s>n;){if(s-n>600){const m=s-n+1,v=i-n+1,_=Math.log(m),T=.5*Math.exp(2*_/3),b=.5*Math.sqrt(_*T*(m-T)/m)*(v-m/2<0?-1:1);pp(r,e,i,Math.max(n,Math.floor(i-v*T/m+b)),Math.min(s,Math.floor(i+(m-v)*T/m+b)),l)}const u=e[2*i+l];let p=n,g=s;for(tc(r,e,n,i),e[2*s+l]>u&&tc(r,e,n,s);p<g;){for(tc(r,e,p,g),p++,g--;e[2*p+l]<u;)p++;for(;e[2*g+l]>u;)g--}e[2*n+l]===u?tc(r,e,n,g):(g++,tc(r,e,g,s)),g<=i&&(n=g+1),i<=g&&(s=g-1)}}function tc(r,e,i,n){Rh(r,i,n),Rh(e,2*i,2*n),Rh(e,2*i+1,2*n+1)}function Rh(r,e,i){const n=r[e];r[e]=r[i],r[i]=n}function fp(r,e,i,n){const s=r-i,l=e-n;return s*s+l*l}function kh(r,e,i,n){let s=n;const l=e+(i-e>>1);let u,p=i-e;const g=r[e],m=r[e+1],v=r[i],_=r[i+1];for(let T=e+3;T<i;T+=3){const b=xg(r[T],r[T+1],g,m,v,_);if(b>s)u=T,s=b;else if(b===s){const M=Math.abs(T-l);M<p&&(u=T,p=M)}}s>n&&(u-e>3&&kh(r,e,u,n),r[u+2]=s,i-u>3&&kh(r,u,i,n))}function xg(r,e,i,n,s,l){let u=s-i,p=l-n;if(u!==0||p!==0){const g=((r-i)*u+(e-n)*p)/(u*u+p*p);g>1?(i=s,n=l):g>0&&(i+=u*g,n+=p*g)}return u=r-i,p=e-n,u*u+p*p}function fi(r,e,i,n){const s={type:e,geom:i},l={id:r??null,type:s.type,geometry:s.geom,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(s.type){case"Point":case"MultiPoint":ic(l,s.geom);break;case"LineString":ic(l,s.geom.points);break;case"Polygon":ic(l,s.geom[0].points);break;case"MultiLineString":for(const u of s.geom)ic(l,u.points);break;case"MultiPolygon":for(const u of s.geom)ic(l,u[0].points)}return l}function Lh(r){r.points.length>64&&(r.points=new Float64Array(r.points))}function ic(r,e){for(let i=0;i<e.length;i+=3)r.minX=Math.min(r.minX,e[i]),r.minY=Math.min(r.minY,e[i+1]),r.maxX=Math.max(r.maxX,e[i]),r.maxY=Math.max(r.maxY,e[i+1])}function Fh(r,e){const i=[];switch(r.type){case"FeatureCollection":for(let n=0;n<r.features.length;n++)Tu(i,r.features[n],e,n);break;case"Feature":Tu(i,r,e);break;default:Tu(i,{geometry:r,properties:void 0},e)}return i}function Tu(r,e,i,n){if(!e.geometry)return;if(e.geometry.type==="GeometryCollection")return void(function(p,g,m,v,_){for(const T of m.geometries)Tu(p,{id:g.id,geometry:T,properties:g.properties},v,_)})(r,e,e.geometry,i,n);if(!e.geometry.coordinates?.length)return;const l=(function(p,g,m){return g.promoteId?p.properties?.[g.promoteId]:g.generateId?m||0:p.id})(e,i,n),u=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);switch(e.geometry.type){case"Point":return void(function(p,g,m,v){const _=[];_.push(vo(m.coordinates[0]),xo(m.coordinates[1]),0),p.push(fi(g,"Point",_,v))})(r,l,e.geometry,e.properties);case"MultiPoint":return void(function(p,g,m,v){const _=[];for(const T of m.coordinates)_.push(vo(T[0]),xo(T[1]),0);p.push(fi(g,"MultiPoint",_,v))})(r,l,e.geometry,e.properties);case"LineString":return void(function(p,g,m,v,_){const T={points:[]};Bh(m.coordinates,T,v,!1),p.push(fi(g,"LineString",T,_))})(r,l,e.geometry,u,e.properties);case"MultiLineString":return void(function(p,g,m,v,_,T){if(_.lineMetrics)for(const b of m.coordinates){const M={points:[]};Bh(b,M,v,!1),p.push(fi(g,"LineString",M,T))}else{const b=[];Oh(m.coordinates,b,v,!1),p.push(fi(g,"MultiLineString",b,T))}})(r,l,e.geometry,u,i,e.properties);case"Polygon":return void(function(p,g,m,v,_){const T=[];Oh(m.coordinates,T,v,!0),p.push(fi(g,"Polygon",T,_))})(r,l,e.geometry,u,e.properties);case"MultiPolygon":return void(function(p,g,m,v,_){const T=[];for(const b of m.coordinates){const M=[];Oh(b,M,v,!0),T.push(M)}p.push(fi(g,"MultiPolygon",T,_))})(r,l,e.geometry,u,e.properties);default:throw new Error("Input data is not a valid GeoJSON object.")}}function Bh(r,e,i,n){let s,l,u=0;for(let g=0;g<r.length;g++){const m=vo(r[g][0]),v=xo(r[g][1]);e.points.push(m,v,0),g>0&&(u+=n?(s*v-m*l)/2:Math.sqrt(Math.pow(m-s,2)+Math.pow(v-l,2))),s=m,l=v}const p=e.points.length-3;e.points[2]=1,i>0&&kh(e.points,0,p,i),e.points[p+2]=1,Lh(e),e.size=Math.abs(u),e.start=0,e.end=e.size}function Oh(r,e,i,n){for(let s=0;s<r.length;s++){const l={points:[]};Bh(r[s],l,i,n),e.push(l)}}function vo(r){return r/360+.5}function xo(r){const e=Math.sin(r*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function Su(r){const e={type:"Feature",geometry:bg(r),properties:r.tags};return r.id!=null&&(e.id=r.id),e}function bg(r){const{type:e,geometry:i}=r;switch(e){case"Point":return{type:e,coordinates:mp(i[0],i[1])};case"MultiPoint":return{type:e,coordinates:Pu(i)};case"LineString":return{type:e,coordinates:Pu(i.points)};case"MultiLineString":case"Polygon":return{type:e,coordinates:i.map((n=>Pu(n.points)))};case"MultiPolygon":return{type:e,coordinates:i.map((n=>n.map((s=>Pu(s.points)))))}}}function Pu(r){const e=[];for(let i=0;i<r.length;i+=3)e.push(mp(r[i],r[i+1]));return e}function mp(r,e){return[gp(r),_p(e)]}function gp(r){return 360*(r-.5)}function _p(r){const e=(180-360*r)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var Ri;function Ba(r,e,i,n,s,l,u,p){if(n/=e,l>=(i/=e)&&u<n)return r;if(u<i||l>=n)return null;const g=[];for(const m of r){const v=s===Ri.X?m.minX:m.minY,_=s===Ri.X?m.maxX:m.maxY;if(v>=i&&_<n)g.push(m);else if(!(_<i||v>=n))switch(m.type){case"Point":case"MultiPoint":wg(m,g,i,n,s);continue;case"LineString":Tg(m,g,i,n,s,p);continue;case"MultiLineString":Sg(m,g,i,n,s);continue;case"Polygon":Pg(m,g,i,n,s);continue;case"MultiPolygon":Mg(m,g,i,n,s);continue}}return g.length?g:null}function wg(r,e,i,n,s){const l=[];(function(u,p,g,m,v){for(let _=0;_<u.length;_+=3){const T=u[_+v];T>=g&&T<=m&&bo(p,u[_],u[_+1],u[_+2])}})(r.geometry,l,i,n,s),l.length&&e.push(fi(r.id,l.length===3?"Point":"MultiPoint",l,r.tags))}function Tg(r,e,i,n,s,l){const u=[];
2if(yp(r.geometry,u,i,n,s,!1,l.lineMetrics),u.length)if(l.lineMetrics)for(const p of u)e.push(fi(r.id,"LineString",p,r.tags));else e.push(u.length>1?fi(r.id,"MultiLineString",u,r.tags):fi(r.id,"LineString",u[0],r.tags))}function Sg(r,e,i,n,s){const l=[];Nh(r.geometry,l,i,n,s,!1),l.length&&e.push(l.length!==1?fi(r.id,"MultiLineString",l,r.tags):fi(r.id,"LineString",l[0],r.tags))}function Pg(r,e,i,n,s){const l=[];Nh(r.geometry,l,i,n,s,!0),l.length&&e.push(fi(r.id,"Polygon",l,r.tags))}function Mg(r,e,i,n,s){const l=[];for(const u of r.geometry){const p=[];Nh(u,p,i,n,s,!0),p.length&&l.push(p)}l.length&&e.push(fi(r.id,"MultiPolygon",l,r.tags))}function yp(r,e,i,n,s,l,u){let p=vp(r);const g=s===Ri.X?Ig:Eg;let m,v,_=r.start;for(let A=0;A<r.points.length-3;A+=3){const D=r.points[A],L=r.points[A+1],R=r.points[A+2],F=r.points[A+3],O=r.points[A+4],V=s===Ri.X?D:L,Y=s===Ri.X?F:O;let J=!1;u&&(m=Math.sqrt(Math.pow(D-F,2)+Math.pow(L-O,2))),V<i?Y>i&&(v=g(p,D,L,F,O,i),u&&(p.start=_+m*v)):V>n?Y<n&&(v=g(p,D,L,F,O,n),u&&(p.start=_+m*v)):bo(p.points,D,L,R),Y<i&&V>=i&&(v=g(p,D,L,F,O,i),J=!0),Y>n&&V<=n&&(v=g(p,D,L,F,O,n),J=!0),!l&&J&&(u&&(p.end=_+m*v),e.push(p),p=vp(r)),u&&(_+=m)}let T=r.points.length-3;const b=r.points[T],M=r.points[T+1],I=s===Ri.X?b:M;I>=i&&I<=n&&bo(p.points,b,M,r.points[T+2]),T=p.points.length-3,l&&T>=3&&(p.points[T]!==p.points[0]||p.points[T+1]!==p.points[1])&&bo(p.points,p.points[0],p.points[1],p.points[2]),p.points.length&&(Lh(p),e.push(p))}function vp(r){return{points:[],size:r.size,start:r.start,end:r.end}}function Nh(r,e,i,n,s,l){for(const u of r)yp(u,e,i,n,s,l,!1)}function bo(r,e,i,n){r.push(e,i,n)}function Ig(r,e,i,n,s,l){const u=(l-e)/(n-e);return bo(r.points,l,i+(s-i)*u,1),u}function Eg(r,e,i,n,s,l){const u=(l-i)/(s-i);return bo(r.points,e+(n-e)*u,l,1),u}function Vh(r,e){const i=e.buffer/e.extent;let n=r;const s=Ba(r,1,-1-i,i,Ri.X,-1,2,e),l=Ba(r,1,1-i,2+i,Ri.X,-1,2,e);return(s||l)&&(n=Ba(r,1,-i,1+i,Ri.X,-1,2,e)||[],s&&(n=xp(s,1).concat(n)),l&&(n=n.concat(xp(l,-1)))),n}function xp(r,e){const i=[];for(const n of r)switch(n.type){case"Point":case"MultiPoint":{const s=Cg(n.geometry,e);i.push(fi(n.id,n.type,s,n.tags));continue}case"LineString":{const s=jh(n.geometry,e);i.push(fi(n.id,n.type,s,n.tags));continue}case"MultiLineString":case"Polygon":{const s=[];for(const l of n.geometry)s.push(jh(l,e));i.push(fi(n.id,n.type,s,n.tags));continue}case"MultiPolygon":{const s=[];for(const l of n.geometry){const u=[];for(const p of l)u.push(jh(p,e));s.push(u)}i.push(fi(n.id,n.type,s,n.tags));continue}}return i}function Cg(r,e){const i=[];for(let n=0;n<r.length;n+=3)i.push(r[n]+e,r[n+1],r[n+2]);return i}function jh(r,e){const i={points:[],size:r.size};r.start!==void 0&&(i.start=r.start,i.end=r.end);for(let n=0;n<r.points.length;n+=3)i.points.push(r.points[n]+e,r.points[n+1],r.points[n+2]);return Lh(i),i}function Ag(r,e,i){const n=!!e.newGeometry,s=e.removeAllProperties||e.removeProperties?.length>0||e.addOrUpdateProperties?.length>0;if(n){const l=r[0];let u=Fh({type:"FeatureCollection",features:[{type:"Feature",id:l.id,geometry:e.newGeometry,properties:s?bp(l.tags,e):l.tags}]},i);return u=Vh(u,i),u}if(s){const l=[];for(const u of r){const p={...u};p.tags=bp(p.tags,e),l.push(p)}return l}return r}function bp(r,e){if(e.removeAllProperties)return{};const i={...r||{}};if(e.removeProperties)for(const n of e.removeProperties)delete i[n];if(e.addOrUpdateProperties)for(const{key:n,value:s}of e.addOrUpdateProperties)i[n]=s;return i}(function(r){r[r.X=0]="X",r[r.Y=1]="Y"})(Ri||(Ri={}));const Uh={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:r=>r};class Dg{constructor(e){this.options=Object.assign(Object.create(Uh),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(e){const i=[];for(const n of e){if(!n.geometry)continue;const[s,l]=n.geometry.coordinates,[u,p]=[vo(s),xo(l)];i.push({id:n.id,type:"Point",geometry:[u,p],tags:n.properties})}this.createIndex(i)}initialize(e){const i=[];for(const n of e)n.type==="Point"&&i.push(n);this.createIndex(i)}updateIndex(e,i,n){this.options=Object.assign(Object.create(Uh),n.clusterOptions),this.initialize(e)}createIndex(e){const{log:i,minZoom:n,maxZoom:s}=this.options;i&&console.time("total time");const l=`prepare ${e.length} points`;i&&console.time(l),this.points=e;const u=[];for(let g=0;g<e.length;g++){const m=e[g];if(!m?.geometry)continue;let[v,_]=m.geometry;v=Math.fround(v),_=Math.fround(_),u.push(v,_,1/0,g,-1,1),this.options.reduce&&u.push(0)}let p=this.trees[s+1]=this.createTree(u);i&&console.timeEnd(l);for(let g=s;g>=n;g--){const m=Date.now();p=this.trees[g]=this.createTree(this.cluster(p,g)),i&&console.log("z%d: %d clusters in %dms",g,p.numItems,Date.now()-m)}i&&console.timeEnd("total time")}getClusters(e,i){return this.getClustersInternal(e,i).map((n=>Su(n)))}getClustersInternal(e,i){let n=((e[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[1]));let l=e[2]===180?180:((e[2]+180)%360+360)%360-180;const u=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,l=180;else if(n>l){const _=this.getClustersInternal([n,s,180,u],i),T=this.getClustersInternal([-180,s,l,u],i);return _.concat(T)}const p=this.trees[this.limitZoom(i)],g=p.range(vo(n),xo(u),vo(l),xo(s)),m=p.flatData,v=[];for(const _ of g){const T=this.stride*_;v.push(m[T+5]>1?zg(m,T,this.clusterProps):this.points[m[T+3]])}return v}getChildren(e){const i=this.getOriginId(e),n=this.getOriginZoom(e),s=new Error("No cluster with the specified id: "+e),l=this.trees[n];if(!l)throw s;const u=l.flatData;if(i*this.stride>=u.length)throw s;const p=this.options.radius/(this.options.extent*Math.pow(2,n-1)),g=l.within(u[i*this.stride],u[i*this.stride+1],p),m=[];for(const v of g){const _=v*this.stride;u[_+4]===e&&m.push(u[_+5]>1?Rg(u,_,this.clusterProps):Su(this.points[u[_+3]]))}if(m.length===0)throw s;return m}getLeaves(e,i,n){const s=[];return this.appendLeaves(s,e,i=i||10,n=n||0,0),s}getTile(e,i,n){const s=this.trees[this.limitZoom(e)];if(!s)return null;const l=Math.pow(2,e),{extent:u,radius:p}=this.options,g=p/u,m=(n-g)/l,v=(n+1+g)/l,_={transformed:!0,features:[],source:null,x:i,y:n,z:e};return this.addTileFeatures(s.range((i-g)/l,m,(i+1+g)/l,v),s.flatData,i,n,l,_),i===0&&this.addTileFeatures(s.range(1-g/l,m,1,v),s.flatData,l,n,l,_),i===l-1&&this.addTileFeatures(s.range(0,m,g/l,v),s.flatData,-1,n,l,_),_}getClusterExpansionZoom(e){return this.getOriginZoom(e)}appendLeaves(e,i,n,s,l){const u=this.getChildren(i);for(const p of u){const g=p.properties;if(g?.cluster?l+g.point_count<=s?l+=g.point_count:l=this.appendLeaves(e,g.cluster_id,n,s,l):l<s?l++:e.push(p),e.length===n)break}return l}createTree(e){const i=new wu(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)i.add(e[n],e[n+1]);return i.finish(),i.flatData=e,i.data=null,i}
vendor: 6,583 bytes, line 2
2addTileFeatures(e,i,n,s,l,u){for(const p of e){const g=p*this.stride,m=i[g+5]>1;let v,_,T;if(m)v=Zh(i,g,this.clusterProps),_=i[g],T=i[g+1];else{const I=this.points[i[g+3]];v=I.tags,[_,T]=I.geometry}const b={type:1,geometry:[[Math.round(this.options.extent*(_*l-n)),Math.round(this.options.extent*(T*l-s))]],tags:v};let M;M=m||this.options.generateId?i[g+3]:this.points[i[g+3]].id,M!==void 0&&(b.id=M),u.features.push(b)}}limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}cluster(e,i){const{radius:n,extent:s,reduce:l,minPoints:u}=this.options,p=n/(s*Math.pow(2,i)),g=e.flatData,m=[],v=this.stride;for(let _=0;_<g.length;_+=v){if(g[_+2]<=i)continue;g[_+2]=i;const T=g[_],b=g[_+1],M=e.within(g[_],g[_+1],p),I=g[_+5];let A=I;for(const D of M){const L=D*v;g[L+2]>i&&(A+=g[L+5])}if(A>I&&A>=u){let D,L=T*I,R=b*I,F=-1;const O=(_/v<<5)+(i+1)+this.points.length;for(const V of M){const Y=V*v;if(g[Y+2]<=i)continue;g[Y+2]=i;const J=g[Y+5];L+=g[Y]*J,R+=g[Y+1]*J,g[Y+4]=O,l&&(D||(D=this.map(g,_,!0),F=this.clusterProps.length,this.clusterProps.push(D)),l(D,this.map(g,Y)))}g[_+4]=O,m.push(L/A,R/A,1/0,O,-1,A),l&&m.push(F)}else{for(let D=0;D<v;D++)m.push(g[_+D]);if(A>1)for(const D of M){const L=D*v;if(!(g[L+2]<=i)){g[L+2]=i;for(let R=0;R<v;R++)m.push(g[L+R])}}}}return m}getOriginId(e){return e-this.points.length>>5}getOriginZoom(e){return(e-this.points.length)%32}map(e,i,n){if(e[i+5]>1){const u=this.clusterProps[e[i+6]];return n?Object.assign({},u):u}const s=this.points[e[i+3]].tags,l=this.options.map(s);return n&&l===s?Object.assign({},l):l}}function zg(r,e,i){return{id:r[e+3],type:"Point",tags:Zh(r,e,i),geometry:[r[e],r[e+1]]}}function Rg(r,e,i){return{type:"Feature",id:r[e+3],properties:Zh(r,e,i),geometry:{type:"Point",coordinates:[gp(r[e]),_p(r[e+1])]}}}function Zh(r,e,i){const n=r[e+5],s=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,l=r[e+6],u=l===-1?{}:Object.assign({},i[l]);return Object.assign(u,{cluster:!0,cluster_id:r[e+3],point_count:n,point_count_abbreviated:s})}const Gh="geojsonvt_clip_start",$h="geojsonvt_clip_end";function wp(r,e,i,n,s){const l=e===s.maxZoom?0:s.tolerance/((1<<e)*s.extent),u={transformed:!1,features:[],source:null,x:i,y:n,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:r.length};for(const p of r)kg(u,p,l,s);return u}function kg(r,e,i,n){switch(r.minX=Math.min(r.minX,e.minX),r.minY=Math.min(r.minY,e.minY),r.maxX=Math.max(r.maxX,e.maxX),r.maxY=Math.max(r.maxY,e.maxY),e.type){case"Point":case"MultiPoint":return void(function(s,l){const u=[];for(let g=0;g<l.geometry.length;g+=3)u.push(l.geometry[g],l.geometry[g+1]),s.numPoints++,s.numSimplified++;if(!u.length)return;const p={type:1,tags:l.tags||null,geometry:u};l.id!==null&&(p.id=l.id),s.features.push(p)})(r,e);case"LineString":return void(function(s,l,u,p){const g=[];if(qh(g,l.geometry,s,u,!1,!1),!g.length)return;let m=l.tags||null;if(p.lineMetrics){m={};for(const _ in l.tags)m[_]=l.tags[_];m[Gh]=l.geometry.start/l.geometry.size,m[$h]=l.geometry.end/l.geometry.size}const v={type:2,tags:m,geometry:g};l.id!==null&&(v.id=l.id),s.features.push(v)})(r,e,i,n);case"MultiLineString":case"Polygon":return void(function(s,l,u){const p=[];for(let m=0;m<l.geometry.length;m++)qh(p,l.geometry[m],s,u,l.type==="Polygon",m===0);if(!p.length)return;const g={type:l.type==="Polygon"?3:2,tags:l.tags||null,geometry:p};l.id!==null&&(g.id=l.id),s.features.push(g)})(r,e,i);case"MultiPolygon":return void(function(s,l,u){const p=[];for(let m=0;m<l.geometry.length;m++){const v=l.geometry[m];for(let _=0;_<v.length;_++)qh(p,v[_],s,u,!0,_===0)}if(!p.length)return;const g={type:3,tags:l.tags||null,geometry:p};l.id!==null&&(g.id=l.id),s.features.push(g)})(r,e,i)}}function qh(r,e,i,n,s,l){const u=n*n;if(n>0&&e.size<(s?u:n))return void(i.numPoints+=e.points.length/3);const p=[];for(let g=0;g<e.points.length;g+=3)(n===0||e.points[g+2]>u)&&(i.numSimplified++,p.push(e.points[g],e.points[g+1])),i.numPoints++;s&&(function(g,m){let v=0;for(let _=0,T=g.length,b=T-2;_<T;b=_,_+=2)v+=(g[_]-g[b])*(g[_+1]+g[b+1]);if(v>0===m)for(let _=0,T=g.length;_<T/2;_+=2){const b=g[_],M=g[_+1];g[_]=g[T-2-_],g[_+1]=g[T-1-_],g[T-2-_]=b,g[T-1-_]=M}})(p,l),r.push(p)}function Tp(r,e){if(r.transformed)return r;const i=1<<r.z,n=r.x,s=r.y;for(const l of r.features)l.type===1?Lg(l,e,i,n,s):Fg(l,e,i,n,s);return r.transformed=!0,r}function Lg(r,e,i,n,s){const l=r,u=r.geometry,p=[];for(let g=0;g<u.length;g+=2)p.push(Sp(u[g],u[g+1],e,i,n,s));return l.geometry=p,l}function Fg(r,e,i,n,s){const l=r,u=r.geometry,p=[];for(const g of u){const m=[];for(let v=0;v<g.length;v+=2)m.push(Sp(g[v],g[v+1],e,i,n,s));p.push(m)}return l.geometry=p,l}function Sp(r,e,i,n,s,l){return[Math.round(i*(r*n-s)),Math.round(i*(e*n-l))]}class Bg{constructor(e){this.options=e,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(e){this.splitTile(e,0,0,0),this.options.debug&&(e.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}updateIndex(e,i,n){n.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(i),n.debug>1&&console.timeEnd("invalidating");const[s,l,u]=[0,0,0],p=wp(e,s,l,u,n);p.source=e;const g=Mu(s,l,u);if(this.tiles[g]=p,this.tileCoords.push({z:s,x:l,y:u,id:g}),n.debug){const m=`z${s}`;this.stats[m]=(this.stats[m]||0)+1,this.total++}}getClusterExpansionZoom(e){return null}getChildren(e){return null}getLeaves(e,i,n){return null}getTile(e,i,n){const{extent:s,debug:l}=this.options,u=1<<e,p=Mu(e,i=i+u&u-1,n);if(this.tiles[p])return Tp(this.tiles[p],s);l>1&&console.log("drilling down to z%d-%d-%d",e,i,n);let g,m=e,v=i,_=n;for(;!g&&m>0;)m--,v>>=1,_>>=1,g=this.tiles[Mu(m,v,_)];return g?.source?(l>1&&(console.log("found parent tile z%d-%d-%d",m,v,_),console.time("drilling down")),this.splitTile(g.source,m,v,_,e,i,n),l>1&&console.timeEnd("drilling down"),this.tiles[p]?Tp(this.tiles[p],s):null):null}splitTile(e,i,n,s,l,u,p){const g=[e,i,n,s],m=this.options,v=m.debug;for(;g.length;){s=g.pop(),n=g.pop(),i=g.pop(),e=g.pop();const _=1<<i,T=Mu(i,n,s);let b=this.tiles[T];if(!b&&(v>1&&console.time("creation"),b=this.tiles[T]=wp(e,i,n,s,m),this.tileCoords.push({z:i,x:n,y:s,id:T}),v)){v>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",i,n,s,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd("creation"));const J=`z${i}`;this.stats[J]=(this.stats[J]||0)+1,this.total++}
2if(b.source=e,l==null){if(i===m.indexMaxZoom||b.numPoints<=m.indexMaxPoints)continue}else{if(i===m.maxZoom||i===l)continue;if(l!=null){const J=l-i;if(n!==u>>J||s!==p>>J)continue}}if(b.source=null,!e.length)continue;v>1&&console.time("clipping");const M=.5*m.buffer/m.extent,I=.5-M,A=.5+M,D=1+M;let L=null,R=null,F=null,O=null;const V=Ba(e,_,n-M,n+A,Ri.X,b.minX,b.maxX,m),Y=Ba(e,_,n+I,n+D,Ri.X,b.minX,b.maxX,m);V&&(L=Ba(V,_,s-M,s+A,Ri.Y,b.minY,b.maxY,m),R=Ba(V,_,s+I,s+D,Ri.Y,b.minY,b.maxY,m)),Y&&(F=Ba(Y,_,s-M,s+A,Ri.Y,b.minY,b.maxY,m),O=Ba(Y,_,s+I,s+D,Ri.Y,b.minY,b.maxY,m)),v>1&&console.timeEnd("clipping"),g.push(L||[],i+1,2*n,2*s),g.push(R||[],i+1,2*n,2*s+1),g.push(F||[],i+1,2*n+1,2*s),g.push(O||[],i+1,2*n+1,2*s+1)}}invalidateTiles(e){if(!e.length)return;const i=this.options,{debug:n}=i;let s=1/0,l=-1/0,u=1/0,p=-1/0;for(const v of e)s=Math.min(s,v.minX),l=Math.max(l,v.maxX),u=Math.min(u,v.minY),p=Math.max(p,v.maxY);const g=i.buffer/i.extent,m=new Set;for(const v in this.tiles){const _=this.tiles[v],T=1<<_.z,b=(_.x-g)/T,M=(_.x+1+g)/T,I=(_.y-g)/T,A=(_.y+1+g)/T;if(l<b||s>=M||p<I||u>=A)continue;let D=!1;for(const L of e)if(L.maxX>=b&&L.minX<M&&L.maxY>=I&&L.minY<A){D=!0;break}if(D){if(n){n>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",_.z,_.x,_.y,_.numFeatures,_.numPoints,_.numSimplified);const L=`z${_.z}`;this.stats[L]=(this.stats[L]||0)-1,this.total--}delete this.tiles[v],m.add(v)}}m.size&&(this.tileCoords=this.tileCoords.filter((v=>!m.has(v.id))))}}function Mu(r,e,i){return 32*((1<<r)*i+e)+r}const Og={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:Uh,debug:0},Ng=wt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Vg}=Ng,jg=wt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Ug}=jg,Zg=Math.cos(Math.PI/180*37.5),Pp=Math.pow(2,14)/.5;class Wh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(const i of this.layers)this.gradients[i.id]={};this.layoutVertexArray=new X,this.layoutVertexArray2=new $,this.indexArray=new pe,this.programConfigurations=new Ur(e.layers,e.zoom),this.segments=new Me,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,n){this.hasDependencies=yu("line",this.layers,i)||this.hasLineDasharray(this.layers);const s=this.layers[0].layout.get("line-sort-key"),l=!s.isConstant(),u=[];for(const{feature:p,id:g,index:m,sourceLayerIndex:v}of e){const _=this.layers[0]._featureFilter.needGeometry,T=ua(p,_);if(!this.layers[0]._featureFilter.filter(new vt(this.zoom),T,n))continue;const b=l?s.evaluate(T,{},n):void 0,M={id:g,properties:p.properties,type:p.type,sourceLayerIndex:v,index:m,geometry:_?T.geometry:ca(p),patterns:{},dashes:{},sortKey:b};u.push(M)}l&&u.sort(((p,g)=>p.sortKey-g.sortKey));for(const p of u){const{geometry:g,index:m,sourceLayerIndex:v}=p;this.hasDependencies?(yu("line",this.layers,i)?Mh("line",this.layers,p,{zoom:this.zoom},i):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,p,this.zoom,i),this.patternFeatures.push(p)):this.addFeature(p,g,m,n,{},{},i.subdivisionGranularity),i.featureIndex.insert(e[m].feature,g,m,v,this.index)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:n,dashPositions:s})}addFeatures(e,i,n,s){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,i,n,s,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Ug)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Vg),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,Gh)&&Object.hasOwn(e.properties,$h))return{start:+e.properties[Gh],end:+e.properties[$h]}}addFeature(e,i,n,s,l,u,p){const g=this.layers[0].layout,m=g.get("line-join").evaluate(e,{}),v=g.get("line-cap").evaluate(e,{}),_=g.get("line-miter-limit").evaluate(e,{}),T=g.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(const b of i)this.addLine(b,e,m,v,_,T,s,p);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:l,dashPositions:u,canonical:s})}addLine(e,i,n,s,l,u,p,g){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=us(e,p?g.line.getGranularityForZoomLevel(p.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let R=0;R<e.length-1;R++)this.totalDistance+=e[R].dist(e[R+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const m=Jl.types[i.type]==="Polygon";let v=e.length;for(;v>=2&&e[v-1].equals(e[v-2]);)v--;let _=0;for(;_<v-1&&e[_].equals(e[_+1]);)_++;if(v<(m?3:2))return;n==="bevel"&&(l=1.05);const T=this.overscaling<=16?122880/(512*this.overscaling):0,b=this.segments.prepareSegment(10*v,this.layoutVertexArray,this.indexArray);let M,I,A,D,L;this.e1=this.e2=-1,m&&(M=e[v-2],L=e[_].sub(M)._unit()._perp());for(let R=_;R<v;R++){if(A=R===v-1?m?e[_+1]:void 0:e[R+1],A&&e[R].equals(A))continue;L&&(D=L),M&&(I=M),M=e[R],L=A?A.sub(M)._unit()._perp():D,D||(D=L);let F=D.add(L);F.x===0&&F.y===0||F._unit();const O=D.x*L.x+D.y*L.y,V=F.x*L.x+F.y*L.y,Y=V!==0?1/V:1/0,J=2*Math.sqrt(2-2*V),re=V<Zg&&I&&A,te=D.x*L.y-D.y*L.x>0;if(re&&R>_){const ae=M.dist(I);if(ae>
vendor: 11,400 bytes, line 2
22*T){const ie=M.sub(M.sub(I)._mult(T/ae)._round());this.updateDistance(I,ie),this.addCurrentVertex(ie,D,0,0,b),I=ie}}const oe=I&&A;let le=oe?n:m?"butt":s;if(oe&&le==="round"&&(Y<u?le="miter":Y<=2&&(le="fakeround")),le==="miter"&&Y>l&&(le="bevel"),le==="bevel"&&(Y>2&&(le="flipbevel"),Y<l&&(le="miter")),I&&this.updateDistance(I,M),le==="miter")F._mult(Y),this.addCurrentVertex(M,F,0,0,b);else if(le==="flipbevel"){if(Y>100)F=L.mult(-1);else{const ae=Y*D.add(L).mag()/D.sub(L).mag();F._perp()._mult(ae*(te?-1:1))}this.addCurrentVertex(M,F,0,0,b),this.addCurrentVertex(M,F.mult(-1),0,0,b)}else if(le==="bevel"||le==="fakeround"){const ae=-Math.sqrt(Y*Y-1),ie=te?ae:0,ye=te?0:ae;if(I&&this.addCurrentVertex(M,D,ie,ye,b),le==="fakeround"){const Se=Math.round(180*J/Math.PI/20);for(let we=1;we<Se;we++){let xe=we/Se;if(xe!==.5){const rt=xe-.5;xe+=xe*rt*(xe-1)*((1.0904+O*(O*(3.55645-1.43519*O)-3.2452))*rt*rt+(.848013+O*(.215638*O-1.06021)))}const Oe=L.sub(D)._mult(xe)._add(D)._unit()._mult(te?-1:1);this.addHalfVertex(M,Oe.x,Oe.y,!1,te,0,b)}}A&&this.addCurrentVertex(M,L,-ie,-ye,b)}else if(le==="butt")this.addCurrentVertex(M,F,0,0,b);else if(le==="square"){const ae=I?1:-1;this.addCurrentVertex(M,F,ae,ae,b)}else le==="round"&&(I&&(this.addCurrentVertex(M,D,0,0,b),this.addCurrentVertex(M,D,1,1,b,!0)),A&&(this.addCurrentVertex(M,L,-1,-1,b,!0),this.addCurrentVertex(M,L,0,0,b)));if(re&&R<v-1){const ae=M.dist(A);if(ae>2*T){const ie=M.add(A.sub(M)._mult(T/ae)._round());this.updateDistance(M,ie),this.addCurrentVertex(ie,L,0,0,b),M=ie}}}}addCurrentVertex(e,i,n,s,l,u=!1){const p=i.y*s-i.x,g=-i.y-i.x*s;this.addHalfVertex(e,i.x+i.y*n,i.y-i.x*n,u,!1,n,l),this.addHalfVertex(e,p,g,u,!0,-s,l),this.distance>Pp/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,i,n,s,l,u))}addHalfVertex({x:e,y:i},n,s,l,u,p,g){const m=.5*(this.lineClips?this.scaledDistance*(Pp-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(l?1:0),(i<<1)+(u?1:0),Math.round(63*n)+128,Math.round(63*s)+128,1+(p===0?0:p<0?-1:1)|(63&m)<<2,m>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const v=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,v,this.e2),g.primitiveLength++),u?this.e2=v:this.e1=v}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}hasLineDasharray(e){for(const i of e){const n=i.paint.get("line-dasharray");if(n&&!n.isConstant())return!0}return!1}addLineDashDependencies(e,i,n,s){for(const l of e){const u=l.paint.get("line-dasharray");if(!u||u.value.kind==="constant")continue;const p=l.layout.get("line-cap").evaluate(i,{})==="round",g={dasharray:u.value.evaluate({zoom:n-1},i,{}),round:p},m={dasharray:u.value.evaluate({zoom:n},i,{}),round:p},v={dasharray:u.value.evaluate({zoom:n+1},i,{}),round:p},_=`${g.dasharray.join(",")},${g.round}`,T=`${m.dasharray.join(",")},${m.round}`,b=`${v.dasharray.join(",")},${v.round}`;s.dashDependencies[_]=g,s.dashDependencies[T]=m,s.dashDependencies[b]=v,i.dashes[l.id]={min:_,mid:T,max:b}}}}let Mp,Ip;Ee("LineBucket",Wh,{omit:["layers","patternFeatures"]});var Ep={get paint(){return Ip=Ip||new Di({"line-opacity":new ke(ce.paint_line["line-opacity"]),"line-color":new ke(ce.paint_line["line-color"]),"line-translate":new De(ce.paint_line["line-translate"]),"line-translate-anchor":new De(ce.paint_line["line-translate-anchor"]),"line-width":new ke(ce.paint_line["line-width"]),"line-gap-width":new ke(ce.paint_line["line-gap-width"]),"line-offset":new ke(ce.paint_line["line-offset"]),"line-blur":new ke(ce.paint_line["line-blur"]),"line-dasharray":new ra(ce.paint_line["line-dasharray"]),"line-pattern":new ra(ce.paint_line["line-pattern"]),"line-gradient":new mn(ce.paint_line["line-gradient"])})},get layout(){return Mp=Mp||new Di({"line-cap":new ke(ce.layout_line["line-cap"]),"line-join":new ke(ce.layout_line["line-join"]),"line-miter-limit":new ke(ce.layout_line["line-miter-limit"]),"line-round-limit":new ke(ce.layout_line["line-round-limit"]),"line-sort-key":new ke(ce.layout_line["line-sort-key"])})}};class Gg extends ke{possiblyEvaluate(e,i){return i=new vt(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(e,i)}evaluate(e,i,n,s){return i=Ii({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(e,i,n,s)}}let Iu;class $g extends nr{constructor(e,i){super(e,Ep,i),this.gradientVersion=0,Iu||(Iu=new Gg(Ep.paint.properties["line-width"].specification),Iu.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const i=this.gradientExpression();this.stepInterpolant=!!(function(n){return n._styleExpression!==void 0})(i)&&i._styleExpression.expression instanceof tn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,i){super.recalculate(e,i),this.paint._values["line-floorwidth"]=Iu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Wh(e)}queryRadius(e){const i=e,n=Cp(mo("line-width",this,i),mo("line-gap-width",this,i)),s=mo("line-offset",this,i);return n/2+Math.abs(s)+gu(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:n,geometry:s,transform:l,pixelsToTileUnits:u}){const p=_u(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-l.bearingInRadians,u),g=u/2*Cp(this.paint.get("line-width").evaluate(i,n),this.paint.get("line-gap-width").evaluate(i,n)),m=this.paint.get("line-offset").evaluate(i,n);return m&&(s=(function(v,_){const T=[];for(const b of v){const M=km(b),I=[];for(let A=0;A<M.length;A++){const D=M[A],L=M[A-1],R=M[A+1],F=A===0?new ge(0,0):D.sub(L)._unit()._perp(),O=A===M.length-1?new ge(0,0):R.sub(D)._unit()._perp(),V=F._add(O)._unit(),Y=V.x*O.x+V.y*O.y;Y!==0&&V._mult(1/Y),I.push(V._mult(_)._add(D))}T.push(I)}return T})(s,m*u)),(function(v,_,T){for(const b of _){if(v.length>=3){for(const M of b)if(fo(v,M))return!0}if(Dm(v,b,T))return!0}return!1})(p,s,g)}isTileClipped(){return!0}}function Cp(r,e){return e>0?e+2*r:r}const qg=wt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Wg=wt([{name:"a_projected_pos",components:3,type:"Float32"}],4);wt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Hg=wt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);wt([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Ap=wt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Xg=wt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Yg(r,e,i){const n=e.layout.get("text-transform").evaluate(i,{});return n==="uppercase"?r=r.toLocaleUpperCase():n==="lowercase"&&(r=r.toLocaleLowerCase()),Nr.applyArabicShaping&&(r=Nr.applyArabicShaping(r)),r}function Kg(r,e,i){for(const n of r.sections)n.text=Yg(n.text,e,i);return r}wt([{name:"triangle",components:3,type:"Uint16"}]),wt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),wt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),wt([{type:"Float32",name:"offsetX"}]),wt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),wt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var ni=24;const rc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","⋯":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Jg={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Qg={40:!0};function Dp(r,e,i,n,s,l){if("fontStack"in e){const u=i[e.fontStack],p=u?.[r];return p?p.metrics.advance*e.scale+s:0}{const u=n[e.imageName];return u?u.displaySize[0]*e.scale*ni/l+s:0}}function zp(r,e,i,n){const s=Math.pow(r-e,2);return n?r<e?s/2:2*s:s+Math.abs(i)*i}function e_(r,e,i){let n=0;return r===10&&(n-=1e4),i&&(n+=150),r!==40&&r!==65288||(n+=50),e!==41&&e!==65289||(n+=50),n}function Rp(r,e,i,n,s,l){let u=null,p=zp(e,i,s,l);for(const g of n){const m=zp(e-g.x,i,s,l)+g.badness;
2m<=p&&(u=g,p=m)}return{index:r,x:e,priorBreak:u,badness:p}}function kp(r){return r?kp(r.priorBreak).concat(r.index):[]}class wo{constructor(e="",i=[],n=[]){this.text=e,this.sections=i,this.sectionIndex=n,this.imageSectionID=null}static fromFeature(e,i){const n=new wo;for(const s of e.sections)s.image?n.addImageSection(s):n.addTextSection(s,i);return n}length(){return[...this.text].length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=(function(e){let i="",n={premature:!0,value:void 0};const s=e[Symbol.iterator]();let l=s.next();const u=e[Symbol.iterator]();u.next();let p=u.next();for(;!l.done;)i+=!p.done&&Cl(p.value.codePointAt(0))&&!rc[p.value]||!n.premature&&Cl(n.value.codePointAt(0))&&!rc[n.value]||!rc[l.value]?l.value:rc[l.value],n={value:l.value,premature:!1},l=s.next(),p=u.next();return i})(this.text)}hasZeroWidthSpaces(){return this.text.includes("​")}trim(){const e=this.text.match(/^\s*/),i=e?e[0].length:0,n=this.text.match(/\S\s*$/),s=n?n[0].length-1:0;this.text=this.text.substring(i,this.text.length-s),this.sectionIndex=this.sectionIndex.slice(i,this.sectionIndex.length-s)}substring(e,i){const n=[...this.text].slice(e,i).join(""),s=this.sectionIndex.slice(e,i);return new wo(n,this.sections,s)}toCodeUnitIndex(e){return[...this.text].slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,i)=>Math.max(e,this.sections[i].scale)),0)}getMaxImageSize(e){let i=0,n=0;for(let s=0;s<this.length();s++){const l=this.getSection(s);if("imageName"in l){const u=e[l.imageName];if(!u)continue;const p=u.displaySize;i=Math.max(i,p[0]),n=Math.max(n,p[1])}}return{maxImageWidth:i,maxImageHeight:n}}addTextSection(e,i){this.text+=e.text,this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||i});const n=this.sections.length-1;this.sectionIndex.push(...[...e.text].map((()=>n)))}addImageSection(e){const i=e.image?e.image.name:"";if(i.length===0)return void Kt("Can't add FormattedSection with an empty image.");const n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:i}),this.sectionIndex.push(this.sections.length-1)):Kt("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,i,n,s,l){const u=[],p=this.determineAverageLineWidth(e,i,n,s,l),g=this.hasZeroWidthSpaces();let m=0,v=0;const _=this.text[Symbol.iterator]();let T=_.next();const b=this.text[Symbol.iterator]();b.next();let M=b.next();const I=this.text[Symbol.iterator]();I.next(),I.next();let A=I.next();for(;!T.done;){const D=this.getSection(v),L=T.value.codePointAt(0);if(nu(L)||(m+=Dp(L,D,n,s,e,l)),!M.done){const R=fh(L),F=M.value.codePointAt(0);(Jg[L]||R||"imageName"in D||!A.done&&Qg[F])&&u.push(Rp(v+1,m,p,u,e_(L,F,R&&g),!1))}v++,T=_.next(),M=b.next(),A=I.next()}return kp(Rp(this.length(),m,p,u,0,!0))}determineAverageLineWidth(e,i,n,s,l){let u=0,p=0;for(const g of this.text){const m=this.getSection(p);u+=Dp(g.codePointAt(0),m,n,s,e,l),p++}return u/Math.max(1,Math.ceil(u/i))}}const Hh=4294967296,Lp=1/Hh,Fp=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class Eu{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,i,n=this.length){for(;this.pos<n;){const s=this.readVarint(),l=s>>3,u=this.pos;this.type=7&s,e(l,i,this),this.pos===u&&this.skip(s)}return i}readMessage(e,i){return this.readFields(e,i,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Hh;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Hh;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const i=this.buf;let n,s;return s=i[this.pos++],n=127&s,s<128?n:(s=i[this.pos++],n|=(127&s)<<7,s<128?n:(s=i[this.pos++],n|=(127&s)<<14,s<128?n:(s=i[this.pos++],n|=(127&s)<<21,s<128?n:(s=i[this.pos],n|=(15&s)<<28,(function(l,u,p){const g=p.buf;let m,v;if(v=g[p.pos++],m=(112&v)>>4,v<128||(v=g[p.pos++],m|=(127&v)<<3,v<128)||(v=g[p.pos++],m|=(127&v)<<10,v<128)||(v=g[p.pos++],m|=(127&v)<<17,v<128)||(v=g[p.pos++],m|=(127&v)<<24,v<128)||(v=g[p.pos++],m|=(1&v)<<31,v<128))return To(l,m,u);throw new Error("Expected varint not more than 10 bytes")})(n,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,i=this.pos;return this.pos=e,e-i>=12&&Fp?Fp.decode(this.buf.subarray(i,e)):(function(n,s,l){let u="",p=s;for(;p<l;){const g=n[p];let m,v,_,T=null,b=g>239?4:g>223?3:g>191?2:1;if(p+b>l)break;b===1?g<128&&(T=g):b===2?(m=n[p+1],(192&m)==128&&(T=(31&g)<<6|63&m,T<=127&&(T=null))):b===3?(m=n[p+1],v=n[p+2],(192&m)==128&&(192&v)==128&&(T=(15&g)<<12|(63&m)<<6|63&v,(T<=2047||T>=55296&&T<=57343)&&(T=null))):b===4&&(m=n[p+1],v=n[p+2],_=n[p+3],(192&m)==128&&(192&v)==128&&(192&_)==128&&(T=(15&g)<<18|(63&m)<<12|(63&v)<<6|63&_,(T<=65535||T>=1114112)&&(T=null))),T===null?(T=65533,b=1):T>65535&&(T-=65536,u+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),u+=String.fromCharCode(T),p+=b}return u})(this.buf,i,e)}readBytes(){const e=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,e);return this.pos=e,i}readPackedVarint(e=[],i){const n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readVarint(i));return e}readPackedSVarint(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(e){const i=7&e;if(i===0)for(;this.buf[this.pos++]>127;);else if(i===2)this.pos=this.readVarint()+this.pos;else if(i===5)this.pos+=4;else{if(i!==1)throw new Error(`Unimplemented type: ${i}`);this.pos+=8}}writeTag(e,i){this.writeVarint(e<<3|i)}realloc(e){let i=this.length||16;for(;i<this.pos+e;)i*=2;if(i!==this.length){const n=new Uint8Array(i);n.set(this.buf),this.buf=n,this.dataView=new DataView(n.buffer),this.length=i}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}
vendor: 4,424 bytes, line 2
2writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Lp),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Lp),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?(function(i,n){let s,l;if(i>=0?(s=i%4294967296|0,l=i/4294967296|0):(s=~(-i%4294967296),l=~(-i/4294967296),4294967295^s?s=s+1|0:(s=0,l=l+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),(function(u,p,g){g.buf[g.pos++]=127&u|128,u>>>=7,g.buf[g.pos++]=127&u|128,u>>>=7,g.buf[g.pos++]=127&u|128,u>>>=7,g.buf[g.pos++]=127&u|128,g.buf[g.pos]=127&(u>>>=7)})(s,0,n),(function(u,p){const g=(7&u)<<4;p.buf[p.pos++]|=g|((u>>>=3)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u|((u>>>=7)?128:0),u&&(p.buf[p.pos++]=127&u)))))})(l,n)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const i=this.pos;this.pos=(function(s,l,u){for(let p,g,m=0;m<l.length;m++){if(p=l.charCodeAt(m),p>55295&&p<57344){if(!g){p>56319||m+1===l.length?(s[u++]=239,s[u++]=191,s[u++]=189):g=p;continue}if(p<56320){s[u++]=239,s[u++]=191,s[u++]=189,g=p;continue}p=g-55296<<10|p-56320|65536,g=null}else g&&(s[u++]=239,s[u++]=191,s[u++]=189,g=null);p<128?s[u++]=p:(p<2048?s[u++]=p>>6|192:(p<65536?s[u++]=p>>12|224:(s[u++]=p>>18|240,s[u++]=p>>12&63|128),s[u++]=p>>6&63|128),s[u++]=63&p|128)}return u})(this.buf,e,this.pos);const n=this.pos-i;n>=128&&Bp(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const i=e.length;this.writeVarint(i),this.realloc(i);for(let n=0;n<i;n++)this.buf[this.pos++]=e[n]}writeRawMessage(e,i){this.pos++;const n=this.pos;e(i,this);const s=this.pos-n;s>=128&&Bp(n,s,this),this.pos=n-1,this.writeVarint(s),this.pos+=s}writeMessage(e,i,n){this.writeTag(e,2),this.writeRawMessage(i,n)}writePackedVarint(e,i){i.length&&this.writeMessage(e,t_,i)}writePackedSVarint(e,i){i.length&&this.writeMessage(e,i_,i)}writePackedBoolean(e,i){i.length&&this.writeMessage(e,n_,i)}writePackedFloat(e,i){i.length&&this.writeMessage(e,r_,i)}writePackedDouble(e,i){i.length&&this.writeMessage(e,a_,i)}writePackedFixed32(e,i){i.length&&this.writeMessage(e,s_,i)}writePackedSFixed32(e,i){i.length&&this.writeMessage(e,o_,i)}writePackedFixed64(e,i){i.length&&this.writeMessage(e,l_,i)}writePackedSFixed64(e,i){i.length&&this.writeMessage(e,c_,i)}writeBytesField(e,i){this.writeTag(e,2),this.writeBytes(i)}writeFixed32Field(e,i){this.writeTag(e,5),this.writeFixed32(i)}writeSFixed32Field(e,i){this.writeTag(e,5),this.writeSFixed32(i)}writeFixed64Field(e,i){this.writeTag(e,1),this.writeFixed64(i)}writeSFixed64Field(e,i){this.writeTag(e,1),this.writeSFixed64(i)}writeVarintField(e,i){this.writeTag(e,0),this.writeVarint(i)}writeSVarintField(e,i){this.writeTag(e,0),this.writeSVarint(i)}writeStringField(e,i){this.writeTag(e,2),this.writeString(i)}writeFloatField(e,i){this.writeTag(e,5),this.writeFloat(i)}writeDoubleField(e,i){this.writeTag(e,1),this.writeDouble(i)}writeBooleanField(e,i){this.writeVarintField(e,+i)}}function To(r,e,i){return i?4294967296*e+(r>>>0):4294967296*(e>>>0)+(r>>>0)}function Bp(r,e,i){const n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(let s=i.pos-1;s>=r;s--)i.buf[s+n]=i.buf[s]}function t_(r,e){for(let i=0;i<r.length;i++)e.writeVarint(r[i])}function i_(r,e){for(let i=0;i<r.length;i++)e.writeSVarint(r[i])}function r_(r,e){for(let i=0;i<r.length;i++)e.writeFloat(r[i])}function a_(r,e){for(let i=0;i<r.length;i++)e.writeDouble(r[i])}function n_(r,e){for(let i=0;i<r.length;i++)e.writeBoolean(r[i])}function s_(r,e){for(let i=0;i<r.length;i++)e.writeFixed32(r[i])}function o_(r,e){for(let i=0;i<r.length;i++)e.writeSFixed32(r[i])}function l_(r,e){for(let i=0;i<r.length;
2i++)e.writeFixed64(r[i])}function c_(r,e){for(let i=0;i<r.length;i++)e.writeSFixed64(r[i])}function u_(r,e,i){r===1&&i.readMessage(h_,e)}function h_(r,e,i){if(r===3){const{id:n,bitmap:s,width:l,height:u,left:p,top:g,advance:m}=i.readMessage(d_,{});e.push({id:n,bitmap:new $l({width:l+6,height:u+6},s),metrics:{width:l,height:u,left:p,top:g,advance:m}})}}function d_(r,e,i){r===1?e.id=i.readVarint():r===2?e.bitmap=i.readBytes():r===3?e.width=i.readVarint():r===4?e.height=i.readVarint():r===5?e.left=i.readSVarint():r===6?e.top=i.readSVarint():r===7&&(e.advance=i.readVarint())}function Op(r){let e=0,i=0;for(const u of r)e+=u.w*u.h,i=Math.max(i,u.w);r.sort(((u,p)=>p.h-u.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let s=0,l=0;for(const u of r)for(let p=n.length-1;p>=0;p--){const g=n[p];if(!(u.w>g.w||u.h>g.h)){if(u.x=g.x,u.y=g.y,l=Math.max(l,u.y+u.h),s=Math.max(s,u.x+u.w),u.w===g.w&&u.h===g.h){const m=n.pop();m&&p<n.length&&(n[p]=m)}else u.h===g.h?(g.x+=u.w,g.w-=u.w):u.w===g.w?(g.y+=u.h,g.h-=u.h):(n.push({x:g.x+u.w,y:g.y,w:g.w-u.w,h:u.h}),g.y+=u.h,g.h-=u.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}class Xh{constructor(e,{pixelRatio:i,version:n,stretchX:s,stretchY:l,content:u,textFitWidth:p,textFitHeight:g}){this.paddedRect=e,this.pixelRatio=i,this.stretchX=s,this.stretchY=l,this.content=u,this.version=n,this.textFitWidth=p,this.textFitHeight=g}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Np{constructor(e,i){const n={},s={};this.haveRenderCallbacks=[];const l=[];this.addImages(e,n,l),this.addImages(i,s,l);const{w:u,h:p}=Op(l),g=new Ki({width:u||1,height:p||1});for(const m in e){const v=e[m],_=n[m].paddedRect;Ki.copy(v.data,g,{x:0,y:0},{x:_.x+1,y:_.y+1},v.data)}for(const m in i){const v=i[m],_=s[m].paddedRect,T=_.x+1,b=_.y+1,M=v.data.width,I=v.data.height;Ki.copy(v.data,g,{x:0,y:0},{x:T,y:b},v.data),Ki.copy(v.data,g,{x:0,y:I-1},{x:T,y:b-1},{width:M,height:1}),Ki.copy(v.data,g,{x:0,y:0},{x:T,y:b+I},{width:M,height:1}),Ki.copy(v.data,g,{x:M-1,y:0},{x:T-1,y:b},{width:1,height:I}),Ki.copy(v.data,g,{x:0,y:0},{x:T+M,y:b},{width:1,height:I})}this.image=g,this.iconPositions=n,this.patternPositions=s}addImages(e,i,n){for(const s in e){const l=e[s],u={x:0,y:0,w:l.data.width+2,h:l.data.height+2};n.push(u),i[s]=new Xh(u,l),l.hasRenderCallback&&this.haveRenderCallbacks.push(s)}}patchUpdatedImages(e,i){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),i),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),i)}patchUpdatedImage(e,i,n){if(!e||!i||e.version===i.version)return;e.version=i.version;const[s,l]=e.tl;n.update(i.data,void 0,{x:s,y:l})}}var _n;function Cu(r,e,i,n,s,l,u,p,g,m,v,_,T,b,M){const I=wo.fromFeature(r,s);let A;_===k.ax.vertical&&I.verticalizePunctuation();let D=I.determineLineBreaks(m,l,e,n,b);const{processBidirectionalText:L,processStyledBidirectionalText:R}=Nr;if(L&&I.sections.length===1){A=[],D=D.map((Y=>I.toCodeUnitIndex(Y)));const V=L(I.toString(),D);for(const Y of V){const J=[...Y].map((()=>0));A.push(new wo(Y,I.sections,J))}}else if(R){A=[],D=D.map((re=>I.toCodeUnitIndex(re)));let V=0;const Y=[];for(const re of I.text)Y.push(...Array(re.length).fill(I.sectionIndex[V])),V++;const J=R(I.text,Y,D);for(const re of J){const te=[];let oe="";for(const le of re[0])te.push(re[1][oe.length]),oe+=le;A.push(new wo(re[0],I.sections,te))}}else A=(function(V,Y){const J=[];let re=0;for(const te of Y)J.push(V.substring(re,te)),re=te;return re<V.length()&&J.push(V.substring(re,V.length())),J})(I,D);const F=[],O={positionedLines:F,text:I.toString(),top:v[1],bottom:v[1],left:v[0],right:v[0],writingMode:_,iconsInText:!1,verticalizable:!1};return(function(V,Y,J,re,te,oe,le,ae,ie,ye,Se,we){let xe=0,Oe=0,rt=0,nt=0;const ht=ae==="right"?1:ae==="left"?0:.5,wi=ni/we;let Lt=0;for(const Mt of te){Mt.trim();const mi=Mt.getMaxScale(),Li={positionedGlyphs:[],lineOffset:0};V.positionedLines[Lt]=Li;const Fi=Li.positionedGlyphs;let Ji=0;if(!Mt.length()){Oe+=oe,++Lt;continue}const Ti=p_(re,Mt,wi);let Qi=0;for(const li of Mt.text){const Dt=Mt.getSection(Qi),Xt=li.codePointAt(0),Ft=f_(ie,Se,Xt),ci={glyph:Xt,imageName:null,x:xe,y:Oe+-17,vertical:Ft,scale:1,fontStack:"",sectionIndex:Mt.getSectionIndex(Qi),metrics:null,rect:null};let Va;if("fontStack"in Dt){if(Va=m_(Dt,Xt,Ft,Ti,Y,J),!Va)continue;ci.fontStack=Dt.fontStack}else{if(V.iconsInText=!0,Dt.scale*=wi,Va=g_(Dt,Ft,mi,Ti,re),!Va)continue;
vendor: 31,887 bytes, line 2
2Ji=Math.max(Ji,Va.imageOffset),ci.imageName=Dt.imageName}const{rect:$r,metrics:lc,baselineOffset:Sn}=Va;ci.y+=Sn,ci.scale=Dt.scale,ci.metrics=lc,ci.rect=$r,Fi.push(ci),Ft?(V.verticalizable=!0,xe+=("imageName"in Dt?lc.advance:ni)*Dt.scale+ye):xe+=lc.advance*Dt.scale+ye,Qi++}Fi.length!==0&&(rt=Math.max(xe-ye,rt),__(Fi,0,Fi.length-1,ht)),xe=0,Li.lineOffset=Math.max(Ji,(mi-1)*ni);const Ar=oe*mi+Ji;Oe+=Ar,nt=Math.max(Ar,nt),++Lt}const{horizontalAlign:ti,verticalAlign:oi}=Yh(le);(function(Mt,mi,Li,Fi,Ji,Ti,Qi,Ar,li){const Dt=(mi-Li)*Ji;let Xt=0;Xt=Ti!==Qi?-Ar*Fi- -17:-Fi*li*Qi+.5*Qi;for(const Ft of Mt)for(const ci of Ft.positionedGlyphs)ci.x+=Dt,ci.y+=Xt})(V.positionedLines,ht,ti,oi,rt,nt,oe,Oe,te.length),V.top+=-oi*Oe,V.bottom=V.top+Oe,V.left+=-ti*rt,V.right=V.left+rt})(O,e,i,n,A,u,p,g,_,m,T,M),!(function(V){for(const Y of V)if(Y.positionedGlyphs.length!==0)return!1;return!0})(F)&&O}function Yh(r){let e=.5,i=.5;switch(r){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(r){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function p_(r,e,i){const n=e.getMaxScale()*ni,{maxImageWidth:s,maxImageHeight:l}=e.getMaxImageSize(r),u=Math.max(n,l*i);return{verticalLineContentWidth:Math.max(n,s*i),horizontalLineContentHeight:u}}function Vp(r){switch(r){case"top":return 0;case"center":return .5;default:return 1}}function f_(r,e,i){return!(r===k.ax.horizontal||!e&&!Ra(i)||e&&(nu(i)||(n=i,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(n)))));var n}function m_(r,e,i,n,s,l){const u=l[r.fontStack],p=(function(m,v,_,T){if(m?.rect)return m;const b=v[_.fontStack],M=b?.[T];return M?{rect:null,metrics:M.metrics}:null})(u?.[e],s,r,e);if(p===null)return null;let g;if(i)g=n.verticalLineContentWidth-r.scale*ni;else{const m=Vp(r.verticalAlign);g=(n.horizontalLineContentHeight-r.scale*ni)*m}return{rect:p.rect,metrics:p.metrics,baselineOffset:g}}function g_(r,e,i,n,s){const l=s[r.imageName];if(!l)return null;const u=l.paddedRect,p=l.displaySize,g={width:p[0],height:p[1],left:1,top:-3,advance:e?p[1]:p[0]};let m;if(e)m=n.verticalLineContentWidth-p[1]*r.scale;else{const v=Vp(r.verticalAlign);m=(n.horizontalLineContentHeight-p[1]*r.scale)*v}return{rect:u,metrics:g,baselineOffset:m,imageOffset:(e?p[0]:p[1])*r.scale-ni*i}}function __(r,e,i,n){if(n===0)return;const s=r[i],l=(r[i].x+s.metrics.advance*s.scale)*n;for(let u=e;u<=i;u++)r[u].x-=l}function y_(r,e,i){const{horizontalAlign:n,verticalAlign:s}=Yh(i),l=e[0]-r.displaySize[0]*n,u=e[1]-r.displaySize[1]*s;return{image:r,top:u,bottom:u+r.displaySize[1],left:l,right:l+r.displaySize[0]}}function jp(r){var e,i;let n=r.left,s=r.top,l=r.right-n,u=r.bottom-s;const p=(e=r.image.textFitWidth)!==null&&e!==void 0?e:"stretchOrShrink",g=(i=r.image.textFitHeight)!==null&&i!==void 0?i:"stretchOrShrink",m=(r.image.content[2]-r.image.content[0])/(r.image.content[3]-r.image.content[1]);if(g==="proportional"){if(p==="stretchOnly"&&l/u<m||p==="proportional"){const v=Math.ceil(u*m);n*=v/l,l=v}}else if(p==="proportional"&&g==="stretchOnly"&&m!==0&&l/u>m){const v=Math.ceil(l/m);s*=v/u,u=v}return{x1:n,y1:s,x2:n+l,y2:s+u}}function Up(r,e,i,n,s,l){const u=r.image;let p;if(u.content){const A=u.content,D=u.pixelRatio||1;p=[A[0]/D,A[1]/D,u.displaySize[0]-A[2]/D,u.displaySize[1]-A[3]/D]}const g=e.left*l,m=e.right*l;let v,_,T,b;i==="width"||i==="both"?(b=s[0]+g-n[3],_=s[0]+m+n[1]):(b=s[0]+(g+m-u.displaySize[0])/2,_=b+u.displaySize[0]);const M=e.top*l,I=e.bottom*l;return i==="height"||i==="both"?(v=s[1]+M-n[0],T=s[1]+I+n[2]):(v=s[1]+(M+I-u.displaySize[1])/2,T=v+u.displaySize[1]),{image:u,top:v,right:_,bottom:T,left:b,collisionPadding:p}}Ee("ImagePosition",Xh),Ee("ImageAtlas",Np),k.ax=void 0,(_n=k.ax||(k.ax={}))[_n.none=0]="none",_n[_n.horizontal=1]="horizontal",_n[_n.vertical=2]="vertical",_n[_n.horizontalOnly=3]="horizontalOnly";const Oa=128,yn=32640;function Zp(r,e){const{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new vt(r+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:n,interpolationType:s}=i;let l=0;for(;l<n.length&&n[l]<=r;)l++;l=Math.max(0,l-1);let u=l;for(;u<n.length&&n[u]<r+1;)u++;u=Math.min(n.length-1,u);const p=n[l],g=n[u];return i.kind==="composite"?{kind:"composite",minZoom:p,maxZoom:g,interpolationType:s}:{kind:"camera",minZoom:p,maxZoom:g,minSize:i.evaluate(new vt(p)),maxSize:i.evaluate(new vt(g)),interpolationType:s}}}function Kh(r,e,i){let n="never";const s=r.get(e);return s?n=s:r.get(i)&&(n="always"),n}const v_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Au(r,e,i,n,s,l,u,p,g,m,v,_,T){const b=p?Math.min(yn,Math.round(p[0])):0,M=p?Math.min(yn,Math.round(p[1])):0;r.emplaceBack(e,i,Math.round(32*n),Math.round(32*s),l,u,(b<<1)+(g?1:0),M,16*m,16*v,256*_,256*T)}function Jh(r,e,i){r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i)}function x_(r){for(const e of r.sections)if(Dl(e.text))return!0;return!1}class Qh{constructor(e){this.layoutVertexArray=new q,this.indexArray=new pe,this.programConfigurations=e,this.segments=new Me,this.dynamicLayoutVertexArray=new Q,this.opacityVertexArray=new ne,this.hasVisibleVertices=!1,this.placedSymbolArray=new y}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,n,s){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,qg.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Wg.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,v_,!0),this.opacityVertexBuffer.itemSize=1),(n||s)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Ee("SymbolBuffers",Qh);class ed{constructor(e,i,n){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new n,this.segments=new Me,this.collisionVertexArray=new me}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Hg.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ee("CollisionBuffers",ed);class So{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((u=>u.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Zp(this.zoom,i["text-size"]),this.iconSizeData=Zp(this.zoom,i["icon-size"]);const n=this.layers[0].layout,s=n.get("symbol-sort-key"),l=n.get("symbol-z-order");this.canOverlap=Kh(n,"text-overlap","text-allow-overlap")!=="never"||Kh(n,"icon-overlap","icon-allow-overlap")!=="never"||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey=l!=="viewport-y"&&!s.isConstant(),this.sortFeaturesByY=(l==="viewport-y"||l==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,n.get("symbol-placement")==="point"&&(this.writingModes=n.get("text-writing-mode").map((u=>k.ax[u]))),this.stateDependentLayerIds=this.layers.filter((u=>u.isStateDependent())).map((u=>u.id)),this.sourceID=e.sourceID}createArrays(){this.text=new Qh(new Ur(this.layers,this.zoom,(e=>e.startsWith("text")))),this.icon=new Qh(new Ur(this.layers,this.zoom,(e=>e.startsWith("icon")))),this.glyphOffsetArray=new S,this.lineVertexArray=new P,this.symbolInstances=new w,this.textAnchorOffsets=new C}calculateGlyphDependencies(e,i,n,s,l){for(const u of e)if(i[u.codePointAt(0)]=!0,(n||s)&&l){const p=rc[u];p&&(i[p.codePointAt(0)]=!0)}}populate(e,i,n){var s;const l=this.layers[0],u=l.layout,p=u.get("text-font"),g=u.get("text-field"),m=u.get("icon-image"),v=(g.value.kind!=="constant"||g.value.value instanceof Ni&&!g.value.value.isEmpty()||g.value.value.toString().length>0)&&(p.value.kind!=="constant"||p.value.value.length>0),_=m.value.kind!=="constant"||!!m.value.value||Object.keys(m.parameters).length>0,T=u.get("symbol-sort-key");if(this.features=[],!v&&!_)return;const b=i.iconDependencies,M=i.glyphDependencies,I=i.availableImages,A=new vt(this.zoom);for(const{feature:D,id:L,index:R,sourceLayerIndex:F}of e){const O=l._featureFilter.needGeometry,V=ua(D,O);if(!l._featureFilter.filter(A,V,n))continue;let Y,J;if(O||(V.geometry=ca(D)),v){const te=l.getValueAndResolveTokens("text-field",V,n,I),oe=Ni.factory(te);this.hasRTLText||(this.hasRTLText=x_(oe)),(!this.hasRTLText||Nr.getRTLTextPluginStatus()==="unavailable"||this.hasRTLText&&Nr.isParsed())&&(Y=Kg(oe,l,V))}if(_){const te=l.getValueAndResolveTokens("icon-image",V,n,I);J=te instanceof qi?te:qi.fromString(te)}if(!Y&&!J)continue;const re=this.sortFeaturesByKey?T.evaluate(V,{},n):void 0;if(this.features.push({id:L,text:Y,icon:J,index:R,sourceLayerIndex:F,geometry:V.geometry,properties:D.properties,type:Jl.types[D.type],sortKey:re}),J&&(b[J.name]=!0),Y){const te=p.evaluate(V,{},n).join(","),oe=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=(s=this.writingModes)===null||s===void 0?void 0:s.includes(k.ax.vertical);for(const le of Y.sections)if(le.image)b[le.image.name]=!0;else{const ae=Il(Y.toString()),ie=le.fontStack||te;M[ie]||(M[ie]={}),this.calculateGlyphDependencies(le.text,M[ie],oe,this.allowVerticalPlacement,ae)}}}u.get("symbol-placement")==="line"&&(this.features=(function(D){const L={},R={},F=[];let O=0;function V(te){F.push(D[te]),O++}function Y(te,oe,le){const ae=R[te];return delete R[te],R[oe]=ae,F[ae].geometry[0].pop(),F[ae].geometry[0]=F[ae].geometry[0].concat(le[0]),ae}function J(te,oe,le){const ae=L[oe];return delete L[oe],L[te]=ae,F[ae].geometry[0].shift(),F[ae].geometry[0]=le[0].concat(F[ae].geometry[0]),ae}function re(te,oe,le){const ae=le?oe[0][oe[0].length-1]:oe[0][0];return`${te}:${ae.x}:${ae.y}`}for(let te=0;te<D.length;te++){const oe=D[te],le=oe.geometry,ae=oe.text?oe.text.toString():null;if(!ae){V(te);continue}const ie=re(ae,le),ye=re(ae,le,!0);if(ie in R&&ye in L&&R[ie]!==L[ye]){const Se=J(ie,ye,le),we=Y(ie,ye,F[Se].geometry);delete L[ie],delete R[ye],R[re(ae,F[we].geometry,!0)]=we,F[Se].geometry=null}else ie in R?Y(ie,ye,le):ye in L?J(ie,ye,le):(V(te),L[ie]=O-1,R[ye]=O-1)}return F.filter((te=>te.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((D,L)=>D.sortKey-L.sortKey))}update(e,i,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:n}),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:n}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const n=this.lineVertexArray.length;if(e.segment!==void 0){let s=e.dist(i[e.segment+1]),l=e.dist(i[e.segment]);const u={};for(let p=e.segment+1;p<i.length;p++)u[p]={x:i[p].x,y:i[p].y,tileUnitDistanceFromAnchor:s},p<i.length-1&&(s+=i[p+1].dist(i[p]));for(let p=e.segment||0;p>=0;p--)u[p]={x:i[p].x,y:i[p].y,tileUnitDistanceFromAnchor:l},p>0&&(l+=i[p-1].dist(i[p]));for(let p=0;p<i.length;p++){const g=u[p];this.lineVertexArray.emplaceBack(g.x,g.y,g.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,i,n,s,l,u,p,g,m,v,_,T){const b=e.indexArray,M=e.layoutVertexArray,I=e.segments.prepareSegment(4*i.length,M,b,this.canOverlap?u.sortKey:void 0),A=this.glyphOffsetArray.length,D=I.vertexLength,L=this.allowVerticalPlacement&&p===k.ax.vertical?Math.PI/2:0,R=u.text&&u.text.sections;for(let F=0;F<i.length;F++){const{tl:O,tr:V,bl:Y,br:J,tex:re,pixelOffsetTL:te,pixelOffsetBR:oe,minFontScaleX:le,minFontScaleY:ae,glyphOffset:ie,isSDF:ye,sectionIndex:Se}=i[F],we=I.vertexLength,xe=ie[1];Au(M,g.x,g.y,O.x,xe+O.y,re.x,re.y,n,ye,te.x,te.y,le,ae),Au(M,g.x,g.y,V.x,xe+V.y,re.x+re.w,re.y,n,ye,oe.x,te.y,le,ae),Au(M,g.x,g.y,Y.x,xe+Y.y,re.x,re.y+re.h,n,ye,te.x,oe.y,le,ae),Au(M,g.x,g.y,J.x,xe+J.y,re.x+re.w,re.y+re.h,n,ye,oe.x,oe.y,le,ae),Jh(e.dynamicLayoutVertexArray,g,L),b.emplaceBack(we,we+2,we+1),b.emplaceBack(we+1,we+2,we+3),I.vertexLength+=4,I.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ie[0]),F!==i.length-1&&Se===i[F+1].sectionIndex||e.programConfigurations.populatePaintArrays(M.length,u,u.index,{imagePositions:{},canonical:T,formattedSection:R?.[Se]})}e.placedSymbolArray.emplaceBack(g.x,g.y,A,this.glyphOffsetArray.length-A,D,m,v,g.segment,n?n[0]:0,n?n[1]:0,s[0],s[1],p,0,!1,0,_)}_addCollisionDebugVertex(e,i,n,s,l,u){return i.emplaceBack(0,0),e.emplaceBack(n.x,n.y,s,l,Math.round(u.x),Math.round(u.y))}addCollisionDebugVertices(e,i,n,s,l,u,p){const g=l.segments.prepareSegment(4,l.layoutVertexArray,l.indexArray),m=g.vertexLength,v=l.layoutVertexArray,_=l.collisionVertexArray,T=p.anchorX,b=p.anchorY;this._addCollisionDebugVertex(v,_,u,T,b,new ge(e,i)),this._addCollisionDebugVertex(v,_,u,T,b,new ge(n,i)),this._addCollisionDebugVertex(v,_,u,T,b,new ge(n,s)),this._addCollisionDebugVertex(v,_,u,T,b,new ge(e,s)),g.vertexLength+=4;const M=l.indexArray;M.emplaceBack(m,m+1),M.emplaceBack(m+1,m+2),M.emplaceBack(m+2,m+3),M.emplaceBack(m+3,m),g.primitiveLength+=4}addDebugCollisionBoxes(e,i,n,s){for(let l=e;l<i;l++){const u=this.collisionBoxArray.get(l);this.addCollisionDebugVertices(u.x1,u.y1,u.x2,u.y2,s?this.textCollisionBox:this.iconCollisionBox,u.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ed(se,Ap.members,Ae),this.iconCollisionBox=new ed(se,Ap.members,Ae);for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);this.addDebugCollisionBoxes(i.textBoxStartIndex,i.textBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.iconBoxStartIndex,i.iconBoxEndIndex,i,!1),this.addDebugCollisionBoxes(i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex,i,!1)}}_deserializeCollisionBoxesForSymbol(e,i,n,s,l,u,p,g,m){const v={};for(let _=i;_<n;_++){const T=e.get(_);v.textBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},v.textFeatureIndex=T.featureIndex;break}for(let _=s;_<l;_++){const T=e.get(_);v.verticalTextBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},v.verticalTextFeatureIndex=T.featureIndex;break}for(let _=u;_<p;_++){const T=e.get(_);v.iconBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},v.iconFeatureIndex=T.featureIndex;break}for(let _=g;_<m;_++){const T=e.get(_);v.verticalIconBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},v.verticalIconFeatureIndex=T.featureIndex;break}return v}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){const n=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,i){const n=e.placedSymbolArray.get(i),s=n.vertexStartIndex+4*n.numGlyphs;for(let l=n.vertexStartIndex;l<s;l+=4)e.indexArray.emplaceBack(l,l+2,l+1),e.indexArray.emplaceBack(l+1,l+2,l+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const i=Math.sin(e),n=Math.cos(e),s=[],l=[],u=[];for(let p=0;p<this.symbolInstances.length;++p){u.push(p);const g=this.symbolInstances.get(p);s.push(0|Math.round(i*g.anchorX+n*g.anchorY)),l.push(g.featureIndex)}return u.sort(((p,g)=>s[p]-s[g]||l[g]-l[p])),u}addToSortKeyRanges(e,i){const n=this.sortKeyRanges[this.sortKeyRanges.length-1];n?.sortKey===i?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const n=this.symbolInstances.get(i);this.featureSortOrder.push(n.featureIndex);const s=[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex];for(let l=0;l<s.length;l++){const u=s[l];u>=0&&s.indexOf(u)===l&&this.addIndicesForPlacedSymbol(this.text,u)}n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Gp,$p;Ee("SymbolBucket",So,{omit:["layers","collisionBoxArray","features","compareText"]}),So.MAX_GLYPHS=65535,So.addDynamicAttributes=Jh;var td={get paint(){return $p=$p||new Di({"icon-opacity":new ke(ce.paint_symbol["icon-opacity"]),"icon-color":new ke(ce.paint_symbol["icon-color"]),"icon-halo-color":new ke(ce.paint_symbol["icon-halo-color"]),"icon-halo-width":new ke(ce.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ke(ce.paint_symbol["icon-halo-blur"]),"icon-translate":new De(ce.paint_symbol["icon-translate"]),"icon-translate-anchor":new De(ce.paint_symbol["icon-translate-anchor"]),"text-opacity":new ke(ce.paint_symbol["text-opacity"]),"text-color":new ke(ce.paint_symbol["text-color"],{runtimeType:$i,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new ke(ce.paint_symbol["text-halo-color"]),"text-halo-width":new ke(ce.paint_symbol["text-halo-width"]),"text-halo-blur":new ke(ce.paint_symbol["text-halo-blur"]),"text-translate":new De(ce.paint_symbol["text-translate"]),"text-translate-anchor":new De(ce.paint_symbol["text-translate-anchor"])})},get layout(){return Gp=Gp||new Di({"symbol-placement":new De(ce.layout_symbol["symbol-placement"]),"symbol-spacing":new De(ce.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new De(ce.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ke(ce.layout_symbol["symbol-sort-key"]),"symbol-z-order":new De(ce.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new De(ce.layout_symbol["icon-allow-overlap"]),"icon-overlap":new De(ce.layout_symbol["icon-overlap"]),"icon-ignore-placement":new De(ce.layout_symbol["icon-ignore-placement"]),"icon-optional":new De(ce.layout_symbol["icon-optional"]),"icon-rotation-alignment":new De(ce.layout_symbol["icon-rotation-alignment"]),"icon-size":new ke(ce.layout_symbol["icon-size"]),"icon-text-fit":new De(ce.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new De(ce.layout_symbol["icon-text-fit-padding"]),"icon-image":new ke(ce.layout_symbol["icon-image"]),"icon-rotate":new ke(ce.layout_symbol["icon-rotate"]),"icon-padding":new ke(ce.layout_symbol["icon-padding"]),"icon-keep-upright":new De(ce.layout_symbol["icon-keep-upright"]),"icon-offset":new ke(ce.layout_symbol["icon-offset"]),"icon-anchor":new ke(ce.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new De(ce.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new De(ce.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new De(ce.layout_symbol["text-rotation-alignment"]),"text-field":new ke(ce.layout_symbol["text-field"]),"text-font":new ke(ce.layout_symbol["text-font"]),"text-size":new ke(ce.layout_symbol["text-size"]),"text-max-width":new ke(ce.layout_symbol["text-max-width"]),"text-line-height":new De(ce.layout_symbol["text-line-height"]),"text-letter-spacing":new ke(ce.layout_symbol["text-letter-spacing"]),"text-justify":new ke(ce.layout_symbol["text-justify"]),"text-radial-offset":new ke(ce.layout_symbol["text-radial-offset"]),"text-variable-anchor":new De(ce.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new ke(ce.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new ke(ce.layout_symbol["text-anchor"]),"text-max-angle":new De(ce.layout_symbol["text-max-angle"]),"text-writing-mode":new De(ce.layout_symbol["text-writing-mode"]),"text-rotate":new ke(ce.layout_symbol["text-rotate"]),"text-padding":new De(ce.layout_symbol["text-padding"]),"text-keep-upright":new De(ce.layout_symbol["text-keep-upright"]),"text-transform":new ke(ce.layout_symbol["text-transform"]),"text-offset":new ke(ce.layout_symbol["text-offset"]),"text-allow-overlap":new De(ce.layout_symbol["text-allow-overlap"]),"text-overlap":new De(ce.layout_symbol["text-overlap"]),"text-ignore-placement":new De(ce.layout_symbol["text-ignore-placement"]),"text-optional":new De(ce.layout_symbol["text-optional"])})}};class qp{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Kr,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i?.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ee("FormatSectionOverride",qp,{omit:["defaultValue"]});class Du extends nr{constructor(e,i){super(e,td,i)}recalculate(e,i){if(super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const n=this.layout.get("text-writing-mode");if(n){const s=[];for(const l of n)s.includes(l)||s.push(l);this.layout._values["text-writing-mode"]=s}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,i,n,s){const l=this.layout.get(e).evaluate(i,{},n,s),u=this._unevaluatedLayout._values[e];return u.isDataDriven()||$s(u.value)||!l?l:(function(p,g){return g.replace(/{([^{}]+)}/g,((m,v)=>p&&v in p?String(p[v]):""))})(i.properties,l)}createBucket(e){return new So(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of td.paint.overridableProperties){if(!Du.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),n=new qp(i),s=new Un(n,i.property.specification);let l=null;l=i.value.kind==="constant"||i.value.kind==="source"?new qs("source",s):new Ws("composite",s,i.value.zoomStops),this.paint._values[e]=new vr(i.property,l,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,n){return!(!this.layout||i.isDataDriven()||n.isDataDriven())&&Du.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const n=e.get("text-field"),s=td.paint.properties[i];let l=!1;const u=p=>{var g;for(const m of p)if(!((g=s.overrides)===null||g===void 0)&&g.hasOverride(m))return void(l=!0)};if(n.value.kind==="constant"&&n.value.value instanceof Ni)u(n.value.value.sections);else if(n.value.kind==="source"||n.value.kind==="composite"){const p=m=>{l||(m instanceof Sr&&Nt(m.value)===En?u(m.value.sections):m instanceof Sa?u(m.sections):m.eachChild(p))},g=n.value;g._styleExpression&&p(g._styleExpression.expression)}return l}}let Wp;var b_={get paint(){return Wp=Wp||new Di({"background-color":new De(ce.paint_background["background-color"]),"background-pattern":new hu(ce.paint_background["background-pattern"]),"background-opacity":new De(ce.paint_background["background-opacity"])})}};class w_ extends nr{constructor(e,i){super(e,b_,i)}}class T_ extends nr{constructor(e,i){super(e,{},i),this.onAdd=n=>{this.implementation.onAdd&&this.implementation.onAdd(n,n.painter.context.gl)},this.onRemove=n=>{this.implementation.onRemove&&this.implementation.onRemove(n,n.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class S_{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var e;this._triggered||(this._triggered=!0,(e=this._channel)===null||e===void 0||e.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const P_={once:!0},id=63710088e-1;class vn{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new vn(wr(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,n=this.lat*i,s=e.lat*i,l=Math.sin(n)*Math.sin(s)+Math.cos(n)*Math.cos(s)*Math.cos((e.lng-this.lng)*i);return id*Math.acos(Math.min(l,1))}static convert(e){if(e instanceof vn)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new vn(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new vn(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Hp=2*Math.PI*id;function Xp(r){return Hp*Math.cos(r*Math.PI/180)}function Yp(r){return(180+r)/360}function Kp(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function Jp(r,e){return r/Xp(e)}function Qp(r){return 360*r-180}function zu(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function ef(r,e){return r*Xp(zu(e))}class ac{constructor(e,i,n=0){this.x=+e,this.y=+i,this.z=+n}static fromLngLat(e,i=0){const n=vn.convert(e);return new ac(Yp(n.lng),Kp(n.lat),Jp(i,n.lat))}toLngLat(){return new vn(Qp(this.x),zu(this.y))}toAltitude(){return ef(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Hp*(e=zu(this.y),1/Math.cos(e*Math.PI/180));var e}}function tf(r,e,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[r*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class rd{constructor(e,i,n){if(!(function(s,l,u){return!(s<0||s>25||u<0||u>=Math.pow(2,s)||l<0||l>=Math.pow(2,s))})(e,i,n))throw new Error(`x=${i}, y=${n}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=i,this.y=n,this.key=Po(0,e,e,i,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i,n){const s=(u=this.y,p=this.z,g=tf(256*(l=this.x),256*(u=Math.pow(2,p)-u-1),p),m=tf(256*(l+1),256*(u+1),p),g[0]+","+g[1]+","+m[0]+","+m[1]);var l,u,p,g,m;const v=(function(_,T,b){let M="";for(let I=_;I>0;I--){const A=1<<I-1;M+=(T&A?1:0)+(b&A?2:0)}return M})(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(n==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,i>1?"@2x":"").replace(/{quadkey}/g,v).replace(/{bbox-epsg-3857}/g,s)}isChildOf(e){const i=this.z-e.z;return i>0&&e.x===this.x>>i&&e.y===this.y>>i}getTilePoint(e){const i=Math.pow(2,this.z);return new ge((e.x*i-this.x)*Le,(e.y*i-this.y)*Le)}toString(){return`${this.z}/${this.x}/${this.y}`}}class rf{constructor(e,i){this.wrap=e,this.canonical=i,this.key=Po(e,i.z,i.z,i.x,i.y)}}class or{constructor(e,i,n,s,l){if(this.terrainRttPosMatrix32f=null,e<n)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${n}`);this.overscaledZ=e,this.wrap=i,this.canonical=new rd(n,+s,+l),this.key=Po(i,e,n,s,l)}clone(){return new or(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const i=this.canonical.z-e;return e>this.canonical.z?new or(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new or(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,i){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const n=this.canonical.z-e;return e>this.canonical.z?Po(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y):Po(this.wrap*+i,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;const i=this.canonical.z-e.canonical.z;return!(i<0)&&e.canonical.x===this.canonical.x>>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new or(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,n=2*this.canonical.x,s=2*this.canonical.y;return[new or(i,this.wrap,i,n,s),new or(i,this.wrap,i,n+1,s),new or(i,this.wrap,i,n,s+1),new or(i,this.wrap,i,n+1,s+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>
2e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new or(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new or(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new rf(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new ac(e.x-this.wrap,e.y))}normalizeCoordinates(e,i,n=8192){if(e>=0&&e<n&&i>=0&&i<n)return{tileID:this,x:e,y:i};const s=Math.floor(e/n),l=Math.floor(i/n),u=e-s*n,p=i-l*n,g=this.canonical.z,m=1<<g,v=this.canonical.y+l;if(v<0||v>=m)return null;let _=this.canonical.x+s,T=this.wrap;return _<0?(T-=Math.ceil(-_/m),_=(_%m+m)%m):_>=m&&(T+=Math.floor(_/m),_%=m),{tileID:new or(this.overscaledZ,T,g,_,v),x:u,y:p}}}function Po(r,e,i,n,s){(r*=2)<0&&(r=-1*r-1);const l=1<<i;return(l*l*r+l*s+n).toString(36)+i.toString(36)+e.toString(36)}Ee("CanonicalTileID",rd),Ee("OverscaledTileID",or,{omit:["terrainRttPosMatrix32f"]});class hs{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){const i=new hs;return i.extend(e(new ge(this.minX,this.minY))),i.extend(e(new ge(this.maxX,this.minY))),i.extend(e(new ge(this.minX,this.maxY))),i.extend(e(new ge(this.maxX,this.maxY))),i}static fromPoints(e){const i=new hs;for(const n of e)i.extend(n);return i}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}}class af{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i<e.length;i++){const n=e[i];this._stringToNumber[n]=i,this._numberToString[i]=n}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class nf{constructor(e,i,n,s,l){this.type="Feature",this._vectorTileFeature=e,this._x=n,this._y=s,this._z=i,this.properties=e.properties,this.id=l}projectPoint(e,i,n,s){return[360*(e.x+i)/s-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+n)/s)*Math.PI))-90]}projectLine(e,i,n,s){return e.map((l=>this.projectPoint(l,i,n,s)))}get geometry(){if(this._geometry)return this._geometry;const e=this._vectorTileFeature,i=e.extent*Math.pow(2,this._z),n=e.extent*this._x,s=e.extent*this._y,l=e.loadGeometry();switch(e.type){case 1:{const u=[];for(const g of l)u.push(g[0]);const p=this.projectLine(u,n,s,i);this._geometry=u.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p};break}case 2:{const u=l.map((p=>this.projectLine(p,n,s,i)));this._geometry=u.length===1?{type:"LineString",coordinates:u[0]}:{type:"MultiLineString",coordinates:u};break}case 3:{const u=op(l),p=[];for(const g of u)p.push(g.map((m=>this.projectLine(m,n,s,i))));this._geometry=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p};break}default:throw new Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const i in this)i!=="_geometry"&&i!=="_vectorTileFeature"&&i!=="_x"&&i!=="_y"&&i!=="_z"&&(e[i]=this[i]);return e}}class Mo{constructor(e,i,n){this._name=e,this.dataBuffer=i,typeof n=="number"?this._size=n:(this.nullabilityBuffer=n,this._size=n.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class Ru extends Mo{}class ad extends Ru{getValueFromBuffer(e){return this.dataBuffer[e]}}class nd extends Ru{getValueFromBuffer(e){return this.dataBuffer[e]}}class sf extends Mo{constructor(e,i,n,s){super(e,i,s),this.delta=n}}class sd extends sf{constructor(e,i,n,s){super(e,Int32Array.of(i),n,s)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}}class od extends Mo{constructor(e,i,n,s){super(e,s?Int32Array.of(i):Uint32Array.of(i),n)}getValueFromBuffer(e){return this.dataBuffer[0]}}class M_{constructor(e,i,n,s,l=4096){this._name=e,this._geometryVector=i,this._idVector=n,this._propertyVectors=s,this._extent=l}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map((i=>[i.name,i])))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){const e=[],i=this.geometryVector.getGeometries();for(let n=0;n<this.numFeatures;n++){let s;if(this.idVector){const p=this.idVector.getValue(n);s=this.containsMaxSafeIntegerValues(this.idVector)&&p!==null?Number(p):p}const l={coordinates:i[n],type:this.geometryVector.geometryType(n)},u={};
2for(const p of this.propertyVectors){if(!p)continue;const g=p.name,m=p.getValue(n);m!==null&&(u[g]=m)}e.push({id:s,geometry:l,properties:u})}return e}containsMaxSafeIntegerValues(e){return e instanceof ad||e instanceof od||e instanceof sd||e instanceof nd}}class of{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}}var Je,xn;(function(r){r.NONE="NONE",r.DELTA="DELTA",r.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",r.RLE="RLE",r.MORTON="MORTON",r.PDE="PDE"})(Je||(Je={})),(function(r){r.NONE="NONE",r.FAST_PFOR="FAST_PFOR",r.VARINT="VARINT",r.ALP="ALP"})(xn||(xn={}));const ld=new Uint32Array(33);ld[0]=0;for(let r=1;r<=32;r++)ld[r]=r===32?4294967295:4294967295>>>32-r;const cd=ld,Na=256;function ud(r,e){return r-r%e}function I_(r){const e=r>>>0;return((255&e)<<24|(65280&e)<<8|e>>>8&65280|e>>>24&255)>>>0}const hd=(function(){if(!Number.isFinite(65536))return 65536;const r=ud(Math.floor(65536),Na);return r===0?Na:r})(),E_=3*hd/Na+hd|0;function lf(){const r=new Uint8Array(E_);return{dataToBePacked:new Array(33),dataPointers:new Int32Array(33),byteContainer:r,byteContainerI32:new Int32Array(r.buffer,r.byteOffset,r.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function C_(r,e,i,n,s){switch(s){case 1:(function(l,u,p,g){let m=g,v=u;for(let _=0;_<8;_++){const T=l[v++]>>>0;p[m++]=T>>>0&1,p[m++]=T>>>1&1,p[m++]=T>>>2&1,p[m++]=T>>>3&1,p[m++]=T>>>4&1,p[m++]=T>>>5&1,p[m++]=T>>>6&1,p[m++]=T>>>7&1,p[m++]=T>>>8&1,p[m++]=T>>>9&1,p[m++]=T>>>10&1,p[m++]=T>>>11&1,p[m++]=T>>>12&1,p[m++]=T>>>13&1,p[m++]=T>>>14&1,p[m++]=T>>>15&1,p[m++]=T>>>16&1,p[m++]=T>>>17&1,p[m++]=T>>>18&1,p[m++]=T>>>19&1,p[m++]=T>>>20&1,p[m++]=T>>>21&1,p[m++]=T>>>22&1,p[m++]=T>>>23&1,p[m++]=T>>>24&1,p[m++]=T>>>25&1,p[m++]=T>>>26&1,p[m++]=T>>>27&1,p[m++]=T>>>28&1,p[m++]=T>>>29&1,p[m++]=T>>>30&1,p[m++]=T>>>31&1}})(r,e,i,n);break;case 2:(function(l,u,p,g){let m=g,v=u;for(let _=0;_<8;_++){const T=l[v++]>>>0,b=l[v++]>>>0;p[m++]=T>>>0&3,p[m++]=T>>>2&3,p[m++]=T>>>4&3,p[m++]=T>>>6&3,p[m++]=T>>>8&3,p[m++]=T>>>10&3,p[m++]=T>>>12&3,p[m++]=T>>>14&3,p[m++]=T>>>16&3,p[m++]=T>>>18&3,p[m++]=T>>>20&3,p[m++]=T>>>22&3,p[m++]=T>>>24&3,p[m++]=T>>>26&3,p[m++]=T>>>28&3,p[m++]=T>>>30&3,p[m++]=b>>>0&3,p[m++]=b>>>2&3,p[m++]=b>>>4&3,p[m++]=b>>>6&3,p[m++]=b>>>8&3,p[m++]=b>>>10&3,p[m++]=b>>>12&3,p[m++]=b>>>14&3,p[m++]=b>>>16&3,p[m++]=b>>>18&3,p[m++]=b>>>20&3,p[m++]=b>>>22&3,p[m++]=b>>>24&3,p[m++]=b>>>26&3,p[m++]=b>>>28&3,p[m++]=b>>>30&3}})(r,e,i,n);break;case 3:(function(l,u,p,g){let m=g,v=u;for(let _=0;_<8;_++){const T=l[v++]>>>0,b=l[v++]>>>0,M=l[v++]>>>0;p[m++]=T>>>0&7,p[m++]=T>>>3&7,p[m++]=T>>>6&7,p[m++]=T>>>9&7,p[m++]=T>>>12&7,p[m++]=T>>>15&7,p[m++]=T>>>18&7,p[m++]=T>>>21&7,p[m++]=T>>>24&7,p[m++]=T>>>27&7,p[m++]=7&(T>>>30|(1&b)<<2),p[m++]=b>>>1&7,p[m++]=b>>>4&7,p[m++]=b>>>7&7,p[m++]=b>>>10&7,p[m++]=b>>>13&7,p[m++]=b>>>16&7,p[m++]=b>>>19&7,p[m++]=b>>>22&7,p[m++]=b>>>25&7,p[m++]=b>>>28&7,p[m++]=7&(b>>>31|(3&M)<<1),p[m++]=M>>>2&7,p[m++]=M>>>5&7,p[m++]=M>>>8&7,p[m++]=M>>>11&7,p[m++]=M>>>14&7,p[m++]=M>>>17&7,p[m++]=M>>>20&7,p[m++]=M>>>23&7,p[m++]=M>>>26&7,p[m++]=M>>>29&7}})(r,e,i,n);break;case 4:(function(l,u,p,g){let m=g,v=u;for(let _=0;_<8;_++){const T=l[v++]>>>0,b=l[v++]>>>0,M=l[v++]>>>0,I=l[v++]>>>0;p[m++]=T>>>0&15,p[m++]=T>>>4&15,p[m++]=T>>>8&15,p[m++]=T>>>12&15,p[m++]=T>>>16&15,p[m++]=T>>>20&15,p[m++]=T>>>24&15,p[m++]=T>>>28&15,p[m++]=b>>>0&15,p[m++]=b>>>4&15,p[m++]=b>>>8&15,p[m++]=b>>>12&15,p[m++]=b>>>16&15,p[m++]=b>>>20&15,p[m++]=b>>>24&15,p[m++]=b>>>28&15,p[m++]=M>>>0&15,p[m++]=M>>>4&15,p[m++]=M>>>8&15,p[m++]=M>>>12&15,p[m++]=M>>>16&15,p[m++]=M>>>20&15,p[m++]=M>>>24&15,p[m++]=M>>>28&15,p[m++]=I>>>0&15,p[m++]=I>>>4&15,p[m++]=I>>>8&15,p[m++]=I>>>12&15,p[m++]=I>>>16&15,p[m++]=I>>>20&15,p[m++]=I>>>24&15,p[m++]=I>>>28&15}})(r,e,i,n);break;case 5:(function(l,u,p,g){let m=g,v=u;for(let _=0;_<8;_++){const T=l[v++]>>>0,b=l[v++]>>>0,M=l[v++]>>>0,I=l[v++]>>>0,A=l[v++]>>>0;p[m++]=T>>>0&31,p[m++]=T>>>5&31,p[m++]=T>>>10&31,p[m++]=T>>>15&31,p[m++]=T>>>20&31,p[m++]=T>>>25&31,p[m++]=31&(T>>>30|(7&b)<<2),p[m++]=b>>>3&31,p[m++]=b>>>8&31,p[m++]=b>>>13&31,p[m++]=b>>>18&31,p[m++]=b>>>23&31,p[m++]=31&(b>>>28|(1&M)<<4),p[m++]=M>>>1&31,p[m++]=M>>>6&31,p[m++]=M>>>11&31,p[m++]=M>>>16&31,p[m++]=M>>>21&31,p[m++]=M>>>26&31,p[m++]=31&(M>>>31|(15&I)<<1),p[m++]=I>>>4&31,p[m++]=I>>>9&31,p[m++]=I>>>14&31,p[m++]=I>>>19&31,p[m++]=I>>>24&31,p[m++]=31&(I>>>29|(3&A)<<3),p[m++]=A>>>2&31,p[m++]=A>>>7&31,p[m++]=A>>>12&31,p[m++]=A>>>17&31,p[m++]=A>>>22&31,p[m++]=A>>>27&31}})(r,e,i,n);break;case 6:(function(l,u,p,g){let m=g,v=u;for(let _=0;_<8;_++){const T=l[v++]>>>0,b=l[v++]>>>0,M=l[v++]>>>0,I=l[v++]>>>0,A=l[v++]>>>0,D=l[v++]>>>0;p[m++]=T>>>0&63,p[m++]=T>>>6&63,p[m++]=T>>>12&63,p[m++]=T>>>18&63,p[m++]=T>>>24&63,p[m++]=63&(T>>>30|(15&b)<<2),p[m++]=b>>>4&63,p[m++]=b>>>10&63,p[m++]=b>>>16&63,p[m++]=b>>>22&63,p[m++]=63&(b>>>28|(3&M)<<4),p[m++]=M>>>2&63,p[m++]=M>>>8&63,p[m++]=M>>>14&63,p[m++]=M>>>20&63,p[m++]=M>>>26&63,p[m++]=I>>>0&63,p[m++]=I>>>6&63,p[m++]=I>>>12&63,p[m++]=I>>>18&63,p[m++]=I>>>24&63,p[m++]=63&(I>>>30|(15&A)<<2),p[m++]=A>>>4&63,p[m++]=A>>>10&63,p[m++]=A>>>16&63,p[m++]=A>>>22&63,p[m++]=63&(A>>>28|(3&D)<<4),p[m++]=D>>>2&63,p[m++]=D>>>8&63,p[m++]=D>>>14&63,p[m++]=D>>>20&63,p[m++]=D>>>26&63}})(r,e,i,n);break;case 7:(function(l,u,p,g){let m=g,v=u;for(let _=0;_<8;_++){const T=l[v++]>>>0,b=l[v++]>>>0,M=l[v++]>>>0,I=l[v++]>>>0,A=l[v++]>>>0,D=l[v++]>>>0,L=l[v++]>>>0;p[m++]=T>>>0&127,p[m++]=T>>>7&127,p[m++]=T>>>14&127,p[m++]=T>>>21&127,p[m++]=127&(T>>>28|(7&b)<<4),p[m++]=b>>>3&127,p[m++]=b>>>10&127,p[m++]=b>>>17&127,p[m++]=b>>>24&127,p[m++]=127&(b>>>31|(63&M)<<1),p[m++]=M>>>6&127,p[m++]=M>>>13&127,p[m++]=M>>>20&127,p[m++]=127&(M>>>27|(3&I)<<5),p[m++]=I>>>2&127,p[m++]=I>>>9&127,p[m++]=I>>>16&127,p[m++]=I>>>23&127,p[m++]=127&(I>>>30|(31&A)<<2),p[m++]=A>>>5&127,p[m++]=A>>>12&127,p[m++]=A>>>19&127,p[m++]=127&(A>>>26|(1&D)<<6),p[m++]=D>>>1&127,p[m++]=D>>>8&127,p[m++]=D>>>15&127,p[m++]=D>>>22&127,p[m++]=127&(D>>>29|(15&L)<<3),p[m++]=L>>>4&127,p[m++]=L>>>11&127,p[m++]=L>>>18&127,p[m++]=L>>>25&127}})(r,e,i,n);break;case 8:(function(l,u,p,g){let m=g,v=u;for(let _=0;_<8;_++){const T=l[v++]>>>0,b=l[v++]>>>0,M=l[v++]>>>0,I=l[v++]>>>0,A=l[v++]>>>0,D=l[v++]>>>0,L=l[v++]>>>0,R=l[v++]>>>0;p[m++]=T>>>0&255,p[m++]=T>>>8&255,p[m++]=T>>>16&255,p[m++]=T>>>24&255,p[m++]=b>>>0&255,p[m++]=b>>>8&255,p[m++]=b>>>16&255,p[m++]=b>>>24&255,p[m++]=M>>>0&255,p[m++]=M>>>8&255,p[m++]=M>>>16&255,p[m++]=M>>>24&255,p[m++]=I>>>0&255,p[m++]=I>>>8&255,p[m++]=I>>>16&255,p[m++]=I>>>24&255,p[m++]=A>>>0&255,p[m++]=A>>>8&255,p[m++]=A>>>16&255,p[m++]=A>>>24&255,p[m++]=D>>>0&255,p[m++]=D>>>8&255,p[m++]=D>>>16&255,p[m++]=D>>>24&255,p[m++]=L>>>0&255,p[m++]=L>>>8&255,p[m++]=L>>>16&255,p[m++]=L>>>24&255,p[m++]=R>>>0&255,p[m++]=R>>>8&255,p[m++]=R>>>16&255,p[m++]=R>>>24&255}})(r,e,i,n);break;case 16:(function(l,u,p,g){let m=g,v=u;for(let _=0;_<128;_++){const T=l[v++]>>>0;p[m++]=65535&T,p[m++]=T>>>16&65535}})(r,e,i,n);break;default:(function(l,u,p,g,m){const v=cd[m]>>>0;let _=u,T=0,b=l[_]>>>0,M=g;
2for(let I=0;I<8;I++){for(let A=0;A<32;A++)if(T+m<=32)p[M+A]=b>>>T&v,T+=m,T===32&&(T=0,_++,A!==31&&(b=l[_]>>>0));else{const D=32-T,L=b>>>T;_++,b=l[_]>>>0;const R=m-D;p[M+A]=(L|(b&-1>>>32-R>>>0)<<D)&v,T=R}M+=32,T=0,I<7&&(b=l[_]>>>0)}})(r,e,i,n,s)}return e+(s<<3)|0}function A_(r,e,i,n){if(i+2>e)throw new Error(`FastPFOR decode: byteContainer underflow at block=${n} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${i}, byteSize=${e})`);const s=r[i++],l=r[i++];if(s>32)throw new Error(`FastPFOR decode: invalid bitWidth=${s} at block=${n} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:s,exceptionCount:l,bytePosIn:i}}function D_(r,e,i,n,s,l,u,p,g){const{maxBits:m,exceptionBitWidth:v,bytePosIn:_}=(function(A,D,L,R,F,O){if(L+1>D)throw new Error(`FastPFOR decode: exception header underflow at block=${O} (need 1 byte for maxBits, bytePos=${L}, byteSize=${D})`);const V=A[L++];if(V<R||V>32)throw new Error(`FastPFOR decode: invalid maxBits=${V} at block=${O} (bitWidth=${R}, expected ${R}..32)`);const Y=V-R|0;if(Y<1||Y>32)throw new Error(`FastPFOR decode: invalid exceptionBitWidth=${Y} at block=${O} (bitWidth=${R}, maxBits=${V})`);if(L+F>D)throw new Error(`FastPFOR decode: exception positions underflow at block=${O} (need=${F}, have=${D-L})`);return{maxBits:V,exceptionBitWidth:Y,bytePosIn:L}})(s,l,u,i,n,g);if(u=_,v===1){const A=1<<i;for(let D=0;D<n;D=D+1|0)r[s[u++]+e|0]|=A;return u}const T=p.dataToBePacked[v];if(!T)throw new Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${v} (bitWidth=${i}, maxBits=${m}) at block ${g}`);const b=p.dataPointers;let M=0|b[v];const I=0|p.exceptionSizes[v];if(M+n>I)throw new Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${v} (ptr=${M}, need ${n}, size=${I}) at block ${g}`);for(let A=0;A<n;A=A+1|0){const D=s[u++],L=0|T[M++];r[D+e|0]|=L<<i}return b[v]=M,u}function z_(r,e,i,n,s,l){const u=0|i,p=0|r[u];if(p<=0||u+p>r.length-1)throw new Error(`FastPFOR decode: invalid whereMeta=${p} at pageStart=${u} (expected > 0 and pageStart+whereMeta < encoded.length=${r.length})`);const g=u+1|0,m=u+p|0,v=r[m]>>>0,_=v+3>>>2,T=m+1,b=T+_;if(b>=r.length)throw new Error(`FastPFOR decode: invalid byteSize=${v} (metaInts=${_}, pageStart=${u}, packedEnd=${m}, byteContainerStart=${T}) causes bitmapPos=${b} out of bounds (encoded.length=${r.length})`);const M=(function(D,L,R,F){F.byteContainer.length<R&&(F.byteContainer=new Uint8Array(2*R),F.byteContainerI32=void 0);const O=F.byteContainer,V=R>>>2;if(3&O.byteOffset)for(let J=0;J<V;J=J+1|0){const re=0|D[L+J|0],te=J<<2;O[te]=255&re,O[te+1|0]=re>>>8&255,O[te+2|0]=re>>>16&255,O[te+3|0]=re>>>24&255}else{let J=F.byteContainerI32;(!J||J.buffer!==O.buffer||J.byteOffset!==O.byteOffset||J.length<V)&&(J=F.byteContainerI32=new Int32Array(O.buffer,O.byteOffset,O.byteLength>>>2)),J.set(D.subarray(L,L+V))}const Y=3&R;if(Y>0){const J=0|D[L+V|0],re=V<<2;for(let te=0;te<Y;te=te+1|0)O[re+te|0]=J>>>(te<<3)&255}return O})(r,T,v,l),I=v,A=(function(D,L,R){const F=0|D[L++],O=R.dataToBePacked;for(let V=2;V<=32;V=V+1|0){if(!(F>>>V-1&1))continue;if(L>=D.length)throw new Error(`FastPFOR decode: truncated exception stream header (bitWidth=${V}, streamWordIndex=${L}, needWords=1, availableWords=${D.length-L}, encodedWords=${D.length})`);const Y=D[L++]>>>0,J=ud(Y+31,32),re=Y*V+31>>>5;if(L+re>D.length)throw new Error(`FastPFOR decode: truncated exception stream (bitWidth=${V}, size=${Y}, streamWordIndex=${L}, needWords=${re}, availableWords=${D.length-L}, encodedWords=${D.length})`);let te=O[V];(!te||te.length<J)&&(te=O[V]=new Uint32Array(J));let oe=0;for(;oe<Y;oe=oe+32|0)R_(D,L,te,oe,V),L=L+V|0;L=L-((oe-Y|0)*V>>>5)|0,R.exceptionSizes[V]=Y}return L})(r,b,l);return l.dataPointers.fill(0),(function(D,L,R,F,O,V,Y,J,re,te){let oe=0|R,le=0;for(let ae=0;ae<Y;ae=ae+1|0){const ie=A_(J,re,le,ae);le=ie.bytePosIn;const ye=ie.bitWidth,Se=ie.exceptionCount,we=V+ae*Na|0;switch(ye){case 0:O.fill(0,we,we+Na);break;case 32:for(let xe=0;xe<Na;xe=xe+1|0)O[we+xe|0]=0|D[oe+xe|0];oe=oe+Na|0;break;default:oe=C_(D,oe,O,we,ye)}Se>
20&&(le=D_(O,we,ye,Se,J,re,le,te,ae))}if(oe!==F)throw new Error(`FastPFOR decode: packed region mismatch (pageStart=${L}, packedStart=${R}, consumedPackedEnd=${oe}, expectedPackedEnd=${F}, packedWords=${F-R}, encoded.length=${D.length})`)})(r,u,g,m,e,0|n,s/Na|0,M,I,l),A}function R_(r,e,i,n,s){switch(s){case 2:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0;_[b++]=M>>>0&3,_[b++]=M>>>2&3,_[b++]=M>>>4&3,_[b++]=M>>>6&3,_[b++]=M>>>8&3,_[b++]=M>>>10&3,_[b++]=M>>>12&3,_[b++]=M>>>14&3,_[b++]=M>>>16&3,_[b++]=M>>>18&3,_[b++]=M>>>20&3,_[b++]=M>>>22&3,_[b++]=M>>>24&3,_[b++]=M>>>26&3,_[b++]=M>>>28&3,_[b++]=M>>>30&3,_[b++]=I>>>0&3,_[b++]=I>>>2&3,_[b++]=I>>>4&3,_[b++]=I>>>6&3,_[b++]=I>>>8&3,_[b++]=I>>>10&3,_[b++]=I>>>12&3,_[b++]=I>>>14&3,_[b++]=I>>>16&3,_[b++]=I>>>18&3,_[b++]=I>>>20&3,_[b++]=I>>>22&3,_[b++]=I>>>24&3,_[b++]=I>>>26&3,_[b++]=I>>>28&3,_[b]=I>>>30&3})(r,e,i,n);case 3:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0;_[b++]=M>>>0&7,_[b++]=M>>>3&7,_[b++]=M>>>6&7,_[b++]=M>>>9&7,_[b++]=M>>>12&7,_[b++]=M>>>15&7,_[b++]=M>>>18&7,_[b++]=M>>>21&7,_[b++]=M>>>24&7,_[b++]=M>>>27&7,_[b++]=7&(M>>>30|(1&I)<<2),_[b++]=I>>>1&7,_[b++]=I>>>4&7,_[b++]=I>>>7&7,_[b++]=I>>>10&7,_[b++]=I>>>13&7,_[b++]=I>>>16&7,_[b++]=I>>>19&7,_[b++]=I>>>22&7,_[b++]=I>>>25&7,_[b++]=I>>>28&7,_[b++]=7&(I>>>31|(3&A)<<1),_[b++]=A>>>2&7,_[b++]=A>>>5&7,_[b++]=A>>>8&7,_[b++]=A>>>11&7,_[b++]=A>>>14&7,_[b++]=A>>>17&7,_[b++]=A>>>20&7,_[b++]=A>>>23&7,_[b++]=A>>>26&7,_[b]=A>>>29&7})(r,e,i,n);case 4:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0;_[b++]=M>>>0&15,_[b++]=M>>>4&15,_[b++]=M>>>8&15,_[b++]=M>>>12&15,_[b++]=M>>>16&15,_[b++]=M>>>20&15,_[b++]=M>>>24&15,_[b++]=M>>>28&15,_[b++]=I>>>0&15,_[b++]=I>>>4&15,_[b++]=I>>>8&15,_[b++]=I>>>12&15,_[b++]=I>>>16&15,_[b++]=I>>>20&15,_[b++]=I>>>24&15,_[b++]=I>>>28&15,_[b++]=A>>>0&15,_[b++]=A>>>4&15,_[b++]=A>>>8&15,_[b++]=A>>>12&15,_[b++]=A>>>16&15,_[b++]=A>>>20&15,_[b++]=A>>>24&15,_[b++]=A>>>28&15,_[b++]=D>>>0&15,_[b++]=D>>>4&15,_[b++]=D>>>8&15,_[b++]=D>>>12&15,_[b++]=D>>>16&15,_[b++]=D>>>20&15,_[b++]=D>>>24&15,_[b]=D>>>28&15})(r,e,i,n);case 5:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0,L=m[v+4]>>>0;_[b++]=M>>>0&31,_[b++]=M>>>5&31,_[b++]=M>>>10&31,_[b++]=M>>>15&31,_[b++]=M>>>20&31,_[b++]=M>>>25&31,_[b++]=31&(M>>>30|(7&I)<<2),_[b++]=I>>>3&31,_[b++]=I>>>8&31,_[b++]=I>>>13&31,_[b++]=I>>>18&31,_[b++]=I>>>23&31,_[b++]=31&(I>>>28|(1&A)<<4),_[b++]=A>>>1&31,_[b++]=A>>>6&31,_[b++]=A>>>11&31,_[b++]=A>>>16&31,_[b++]=A>>>21&31,_[b++]=A>>>26&31,_[b++]=31&(A>>>31|(15&D)<<1),_[b++]=D>>>4&31,_[b++]=D>>>9&31,_[b++]=D>>>14&31,_[b++]=D>>>19&31,_[b++]=D>>>24&31,_[b++]=31&(D>>>29|(3&L)<<3),_[b++]=L>>>2&31,_[b++]=L>>>7&31,_[b++]=L>>>12&31,_[b++]=L>>>17&31,_[b++]=L>>>22&31,_[b]=L>>>27&31})(r,e,i,n);case 6:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0,L=m[v+4]>>>0,R=m[v+5]>>>0;_[b++]=M>>>0&63,_[b++]=M>>>6&63,_[b++]=M>>>12&63,_[b++]=M>>>18&63,_[b++]=M>>>24&63,_[b++]=63&(M>>>30|(15&I)<<2),_[b++]=I>>>4&63,_[b++]=I>>>10&63,_[b++]=I>>>16&63,_[b++]=I>>>22&63,_[b++]=63&(I>>>28|(3&A)<<4),_[b++]=A>>>2&63,_[b++]=A>>>8&63,_[b++]=A>>>14&63,_[b++]=A>>>20&63,_[b++]=A>>>26&63,_[b++]=D>>>0&63,_[b++]=D>>>6&63,_[b++]=D>>>12&63,_[b++]=D>>>18&63,_[b++]=D>>>24&63,_[b++]=63&(D>>>30|(15&L)<<2),_[b++]=L>>>4&63,_[b++]=L>>>10&63,_[b++]=L>>>16&63,_[b++]=L>>>22&63,_[b++]=63&(L>>>28|(3&R)<<4),_[b++]=R>>>2&63,_[b++]=R>>>8&63,_[b++]=R>>>14&63,_[b++]=R>>>20&63,_[b]=R>>>26&63})(r,e,i,n);case 7:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0,L=m[v+4]>>>0,R=m[v+5]>>>0,F=m[v+6]>>>0;_[b++]=M>>>0&127,_[b++]=M>>>7&127,_[b++]=M>>>14&127,_[b++]=M>>>21&127,_[b++]=127&(M>>>28|(7&I)<<4),_[b++]=I>>>3&127,_[b++]=I>>>10&127,_[b++]=I>>>17&127,_[b++]=I>>>24&127,_[b++]=127&(I>>>31|(63&A)<<1),_[b++]=A>>>6&127,_[b++]=A>>>13&127,_[b++]=A>>>20&127,_[b++]=127&(A>>>27|(3&D)<<5),_[b++]=D>>>2&127,_[b++]=D>>>9&127,_[b++]=D>>>16&127,_[b++]=D>>>23&127,_[b++]=127&(D>>>30|(31&L)<<2),_[b++]=L>>>5&127,_[b++]=L>>>12&127,_[b++]=L>>>19&127,_[b++]=127&(L>>>26|(1&R)<<6),_[b++]=R>>>1&127,_[b++]=R>>>8&127,_[b++]=R>>>15&127,_[b++]=R>>>22&127,_[b++]=127&(R>>>29|(15&F)<<3),_[b++]=F>>>4&127,_[b++]=F>>>11&127,_[b++]=F>>>18&127,_[b]=F>>>25&127})(r,e,i,n);case 8:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0,L=m[v+4]>>>0,R=m[v+5]>>>0,F=m[v+6]>>>0,O=m[v+7]>>>0;_[b++]=M>>>0&255,_[b++]=M>>>8&255,_[b++]=M>>>16&255,_[b++]=M>>>24&255,_[b++]=I>>>0&255,_[b++]=I>>>8&255,_[b++]=I>>>16&255,_[b++]=I>>>24&255,_[b++]=A>>>0&255,_[b++]=A>>>8&255,_[b++]=A>>>16&255,_[b++]=A>>>24&255,_[b++]=D>>>0&255,_[b++]=D>>>8&255,_[b++]=D>>>16&255,_[b++]=D>>>24&255,_[b++]=L>>>0&255,_[b++]=L>>>8&255,_[b++]=L>>>16&255,_[b++]=L>>>24&255,_[b++]=R>>>0&255,_[b++]=R>>>8&255,_[b++]=R>>>16&255,_[b++]=R>>>24&255,_[b++]=F>>>0&255,_[b++]=F>>>8&255,_[b++]=F>>>16&255,_[b++]=F>>>24&255,_[b++]=O>>>0&255,_[b++]=O>>>8&255,_[b++]=O>>>16&255,_[b]=O>>>24&255})(r,e,i,n);case 9:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0,L=m[v+4]>>>0,R=m[v+5]>>>0,F=m[v+6]>>>0,O=m[v+7]>>>0,V=m[v+8]>>>0;_[b++]=M>>>0&511,_[b++]=M>>>9&511,_[b++]=M>>>18&511,_[b++]=511&(M>>>27|(15&I)<<5),_[b++]=I>>>4&511,_[b++]=I>>>13&511,_[b++]=I>>>22&511,_[b++]=511&(I>>>31|(255&A)<<1),_[b++]=A>>>8&511,_[b++]=A>>>17&511,_[b++]=511&(A>>>26|(7&D)<<6),_[b++]=D>>>3&511,_[b++]=D>>>12&511,_[b++]=D>>>21&511,_[b++]=511&(D>>>30|(127&L)<<2),_[b++]=L>>>7&511,_[b++]=L>>>16&511,_[b++]=511&(L>>>25|(3&R)<<7),_[b++]=R>>>2&511,_[b++]=R>>>11&511,_[b++]=R>>>20&511,_[b++]=511&(R>>>29|(63&F)<<3),_[b++]=F>>>6&511,_[b++]=F>>>15&511,_[b++]=511&(F>>>24|(1&O)<<8),_[b++]=O>>>1&511,_[b++]=O>>>10&511,_[b++]=O>>>19&511,_[b++]=511&(O>>>28|(31&V)<<4),_[b++]=V>>>5&511,_[b++]=V>>>14&511,_[b]=V>>>23&511}
2)(r,e,i,n);case 10:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0,L=m[v+4]>>>0,R=m[v+5]>>>0,F=m[v+6]>>>0,O=m[v+7]>>>0,V=m[v+8]>>>0,Y=m[v+9]>>>0;_[b++]=M>>>0&1023,_[b++]=M>>>10&1023,_[b++]=M>>>20&1023,_[b++]=1023&(M>>>30|(255&I)<<2),_[b++]=I>>>8&1023,_[b++]=I>>>18&1023,_[b++]=1023&(I>>>28|(63&A)<<4),_[b++]=A>>>6&1023,_[b++]=A>>>16&1023,_[b++]=1023&(A>>>26|(15&D)<<6),_[b++]=D>>>4&1023,_[b++]=D>>>14&1023,_[b++]=1023&(D>>>24|(3&L)<<8),_[b++]=L>>>2&1023,_[b++]=L>>>12&1023,_[b++]=L>>>22&1023,_[b++]=R>>>0&1023,_[b++]=R>>>10&1023,_[b++]=R>>>20&1023,_[b++]=1023&(R>>>30|(255&F)<<2),_[b++]=F>>>8&1023,_[b++]=F>>>18&1023,_[b++]=1023&(F>>>28|(63&O)<<4),_[b++]=O>>>6&1023,_[b++]=O>>>16&1023,_[b++]=1023&(O>>>26|(15&V)<<6),_[b++]=V>>>4&1023,_[b++]=V>>>14&1023,_[b++]=1023&(V>>>24|(3&Y)<<8),_[b++]=Y>>>2&1023,_[b++]=Y>>>12&1023,_[b]=Y>>>22&1023})(r,e,i,n);case 11:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0,L=m[v+4]>>>0,R=m[v+5]>>>0,F=m[v+6]>>>0,O=m[v+7]>>>0,V=m[v+8]>>>0,Y=m[v+9]>>>0,J=m[v+10]>>>0;_[b++]=M>>>0&2047,_[b++]=M>>>11&2047,_[b++]=2047&(M>>>22|(1&I)<<10),_[b++]=I>>>1&2047,_[b++]=I>>>12&2047,_[b++]=2047&(I>>>23|(3&A)<<9),_[b++]=A>>>2&2047,_[b++]=A>>>13&2047,_[b++]=2047&(A>>>24|(7&D)<<8),_[b++]=D>>>3&2047,_[b++]=D>>>14&2047,_[b++]=2047&(D>>>25|(15&L)<<7),_[b++]=L>>>4&2047,_[b++]=L>>>15&2047,_[b++]=2047&(L>>>26|(31&R)<<6),_[b++]=R>>>5&2047,_[b++]=R>>>16&2047,_[b++]=2047&(R>>>27|(63&F)<<5),_[b++]=F>>>6&2047,_[b++]=F>>>17&2047,_[b++]=2047&(F>>>28|(127&O)<<4),_[b++]=O>>>7&2047,_[b++]=O>>>18&2047,_[b++]=2047&(O>>>29|(255&V)<<3),_[b++]=V>>>8&2047,_[b++]=V>>>19&2047,_[b++]=2047&(V>>>30|(511&Y)<<2),_[b++]=Y>>>9&2047,_[b++]=Y>>>20&2047,_[b++]=2047&(Y>>>31|(1023&J)<<1),_[b++]=J>>>10&2047,_[b]=J>>>21&2047})(r,e,i,n);case 12:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0,L=m[v+4]>>>0,R=m[v+5]>>>0,F=m[v+6]>>>0,O=m[v+7]>>>0,V=m[v+8]>>>0,Y=m[v+9]>>>0,J=m[v+10]>>>0,re=m[v+11]>>>0;_[b++]=M>>>0&4095,_[b++]=M>>>12&4095,_[b++]=4095&(M>>>24|(15&I)<<8),_[b++]=I>>>4&4095,_[b++]=I>>>16&4095,_[b++]=4095&(I>>>28|(255&A)<<4),_[b++]=A>>>8&4095,_[b++]=A>>>20&4095,_[b++]=D>>>0&4095,_[b++]=D>>>12&4095,_[b++]=4095&(D>>>24|(15&L)<<8),_[b++]=L>>>4&4095,_[b++]=L>>>16&4095,_[b++]=4095&(L>>>28|(255&R)<<4),_[b++]=R>>>8&4095,_[b++]=R>>>20&4095,_[b++]=F>>>0&4095,_[b++]=F>>>12&4095,_[b++]=4095&(F>>>24|(15&O)<<8),_[b++]=O>>>4&4095,_[b++]=O>>>16&4095,_[b++]=4095&(O>>>28|(255&V)<<4),_[b++]=V>>>8&4095,_[b++]=V>>>20&4095,_[b++]=Y>>>0&4095,_[b++]=Y>>>12&4095,_[b++]=4095&(Y>>>24|(15&J)<<8),_[b++]=J>>>4&4095,_[b++]=J>>>16&4095,_[b++]=4095&(J>>>28|(255&re)<<4),_[b++]=re>>>8&4095,_[b]=re>>>20&4095})(r,e,i,n);case 16:return void(function(m,v,_,T){let b=T;const M=m[v]>>>0,I=m[v+1]>>>0,A=m[v+2]>>>0,D=m[v+3]>>>0,L=m[v+4]>>>0,R=m[v+5]>>>0,F=m[v+6]>>>0,O=m[v+7]>>>0,V=m[v+8]>>>0,Y=m[v+9]>>>0,J=m[v+10]>>>0,re=m[v+11]>>>0,te=m[v+12]>>>0,oe=m[v+13]>>>0,le=m[v+14]>>>0,ae=m[v+15]>>>0;_[b++]=M>>>0&65535,_[b++]=M>>>16&65535,_[b++]=I>>>0&65535,_[b++]=I>>>16&65535,_[b++]=A>>>0&65535,_[b++]=A>>>16&65535,_[b++]=D>>>0&65535,_[b++]=D>>>16&65535,_[b++]=L>>>0&65535,_[b++]=L>>>16&65535,_[b++]=R>>>0&65535,_[b++]=R>>>16&65535,_[b++]=F>>>0&65535,_[b++]=F>>>16&65535,_[b++]=O>>>0&65535,_[b++]=O>>>16&65535,_[b++]=V>>>0&65535,_[b++]=V>>>16&65535,_[b++]=Y>>>0&65535,_[b++]=Y>>>16&65535,_[b++]=J>>>0&65535,_[b++]=J>>>16&65535,_[b++]=re>>>0&65535,_[b++]=re>>>16&65535,_[b++]=te>>>0&65535,_[b++]=te>>>16&65535,_[b++]=oe>>>0&65535,_[b++]=oe>>>16&65535,_[b++]=le>>>0&65535,_[b++]=le>>>16&65535,_[b++]=ae>>>0&65535,_[b]=ae>>>16&65535})(r,e,i,n);case 32:for(let m=0;m<32;m=m+1|0)i[n+m|0]=0|r[e+m|0];return}const l=cd[s]>>>0;let u=e,p=0,g=r[u]>>>0;for(let m=0;m<32;m++)if(p+s<=32)i[n+m]=g>>>p&l,p+=s,p===32&&(p=0,u++,m!==31&&(g=r[u]>>>0));else{const v=32-p,_=g>>>p;u++,g=r[u]>>>0,i[n+m]=(_|(g&cd[s-v]>>>0)<<v)&l,p=s-v}}function ki(r,e,i){const n=new Uint32Array(i);let s=0,l=e.get();for(let u=0;u<n.length;u++){let p=r[l++],g=127&p;p<128||(p=r[l++],g|=(127&p)<<7,p<128||(p=r[l++],g|=(127&p)<<14,p<128||(p=r[l++
2],g|=(127&p)<<21,p<128||(p=r[l++],g|=(15&p)<<28)))),n[s++]=g}return e.set(l),n}function Io(r,e,i){const n=new BigUint64Array(i);for(let s=0;s<n.length;s++)n[s]=k_(r,e);return n}function k_(r,e){let i=0n,n=0,s=e.get();for(;s<r.length;){const l=r[s++];if(i|=BigInt(127&l)<<BigInt(n),!(128&l))break;if(n+=7,n>=64)throw new Error("Varint too long")}return e.set(s),i}function L_(r,e){let i,n;return n=r[e.get()],e.increment(),i=127&n,n<128?i:(n=r[e.get()],e.increment(),i|=(127&n)<<7,n<128?i:(n=r[e.get()],e.increment(),i|=(127&n)<<14,n<128?i:(n=r[e.get()],e.increment(),i|=(127&n)<<21,n<128?i:(n=r[e.get()],i|=(15&n)<<28,(function(s,l,u){let p,g;if(g=l[u.get()],u.increment(),p=(112&g)>>4,g<128||(g=l[u.get()],u.increment(),p|=(127&g)<<3,g<128)||(g=l[u.get()],u.increment(),p|=(127&g)<<10,g<128)||(g=l[u.get()],u.increment(),p|=(127&g)<<17,g<128)||(g=l[u.get()],u.increment(),p|=(127&g)<<24,g<128)||(g=l[u.get()],u.increment(),p|=(1&g)<<31,g<128))return 4294967296*p+(s>>>0);throw new Error("Expected varint not more than 10 bytes")})(i,r,e)))))}function gt(r){return r>>>1^-(1&r)}function Ui(r){return r>>1n^-(1n&r)}function Eo(r){return r%2==1?(r+1)/-2:r/2}function dd(r,e,i){if(i===void 0){i=0;for(let l=0;l<e;l++)i+=r[l]}const n=new Uint32Array(i);let s=0;for(let l=0;l<e;l++){const u=r[l];n.fill(r[l+e],s,s+u),s+=u}return n}function pd(r,e,i){if(i===void 0){i=0;for(let l=0;l<e;l++)i+=Number(r[l])}const n=new BigUint64Array(i);let s=0;for(let l=0;l<e;l++){const u=Number(r[l]);n.fill(r[l+e],s,s+u),s+=u}return n}function cf(r,e,i){const n=new Float64Array(i);let s=0;for(let l=0;l<e;l++){const u=r[l];n.fill(r[l+e],s,s+u),s+=u}return n}function uf(r){const e=new Int32Array(r.length);e[0]=gt(r[0]);const i=r.length/4*4;let n=1;if(i>=4)for(;n<i-4;n+=4){const s=r[n+1],l=r[n+2],u=r[n+3];e[n]=gt(r[n])+e[n-1],e[n+1]=gt(s)+e[n],e[n+2]=gt(l)+e[n+1],e[n+3]=gt(u)+e[n+2]}for(;n!==r.length;++n)e[n]=gt(r[n])+e[n-1];return e}function hf(r){const e=new BigInt64Array(r.length);e[0]=Ui(r[0]);const i=r.length/4*4;let n=1;if(i>=4)for(;n<i-4;n+=4){const s=r[n+1],l=r[n+2],u=r[n+3];e[n]=Ui(r[n])+e[n-1],e[n+1]=Ui(s)+e[n],e[n+2]=Ui(l)+e[n+1],e[n+3]=Ui(u)+e[n+2]}for(;n!==e.length;++n)e[n]=Ui(r[n])+e[n-1];return e}function fd(r){const e=r.length/4*4;let i=1;if(e>=4)for(let n=r[0];i<e-4;i+=4)n=r[i]+=n,n=r[i+1]+=n,n=r[i+2]+=n,n=r[i+3]+=n;for(;i!==r.length;)r[i]+=r[i-1],++i}var xi,Zr,ds,lr,Pt,si,df,bn;function Zi(r,e){const i=(function(n,s){const l=n[s.get()],u=Object.values(xi)[l>>4];let p=null;switch(u){case xi.DATA:p={dictionaryType:Object.values(Zr)[15&l]};break;case xi.OFFSET:p={offsetType:Object.values(ds)[15&l]};break;case xi.LENGTH:p={lengthType:Object.values(lr)[15&l]}}s.increment();const g=n[s.get()],m=Object.values(Je)[g>>5],v=Object.values(Je)[g>>2&7],_=Object.values(xn)[3&g];s.increment();const T=ki(n,s,2),b=T[0];return{physicalStreamType:u,logicalStreamType:p,logicalLevelTechnique1:m,logicalLevelTechnique2:v,physicalLevelTechnique:_,numValues:b,byteLength:T[1],decompressedCount:b}})(r,e);return i.logicalLevelTechnique1===Je.MORTON?(function(n,s,l){const u=ki(s,l,2);return{physicalStreamType:n.physicalStreamType,logicalStreamType:n.logicalStreamType,logicalLevelTechnique1:n.logicalLevelTechnique1,logicalLevelTechnique2:n.logicalLevelTechnique2,physicalLevelTechnique:n.physicalLevelTechnique,numValues:n.numValues,byteLength:n.byteLength,decompressedCount:n.decompressedCount,numBits:u[0],coordinateShift:u[1]}})(i,r,e):Je.RLE!==i.logicalLevelTechnique1&&Je.RLE!==i.logicalLevelTechnique2||xn.NONE===i.physicalLevelTechnique?i:(function(n,s,l){const u=ki(s,l,2);return{physicalStreamType:n.physicalStreamType,logicalStreamType:n.logicalStreamType,logicalLevelTechnique1:n.logicalLevelTechnique1,logicalLevelTechnique2:n.logicalLevelTechnique2,physicalLevelTechnique:n.physicalLevelTechnique,numValues:n.numValues,byteLength:n.byteLength,decompressedCount:u[1],runs:u[0],numRleValues:u[1]}})(i,r,e)}(function(r){r.PRESENT="PRESENT",r.DATA="DATA",r.OFFSET="OFFSET",r.LENGTH="LENGTH"})(xi||(xi={})),(function(r){r.NONE="NONE",r.SINGLE="SINGLE",r.SHARED="SHARED",r.VERTEX="VERTEX",r.MORTON="MORTON",r.FSST="FSST"})(Zr||(Zr={})),(function(r){r.VERTEX="VERTEX",r.INDEX="INDEX",r.STRING="STRING",r.KEY="KEY"})(ds||(ds={})),(function(r){r.VAR_BINARY="VAR_BINARY",r.GEOMETRIES="GEOMETRIES",r.PARTS="PARTS",r.RINGS="RINGS",r.TRIANGLES="TRIANGLES",r.SYMBOL="SYMBOL",r.DICTIONARY="DICTIONARY"})(lr||(lr={})),(function(r){r[r.FLAT=0]="FLAT",r[r.CONST=1]="CONST",r[r.SEQUENCE=2]="SEQUENCE",r[r.DICTIONARY=3]="DICTIONARY",r[r.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(Pt||(Pt={}));class Gr{constructor(e,i){this.values=e,this._size=i}get(e){const i=Math.floor(e/8);return(this.values[i]>>e%8&1)==1}set(e,i){const n=Math.floor(e/8);this.values[n]=this.values[n]|(i?1:0)<<e%8}getInt(e){const i=Math.floor(e/8);return this.values[i]>>e%8&1}size(){return this._size}getBuffer(){return this.values}}function Co(r,e,i){if(!e)return r;const n=e.size(),s=new r.constructor(n);let l=0;for(let u=0;u<n;u++)s[u]=e.get(u)?r[l++]:i;return s}function md(r,e,i,n,s){return(function(l,u,p,g){let m;switch(u.logicalLevelTechnique1){case Je.DELTA:if(u.logicalLevelTechnique2===Je.RLE){const v=u;if(!g)return(function(_,T,b){const M=new Int32Array(b);let I=0,A=0;for(let D=0;D<T;D++){const L=_[D],R=gt(_[D+T]);for(let F=0;F<L;F++)A+=R,M[I++]=A}return M})(l,v.runs,v.numRleValues);m=uf(l=dd(l,v.runs,v.numRleValues))}else m=uf(l);break;case Je.RLE:m=(function(v,_,T){if(T===void 0){T=0;for(let I=0;I<_;I++)T+=v[I]}const b=new Int32Array(T);let M=0;for(let I=0;I<_;I++){const A=v[I];let D=v[I+_];D=gt(D),b.fill(D,M,M+A),M+=A}return b})(l,u.runs,u.numRleValues);break;case Je.MORTON:fd(l),m=new Int32Array(l);break;case Je.COMPONENTWISE_DELTA:m=(function(v){if(v.length<2)return new Int32Array(v);const _=new Int32Array(v.length);_[0]=gt(v[0]),_[1]=gt(v[1]);const T=v.length/4*4;let b=2;if(T>=4)for(;b<T-4;b+=4){const M=v[b+1],I=v[b+2],A=v[b+3];_[b]=gt(v[b])+_[b-2],_[b+1]=gt(M)+_[b-1],_[b+2]=gt(I)+_[b],_[b+3]=gt(A)+_[b+1]}for(;b!==v.length;b+=2)_[b]=gt(v[b])+_[b-2],_[b+1]=gt(v[b+1])+_[b-1];return _})(l);break;case Je.NONE:m=(function(v){const _=new Int32Array(v.length);for(let T=0;T<v.length;T++)_[T]=gt(v[T]);return _})(l);break;default:throw new Error(`The specified Logical level technique is not supported: ${u.logicalLevelTechnique1}`)}return g?Co(m,g,0):m})(Ao(r,e,i),i,0,s)}function cr(r,e,i,n,s){return(function(l,u,p,g){let m;switch(u.logicalLevelTechnique1){case Je.DELTA:m=(function(v){const _=new Uint32Array(v.length);_[0]=gt(v[0])>>>0;for(let T=1;T<v.length;T++)_[T]=_[T-1]+gt(v[T])>>>0;return _})(u.logicalLevelTechnique2===Je.RLE?dd(l,u.runs,u.numRleValues):l);break;case Je.RLE:m=dd(l,u.runs,u.numRleValues);break;case Je.MORTON:fd(l),m=l;break;case Je.COMPONENTWISE_DELTA:m=(function(v){if(v.length<2)return new Uint32Array(v);const _=new Uint32Array(v.length);_[0]=gt(v[0])>>>0,_[1]=gt(v[1])>>>0;for(let T=2;T<v.length;T+=2)_[T]=_[T-2]+gt(v[T])>>>0,_[T+1]=_[T-1]+gt(v[T+1])>>>0;return _})(l);break;case Je.NONE:m=l;break;default:throw new Error(`The specified Logical level technique is not supported: ${u.logicalLevelTechnique1}`)}return g?Co(m,g,0):m})(Ao(r,e,i),i,0,s)}function wn(r,e,i){return(function(n,s){if(s.logicalLevelTechnique1===Je.DELTA&&s.logicalLevelTechnique2===Je.NONE)return(function(l){const u=new Int32Array(l.length+1);u[0]=0,u[1]=gt(l[0]);let p=u[1];for(let g=2;g!==u.length;++g)p+=gt(l[g-1]),u[g]=u[g-1]+p;return new Uint32Array(u)})(n);if(s.logicalLevelTechnique1===Je.RLE&&s.logicalLevelTechnique2===Je.NONE)return(function(l,u,p){const g=new Uint32Array(p+1);g[0]=0;let m=1,v=g[0];for(let _=0;_<u;_++){const T=l[_],b=l[_+u];for(let M=m;M<m+T;M++)g[M]=b+v,v=g[M];m+=T}return g})(n,s.runs,s.numRleValues);if(s.logicalLevelTechnique1===Je.NONE&&s.logicalLevelTechnique2===Je.NONE){(function(u){let p=0;for(let g=0;g<u.length;g++)u[g]+=p,p=u[g]})(n);const l=new Uint32Array(s.numValues+1);return l[0]=0,l.set(n,1),l}if(s.logicalLevelTechnique1===Je.DELTA&&s.logicalLevelTechnique2===Je.RLE){const l=(function(u,p,g){const m=new Int32Array(g+1);m[0]=0;let v=1,_=m[0];for(let T=0;T<p;T++){const b=u[T];let M=u[T+p];M=gt(M);for(let I=v;I<v+b;I++)m[I]=M+_,_=m[I];v+=b}return m})(n,s.runs,s.numRleValues);return fd(l),new Uint32Array(l)}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")})(Ao(r,e,i),i)}function Ao(r,e,i){const n=i.physicalLevelTechnique;switch(n){case xn.FAST_PFOR:return(function(s,l,u,p){return(function(g,m,v,_,T){const b=_.get();
2if(3&v)throw new Error(`FastPFOR: invalid encodedByteLength=${v} at offset=${b} (encodedBytes.length=${g.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);const M=v>>>2,I=(function(D,L){if(L<=D.encodedWords.length)return D.encodedWords;const R=new Uint32Array(Math.max(16,2*L));return D.encodedWords=R,R})(T,M);(function(D,L,R,F){if(L<0||R<0||L+R>D.length)throw new RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${L}, byteLength=${R}, bytes.length=${D.length})`);const O=Math.floor(R/4),V=R%4!=0,Y=V?O+1:O;if(F.length<Y)throw new RangeError(`decodeBigEndianInt32sInto: out.length=${F.length} < ${Y}`);if(O>0){const J=D.byteOffset+L;if(3&J)for(let re=0;re<O;re++){const te=L+4*re;F[re]=D[te]<<24|D[te+1]<<16|D[te+2]<<8|D[te+3]}else{const re=new Uint32Array(D.buffer,J,O);for(let te=0;te<O;te++)F[te]=0|I_(re[te])}}if(V){const J=L+4*O,re=R-4*O;let te=0;for(let oe=0;oe<re;oe++)te|=D[J+oe]<<24-8*oe;F[O]=0|te}})(g,b,v,I);const A=(function(D,L,R){let F=0,O=0;const V=new Uint32Array(L),Y=R??lf();if(D.length>0){const J=0|D[F];if(F=F+1|0,255&J)throw new Error(`FastPFOR decode: invalid alignedLength=${J} (expected multiple of 256)`);if(O+J>V.length)throw new Error(`FastPFOR decode: output buffer too small (outPos=${O}, alignedLength=${J}, out.length=${V.length})`);F=(function(re,te,oe,le,ae,ie){const ye=le+ud(ae,Na);let Se=le,we=oe;for(;Se!==ye;){const xe=Math.min(hd,ye-Se);we=z_(re,te,we,Se,xe,ie),Se=Se+xe|0}return we})(D,V,F,O,J,Y),O=O+J|0}return(function(J,re,te,oe,le,ae){if(ae===0)return re;let ie=0,ye=re;const Se=re+te,we=le;let xe=le;const Oe=le+ae;let rt=0,nt=0;for(;ye<Se&&xe<Oe;){const ht=J[ye]>>>ie&255;if(ie+=8,ye+=ie>>>5,ie&=31,rt|=(127&ht)<<nt,128&ht)oe[xe++]=0|rt,rt=0,nt=0;else if(nt+=7,nt>28)throw new Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${nt}, partial=${rt}, decoded=${xe-we}/${ae}, inPos=${ye}, inEnd=${Se})`)}if(xe!==Oe)throw new Error(`FastPFOR VByte: truncated stream (decoded=${xe-we}, expected=${ae}, consumedWords=${ye-re}/${te}, vbyteStart=${re}, vbyteEnd=${Se})`)})(D,F,D.length-F|0,V,O,L-O|0),V})(I.subarray(0,M),m,T.decoderWorkspace);return _.add(v),A})(s,l,u,p,(function(g=16){if(g<0)throw new RangeError(`initialEncodedWordCapacity must be >= 0, got ${g}`);const m=Math.max(16,0|g);return{encodedWords:new Uint32Array(m),decoderWorkspace:lf()}})(u>>>2))})(r,i.numValues,i.byteLength,e);case xn.VARINT:return ki(r,e,i.numValues);case xn.NONE:{const s=e.get();e.add(i.byteLength);const l=r.subarray(s,e.get());return new Uint32Array(l)}default:throw new Error(`Specified physicalLevelTechnique ${n} is not supported (yet).`)}}function gd(r,e,i){const n=Ao(r,e,i);return n.length===1?n[0]:(function(s){return s[1]})(n)}function pf(r,e,i){return(function(n){if(n.length===2){const s=gt(n[1]);return[s,s]}return[gt(n[2]),gt(n[3])]})(Ao(r,e,i))}function ff(r,e,i){return(function(n){if(n.length===2){const s=Ui(n[1]);return[s,s]}return[Ui(n[2]),Ui(n[3])]})(Io(r,e,i.numValues))}function mf(r,e,i,n){return(function(s,l,u){let p;switch(l.logicalLevelTechnique1){case Je.DELTA:p=(function(g){const m=new BigUint64Array(g.length);m[0]=BigInt.asUintN(64,Ui(g[0]));for(let v=1;v<g.length;v++)m[v]=BigInt.asUintN(64,m[v-1]+Ui(g[v]));return m})(l.logicalLevelTechnique2===Je.RLE?pd(s,l.runs,l.numRleValues):s);break;case Je.RLE:p=pd(s,l.runs,l.numRleValues);break;case Je.NONE:p=s;break;default:throw new Error(`The specified Logical level technique is not supported: ${l.logicalLevelTechnique1}`)}return u?Co(p,u,0n):p})(Io(r,e,i.numValues),i,n)}function gf(r,e,i){const n=Io(r,e,i.numValues);return n.length===1?n[0]:(function(s){return s[1]})(n)}function ku(r,e,i,n,s="int32"){const l=r.logicalLevelTechnique1;if(l===Je.RLE)return r.runs===1?Pt.CONST:Pt.FLAT;if(l!==Je.DELTA||r.logicalLevelTechnique2!==Je.RLE)return r.numValues===1?Pt.CONST:Pt.FLAT;const u=e instanceof Gr?e.size():e;if(r.numRleValues!==u)return Pt.FLAT;if(r.runs===1)return Pt.SEQUENCE;if(r.runs!==2)return r.numValues===1?Pt.CONST:Pt.FLAT;const p=n.get();if(r.physicalLevelTechnique===xn.VARINT)return(function(v,_,T){const b=new of(_.get());if(T==="int64"){const I=Io(v,b,4);return I[2]===2n&&I[3]===2n}const M=ki(v,b,4);return M[2]===2&&M[3]===2})(i,n,s)?Pt.SEQUENCE:r.numValues===1?Pt.CONST:Pt.FLAT;const g=n.get(),m=new Int32Array(i.buffer,i.byteOffset+g,4);return n.set(p),m[2]===2&&m[3]===2?Pt.SEQUENCE:r.numValues===1?Pt.CONST:Pt.FLAT}class _f extends Ru{getValueFromBuffer(e){return this.dataBuffer[e]}}class yf extends sf{constructor(e,i,n,s){super(e,BigInt64Array.of(i),n,s)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}}function _d(r,e,i){return{x:vf(r,e)-i,y:vf(r>>1,e)-i}}function vf(r,e){let i=0;for(let n=0;n<e;n++)i|=(r&1<<2*n)>>n;return i}function Do(r,e,i,n,s,l,u){return r===bn.MORTON?(function(p,g,m,v,_,T){const b=new Array(_?v+1:v);for(let M=0;M<v;M++){const I=_d(p[g[m+M]],T.numBits,T.coordinateShift);b[M]=new ge(I.x,I.y)}return _&&(b[b.length-1]=b[0]),b})(e,i,n,s,l,u):(function(p,g,m,v,_){const T=new Array(_?v+1:v);for(let b=0;b<2*v;b+=2){const M=2*g[m+b/2];T[b/2]=new ge(p[M],p[M+1])}return _&&(T[T.length-1]=T[0]),T})(e,i,n,s,l)}function zo(r,e,i,n){const s=new Array(n?i+1:i);for(let l=0;l<2*i;l+=2)s[l/2]=new ge(r[e+l],r[e+l+1]);return n&&(s[s.length-1]=s[0]),s}(function(r){r[r.POINT=0]="POINT",r[r.LINESTRING=1]="LINESTRING",r[r.POLYGON=2]="POLYGON",r[r.MULTIPOINT=3]="MULTIPOINT",r[r.MULTILINESTRING=4]="MULTILINESTRING",r[r.MULTIPOLYGON=5]="MULTIPOLYGON"})(si||(si={})),(function(r){r[r.POINT=0]="POINT",r[r.LINESTRING=1]="LINESTRING",r[r.POLYGON=2]="POLYGON"})(df||(df={})),(function(r){r[r.MORTON=0]="MORTON",r[r.VEC_2=1]="VEC_2",r[r.VEC_3=2]="VEC_3"})(bn||(bn={}));class xf{constructor(e,i,n,s,l){this._vertexBufferType=e,this._topologyVector=i,this._vertexOffsets=n,this._vertexBuffer=s,this._mortonSettings=l}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){const i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){const n=_d(this.vertexBuffer[this.vertexOffsets[e]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[n.x,n.y]}const i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getGeometries(){return(function(e){const i=new Array(e.numGeometries);let n=1,s=1,l=1,u=0,p=0,g=0;const m=e.mortonSettings,v=e.topologyVector,_=v.geometryOffsets,T=v.partOffsets,b=v.ringOffsets,M=e.vertexOffsets,I=!M||M.length===0,A=e.containsPolygonGeometry(),D=e.vertexBuffer;for(let L=0;L<e.numGeometries;L++)switch(e.geometryType(L)){case si.POINT:{let R,F;if(I)R=D[p++],F=D[p++];else if(e.vertexBufferType===bn.MORTON){const O=_d(D[M[g++]],m.numBits,m.coordinateShift);R=O.x,F=O.y}else{const O=2*M[g++];R=D[O],F=D[O+1]}i[u++]=[[new ge(R,F)]],_&&l++,T&&n++,b&&s++}break;case si.MULTIPOINT:{const R=_[l]-_[l-1];l++;const F=new Array(R);if(I)for(let O=0;O<R;O++){const V=D[p++],Y=D[p++];F[O]=new ge(V,Y)}else for(let O=0;O<R;O++){const V=2*M[g++];F[O]=new ge(D[V],D[V+1])}i[u++]=F.map((O=>[O])),n+=R,s+=R}break;case si.LINESTRING:{let R,F;A?(R=b[s]-b[s-1],s++):R=T[n]-T[n-1],n++,I?(F=zo(D,p,R,!1),p+=2*R):(F=Do(e.vertexBufferType,D,M,g,R,!1,m),g+=R),i[u++]=[F],_&&l++}break;case si.POLYGON:{const R=T[n]-T[n-1];n++;const F=new Array(R-1);let O,V=b[s]-b[s-1];if(s++,I){O=zo(D,p,V,!0),p+=2*V;for(let Y=0;Y<F.length;Y++)V=b[s]-b[s-1],s++,F[Y]=zo(D,p,V,!0),p+=2*V}else{O=Do(e.vertexBufferType,D,M,g,V,!0,m),g+=V;for(let Y=0;Y<F.length;Y++)V=b[s]-b[s-1],s++,F[Y]=Do(e.vertexBufferType,D,M,g,V,!0,m),g+=V}i[u++]=[O].concat(F),_&&l++}break;case si.MULTILINESTRING:{const R=_[l]-_[l-1];l++;const F=new Array(R);for(let O=0;O<R;O++){let V;if(A?(V=b[s]-b[s-1],s++):V=T[n]-T[n-1],n++,I)F[O]=zo(D,p,V,!1),p+=2*V;else{const Y=Do(e.vertexBufferType,D,M,g,V,!1,m);F[O]=Y,g+=V}}i[u++]=F}break;case si.MULTIPOLYGON:{const R=_[l]-_[l-1];l++;const F=new Array(R);for(let O=0;O<R;O++){const V=T[n]-T[n-1];let Y;n++;const J=new Array(V-1),re=b[s]-b[s-1];s++,I?(Y=zo(D,p,re,!0),p+=2*re):(Y=Do(e.vertexBufferType,D,M,g,re,!0,m),g+=re);for(let te=0;te<J.length;te++){const oe=b[s]-b[s-1];s++,I?(J[te]=zo(D,p,oe,!0),p+=2*oe):(J[te]=Do(e.vertexBufferType,D,M,g,oe,!0,m),g+=oe)}F[O]=[Y].concat(J)}i[u++]=F.flat()}break;default:throw new Error("The specified geometry type is currently not supported.")}return i})(this)}get mortonSettings(){return this._mortonSettings}}class bf extends xf{constructor(e,i,n,s,l,u,p){super(n,s,l,u,p),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===si.POLYGON||this._geometryType===si.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class wf extends xf{constructor(e,i,n,s,l,u){super(e,n,s,l,u),this._geometryTypes=i}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===si.POLYGON||this.geometryType(e)===si.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class Tf{constructor(e,i,n,s){this._triangleOffsets=e,this._indexBuffer=i,this._vertexBuffer=n,this._topologyVector=s}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw new Error("Cannot convert GpuVector to coordinates without topology information");const e=new Array(this.numGeometries),i=this._topologyVector,n=i.partOffsets,s=i.ringOffsets,l=i.geometryOffsets;let u=0,p=1,g=1,m=1;for(let v=0;v<this.numGeometries;v++)switch(this.geometryType(v)){case si.POLYGON:{const _=n[p]-n[p-1];p++;const T=[];for(let b=0;b<_;b++){const M=s[g]-s[g-1];g++;const I=[];for(let A=0;A<M;A++){const D=this._vertexBuffer[u++],L=this._vertexBuffer[u++];I.push(new ge(D,L))}I.length>0&&I.push(I[0]),T.push(I)}e[v]=T,l&&m++}break;case si.MULTIPOLYGON:{const _=l[m]-l[m-1];m++;const T=[];for(let b=0;b<_;b++){const M=n[p]-n[p-1];p++;for(let I=0;I<M;I++){const A=s[g]-s[g-1];g++;const D=[];for(let L=0;L<A;L++){const R=this._vertexBuffer[u++],F=this._vertexBuffer[u++];D.push(new ge(R,F))}D.length>0&&D.push(D[0]),T.push(D)}}e[v]=T}}return e}[Symbol.iterator](){return null}}
2function Sf(r,e,i,n,s,l){return new F_(r,e,i,n,s,l)}class F_ extends Tf{constructor(e,i,n,s,l,u){super(n,s,l,u),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function Pf(r,e,i,n,s){return new B_(r,e,i,n,s)}class B_ extends Tf{constructor(e,i,n,s,l){super(i,n,s,l),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function O_(r,e,i,n,s){const l=Zi(r,i);let u,p,g,m;if(ku(l,n,r,i)===Pt.CONST){const L=gd(r,i,l);let R,F,O,V;for(let Y=0;Y<e-1;Y++){const J=Zi(r,i);switch(J.physicalStreamType){case xi.LENGTH:switch(J.logicalStreamType.lengthType){case lr.GEOMETRIES:R=wn(r,i,J);break;case lr.PARTS:F=wn(r,i,J);break;case lr.RINGS:O=wn(r,i,J);break;case lr.TRIANGLES:V=wn(r,i,J)}break;case xi.OFFSET:switch(J.logicalStreamType.offsetType){case ds.VERTEX:u=cr(r,i,J);break;case ds.INDEX:m=cr(r,i,J)}break;case xi.DATA:Zr.VERTEX===J.logicalStreamType.dictionaryType?p=md(r,i,J):(g={numBits:J.numBits,coordinateShift:J.coordinateShift},p=cr(r,i,J))}}return m?R!==void 0||F!==void 0?Sf(n,L,V,m,p,{geometryOffsets:R,partOffsets:F,ringOffsets:O}):Sf(n,L,V,m,p):g===void 0?(function(Y,J,re,te,oe){return new bf(Y,J,bn.VEC_2,re,te,oe)})(n,L,{geometryOffsets:R,partOffsets:F,ringOffsets:O},u,p):(function(Y,J,re,te,oe,le){return new bf(Y,J,bn.MORTON,re,te,oe,le)})(n,L,{geometryOffsets:R,partOffsets:F,ringOffsets:O},u,p,g)}const v=cr(r,i,l);let _,T,b,M,I,A,D;for(let L=0;L<e-1;L++){const R=Zi(r,i);switch(R.physicalStreamType){case xi.LENGTH:switch(R.logicalStreamType.lengthType){case lr.GEOMETRIES:_=cr(r,i,R);break;case lr.PARTS:T=cr(r,i,R);break;case lr.RINGS:b=cr(r,i,R);break;case lr.TRIANGLES:M=wn(r,i,R)}break;case xi.OFFSET:switch(R.logicalStreamType.offsetType){case ds.VERTEX:u=cr(r,i,R);break;case ds.INDEX:m=cr(r,i,R)}break;case xi.DATA:Zr.VERTEX===R.logicalStreamType.dictionaryType?p=md(r,i,R):(g={numBits:R.numBits,coordinateShift:R.coordinateShift},p=cr(r,i,R))}}return _?(I=yd(v,_,2),T&&b?(A=Mf(v,I,T,!1),D=(function(L,R,F,O){const V=new Uint32Array(F[F.length-1]+1);let Y=0;V[0]=Y;let J=1,re=1,te=0;for(let oe=0;oe<L.length;oe++){const le=L[oe],ae=R[oe+1]-R[oe];if(le!==0&&le!==3)for(let ie=0;ie<ae;ie++){const ye=F[J]-F[J-1];J++;for(let Se=0;Se<ye;Se++)Y=V[re++]=Y+O[te++]}else for(let ie=0;ie<ae;ie++)V[re++]=++Y,J++}return V})(v,I,A,b)):T&&(A=(function(L,R,F){const O=new Uint32Array(R[R.length-1]+1);let V=0;O[0]=V;let Y=1,J=0;for(let re=0;re<L.length;re++){const te=L[re],oe=R[re+1]-R[re];if(te===4||te===1)for(let le=0;le<oe;le++)V=O[Y++]=V+F[J++];else for(let le=0;le<oe;le++)O[Y++]=++V}return O})(v,I,T))):T&&b?(A=yd(v,T,1),D=Mf(v,A,b,!0)):T&&(A=yd(v,T,0)),m&&!A?Pf(v,M,m,p):m?Pf(v,M,m,p,{geometryOffsets:I,partOffsets:A,ringOffsets:D}):g===void 0?(function(L,R,F,O){return new wf(bn.VEC_2,L,R,F,O)})(v,{geometryOffsets:I,partOffsets:A,ringOffsets:D},u,p):(function(L,R,F,O,V){return new wf(bn.MORTON,L,R,F,O,V)})(v,{geometryOffsets:I,partOffsets:A,ringOffsets:D},u,p,g)}function yd(r,e,i){const n=new Uint32Array(r.length+1);let s=0;n[0]=s;let l=0;for(let u=0;u<r.length;u++)s=n[u+1]=s+(r[u]>i?e[l++]:1);return n}function Mf(r,e,i,n){const s=new Uint32Array(e[e.length-1]+1);let l=0;s[0]=l;let u=1,p=0;for(let g=0;g<r.length;g++){const m=r[g],v=e[g+1]-e[g];if(m===5||m===2||n&&(m===4||m===1))for(let _=0;_<v;_++)l=s[u++]=l+i[p++];else for(let _=0;_<v;_++)s[u++]=++l}return s}class N_ extends Mo{constructor(e,i,n){super(e,i.getBuffer(),n),this.dataVector=i}getValueFromBuffer(e){return this.dataVector.get(e)}}class V_ extends Ru{getValueFromBuffer(e){return this.dataBuffer[e]}}class If extends Mo{constructor(e,i,n,s){super(e,s?BigInt64Array.of(i):BigUint64Array.of(i),n)}getValueFromBuffer(e){return this.dataBuffer[0]}}function nc(r,e,i,n,s){const l=(function(u,p,g,m){const v=new Uint8Array(p);let _=0;const T=m.get()+g;for(;_<p&&!(m.get()>=T);){const b=u[m.increment()];if(b<=127){const M=b+3,I=u[m.increment()],A=Math.min(_+M,p);v.fill(I,_,A),_=A}else{const M=256-b;for(let I=0;I<M&&_<p;I++)v[_++]=u[m.increment()]}}return m.set(T),v})(r,Math.ceil(e/8),i,n);return s?(function(u,p,g){if(!g)return u;const m=g.size(),v=new Gr(u,p),_=new Gr(new Uint8Array(Math.ceil(m/8)),m);let T=0;for(let b=0;b<m;b++){const M=!!g.get(b)&&v.get(T++);_.set(b,M)}return _.getBuffer()})(l,e,s):l}const j_=new TextDecoder;function vd(r,e,i){return i-e>=12?j_.decode(r.subarray(e,i)):(function(n,s,l){let u="",p=s;for(;p<l;){const g=n[p];let m,v,_,T=null,b=g>239?4:g>223?3:g>191?2:1;if(p+b>l)break;b===1?g<128&&(T=g):b===2?(m=n[p+1],(192&m)==128&&(T=(31&g)<<6|63&m,T<=127&&(T=null))):b===3?(m=n[p+1],v=n[p+2],(192&m)==128&&(192&v)==128&&(T=(15&g)<<12|(63&m)<<6|63&v,(T<=2047||T>=55296&&T<=57343)&&(T=null))):b===4&&(m=n[p+1],v=n[p+2],_=n[p+3],(192&m)==128&&(192&v)==128&&(192&_)==128&&(T=(15&g)<<18|(63&m)<<12|(63&v)<<6|63&_,(T<=65535||T>=1114112)&&(T=null))),T===null?(T=65533,b=1):T>65535&&(T-=65536,u+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),u+=String.fromCharCode(T),p+=b}return u})(r,e,i)}class xd extends Mo{constructor(e,i,n,s){super(e,n,s),this.offsetBuffer=i}}class Ef extends xd{constructor(e,i,n,s){super(e,i,n,s??i.length-1)}getValueFromBuffer(e){return vd(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class Ro extends xd{constructor(e,i,n,s,l){super(e,n,s,l??i.length),this.indexBuffer=i,this.indexBuffer=i}getValueFromBuffer(e){const i=this.indexBuffer[e];return vd(this.dataBuffer,this.offsetBuffer[i],this.offsetBuffer[i+1])}}class Cf extends xd{constructor(e,i,n,s,l,u,p){super(e,n,s,p),this.indexBuffer=i,this.symbolOffsetBuffer=l,this.symbolTableBuffer=u}getValueFromBuffer(e){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),this.decodedDictionary=(function(n,s,l){const u=[],p=new Array(s.length).fill(0);for(let g=1;g<s.length;g++)p[g]=p[g-1]+s[g-1];for(let g=0;g<l.length;g++)if(l[g]===255)u.push(l[++g]);else{const m=s[l[g]],v=p[l[g]];for(let _=0;_<m;_++)u.push(n[v+_])}return new Uint8Array(u)})(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));const i=this.indexBuffer[e];return vd(this.decodedDictionary,this.offsetBuffer[i],this.offsetBuffer[i+1])}offsetToLengthBuffer(e){const i=new Uint32Array(e.length-1);let n=e[0];for(let s=1;s<e.length;s++){const l=e[s];i[s-1]=l-n,n=l}return i}}function U_(r,e,i,n,s,l){return i.type==="scalarType"?(function(u,p,g,m,v,_){let T=null;if(u===0)return null;if(_.nullable){const M=Zi(p,g),I=M.numValues,A=g.get(),D=nc(p,I,M.byteLength,g);g.set(A+M.byteLength),T=new Gr(D,M.numValues)}const b=T??m;switch(v.physicalType){case 4:case 3:return(function(M,I,A,D,L){const R=Zi(M,I),F=ku(R,L,M,I),O=D.physicalType===3;if(F===Pt.FLAT){const Y=sc(L)?L:void 0,J=O?md(M,I,R,0,Y):cr(M,I,R,0,Y);return new ad(A.name,J,L)}if(F===Pt.SEQUENCE){const Y=pf(M,I,R);return new sd(A.name,Y[0],Y[1],R.numRleValues)}const V=O?(function(Y,J,re){const te=Ao(Y,J,re);return te.length===1?gt(te[0]):(function(oe){return gt(oe[1])})(te)})(M,I,R):gd(M,I,R);return new od(A.name,V,L,O)})(p,g,_,v,b);case 9:return(function(M,I,A,D,L){let R=null,F=null,O=null,V=null,Y=null,J=L??null,re=null,te=null;for(let oe=0;oe<D;oe++){const le=Zi(I,A);switch(le.physicalStreamType){case xi.PRESENT:{const ae=nc(I,le.numValues,le.byteLength,A),ie=new Gr(ae,le.numValues);J=L??ie;break}case xi.OFFSET:F=cr(I,A,le,0,J);break;case xi.LENGTH:{const ae=wn(I,A,le);lr.DICTIONARY===le.logicalStreamType.lengthType?R=ae:lr.SYMBOL===le.logicalStreamType.lengthType?V=ae:re=ae;break}case xi.DATA:{const ae=I.subarray(A.get(),A.get()+le.byteLength);A.add(le.byteLength);const ie=le.logicalStreamType.dictionaryType;Zr.FSST===ie?Y=ae:Zr.SINGLE===ie||Zr.SHARED===ie?O=ae:Zr.NONE===ie&&(te=ae);break}}}return(function(oe,le,ae,ie,ye,Se,we){return le?new Cf(oe,ae,ie,ye,Se,le,we):null})(M,Y,F,R,O,V,J)??(function(oe,le,ae,ie,ye){return le?ye?new Ro(oe,ae,ie,le,ye):new Ro(oe,ae,ie,le):null})(M,O,F,R,J)??(function(oe,le,ae,ie,ye){if(!le||!ae)return null;if(ie)return ye?new Ro(oe,ie,le,ae,ye):new Ro(oe,ie,le,ae);if(ye&&ye.size()!==le.length-1){const Se=new Uint32Array(ye.size());let we=0;for(let xe=0;xe<ye.size();xe++)Se[xe]=ye.get(xe)?we++:0;return new Ro(oe,Se,le,ae,ye)}return ye?new Ef(oe,le,ae,ye):new Ef(oe,le,ae)})(M,re,te,F,J)})(_.name,p,g,_.nullable?u-1:u,T);
2case 0:return(function(M,I,A,D,L){const R=Zi(M,I),F=R.numValues,O=I.get(),V=sc(L)?L:void 0,Y=nc(M,F,R.byteLength,I,V);I.set(O+R.byteLength);const J=new Gr(Y,F);return new N_(A.name,J,L)})(p,g,_,0,b);case 6:case 5:return(function(M,I,A,D,L){const R=Zi(M,I),F=ku(R,D,M,I,"int64"),O=L.physicalType===5;if(F===Pt.FLAT){const Y=sc(D)?D:void 0,J=O?(function(re,te,oe,le){return(function(ae,ie,ye){let Se;switch(ie.logicalLevelTechnique1){case Je.DELTA:if(ie.logicalLevelTechnique2===Je.RLE){const we=ie;if(!ye)return(function(xe,Oe,rt){const nt=new BigInt64Array(rt);let ht=0,wi=0n;for(let Lt=0;Lt<Oe;Lt++){const ti=Number(xe[Lt]),oi=Ui(xe[Lt+Oe]);for(let Mt=0;Mt<ti;Mt++)wi+=oi,nt[ht++]=wi}return nt})(ae,we.runs,we.numRleValues);Se=hf(ae=pd(ae,we.runs,we.numRleValues))}else Se=hf(ae);break;case Je.RLE:Se=(function(we,xe,Oe){if(Oe===void 0){Oe=0;for(let ht=0;ht<xe;ht++)Oe+=Number(we[ht])}const rt=new BigInt64Array(Oe);let nt=0;for(let ht=0;ht<xe;ht++){const wi=Number(we[ht]);let Lt=we[ht+xe];Lt=Ui(Lt),rt.fill(Lt,nt,nt+wi),nt+=wi}return rt})(ae,ie.runs,ie.numRleValues);break;case Je.NONE:Se=(function(we){const xe=new BigInt64Array(we.length);for(let Oe=0;Oe<we.length;Oe++)xe[Oe]=Ui(we[Oe]);return xe})(ae);break;default:throw new Error(`The specified Logical level technique is not supported: ${ie.logicalLevelTechnique1}`)}return ye?Co(Se,ye,0n):Se})(Io(re,te,oe.numValues),oe,le)})(M,I,R,Y):mf(M,I,R,Y);return new _f(A.name,J,D)}if(F===Pt.SEQUENCE){const Y=ff(M,I,R);return new yf(A.name,Y[0],Y[1],R.numRleValues)}const V=O?(function(Y,J,re){const te=Io(Y,J,re.numValues);return te.length===1?Ui(te[0]):(function(oe){return Ui(oe[1])})(te)})(M,I,R):gf(M,I,R);return new If(A.name,V,D,O)})(p,g,_,b,v);case 7:return(function(M,I,A,D){const L=Zi(M,I),R=sc(D)?D:void 0,F=(function(O,V,Y,J){const re=V.get(),te=re+Y*Float32Array.BYTES_PER_ELEMENT,oe=new 
2Uint8Array(O.subarray(re,te)).buffer,le=new Float32Array(oe);return V.set(te),J?Co(le,J,0):le})(M,I,L.numValues,R);return new V_(A.name,F,D)})(p,g,_,b);case 8:return(function(M,I,A,D){const L=Zi(M,I),R=sc(D)?D:void 0,F=(function(O,V,Y,J){const re=V.get(),te=re+Y*Float64Array.BYTES_PER_ELEMENT,oe=new Uint8Array(O.subarray(re,te)).buffer,le=new Float64Array(oe);return V.set(te),J?Co(le,J,0):le})(M,I,L.numValues,R);return new nd(A.name,F,D)})(p,g,_,b);default:throw new Error(`The specified data type for the field is currently not supported: ${v}`)}})(n,r,e,s,i.scalarType,i):n===0?null:(function(u,p,g,m){let v=null,_=null,T=null,b=null,M=!1;for(;!M;){const L=Zi(u,p);switch(L.physicalStreamType){case xi.LENGTH:lr.DICTIONARY===L.logicalStreamType.lengthType?v=wn(u,p,L):T=wn(u,p,L);break;case xi.DATA:Zr.SINGLE===L.logicalStreamType.dictionaryType||Zr.SHARED===L.logicalStreamType.dictionaryType?(_=u.subarray(p.get(),p.get()+L.byteLength),M=!0):b=u.subarray(p.get(),p.get()+L.byteLength),p.add(L.byteLength)}}const I=g.complexType.children,A=[];let D=0;for(const L of I){const R=ki(u,p,1)[0];if(R===0)continue;const F=L.name?`${g.name}${L.name}`:g.name;if(R!==2||L.type!=="scalarField"||L.scalarField.physicalType!==9)throw new Error("Currently only optional string fields are implemented for a struct.");const O=Zi(u,p),V=nc(u,O.numValues,O.byteLength,p),Y=Zi(u,p),J=cr(u,p,Y,0,Y.decompressedCount!==m?new Gr(V,O.numValues):void 0);A[D++]=b?new Cf(F,J,v,_,T,b,new Gr(V,O.numValues)):new Ro(F,J,v,_,new Gr(V,O.numValues))}return A})(r,e,i,s)}function sc(r){return r instanceof Gr}function Af(r){switch(r){case 0:case 1:case 2:case 3:{const e={};e.nullable=!!(1&r),e.columnScope=0;const i={type:"logicalType",logicalType:0};return i.longID=!!(2&r),e.scalarType=i,e.type="scalarType",e}case 4:{const e={nullable:!1,columnScope:0},i={type:"physicalType",physicalType:0};return e.type="complexType",e.complexType=i,e}case 30:{const e={nullable:!1,columnScope:0},i={type:"physicalType",physicalType:1};return e.type="complexType",e.complexType=i,e}default:return(function(e){let i;switch(e){case 10:case 11:i=0;break;case 12:case 13:i=1;break;case 14:case 15:i=2;break;case 16:case 17:i=3;break;case 18:case 19:i=4;break;case 20:case 21:i=5;break;case 22:case 23:i=6;break;case 24:case 25:i=7;break;case 26:case 27:i=8;break;case 28:case 29:i=9;break;default:return null}const n={};n.nullable=!!(1&e),n.columnScope=0;const s={type:"physicalType"};return s.physicalType=i,n.type="scalarType",n.scalarType=s,n})(r)}}function Df(r){return r>=10}function zf(r){return r===30}function Z_(r){if(r.type==="scalarType"){const e=r.scalarType;if(e.type==="physicalType")switch(e.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}if(e.type==="logicalType")return!1}else if(r.type==="complexType"){const e=r.complexType;if(e.type==="physicalType")switch(e.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",r),!1}function G_(r){return r.type==="complexType"&&r.complexType?.type==="physicalType"&&r.complexType.physicalType===0}const $_=new TextDecoder;function bd(r,e){const i=ki(r,e,1)[0];if(i===0)return"";const n=e.get(),s=r.subarray(n,n+i);return e.add(i),$_.decode(s)}function Rf(r,e){const i=ki(r,e,1)[0]>>>0;if(i<10||i>30)throw new Error(`Unsupported field type code ${i}. Supported: 10-29(scalars), 30(STRUCT)`);const n=Af(i);if(Df(i)&&(n.name=bd(r,e)),zf(i)){const s=ki(r,e,1)[0]>>>0;n.complexType.children=new Array(s);for(let l=0;l<s;l++)n.complexType.children[l]=Rf(r,e)}return(function(s){return{name:s.name,nullable:s.nullable,scalarField:s.scalarType,complexField:s.complexType,type:s.type==="scalarType"?"scalarField":"complexField"}})(n)}function q_(r,e){const i=ki(r,e,1)[0]>>>0,n=Af(i);if(!n)throw new Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(Df(i)?n.name=bd(r,e):i>=0&&i<=3?n.name="id":i===4&&(n.name="geometry"),zf(i)){const s=ki(r,e,1)[0]>>>0,l=n.complexType;l.children=new Array(s);for(let u=0;u<s;u++)l.children[u]=Rf(r,e)}return n}function W_(r,e){const i={featureTables:[]},n={};n.name=bd(r,e);const s=ki(r,e,1)[0]>>>0,l=ki(r,e,1)[0]>>>0;n.columns=new Array(l);for(let u=0;u<l;u++)n.columns[u]=q_(r,e);return i.featureTables.push(n),[i,s]}
2function H_(r,e,i,n,s,l,u=!1){const p=e.scalarType;if(!p||p.type!=="logicalType"||p.logicalType!==0)throw new Error(`ID column must be a logical ID scalar type: ${n}`);const g=p.longID?6:4,m=typeof l=="number"?void 0:l,v=ku(s,l,r,i,g===6?"int64":"int32");if(g===4)switch(v){case Pt.FLAT:{const _=cr(r,i,s,0,m);return new ad(n,_,l)}case Pt.SEQUENCE:{const _=pf(r,i,s);return new sd(n,_[0],_[1],s.numRleValues)}case Pt.CONST:{const _=gd(r,i,s);return new od(n,_,l,!1)}}switch(v){case Pt.FLAT:{if(u){const T=(function(b,M,I){const A=(function(D,L,R){const F=new Float64Array(R);for(let O=0;O<R;O++)F[O]=L_(D,L);return F})(b,M,I.numValues);return(function(D,L){switch(L.logicalLevelTechnique1){case Je.DELTA:return L.logicalLevelTechnique2===Je.RLE&&(D=cf(D,L.runs,L.numRleValues)),(function(R){R[0]=Eo(R[0]);const F=R.length/4*4;let O=1;if(F>=4)for(;O<F-4;O+=4){const V=R[O+1],Y=R[O+2],J=R[O+3];R[O]=Eo(R[O])+R[O-1],R[O+1]=Eo(V)+R[O],R[O+2]=Eo(Y)+R[O+1],R[O+3]=Eo(J)+R[O+2]}for(;O!==R.length;++O)R[O]=Eo(R[O])+R[O-1]})(D),D;case Je.RLE:return(function(R,F){return cf(R,F.runs,F.numRleValues)})(D,L);case Je.NONE:return D;default:throw new Error(`The specified Logical level technique is not supported: ${L.logicalLevelTechnique1}`)}})(A,I)})(r,i,s);return new nd(n,T,l)}const _=mf(r,i,s,m);return new _f(n,_,l)}case Pt.SEQUENCE:{const _=ff(r,i,s);return new yf(n,_[0],_[1],s.numRleValues)}case Pt.CONST:{const _=gf(r,i,s);return new If(n,_,l,!1)}}throw new Error("Vector type not supported for id column.")}class X_{constructor(e,i){var n;switch(this._featureData=e,this.properties=this._featureData.properties||{},(n=this._featureData.geometry)===null||n===void 0?void 0:n.type){case si.POINT:case si.MULTIPOINT:this.type=1;break;case si.LINESTRING:case si.MULTILINESTRING:this.type=2;break;case si.POLYGON:case si.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=i,this.id=Number(this._featureData.id)}loadGeometry(){const e=[];for(const i of this._featureData.geometry.coordinates){const n=[];for(const s of i)n.push(new ge(s.x,s.y));e.push(n)}return e}}class Y_{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new X_(this.features[e],this.extent)}}class kf{constructor(e){this.layers={};const i=(function(n,s,l=!0){const u=new of(0),p=[];for(;u.get()<n.length;){const m=ki(n,u,1)[0]>>>0,v=u.get()+m;if(v>n.length)throw new Error(`Block overruns tile: ${v} > ${n.length}`);if(ki(n,u,1)[0]>>>0!=1){u.set(v);continue}const[_,T]=W_(n,u),b=_.featureTables[0];let M=null,I=null;const A=[];let D=0;for(const R of b.columns){const F=R.name;if((g=R).type==="scalarType"&&g.scalarType?.type==="logicalType"&&g.scalarType.logicalType===0){let O=null;if(R.nullable){const Y=Zi(n,u),J=u.get(),re=nc(n,Y.numValues,Y.byteLength,u);u.set(J+Y.byteLength),O=new Gr(re,Y.numValues)}const V=Zi(n,u);D=O?O.size():V.decompressedCount,M=H_(n,R,u,F,V,O??D,l)}else if(G_(R)){const O=ki(n,u,1)[0];if(D===0){const V=u.get();D=Zi(n,u).decompressedCount,u.set(V)}I=O_(n,O,u,D)}else{const O=Z_(R)?ki(n,u,1)[0]:1;if(O===0)continue;const V=U_(n,u,R,O,D);if(V)if(Array.isArray(V))for(const Y of V)A.push(Y);else A.push(V)}}const L=new M_(b.name,I,M,A,T);p.push(L),u.set(v)}var g;return p})(new Uint8Array(e));this.layers=i.reduce(((n,s)=>Object.assign(Object.assign({},n),{[s.name]:new Y_(s)})),{})}}class K_{constructor(e,i){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{}
2,this.extent=i,"id"in e&&(typeof e.id=="string"?this.id=parseInt(e.id,10):typeof e.id!="number"||isNaN(e.id)||(this.id=e.id))}loadGeometry(){const e=[],i=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(const n of i){const s=[];for(const l of n)s.push(new ge(l[0],l[1]));e.push(s)}return e}}const oc="_geojsonTileLayer";function J_(r,e,i=""){e.writeVarintField(15,r.version||1),e.writeStringField(1,r.name||""),e.writeVarintField(5,r.extent||4096);const n={jsonPrefix:i,keys:[],values:[],keycache:{},valuecache:{}};for(let u=0;u<r.length;u++)n.feature=r.feature(u),e.writeMessage(2,Q_,n);const s=n.keys;for(const u of s)e.writeStringField(3,u);const l=n.values;for(const u of l)e.writeMessage(4,iy,u)}function Q_(r,e){if(!r.feature)return;const i=r.feature;i.id!==void 0&&e.writeVarintField(1,i.id),e.writeMessage(2,ey,r),e.writeVarintField(3,i.type),e.writeMessage(4,ty,i)}function ey(r,e){for(const i in r.feature?.properties){let n=r.feature.properties[i],s=r.keycache[i];if(n==null)continue;s===void 0&&(r.keys.push(i),s=r.keys.length-1,r.keycache[i]=s),e.writeVarint(s),typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&(n=r.jsonPrefix+JSON.stringify(n));const l=typeof n+":"+n;let u=r.valuecache[l];u===void 0&&(r.values.push(n),u=r.values.length-1,r.valuecache[l]=u),e.writeVarint(u)}}function wd(r,e){return(e<<3)+(7&r)}function Lf(r){return r<<1^r>>31}function ty(r,e){const i=r.loadGeometry(),n=r.type;let s=0,l=0;for(const u of i){let p=1;n===1&&(p=u.length),e.writeVarint(wd(1,p));const g=n===3?u.length-1:u.length;for(let m=0;m<g;m++){m===1&&n!==1&&e.writeVarint(wd(2,g-1));const v=u[m].x-s,_=u[m].y-l;e.writeVarint(Lf(v)),e.writeVarint(Lf(_)),s+=v,l+=_}r.type===3&&e.writeVarint(wd(7,1))}}function iy(r,e){const i=typeof r;i==="string"?e.writeStringField(1,r):i==="boolean"?e.writeBooleanField(7,r):i==="number"&&(r%1!=0?e.writeDoubleField(3,r):r<0?e.writeSVarintField(6,r):e.writeVarintField(5,r))}class Ff{constructor(e,i){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Br(Le,16,0),this.grid3D=new Br(Le,16,0),this.featureIndexArray=new B,this.promoteId=i}insert(e,i,n,s,l,u){const p=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,s,l);const g=u?this.grid3D:this.grid;for(const m of i){const v=[1/0,1/0,-1/0,-1/0];for(const _ of m)v[0]=Math.min(v[0],_.x),v[1]=Math.min(v[1],_.y),v[2]=Math.max(v[2],_.x),v[3]=Math.max(v[3],_.y);v[0]<Le&&v[1]<Le&&v[2]>=0&&v[3]>=0&&g.insert(p,v[0],v[1],v[2],v[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!=="mlt"?new lp(new Eu(this.rawTileData)).layers:new kf(this.rawTileData).layers,this.sourceLayerCoder=new af(this.vtLayers?Object.keys(this.vtLayers).sort():[oc])),this.vtLayers}query(e,i,n,s){this.loadVTLayers();const l=e.params,u=Le/e.tileSize/e.scale,p=Gn(l.filter,l.globalState),g=e.queryGeometry,m=e.queryPadding*u,v=hs.fromPoints(g),_=this.grid.query(v.minX-m,v.minY-m,v.maxX+m,v.maxY+m),T=hs.fromPoints(e.cameraQueryGeometry).expandBy(m),b=this.grid3D.query(T.minX,T.minY,T.maxX,T.maxY,((A,D,L,R)=>(function(F,O,V,Y,J){for(const te of F)if(O<=te.x&&V<=te.y&&Y>=te.x&&J>=te.y)return!0;const re=[new ge(O,V),new ge(O,J),new ge(Y,J),new ge(Y,V)];if(F.length>2){for(const te of re)if(fo(F,te))return!0}for(let te=0;te<F.length-1;te++)if(Rm(F[te],F[te+1],re))return!0;return!1})(e.cameraQueryGeometry,A-m,D-m,L+m,R+m)));for(const A of b)_.push(A);_.sort(ry);const M={};let I;for(const A of _){if(A===I)continue;I=A;const D=this.featureIndexArray.get(A);let L=null;this.loadMatchingFeature(M,D.bucketIndex,D.sourceLayerIndex,D.featureIndex,p,l.layers,l.availableImages,i,n,s,((R,F,O)=>(L||(L=ca(R)),F.queryIntersectsFeature({queryGeometry:g,feature:R,featureState:O,geometry:L,zoom:this.z,transform:e.transform,pixelsToTileUnits:u,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation}))))}return M}loadMatchingFeature(e,i,n,s,l,u,p,g,m,v,_){const T=this.bucketLayerIDs[i];if(u&&!T.some((A=>u.has(A))))return;const b=this.sourceLayerCoder.decode(n),M=this.vtLayers[b].feature(s);if(l.needGeometry){const A=ua(M,!0);
vendor: 33,966 bytes, line 2
2if(!l.filter(new vt(this.tileID.overscaledZ),A,this.tileID.canonical))return}else if(!l.filter(new vt(this.tileID.overscaledZ),M))return;const I=this.getId(M,b);for(const A of T){if(u&&!u.has(A))continue;const D=g[A];if(!D)continue;let L={};I&&v&&(L=v.getState(D.sourceLayer||oc,I));const R=Ii({},m[A]);R.paint=Bf(R.paint,D.paint,M,L,p),R.layout=Bf(R.layout,D.layout,M,L,p);const F=!_||_(M,D,L);if(!F)continue;const O=new nf(M,this.z,this.x,this.y,I);O.layer=R;let V=e[A];V===void 0&&(V=e[A]=[]),V.push({featureIndex:s,feature:O,intersectionZ:F})}}lookupSymbolFeatures(e,i,n,s,l,u,p,g){const m={};this.loadVTLayers();const v=Gn(l.filterSpec,l.globalState);for(const _ of e)this.loadMatchingFeature(m,n,s,_,v,u,p,g,i);return m}hasLayer(e){for(const i of this.bucketLayerIDs)for(const n of i)if(e===n)return!0;return!1}getId(e,i){var n;let s=e.id;return this.promoteId&&(s=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[i]],typeof s=="boolean"&&(s=Number(s)),s===void 0&&(!((n=e.properties)===null||n===void 0)&&n.cluster)&&this.promoteId&&(s=Number(e.properties.cluster_id))),s}}function Bf(r,e,i,n,s){return Gi(r,((l,u)=>{const p=e instanceof is?e.get(u):null;return p?.evaluate?p.evaluate(i,n,s):p}))}function ry(r,e){return e-r}function Of(r,e,i,n,s){const l=[];for(const u of r){let p;for(let g=0;g<u.length-1;g++){let m=u[g],v=u[g+1];m.x<e&&v.x<e||(m.x<e?m=new ge(e,m.y+(e-m.x)/(v.x-m.x)*(v.y-m.y))._round():v.x<e&&(v=new ge(e,m.y+(e-m.x)/(v.x-m.x)*(v.y-m.y))._round()),m.y<i&&v.y<i||(m.y<i?m=new ge(m.x+(i-m.y)/(v.y-m.y)*(v.x-m.x),i)._round():v.y<i&&(v=new ge(m.x+(i-m.y)/(v.y-m.y)*(v.x-m.x),i)._round()),m.x>=n&&v.x>=n||(m.x>=n?m=new ge(n,m.y+(n-m.x)/(v.x-m.x)*(v.y-m.y))._round():v.x>=n&&(v=new ge(n,m.y+(n-m.x)/(v.x-m.x)*(v.y-m.y))._round()),m.y>=s&&v.y>=s||(m.y>=s?m=new ge(m.x+(s-m.y)/(v.y-m.y)*(v.x-m.x),s)._round():v.y>=s&&(v=new ge(m.x+(s-m.y)/(v.y-m.y)*(v.x-m.x),s)._round()),p&&m.equals(p[p.length-1])||(p=[m],l.push(p)),p.push(v)))))}}return l}function Nf(r,e,i,n,s){switch(e){case 1:return(function(l,u,p,g){const m=[];for(const v of l)for(const _ of v){const T=g===0?_.x:_.y;T>=u&&T<=p&&m.push([_])}return m})(r,i,n,s);case 2:return Vf(r,i,n,s,!1);case 3:return Vf(r,i,n,s,!0)}return[]}function ay(r,e,i,n,s){const l=n===0?ny:sy;let u=[];const p=[];for(let v=0;v<r.length-1;v++){const _=r[v],T=r[v+1],b=n===0?_.x:_.y,M=n===0?T.x:T.y;let I=!1;b<e?M>e&&u.push(l(_,T,e)):b>i?M<i&&u.push(l(_,T,i)):u.push(_),M<e&&b>=e&&(u.push(l(_,T,e)),I=!0),M>i&&b<=i&&(u.push(l(_,T,i)),I=!0),!s&&I&&(p.push(u),u=[])}const g=r.length-1,m=n===0?r[g].x:r[g].y;return m>=e&&m<=i&&u.push(r[g]),s&&u.length>0&&!u[0].equals(u[u.length-1])&&u.push(new ge(u[0].x,u[0].y)),u.length>0&&p.push(u),p}function Vf(r,e,i,n,s){const l=[];for(const u of r){const p=ay(u,e,i,n,s);p.length>0&&l.push(...p)}return l}function ny(r,e,i){return new ge(i,r.y+(i-r.x)/(e.x-r.x)*(e.y-r.y))}function sy(r,e,i){return new ge(r.x+(i-r.y)/(e.y-r.y)*(e.x-r.x),i)}Ee("FeatureIndex",Ff,{omit:["rawTileData","sourceLayerCoder"]});class Tn extends ge{constructor(e,i,n,s){super(e,i),this.angle=n,s!==void 0&&(this.segment=s)}clone(){return new Tn(this.x,this.y,this.angle,this.segment)}}function jf(r,e,i,n,s){if(e.segment===void 0||i===0)return!0;let l=e,u=e.segment+1,p=0;for(;p>-i/2;){if(u--,u<0)return!1;p-=r[u].dist(l),l=r[u]}p+=r[u].dist(r[u+1]),u++;const g=[];let m=0;for(;p<i/2;){const v=r[u],_=r[u+1];if(!_)return!1;let T=r[u-1].angleTo(v)-v.angleTo(_);for(T=Math.abs((T+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:p,angleDelta:T}),m+=T;p-g[0].distance>n;)m-=g.shift().angleDelta;if(m>s)return!1;u++,p+=v.dist(_)}return!0}function Uf(r){let e=0;for(let i=0;i<r.length-1;i++)e+=r[i].dist(r[i+1]);return e}function Zf(r,e,i){return r?.6*e*i:0}function Gf(r,e){return Math.max(r?r.right-r.left:0,e?e.right-e.left:0)}function oy(r,e,i,n,s,l){const u=Zf(i,s,l),p=Gf(i,n)*l;let g=0;const m=Uf(r)/2;for(let v=0;v<r.length-1;v++){const _=r[v],T=r[v+1],b=_.dist(T);if(g+b>m){const M=(m-g)/b,I=Wi.number(_.x,T.x,M),A=Wi.number(_.y,T.y,M),D=new Tn(I,A,T.angleTo(_),v);return D._round(),!u||jf(r,D,p,u,e)?D:void 0}g+=b}}function ly(r,e,i,n,s,l,u,p,g){const m=Zf(n,l,u),v=Gf(n,s),_=v*u,T=r[0].x===0||r[0].x===g||r[0].y===0||r[0].y===g;return e-_<e/4&&(e=_+e/4),$f(r,T?e/2*p%e:(v/2+2*l)*u*p%e,e,m,i,_,T,!1,g)}function $f(r,e,i,n,s,l,u,p,g){const m=l/2,v=Uf(r);let _=0,T=e-i,b=[];for(let M=0;M<r.length-1;M++){const I=r[M],A=r[M+1],D=I.dist(A),L=A.angleTo(I);for(;T+i<_+D;){T+=i;const R=(T-_)/D,F=Wi.number(I.x,A.x,R),O=Wi.number(I.y,A.y,R);if(F>=0&&F<g&&O>=0&&O<g&&T-m>=0&&T+m<=v){const V=new Tn(F,O,L,M);V._round(),n&&!jf(r,V,l,n,s)||b.push(V)}}_+=D}return p||b.length||u||(b=$f(r,_/2,i,n,s,l,u,!0,g)),b}function qf(r,e,i,n){const s=[],l=r.image,u=l.pixelRatio,p=l.paddedRect.w-2,g=l.paddedRect.h-2;let m={x1:r.left,y1:r.top,x2:r.right,y2:r.bottom};const v=l.stretchX||[[0,p]],_=l.stretchY||[[0,g]],T=(ie,ye)=>ie+ye[1]-ye[0],b=v.reduce(T,0),M=_.reduce(T,0),I=p-b,A=g-M;let D=0,L=b,R=0,F=M,O=0,V=I,Y=0,J=A;if(l.content&&n){const ie=l.content,ye=ie[2]-ie[0],Se=ie[3]-ie[1];(l.textFitWidth||l.textFitHeight)&&(m=jp(r)),D=Lu(v,0,ie[0]),R=Lu(_,0,ie[1]),L=Lu(v,ie[0],ie[2]),F=Lu(_,ie[1],ie[3]),O=ie[0]-D,Y=ie[1]-R,V=ye-L,J=Se-F}const re=m.x1,te=m.y1,oe=m.x2-re,le=m.y2-te,ae=(ie,ye,Se,we)=>{const xe=Fu(ie.stretch-D,L,oe,re),Oe=Bu(ie.fixed-O,V,ie.stretch,b),rt=Fu(ye.stretch-R,F,le,te),nt=Bu(ye.fixed-Y,J,ye.stretch,M),ht=Fu(Se.stretch-D,L,oe,re),wi=Bu(Se.fixed-O,V,Se.stretch,b),Lt=Fu(we.stretch-R,F,le,te),ti=Bu(we.fixed-Y,J,we.stretch,M),oi=new ge(xe,rt),Mt=new ge(ht,rt),mi=new ge(ht,Lt),Li=new ge(xe,Lt),Fi=new ge(Oe/u,nt/u),Ji=new ge(wi/u,ti/u),Ti=e*Math.PI/180;if(Ti){const li=Math.sin(Ti),Dt=Math.cos(Ti),Xt=[Dt,-li,li,Dt];oi._matMult(Xt),Mt._matMult(Xt),Li._matMult(Xt),mi._matMult(Xt)}const Qi=ie.stretch+ie.fixed,Ar=ye.stretch+ye.fixed;return{tl:oi,tr:Mt,bl:Li,br:mi,tex:{x:l.paddedRect.x+1+Qi,y:l.paddedRect.y+1+Ar,w:Se.stretch+Se.fixed-Qi,h:we.stretch+we.fixed-Ar},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Fi,pixelOffsetBR:Ji,minFontScaleX:V/u/oe,minFontScaleY:J/u/le,isSDF:i}};if(n&&(l.stretchX||l.stretchY)){const ie=Wf(v,I,b),ye=Wf(_,A,M);for(let Se=0;Se<ie.length-1;Se++){const we=ie[Se],xe=ie[Se+1];for(let Oe=0;Oe<ye.length-1;Oe++)s.push(ae(we,ye[Oe],xe,ye[Oe+1]))}}else s.push(ae({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:p+1},{fixed:0,stretch:g+1}));return s}function Lu(r,e,i){let n=0;for(const s of r)n+=Math.max(e,Math.min(i,s[1]))-Math.max(e,Math.min(i,s[0]));return n}function Wf(r,e,i){const n=[{fixed:-1,stretch:0}];for(const[s,l]of r){const u=n[n.length-1];n.push({fixed:s-u.stretch,stretch:u.stretch}),n.push({fixed:s-u.stretch,stretch:u.stretch+(l-s)})}return n.push({fixed:e+1,stretch:i}),n}function Fu(r,e,i,n){return r/e*i+n}function Bu(r,e,i,n){return r-e*i/n}Ee("Anchor",Tn);class Ou{constructor(e,i,n,s,l,u,p,g,m,v){var _;if(this.boxStartIndex=e.length,m){let T=u.top,b=u.bottom;const M=u.collisionPadding;M&&(T-=M[1],b+=M[3]);let I=b-T;I>0&&(I=Math.max(10,I),this.circleDiameter=I)}else{const T=!((_=u.image)===null||_===void 0)&&_.content&&(u.image.textFitWidth||u.image.textFitHeight)?jp(u):{x1:u.left,y1:u.top,x2:u.right,y2:u.bottom};T.y1=T.y1*p-g[0],T.y2=T.y2*p+g[2],T.x1=T.x1*p-g[3],T.x2=T.x2*p+g[1];const b=u.collisionPadding;if(b&&(T.x1-=b[0]*p,T.y1-=b[1]*p,T.x2+=b[2]*p,T.y2+=b[3]*p),v){const M=new ge(T.x1,T.y1),I=new ge(T.x2,T.y1),A=new ge(T.x1,T.y2),D=new ge(T.x2,T.y2),L=v*Math.PI/180;M._rotate(L),I._rotate(L),A._rotate(L),D._rotate(L),T.x1=Math.min(M.x,I.x,A.x,D.x),T.x2=Math.max(M.x,I.x,A.x,D.x),T.y1=Math.min(M.y,I.y,A.y,D.y),T.y2=Math.max(M.y,I.y,A.y,D.y)}e.emplaceBack(i.x,i.y,T.x1,T.y1,T.x2,T.y2,n,s,l)}this.boxEndIndex=e.length}}class cy{constructor(e=[],i=(n,s)=>n<s?-1:n>s?1:0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:n}=this,s=i[e];for(;e>0;){const l=e-1>>1,u=i[l];if(n(s,u)>=0)break;i[e]=u,e=l}i[e]=s}_down(e){const{data:i,compare:n}=this,s=this.length>>1,l=i[e];for(;e<s;){let u=1+(e<<1);const p=u+1;if(p<this.length&&n(i[p],i[u])<0&&(u=p),n(i[u],l)>=0)break;i[e]=i[u],e=u}i[e]=l}}function uy(r,e=1){const i=hs.fromPoints(r[0]),n=Math.min(i.width(),i.height());let s=n/2;const l=new cy([],hy),{minX:u,minY:p,maxX:g,maxY:m}=i;if(n===0)return new ge(u,p);for(let T=u;T<g;T+=n)for(let b=p;b<m;b+=n)l.push(new ko(T+s,b+s,s,r));const v=(function(T){let b=0,M=0,I=0;const A=T[0];for(let D=0,L=A.length,R=L-1;D<L;R=D++){const F=A[D],O=A[R],V=F.x*O.y-O.x*F.y;M+=(F.x+O.x)*V,I+=(F.y+O.y)*V,b+=3*V}return new ko(M/b,I/b,0,T)})(r);let _=v;for(;l.length;){const T=l.pop();(T.d>_.d||!_.d)&&(_=T),T.max-_.d<=e||(s=T.h/2,l.push(new ko(T.p.x-s,T.p.y-s,s,r)),l.push(new ko(T.p.x+s,T.p.y-s,s,r)),l.push(new ko(T.p.x-s,T.p.y+s,s,r)),l.push(new ko(T.p.x+s,T.p.y+s,s,r)))}return v.d>0&&_.d-v.d<=e?v.p:_.p}function hy(r,e){return e.max-r.max}class ko{constructor(e,i,n,s){this.p=new ge(e,i),this.h=n,this.d=(function(l,u){let p=!1,g=1/0;for(const m of u)for(let v=0,_=m.length,T=_-1;v<_;T=v++){const b=m[v],M=m[T];b.y>l.y!=M.y>l.y&&l.x<(M.x-b.x)*(l.y-b.y)/(M.y-b.y)+b.x&&(p=!p),g=Math.min(g,Bd(l,b,M))}return(p?1:-1)*Math.sqrt(g)})(this.p,s),this.max=this.d+this.h*Math.SQRT2}}var bi;k.aM=void 0,(bi=k.aM||(k.aM={}))[bi.center=1]="center",bi[bi.left=2]="left",bi[bi.right=3]="right",bi[bi.top=4]="top",bi[bi.bottom=5]="bottom",bi[bi["top-left"]=6]="top-left",bi[bi["top-right"]=7]="top-right",bi[bi["bottom-left"]=8]="bottom-left",bi[bi["bottom-right"]=9]="bottom-right";const Td=Number.POSITIVE_INFINITY;function Hf(r,e){return e[1]!==Td?(function(i,n,s){let l=0,u=0;switch(n=Math.abs(n),s=Math.abs(s),i){case"top-right":case"top-left":case"top":u=s-7;break;case"bottom-right":case"bottom-left":case"bottom":u=7-s}switch(i){case"top-right":case"bottom-right":case"right":l=-n;break;case"top-left":case"bottom-left":case"left":l=n}return[l,u]})(r,e[0],e[1]):(function(i,n){let s=0,l=0;n<0&&(n=0);const u=n/Math.SQRT2;switch(i){case"top-right":case"top-left":l=u-7;break;case"bottom-right":case"bottom-left":l=7-u;break;case"bottom":l=7-n;break;case"top":l=n-7}switch(i){case"top-right":case"bottom-right":s=-u;break;case"top-left":case"bottom-left":s=u;break;case"left":s=n;break;case"right":s=-n}return[s,l]})(r,e[0])}function Xf(r,e,i){var n;const s=r.layout,l=(n=s.get("text-variable-anchor-offset"))===null||n===void 0?void 0:n.evaluate(e,{},i);if(l){const p=l.values,g=[];for(let m=0;m<p.length;m+=2){const v=g[m]=p[m],_=p[m+1].map((T=>T*ni));v.startsWith("top")?_[1]-=7:v.startsWith("bottom")&&(_[1]+=7),g[m+1]=_}return new Ci(g)}const u=s.get("text-variable-anchor");if(u){let p;p=r._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[s.get("text-radial-offset").evaluate(e,{},i)*ni,Td]:s.get("text-offset").evaluate(e,{},i).map((m=>m*ni));const g=[];for(const m of u)g.push(m,Hf(m,p));return new Ci(g)}return null}function Sd(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function dy(r,e,i,n,s,l,u,p,g,m,v,_){let T=l.textMaxSize.evaluate(e,{});T===void 0&&(T=u);const b=r.layers[0].layout,M=b.get("icon-offset").evaluate(e,{},v),I=Kf(i.horizontal),A=u/24,D=r.tilePixelRatio*A,L=r.tilePixelRatio*T/24,R=r.tilePixelRatio*p,F=r.tilePixelRatio*b.get("symbol-spacing"),O=b.get("text-padding")*r.tilePixelRatio,V=(function(Se,we,xe,Oe=1){const rt=Se.get("icon-padding").evaluate(we,{},xe),nt=rt?.values;return[nt[0]*Oe,nt[1]*Oe,nt[2]*Oe,nt[3]*Oe]})(b,e,v,r.tilePixelRatio),Y=b.get("text-max-angle")/180*Math.PI,J=b.get("text-rotation-alignment")!=="viewport"&&b.get("symbol-placement")!=="point",re=b.get("icon-rotation-alignment")==="map"&&b.get("symbol-placement")!=="point",te=b.get("symbol-placement"),oe=F/2,le=b.get("icon-text-fit");let ae;n&&le!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(ae=Up(n,i.vertical,le,b.get("icon-text-fit-padding"),M,A)),I&&(n=Up(n,I,le,b.get("icon-text-fit-padding"),M,A)));const ie=v?_.line.getGranularityForZoomLevel(v.z):1,ye=(Se,we)=>{we.x<0||we.x>=Le||we.y<0||we.y>=Le||(function(xe,Oe,rt,nt,ht,wi,Lt,ti,oi,Mt,mi,Li,Fi,Ji,Ti,Qi,Ar,li,Dt,Xt,Ft,ci,Va,$r,lc){const Sn=xe.addToLineVertexArray(Oe,rt);let ps,Lo,Fo,Bo,Jf=0,Qf=0,em=0,tm=0,Pd=-1,Md=-1;const ja={};let im=ai("");if(xe.allowVerticalPlacement&&nt.vertical){const Bi=ti.layout.get("text-rotate").evaluate(Ft,{},$r)+90;Fo=new Ou(oi,Oe,Mt,mi,Li,nt.vertical,Fi,Ji,Ti,Bi),Lt&&(Bo=new Ou(oi,Oe,Mt,mi,Li,Lt,Ar,li,Ti,Bi))}if(ht){const Bi=ti.layout.get("icon-rotate").evaluate(Ft,{}),xr=ti.layout.get("icon-text-fit")!=="none",fs=qf(ht,Bi,Va,xr),Wr=Lt?qf(Lt,Bi,Va,xr):void 0;Lo=new Ou(oi,Oe,Mt,mi,Li,ht,Ar,li,!1,Bi),Jf=4*fs.length;const ms=xe.iconSizeData;let ha=null;ms.kind==="source"?(ha=[Oa*ti.layout.get("icon-size").evaluate(Ft,{})],ha[0]>yn&&Kt(`${xe.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):ms.kind==="composite"&&(ha=[Oa*ci.compositeIconSizes[0].evaluate(Ft,{},$r),Oa*ci.compositeIconSizes[1].evaluate(Ft,{},$r)],(ha[0]>yn||ha[1]>yn)&&Kt(`${xe.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),xe.addSymbols(xe.icon,fs,ha,Xt,Dt,Ft,k.ax.none,Oe,Sn.lineStartIndex,Sn.lineLength,-1,$r),Pd=xe.icon.placedSymbolArray.length-1,Wr&&(Qf=4*Wr.length,xe.addSymbols(xe.icon,Wr,ha,Xt,Dt,Ft,k.ax.vertical,Oe,Sn.lineStartIndex,Sn.lineLength,-1,$r),Md=xe.icon.placedSymbolArray.length-1)}const rm=Object.keys(nt.horizontal);for(const Bi of rm){const xr=nt.horizontal[Bi];if(!ps){im=ai(xr.text);const Wr=ti.layout.get("text-rotate").evaluate(Ft,{},$r);ps=new Ou(oi,Oe,Mt,mi,Li,xr,Fi,Ji,Ti,Wr)}const fs=xr.positionedLines.length===1;if(em+=Yf(xe,Oe,xr,wi,ti,Ti,Ft,Qi,Sn,nt.vertical?k.ax.horizontal:k.ax.horizontalOnly,fs?rm:[Bi],ja,Pd,ci,$r),fs)break}nt.vertical&&(tm+=Yf(xe,Oe,nt.vertical,wi,ti,Ti,Ft,Qi,Sn,k.ax.vertical,["vertical"],ja,Md,ci,$r));const fy=ps?ps.boxStartIndex:xe.collisionBoxArray.length,my=ps?ps.boxEndIndex:xe.collisionBoxArray.length,gy=Fo?Fo.boxStartIndex:xe.collisionBoxArray.length,_y=Fo?Fo.boxEndIndex:xe.collisionBoxArray.length,yy=Lo?Lo.boxStartIndex:xe.collisionBoxArray.length,vy=Lo?Lo.boxEndIndex:xe.collisionBoxArray.length,xy=Bo?Bo.boxStartIndex:xe.collisionBoxArray.length,by=Bo?Bo.boxEndIndex:xe.collisionBoxArray.length;let qr=-1;const Nu=(Bi,xr)=>Bi?.circleDiameter?Math.max(Bi.circleDiameter,xr):xr;qr=Nu(ps,qr),qr=Nu(Fo,qr),qr=Nu(Lo,qr),qr=Nu(Bo,qr);const am=qr>-1?1:0;am&&(qr*=lc/ni),xe.glyphOffsetArray.length>=So.MAX_GLYPHS&&Kt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ft.sortKey!==void 0&&xe.addToSortKeyRanges(xe.symbolInstances.length,Ft.sortKey);const wy=Xf(ti,Ft,$r),[Ty,Sy]=(function(Bi,xr){const fs=Bi.length,Wr=xr?.values;if(Wr?.length>0)for(let ms=0;ms<Wr.length;ms+=2){const ha=Wr[ms+1];Bi.emplaceBack(k.aM[Wr[ms]],ha[0],ha[1])}return[fs,Bi.length]})(xe.textAnchorOffsets,wy);xe.symbolInstances.emplaceBack(Oe.x,Oe.y,ja.right>=0?ja.right:-1,ja.center>=0?ja.center:-1,ja.left>=0?ja.left:-1,ja.vertical||-1,Pd,Md,im,fy,my,gy,_y,yy,vy,xy,by,Mt,em,tm,Jf,Qf,am,0,Fi,qr,Ty,Sy)})(r,we,Se,i,n,s,ae,r.layers[0],r.collisionBoxArray,e.index,e.sourceLayerIndex,r.index,D,[O,O,O,O],J,g,R,V,re,M,e,l,m,v,u)};if(te==="line")for(const Se of Of(e.geometry,0,0,Le,Le)){const we=us(Se,ie),xe=ly(we,F,Y,i.vertical||I,n,24,L,r.overscaling,Le);for(const Oe of xe)I&&py(r,I.text,oe,Oe)||ye(we,Oe)}else if(te==="line-center"){for(const Se of e.geometry)if(Se.length>1){const we=us(Se,ie),xe=oy(we,Y,i.vertical||I,n,24,L);xe&&ye(we,xe)}}else if(e.type==="Polygon")for(const Se of Fs(e.geometry,0)){const we=uy(Se,16);ye(us(Se[0],ie,!0),new Tn(we.x,we.y,0))}else if(e.type==="LineString")for(const Se of e.geometry){const we=us(Se,ie);ye(we,new Tn(we[0].x,we[0].y,0))}else if(e.type==="Point")for(const Se of e.geometry)for(const we of Se)ye([we],new Tn(we.x,we.y,0))}function Yf(r,e,i,n,s,l,u,p,g,m,v,_,T,b,M){const I=(function(L,R,F,O,V,Y,J,re){const te=O.layout.get("text-rotate").evaluate(Y,{})*Math.PI/180,oe=[];for(const le of R.positionedLines)for(const ae of le.positionedGlyphs){if(!ae.rect)continue;const ie=ae.rect||{};let ye=4,Se=!0,we=1,xe=0;const Oe=(V||re)&&ae.vertical,rt=ae.metrics.advance*ae.scale/2;if(re&&R.verticalizable&&(xe=le.lineOffset/2-(ae.imageName?-(ni-ae.metrics.width*ae.scale)/2:(ae.scale-1)*ni)),ae.imageName){const li=J[ae.imageName];Se=li.sdf,we=li.pixelRatio,ye=1/we}const nt=V?[ae.x+rt,ae.y]:[0,0];let ht=V?[0,0]:[ae.x+rt+F[0],ae.y+F[1]-xe],wi=[0,0];Oe&&(wi=ht,ht=[0,0]);const Lt=ae.metrics.isDoubleResolution?2:1,ti=(ae.metrics.left-ye)*ae.scale-rt+ht[0],oi=(-ae.metrics.top-ye)*ae.scale+ht[1],Mt=ti+ie.w/Lt*ae.scale/we,mi=oi+ie.h/Lt*ae.scale/we,Li=new ge(ti,oi),Fi=new ge(Mt,oi),Ji=new ge(ti,mi),Ti=new ge(Mt,mi);if(Oe){const li=new ge(-rt,rt- -17),Dt=-Math.PI/2,Xt=12-rt,Ft=new ge(22-Xt,-(ae.imageName?Xt:0)),ci=new ge(...wi);Li._rotateAround(Dt,li)._add(Ft)._add(ci),Fi._rotateAround(Dt,li)._add(Ft)._add(ci),Ji._rotateAround(Dt,li)._add(Ft)._add(ci),Ti._rotateAround(Dt,li)._add(Ft)._add(ci)}if(te){const li=Math.sin(te),Dt=Math.cos(te),Xt=[Dt,-li,li,Dt];Li._matMult(Xt),Fi._matMult(Xt),Ji._matMult(Xt),Ti._matMult(Xt)}const Qi=new ge(0,0),Ar=new ge(0,0);oe.push({tl:Li,tr:Fi,bl:Ji,br:Ti,tex:ie,writingMode:R.writingMode,glyphOffset:nt,sectionIndex:ae.sectionIndex,isSDF:Se,pixelOffsetTL:Qi,pixelOffsetBR:Ar,minFontScaleX:0,minFontScaleY:0})}return oe})(0,i,p,s,l,u,n,r.allowVerticalPlacement),A=r.textSizeData;let D=null;A.kind==="source"?(D=[Oa*s.layout.get("text-size").evaluate(u,{})],D[0]>yn&&Kt(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):A.kind==="composite"&&(D=[Oa*b.compositeTextSizes[0].evaluate(u,{},M),Oa*b.compositeTextSizes[1].evaluate(u,{},M)],(D[0]>yn||D[1]>yn)&&Kt(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),r.addSymbols(r.text,I,D,p,l,u,m,e,g.lineStartIndex,g.lineLength,T,M);for(const L of v)_[L]=r.text.placedSymbolArray.length-1;return 4*I.length}function Kf(r){for(const e in r)return r[e];return null}function py(r,e,i,n){const s=r.compareText;if(e in s){const l=s[e];for(let u=l.length-1;u>=0;u--)if(n.dist(l[u])<i)return!0}else s[e]=[];return s[e].push(n),!1}k.$=uc,k.A=zt,k.B=eo,k.C=iu,k.D=De,k.E=xs,k.F=Mr,k.G=function([r,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,{x:r*Math.cos(e)*Math.sin(i),y:r*Math.sin(e)*Math.sin(i),z:r*Math.cos(i)}},k.H=Wi,k.I=Xh,k.J=vt,k.K=Jn,k.L=function(r){if(et==null){const e=r.navigator?r.navigator.userAgent:null;et=!!r.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return et},k.M=ir,k.N=class{constructor(r,e){this.target=r,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new S_((()=>this.process())),this.subscription=_s(this.target,"message",(i=>this.receive(i)),!1),this.globalScope=Jt(self)?r:window}registerMessageHandler(r,e){this.messageHandlers[r]=e}unregisterMessageHandler(r){delete this.messageHandlers[r]}sendAsync(r,e){return new Promise(((i,n)=>{const s=Math.round(1e18*Math.random()).toString(36).substring(0,10),l=e?_s(e.signal,"abort",(()=>{l?.unsubscribe(),delete this.resolveRejects[s];const g={id:s,type:"<cancel>",origin:location.origin,targetMapId:r.targetMapId,sourceMapId:this.mapId};this.target.postMessage(g)}),P_):null;this.resolveRejects[s]={resolve:g=>{l?.unsubscribe(),i(g)},reject:g=>{l?.unsubscribe(),n(g)}};const u=[],p=Object.assign(Object.assign({},r),{id:s,sourceMapId:this.mapId,origin:location.origin,data:Or(r.data,u)});this.target.postMessage(p,{transfer:u})}))}receive(r){const e=r.data,i=e.id,n=["file://","resource://android","null"],s=[e.origin,location.origin],l=e.origin===location.origin,u=s.some((p=>n.includes(p)));if((l||u)&&(!e.targetMapId||this.mapId===e.targetMapId)){if(e.type==="<cancel>"){delete this.tasks[i];const p=this.abortControllers[i];return delete this.abortControllers[i],void(p&&p.abort())}if(Jt(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(this.taskQueue.length===0)return;const r=this.taskQueue.shift(),e=this.tasks[r];delete this.tasks[r],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(r,e)}processTask(r,e){return h(this,void 0,void 0,(function*(){if(e.type==="<response>"){const s=this.resolveRejects[r];return delete this.resolveRejects[r],s?void(e.error?s.reject(lt(es(e.error))):s.resolve(es(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(r,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const i=es(e.data),n=new AbortController;this.abortControllers[r]=n;try{const s=yield this.messageHandlers[e.type](e.sourceMapId,i,n);this.completeTask(r,null,s)}catch(s){this.completeTask(r,lt(s))}}))}completeTask(r,e,i){const n=[];delete this.abortControllers[r];const s={id:r,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?Or(e):null,data:Or(i,n)};this.target.postMessage(s,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},k.O=function(){var r=new zt(16);return zt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},k.P=ge,k.Q=function(r,e,i){var n,s,l,u,p,g,m,v,_,T,b,M,I=i[0],A=i[1],D=i[2];return e===r?(r[12]=e[0]*I+e[4]*A+e[8]*D+e[12],r[13]=e[1]*I+e[5]*A+e[9]*D+e[13],r[14]=e[2]*I+e[6]*A+e[10]*D+e[14],r[15]=e[3]*I+e[7]*A+e[11]*D+e[15]):(s=e[1],l=e[2],u=e[3],p=e[4],g=e[5],m=e[6],v=e[7],_=e[8],T=e[9],b=e[10],M=e[11],r[0]=n=e[0],r[1]=s,r[2]=l,r[3]=u,r[4]=p,r[5]=g,r[6]=m,r[7]=v,r[8]=_,r[9]=T,r[10]=b,r[11]=M,r[12]=n*I+p*A+_*D+e[12],r[13]=s*I+g*A+T*D+e[13],r[14]=l*I+m*A+b*D+e[14],r[15]=u*I+v*A+M*D+e[15]),r},k.R=Ki,k.S=function(r,e,i){var n=i[0],s=i[1],l=i[2];return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*s,r[5]=e[5]*s,r[6]=e[6]*s,r[7]=e[7]*s,r[8]=e[8]*l,r[9]=e[9]*l,r[10]=e[10]*l,r[11]=e[11]*l,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},k.T=Ph,k.U=function(r,e,i){var n=e[0],s=e[1],l=e[2],u=e[3],p=e[4],g=e[5],m=e[6],v=e[7],_=e[8],T=e[9],b=e[10],M=e[11],I=e[12],A=e[13],D=e[14],L=e[15],R=i[0],F=i[1],O=i[2],V=i[3];return r[0]=R*n+F*p+O*_+V*I,r[1]=R*s+F*g+O*T+V*A,r[2]=R*l+F*m+O*b+V*D,r[3]=R*u+F*v+O*M+V*L,r[4]=(R=i[4])*n+(F=i[5])*p+(O=i[6])*_+(V=i[7])*I,r[5]=R*s+F*g+O*T+V*A,r[6]=R*l+F*m+O*b+V*D,r[7]=R*u+F*v+O*M+V*L,r[8]=(R=i[8])*n+(F=i[9])*p+(O=i[10])*_+(V=i[11])*I,r[9]=R*s+F*g+O*T+V*A,r[10]=R*l+F*m+O*b+V*D,r[11]=R*u+F*v+O*M+V*L,r[12]=(R=i[12])*n+(F=i[13])*p+(O=i[14])*_+(V=i[15])*I,r[13]=R*s+F*g+O*T+V*A,r[14]=R*l+F*m+O*b+V*D,r[15]=R*u+F*v+O*M+V*L,r},k.V=function(r,e){const i={};for(const n of e)n in r&&(i[n]=r[n]);return i},k.W=vn,k.X=wr,k.Y=Kp,k.Z=Yp,k._=h,k.a=Pn,k.a$=function(r){var e=new zt(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e},k.a0=ii,k.a1=Ut,k.a2=dr,k.a3=or,k.a4=Qp,k.a5=zu,k.a6=Le,k.a7=ac,k.a8=hs,k.a9=25,k.aA=function(r){var e=r[0],i=r[1];return Math.sqrt(e*e+i*i)},k.aB=function(r){return r[0]=0,r[1]=0,r},k.aC=function(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r},k.aD=Jh,k.aE=Be,k.aF=function(r,e,i,n){const s=e.y-r.y,l=e.x-r.x,u=n.y-i.y,p=n.x-i.x,g=u*l-p*s;if(g===0)return null;const m=(p*(r.y-i.y)-u*(r.x-i.x))/g;return new ge(r.x+m*l,r.y+m*s)},k.aG=Of,k.aH=po,k.aI=function(r){let e=1/0,i=1/0,n=-1/0,s=-1/0;for(const l of r)e=Math.min(e,l.x),i=Math.min(i,l.y),n=Math.max(n,l.x),s=Math.max(s,l.y);return[e,i,n,s]},k.aJ=ni,k.aK=bt,k.aL=function(r,e,i,n,s=!1){if(!i[0]&&!i[1])return[0,0];const l=s?n==="map"?-r.bearingInRadians:0:n==="viewport"?r.bearingInRadians:0;if(l){const u=Math.sin(l),p=Math.cos(l);i=[i[0]*p-i[1]*u,i[0]*u+i[1]*p]}return[s?i[0]:bt(e,i[0],r.zoom),s?i[1]:bt(e,i[1],r.zoom)]},k.aN=Kh,k.aO=Sd,k.aP=Yh,k.aQ=r=>r.type==="symbol",k.aR=wu,k.aS=wt,k.aT=bu,k.aU=N,k.aV=Me,k.aW=pe,k.aX=da,k.aY=ef,k.aZ=K,k.a_=W,k.aa=rd,k.ab=r=>{const e=window.document.createElement("video");return e.muted=!0,new Promise((i=>{e.onloadstart=()=>{i(e)};for(const n of r){const s=window.document.createElement("source");pr(n)||(e.crossOrigin="Anonymous"),s.src=n,e.appendChild(s)}}))},k.ac=be,k.ad=function(){return Hr++},k.ae=c,k.af=So,k.ag=oc,k.ah=Gn,k.ai=ua,k.aj=nf,k.ak=function(r){const e={};if(r.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((i,n,s,l)=>{const u=s||l;return e[n]=!u||u.toLowerCase(),""})),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e},k.al=Yt,k.am=85.051129,k.an=Xr,k.ao=function(r){return Math.pow(2,r)},k.ap=zr,k.aq=Jp,k.ar=function(r){return Math.log(r)/Math.LN2},k.as=function(r){var e=r[0],i=r[1];return e*e+i*i},k.at=function(r){if(!r.length)return new Set;const e=Math.max(...r.map((g=>g.canonical.z)));let i=1/0,n=-1/0,s=1/0,l=-1/0;const u=[];for(const g of r){const{x:m,y:v,z:_}=g.canonical,T=Math.pow(2,e-_),b=m*T,M=v*T;u.push({id:g,x:b,y:M}),b<i&&(i=b),b>n&&(n=b),M<s&&(s=M),M>l&&(l=M)}const p=new Set;for(const g of u)g.x!==i&&g.x!==n&&g.y!==s&&g.y!==l||p.add(g.id);return p},k.au=function(r,e){const i=Math.abs(2*r.wrap)-+(r.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return r.overscaledZ-e.overscaledZ||n-i||e.canonical.y-r.canonical.y||e.canonical.x-r.canonical.x},k.av=class{constructor(r,e){this.max=r,this.onRemove=e,this.reset()}reset(){for(const r in this.data)for(const e of this.data[r])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(r,e,i){const n=r.wrapped().key;this.data[n]===void 0&&(this.data[n]=[]);const s={value:e,timeout:void 0};if(i!==void 0&&(s.timeout=setTimeout((()=>{this.remove(r,s)}),i)),this.data[n].push(s),this.order.push(n),this.order.length>this.max){const l=this._getAndRemoveByKey(this.order[0]);l&&this.onRemove(l)}return this}has(r){return r.wrapped().key in this.data}getAndRemove(r){return this.has(r)?this._getAndRemoveByKey(r.wrapped().key):null}_getAndRemoveByKey(r){const e=this.data[r].shift();return e.timeout&&clearTimeout(e.timeout),this.data[r].length===0&&delete this.data[r],this.order.splice(this.order.indexOf(r),1),e.value}getByKey(r){const e=this.data[r];return e?e[0].value:null}get(r){return this.has(r)?this.data[r.wrapped().key][0].value:null}remove(r,e){if(!this.has(r))return this;const i=r.wrapped().key,n=e===void 0?0:this.data[i].indexOf(e),s=this.data[i][n];return this.data[i].splice(n,1),s.timeout&&clearTimeout(s.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(s.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(r){for(this.max=r;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(r){const e=[];for(const i in this.data)for(const n of this.data[i])r(n.value)||e.push(n);for(const i of e)this.remove(i.value.tileID,i)}},k.aw=function(r,e){let i=0,n=0;if(r.kind==="constant")n=r.layoutSize;else if(r.kind!=="source"){const{interpolationType:s,minZoom:l,maxZoom:u}=r,p=s?Yt(Gt.interpolationFactor(s,e,l,u),0,1):0;r.kind==="camera"?n=Wi.number(r.minSize,r.maxSize,p):i=p}return{uSizeT:i,uSize:n}},k.ay=function(r,{uSize:e,uSizeT:i},{lowerSize:n,upperSize:s}){return r.kind==="source"?n/Oa:r.kind==="composite"?Wi.number(n/Oa,s/Oa,i):e},k.az=Ve,k.b=Ot,k.b$=co,k.b0=function(r,e,i){return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],r},k.b1=function(r,e){var i=e[0],n=e[1],s=e[2],l=i*i+n*n+s*s;return l>0&&(l=1/Math.sqrt(l)),r[0]=e[0]*l,r[1]=e[1]*l,r[2]=e[2]*l,r},k.b2=ee,k.b3=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]},k.b4=function(r,e,i){return r[0]=e[0]*i[0],r[1]=e[1]*i[1],r[2]=e[2]*i[2],r[3]=e[3]*i[3],r},k.b5=ur,k.b6=function(r,e,i){const n=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return n===0?null:(-(r[0]*i[0]+r[1]*i[1]+r[2]*i[2])-i[3])/n},k.b7=_e,k.b8=function(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r[3]=e[3]*i,r},k.b9=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]},k.bA=Ce,k.bB=function(r,e,i){var n=i[0],s=i[1],l=i[2],u=i[3],p=e[0],g=e[1],m=e[2],v=s*m-l*g,_=l*p-n*m,T=n*g-s*p;return r[0]=p+u*(v+=v)+s*(T+=T)-l*(_+=_),r[1]=g+u*_+l*v-n*T,r[2]=m+u*T+n*_-s*v,r},k.bC=function(r,e,i){const n=(s=[r[0],r[1],r[2],e[0],e[1],e[2],i[0],i[1],i[2]])[0]*((v=s[8])*(u=s[4])-(p=s[5])*(m=s[7]))+s[1]*(-v*(l=s[3])+p*(g=s[6]))+s[2]*(m*l-u*g);var s,l,u,p,g,m,v;if(n===0)return null;const _=ee([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),T=ee([],[i[0],i[1],i[2]],[r[0],r[1],r[2]]),b=ee([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),M=K([],_,-r[3]);return W(M,M,K([],T,-e[3])),W(M,M,K([],b,-i[3])),K(M,M,1/n),M},k.bD=id,k.bE=function(){return new Float64Array(4)},k.bF=function(r,e,i,n){var s=[],l=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],l[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),l[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),l[2]=s[2],r[0]=l[0]+i[0],r[1]=l[1]+i[1],r[2]=l[2]+i[2],r},k.bG=function(r,e,i,n){var s=[],l=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],l[0]=s[0],l[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),l[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),r[0]=l[0]+i[0],r[1]=l[1]+i[1],r[2]=l[2]+i[2],r},k.bH=function(r,e,i,n){var s=[],l=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],l[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),l[1]=s[1],l[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),r[0]=l[0]+i[0],r[1]=l[1]+i[1],r[2]=l[2]+i[2],r},k.bI=function(r,e,i){var n=Math.sin(i),s=Math.cos(i),l=e[0],u=e[1],p=e[2],g=e[3],m=e[8],v=e[9],_=e[10],T=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=l*s-m*n,r[1]=u*s-v*n,r[2]=p*s-_*n,r[3]=g*s-T*n,r[8]=l*n+m*s,r[9]=u*n+v*s,r[10]=p*n+_*s,r[11]=g*n+T*s,r},k.bJ=function(r,e){const i=Pi(r,360),n=Pi(e,360),s=n-i,l=n>i?s-360:s+360;return Math.abs(s)<Math.abs(l)?s:l},k.bK=function(r){return r[0]=0,r[1]=0,r[2]=0,r},k.bL=function(r,e,i,n){const s=Math.sqrt(r*r+e*e),l=Math.sqrt(i*i+n*n);r/=s,e/=s,i/=l,n/=l;const u=Math.acos(r*i+e*n);return-e*i+r*n>0?u:-u},k.bM=function(r,e){const i=Pi(r,2*Math.PI),n=Pi(e,2*Math.PI);return Math.min(Math.abs(i-n),Math.abs(i-n+2*Math.PI),Math.abs(i-n-2*Math.PI))},k.bN=function(){const r={},e=ce.$version;for(const i in ce.$root){const n=ce.$root[i];if(n.required){let s=null;s=i==="version"?e:n.type==="array"?[]:{},s!=null&&(r[i]=s)}}return r},k.bO=Uo,k.bP=Ml,k.bQ=function r(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],i[n]))return!1;return!0}if(typeof e=="object"&&e!==null&&i!==null){if(typeof i!="object"||Object.keys(e).length!==Object.keys(i).length)return!1;for(const n in e)if(!r(e[n],i[n]))return!1;return!0}return e===i},k.bR=vs,k.bS=function(r){r=r.slice();const e=Object.create(null);for(let i=0;i<r.length;i++)e[r[i].id]=r[i];for(let i=0;i<r.length;i++)"ref"in r[i]&&(r[i]=Go(r[i],e[r[i].ref]));return r},k.bT=function(r,e){if(r.type==="custom")return new T_(r,e);switch(r.type){case"background":return new w_(r,e);case"circle":return new Vm(r,e);case"color-relief":return new qm(r,e);case"fill":return new og(r,e);case"fill-extrusion":return new vg(r,e);case"heatmap":return new Um(r,e);case"hillshade":return new Gm(r,e);case"line":return new $g(r,e);case"raster":return new _h(r,e);case"symbol":return new Du(r,e)}},k.bU=r=>r.type==="raster",k.bV=Fe,k.bW=function(r,e){if(!r)return[{command:"setStyle",args:[e]}];let i=[];try{if(!ct(r.version,e.version))return[{command:"setStyle",args:[e]}];ct(r.center,e.center)||i.push({command:"setCenter",args:[e.center]}),ct(r.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),ct(r.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),ct(r.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),ct(r.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),ct(r.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),ct(r.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),ct(r.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),ct(r.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),ct(r.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),ct(r.light,e.light)||i.push({command:"setLight",args:[e.light]}),ct(r.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),ct(r.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),ct(r.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});const n={},s=[];(function(u,p,g,m){let v;for(v in p=p||{},u=u||{})Object.prototype.hasOwnProperty.call(u,v)&&(Object.prototype.hasOwnProperty.call(p,v)||hc(v,g,m));for(v in p)Object.prototype.hasOwnProperty.call(p,v)&&(Object.prototype.hasOwnProperty.call(u,v)?ct(u[v],p[v])||(u[v].type==="geojson"&&p[v].type==="geojson"&&$u(u,p,v)?Oi(g,{command:"setGeoJSONSourceData",args:[v,p[v].data]}):dc(v,p,g,m)):ma(v,p,g))})(r.sources,e.sources,s,n);const l=[];r.layers&&r.layers.forEach((u=>{"source"in u&&n[u.source]?i.push({command:"removeLayer",args:[u.id]}):l.push(u)})),i=i.concat(s),(function(u,p,g){p=p||[];const m=(u=u||[]).map($o),v=p.map($o),_=u.reduce(pc,{}),T=p.reduce(pc,{}),b=m.slice(),M=Object.create(null);let I,A,D,L,R;for(let F=0,O=0;F<m.length;F++)I=m[F],Object.prototype.hasOwnProperty.call(T,I)?O++:(Oi(g,{command:"removeLayer",args:[I]}),b.splice(b.indexOf(I,O),1));for(let F=0,O=0;F<v.length;F++)I=v[v.length-1-F],b[b.length-1-F]!==I&&(Object.prototype.hasOwnProperty.call(_,I)?(Oi(g,{command:"removeLayer",args:[I]}),b.splice(b.lastIndexOf(I,b.length-O),1)):O++,L=b[b.length-F],Oi(g,{command:"addLayer",args:[T[I],L]}),b.splice(b.length-F,0,I),M[I]=!0);for(let F=0;F<v.length;F++)if(I=v[F],A=_[I],D=T[I],!M[I]&&!ct(A,D))if(ct(A.source,D.source)&&ct(A["source-layer"],D["s
2ource-layer"])&&ct(A.type,D.type)){for(R in bs(A.layout,D.layout,g,I,null,"setLayoutProperty"),bs(A.paint,D.paint,g,I,null,"setPaintProperty"),ct(A.filter,D.filter)||Oi(g,{command:"setFilter",args:[I,D.filter]}),ct(A.minzoom,D.minzoom)&&ct(A.maxzoom,D.maxzoom)||Oi(g,{command:"setLayerZoomRange",args:[I,D.minzoom,D.maxzoom]}),A)Object.prototype.hasOwnProperty.call(A,R)&&R!=="layout"&&R!=="paint"&&R!=="filter"&&R!=="metadata"&&R!=="minzoom"&&R!=="maxzoom"&&(R.indexOf("paint.")===0?bs(A[R],D[R],g,I,R.slice(6),"setPaintProperty"):ct(A[R],D[R])||Oi(g,{command:"setLayerProperty",args:[I,R,D[R]]}));for(R in D)Object.prototype.hasOwnProperty.call(D,R)&&!Object.prototype.hasOwnProperty.call(A,R)&&R!=="layout"&&R!=="paint"&&R!=="filter"&&R!=="metadata"&&R!=="minzoom"&&R!=="maxzoom"&&(R.indexOf("paint.")===0?bs(A[R],D[R],g,I,R.slice(6),"setPaintProperty"):ct(A[R],D[R])||Oi(g,{command:"setLayerProperty",args:[I,R,D[R]]}))}else Oi(g,{command:"removeLayer",args:[I]}),L=b[b.lastIndexOf(I)+1],Oi(g,{command:"addLayer",args:[D,L]})})(l,e.layers,i)}catch(n){console.warn("Unable to compute style diff:",n),i=[{command:"setStyle",args:[e]}]}return i},k.bX=function(r){const e=[],i=r.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),r.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},k.bY=Gi,k.bZ=Tr,k.b_=class extends vi{constructor(r,e){super(r,e),this.current=0}set(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}},k.ba=rf,k.bb=Po,k.bc=function(r,e,i,n,s){var l=1/Math.tan(e/2);if(r[0]=l/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,s!=null&&s!==1/0){var u=1/(n-s);r[10]=(s+n)*u,r[14]=2*s*n*u}else r[10]=-1,r[14]=-2*n;return r},k.bd=function(r){var e=new zt(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e},k.be=function(r,e,i){var n=Math.sin(i),s=Math.cos(i),l=e[0],u=e[1],p=e[2],g=e[3],m=e[4],v=e[5],_=e[6],T=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=l*s+m*n,r[1]=u*s+v*n,r[2]=p*s+_*n,r[3]=g*s+T*n,r[4]=m*s-l*n,r[5]=v*s-u*n,r[6]=_*s-p*n,r[7]=T*s-g*n,r},k.bf=function(r,e,i){var n=Math.sin(i),s=Math.cos(i),l=e[4],u=e[5],p=e[6],g=e[7],m=e[8],v=e[9],_=e[10],T=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=l*s+m*n,r[5]=u*s+v*n,r[6]=p*s+_*n,r[7]=g*s+T*n,r[8]=m*s-l*n,r[9]=v*s-u*n,r[10]=_*s-p*n,r[11]=T*s-g*n,r},k.bg=function(r,e){var i=e[0],n=e[1],s=e[2],l=e[3],u=e[4],p=e[5],g=e[6],m=e[7],v=e[8],_=e[9],T=e[10],b=e[11],M=e[12],I=e[13],A=e[14],D=e[15],L=i*p-n*u,R=i*g-s*u,F=i*m-l*u,O=n*g-s*p,V=n*m-l*p,Y=s*m-l*g,J=v*I-_*M,re=v*A-T*M,te=v*D-b*M,oe=_*A-T*I,le=_*D-b*I,ae=T*D-b*A,ie=L*ae-R*le+F*oe+O*te-V*re+Y*J;return ie?(r[0]=(p*ae-g*le+m*oe)*(ie=1/ie),r[1]=(s*le-n*ae-l*oe)*ie,r[2]=(I*Y-A*V+D*O)*ie,r[3]=(T*V-_*Y-b*O)*ie,r[4]=(g*te-u*ae-m*re)*ie,r[5]=(i*ae-s*te+l*re)*ie,r[6]=(A*F-M*Y-D*R)*ie,r[7]=(v*Y-T*F+b*R)*ie,r[8]=(u*le-p*te+m*J)*ie,r[9]=(n*te-i*le-l*J)*ie,r[10]=(M*V-I*F+D*L)*ie,r[11]=(_*F-v*V-b*L)*ie,r[12]=(p*re-u*oe-g*J)*ie,r[13]=(i*oe-n*re+s*J)*ie,r[14]=(I*R-M*O-A*L)*ie,r[15]=(v*O-_*R+T*L)*ie,r):null},k.bh=function(){const r=new Float32Array(16);return zr(r),r},k.bi=function(){const r=new Float64Array(16);return zr(r),r},k.bj=function(){return new Float64Array(16)},k.bk=function(r,e,i){const n=new Float64Array(4);return Ce(n,r,e-90,i),n},k.bl=function(r,e,i,n){var s,l,u,p,g,m=e[0],v=e[1],_=e[2],T=e[3],b=i[0],M=i[1],I=i[2],A=i[3];return(l=m*b+v*M+_*I+T*A)<0&&(l=-l,b=-b,M=-M,I=-I,A=-A),1-l>de?(s=Math.acos(l),u=Math.sin(s),p=Math.sin((1-n)*s)/u,g=Math.sin(n*s)/u):(p=1-n,g=n),r[0]=p*m+g*b,r[1]=p*v+g*M,r[2]=p*_+g*I,r[3]=p*T+g*A,r},k.bm=function(r){const e=new Float64Array(9);var i,n,s,l,u,p,g,m,v,_,T,b,M,I,A,D,L,R;_=(s=(n=r)[0])*(g=s+s),T=(l=n[1])*g,M=(u=n[2])*g,I=u*(m=l+l),D=(p=n[3])*g,L=p*m,R=p*(v
vendor: 4,871 bytes, line 2
2=u+u),(i=e)[0]=1-(b=l*m)-(A=u*v),i[3]=T-R,i[6]=M+L,i[1]=T+R,i[4]=1-_-A,i[7]=I-D,i[2]=M-L,i[5]=I+D,i[8]=1-_-b;const F=da(-Math.asin(Yt(e[2],-1,1)));let O,V;return Math.hypot(e[5],e[8])<.001?(O=0,V=-da(Math.atan2(e[3],e[4]))):(O=da(e[5]===0&&e[8]===0?0:Math.atan2(e[5],e[8])),V=da(e[1]===0&&e[0]===0?0:Math.atan2(e[1],e[0]))),{roll:O,pitch:F+90,bearing:V}},k.bn=function(r,e){return r.roll==e.roll&&r.pitch==e.pitch&&r.bearing==e.bearing},k.bo=He,k.bp=jr,k.bq=yo,k.br=Yl,k.bs=_o,k.bt=Mi,k.bu=er,k.bv=Ai,k.bw=function(r,e,i,n,s){return Mi(n,s,Yt((r-e)/(i-e),0,1))},k.bx=function(r,e,i,n){return r[0]=e[0]+i[0]*n,r[1]=e[1]+i[1]*n,r[2]=e[2]+i[2]*n,r},k.by=Pi,k.bz=function(){return new Float64Array(3)},k.c=Yr,k.c$=Zn,k.c0=class extends vi{constructor(r,e){super(r,e),this.current=Er}set(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}},k.c1=oa,k.c2=class extends vi{constructor(r,e){super(r,e),this.current=[0,0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))}},k.c3=class extends vi{constructor(r,e){super(r,e),this.current=[0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))}},k.c4=Dr,k.c5=function(r,e){var i=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=i,r[2]=0,r[3]=-i,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r},k.c6=function(r,e,i){var n=e[0],s=e[1],l=e[2];return r[0]=n*i[0]+s*i[3]+l*i[6],r[1]=n*i[1]+s*i[4]+l*i[7],r[2]=n*i[2]+s*i[5]+l*i[8],r},k.c7=function(r,e,i,n,s,l,u){var p=1/(e-i),g=1/(n-s),m=1/(l-u);return r[0]=-2*p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*m,r[11]=0,r[12]=(e+i)*p,r[13]=(s+n)*g,r[14]=(u+l)*m,r[15]=1,r},k.c8=class extends vi{constructor(r,e){super(r,e),this.current=new Array}set(r){if(r!=this.current){this.current=r;const e=new Float32Array(4*r.length);for(let i=0;i<r.length;i++)e[4*i]=r[i].r,e[4*i+1]=r[i].g,e[4*i+2]=r[i].b,e[4*i+3]=r[i].a;this.gl.uniform4fv(this.location,e)}}},k.c9=class extends vi{constructor(r,e){super(r,e),this.current=new Array}set(r){if(r!=this.current){this.current=r;const e=new Float32Array(r);this.gl.uniform1fv(this.location,e)}}},k.cA=function(r,e){return Vo[e]&&"touches"in r},k.cB=function(r){return Vo[r]||jo[r]},k.cC=function(r,e,i){var n=e[0],s=e[1];return r[0]=i[0]*n+i[4]*s+i[12],r[1]=i[1]*n+i[5]*s+i[13],r},k.cD=function(r,e){const{x:i,y:n}=ac.fromLngLat(e);return!(r<0||r>25||n<0||n>=1||i<0||i>=1)},k.cE=function(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},k.cF=class extends io{},k.cG=Za,k.cH=function(r,e){Yr.REGISTERED_PROTOCOLS[r]=e},k.cI=function(r){delete Yr.REGISTERED_PROTOCOLS[r]},k.cJ=function(r,e){const i={};for(let s=0;s<r.length;s++){const l=e&&e[r[s].id]||uh(r[s]);e&&(e[r[s].id]=l);let u=i[l];u||(u=i[l]=[]),u.push(r[s])}const n=[];for(const s in i)n.push(i[s]);return n},k.cK=Ee,k.cL=af,k.cM=Ff,k.cN=Np,k.cO=function(r){var e,i;r.bucket.createArrays(),r.bucket.tilePixelRatio=Le/(512*r.bucket.overscaling),r.bucket.compareText={},r.bucket.iconsNeedLinear=!1;const n=r.bucket.layers[0],s=n.layout,l=n._unevaluatedLayout._values,u={layoutIconSize:l["icon-size"].possiblyEvaluate(new vt(r.bucket.zoom+1),r.canonical),layoutTextSize:l["text-size"].possiblyEvaluate(new vt(r.bucket.zoom+1),r.canonical),textMaxSize:l["text-size"].possiblyEvaluate(new vt(18))};if(r.bucket.textSizeData.kind==="composite"){const{minZoom:_,maxZoom:T}=r.bucket.textSizeData;u.compositeTextSizes=[l["text-size"].possiblyEvaluate(new vt(_),r.canonical),l["text-size"].possiblyEvaluate(new vt(T),r.canonical)]}if(r.bucket.iconSizeData.kind==="composite"){const{minZoom:_,maxZoom:T}=r.bucket.iconSizeData;u.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new vt(_),r.canonical),l["icon-size"].possiblyEvaluate(new vt(T),r.canonical)]}const p=s.get("text-line-height")*ni,g=s.get("text-rotation-alignment")!=="viewport"&&s.get("symbol-placement")!=="point",m=s.get("text-keep-upright"),v=s.get("text-size");for(const _ of r.bucket.features){const T=s.get("text-font").evaluate(_,{},r.canonical).join(","),b=v.evaluate(_,{},r.canonical),M=u.layoutTextSize.evaluate(_,{},r.canonical),I=u.layoutIconSize.evaluate(_,{},r.canonical),A={horizontal:{},vertical:void 0},D=_.text;let L,R=[0,0];if(D){const V=D.toString(),Y=s.get("text-letter-spacing").evaluate(_,{},r.canonical)*ni,J=Js(V)?Y:0,re=s.get("text-anchor").evaluate(_,{},r.canonical),te=Xf(n,_,r.canonical);if(!te){const ie=s.get("text-radial-offset").evaluate(_,{},r.canonical);R=ie?Hf(re,[ie*ni,Td]):s.get("text-offset").evaluate(_,{},r.canonical).map((ye=>ye*ni))}
2let oe=g?"center":s.get("text-justify").evaluate(_,{},r.canonical);const le=s.get("symbol-placement")==="point"?s.get("text-max-width").evaluate(_,{},r.canonical)*ni:1/0,ae=()=>{r.bucket.allowVerticalPlacement&&Il(V)&&(A.vertical=Cu(D,r.glyphMap,r.glyphPositions,r.imagePositions,T,le,p,re,"left",J,R,k.ax.vertical,!0,M,b))};if(!g&&te){const ie=new Set;if(oe==="auto")for(let Se=0;Se<te.values.length;Se+=2)ie.add(Sd(te.values[Se]));else ie.add(oe);let ye=!1;for(const Se of ie)if(!A.horizontal[Se])if(ye)A.horizontal[Se]=A.horizontal[0];else{const we=Cu(D,r.glyphMap,r.glyphPositions,r.imagePositions,T,le,p,"center",Se,J,R,k.ax.horizontal,!1,M,b);we&&(A.horizontal[Se]=we,ye=we.positionedLines.length===1)}ae()}else{oe==="auto"&&(oe=Sd(re));const ie=Cu(D,r.glyphMap,r.glyphPositions,r.imagePositions,T,le,p,re,oe,J,R,k.ax.horizontal,!1,M,b);ie&&(A.horizontal[oe]=ie),ae(),Il(V)&&g&&m&&(A.vertical=Cu(D,r.glyphMap,r.glyphPositions,r.imagePositions,T,le,p,re,oe,J,R,k.ax.vertical,!1,M,b))}}let F=!1;if(!((e=_.icon)===null||e===void 0)&&e.name){const V=r.imageMap[_.icon.name];V&&(L=y_(r.imagePositions[_.icon.name],s.get("icon-offset").evaluate(_,{},r.canonical),s.get("icon-anchor").evaluate(_,{},r.canonical)),F=!!V.sdf,r.bucket.sdfIcons===void 0?r.bucket.sdfIcons=F:r.bucket.sdfIcons!==F&&Kt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(V.pixelRatio!==r.bucket.pixelRatio||s.get("icon-rotate").constantOr(1)!==0)&&(r.bucket.iconsNeedLinear=!0))}const O=Kf(A.horizontal)||A.vertical;(i=r.bucket).iconsInText||(i.iconsInText=!!O&&O.iconsInText),(O||L)&&dy(r.bucket,_,A,L,r.imageMap,u,M,I,R,F,r.canonical,r.subdivisionGranularity)}r.showCollisionBoxes&&r.bucket.generateCollisionDebugBuffers()},k.cP=Ch,k.cQ=Dh,k.cR=Wh,k.cS=function(r,e=""){const i=new Eu;return(function(n,s,l=""){for(const u in n.layers)s.writeMessage(3,((p,g)=>J_(p,g,l)),n.layers[u])})(r,i,e),i.finish()},k.cT=function(r,e,i,n,s,l){let u=Nf(r,e,i,s,0);return u=Nf(u,e,n,l,1),u},k.cU=class{constructor(r){this.maxEntries=r,this.map=new Map}get(r){const e=this.map.get(r);return e!==void 0&&(this.map.delete(r),this.map.set(r,e)),e}set(r,e){if(this.map.has(r))this.map.delete(r);else if(this.map.size>=this.maxEntries){const i=this.map.keys().next().value;this.map.delete(i)}this.map.set(r,e)}clear(){this.map.clear()}},k.cV=lp,k.cW=Eu,k.cX=kf,k.cY=function(r,e,i,n,s){return h(this,void 0,void 0,(function*(){if(Ut())try{return yield dr(r,e,i,n,s)}catch{}return(function(l,u,p,g,m){const v=l.width,_=l.height;Qt&&Ua||(Qt=new OffscreenCanvas(v,_),Ua=Qt.getContext("2d",{willReadFrequently:!0})),Qt.width=v,Qt.height=_,Ua.drawImage(l,0,0,v,_);const T=Ua.getImageData(u,p,g,m);return Ua.clearRect(0,0,v,_),T.data})(r,e,i,n,s)}))},k.cZ=Yd,k.c_=class{constructor(r,e){this.layers={[oc]:this},this.name=oc,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=r.length,this.features=r}feature(r){return new K_(this.features[r],this.extent)}},k.ca=class extends ka{},k.cb=Xg,k.cc=class extends ls{},k.cd=Sh,k.ce=function(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))},k.cf=qd,k.cg=function(r,e,i){var n=e[0],s=e[1],l=e[2],u=i[3]*n+i[7]*s+i[11]*l+i[15];return r[0]=(i[0]*n+i[4]*s+i[8]*l+i[12])/(u=u||1),r[1]=(i[1]*n+i[5]*s+i[9]*l+i[13])/u,r[2]=(i[2]*n+i[6]*s+i[10]*l+i[14])/u,r},k.ch=class extends ro{},k.ci=class extends t{},k.cj=function(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]},k.ck=function(r,e){var i=r[0],n=r[1],s=r[2],l=r[3],u=r[4],p=r[5],g=r[6],m=r[7],v=r[8],_=r[9],T=r[10],b=r[11],M=r[12],I=r[13],A=r[14],D=r[15],L=e[0],R=e[1],F=e[2],O=e[3],V=e[4],Y=e[5],J=e[6],re=e[7],te=e[8],oe=e[9],le=e[10],ae=e[11],ie=e[12],ye=e[13],Se=e[14],we=e[15];return Math.abs(i-L)<=de*Math.max(1,Math.abs(i),Math.abs(L))&&Math.abs(n-R)<=de*Math.max(1,Math.abs(n),Math.abs(R))&&Math.abs(s-F)<=de*Math.max(1,Math.abs(s),Math.abs(F))&&Math.abs(l-O)<=de*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(u-V)<=de*Math.max(1,Math.abs(u),Math.abs(V))&&Math.abs(p-Y)<=de*Math.max(1,Math.abs(p),Math.abs(Y))&&Math.abs(g-J)<=de*Math.max(1,Math.abs(g),Math.abs(J))&&Math.abs(m-re)<=de*Math.max(1,Math.abs(m),Math.abs(re))&&Math.abs(v-te)<=de*Math.max(1,Math.abs(v),Math.abs(te))&&Math.abs(_-oe)<=de*Math.max(1,Math.abs(_),Math.abs(oe))&&Math.abs(T-le)<=de*Math.max(1,Math.abs(T),Math.abs(le))&&Math.abs(b-ae)<=de*Math.max(1,Math.abs(b),Math.abs(ae))&&Math.abs(M-ie)<=de*Math.max(1,Math.abs(M),Math.abs(ie))&&Math.abs(I-ye)<=de*Math.max(1,Math.abs(I),Math.abs(ye))&&Math.abs(A-Se)<=de*Math.max(1,Math.abs(A),Math.abs(Se))&&Math.abs(D-we)<=de*Math.max(1,Math.abs(D),Math.abs(we))},k.cl=function(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},k.cm=r=>r.type==="circle",k.cn=r=>r.type==="heatmap",k.co=r=>r.type==="line",k.cp=r=>r.type==="fill",k.cq=r=>r.type==="fill-extrusion",k.cr=r=>r.type==="hillshade",k.cs=r=>r.type==="color-relief",k.ct=r=>r.type==="background",k.cu=r=>r.type==="custom",k.cv=tr,k.cw=function(r,e,i){if(e<=0)return r;const n=1/e;return i===void 0||Math.abs(i)<1e-10?Math.round(r*n)/n:(i>0?Math.ceil(r*n-1e-9):Math.floor(r*n+1e-10))/n},k.cx=function(r,e,i){const n=Xe(e.x-i.x,e.y-i.y),s=Xe(r.x-i.x,r.y-i.y);var l,u;return da(Math.atan2(n[0]*s[1]-n[1]*s[0],(l=n)[0]*(u=s)[0]+l[1]*u[1]))},k.cy=br,k.cz=function(r,e){var i;if(!jo[e])return!1;const n=r?.target,s=((i=n?.ownerDocument)===null||i===void 0?void 0:i.defaultView)||window;return r instanceof s.MouseEvent||r instanceof s.WheelEvent},k.d=lt,k.d0=class{constructor(r,e){const i=(e=this.options=Object.assign({},Og,e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=Fh(r,e);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),n=Vh(n,e),e.updateable&&(this.source=n),this.initializeIndex(n,e)}initializeIndex(r,e){this.tileIndex=e.cluster?new Dg(e.clusterOptions):new Bg(e),r.length&&this.tileIndex.initialize(r)}
2getTile(r,e,i){return e=+e,i=+i,(r=+r)<0||r>24?null:this.tileIndex.getTile(r,e,i)}updateData(r,e){const i=this.options;if(!i.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");let{affected:n,source:s}=(function(l,u,p){const g=(function(v,_){return v?{removeAll:v.removeAll,remove:new Set(v.remove||[]),add:new Map(v.add?.map((T=>[_.promoteId?T.properties[_.promoteId]:T.id,T]))),update:new Map(v.update?.map((T=>[T.id,T])))}:{remove:new Set,add:new Map,update:new Map}})(u,p);let m=[];if(g.removeAll&&(m=l,l=[]),g.remove.size||g.add.size){const v=[];for(const _ of l)(g.remove.has(_.id)||g.add.has(_.id))&&v.push(_);if(v.length){m.push(...v);const _=new Set(v.map((T=>T.id)));l=l.filter((T=>!_.has(T.id)))}if(g.add.size){let _=Fh({type:"FeatureCollection",features:Array.from(g.add.values())},p);_=Vh(_,p),m.push(..._),l.push(..._)}}if(g.update.size){const v=new Map,_=[];for(const T of l)g.update.has(T.id)?v.set(T.id,[...v.get(T.id)||[],T]):_.push(T);for(const[T,b]of g.update){const M=v.get(T);if(!M||M.length===0)continue;const I=Ag(M,b,p);m.push(...M,...I),_.push(...I)}l=_}return{affected:m,source:l}})(this.source,r,i);e&&({affected:n,source:s}=this.filterUpdate(s,n,e)),n.length&&(this.source=s,this.tileIndex.updateIndex(s,n,i))}filterUpdate(r,e,i){const n=new Set;for(const s of r)s.id!=null&&(i(Su(s))||(e.push(s),n.add(s.id)));return{affected:e,source:r=r.filter((s=>!n.has(s.id)))}}getData(){if(!this.options.updateable)throw new Error("to retrieve data the `updateable` option must be set to true");return{type:"FeatureCollection",features:this.source.map((r=>Su(r)))}}updateClusterOptions(r,e){const i=this.options.cluster;this.options.cluster=r,this.options.clusterOptions=e,i!=r?this.initializeIndex(this.source,this.options):this.tileIndex.updateIndex(this.source,[],this.options)}getClusterExpansionZoom(r){return this.tileIndex.getClusterExpansionZoom(r)}getClusterChildren(r){return this.tileIndex.getChildren(r)}getClusterLeaves(r,e,i){return this.tileIndex.getLeaves(r,e,i)}},k.d1=Nr,k.e=Ii,k.f=pr,k.g=Rr,k.h=r=>h(void 0,void 0,void 0,(function*(){if(r.byteLength===0)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(r)],{type:"image/png"});try{return createImageBitmap(e)}catch(i){throw new Error(`Could not load image because of ${lt(i).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),k.i=Jt,k.j=r=>new Promise(((e,i)=>{const n=new Image;n.onload=()=>{e(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>n.src=hr))},n.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const s=new Blob([new Uint8Array(r)],{type:"image/png"});n.src=r.byteLength?URL.createObjectURL(s):hr})),k.k=(r,e)=>pa(Ii(r,{type:"json"}),e),k.l=$a,k.m=pa,k.n=Mn,k.o=(r,e)=>pa(Ii(r,{type:"arrayBuffer"}),e),k.p=Op,k.q=function(r){return new Eu(r).readFields(u_,[])},k.r=function(r){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(r))},k.s=_s,k.t=$l,k.u=Di,k.v=Kn,k.w=Kt,k.x=ce,k.y=Rl,k.z=Xi})),Ge("worker",["./shared"],(function(k){class h{constructor(W,K){this.keyCache={},W&&this.replace(W,K)}replace(W,K){this._layerConfigs={},this._layers={},this.update(W,[],K)}update(W,K,ee){for(const _e of W){this._layerConfigs[_e.id]=_e;const Be=this._layers[_e.id]=k.bT(_e,ee);Be._featureFilter=k.ah(Be.filter,ee),this.keyCache[_e.id]&&delete this.keyCache[_e.id]}for(const _e of K)delete this.keyCache[_e],delete this._layerConfigs[_e],delete this._layers[_e];this.familiesBySource={};const ve=k.cJ(Object.values(this._layerConfigs),this.keyCache);for(const _e of ve){const Be=_e.map((bt=>this._layers[bt.id])),Re=Be[0];if(Re.isHidden())continue;const Ce=Re.source||"";let Ve=this.familiesBySource[Ce];Ve||(Ve=this.familiesBySource[Ce]={});const Xe=Re.sourceLayer||k.ag;let Le=Ve[Xe];Le||(Le=Ve[Xe]=[]),Le.push(Be)}}}class ge{constructor(W){const K={},ee=[];for(const Re in W){const Ce=W[Re],Ve=K[Re]={};for(const Xe in Ce){const Le=Ce[+Xe];if(!Le||Le.bitmap.width===0||Le.bitmap.height===0)continue;const bt={x:0,y:0,w:Le.bitmap.width+2,h:Le.bitmap.height+2};ee.push(bt),Ve[Xe]={rect:bt,metrics:Le.metrics}}}const{w:ve,h:_e}=k.p(ee),Be=new k.t({width:ve||1,height:_e||1});for(const Re in W){const Ce=W[Re];for(const Ve in Ce){const Xe=Ce[+Ve];if(!Xe||Xe.bitmap.width===0||Xe.bitmap.height===0)continue;const Le=K[Re][Ve].rect;k.t.copy(Xe.bitmap,Be,{x:0,y:0},{x:Le.x+1,y:Le.y+1},Xe.bitmap)}}this.image=Be,this.positions=K}}k.cK("GlyphAtlas",ge);class pt{constructor(W){this.tileID=new k.a3(W.tileID.overscaledZ,W.tileID.wrap,W.tileID.canonical.z,W.tileID.canonical.x,W.tileID.canonical.y),this.uid=W.uid,this.zoom=W.zoom,this.pixelRatio=W.pixelRatio,this.tileSize=W.tileSize,this.source=W.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=W.showCollisionBoxes,this.collectResourceTiming=!!W.collectResourceTiming,this.returnDependencies=!!W.returnDependencies,this.promoteId=W.promoteId,this.inFlightDependencies=[]}parse(W,K,ee,ve,_e){return k._(this,void 0,void 0,(function*(){this.status="parsing",this.data=W,this.collisionBoxArray=new k.ae;const Be=new k.cL(Object.keys(W.layers).sort()),Re=new k.cM(this.tileID,this.promoteId);Re.bucketLayerIDs=[];const Ce={},Ve={featureIndex:Re,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:ee,subdivisionGranularity:_e},Xe=K.familiesBySource[this.source];for(const Fe in Xe){const Zt=W.layers[Fe];if(!Zt)continue;Zt.version===1&&k.w(`Vector tile source "${this.source}" layer "${Fe}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Kt=Be.encode(Fe),Ei=[];for(let Jt=0;Jt<Zt.length;Jt++){const et=Zt.feature(Jt),Ot=Re.getId(et,Fe);Ei.push({feature:et,id:Ot,index:Jt,sourceLayerIndex:Kt})}for(const Jt of Xe[Fe]){const et=Jt[0];et.source!==this.source&&k.w(`layer.source = ${et.source} does not equal this.source = ${this.source}`),et.isHidden(this.zoom,!0)||(at(Jt,this.zoom,ee),(Ce[et.id]=et.createBucket({index:Re.bucketLayerIDs.length,layers:Jt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Kt,sourceID:this.source})).populate(Ei,Ve,this.tileID.canonical),Re.bucketLayerIDs.push(Jt.map((Ot=>Ot.id))))}}const Le=k.bY(Ve.glyphDependencies,(Fe=>Object.keys(Fe).map(Number)));for(const Fe of this.inFlightDependencies)Fe?.abort();this.inFlightDependencies=[];let bt=Promise.resolve({});if(Object.keys(Le).length){const Fe=new AbortController;this.inFlightDependencies.push(Fe),bt=ve.sendAsync({type:"GG",data:{stacks:Le,source:this.source,tileID:this.tileID,type:"glyphs"}},Fe)}const lt=Object.keys(Ve.iconDependencies);let Pi=Promise.resolve({});if(lt.length){const Fe=new AbortController;this.inFlightDependencies.push(Fe),Pi=ve.sendAsync({type:"GI",data:{icons:lt,source:this.source,tileID:this.tileID,type:"icons"}},Fe)}const Mi=Object.keys(Ve.patternDependencies);let er=Promise.resolve({});if(Mi.length){const Fe=new AbortController;this.inFlightDependencies.push(Fe),er=ve.sendAsync({type:"GI",data:{icons:Mi,source:this.source,tileID:this.tileID,type:"patterns"}},Fe)}const tr=Ve.dashDependencies;let br=Promise.resolve({});if(Object.keys(tr).length){const Fe=new AbortController;this.inFlightDependencies.push(Fe),br=ve.sendAsync({type:"GDA",data:{dashes:tr}},Fe)}const[Yt,wr,Ii,Hr]=yield Promise.all([bt,Pi,er,br]),Gi=new ge(Yt),Tr=new k.cN(wr,Ii);for(const Fe in Ce){const Zt=Ce[Fe];Zt instanceof k.af?(at(Zt.layers,this.zoom,ee),k.cO({bucket:Zt,glyphMap:Yt,glyphPositions:Gi.positions,imageMap:wr,imagePositions:Tr.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:Ve.subdivisionGranularity})):Zt.hasDependencies&&(Zt instanceof k.cP||Zt instanceof k.cQ||Zt instanceof k.cR)&&(at(Zt.layers,this.zoom,ee),Zt.addFeatures(Ve,this.tileID.canonical,Tr.patternPositions,Hr))}return this.status="done",{buckets:Object.values(Ce).filter((Fe=>!Fe.isEmpty())),featureIndex:Re,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Gi.image,imageAtlas:Tr,dashPositions:Hr,glyphMap:this.returnDependencies?Yt:null,iconMap:this.returnDependencies?wr:null,glyphPositions:this.returnDependencies?Gi.positions:null}}))}}function at(Qe,W,K){const ee=new k.J(W);for(const ve of Qe)ve.recalculate(ee,K)}class Tt{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(W,K){this.loading[W]=K}finishLoading(W){delete this.loading[W]}abort(W){const K=this.loading[W];K?.abort&&(K.abort.abort(),delete this.loading[W])}setParsing(W,K){this.parsing[W]=K}consumeParsing(W){const K=this.parsing[W];if(K)return delete this.parsing[W],K}clearParsing(W){delete this.parsing[W]}markLoaded(W,K){this.loaded[W]=K}getLoaded(W){const K=this.loaded[W];if(K)return K}removeLoaded(W){delete this.loaded[W]}clearLoaded(){this.loaded={}}}class Si{constructor(W){this.start=`${W}#start`,this.end=`${W}#end`,this.measure=W,performance.mark(this.start)}finish(){performance.mark(this.end);let W=performance.getEntriesByName(this.measure);return W.length===0&&(performance.measure(this.measure,this.start,this.end),W=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),W}}class ft{constructor(W,K,ee,ve,_e){this.type=W,this.properties=ee||{},this.extent=_e,this.pointsArray=K,this.id=ve}loadGeometry(){return this.pointsArray.map((W=>W.map((K=>new k.P(K.x,K.y)))))}}class ui{constructor(W,K,ee){this.version=2,this._myFeatures=W,this.name=K,this.length=W.length,this.extent=ee}feature(W){return this._myFeatures[W]}}class je{constructor(){this.layers={}}addLayer(W){this.layers[W.name]=W}}function ii(Qe){let W=k.cS(Qe);return W.byteOffset===0&&W.byteLength===W.buffer.byteLength||(W=new Uint8Array(W)),{vectorTile:Qe,rawData:W.buffer}}function Ut(Qe,W,K){const{extent:ee}=Qe,ve=Math.pow(2,K.z-W.z),_e=(K.x-W.x*ve)*ee,Be=(K.y-W.y*ve)*ee,Re=[];for(let Ce=0;Ce<Qe.length;Ce++){const Ve=Qe.feature(Ce);let Xe=Ve.loadGeometry();for(const bt of Xe)for(const lt of bt)lt.x=lt.x*ve-_e,lt.y=lt.y*ve-Be;const Le=128;Xe=k.cT(Xe,Ve.type,-Le,-Le,ee+Le,ee+Le),Xe.length!==0&&Re.push(new ft(Ve.type,Xe,Ve.properties,Ve.id,ee))}return new ui(Re,Qe.name,ee)}class de{constructor(W,K,ee){this.actor=W,this.layerIndex=K,this.availableImages=ee,this.tileState=new Tt,this.overzoomedTileResultCache=new k.cU(1e3)}loadVectorTile(W,K){try{return{vectorTile:W.encoding!=="mlt"?new k.cV(new k.cW(K)):new k.cX(K),rawData:K}}catch(ee){const ve=new Uint8Array(K);let _e=`Unable to parse the tile at ${W.request.url}, `;throw _e+=ve[0]===31&&ve[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${k.d(ee).message}`,new Error(_e)}}loadTile(W){return k._(this,void 0,void 0,(function*(){const{uid:K,overzoomParameters:ee}=W;ee&&(W.request=ee.overzoomRequest);const ve=this._startRequestTiming(W),_e=new pt(W);this.tileState.startLoading(K,_e);const Be=new AbortController;_e.abort=Be;try{const Re=yield k.o(W.request,Be);if(W.etag&&W.etag===Re.etag)return this.tileState.finishLoading(K),this._getEtagUnmodifiedResult(Re,ve);const Ce=this.loadVectorTile(W,Re.data);if(this.tileState.finishLoading(K),!Ce)return null;let{vectorTile:Ve,rawData:Xe}=Ce;ee&&({vectorTile:Ve,rawData:Xe}=this._getOverzoomTile(W,Ve));const Le=this._getExpiryData(Re),bt=this._finishRequestTiming(ve);_e.vectorTile=Ve,this.tileState.markLoaded(K,_e);
2const lt={rawData:Xe,cacheControl:Le,resourceTiming:bt};this.tileState.setParsing(K,lt);try{return yield this._parseWorkerTile(_e,W,lt)}finally{this.tileState.clearParsing(K)}}catch(Re){throw this.tileState.finishLoading(K),_e.status="done",this.tileState.markLoaded(K,_e),Re}}))}_getEtagUnmodifiedResult(W,K){const ee=this._getExpiryData(W),ve=this._finishRequestTiming(K);return k.e({etagUnmodified:!0},ee,ve)}_parseWorkerTile(W,K,ee){return k._(this,void 0,void 0,(function*(){let ve=yield W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor,K.subdivisionGranularity);if(ee){const{rawData:_e,cacheControl:Be,resourceTiming:Re}=ee;ve=k.e({rawTileData:_e.slice(0),encoding:K.encoding},ve,Be,Re)}return ve}))}_getExpiryData({expires:W,cacheControl:K,etag:ee}){const ve={};return W&&(ve.expires=W),K&&(ve.cacheControl=K),ee&&(ve.etag=ee),ve}_startRequestTiming(W){var K;if(!((K=W.request)===null||K===void 0)&&K.collectResourceTiming)return new Si(W.request.url)}_finishRequestTiming(W){const K=W?.finish();return K?{resourceTiming:JSON.parse(JSON.stringify(K))}:{}}_getOverzoomTile(W,K){var ee;const{tileID:ve,source:_e,overzoomParameters:Be}=W,{maxZoomTileID:Re}=Be,Ce=`${Re.key}_${ve.key}_${(ee=W.request)===null||ee===void 0?void 0:ee.url}`,Ve=this.overzoomedTileResultCache.get(Ce);if(Ve)return Ve;const Xe=new je,Le=this.layerIndex.familiesBySource[_e];for(const lt in Le){const Pi=K.layers[lt];if(!Pi)continue;const Mi=Ut(Pi,Re,ve.canonical);Mi.length>0&&Xe.addLayer(Mi)}const bt=ii(Xe);return this.overzoomedTileResultCache.set(Ce,bt),bt}reloadTile(W){return k._(this,void 0,void 0,(function*(){const K=W.uid,ee=this.tileState.getLoaded(K);if(!ee)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(ee.showCollisionBoxes=W.showCollisionBoxes,ee.status==="parsing"){const ve=this.tileState.consumeParsing(K);return yield this._parseWorkerTile(ee,W,ve)}if(ee.status==="done"&&ee.vectorTile)return yield this._parseWorkerTile(ee,W)}))}abortTile(W){return k._(this,void 0,void 0,(function*(){this.tileState.abort(W.uid)}))}removeTile(W){return k._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(W.uid)}))}}class zt{constructor(){this.loaded={}}loadTile(W){return k._(this,void 0,void 0,(function*(){const{uid:K,encoding:ee,rawImageData:ve,redFactor:_e,greenFactor:Be,blueFactor:Re,baseShift:Ce}=W,Ve=ve.width+2,Xe=ve.height+2,Le=k.b(ve)?new k.R({width:Ve,height:Xe},yield k.cY(ve,-1,-1,Ve,Xe)):ve,bt=new k.cZ(K,Le,ee,_e,Be,Re,Ce);return this.loaded||(this.loaded={}),this.loaded[K]=bt,bt}))}removeTile(W){const K=this.loaded,ee=W.uid;K?.[ee]&&delete K[ee]}}class Dr{constructor(W,K,ee,ve=zr){this.actor=W,this.layerIndex=K,this.availableImages=ee,this.tileState=new Tt,this._createGeoJSONIndex=ve}loadVectorTile(W){if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const{z:K,x:ee,y:ve}
2=W.tileID.canonical,_e=this._geoJSONIndex.getTile(K,ee,ve);return _e?ii(new k.c_(_e.features,{version:2,extent:k.a6})):null}loadTile(W){return k._(this,void 0,void 0,(function*(){const{uid:K}=W,ee=new pt(W);ee.abort=new AbortController;try{const ve=this.loadVectorTile(W);if(!ve)return null;const{vectorTile:_e,rawData:Be}=ve;ee.vectorTile=_e,this.tileState.markLoaded(K,ee);const Re={rawData:Be};this.tileState.setParsing(K,Re);try{return yield this._parseWorkerTile(ee,W,Re)}finally{this.tileState.clearParsing(K)}}catch(ve){throw ee.status="done",this.tileState.markLoaded(K,ee),ve}}))}_reloadLoadedTile(W){return k._(this,void 0,void 0,(function*(){const K=W.uid,ee=this.tileState.getLoaded(K);if(!ee)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(ee.showCollisionBoxes=W.showCollisionBoxes,ee.status==="parsing"){const ve=this.tileState.consumeParsing(K);return yield this._parseWorkerTile(ee,W,ve)}if(ee.status==="done"&&ee.vectorTile)return yield this._parseWorkerTile(ee,W)}))}_parseWorkerTile(W,K,ee){return k._(this,void 0,void 0,(function*(){let ve=yield W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor,K.subdivisionGranularity);if(ee){const{rawData:_e}=ee;ve=k.e({rawTileData:_e.slice(0),encoding:"mvt"},ve)}return ve}))}abortTile(W){return k._(this,void 0,void 0,(function*(){this.tileState.abort(W.uid)}))}removeTile(W){return k._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(W.uid)}))}loadData(W){return k._(this,void 0,void 0,(function*(){var K;(K=this._pendingRequest)===null||K===void 0||K.abort();const ee=this._startRequestTiming(W);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(W,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();const ve={};return W.request&&(ve.data=W.data),this._finishRequestTiming(ee,W,ve),ve}catch(ve){if(delete this._pendingRequest,!k.$(ve))throw ve;return{abandoned:!0}}}))}_startRequestTiming(W){var K;if(!((K=W.request)===null||K===void 0)&&K.collectResourceTiming)return new Si(W.request.url)}_finishRequestTiming(W,K,ee){const ve=W?.finish();ve&&(ee.resourceTiming={[K.source]:JSON.parse(JSON.stringify(ve))})}reloadTile(W){return this.tileState.getLoaded(W.uid)?this._reloadLoadedTile(W):this.loadTile(W)}loadAndProcessGeoJSON(W,K){return k._(this,void 0,void 0,(function*(){var ee;if(W.request&&(W.data=(yield k.k(W.request,K)).data),W.data)return W.data=this._filterGeoJSON(W.data,W.filter),void(this._geoJSONIndex=this._createGeoJSONIndex(W.data,W));if(W.dataDiff)return(ee=this._geoJSONIndex)!==null&&ee!==void 0||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},W)),void this._geoJSONIndex.updateData(W.dataDiff,this._getFilterPredicate(W.filter));if(W.updateCluster&&this._geoJSONIndex.updateClusterOptions(W.geojsonVtOptions.cluster,Bt(W)),this._geoJSONIndex==null)throw new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`)}))}_filterGeoJSON(W,K){if(W.type!=="FeatureCollection")return W;const ee=this._getFilterPredicate(K);return ee?{type:"FeatureCollection",features:W.features.filter((ve=>ee(ve)))}:W}_getFilterPredicate(W){if(typeof W!="boolean"&&!W?.length)return;const K=k.c$(W,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(K.result==="error")throw new Error(K.value.map((ee=>`${ee.key}: ${ee.message}`)).join(", "));return ee=>K.value.evaluate({zoom:0},ee)}removeSource(W){return k._(this,void 0,void 0,(function*(){var K;(K=this._pendingRequest)===null||K===void 0||K.abort()}))}getClusterExpansionZoom(W){return this._geoJSONIndex.getClusterExpansionZoom(W.clusterId)}getClusterChildren(W){return this._geoJSONIndex.getClusterChildren(W.clusterId)}getClusterLeaves(W){return this._geoJSONIndex.getClusterLeaves(W.clusterId,W.limit,W.offset)}}function zr(Qe,W){const K=k.e(W.geojsonVtOptions||{},{updateable:!0,clusterOptions:Bt(W)});return new k.d0(Qe,K)}function Bt({geojsonVtOptions:Qe,clusterProperties:W}){if(!W||!Qe.clusterOptions)return Qe.clusterOptions;const K={},ee={},ve={accumulated:null,zoom:0},_e={properties:null},Be=Object.keys(W);for(const Re of Be){const[Ce,Ve]=W[Re],Xe=k.c$(Ve),Le=k.c$(typeof Ce=="string"?[Ce,["accumulated"],["get",Re]]:Ce);K[Re]=Xe.value,ee[Re]=Le.value}return Qe.clusterOptions.map=Re=>{_e.properties=Re;const Ce={};for(const Ve of Be)Ce[Ve]=K[Ve].evaluate(ve,_e);return Ce},Qe.clusterOptions.reduce=(Re,Ce)=>{_e.properties=Ce;for(const Ve of Be)ve.accumulated=Re[Ve],Re[Ve]=ee[Ve].evaluate(ve,_e)},Qe.clusterOptions}class ur{constructor(W){this.self=W,this.actor=new k.N(W),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={}
2,this.globalStates=new Map,this.self.registerWorkerSource=(K,ee)=>{if(this.externalWorkerSourceTypes[K])throw new Error(`Worker source with name "${K}" already registered.`);this.externalWorkerSourceTypes[K]=ee},this.self.addProtocol=k.cH,this.self.removeProtocol=k.cI,this.self.registerRTLTextPlugin=K=>{k.d1.setMethods(K)},this.self.makeRequest=k.m,this.actor.registerMessageHandler("LDT",((K,ee)=>this._getDEMWorkerSource(K,ee.source).loadTile(ee))),this.actor.registerMessageHandler("RDT",((K,ee)=>k._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(K,ee.source).removeTile(ee)})))),this.actor.registerMessageHandler("GCEZ",((K,ee)=>k._(this,void 0,void 0,(function*(){return this._getWorkerSource(K,ee.type,ee.source).getClusterExpansionZoom(ee)})))),this.actor.registerMessageHandler("GCC",((K,ee)=>k._(this,void 0,void 0,(function*(){return this._getWorkerSource(K,ee.type,ee.source).getClusterChildren(ee)})))),this.actor.registerMessageHandler("GCL",((K,ee)=>k._(this,void 0,void 0,(function*(){return this._getWorkerSource(K,ee.type,ee.source).getClusterLeaves(ee)})))),this.actor.registerMessageHandler("LD",((K,ee)=>this._getWorkerSource(K,ee.type,ee.source).loadData(ee))),this.actor.registerMessageHandler("LT",((K,ee)=>this._getWorkerSource(K,ee.type,ee.source).loadTile(ee))),this.actor.registerMessageHandler("RT",((K,ee)=>this._getWorkerSource(K,ee.type,ee.source).reloadTile(ee))),this.actor.registerMessageHandler("AT",((K,ee)=>this._getWorkerSource(K,ee.type,ee.source).abortTile(ee))),this.actor.registerMessageHandler("RMT",((K,ee)=>this._getWorkerSource(K,ee.type,ee.source).removeTile(ee))),this.actor.registerMessageHandler("RS",((K,ee)=>k._(this,void 0,void 0,(function*(){var ve,_e;if(!(!((_e=(ve=this.workerSources[K])===null||ve===void 0?void 0:ve[ee.type])===null||_e===void 0)&&_e[ee.source]))return;const Be=this.workerSources[K][ee.type][ee.source];delete this.workerSources[K][ee.type][ee.source],Be.removeSource!==void 0&&Be.removeSource(ee)})))),this.actor.registerMessageHandler("RM",(K=>k._(this,void 0,void 0,(function*(){delete this.layerIndexes[K],delete this.availableImages[K],delete this.workerSources[K],delete this.demWorkerSources[K],this.globalStates.delete(K)})))),this.actor.registerMessageHandler("SR",((K,ee)=>k._(this,void 0,void 0,(function*(){this.referrer=ee})))),this.actor.registerMessageHandler("SRPS",((K,ee)=>this._syncRTLPluginState(K,ee))),this.actor.registerMessageHandler("IS",((K,ee)=>k._(this,void 0,void 0,(function*(){this.self.importScripts(ee)})))),this.actor.registerMessageHandler("SI",((K,ee)=>this._setImages(K,ee))),this.actor.registerMessageHandler("UL",((K,ee)=>k._(this,void 0,void 0,(function*(){this._getLayerIndex(K).update(ee.layers,ee.removedIds,this._getGlobalState(K))})))),this.actor.registerMessageHandler("UGS",((K,ee)=>k._(this,void 0,void 0,(function*(){const ve=this._getGlobalState(K);for(const _e in ee)ve[_e]=ee[_e]})))),this.actor.registerMessageHandler("SL",((K,ee)=>k._(this,void 0,void 0,(function*(){this._getLayerIndex(K).replace(ee,this._getGlobalState(K))}))))}_getGlobalState(W){let K=this.globalStates.get(W);return K||(K={},this.globalStates.set(W,K)),K}_setImages(W,K){return k._(this,void 0,void 0,(function*(){this.availableImages[W]=K;for(const ee in this.workerSources[W]){const ve=this.workerSources[W][ee];for(const _e in ve)ve[_e].availableImages=K}}))}_syncRTLPluginState(W,K){return k._(this,void 0,void 0,(function*(){return yield k.d1.syncState(K,this.self.importScripts)}))}_getAvailableImages(W){let K=this.availableImages[W];return K||(K=[]),K}_getLayerIndex(W){let K=this.layerIndexes[W];return K||(K=this.layerIndexes[W]=new h),K}_getWorkerSource(W,K,ee){var ve,_e;if((ve=this.workerSources)[W]||(ve[W]={}),(_e=this.workerSources[W])[K]||(_e[K]={}),!this.workerSources[W][K][ee]){const Be={sendAsync:(Re,Ce)=>(Re.targetMapId=W,this.actor.sendAsync(Re,Ce))};switch(K){case"vector":this.workerSources[W][K][ee]=new de(Be,this._getLayerIndex(W),this._getAvailableImages(W));break;case"geojson":this.workerSources[W][K][ee]=new Dr(Be,this._getLayerIndex(W),this._getAvailableImages(W));break;default:this.workerSources[W][K][ee]=new this.externalWorkerSourceTypes[K](Be,this._getLayerIndex(W),this._getAvailableImages(W))}}return this.workerSources[W][K][ee]}_getDEMWorkerSource(W,K){var ee,ve;return(ee=this.demWorkerSources)[W]||(ee[W]={}),(ve=this.demWorkerSources[W])[K]||(ve[K]=new zt),this.demWorkerSources[W][K]}}return k.i(self)&&(self.worker=new ur(self)),ur})),Ge("index",["exports","./shared"],(function(k,h){var ge="5.24.0";function pt(){var d=new h.A(4);return h.A!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}let at,Tt,Si;
2const ft={frame(d,t,a,o){const c=o||window,f=c.requestAnimationFrame((x=>{y(),t(x)})),{unsubscribe:y}=h.s(d.signal,"abort",(()=>{y(),c.cancelAnimationFrame(f),a(new h.a(d.signal.reason))}),!1)},frameAsync(d,t){return new Promise(((a,o)=>{this.frame(d,a,o,t)}))},getImageData(d,t=0){return this.getImageCanvasContext(d).getImageData(-t,-t,d.width+2*t,d.height+2*t)},getImageCanvasContext(d){const t=window.document.createElement("canvas"),a=t.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return t.width=d.width,t.height=d.height,a.drawImage(d,0,0,d.width,d.height),a},resolveURL:d=>(at||(at=document.createElement("a")),at.href=d,at.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return Si!==void 0?Si:!!matchMedia&&(Tt!=null||(Tt=matchMedia("(prefers-reduced-motion: reduce)")),Tt.matches)},set prefersReducedMotion(d){Si=d}},ui=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt!==null?this._frozenAt:performance.now()}setNow(d){this._frozenAt=d}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function je(){return ui.getCurrentTime()}var ii,Ut;class de{static create(t,a,o){const c=window.document.createElement(t);return a!==void 0&&(c.className=a),o&&o.appendChild(c),c}static createNS(t,a){return window.document.createElementNS(t,a)}static disableDrag(){de.docStyle&&de.selectProp&&(de.userSelect=de.docStyle[de.selectProp],de.docStyle[de.selectProp]="none")}static enableDrag(){de.docStyle&&de.selectProp&&(de.docStyle[de.selectProp]=de.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",de.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",de.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",de.suppressClickInternal,!0)}),0)}static getScale(t){const a=t.getBoundingClientRect();return{x:a.width/t.offsetWidth||1,y:a.height/t.offsetHeight||1,boundingClientRect:a}}static getPoint(t,a,o){const c=a.boundingClientRect;return new h.P((o.clientX-c.left)/a.x-t.clientLeft,(o.clientY-c.top)/a.y-t.clientTop)}static mousePos(t,a){const o=de.getScale(t);return de.getPoint(t,o,a)}static touchPos(t,a){const o=[],c=de.getScale(t);for(const f of a)o.push(de.getPoint(t,c,f));return o}static sanitize(t){const a=new DOMParser().parseFromString(t,"text/html").body||document.createElement("body"),o=a.querySelectorAll("script");for(const c of o)c.remove();return de.clean(a),a.innerHTML}static isPossiblyDangerous(t,a){const o=a.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!o.includes("javascript:")&&!o.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){const a=t.children;for(const o of a)de.removeAttributes(o),de.clean(o)}static removeAttributes(t){for(const{name:a,value:o}of t.attributes)de.isPossiblyDangerous(a,o)&&t.removeAttribute(a)}}de.docStyle=typeof window<"u"&&((ii=window.document)===null||ii===void 0?void 0:ii.documentElement.style),de.selectProp=!de.docStyle||"userSelect"in de.docStyle?"userSelect":"webkitUserSelect",(function(d){let t,a,o,c;d.resetRequestQueue=()=>{t=[],a=0,o=0,c={}},d.addThrottleControl=w=>{const S=o++;return c[S]=w,S},d.removeThrottleControl=w=>{delete c[w],y()},d.getImage=(w,S,P=!0)=>new Promise(((E,C)=>{w.headers||(w.headers={}),w.headers.accept="image/webp,*/*",h.e(w,{type:"image"}),t.push({abortController:S,requestParameters:w,supportImageRefresh:P,state:"queued",onError:z=>{C(z)},onSuccess:z=>{E(z)}}),y()}));const f=w=>h._(this,void 0,void 0,(function*(){w.state="running";const{requestParameters:S,supportImageRefresh:P,onError:E,onSuccess:C,abortController:z}=w,B=P===!1&&!h.i(self)&&!h.g(S.url)&&(!S.headers||Object.keys(S.headers).reduce(((j,G)=>j&&G==="accept"),!0));a++;const N=B?x(S,z):h.m(S,z);try{const j=yield N;delete w.abortController,w.state="completed",j.data instanceof HTMLImageElement||h.b(j.data)?C(j):j.data&&C({data:yield(Z=j.data,typeof createImageBitmap=="function"?h.h(Z):h.j(Z)),cacheControl:j.cacheControl,expires:j.expires})}catch(j){delete w.abortController,E(h.d(j))}finally{a--,y()}var Z})),y=()=>{const w=(()=>{for(const S of Object.keys(c))if(c[S]())return!0;return!1})()?h.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:h.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let S=a;S<w&&t.length>0;S++){const P=t.shift();P.abortController.signal.aborted?S--:f(P)}},x=(w,S)=>new Promise(((P,E)=>{const C=new Image,z=w.url,B=w.credentials;B&&B==="include"?C.crossOrigin="use-credentials":(B&&B==="same-origin"||!h.f(z))&&(C.crossOrigin="anonymous"),S.signal.addEventListener("abort",(()=>{C.src="",E(new h.a(S.signal.reason))})),C.fetchPriority="high",C.onload=()=>{C.onerror=C.onload=null,P({data:C})},C.onerror=()=>{C.onerror=C.onload=null,S.signal.aborted||E(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},C.src=z}))})(Ut||(Ut={})),Ut.resetRequestQueue();class zt{constructor(t){this._transformRequestFn=t??null}transformRequest(t,a){return this._transformRequestFn&&this._transformRequestFn(t,a)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function Dr(d){const t=[];
2if(typeof d=="string")t.push({id:"default",url:d});else if(d&&d.length>0){const a=[];for(const{id:o,url:c}of d){const f=`${o}${c}`;a.includes(f)||(a.push(f),t.push({id:o,url:c}))}}return t}function zr(d,t,a){try{const o=new URL(d);return o.pathname+=`${t}${a}`,o.toString()}catch{throw new Error(`Invalid sprite URL "${d}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function Bt(d){const{userImage:t}=d;return!(!t?.render||!t.render()||(d.data.replace(new Uint8Array(t.data.buffer)),0))}class ur extends h.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new h.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(const t of Object.keys(this.images))this.removeImage(t);this.patterns={},this.atlasImage=new h.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:a,promiseResolve:o}of this.requestors)o(this._getImagesForIds(a));this.requestors=[]}}getImage(t){const a=this.images[t];if(a&&!a.data&&a.spriteData){const o=a.spriteData;a.data=new h.R({width:o.width,height:o.height},o.context.getImageData(o.x,o.y,o.width,o.height).data),a.spriteData=null}return a}
2addImage(t,a){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,a)&&(this.images[t]=a)}_validate(t,a){let o=!0;const c=a.data||a.spriteData;return this._validateStretch(a.stretchX,c?.width)||(this.fire(new h.l(new Error(`Image "${t}" has invalid "stretchX" value`))),o=!1),this._validateStretch(a.stretchY,c?.height)||(this.fire(new h.l(new Error(`Image "${t}" has invalid "stretchY" value`))),o=!1),this._validateContent(a.content,a)||(this.fire(new h.l(new Error(`Image "${t}" has invalid "content" value`))),o=!1),o}_validateStretch(t,a){if(!t)return!0;let o=0;for(const c of t){if(c[0]<o||c[1]<c[0]||a<c[1])return!1;o=c[1]}return!0}_validateContent(t,a){if(!t)return!0;if(t.length!==4)return!1;const o=a.spriteData,c=o?.width||a.data.width,f=o?.height||a.data.height;return!(t[0]<0||c<t[0]||t[1]<0||f<t[1]||t[2]<0||c<t[2]||t[3]<0||f<t[3]||t[2]<t[0]||!(t[3]>=t[1]))}updateImage(t,a,o=!0){const c=this.getImage(t);if(o&&(c.data.width!==a.data.width||c.data.height!==a.data.height))throw new Error(`size mismatch between old image (${c.data.width}x${c.data.height}) and new image (${a.data.width}x${a.data.height}).`);a.version=c.version+1,this.images[t]=a,this.updatedImages[t]=!0}removeImage(t){var a;const o=this.images[t];delete this.images[t],delete this.patterns[t],!((a=o.userImage)===null||a===void 0)&&a.onRemove&&o.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((a,o)=>{let c=!0;if(!this.isLoaded())for(const f of t)this.images[f]||(c=!1);this.isLoaded()||c?a(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:a})}))}_getImagesForIds(t){var a;const o={};for(const c of t){let f=this.getImage(c);f||(this.fire(new h.n("styleimagemissing",{id:c})),f=this.getImage(c)),f?o[c]={data:f.data.clone(),pixelRatio:f.pixelRatio,sdf:f.sdf,version:f.version,stretchX:f.stretchX,stretchY:f.stretchY,content:f.content,textFitWidth:f.textFitWidth,textFitHeight:f.textFitHeight,hasRenderCallback:!!(!((a=f.userImage)===null||a===void 0)&&a.render)}:h.w(`Image "${c}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return o}getPixelSize(){const{width:t,height:a}=this.atlasImage;return{width:t,height:a}}getPattern(t){const a=this.patterns[t],o=this.getImage(t);if(!o)return null;if(a&&a.position.version===o.version)return a.position;if(a)a.position.version=o.version;else{const c={w:o.data.width+2,h:o.data.height+2,x:0,y:0},f=new h.I(c,o);this.patterns[t]={bin:c,position:f}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const a=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new h.T(t,this.atlasImage,a.RGBA),this.atlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const f in this.patterns)t.push(this.patterns[f].bin);const{w:a,h:o}=h.p(t),c=this.atlasImage;c.resize({width:a||1,height:o||1});for(const f in this.patterns){const{bin:y}=this.patterns[f],x=y.x+1,w=y.y+1,S=this.getImage(f).data,P=S.width,E=S.height;h.R.copy(S,c,{x:0,y:0},{x,y:w},{width:P,height:E}),h.R.copy(S,c,{x:0,y:E-1},{x,y:w-1},{width:P,height:1}),h.R.copy(S,c,{x:0,y:0},{x,y:w+E},{width:P,height:1}),h.R.copy(S,c,{x:P-1,y:0},{x:x-1,y:w},{width:1,height:E}),h.R.copy(S,c,{x:0,y:0},{x:x+P,y:w},{width:1,height:E})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const a of t){if(this.callbackDispatchedThisFrame[a])continue;this.callbackDispatchedThisFrame[a]=!0;const o=this.getImage(a);o||h.w(`Image with ID: "${a}" was not found`),Bt(o)&&this.updateImage(a,o)}}cloneImages(){const t={};for(const a in this.images){const o=this.images[a];t[a]=Object.assign(Object.assign({},o),{data:o.data?o.data.clone():null})}return t}}const Qe=1e20,W=new Float64Array(256);for(let d=0;d<256;d++){const t=.5-Math.pow(d/255,.45454545454545453);W[d]=t*Math.abs(t)}function K(d,t,a,o,c,f,y,x,w){for(let S=t;S<t+o;S++)ee(d,a*f+S,f,c,y,x,w);for(let S=a;S<a+c;S++)ee(d,S*f+t,1,o,y,x,w)}function ee(d,t,a,o,c,f,y){f[0]=0,y[0]=-Qe,y[1]=Qe,c[0]=d[t];for(let x=1,w=0,S=0;x<o;x++){c[x]=d[t+x*a];const P=x*x;do{const E=f[w];S=(c[x]-c[E]+P-E*E)/(x-E)/2}while(S<=y[w]&&--w>-1);w++,f[w]=x,y[w]=S,y[w+1]=Qe}for(let x=0,w=0;x<o;x++){for(;y[w+1]<x;)w++;const S=f[w],P=x-S;d[t+x*a]=c[S]+P*P}}W[255]=-Qe;const ve=h.v.layout_symbol["text-font"].default.join(",");class _e{constructor(t,a,o){this.requestManager=t,this.localIdeographFontFamily=a,this.entries={},this.lang=o}setURL(t){this.url=t}getGlyphs(t){return h._(this,void 0,void 0,(function*(){const a=[];for(const f in t)for(const y of t[f])a.push(this._getAndCacheGlyphsPromise(f,y));const o=yield Promise.all(a),c={};for(const{stack:f,id:y,glyph:x}of o)c[f]||(c[f]={}),c[f][y]=x&&{id:x.id,bitmap:x.bitmap.clone(),metrics:x.metrics};return c}))}_getAndCacheGlyphsPromise(t,a){return h._(this,void 0,void 0,(function*(){var o,c;(o=(c=this.entries)[t])!==null&&o!==void 0||(c[t]={glyphs:{},requests:{},ranges:{}});const f=this.entries[t];let y=f.glyphs[a];return y!==void 0?{stack:t,id:a,glyph:y}:!this.url||this._charUsesLocalIdeographFontFamily(a)?(y=f.glyphs[a]=this._drawGlyph(f,t,a),{stack:t,id:a,glyph:y}):yield this._downloadAndCacheRangePromise(t,a)}))}_downloadAndCacheRangePromise(t,a){return h._(this,void 0,void 0,(function*(){var o;const c=this.entries[t],f=Math.floor(a/256);if(c.ranges[f])return{stack:t,id:a,glyph:null};(o=c.requests)[f]||(o[f]=_e.loadGlyphRange(t,f,this.url,this.requestManager));try{const y=yield c.requests[f];for(const x in y)c.glyphs[+x]=y[+x];return c.ranges[f]=!0,{stack:t,id:a,glyph:y[a]||null}}catch(y){const x=c.glyphs[a]=this._drawGlyph(c,t,a);return this._warnOnMissingGlyphRange(x,f,a,h.d(y)),{stack:t,id:a,glyph:x}}}))}_warnOnMissingGlyphRange(t,a,o,c){const f=256*a,y=f+255,x=o.toString(16).padStart(4,"0").toUpperCase();h.w(`Unable to load glyph range ${a}, ${f}-${y}. Rendering codepoint U+${x} locally instead. ${c}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&h.r(t)}_drawGlyph(t,a,o){const c=a===ve&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(o),f=c?"ideographTinySDF":"tinySDF";t[f]||(t[f]=this._createTinySDF(c?this.localIdeographFontFamily:a));const y=t[f].draw(String.fromCodePoint(o)),x=new RegExp("^\\p{gc=Cf}+$","u").test(String.fromCodePoint(o));return{id:o,bitmap:new h.t({width:y.width||60,height:y.height||60},y.data),metrics:{width:x?0:y.glyphWidth/2||24,height:y.glyphHeight/2||24,left:y.glyphLeft/2+.5||0,top:y.glyphTop/2-27.5||-8,advance:x?0:y.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){const a=t?t.split(","):[];a.push("sans-serif");const o=a.map((c=>/[-\w]+/.test(c)?c:`'${CSS.escape(c)}'`)).join(",");return new _e.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:o,fontWeight:this._fontWeight(a[0]),fontStyle:this._fontStyle(a[
20]),lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){const a={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950};let o;for(const[c,f]of Object.entries(a))new RegExp(`\\b${c}\\b`,"i").test(t)&&(o=`${f}`);return o}destroy(){for(const t in this.entries){const a=this.entries[t];a.tinySDF=null,a.ideographTinySDF=null,a.glyphs={},a.requests={},a.ranges={}}this.entries={}}}_e.loadGlyphRange=function(d,t,a,o){return h._(this,void 0,void 0,(function*(){const c=256*t,f=c+255,y=yield o.transformRequest(a.replace("{fontstack}",d).replace("{range}",`${c}-${f}`),"Glyphs"),x=yield h.o(y,new AbortController);if(!x?.data)throw new Error(`Could not load glyph range. range: ${t}, ${c}-${f}`);const w={};for(const S of h.q(x.data))w[S.id]=S;return w}))},_e.TinySDF=class{constructor({fontSize:d=24,buffer:t=3,radius:a=8,cutoff:o=.25,fontFamily:c="sans-serif",fontWeight:f="normal",fontStyle:y="normal",lang:x=null}={}){this.buffer=t,this.radius=a,this.cutoff=o,this.lang=x;const w=this.size=d+4*t,S=this._createCanvas(w),P=this.ctx=S.getContext("2d",{willReadFrequently:!0});P.font=`${y} ${f} ${d}px ${c}`,P.textBaseline="alphabetic",P.textAlign="left",P.fillStyle="black",this.gridOuter=new Float64Array(w*w),this.gridInner=new Float64Array(w*w),this.f=new Float64Array(w),this.z=new Float64Array(w+1),this.v=new Uint16Array(w)}_createCanvas(d){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(d,d);const t=document.createElement("canvas");return t.width=t.height=d,t}draw(d){const{width:t,actualBoundingBoxAscent:a,actualBoundingBoxDescent:o,actualBoundingBoxLeft:c,actualBoundingBoxRight:f}=this.ctx.measureText(d),y=Math.ceil(a),x=Math.floor(c),w=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(f)-x)),S=Math.max(0,Math.min(this.size-this.buffer,y+Math.ceil(o))),P=w+2*this.buffer,E=S+2*this.buffer,C=Math.max(P*E,0),z=new Uint8ClampedArray(C),B={data:z,width:P,height:E,glyphWidth:w,glyphHeight:S,glyphTop:y,glyphLeft:x,glyphAdvance:t};if(w===0||S===0)return B;const{ctx:N,buffer:Z,gridInner:j,gridOuter:G}=this;this.lang&&(N.lang=this.lang),N.clearRect(Z,Z,w,S),N.fillText(d,Z-x,Z+y);const X=N.getImageData(Z,Z,w,S);G.fill(Qe,0,C),j.fill(0,0,C);let $=3;for(let q=0;q<S;q++){let Q=(q+Z)*P+Z;for(let ne=0;ne<w;ne++,$+=4,Q++){const se=X.data[$];if(se===0)continue;const me=W[se];G[Q]=Math.max(0,me),j[Q]=Math.max(0,-me)}}K(G,0,0,P,E,P,this.f,this.v,this.z),K(j,Z,Z,w,S,P,this.f,this.v,this.z);const U=255/this.radius,H=255*(1-this.cutoff);for(let q=0;q<C;q++){const Q=Math.sqrt(G[q])-Math.sqrt(j[q]);z[q]=Math.round(H-U*Q)}return B}};class Be{constructor(){this.specification=h.x.light.position}possiblyEvaluate(t,a){return h.G(t.expression.evaluate(a))}interpolate(t,a,o){return{x:h.H.number(t.x,a.x,o),y:h.H.number(t.y,a.y,o),z:h.H.number(t.z,a.z,o)}}}let Re;class Ce extends h.E{constructor(t){super(),Re||(Re=new h.u({anchor:new h.D(h.x.light.anchor),position:new Be,color:new h.D(h.x.light.color),intensity:new h.D(h.x.light.intensity)})),this._transitionable=new h.y(Re,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,a={}){if(!this._validate(h.z,t,a))for(const o in t){const c=t[o];o.endsWith(h.B)?this._transitionable.setTransition(o.slice(0,-h.B.length),c):this._transitionable.setValue(o,c)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,a,o){return o?.validate!==!1&&h.C(this,t.call(h.F,{value:a,style:{glyphs:!0,sprite:!0},styleSpec:h.x}))}}const Ve=new h.u({"sky-color":new h.D(h.x.sky["sky-color"]),"horizon-color":new h.D(h.x.sky["horizon-color"]),"fog-color":new h.D(h.x.sky["fog-color"]),"fog-ground-blend":new h.D(h.x.sky["fog-ground-blend"]),"horizon-fog-blend":ne
vendor: 4,626 bytes, line 2
2w h.D(h.x.sky["horizon-fog-blend"]),"sky-horizon-blend":new h.D(h.x.sky["sky-horizon-blend"]),"atmosphere-blend":new h.D(h.x.sky["atmosphere-blend"])});class Xe extends h.E{constructor(t){super(),this._transitionable=new h.y(Ve,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new h.J(0))}setSky(t,a={}){if(!this._validate(h.K,t,a)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const o in t){const c=t[o];o.endsWith(h.B)?this._transitionable.setTransition(o.slice(0,-h.B.length),c):this._transitionable.setValue(o,c)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,a,o={}){return o?.validate!==!1&&h.C(this,t.call(h.F,h.e({value:a,style:{glyphs:!0,sprite:!0},styleSpec:h.x})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class Le{constructor(t,a){this.width=t,this.height=a,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,a){var o;const c=t.join(",")+String(a);return(o=this.dashEntry)[c]||(o[c]=this.addDash(t,a)),this.dashEntry[c]}getDashRanges(t,a,o){const c=[];let f=t.length%2==1?-t[t.length-1]*o:0,y=t[0]*o,x=!0;c.push({left:f,right:y,isDash:x,zeroLength:t[0]===0});let w=t[0];for(let S=1;S<t.length;S++){x=!x;const P=t[S];f=w*o,w+=P,y=w*o,c.push({left:f,right:y,isDash:x,zeroLength:P===0})}return c}addRoundDash(t,a,o){const c=a/2;for(let f=-o;f<=o;f++){const y=this.width*(this.nextRow+o+f);let x=0,w=t[x];for(let S=0;S<this.width;S++){S/w.right>1&&(w=t[++x]);const P=Math.abs(S-w.left),E=Math.abs(S-w.right),C=Math.min(P,E);let z;const B=f/o*(c+1);if(w.isDash){const N=c-Math.abs(B);z=Math.sqrt(C*C+N*N)}else z=c-Math.sqrt(C*C+B*B);this.data[y+S]=Math.max(0,Math.min(255,z+128))}}}addRegularDash(t){for(let x=t.length-1;x>=0;--x){const w=t[x],S=t[x+1];w.zeroLength?t.splice(x,1):S&&S.isDash===w.isDash&&(S.left=w.left,t.splice(x,1))}const a=t[0],o=t[t.length-1];a.isDash===o.isDash&&(a.left=o.left-this.width,o.right=a.right+this.width);const c=this.width*this.nextRow;let f=0,y=t[f];for(let x=0;x<this.width;x++){x/y.right>1&&(y=t[++f]);const w=Math.abs(x-y.left),S=Math.abs(x-y.right),P=Math.min(w,S);this.data[c+x]=Math.max(0,Math.min(255,(y.isDash?P:-P)+128))}}addDash(t,a){const o=a?7:0,c=2*o+1;if(this.nextRow+c>this.height)return h.w("LineAtlas out of space"),null;let f=0;for(const x of t)f+=x;if(f!==0){const x=this.width/f,w=this.getDashRanges(t,this.width,x);a?this.addRoundDash(w,x,o):this.addRegularDash(w)}const y={y:this.nextRow+o,height:2*o,width:f};return this.nextRow+=c,this.dirty=!0,y}bind(t){const a=t.gl;this.texture?(a.bindTexture(a.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.ALPHA,a.UNSIGNED_BYTE,this.data))):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,this.width,this.height,0,a.ALPHA,a.UNSIGNED_BYTE,this.data))}}const bt="maplibre_preloaded_worker_pool";class lt{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<lt.workerCount;)this.workers.push(new Worker(h.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){if(delete this.active[t],this.numActive()===0){for(const a of this.workers)a.terminate();this.workers=null}}isPreloaded(){return!!this.active[bt]}numActive(){return Object.keys(this.active).length}}const Pi=Math.floor(ft.hardwareConcurrency/2);let Mi,er;function tr(){return Mi||(Mi=new lt),Mi}lt.workerCount=h.L(globalThis)?Math.max(Math.min(Pi,3),1):1;class br{constructor(t,a){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=a;const o=this.workerPool.acquire(a);for(let c=0;c<o.length;c++){const f=new h.N(o[c],a);f.name=`Worker ${c}`,this.actors.push(f)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,a){const o=[];for(const c of this.actors)o.push(c.sendAsync({type:t,data:a}));return Promise.all(o)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){for(const a of this.actors)a.remove();
2this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,a){for(const o of this.actors)o.registerMessageHandler(t,a)}unregisterMessageHandler(t){for(const a of this.actors)a.unregisterMessageHandler(t)}}function Yt(){return er||(er=new br(tr(),h.M),er.registerMessageHandler("GR",((d,t,a)=>h.m(t,a)))),er}function wr(d,t){const a=h.O();return h.Q(a,a,[1,1,0]),h.S(a,a,[.5*d.width,.5*d.height,1]),d.calculatePosMatrix?h.U(a,a,d.calculatePosMatrix(t.toUnwrapped())):a}function Ii(d,t,a,o,c,f,y){var x;const w=(function(C,z,B){if(C)for(const N of C){const Z=z[N];if(Z?.source===B&&Z.type==="fill-extrusion")return!0}else for(const N in z){const Z=z[N];if(Z.source===B&&Z.type==="fill-extrusion")return!0}return!1})((x=c?.layers)!==null&&x!==void 0?x:null,t,d.id),S=f.maxPitchScaleFactor(),P=d.tilesIn(o,S,w);P.sort(Hr);const E=[];for(const C of P)E.push({wrappedTileID:C.tileID.wrapped().key,queryResults:C.tile.queryRenderedFeatures(t,a,d.getState(),C.queryGeometry,C.cameraQueryGeometry,C.scale,c,f,S,wr(f,C.tileID),y?(z,B)=>y(C.tileID,z,B):void 0)});return(function(C,z){for(const B in C)for(const N of C[B])Gi(N,z);return C})((function(C){const z={},B={};for(const{queryResults:N,wrappedTileID:Z}of C){B[Z]||(B[Z]={});const j=B[Z];for(const G in N){const X=N[G];j[G]||(j[G]={});const $=j[G];z[G]||(z[G]=[]);for(const U of X)$[U.featureIndex]||($[U.featureIndex]=!0,z[G].push(U))}}return z})(E),d)}function Hr(d,t){const a=d.tileID,o=t.tileID;return a.overscaledZ-o.overscaledZ||a.canonical.y-o.canonical.y||a.wrap-o.wrap||a.canonical.x-o.canonical.x}function Gi(d,t){const a=d.feature,o=t.getFeatureState(a.layer["source-layer"],a.id);a.source=a.layer.source,a.layer["source-layer"]&&(a.sourceLayer=a.layer["source-layer"]),a.state=o}function Tr(d,t,a,o){return h._(this,void 0,void 0,(function*(){let c=d;if(d.url?c=(yield h.k(yield t.transformRequest(d.url,"Source"),a)).data:yield ft.frameAsync(a,o),!c)return null;const f=h.V(h.e(c,d),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in c&&c.vector_layers&&(f.vectorLayerIds=c.vector_layers.map((y=>y.id))),f}))}class Fe{constructor(t,a){t&&(a?this.setSouthWest(t).setNorthEast(a):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof h.W?new h.W(t.lng,t.lat):h.W.convert(t),this}setSouthWest(t){return this._sw=t instanceof h.W?new h.W(t.lng,t.lat):h.W.convert(t),this}extend(t){const a=this._sw,o=this._ne;let c,f;if(t instanceof h.W)c=t,f=t;else{if(!(t instanceof Fe))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Fe.convert(t)):this.extend(h.W.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(h.W.convert(t)):this;if(c=t._sw,f=t._ne,!c||!f)return this}return a||o?(a.lng=Math.min(c.lng,a.lng),a.lat=Math.min(c.lat,a.lat),o.lng=Math.max(f.lng,o.lng),o.lat=Math.max(f.lat,o.lat)):(this._sw=new h.W(c.lng,c.lat),this._ne=new h.W(f.lng,f.lat)),this}getCenter(){return new h.W((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new h.W(this.getWest(),this.getNorth())}getSouthEast(){return new h.W(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:a,lat:o}=h.W.convert(t);let c=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=a&&a>=this._ne.lng),this._sw.lat<=o&&o<=this._ne.lat&&c}intersects(t){if(!((t=Fe.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;const a=Math.abs(this.getEast()-this.getWest()),o=Math.abs(t.getEast()-t.getWest());if(a>=360||o>=360)return!0;const c=h.X(this.getWest(),-180,180),f=h.X(this.getEast(),-180,180),y=h.X(t.getWest(),-180,180),x=h.X(t.getEast(),-180,180),w=c>f,S=y>x;return!(!w||!S)||(w?x>=c||y<=f:S?f>=y||c<=x:y<=f&&x>=c)}static convert(t){return t instanceof Fe?t:t&&new Fe(t)}static fromLngLat(t,a=0){const o=360*a/40075017,c=o/Math.cos(Math.PI/180*t.lat);return new Fe(new h.W(t.lng-c,t.lat-o),new h.W(t.lng+c,t.lat+o))}adjustAntiMeridian(){const t=new h.W(this._sw.lng,this._sw.lat),a=new h.W(this._ne.lng,this._ne.lat);return new Fe(t,t.lng>a.lng?new h.W(a.lng+360,a.lat):a)}}class Zt{constructor(t,a,o){this.bounds=Fe.convert(this.validateBounds(t)),this.minzoom=a||0,this.maxzoom=o||24}
vendor: 2,398 bytes, line 2
2validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const a=Math.pow(2,t.z),o=Math.floor(h.Z(this.bounds.getWest())*a),c=Math.floor(h.Y(this.bounds.getNorth())*a),f=Math.ceil(h.Z(this.bounds.getEast())*a),y=Math.ceil(h.Y(this.bounds.getSouth())*a);return t.x>=o&&t.x<f&&t.y>=c&&t.y<y}}class Kt extends h.E{constructor(t,a,o,c){if(super(),this.id=t,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,h.e(this,h.V(a,["url","scheme","tileSize","promoteId","encoding"])),this._options=h.e({type:"vector"},a),this._collectResourceTiming=a.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(c)}load(){return h._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new h.n("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const a=yield Tr(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,a&&(h.e(this,a),a.bounds&&(this.tileBounds=new Zt(a.bounds,this.minzoom,this.maxzoom)),this.fire(new h.n("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.n("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(a){this._tileJSONRequest=null,this._loaded=!0,h.$(a)||this.fire(new h.l(h.d(a)))}}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load(!0)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return h.e({},this._options)}loadTile(t){return h._(this,void 0,void 0,(function*(){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),o={request:yield this.map._requestManager.transformRequest(a,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
2ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(t),etag:t.etag};o.request.collectResourceTiming=this._collectResourceTiming;let c="RT";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise(((f,y)=>{t.reloadPromise={resolve:f,reject:y}}))}else t.actor=this.dispatcher.getActor(),c="LT";t.abortController=new AbortController;try{const f=yield t.actor.sendAsync({type:c,data:o},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,f);const y={};return f?.etagUnmodified&&(y.unmodified=!0),y}catch(f){if(delete t.abortController,t.aborted)return;if(f&&f.status!==404)throw f;this._afterTileLoadWorkerResponse(t,null)}}))}_getOverzoomParameters(t){return h._(this,void 0,void 0,(function*(){if(t.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;const a=t.tileID.scaledTo(this.maxzoom).canonical,o=a.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:a,overzoomRequest:yield this.map._requestManager.transformRequest(o,"Tile")}}))}_afterTileLoadWorkerResponse(t,a){if(a?.resourceTiming&&(t.resourceTiming=a.resourceTiming),a&&this.map._refreshExpiredTiles&&t.setExpiryData(a),t.etag=a?.etag,t.loadVectorData(a,this.map.painter),t.reloadPromise){const o=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(o.resolve).catch(o.reject)}}abortTile(t){return h._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.t
vendor: 4,211 bytes, line 2
2ype,source:this.id}}))}))}unloadTile(t){return h._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class Ei extends h.E{constructor(t,a,o,c){super(),this.id=t,this.dispatcher=o,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=h.e({type:"raster"},a),h.e(this,h.V(a,["url","scheme","tileSize"]))}load(){return h._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new h.n("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const a=yield Tr(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,a&&(h.e(this,a),a.bounds&&(this.tileBounds=new Zt(a.bounds,this.minzoom,this.maxzoom)),this.fire(new h.n("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.n("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(a){this._tileJSONRequest=null,this._loaded=!0,h.$(a)||this.fire(new h.l(h.d(a)))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load(!0)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return h.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return h._(this,void 0,void 0,(function*(){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const o=yield Ut.getImage(yield this.map._requestManager.transformRequest(a,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(o?.data){this.map._refreshExpiredTiles&&(o.cacheControl||o.expires)&&t.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});const c=this.map.painter.context,f=c.gl,y=o.data;t.texture=this.map.painter.getTileTexture(y.width),t.texture?t.texture.update(y,{useMipmap:!0}):(t.texture=new h.T(c,y,f.RGBA,{useMipmap:!0}),t.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(o){if(delete t.abortController,t.aborted)t.state="unloaded";else if(o)throw t.state="errored",o}}))}abortTile(t){return h._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return h._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class Jt extends Ei{constructor(t,a,o,c){super(t,a,o,c),this.type="raster-dem",this.maxzoom=22,this._options=h.e({type:"raster-dem"},a),this.encoding=a.encoding||"mapbox",this.redFactor=a.redFactor,this.greenFactor=a.greenFactor,this.blueFactor=a.blueFactor,this.baseShift=a.baseShift}loadTile(t){return h._(this,void 0,void 0,(function*(){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),o=yield this.map._requestManager.transformRequest(a,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const c=yield Ut.getImage(o,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(c?.data){const f=c.data;this.map._refreshExpiredTiles&&(c.cacheControl||c.expires)&&t.setExpiryData({cacheControl:c.cacheControl,expires:c.expires});const y=h.b(f)&&h.a0()?f:yield this.readImageNow(f),x={type:this.type,uid:t.uid,source:this.id,rawImageData:y,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(t.actor&&t.state!=="expired"&&t.state!=="reloading")return;t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor()),t.dem=yield t.actor.sendAsync({type:"LDT",data:x}
2),t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}catch(c){if(delete t.abortController,t.aborted)t.state="unloaded";else if(c)throw t.state="errored",c}}))}readImageNow(t){return h._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&h.a1()){const a=t.width+2,o=t.height+2;try{return new h.R({width:a,height:o},yield h.a2(t,-1,-1,a,o))}catch{}}return ft.getImageData(t,1)}))}_getNeighboringTiles(t){const a=t.canonical,o=Math.pow(2,a.z),c=(a.x-1+o)%o,f=a.x===0?t.wrap-1:t.wrap,y=(a.x+1+o)%o,x=a.x+1===o?t.wrap+1:t.wrap,w={};return w[new h.a3(t.overscaledZ,f,a.z,c,a.y).key]={backfilled:!1},w[new h.a3(t.overscaledZ,x,a.z,y,a.y).key]={backfilled:!1},a.y>0&&(w[new h.a3(t.overscaledZ,f,a.z,c,a.y-1).key]={backfilled:!1},w[new h.a3(t.overscaledZ,t.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},w[new h.a3(t.overscaledZ,x,a.z,y,a.y-1).key]={backfilled:!1}),a.y+1<o&&(w[new h.a3(t.overscaledZ,f,a.z,c,a.y+1).key]={backfilled:!1},w[new h.a3(t.overscaledZ,t.wrap,a.z,a.x,a.y+1).key]={backfilled:!1},w[new h.a3(t.overscaledZ,x,a.z,y,a.y+1).key]={backfilled:!1}),w}unloadTile(t){return h._(this,void 0,void 0,(function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))}))}}function et(d,t){return t?d.properties[t]:d.id}function Ot(d,t){const a={id:d.id};if(t.removeAllProperties&&(delete d.removeProperties,delete d.addOrUpdateProperties,delete t.removeProperties),t.removeProperties)for(const o of t.removeProperties){const c=d.addOrUpdateProperties.findIndex((f=>f.key===o));c>-1&&d.addOrUpdateProperties.splice(c,1)}return(d.removeAllProperties||t.removeAllProperties)&&(a.removeAllProperties=!0),(d.removeProperties||t.removeProperties)&&(a.removeProperties=[...d.removeProperties||[],...t.removeProperties||[]]),(d.addOrUpdateProperties||t.addOrUpdateProperties)&&(a.addOrUpdateProperties=[...d.addOrUpdateProperties||[],...t.addOrUpdateProperties||[]]),(d.newGeometry||t.newGeometry)&&(a.newGeometry=t.newGeometry||d.newGeometry),a}function hr(d){var t,a;if(!d)return{};const o={};return o.removeAll=d.removeAll,o.remove=new Set(d.remove||[]),o.add=new Map((t=d.add)===null||t===void 0?void 0:t.map((c=>[c.id,c]))),o.update=new Map((a=d.update)===null||a===void 0?void 0:a.map((c=>[c.id,c]))),o}function dr(d){return d&&d.length!==0?typeof d[0]=="number"?[d]:d.flatMap((t=>dr(t))):[]}function Qt(d){return d.type==="GeometryCollection"?d.geometries.flatMap((t=>Qt(t))):dr(d.coordinates)}function Ua(d){const t=new Fe;let a;switch(d.type){case"FeatureCollection":a=d.features.flatMap((o=>Qt(o.geometry)));break;case"Feature":a=Qt(d.geometry);break;default:a=Qt(d)}if(a.length===0)return t;for(const o of a){const[c,f]=o;t.extend([c,f])}return t}class _s extends h.E{constructor(t,a,o,c){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:a.data},this.actor=o.getActor(),this.setEventedParent(c),this._data=typeof a.data=="string"?{url:a.data}:{geojson:a.data},this._options=h.e({},a),this._collectResourceTiming=a.collectResourceTiming,a.maxzoom!==void 0&&(this.maxzoom=a.maxzoom),a.type&&(this.type=a.type),a.attribution&&(this.attribution=a.attribution),this.promoteId=a.promoteId,a.clusterMaxZoom!==void 0&&this.maxzoom<=a.clusterMaxZoom&&h.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${a.clusterMaxZoom}".`),this.workerOptions=h.e({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(a.buffer!==void 0?a.buffer:128),tolerance:this._pixelsToTileUnits(a.tolerance!==void 0?a.tolerance:.375),extent:h.a6,maxZoom:this.maxzoom,lineMetrics:a.lineMetrics||!1,generateId:a.generateId||!1,promoteId:typeof a.promoteId=="string"?a.promoteId:void 0,cluster:a.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(a.clusterMaxZoom),minPoints:Math.max(2,a.clusterMinPoints||2),extent:h.a6,radius:this._pixelsToTileUnits(a.clusterRadius||50),log:!1,generateId:a.generateId||!1}},clusterProperties:a.clusterProperties,filter:a.filter},a.workerOptions)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(t){return t*(h.a6/this.tileSize)}
2_getClusterMaxZoom(t){const a=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||t===void 0||h.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${a}"`),a}load(){return h._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t,a){this._data=typeof t=="string"?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t};const o=this._updateWorkerData();return a?o:this}updateData(t,a){this._pendingWorkerUpdate.diff=(function(c,f){if(!c)return f||{};if(!f)return c||{};const y=hr(c),x=hr(f);(function(S,P){P.removeAll&&(S.add.clear(),S.update.clear(),S.remove.clear(),P.remove.clear());for(const E of P.remove)S.add.delete(E),S.update.delete(E);for(const[E,C]of P.update){const z=S.update.get(E);z&&(P.update.set(E,Ot(z,C)),S.update.delete(E))}})(y,x);const w={};if((y.removeAll||x.removeAll)&&(w.removeAll=!0),w.remove=new Set([...y.remove,...x.remove]),w.add=new Map([...y.add,...x.add]),w.update=new Map([...y.update,...x.update]),w.remove.size&&w.add.size)for(const S of w.add.keys())w.remove.delete(S);return(function(S){const P={};return S.removeAll&&(P.removeAll=S.removeAll),S.remove&&(P.remove=Array.from(S.remove)),S.add&&(P.add=Array.from(S.add.values())),S.update&&(P.update=Array.from(S.update.values())
2),P})(w)})(this._pendingWorkerUpdate.diff,t);const o=this._updateWorkerData();return a?o:this}getData(){return h._(this,void 0,void 0,(function*(){return this._data.url&&(yield this.once("data")),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}}))}getBounds(){return h._(this,void 0,void 0,(function*(){return Ua(yield this.getData())}))}setClusterOptions(t){return this.workerOptions.geojsonVtOptions.cluster=t.cluster,t.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),t.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,a,o){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:a,offset:o}})}_updateWorkerData(){return h._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void h.w(`No pending worker updates for GeoJSONSource ${this.id}.`);const{data:t,diff:a,updateCluster:o}=this._pendingWorkerUpdate,c=this._getLoadGeoJSONParameters(t,a,o);t!==void 0?this._pendingWorkerUpdate.data=void 0:a?this._pendingWorkerUpdate.diff=void 0:o&&(this._pendingWorkerUpdate.updateCluster=void 0),yield this._dispatchWorkerUpdate(c)}))}_getLoadGeoJSONParameters(t,a,o){return h._(this,void 0,void 0,(function*(){const c=h.e({type:this.type},this.workerOptions);return typeof t=="string"?(c.request=yield this.map._requestManager.transformRequest(ft.resolveURL(t),"Source"),c.request.collectResourceTiming=this._collectResourceTiming,c):t!==void 0?(c.data=t,c):a?(c.dataDiff=a,c):o?(c.updateCluster=!0,c):void 0}))}_dispatchWorkerUpdate(t){return h._(this,void 0,void 0,(function*(){this._isUpdatingWorker=!0,this.fire(new h.n("dataloading",{dataType:"source"}));try{const a=yield t,o=yield this.actor.sendAsync({type:"LD",data:a});if(this._isUpdatingWorker=!1,this._removed||o.abandoned)return void this.fire(new h.n("dataabort",{dataType:"source"}));o.data&&(this._data={geojson:o.data});const c=this._applyDiffToSource(a.dataDiff),f=this._getShouldReloadTileOptions(c),y={dataType:"source"};this._applyResourceTiming(y,o),this.fire(new h.n("data",Object.assign(Object.assign({},y),{sourceDataType:"metadata"}))),this.fire(new h.n("data",Object.assign(Object.assign({},y),{sourceDataType:"content",shouldReloadTileOptions:f})))}catch(a){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new h.n("dataabort",{dataType:"source"}));this.fire(new h.l(h.d(a)))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_applyResourceTiming(t,a){var o;if(!this._collectResourceTiming)return;const c=(o=a.resourceTiming)===null||o===void 0?void 0:o[this.id];if(!c)return;const f=c.slice(0);f?.length&&h.e(t,{resourceTiming:f})}_applyDiffToSource(t){if(!t)return;const a=typeof this.promoteId=="string"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){const c=(function(f,y){const x=new Map;if(f==null||f.type==null)return x;if(f.type==="Feature"){const w=et(f,y);return w==null?void 0:(x.set(w,f),x)}if(f.type==="FeatureCollection"){const w=new Set;for(const S of f.features){const P=et(S,y);if(P==null||w.has(P))return;w.add(P),x.set(P,S)}return x}})(this._data.geojson,a);if(!c)throw new Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:c}}if(!this._data.updateable)return;const o=(function(c,f,y){var x,w;const S=[];if(f.removeAll)c.clear();else if(f.remove)for(const P of f.remove){const E=c.get(P);E&&(S.push(E.geometry),c.delete(P))}if(f.add)for(const P of f.add){const E=et(P,y);if(E==null)continue;const C=c.get(E);C&&S.push(C.geometry),S.push(P.geometry),c.set(E,P)}if(f.update)for(const P of f.update){const E=c.get(P.id);if(!E)continue;const C=!!P.newGeometry,z=P.removeAllProperties||((x=P.removeProperties)===null||x===void 0?void 0:x.length)>0||((w=P.addOrUpdateProperties)===null||w===void 0?void 0:w.length)>0;if(!C&&!z)continue;S.push(E.geometry);const B=Object.assign({},E);if(c.set(P.id,B),C&&(S.push(P.newGeometry),B.geometry=P.newGeometry),z){if(B.properties=P.removeAllProperties?{}:Object.assign({},B.properties||{}),P.removeProperties)for(const N of P.removeProperties)delete B.properties[N];if(P.addOrUpdateProperties)for(const{key:N,value:Z}of P.addOrUpdateProperties)B.properties[N]=Z}}return S})(this._data.updateable,t,a);return t.removeAll||this._options.cluster?void 0:o}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map((a=>Ua(a)))}}shouldReloadTile(t,{affectedBounds:a}
vendor: 1,378 bytes, line 2
2){if(t.state==="loading")return!0;if(t.state==="unloaded")return!1;const{buffer:o,extent:c}=this.workerOptions.geojsonVtOptions,f=(function({x:y,y:x,z:w},S=0){const P=h.a4((y-S)/Math.pow(2,w)),E=h.a5((x+1+S)/Math.pow(2,w)),C=h.a4((y+1+S)/Math.pow(2,w)),z=h.a5((x-S)/Math.pow(2,w));return new Fe([P,E],[C,z])})(t.tileID.canonical,o/c);for(const y of a)if(f.intersects(y))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return h._(this,void 0,void 0,(function*(){const a=t.actor?"RT":"LT";t.actor=this.actor;const o={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};t.abortController=new AbortController;const c=yield this.actor.sendAsync({type:a,data:o},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(c,this.map.painter,a==="RT")}))}abortTile(t){return h._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return h._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.t
2ype,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return h.e({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}}class Xr extends h.E{constructor(t,a,o,c){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=o,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=a}load(t){return h._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new h.n("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const a=yield Ut.getImage(yield this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,a?.data&&(this.image=a.data,t&&(this.coordinates=t),this._finishLoading())}catch(a){this._request=null,this._loaded=!0,h.$(a)||this.fire(new h.l(h.d(a)))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>this.texture=null)),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new h.n("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const a=t.map(h.a7.fromLngLat);var o;return this.tileID=(function(c){const f=h.a8.fromPoints(c),y=f.width(),x=f.height(),w=Math.max(y,x),S=Math.max(0,Math.floor(-Math.log(w)/Math.LN2)),P=Math.pow(2,S);return new h.aa(S,Math.floor((f.minX+f.maxX)/2*P),Math.floor((f.minY+f.maxY)/2*P))})(a),this.terrainTileRanges=this._getOverlappingTileRanges(a),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=a.map((c=>this.tileID.getTilePoint(c)._round())),this.flippedWindingOrder=((o=this.tileCoords)[1].x-o[0].x)*(o[2].y-o[0].y)-(o[1].y-o[0].y)*(o[2].x-o[0].x)<0,this.fire(new h.n("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,a=t.gl;this.texture||(this.texture=new h.T(t,this.image,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let o=!1;for(const c in this.tiles){const f=this.tiles[c];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture,o=!0)}o&&this.fire(new h.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return h._(this,void 0,void 0,(function*(){var a;!((a=this.tileID)===null||a===void 0)&&a.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(t){const{minX:a,minY:o,maxX:c,maxY:f}=h.a8.fromPoints(t),y={};for(let x=0;x<=h.a9;x++){const w=Math.pow(2,x),S=Math.floor(a*w),P=Math.floor(o*w),E=Math.floor(c*w),C=Math.floor(f*w),z=(S%w+w)%w,B=E%w,N=Math.floor(S/w),Z=Math.floor(E/w);y[x]={minWrap:N,maxWrap:Z,minTileXWrapped:z,maxTileXWrapped:B,minTileY:P,maxTileY:C}}return y}}class da extends Xr{constructor(t,a,o,c){super(t,a,o,c),this._onPlayingHandler=()=>{var f;(f=this.map)===null||f===void 0||f.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=a}load(){return h._(this,void 0,void 0,(function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const a of t.urls)this.urls.push((yield this.map._requestManager.transformRequest(a,"Source")).url);try{const a=yield h.ab(this.urls);if(this._loaded=!0,!a)return;this.video=a,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(a){this.fire(new h.l(h.d(a)))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const a=this.video.seekable;t<a.start(0)||t>a.end(0)?this.fire(new h.l(new h.ac(`sources.${this.id}`,null,`Playback for this video can be set only between the ${a.start(0)} and ${a.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}
vendor: 4,361 bytes, line 2
2onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,a=t.gl;this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new h.T(t,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let o=!1;for(const c in this.tiles){const f=this.tiles[c];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture,o=!0)}o&&this.fire(new h.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Vo extends Xr{constructor(t,a,o,c){super(t,a,o,c),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some((f=>!Array.isArray(f)||f.length!==2||f.some((y=>typeof y!="number"))))||this.fire(new h.l(new h.ac(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new h.l(new h.ac(`sources.${t}`,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new h.l(new h.ac(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof HTMLCanvasElement||this.fire(new h.l(new h.ac(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new h.l(new h.ac(`sources.${t}`,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}load(){return h._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new h.l(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const a=this.map.painter.context,o=a.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new h.T(a,this.canvas,o.RGBA,{premultiply:!0}),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE));let c=!1;for(const f in this.tiles){const y=this.tiles[f];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,c=!0)}c&&this.fire(new h.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const jo={},ys=d=>{switch(d){case"geojson":return _s;case"image":return Xr;case"raster":return Ei;case"raster-dem":return Jt;case"vector":return Kt;case"video":return da;case"canvas":return Vo}return jo[d]},Pn="RTLPluginLoaded";class uc extends h.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Yt()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((a=>{throw this.status="error",a}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return h._(this,arguments,void 0,(function*(a,o=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=ft.resolveURL(a),!this.url)throw new Error(`requested url ${a}
2 is invalid`);if(this.status==="unavailable"){if(!o)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()}))}_requestImport(){return h._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new h.n(Pn))}))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let vs=null;function Yr(){return vs||(vs=new uc),vs}var Rr,ir;(function(d){d[d.Base=0]="Base",d[d.Parent=1]="Parent"})(Rr||(Rr={})),(function(d){d[d.Departing=0]="Departing",d[d.Incoming=1]="Incoming"})(ir||(ir={}));class Za{constructor(t,a){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=h.ad(),this.uses=0,this.tileSize=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading"}isRenderable(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:a,fadingParentID:o,fadeEndTime:c}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=a,this.fadingParentID=o,this.fadeEndTime=c}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=je(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,a,o){if(t?.etagUnmodified!==!0)if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestEncoding=t.encoding,this.latestFeatureIndex.rawTileData=t.rawTileData,this.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=(function(c,f){const y={};if(!f)return y;for(const x of c){const w=x.layerIds.map((S=>f.getLayer(S))).filter(Boolean);if(w.length!==0){x.layers=w,x.stateDependentLayerIds&&(x.stateDependentLayers=x.stateDependentLayerIds.map((S=>w.filter((P=>P.id===S))[0])));for(const S of w)y[S.id]=x}}return y})(t.buckets,a?.style),this.hasSymbolBuckets=!1;for(const c in this.buckets){const f=this.buckets[c];if(f instanceof h.af){if(this.hasSymbolBuckets=!0,!o)break;f.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const c in this.buckets){const f=this.buckets[c];if(f instanceof h.af&&f.hasRTLText){this.hasRTLText=!0,Yr().lazyLoad();break}}this.queryPadding=0;for(const c in this.buckets){const f=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,a.style.getLayer(c).queryRadius(f))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new h.ae;else this.state="loaded"}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const o in this.buckets){const c=this.buckets[o];c.uploadPending()&&c.upload(t)}const a=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new h.T(t,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new h.T(t,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,a,o,c,f,y,x,w,S,P,E){var C;return!((C=this.latestFeatureIndex)===null||C===void 0)&&C.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:f,scale:y,tileSize:this.tileSize,pixelPosMatrix:P,transform:w,params:x,queryPadding:this.queryPadding*S,getElevation:E},t,a,o):{}}querySourceFeatures(t,a){const o=this.latestFeatureIndex;if(!o?.rawTileData)return;const c=o.loadVTLayers(),f=a?.sourceLayer?a.sourceLayer:"",y=c[h.ag]||c[f];if(!y)return;const x=h.ah(a?.filter,a?.globalState),{z:w,x:S,y:P}=this.tileID.canonical,E={z:w,x:S,y:P};for(let C=0;C<y.length;C++){const z=y.feature(C);if(x.needGeometry){const Z=h.ai(z,!0);
2if(!x.filter(new h.J(this.tileID.overscaledZ),Z,this.tileID.canonical))continue}else if(!x.filter(new h.J(this.tileID.overscaledZ),z))continue;const B=o.getId(z,f),N=new h.aj(z,w,S,P,B);N.tile=E,t.push(N)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const a=this.expirationTime;if(t.cacheControl){const o=h.ak(t.cacheControl);o["max-age"]&&(this.expirationTime=Date.now()+1e3*o["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const o=Date.now();let c=!1;if(this.expirationTime>o)c=!1;else if(a)if(this.expirationTime<a)c=!0;else{const f=this.expirationTime-a;f?this.expirationTime=o+Math.max(f,3e4):c=!0}else c=!0;c?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(t,a){var o,c,f;if(!(!((o=this.latestFeatureIndex)===null||o===void 0)&&o.rawTileData)||Object.keys(t).length===0)return;const y=this.latestFeatureIndex.loadVTLayers();for(const x in this.buckets){if(!a.style.hasLayer(x))continue;const w=this.buckets[x],S=w.layers[0].sourceLayer||h.ag,P=y[S],E=t[S];if(!P||!E||Object.keys(E).length===0)continue;w.update(E,P,((c=this.imageAtlas)===null||c===void 0?void 0:c.patternPositions)||{},this.dashPositions||{});const C=(f=a?.style)===null||f===void 0?void 0:f.getLayer(x);C&&(this.queryPadding=Math.max(this.queryPadding,C.queryRadius(w)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<je()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=je()+t}setDependencies(t,a){const o={};for(const c of a)o[c]=!0;this.dependencies[t]=o}hasDependency(t,a){for(const o of t){const c=this.dependencies[o];if(c){for(const f of a)if(c[f])return!0}}return!1}}class Uo{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(t,a,o){var c,f,y,x,w;const S=String(a);if((x=this.stateChanges)[t]||(x[t]={}),(w=this.stateChanges[t])[S]||(w[S]={}),h.e(this.stateChanges[t][S],o),this.deletedStates[t]===null){this.deletedStates[t]={};for(const P in this.state[t])P!==S&&(this.deletedStates[t][P]=null)}else if(((c=this.deletedStates[t])===null||c===void 0?void 0:c[S])===null){this.deletedStates[t][S]={};for(const P in this.state[t][S])o[P]||(this.deletedStates[t][S][P]=null)}else for(const P in o)((y=(f=this.deletedStates[t])===null||f===void 0?void 0:f[S])===null||y===void 0?void 0:y[P])===null&&delete this.deletedStates[t][S][P]}removeFeatureState(t,a,o){var c,f,y;if(this.deletedStates[t]===null)return;const x=String(a);if((f=this.deletedStates)[t]||(f[t]={}),o&&a!==void 0)this.deletedStates[t][x]!==null&&((y=this.deletedStates[t])[x]||(y[x]={}),this.deletedStates[t][x][o]=null);else if(a!==void 0)if(!((c=this.stateChanges[t])===null||c===void 0)&&c[x])for(o in this.deletedStates[t][x]={},this.stateChanges[t][x])this.deletedStates[t][x][o]=null;else this.deletedStates[t][x]=null;else this.deletedStates[t]=null}getState(t,a){const o=String(a),c=h.e({},(this.state[t]||{})[o],(this.stateChanges[t]||{})[o]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const f=this.deletedStates[t][a];if(f===null)return{};for(const y in f)delete c[y]}return c}initializeTileState(t,a){t.setFeatureState(this.state,a)}coalesceChanges(t,a){var o,c,f;const y={};for(const x in this.stateChanges){(o=this.state)[x]||(o[x]={});const w={};for(const S in this.stateChanges[x])(c=this.state[x])[S]||(c[S]={}),h.e(this.state[x][S],this.stateChanges[x][S]),w[S]=this.state[x][S];
2y[x]=w}for(const x in this.deletedStates){(f=this.state)[x]||(f[x]={});const w={};if(this.deletedStates[x]===null)for(const S in this.state[x])w[S]={},this.state[x][S]={};else for(const S in this.deletedStates[x]){if(this.deletedStates[x][S]===null)this.state[x][S]={};else for(const P of Object.keys(this.deletedStates[x][S]))delete this.state[x][S][P];w[S]=this.state[x][S]}y[x]||(y[x]={}),h.e(y[x],w)}this.stateChanges={},this.deletedStates={},Object.keys(y).length!==0&&(this.revision++,t.setFeatureState(y,a))}}const pa=89.25;function pr(d,t){const a=h.al(t.lat,-h.am,h.am);return new h.P(h.Z(t.lng)*d,h.Y(a)*d)}function Ga(d,t){return new h.a7(t.x/d,t.y/d).toLngLat()}function fa(d){return d.cameraToCenterDistance*Math.min(.85*Math.tan(h.an(90-d.pitch)),Math.tan(h.an(pa-d.pitch)))}function Mn(d,t){const a=d.canonical,o=t/h.ao(a.z),c=a.x+Math.pow(2,a.z)*d.wrap,f=h.ap(new Float64Array(16));return h.Q(f,f,[c*o,a.y*o,0]),h.S(f,f,[o/h.a6,o/h.a6,1]),f}function $a(d,t,a,o,c){const f=h.a7.fromLngLat(d,t),y=c*h.aq(1,d.lat),{x,y:w,z:S}=xs(a,o);return new h.a7(f.x+y*-x,f.y+y*-w,f.z+y*-S)}function xs(d,t){const a=h.an(d),o=h.an(t),c=Math.cos(-a),f=Math.sin(a);return{x:f*Math.sin(o),y:-f*Math.cos(o),z:c}}function ce(d,t,a){const o=t.intersectsFrustum(d);if(!a||o===0)return o;const c=t.intersectsPlane(a);return c===0?0:o===2&&c===2?2:1}function Zo(d,t,a){let o=0;const c=(a-t)/10;for(let f=0;f<10;f++)o+=c*Math.pow(Math.cos(t+(f+.5)/10*(a-t)),d);return o}function Go(d,t){return function(a,o,c,f,y){const x=2*((d-1)/h.ar(Math.cos(h.an(pa-y))/Math.cos(h.an(pa)))-1),w=Math.acos(c/f),S=2*Zo(x-1,0,h.an(y/2)),P=Math.min(h.an(pa),w+h.an(y/2)),E=Zo(x-1,Math.min(P,w-h.an(y/2)),P),C=Math.atan(o/c),z=Math.hypot(o,c);let B=a;return B+=h.ar(f/z/Math.max(.5,Math.cos(h.an(y/2)))),B+=x*h.ar(Math.cos(C))/2,B-=h.ar(Math.max(1,E/S/t))/2,B}}const ct=Go(9.314,3);function Oi(d,t){const a=(t.roundZoom?Math.round:Math.floor)(d.zoom+h.ar(d.tileSize/t.tileSize));return Math.max(0,a)}function ma(d,t){const a=d.getCameraFrustum(),o=d.getClippingPlane(),c=d.screenPointToMercatorCoordinate(d.getCameraPoint()),f=h.a7.fromLngLat(d.center,d.elevation);c.z=f.z+Math.cos(d.pitchInRadians)*d.cameraToCenterDistance/d.worldSize;const y=d.getCoveringTilesDetailsProvider(),x=y.allowVariableZoom(d,t),w=Oi(d,t),S=t.minzoom||0,P=t.maxzoom!==void 0?t.maxzoom:d.maxZoom,E=Math.min(Math.max(0,w),P),C=Math.pow(2,E),z=[C*c.x,C*c.y,0],B=[C*f.x,C*f.y,0],N=Math.hypot(f.x-c.x,f.y-c.y),Z=Math.abs(f.z-c.z),j=Math.hypot(N,Z),G=U=>({zoom:0,x:0,y:0,wrap:U,fullyVisible:!1}),X=[],$=[];if(d.renderWorldCopies&&y.allowWorldCopies())for(let U=1;U<=3;U++)X.push(G(-U)),X.push(G(U));for(X.push(G(0));X.length>0;){const U=X.pop(),H=U.x,q=U.y;let Q=U.fullyVisible;const ne={x:H,y:q,z:U.zoom},se=y.getTileBoundingVolume(ne,U.wrap,d.elevation,t);if(!Q){const Te=ce(a,se,o);if(Te===0)continue;Q=Te===2}const me=y.distanceToTile2d(c.x,c.y,ne,se);let pe=w;x&&(pe=(t.calculateTileZoom||ct)(d.zoom+h.ar(d.tileSize/t.tileSize),me,Z,j,d.fov)),pe=(t.roundZoom?Math.round:Math.floor)(pe),pe=Math.max(0,pe);const Ae=Math.min(pe,P);if(U.wrap=y.getWrap(f,ne,U.wrap),U.zoom>=Ae){if(U.zoom<S)continue;const Te=E-U.zoom,ue=z[0]-.5-(H<<Te),Me=z[1]-.5-(q<<Te),ze=t.reparseOverscaled?Math.max(U.zoom,pe):U.zoom;$.push({tileID:new h.a3(U.zoom===P?ze:U.zoom,U.wrap,U.zoom,H,q),distanceSq:h.as([B[0]-.5-H,B[1]-.5-q]),tileDistanceToCamera:Math.sqrt(ue*ue+Me*Me)})}else for(let Te=0;Te<4;Te++)X.push({zoom:U.zoom+1,x:(H<<1)+Te%2,y:(q<<1)+(Te>>1),wrap:U.wrap,fullyVisible:Q})}return $.sort(((U,H)=>U.distanceSq-H.distanceSq)).map((U=>U.tileID))}const hc=h.a8.fromPoints([new h.P(0,0),new h.P(h.a6,h.a6)]);function dc(d){return d==="raster"||d==="image"||d==="video"}function $u(d,t,a,o,c,f,y){if(!t.hasData())return!1;const{tileID:x,fadingRole:w,fadingDirection:S,fadingParentID:P}=t;if(w===Rr.Base&&S===ir.Incoming&&P)return a[P.key]=P,!0;const E=Math.max(x.overscaledZ-c,f);for(let C=x.overscaledZ-1;C>=E;C--){const z=x.scaledTo(C),B=d.getLoadedTile(z);if(B)return t.setCrossFadeLogic({fadingRole:Rr.Base,fadingDirection:ir.Incoming,fadingParentID:B.tileID,fadeEndTime:o+y}),B.setCrossFadeLogic({fadingRole:Rr.Parent,fadingDirection:ir.Departing,fadeEndTime:o+y}),a[z.key]=z,!0}return!1}function bs(d,t,a,o,c,f){if(!t.hasData())return!1;
2const y=t.tileID.children(c);let x=$o(d,t,y,a,o,c,f);if(x)return!0;for(const w of y)$o(d,t,w.children(c),a,o,c,f)&&(x=!0);return x}function $o(d,t,a,o,c,f,y){if(a[0].overscaledZ>=f)return!1;let x=!1;for(const w of a){const S=d.getLoadedTile(w);if(!S)continue;const{fadingRole:P,fadingDirection:E,fadingParentID:C}=S;P===Rr.Base&&E===ir.Departing&&C||(S.setCrossFadeLogic({fadingRole:Rr.Base,fadingDirection:ir.Departing,fadingParentID:t.tileID,fadeEndTime:c+y}),t.setCrossFadeLogic({fadingRole:Rr.Parent,fadingDirection:ir.Incoming,fadeEndTime:c+y})),o[w.key]=w,x=!0}return x}function pc(d,t,a,o){const c=d.tileID;return!!d.selfFading||!d.hasData()&&!!t.has(c)&&(d.setSelfFadeLogic(a+o),!0)}function be(d,t){var a;d.needsHillshadePrepare=!0,d.needsTerrainPrepare=!0;let o=t.tileID.canonical.x-d.tileID.canonical.x;const c=t.tileID.canonical.y-d.tileID.canonical.y,f=Math.pow(2,d.tileID.canonical.z),y=t.tileID.key;o===0&&c===0||Math.abs(c)>1||(Math.abs(o)>1&&(Math.abs(o+f)===1?o+=f:Math.abs(o-f)===1&&(o-=f)),t.dem&&d.dem&&(d.dem.backfillBorder(t.dem,o,c),!((a=d.neighboringTiles)===null||a===void 0)&&a[y]&&(d.neighboringTiles[y].backfilled=!0)))}class ga{constructor(){this._tiles={}}handleWrapJump(t){const a={};for(const o in this._tiles){const c=this._tiles[o];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+t),a[c.tileID.key]=c}this._tiles=a}setFeatureState(t,a){for(const o in this._tiles)this._tiles[o].setFeatureState(t,a)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map((a=>a.tileID)).sort(h.au).map((a=>a.key)):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,a){this._tiles[t]=a}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){const a=this.getTileById(t.key);return a?.hasData()?a:null}isIdRenderable(t,a=!1){var o;return(o=this.getTileById(t))===null||o===void 0?void 0:o.isRenderable(a)}getRenderableIds(t=0,a){const o=[];for(const c of this.getAllIds())this.isIdRenderable(c,a)&&o.push(this.getTileById(c));return a?o.sort(((c,f)=>{const y=c.tileID,x=f.tileID,w=new h.P(y.canonical.x,y.canonical.y)._rotate(-t),S=new h.P(x.canonical.x,x.canonical.y)._rotate(-t);return y.overscaledZ-x.overscaledZ||S.y-w.y||S.x-w.x})).map((c=>c.tileID.key)):o.map((c=>c.tileID)).sort(h.au).map((c=>c.key))}}class hi extends h.E{constructor(t,a,o){super(),this.id=t,this.dispatcher=o,this.on("data",(c=>{this._dataHandler(c)})),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((c,f,y,x)=>{const w=new(ys(f.type))(c,f,y,x);if(w.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${w.id}`);return w})(t,a,o,this),this._inViewTiles=new ga,this._outOfViewCache=new h.av(0,(c=>this._unloadTile(c))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new Uo,this._didEmitContent=!1,this._updated=!1}onAdd(t){var a;this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,!((a=this._source)===null||a===void 0)&&a.onAdd&&this._source.onAdd(t)}onRemove(t){var a;for(const o of this._inViewTiles.getAllTiles())o.unloadVectorData();this.clearTiles(),!((a=this._source)===null||a===void 0)&&a.onRemove&&this._source.onRemove(t),this._inViewTiles=new ga}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,a,o){return h._(this,void 0,void 0,(function*(){try{const c=yield this._source.loadTile(t);this._tileLoaded(t,a,o,c)}catch(c){t.state="errored",c.status!==404?this._source.fire(new h.l(h.d(c),{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new h.n("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);
2for(const a of this._inViewTiles.getAllTiles())a.upload(t),a.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var a;return this._inViewTiles.getRenderableIds((a=this.transform)===null||a===void 0?void 0:a.bearingInRadians,t)}hasRenderableParent(t){const a=t.overscaledZ-1;if(a>=this._source.minzoom){const o=this.getLoadedTile(t.scaledTo(a));if(o)return this._inViewTiles.isIdRenderable(o.tileID.key)}return!1}reload(t,a=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(const o of this._inViewTiles.getAllIds()){const c=this._inViewTiles.getTileById(o);a&&!this._source.shouldReloadTile(c,a)||(t?this._reloadTile(o,"expired"):c.state!=="errored"&&this._reloadTile(o,"reloading"))}}}_reloadTile(t,a){return h._(this,void 0,void 0,(function*(){const o=this._inViewTiles.getTileById(t);o&&(o.state!=="loading"&&(o.state=a),yield this._loadTile(o,t,a))}))}_tileLoaded(t,a,o,c){t.timeAdded=je(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),o==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(a,t),c?.unmodified||(this.getSource().type==="raster-dem"&&t.dem&&(function(f,y){var x,w,S;const P=y.getRenderableIds();for(const E of P){if(!(!((x=f.neighboringTiles)===null||x===void 0)&&x[E]))continue;const C=y.getTileById(E);f.neighboringTiles[E].backfilled||be(f,C),!((S=(w=C.neighboringTiles)===null||w===void 0?void 0:w[f.tileID.key])===null||S===void 0)&&S.backfilled||be(C,f)}})(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new h.n("data",{dataType:"source",tile:t,coord:t.tileID})))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,a){const o=this._getLoadedDescendents(a),c=new Set;for(const f of a){const y=o[f.key];if(!y?.length){c.add(f);continue}const x=f.overscaledZ+hi.maxOverzooming,w=y.filter((E=>E.tileID.overscaledZ<=x));if(!w.length){c.add(f);continue}const S=Math.min(...w.map((E=>E.tileID.overscaledZ))),P=w.filter((E=>E.tileID.overscaledZ===S)).map((E=>E.tileID));for(const E of P)t[E.key]=E;this._areDescendentsComplete(P,S,f.overscaledZ)||c.add(f)}return c}_getLoadedDescendents(t){var a;const o={};for(const c of this._inViewTiles.getAllTiles().filter((f=>f.hasData())))for(const f of t)c.tileID.isChildOf(f)&&(o[a=f.key]||(o[a]=[]),o[f.key].push(c));return o}_areDescendentsComplete(t,a,o){return t.length===1&&t[0].isOverscaled()?t[0].overscaledZ===a:Math.pow(4,a-o)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){const a=Math.ceil(t.width/this._source.tileSize)+1,o=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(a*o*(this._maxTileCacheZoomLevels===null?h.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),f=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._outOfViewCache.setMaxSize(f)}handleWrapJump(t){const a=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);this._prevLng=t,a&&(this._inViewTiles.handleWrapJump(a),this._resetTileReloadTimers())}update(t,a){if(!this._sourceLoaded||this._paused)return;let o;this.transform=t,this.terrain=a,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?o=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((w=>new h.a3(w.canonical.z,w.wrap,w.canonical.z,w.canonical.x,w.canonical.y))):(o=ma(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?t.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:a,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(o=o.filter((w=>this._source.hasTile(w))))):o=[],this.usedForTerrain&&(o=this._addTerrainIdealTiles(o));const c=o.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,c&&this.fire(new h.n("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const f=Oi(t,this._source),y=this._updateRetainedTiles(o,f),x=dc(this._source.type);x&&this._rasterFadeDuration>0&&!a&&(function(w,S,P,E,C,z,B){const N=je(),Z=h.at(S);for(const j of S){const G=w.getTileById(j.key);G.fadingDirection!==ir.Departing&&G.fadeOpacity!==0||G.resetFadeLogic(),$u(w,G,P,N,E,C,B)||bs(w,G,P,N,z,B)||pc(G,Z,N,B)||G.resetFadeLogic()}})(this._inViewTiles,o,y,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),x?this._cleanUpRasterTiles(y):this._cleanUpVectorTiles(y)}
2_cleanUpRasterTiles(t){for(const a of this._inViewTiles.getAllIds())t[a]||this._removeTile(a)}_cleanUpVectorTiles(t){for(const a of this._inViewTiles.getAllIds()){const o=this._inViewTiles.getTileById(a);t[a]?o.clearSymbolFadeHold():o.hasSymbolBuckets?o.holdingForSymbolFade()?o.symbolFadeFinished()&&this._removeTile(a):o.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(a)}}_addTerrainIdealTiles(t){const a=[];for(const o of t)if(o.canonical.z>this._source.minzoom){const c=o.scaledTo(o.canonical.z-1);a.push(c);const f=o.scaledTo(Math.max(this._source.minzoom,Math.min(o.canonical.z,5)));a.push(f)}return t.concat(a)}releaseSymbolFadeTiles(){for(const t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,a){var o;const c=new Set;for(const S of t)this._addTile(S).hasData()||c.add(S);const f=t.reduce(((S,P)=>(S[P.key]=P,S)),{}),y=this._retainLoadedChildren(f,c),x={},w=Math.max(a-hi.maxUnderzooming,this._source.minzoom);for(const S of y){let P=this._inViewTiles.getTileById(S.key),E=P?.wasRequested();for(let C=S.overscaledZ-1;C>=w;--C){const z=S.scaledTo(C);if(x[z.key])break;if(x[z.key]=!0,P=this.getTile(z),!P&&E&&(P=this._addTile(z)),P){const B=P.hasData();if((B||!(!((o=this.map)===null||o===void 0)&&o.cancelPendingTileRequestsWhileZooming)||E)&&(f[z.key]=z),E=P.wasRequested(),B)break}}}return f}_addTile(t){let a=this._inViewTiles.getTileById(t.key);if(a)return a;a=this._outOfViewCache.getAndRemove(t),a&&(a.resetFadeLogic(),this._setTileReloadTimer(t.key,a),a.tileID=t,this._state.initializeTileState(a,this.map?this.map.painter:null));const o=a;return a||(a=new Za(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(a,t.key,a.state)),a.uses++,this._inViewTiles.setTile(t.key,a),o||this._source.fire(new h.n("dataloading",{tile:a,coord:a.tileID,dataType:"source"})),a}_setTileReloadTimer(t,a){this._clearTileReloadTimer(t);const o=a.getExpiryTimeout();o&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),o))}_clearTileReloadTimer(t){const a=this._timers[t];a&&(clearTimeout(a),delete this._timers[t])}_resetTileReloadTimers(){for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t of this._inViewTiles.getAllIds()){const a=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,a)}}refreshTiles(t){for(const a of this._inViewTiles.getAllIds()){const o=this._inViewTiles.getTileById(a);(this._inViewTiles.isIdRenderable(a)||o.state=="errored")&&t.some((c=>c.equals(o.tileID.canonical)))&&this._reloadTile(a,"expired")}}_removeTile(t){const a=this._inViewTiles.getTileById(t);a&&(a.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),a.uses>0||(a.hasData()&&a.state!=="reloading"?this._outOfViewCache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))}_dataHandler(t){t.dataType==="source"&&(t.sourceDataType!=="metadata"?t.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,a,o){const c=[],f=this.transform;if(!f)return c;const y=f.getCoveringTilesDetailsProvider().allowWorldCopies(),x=o?f.getCameraQueryGeometry(t):t,w=z=>f.screenPointToMercatorCoordinate(z,this.terrain),S=this.transformBbox(t,w,!y),P=this.transformBbox(x,w,!y),E=this.getIds(),C=h.a8.fromPoints(P);for(const z of E){const B=this._inViewTiles.getTileById(z);if(B.holdingForSymbolFade())continue;const N=y?[B.tileID]:[B.tileID.unwrapTo(-1),B.tileID.unwrapTo(0)],Z=Math.pow(2,f.zoom-B.tileID.overscaledZ),j=a*B.queryPadding*h.a6/B.tileSize/Z;for(const G of N){const X=C.map(($=>G.getTilePoint(new h.a7($.x,$.y))));if(X.expandBy(j),X.intersects(hc)){const $=S.map((H=>G.getTilePoint(H))),U=P.map((H=>G.getTilePoint(H)));c.push({tile:B,tileID:y?G:G.unwrapTo(0),queryGeometry:$,cameraQueryGeometry:U,scale:Z})}}}return c}transformBbox(t,a,o){let c=t.map(a);if(o){const f=h.a8.fromPoints(t);f.shrinkBy(.001*Math.min(f.width(),f.height()));const y=f.map(a);h.a8.fromPoints(c).covers(y)||(c=c.map((x=>x.x>.5?new h.a7(x.x-1,x.y,x.z):x)))}return c}getVisibleCoordinates(t){const a=this.getRenderableIds(t).map((o=>this._inViewTiles.getTileById(o).tileID));return this.transform&&this.transform.populateCache(a),a}hasTransition(){return!!this._source.hasTransition()||dc(this._source.type)&&(function(t,a){if(a<=0)return!1;const o=je();for(const c of t.getAllTiles())if(c.fadeEndTime>=o)return!0;return!1})(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,a,o){t||(t=h.ag),this._state.updateState(t,a,o)}removeFeatureState(t,a,o){t||(t=h.ag),this._state.removeFeatureState(t,a,o)}getFeatureState(t,a){return t||(t=h.ag),this._state.getState(t,a)}
vendor: 1,857 bytes, line 2
2setDependencies(t,a,o){const c=this._inViewTiles.getTileById(t);c&&c.setDependencies(a,o)}reloadTilesForDependencies(t,a){for(const o of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(o).hasDependency(t,a)&&this._reloadTile(o,"reloading");this._outOfViewCache.filter((o=>!o.hasDependency(t,a)))}areTilesLoaded(){for(const t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}}hi.maxUnderzooming=10,hi.maxOverzooming=3;class qo{constructor(t,a){this.reset(t,a)}reset(t,a){this.points=t||[],this._distances=[0];for(let o=1;o<this.points.length;o++)this._distances[o]=this._distances[o-1]+this.points[o].dist(this.points[o-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(a||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=h.al(t,0,1);let a=1,o=this._distances[a];const c=t*this.paddedLength+this.padding;for(;o<c&&a<this._distances.length;)o=this._distances[++a];const f=a-1,y=this._distances[f],x=o-y,w=x>0?(c-y)/x:0;return this.points[f].mult(1-w).add(this.points[a].mult(w))}}function Kr(d,t){let a=!0;return d==="always"||d!=="never"&&t!=="never"||(a=!1),a}class Pe{constructor(t,a,o){const c=this.boxCells=[],f=this.circleCells=[];this.xCellCount=Math.ceil(t/o),this.yCellCount=Math.ceil(a/o);for(let y=0;y<this.xCellCount*this.yCellCount;y++)c.push([]),f.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=a,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/a,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,a,o,c,f){this._forEachCell(a,o,c,f,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(a),this.bboxes.push(o),this.bboxes.push(c),this.bboxes.push(f)}
vendor: 19,699 bytes, line 2
2insertCircle(t,a,o,c){this._forEachCell(a-c,o-c,a+c,o+c,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(a),this.circles.push(o),this.circles.push(c)}_insertBoxCell(t,a,o,c,f,y){this.boxCells[f].push(y)}_insertCircleCell(t,a,o,c,f,y){this.circleCells[f].push(y)}_query(t,a,o,c,f,y,x){if(o<0||t>this.width||c<0||a>this.height)return[];const w=[];if(t<=0&&a<=0&&this.width<=o&&this.height<=c){if(f)return[{key:null,x1:t,y1:a,x2:o,y2:c}];for(let S=0;S<this.boxKeys.length;S++)w.push({key:this.boxKeys[S],x1:this.bboxes[4*S],y1:this.bboxes[4*S+1],x2:this.bboxes[4*S+2],y2:this.bboxes[4*S+3]});for(let S=0;S<this.circleKeys.length;S++){const P=this.circles[3*S],E=this.circles[3*S+1],C=this.circles[3*S+2];w.push({key:this.circleKeys[S],x1:P-C,y1:E-C,x2:P+C,y2:E+C})}}else this._forEachCell(t,a,o,c,this._queryCell,w,{hitTest:f,overlapMode:y,seenUids:{box:{},circle:{}}},x);return w}query(t,a,o,c){return this._query(t,a,o,c,!1,null)}hitTest(t,a,o,c,f,y){return this._query(t,a,o,c,!0,f,y).length>0}hitTestCircle(t,a,o,c,f){const y=t-o,x=t+o,w=a-o,S=a+o;if(x<0||y>this.width||S<0||w>this.height)return!1;const P=[];return this._forEachCell(y,w,x,S,this._queryCellCircle,P,{hitTest:!0,overlapMode:c,circle:{x:t,y:a,radius:o},seenUids:{box:{},circle:{}}},f),P.length>0}_queryCell(t,a,o,c,f,y,x,w){const{seenUids:S,hitTest:P,overlapMode:E}=x,C=this.boxCells[f],z=1e-6;if(C!==null){const N=this.bboxes;for(const Z of C)if(!S.box[Z]){S.box[Z]=!0;const j=4*Z,G=this.boxKeys[Z];if(t<=N[j+2]+z&&a<=N[j+3]+z&&o>=N[j+0]-z&&c>=N[j+1]-z&&(!w||w(G))&&(!P||!Kr(E,G.overlapMode))&&(y.push({key:G,x1:N[j],y1:N[j+1],x2:N[j+2],y2:N[j+3]}),P))return!0}}const B=this.circleCells[f];if(B!==null){const N=this.circles;for(const Z of B)if(!S.circle[Z]){S.circle[Z]=!0;const j=3*Z,G=this.circleKeys[Z];if(this._circleAndRectCollide(N[j],N[j+1],N[j+2],t,a,o,c)&&(!w||w(G))&&(!P||!Kr(E,G.overlapMode))){const X=N[j],$=N[j+1],U=N[j+2];if(y.push({key:G,x1:X-U,y1:$-U,x2:X+U,y2:$+U}),P)return!0}}}return!1}_queryCellCircle(t,a,o,c,f,y,x,w){const{circle:S,seenUids:P,overlapMode:E}=x,C=this.boxCells[f];if(C!==null){const B=this.bboxes;for(const N of C)if(!P.box[N]){P.box[N]=!0;const Z=4*N,j=this.boxKeys[N];if(this._circleAndRectCollide(S.x,S.y,S.radius,B[Z+0],B[Z+1],B[Z+2],B[Z+3])&&(!w||w(j))&&!Kr(E,j.overlapMode))return y.push(!0),!0}}const z=this.circleCells[f];if(z!==null){const B=this.circles;for(const N of z)if(!P.circle[N]){P.circle[N]=!0;const Z=3*N,j=this.circleKeys[N];if(this._circlesCollide(B[Z],B[Z+1],B[Z+2],S.x,S.y,S.radius)&&(!w||w(j))&&!Kr(E,j.overlapMode))return y.push(!0),!0}}}_forEachCell(t,a,o,c,f,y,x,w){const S=this._convertToXCellCoord(t),P=this._convertToYCellCoord(a),E=this._convertToXCellCoord(o),C=this._convertToYCellCoord(c);for(let z=S;z<=E;z++)for(let B=P;B<=C;B++)if(f.call(this,t,a,o,c,this.xCellCount*B+z,y,x,w))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,a,o,c,f,y){const x=c-t,w=f-a,S=o+y;return S*S>x*x+w*w}_circleAndRectCollide(t,a,o,c,f,y,x){const w=(y-c)/2,S=Math.abs(t-(c+w));if(S>w+o)return!1;const P=(x-f)/2,E=Math.abs(a-(f+P));if(E>P+o)return!1;if(S<=w||E<=P)return!0;const C=S-w,z=E-P;return C*C+z*z<=o*o}}function Ze(d,t){const a=1/(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),o=1/(t[8]*t[8]+t[9]*t[9]+t[10]*t[10]),c=t[0]*a,f=t[4]*a,y=t[8]*o,x=t[1]*a,w=t[5]*a,S=t[9]*o,P=t[2]*a,E=t[6]*a,C=t[10]*o;d[0]=c,d[1]=f,d[2]=y,d[4]=x,d[5]=w,d[6]=S,d[8]=P,d[9]=E,d[10]=C;const z=t[12],B=t[13],N=t[14];return d[12]=-c*z-x*B-P*N,d[13]=-f*z-w*B-E*N,d[14]=-y*z-S*B-C*N,d[3]=0,d[7]=0,d[11]=0,d[15]=1,d}const Ye=h.O();function $i(d,t,a){const o=h.O();if(!d){const{vecSouth:E,vecEast:C}=kr(t),z=pt();z[0]=C[0],z[1]=C[1],z[2]=E[0],z[3]=E[1],c=z,(P=(y=(f=z)[0])*(S=f[3])-(w=f[2])*(x=f[1]))&&(c[0]=S*(P=1/P),c[1]=-x*P,c[2]=-w*P,c[3]=y*P),o[0]=z[0],o[1]=z[1],o[4]=z[2],o[5]=z[3]}var c,f,y,x,w,S,P;return h.S(o,o,[1/a,1/a,1]),o}function ws(d,t,a,o){if(d){const c=h.O();if(!t){const{vecSouth:f,vecEast:y}=kr(a);c[0]=y[0],c[1]=y[1],c[4]=f[0],c[5]=f[1]}return h.S(c,c,[o,o,1]),c}return a.pixelsToClipSpaceMatrix}function kr(d){const t=Math.cos(d.rollInRadians),a=Math.sin(d.rollInRadians),o=Math.cos(d.pitchInRadians),c=Math.cos(d.bearingInRadians),f=Math.sin(d.bearingInRadians),y=h.az();y[0]=-c*o*a-f*t,y[1]=-f*o*a+c*t;const x=h.aA(y);x<1e-9?h.aB(y):h.aC(y,y,1/x);const w=h.az();w[0]=c*o*t-f*a,w[1]=f*o*t+c*a;const S=h.aA(w);return S<1e-9?h.aB(w):h.aC(w,w,1/S),{vecEast:w,vecSouth:y}}function $e(d,t,a,o){let c;o?(c=[d,t,o(d,t),1],h.aE(c,c,a)):(c=[d,t,0,1],Ps(c,c,a));const f=c[3];return{point:new h.P(c[0]/f,c[1]/f),signedDistanceFromCamera:f,isOccluded:!1}}function In(d,t){return .5+d/t*.5}function En(d,t){return d.x>=-t[0]&&d.x<=t[0]&&d.y>=-t[1]&&d.y<=t[1]}function Ts(d,t,a,o,c,f,y,x,w,S,P,E,C){const z=a?d.textSizeData:d.iconSizeData,B=h.aw(z,t.transform.zoom),N=[256/t.width*2+1,256/t.height*2+1],Z=a?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;Z.clear();const j=d.lineVertexArray,G=a?d.text.placedSymbolArray:d.icon.placedSymbolArray,X=t.transform.width/t.transform.height;let $=!1;for(let U=0;U<G.length;U++){const H=G.get(U);if(H.hidden||H.writingMode===h.ax.vertical&&!$){ya(H.numGlyphs,Z);continue}$=!1;const q=new h.P(H.anchorX,H.anchorY),Q={getElevation:C,pitchedLabelPlaneMatrix:o,lineVertexArray:j,pitchWithMap:f,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:q,unwrappedTileID:w,width:S,height:P,translation:E},ne=Ha(H.anchorX,H.anchorY,Q);if(!En(ne.point,N)){ya(H.numGlyphs,Z);continue}const se=In(t.transform.cameraToCenterDistance,ne.signedDistanceFromCamera),me=h.ay(z,B,H),pe=f?me*t.transform.getPitchedTextCorrection(H.anchorX,H.anchorY,w)/se:me*se,Ae=Wa({projectionContext:Q,pitchedLabelPlaneMatrixInverse:c,symbol:H,fontSize:pe,flip:!1,keepUpright:y,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:Z,aspectRatio:X,rotateToLine:x});$=Ae.useVertical,(Ae.notEnoughRoom||$||Ae.needsFlipping&&Wa({projectionContext:Q,pitchedLabelPlaneMatrixInverse:c,symbol:H,fontSize:pe,flip:!0,keepUpright:y,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:Z,aspectRatio:X,rotateToLine:x}).notEnoughRoom)&&ya(H.numGlyphs,Z)}a?d.text.dynamicLayoutVertexBuffer.updateData(Z):d.icon.dynamicLayoutVertexBuffer.updateData(Z)}function qa(d,t,a,o,c,f,y,x){const w=f.glyphStartIndex+f.numGlyphs,S=f.lineStartIndex,P=f.lineStartIndex+f.lineLength,E=t.getoffsetX(f.glyphStartIndex),C=t.getoffsetX(w-1),z=fr(d*E,a,o,c,f.segment,S,P,x,y);if(!z)return null;const B=fr(d*C,a,o,c,f.segment,S,P,x,y);return B?x.projectionCache.anyProjectionOccluded?null:{first:z,last:B}:null}function Cn(d,t,a,o){return d===h.ax.horizontal&&Math.abs(a.y-t.y)>Math.abs(a.x-t.x)*o?{useVertical:!0}:(d===h.ax.vertical?t.y<a.y:t.x>a.x)?{needsFlipping:!0}:null}function Wa(d){const{projectionContext:t,pitchedLabelPlaneMatrixInverse:a,symbol:o,fontSize:c,flip:f,keepUpright:y,glyphOffsetArray:x,dynamicLayoutVertexArray:w,aspectRatio:S,rotateToLine:P}=d,E=c/24,C=o.lineOffsetX*E,z=o.lineOffsetY*E;let B;if(o.numGlyphs>1){const N=o.glyphStartIndex+o.numGlyphs,Z=o.lineStartIndex,j=o.lineStartIndex+o.lineLength,G=qa(E,x,C,z,f,o,P,t);if(!G)return{notEnoughRoom:!0};const X=Ss(G.first.point.x,G.first.point.y,t,a),$=Ss(G.last.point.x,G.last.point.y,t,a);if(y&&!f){const U=Cn(o.writingMode,X,$,S);if(U)return U}B=[G.first];for(let U=o.glyphStartIndex+1;U<N-1;U++){const H=fr(E*x.getoffsetX(U),C,z,f,o.segment,Z,j,t,P);if(!H)return{notEnoughRoom:!0};B.push(H)}B.push(G.last)}else{if(y&&!f){const Z=ut(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,j=o.lineStartIndex+o.segment+1,G=new h.P(t.lineVertexArray.getx(j),t.lineVertexArray.gety(j)),X=ut(G.x,G.y,t),$=X.signedDistanceFromCamera>0?X.point:An(t.tileAnchorPoint,G,Z,1,t),U=Ss(Z.x,Z.y,t,a),H=Ss($.x,$.y,t,a),q=Cn(o.writingMode,U,H,S);if(q)return q}const N=fr(E*x.getoffsetX(o.glyphStartIndex),C,z,f,o.segment,o.lineStartIndex,o.lineStartIndex+o.lineLength,t,P);if(!N||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};B=[N]}for(const N of B)h.aD(w,N.point,N.angle);return{}}function An(d,t,a,o,c){const f=d.add(d.sub(t)._unit()),y=ut(f.x,f.y,c).point,x=a.sub(y);return a.add(x._mult(o/x.mag()))}function di(d,t,a){const o=t.projectionCache;if(o.projections[d])return o.projections[d];const c=new h.P(t.lineVertexArray.getx(d),t.lineVertexArray.gety(d)),f=ut(c.x,c.y,t);if(f.signedDistanceFromCamera>0)return o.projections[d]=f.point,o.anyProjectionOccluded||(o.anyProjectionOccluded=f.isOccluded),f.point;const y=d-a.direction;return An(a.distanceFromAnchor===0?t.tileAnchorPoint:new h.P(t.lineVertexArray.getx(y),t.lineVertexArray.gety(y)),c,a.previousVertex,a.absOffsetX-a.distanceFromAnchor+1,t)}function ut(d,t,a){const o=d+a.translation[0],c=t+a.translation[1];let f;return a.pitchWithMap?(f=$e(o,c,a.pitchedLabelPlaneMatrix,a.getElevation),f.isOccluded=!1):(f=a.transform.projectTileCoordinates(o,c,a.unwrappedTileID,a.getElevation),f.point.x=(.5*f.point.x+.5)*a.width,f.point.y=(.5*-f.point.y+.5)*a.height),f}function Ss(d,t,a,o){if(a.pitchWithMap){const c=[d,t,0,1];return h.aE(c,c,o),a.transform.projectTileCoordinates(c[0]/c[3],c[1]/c[3],a.unwrappedTileID,a.getElevation).point}return{x:d/a.width*2-1,y:1-t/a.height*2}}function Ha(d,t,a){return a.transform.projectTileCoordinates(d,t,a.unwrappedTileID,a.getElevation)}function Dn(d,t,a){return d._unit()._perp()._mult(t*a)}function _a(d,t,a,o,c,f,y,x,w){if(x.projectionCache.offsets[d])return x.projectionCache.offsets[d];const S=a.add(t);if(d+w.direction<o||d+w.direction>=c)return x.projectionCache.offsets[d]=S,S;const P=di(d+w.direction,x,w),E=Dn(P.sub(a),y,w.direction),C=a.add(E),z=P.add(E);return x.projectionCache.offsets[d]=h.aF(f,S,C,z)||S,x.projectionCache.offsets[d]}function fr(d,t,a,o,c,f,y,x,w){const S=o?d-t:d+t;let P=S>0?1:-1,E=0;o&&(P*=-1,E=Math.PI),P<0&&(E+=Math.PI);let C,z=P>0?f+c:f+c+1;x.projectionCache.cachedAnchorPoint?C=x.projectionCache.cachedAnchorPoint:(C=ut(x.tileAnchorPoint.x,x.tileAnchorPoint.y,x).point,x.projectionCache.cachedAnchorPoint=C);let B,N,Z=C,j=C,G=0,X=0;const $=Math.abs(S),U=[];let H;for(;G+X<=$;){if(z+=P,z<f||z>=y)return null;G+=X,j=Z,N=B;const ne={absOffsetX:$,direction:P,distanceFromAnchor:G,previousVertex:j};if(Z=di(z,x,ne),a===0)U.push(j),H=Z.sub(j);else{let se;const me=Z.sub(j);se=me.mag()===0?Dn(di(z+P,x,ne).sub(Z),a,P):Dn(me,a,P),N||(N=j.add(se)),B=_a(z,se,Z,f,y,N,a,x,ne),U.push(N),H=B.sub(N)}X=H.mag()}const q=H._mult(($-G)/X)._add(N||j),Q=E+Math.atan2(Z.y-j.y,Z.x-j.x);return U.push(q),{point:q,angle:w?Q:0,path:U}}const fc=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ya(d,t){for(let a=0;a<d;a++){const o=t.length;t.resize(o+4),t.float32.set(fc,3*o)}}function Ps(d,t,a){const o=t[0],c=t[1];return d[0]=a[0]*o+a[4]*c+a[12],d[1]=a[1]*o+a[5]*c+a[13],d[3]=a[3]*o+a[7]*c+a[15],d}const Rt=100;class mc{constructor(t,a=new Pe(t.width+200,t.height+200,25),o=new Pe(t.width+200,t.height+200,25)){this.transform=t,this.grid=a,this.ignoredGrid=o,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Rt,this.screenBottomBoundary=t.height+Rt,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,a,o,c,f,y,x,w,S,P,E,C){const z=this.projectAndGetPerspectiveRatio(t.anchorPointX+w[0],t.anchorPointY+w[1],f,P,C),B=o*z.perspectiveRatio;let N;if(y||x)N=this._projectCollisionBox(t,B,c,f,y,x,w,z,P,E,C);else{const H=z.x+(E?E.x*B:0),q=z.y+(E?E.y*B:0);N={allPointsOccluded:!1,box:[H+t.x1*B,q+t.y1*B,H+t.x2*B,q+t.y2*B]}}const[Z,j,G,X]=N.box,$=y?N.allPointsOccluded:z.isOccluded;let U=$;return U||(U=z.perspectiveRatio<this.perspectiveRatioCutoff),U||(U=!this.isInsideGrid(Z,j,G,X)),U||a!=="always"&&this.grid.hitTest(Z,j,G,X,a,S)?{box:[Z,j,G,X],placeable:!1,offscreen:!1,occluded:$}:{box:[Z,j,G,X],placeable:!0,offscreen:this.isOffscreen(Z,j,G,X),occluded:$}}placeCollisionCircles(t,a,o,c,f,y,x,w,S,P,E,C,z,B){const N=[],Z=new h.P(a.anchorX,a.anchorY),j=this.getPerspectiveRatio(Z.x,Z.y,y,B),G=(S?f*this.transform.getPitchedTextCorrection(a.anchorX,a.anchorY,y)/j:f*j)/h.aJ,X={getElevation:B,pitchedLabelPlaneMatrix:x,lineVertexArray:o,pitchWithMap:S,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:Z,unwrappedTileID:y,width:this.transform.width,height:this.transform.height,translation:z},$=qa(G,c,a.lineOffsetX*G,a.lineOffsetY*G,!1,a,!1,X);let U=!1,H=!1,q=!0;if($){const Q=.5*E*j+C,ne=new h.P(-100,-100),se=new h.P(this.screenRightBoundary,this.screenBottomBoundary),me=new qo,pe=$.first,Ae=$.last;let Te=[];for(let ze=pe.path.length-1;ze>=1;ze--)Te.push(pe.path[ze]);for(let ze=1;ze<Ae.path.length;ze++)Te.push(Ae.path[ze]);const ue=2.5*Q;if(S){const ze=this.projectPathToScreenSpace(Te,X);Te=ze.some((ot=>ot.signedDistanceFromCamera<=0))?[]:ze.map((ot=>ot.point))}let Me=[];if(Te.length>0){const ze=Te[0].clone(),ot=Te[0].clone();for(let jt=1;jt<Te.length;jt++)ze.x=Math.min(ze.x,Te[jt].x),ze.y=Math.min(ze.y,Te[jt].y),ot.x=Math.max(ot.x,Te[jt].x),ot.y=Math.max(ot.y,Te[jt].y);Me=ze.x>=ne.x&&ot.x<=se.x&&ze.y>=ne.y&&ot.y<=se.y?[Te]:ot.x<ne.x||ze.x>se.x||ot.y<ne.y||ze.y>se.y?[]:h.aG([Te],ne.x,ne.y,se.x,se.y)}for(const ze of Me){me.reset(ze,.25*Q);let ot=0;ot=me.length<=.5*Q?1:Math.ceil(me.paddedLength/ue)+1;for(let jt=0;jt<ot;jt++){const mt=jt/Math.max(ot-1,1),$t=me.lerp(mt),Wt=$t.x+Rt,_i=$t.y+Rt;N.push(Wt,_i,Q,0);const kt=Wt-Q,zi=_i-Q,pi=Wt+Q,ai=_i+Q;if(q&&(q=this.isOffscreen(kt,zi,pi,ai)),H||(H=this.isInsideGrid(kt,zi,pi,ai)),t!=="always"&&this.grid.hitTestCircle(Wt,_i,Q,t,P)&&(U=!0,!w))return{circles:[],offscreen:!1,collisionDetected:U}}}}return{circles:!w&&U||!H||j<this.perspectiveRatioCutoff?[]:N,offscreen:q,collisionDetected:U}}projectPathToScreenSpace(t,a){const o=(function(c,f){const y=Ye;return(function(x,w){const S=1/(w[0]*w[5]-w[1]*w[4]);x[0]=w[5]*S,x[1]=-w[1]*S,x[2]=0,x[3]=0,x[4]=-w[4]*S,x[5]=w[0]*S,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=1/w[10],x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1/w[15]})(y,f.pitchedLabelPlaneMatrix),c.map((x=>{const w=$e(x.x,x.y,y,f.getElevation),S=f.transform.projectTileCoordinates(w.point.x,w.point.y,f.unwrappedTileID,f.getElevation);return S.point.x=(.5*S.point.x+.5)*f.width,S.point.y=(.5*-S.point.y+.5)*f.height,S}))})(t,a);return(function(c){let f=0,y=0,x=0,w=0;for(let S=0;S<c.length;S++)c[S].isOccluded?(x=S+1,w=0):(w++,w>y&&(y=w,f=x));return c.slice(f,f+y)})(o)}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const a=[],o=new h.a8;for(const E of t){const C=new h.P(E.x+Rt,E.y+Rt);o.extend(C),a.push(C)}const{minX:c,minY:f,maxX:y,maxY:x}=o,w=this.grid.query(c,f,y,x).concat(this.ignoredGrid.query(c,f,y,x)),S={},P={};for(const E of w){const C=E.key;if(S[C.bucketInstanceId]===void 0&&(S[C.bucketInstanceId]={}),S[C.bucketInstanceId][C.featureIndex])continue;const z=[new h.P(E.x1,E.y1),new h.P(E.x2,E.y1),new h.P(E.x2,E.y2),new h.P(E.x1,E.y2)];h.aH(a,z)&&(S[C.bucketInstanceId][C.featureIndex]=!0,P[C.bucketInstanceId]===void 0&&(P[C.bucketInstanceId]=[]),P[C.bucketInstanceId].push(C.featureIndex))}return P}insertCollisionBox(t,a,o,c,f,y){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:c,featureIndex:f,collisionGroupID:y,overlapMode:a},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,a,o,c,f,y){const x=o?this.ignoredGrid:this.grid,w={bucketInstanceId:c,featureIndex:f,collisionGroupID:y,overlapMode:a};for(let S=0;S<t.length;S+=4)x.insertCircle(w,t[S],t[S+1],t[S+2])}projectAndGetPerspectiveRatio(t,a,o,c,f){if(f){let y;c?(y=[t,a,c(t,a),1],h.aE(y,y,f)):(y=[t,a,0,1],Ps(y,y,f));const x=y[3];return{x:(y[0]/x+1)/2*this.transform.width+Rt,y:(-y[1]/x+1)/2*this.transform.height+Rt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/x*.5,isOccluded:!1,signedDistanceFromCamera:x}}{const y=this.transform.projectTileCoordinates(t,a,o,c);return{x:(y.point.x+1)/2*this.transform.width+Rt,y:(1-y.point.y)/2*this.transform.height+Rt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/y.signedDistanceFromCamera*.5,isOccluded:y.isOccluded,signedDistanceFromCamera:y.signedDistanceFromCamera}}}getPerspectiveRatio(t,a,o,c){const f=this.transform.projectTileCoordinates(t,a,o,c);return .5+this.transform.cameraToCenterDistance/f.signedDistanceFromCamera*.5}isOffscreen(t,a,o,c){return o<Rt||t>=this.screenRightBoundary||c<Rt||a>this.screenBottomBoundary}isInsideGrid(t,a,o,c){return o>=0&&t<this.gridRightBoundary&&c>=0&&a<this.gridBottomBoundary}getViewportMatrix(){const t=h.ap([]);return h.Q(t,t,[-100,-100,0]),t}_projectCollisionBox(t,a,o,c,f,y,x,w,S,P,E){let C=1,z=0,B=0,N=1;const Z=t.anchorPointX+x[0],j=t.anchorPointY+x[1];if(y&&!f){const Te=this.projectAndGetPerspectiveRatio(Z+1,j,c,S,E),ue=Te.x-w.x,Me=Math.atan((Te.y-w.y)/ue)+(ue<0?Math.PI:0),ze=Math.sin(Me),ot=Math.cos(Me);C=ot,z=ze,B=-ze,N=ot}else if(!y&&f){const Te=kr(this.transform);C=Te.vecEast[0],z=Te.vecEast[1],B=Te.vecSouth[0],N=Te.vecSouth[1]}let G=w.x,X=w.y,$=a;f&&(G=Z,X=j,$=Math.pow(2,-(this.transform.zoom-o.overscaledZ)),$*=this.transform.getPitchedTextCorrection(Z,j,c),P||($*=h.al(.5+w.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),P&&(G+=C*P.x*$+B*P.y*$,X+=z*P.x*$+N*P.y*$);const U=t.x1*$,H=t.x2*$,q=(U+H)/2,Q=t.y1*$,ne=t.y2*$,se=(Q+ne)/2,me=[{offsetX:U,offsetY:Q},{offsetX:q,offsetY:Q},{offsetX:H,offsetY:Q},{offsetX:H,offsetY:se},{offsetX:H,offsetY:ne},{offsetX:q,offsetY:ne},{offsetX:U,offsetY:ne},{offsetX:U,offsetY:se}];let pe=[];for(const{offsetX:Te,offsetY:ue}of me)pe.push(new h.P(G+C*Te+B*ue,X+z*Te+N*ue));let Ae=!1;if(f){const Te=pe.map((ue=>this.projectAndGetPerspectiveRatio(ue.x,ue.y,c,S,E)));Ae=Te.some((ue=>!ue.isOccluded)),pe=Te.map((ue=>new h.P(ue.x,ue.y)))}else Ae=!0;return{box:h.aI(pe),allPointsOccluded:!Ae}}}class gc{constructor(t,a,o,c){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?a:-a))):c&&o?1:0,this.placed=o}isHidden(){return this.opacity===0&&!this.placed}}class zn{constructor(t,a,o,c,f){this.text=new gc(t?t.text:null,a,o,f),this.icon=new gc(t?t.icon:null,a,c,f)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class _c{constructor(t,a,o){this.text=t,this.icon=a,this.skipFade=o}}class yc{constructor(t,a,o,c,f){this.bucketInstanceId=t,this.featureIndex=a,this.sourceLayerIndex=o,this.bucketIndex=c,this.tileID=f}}class vc{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const a=++this.maxGroupID;this.collisionGroups[t]={ID:a,predicate:o=>o.collisionGroupID===a}}return this.collisionGroups[t]}}function Ms(d,t,a,o,c){const{horizontalAlign:f,verticalAlign:y}=h.aP(d);return new h.P(-(f-.5)*t+o[0]*c,-(y-.5)*a+o[1]*c)}class Wo{constructor(t,a,o,c,f){this.transform=t.clone(),this.terrain=a,this.collisionIndex=new mc(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new vc(c),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=f,f&&(f.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const a=this.terrain;return a?(o,c)=>a.getElevation(t,o,c):null}getBucketParts(t,a,o,c){const f=o.getBucket(a),y=o.latestFeatureIndex;if(!f||!y||a.id!==f.layerIds[0])return;const x=o.collisionBoxArray,w=f.layers[0].layout,S=f.layers[0].paint,P=Math.pow(2,this.transform.zoom-o.tileID.overscaledZ
2),E=o.tileSize/h.a6,C=o.tileID.toUnwrapped(),z=w.get("text-rotation-alignment")==="map",B=h.aK(o,1,this.transform.zoom),N=h.aL(this.collisionIndex.transform,o,S.get("text-translate"),S.get("text-translate-anchor")),Z=h.aL(this.collisionIndex.transform,o,S.get("icon-translate"),S.get("icon-translate-anchor")),j=$i(z,this.transform,B);this.retainedQueryData[f.bucketInstanceId]=new yc(f.bucketInstanceId,y,f.sourceLayerIndex,f.index,o.tileID);const G={bucket:f,layout:w,translationText:N,translationIcon:Z,unwrappedTileID:C,pitchedLabelPlaneMatrix:j,scale:P,textPixelRatio:E,holdingForFade:o.holdingForSymbolFade(),collisionBoxArray:x,partiallyEvaluatedTextSize:h.aw(f.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(f.sourceID)};if(c)for(const X of f.sortKeyRanges){const{sortKey:$,symbolInstanceStart:U,symbolInstanceEnd:H}=X;t.push({sortKey:$,symbolInstanceStart:U,symbolInstanceEnd:H,parameters:G})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:f.symbolInstances.length,parameters:G})}attemptAnchorPlacement(t,a,o,c,f,y,x,w,S,P,E,C,z,B,N,Z,j,G,X,$){var U,H,q;const Q=h.aM[t.textAnchor],ne=[t.textOffset0,t.textOffset1],se=Ms(Q,o,c,ne,f),me=this.collisionIndex.placeCollisionBox(a,C,w,S,P,x,y,Z,E.predicate,X,se,$);if((!G||this.collisionIndex.placeCollisionBox(G,C,w,S,P,x,y,j,E.predicate,X,se,$).placeable)&&me.placeable){let pe;if(!((U=this.prevPlacement)===null||U===void 0)&&U.variableOffsets[z.crossTileID]&&(!((q=(H=this.prevPlacement)===null||H===void 0?void 0:H.placements[z.crossTileID])===null||q===void 0)&&q.text)&&(pe=this.prevPlacement.variableOffsets[z.crossTileID].anchor),z.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[z.crossTileID]={textOffset:ne,width:o,height:c,anchor:Q,textBoxScale:f,prevAnchor:pe},this.markUsedJustification(B,Q,z,N),B.allowVerticalPlacement&&(this.markUsedOrientation(B,N,z),this.placedOrientations[z.crossTileID]=N),{shift:se,placedGlyphBoxes:me}}}placeLayerBucketPart(t,a,o){const{bucket:c,layout:f,translationText:y,translationIcon:x,unwrappedTileID:w,pitchedLabelPlaneMatrix:S,textPixelRatio:P,holdingForFade:E,collisionBoxArray:C,partiallyEvaluatedTextSize:z,collisionGroup:B}=t.parameters,N=f.get("text-optional"),Z=f.get("icon-optional"),j=h.aN(f,"text-overlap","text-allow-overlap"),G=j==="always",X=h.aN(f,"icon-overlap","icon-allow-overlap"),$=X==="always",U=f.get("text-rotation-alignment")==="map",H=f.get("text-pitch-alignment")==="map",q=f.get("icon-text-fit")!=="none",Q=f.get("symbol-z-order")==="viewport-y",ne=G&&($||!c.hasIconData()||Z),se=$&&(G||!c.hasTextData()||N);!c.collisionArrays&&C&&c.deserializeCollisionBoxes(C);const me=this.retainedQueryData[c.bucketInstanceId].tileID,pe=this._getTerrainElevationFunc(me),Ae=this.transform.getFastPathSimpleProjectionMatrix(me),Te=(ue,Me,ze)=>{var ot,jt;if(a[ue.crossTileID])return;if(E)return void(this.placements[ue.crossTileID]=new _c(!1,!1,!1));let mt=!1,$t=!1,Wt=!0,_i=null,kt={box:null,placeable:!1,offscreen:null,occluded:!1},zi={placeable:!1},pi=null,ai=null,yi=null,aa=0,na=0,sa=0;Me.textFeatureIndex?aa=Me.textFeatureIndex:ue.useRuntimeCollisionCircles&&(aa=ue.featureIndex),Me.verticalTextFeatureIndex&&(na=Me.verticalTextFeatureIndex);const vi=Me.textBox;if(vi){const Er=Ct=>{let St=h.ax.horizontal;if(c.allowVerticalPlacement&&!Ct&&this.prevPlacement){const Ht=this.prevPlacement.placedOrientations[ue.crossTileID];Ht&&(this.placedOrientations[ue.crossTileID]=Ht,St=Ht,this.markUsedOrientation(c,St,ue))}return St},Cr=(Ct,St)=>{if(c.allowVerticalPlacement&&ue.numVerticalGlyphVertices>0&&Me.verticalTextBox){for(const Ht of c.writingModes)if(Ht===h.ax.vertical?(kt=St(),zi=kt):kt=Ct(),kt?.placeable)break}else kt=Ct()},Yi=ue.textAnchorOffsetStartIndex,sr=ue.textAnchorOffsetEndIndex;if(sr===Yi){const Ct=(St,Ht)=>{const At=this.collisionIndex.placeCollisionBox(St,j,P,me,w,H,U,y,B.predicate,pe,void 0,Ae);return At?.placeable&&(this.markUsedOrientation(c,Ht,ue),this.placedOrientations[ue.crossTileID]=Ht),At};Cr((()=>Ct(vi,h.ax.horizontal)),(()=>{const St=Me.verticalTextBox;return c.allowVerticalPlacement&&ue.numVerticalGlyphVertices>0&&St?Ct(St,h.ax.vertical):{box:null,offscreen:null}})),Er(kt?.placeable)}else{let Ct=h.aM[(jt=(ot=this.prevPlacement)===null||ot===void 0?void 0:ot.variableOffsets[ue.crossTileID])===null||jt===void 0?void 0:jt.anchor];const St=(At,Fa,uo)=>{const Ur=At.x2-At.x1,jl=At.y2-At.y1,fu=ue.textBoxScale,Ul=q&&X==="never"?Fa:null;let la=null,ca=j==="never"?1:2,ua="never";Ct&&ca++;for(let Zl=0;Zl<ca;Zl++){for(let Gl=Yi;Gl<sr;Gl++){const ho=c.textAnchorOffsets.get(Gl);if(Ct&&ho.textAnchor!==Ct)continue;const po=this.attemptAnchorPlacement(ho,At,Ur,jl,fu,U,H,P,me,w,B,ua,ue,c,uo,y,x,Ul,pe);if(po&&(la=po.placedGlyphBoxes,la?.placeable))return mt=!0,_i=po.shift,la}Ct?Ct=null:ua=j}return o&&!la&&(la={box:this.collisionIndex.placeCollisionBox(vi,"always",P,me,w,H,U,y,B.predicate,pe,void 0,Ae).box,offscreen:!1,placeable:!1,occluded:!1}),la};Cr((()=>St(vi,Me.iconBox,h.ax.horizontal)),(()=>{const At=Me.verticalTextBox;return c.allowVerticalPlacement&&!kt?.placeable&&ue.numVerticalGlyphVertices>0&&At?St(At,Me.verticalIconBox,h.ax.vertical):{box:null,occluded:!0,offscreen:null}})),kt&&(mt=kt.placeable,Wt=kt.offscreen);const Ht=Er(kt?.placeable);if(!mt&&this.prevPlacement){const At=this.prevPlacement.variableOffsets[ue.crossTileID];At&&(this.variableOffsets[ue.crossTileID]=At,this.markUsedJustification(c,At.anchor,ue,Ht))}}}if(pi=kt,mt=pi?.placeable,Wt=pi?.offscreen,ue.useRuntimeCollisionCircles&&ue.centerJustifiedTextSymbolIndex>=0){const Er=c.text.placedSymbolArray.get(ue.centerJustifiedTextSymbolIndex),Cr=h.ay(c.textSizeData,z,Er),Yi=f.get("text-padding");ai=this.collisionIndex.placeCollisionCircles(j,Er,c.lineVertexArray,c.glyphOffsetArray,Cr,w,S,o,H,B.predicate,ue.collisionCircleDiameter,Yi,y,pe),ai.circles.length&&ai.collisionDetected&&!o&&h.w("Collisions detected, but collision boxes are not shown"),mt=G||ai.
2circles.length>0&&!ai.collisionDetected,Wt&&(Wt=ai.offscreen)}if(Me.iconFeatureIndex&&(sa=Me.iconFeatureIndex),Me.iconBox){const Er=Cr=>this.collisionIndex.placeCollisionBox(Cr,X,P,me,w,H,U,x,B.predicate,pe,q&&_i?_i:void 0,Ae);zi&&zi.placeable&&Me.verticalIconBox?(yi=Er(Me.verticalIconBox),$t=yi.placeable):(yi=Er(Me.iconBox),$t=yi.placeable),Wt&&(Wt=yi.offscreen)}const jr=N||ue.numHorizontalGlyphVertices===0&&ue.numVerticalGlyphVertices===0,oa=Z||ue.numIconVertices===0;jr||oa?oa?jr||$t&&($t=mt):mt=$t&&mt:$t=mt=$t&&mt;const co=$t&&yi.placeable;if(mt&&pi.placeable&&this.collisionIndex.insertCollisionBox(pi.box,j,f.get("text-ignore-placement"),c.bucketInstanceId,zi&&zi.placeable&&na?na:aa,B.ID),co&&this.collisionIndex.insertCollisionBox(yi.box,X,f.get("icon-ignore-placement"),c.bucketInstanceId,sa,B.ID),ai&&mt&&this.collisionIndex.insertCollisionCircles(ai.circles,j,f.get("text-ignore-placement"),c.bucketInstanceId,aa,B.ID),o&&this.storeCollisionData(c.bucketInstanceId,ze,Me,pi,yi,ai),ue.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(c.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[ue.crossTileID]=new _c((mt||ne)&&!pi?.occluded,($t||se)&&!yi?.occluded,Wt||c.justReloaded),a[ue.crossTileID]=!0};if(Q){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const ue=c.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let Me=ue.length-1;Me>=0;--Me){const ze=ue[Me];Te(c.symbolInstances.get(ze),c.collisionArrays[ze],ze)}}else for(let ue=t.symbolInstanceStart;ue<t.symbolInstanceEnd;ue++)Te(c.symbolInstances.get(ue),c.collisionArrays[ue],ue);c.justReloaded=!1}storeCollisionData(t,a,o,c,f,y){if(o.textBox||o.iconBox){let x,w;this.collisionBoxArrays.has(t)?x=this.collisionBoxArrays.get(t):(x=new Map,this.collisionBoxArrays.set(t,x)),x.has(a)?w=x.get(a):(w={text:null,icon:null},x.set(a,w)),o.textBox&&(w.text=c.box),o.iconBox&&(w.icon=f.box)}if(y){let x=this.collisionCircleArrays[t];x===void 0&&(x=this.collisionCircleArrays[t]=[]);for(let w=0;w<y.circles.length;w+=4)x.push(y.circles[w+0]-Rt),x.push(y.circles[w+1]-Rt),x.push(y.circles[w+2]),x.push(y.collisionDetected?1:0)}}markUsedJustification(t,a,o,c){let f;f=c===h.ax.vertical?o.verticalPlacedTextSymbolIndex:{left:o.leftJustifiedTextSymbolIndex,center:o.centerJustifiedTextSymbolIndex,right:o.rightJustifiedTextSymbolIndex}[h.aO(a)];const y=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex,o.verticalPlacedTextSymbolIndex];for(const x of y)x>=0&&(t.text.placedSymbolArray.get(x).crossTileID=f>=0&&x!==f?0:o.crossTileID)}markUsedOrientation(t,a,o){const c=a===h.ax.horizontal||a===h.ax.horizontalOnly?a:0,f=a===h.ax.vertical?a:0,y=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex];for(const x of y)t.text.placedSymbolArray.get(x).placedOrientation=c;o.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).placedOrientation=f)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const a=this.prevPlacement;let o=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;const c=a?a.symbolFadeChange(t):1,f=a?a.opacities:{},y=a?a.variableOffsets:{},x=a?a.placedOrientations:{};for(const w in this.placements){const S=this.placements[w],P=f[w];P?(this.opacities[w]=new zn(P,c,S.text,S.icon),o||(o=S.text!==P.text.placed),o||(o=S.icon!==P.icon.placed)):(this.opacities[w]=new zn(null,c,S.text,S.icon,S.skipFade),o||(o=S.text||S.icon))}for(const w in f){const S=f[w];if(!this.opacities[w]){const P=new zn(S,c,!1,!1);P.isHidden()||(this.opacities[w]=P,o||(o=S.text.placed),o||(o=S.icon.placed))}}for(const w in y)this.variableOffsets[w]||!this.opacities[w]||this.opacities[w].isHidden()||(this.variableOffsets[w]=y[w]);for(const w in x)this.placedOrientations[w]||!this.opacities[w]||this.opacities[w].isHidden()||(this.placedOrientations[w]=x[w]);if(a&&a.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");o?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=a?a.lastPlacementChangeTime:t)}updateLayerOpacities(t,a){const o={};for(const c of a){const f=c.getBucket(t);f&&c.latestFeatureIndex&&t.id===f.layerIds[0]&&this.updateBucketOpacities(f,c.tileID,o,c.collisionBoxArray)}}updateBucketOpacities(t,a,o,c){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();
vendor: 7,628 bytes, line 2
2const f=t.layers[0],y=f.layout,x=new zn(null,0,!1,!1,!0),w=y.get("text-allow-overlap"),S=y.get("icon-allow-overlap"),P=f._unevaluatedLayout.hasValue("text-variable-anchor")||f._unevaluatedLayout.hasValue("text-variable-anchor-offset"),E=y.get("text-rotation-alignment")==="map",C=y.get("text-pitch-alignment")==="map",z=y.get("icon-text-fit")!=="none",B=new zn(null,0,w&&(S||!t.hasIconData()||y.get("icon-optional")),S&&(w||!t.hasTextData()||y.get("text-optional")),!0);!t.collisionArrays&&c&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(c);const N=(j,G,X)=>{for(let $=0;$<G/4;$++)j.opacityVertexArray.emplaceBack(X);j.hasVisibleVertices||(j.hasVisibleVertices=X!==kn)},Z=this.collisionBoxArrays.get(t.bucketInstanceId);for(let j=0;j<t.symbolInstances.length;j++){const G=t.symbolInstances.get(j),{numHorizontalGlyphVertices:X,numVerticalGlyphVertices:$,crossTileID:U}=G;let H=this.opacities[U];o[U]?H=x:H||(H=B,this.opacities[U]=H),o[U]=!0;const q=G.numIconVertices>0,Q=this.placedOrientations[G.crossTileID],ne=Q===h.ax.vertical,se=Q===h.ax.horizontal||Q===h.ax.horizontalOnly;if(X>0||$>0){const pe=Ko(H.text);N(t.text,X,ne?kn:pe),N(t.text,$,se?kn:pe);const Ae=H.text.isHidden(),Te=[G.rightJustifiedTextSymbolIndex,G.centerJustifiedTextSymbolIndex,G.leftJustifiedTextSymbolIndex];for(const ze of Te)ze>=0&&(t.text.placedSymbolArray.get(ze).hidden=Ae||ne?1:0);G.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(G.verticalPlacedTextSymbolIndex).hidden=Ae||se?1:0);const ue=this.variableOffsets[G.crossTileID];ue&&this.markUsedJustification(t,ue.anchor,G,Q);const Me=this.placedOrientations[G.crossTileID];Me&&(this.markUsedJustification(t,"left",G,Me),this.markUsedOrientation(t,Me,G))}if(q){const pe=Ko(H.icon),Ae=!(z&&G.verticalPlacedIconSymbolIndex&&ne);G.placedIconSymbolIndex>=0&&(N(t.icon,G.numIconVertices,Ae?pe:kn),t.icon.placedSymbolArray.get(G.placedIconSymbolIndex).hidden=H.icon.isHidden()),G.verticalPlacedIconSymbolIndex>=0&&(N(t.icon,G.numVerticalIconVertices,Ae?kn:pe),t.icon.placedSymbolArray.get(G.verticalPlacedIconSymbolIndex).hidden=H.icon.isHidden())}const me=Z?.has(j)?Z.get(j):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const pe=t.collisionArrays[j];if(pe){let Ae=new h.P(0,0);if(pe.textBox||pe.verticalTextBox){let Te=!0;if(P){const ue=this.variableOffsets[U];ue?(Ae=Ms(ue.anchor,ue.width,ue.height,ue.textOffset,ue.textBoxScale),E&&Ae._rotate(C?-this.transform.bearingInRadians:this.transform.bearingInRadians)):Te=!1}if(pe.textBox||pe.verticalTextBox){let ue;pe.textBox&&(ue=ne),pe.verticalTextBox&&(ue=se),Ho(t.textCollisionBox.collisionVertexArray,H.text.placed,!Te||ue,me.text,Ae.x,Ae.y)}}if(pe.iconBox||pe.verticalIconBox){const Te=!!(!se&&pe.verticalIconBox);let ue;pe.iconBox&&(ue=Te),pe.verticalIconBox&&(ue=!Te),Ho(t.iconCollisionBox.collisionVertexArray,H.icon.placed,ue,me.icon,z?Ae.x:0,z?Ae.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,a){const o=this.zoomAtLastRecencyCheck===a?1-this.zoomAdjustment(a):1;return this.zoomAtLastRecencyCheck=a,this.commitTime+this.fadeDuration*o>t}setStale(){this.stale=!0}}function Ho(d,t,a,o,c,f){o&&o.length!==0||(o=[0,0,0,0]);const y=o[0]-Rt,x=o[1]-Rt,w=o[2]-Rt,S=o[3]-Rt;d.emplaceBack(t?1:0,a?1:0,c||0,f||0,y,x),d.emplaceBack(t?1:0,a?1:0,c||0,f||0,w,x),d.emplaceBack(t?1:0,a?1:0,c||0,f||0,w,S),d.emplaceBack(t?1:0,a?1:0,c||0,f||0,y,S)}const Xo=Math.pow(2,25),Yo=Math.pow(2,24),qu=Math.pow(2,17),Rn=Math.pow(2,16),Is=Math.pow(2,9),xc=Math.pow(2,8),Xa=Math.pow(2,1);function Ko(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const t=d.placed?1:0,a=Math.floor(127*d.opacity);return a*Xo+t*Yo+a*qu+t*Rn+a*Is+t*xc+a*Xa+t}const kn=0;class Jr{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,a,o,c,f){const y=this._bucketParts;for(;this._currentTileIndex<t.length;)if(a.getBucketParts(y,c,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,f())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,y.sort(((x,w)=>x.sortKey-w.sortKey)));this._currentPartIndex<y.length;)if(a.placeLayerBucketPart(y[this._currentPartIndex],this._seenCrossTileIDs,o),this._currentPartIndex++,f())return!0;return!1}}class Ya{constructor(t,a,o,c,f,y,x,w){this.placement=new Wo(t,a,y,x,w),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=c,this._showCollisionBoxes=f,this._done=!1}isDone(){return this._done}continuePlacement(t,a,o){const c=je(),f=()=>!this._forceFullPlacement&&je()-c>2;for(;this._currentPlacementIndex>=0;){const y=a[t[this._currentPlacementIndex]],x=this.placement.collisionIndex.transform.zoom;if(h.aQ(y)&&y.layout&&(!y.minzoom||y.minzoom<=x)&&(!y.maxzoom||y.maxzoom>x)){if(this._inProgressLayer||(this._inProgressLayer=new Jr(y)),this._inProgressLayer.continuePlacement(o[y.source],this.placement,this._showCollisionBoxes,y,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const He=512/h.a6/2;class Jo{constructor(t,a,o){this.tileID=t,this.bucketInstanceId=o,this._symbolsByKey={};const c=new Map;for(let f=0;f<a.length;f++){const y=a.get(f),x=y.key,w=c.get(x);w?w.push(y):c.set(x,[y])}for(const[f,y]of c){const x={positions:y.map((w=>({x:Math.floor(w.anchorX*He),y:Math.floor(w.anchorY*He)}))),crossTileIDs:y.map((w=>w.crossTileID))};if(x.positions.length>128){const w=new h.aR(x.positions.length,16,Uint16Array);for(const{x:S,y:P}of x.positions)w.add(S,P);w.finish(),delete x.positions,x.index=w}this._symbolsByKey[f]=x}}getScaledCoordinates(t,a){const{x:o,y:c,z:f}=this.tileID.canonical,{x:y,y:x,z:w}=a.canonical,S=He/Math.pow(2,w-f),P=(x*h.a6+t.anchorY)*S,E=c*h.a6*He;return{x:Math.floor((y*h.a6+t.anchorX)*S-o*h.a6*He),y:Math.floor(P-E)}}
2findMatches(t,a,o){const c=this.tileID.canonical.z<a.canonical.z?1:Math.pow(2,this.tileID.canonical.z-a.canonical.z);for(let f=0;f<t.length;f++){const y=t.get(f);if(y.crossTileID)continue;const x=this._symbolsByKey[y.key];if(!x)continue;const w=this.getScaledCoordinates(y,a);if(x.index){const S=x.index.range(w.x-c,w.y-c,w.x+c,w.y+c).sort();for(const P of S){const E=x.crossTileIDs[P];if(!o[E]){o[E]=!0,y.crossTileID=E;break}}}else if(x.positions)for(let S=0;S<x.positions.length;S++){const P=x.positions[S],E=x.crossTileIDs[S];if(Math.abs(P.x-w.x)<=c&&Math.abs(P.y-w.y)<=c&&!o[E]){o[E]=!0,y.crossTileID=E;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:t})=>t))}}class Wu{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Qo{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const a=Math.round((t-this.lng)/360);if(a!==0)for(const o in this.indexes){const c=this.indexes[o],f={};for(const y in c){const x=c[y];x.tileID=x.tileID.unwrapTo(x.tileID.wrap+a),f[x.tileID.key]=x}this.indexes[o]=f}this.lng=t}addBucket(t,a,o){var c,f,y;if(!((c=this.indexes[t.overscaledZ])===null||c===void 0)&&c[t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let w=0;w<a.symbolInstances.length;w++)a.symbolInstances.get(w).crossTileID=0;(f=this.usedCrossTileIDs)[y=t.overscaledZ]||(f[y]={});const x=this.usedCrossTileIDs[t.overscaledZ];for(const w in this.indexes){const S=this.indexes[w];if(Number(w)>t.overscaledZ)for(const P in S){const E=S[P];E.tileID.isChildOf(t)&&E.findMatches(a.symbolInstances,t,x)}else{const P=S[t.scaledTo(Number(w)).key];P&&P.findMatches(a.symbolInstances,t,x)}}for(let w=0;w<a.symbolInstances.length;w++){const S=a.symbolInstances.get(w);S.crossTileID||(S.crossTileID=o.generate(),x[S.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Jo(t,a.symbolInstances,a.bucketInstanceId),!0}removeBucketCrossTileIDs(t,a){for(const o of a.getCrossTileIDsLists())for(const c of o)delete this.usedCrossTileIDs[t][c]}removeStaleBuckets(t){let a=!1;for(const o in this.indexes){const c=this.indexes[o];for(const f in c)t[c[f].bucketInstanceId]||(this.removeBucketCrossTileIDs(o,c[f]),delete c[f],a=!0)}return a}}class Ni{constructor(){this.layerIndexes={},this.crossTileIDs=new Wu,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,a,o){let c=this.layerIndexes[t.id];c===void 0&&(c=this.layerIndexes[t.id]=new Qo);let f=!1;const y={};c.handleWrapJump(o);for(const x of a){const w=x.getBucket(t);t.id===w?.layerIds[0]&&(w.bucketInstanceId||(this.maxBucketInstanceId+=1,w.bucketInstanceId=this.maxBucketInstanceId),c.addBucket(x.tileID,w,this.crossTileIDs)&&(f=!0),y[w.bucketInstanceId]=!0)}return c.removeStaleBuckets(y)&&(f=!0),f}pruneUnusedLayers(t){const a={};for(const o of t)a[o]=!0;for(const o in this.layerIndexes)a[o]||delete this.layerIndexes[o]}}var gi="void main() {fragColor=vec4(1.0);}";const It={prelude:Ne(`#ifdef GL_ES
3precision mediump float;
4#else
5#if !defined(lowp)
6#define lowp
7#endif
8#if !defined(mediump)
9#define mediump
10#endif
11#if !defined(highp)
12#define highp
13#endif
14#endif
15out highp vec4 fragColor;`,`#ifdef GL_ES
16precision highp float;
17#else
18#if !defined(lowp)
19#define lowp
20#endif
21#if !defined(mediump)
22#define mediump
23#endif
24#if !defined(highp)
25#define highp
26#endif
27#endif
28vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
29);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);
29return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+      c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+    c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+    c
30);}
31#ifdef TERRAIN3D
32uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
33#endif
34const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
35#ifdef TERRAIN3D
36highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
37#else
38return 1.0;
39#endif
40}float calculate_visibility(vec4 pos) {
41#ifdef TERRAIN3D
42vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
43#else
44return 1.0;
45#endif
46}float ele(vec2 pos) {
47#ifdef TERRAIN3D
48vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
49#else
50return 0.0;
51#endif
52}float get_elevation(vec2 pos) {
53#ifdef TERRAIN3D
54#ifdef GLOBE
55if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
56#endif
57vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
58#else
59return 0.0;
60#endif
61}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:Ne("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:Ne("",`#define GLOBE_RADIUS 6371008.8
62uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos
63);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); 
64if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len
65);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:Ne(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
66#ifdef OVERDRAW_INSPECTOR
67fragColor=vec4(1.0);
68#endif
69}`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Ne(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;
69uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;
70#ifdef OVERDRAW_INSPECTOR
71fragColor=vec4(1.0);
72#endif
73}`,"uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Ne(`in vec3 v_data;in float v_visibility;
74#pragma mapbox: define highp vec4 color
75#pragma mapbox: define mediump float radius
76#pragma mapbox: define lowp float blur
77#pragma mapbox: define lowp float opacity
78#pragma mapbox: define highp vec4 stroke_color
79#pragma mapbox: define mediump float stroke_width
80#pragma mapbox: define lowp float stroke_opacity
81void main() {
82#pragma mapbox: initialize highp vec4 color
83#pragma mapbox: initialize mediump float radius
84#pragma mapbox: initialize lowp float blur
85#pragma mapbox: initialize lowp float opacity
86#pragma mapbox: initialize highp vec4 stroke_color
87#pragma mapbox: initialize mediump float stroke_width
88#pragma mapbox: initialize lowp float stroke_opacity
89vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}
90#ifdef OVERDRAW_INSPECTOR
91fragColor=vec4(1.0);
92#endif
93}`,`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;
94#pragma mapbox: define highp vec4 color
95#pragma mapbox: define mediump float radius
96#pragma mapbox: define lowp float blur
97#pragma mapbox: define lowp float opacity
98#pragma mapbox: define highp vec4 stroke_color
99#pragma mapbox: define mediump float stroke_width
100#pragma mapbox: define lowp float stroke_opacity
101void main(void) {
102#pragma mapbox: initialize highp vec4 color
103#pragma mapbox: initialize mediump float radius
104#pragma mapbox: initialize lowp float blur
105#pragma mapbox: initialize lowp float opacity
106#pragma mapbox: initialize highp vec4 stroke_color
107#pragma mapbox: initialize mediump float stroke_width
108#pragma mapbox: initialize lowp float stroke_opacity
109vec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {
110#ifdef GLOBE
111vec3 center_vector=projectToSphere(circle_center);
112#endif
113float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {
114#ifdef GLOBE
115vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
116#else
117vec4 projected_center=projectTileWithElevation(circle_center,ele);
118#endif
119corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}
120#ifdef GLOBE
121vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
122#else
123gl_Position=projectTileWithElevation(corner_position,ele);
124#endif
125} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Ne(gi,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Ne(`uniform highp float u_intensity;in vec2 v_extrude;
126#pragma mapbox: define highp float weight
127#define GAUSS_COEF 0.3989422804014327
128void main() {
129#pragma mapbox: initialize highp float weight
130float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);
131#ifdef OVERDRAW_INSPECTOR
132fragColor=vec4(1.0);
133#endif
134}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;
135#pragma mapbox: define highp float weight
136#pragma mapbox: define mediump float radius
137const highp float ZERO=1.0/255.0/16.0;
138#define GAUSS_COEF 0.3989422804014327
139void main(void) {
140#pragma mapbox: initialize highp float weight
141#pragma mapbox: initialize mediump float radius
142vec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);
143#ifdef GLOBE
144vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);
145#else
146gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
147#endif
148}`),heatmapTexture:Ne(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;
149#ifdef OVERDRAW_INSPECTOR
150fragColor=vec4(0.0);
151#endif
152}`,"uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Ne("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ne("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:Ne(`#ifdef GL_ES
153precision highp float;
154#endif
155uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else
156{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));
157#ifdef OVERDRAW_INSPECTOR
158fragColor=vec4(1.0);
159#endif
160}`,"uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:Ne("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:Ne(gi,`in vec2 a_pos;void main() {
161#ifdef GLOBE
162gl_Position=projectTileFor3D(a_pos,0.0);
163#else
164gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
165#endif
166}`),fill:Ne(`#pragma mapbox: define highp vec4 color
167#pragma mapbox: define lowp float opacity
168void main() {
169#pragma mapbox: initialize highp vec4 color
170#pragma mapbox: initialize lowp float opacity
171fragColor=color*opacity;
172#ifdef OVERDRAW_INSPECTOR
173fragColor=vec4(1.0);
174#endif
175}`,`uniform vec2 u_fill_translate;in vec2 a_pos;
176#pragma mapbox: define highp vec4 color
177#pragma mapbox: define lowp float opacity
178void main() {
179#pragma mapbox: initialize highp vec4 color
180#pragma mapbox: initialize lowp float opacity
181gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:Ne(`in vec2 v_pos;
182#ifdef GLOBE
183in float v_depth;
184#endif
185#pragma mapbox: define highp vec4 outline_color
186#pragma mapbox: define lowp float opacity
187void main() {
188#pragma mapbox: initialize highp vec4 outline_color
189#pragma mapbox: initialize lowp float opacity
190float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
191#ifdef GLOBE
192if (v_depth > 1.0) {discard;}
193#endif
194#ifdef OVERDRAW_INSPECTOR
195fragColor=vec4(1.0);
196#endif
197}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;
198#ifdef GLOBE
199out float v_depth;
200#endif
201#pragma mapbox: define highp vec4 outline_color
202#pragma mapbox: define lowp float opacity
203void main() {
204#pragma mapbox: initialize highp vec4 outline_color
205#pragma mapbox: initialize lowp float opacity
206gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
207#ifdef GLOBE
208v_depth=gl_Position.z/gl_Position.w;
209#endif
210}`),fillOutlinePattern:Ne(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;
211#ifdef GLOBE
212in float v_depth;
213#endif
214#pragma mapbox: define lowp float opacity
215#pragma mapbox: define lowp vec4 pattern_from
216#pragma mapbox: define lowp vec4 pattern_to
217void main() {
218#pragma mapbox: initialize lowp float opacity
219#pragma mapbox: initialize mediump vec4 pattern_from
220#pragma mapbox: initialize mediump vec4 pattern_to
221vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;
222#ifdef GLOBE
223if (v_depth > 1.0) {discard;}
224#endif
225#ifdef OVERDRAW_INSPECTOR
226fragColor=vec4(1.0);
227#endif
228}`,`uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;
229#ifdef GLOBE
230out float v_depth;
231#endif
232#pragma mapbox: define lowp float opacity
233#pragma mapbox: define lowp vec4 pattern_from
234#pragma mapbox: define lowp vec4 pattern_to
235#pragma mapbox: define lowp float pixel_ratio_from
236#pragma mapbox: define lowp float pixel_ratio_to
237void main() {
238#pragma mapbox: initialize lowp float opacity
239#pragma mapbox: initialize mediump vec4 pattern_from
240#pragma mapbox: initialize mediump vec4 pattern_to
241#pragma mapbox: initialize lowp float pixel_ratio_from
242#pragma mapbox: initialize lowp float pixel_ratio_to
243vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
244#ifdef GLOBE
245v_depth=gl_Position.z/gl_Position.w;
246#endif
247}`),fillPattern:Ne(`#ifdef GL_ES
248precision highp float;
249#endif
250uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
251#pragma mapbox: define lowp float opacity
252#pragma mapbox: define lowp vec4 pattern_from
253#pragma mapbox: define lowp vec4 pattern_to
254void main() {
255#pragma mapbox: initialize lowp float opacity
256#pragma mapbox: initialize mediump vec4 pattern_from
257#pragma mapbox: initialize mediump vec4 pattern_to
258vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;
259#ifdef OVERDRAW_INSPECTOR
260fragColor=vec4(1.0);
261#endif
262}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;
263#pragma mapbox: define lowp float opacity
264#pragma mapbox: define lowp vec4 pattern_from
265#pragma mapbox: define lowp vec4 pattern_to
266#pragma mapbox: define lowp float pixel_ratio_from
267#pragma mapbox: define lowp float pixel_ratio_to
268void main() {
269#pragma mapbox: initialize lowp float opacity
270#pragma mapbox: initialize mediump vec4 pattern_from
271#pragma mapbox: initialize mediump vec4 pattern_to
272#pragma mapbox: initialize lowp float pixel_ratio_from
273#pragma mapbox: initialize lowp float pixel_ratio_to
274vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_siz
274e_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Ne(`in vec4 v_color;void main() {fragColor=v_color;
275#ifdef OVERDRAW_INSPECTOR
276fragColor=vec4(1.0);
277#endif
278}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;
279#ifdef TERRAIN3D
280in vec2 a_centroid;
281#endif
282out vec4 v_color;
283#pragma mapbox: define highp float base
284#pragma mapbox: define highp float height
285#pragma mapbox: define highp vec4 color
286void main() {
287#pragma mapbox: initialize highp float base
288#pragma mapbox: initialize highp float height
289#pragma mapbox: initialize highp vec4 color
290vec3 normal=a_normal_ed.xyz;
291#ifdef TERRAIN3D
292float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
293#else
294float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
295#endif
296base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
297#ifdef GLOBE
298vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
299#else
300gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
301#endif
302float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);
303#ifdef GLOBE
304mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
305#endif
306directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Ne(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;
307#pragma mapbox: define lowp float base
308#pragma mapbox: define lowp float height
309#pragma mapbox: define lowp vec4 pattern_from
310#pragma mapbox: define lowp vec4 pattern_to
311#pragma mapbox: define lowp float pixel_ratio_from
312#pragma mapbox: define lowp float pixel_ratio_to
313void main() {
314#pragma mapbox: initialize lowp float base
315#pragma mapbox: initialize lowp float height
316#pragma mapbox: initialize mediump vec4 pattern_from
317#pragma mapbox: initialize mediump vec4 pattern_to
318#pragma mapbox: initialize lowp float pixel_ratio_from
319#pragma mapbox: initialize lowp float pixel_ratio_to
320vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;
321#ifdef OVERDRAW_INSPECTOR
322fragColor=vec4(1.0);
323#endif
324}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;
325#ifdef TERRAIN3D
326in vec2 a_centroid;
327#endif
328#ifdef GLOBE
329out vec3 v_sphere_pos;
330#endif
331out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
332#pragma mapbox: define lowp float base
333#pragma mapbox: define lowp float height
334#pragma mapbox: define lowp vec4 pattern_from
335#pragma mapbox: define lowp vec4 pattern_to
336#pragma mapbox: define lowp float pixel_ratio_from
337#pragma mapbox: define lowp float pixel_ratio_to
338void main() {
339#pragma mapbox: initialize lowp float base
340#pragma mapbox: initialize lowp float height
341#pragma mapbox: initialize mediump vec4 pattern_from
342#pragma mapbox: initialize mediump vec4 pattern_to
343#pragma mapbox: initialize lowp float pixel_ratio_from
344#pragma mapbox: initialize lowp float pixel_ratio_to
345vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
346#ifdef TERRAIN3D
347float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
348#else
349float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
350#endif
351base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
352#ifdef GLOBE
353vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
354#else
355gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
356#endif
357vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
358? a_pos
359: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Ne(`#ifdef GL_ES
360precision highp float;
361#endif
362uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/p
362ow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);
363#ifdef OVERDRAW_INSPECTOR
364fragColor=vec4(1.0);
365#endif
366}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Ne(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];
367#define PI 3.141592653589793
368#define STANDARD 0
369#define COMBINED 1
370#define IGOR 2
371#define MULTIDIRECTIONAL 3
372#define BASIC 4
373float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else
374{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else
375{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}
376#ifdef OVERDRAW_INSPECTOR
377fragColor=vec4(1.0);
378#endif
379}`,"uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:Ne(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
380#ifdef GLOBE
381in float v_depth;
382#endif
383#pragma mapbox: define highp vec4 color
384#pragma mapbox: define lowp float blur
385#pragma mapbox: define lowp float opacity
386void main() {
387#pragma mapbox: initialize highp vec4 color
388#pragma mapbox: initialize lowp float blur
389#pragma mapbox: initialize lowp float opacity
390float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);
391#ifdef GLOBE
392if (v_depth > 1.0) {discard;}
393#endif
394#ifdef OVERDRAW_INSPECTOR
395fragColor=vec4(1.0);
396#endif
397}`,`
398#define scale 0.015873016
399in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;
400#ifdef GLOBE
401out float v_depth;
402#endif
403#pragma mapbox: define highp vec4 color
404#pragma mapbox: define lowp float blur
405#pragma mapbox: define lowp float opacity
406#pragma mapbox: define mediump float gapwidth
407#pragma mapbox: define lowp float offset
408#pragma mapbox: define mediump float width
409void main() {
410#pragma mapbox: initialize highp vec4 color
411#pragma mapbox: initialize lowp float blur
412#pragma mapbox: initialize lowp float opacity
413#pragma mapbox: initialize mediump float gapwidth
414#pragma mapbox: initialize lowp float offset
415#pragma mapbox: initialize mediump float width
416float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
416float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
417#ifdef GLOBE
418v_depth=gl_Position.z/gl_Position.w;
419#endif
420#ifdef TERRAIN3D
421v_gamma_scale=1.0;
422#else
423float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
424#endif
425v_width2=vec2(outset,inset);}`),lineGradient:Ne(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;
426#ifdef GLOBE
427in float v_depth;
428#endif
429#pragma mapbox: define lowp float blur
430#pragma mapbox: define lowp float opacity
431void main() {
432#pragma mapbox: initialize lowp float blur
433#pragma mapbox: initialize lowp float opacity
434float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);
435#ifdef GLOBE
436if (v_depth > 1.0) {discard;}
437#endif
438#ifdef OVERDRAW_INSPECTOR
439fragColor=vec4(1.0);
440#endif
441}`,`
442#define scale 0.015873016
443in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;
444#ifdef GLOBE
445out float v_depth;
446#endif
447#pragma mapbox: define lowp float blur
448#pragma mapbox: define lowp float opacity
449#pragma mapbox: define mediump float gapwidth
450#pragma mapbox: define lowp float offset
451#pragma mapbox: define mediump float width
452void main() {
453#pragma mapbox: initialize lowp float blur
454#pragma mapbox: initialize lowp float opacity
455#pragma mapbox: initialize mediump float gapwidth
456#pragma mapbox: initialize lowp float offset
457#pragma mapbox: initialize mediump float width
458float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
459#ifdef GLOBE
460v_depth=gl_Position.z/gl_Position.w;
461#endif
462#ifdef TERRAIN3D
463v_gamma_scale=1.0;
464#else
465float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
466#endif
467v_width2=vec2(outset,inset);}`),linePattern:Ne(`#ifdef GL_ES
468precision highp float;
469#endif
470uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;
471#ifdef GLOBE
472in float v_depth;
473#endif
474#pragma mapbox: define lowp vec4 pattern_from
475#pragma mapbox: define lowp vec4 pattern_to
476#pragma mapbox: define lowp float pixel_ratio_from
477#pragma mapbox: define lowp float pixel_ratio_to
478#pragma mapbox: define lowp float blur
479#pragma mapbox: define lowp float opacity
480void main() {
481#pragma mapbox: initialize mediump vec4 pattern_from
482#pragma mapbox: initialize mediump vec4 pattern_to
483#pragma mapbox: initialize lowp float pixel_ratio_from
484#pragma mapbox: initialize lowp float pixel_ratio_to
485#pragma mapbox: initialize lowp float blur
486#pragma mapbox: initialize lowp float opacity
487vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;
488#ifdef GLOBE
489if (v_depth > 1.0) {discard;}
490#endif
491#ifdef OVERDRAW_INSPECTOR
492fragColor=vec4(1.0);
493#endif
494}`,`
495#define scale 0.015873016
496#define LINE_DISTANCE_SCALE 2.0
497in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;
498#ifdef GLOBE
499out float v_depth;
500#endif
501#pragma mapbox: define lowp float blur
502#pragma mapbox: define lowp float opacity
503#pragma mapbox: define lowp float offset
504#pragma mapbox: define mediump float gapwidth
505#pragma mapbox: define mediump float width
506#pragma mapbox: define lowp float floorwidth
507#pragma mapbox: define lowp vec4 pattern_from
508#pragma mapbox: define lowp vec4 pattern_to
509#pragma mapbox: define lowp float pixel_ratio_from
510#pragma mapbox: define lowp float pixel_ratio_to
511void main() {
512#pragma mapbox: initialize lowp float blur
513#pragma mapbox: initialize lowp float opacity
514#pragma mapbox: initialize lowp float offset
515#pragma mapbox: initialize mediump float gapwidth
516#pragma mapbox: initialize mediump float width
517#pragma mapbox: initialize lowp float floorwidth
518#pragma mapbox: initialize mediump vec4 pattern_from
519#pragma mapbox: initialize mediump vec4 pattern_to
520#pragma mapbox: initialize lowp float pixel_ratio_from
521#pragma mapbox: initialize lowp float pixel_ratio_to
522float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
522float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
523#ifdef GLOBE
524v_depth=gl_Position.z/gl_Position.w;
525#endif
526#ifdef TERRAIN3D
527v_gamma_scale=1.0;
528#else
529float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
530#endif
531v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ne(`uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;
532#ifdef GLOBE
533in float v_depth;
534#endif
535#pragma mapbox: define highp vec4 color
536#pragma mapbox: define lowp float blur
537#pragma mapbox: define lowp float opacity
538#pragma mapbox: define mediump float width
539#pragma mapbox: define lowp float floorwidth
540#pragma mapbox: define mediump vec4 dasharray_from
541#pragma mapbox: define mediump vec4 dasharray_to
542void main() {
543#pragma mapbox: initialize highp vec4 color
544#pragma mapbox: initialize lowp float blur
545#pragma mapbox: initialize lowp float opacity
546#pragma mapbox: initialize mediump float width
547#pragma mapbox: initialize lowp float floorwidth
548#pragma mapbox: initialize mediump vec4 dasharray_from
549#pragma mapbox: initialize mediump vec4 dasharray_to
550float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
550float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);
551#ifdef GLOBE
552if (v_depth > 1.0) {discard;}
553#endif
554#ifdef OVERDRAW_INSPECTOR
555fragColor=vec4(1.0);
556#endif
557}`,`
558#define scale 0.015873016
559#define LINE_DISTANCE_SCALE 2.0
560in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;
561#ifdef GLOBE
562out float v_depth;
563#endif
564#pragma mapbox: define highp vec4 color
565#pragma mapbox: define lowp float blur
566#pragma mapbox: define lowp float opacity
567#pragma mapbox: define mediump float gapwidth
568#pragma mapbox: define lowp float offset
569#pragma mapbox: define mediump float width
570#pragma mapbox: define lowp float floorwidth
571#pragma mapbox: define mediump vec4 dasharray_from
572#pragma mapbox: define mediump vec4 dasharray_to
573void main() {
574#pragma mapbox: initialize highp vec4 color
575#pragma mapbox: initialize lowp float blur
576#pragma mapbox: initialize lowp float opacity
577#pragma mapbox: initialize mediump float gapwidth
578#pragma mapbox: initialize lowp float offset
579#pragma mapbox: initialize mediump float width
580#pragma mapbox: initialize lowp float floorwidth
581#pragma mapbox: initialize mediump vec4 dasharray_from
582#pragma mapbox: initialize mediump vec4 dasharray_to
583float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
584#ifdef GLOBE
585v_depth=gl_Position.z/gl_Position.w;
586#endif
587#ifdef TERRAIN3D
588v_gamma_scale=1.0;
589#else
590float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
591#endif
592float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:Ne(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;
593#ifdef GLOBE
594in float v_depth;
595#endif
596#pragma mapbox: define lowp float blur
597#pragma mapbox: define lowp float opacity
598#pragma mapbox: define mediump float width
599#pragma mapbox: define lowp float floorwidth
600#pragma mapbox: define mediump vec4 dasharray_from
601#pragma mapbox: define mediump vec4 dasharray_to
602void main() {
603#pragma mapbox: initialize lowp float blur
604#pragma mapbox: initialize lowp float opacity
605#pragma mapbox: initialize mediump float width
606#pragma mapbox: initialize lowp float floorwidth
607#pragma mapbox: initialize mediump vec4 dasharray_from
608#pragma mapbox: initialize mediump vec4 dasharray_to
609float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
609float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);
610#ifdef GLOBE
611if (v_depth > 1.0) {discard;}
612#endif
613#ifdef OVERDRAW_INSPECTOR
614fragColor=vec4(1.0);
615#endif
616}`,`
617#define scale 0.015873016
618#define LINE_DISTANCE_SCALE 2.0
619in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;
620#ifdef GLOBE
621out float v_depth;
622#endif
623#pragma mapbox: define lowp float blur
624#pragma mapbox: define lowp float opacity
625#pragma mapbox: define mediump float gapwidth
626#pragma mapbox: define lowp float offset
627#pragma mapbox: define mediump float width
628#pragma mapbox: define lowp float floorwidth
629#pragma mapbox: define mediump vec4 dasharray_from
630#pragma mapbox: define mediump vec4 dasharray_to
631void main() {
632#pragma mapbox: initialize lowp float blur
633#pragma mapbox: initialize lowp float opacity
634#pragma mapbox: initialize mediump float gapwidth
635#pragma mapbox: initialize lowp float offset
636#pragma mapbox: initialize mediump float width
637#pragma mapbox: initialize lowp float floorwidth
638#pragma mapbox: initialize mediump vec4 dasharray_from
639#pragma mapbox: initialize mediump vec4 dasharray_to
640float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
641#ifdef GLOBE
642v_depth=gl_Position.z/gl_Position.w;
643#endif
644#ifdef TERRAIN3D
645v_gamma_scale=1.0;
646#else
647float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
648#endif
649float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),raster:Ne(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
650#ifdef OVERDRAW_INSPECTOR
651fragColor=vec4(1.0);
652#endif
653}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;
654#ifdef GLOBE
655if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}
656#endif
657v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:Ne(`uniform sampler2D u_texture;in vec2 v_tex;in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity;
658#ifdef OVERDRAW_INSPECTOR
659fragColor=vec4(1.0);
660#endif
661}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_total_opacity;
662#pragma mapbox: define lowp float opacity
663void main() {
664#pragma mapbox: initialize lowp float opacity
665vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
666camera_to_anchor_distance/u_camera_to_center_distance :
667u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
668#ifdef GLOBE
669if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
670#endif
671vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}`),symbolSDF:Ne(`#define SDF_PX 8.0
672uniform bool u_is_halo;uniform bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;
673#pragma mapbox: define highp vec4 fill_color
674#pragma mapbox: define highp vec4 halo_color
675#pragma mapbox: define lowp float halo_width
676#pragma mapbox: define lowp float halo_blur
677void main() {
678#pragma mapbox: initialize highp vec4 fill_color
679#pragma mapbox: initialize highp vec4 halo_color
680#pragma mapbox: initialize lowp float halo_width
681#pragma mapbox: initialize lowp float halo_blur
682float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;}
683#ifdef OVERDRAW_INSPECTOR
684fragColor=vec4(1.0);
685#endif
686}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;
687#pragma mapbox: define highp vec4 fill_color
688#pragma mapbox: define highp vec4 halo_color
689#pragma mapbox: define lowp float opacity
690#pragma mapbox: define lowp float halo_width
691#pragma mapbox: define lowp float halo_blur
692void main() {
693#pragma mapbox: initialize highp vec4 fill_color
694#pragma mapbox: initialize highp vec4 halo_color
695#pragma mapbox: initialize lowp float opacity
696#pragma mapbox: initialize lowp float halo_width
697#pragma mapbox: initialize lowp float halo_blur
698vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy/16.0;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
699camera_to_anchor_distance/u_camera_to_center_distance :
700u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
701#ifdef GLOBE
702if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
703#endif
704vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}`),symbolTextAndIcon:Ne(`#define SDF_PX 8.0
705#define SDF 1.0
706#define ICON 0.0
707uniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;
708#pragma mapbox: define highp vec4 fill_color
709#pragma mapbox: define highp vec4 halo_color
710#pragma mapbox: define lowp float halo_width
711#pragma mapbox: define lowp float halo_blur
712void main() {
713#pragma mapbox: initialize highp vec4 fill_color
714#pragma mapbox: initialize highp vec4 halo_color
715#pragma mapbox: initialize lowp float halo_width
716#pragma mapbox: initialize lowp float halo_blur
717float total_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;
717fragColor=texture(u_texture_icon,tex_icon)*total_opacity;
718#ifdef OVERDRAW_INSPECTOR
719fragColor=vec4(1.0);
720#endif
721return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;}
722#ifdef OVERDRAW_INSPECTOR
723fragColor=vec4(1.0);
724#endif
725}`,`in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;
726#pragma mapbox: define highp vec4 fill_color
727#pragma mapbox: define highp vec4 halo_color
728#pragma mapbox: define lowp float opacity
729#pragma mapbox: define lowp float halo_width
730#pragma mapbox: define lowp float halo_blur
731void main() {
732#pragma mapbox: initialize highp vec4 fill_color
733#pragma mapbox: initialize highp vec4 halo_color
734#pragma mapbox: initialize lowp float opacity
735#pragma mapbox: initialize lowp float halo_width
736#pragma mapbox: initialize lowp float halo_blur
737vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
738camera_to_anchor_distance/u_camera_to_center_distance :
739u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
740#ifdef GLOBE
741if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
742#endif
743vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,total_opacity,is_sdf);}`),terrain:Ne("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && u_fog_ground_blend_opacity > 0.0 && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
743float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Ne("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Ne("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:Ne("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:Ne(`#ifdef GL_ES
744precision highp float;
745#endif
746in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758
747);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:Ne("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};
vendor: 80,280 bytes, lines 747-796
747function Ne(d,t){const a=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o=t.match(/in ([\w]+) ([\w]+)/g),c=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=f?f.concat(c):c,x={};return{fragmentSource:d=d.replace(a,((w,S,P,E,C)=>(x[C]=!0,S==="define"?`
748#ifndef HAS_UNIFORM_u_${C}
749in ${P} ${E} ${C};
750#else
751uniform ${P} ${E} u_${C};
752#endif
753`:`
754#ifdef HAS_UNIFORM_u_${C}
755    ${P} ${E} ${C} = u_${C};
756#endif
757`))),vertexSource:t=t.replace(a,((w,S,P,E,C)=>{const z=E==="float"?"vec2":"vec4",B=C.match(/color/)?"color":z;return x[C]?S==="define"?`
758#ifndef HAS_UNIFORM_u_${C}
759uniform lowp float u_${C}_t;
760in ${P} ${z} a_${C};
761out ${P} ${E} ${C};
762#else
763uniform ${P} ${E} u_${C};
764#endif
765`:B==="vec4"?`
766#ifndef HAS_UNIFORM_u_${C}
767    ${C} = a_${C};
768#else
769    ${P} ${E} ${C} = u_${C};
770#endif
771`:`
772#ifndef HAS_UNIFORM_u_${C}
773    ${C} = unpack_mix_${B}(a_${C}, u_${C}_t);
774#else
775    ${P} ${E} ${C} = u_${C};
776#endif
777`:S==="define"?`
778#ifndef HAS_UNIFORM_u_${C}
779uniform lowp float u_${C}_t;
780in ${P} ${z} a_${C};
781#else
782uniform ${P} ${E} u_${C};
783#endif
784`:B==="vec4"?`
785#ifndef HAS_UNIFORM_u_${C}
786    ${P} ${E} ${C} = a_${C};
787#else
788    ${P} ${E} ${C} = u_${C};
789#endif
790`:`
791#ifndef HAS_UNIFORM_u_${C}
792    ${P} ${E} ${C} = unpack_mix_${B}(a_${C}, u_${C}_t);
793#else
794    ${P} ${E} ${C} = u_${C};
795#endif
796`})),staticAttributes:o,staticUniforms:y}}class _t{constructor(t,a,o){this.vertexBuffer=t,this.indexBuffer=a,this.segments=o}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var Qr=h.aS([{name:"a_pos",type:"Int16",components:2}]);const Ci="#define PROJECTION_MERCATOR",qi="mercator";class Ai{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return qi}get shaderDefine(){return Ci}get shaderPreludeCode(){return It.projectionMercator}get vertexShaderPreludeCode(){return It.projectionMercator.vertexSource}get subdivisionGranularity(){return h.aT.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,a,o,c,f){if(this._cachedMesh)return this._cachedMesh;const y=new h.aU;y.emplaceBack(0,0),y.emplaceBack(h.a6,0),y.emplaceBack(0,h.a6),y.emplaceBack(h.a6,h.a6);const x=t.createVertexBuffer(y,Qr.members),w=h.aV.simpleSegment(0,0,4,2),S=new h.aW;S.emplaceBack(1,0,2),S.emplaceBack(1,2,3);const P=t.createIndexBuffer(S);return this._cachedMesh=new _t(x,P,w),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class Ka{constructor(t=0,a=0,o=0,c=0){if(isNaN(t)||t<0||isNaN(a)||a<0||isNaN(o)||o<0||isNaN(c)||c<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=a,this.left=o,this.right=c}interpolate(t,a,o){return a.top!=null&&t.top!=null&&(this.top=h.H.number(t.top,a.top,o)),a.bottom!=null&&t.bottom!=null&&(this.bottom=h.H.number(t.bottom,a.bottom,o)),a.left!=null&&t.left!=null&&(this.left=h.H.number(t.left,a.left,o)),a.right!=null&&t.right!=null&&(this.right=h.H.number(t.right,a.right,o)),this}getCenter(t,a){const o=h.al((this.left+t-this.right)/2,0,t),c=h.al((this.top+a-this.bottom)/2,0,a);return new h.P(o,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Ka(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function ea(d,t){if(!d.renderWorldCopies||d.lngRange)return;const a=t.lng-d.center.lng;t.lng+=a>180?-360:a<-180?360:0}function Nt(d){return Math.max(0,Math.floor(d))}class va{constructor(t,a){var o;this.applyConstrain=(c,f)=>this._constrainOverride!==null?this._constrainOverride(c,f):this._callbacks.defaultConstrain(c,f),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=a?.renderWorldCopies===void 0||!!a?.renderWorldCopies,this._minZoom=a?.minZoom||0,this._maxZoom=a?.maxZoom||22,this._minPitch=a?.minPitch==null?0:a?.minPitch,this._maxPitch=a?.maxPitch==null?60:a?.maxPitch,this._constrainOverride=(o=a?.constrainOverride)!==null&&o!==void 0?o:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new h.W(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Nt(this._zoom),this._scale=h.ao(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Ka,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,a,o){this._constrainOverride=t.constrainOverride,this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=Nt(this._zoom),this._scale=h.ao(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new Ka(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!o&&t.autoCalculateNearFarZ,a&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){this._minZoom!==t&&(this._minZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(t){this._minPitch!==t&&(this._minPitch=t,this.setPitch(Math.max(this.pitch,t)))}get maxPitch(){return this._maxPitch}setMaxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.setPitch(Math.min(this.pitch,t)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){t===void 0&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new h.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){const a=h.X(t,-180,180)*Math.PI/180;var o,c,f,y,x,w,S,P,E;this._bearingInRadians!==a&&(this._unmodified=!1,this._bearingInRadians=a,this._calcMatrices(),this._rotationMatrix=pt(),o=this._rotationMatrix,f=-this._bearingInRadians,y=(c=this._rotationMatrix)[0],x=c[1],w=c[2],S=c[3],P=Math.sin(f),E=Math.cos(f),o[0]=y*E+w*P,o[1]=x*E+S*P,o[2]=y*-P+w*E,o[3]=x*-P+S*E)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){const a=h.al(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==a&&(this._unmodified=!1,this._pitchInRadians=a,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){const a=t/180*Math.PI;this._rollInRadians!==a&&(this._unmodified=!1,this._rollInRadians=a,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return h.aX(this._fovInRadians)}setFov(t){t=h.al(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=h.an(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){const a=this.applyConstrain(this._center,t).zoom;this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this._tileZoom=Math.max(0,Math.floor(a)),this._scale=h.ao(a),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,a){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=a,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,a,o){this._unmodified=!1,this._edgeInsets.interpolate(t,a,o),this.constrainInternal(),this._calcMatrices()}resize(t,a,o=!0){this._width=t,this._height=a,o&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){var t,a;return((t=this._latRange)===null||t===void 0?void 0:t.length)!==2||((a=this._lngRange)===null||a===void 0?void 0:a.length)!==2?null:new Fe([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-h.am,h.am])}getCameraQueryGeometry(t,a){if(a.length===1)return[a[0],t];{const{minX:o,minY:c,maxX:f,maxY:y}=h.a8.fromPoints(a).extend(t);return[new h.P(o,c),new h.P(f,c),new h.P(f,y),new h.P(o,y),new h.P(o,c)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:a,zoom:o}=this.applyConstrain(this.center,this.zoom);this.setCenter(a),this.setZoom(o),this._unmodified=t,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=h.ap(new Float64Array(16));h.S(t,t,[this._width/2,-this._height/2,1]),h.Q(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=h.ap(new Float64Array(16)),h.S(t,t,[1,-1,1]),h.Q(t,t,[-1,-1,0]),h.S(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,a,o,c){const f=o!==void 0?o:this.bearing,y=c=c!==void 0?c:this.pitch,{distanceToCenter:x,clampedElevation:w}=this._distanceToCenterFromAltElevationPitch(a,this.elevation,y),{x:S,y:P}=xs(y,f),E=h.a7.fromLngLat(t,a);let C,z,B=h.aY(1,E.y),N=0;do{if(N+=1,N>10)break;z=x/B,C=new h.a7(E.x+S*z,E.y+P*z),B=1/C.meterInMercatorCoordinateUnits()}while(Math.abs(x-z*B)>1e-12);return{center:C.toLngLat(),elevation:w,zoom:h.ar(this.height/2/Math.tan(this.fovInRadians/2)/z/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;const a=1/this.worldSize,o=h.aq(1,this.center.lat)*this.worldSize,c=h.a7.fromLngLat(this.center,this.elevation),f=c.x/a,y=c.y/a,x=c.z/a,w=this.pitch,S=this.bearing,{x:P,y:E,z:C}=xs(w,S),z=this.cameraToCenterDistance,B=f+z*-P,N=y+z*-E,Z=x+z*C,{distanceToCenter:j,clampedElevation:G}=this._distanceToCenterFromAltElevationPitch(Z/o,t,w),X=j*o,$=new h.a7((B+P*X)*a,(N+E*X)*a,0).toLngLat(),U=h.aq(1,$.lat),H=h.ar(this.height/2/Math.tan(this.fovInRadians/2)/j/U/this.tileSize);this._elevation=G,this._center=$,this.setZoom(H)}_distanceToCenterFromAltElevationPitch(t,a,o){const c=-Math.cos(h.an(o)),f=t-a;let y,x=a;return c*f>=0||Math.abs(c)<.1?(y=1e4,x=t+y*c):y=-f/c,{distanceToCenter:y,clampedElevation:x}}getCameraPoint(){const t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new h.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const t=h.aq(1,this.center.lat)*this.worldSize;return $a(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];const a=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/a,t.canonical.y/a,1/a/h.a6,1/a/h.a6]}}class Sr{constructor(t,a){this.min=t,this.max=a,this.center=h.aZ([],h.a_([],this.min,this.max),.5)}quadrant(t){const a=[t%2==0,t<2],o=h.a$(this.min),c=h.a$(this.max);for(let f=0;f<a.length;f++)o[f]=a[f]?this.min[f]:this.center[f],c[f]=a[f]?this.center[f]:this.max[f];return c[2]=this.max[2],new Sr(o,c)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let a=!0;for(const o of t.planes){const c=this.intersectsPlane(o);if(c===0)return 0;c===1&&(a=!1)}return a?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let a=t[3],o=t[3];for(let c=0;c<3;c++)t[c]>0?(a+=t[c]*this.min[c],o+=t[c]*this.max[c]):(o+=t[c]*this.min[c],a+=t[c]*this.max[c]);return a>=0?2:o<0?0:1}}class Es{distanceToTile2d(t,a,o,c){const f=c,y=f.distanceX([t,a]),x=f.distanceY([t,a]);return Math.hypot(y,x)}getWrap(t,a,o){return o}getTileBoundingVolume(t,a,o,c){var f,y;let x=0,w=0;if(c?.terrain){const P=new h.a3(t.z,a,t.z,t.x,t.y),E=c.terrain.getMinMaxElevation(P);x=(f=E.minElevation)!==null&&f!==void 0?f:Math.min(0,o),w=(y=E.maxElevation)!==null&&y!==void 0?y:Math.max(0,o)}const S=1<<t.z;return new Sr([a+t.x/S,t.y/S,x],[a+(t.x+1)/S,(t.y+1)/S,w])}allowVariableZoom(t,a){const o=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,c=h.al(78.5-o/2,0,60);return!!a.terrain||t.pitch>c}allowWorldCopies(){return!0}prepareNextFrame(){}}class Vi{constructor(t,a,o){this.points=t,this.planes=a,this.aabb=o}static fromInvProjectionMatrix(t,a=1,o=0,c,f){const y=f?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],x=Math.pow(2,o),w=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((C=>(function(z,B,N,Z){const j=h.aE([],z,B),G=1/j[3]/N*Z;return h.b4(j,j,[G,G,1/j[3],G])})(C,t,a,x)));c&&(function(C,z,B,N){const Z=N?4:0,j=N?0:4;let G=0;const X=[],$=[];for(let q=0;q<4;q++){const Q=h.b0([],C[q+j],C[q+Z]),ne=h.b5(Q);h.aZ(Q,Q,1/ne),X.push(ne),$.push(Q)}for(let q=0;q<4;q++){const Q=h.b6(C[q+Z],$[q],B);G=Q!==null&&Q>=0?Math.max(G,Q):Math.max(G,X[q])}const U=(function(q,Q){const ne=h.b0([],q[Q[0]],q[Q[1]]),se=h.b0([],q[Q[2]],q[Q[1]]),me=[0,0,0,0];return h.b1(me,h.b2([],ne,se)),me[3]=-h.b3(me,q[Q[0]]),me})(C,z),H=(function(q,Q){const ne=h.b7(q),se=h.b8([],q,1/ne),me=h.b0([],Q,h.aZ([],se,h.b3(Q,se))),pe=h.b7(me);if(pe>0){const Ae=Math.sqrt(1-se[3]*se[3]),Te=h.aZ([],se,-se[3]),ue=h.a_([],Te,h.aZ([],me,Ae/pe));return h.b9(Q,ue)}return null})(B,U);if(H!==null){const q=H/h.b3($[0],U);G=Math.min(G,q)}for(let q=0;q<4;q++){const Q=Math.min(G,X[q]);C[q+j]=[C[q+Z][0]+$[q][0]*Q,C[q+Z][1]+$[q][1]*Q,C[q+Z][2]+$[q][2]*Q,1]}})(w,y[0],c,f);const S=y.map((C=>{const z=h.b0([],w[C[0]],w[C[1]]),B=h.b0([],w[C[2]],w[C[1]]),N=h.b1([],h.b2([],z,B)),Z=-h.b3(N,w[C[1]]);return N.concat(Z)})),P=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],E=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const C of w)for(let z=0;z<3;z++)P[z]=Math.min(P[z],C[z]),E[z]=Math.max(E[z],C[z]);return new Vi(w,S,new Sr(P,E))}}class xa{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,a,o){this._helper.interpolatePadding(t,a,o)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a,o=!0){this._helper.resize(t,a,o)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t,a){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(a,o)=>{o=h.al(+o,this.minZoom,this.maxZoom);const c={center:new h.W(a.lng,a.lat),zoom:o};let f=this._helper._lngRange;if(!this._helper._renderWorldCopies&&f===null){const $=179.9999999999;f=[-$,$]}const y=this.tileSize*h.ao(c.zoom);let x=0,w=y,S=0,P=y,E=0,C=0;const{x:z,y:B}=this.size;if(this._helper._latRange){const $=this._helper._latRange;x=h.Y($[1])*y,w=h.Y($[0])*y,w-x<B&&(E=B/(w-x))}f&&(S=h.X(h.Z(f[0])*y,0,y),P=h.X(h.Z(f[1])*y,0,y),P<S&&(P+=y),P-S<z&&(C=z/(P-S)));const{x:N,y:Z}=pr(y,a);let j,G;const X=Math.max(C||0,E||0);if(X){const $=new h.P(C?(P+S)/2:N,E?(w+x)/2:Z);return c.center=Ga(y,$).wrap(),c.zoom+=h.ar(X),c}if(this._helper._latRange){const $=B/2;Z-$<x&&(G=x+$),Z+$>w&&(G=w-$)}if(f){const $=(S+P)/2;let U=N;this._helper._renderWorldCopies&&(U=h.X(N,$-y/2,$+y/2));const H=z/2;U-H<S&&(j=S+H),U+H>P&&(j=P-H)}if(j!==void 0||G!==void 0){const $=new h.P(j??N,G??Z);c.center=Ga(y,$).wrap()}return c},this.applyConstrain=(a,o)=>this._helper.applyConstrain(a,o),this._helper=new va({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(a,o)=>this.defaultConstrain(a,o)},t),this._coveringTilesDetailsProvider=new Es}clone(){const t=new xa;return t.apply(this,!1),t}apply(t,a,o){this._helper.apply(t,a,o)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){const a=[new h.ba(0,t)];if(this._helper._renderWorldCopies){const o=this.screenPointToMercatorCoordinate(new h.P(0,0)),c=this.screenPointToMercatorCoordinate(new h.P(this._helper._width,0)),f=this.screenPointToMercatorCoordinate(new h.P(this._helper._width,this._helper._height)),y=this.screenPointToMercatorCoordinate(new h.P(0,this._helper._height)),x=Math.floor(Math.min(o.x,c.x,f.x,y.x)),w=Math.floor(Math.max(o.x,c.x,f.x,y.x)),S=1;for(let P=x-S;P<=w+S;P++)P!==0&&a.push(new h.ba(P,t))}return a}getCameraFrustum(){return Vi.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){const a=this.screenPointToLocation(this.centerPoint,t),o=t?t.getElevationForLngLatZoom(a,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(o)}setLocationAtPoint(t,a){const o=h.aq(this.elevation,this.center.lat),c=this.screenPointToMercatorCoordinateAtZ(a,o),f=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,o),y=h.a7.fromLngLat(t),x=new h.a7(y.x-(c.x-f.x),y.y-(c.y-f.y));this.setCenter(x?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,a){return a?this.coordinatePoint(h.a7.fromLngLat(t),a.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(h.a7.fromLngLat(t))}screenPointToLocation(t,a){var o;return(o=this.screenPointToMercatorCoordinate(t,a))===null||o===void 0?void 0:o.toLngLat()}screenPointToMercatorCoordinate(t,a){if(a){const o=a.pointCoordinate(t);if(o!=null)return o}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,a){const o=a||0,c=[t.x,t.y,0,1],f=[t.x,t.y,1,1];h.aE(c,c,this._pixelMatrixInverse),h.aE(f,f,this._pixelMatrixInverse);const y=c[3],x=f[3],w=c[1]/y,S=f[1]/x,P=c[2]/y,E=f[2]/x,C=P===E?0:(o-P)/(E-P);return new h.a7(h.H.number(c[0]/y,f[0]/x,C)/this.worldSize,h.H.number(w,S,C)/this.worldSize,o)}coordinatePoint(t,a=0,o=this._pixelMatrix){const c=[t.x*this.worldSize,t.y*this.worldSize,a,1];return h.aE(c,c,o),new h.P(c[0]/c[3],c[1]/c[3])}getBounds(){const t=Math.max(0,this._helper._height/2-fa(this));return new Fe().extend(this.screenPointToLocation(new h.P(0,t))).extend(this.screenPointToLocation(new h.P(this._helper._width,t))).extend(this.screenPointToLocation(new h.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new h.P(0,this._helper._height)))}isPointOnMapSurface(t,a){return a?a.pointCoordinate(t)!=null:t.y>this.height/2-fa(this)}calculatePosMatrix(t,a=!1,o){var c;const f=(c=t.key)!==null&&c!==void 0?c:h.bb(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),y=a?this._alignedPosMatrixCache:this._posMatrixCache;if(y.has(f)){const S=y.get(f);return o?S.f32:S.f64}const x=Mn(t,this.worldSize);h.U(x,a?this._alignedProjMatrix:this._viewProjMatrix,x);const w={f64:x,f32:new Float32Array(x)};return y.set(f,w),o?w.f32:w.f64}calculateFogMatrix(t){const a=t.key,o=this._fogMatrixCacheF32;if(o.has(a))return o.get(a);const c=Mn(t,this.worldSize);return h.U(c,this._fogMatrix,c),o.set(a,new Float32Array(c)),o.get(a)}calculateCenterFromCameraLngLatAlt(t,a,o,c){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,o,c)}_calculateNearFarZIfNeeded(t,a,o){if(!this._helper.autoCalculateNearFarZ)return;const c=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),f=t-c*this._helper._pixelPerMeter/Math.cos(a),y=c<0?f:t,x=Math.PI/2+this.pitchInRadians,w=h.an(this.fov)*(Math.abs(Math.cos(h.an(this.roll)))*this.height+Math.abs(Math.sin(h.an(this.roll)))*this.width)/this.height*(.5+o.y/this.height),S=Math.sin(w)*y/Math.sin(h.al(Math.PI-x-w,.01,Math.PI-.01)),P=fa(this),E=Math.atan(P/this._helper.cameraToCenterDistance),C=h.an(.75),z=E>C?2*E*(.5+o.y/(2*P)):C,B=Math.sin(z)*y/Math.sin(h.al(Math.PI-x-z,.01,Math.PI-.01)),N=Math.min(S,B);this._helper._farZ=1.01*(Math.cos(Math.PI/2-a)*N+y),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const t=this.centerOffset,a=pr(this.worldSize,this.center),o=a.x,c=a.y;this._helper._pixelPerMeter=h.aq(1,this.center.lat)*this.worldSize;const f=h.an(Math.min(this.pitch,pa)),y=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(f));let x;var w,S;this._calculateNearFarZIfNeeded(y,f,t),x=new Float64Array(16),h.bc(x,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),(w=this._invProjMatrix)[0]=1/(S=x)[0],w[1]=0,w[2]=0,w[3]=0,w[4]=0,w[5]=1/S[5],w[6]=0,w[7]=0,w[8]=0,w[9]=0,w[10]=0,w[11]=1/S[14],w[12]=0,w[13]=0,w[14]=-1,w[15]=S[10]/S[14],x[8]=2*-t.x/this._helper._width,x[9]=2*t.y/this._helper._height,this._projectionMatrix=h.bd(x),h.S(x,x,[1,-1,1]),h.Q(x,x,[0,0,-this._helper.cameraToCenterDistance]),h.be(x,x,-this.rollInRadians),h.bf(x,x,this.pitchInRadians),h.be(x,x,-this.bearingInRadians),h.Q(x,x,[-o,-c,0]),this._mercatorMatrix=h.S([],x,[this.worldSize,this.worldSize,this.worldSize]),h.S(x,x,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=h.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,x),h.Q(x,x,[0,0,-this.elevation]),this._viewProjMatrix=x,this._invViewProjMatrix=h.bg([],x);const P=[0,0,-1,1];h.aE(P,P,this._invViewProjMatrix),this._cameraPosition=[P[0]/P[3],P[1]/P[3],P[2]/P[3]],this._fogMatrix=new Float64Array(16),h.bc(this._fogMatrix,this.fovInRadians,this.width/this.height,y,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,h.S(this._fogMatrix,this._fogMatrix,[1,-1,1]),h.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),h.be(this._fogMatrix,this._fogMatrix,-this.rollInRadians),h.bf(this._fogMatrix,this._fogMatrix,this.pitchInRadians),h.be(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),h.Q(this._fogMatrix,this._fogMatrix,[-o,-c,0]),h.S(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),h.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=h.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,x);const E=this._helper._width%2/2,C=this._helper._height%2/2,z=Math.cos(this.bearingInRadians),B=Math.sin(-this.bearingInRadians),N=o-Math.round(o)+z*E+B*C,Z=c-Math.round(c)+z*C+B*E,j=new Float64Array(x);if(h.Q(j,j,[N>.5?N-1:N,Z>.5?Z-1:Z,0]),this._alignedProjMatrix=j,x=h.bg(new Float64Array(16),this._pixelMatrix),!x)throw new Error("failed to invert matrix");this._pixelMatrixInverse=x,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const t=this.screenPointToMercatorCoordinate(new h.P(0,0)),a=[t.x*this.worldSize,t.y*this.worldSize,0,1];return h.aE(a,a,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const t=h.aq(1,this.center.lat)*this.worldSize;return $a(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,a){const o=h.a7.fromLngLat(t),c=[o.x*this.worldSize,o.y*this.worldSize,a,1];return h.aE(c,c,this._viewProjMatrix),c[2]/c[3]}getProjectionData(t){const{overscaledTileID:a,aligned:o,applyTerrainMatrix:c}=t,f=this._helper.getMercatorTileCoordinates(a),y=a?this.calculatePosMatrix(a,o,!0):null;let x;return x=a?.terrainRttPosMatrix32f&&c?a.terrainRttPosMatrix32f:y||h.bh(),{mainMatrix:x,tileMercatorCoords:f,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:x}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,a,o){return 1}transformLightDirection(t){return h.a$(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,a,o,c){const f=this.calculatePosMatrix(o);let y;c?(y=[t,a,c(t,a),1],h.aE(y,y,f)):(y=[t,a,0,1],Ps(y,y,f));const x=y[3];return{point:new h.P(y[0]/x,y[1]/x),signedDistanceFromCamera:x,isOccluded:!1}}populateCache(t){for(const a of t)this.calculatePosMatrix(a)}getMatrixForModel(t,a){const o=h.a7.fromLngLat(t,a),c=o.meterInMercatorCoordinateUnits(),f=h.bi();return h.Q(f,f,[o.x,o.y,o.z]),h.be(f,f,Math.PI),h.bf(f,f,Math.PI/2),h.S(f,f,[-c,c,c]),f}getProjectionDataForCustomLayer(t=!0){const a=new h.a3(0,0,0,0,0),o=this.getProjectionData({overscaledTileID:a,applyGlobeMatrix:t}),c=Mn(a,this.worldSize);h.U(c,this._viewProjMatrix,c),o.tileMercatorCoords=[0,0,1,1];const f=[h.a6,h.a6,this.worldSize/this._helper.pixelsPerMeter],y=h.bj();return h.S(y,c,f),o.fallbackMatrix=y,o.mainMatrix=y,o}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function Lr(){h.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function bc(d){if(d.useSlerp)if(d.k<1){const t=h.bk(d.startEulerAngles.roll,d.startEulerAngles.pitch,d.startEulerAngles.bearing),a=h.bk(d.endEulerAngles.roll,d.endEulerAngles.pitch,d.endEulerAngles.bearing),o=new Float64Array(4);h.bl(o,t,a,d.k);const c=h.bm(o);d.tr.setRoll(c.roll),d.tr.setPitch(c.pitch),d.tr.setBearing(c.bearing)}else d.tr.setRoll(d.endEulerAngles.roll),d.tr.setPitch(d.endEulerAngles.pitch),d.tr.setBearing(d.endEulerAngles.bearing);else d.tr.setRoll(h.H.number(d.startEulerAngles.roll,d.endEulerAngles.roll,d.k)),d.tr.setPitch(h.H.number(d.startEulerAngles.pitch,d.endEulerAngles.pitch,d.k)),d.tr.setBearing(h.H.number(d.startEulerAngles.bearing,d.endEulerAngles.bearing,d.k))}function el(d,t,a,o,c){const f=c.padding,y=pr(c.worldSize,a.getNorthWest()),x=pr(c.worldSize,a.getNorthEast()),w=pr(c.worldSize,a.getSouthEast()),S=pr(c.worldSize,a.getSouthWest()),P=h.an(-o),E=y.rotate(P),C=x.rotate(P),z=w.rotate(P),B=S.rotate(P),N=new h.P(Math.max(E.x,C.x,B.x,z.x),Math.max(E.y,C.y,B.y,z.y)),Z=new h.P(Math.min(E.x,C.x,B.x,z.x),Math.min(E.y,C.y,B.y,z.y)),j=N.sub(Z),G=(c.width-(f.left+f.right+t.left+t.right))/j.x,X=(c.height-(f.top+f.bottom+t.top+t.bottom))/j.y;if(X<0||G<0)return void Lr();const $=Math.min(h.ar(c.scale*Math.min(G,X)),d.maxZoom),U=h.P.convert(d.offset),H=new h.P((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(h.an(o)),q=U.add(H).mult(c.scale/h.ao($));return{center:Ga(c.worldSize,y.add(w).div(2).sub(q)),zoom:$,bearing:o}}class ba{get useGlobeControls(){return!1}handlePanInertia(t,a){const o=t.mag(),c=Math.abs(fa(a));return{easingOffset:t.mult(Math.min(.75*c/o,1)),easingCenter:a.center}}handleMapControlsRollPitchBearingZoom(t,a){t.bearingDelta&&a.setBearing(a.bearing+t.bearingDelta),t.pitchDelta&&a.setPitch(a.pitch+t.pitchDelta),t.rollDelta&&a.setRoll(a.roll+t.rollDelta),t.zoomDelta&&a.setZoom(a.zoom+t.zoomDelta)}handleMapControlsPan(t,a,o){t.around.distSqr(a.centerPoint)<.01||a.setLocationAtPoint(o,t.around)}cameraForBoxAndBearing(t,a,o,c,f){return el(t,a,o,c,f)}handleJumpToCenterZoom(t,a){t.zoom!==(a.zoom!==void 0?+a.zoom:t.zoom)&&t.setZoom(+a.zoom),a.center!==void 0&&t.setCenter(h.W.convert(a.center))}handleEaseTo(t,a){const o=t.zoom,c=t.padding,f={roll:t.roll,pitch:t.pitch,bearing:t.bearing},y={roll:a.roll===void 0?t.roll:a.roll,pitch:a.pitch===void 0?t.pitch:a.pitch,bearing:a.bearing===void 0?t.bearing:a.bearing},x=a.zoom!==void 0,w=!t.isPaddingEqual(a.padding);let S=!1;const P=x?+a.zoom:t.zoom;let E=t.centerPoint.add(a.offsetAsPoint);const C=t.screenPointToLocation(E),{center:z,zoom:B}=t.applyConstrain(h.W.convert(a.center||C),P??o);ea(t,z);const N=pr(t.worldSize,C),Z=pr(t.worldSize,z).sub(N),j=h.ao(B-o);return S=B!==o,{easeFunc:G=>{if(S&&t.setZoom(h.H.number(o,B,G)),h.bn(f,y)||bc({startEulerAngles:f,endEulerAngles:y,tr:t,k:G,useSlerp:f.roll!=y.roll}),w&&(t.interpolatePadding(c,a.padding,G),E=t.centerPoint.add(a.offsetAsPoint)),a.around)t.setLocationAtPoint(a.around,a.aroundPoint);else{const X=h.ao(t.zoom-o),$=B>o?Math.min(2,j):Math.max(.5,j),U=Math.pow($,1-G),H=Ga(t.worldSize,N.add(Z.mult(G*U)).mult(X));t.setLocationAtPoint(t.renderWorldCopies?H.wrap():H,E)}},isZooming:S,elevationCenter:z}}handleFlyTo(t,a){const o=a.zoom!==void 0,c=t.zoom,f=t.applyConstrain(h.W.convert(a.center||a.locationAtOffset),o?+a.zoom:c),y=f.center,x=f.zoom;ea(t,y);const w=pr(t.worldSize,a.locationAtOffset),S=pr(t.worldSize,y).sub(w),P=S.mag(),E=h.ao(x-c);let C;if(a.minZoom!==void 0){const z=Math.min(+a.minZoom,c,x),B=t.applyConstrain(y,z).zoom;C=h.ao(B-c)}return{easeFunc:(z,B,N,Z)=>{t.setZoom(z===1?x:c+h.ar(B));const j=z===1?y:Ga(t.worldSize,w.add(S.mult(N)).mult(B));t.setLocationAtPoint(t.renderWorldCopies?j.wrap():j,Z)},scaleOfZoom:E,targetCenter:y,scaleOfMinZoom:C,pixelPathLength:P}}}class yt{constructor(t,a,o){this.blendFunction=t,this.blendColor=a,this.mask=o}}yt.Replace=[1,0],yt.disabled=new yt(yt.Replace,h.bo.transparent,[!1,!1,!1,!1]),yt.unblended=new yt(yt.Replace,h.bo.transparent,[!0,!0,!0,!0]),yt.alphaBlended=new yt([1,771],h.bo.transparent,[!0,!0,!0,!0]);const Ja=2305;class tt{constructor(t,a,o){this.enable=t,this.mode=a,this.frontFace=o}}tt.disabled=new tt(!1,1029,Ja),tt.backCCW=new tt(!0,1029,Ja),tt.frontCCW=new tt(!0,1028,Ja);class qe{constructor(t,a,o){this.func=t,this.mask=a,this.range=o}}qe.ReadOnly=!1,qe.ReadWrite=!0,qe.disabled=new qe(519,qe.ReadOnly,[0,1]);const Qa=7680;class it{constructor(t,a,o,c,f,y){this.test=t,this.ref=a,this.mask=o,this.fail=c,this.depthFail=f,this.pass=y}}function mr(d){return typeof WebGL2RenderingContext<"u"&&d instanceof WebGL2RenderingContext}it.disabled=new it({func:519,mask:0},0,0,Qa,Qa,Qa);class en{get awaitingQuery(){return!!this._readbackQueue}constructor(t){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=t;const a=t.context,o=a.gl;this._texFormat=o.RGBA,this._texType=o.UNSIGNED_BYTE;const c=new h.aU;c.emplaceBack(-1,-1),c.emplaceBack(2,-1),c.emplaceBack(-1,2);const f=new h.aW;f.emplaceBack(0,1,2),this._fullscreenTriangle=new _t(a.createVertexBuffer(c,Qr.members),a.createIndexBuffer(f),h.aV.simpleSegment(0,0,c.length,f.length)),this._resultBuffer=new Uint8Array(4),a.activeTexture.set(o.TEXTURE1);const y=o.createTexture();o.bindTexture(o.TEXTURE_2D,y),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),o.texImage2D(o.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=a.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(y),mr(o)&&(this._pbo=o.createBuffer(),o.bindBuffer(o.PIXEL_PACK_BUFFER,this._pbo),o.bufferData(o.PIXEL_PACK_BUFFER,4,o.STREAM_READ),o.bindBuffer(o.PIXEL_PACK_BUFFER,null))}destroy(){const t=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),t.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(t,a){const o=this._updateCount;return this._readbackQueue?o>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():o>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,a),this._updateCount++,this._measuredError}_bindFramebuffer(){const t=this._cachedRenderContext.context,a=t.gl;t.activeTexture.set(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,a){const o=this._cachedRenderContext.context,c=o.gl;if(this._bindFramebuffer(),o.viewport.set([0,0,this._texWidth,this._texHeight]),o.clear({color:h.bo.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(o,c.TRIANGLES,qe.disabled,it.disabled,yt.unblended,tt.disabled,((f,y)=>({u_input:f,u_output_expected:y}))(t,a),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&mr(c)){c.bindBuffer(c.PIXEL_PACK_BUFFER,this._pbo),c.readBuffer(c.COLOR_ATTACHMENT0),c.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null);const f=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:f}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&mr(t)){const a=t.clientWaitSync(this._readbackQueue.sync,0,0);if(a===t.WAIT_FAILED)return h.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(a===t.TIMEOUT_EXPIRED)return;t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pbo),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),t.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=en._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let a=0;return a+=t[0]/256,a+=t[1]/65536,a+=t[2]/16777216,t[3]<127&&(a=-a),a/128}}const wa=h.a6/128;function tn(d,t){const a=d.granularity!==void 0?Math.max(d.granularity,1):1,o=a+(d.generateBorders?2:0),c=a+(d.extendToNorthPole||d.generateBorders?1:0)+(d.extendToSouthPole||d.generateBorders?1:0),f=o+1,y=c+1,x=d.generateBorders?-1:0,w=d.generateBorders||d.extendToNorthPole?-1:0,S=a+(d.generateBorders?1:0),P=a+(d.generateBorders||d.extendToSouthPole?1:0),E=f*y,C=o*c*6,z=f*y>65536;if(z&&t==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const B=z||t==="32bit",N=new Int16Array(2*E);let Z=0;for(let X=w;X<=P;X++)for(let $=x;$<=S;$++){let U=$/a*h.a6;$===-1&&(U=-wa),$===a+1&&(U=h.a6+wa);let H=X/a*h.a6;X===-1&&(H=d.extendToNorthPole?h.bq:-wa),X===a+1&&(H=d.extendToSouthPole?h.br:h.a6+wa),N[Z++]=U,N[Z++]=H}const j=B?new Uint32Array(C):new Uint16Array(C);let G=0;for(let X=0;X<c;X++)for(let $=0;$<o;$++){const U=$+1+X*f,H=$+(X+1)*f,q=$+1+(X+1)*f;j[G++]=$+X*f,j[G++]=H,j[G++]=U,j[G++]=U,j[G++]=H,j[G++]=q}return{vertices:N.buffer.slice(0),indices:j.buffer.slice(0),uses32bitIndices:B}}const tl=new h.aT({fill:new h.bs(128,2),line:new h.bs(512,0),tile:new h.bs(128,32),stencil:new h.bs(128,1),circle:3});class Cs{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return It.projectionGlobe}get vertexShaderPreludeCode(){return It.projectionMercator.vertexSource}get subdivisionGranularity(){return tl}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new en(t));const a=h.Y(this._errorQueryLatitudeDegrees),o=2*Math.atan(Math.exp(Math.PI-a*Math.PI*2))-.5*Math.PI,c=this._errorMeasurement.updateErrorLoop(a,o),f=je();c!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=c,this._errorMeasurementLastChangeTime=f);const y=Math.min(Math.max((f-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=h.bt(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,h.bu(y))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,a,o,c,f){const y=(f==="stencil"?tl.stencil:tl.tile).getGranularityForZoomLevel(a.z);return this._getMesh(t,{granularity:y,generateBorders:o,extendToNorthPole:a.y===0&&c,extendToSouthPole:a.y===(1<<a.z)-1&&c})}_getMesh(t,a){const o=this._getMeshKey(a);if(o in this._tileMeshCache)return this._tileMeshCache[o];const c=(function(f,y){const x=tn(y,"16bit"),w=h.aU.deserialize({arrayBuffer:x.vertices,length:x.vertices.byteLength/2/2}),S=h.aW.deserialize({arrayBuffer:x.indices,length:x.indices.byteLength/2/3});return new _t(f.createVertexBuffer(w,Qr.members),f.createIndexBuffer(S),h.aV.simpleSegment(0,0,w.length,S.length))})(t,a);return this._tileMeshCache[o]=c,c}recalculate(t){}hasTransition(){var t;const a=je();let o=!1;return o||(o=(a-this._errorMeasurementLastChangeTime)/1e3<.7),o||(o=(t=this._errorMeasurement)===null||t===void 0?void 0:t.awaitingQuery),o}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}const wc=new h.u({type:new h.D(h.x.projection.type)});class Tc extends h.E{constructor(t){super(),this._transitionable=new h.y(wc,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new h.J(0)),this._mercatorProjection=new Ai,this._verticalPerspectiveProjection=new Cs}get transitionState(){const t=this.properties.get("type");if(typeof t=="string"&&t==="mercator")return 0;if(typeof t=="string"&&t==="vertical-perspective")return 1;if(t instanceof h.bv){if(t.from==="vertical-perspective"&&t.to==="mercator")return 1-t.transition;if(t.from==="mercator"&&t.to==="vertical-perspective")return t.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(t){this._mercatorProjection.updateGPUdependent(t),this._verticalPerspectiveProjection.updateGPUdependent(t)}getMeshFromTileID(t,a,o,c,f){return this.currentProjection.getMeshFromTileID(t,a,o,c,f)}setProjection(t){this._transitionable.setValue("type",t?.type||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}setErrorQueryLatitudeDegrees(t){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(t),this._mercatorProjection.setErrorQueryLatitudeDegrees(t)}}function Sc(d){const t=Wi(d.worldSize,d.center.lat);return 2*Math.PI*t}function Gt(d,t,a,o,c){const f=1/(1<<c),y=t/h.a6*f+o*f,x=h.by((d/h.a6*f+a*f)*Math.PI*2+Math.PI,2*Math.PI),w=2*Math.atan(Math.exp(Math.PI-y*Math.PI*2))-.5*Math.PI,S=Math.cos(w),P=new Float64Array(3);return P[0]=Math.sin(x)*S,P[1]=Math.sin(w),P[2]=Math.cos(x)*S,P}function ri(d){return(function(t,a){const o=Math.cos(a),c=new Float64Array(3);return c[0]=Math.sin(t)*o,c[1]=Math.sin(a),c[2]=Math.cos(t)*o,c})(d.lng*Math.PI/180,d.lat*Math.PI/180)}function Wi(d,t){return d/(2*Math.PI)/Math.cos(t*Math.PI/180)}function Ln(d){const t=Math.asin(d[1])/Math.PI*180,a=Math.sqrt(d[0]*d[0]+d[2]*d[2]);if(a>1e-6){const o=d[0]/a,c=Math.acos(d[2]/a),f=(o>0?c:-c)/Math.PI*180;return new h.W(h.X(f,-180,180),t)}return new h.W(0,t)}function Fn(d){return Math.cos(d*Math.PI/180)}function ei(d,t){const a=Fn(d),o=Fn(t);return h.ar(o/a)}function Ta(d,t){const a=d.rotate(t.bearingInRadians),o=t.zoom+ei(t.center.lat,0),c=h.bt(1/Fn(t.center.lat),1/Fn(Math.min(Math.abs(t.center.lat),60)),h.bw(o,7,3,0,1)),f=360/Sc({worldSize:t.worldSize,center:{lat:t.center.lat}});return new h.W(t.center.lng-a.x*f*c,h.al(t.center.lat+a.y*f,-h.am,h.am))}function il(d){const t=.5*d,a=Math.sin(t),o=Math.cos(t);return Math.log(a+o)-Math.log(o-a)}function Pc(d,t,a,o){const c=d.lat+a*o;if(Math.abs(a)>1){const f=(Math.sign(d.lat+a)!==Math.sign(d.lat)?-Math.abs(d.lat):Math.abs(d.lat))*Math.PI/180,y=Math.abs(d.lat+a)*Math.PI/180,x=il(f+o*(y-f)),w=il(f),S=il(y);return new h.W(d.lng+t*((x-w)/(S-w)),c)}return new h.W(d.lng+t*o,c)}class Hu{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;const t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,a,o,c){const f=`${t.z}_${t.x}_${t.y}_${c?.terrain?"t":""}`,y=this._cache.get(f);if(y)return y;const x=this._cachePrevious.get(f);if(x)return this._cache.set(f,x),x;const w=this._boundingVolumeFactory(t,a,o,c);return this._cache.set(f,w),this._hadAnyChanges=!0,w}}class rn{constructor(t,a,o,c){this.min=o,this.max=c,this.points=t,this.planes=a}static fromAabb(t,a){const o=[];for(let c=0;c<8;c++)o.push([1&~c?t[0]:a[0],(c>>1&1)==1?a[1]:t[1],(c>>2&1)==1?a[2]:t[2]]);return new rn(o,[[-1,0,0,a[0]],[1,0,0,-t[0]],[0,-1,0,a[1]],[0,1,0,-t[1]],[0,0,-1,a[2]],[0,0,1,-t[2]]],t,a)}static fromCenterSizeAngles(t,a,o){const c=h.bA([],o[0],o[1],o[2]),f=h.bB([],[a[0],0,0],c),y=h.bB([],[0,a[1],0],c),x=h.bB([],[0,0,a[2]],c),w=[...t],S=[...t];for(let E=0;E<8;E++)for(let C=0;C<3;C++){const z=t[C]+f[C]*(1&~E?-1:1)+y[C]*((E>>1&1)==1?1:-1)+x[C]*((E>>2&1)==1?1:-1);w[C]=Math.min(w[C],z),S[C]=Math.max(S[C],z)}const P=[];for(let E=0;E<8;E++){const C=[...t];h.a_(C,C,h.aZ([],f,1&~E?-1:1)),h.a_(C,C,h.aZ([],y,(E>>1&1)==1?1:-1)),h.a_(C,C,h.aZ([],x,(E>>2&1)==1?1:-1)),P.push(C)}return new rn(P,[[...f,-h.b3(f,P[0])],[...y,-h.b3(y,P[0])],[...x,-h.b3(x,P[0])],[-f[0],-f[1],-f[2],-h.b3(f,P[7])],[-y[0],-y[1],-y[2],-h.b3(y,P[7])],[-x[0],-x[1],-x[2],-h.b3(x,P[7])]],w,S)}intersectsFrustum(t){let a=!0;const o=this.points.length,c=this.planes.length,f=t.planes.length,y=t.points.length;for(let x=0;x<f;x++){const w=t.planes[x];let S=0;for(let P=0;P<o;P++){const E=this.points[P];w[0]*E[0]+w[1]*E[1]+w[2]*E[2]+w[3]>=0&&S++}if(S===0)return 0;S<o&&(a=!1)}if(a)return 2;for(let x=0;x<c;x++){const w=this.planes[x];let S=0;for(let P=0;P<y;P++){const E=t.points[P];w[0]*E[0]+w[1]*E[1]+w[2]*E[2]+w[3]>=0&&S++}if(S===0)return 0}return 1}intersectsPlane(t){const a=this.points.length;let o=0;for(let c=0;c<a;c++){const f=this.points[c];t[0]*f[0]+t[1]*f[1]+t[2]*f[2]+t[3]>=0&&o++}return o===a?2:o===0?0:1}}function As(d,t,a){const o=d-t;return o<0?-o:Math.max(0,o-a)}function rl(d,t,a,o,c){const f=d-a;let y;return y=f<0?Math.min(-f,1+f-c):f>c?Math.min(Math.max(f-c,0),1-f):0,Math.max(y,As(t,o,c))}class Ds{constructor(){this._boundingVolumeCache=new Hu(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,a,o,c){const f=1<<o.z,y=1/f,x=o.x/f,w=o.y/f;let S=2;return S=Math.min(S,rl(t,a,x,w,y)),S=Math.min(S,rl(t,a,x+.5,-w-y,y)),S=Math.min(S,rl(t,a,x+.5,2-w-y,y)),S}getWrap(t,a,o){const c=1<<a.z,f=1/c,y=a.x/c,x=As(t.x,y,f),w=As(t.x,y-1,f),S=As(t.x,y+1,f),P=Math.min(x,w,S);return P===S?1:P===w?-1:0}allowVariableZoom(t,a){return Oi(t,a)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,a,o,c){return this._boundingVolumeCache.getTileBoundingVolume(t,a,o,c)}_computeTileBoundingVolume(t,a,o,c){var f,y;let x=0,w=0;if(c?.terrain){const S=new h.a3(t.z,a,t.z,t.x,t.y),P=c.terrain.getMinMaxElevation(S);x=(f=P.minElevation)!==null&&f!==void 0?f:Math.min(0,o),w=(y=P.maxElevation)!==null&&y!==void 0?y:Math.max(0,o)}if(x/=h.bD,w/=h.bD,x+=1,w+=1,t.z<=0)return rn.fromAabb([-w,-w,-w],[w,w,w]);if(t.z===1)return rn.fromAabb([t.x===0?-w:0,t.y===0?0:-w,-w],[t.x===0?0:w,t.y===0?w:0,w]);{const S=[Gt(0,0,t.x,t.y,t.z),Gt(h.a6,0,t.x,t.y,t.z),Gt(h.a6,h.a6,t.x,t.y,t.z),Gt(0,h.a6,t.x,t.y,t.z)],P=[];for(const me of S)P.push(h.aZ([],me,w));if(w!==x)for(const me of S)P.push(h.aZ([],me,x));t.y===0&&P.push([0,1,0]),t.y===(1<<t.z)-1&&P.push([0,-1,0]);const E=[1,1,1],C=[-1,-1,-1];for(const me of P)for(let pe=0;pe<3;pe++)E[pe]=Math.min(E[pe],me[pe]),C[pe]=Math.max(C[pe],me[pe]);const z=Gt(h.a6/2,h.a6/2,t.x,t.y,t.z),B=h.b2([],[0,1,0],z);h.b1(B,B);const N=h.b2([],z,B);h.b1(N,N);const Z=h.b2([],S[2],S[1]);h.b1(Z,Z);const j=h.b2([],S[0],S[3]);h.b1(j,j),P.push(h.aZ([],z,w)),t.y>=(1<<t.z)/2&&P.push(h.aZ([],Gt(h.a6/2,0,t.x,t.y,t.z),w)),t.y<(1<<t.z)/2&&P.push(h.aZ([],Gt(h.a6/2,h.a6,t.x,t.y,t.z),w));const G=zs(z,P),X=zs(N,P),$=[-z[0],-z[1],-z[2],G.max],U=[z[0],z[1],z[2],-G.min],H=[-N[0],-N[1],-N[2],X.max],q=[N[0],N[1],N[2],-X.min],Q=[...Z,0],ne=[...j,0],se=[];return t.y===0?se.push(h.bC(ne,Q,$),h.bC(ne,Q,U)):se.push(h.bC(H,Q,$),h.bC(H,Q,U),h.bC(H,ne,$),h.bC(H,ne,U)),t.y===(1<<t.z)-1?se.push(h.bC(ne,Q,$),h.bC(ne,Q,U)):se.push(h.bC(q,Q,$),h.bC(q,Q,U),h.bC(q,ne,$),h.bC(q,ne,U)),new rn(se,[$,U,H,q,Q,ne],E,C)}}}function zs(d,t){let a=1/0,o=-1/0;for(const c of t){const f=h.b3(d,c);a=Math.min(a,f),o=Math.max(o,f)}return{min:a,max:o}}class Sa{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,a,o){this._helper.interpolatePadding(t,a,o)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a){this._helper.resize(t,a)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._cachedClippingPlane=h.bE(),this._projectionMatrix=h.bi(),this._globeViewProjMatrix32f=h.bh(),this._globeViewProjMatrixNoCorrection=h.bi(),this._globeViewProjMatrixNoCorrectionInverted=h.bi(),this._globeProjMatrixInverted=h.bi(),this._cameraPosition=h.bz(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(a,o)=>{const c=h.al(a.lat,-h.am,h.am),f=h.al(+o,this.minZoom+ei(0,c),this.maxZoom);return{center:new h.W(a.lng,c),zoom:f}},this.applyConstrain=(a,o)=>this._helper.applyConstrain(a,o),this._helper=new va({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(a,o)=>this.defaultConstrain(a,o)},t),this._coveringTilesDetailsProvider=new Ds}clone(){const t=new Sa;return t.apply(this,!1),t}apply(t,a,o){this._globeLatitudeErrorCorrectionRadians=o||0,this._helper.apply(t,a)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const t=h.bz();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){const{overscaledTileID:a,applyGlobeMatrix:o}=t,c=this._helper.getMercatorTileCoordinates(a);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:c,clippingPlane:this._cachedClippingPlane,projectionTransition:o?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){const a=this.pitchInRadians,o=this.cameraToCenterDistance/t,c=Math.sin(a)*o,f=Math.cos(a)*o+1,y=1/Math.sqrt(c*c+f*f)*1;let x=-c,w=f;const S=Math.sqrt(x*x+w*w);x/=S,w/=S;const P=[0,x,w];h.bF(P,P,[0,0,0],-this.bearingInRadians),h.bG(P,P,[0,0,0],-1*this.center.lat*Math.PI/180),h.bH(P,P,[0,0,0],this.center.lng*Math.PI/180);const E=1/h.b5(P);return h.aZ(P,P,E),[...P,-y*E]}isLocationOccluded(t){return!this.isSurfacePointVisible(ri(t))}transformLightDirection(t){const a=this._helper._center.lng*Math.PI/180,o=this._helper._center.lat*Math.PI/180,c=Math.cos(o),f=[Math.sin(a)*c,Math.sin(o),Math.cos(a)*c],y=[f[2],0,-f[0]],x=[0,0,0];h.b2(x,y,f),h.b1(y,y),h.b1(x,x);const w=[0,0,0];return h.b1(w,[y[0]*t[0]+x[0]*t[1]+f[0]*t[2],y[1]*t[0]+x[1]*t[1]+f[1]*t[2],y[2]*t[0]+x[2]*t[1]+f[2]*t[2]]),w}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,a,o){const c=(function(x,w,S){const P=1/(1<<S.z);return new h.a7(x/h.a6*P+S.x*P,w/h.a6*P+S.y*P)})(t,a,o.canonical),f=(y=c.y,[h.by(c.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-y*Math.PI*2))-.5*Math.PI]);var y;return this.getCircleRadiusCorrection()/Math.cos(f[1])}projectTileCoordinates(t,a,o,c){const f=o.canonical,y=Gt(t,a,f.x,f.y,f.z),x=1+(c?c(t,a):0)/h.bD,w=[y[0]*x,y[1]*x,y[2]*x,1];h.aE(w,w,this._globeViewProjMatrixNoCorrection);const S=this._cachedClippingPlane,P=S[0]*y[0]+S[1]*y[1]+S[2]*y[2]+S[3]<0;return{point:new h.P(w[0]/w[3],w[1]/w[3]),signedDistanceFromCamera:w[3],isOccluded:P}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const t=Wi(this.worldSize,this.center.lat),a=h.bj(),o=h.bj();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),h.bc(a,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const c=this.centerOffset;a[8]=2*-c.x/this._helper._width,a[9]=2*c.y/this._helper._height,this._projectionMatrix=h.bd(a),this._globeProjMatrixInverted=h.bj(),h.bg(this._globeProjMatrixInverted,a),h.Q(a,a,[0,0,-this.cameraToCenterDistance]),h.be(a,a,this.rollInRadians),h.bf(a,a,-this.pitchInRadians),h.be(a,a,this.bearingInRadians),h.Q(a,a,[0,0,-t]);const f=h.bz();f[0]=t,f[1]=t,f[2]=t,h.bf(o,a,this.center.lat*Math.PI/180),h.bI(o,o,-this.center.lng*Math.PI/180),h.S(o,o,f),this._globeViewProjMatrixNoCorrection=o,h.bf(a,a,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),h.bI(a,a,-this.center.lng*Math.PI/180),h.S(a,a,f),this._globeViewProjMatrix32f=new Float32Array(a),this._globeViewProjMatrixNoCorrectionInverted=h.bj(),h.bg(this._globeViewProjMatrixNoCorrectionInverted,o);const y=h.bz();this._cameraPosition=h.bz(),this._cameraPosition[2]=this.cameraToCenterDistance/t,h.bF(this._cameraPosition,this._cameraPosition,y,-this.rollInRadians),h.bG(this._cameraPosition,this._cameraPosition,y,this.pitchInRadians),h.bF(this._cameraPosition,this._cameraPosition,y,-this.bearingInRadians),h.a_(this._cameraPosition,this._cameraPosition,[0,0,1]),h.bG(this._cameraPosition,this._cameraPosition,y,-this.center.lat*Math.PI/180),h.bH(this._cameraPosition,this._cameraPosition,y,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);const x=h.bd(this._globeViewProjMatrixNoCorrectionInverted);h.S(x,x,[1,1,-1]),this._cachedFrustum=Vi.fromInvProjectionMatrix(x,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){h.w("calculateFogMatrix is not supported on globe projection.");const a=h.bj();return h.ap(a),a}getVisibleUnwrappedCoordinates(t){return[new h.ba(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&h.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,a){if(!this._globeViewProjMatrixNoCorrection)return 1;const o=ri(t);h.aZ(o,o,1+a/h.bD);const c=h.bE();return h.aE(c,[o[0],o[1],o[2],1],this._globeViewProjMatrixNoCorrection),c[2]/c[3]}populateCache(t){}getBounds(){const t=.5*this.width,a=.5*this.height,o=[new h.P(0,0),new h.P(t,0),new h.P(this.width,0),new h.P(this.width,a),new h.P(this.width,this.height),new h.P(t,this.height),new h.P(0,this.height),new h.P(0,a)],c=[];for(const E of o)c.push(this.unprojectScreenPoint(E));let f=0,y=0,x=0,w=0;const S=this.center;for(const E of c){const C=h.bJ(S.lng,E.lng),z=h.bJ(S.lat,E.lat);C<y&&(y=C),C>f&&(f=C),z<w&&(w=z),z>x&&(x=z)}const P=[S.lng+y,S.lat+w,S.lng+f,S.lat+x];return this.isSurfacePointOnScreen([0,1,0])&&(P[3]=90,P[0]=-180,P[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(P[1]=-90,P[0]=-180,P[2]=180),new Fe(P)}calculateCenterFromCameraLngLatAlt(t,a,o,c){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,o,c)}setLocationAtPoint(t,a){const o=ri(this.unprojectScreenPoint(a)),c=ri(t),f=h.bz();h.bK(f);const y=h.bz();h.bH(y,o,f,-this.center.lng*Math.PI/180),h.bG(y,y,f,this.center.lat*Math.PI/180);const x=c[0]*c[0]+c[2]*c[2],w=y[0]*y[0];if(x<w)return;const S=Math.sqrt(x-w),P=-S,E=h.bL(c[0],c[2],y[0],S),C=h.bL(c[0],c[2],y[0],P),z=h.bz();h.bH(z,c,f,-E);const B=h.bL(z[1],z[2],y[1],y[2]),N=h.bz();h.bH(N,c,f,-C);const Z=h.bL(N[1],N[2],y[1],y[2]),j=.5*Math.PI,G=B>=-j&&B<=j,X=Z>=-j&&Z<=j;let $,U;if(G&&X){const ne=this.center.lng*Math.PI/180,se=this.center.lat*Math.PI/180;h.bM(E,ne)+h.bM(B,se)<h.bM(C,ne)+h.bM(Z,se)?($=E,U=B):($=C,U=Z)}else if(G)$=E,U=B;else{if(!X)return;$=C,U=Z}const H=$/Math.PI*180,q=U/Math.PI*180,Q=this.center.lat;this.setCenter(new h.W(H,h.al(q,-90,90))),this.setZoom(this.zoom+ei(Q,this.center.lat))}locationToScreenPoint(t,a){const o=ri(t);if(a){const c=a.getElevationForLngLatZoom(t,this._helper._tileZoom);h.aZ(o,o,1+c/h.bD)}return this._projectSurfacePointToScreen(o)}_projectSurfacePointToScreen(t){const a=h.bE();return h.aE(a,[...t,1],this._globeViewProjMatrixNoCorrection),a[0]/=a[3],a[1]/=a[3],new h.P((.5*a[0]+.5)*this.width,(.5*-a[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,a){if(a){const o=a.pointCoordinate(t);if(o)return o}return h.a7.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,a){var o;return(o=this.screenPointToMercatorCoordinate(t,a))===null||o===void 0?void 0:o.toLngLat()}isPointOnMapSurface(t,a){const o=this._cameraPosition,c=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(o,c)}getRayDirectionFromPixel(t){const a=h.bE();a[0]=t.x/this.width*2-1,a[1]=-1*(t.y/this.height*2-1),a[2]=1,a[3]=1,h.aE(a,a,this._globeViewProjMatrixNoCorrectionInverted),a[0]/=a[3],a[1]/=a[3],a[2]/=a[3];const o=h.bz();o[0]=a[0]-this._cameraPosition[0],o[1]=a[1]-this._cameraPosition[1],o[2]=a[2]-this._cameraPosition[2];const c=h.bz();return h.b1(c,o),c}isSurfacePointVisible(t){const a=this._cachedClippingPlane;return a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;const a=h.bE();return h.aE(a,[...t,1],this._globeViewProjMatrixNoCorrection),a[0]/=a[3],a[1]/=a[3],a[2]/=a[3],a[0]>-1&&a[0]<1&&a[1]>-1&&a[1]<1&&a[2]>-1&&a[2]<1}rayPlanetIntersection(t,a){const o=h.b3(t,a),c=h.bz(),f=h.bz();h.aZ(f,a,o),h.b0(c,t,f);const y=1-h.b3(c,c);if(y<0)return null;const x=h.b3(t,t)-1,w=-o+(o<0?1:-1)*Math.sqrt(y),S=x/w,P=w;return{tMin:Math.min(S,P),tMax:Math.max(S,P)}}unprojectScreenPoint(t){const a=this._cameraPosition,o=this.getRayDirectionFromPixel(t),c=this.rayPlanetIntersection(a,o);if(c){const P=h.bz();h.a_(P,a,[o[0]*c.tMin,o[1]*c.tMin,o[2]*c.tMin]);const E=h.bz();return h.b1(E,P),Ln(E)}const f=this._cachedClippingPlane,y=f[0]*o[0]+f[1]*o[1]+f[2]*o[2],x=-h.b9(f,a)/y,w=h.bz();if(x>0)h.a_(w,a,[o[0]*x,o[1]*x,o[2]*x]);else{const P=h.bz();h.a_(P,a,[2*o[0],2*o[1],2*o[2]]);const E=h.b9(this._cachedClippingPlane,P);h.b0(w,P,[this._cachedClippingPlane[0]*E,this._cachedClippingPlane[1]*E,this._cachedClippingPlane[2]*E])}const S=(function(P){const E=h.bz();return E[0]=P[0]*-P[3],E[1]=P[1]*-P[3],E[2]=P[2]*-P[3],{center:E,radius:Math.sqrt(1-P[3]*P[3])}})(f);return Ln((function(P,E,C){const z=h.bz();h.b0(z,C,P);const B=h.bz();return h.bx(B,P,z,E/h.b7(z)),B})(S.center,S.radius,w))}getMatrixForModel(t,a){const o=h.W.convert(t),c=1/h.bD,f=h.bi();return h.bI(f,f,o.lng/180*Math.PI),h.bf(f,f,-o.lat/180*Math.PI),h.Q(f,f,[0,0,1+a/h.bD]),h.bf(f,f,.5*Math.PI),h.S(f,f,[c,c,c]),f}getProjectionDataForCustomLayer(t=!0){const a=this.getProjectionData({overscaledTileID:new h.a3(0,0,0,0,0),applyGlobeMatrix:t});return a.tileMercatorCoords=[0,0,1,1],a}getFastPathSimpleProjectionMatrix(t){}}class an{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,a,o){this._helper.interpolatePadding(t,a,o)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a,o=!0){this._helper.resize(t,a,o)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t,a){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=a,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(a,o)=>this.currentTransform.defaultConstrain(a,o),this.applyConstrain=(a,o)=>this._helper.applyConstrain(a,o),this._helper=new va({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(a,o)=>this.defaultConstrain(a,o)},t),this._globeness=1,this._mercatorTransform=new xa,this._verticalPerspectiveTransform=new Sa}clone(){const t=new an;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this,!1),t}apply(t,a){this._helper.apply(t,a),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){const a=this._mercatorTransform.getProjectionData(t),o=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?o.mainMatrix:a.mainMatrix,clippingPlane:o.clippingPlane,tileMercatorCoords:o.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:a.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return h.bt(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return h.bt(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,a,o){const c=this._mercatorTransform.getPitchedTextCorrection(t,a,o),f=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,a,o);return h.bt(c,f,this._globeness)}projectTileCoordinates(t,a,o,c){return this.currentTransform.projectTileCoordinates(t,a,o,c)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this._mercatorTransform.recalculateZoomAndCenter(t),this._verticalPerspectiveTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,a){return this.currentTransform.lngLatToCameraDepth(t,a)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,a,o,c){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,o,c)}setLocationAtPoint(t,a){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,a),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(t,a),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,a){return this.currentTransform.locationToScreenPoint(t,a)}screenPointToMercatorCoordinate(t,a){return this.currentTransform.screenPointToMercatorCoordinate(t,a)}screenPointToLocation(t,a){return this.currentTransform.screenPointToLocation(t,a)}isPointOnMapSurface(t,a){return this.currentTransform.isPointOnMapSurface(t,a)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,a){return this.currentTransform.getMatrixForModel(t,a)}getProjectionDataForCustomLayer(t=!0){const a=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return a;const o=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return o.fallbackMatrix=a.mainMatrix,o}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class Hi{get useGlobeControls(){return!0}handlePanInertia(t,a){const o=Ta(t,a);return Math.abs(o.lng-a.center.lng)>180&&(o.lng=a.center.lng+179.5*Math.sign(o.lng-a.center.lng)),{easingCenter:o,easingOffset:new h.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,a){const o=t.around,c=a.screenPointToLocation(o);t.bearingDelta&&a.setBearing(a.bearing+t.bearingDelta),t.pitchDelta&&a.setPitch(a.pitch+t.pitchDelta),t.rollDelta&&a.setRoll(a.roll+t.rollDelta);const f=a.zoom;t.zoomDelta&&a.setZoom(a.zoom+t.zoomDelta);const y=a.zoom-f;if(y===0)return;const x=h.bJ(a.center.lng,c.lng),w=x/(Math.abs(x/180)+1),S=h.bJ(a.center.lat,c.lat),P=a.getRayDirectionFromPixel(o),E=a.cameraPosition,C=-1*h.b3(E,P),z=h.bz();h.a_(z,E,[P[0]*C,P[1]*C,P[2]*C]);const B=h.b5(z)-1,N=Math.exp(.5*-Math.max(B-.3,0)),Z=Wi(a.worldSize,a.center.lat)/Math.min(a.width,a.height),j=h.bw(Z,.9,.5,1,.25),G=(1-h.ao(-y))*Math.min(N,j),X=a.center.lat,$=a.zoom,U=new h.W(a.center.lng+w*G,h.al(a.center.lat+S*G,-h.am,h.am));a.setLocationAtPoint(c,o);const H=a.center,q=h.bw(Math.abs(x),45,85,0,1),Q=h.bw(Z,.75,.35,0,1),ne=Math.pow(Math.max(q,Q),.25),se=h.bJ(H.lng,U.lng),me=h.bJ(H.lat,U.lat);a.setCenter(new h.W(H.lng+se*ne,H.lat+me*ne).wrap()),a.setZoom($+ei(X,a.center.lat))}handleMapControlsPan(t,a,o){if(!t.panDelta)return;const c=a.center.lat,f=a.zoom;a.setCenter(Ta(t.panDelta,a).wrap()),a.setZoom(f+ei(c,a.center.lat))}cameraForBoxAndBearing(t,a,o,c,f){const y=el(t,a,o,c,f),x=a.left/f.width*2-1,w=(f.width-a.right)/f.width*2-1,S=a.top/f.height*-2+1,P=(f.height-a.bottom)/f.height*-2+1,E=h.bJ(o.getWest(),o.getEast())<0,C=E?o.getEast():o.getWest(),z=E?o.getWest():o.getEast(),B=Math.max(o.getNorth(),o.getSouth()),N=Math.min(o.getNorth(),o.getSouth()),Z=C+.5*h.bJ(C,z),j=B+.5*h.bJ(B,N),G=f.clone();G.setCenter(y.center),G.setBearing(y.bearing),G.setPitch(0),G.setRoll(0),G.setZoom(y.zoom);const X=G.modelViewProjectionMatrix,$=[ri(o.getNorthWest()),ri(o.getNorthEast()),ri(o.getSouthWest()),ri(o.getSouthEast()),ri(new h.W(z,j)),ri(new h.W(C,j)),ri(new h.W(Z,B)),ri(new h.W(Z,N))],U=ri(y.center);let H=Number.POSITIVE_INFINITY;for(const q of $)x<0&&(H=Hi.getLesserNonNegativeNonNull(H,Hi.solveVectorScale(q,U,X,"x",x))),w>0&&(H=Hi.getLesserNonNegativeNonNull(H,Hi.solveVectorScale(q,U,X,"x",w))),S>0&&(H=Hi.getLesserNonNegativeNonNull(H,Hi.solveVectorScale(q,U,X,"y",S))),P<0&&(H=Hi.getLesserNonNegativeNonNull(H,Hi.solveVectorScale(q,U,X,"y",P)));if(Number.isFinite(H)&&H!==0)return y.zoom=Math.min(G.zoom+h.ar(H),t.maxZoom),y;Lr()}handleJumpToCenterZoom(t,a){const o=t.center.lat,c=t.applyConstrain(a.center?h.W.convert(a.center):t.center,t.zoom).center;t.setCenter(c.wrap());const f=a.zoom!==void 0?+a.zoom:t.zoom+ei(o,c.lat);t.zoom!==f&&t.setZoom(f)}handleEaseTo(t,a){const o=t.zoom,c=t.center,f=t.padding,y={roll:t.roll,pitch:t.pitch,bearing:t.bearing},x={roll:a.roll===void 0?t.roll:a.roll,pitch:a.pitch===void 0?t.pitch:a.pitch,bearing:a.bearing===void 0?t.bearing:a.bearing},w=a.zoom!==void 0,S=!t.isPaddingEqual(a.padding);let P=!1;const E=a.center?h.W.convert(a.center):c,C=t.applyConstrain(E,o).center;ea(t,C);const z=t.clone();z.setCenter(C),z.setZoom(w?+a.zoom:o+ei(c.lat,E.lat)),z.setBearing(a.bearing);const B=new h.P(h.al(t.centerPoint.x+a.offsetAsPoint.x,0,t.width),h.al(t.centerPoint.y+a.offsetAsPoint.y,0,t.height));z.setLocationAtPoint(C,B);const N=(a.offset&&a.offsetAsPoint.mag())>0?z.center:C,Z=w?+a.zoom:o+ei(c.lat,N.lat),j=o+ei(c.lat,0),G=Z+ei(N.lat,0),X=h.bJ(c.lng,N.lng),$=h.bJ(c.lat,N.lat),U=h.ao(G-j);return P=Z!==o,{easeFunc:H=>{if(h.bn(y,x)||bc({startEulerAngles:y,endEulerAngles:x,tr:t,k:H,useSlerp:y.roll!=x.roll}),S&&t.interpolatePadding(f,a.padding,H),a.around)h.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(a.around,a.aroundPoint);else{const q=G>j?Math.min(2,U):Math.max(.5,U),Q=Math.pow(q,1-H),ne=Pc(c,X,$,H*Q);t.setCenter(ne.wrap())}if(P){const q=h.H.number(j,G,H)+ei(0,t.center.lat);t.setZoom(q)}},isZooming:P,elevationCenter:N}}handleFlyTo(t,a){const o=a.zoom!==void 0,c=t.center,f=t.zoom,y=t.padding,x=!t.isPaddingEqual(a.padding),w=t.applyConstrain(h.W.convert(a.center||a.locationAtOffset),f).center,S=o?+a.zoom:t.zoom+ei(t.center.lat,w.lat),P=t.clone();P.setCenter(w),P.setZoom(S),P.setBearing(a.bearing);const E=new h.P(h.al(t.centerPoint.x+a.offsetAsPoint.x,0,t.width),h.al(t.centerPoint.y+a.offsetAsPoint.y,0,t.height));P.setLocationAtPoint(w,E);const C=P.center;ea(t,C);const z=(function($,U,H){const q=ri(U),Q=ri(H),ne=h.b3(q,Q),se=Math.acos(ne),me=Sc($);return se/(2*Math.PI)*me})(t,c,C),B=f+ei(c.lat,0),N=S+ei(C.lat,0),Z=h.ao(N-B);let j;if(typeof a.minZoom=="number"){const $=+a.minZoom+ei(C.lat,0),U=Math.min($,B,N)+ei(0,C.lat),H=t.applyConstrain(C,U).zoom+ei(C.lat,0);j=h.ao(H-B)}const G=h.bJ(c.lng,C.lng),X=h.bJ(c.lat,C.lat);return{easeFunc:($,U,H,q)=>{const Q=Pc(c,G,X,H);x&&t.interpolatePadding(y,a.padding,$);const ne=$===1?C:Q;t.setCenter(ne.wrap());const se=B+h.ar(U);t.setZoom($===1?S:se+ei(0,ne.lat))},scaleOfZoom:Z,targetCenter:C,scaleOfMinZoom:j,pixelPathLength:z}}static solveVectorScale(t,a,o,c,f){const y=c==="x"?[o[0],o[4],o[8],o[12]]:[o[1],o[5],o[9],o[13]],x=[o[3],o[7],o[11],o[15]],w=t[0]*y[0]+t[1]*y[1]+t[2]*y[2],S=t[0]*x[0]+t[1]*x[1]+t[2]*x[2],P=a[0]*y[0]+a[1]*y[1]+a[2]*y[2],E=a[0]*x[0]+a[1]*x[1]+a[2]*x[2];return P+f*S===w+f*E||x[3]*(w-P)+y[3]*(E-S)+w*E==P*S?null:(P+y[3]-f*E-f*x[3])/(P-w-f*E+f*S)}static getLesserNonNegativeNonNull(t,a){return a!==null&&a>=0&&a<t?a:t}}class gr{constructor(t){this._globe=t,this._mercatorCameraHelper=new ba,this._verticalPerspectiveCameraHelper=new Hi}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,a){return this.currentHelper.handlePanInertia(t,a)}handleMapControlsRollPitchBearingZoom(t,a){this.currentHelper.handleMapControlsRollPitchBearingZoom(t,a)}handleMapControlsPan(t,a,o){this.currentHelper.handleMapControlsPan(t,a,o)}cameraForBoxAndBearing(t,a,o,c,f){return this.currentHelper.cameraForBoxAndBearing(t,a,o,c,f)}handleJumpToCenterZoom(t,a){this.currentHelper.handleJumpToCenterZoom(t,a)}handleEaseTo(t,a){return this.currentHelper.handleEaseTo(t,a)}handleFlyTo(t,a){return this.currentHelper.handleFlyTo(t,a)}}const Rs=(d,t)=>h.C(d,t?.filter((a=>a.identifier!=="source.canvas"))),al=h.bN();class Pa extends h.E{constructor(t,a={}){var o,c;super(),this._rtlPluginLoaded=()=>{for(const y in this.tileManagers){const x=this.tileManagers[y].getSource().type;x!=="vector"&&x!=="geojson"||this.tileManagers[y].reload()}},this.map=t,this.dispatcher=new br(tr(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((y,x)=>this.getGlyphs(y,x))),this.dispatcher.registerMessageHandler("GI",((y,x)=>this.getImages(y,x))),this.dispatcher.registerMessageHandler("GDA",((y,x)=>this.getDashes(y,x))),this.imageManager=new ur,this.imageManager.setEventedParent(this);const f=((o=t._container)===null||o===void 0?void 0:o.lang)||typeof document<"u"&&((c=document.documentElement)===null||c===void 0?void 0:c.lang)||void 0;this.glyphManager=new _e(t._requestManager,a.localIdeographFontFamily,f),this.lineAtlas=new Le(256,512),this.crossTileSymbolIndex=new Ni,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",h.bO()),Yr().on(Pn,this._rtlPluginLoaded),this.on("data",(y=>{if(y.dataType!=="source"||y.sourceDataType!=="metadata")return;const x=this.tileManagers[y.sourceId];if(!x)return;const w=x.getSource();if(w?.vectorLayerIds)for(const S in this._layers){const P=this._layers[S];
796P.source===w.id&&this._validateLayer(P)}}))}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new h.bP,this._availableImages=[],this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new(((t=this.crossTileSymbolIndex)===null||t===void 0?void 0:t.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,a){var o,c,f;this._checkLoaded();const y=a===null?(f=(c=(o=this.stylesheet.state)===null||o===void 0?void 0:o[t])===null||c===void 0?void 0:c.default)!==null&&f!==void 0?f:null:a;if(h.bQ(y,this._globalState[t]))return this;this._globalState[t]=y,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();const a=[];for(const o in t)!h.bQ(this._globalState[o],t[o].default)&&(a.push(o),this._globalState[o]=t[o].default);this._applyGlobalStateChanges(a)}_applyGlobalStateChanges(t){if(t.length===0)return;const a=new Set,o={};for(const c of t){o[c]=this._globalState[c];for(const f in this._layers){const y=this._layers[f],x=y.getLayoutAffectingGlobalStateRefs(),w=y.getPaintAffectingGlobalStateRefs(),S=y.getVisibilityAffectingGlobalStateRefs();if(x.has(c)&&a.add(y.source),w.has(c))for(const{name:P,value:E}of w.get(c))this._updatePaintProperty(y,P,E);S?.has(c)&&(y.recalculateVisibility(),this._updateLayer(y))}}this.dispatcher.broadcast("UGS",o);for(const c in this.tileManagers)a.has(c)&&(this._reloadSource(c),this._changed=!0)}loadURL(t){return h._(this,arguments,void 0,(function*(a,o={},c){this.fire(new h.n("dataloading",{dataType:"style"})),o.validate=typeof o.validate!="boolean"||o.validate,this._loadStyleRequest=new AbortController;const f=this._loadStyleRequest;try{const y=yield this.map._requestManager.transformRequest(a,"Style");h.bR(f.signal);const x=yield h.k(y,f);this._loadStyleRequest===f&&(this._loadStyleRequest=null),this._load(x.data,o,c)}catch(y){this._loadStyleRequest===f&&(this._loadStyleRequest=null),y&&!f.signal.aborted&&this.fire(new h.l(h.d(y)))}}))}loadJSON(t,a={},o){this.fire(new h.n("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,ft.frameAsync(this._frameRequest,this.map._ownerWindow).then((()=>{this._frameRequest=null,a.validate=a.validate!==!1,this._load(t,a,o)})).catch((()=>{}))}loadEmpty(){this.fire(new h.n("dataloading",{dataType:"style"})),this._load(al,{validate:!1})}_load(t,a,o){var c,f;let y=a.transformStyle?a.transformStyle(o,t):t;if(!a.validate||!Rs(this,h.F(y))){y=Object.assign({},y),this._loaded=!0,this.stylesheet=y;for(const x in y.sources)this.addSource(x,y.sources[x],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs),this._createLayers(),this.light=new Ce(this.stylesheet.light),this._setProjectionInternal(((c=this.stylesheet.projection)===null||c===void 0?void 0:c.type)||"mercator"),this.sky=new Xe(this.stylesheet.sky),this.map.setTerrain((f=this.stylesheet.terrain)!==null&&f!==void 0?f:null),this.fire(new h.n("data",{dataType:"style"})),this.fire(new h.n("style.load"))}}_createLayers(){var t,a,o;const c=h.bS(this.stylesheet.layers);this.setGlobalState((t=this.stylesheet.state)!==null&&t!==void 0?t:null),this.dispatcher.broadcast("SL",c),this._order=c.map((f=>f.id)),this._layers={},this._serializedLayers=null;for(const f of c){const y=h.bT(f,this._globalState);if(y.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=y,h.bU(y)&&this.tileManagers[y.source]){const x=(o=(a=f.paint)===null||a===void 0?void 0:a["raster-fade-duration"])!==null&&o!==void 0?o:y.paint.get("raster-fade-duration");this.tileManagers[y.source].setRasterFadeDuration(x)}}}_loadSprite(t,a=!1,o=void 0){this.imageManager.setLoaded(!1);const c=new AbortController;let f;this._spriteRequest=c,(function(y,x,w,S){return h._(this,void 0,void 0,(function*(){const P=Dr(y),E=w>1?"@2x":"",C={},z={};for(const{id:B,url:N}of P){const Z=yield x.transformRequest(zr(N,E,".json"),"SpriteJSON");C[B]=h.k(Z,S);const j=yield x.transformRequest(zr(N,E,".png"),"SpriteImage");z[B]=Ut.getImage(j,S)}return yield Promise.all([...Object.values(C),...Object.values(z)]),(function(B,N){return h._(this,void 0,void 0,(function*(){const Z={};for(const j in B){Z[j]={};const G=ft.getImageCanvasContext((yield N[j]).data),X=(yield B[j]).data;for(const $ in X){const{width:U,height:H,x:q,y:Q,sdf:ne,pixelRatio:se,stretchX:me,stretchY:pe,content:Ae,textFitWidth:Te,textFitHeight:ue}=X[$];Z[j][$]={data:null,pixelRatio:se,sdf:ne,stretchX:me,stretchY:pe,content:Ae,textFitWidth:Te,textFitHeight:ue,spriteData:{width:U,height:H,x:q,y:Q,context:G}}}}return Z}))})(C,z)}))})(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((y=>{if(this._spriteRequest=null,y)for(const x in y){this._spritesImagesIds[x]=[];const w=this._spritesImagesIds[x]?this._spritesImagesIds[x].filter((S=>!(S in y))):[];for(const S of w)this.imageManager.removeImage(S),this._changedImages[S]=!0;for(const S in y[x]){const P=x==="default"?S:`${x}:${S}`;this._spritesImagesIds[x].push(P),P in this.imageManager.images?this.imageManager.updateImage(P,y[x][S],!1):this.imageManager.addImage(P,y[x][S]),a&&(this._changedImages[P]=!0)}}})).catch((y=>{this._spriteRequest=null,f=y,c.signal.aborted||this.fire(new h.l(f))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),a&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new h.n("data",{dataType:"style"})),o&&o(f)}))}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new h.n("data",{dataType:"style"}))}_validateLayer(t){const a=this.tileManagers[t.source];if(!a)return;const o=t.sourceLayer;if(!o)return;const c=a.getSource();(c.type==="geojson"||c.vectorLayerIds&&!c.vectorLayerIds.includes(o))&&this.fire(new h.l(new Error(`Source layer "${o}" does not exist on source "${c.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(t,a=!1){const o=this._serializedAllLayers();if(!t||t.length===0)return Object.values(a?h.bV(o):o);const c=[];
vendor: 107,459 bytes, lines 796-800
796for(const f of t)if(o[f]){const y=a?h.bV(o[f]):o[f];c.push(y)}return c}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const a=Object.keys(this._layers);for(const o of a){const c=this._layers[o];c.type!=="custom"&&(t[o]=c.serialize())}return t}hasTransitions(){var t,a,o;if(!((t=this.light)===null||t===void 0)&&t.hasTransition()||!((a=this.sky)===null||a===void 0)&&a.hasTransition()||!((o=this.projection)===null||o===void 0)&&o.hasTransition())return!0;for(const c in this.tileManagers)if(this.tileManagers[c].hasTransition())return!0;for(const c in this._layers)if(this._layers[c].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const a=this._changed;if(a){const c=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);(c.length||f.length)&&this._updateWorkerLayers(c,f);for(const y in this._updatedSources){const x=this._updatedSources[y];if(x==="reload")this._reloadSource(y);else{if(x!=="clear")throw new Error(`Invalid action ${x}`);this._clearSource(y)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const y in this._updatedPaintProps)this._layers[y].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const o={};for(const c in this.tileManagers){const f=this.tileManagers[c];o[c]=f.used,f.used=!1}for(const c of this._order){const f=this._layers[c];f.recalculate(t,this._availableImages),!f.isHidden(t.zoom)&&f.source&&(this.tileManagers[f.source].used=!0)}for(const c in o){const f=this.tileManagers[c];!!o[c]!=!!f.used&&f.fire(new h.n("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,a&&this.fire(new h.n("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const a in this.tileManagers)this.tileManagers[a].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,a){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:a})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,a={}){var o;this._checkLoaded();const c=this.serialize();if(t=a.transformStyle?a.transformStyle(c,t):t,((o=a.validate)===null||o===void 0||o)&&Rs(this,h.F(t)))return!1;(t=h.bV(t)).layers=h.bS(t.layers);const f=h.bW(c,t),y=this._getOperationsToPerform(f);if(y.unimplemented.length>0)throw new Error(`Unimplemented: ${y.unimplemented.join(", ")}.`);if(y.operations.length===0)return!1;for(const x of y.operations)x();return this.stylesheet=t,this._serializedLayers=null,this.fire(new h.n("style.load",{style:this})),!0}_getOperationsToPerform(t){const a=[],o=[];for(const c of t)switch(c.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":a.push((()=>this.addLayer.apply(this,c.args)));break;case"removeLayer":a.push((()=>this.removeLayer.apply(this,c.args)));break;case"setPaintProperty":a.push((()=>this.setPaintProperty.apply(this,c.args)));break;case"setLayoutProperty":a.push((()=>this.setLayoutProperty.apply(this,c.args)));break;case"setFilter":a.push((()=>this.setFilter.apply(this,c.args)));break;case"addSource":a.push((()=>this.addSource.apply(this,c.args)));break;case"removeSource":a.push((()=>this.removeSource.apply(this,c.args)));break;case"setLayerZoomRange":a.push((()=>this.setLayerZoomRange.apply(this,c.args)));break;case"setLight":a.push((()=>this.setLight.apply(this,c.args)));break;case"setGeoJSONSourceData":a.push((()=>this.setGeoJSONSourceData.apply(this,c.args)));break;case"setGlyphs":a.push((()=>this.setGlyphs.apply(this,c.args)));break;case"setSprite":a.push((()=>this.setSprite.apply(this,c.args)));break;case"setTerrain":a.push((()=>this.map.setTerrain.apply(this,c.args)));break;case"setSky":a.push((()=>this.setSky.apply(this,c.args)));break;case"setProjection":this.setProjection.apply(this,c.args);break;case"setGlobalState":a.push((()=>this.setGlobalState.apply(this,c.args)));break;case"setTransition":a.push((()=>{}));break;default:o.push(c.command)}return{operations:a,unimplemented:o}}addImage(t,a){if(this.getImage(t))return this.fire(new h.l(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,a),this._afterImageUpdated(t)}updateImage(t,a){this.imageManager.updateImage(t,a)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new h.l(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new h.n("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,a,o={}){var c;if(this._checkLoaded(),this.tileManagers[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!a.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(a).join(", ")}.`);if(["vector","raster","geojson","video","image"].includes(a.type)&&this._validate(h.F.source,`sources.${t}`,a,null,o))return;!((c=this.map)===null||c===void 0)&&c._collectResourceTiming&&(a.collectResourceTiming=!0);const f=this.tileManagers[t]=new hi(t,a,this.dispatcher);f.style=this,f.setEventedParent(this,(()=>({isSourceLoaded:f.loaded(),source:f.serialize(),sourceId:t}))),f.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error(`There is no source with this ID=${t}`);for(const o in this._layers)if(this._layers[o].source===t)return this.fire(new h.l(new Error(`Source "${t}" cannot be removed while layer "${o}" is using it.`)));const a=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],a.fire(new h.n("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),a.setEventedParent(null),a.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,a){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const o=this.tileManagers[t].getSource();if(o.type!=="geojson")throw new Error(`geojsonSource.type is ${o.type}, which is !== 'geojson`);o.setData(a),this._changed=!0}getSource(t){var a;return(a=this.tileManagers[t])===null||a===void 0?void 0:a.getSource()}addLayer(t,a,o={}){this._checkLoaded();const c=t.id;if(this.getLayer(c))return void this.fire(new h.l(new Error(`Layer "${c}" already exists on this map.`)));let f;if(t.type==="custom"){if(Rs(this,h.bX(t)))return;f=h.bT(t,this._globalState)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(c,t.source),t=h.bV(t),t=h.e(t,{source:c})),this._validate(h.F.layer,`layers.${c}`,t,{arrayIndex:-1},o))return;f=h.bT(t,this._globalState),this._validateLayer(f),f.setEventedParent(this,{layer:{id:c}})}const y=a?this._order.indexOf(a):this._order.length;if(a&&y===-1)this.fire(new h.l(new Error(`Cannot add layer "${c}" before non-existing layer "${a}".`)));else{if(this._order.splice(y,0,c),this._layerOrderChanged=!0,this._layers[c]=f,this._removedLayers[c]&&f.source&&f.type!=="custom"){const x=this._removedLayers[c];delete this._removedLayers[c],x.type!==f.type?this._updatedSources[f.source]="clear":(this._updatedSources[f.source]="reload",this.tileManagers[f.source].pause())}this._updateLayer(f),f.onAdd&&f.onAdd(this.map)}}moveLayer(t,a){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new h.l(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===a)return;const o=this._order.indexOf(t);this._order.splice(o,1);const c=a?this._order.indexOf(a):this._order.length;a&&c===-1?this.fire(new h.l(new Error(`Cannot move layer "${t}" before non-existing layer "${a}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const a=this._layers[t];if(!a)return void this.fire(new h.l(new Error(`Cannot remove non-existing layer "${t}".`)));a.setEventedParent(null);const o=this._order.indexOf(t);this._order.splice(o,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=a,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],a.onRemove&&a.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,a,o){this._checkLoaded();const c=this.getLayer(t);c?c.minzoom===a&&c.maxzoom===o||(a!=null&&(c.minzoom=a),o!=null&&(c.maxzoom=o),this._updateLayer(c)):this.fire(new h.l(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,a,o={}){this._checkLoaded();const c=this.getLayer(t);if(c){if(!h.bQ(c.filter,a))return a==null?(c.setFilter(void 0),void this._updateLayer(c)):void(this._validate(h.F.filter,`layers.${c.id}.filter`,a,null,o)||(c.setFilter(h.bV(a)),this._updateLayer(c)))}else this.fire(new h.l(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return h.bV(this.getLayer(t).filter)}setLayoutProperty(t,a,o,c={}){this._checkLoaded();const f=this.getLayer(t);f?h.bQ(f.getLayoutProperty(a),o)||(f.setLayoutProperty(a,o,c),this._updateLayer(f)):this.fire(new h.l(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,a){const o=this.getLayer(t);if(o)return o.getLayoutProperty(a);this.fire(new h.l(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,a,o,c={}){this._checkLoaded();const f=this.getLayer(t);f?h.bQ(f.getPaintProperty(a),o)||this._updatePaintProperty(f,a,o,c):this.fire(new h.l(new Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,a,o,c={}){t.setPaintProperty(a,o,c)&&this._updateLayer(t),h.bU(t)&&a==="raster-fade-duration"&&this.tileManagers[t.source].setRasterFadeDuration(o),this._changed=!0,this._updatedPaintProps[t.id]=!0,this._serializedLayers=null}getPaintProperty(t,a){return this.getLayer(t).getPaintProperty(a)}setFeatureState(t,a){this._checkLoaded();const o=t.source,c=t.sourceLayer,f=this.tileManagers[o];if(f===void 0)return void this.fire(new h.l(new Error(`The source '${o}' does not exist in the map's style.`)));const y=f.getSource().type;y==="geojson"&&c?this.fire(new h.l(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):y!=="vector"||c?(t.id===void 0&&this.fire(new h.l(new Error("The feature id parameter must be provided."))),f.setFeatureState(c,t.id,a)):this.fire(new h.l(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,a){this._checkLoaded();const o=t.source,c=this.tileManagers[o];if(c===void 0)return void this.fire(new h.l(new Error(`The source '${o}' does not exist in the map's style.`)));const f=c.getSource().type,y=f==="vector"?t.sourceLayer:void 0;f!=="vector"||y?a&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new h.l(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(y,t.id,a):this.fire(new h.l(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const a=t.source,o=t.sourceLayer,c=this.tileManagers[a];if(c!==void 0)return c.getSource().type!=="vector"||o?(t.id===void 0&&this.fire(new h.l(new Error("The feature id parameter must be provided."))),c.getFeatureState(o,t.id)):void this.fire(new h.l(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new h.l(new Error(`The source '${a}' does not exist in the map's style.`)))}getTransition(){var t;return h.e({duration:300,delay:0},(t=this.stylesheet)===null||t===void 0?void 0:t.transition)}serialize(){if(!this._loaded)return;const t=h.bY(this.tileManagers,(f=>f.serialize())),a=this._serializeByIds(this._order,!0),o=this.map.getTerrain()||void 0,c=this.stylesheet;return h.bZ({version:c.version,name:c.name,metadata:c.metadata,light:c.light,sky:c.sky,center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,sprite:c.sprite,glyphs:c.glyphs,transition:c.transition,projection:c.projection,sources:t,layers:a,terrain:o},(f=>f!==void 0))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.tileManagers[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const a=y=>this._layers[y].type==="fill-extrusion",o={},c=[];for(let y=this._order.length-1;y>=0;y--){const x=this._order[y];if(a(x)){o[x]=y;for(const w of t){const S=w[x];if(S)for(const P of S)c.push(P)}}}c.sort(((y,x)=>x.intersectionZ-y.intersectionZ));const f=[];for(let y=this._order.length-1;y>=0;y--){const x=this._order[y];if(a(x))for(let w=c.length-1;w>=0;w--){const S=c[w].feature;if(o[S.layer.id]<y)break;f.push(S),c.pop()}else for(const w of t){const S=w[x];if(S)for(const P of S)f.push(P.feature)}}return f}queryRenderedFeatures(t,a,o){a?.filter&&this._validate(h.F.filter,"queryRenderedFeatures.filter",a.filter,null,a);const c={};if(a?.layers){if(!(Array.isArray(a.layers)||a.layers instanceof Set))return this.fire(new h.l(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const S of a.layers){const P=this._layers[S];if(!P)return this.fire(new h.l(new Error(`The layer '${S}' does not exist in the map's style and cannot be queried for features.`))),[];c[P.source]=!0}}const f=[];a.availableImages=this._availableImages;const y=this._serializedAllLayers(),x=a.layers instanceof Set?a.layers:Array.isArray(a.layers)?new Set(a.layers):null,w=Object.assign(Object.assign({},a),{layers:x,globalState:this._globalState});for(const S in this.tileManagers)a.layers&&!c[S]||f.push(Ii(this.tileManagers[S],this._layers,y,t,w,o,this.map.terrain?(P,E,C)=>this.map.terrain.getElevation(P,E,C):void 0));return this.placement&&f.push((function(S,P,E,C,z,B,N){const Z={},j=B.queryRenderedSymbols(C),G=[];for(const X of Object.keys(j).map(Number))G.push(N[X]);G.sort(Hr);for(const X of G){const $=X.featureIndex.lookupSymbolFeatures(j[X.bucketInstanceId],P,X.bucketIndex,X.sourceLayerIndex,{filterSpec:z.filter,globalState:z.globalState},z.layers,z.availableImages,S);for(const U in $){Z[U]||(Z[U]=[]);const H=$[U];H.sort(((q,Q)=>{const ne=X.featureSortOrder;if(ne){const se=ne.indexOf(q.featureIndex);return ne.indexOf(Q.featureIndex)-se}return Q.featureIndex-q.featureIndex}));for(const q of H)Z[U].push(q)}}return(function(X,$,U){for(const H in X)for(const q of X[H])Gi(q,U[$[H].source]);return X})(Z,S,E)})(this._layers,y,this.tileManagers,t,w,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(f)}querySourceFeatures(t,a){a?.filter&&this._validate(h.F.filter,"querySourceFeatures.filter",a.filter,null,a);const o=this.tileManagers[t];return o?(function(c,f){const y=c.getRenderableIds().map((S=>c.getTileByID(S))),x=[],w={};for(const S of y){const P=S.tileID.canonical.key;w[P]||(w[P]=!0,S.querySourceFeatures(x,f))}return x})(o,a?Object.assign(Object.assign({},a),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,a={}){this._checkLoaded();const o=this.light.getLight();let c=!1;for(const y in t)if(!h.bQ(t[y],o[y])){c=!0;break}if(!c)return;const f={now:je(),transition:h.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,a),this.light.updateTransitions(f)}getProjection(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.projection}setProjection(t){this._checkLoaded();const a=t??{type:"mercator"};if(this.stylesheet.projection=t,this.projection){if(this.projection.name===a.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(a.type)}getSky(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.sky}setSky(t,a={}){this._checkLoaded();const o=this.getSky();let c=!1;if(!t&&!o)return;if(t&&!o)c=!0;else if(!t&&o)c=!0;else for(const y in t)if(!h.bQ(t[y],o[y])){c=!0;break}if(!c)return;const f={now:je(),transition:h.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,a),this.sky.updateTransitions(f)}_setProjectionInternal(t){const a=(function(o,c){const f={constrainOverride:c};if(Array.isArray(o)){const y=new Tc({type:o});return{projection:y,transform:new an(f),cameraHelper:new gr(y)}}switch(o){case"mercator":return{projection:new Ai,transform:new xa(f),cameraHelper:new ba};case"globe":{const y=new Tc({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:y,transform:new an(f),cameraHelper:new gr(y)}}case"vertical-perspective":return{projection:new Cs,transform:new Sa(f),cameraHelper:new Hi};default:return h.w(`Unknown projection name: ${o}. Falling back to mercator projection.`),{projection:new Ai,transform:new xa(f),cameraHelper:new ba}}})(t,this.map.transformConstrain);this.projection=a.projection,this.map.migrateProjection(a.transform,a.cameraHelper);for(const o in this.tileManagers)this.tileManagers[o].reload()}_validate(t,a,o,c,f={}){return f?.validate!==!1&&Rs(this,t.call(h.F,h.e({key:a,style:this.serialize(),value:o,styleSpec:h.x},c)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),Yr().off(Pn,this._rtlPluginLoaded);for(const a in this._layers)this._layers[a].setEventedParent(null);for(const a in this.tileManagers){const o=this.tileManagers[a];o.setEventedParent(null),o.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(const a in this.tileManagers)this.tileManagers[a].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.tileManagers)this._reloadSource(t)}_updatePlacement(t,a,o,c,f=!1){let y=!1,x=!1;const w={};for(const S of this._order){const P=this._layers[S];if(P.type!=="symbol")continue;if(!w[P.source]){const C=this.tileManagers[P.source];w[P.source]=C.getRenderableIds(!0).map((z=>C.getTileByID(z))).sort(((z,B)=>B.tileID.overscaledZ-z.tileID.overscaledZ||(z.tileID.isLessThan(B.tileID)?-1:1)))}const E=this.crossTileSymbolIndex.addLayer(P,w[P.source],t.center.lng);y||(y=E)}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),f||(f=this._layerOrderChanged||o===0),(f||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(je(),t.zoom))&&(this.pauseablePlacement=new Ya(t,this.map.terrain,this._order,f,a,o,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,w),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(je()),x=!0),y&&this.pauseablePlacement.placement.setStale()),x||y)for(const S of this._order){const P=this._layers[S];P.type==="symbol"&&this.placement.updateLayerOpacities(P,w[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(je())}_releaseSymbolFadeTiles(){for(const t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,a){return h._(this,void 0,void 0,(function*(){const o=yield this.imageManager.getImages(a.icons);this._updateTilesForChangedImages();const c=this.tileManagers[a.source];return c&&c.setDependencies(a.tileID.key,a.type,a.icons),o}))}getGlyphs(t,a){return h._(this,void 0,void 0,(function*(){const o=yield this.glyphManager.getGlyphs(a.stacks),c=this.tileManagers[a.source];return c&&c.setDependencies(a.tileID.key,a.type,[""]),o}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,a={}){this._checkLoaded(),t&&this._validate(h.F.glyphs,"glyphs",t,null,a)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,a){return h._(this,void 0,void 0,(function*(){const o={};for(const[c,f]of Object.entries(a.dashes))o[c]=this.lineAtlas.getDash(f.dasharray,f.round);return o}))}addSprite(t,a,o={},c){this._checkLoaded();const f=[{id:t,url:a}],y=[...Dr(this.stylesheet.sprite),...f];this._validate(h.F.sprite,"sprite",y,null,o)||(this.stylesheet.sprite=y,this._loadSprite(f,!0,c))}removeSprite(t){this._checkLoaded();const a=Dr(this.stylesheet.sprite);if(a.find((o=>o.id===t))){if(this._spritesImagesIds[t])for(const o of this._spritesImagesIds[t])this.imageManager.removeImage(o),this._changedImages[o]=!0;a.splice(a.findIndex((o=>o.id===t)),1),this.stylesheet.sprite=a.length>0?a:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new h.n("data",{dataType:"style"}))}else this.fire(new h.l(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return Dr(this.stylesheet.sprite)}setSprite(t,a={},o){this._checkLoaded(),t&&this._validate(h.F.sprite,"sprite",t,null,a)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,o):(this._unloadSprite(),o&&o(null)))}destroy(){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null);for(const t in this.tileManagers){const a=this.tileManagers[t];a.setEventedParent(null),a.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(const t in this._layers){const a=this._layers[t];a.setEventedParent(null),a.onRemove&&a.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}}var Bn=h.aS([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Xu{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,a,o,c,f,y,x,w,S){this.context=t;let P=this.boundPaintVertexBuffers.length!==c.length;for(let E=0;!P&&E<c.length;E++)this.boundPaintVertexBuffers[E]!==c[E]&&(P=!0);!this.vao||this.boundProgram!==a||this.boundLayoutVertexBuffer!==o||P||this.boundIndexBuffer!==f||this.boundVertexOffset!==y||this.boundDynamicVertexBuffer!==x||this.boundDynamicVertexBuffer2!==w||this.boundDynamicVertexBuffer3!==S?this.freshBind(a,o,c,f,y,x,w,S):(t.bindVertexArray.set(this.vao),x&&x.bind(),f?.dynamicDraw&&f.bind(),w&&w.bind(),S&&S.bind())}freshBind(t,a,o,c,f,y,x,w){const S=t.numAttributes,P=this.context,E=P.gl;this.vao&&this.destroy(),this.vao=P.createVertexArray(),P.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=a,this.boundPaintVertexBuffers=o,this.boundIndexBuffer=c,this.boundVertexOffset=f,this.boundDynamicVertexBuffer=y,this.boundDynamicVertexBuffer2=x,this.boundDynamicVertexBuffer3=w,a.enableAttributes(E,t);for(const C of o)C.enableAttributes(E,t);y&&y.enableAttributes(E,t),x&&x.enableAttributes(E,t),w&&w.enableAttributes(E,t),a.bind(),a.setVertexAttribPointers(E,t,f);for(const C of o)C.bind(),C.setVertexAttribPointers(E,t,f);y&&(y.bind(),y.setVertexAttribPointers(E,t,f)),c&&c.bind(),x&&(x.bind(),x.setVertexAttribPointers(E,t,f)),w&&(w.bind(),w.setVertexAttribPointers(E,t,f)),P.currentNumAttributes=S}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const ks=(d,t,a,o,c)=>({u_texture:0,u_ele_delta:d,u_fog_matrix:t,u_fog_color:a?a.properties.get("fog-color"):h.bo.white,u_fog_ground_blend:a?a.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:c?0:a?a.calculateFogBlendOpacity(o):0,u_horizon_color:a?a.properties.get("horizon-color"):h.bo.white,u_horizon_fog_blend:a?a.properties.get("horizon-fog-blend"):1,u_is_globe_mode:c?1:0}),Yu={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function Fr(d){const t=[];for(const a of d){if(a===null)continue;const o=a.split(" ");t.push(o.pop())}return t}class Ku{constructor(t,a,o,c,f,y,x,w,S=[]){const P=t.gl;this.program=P.createProgram();const E=Fr(a.staticAttributes),C=o?o.getBinderAttributes():[],z=E.concat(C),B=It.prelude.staticUniforms?Fr(It.prelude.staticUniforms):[],N=x.staticUniforms?Fr(x.staticUniforms):[],Z=a.staticUniforms?Fr(a.staticUniforms):[],j=o?o.getBinderUniforms():[],G=B.concat(N).concat(Z).concat(j),X=[];for(const se of G)X.includes(se)||X.push(se);const $=o?o.defines():[];mr(P)&&$.unshift("#version 300 es"),f&&$.push("#define OVERDRAW_INSPECTOR;"),y&&$.push("#define TERRAIN3D;"),w&&$.push(w),S&&$.push(...S);let U=$.concat(It.prelude.fragmentSource,x.fragmentSource,a.fragmentSource).join(`
797`),H=$.concat(It.prelude.vertexSource,x.vertexSource,a.vertexSource).join(`
798`);mr(P)||(U=(function(se){return se.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")})(U),H=(function(se){return se.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")})(H));const q=P.createShader(P.FRAGMENT_SHADER);if(P.isContextLost())return void(this.failedToCreate=!0);if(P.shaderSource(q,U),P.compileShader(q),!P.getShaderParameter(q,P.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${P.getShaderInfoLog(q)}`);P.attachShader(this.program,q);const Q=P.createShader(P.VERTEX_SHADER);if(P.isContextLost())return void(this.failedToCreate=!0);if(P.shaderSource(Q,H),P.compileShader(Q),!P.getShaderParameter(Q,P.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${P.getShaderInfoLog(Q)}`);P.attachShader(this.program,Q),this.attributes={};const ne={};this.numAttributes=z.length;for(let se=0;se<this.numAttributes;se++)z[se]&&(P.bindAttribLocation(this.program,se,z[se]),this.attributes[z[se]]=se);if(P.linkProgram(this.program),!P.getProgramParameter(this.program,P.LINK_STATUS))throw new Error(`Program failed to link: ${P.getProgramInfoLog(this.program)}`);P.deleteShader(Q),P.deleteShader(q);for(const se of X)if(se&&!ne[se]){const me=P.getUniformLocation(this.program,se);me&&(ne[se]=me)}this.fixedUniforms=c(t,ne),this.terrainUniforms=((se,me)=>({u_depth:new h.b_(se,me.u_depth),u_terrain:new h.b_(se,me.u_terrain),u_terrain_dim:new h.bp(se,me.u_terrain_dim),u_terrain_matrix:new h.c0(se,me.u_terrain_matrix),u_terrain_unpack:new h.c1(se,me.u_terrain_unpack),u_terrain_exaggeration:new h.bp(se,me.u_terrain_exaggeration)}))(t,ne),this.projectionUniforms=((se,me)=>({u_projection_matrix:new h.c0(se,me.u_projection_matrix),u_projection_tile_mercator_coords:new h.c1(se,me.u_projection_tile_mercator_coords),u_projection_clipping_plane:new h.c1(se,me.u_projection_clipping_plane),u_projection_transition:new h.bp(se,me.u_projection_transition),u_projection_fallback_matrix:new h.c0(se,me.u_projection_fallback_matrix)}))(t,ne),this.binderUniforms=o?o.getUniforms(t,ne):[]}draw(t,a,o,c,f,y,x,w,S,P,E,C,z,B,N,Z,j,G,X){var $;const U=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(o),t.setStencilMode(c),t.setColorMode(f),t.setCullFace(y),w){t.activeTexture.set(U.TEXTURE2),U.bindTexture(U.TEXTURE_2D,w.depthTexture),t.activeTexture.set(U.TEXTURE3),U.bindTexture(U.TEXTURE_2D,w.texture);for(const q in this.terrainUniforms)this.terrainUniforms[q].set(w[q])}if(S)for(const q in S)this.projectionUniforms[Yu[q]].set(S[q]);if(x)for(const q in this.fixedUniforms)this.fixedUniforms[q].set(x[q]);Z&&Z.setUniforms(t,this.binderUniforms,B,{zoom:N});let H=0;switch(a){case U.LINES:H=2;break;case U.TRIANGLES:H=3;break;case U.LINE_STRIP:H=1}for(const q of z.get())q.vaos||(q.vaos={}),($=q.vaos)[P]||($[P]=new Xu),q.vaos[P].bind(t,this,E,Z?Z.getPaintVertexBuffers():[],C,q.vertexOffset,j,G,X),U.drawElements(a,q.primitiveLength*H,U.UNSIGNED_SHORT,q.primitiveOffset*H*2)}}function nl(d,t,a){const o=1/h.aK(a,1,t.transform.tileZoom),c=Math.pow(2,a.tileID.overscaledZ),f=a.tileSize*Math.pow(2,t.transform.tileZoom)/c,y=f*(a.tileID.canonical.x+a.tileID.wrap*c),x=f*a.tileID.canonical.y;return{u_image:0,u_texsize:a.imageAtlasTexture.size,u_scale:[o,d.fromScale,d.toScale],u_fade:d.t,u_pixel_coord_upper:[y>>16,x>>16],u_pixel_coord_lower:[65535&y,65535&x]}}const Mc=(d,t,a,o)=>{const c=d.style.light,f=c.properties.get("position"),y=[f.x,f.y,f.z],x=h.c4();c.properties.get("anchor")==="viewport"&&h.c5(x,d.transform.bearingInRadians),h.c6(y,y,x);const w=d.transform.transformLightDirection(y),S=c.properties.get("color");return{u_lightpos:y,u_lightpos_globe:w,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[S.r,S.g,S.b],u_vertical_gradient:+t,u_opacity:a,u_fill_translate:o}},Ic=(d,t,a,o,c,f,y)=>h.e(Mc(d,t,a,o),nl(f,d,y),{u_height_factor:-Math.pow(2,c.overscaledZ)/y.tileSize/8}),Ls=(d,t,a,o)=>h.e(nl(t,d,a),{u_fill_translate:o}),Ec=(d,t)=>({u_world:d,u_fill_translate:t}),Cc=(d,t,a,o,c)=>h.e(Ls(d,t,a,c),{u_world:o}),Ac=(d,t,a,o,c)=>{const f=d.transform;let y,x,w=0;if(a.paint.get("circle-pitch-alignment")==="map"){const S=h.aK(t,1,f.zoom);y=!0,x=[S,S],w=S/(h.a6*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*c}else y=!1,x=f.pixelsToGLUnits;return{u_camera_to_center_distance:f.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+y,u_device_pixel_ratio:d.pixelRatio,u_extrude_scale:x,u_globe_extrude_scale:w,u_translate:o}},Dc=d=>({u_pixel_extrude_scale:[1/d.width,1/d.height]}),Ma=d=>({u_viewport_size:[d.width,d.height]}),sl=(d,t=1)=>({u_color:d,u_overlay:0,u_overlay_scale:t}),ol=(d,t,a,o)=>{const c=h.aK(d,1,t)/(h.a6*Math.pow(2,d.tileID.overscaledZ))*2*Math.PI*o;return{u_extrude_scale:h.aK(d,1,t),u_intensity:a,u_globe_extrude_scale:c}},nn=(d,t,a,o)=>{const c=h.O();h.c7(c,0,d.width,d.height,0,0,1);const f=d.context.gl;return{u_matrix:c,u_world:[f.drawingBufferWidth,f.drawingBufferHeight],u_image:a,u_color_ramp:o,u_opacity:t.paint.get("heatmap-opacity")}},Ju=(d,t,a)=>{const o=a.paint.get("hillshade-accent-color");let c;switch(a.paint.get("hillshade-method")){case"basic":c=4;break;case"combined":c=1;break;case"igor":c=2;break;case"multidirectional":c=3;break;default:c=0}const f=a.getIlluminationProperties();for(let y=0;y<f.directionRadians.length;y++)a.paint.get("hillshade-illumination-anchor")==="viewport"&&(f.directionRadians[y]+=d.transform.bearingInRadians);return{u_image:0,u_latrange:Qu(0,t.tileID),u_exaggeration:a.paint.get("hillshade-exaggeration"),u_altitudes:f.altitudeRadians,u_azimuths:f.directionRadians,u_accent:o,u_method:c,u_highlights:f.highlightColor,u_shadows:f.shadowColor}},Fs=(d,t)=>{const a=t.stride,o=h.O();return h.c7(o,0,h.a6,-h.a6,0,0,1),h.Q(o,o,[0,-h.a6,0]),{u_matrix:o,u_image:1,u_dimension:[a,a],u_zoom:d.overscaledZ,u_unpack:t.getUnpackVector()}};function Qu(d,t){const a=Math.pow(2,t.canonical.z),o=t.canonical.y;return[new h.a7(0,o/a).toLngLat().lat,new h.a7(0,(o+1)/a).toLngLat().lat]}const eh=(d,t,a=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:a,u_opacity:d.paint.get("color-relief-opacity")}),On=(d,t,a,o)=>{const c=d.transform;return{u_translation:Pr(d,t,a),u_ratio:o/h.aK(t,1,c.zoom),u_device_pixel_ratio:d.pixelRatio,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},zc=(d,t,a,o,c)=>h.e(On(d,t,a,o),{u_image:0,u_image_height:c}),Rc=(d,t,a,o,c)=>{const f=d.transform,y=sn(t,f);return{u_translation:Pr(d,t,a),u_texsize:t.imageAtlasTexture.size,u_ratio:o/h.aK(t,1,f.zoom),u_device_pixel_ratio:d.pixelRatio,u_image:0,u_scale:[y,c.fromScale,c.toScale],u_fade:c.t,u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]]}},ll=(d,t,a,o,c)=>{const f=sn(t,d.transform);return h.e(On(d,t,a,o),{u_tileratio:f,u_crossfade_from:c.fromScale,u_crossfade_to:c.toScale,u_image:0,u_mix:c.t,u_lineatlas_width:d.lineAtlas.width,u_lineatlas_height:d.lineAtlas.height})},kc=(d,t,a,o,c,f)=>{const y=sn(t,d.transform);return h.e(On(d,t,a,o),{u_image:0,u_image_height:f,u_tileratio:y,u_crossfade_from:c.fromScale,u_crossfade_to:c.toScale,u_image_dash:1,u_mix:c.t,u_lineatlas_width:d.lineAtlas.width,u_lineatlas_height:d.lineAtlas.height})};function sn(d,t){return 1/h.aK(d,1,t.tileZoom)}function Pr(d,t,a){return h.aL(d.transform,t,a.paint.get("line-translate"),a.paint.get("line-translate-anchor"))}const cl=(d,t,a,o,c)=>{return{u_tl_parent:d,u_scale_parent:t,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(y=o.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(f=o.paint.get("raster-contrast"),f>0?1/(1-f):1+f),u_spin_weights:ul(o.paint.get("raster-hue-rotate")),u_coords_top:[c[0].x,c[0].y,c[1].x,c[1].y],u_coords_bottom:[c[3].x,c[3].y,c[2].x,c[2].y]};var f,y};function ul(d){d*=Math.PI/180;const t=Math.sin(d),a=Math.cos(d);return[(2*a+1)/3,(-Math.sqrt(3)*t-a+1)/3,(Math.sqrt(3)*t-a+1)/3]}const Bs=(d,t,a,o,c,f,y,x,w,S,P,E,C)=>{const z=y.transform;return{u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:z.cameraToCenterDistance,u_pitch:z.pitch/360*2*Math.PI,u_rotate_symbol:+a,u_aspect_ratio:z.width/z.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_label_plane_matrix:x,u_coord_matrix:w,u_is_text:+P,u_pitch_with_map:+o,u_is_along_line:c,u_is_variable_anchor:f,u_texsize:E,u_texture:0,u_translation:S,u_pitched_scale:C}},hl=(d,t,a,o,c,f,y,x,w,S,P,E,C,z)=>{const B=y.transform;return h.e(Bs(d,t,a,o,c,f,y,x,w,S,P,E,z),{u_gamma_scale:o?Math.cos(B.pitch*Math.PI/180)*B.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:C?1:0,u_is_plain:1})},dl=(d,t,a,o,c,f,y,x,w,S,P,E,C)=>h.e(hl(d,t,a,o,c,f,y,x,w,S,!0,P,!0,C),{u_texsize_icon:E,u_texture_icon:1}),Ia=(d,t)=>({u_opacity:d,u_color:t}),pl=(d,t,a,o,c)=>h.e((function(f,y,x,w){const S=x.imageManager.getPattern(f.from.toString()),P=x.imageManager.getPattern(f.to.toString()),{width:E,height:C}=x.imageManager.getPixelSize(),z=Math.pow(2,w.tileID.overscaledZ),B=w.tileSize*Math.pow(2,x.transform.tileZoom)/z,N=B*(w.tileID.canonical.x+w.tileID.wrap*z),Z=B*w.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:S.tl,u_pattern_br_a:S.br,u_pattern_tl_b:P.tl,u_pattern_br_b:P.br,u_texsize:[E,C],u_mix:y.t,u_pattern_size_a:S.displaySize,u_pattern_size_b:P.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/h.aK(w,1,x.transform.tileZoom),u_pixel_coord_upper:[N>>16,Z>>16],u_pixel_coord_lower:[65535&N,65535&Z]}})(a,c,t,o),{u_opacity:d}),Lc=(d,t)=>{},th={fillExtrusion:(d,t)=>({u_lightpos:new h.c2(d,t.u_lightpos),u_lightpos_globe:new h.c2(d,t.u_lightpos_globe),u_lightintensity:new h.bp(d,t.u_lightintensity),u_lightcolor:new h.c2(d,t.u_lightcolor),u_vertical_gradient:new h.bp(d,t.u_vertical_gradient),u_opacity:new h.bp(d,t.u_opacity),u_fill_translate:new h.c3(d,t.u_fill_translate)}),fillExtrusionPattern:(d,t)=>({u_lightpos:new h.c2(d,t.u_lightpos),u_lightpos_globe:new h.c2(d,t.u_lightpos_globe),u_lightintensity:new h.bp(d,t.u_lightintensity),u_lightcolor:new h.c2(d,t.u_lightcolor),u_vertical_gradient:new h.bp(d,t.u_vertical_gradient),u_height_factor:new h.bp(d,t.u_height_factor),u_opacity:new h.bp(d,t.u_opacity),u_fill_translate:new h.c3(d,t.u_fill_translate),u_image:new h.b_(d,t.u_image),u_texsize:new h.c3(d,t.u_texsize),u_pixel_coord_upper:new h.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.c3(d,t.u_pixel_coord_lower),u_scale:new h.c2(d,t.u_scale),u_fade:new h.bp(d,t.u_fade)}),fill:(d,t)=>({u_fill_translate:new h.c3(d,t.u_fill_translate)}),fillPattern:(d,t)=>({u_image:new h.b_(d,t.u_image),u_texsize:new h.c3(d,t.u_texsize),u_pixel_coord_upper:new h.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.c3(d,t.u_pixel_coord_lower),u_scale:new h.c2(d,t.u_scale),u_fade:new h.bp(d,t.u_fade),u_fill_translate:new h.c3(d,t.u_fill_translate)}),fillOutline:(d,t)=>({u_world:new h.c3(d,t.u_world),u_fill_translate:new h.c3(d,t.u_fill_translate)}),fillOutlinePattern:(d,t)=>({u_world:new h.c3(d,t.u_world),u_image:new h.b_(d,t.u_image),u_texsize:new h.c3(d,t.u_texsize),u_pixel_coord_upper:new h.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.c3(d,t.u_pixel_coord_lower),u_scale:new h.c2(d,t.u_scale),u_fade:new h.bp(d,t.u_fade),u_fill_translate:new h.c3(d,t.u_fill_translate)}),circle:(d,t)=>({u_camera_to_center_distance:new h.bp(d,t.u_camera_to_center_distance),u_scale_with_map:new h.b_(d,t.u_scale_with_map),u_pitch_with_map:new h.b_(d,t.u_pitch_with_map),u_extrude_scale:new h.c3(d,t.u_extrude_scale),u_device_pixel_ratio:new h.bp(d,t.u_device_pixel_ratio),u_globe_extrude_scale:new h.bp(d,t.u_globe_extrude_scale),u_translate:new h.c3(d,t.u_translate)}),collisionBox:(d,t)=>({u_pixel_extrude_scale:new h.c3(d,t.u_pixel_extrude_scale)}),collisionCircle:(d,t)=>({u_viewport_size:new h.c3(d,t.u_viewport_size)}),debug:(d,t)=>({u_color:new h.b$(d,t.u_color),u_overlay:new h.b_(d,t.u_overlay),u_overlay_scale:new h.bp(d,t.u_overlay_scale)}),depth:Lc,clippingMask:Lc,heatmap:(d,t)=>({u_extrude_scale:new h.bp(d,t.u_extrude_scale),u_intensity:new h.bp(d,t.u_intensity),u_globe_extrude_scale:new h.bp(d,t.u_globe_extrude_scale)}),heatmapTexture:(d,t)=>({u_matrix:new h.c0(d,t.u_matrix),u_world:new h.c3(d,t.u_world),u_image:new h.b_(d,t.u_image),u_color_ramp:new h.b_(d,t.u_color_ramp),u_opacity:new h.bp(d,t.u_opacity)}),hillshade:(d,t)=>({u_image:new h.b_(d,t.u_image),u_latrange:new h.c3(d,t.u_latrange),u_exaggeration:new h.bp(d,t.u_exaggeration),u_altitudes:new h.c9(d,t.u_altitudes),u_azimuths:new h.c9(d,t.u_azimuths),u_accent:new h.b$(d,t.u_accent),u_method:new h.b_(d,t.u_method),u_shadows:new h.c8(d,t.u_shadows),u_highlights:new h.c8(d,t.u_highlights)}),hillshadePrepare:(d,t)=>({u_matrix:new h.c0(d,t.u_matrix),u_image:new h.b_(d,t.u_image),u_dimension:new h.c3(d,t.u_dimension),u_zoom:new h.bp(d,t.u_zoom),u_unpack:new h.c1(d,t.u_unpack)}),colorRelief:(d,t)=>({u_image:new h.b_(d,t.u_image),u_unpack:new h.c1(d,t.u_unpack),u_dimension:new h.c3(d,t.u_dimension),u_elevation_stops:new h.b_(d,t.u_elevation_stops),u_color_stops:new h.b_(d,t.u_color_stops),u_color_ramp_size:new h.b_(d,t.u_color_ramp_size),u_opacity:new h.bp(d,t.u_opacity)}),line:(d,t)=>({u_translation:new h.c3(d,t.u_translation),u_ratio:new h.bp(d,t.u_ratio),u_device_pixel_ratio:new h.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new h.c3(d,t.u_units_to_pixels)}),lineGradient:(d,t)=>({u_translation:new h.c3(d,t.u_translation),u_ratio:new h.bp(d,t.u_ratio),u_device_pixel_ratio:new h.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new h.c3(d,t.u_units_to_pixels),u_image:new h.b_(d,t.u_image),u_image_height:new h.bp(d,t.u_image_height)}),linePattern:(d,t)=>({u_translation:new h.c3(d,t.u_translation),u_texsize:new h.c3(d,t.u_texsize),u_ratio:new h.bp(d,t.u_ratio),u_device_pixel_ratio:new h.bp(d,t.u_device_pixel_ratio),u_image:new h.b_(d,t.u_image),u_units_to_pixels:new h.c3(d,t.u_units_to_pixels),u_scale:new h.c2(d,t.u_scale),u_fade:new h.bp(d,t.u_fade)}),lineSDF:(d,t)=>({u_translation:new h.c3(d,t.u_translation),u_ratio:new h.bp(d,t.u_ratio),u_device_pixel_ratio:new h.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new h.c3(d,t.u_units_to_pixels),u_image:new h.b_(d,t.u_image),u_mix:new h.bp(d,t.u_mix),u_tileratio:new h.bp(d,t.u_tileratio),u_crossfade_from:new h.bp(d,t.u_crossfade_from),u_crossfade_to:new h.bp(d,t.u_crossfade_to),u_lineatlas_width:new h.bp(d,t.u_lineatlas_width),u_lineatlas_height:new h.bp(d,t.u_lineatlas_height)}),lineGradientSDF:(d,t)=>({u_translation:new h.c3(d,t.u_translation),u_ratio:new h.bp(d,t.u_ratio),u_device_pixel_ratio:new h.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new h.c3(d,t.u_units_to_pixels),u_image:new h.b_(d,t.u_image),u_image_height:new h.bp(d,t.u_image_height),u_tileratio:new h.bp(d,t.u_tileratio),u_crossfade_from:new h.bp(d,t.u_crossfade_from),u_crossfade_to:new h.bp(d,t.u_crossfade_to),u_image_dash:new h.b_(d,t.u_image_dash),u_mix:new h.bp(d,t.u_mix),u_lineatlas_width:new h.bp(d,t.u_lineatlas_width),u_lineatlas_height:new h.bp(d,t.u_lineatlas_height)}),raster:(d,t)=>({u_tl_parent:new h.c3(d,t.u_tl_parent),u_scale_parent:new h.bp(d,t.u_scale_parent),u_buffer_scale:new h.bp(d,t.u_buffer_scale),u_fade_t:new h.bp(d,t.u_fade_t),u_opacity:new h.bp(d,t.u_opacity),u_image0:new h.b_(d,t.u_image0),u_image1:new h.b_(d,t.u_image1),u_brightness_low:new h.bp(d,t.u_brightness_low),u_brightness_high:new h.bp(d,t.u_brightness_high),u_saturation_factor:new h.bp(d,t.u_saturation_factor),u_contrast_factor:new h.bp(d,t.u_contrast_factor),u_spin_weights:new h.c2(d,t.u_spin_weights),u_coords_top:new h.c1(d,t.u_coords_top),u_coords_bottom:new h.c1(d,t.u_coords_bottom)}),symbolIcon:(d,t)=>({u_is_size_zoom_constant:new h.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.b_(d,t.u_is_size_feature_constant),u_size_t:new h.bp(d,t.u_size_t),u_size:new h.bp(d,t.u_size),u_camera_to_center_distance:new h.bp(d,t.u_camera_to_center_distance),u_pitch:new h.bp(d,t.u_pitch),u_rotate_symbol:new h.b_(d,t.u_rotate_symbol),u_aspect_ratio:new h.bp(d,t.u_aspect_ratio),u_fade_change:new h.bp(d,t.u_fade_change),u_label_plane_matrix:new h.c0(d,t.u_label_plane_matrix),u_coord_matrix:new h.c0(d,t.u_coord_matrix),u_is_text:new h.b_(d,t.u_is_text),u_pitch_with_map:new h.b_(d,t.u_pitch_with_map),u_is_along_line:new h.b_(d,t.u_is_along_line),u_is_variable_anchor:new h.b_(d,t.u_is_variable_anchor),u_texsize:new h.c3(d,t.u_texsize),u_texture:new h.b_(d,t.u_texture),u_translation:new h.c3(d,t.u_translation),u_pitched_scale:new h.bp(d,t.u_pitched_scale)}),symbolSDF:(d,t)=>({u_is_size_zoom_constant:new h.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.b_(d,t.u_is_size_feature_constant),u_size_t:new h.bp(d,t.u_size_t),u_size:new h.bp(d,t.u_size),u_camera_to_center_distance:new h.bp(d,t.u_camera_to_center_distance),u_pitch:new h.bp(d,t.u_pitch),u_rotate_symbol:new h.b_(d,t.u_rotate_symbol),u_aspect_ratio:new h.bp(d,t.u_aspect_ratio),u_fade_change:new h.bp(d,t.u_fade_change),u_label_plane_matrix:new h.c0(d,t.u_label_plane_matrix),u_coord_matrix:new h.c0(d,t.u_coord_matrix),u_is_text:new h.b_(d,t.u_is_text),u_pitch_with_map:new h.b_(d,t.u_pitch_with_map),u_is_along_line:new h.b_(d,t.u_is_along_line),u_is_variable_anchor:new h.b_(d,t.u_is_variable_anchor),u_texsize:new h.c3(d,t.u_texsize),u_texture:new h.b_(d,t.u_texture),u_gamma_scale:new h.bp(d,t.u_gamma_scale),u_device_pixel_ratio:new h.bp(d,t.u_device_pixel_ratio),u_is_halo:new h.b_(d,t.u_is_halo),u_is_plain:new h.b_(d,t.u_is_plain),u_translation:new h.c3(d,t.u_translation),u_pitched_scale:new h.bp(d,t.u_pitched_scale)}),symbolTextAndIcon:(d,t)=>({u_is_size_zoom_constant:new h.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new h.b_(d,t.u_is_size_feature_constant),u_size_t:new h.bp(d,t.u_size_t),u_size:new h.bp(d,t.u_size),u_camera_to_center_distance:new h.bp(d,t.u_camera_to_center_distance),u_pitch:new h.bp(d,t.u_pitch),u_rotate_symbol:new h.b_(d,t.u_rotate_symbol),u_aspect_ratio:new h.bp(d,t.u_aspect_ratio),u_fade_change:new h.bp(d,t.u_fade_change),u_label_plane_matrix:new h.c0(d,t.u_label_plane_matrix),u_coord_matrix:new h.c0(d,t.u_coord_matrix),u_is_text:new h.b_(d,t.u_is_text),u_pitch_with_map:new h.b_(d,t.u_pitch_with_map),u_is_along_line:new h.b_(d,t.u_is_along_line),u_is_variable_anchor:new h.b_(d,t.u_is_variable_anchor),u_texsize:new h.c3(d,t.u_texsize),u_texsize_icon:new h.c3(d,t.u_texsize_icon),u_texture:new h.b_(d,t.u_texture),u_texture_icon:new h.b_(d,t.u_texture_icon),u_gamma_scale:new h.bp(d,t.u_gamma_scale),u_device_pixel_ratio:new h.bp(d,t.u_device_pixel_ratio),u_is_halo:new h.b_(d,t.u_is_halo),u_translation:new h.c3(d,t.u_translation),u_pitched_scale:new h.bp(d,t.u_pitched_scale)}),background:(d,t)=>({u_opacity:new h.bp(d,t.u_opacity),u_color:new h.b$(d,t.u_color)}),backgroundPattern:(d,t)=>({u_opacity:new h.bp(d,t.u_opacity),u_image:new h.b_(d,t.u_image),u_pattern_tl_a:new h.c3(d,t.u_pattern_tl_a),u_pattern_br_a:new h.c3(d,t.u_pattern_br_a),u_pattern_tl_b:new h.c3(d,t.u_pattern_tl_b),u_pattern_br_b:new h.c3(d,t.u_pattern_br_b),u_texsize:new h.c3(d,t.u_texsize),u_mix:new h.bp(d,t.u_mix),u_pattern_size_a:new h.c3(d,t.u_pattern_size_a),u_pattern_size_b:new h.c3(d,t.u_pattern_size_b),u_scale_a:new h.bp(d,t.u_scale_a),u_scale_b:new h.bp(d,t.u_scale_b),u_pixel_coord_upper:new h.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new h.c3(d,t.u_pixel_coord_lower),u_tile_units_to_pixels:new h.bp(d,t.u_tile_units_to_pixels)}),terrain:(d,t)=>({u_texture:new h.b_(d,t.u_texture),u_ele_delta:new h.bp(d,t.u_ele_delta),u_fog_matrix:new h.c0(d,t.u_fog_matrix),u_fog_color:new h.b$(d,t.u_fog_color),u_fog_ground_blend:new h.bp(d,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new h.bp(d,t.u_fog_ground_blend_opacity),u_horizon_color:new h.b$(d,t.u_horizon_color),u_horizon_fog_blend:new h.bp(d,t.u_horizon_fog_blend),u_is_globe_mode:new h.bp(d,t.u_is_globe_mode)}),terrainDepth:(d,t)=>({u_ele_delta:new h.bp(d,t.u_ele_delta)}),terrainCoords:(d,t)=>({u_texture:new h.b_(d,t.u_texture),u_terrain_coords_id:new h.bp(d,t.u_terrain_coords_id),u_ele_delta:new h.bp(d,t.u_ele_delta)}),projectionErrorMeasurement:(d,t)=>({u_input:new h.bp(d,t.u_input),u_output_expected:new h.bp(d,t.u_output_expected)}),atmosphere:(d,t)=>({u_sun_pos:new h.c2(d,t.u_sun_pos),u_atmosphere_blend:new h.bp(d,t.u_atmosphere_blend),u_globe_position:new h.c2(d,t.u_globe_position),u_globe_radius:new h.bp(d,t.u_globe_radius),u_inv_proj_matrix:new h.c0(d,t.u_inv_proj_matrix)}),sky:(d,t)=>({u_sky_color:new h.b$(d,t.u_sky_color),u_horizon_color:new h.b$(d,t.u_horizon_color),u_horizon:new h.c3(d,t.u_horizon),u_horizon_normal:new h.c3(d,t.u_horizon_normal),u_sky_horizon_blend:new h.bp(d,t.u_sky_horizon_blend),u_sky_blend:new h.bp(d,t.u_sky_blend)})};class ih{constructor(t,a,o){this.context=t;const c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=!!o,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||a.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const a=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const rh={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Fc{constructor(t,a,o,c){this.length=a.length,this.attributes=o,this.itemSize=a.bytesPerElement,this.dynamicDraw=c,this.context=t;const f=t.gl;this.buffer=f.createBuffer(),t.bindVertexBuffer.set(this.buffer),f.bufferData(f.ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?f.DYNAMIC_DRAW:f.STATIC_DRAW),this.dynamicDraw||a.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,a){for(const o of this.attributes){const c=a.attributes[o.name];c!==void 0&&t.enableVertexAttribArray(c)}}setVertexAttribPointers(t,a,o){for(const c of this.attributes){const f=a.attributes[c.name];f!==void 0&&t.vertexAttribPointer(f,c.components,t[rh[c.type]],!1,this.itemSize,c.offset+this.itemSize*(o||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class st{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Bc extends st{getDefault(){return h.bo.transparent}set(t){const a=this.current;(t.r!==a.r||t.g!==a.g||t.b!==a.b||t.a!==a.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Os extends st{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Ns extends st{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Vs extends st{getDefault(){return[!0,!0,!0,!0]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||t[3]!==a[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class fl extends st{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class Ea extends st{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Nn extends st{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const a=this.current;(t.func!==a.func||t.ref!==a.ref||t.mask!==a.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class on extends st{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class rr extends st{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;t?a.enable(a.STENCIL_TEST):a.disable(a.STENCIL_TEST),this.current=t,this.dirty=!1}}class Oc extends st{getDefault(){return[0,1]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Nc extends st{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;t?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),this.current=t,this.dirty=!1}}class ml extends st{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class Ca extends st{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;t?a.enable(a.BLEND):a.disable(a.BLEND),this.current=t,this.dirty=!1}}class js extends st{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class Us extends st{getDefault(){return h.bo.transparent}set(t){const a=this.current;(t.r!==a.r||t.g!==a.g||t.b!==a.b||t.a!==a.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Vn extends st{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Zs extends st{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;t?a.enable(a.CULL_FACE):a.disable(a.CULL_FACE),this.current=t,this.dirty=!1}}class Vc extends st{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class ln extends st{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class cn extends st{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class jc extends st{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class gl extends st{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||t[3]!==a[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Ke extends st{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Gs extends st{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.bindRenderbuffer(a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class ah extends st{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.bindTexture(a.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Uc extends st{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.bindBuffer(a.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class jn extends st{getDefault(){return null}set(t){const a=this.gl;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class nh extends st{getDefault(){return null}set(t){var a;if(t===this.current&&!this.dirty)return;const o=this.gl;mr(o)?o.bindVertexArray(t):(a=o.getExtension("OES_vertex_array_object"))===null||a===void 0||a.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class sh extends st{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.pixelStorei(a.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class Zc extends st{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class oh extends st{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Un extends st{constructor(t,a){super(t),this.context=t,this.parent=a}getDefault(){return null}}class $s extends Un{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const a=this.gl;a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class Zn extends Un{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class qs extends Un{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}const Ws="Framebuffer is not complete";class Gc{constructor(t,a,o,c,f){this.context=t,this.width=a,this.height=o;const y=t.gl,x=this.framebuffer=y.createFramebuffer();if(this.colorAttachment=new $s(t,x),c)this.depthAttachment=f?new qs(t,x):new Zn(t,x);else if(f)throw new Error("Stencil cannot be set without depth");if(y.checkFramebufferStatus(y.FRAMEBUFFER)!==y.FRAMEBUFFER_COMPLETE)throw new Error(Ws)}destroy(){const t=this.context.gl,a=this.colorAttachment.get();if(a&&t.deleteTexture(a),this.depthAttachment){const o=this.depthAttachment.get();o&&t.deleteRenderbuffer(o)}t.deleteFramebuffer(this.framebuffer)}}class Hs{constructor(t){var a,o;if(this.gl=t,this.clearColor=new Bc(this),this.clearDepth=new Os(this),this.clearStencil=new Ns(this),this.colorMask=new Vs(this),this.depthMask=new fl(this),this.stencilMask=new Ea(this),this.stencilFunc=new Nn(this),this.stencilOp=new on(this),this.stencilTest=new rr(this),this.depthRange=new Oc(this),this.depthTest=new Nc(this),this.depthFunc=new ml(this),this.blend=new Ca(this),this.blendFunc=new js(this),this.blendColor=new Us(this),this.blendEquation=new Vn(this),this.cullFace=new Zs(this),this.cullFaceSide=new Vc(this),this.frontFace=new ln(this),this.program=new cn(this),this.activeTexture=new jc(this),this.viewport=new gl(this),this.bindFramebuffer=new Ke(this),this.bindRenderbuffer=new Gs(this),this.bindTexture=new ah(this),this.bindVertexBuffer=new Uc(this),this.bindElementBuffer=new jn(this),this.bindVertexArray=new nh(this),this.pixelStoreUnpack=new sh(this),this.pixelStoreUnpackPremultiplyAlpha=new Zc(this),this.pixelStoreUnpackFlipY=new oh(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),mr(t)){this.HALF_FLOAT=t.HALF_FLOAT;const c=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(a=t.RGBA16F)!==null&&a!==void 0?a:c?.RGBA16F_EXT,this.RGB16F=(o=t.RGB16F)!==null&&o!==void 0?o:c?.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const c=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=c?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,a){return new ih(this,t,a)}createVertexBuffer(t,a,o){return new Fc(this,t,a,o)}createRenderbuffer(t,a,o){const c=this.gl,f=c.createRenderbuffer();return this.bindRenderbuffer.set(f),c.renderbufferStorage(c.RENDERBUFFER,t,a,o),this.bindRenderbuffer.set(null),f}createFramebuffer(t,a,o,c){return new Gc(this,t,a,o,c)}clear({color:t,depth:a,stencil:o}){const c=this.gl;let f=0;t&&(f|=c.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),a!==void 0&&(f|=c.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(a),this.depthMask.set(!0)),o!==void 0&&(f|=c.STENCIL_BUFFER_BIT,this.clearStencil.set(o),this.stencilMask.set(255)),c.clear(f)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){h.bQ(t.blendFunction,yt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return mr(this.gl)?this.gl.createVertexArray():(t=this.gl.getExtension("OES_vertex_array_object"))===null||t===void 0?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var a;mr(this.gl)?this.gl.deleteVertexArray(t):(a=this.gl.getExtension("OES_vertex_array_object"))===null||a===void 0||a.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let Aa;function un(d,t,a,o,c){var f,y;const x=d.context,w=d.transform,S=x.gl,P=d.useProgram("collisionBox"),E=[];let C=0,z=0;for(const X of o){const $=t.getTile(X).getBucket(a);if(!$)continue;const U=c?$.textCollisionBox:$.iconCollisionBox,H=$.collisionCircleArray;H.length>0&&(E.push({circleArray:H,circleOffset:z,coord:X}),C+=H.length/4,z=C),U&&P.draw(x,S.LINES,qe.disabled,it.disabled,d.colorModeForRenderPass(),tt.disabled,Dc(d.transform),(f=d.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(X),w.getProjectionData({overscaledTileID:X,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),a.id,U.layoutVertexBuffer,U.indexBuffer,U.segments,null,d.transform.zoom,null,null,U.collisionVertexBuffer)}if(!c||!E.length)return;const B=d.useProgram("collisionCircle"),N=new h.ca;N.resize(4*C),N._trim();let Z=0;for(const X of E)for(let $=0;$<X.circleArray.length/4;$++){const U=4*$,H=X.circleArray[U+0],q=X.circleArray[U+1],Q=X.circleArray[U+2],ne=X.circleArray[U+3];N.emplace(Z++,H,q,Q,ne,0),N.emplace(Z++,H,q,Q,ne,1),N.emplace(Z++,H,q,Q,ne,2),N.emplace(Z++,H,q,Q,ne,3)}(!Aa||Aa.length<2*C)&&(Aa=(function(X){const $=2*X,U=new h.cc;U.resize($),U._trim();for(let H=0;H<$;H++){const q=6*H;U.uint16[q+0]=4*H+0,U.uint16[q+1]=4*H+1,U.uint16[q+2]=4*H+2,U.uint16[q+3]=4*H+2,U.uint16[q+4]=4*H+3,U.uint16[q+5]=4*H+0}return U})(C));const j=x.createIndexBuffer(Aa,!0),G=x.createVertexBuffer(N,h.cb.members,!0);for(const X of E){const $=Ma(d.transform);B.draw(x,S.TRIANGLES,qe.disabled,it.disabled,d.colorModeForRenderPass(),tt.disabled,$,(y=d.style.map.terrain)===null||y===void 0?void 0:y.getTerrainData(X.coord),null,a.id,G,j,h.aV.simpleSegment(0,2*X.circleOffset,X.circleArray.length,X.circleArray.length/2),null,d.transform.zoom,null,null,null)}G.destroy(),j.destroy()}const hn=h.ap(new Float32Array(16));function _l(d,t,a,o,c,f){const{horizontalAlign:y,verticalAlign:x}=h.aP(d);return new h.P((-(y-.5)*t/c+o[0])*f,(-(x-.5)*a/c+o[1])*f)}function lh(d,t,a,o,c,f){const y=t.tileAnchorPoint.add(new h.P(t.translation[0],t.translation[1]));if(t.pitchWithMap){let x=o.mult(f);a||(x=x.rotate(-c));const w=y.add(x);return $e(w.x,w.y,t.pitchedLabelPlaneMatrix,t.getElevation).point}if(a){const x=ut(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(d),w=Math.atan(x.y/x.x)+(x.x<0?Math.PI:0);return d.add(o.rotate(w))}return d.add(o)}function Gn(d,t,a,o,c,f,y,x,w,S,P,E){const C=d.text.placedSymbolArray,z=d.text.dynamicLayoutVertexArray,B=d.icon.dynamicLayoutVertexArray,N={};z.clear();for(let Z=0;Z<C.length;Z++){const j=C.get(Z),G=j.hidden||!j.crossTileID||d.allowVerticalPlacement&&!j.placedOrientation?null:o[j.crossTileID];if(G){const X=new h.P(j.anchorX,j.anchorY),$={getElevation:E,width:c.width,height:c.height,pitchedLabelPlaneMatrix:f,pitchWithMap:a,transform:c,tileAnchorPoint:X,translation:S,unwrappedTileID:P},U=a?Ha(X.x,X.y,$):ut(X.x,X.y,$),H=In(c.cameraToCenterDistance,U.signedDistanceFromCamera);let q=h.ay(d.textSizeData,x,j)*H/h.aJ;a&&(q*=d.tilePixelRatio/y);const{width:Q,height:ne,anchor:se,textOffset:me,textBoxScale:pe}=G,Ae=_l(se,Q,ne,me,pe,q),Te=c.getPitchedTextCorrection(X.x+S[0],X.y+S[1],P),ue=lh(U.point,$,t,Ae,-c.bearingInRadians,Te),Me=d.allowVerticalPlacement&&j.placedOrientation===h.ax.vertical?Math.PI/2:0;for(let ze=0;ze<j.numGlyphs;ze++)h.aD(z,ue,Me);w&&j.associatedIconIndex>=0&&(N[j.associatedIconIndex]={shiftedAnchor:ue,angle:Me})}else ya(j.numGlyphs,z)}if(w){B.clear();const Z=d.icon.placedSymbolArray;for(let j=0;j<Z.length;j++){const G=Z.get(j);if(G.hidden)ya(G.numGlyphs,B);else{const X=N[j];if(X)for(let $=0;$<G.numGlyphs;$++)h.aD(B,X.shiftedAnchor,X.angle);else ya(G.numGlyphs,B)}}d.icon.dynamicLayoutVertexBuffer.updateData(B)}d.text.dynamicLayoutVertexBuffer.updateData(z)}function ch(d,t,a){return a.iconsInText&&t?"symbolTextAndIcon":d?"symbolSDF":"symbolIcon"}function yl(d,t,a,o,c,f,y,x,w,S,P,E,C){var z,B;const N=d.context,Z=N.gl,j=d.transform,G=x==="map",X=w==="map",$=x!=="viewport"&&a.layout.get("symbol-placement")!=="point",U=G&&!X&&!$,H=!a.layout.get("symbol-sort-key").isConstant();let q=!1;const Q=d.getDepthModeForSublayer(0,qe.ReadOnly),ne=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),se=[],me=j.getCircleRadiusCorrection();for(const Te of o){const ue=t.getTile(Te),Me=ue.getBucket(a);if(!Me)continue;const ze=c?Me.text:Me.icon;if(!ze?.segments.get().length||!ze.hasVisibleVertices)continue;const ot=ze.programConfigurations.get(a.id),jt=c||Me.sdfIcons,mt=c?Me.textSizeData:Me.iconSizeData,$t=X||j.pitch!==0,Wt=d.useProgram(ch(jt,c,Me),ot),_i=h.aw(mt,j.zoom),kt=(z=d.style.map.terrain)===null||z===void 0?void 0:z.getTerrainData(Te);let zi,pi,ai,yi,aa=[0,0],na=null;if(c)pi=ue.glyphAtlasTexture,ai=Z.LINEAR,zi=ue.glyphAtlasTexture.size,Me.iconsInText&&(aa=ue.imageAtlasTexture.size,na=ue.imageAtlasTexture,yi=$t||d.options.rotating||d.options.zooming||mt.kind==="composite"||mt.kind==="camera"?Z.LINEAR:Z.NEAREST);else{const At=a.layout.get("icon-size").constantOr(0)!==1||Me.iconsNeedLinear;pi=ue.imageAtlasTexture,ai=jt||d.options.rotating||d.options.zooming||At||$t?Z.LINEAR:Z.NEAREST,zi=ue.imageAtlasTexture.size}const sa=h.aK(ue,1,d.transform.zoom),vi=$i(G,d.transform,sa),jr=ws(X,G,d.transform,sa),oa=h.aL(j,ue,f,y),co=j.getProjectionData({overscaledTileID:Te,applyGlobeMatrix:!C,applyTerrainMatrix:!0}),Er=ne&&Me.hasTextData(),Cr=a.layout.get("icon-text-fit")!=="none"&&Er&&Me.hasIconData();if($){const At=h.O();Ze(At,vi);const Fa=d.style.map.terrain?(Ur,jl)=>d.style.map.terrain.getElevation(Te,Ur,jl):null,uo=a.layout.get("text-rotation-alignment")==="map";Ts(Me,d,c,vi,At,X,S,uo,Te.toUnwrapped(),j.width,j.height,oa,Fa)}const Yi=c&&ne||Cr,sr=$||Yi?hn:X?vi:d.transform.clipSpaceToPixelsMatrix,Ct=jt&&a.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let St;St=jt?Me.iconsInText?dl(mt.kind,_i,U,X,$,Yi,d,sr,jr,oa,zi,aa,me):hl(mt.kind,_i,U,X,$,Yi,d,sr,jr,oa,c,zi,Ct,me):Bs(mt.kind,_i,U,X,$,Yi,d,sr,jr,oa,c,zi,me);const Ht={program:Wt,buffers:ze,uniformValues:St,projectionData:co,atlasTexture:pi,atlasTextureIcon:na,atlasInterpolation:ai,atlasInterpolationIcon:yi,isSDF:jt,hasHalo:Ct};if(H&&Me.canOverlap){q=!0;const At=ze.segments.get();for(const Fa of At)se.push({segments:new h.aV([Fa]),sortKey:Fa.sortKey,state:Ht,terrainData:kt})}else se.push({segments:ze.segments,sortKey:0,state:Ht,terrainData:kt})}q&&se.sort(((Te,ue)=>Te.sortKey-ue.sortKey));const pe=(B=a.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(null))!==null&&B!==void 0?B:1/0,Ae=a.layout.get("text-letter-spacing").constantOr(0)*h.aJ<0||pe>1;for(const Te of se){const ue=Te.state;N.activeTexture.set(Z.TEXTURE0),ue.atlasTexture.bind(ue.atlasInterpolation,Z.CLAMP_TO_EDGE),ue.atlasTextureIcon&&(N.activeTexture.set(Z.TEXTURE1),ue.atlasTextureIcon&&ue.atlasTextureIcon.bind(ue.atlasInterpolationIcon,Z.CLAMP_TO_EDGE));const Me=ue.isSDF&&ue.hasHalo;if(Me){const ze=ue.uniformValues;ze.u_is_halo=1,Ae&&(ze.u_is_plain=0,$n(ue.buffers,Te.segments,a,d,ue.program,Q,P,E,ze,ue.projectionData,Te.terrainData),ze.u_is_halo=0,ze.u_is_plain=1)}$n(ue.buffers,Te.segments,a,d,ue.program,Q,P,E,ue.uniformValues,ue.projectionData,Te.terrainData),Me&&!Ae&&(ue.uniformValues.u_is_halo=0)}}function $n(d,t,a,o,c,f,y,x,w,S,P){const E=o.context;c.draw(E,E.gl.TRIANGLES,f,y,x,tt.backCCW,w,P,S,a.id,d.layoutVertexBuffer,d.indexBuffer,t,a.paint,o.transform.zoom,d.programConfigurations.get(a.id),d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer)}function vl(d,t,a,o,c){const f=d.context,y=f.gl,x=it.disabled,w=new yt([y.ONE,y.ONE],h.bo.transparent,[!0,!0,!0,!0]),S=t.getBucket(a);if(!S)return;const P=o.key;let E=a.heatmapFbos.get(P);E||(E=xl(f,t.tileSize,t.tileSize),a.heatmapFbos.set(P,E)),f.bindFramebuffer.set(E.framebuffer),f.viewport.set([0,0,t.tileSize,t.tileSize]),f.clear({color:h.bo.transparent});const C=S.programConfigurations.get(a.id),z=d.useProgram("heatmap",C,!c),B=d.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),N=d.style.map.terrain.getTerrainData(o);z.draw(f,y.TRIANGLES,qe.disabled,x,w,tt.disabled,ol(t,d.transform.zoom,a.paint.get("heatmap-intensity"),1),N,B,a.id,S.layoutVertexBuffer,S.indexBuffer,S.segments,a.paint,d.transform.zoom,C)}function $c(d,t,a,o,c){const f=d.context,y=f.gl,x=d.transform;f.setColorMode(d.colorModeForRenderPass());const w=qn(f,t),S=a.key,P=t.heatmapFbos.get(S);if(!P)return;f.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,P.colorAttachment.get()),f.activeTexture.set(y.TEXTURE1),w.bind(y.LINEAR,y.CLAMP_TO_EDGE);const E=x.getProjectionData({overscaledTileID:a,applyTerrainMatrix:c,applyGlobeMatrix:!o});d.useProgram("heatmapTexture").draw(f,y.TRIANGLES,qe.disabled,it.disabled,d.colorModeForRenderPass(),tt.disabled,nn(d,t,0,1),null,E,t.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments,t.paint,x.zoom),P.destroy(),t.heatmapFbos.delete(S)}function xl(d,t,a){var o,c;const f=d.gl,y=f.createTexture();f.bindTexture(f.TEXTURE_2D,y),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR);const x=(o=d.HALF_FLOAT)!==null&&o!==void 0?o:f.UNSIGNED_BYTE,w=(c=d.RGBA16F)!==null&&c!==void 0?c:f.RGBA;f.texImage2D(f.TEXTURE_2D,0,w,t,a,0,f.RGBA,x,null);const S=d.createFramebuffer(t,a,!1,!1);return S.colorAttachment.set(y),S}function qn(d,t){return t.colorRampTexture||(t.colorRampTexture=new h.T(d,t.colorRamp,d.gl.RGBA)),t.colorRampTexture}function Xs(d,t,a,o,c,f,y,x){let w=256;if(c.stepInterpolant){const S=t.getSource().maxzoom,P=y.canonical.z===S?Math.ceil(1<<d.transform.maxZoom-y.canonical.z):1;w=h.al(h.ce(f.maxLineLength/h.a6*1024*P),256,a.maxTextureSize)}return x.gradient=h.cf({expression:c.gradientExpression(),evaluationKey:"lineProgress",resolution:w,image:x.gradient||void 0,clips:f.lineClipsArray}),x.texture?x.texture.update(x.gradient):x.texture=new h.T(a,x.gradient,o.RGBA),x.version=c.gradientVersion,x.texture}function uh(d,t,a,o,c){d.activeTexture.set(t.TEXTURE0),a.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),o.updatePaintBuffers(c)}function qc(d,t,a,o,c,f){(c||d.lineAtlas.dirty)&&(t.activeTexture.set(a.TEXTURE0),d.lineAtlas.bind(t)),o.updatePaintBuffers(f)}function Vt(d,t,a,o,c,f,y){const x=f.gradients[c.id];let w=x.texture;c.gradientVersion!==x.version&&(w=Xs(d,t,a,o,c,f,y,x)),a.activeTexture.set(o.TEXTURE0),w.bind(c.stepInterpolant?o.NEAREST:o.LINEAR,o.CLAMP_TO_EDGE)}function Da(d,t,a,o,c,f,y,x,w){const S=f.gradients[c.id];let P=S.texture;c.gradientVersion!==S.version&&(P=Xs(d,t,a,o,c,f,y,S)),a.activeTexture.set(o.TEXTURE0),P.bind(c.stepInterpolant?o.NEAREST:o.LINEAR,o.CLAMP_TO_EDGE),a.activeTexture.set(o.TEXTURE1),d.lineAtlas.bind(a),x.updatePaintBuffers(w)}function ji(d,t,a,o,c){if(!a||!o?.imageAtlas)return;const f=o.imageAtlas.patternPositions;let y=f[a.to.toString()],x=f[a.from.toString()];if(!y&&x&&(y=x),!x&&y&&(x=y),!y||!x){const w=c.getPaintProperty(t);y=f[w],x=f[w]}y&&x&&d.setConstantPatternPositions(y,x)}function Ys(d,t,a,o,c,f,y,x){var w;const S=d.context.gl,P="fill-pattern",E=a.paint.get(P),C=E?.constantOr(1),z=a.getCrossfadeParameters();let B,N,Z,j,G;const X=d.transform,$=a.paint.get("fill-translate"),U=a.paint.get("fill-translate-anchor");y?(N=C&&!a.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",B=S.LINES):(N=C?"fillPattern":"fill",B=S.TRIANGLES);const H=E.constantOr(null);for(const q of o){const Q=t.getTile(q);if(C&&!Q.patternsLoaded())continue;const ne=Q.getBucket(a);if(!ne)continue;const se=ne.programConfigurations.get(a.id),me=d.useProgram(N,se),pe=(w=d.style.map.terrain)===null||w===void 0?void 0:w.getTerrainData(q);C&&(d.context.activeTexture.set(S.TEXTURE0),Q.imageAtlasTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),se.updatePaintBuffers(z)),ji(se,P,H,Q,a);const Ae=X.getProjectionData({overscaledTileID:q,applyGlobeMatrix:!x,applyTerrainMatrix:!0}),Te=h.aL(X,Q,$,U);if(y){j=ne.indexBuffer2,G=ne.segments2;const Me=[S.drawingBufferWidth,S.drawingBufferHeight];Z=N==="fillOutlinePattern"&&C?Cc(d,z,Q,Me,Te):Ec(Me,Te)}else j=ne.indexBuffer,G=ne.segments,Z=C?Ls(d,z,Q,Te):{u_fill_translate:Te};const ue=d.stencilModeForClipping(q);me.draw(d.context,B,c,ue,f,tt.backCCW,Z,pe,Ae,a.id,ne.layoutVertexBuffer,j,G,a.paint,d.transform.zoom,se)}}function dn(d,t,a,o,c,f,y,x){var w;const S=d.context,P=S.gl,E="fill-extrusion-pattern",C=a.paint.get(E),z=C.constantOr(1),B=a.getCrossfadeParameters(),N=a.paint.get("fill-extrusion-opacity"),Z=C.constantOr(null),j=d.transform;for(const G of o){const X=t.getTile(G),$=X.getBucket(a);if(!$)continue;const U=(w=d.style.map.terrain)===null||w===void 0?void 0:w.getTerrainData(G),H=$.programConfigurations.get(a.id),q=d.useProgram(z?"fillExtrusionPattern":"fillExtrusion",H);z&&(d.context.activeTexture.set(P.TEXTURE0),X.imageAtlasTexture.bind(P.LINEAR,P.CLAMP_TO_EDGE),H.updatePaintBuffers(B));const Q=j.getProjectionData({overscaledTileID:G,applyGlobeMatrix:!x,applyTerrainMatrix:!0});ji(H,E,Z,X,a);const ne=h.aL(j,X,a.paint.get("fill-extrusion-translate"),a.paint.get("fill-extrusion-translate-anchor")),se=a.paint.get("fill-extrusion-vertical-gradient"),me=z?Ic(d,se,N,ne,G,B,X):Mc(d,se,N,ne);q.draw(S,S.gl.TRIANGLES,c,f,y,tt.backCCW,me,U,Q,a.id,$.layoutVertexBuffer,$.indexBuffer,$.segments,a.paint,d.transform.zoom,H,d.style.map.terrain&&$.centroidVertexBuffer)}}function Ks(d,t,a,o,c,f,y,x,w){var S;const P=d.style.projection,E=d.context,C=d.transform,z=E.gl,B=[`#define NUM_ILLUMINATION_SOURCES ${a.paint.get("hillshade-highlight-color").values.length}`],N=d.useProgram("hillshade",null,!1,B),Z=!d.options.moving;for(const j of o){const G=t.getTile(j),X=G.fbo;if(!X)continue;const $=P.getMeshFromTileID(E,j.canonical,x,!0,"raster"),U=(S=d.style.map.terrain)===null||S===void 0?void 0:S.getTerrainData(j);E.activeTexture.set(z.TEXTURE0),z.bindTexture(z.TEXTURE_2D,X.colorAttachment.get());const H=C.getProjectionData({overscaledTileID:j,aligned:Z,applyGlobeMatrix:!w,applyTerrainMatrix:!0});N.draw(E,z.TRIANGLES,f,c[j.overscaledZ],y,tt.backCCW,Ju(d,G,a),U,H,a.id,$.vertexBuffer,$.indexBuffer,$.segments)}}let ta=0;function Wn(d,t,a,o,c,f,y,x,w){var S;const P=d.style.projection,E=d.context,C=d.transform,z=E.gl,B=d.useProgram("colorRelief"),N=!d.options.moving,Z=a.paint.get("resampling")==="nearest"?z.NEAREST:z.LINEAR;let j=!0,G=0;for(const X of o){const $=t.getTile(X),U=$.dem;if(j){ta||(ta=z.getParameter(z.MAX_TEXTURE_SIZE));const me=ta,{elevationTexture:pe,colorTexture:Ae}=a.getColorRampTextures(E,me,U.getUnpackVector());E.activeTexture.set(z.TEXTURE1),pe.bind(z.NEAREST,z.CLAMP_TO_EDGE),E.activeTexture.set(z.TEXTURE4),Ae.bind(z.LINEAR,z.CLAMP_TO_EDGE),j=!1,G=pe.size[0]}if(!U?.data)continue;const H=U.stride,q=U.getPixels();if(E.activeTexture.set(z.TEXTURE0),E.pixelStoreUnpackPremultiplyAlpha.set(!1),$.demTexture||($.demTexture=d.getTileTexture(H)),$.demTexture){const me=$.demTexture;me.update(q,{premultiply:!1}),me.bind(Z,z.CLAMP_TO_EDGE)}else $.demTexture=new h.T(E,q,z.RGBA,{premultiply:!1}),$.demTexture.bind(Z,z.CLAMP_TO_EDGE);const Q=P.getMeshFromTileID(E,X.canonical,x,!0,"raster"),ne=(S=d.style.map.terrain)===null||S===void 0?void 0:S.getTerrainData(X),se=C.getProjectionData({overscaledTileID:X,aligned:N,applyGlobeMatrix:!w,applyTerrainMatrix:!0});B.draw(E,z.TRIANGLES,f,c[X.overscaledZ],y,tt.backCCW,eh(a,$.dem,G),ne,se,a.id,Q.vertexBuffer,Q.indexBuffer,Q.segments)}}const za=[new h.P(0,0),new h.P(h.a6,0),new h.P(h.a6,h.a6),new h.P(0,h.a6)];function pn(d,t,a,o,c,f,y,x,w=!1,S=!1){var P;const E=o[o.length-1].overscaledZ,C=d.context,z=C.gl,B=d.useProgram("raster"),N=d.transform,Z=d.style.projection,j=d.colorModeForRenderPass(),G=!d.options.moving,X=a.paint.get("raster-opacity"),$=a.paint.get("resampling")==="nearest"||a.paint.get("raster-resampling")==="nearest"?z.NEAREST:z.LINEAR,U=a.paint.get("raster-fade-duration"),H=!!d.style.map.terrain;for(const q of o){const Q=d.getDepthModeForSublayer(q.overscaledZ-E,X===1?qe.ReadWrite:qe.ReadOnly,z.LESS),ne=t.getTile(q);C.activeTexture.set(z.TEXTURE0),ne.texture.bind($,z.CLAMP_TO_EDGE,z.LINEAR_MIPMAP_NEAREST),C.activeTexture.set(z.TEXTURE1);const{parentTile:se,parentScaleBy:me,parentTopLeft:pe,fadeValues:Ae}=Wc(ne,t,U,H);ne.fadeOpacity=Ae.tileOpacity,se?(se.fadeOpacity=Ae.parentTileOpacity,se.texture.bind($,z.CLAMP_TO_EDGE,z.LINEAR_MIPMAP_NEAREST)):ne.texture.bind($,z.CLAMP_TO_EDGE,z.LINEAR_MIPMAP_NEAREST),ne.texture.useMipmap&&C.extTextureFilterAnisotropic&&d.transform.pitch>d.options.anisotropicFilterPitch&&z.texParameterf(z.TEXTURE_2D,C.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,C.extTextureFilterAnisotropicMax);const Te=(P=d.style.map.terrain)===null||P===void 0?void 0:P.getTerrainData(q),ue=N.getProjectionData({overscaledTileID:q,aligned:G,applyGlobeMatrix:!S,applyTerrainMatrix:!0}),Me=cl(pe,me,Ae.fadeMix,a,x),ze=Z.getMeshFromTileID(C,q.canonical,f,y,"raster");B.draw(C,z.TRIANGLES,Q,c?c[q.overscaledZ]:it.disabled,j,w?tt.frontCCW:tt.backCCW,Me,Te,ue,a.id,ze.vertexBuffer,ze.indexBuffer,ze.segments)}}function Wc(d,t,a,o){const c={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(a===0||o)return c;if(d.fadingParentID){const f=t.getLoadedTile(d.fadingParentID);if(!f)return c;const y=Math.pow(2,f.tileID.overscaledZ-d.tileID.overscaledZ),x=[d.tileID.canonical.x*y%1,d.tileID.canonical.y*y%1],w=(function(S,P,E){const C=je(),z=(C-P.timeAdded)/E,B=S.fadingDirection===ir.Incoming,N=h.al((C-S.timeAdded)/E,0,1),Z=h.al(1-z,0,1),j=B?N:Z;return{tileOpacity:j,parentTileOpacity:B?Z:N,fadeMix:{opacity:1,mix:1-j}}})(d,f,a);return{parentTile:f,parentScaleBy:y,parentTopLeft:x,fadeValues:w}}if(d.selfFading){const f=(function(y,x){const w=(je()-y.timeAdded)/x,S=h.al(w,0,1);return{tileOpacity:S,fadeMix:{opacity:S,mix:0}}})(d,a);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:f}}return c}const Hc=new h.bo(1,0,0,1),Xc=new h.bo(0,1,0,1),Yc=new h.bo(0,0,1,1),Kc=new h.bo(1,0,1,1),ia=new h.bo(0,1,1,1);function bl(d,t,a,o){Hn(d,0,t+a/2,d.transform.width,a,o)}function wl(d,t,a,o){Hn(d,t-a/2,0,a,d.transform.height,o)}function Hn(d,t,a,o,c,f){const y=d.context,x=y.gl;x.enable(x.SCISSOR_TEST),x.scissor(t*d.pixelRatio,a*d.pixelRatio,o*d.pixelRatio,c*d.pixelRatio),y.clear({color:f}),x.disable(x.SCISSOR_TEST)}function Jc(d,t,a){var o;const c=d.context,f=c.gl,y=d.useProgram("debug"),x=qe.disabled,w=it.disabled,S=d.colorModeForRenderPass(),P="$debug",E=(o=d.style.map.terrain)===null||o===void 0?void 0:o.getTerrainData(a);c.activeTexture.set(f.TEXTURE0);const C=t.getTileByID(a.key).latestRawTileData,z=Math.floor((C?.byteLength||0)/1024),B=t.getTile(a).tileSize,N=512/Math.min(B,512)*(a.overscaledZ/d.transform.zoom)*.5;let Z=a.canonical.toString();a.overscaledZ!==a.canonical.z&&(Z+=` => ${a.overscaledZ}`),(function(G,X){G.initDebugOverlayCanvas();const $=G.debugOverlayCanvas,U=G.context.gl,H=G.debugOverlayCanvas.getContext("2d");H.clearRect(0,0,$.width,$.height),H.shadowColor="white",H.shadowBlur=2,H.lineWidth=1.5,H.strokeStyle="white",H.textBaseline="top",H.font="bold 36px Open Sans, sans-serif",H.fillText(X,5,5),H.strokeText(X,5,5),G.debugOverlayTexture.update($),G.debugOverlayTexture.bind(U.LINEAR,U.CLAMP_TO_EDGE)})(d,`${Z} ${z}kB`);const j=d.transform.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!0,applyTerrainMatrix:!0});y.draw(c,f.TRIANGLES,x,w,yt.alphaBlended,tt.disabled,sl(h.bo.transparent,N),null,j,P,d.debugBuffer,d.quadTriangleIndexBuffer,d.debugSegments),y.draw(c,f.LINE_STRIP,x,w,S,tt.disabled,sl(h.bo.red),E,j,P,d.debugBuffer,d.tileBorderIndexBuffer,d.debugSegments)}function Tl(d,t,a,o){const{isRenderingGlobe:c}=o,f=d.context,y=f.gl,x=d.transform,w=d.colorModeForRenderPass(),S=d.getDepthModeFor3D(),P=d.useProgram("terrain");f.bindFramebuffer.set(null),f.viewport.set([0,0,d.width,d.height]);for(const E of a){const C=t.getTerrainMesh(E.tileID),z=d.renderToTexture.getTexture(E),B=t.getTerrainData(E.tileID);f.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,z.texture);const N=t.getMeshFrameDelta(x.zoom),Z=x.calculateFogMatrix(E.tileID.toUnwrapped()),j=ks(N,Z,d.style.sky,x.pitch,c),G=x.getProjectionData({overscaledTileID:E.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});P.draw(f,y.TRIANGLES,S,it.disabled,w,tt.backCCW,j,B,G,"terrain",C.vertexBuffer,C.indexBuffer,C.segments)}}function Sl(d,t){if(!t.mesh){const a=new h.aU;a.emplaceBack(-1,-1),a.emplaceBack(1,-1),a.emplaceBack(1,1),a.emplaceBack(-1,1);const o=new h.aW;o.emplaceBack(0,1,2),o.emplaceBack(0,2,3),t.mesh=new _t(d.createVertexBuffer(a,Qr.members),d.createIndexBuffer(o),h.aV.simpleSegment(0,0,a.length,o.length))}return t.mesh}const Qc={symbol:function(d,t,a,o,c,f){if(d.renderPass!=="translucent")return;const{isRenderingToTexture:y}=f,x=it.disabled,w=d.colorModeForRenderPass();(a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(S,P,E,C,z,B,N,Z,j){var G;const X=P.transform,$=P.style.map.terrain,U=z==="map",H=B==="map";for(const q of S){const Q=C.getTile(q),ne=Q.getBucket(E);if(!(!((G=ne?.text)===null||G===void 0)&&G.segments.get().length))continue;const se=h.aw(ne.textSizeData,X.zoom),me=h.aK(Q,1,P.transform.zoom),pe=$i(U,P.transform,me),Ae=E.layout.get("icon-text-fit")!=="none"&&ne.hasIconData();if(se){const Te=Math.pow(2,X.zoom-Q.tileID.overscaledZ),ue=$?(Me,ze)=>$.getElevation(q,Me,ze):null;Gn(ne,U,H,j,X,pe,Te,se,Ae,h.aL(X,Q,N,Z),q.toUnwrapped(),ue)}}})(o,d,a,t,a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),c),a.paint.get("icon-opacity").constantOr(1)!==0&&yl(d,t,a,o,!1,a.paint.get("icon-translate"),a.paint.get("icon-translate-anchor"),a.layout.get("icon-rotation-alignment"),a.layout.get("icon-pitch-alignment"),a.layout.get("icon-keep-upright"),x,w,y),a.paint.get("text-opacity").constantOr(1)!==0&&yl(d,t,a,o,!0,a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.layout.get("text-keep-upright"),x,w,y),t.map.showCollisionBoxes&&(un(d,t,a,o,!0),un(d,t,a,o,!1))},circle:function(d,t,a,o,c){var f;if(d.renderPass!=="translucent")return;const{isRenderingToTexture:y}=c,x=a.paint.get("circle-opacity"),w=a.paint.get("circle-stroke-width"),S=a.paint.get("circle-stroke-opacity"),P=!a.layout.get("circle-sort-key").isConstant();if(x.constantOr(1)===0&&(w.constantOr(1)===0||S.constantOr(1)===0))return;const E=d.context,C=E.gl,z=d.transform,B=d.getDepthModeForSublayer(0,qe.ReadOnly),N=it.disabled,Z=d.colorModeForRenderPass(),j=[],G=z.getCircleRadiusCorrection();for(const X of o){const $=t.getTile(X),U=$.getBucket(a);if(!U)continue;const H=a.paint.get("circle-translate"),q=a.paint.get("circle-translate-anchor"),Q=h.aL(z,$,H,q),ne=U.programConfigurations.get(a.id),se=d.useProgram("circle",ne),me=U.layoutVertexBuffer,pe=U.indexBuffer,Ae=(f=d.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(X),Te={programConfiguration:ne,program:se,layoutVertexBuffer:me,indexBuffer:pe,uniformValues:Ac(d,$,a,Q,G),terrainData:Ae,projectionData:z.getProjectionData({overscaledTileID:X,applyGlobeMatrix:!y,applyTerrainMatrix:!0})};if(P){const ue=U.segments.get();for(const Me of ue)j.push({segments:new h.aV([Me]),sortKey:Me.sortKey,state:Te})}else j.push({segments:U.segments,sortKey:0,state:Te})}P&&j.sort(((X,$)=>X.sortKey-$.sortKey));for(const X of j){const{programConfiguration:$,program:U,layoutVertexBuffer:H,indexBuffer:q,uniformValues:Q,terrainData:ne,projectionData:se}=X.state;U.draw(E,C.TRIANGLES,B,N,Z,tt.backCCW,Q,ne,se,a.id,H,q,X.segments,a.paint,d.transform.zoom,$)}},heatmap:function(d,t,a,o,c){if(a.paint.get("heatmap-opacity")===0)return;const f=d.context,{isRenderingToTexture:y,isRenderingGlobe:x}=c;if(d.style.map.terrain){for(const w of o){const S=t.getTile(w);t.hasRenderableParent(w)||(d.renderPass==="offscreen"?vl(d,S,a,w,x):d.renderPass==="translucent"&&$c(d,a,w,y,x))}f.viewport.set([0,0,d.width,d.height])}else d.renderPass==="offscreen"?(function(w,S,P,E){const C=w.context,z=C.gl,B=w.transform,N=it.disabled,Z=new yt([z.ONE,z.ONE],h.bo.transparent,[!0,!0,!0,!0]);(function(j,G,X){const $=j.gl;j.activeTexture.set($.TEXTURE1),j.viewport.set([0,0,G.width/4,G.height/4]);let U=X.heatmapFbos.get(h.cd);U?($.bindTexture($.TEXTURE_2D,U.colorAttachment.get()),j.bindFramebuffer.set(U.framebuffer)):(U=xl(j,G.width/4,G.height/4),X.heatmapFbos.set(h.cd,U))})(C,w,P),C.clear({color:h.bo.transparent});for(const j of E){if(S.hasRenderableParent(j))continue;const G=S.getTile(j),X=G.getBucket(P);if(!X)continue;const $=X.programConfigurations.get(P.id),U=w.useProgram("heatmap",$),H=B.getProjectionData({overscaledTileID:j,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),q=B.getCircleRadiusCorrection();U.draw(C,z.TRIANGLES,qe.disabled,N,Z,tt.backCCW,ol(G,B.zoom,P.paint.get("heatmap-intensity"),q),null,H,P.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,P.paint,B.zoom,$)}C.viewport.set([0,0,w.width,w.height])})(d,t,a,o):d.renderPass==="translucent"&&(function(w,S){const P=w.context,E=P.gl;P.setColorMode(w.colorModeForRenderPass());const C=S.heatmapFbos.get(h.cd);C&&(P.activeTexture.set(E.TEXTURE0),E.bindTexture(E.TEXTURE_2D,C.colorAttachment.get()),P.activeTexture.set(E.TEXTURE1),qn(P,S).bind(E.LINEAR,E.CLAMP_TO_EDGE),w.useProgram("heatmapTexture").draw(P,E.TRIANGLES,qe.disabled,it.disabled,w.colorModeForRenderPass(),tt.disabled,nn(w,S,0,1),null,null,S.id,w.viewportBuffer,w.quadTriangleIndexBuffer,w.viewportSegments,S.paint,w.transform.zoom))})(d,a)},line:function(d,t,a,o,c){var f;if(d.renderPass!=="translucent")return;const{isRenderingToTexture:y}=c,x=a.paint.get("line-opacity"),w=a.paint.get("line-width");if(x.constantOr(1)===0||w.constantOr(1)===0)return;const S=d.getDepthModeForSublayer(0,qe.ReadOnly),P=d.colorModeForRenderPass(),E=a.paint.get("line-dasharray"),C=E.constantOr(1),z=a.paint.get("line-pattern"),B=z.constantOr(1),N=a.paint.get("line-gradient"),Z=a.getCrossfadeParameters();let j;j=B?"linePattern":C&&N?"lineGradientSDF":C?"lineSDF":N?"lineGradient":"line";const G=d.context,X=G.gl,$=d.transform;let U=!0;for(const H of o){const q=t.getTile(H);if(B&&!q.patternsLoaded())continue;const Q=q.getBucket(a);if(!Q)continue;const ne=Q.programConfigurations.get(a.id),se=d.context.program.get(),me=d.useProgram(j,ne),pe=U||me.program!==se,Ae=(f=d.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(H),Te=z.constantOr(null),ue=E?.constantOr(null);if(Te&&q.imageAtlas){const mt=q.imageAtlas,$t=mt.patternPositions[Te.to.toString()],Wt=mt.patternPositions[Te.from.toString()];$t&&Wt&&ne.setConstantPatternPositions($t,Wt)}else if(ue){const mt=a.layout.get("line-cap").constantOr(null)==="round",$t=d.lineAtlas.getDash(ue.to,mt),Wt=d.lineAtlas.getDash(ue.from,mt);ne.setConstantDashPositions($t,Wt)}const Me=$.getProjectionData({overscaledTileID:H,applyGlobeMatrix:!y,applyTerrainMatrix:!0}),ze=$.getPixelScale();let ot;B?(ot=Rc(d,q,a,ze,Z),uh(G,X,q,ne,Z)):C&&N?(ot=kc(d,q,a,ze,Z,Q.lineClipsArray.length),Da(d,t,G,X,a,Q,H,ne,Z)):C?(ot=ll(d,q,a,ze,Z),qc(d,G,X,ne,pe,Z)):N?(ot=zc(d,q,a,ze,Q.lineClipsArray.length),Vt(d,t,G,X,a,Q,H)):ot=On(d,q,a,ze);const jt=d.stencilModeForClipping(H);me.draw(G,X.TRIANGLES,S,jt,P,tt.disabled,ot,Ae,Me,a.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,a.paint,d.transform.zoom,ne,Q.layoutVertexBuffer2),U=!1}},fill:function(d,t,a,o,c){const f=a.paint.get("fill-color"),y=a.paint.get("fill-opacity");if(y.constantOr(1)===0)return;const{isRenderingToTexture:x}=c,w=d.colorModeForRenderPass(),S=a.paint.get("fill-pattern"),P=d.opaquePassEnabledForLayer()&&!S.constantOr(1)&&f.constantOr(h.bo.transparent).a===1&&y.constantOr(0)===1?"opaque":"translucent";if(d.renderPass===P){const E=d.getDepthModeForSublayer(1,d.renderPass==="opaque"?qe.ReadWrite:qe.ReadOnly);Ys(d,t,a,o,E,w,!1,x)}if(d.renderPass==="translucent"&&a.paint.get("fill-antialias")){const E=d.getDepthModeForSublayer(a.getPaintProperty("fill-outline-color")?2:0,qe.ReadOnly);Ys(d,t,a,o,E,w,!0,x)}},fillExtrusion:function(d,t,a,o,c){const f=a.paint.get("fill-extrusion-opacity");if(f===0)return;const{isRenderingToTexture:y}=c;if(d.renderPass==="translucent"){const x=new qe(d.context.gl.LEQUAL,qe.ReadWrite,d.depthRangeFor3D);if(f!==1||a.paint.get("fill-extrusion-pattern").constantOr(1))dn(d,t,a,o,x,it.disabled,yt.disabled,y),dn(d,t,a,o,x,d.stencilModeFor3D(),d.colorModeForRenderPass(),y);else{const w=d.colorModeForRenderPass();dn(d,t,a,o,x,it.disabled,w,y)}}},hillshade:function(d,t,a,o,c){if(d.renderPass!=="offscreen"&&d.renderPass!=="translucent")return;const{isRenderingToTexture:f}=c,y=d.context,x=d.style.projection.useSubdivision,w=d.getDepthModeForSublayer(0,qe.ReadOnly),S=d.colorModeForRenderPass();if(d.renderPass==="offscreen")(function(P,E,C,z,B,N,Z){const j=P.context,G=j.gl,X=z.paint.get("resampling")==="nearest"?G.NEAREST:G.LINEAR;for(const $ of C){const U=E.getTile($),H=U.dem;if(!H?.data||!U.needsHillshadePrepare)continue;const q=H.dim,Q=H.stride,ne=H.getPixels();if(j.activeTexture.set(G.TEXTURE1),j.pixelStoreUnpackPremultiplyAlpha.set(!1),U.demTexture||(U.demTexture=P.getTileTexture(Q)),U.demTexture){const me=U.demTexture;me.update(ne,{premultiply:!1}),me.bind(G.NEAREST,G.CLAMP_TO_EDGE)}else U.demTexture=new h.T(j,ne,G.RGBA,{premultiply:!1}),U.demTexture.bind(G.NEAREST,G.CLAMP_TO_EDGE);j.activeTexture.set(G.TEXTURE0);let se=U.fbo;if(!se){const me=new h.T(j,{width:q,height:q,data:null},G.RGBA);me.bind(X,G.CLAMP_TO_EDGE),se=U.fbo=j.createFramebuffer(q,q,!0,!1),se.colorAttachment.set(me.texture)}j.bindFramebuffer.set(se.framebuffer),j.viewport.set([0,0,q,q]),P.useProgram("hillshadePrepare").draw(j,G.TRIANGLES,B,N,Z,tt.disabled,Fs(U.tileID,H),null,null,z.id,P.rasterBoundsBuffer,P.quadTriangleIndexBuffer,P.rasterBoundsSegments),U.needsHillshadePrepare=!1}})(d,t,o,a,w,it.disabled,S),y.viewport.set([0,0,d.width,d.height]);else if(d.renderPass==="translucent")if(x){const[P,E,C]=d.stencilConfigForOverlapTwoPass(o);Ks(d,t,a,C,P,w,S,!1,f),Ks(d,t,a,C,E,w,S,!0,f)}else{const[P,E]=d.getStencilConfigForOverlapAndUpdateStencilID(o);Ks(d,t,a,E,P,w,S,!1,f)}},colorRelief:function(d,t,a,o,c){if(d.renderPass!=="translucent"||!o.length)return;const{isRenderingToTexture:f}=c,y=d.style.projection.useSubdivision,x=d.getDepthModeForSublayer(0,qe.ReadOnly),w=d.colorModeForRenderPass();if(y){const[S,P,E]=d.stencilConfigForOverlapTwoPass(o);Wn(d,t,a,E,S,x,w,!1,f),Wn(d,t,a,E,P,x,w,!0,f)}else{const[S,P]=d.getStencilConfigForOverlapAndUpdateStencilID(o);Wn(d,t,a,P,S,x,w,!1,f)}},raster:function(d,t,a,o,c){if(d.renderPass!=="translucent"||a.paint.get("raster-opacity")===0||!o.length)return;const{isRenderingToTexture:f}=c,y=t.getSource(),x=d.style.projection.useSubdivision;if(y instanceof Xr)pn(d,t,a,o,null,!1,!1,y.tileCoords,y.flippedWindingOrder,f);else if(x){const[w,S,P]=d.stencilConfigForOverlapTwoPass(o);pn(d,t,a,P,w,!1,!0,za,!1,f),pn(d,t,a,P,S,!0,!0,za,!1,f)}else{const[w,S]=d.getStencilConfigForOverlapAndUpdateStencilID(o);pn(d,t,a,S,w,!1,!0,za,!1,f)}},background:function(d,t,a,o,c){var f;const y=a.paint.get("background-color"),x=a.paint.get("background-opacity");if(x===0)return;const{isRenderingToTexture:w}=c,S=d.context,P=S.gl,E=d.style.projection,C=d.transform,z=C.tileSize,B=a.paint.get("background-pattern");if(d.isPatternMissing(B))return;const N=!B&&y.a===1&&x===1&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==N)return;const Z=it.disabled,j=d.getDepthModeForSublayer(0,N==="opaque"?qe.ReadWrite:qe.ReadOnly),G=d.colorModeForRenderPass(),X=d.useProgram(B?"backgroundPattern":"background"),$=o||ma(C,{tileSize:z,terrain:d.style.map.terrain});B&&(S.activeTexture.set(P.TEXTURE0),d.imageManager.bind(d.context));const U=a.getCrossfadeParameters();for(const H of $){const q=C.getProjectionData({overscaledTileID:H,applyGlobeMatrix:!w,applyTerrainMatrix:!0}),Q=B?pl(x,d,B,{tileID:H,tileSize:z},U):Ia(x,y),ne=(f=d.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(H),se=E.getMeshFromTileID(S,H.canonical,!1,!0,"raster");X.draw(S,P.TRIANGLES,j,Z,G,tt.backCCW,Q,ne,q,a.id,se.vertexBuffer,se.indexBuffer,se.segments)}},sky:function(d,t){const a=d.context,o=a.gl,c=((P,E,C)=>{const z=Math.cos(E.rollInRadians),B=Math.sin(E.rollInRadians),N=fa(E),Z=E.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:P.properties.get("sky-color"),u_horizon_color:P.properties.get("horizon-color"),u_horizon:[(E.width/2-N*B)*C,(E.height/2+N*z)*C],u_horizon_normal:[-B,z],u_sky_horizon_blend:P.properties.get("sky-horizon-blend")*E.height/2*C,u_sky_blend:Z}})(t,d.style.map.transform,d.pixelRatio),f=new qe(o.LEQUAL,qe.ReadWrite,[0,1]),y=it.disabled,x=d.colorModeForRenderPass(),w=d.useProgram("sky"),S=Sl(a,t);w.draw(a,o.TRIANGLES,f,y,x,tt.disabled,c,null,void 0,"sky",S.vertexBuffer,S.indexBuffer,S.segments)},atmosphere:function(d,t,a){const o=d.context,c=o.gl,f=d.useProgram("atmosphere"),y=new qe(c.LEQUAL,qe.ReadOnly,[0,1]),x=d.transform,w=(function(Z,j){const G=Z.properties.get("position"),X=[-G.x,-G.y,-G.z],$=h.ap(new Float64Array(16));return Z.properties.get("anchor")==="map"&&(h.be($,$,j.rollInRadians),h.bf($,$,-j.pitchInRadians),h.be($,$,j.bearingInRadians),h.bf($,$,j.center.lat*Math.PI/180),h.bI($,$,-j.center.lng*Math.PI/180)),h.cg(X,X,$),X})(a,d.transform),S=x.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),P=t.properties.get("atmosphere-blend")*S.projectionTransition;if(P===0)return;const E=Wi(x.worldSize,x.center.lat),C=x.inverseProjectionMatrix,z=new Float64Array(4);z[3]=1,h.aE(z,z,x.modelViewProjectionMatrix),z[0]/=z[3],z[1]/=z[3],z[2]/=z[3],z[3]=1,h.aE(z,z,C),z[0]/=z[3],z[1]/=z[3],z[2]/=z[3],z[3]=1;const B=((Z,j,G,X,$)=>({u_sun_pos:Z,u_atmosphere_blend:j,u_globe_position:G,u_globe_radius:X,u_inv_proj_matrix:$}))(w,P,[z[0],z[1],z[2]],E,C),N=Sl(o,t);f.draw(o,c.TRIANGLES,y,it.disabled,yt.alphaBlended,tt.disabled,B,null,null,"atmosphere",N.vertexBuffer,N.indexBuffer,N.segments)},custom:function(d,t,a,o){const{isRenderingGlobe:c}=o,f=d.context,y=a.implementation,x=d.style.projection,w=d.transform,S=w.getProjectionDataForCustomLayer(c),P={farZ:w.farZ,nearZ:w.nearZ,fov:w.fov*Math.PI/180,modelViewProjectionMatrix:w.modelViewProjectionMatrix,projectionMatrix:w.projectionMatrix,shaderData:{variantName:x.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
799uniform mat4 u_projection_matrix;
800${x.shaderPreludeCode.vertexSource}`,define:x.shaderDefine},defaultProjectionData:S},E=y.renderingMode?y.renderingMode:"2d";if(d.renderPass==="offscreen"){const C=y.prerender;C&&(d.setCustomLayerDefaults(),f.setColorMode(d.colorModeForRenderPass()),C.call(y,f.gl,P),f.setDirty(),d.setBaseState())}else if(d.renderPass==="translucent"){d.setCustomLayerDefaults(),f.setColorMode(d.colorModeForRenderPass()),f.setStencilMode(it.disabled);const C=E==="3d"?d.getDepthModeFor3D():d.getDepthModeForSublayer(0,qe.ReadOnly);f.setDepthMode(C),y.render(f.gl,P),f.setDirty(),d.setBaseState(),f.bindFramebuffer.set(null)}},debug:function(d,t,a){for(const o of a)Jc(d,t,o)},debugPadding:function(d){const t=d.transform.padding;bl(d,d.transform.height-(t.top||0),3,Hc),bl(d,t.bottom||0,3,Xc),wl(d,t.left||0,3,Yc),wl(d,d.transform.width-(t.right||0),3,Kc);const a=d.transform.centerPoint;(function(o,c,f,y){Hn(o,c-1,f-10,2,20,y),Hn(o,c-10,f-1,20,2,y)})(d,a.x,d.transform.height-a.y,ia)},terrainDepth:function(d,t){const a=d.context,o=a.gl,c=d.transform,f=yt.unblended,y=new qe(o.LEQUAL,qe.ReadWrite,[0,1]),x=t.tileManager.getRenderableTiles(),w=d.useProgram("terrainDepth");a.bindFramebuffer.set(t.getFramebuffer("depth").framebuffer),a.viewport.set([0,0,d.width/devicePixelRatio,d.height/devicePixelRatio]),a.clear({color:h.bo.transparent,depth:1});for(const S of x){const P=t.getTerrainMesh(S.tileID),E=t.getTerrainData(S.tileID),C=c.getProjectionData({overscaledTileID:S.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),z={u_ele_delta:t.getMeshFrameDelta(c.zoom)};w.draw(a,o.TRIANGLES,y,it.disabled,f,tt.backCCW,z,E,C,"terrain",P.vertexBuffer,P.indexBuffer,P.segments)}a.bindFramebuffer.set(null),a.viewport.set([0,0,d.width,d.height])},terrainCoords:function(d,t){const a=d.context,o=a.gl,c=d.transform,f=yt.unblended,y=new qe(o.LEQUAL,qe.ReadWrite,[0,1]),x=t.getCoordsTexture(),w=t.tileManager.getRenderableTiles(),S=d.useProgram("terrainCoords");a.bindFramebuffer.set(t.getFramebuffer("coords").framebuffer),a.viewport.set([0,0,d.width/devicePixelRatio,d.height/devicePixelRatio]),a.clear({color:h.bo.transparent,depth:1}),t.coordsIndex=[];for(const P of w){const E=t.getTerrainMesh(P.tileID),C=t.getTerrainData(P.tileID);a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,x.texture);const z={u_terrain_coords_id:(255-t.coordsIndex.length)/255,u_texture:0,u_ele_delta:t.getMeshFrameDelta(c.zoom)},B=c.getProjectionData({overscaledTileID:P.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});S.draw(a,o.TRIANGLES,y,it.disabled,f,tt.backCCW,z,C,B,"terrain",E.vertexBuffer,E.indexBuffer,E.segments),t.coordsIndex.push(P.tileID.key)}a.bindFramebuffer.set(null),a.viewport.set([0,0,d.width,d.height])}};class Xn{constructor(t,a){this.drawFunctions=Qc,this.context=new Hs(t),this.transform=a,this._tileTextures={},this.terrainFacilitator={depthDirty:!0,coordsDirty:!1,matrix:h.ap(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=hi.maxOverzooming+hi.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ni}resize(t,a,o){if(this.width=Math.floor(t*o),this.height=Math.floor(a*o),this.pixelRatio=o,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const c of this.style._order)this.style._layers[c].resize()}setup(){const t=this.context,a=new h.aU;a.emplaceBack(0,0),a.emplaceBack(h.a6,0),a.emplaceBack(0,h.a6),a.emplaceBack(h.a6,h.a6),this.tileExtentBuffer=t.createVertexBuffer(a,Qr.members),this.tileExtentSegments=h.aV.simpleSegment(0,0,4,2);const o=new h.aU;o.emplaceBack(0,0),o.emplaceBack(h.a6,0),o.emplaceBack(0,h.a6),o.emplaceBack(h.a6,h.a6),this.debugBuffer=t.createVertexBuffer(o,Qr.members),this.debugSegments=h.aV.simpleSegment(0,0,4,5);const c=new h.ch;c.emplaceBack(0,0,0,0),c.emplaceBack(h.a6,0,h.a6,0),c.emplaceBack(0,h.a6,0,h.a6),c.emplaceBack(h.a6,h.a6,h.a6,h.a6),this.rasterBoundsBuffer=t.createVertexBuffer(c,Bn.members),this.rasterBoundsSegments=h.aV.simpleSegment(0,0,4,2);const f=new h.aU;f.emplaceBack(0,0),f.emplaceBack(h.a6,0),f.emplaceBack(0,h.a6),f.emplaceBack(h.a6,h.a6),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(f,Qr.members),this.rasterBoundsSegmentsPosOnly=h.aV.simpleSegment(0,0,4,5);const y=new h.aU;y.emplaceBack(0,0),y.emplaceBack(1,0),y.emplaceBack(0,1),y.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(y,Qr.members),this.viewportSegments=h.aV.simpleSegment(0,0,4,2);const x=new h.ci;x.emplaceBack(0),x.emplaceBack(1),x.emplaceBack(3),x.emplaceBack(2),x.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(x);const w=new h.aW;w.emplaceBack(1,0,2),w.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(w);const S=this.context.gl;this.stencilClearMode=new it({func:S.ALWAYS,mask:0},0,255,S.ZERO,S.ZERO,S.ZERO),this.tileExtentMesh=new _t(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const t=this.context,a=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const o=h.O();h.c7(o,0,this.width,this.height,0,0,1),h.S(o,o,[a.drawingBufferWidth,a.drawingBufferHeight,0]);const c={mainMatrix:o,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:o};this.useProgram("clippingMask",null,!0).draw(t,a.TRIANGLES,qe.disabled,this.stencilClearMode,yt.disabled,tt.disabled,null,null,c,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,a,o){if(this.currentStencilSource===t.source||!t.isTileClipped()||!a?.length)return;this.currentStencilSource=t.source,this.nextStencilID+a.length>256&&this.clearStencil();const c=this.context;c.setColorMode(yt.disabled),c.setDepthMode(qe.disabled);const f={};for(const y of a)f[y.key]=this.nextStencilID++;this._renderTileMasks(f,a,o,!0),this._renderTileMasks(f,a,o,!1),this._tileClippingMaskIDs=f}_renderTileMasks(t,a,o,c){var f;const y=this.context,x=y.gl,w=this.style.projection,S=this.transform,P=this.useProgram("clippingMask");for(const E of a){const C=t[E.key],z=(f=this.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(E),B=w.getMeshFromTileID(this.context,E.canonical,c,!0,"stencil"),N=S.getProjectionData({overscaledTileID:E,applyGlobeMatrix:!o,applyTerrainMatrix:!0});P.draw(y,x.TRIANGLES,qe.disabled,new it({func:x.ALWAYS,mask:0},C,255,x.KEEP,x.KEEP,x.REPLACE),yt.disabled,o?tt.disabled:tt.backCCW,null,z,N,"$clipping",B.vertexBuffer,B.indexBuffer,B.segments)}}_renderTilesDepthBuffer(){var t;const a=this.context,o=a.gl,c=this.style.projection,f=this.transform,y=this.useProgram("depth"),x=this.getDepthModeFor3D(),w=ma(f,{tileSize:f.tileSize});for(const S of w){const P=(t=this.style.map.terrain)===null||t===void 0?void 0:t.getTerrainData(S),E=c.getMeshFromTileID(this.context,S.canonical,!0,!0,"raster"),C=f.getProjectionData({overscaledTileID:S,applyGlobeMatrix:!0,applyTerrainMatrix:!0});y.draw(a,o.TRIANGLES,x,it.disabled,yt.disabled,tt.backCCW,null,P,C,"$clipping",E.vertexBuffer,E.indexBuffer,E.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,a=this.context.gl;return new it({func:a.NOTEQUAL,mask:255},t,255,a.KEEP,a.KEEP,a.REPLACE)}stencilModeForClipping(t){const a=this.context.gl;return new it({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,a.KEEP,a.KEEP,a.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){const a=this.context.gl,o=t.sort(((y,x)=>x.overscaledZ-y.overscaledZ)),c=o[o.length-1].overscaledZ,f=o[0].overscaledZ-c+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();const y={};for(let x=0;x<f;x++)y[x+c]=new it({func:a.GEQUAL,mask:255},x+this.nextStencilID,255,a.KEEP,a.KEEP,a.REPLACE);return this.nextStencilID+=f,[y,o]}return[{[c]:it.disabled},o]}stencilConfigForOverlapTwoPass(t){const a=this.context.gl,o=t.sort(((y,x)=>x.overscaledZ-y.overscaledZ)),c=o[o.length-1].overscaledZ,f=o[0].overscaledZ-c+1;if(this.clearStencil(),f>1){const y={},x={};for(let w=0;w<f;w++)y[w+c]=new it({func:a.GREATER,mask:255},f+1+w,255,a.KEEP,a.KEEP,a.REPLACE),x[w+c]=new it({func:a.GREATER,mask:255},1+w,255,a.KEEP,a.KEEP,a.REPLACE);return this.nextStencilID=2*f+1,[y,x,o]}return this.nextStencilID=3,[{[c]:new it({func:a.GREATER,mask:255},2,255,a.KEEP,a.KEEP,a.REPLACE)},{[c]:new it({func:a.GREATER,mask:255},1,255,a.KEEP,a.KEEP,a.REPLACE)},o]}colorModeForRenderPass(){const t=this.context.gl;return this._showOverdrawInspector?new yt([t.CONSTANT_COLOR,t.ONE],new h.bo(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?yt.unblended:yt.alphaBlended}getDepthModeForSublayer(t,a,o){if(!this.opaquePassEnabledForLayer())return qe.disabled;const c=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new qe(o||this.context.gl.LEQUAL,a,[c,c])}getDepthModeFor3D(){return new qe(this.context.gl.LEQUAL,qe.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,a){var o,c,f;this.style=t,this.options=a,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(je()),this.imageManager.beginFrame();const y=this.style._order,x=this.style.tileManagers,w={},S={},P={},E={isRenderingToTexture:!1,isRenderingGlobe:((o=t.projection)===null||o===void 0?void 0:o.transitionState)>0};for(const z in x){const B=x[z];B.used&&B.prepare(this.context),w[z]=B.getVisibleCoordinates(!1),S[z]=w[z].slice().reverse(),P[z]=B.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let z=0;z<y.length;z++)if(this.style._layers[y[z]].is3D()){this.opaquePassCutoff=z;break}this.maybeDrawDepth(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const z of y){const B=this.style._layers[z];if(!B.hasOffscreenPass()||B.isHidden(this.transform.zoom))continue;const N=S[B.source];(B.type==="custom"||N.length)&&this.renderLayer(this,x[B.source],B,N,E)}if((c=this.style.projection)===null||c===void 0||c.updateGPUdependent({context:this.context,useProgram:z=>this.useProgram(z)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:a.showOverdrawInspector?h.bo.black:h.bo.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=y.length-1;this.currentLayer>=0;this.currentLayer--){const z=this.style._layers[y[this.currentLayer]],B=x[z.source],N=w[z.source];this._renderTileClippingMasks(z,N,!1),this.renderLayer(this,B,z,N,E)}this.renderPass="translucent";let C=!1;for(this.currentLayer=0;this.currentLayer<y.length;this.currentLayer++){const z=this.style._layers[y[this.currentLayer]],B=x[z.source];if(!((f=this.renderToTexture)===null||f===void 0)&&f.renderLayer(z,E))continue;this.opaquePassEnabledForLayer()||C||(C=!0,E.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const N=(z.type==="symbol"?P:S)[z.source];this._renderTileClippingMasks(z,w[z.source],!!this.renderToTexture),this.renderLayer(this,B,z,N,E)}if(E.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const z=(function(B,N){let Z=null;const j=Object.values(B._layers).flatMap((U=>
800U.source&&!U.isHidden(N)?[B.tileManagers[U.source]]:[])),G=j.filter((U=>U.getSource().type==="vector")),X=j.filter((U=>U.getSource().type!=="vector")),$=U=>{(!Z||Z.getSource().maxzoom<U.getSource().maxzoom)&&(Z=U)};for(const U of G)$(U);if(!Z)for(const U of X)$(U);return Z})(this.style,this.transform.zoom);z&&this.drawFunctions.debug(this,z,z.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(t){var a,o;if(!(!((o=(a=this.style)===null||a===void 0?void 0:a.map)===null||o===void 0)&&o.terrain))return;const c=this.terrainFacilitator.matrix,f=this.transform.modelViewProjectionMatrix;let y=this.terrainFacilitator.depthDirty;y||(y=t?!h.cj(c,f):!h.ck(c,f)),y||(y=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),y&&(h.cl(c,f),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.depthDirty=!1,this.terrainFacilitator.coordsDirty=!0,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}maybeDrawCoords(){var t,a;!((a=(t=this.style)===null||t===void 0?void 0:t.map)===null||a===void 0)&&a.terrain&&this.terrainFacilitator.coordsDirty&&(this.terrainFacilitator.coordsDirty=!1,this.drawFunctions.terrainCoords(this,this.style.map.terrain))}renderLayer(t,a,o,c,f){if(o.isHidden(this.transform.zoom)||o.type!=="background"&&o.type!=="custom"&&!(c||[]).length)return;this.id=o.id;const y=this.drawFunctions;h.aQ(o)?y.symbol(t,a,o,c,this.style.placement.variableOffsets,f):h.cm(o)?y.circle(t,a,o,c,f):h.cn(o)?y.heatmap(t,a,o,c,f):h.co(o)?y.line(t,a,o,c,f):h.cp(o)?y.fill(t,a,o,c,f):h.cq(o)?y.fillExtrusion(t,a,o,c,f):h.cr(o)?y.hillshade(t,a,o,c,f):h.cs(o)?y.colorRelief(t,a,o,c,f):h.bU(o)?y.raster(t,a,o,c,f):h.ct(o)?y.background(t,a,o,c,f):h.cu(o)&&y.custom(t,a,o,f)}saveTileTexture(t){const a=this._tileTextures[t.size[0]];a?a.length<Xn.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?a.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const a=this._tileTextures[t];return a&&a.length>0?a.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const a=this.imageManager.getPattern(t.from.toString()),o=this.imageManager.getPattern(t.to.toString());return!a||!o}useProgram(t,a,o=!1,c=[]){var f;this.cache||(this.cache={});const y=!!this.style.map.terrain,x=this.style.projection,w=o?It.projectionMercator:x.shaderPreludeCode,S=o?Ci:x.shaderDefine,P=t+(a?a.cacheKey:"")+`/${o?qi:x.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(y?"/terrain":"")+(c?`/${c.join("/")}`:"");return(f=this.cache)[P]||(f[P]=new Ku(this.context,It[t],a,th[t],this._showOverdrawInspector,y,w,S,c)),this.cache[P]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new h.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,a;if(this._tileTextures){for(const o in this._tileTextures){const c=this._tileTextures[o];if(c)for(const f of c)f.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&((t=this.tileExtentMesh.vertexBuffer)===null||t===void 0||t.destroy()),this.tileExtentMesh&&((a=this.tileExtentMesh.indexBuffer)===null||a===void 0||a.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(const o in this.cache){const c=this.cache[o];c?.program&&this.context.gl.deleteProgram(c.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:a}=this.context.gl;return this.width!==t||this.height!==a}}function Pl(d,t){let a,o=!1,c=null;const f=()=>{c=null,o&&(d(...a),c=setTimeout(f,t),o=!1)};
vendor: 56,029 bytes, line 800
800return(...y)=>(o=!0,a=y,c||f(),c)}Xn.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50;class Yn{constructor(t){this._getCurrentHash=()=>{const a=window.location.hash.replace("#","");if(this._hashName){let o;const c=a.split("&").map((f=>f.split("=")));for(const f of c)f[0]===this._hashName&&(o=f);return(o&&o[1]||"").split("/")}return a.split("/")},this._onHashChange=()=>{const a=this._getCurrentHash();if(!this._isValidHash(a))return!1;const o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:o,pitch:+(a[4]||0)}),!0},this._updateHashUnthrottled=()=>{const a=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,a)},this._removeHash=()=>{const a=this._getCurrentHash();if(a.length===0)return;const o=a.join("/");let c=o;c.split("&").length>0&&(c=c.split("&")[0]),this._hashName&&(c=`${this._hashName}=${o}`);let f=window.location.hash.replace(c,"");f.startsWith("#&")?f=f.slice(0,1)+f.slice(2):f==="#"&&(f="");let y=window.location.href.replace(/(#.+)?$/,f);y=y.replace("&&","&"),window.history.replaceState(window.history.state,null,y)},this._updateHash=Pl(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){const a=this._map.getCenter(),o=Math.round(100*this._map.getZoom())/100,c=Math.ceil((o*Math.LN2+Math.log(512/360/.5))/Math.LN10),f=Math.pow(10,c),y=Math.round(a.lng*f)/f,x=Math.round(a.lat*f)/f,w=this._map.getBearing(),S=this._map.getPitch();let P="";if(P+=t?`/${y}/${x}/${o}`:`${o}/${x}/${y}`,(w||S)&&(P+="/"+Math.round(10*w)/10),S&&(P+=`/${Math.round(S)}`),this._hashName){const E=this._hashName;let C=!1;const z=window.location.hash.slice(1).split("&").map((B=>{const N=B.split("=")[0];return N===E?(C=!0,`${N}=${P}`):B})).filter((B=>B));return C||z.push(`${E}=${P}`),`#${z.join("&")}`}return`#${P}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new h.W(+t[2],+t[1])}catch{return!1}const a=+t[0],o=+(t[3]||0),c=+(t[4]||0);return a>=this._map.getMinZoom()&&a<=this._map.getMaxZoom()&&o>=-180&&o<=180&&c>=this._map.getMinPitch()&&c<=this._map.getMaxPitch()}}const fn={linearity:.3,easing:h.cv(0,0,.3,1)},ar=h.e({deceleration:2500,maxSpeed:1400},fn),_r=h.e({deceleration:20,maxSpeed:1400},fn),eu=h.e({deceleration:1e3,maxSpeed:360},fn),yr=h.e({deceleration:1e3,maxSpeed:90},fn),hh=h.e({deceleration:1e3,maxSpeed:360},fn);class dh{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:je(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,a=je();for(;t.length>0&&a-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const a={zoom:0,bearing:0,pitch:0,roll:0,pan:new h.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:f}of this._inertiaBuffer)a.zoom+=f.zoomDelta||0,a.bearing+=f.bearingDelta||0,a.pitch+=f.pitchDelta||0,a.roll+=f.rollDelta||0,f.panDelta&&a.pan._add(f.panDelta),f.around&&(a.around=f.around),f.pinchAround&&(a.pinchAround=f.pinchAround);const o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(a.pan.mag()){const f=Mr(a.pan.mag(),o,h.e({},ar,t||{})),y=a.pan.mult(f.amount/a.pan.mag()),x=this._map.cameraHelper.handlePanInertia(y,this._map.transform);c.center=x.easingCenter,c.offset=x.easingOffset,Kn(c,f)}if(a.zoom){const f=Mr(a.zoom,o,_r);c.zoom=h.cw(this._map.transform.zoom+f.amount,this._map.getZoomSnap(),f.amount),Kn(c,f)}if(a.bearing){const f=Mr(a.bearing,o,eu);c.bearing=this._map.transform.bearing+h.al(f.amount,-179,179),Kn(c,f)}if(a.pitch){const f=Mr(a.pitch,o,yr);c.pitch=this._map.transform.pitch+f.amount,Kn(c,f)}if(a.roll){const f=Mr(a.roll,o,hh);c.roll=this._map.transform.roll+h.al(f.amount,-179,179),Kn(c,f)}if(c.zoom||c.bearing){const f=a.pinchAround===void 0?a.around:a.pinchAround;c.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),h.e(c,{noMoveStart:!0})}}function Kn(d,t){(!d.duration||d.duration<t.duration)&&(d.duration=t.duration,d.easing=t.easing)}function Mr(d,t,a){const{maxSpeed:o,linearity:c,deceleration:f}=a,y=h.al(d*c/(t/1e3),-o,o),x=Math.abs(y)/(f*c);return{easing:a.easing,duration:1e3*x,amount:y*(x/2)}}class Xi extends h.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,o,c={}){o=o instanceof MouseEvent?o:new MouseEvent(t,o);const f=de.mousePos(a.getCanvas(),o),y=a.unproject(f);super(t,h.e({point:f,lngLat:y,originalEvent:o},c)),this._defaultPrevented=!1,this.target=a}}class Jn extends h.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,o){const c=t==="touchend"?o.changedTouches:o.touches,f=de.touchPos(a.getCanvasContainer(),c),y=f.map((w=>a.unproject(w))),x=f.reduce(((w,S,P,E)=>w.add(S.div(E.length))),new h.P(0,0));super(t,{points:f,point:x,lngLats:y,lngLat:a.unproject(x),originalEvent:o}),this._defaultPrevented=!1}}class tu extends h.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,o){super(t,{originalEvent:o}),this._defaultPrevented=!1}}class ph{constructor(t,a){this._map=t,this._clickTolerance=a.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new tu(t.type,this._map,t))}mousedown(t,a){return this._mousedownPos=a,this._firePreventable(new Xi(t.type,this._map,t))}mouseup(t){this._map.fire(new Xi(t.type,this._map,t))}click(t,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new Xi(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Xi(t.type,this._map,t))}mouseover(t){this._map.fire(new Xi(t.type,this._map,t))}mouseout(t){this._map.fire(new Xi(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Jn(t.type,this._map,t))}touchmove(t){this._map.fire(new Jn(t.type,this._map,t))}touchend(t){this._map.fire(new Jn(t.type,this._map,t))}touchcancel(t){this._map.fire(new Jn(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iu{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Xi(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Xi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Xi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Br{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.screenPointToLocation(h.P.convert(t),this._map.terrain)}}class Ir{constructor(t,a){this._map=t,this._tr=new Br(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=a.clickTolerance||1,a.boxZoom&&typeof a.boxZoom=="object"&&(this._boxZoomEnd=a.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,a){this.isEnabled()&&t.shiftKey&&t.button===0&&(de.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)}mousemoveWindow(t,a){if(!this._active)return;const o=a;if(this._lastPos.equals(o)||!this._box&&o.dist(this._startPos)<this._clickTolerance)return;const c=this._startPos;this._lastPos=o,this._box||(this._box=de.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const f=Math.min(c.x,o.x),y=Math.max(c.x,o.x),x=Math.min(c.y,o.y),w=Math.max(c.y,o.y);this._box.style.transform=`translate(${f}px,${x}px)`,this._box.style.width=y-f+"px",this._box.style.height=w-x+"px"}mouseupWindow(t,a){if(!this._active||t.button!==0)return;const o=this._startPos,c=a;if(this.reset(),de.suppressClick(),o.x!==c.x||o.y!==c.y)return this._map.fire(new h.n("boxzoomend",{originalEvent:t})),this._boxZoomEnd?void this._boxZoomEnd(this._map,o,c,t):{cameraAnimation:f=>f.fitScreenCoordinates(o,c,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box.remove(),this._box=null),de.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,a){return this._map.fire(new h.n(t,{originalEvent:a}))}}function Ee(d,t){if(d.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${d.length}, points ${t.length}`);const a={};for(let o=0;o<d.length;o++)a[d[o].identifier]=t[o];return a}class ru{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,a,o){(this.centroid||o.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),o.length===this.numTouches&&(this.centroid=(function(c){const f=new h.P(0,0);for(const y of c)f._add(y);return f.div(c.length)})(a),this.touches=Ee(o,a)))}touchmove(t,a,o){if(this.aborted||!this.centroid)return;const c=Ee(o,a);for(const f in this.touches){const y=c[f];(!y||y.dist(this.touches[f])>30)&&(this.aborted=!0)}}touchend(t,a,o){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),o.length===0){const c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class Qn{constructor(t){this.singleTap=new ru(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,a,o){this.singleTap.touchstart(t,a,o)}touchmove(t,a,o){this.singleTap.touchmove(t,a,o)}touchend(t,a,o){const c=this.singleTap.touchend(t,a,o);if(c){const f=t.timeStamp-this.lastTime<500,y=!this.lastTap||this.lastTap.dist(c)<30;if(f&&y||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class au{constructor(t){this._tr=new Br(t),this._zoomIn=new Qn({numTouches:1,numTaps:2}),this._zoomOut=new Qn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,a,o){this._zoomIn.touchstart(t,a,o),this._zoomOut.touchstart(t,a,o)}touchmove(t,a,o){this._zoomIn.touchmove(t,a,o),this._zoomOut.touchmove(t,a,o)}touchend(t,a,o){const c=this._zoomIn.touchend(t,a,o),f=this._zoomOut.touchend(t,a,o),y=this._tr;return c?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:x=>x.easeTo({duration:300,zoom:h.cw(y.zoom+1,x.getZoomSnap()),around:y.unproject(c)},{originalEvent:t})}):f?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:x=>x.easeTo({duration:300,zoom:h.cw(y.zoom-1,x.getZoomSnap()),around:y.unproject(f)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Or{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const a=this._moveFunction(...t);if(a.bearingDelta||a.pitchDelta||a.rollDelta||a.around||a.panDelta)return this._active=!0,a}dragStart(t,a){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(a)?a[0]:a,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,a){if(!this.isEnabled())return;const o=this._lastPoint;if(!o)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const c=Array.isArray(a)?a[0]:a;return!this._moved&&c.dist(o)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=c,this._move(o,c))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&de.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const es=0,Ml=2,fh={[es]:1,[Ml]:2};class Ra{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!(function(a,o){const c=fh[o];return a.buttons===void 0||(a.buttons&c)!==c})(t,this._eventButton)}isValidEndEvent(t){return t.button===this._eventButton}}class nu{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return t.targetTouches.length===1}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}class Il{constructor(t=new Ra({checkCorrectEvent:()=>!0}),a=new nu){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=a}_executeRelevantHandler(t,a,o){return t instanceof MouseEvent?a(t):typeof TouchEvent<"u"&&t instanceof TouchEvent?o(t):void 0}startMove(t){this._executeRelevantHandler(t,(a=>{this.mouseMoveStateManager.startMove(a)}),(a=>{this.oneFingerTouchMoveStateManager.startMove(a)}))}endMove(t){this._executeRelevantHandler(t,(a=>{this.mouseMoveStateManager.endMove(a)}),(a=>{this.oneFingerTouchMoveStateManager.endMove(a)}))}isValidStartEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidStartEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidStartEvent(a)))}isValidMoveEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidMoveEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(a)))}isValidEndEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidEndEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidEndEvent(a)))}}const Js=d=>{d.mousedown=d.dragStart,d.mousemoveWindow=d.dragMove,d.mouseup=d.dragEnd,d.contextmenu=t=>{t.preventDefault()}};class su{constructor(t,a){this._clickTolerance=t.clickTolerance||1,this._map=a,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new h.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,a,o){return this._calculateTransform(t,a,o)}touchmove(t,a,o){if(this._active){if(!this._shouldBePrevented(o.length))return t.preventDefault(),this._calculateTransform(t,a,o);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,a,o){this._calculateTransform(t,a,o),this._active&&this._shouldBePrevented(o.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,a,o){o.length>0&&(this._active=!0);const c=Ee(o,a),f=new h.P(0,0),y=new h.P(0,0);let x=0;for(const S in c){const P=c[S],E=this._touches[S];E&&(f._add(P),y._add(P.sub(E)),x++,c[S]=P)}if(this._touches=c,this._shouldBePrevented(x)||!y.mag())return;const w=y.div(x);return this._sum._add(w),this._sum.mag()<this._clickTolerance?void 0:{around:f.div(x),panDelta:w}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class El{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,a,o){this._firstTwoTouches||o.length<2||(this._firstTwoTouches=[o[0].identifier,o[1].identifier],this._start([a[0],a[1]]))}touchmove(t,a,o){if(!this._firstTwoTouches)return;t.preventDefault();const[c,f]=this._firstTwoTouches,y=Qs(o,a,c),x=Qs(o,a,f);if(!y||!x)return;const w=this._aroundCenter?null:y.add(x).div(2);return this._move([y,x],w,t)}touchend(t,a,o){if(!this._firstTwoTouches)return;const[c,f]=this._firstTwoTouches,y=Qs(o,a,c),x=Qs(o,a,f);y&&x||(this._active&&de.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Qs(d,t,a){for(let o=0;o<d.length;o++)if(d[o].identifier===a)return t[o]}function Cl(d,t){return Math.log(d/t)/Math.LN2}class ou extends El{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(t){this._zoomRate=t??1}setZoomThreshold(t){this._zoomThreshold=t??.1}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,a){const o=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Cl(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:Cl(this._distance,o)*this._zoomRate,pinchAround:a}}}function Al(d,t){return 180*d.angleWith(t)/Math.PI}class lu extends El{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,a,o){const c=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Al(this._vector,c),pinchAround:a}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const a=25/(Math.PI*this._minDiameter)*360,o=Al(t,this._startVector);return Math.abs(o)<a}}function Dl(d){return Math.abs(d.y)>Math.abs(d.x)}class Nr extends El{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,a,o){super.touchstart(t,a,o),this._currentTouchCount=o.length}_start(t){this._lastPoints=t,Dl(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,a,o){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const c=t[0].sub(this._lastPoints[0]),f=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(c,f,o.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+f.y)/2*-.5}):void 0}gestureBeginsVertically(t,a,o){if(this._valid!==void 0)return this._valid;const c=t.mag()>=2,f=a.mag()>=2;if(!c&&!f)return;if(!c||!f)return this._firstMove===void 0&&(this._firstMove=o),o-this._firstMove<100&&void 0;const y=t.y>0==a.y>0;return Dl(t)&&Dl(a)&&y}}const vt={panStep:100,bearingStep:15,pitchStep:10};class cu{constructor(t){this._tr=new Br(t);const a=vt;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let a=0,o=0,c=0,f=0,y=0;switch(t.keyCode){case 61:case 107:case 171:case 187:a=1;break;case 189:case 109:case 173:a=-1;break;case 37:t.shiftKey?o=-1:(t.preventDefault(),f=-1);break;case 39:t.shiftKey?o=1:(t.preventDefault(),f=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),y=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(o=0,c=0),{cameraAnimation:x=>{const w=this._tr;x.easeTo({duration:300,easeId:"keyboardHandler",easing:eo,zoom:a?h.cw(w.zoom+a*(t.shiftKey?2:1),x.getZoomSnap()):w.zoom,bearing:w.bearing+o*this._bearingStep,pitch:w.pitch+c*this._pitchStep,offset:[-f*this._panStep,-y*this._panStep],center:w.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function eo(d){return d*(2-d)}const ts=4.000244140625,zl=1/450;class Rl{constructor(t,a){this._onTimeout=o=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)},this._map=t,this._tr=new Br(t),this._triggerRenderFrame=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=zl}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let a=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const o=je(),c=o-(this._lastWheelEventTime||0);this._lastWheelEventTime=o,a!==0&&a%ts==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),t.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=t,this._delta-=a,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const a=de.mousePos(this._map.getCanvas(),t),o=this._tr;this._aroundPoint=this._aroundCenter?o.transform.locationToScreenPoint(h.W.convert(o.center)):a,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;const t=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const x=t.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=x),typeof this._targetZoom=="number"&&(this._targetZoom+=x)}if(this._delta!==0){const x=this._type==="wheel"&&Math.abs(this._delta)>ts?this._wheelZoomRate:this._defaultZoomRate;let w=2/(1+Math.exp(-Math.abs(this._delta*x)));this._delta<0&&w!==0&&(w=1/w);const S=typeof this._targetZoom!="number"?t.scale:h.ao(this._targetZoom),P=t.applyConstrain(t.getCameraLngLat(),h.ar(S*w)).zoom,E=this._map.getZoomSnap();if(this._type==="wheel"&&E>0){const C=h.cw(t.zoom,E);this._targetZoom=h.cw(P,E,P-C)}else this._targetZoom=P;this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const a=typeof this._targetZoom!="number"?t.zoom:this._targetZoom,o=this._startZoom,c=this._easing;let f,y=!1;if(this._type==="wheel"&&o&&c){const x=je()-this._lastWheelEventTime,w=Math.min((x+5)/200,1),S=c(w);f=h.H.number(o,a,S),w<1?this._needsRerender=!0:y=!0}else f=a,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=f,{noInertia:!0,needsRenderFrame:!y,zoomDelta:f-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let a=h.cy;if(this._prevEase){const o=this._prevEase,c=(je()-o.start)/o.duration,f=o.easing(c+.01)-o.easing(c),y=.27/Math.sqrt(f*f+1e-4)*.01,x=Math.sqrt(.0729-y*y);a=h.cv(y,x,.25,1)}return this._prevEase={start:je(),duration:t,easing:a},a}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class kl{constructor(t,a){this._clickZoom=t,this._tapZoom=a}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class uu{constructor(t){this._tr=new Br(t),this.reset()}reset(){this._active=!1}dblclick(t,a){return t.preventDefault(),{cameraAnimation:o=>{o.easeTo({duration:300,zoom:h.cw(this._tr.zoom+(t.shiftKey?-1:1),o.getZoomSnap()),around:this._tr.unproject(a)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class mh{constructor(){this._tap=new Qn({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,a,o){if(!this._swipePoint)if(this._tapTime){const c=a[0],f=t.timeStamp-this._tapTime<500,y=this._tapPoint.dist(c)<30;f&&y?o.length>0&&(this._swipePoint=c,this._swipeTouch=o[0].identifier):this.reset()}else this._tap.touchstart(t,a,o)}touchmove(t,a,o){if(this._tapTime){if(this._swipePoint){if(o[0].identifier!==this._swipeTouch)return;const c=a[0],f=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:f/128*this._zoomRate}}}else this._tap.touchmove(t,a,o)}touchend(t,a,o){if(this._tapTime)this._swipePoint&&o.length===0&&this.reset();else{const c=this._tap.touchend(t,a,o);c&&(this._tapTime=t.timeStamp,this._tapPoint=c)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vr{constructor(t,a,o){this._el=t,this._mousePan=a,this._touchPan=o}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class is{constructor(t,a,o,c){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=a,this._mousePitch=o,this._mouseRoll=c}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class De{constructor(t,a,o,c){this._el=t,this._touchZoom=a,this._touchRotate=o,this._tapDragZoom=c,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class ke{constructor(t,a){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=a,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=de.create("div","maplibregl-cooperative-gesture-screen",t);let a=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(a=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const o=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),c=document.createElement("div");c.className="maplibregl-desktop-message",c.textContent=a,this._container.appendChild(c);const f=document.createElement("div");f.className="maplibregl-mobile-message",f.textContent=o,this._container.appendChild(f),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,a){this._enabled&&(this._map.fire(new h.n("cooperativegestureprevented",{gestureType:t,originalEvent:a})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const ra=d=>d.zoom||d.drag||d.roll||d.pitch||d.rotate;class hu extends h.n{}function mn(d){var t;return((t=d.panDelta)===null||t===void 0?void 0:t.mag())||d.zoomDelta||d.bearingDelta||d.pitchDelta||d.rollDelta}class Di{get _ownerDocument(){var t;return((t=this._el)===null||t===void 0?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,a;return((a=(t=this._el)===null||t===void 0?void 0:t.ownerDocument)===null||a===void 0?void 0:a.defaultView)||window}constructor(t,a){this.handleWindowEvent=c=>{this.handleEvent(c,`${c.type}Window`)},this.handleEvent=(c,f)=>{if(c.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const y=c.type==="renderFrame"?void 0:c,x={needsRenderFrame:!1},w={},S={};for(const{handlerName:C,handler:z,allowed:B}of this._handlers){if(!z.isEnabled())continue;let N;if(this._blockedByActive(S,B,C))z.reset();else if(z[f||c.type]){if(h.cz(c,f||c.type)){const Z=de.mousePos(this._map.getCanvas(),c);N=z[f||c.type](c,Z)}else if(h.cA(c,f||c.type)){const Z=this._getMapTouches(c.touches),j=de.touchPos(this._map.getCanvas(),Z);N=z[f||c.type](c,j,Z)}else h.cB(f||c.type)||(N=z[f||c.type](c));this.mergeHandlerResult(x,w,N,C,y),N?.needsRenderFrame&&this._triggerRenderFrame()}(N||z.isActive())&&(S[C]=z)}const P={};for(const C in this._previousActiveHandlers)S[C]||(P[C]=y);this._previousActiveHandlers=S,(Object.keys(P).length||mn(x))&&(this._changes.push([x,w,P]),this._triggerRenderFrame()),(Object.keys(S).length||mn(x))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:E}=x;E&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],E(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new dh(t),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a);const o=this._el;this._listeners=[[o,"touchstart",{passive:!0}],[o,"touchmove",{passive:!1}],[o,"touchend",void 0],[o,"touchcancel",void 0],[o,"mousedown",void 0],[o,"mousemove",void 0],[o,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[o,"mouseover",void 0],[o,"mouseout",void 0],[o,"dblclick",void 0],[o,"click",void 0],[o,"keydown",{capture:!1}],[o,"keyup",void 0],[o,"wheel",{passive:!1}],[o,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(const[c,f,y]of this._listeners)c.addEventListener(f,c===this._ownerDocument?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[t,a,o]of this._listeners)t.removeEventListener(a,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,o)}_addDefaultHandlers(t){const a=this._map,o=a.getCanvasContainer();this._add("mapEvent",new ph(a,t));const c=a.boxZoom=new Ir(a,t);this._add("boxZoom",c),t.interactive&&t.boxZoom&&c.enable();const f=a.cooperativeGestures=new ke(a,t.cooperativeGestures);this._add("cooperativeGestures",f),t.cooperativeGestures&&f.enable();const y=new au(a),x=new uu(a);a.doubleClickZoom=new kl(x,y),this._add("tapZoom",y),this._add("clickZoom",x),t.interactive&&t.doubleClickZoom&&a.doubleClickZoom.enable();const w=new mh;this._add("tapDragZoom",w);const S=a.touchPitch=new Nr(a);this._add("touchPitch",S),t.interactive&&t.touchPitch&&a.touchPitch.enable(t.touchPitch);const P=()=>a.project(a.getCenter()),E=(function({enable:$,clickTolerance:U,aroundCenter:H=!0,minPixelCenterThreshold:q=100,rotateDegreesPerPixelMoved:Q=.8},ne){const se=new Ra({checkCorrectEvent:me=>me.button===0&&me.ctrlKey||me.button===2&&!me.ctrlKey});return new Or({clickTolerance:U,move:(me,pe)=>{const Ae=ne();if(H&&Math.abs(Ae.y-me.y)>q)return{bearingDelta:h.cx(new h.P(me.x,pe.y),pe,Ae)};let Te=(pe.x-me.x)*Q;return H&&pe.y<Ae.y&&(Te=-Te),{bearingDelta:Te}},moveStateManager:se,enable:$,assignEvents:Js})})(t,P),C=(function({enable:$,clickTolerance:U,pitchDegreesPerPixelMoved:H=-.5}){const q=new Ra({checkCorrectEvent:Q=>Q.button===0&&Q.ctrlKey||Q.button===2});return new Or({clickTolerance:U,move:(Q,ne)=>({pitchDelta:(ne.y-Q.y)*H}),moveStateManager:q,enable:$,assignEvents:Js})})(t),z=(function({enable:$,clickTolerance:U,rollDegreesPerPixelMoved:H=.3},q){const Q=new Ra({checkCorrectEvent:ne=>ne.button===2&&ne.ctrlKey});return new Or({clickTolerance:U,move:(ne,se)=>{const me=q();let pe=(se.x-ne.x)*H;return se.y<me.y&&(pe=-pe),{rollDelta:pe}},moveStateManager:Q,enable:$,assignEvents:Js})})(t,P);a.dragRotate=new is(t,E,C,z),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",C,["mouseRotate","mouseRoll"]),this._add("mouseRoll",z,["mousePitch"]),t.interactive&&t.dragRotate&&a.dragRotate.enable();const B=(function({enable:$,clickTolerance:U}){const H=new Ra({checkCorrectEvent:q=>q.button===0&&!q.ctrlKey});return new Or({clickTolerance:U,move:(q,Q)=>({around:Q,panDelta:Q.sub(q)}),activateOnStart:!0,moveStateManager:H,enable:$,assignEvents:Js})})(t),N=new su(t,a);a.dragPan=new vr(o,B,N),this._add("mousePan",B),this._add("touchPan",N,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&a.dragPan.enable(t.dragPan);const Z=new lu,j=new ou;a.touchZoomRotate=new De(o,j,Z,w),this._add("touchRotate",Z,["touchPan","touchZoom"]),this._add("touchZoom",j,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&a.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new iu(a));const G=a.scrollZoom=new Rl(a,(()=>this._triggerRenderFrame()));this._add("scrollZoom",G,["mousePan"]),t.interactive&&t.scrollZoom&&a.scrollZoom.enable(t.scrollZoom);const X=a.keyboard=new cu(a);this._add("keyboard",X),t.interactive&&t.keyboard&&a.keyboard.enable()}_add(t,a,o){this._handlers.push({handlerName:t,handler:a,allowed:o}),this._handlersById[t]=a}stop(t){if(!this._updatingCamera){for(const{handler:a}of this._handlers)a.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ra(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,a,o){for(const c in t)if(c!==o&&!a?.includes(c))return!0;return!1}_getMapTouches(t){const a=[];for(const o of t)this._el.contains(o.target)&&a.push(o);return a}mergeHandlerResult(t,a,o,c,f){if(!o)return;h.e(t,o);const y={handlerName:c,originalEvent:o.originalEvent||f};o.zoomDelta!==void 0&&(a.zoom=y),o.panDelta!==void 0&&(a.drag=y),o.rollDelta!==void 0&&(a.roll=y),o.pitchDelta!==void 0&&(a.pitch=y),o.bearingDelta!==void 0&&(a.rotate=y)}_applyChanges(){const t={},a={},o={};for(const[c,f,y]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new h.P(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.rollDelta&&(t.rollDelta=(t.rollDelta||0)+c.rollDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),h.e(a,f),h.e(o,y);this._updateMapTransform(t,a,o),this._changes=[]}_updateMapTransform(t,a,o){const c=this._map,f=c._getTransformForUpdate(),y=c.terrain;if(!(mn(t)||y&&this._terrainMovement))return void this._fireEvents(a,o,!0);c._stop(!0);let{panDelta:x,zoomDelta:w,bearingDelta:S,pitchDelta:P,rollDelta:E,around:C,pinchAround:z}=t;z!==void 0&&(C=z),C||(C=c.transform.centerPoint),y&&!f.isPointOnMapSurface(C)&&(C=f.centerPoint);const B={panDelta:x,zoomDelta:w,rollDelta:E,pitchDelta:P,bearingDelta:S,around:C};this._map.cameraHelper.useGlobeControls&&!f.isPointOnMapSurface(C)&&(C=f.centerPoint);const N=C.distSqr(f.centerPoint)<.01?f.center:f.screenPointToLocation(x?C.sub(x):C);this._handleMapControls({terrain:y,tr:f,deltasForHelper:B,preZoomAroundLoc:N,combinedEventsInProgress:a,panDelta:x}),c._applyUpdatedTransform(f),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(a,o,!0)}_handleMapControls({terrain:t,tr:a,deltasForHelper:o,preZoomAroundLoc:c,combinedEventsInProgress:f,panDelta:y}){const x=this._map.cameraHelper;if(x.handleMapControlsRollPitchBearingZoom(o,a),t)return x.useGlobeControls?(this._terrainMovement||!f.drag&&!f.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void x.handleMapControlsPan(o,a,c)):this._terrainMovement||!f.drag&&!f.zoom?void(f.drag&&this._terrainMovement&&y?a.setCenter(a.screenPointToLocation(a.centerPoint.sub(y))):x.handleMapControlsPan(o,a,c)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void x.handleMapControlsPan(o,a,c));x.handleMapControlsPan(o,a,c)}_fireEvents(t,a,o){const c=ra(this._eventsInProgress),f=ra(t),y={};for(const E in t){const{originalEvent:C}=t[E];this._eventsInProgress[E]||(y[`${E}start`]=C),this._eventsInProgress[E]=t[E]}!c&&f&&this._fireEvent("movestart",f.originalEvent);for(const E in y)this._fireEvent(E,y[E]);f&&this._fireEvent("move",f.originalEvent);for(const E in t){const{originalEvent:C}=t[E];this._fireEvent(E,C)}const x={};let w;for(const E in this._eventsInProgress){const{handlerName:C,originalEvent:z}=this._eventsInProgress[E];this._handlersById[C].isActive()||(delete this._eventsInProgress[E],w=a[C]||z,x[`${E}end`]=w)}for(const E in x)this._fireEvent(E,x[E]);const S=ra(this._eventsInProgress),P=(c||f)&&!S;if(P&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const E=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&E.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(E)}if(o&&P){this._updatingCamera=!0;const E=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),C=z=>z!==0&&-this._bearingSnap<z&&z<this._bearingSnap;!E||!E.essential&&ft.prefersReducedMotion?(this._map.fire(new h.n("moveend",{originalEvent:w})),C(this._map.getBearing())&&this._map.resetNorth()):(C(E.bearing||this._map.getBearing())&&(E.bearing=0),E.freezeElevation=!0,this._map.easeTo(E,{originalEvent:w})),this._updatingCamera=!1}}_fireEvent(t,a){this._map.fire(new h.n(t,a?{originalEvent:a}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new hu("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class du extends h.E{constructor(t,a,o){super(),this._renderFrameCallback=()=>{const c=Math.min((je()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(c)),c<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=o.bearingSnap,this._zoomSnap=o.zoomSnap,this.cameraHelper=a,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(t,a){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=a}getCenter(){return new h.W(this.transform.center.lng,this.transform.center.lat)}setCenter(t,a){return this.jumpTo({center:t},a)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,a){return this.jumpTo({elevation:t},a),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,a,o){return t=h.P.convert(t).mult(-1),this.panTo(this.transform.center,h.e({offset:t},a),o)}panTo(t,a,o){return this.easeTo(h.e({center:t},a),o)}getZoom(){return this.transform.zoom}setZoom(t,a){return this.jumpTo({zoom:t},a),this}zoomTo(t,a,o){return this.easeTo(h.e({zoom:t},a),o)}zoomIn(t,a){return this.zoomTo(h.cw(this.getZoom()+1,this._zoomSnap),t,a),this}zoomOut(t,a){return this.zoomTo(h.cw(this.getZoom()-1,this._zoomSnap),t,a),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,a){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new h.n("movestart",a)).fire(new h.n("move",a)).fire(new h.n("moveend",a))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,a){return this.jumpTo({bearing:t},a),this}getPadding(){return this.transform.padding}setPadding(t,a){return this.jumpTo({padding:t},a),this}rotateTo(t,a,o){return this.easeTo(h.e({bearing:t},a),o)}resetNorth(t,a){return this.rotateTo(0,h.e({duration:1e3},t),a),this}resetNorthPitch(t,a){return this.easeTo(h.e({bearing:0,pitch:0,roll:0,duration:1e3},t),a),this}snapToNorth(t,a){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,a):this}getPitch(){return this.transform.pitch}setPitch(t,a){return this.jumpTo({pitch:t},a),this}getRoll(){return this.transform.roll}setRoll(t,a){return this.jumpTo({roll:t},a),this}cameraForBounds(t,a){t=Fe.convert(t).adjustAntiMeridian();const o=a?.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),o,a)}_cameraForBoxAndBearing(t,a,o,c){const f={top:0,bottom:0,right:0,left:0};if(typeof(c=h.e({padding:f,offset:[0,0],maxZoom:this.transform.maxZoom},c)).padding=="number"){const P=c.padding;c.padding={top:P,bottom:P,right:P,left:P}}const y=h.e(f,c.padding);c.padding=y;const x=this.transform,w=new Fe(t,a),S=this.cameraHelper.cameraForBoxAndBearing(c,y,w,o,x);return S&&this._zoomSnap&&(S.zoom=h.cw(S.zoom,this._zoomSnap,-1)),S}fitBounds(t,a,o){return this._fitInternal(this.cameraForBounds(t,a),a,o)}fitScreenCoordinates(t,a,o,c,f){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(h.P.convert(t)),this.transform.screenPointToLocation(h.P.convert(a)),o,c),c,f)}_fitInternal(t,a,o){return t?(delete(a=h.e(t,a)).padding,a.linear?this.easeTo(a,o):this.flyTo(a,o)):this}jumpTo(t,a){this.stop(),"zoom"in t&&this._zoomSnap&&(t.zoom=h.cw(t.zoom,this._zoomSnap));const o=this._getTransformForUpdate();let c=!1,f=!1,y=!1;const x=o.zoom;this.terrain&&o.setElevation(this.terrain.getElevationForLngLatZoom(t.center?h.W.convert(t.center):o.center,t.zoom||o.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(o,t);const w=o.zoom!==x;return"elevation"in t&&o.elevation!==+t.elevation&&o.setElevation(+t.elevation),"bearing"in t&&o.bearing!==+t.bearing&&(c=!0,o.setBearing(+t.bearing)),"pitch"in t&&o.pitch!==+t.pitch&&(f=!0,o.setPitch(+t.pitch)),"roll"in t&&o.roll!==+t.roll&&(y=!0,o.setRoll(+t.roll)),t.padding==null||o.isPaddingEqual(t.padding)||o.setPadding(t.padding),this._applyUpdatedTransform(o),this.fire(new h.n("movestart",a)).fire(new h.n("move",a)),w&&this.fire(new h.n("zoomstart",a)).fire(new h.n("zoom",a)).fire(new h.n("zoomend",a)),c&&this.fire(new h.n("rotatestart",a)).fire(new h.n("rotate",a)).fire(new h.n("rotateend",a)),f&&this.fire(new h.n("pitchstart",a)).fire(new h.n("pitch",a)).fire(new h.n("pitchend",a)),y&&this.fire(new h.n("rollstart",a)).fire(new h.n("roll",a)).fire(new h.n("rollend",a)),this.fire(new h.n("moveend",a))}calculateCameraOptionsFromTo(t,a,o,c=0){const f=h.a7.fromLngLat(t,a),y=h.a7.fromLngLat(o,c),x=y.x-f.x,w=y.y-f.y,S=y.z-f.z,P=Math.hypot(x,w,S);if(P===0)throw new Error("Can't calculate camera options with same From and To");const E=Math.hypot(x,w),C=h.ar(this.transform.cameraToCenterDistance/P/this.transform.tileSize),z=180*Math.atan2(x,-w)/Math.PI;let B=180*Math.acos(E/P)/Math.PI;return B=S<0?90-B:90+B,{center:y.toLngLat(),elevation:c,zoom:C,pitch:B,bearing:z}}calculateCameraOptionsFromCameraLngLatAltRotation(t,a,o,c,f){const y=this.transform.calculateCenterFromCameraLngLatAlt(t,a,o,c);return{center:y.center,elevation:y.elevation,zoom:y.zoom,bearing:o,pitch:c,roll:f}}easeTo(t,a){this._stop(!1,t.easeId),"zoom"in(t=h.e({offset:[0,0],duration:500,easing:h.cy},t))&&this._zoomSnap&&(t.zoom=h.cw(t.zoom,this._zoomSnap)),(t.animate===!1||!t.essential&&ft.prefersReducedMotion)&&(t.duration=0);const o=this._getTransformForUpdate(),c=this.getBearing(),f=o.pitch,y=o.roll,x="bearing"in t?this._normalizeBearing(t.bearing,c):c,w="pitch"in t?+t.pitch:f,S="roll"in t?this._normalizeBearing(t.roll,y):y,P="padding"in t?t.padding:o.padding,E=h.P.convert(t.offset);let C,z;t.around&&(C=h.W.convert(t.around),z=o.locationToScreenPoint(C));const B={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},N=this.cameraHelper.handleEaseTo(o,{bearing:x,pitch:w,roll:S,padding:P,around:C,aroundPoint:z,offsetAsPoint:E,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating||(this._rotating=c!==x),this._pitching||(this._pitching=w!==f),this._rolling||(this._rolling=S!==y),this._padding=!o.isPaddingEqual(P),this._zooming||(this._zooming=N.isZooming),this._easeId=t.easeId,this._prepareEase(a,t.noMoveStart,B),this.terrain&&this._prepareElevation(N.elevationCenter),this._ease((Z=>{N.easeFunc(Z),this.terrain&&!t.freezeElevation&&this._updateElevation(Z),this._applyUpdatedTransform(o),this._fireMoveEvents(a)}),(Z=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(a,Z)}),t),this}_prepareEase(t,a,o={}){this._moving=!0,a||o.moving||this.fire(new h.n("movestart",t)),this._zooming&&!o.zooming&&this.fire(new h.n("zoomstart",t)),this._rotating&&!o.rotating&&this.fire(new h.n("rotatestart",t)),this._pitching&&!o.pitching&&this.fire(new h.n("pitchstart",t)),this._rolling&&!o.rolling&&this.fire(new h.n("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this._elevationStart!==void 0&&this._elevationCenter!==void 0||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const a=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&a!==this._elevationTarget){const o=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(o-(a-(o*t+this._elevationStart))/(1-t)),this._elevationTarget=a}this.transform.setElevation(h.H.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};const a=t.getCameraLngLat(),o=t.getCameraAltitude(),c=this.terrain?this.terrain.getElevationForLngLatZoom(a,t.zoom):0;if(o<c){const f=this.calculateCameraOptionsFromTo(a,c,t.center,t.elevation);return{pitch:f.pitch,zoom:f.zoom}}return{}}_applyUpdatedTransform(t){const a=[];if(a.push((c=>this._elevateCameraIfInsideTerrain(c))),this.transformCameraUpdate&&a.push((c=>this.transformCameraUpdate(c))),!a.length)return;const o=t.clone();for(const c of a){const f=o.clone(),{center:y,zoom:x,roll:w,pitch:S,bearing:P,elevation:E}=c(f);y&&f.setCenter(y),E!==void 0&&f.setElevation(E),x!==void 0&&f.setZoom(x),w!==void 0&&f.setRoll(w),S!==void 0&&f.setPitch(S),P!==void 0&&f.setBearing(P),o.apply(f,!1)}this.transform.apply(o,!1)}_fireMoveEvents(t){this.fire(new h.n("move",t)),this._zooming&&this.fire(new h.n("zoom",t)),this._rotating&&this.fire(new h.n("rotate",t)),this._pitching&&this.fire(new h.n("pitch",t)),this._rolling&&this.fire(new h.n("roll",t))}_afterEase(t,a){if(this._easeId&&a&&this._easeId===a)return;delete this._easeId;const o=this._zooming,c=this._rotating,f=this._pitching,y=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,o&&this.fire(new h.n("zoomend",t)),c&&this.fire(new h.n("rotateend",t)),f&&this.fire(new h.n("pitchend",t)),y&&this.fire(new h.n("rollend",t)),this.fire(new h.n("moveend",t))}flyTo(t,a){if(!t.essential&&ft.prefersReducedMotion){const pe=h.V(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(pe,a)}this.stop(),"zoom"in(t=h.e({offset:[0,0],speed:1.2,curve:1.42,easing:h.cy},t))&&this._zoomSnap&&(t.zoom=h.cw(t.zoom,this._zoomSnap));const o=this._getTransformForUpdate(),c=o.bearing,f=o.pitch,y=o.roll,x=o.padding,w="bearing"in t?this._normalizeBearing(t.bearing,c):c,S="pitch"in t?+t.pitch:f,P="roll"in t?this._normalizeBearing(t.roll,y):y,E="padding"in t?t.padding:o.padding,C=h.P.convert(t.offset);let z=o.centerPoint.add(C);const B=o.screenPointToLocation(z),N=this.cameraHelper.handleFlyTo(o,{bearing:w,pitch:S,roll:P,padding:E,locationAtOffset:B,offsetAsPoint:C,center:t.center,minZoom:t.minZoom,zoom:t.zoom});let Z=t.curve;const j=Math.max(o.width,o.height),G=j/N.scaleOfZoom,X=N.pixelPathLength;typeof N.scaleOfMinZoom=="number"&&(Z=Math.sqrt(j/N.scaleOfMinZoom/X*2));const $=Z*Z;function U(pe){const Ae=(G*G-j*j+(pe?-1:1)*$*$*X*X)/(2*(pe?G:j)*$*X);return Math.log(Math.sqrt(Ae*Ae+1)-Ae)}function H(pe){return(Math.exp(pe)-Math.exp(-pe))/2}function q(pe){return(Math.exp(pe)+Math.exp(-pe))/2}const Q=U(!1);let ne=function(pe){return q(Q)/q(Q+Z*pe)},se=function(pe){return j*((q(Q)*(H(Ae=Q+Z*pe)/q(Ae))-H(Q))/$)/X;var Ae},me=(U(!0)-Q)/Z;if(Math.abs(X)<2e-6||!isFinite(me)){if(Math.abs(j-G)<1e-6)return this.easeTo(t,a);const pe=G<j?-1:1;me=Math.abs(Math.log(G/j))/Z,se=()=>0,ne=Ae=>Math.exp(pe*Z*Ae)}return t.duration="duration"in t?+t.duration:1e3*me/("screenSpeed"in t?+t.screenSpeed/Z:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=c!==w,this._pitching=S!==f,this._rolling=P!==y,this._padding=!o.isPaddingEqual(E),this._prepareEase(a,!1),this.terrain&&this._prepareElevation(N.targetCenter),this._ease((pe=>{const Ae=pe*me,Te=1/ne(Ae),ue=se(Ae);this._rotating&&o.setBearing(h.H.number(c,w,pe)),this._pitching&&o.setPitch(h.H.number(f,S,pe)),this._rolling&&o.setRoll(h.H.number(y,P,pe)),this._padding&&(o.interpolatePadding(x,E,pe),z=o.centerPoint.add(C)),N.easeFunc(pe,Te,ue,z),this.terrain&&!t.freezeElevation&&this._updateElevation(pe),this._applyUpdatedTransform(o),this._fireMoveEvents(a)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(a)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,a){var o;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const c=this._onEaseEnd;delete this._onEaseEnd,c.call(this,a)}return t||(o=this.handlers)===null||o===void 0||o.stop(!1),this}_ease(t,a,o){o.animate===!1||o.duration===0?(t(1),a()):(this._easeStart=je(),this._easeOptions=o,this._onEaseFrame=t,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,a){t=h.X(t,-180,180);const o=Math.abs(t-a);return Math.abs(t-360-a)<o&&(t-=360),Math.abs(t+360-a)<o&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(h.W.convert(t),this.transform):null}}const to={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class nr{constructor(t=to){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=a=>{!a||a.sourceDataType!=="metadata"&&a.sourceDataType!=="visibility"&&a.dataType!=="style"&&a.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=de.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=de.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=de.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,a){const o=this._map._getUIString(`AttributionControl.${a}`);t.title=o,t.setAttribute("aria-label",o)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((c=>typeof c!="string"?"":c))):typeof this.options.customAttribution=="str
800ing"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}const a=this._map.style.tileManagers;for(const c in a){const f=a[c];if(f.used||f.usedForTerrain){const y=f.getSource();y.attribution&&!t.includes(y.attribution)&&t.push(y.attribution)}}t=t.filter((c=>String(c).trim())),t.sort(((c,f)=>c.length-f.length)),t=t.filter(((c,f)=>{for(let y=f+1;y<t.length;y++)if(t[y].includes(c))return!1;return!0}));const o=t.join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=de.sanitize(o),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ll{constructor(t={}){this._updateCompact=()=>{const a=this._container.children;if(a.length){const o=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&o.classList.add("maplibregl-compact"):o.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){var a;this._map=t,this._compact=(a=this.options)===null||a===void 0?void 0:a.compact,this._container=de.create("div","maplibregl-ctrl");const o=de.create("a","maplibregl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://maplibre.org/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class gh{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const a=++this._id;return this._queue.push({callback:t,id:a,cancelled:!1}),a}remove(t){const a=this._currentlyRunning,o=a?this._queue.concat(a):this._queue;for(const c of o)if(c.id===t)return void(c.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const a=this._currentlyRunning=this._queue;this._queue=[];for(const o of a)if(!o.cancelled&&(o.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var _h=h.aS([{name:"a_pos3d",type:"Int16",components:3}]);class yh extends h.E{constructor(t){super(),this._lastTilesetChange=je(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(t,a){this.tileManager.update(t,a),this._renderableTilesKeys=[];const o={};for(const c of ma(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:a,calculateTileZoom:this.tileManager._source.calculateTileZoom}))o[c.key]=!0,this._renderableTilesKeys.push(c.key),this._tiles[c.key]||(c.terrainRttPosMatrix32f=new Float64Array(16),h.c7(c.terrainRttPosMatrix32f,0,h.a6,h.a6,0,0,1),this._tiles[c.key]=new Za(c,this.tileSize),this._lastTilesetChange=je());for(const c in this._tiles)o[c]||delete this._tiles[c]}freeRtt(t){for(const a in this._tiles){const o=this._tiles[a];(!t||o.tileID.equals(t)||o.tileID.isChildOf(t)||t.isChildOf(o.tileID))&&(o.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,a){return a?this._getTerrainCoordsForTileRanges(t,a):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){const a={};for(const o of this._renderableTilesKeys){const c=this._tiles[o].tileID,f=t.clone(),y=h.bj();if(c.canonical.equals(t.canonical))h.c7(y,0,h.a6,h.a6,0,0,1);else if(c.canonical.isChildOf(t.canonical)){const x=c.canonical.z-t.canonical.z,w=c.canonical.x-(c.canonical.x>>x<<x),S=c.canonical.y-(c.canonical.y>>x<<x),P=h.a6>>x;h.c7(y,0,P,P,0,0,1),h.Q(y,y,[-w*P,-S*P,0])}else{if(!t.canonical.isChildOf(c.canonical))continue;
800{const x=t.canonical.z-c.canonical.z,w=t.canonical.x-(t.canonical.x>>x<<x),S=t.canonical.y-(t.canonical.y>>x<<x),P=h.a6>>x;h.c7(y,0,h.a6,h.a6,0,0,1),h.Q(y,y,[w*P,S*P,0]),h.S(y,y,[1/2**x,1/2**x,0])}}f.terrainRttPosMatrix32f=new Float32Array(y),a[o]=f}return a}_getTerrainCoordsForTileRanges(t,a){const o={};for(const c of this._renderableTilesKeys){const f=this._tiles[c].tileID;if(!this._isWithinTileRanges(f,a))continue;const y=t.clone(),x=h.bj();if(f.canonical.z===t.canonical.z){const w=t.canonical.x-f.canonical.x+t.wrap*(1<<t.canonical.z),S=t.canonical.y-f.canonical.y;h.c7(x,0,h.a6,h.a6,0,0,1),h.Q(x,x,[w*h.a6,S*h.a6,0])}else if(f.canonical.z>t.canonical.z){const w=f.canonical.z-t.canonical.z,S=f.canonical.x-(f.canonical.x>>w<<w)+t.wrap*(1<<f.canonical.z),P=f.canonical.y-(f.canonical.y>>w<<w),E=t.canonical.x-(f.canonical.x>>w),C=t.canonical.y-(f.canonical.y>>w),z=h.a6>>w;h.c7(x,0,z,z,0,0,1),h.Q(x,x,[-S*z+E*h.a6,-P*z+C*h.a6,0])}else{const w=t.canonical.z-f.canonical.z,S=t.canonical.x-(t.canonical.x>>w<<w)+t.wrap*(1<<t.canonical.z),P=t.canonical.y-(t.canonical.y>>w<<w),E=(t.canonical.x>>w)-f.canonical.x,C=(t.canonical.y>>w)-f.canonical.y,z=h.a6<<w;h.c7(x,0,z,z,0,0,1),h.Q(x,x,[S*h.a6+E*z,P*h.a6+C*z,0])}y.terrainRttPosMatrix32f=new Float32Array(x),o[c]=y}return o}getSourceTile(t,a){var o,c;const f=this.tileManager._source;let y=t.overscaledZ-this.deltaZoom;if(y>f.maxzoom&&(y=f.maxzoom),y<f.minzoom)return;(o=this._sourceTileCache)[c=t.key]||(o[c]=t.scaledTo(y).key);let x=this.findTileInCaches(this._sourceTileCache[t.key]);if(!x?.dem&&a)for(;y>=f.minzoom&&!x?.dem;)x=this.findTileInCaches(t.scaledTo(y--).key);return x}findTileInCaches(t){let a=this.tileManager.getTileByID(t);return a||(a=this.tileManager._outOfViewCache.getByKey(t),a)}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,a){const o=a[t.canonical.z];return!!o&&(t.wrap>o.minWrap||t.wrap<o.maxWrap||t.canonical.x>=o.minTileXWrapped&&t.canonical.x<=o.maxTileXWrapped&&t.canonical.y>=o.minTileY&&t.canonical.y<=o.maxTileY)}}class rs{constructor(t,a,o){this._meshCache={},this.painter=t,this.tileManager=new yh(a),this.options=o,this.exaggeration=typeof o.exaggeration=="number"?o.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}destroy(){this._fbo&&(this._fbo.destroy(),this._fbo=null),this._fboCoordsTexture&&(this._fboCoordsTexture.destroy(),this._fboCoordsTexture=null),this._fboDepthTexture&&(this._fboDepthTexture.destroy(),this._fboDepthTexture=null),this._emptyDemTexture&&(this._emptyDemTexture.destroy(),this._emptyDemTexture=null),this._emptyDepthTexture&&(this._emptyDepthTexture.destroy(),this._emptyDepthTexture=null),this._coordsTexture&&(this._coordsTexture.destroy(),this._coordsTexture=null);for(const t in this._meshCache)this._meshCache[t].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(t,a,o,c=h.a6){var f;const y=t.normalizeCoordinates(a,o,c);if(!y)return 0;const x=this.getTerrainData(y.tileID),w=(f=x.tile)===null||f===void 0?void 0:f.dem;if(!w)return 0;const S=h.cC([],[y.x/c*h.a6,y.y/c*h.a6],x.u_terrain_matrix),P=[S[0]*w.dim,S[1]*w.dim],E=Math.floor(P[0]),C=Math.floor(P[1]),z=P[0]-E,B=P[1]-C;return w.get(E,C)*(1-z)*(1-B)+w.get(E+1,C)*z*(1-B)+w.get(E,C+1)*(1-z)*B+w.get(E+1,C+1)*z*B}getElevationForLngLatZoom(t,a){if(!h.cD(a,t.wrap()))return 0;const{tileID:o,mercatorX:c,mercatorY:f}=this._getOverscaledTileIDFromLngLatZoom(t,a);return this.getElevation(o,c%h.a6,f%h.a6,h.a6)}getElevationForLngLat(t,a){const o=ma(a,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this});let c=0;for(const f of o)f.canonical.z>c&&(c=Math.min(f.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,c)}getElevation(t,a,o,c=h.a6){return this.getDEMElevation(t,a,o,c)*this.exaggeration}getTerrainData(t){var a,o;if(!this._emptyDemTexture){const y=this.painter.context,x=new h.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new h.T(y,x,y.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new h.T(y,new h.R({width:1,height:1}),y.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(y.gl.NEAREST,y.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=h.ap([])}const c=this.tileManager.getSourceTile(t,!0);if(c?.dem&&(!c.demTexture||c.needsTerrainPrepare)){const y=this.painter.context;c.demTexture=this.painter.getTileTexture(c.dem.stride),c.demTexture?c.demTexture.update(c.dem.getPixels(),{premultiply:!1}):c.demTexture=new h.T(y,c.dem.getPixels(),y.gl.RGBA,{premultiply:!1}),c.demTexture.bind(y.gl.NEAREST,y.gl.CLAMP_TO_EDGE),c.needsTerrainPrepare=!1}const f=c&&c.toString()+c.tileID.key+t.key;if(f&&!this._demMatrixCache[f]){const y=this.tileManager.getSource().maxzoom;let x=t.canonical.z-c.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=y?x=t.canonical.z-y:h.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const w=t.canonical.x-(t.canonical.x>>x<<x),S=t.canonical.y-(t.canonical.y>>x<<x),P=h.cE(new Float64Array(16),[1/(h.a6<<x),1/(h.a6<<x),0]);h.Q(P,P,[w*h.a6,S*h.a6,0]),this._demMatrixCache[f]={matrix:P,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:((a=c?.dem)===null||a===void 0?void 0:a.dim)||1,u_terrain_matrix:f?this._demMatrixCache[f].matrix:this._emptyDemMatrix,u_terrain_unpack:((o=c?.dem)===null||o===void 0?void 0:o.getUnpackVector())||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(c?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:c}}getFramebuffer(t){const a=this.painter,o=a.width/devicePixelRatio,c=a.height/devicePixelRatio;return!this._fbo||this._fbo.width===o&&this._fbo.height===c||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new h.T(a.context,{width:o,height:c,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new h.T(a.context,{width:o,height:c,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=a.context.createFramebuffer(o,c,!0,!1),this._fbo.depthAttachment.set(a.context.createRenderbuffer(a.context.gl.DEPTH_COMPONENT16,o,c))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const a=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let f=0,y=0;f<this._coordsTextureSize;f++)for(let x=0;x<this._coordsTextureSize;x++,y+=4)a[y+0]=255&x,a[y+1]=255&f,a[y+2]=x>>8<<4|f>>8,a[y+3]=0;const o=new h.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(a.buffer)),c=new h.T(t,o,t.gl.RGBA,{premultiply:!1});return c.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=c,c}pointCoordinate(t){this.painter.maybeDrawDepth(!0),this.painter.maybeDrawCoords();
vendor: 4,801 bytes, line 800
800const a=new Uint8Array(4),o=this.painter.context,c=o.gl,f=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),y=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),x=Math.round(this.painter.height/devicePixelRatio);o.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),c.readPixels(f,x-y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,a),o.bindFramebuffer.set(null);const w=a[0]+(a[2]>>4<<8),S=a[1]+((15&a[2])<<8),P=this.coordsIndex[255-a[3]],E=P&&this.tileManager.getTileByID(P);if(!E)return null;const C=this._coordsTextureSize,z=(1<<E.tileID.canonical.z)*C;return new h.a7((E.tileID.canonical.x*C+w)/z+E.tileID.wrap,(E.tileID.canonical.y*C+S)/z,this.getElevation(E.tileID,w,S,C))}depthAtPoint(t){const a=new Uint8Array(4),o=this.painter.context,c=o.gl;return o.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),c.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,a),o.bindFramebuffer.set(null),(a[0]/16777216+a[1]/65536+a[2]/256+a[3])/256}getTerrainMesh(t){var a;const o=((a=this.painter.style.projection)===null||a===void 0?void 0:a.transitionState)>0,c=o&&t.canonical.y===0,f=o&&t.canonical.y===(1<<t.canonical.z)-1,y=`m_${c?"n":""}_${f?"s":""}`;if(this._meshCache[y])return this._meshCache[y];const x=this.painter.context,w=new h.cF,S=new h.aW,P=this.meshSize,E=h.a6/P,C=P*P;for(let q=0;q<=P;q++)for(let Q=0;Q<=P;Q++)w.emplaceBack(Q*E,q*E,0);for(let q=0;q<C;q+=P+1)for(let Q=0;Q<P;Q++)S.emplaceBack(Q+q,P+Q+q+1,P+Q+q+2),S.emplaceBack(Q+q,P+Q+q+2,Q+q+1);const z=w.length,B=z+(P+1),N=(P+1)*P,Z=c?h.bq:0,j=c?0:1,G=f?h.br:h.a6,X=f?0:1;for(let q=0;q<=P;q++)w.emplaceBack(q*E,Z,j);for(let q=0;q<=P;q++)w.emplaceBack(q*E,G,X);for(let q=0;q<P;q++)S.emplaceBack(N+q,B+q,B+q+1),S.emplaceBack(N+q,B+q+1,N+q+1),S.emplaceBack(0+q,z+q+1,z+q),S.emplaceBack(0+q,0+q+1,z+q+1);const $=w.length,U=$+2*(P+1);for(const q of[0,1])for(let Q=0;Q<=P;Q++)for(const ne of[0,1])w.emplaceBack(q*h.a6,Q*E,ne);for(let q=0;q<2*P;q+=2)S.emplaceBack($+q,$+q+1,$+q+3),S.emplaceBack($+q,$+q+3,$+q+2),S.emplaceBack(U+q,U+q+3,U+q+1),S.emplaceBack(U+q,U+q+2,U+q+3);const H=new _t(x.createVertexBuffer(w,_h.members),x.createIndexBuffer(S),h.aV.simpleSegment(0,0,w.length,S.length));return this._meshCache[y]=H,H}getMeshFrameDelta(t){return 2*Math.PI*h.bD/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,a){var o;if(!h.cD(a,t.wrap()))return 0;const{tileID:c}=this._getOverscaledTileIDFromLngLatZoom(t,a);return(o=this.getMinMaxElevation(c).minElevation)!==null&&o!==void 0?o:0}getMinMaxElevation(t){const a=this.getTerrainData(t).tile,o={minElevation:null,maxElevation:null};return a?.dem&&(o.minElevation=a.dem.min*this.exaggeration,o.maxElevation=a.dem.max*this.exaggeration),o}_getOverscaledTileIDFromLngLatZoom(t,a){const o=h.a7.fromLngLat(t.wrap()),c=(1<<a)*h.a6,f=o.x*c,y=o.y*c,x=Math.floor(f/h.a6),w=Math.floor(y/h.a6);return{tileID:new h.a3(a,0,a,x,w),mercatorX:f,mercatorY:y}}}class Et{constructor(t,a,o){this._context=t,this._size=a,this._tileSize=o,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const a=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),o=new h.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return o.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),a.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),a.colorAttachment.set(o.texture),{id:t,fbo:a,texture:o,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((a=>t.id!==a)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const a of this._recentlyUsed)if(!this._objects[a].inUse)return this._objects[a];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((t=>!t.inUse))===!1}}const wt={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class pu{constructor(t,a){this.painter=t,this.terrain=a,this.pool=new Et(t.context,30,a.tileManager.tileSize*a.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}
800prepareForRender(t,a){var o,c,f;this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter((y=>!t._layers[y].isHidden(a))),this._coordsAscending={};for(const y in t.tileManagers){this._coordsAscending[y]={};const x=t.tileManagers[y].getVisibleCoordinates(),w=t.tileManagers[y].getSource(),S=w instanceof Xr?w.terrainTileRanges:null;for(const P of x){const E=this.terrain.tileManager.getTerrainCoords(P,S);for(const C in E)(f=this._coordsAscending[y])[C]||(f[C]=[]),this._coordsAscending[y][C].push(E[C])}}this._rttFingerprints={};for(const y of t._order){const x=t._layers[y],w=x.source;if(wt[x.type]&&!this._rttFingerprints[w]){this._rttFingerprints[w]={};const S=(c=(o=t.tileManagers[w])===null||o===void 0?void 0:o.getState().revision)!==null&&c!==void 0?c:0;for(const P in this._coordsAscending[w])this._rttFingerprints[w][P]=`${this._coordsAscending[w][P].map((E=>E.key)).sort().join()}#${S}`}}for(const y of this._renderableTiles)for(const x in this._rttFingerprints){const w=this._rttFingerprints[x][y.tileID.key];w&&w!==y.rttFingerprint[x]&&(y.rtt=[])}}renderLayer(t,a){if(t.isHidden(this.painter.transform.zoom))return!1;const o=Object.assign(Object.assign({},a),{isRenderingToTexture:!0}),c=t.type,f=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(wt[c]&&(this._prevType&&wt[this._prevType]||this._stacks.push([]),this._prevType=c,this._stacks[this._stacks.length-1].push(t.id),!y))return!0;if(wt[this._prevType]||wt[c]&&y){this._prevType=c;const x=this._stacks.length-1,w=this._stacks[x]||[];for(const S of this._renderableTiles){if(this.pool.isFull()&&(Tl(this.painter,this.terrain,this._rttTiles,o),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(S),S.rtt[x]){const E=this.pool.getObjectForId(S.rtt[x].id);if(E.stamp===S.rtt[x].stamp){this.pool.useObject(E);continue}}const P=this.pool.getOrCreateFreeObject();this.pool.useObject(P),this.pool.stampObject(P),S.rtt[x]={id:P.id,stamp:P.stamp},f.context.bindFramebuffer.set(P.fbo.framebuffer),f.context.clear({color:h.bo.transparent,stencil:0}),f.currentStencilSource=void 0;for(const E of w){const C=f.style._layers[E],z=C.source?this._coordsAscending[C.source][S.tileID.key]:[S.tileID];f.context.viewport.set([0,0,P.fbo.width,P.fbo.height]),f._renderTileClippingMasks(C,z,!0),f.renderLayer(f,f.style.tileManagers[C.source],C,z,o),C.source&&(S.rttFingerprint[C.source]=this._rttFingerprints[C.source][S.tileID.key])}}return Tl(this.painter,this.terrain,this._rttTiles,o),this._rttTiles=[],this.pool.freeAllObjects(),wt[c]}return!1}}const as={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},io=ge,ro={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:to,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileC
800acheSize:null,maxTileCacheZoomLevels:h.c.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0,anisotropicFilterPitch:20};let ao=class extends du{get _ownerWindow(){var d,t;return((t=(d=this._container)===null||d===void 0?void 0:d.ownerDocument)===null||t===void 0?void 0:t.defaultView)||window}constructor(d){var t,a,o;const c=Object.assign(Object.assign(Object.assign({},ro),d),{canvasContextAttributes:Object.assign(Object.assign({},ro.canvasContextAttributes),d.canvasContextAttributes)});if(c.minZoom!=null&&c.maxZoom!=null&&c.minZoom>c.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(c.minPitch!=null&&c.maxPitch!=null&&c.minPitch>c.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(c.minPitch!=null&&c.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(c.maxPitch!=null&&c.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const f=new xa,y=new ba;c.minZoom!==void 0&&f.setMinZoom(c.minZoom),c.maxZoom!==void 0&&f.setMaxZoom(c.maxZoom),c.minPitch!==void 0&&f.setMinPitch(c.minPitch),c.maxPitch!==void 0&&f.setMaxPitch(c.maxPitch),c.renderWorldCopies!==void 0&&f.setRenderWorldCopies(c.renderWorldCopies),c.transformConstrain!==null&&f.setConstrainOverride(c.transformConstrain),super(f,y,{bearingSnap:c.bearingSnap,zoomSnap:c.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new gh,this._controls=[],this._mapId=h.ad(),this._lostContextStyle={style:null,images:null},this._contextLost=w=>{if(w.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(const S of Object.values(this.style._layers))if(S.type==="custom"&&console.warn(`Custom layer with id '${S.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),S._listeners)for(const[P]of Object.entries(S._listeners))console.warn(`Custom layer with id '${S.id}' had event listeners for event '${P}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new h.n("webglcontextlost",{originalEvent:w}))}else this.fire(new h.n("webglcontextlost",{originalEvent:w}))},this._contextRestored=w=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new h.n("webglcontextrestored",{originalEvent:w}))},this._onMapScroll=w=>{if(w.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=c.interactive,this._maxTileCacheSize=c.maxTileCacheSize,this._maxTileCacheZoomLevels=c.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},c.canvasContextAttributes),this._trackResize=c.trackResize===!0,this._bearingSnap=c.bearingSnap,this._zoomSnap=c.zoomSnap,this._centerClampedToGround=c.centerClampedToGround,this._refreshExpiredTiles=c.refreshExpiredTiles===!0,this._fadeDuration=c.fadeDuration,this._crossSourceCollisions=c.crossSourceCollisions===!0,this._collectResourceTiming=c.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},as),c.locale),this._clickTolerance=c.clickTolerance,this._overridePixelRatio=c.pixelRatio,this._maxCanvasSize=c.maxCanvasSize,this._zoomLevelsToOverscale=c.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=c.transformCameraUpdate,this.transformConstrain=c.transformConstrain,this.cancelPendingTileRequestsWhileZooming=c.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(c.anisotropicFilterPitch),c.reduceMotion!==void 0&&(ft.prefersReducedMotion=c.reduceMotion),this._imageQueueHandle=Ut.addThrottleControl((()=>this.isMoving())),this._requestManager=new zt(c.transformRequest),this._container=this._resolveContainer(c.container),c.maxBounds&&this.setMaxBounds(c.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this.on("terrain",(()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)})),this.once("idle",(()=>this._idleTriggered=!0)),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new Di(this,c),this._hash=c.hash?new Yn(typeof c.hash=="string"&&c.hash||void 0).addTo(this):void 0,!((t=this._hash)===null||t===void 0)&&t._onHashChange()||(this.jumpTo({center:c.center,elevation:c.elevation,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,roll:c.roll}),c.bounds&&(this.resize(),this.fitBounds(c.bounds,h.e({},c.fitBoundsOptions,{duration:0}))));const x=typeof c.style=="string"||((o=(a=c.style)===null||a===void 0?void 0:a.projection)===null||o===void 0?void 0:o.type)!=="globe";this.resize(null,x),this._localIdeographFontFamily=c.localIdeographFontFamily,this._val
800idateStyle=c.validateStyle,c.style&&this.setStyle(c.style,{localIdeographFontFamily:c.localIdeographFontFamily}),c.attributionControl&&this.addControl(new nr(typeof c.attributionControl=="boolean"?void 0:c.attributionControl)),c.maplibreLogo&&this.addControl(new Ll,c.logoPosition),this.on("style.load",(()=>{if(x||this._resizeTransform(),this.transform.unmodified){const w=h.V(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(w)}})),this.on("data",(w=>{this._update(w.dataType==="style"),this.fire(new h.n(`${w.dataType}data`,w))})),this.on("dataloading",(w=>{this.fire(new h.n(`${w.dataType}dataloading`,w))})),this.on("dataabort",(w=>{this.fire(new h.n("sourcedataabort",w))}))}_getMapId(){return this._mapId}setGlobalStateProperty(d,t){return this.style.setGlobalStateProperty(d,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(d,t){if(t===void 0&&(t=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d?.onAdd)return this.fire(new h.l(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const a=d.onAdd(this);this._controls.push(d);const o=this._controlPositions[t];return t.includes("bottom")?o.insertBefore(a,o.firstChild):o.appendChild(a),this}removeControl(d){if(!d?.onRemove)return this.fire(new h.l(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(d);return t>-1&&this._controls.splice(t,1),d.onRemove(this),this}hasControl(d){return this._controls.includes(d)}coveringTiles(d){return ma(this.transform,d)}calculateCameraOptionsFromTo(d,t,a,o){return o==null&&this.terrain&&(o=this.terrain.getElevationForLngLat(a,this.transform)),super.calculateCameraOptionsFromTo(d,t,a,o)}resize(d,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);const a=!this._moving;return a&&(this.stop(),this.fire(new h.n("movestart",d)).fire(new h.n("move",d))),this.fire(new h.n("resize",d)),a&&this.fire(new h.n("moveend",d)),this}_resizeInternal(d=!0){const[t,a]=this._containerDimensions(),o=this._getClampedPixelRatio(t,a);if(this._resizeCanvas(t,a,o),this.painter.resize(t,a,o),this.painter.overLimit()){const c=this.painter.context.gl;this._maxCanvasSize=[c.drawingBufferWidth,c.drawingBufferHeight];const f=this._getClampedPixelRatio(t,a);this._resizeCanvas(t,a,f),this.painter.resize(t,a,f)}this._resizeTransform(d)}_resizeTransform(d=!0){var t;const[a,o]=this._containerDimensions();this.transform.resize(a,o,d),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,o,d)}_getClampedPixelRatio(d,t){const{0:a,1:o}=this._maxCanvasSize,c=this.getPixelRatio(),f=d*c,y=t*c;return Math.min(f>a?a/f:1,y>o?o/y:1)*c}getPixelRatio(){var d;return(d=this._overridePixelRatio)!==null&&d!==void 0?d:devicePixelRatio}setPixelRatio(d){this._overridePixelRatio=d,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(d){return this.transform.setMaxBounds(Fe.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom){const t=this.transform.zoom,a=this._getTransformForUpdate();return a.setMinZoom(d),this._applyUpdatedTransform(a),this._update(),t!==this.transform.zoom&&this.fire(new h.n("zoomstart")).fire(new h.n("zoom")).fire(new h.n("zoomend")).fire(new h.n("movestart")).fire(new h.n("move")).fire(new h.n("moveend")),this}throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(d){if((d=d??22)>=this.transform.minZoom){const t=this.transform.zoom,a=this._getTransformForUpdate();return a.setMaxZoom(d),this._applyUpdatedTransform(a),this._update(),t!==this.transform.zoom&&this.fire(new h.n("zoomstart")).fire(new h.n("zoom")).fire(new h.n("zoomend")).fire(new h.n("movestart")).fire(new h.n("move")).fire(new h.n("moveend")),this}throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch){const t=this.transform.pitch,a=this._getTransformForUpdate();return a.setMinPitch(d),this._applyUpdatedTransform(a),this._update(),t!==this.transform.pitch&&this.fire(new h.n("pitchstart")).fire(new h.n("pitch")).fire(new h.n("pitchend")).fire(new h.n("movestart")).fire(new h.n("move")).fire(new h.n("moveend")),this}throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(d){if((d=d??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(d>=this.transform.minPitch){const t=this.transform.pitch,a=this._getTransformForUpdate();return a.setMaxPitch(d),this._applyUpdatedTransform(a),this._update(),t!==this.transform.pitch&&this.fire(new h.n("pitchstart")).fire(new h.n("pitch")).fire(new h.n("pitchend")).fire(new h.n("movestart")).fire(new h.n("move")).fire(new h.n("moveend")),this}throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(d){if((d=d??20)>180)throw new Error("anisotropicFilterPitch must be less than or equal to 180");if(d<0)throw new Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=d,this._update()}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.setRenderWorldCopies(d),this._update()}setTransformConstrain(d){return this.transform.setConstrainOverride(d
800),this._update()}project(d){return this.transform.locationToScreenPoint(h.W.convert(d),this.style&&this.terrain)}unproject(d){return this.transform.screenPointToLocation(h.P.convert(d),this.terrain)}isMoving(){var d;return this._moving||((d=this.handlers)===null||d===void 0?void 0:d.isMoving())}isZooming(){var d;return this._zooming||((d=this.handlers)===null||d===void 0?void 0:d.isZooming())}isRotating(){var d;return this._rotating||((d=this.handlers)===null||d===void 0?void 0:d.isRotating())}_createDelegatedListener(d,t,a){if(d==="mouseenter"||d==="mouseover"){let o=!1;return{layers:t,listener:a,delegates:{mousemove:f=>{const y=t.filter((w=>this.getLayer(w))),x=y.length!==0?this.queryRenderedFeatures(f.point,{layers:y}):[];x.length?o||(o=!0,a.call(this,new Xi(d,this,f.originalEvent,{features:x}))):o=!1},mouseout:()=>{o=!1}}}}if(d==="mouseleave"||d==="mouseout"){let o=!1;return{layers:t,listener:a,delegates:{mousemove:y=>{const x=t.filter((w=>this.getLayer(w)));(x.length!==0?this.queryRenderedFeatures(y.point,{layers:x}):[]).length?o=!0:o&&(o=!1,a.call(this,new Xi(d,this,y.originalEvent)))},mouseout:y=>{o&&(o=!1,a.call(this,new Xi(d,this,y.originalEvent)))}}}}{const o=c=>{const f=t.filter((x=>this.getLayer(x))),y=f.length!==0?this.queryRenderedFeatures(c.point,{layers:f}):[];y.length&&(c.features=y,a.call(this,c),delete c.features)};return{layers:t,listener:a,delegates:{[d]:o}}}}_saveDelegatedListener(d,t){var a;this._delegatedListeners||(this._delegatedListeners={}),(a=this._delegatedListeners)[d]||(a[d]=[]),this._delegatedListeners[d].push(t)}_removeDelegatedListener(d,t,a){var o;if(!(!((o=this._delegatedListeners)===null||o===void 0)&&o[d]))return;const c=this._delegatedListeners[d];for(let f=0;f<c.length;f++){const y=c[f];if(y.listener===a&&y.layers.length===t.length&&y.layers.every((x=>t.includes(x)))){for(const x in y.delegates)this.off(x,y.delegates[x]);return void c.splice(f,1)}}}on(d,t,a){if(a===void 0)return super.on(d,t);const o=typeof t=="string"?[t]:t,c=this._createDelegatedListener(d,o,a);this._saveDelegatedListener(d,c);for(const f in c.delegates)this.on(f,c.delegates[f]);return{unsubscribe:()=>{this._removeDelegatedListener(d,o,a)}}}once(d,t,a){if(a===void 0)return super.once(d,t);const o=typeof t=="string"?[t]:t,c=this._createDelegatedListener(d,o,a);for(const f in c.delegates){const y=c.delegates[f];c.delegates[f]=(...x)=>{this._removeDelegatedListener(d,o,a),y(...x)}}this._saveDelegatedListener(d,c);for(const f in c.delegates)this.once(f,c.delegates[f]);return this}off(d,t,a){return a===void 0?super.off(d,t):(this._removeDelegatedListener(d,typeof t=="string"?[t]:t,a),this)}queryRenderedFeatures(d,t){if(!this.style)return[];let a;const o=d instanceof h.P||Array.isArray(d),c=o?d:[[0,0],[this.transform.width,this.transform.height]];if(t||(t=(o?{}:d)||{}),c instanceof h.P||typeof c[0]=="number")a=[h.P.convert(c)];else{const f=h.P.convert(c[0]),y=h.P.convert(c[1]);a=[f,new h.P(y.x,f.y),y,new h.P(f.x,y.y),f]}return this.style.queryRenderedFeatures(a,t,this.transform)}querySourceFeatures(d,t){return this.style.querySourceFeatures(d,t)}setStyle(d,t){return(t=h.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._val
800idateStyle},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&d?(this._diffStyle(d,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(d,t))}setTransformRequest(d){return this._requestManager.setTransformRequest(d),this}_getUIString(d){const t=this._locale[d];if(t==null)throw new Error(`Missing UI string '${d}'`);return t}_updateStyle(d,t){var a,o,c;if((a=this._diffStyleRequest)===null||a===void 0||a.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(d,t)));const f=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!d)),d?(this.style=new Pa(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof d=="string"?this.style.loadURL(d,t,f):this.style.loadJSON(d,t,f),this):(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),(c=(o=this.style)===null||o===void 0?void 0:o.projection)===null||c===void 0||c.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Pa(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(d,t){return h._(this,void 0,void 0,(function*(){var a;if((a=this._diffStyleRequest)===null||a===void 0||a.abort(),typeof d=="string"){const o=d;this._diffStyleRequest=new AbortController;const c=this._diffStyleRequest;try{const f=yield this._requestManager.transformRequest(o,"Style");if(c.signal.aborted)return void(this._diffStyleRequest=null);const y=yield h.k(f,c);this._diffStyleRequest=null,this._updateDiff(y.data,t)}catch(f){this._diffStyleRequest=null,h.$(f)||this.fire(new h.l(h.d(f)))}}else typeof d=="object"&&(this._diffStyleRequest=null,this._updateDiff(d,t))}))}_updateDiff(d,t){try{this.style.setState(d,t)&&this._update(!0)}catch(a){h.w(`Unable to perform style diff: ${h.d(a).message}.  Rebuilding the style from scratch.`),this._updateStyle(d,t)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(this.style)return this.style.loaded();h.w("There is no style added to the map.")}addSource(d,t){return this._lazyInitEmptyStyle(),this.style.addSource(d,t),this._update(!0)}isSourceLoaded(d){var t;const a=(t=this.style)===null||t===void 0?void 0:t.tileManagers[d];if(a!==void 0)return a.loaded();this.fire(new h.l(new Error(`There is no tile manager with ID '${d}'`)))}setTerrain(d){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),d){const t=this.style.tileManagers[d.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${d.source}`);this.terrain===null&&t.reload();for(const a in this.style._layers){const o=this.style._layers[a];o.type==="hillshade"&&o.source===d.source&&h.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),o.type==="color-relief"&&o.source===d.source&&h.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new rs(this.painter,t,d),this.painter.renderToTexture=new pu(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=a=>{var o;a.dataType==="style"?this.terrain.tileManager.freeRtt():a.dataType==="source"&&a.tile&&(a.sourceId!==d.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((o=a.source)===null||o===void 0?void 0:o.type)==="image"?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(a.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGroun
vendor: 5,563 bytes, line 800
800d&&this.transform.setElevation(0);return this.fire(new h.n("terrain",{terrain:d})),this}getTerrain(){var d,t;return(t=(d=this.terrain)===null||d===void 0?void 0:d.options)!==null&&t!==void 0?t:null}areTilesLoaded(){var d;const t=(d=this.style)===null||d===void 0?void 0:d.tileManagers;for(const a of Object.values(t))if(!a.areTilesLoaded())return!1;return!0}removeSource(d){return this.style.removeSource(d),this._update(!0)}getSource(d){return this.style.getSource(d)}setSourceTileLodParams(d,t,a){if(a){const o=this.getSource(a);if(!o)throw new Error(`There is no source with ID "${a}", cannot set LOD parameters`);o.calculateTileZoom=Go(Math.max(1,d),Math.max(1,t))}else for(const o in this.style.tileManagers)this.style.tileManagers[o].getSource().calculateTileZoom=Go(Math.max(1,d),Math.max(1,t));return this._update(!0),this}refreshTiles(d,t){const a=this.style.tileManagers[d];if(!a)throw new Error(`There is no tile manager with ID "${d}", cannot refresh tile`);t===void 0?a.reload(!0):a.refreshTiles(t.map((o=>new h.aa(o.z,o.x,o.y))))}addImage(d,t,a={}){const{pixelRatio:o=1,sdf:c=!1,stretchX:f,stretchY:y,content:x,textFitWidth:w,textFitHeight:S}=a;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||h.b(t))){if(t.width===void 0||t.height===void 0)return this.fire(new h.l(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:P,height:E,data:C}=t,z=t;return this.style.addImage(d,{data:new h.R({width:P,height:E},new Uint8Array(C)),pixelRatio:o,stretchX:f,stretchY:y,content:x,textFitWidth:w,textFitHeight:S,sdf:c,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d),this}}{const{width:P,height:E,data:C}=ft.getImageData(t);this.style.addImage(d,{data:new h.R({width:P,height:E},C),pixelRatio:o,stretchX:f,stretchY:y,content:x,textFitWidth:w,textFitHeight:S,sdf:c,version:0})}}updateImage(d,t){const a=this.style.getImage(d);if(!a)return this.fire(new h.l(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const o=t instanceof HTMLImageElement||h.b(t)?ft.getImageData(t):t,{width:c,height:f,data:y}=o;if(c===void 0||f===void 0)return this.fire(new h.l(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(c!==a.data.width||f!==a.data.height)return this.fire(new h.l(new Error("The width and height of the updated image must be that same as the previous version of the image")));const x=!(t instanceof HTMLImageElement||h.b(t));return a.data.replace(y,x),this.style.updateImage(d,a),this}getImage(d){return this.style.getImage(d)}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new h.l(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d){return h._(this,void 0,void 0,(function*(){return Ut.getImage(yield this._requestManager.transformRequest(d,"Image"),new AbortController)}))}listImages(){return this.style.listImages()}addLayer(d,t){return this._lazyInitEmptyStyle(),this.style.addLayer(d,t),this._update(!0)}moveLayer(d,t){return this.style.moveLayer(d,t),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(d,t,a){return this.style.setLayerZoomRange(d,t,a),this._update(!0)}setFilter(d,t,a={}){return this.style.setFilter(d,t,a),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,t,a,o={}){return this.style.setPaintProperty(d,t,a,o),this._update(!0)}getPaintProperty(d,t){return this.style.getPaintProperty(d,t)}setLayoutProperty(d,t,a,o={}){return this.style.setLayoutProperty(d,t,a,o),this._update(!0)}getLayoutProperty(d,t){return this.style.getLayoutProperty(d,t)}setGlyphs(d,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(d,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(d,t,a={}){return this._lazyInitEmptyStyle(),this.style.addSprite(d,t,a,(o=>{o||this._update(!0)})),this}removeSprite(d){return this._lazyInitEmptyStyle(),this.style.removeSprite(d),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(d,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(d,t,(a=>{a||this._update(!0)})),this}setLight(d,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(d,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(d,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(d,t){return this.style.setFeatureState(d,t),this._update()}removeFeatureState(d,t){return this.style.removeFeatureState(d,t),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let d=0,t=0;return this._container&&(d=this._container.clientWidth||400,t=this._container.clientHeight||300),[d,t]}_setupResizeObserver(){var d;let t=!1;const a=Pl((c=>{this._trackResize&&!this._removed&&(this.resize(c),this.redraw())}),50),o=(d=this._ownerWindow.ResizeObserver)!==null&&d!==void 0?d:ResizeObserver;this._resizeObserver=new o((c=>{t?a(c):t=!0})),this._resizeObserver.observe(this._container)}
800_resolveContainer(d){if(typeof d=="string"){const t=document.getElementById(d);if(!t)throw new Error(`Container '${d}' not found.`);return t}if(d instanceof HTMLElement||d&&typeof d=="object"&&d.nodeType===1)return d;throw new Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){const d=this._container;d.classList.add("maplibregl-map");const t=this._canvasContainer=de.create("div","maplibregl-canvas-container",d);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=de.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const a=this._containerDimensions(),o=this._getClampedPixelRatio(a[0],a[1]);this._resizeCanvas(a[0],a[1],o);const c=this._controlContainer=de.create("div","maplibregl-control-container",d),f=this._controlPositions={};for(const y of["top-left","top-right","bottom-left","bottom-right"])f[y]=de.create("div",`maplibregl-ctrl-${y} `,c);this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,t,a){this._canvas.width=Math.floor(a*d),this._canvas.height=Math.floor(a*t),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const d=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let t=null;this._canvas.addEventListener("webglcontextcreationerror",(o=>{t={requestedAttributes:d},o&&(t.statusMessage=o.statusMessage,t.type=o.type)}),{once:!0});let a=null;if(a=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,d):this._canvas.getContext("webgl2",d)||this._canvas.getContext("webgl",d),!a){const o="Failed to initialize WebGL";throw t?(t.message=o,new Error(JSON.stringify(t))):new Error(o)}this.painter=new Xn(a,this.transform)}migrateProjection(d,t){super.migrateProjection(d,t),this.painter.transform=d,this.fire(new h.n("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){var t;return!((t=this.style)===null||t===void 0)&&t._loaded?(this._styleDirty||(this._styleDirty=d),this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_render(d){var t,a,o,c,f,y;const x=this._idleTriggered?this._fadeDuration:0,w=((t=this.style.projection)===null||t===void 0?void 0:t.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(d),this._removed)return;let S=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const C=this.transform.zoom,z=je();this.style.zoomHistory.update(C,z);const B=new h.J(C,{now:z,fadeDuration:x,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),N=B.crossFadingFactor();N===1&&N===this._crossFadingFactor||(S=!0,this._crossFadingFactor=N),this.style.update(B)}const P=((a=this.style.projection)===null||a===void 0?void 0:a.transitionState)>0!==w;(o=this.style.projection)===null||o===void 0||o.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((c=this.style.projection)===null||c===void 0?void 0:c.transitionState,(f=this.style.projection)===null||f===void 0?void 0:f.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||P)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGroun
vendor: 15,723 bytes, line 800
800d&&this.transform.setElevation(0)),this._placementDirty=(y=this.style)===null||y===void 0?void 0:y._updatePlacement(this.transform,this.showCollisionBoxes,x,this._crossSourceCollisions,P),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:x,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new h.n("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new h.n("load"))),this.style&&(this.style.hasTransitions()||S)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const E=this._sourcesDirty||this._styleDirty||this._placementDirty;return E||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new h.n("idle")),!this._loaded||this._fullyLoaded||E||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var d,t;this._hash&&this._hash.remove();for(const o of this._controls)o.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),(d=this._diffStyleRequest)===null||d===void 0||d.abort(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),Ut.removeThrottleControl(this._imageQueueHandle),(t=this._resizeObserver)===null||t===void 0||t.disconnect();const a=this.painter.context.gl.getExtension("WEBGL_lose_context");a?.loseContext&&a.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),this._removed=!0,this.fire(new h.n("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,ft.frame(this._frameRequest,(d=>{this._frameRequest=null;try{this._render(d)}catch(t){if(!h.$(t)&&!(function(a){return a.message===Ws})(t))throw t}}),(()=>{}),this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get version(){return io}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(d){return this._lazyInitEmptyStyle(),this.style.setProjection(d),this._update(!0)}};const Fl={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class ns{constructor(t,a,o=!1){this.mousedown=f=>{this.startMove(f,de.mousePos(this.element,f)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=f=>{this.move(f,de.mousePos(this.element,f))},this.mouseup=f=>{this._rotatePitchHandler.dragEnd(f),this.offTemp()},this.touchstart=f=>{f.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=de.touchPos(this.element,f.targetTouches)[0],this.startMove(f,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend))},this.touchmove=f=>{f.targetTouches.length!==1?this.reset():(this._lastPos=de.touchPos(this.element,f.targetTouches)[0],this.move(f,this._lastPos))},this.touchend=f=>{f.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=a;const c=new Il;this._rotatePitchHandler=new Or({clickTolerance:3,move:(f,y)=>{const x=a.getBoundingClientRect(),w=new h.P((x.bottom-x.top)/2,(x.right-x.left)/2);return{bearingDelta:h.cx(new h.P(f.x,y.y),y,w),pitchDelta:o?-.5*(y.y-f.y):void 0}},moveStateManager:c,enable:!0,assignEvents:()=>{}}),this.map=t,a.addEventListener("mousedown",this.mousedown),a.addEventListener("touchstart",this.touchstart,{passive:!1}),a.addEventListener("touchcancel",this.reset)}startMove(t,a){this._rotatePitchHandler.dragStart(t,a),de.disableDrag()}move(t,a){const o=this.map,{bearingDelta:c,pitchDelta:f}=this._rotatePitchHandler.dragMove(t,a)||{};c&&o.setBearing(o.getBearing()+c),f&&o.setPitch(o.getPitch()+f)}off(){const t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){de.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}}let Vr;function no(d,t,a,o=!1){if(o||!a.getCoveringTilesDetailsProvider().allowWorldCopies())return d?.wrap();const c=new h.W(d.lng,d.lat);if(d=new h.W(d.lng,d.lat),t){const f=new h.W(d.lng-360,d.lat),y=new h.W(d.lng+360,d.lat),x=a.locationToScreenPoint(d).distSqr(t);a.locationToScreenPoint(f).distSqr(t)<x?d=f:a.locationToScreenPoint(y).distSqr(t)<x&&(d=y)}for(;Math.abs(d.lng-a.center.lng)>180;){const f=a.locationToScreenPoint(d);if(f.x>=0&&f.y>=0&&f.x<=a.width&&f.y<=a.height)break;d.lng>a.center.lng?d.lng-=360:d.lng+=360}return d.lng!==c.lng&&a.isPointOnMapSurface(a.locationToScreenPoint(d))?d:c}const ss={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function so(d,t,a){const o=d.classList;for(const c in ss)o.remove(`maplibregl-${a}-anchor-${c}`);o.add(`maplibregl-${a}-anchor-${t}`)}class os extends h.E{constructor(t){if(super(),this._onClick=a=>{this.fire(new h.n("click",{originalEvent:a}))},this._onKeyPress=a=>{a.code!=="Space"&&a.code!=="Enter"||this.togglePopup()},this._onMapClick=a=>{const o=a.originalEvent.target,c=this._element;this._popup&&(o===c||c.contains(o))&&this.togglePopup()},this._update=a=>{if(!this._map)return;const o=this._map.loaded()&&!this._map.isMoving();(a?.type==="terrain"||a?.type==="render"&&!o)&&this._map.once("render",this._update),this._lngLat=no(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let c="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?c=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(c=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let f="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?f="rotateX(0deg)":this._pitchAlignment==="map"&&(f=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||a&&a.type!=="moveend"||(this._pos=this._pos.round()),this._element.style.transform=`${ss[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${f} ${c}`,ft.frameAsync(new AbortController,this._map._ownerWindow).then((()=>{this._updateOpacity(a?.type==="moveend")})).catch((()=>{}))},this._onMove=a=>{if(!this._isDragging){const o=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=o}this._isDragging&&(this._pos=a.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new h.n("dragstart"))),this.fire(new h.n("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new h.n("dragend")),this._state="inactive"},this._addDragHandler=a=>{this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t?.anchor||"center",this._color=t?.color||"#3FB1CE",this._scale=t?.scale||1,this._draggable=t?.draggable||!1,this._clickTolerance=t?.clickTolerance||0,this._subpixelPositioning=t?.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t?.rotation||0,this._rotationAlignment=t?.rotationAlignment||"auto",this._pitchAlignment=t?.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t?.element)this._element=t.element,this._offset=h.P.convert(t?.offset||[0,0]);else{this._defaultMarker=!0,this._element=de.create("div");const a=de.createNS("http://www.w3.org/2000/svg","svg"),o=41,c=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${o}px`),a.setAttributeNS(null,"width",`${c}px`),a.setAttributeNS(null,"viewBox",`0 0 ${c} ${o}`);const f=de.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");const y=de.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const x=de.createNS("http://www.w3.org/2000/svg","g");x.setAttributeNS(null,"transform","translate(3.0, 29.0)"),x.setAttributeNS(null,"fill","#000000");const w=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const j of w){const G=de.createNS("http://www.w3.org/2000/svg","ellipse");G.setAttributeNS(null,"opacity","0.04"),G.setAttributeNS(null,"cx","10.5"),G.setAttributeNS(null,"cy","5.80029008"),G.setAttributeNS(null,"rx",j.rx),G.setAttributeNS(null,"ry",j.ry),x.appendChild(G)}const S=de.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"fill",this._color);const P=de.createNS("http://www.w3.org/2000/svg","path");P.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),S.appendChild(P);const E=de.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"opacity","0.25"),E.setAttributeNS(null,"fill","#000000");const C=de.createNS("http://www.w3.org/2000/svg","path");C.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),E.appendChild(C);const z=de.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"transform","translate(6.0, 7.0)"),z.setAttributeNS(null,"fill","#FFFFFF");const B=de.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(8.0, 8.0)");const N=de.createNS("http://www.w3.org/2000/svg","circle");N.setAttributeNS(null,"fill","#000000"),N.setAttributeNS(null,"opacity","0.25"),N.setAttributeNS(null,"cx","5.5"),N.setAttributeNS(null,"cy","5.5"),N.setAttributeNS(null,"r","5.4999962");const Z=de.createNS("http://www.w3.org/2000/svg","circle");Z.setAttributeNS(null,"fill","#FFFFFF"),Z.setAttributeNS(null,"cx","5.5"),Z.setAttributeNS(null,"cy","5.5"),Z.setAttributeNS(null,"r","5.4999962"),B.appendChild(N),B.appendChild(Z),y.appendChild(x),y.appendChild(S),y.appendChild(E),y.appendChild(z),y.appendChild(B),a.appendChild(y),a.setAttributeNS(null,"height",o*this._scale+"px"),a.setAttributeNS(null,"width",c*this._scale+"px"),this._element.appendChild(a),this._offset=h.P.convert(t?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(a=>{a.preventDefault()})),this._element.addEventListener("mousedown",(a=>{a.preventDefault()})),so(this._element,this._anchor,"marker"),t?.className)for(const a of t.className.split(" "))this._element.classList.add(a);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),this._element.removeEventListener("click",this._onClick),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=h.W.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const c=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
8000,-38.1],"bottom-left":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var a,o;const c=(a=this._map)===null||a===void 0?void 0:a.terrain,f=this._map.transform.isLocationOccluded(this._lngLat);if(!c||f){const z=f?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==z&&(this._element.style.opacity=z,this._element.classList.toggle("maplibregl-marker-covered",f)))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const y=this._map,x=y.terrain.depthAtPoint(this._pos),w=y.terrain.getElevationForLngLat(this._lngLat,y.transform);if(y.transform.lngLatToCameraDepth(this._lngLat,w)-x<.006)return this._element.style.opacity=this._opacity,void this._element.classList.remove("maplibregl-marker-covered");const S=-this._offset.y/y.transform.pixelsPerMeter,P=Math.sin(y.getPitch()*Math.PI/180)*S,E=y.terrain.depthAtPoint(new h.P(this._pos.x,this._pos.y-this._offset.y)),C=y.transform.lngLatToCameraDepth(this._lngLat,w+P)-E>.006;!((o=this._popup)===null||o===void 0)&&o.isOpen()&&C&&this._popup.remove(),this._element.style.opacity=C?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",C)}getOffset(){return this._offset}setOffset(t){return this._offset=h.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,a){return(this._opacity===void 0||t===void 0&&a===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=String(t)),a!==void 0&&(this._opacityWhenCovered=String(a)),this._map&&this._updateOpacity(!0),this}}const Bl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let gn=0,ka=!1;const Ol={maxWidth:100,unit:"metric"};function ls(d,t,a){const o=a?.maxWidth||100,c=d._container.clientHeight/2,f=d._container.clientWidth/2,y=d.unproject([f-o/2,c]),x=d.unproject([f+o/2,c]),w=Math.round(d.project(x).x-d.project(y).x),S=Math.min(o,w,d._container.clientWidth),P=y.distanceTo(x);if(a?.unit==="imperial"){const E=3.2808*P;E>5280?La(t,S,E/5280,d._getUIString("ScaleControl.Miles")):La(t,S,E,d._getUIString("ScaleControl.Feet"))}else a?.unit==="nautical"?La(t,S,P/1852,d._getUIString("ScaleControl.NauticalMiles")):P>=1e3?La(t,S,P/1e3,d._getUIString("ScaleControl.Kilometers")):La(t,S,P,d._getUIString("ScaleControl.Meters"))}function La(d,t,a,o){const c=(function(f){const y=Math.pow(10,`${Math.floor(f)}`.length-1);let x=f/y;return x=x>=10?10:x>=5?5:x>=3?3:x>=2?2:x>=1?1:(function(w){const S=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*S)/S})(x),y*x})(a);d.style.width=t*(c/a)+"px",d.innerHTML=`${c}&nbsp;${o}`}const Nl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0}
vendor: 4,959 bytes, line 800
800,oo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function lo(d){if(d){if(typeof d=="number"){const t=Math.round(Math.abs(d)/Math.SQRT2);return{center:new h.P(0,0),top:new h.P(0,d),"top-left":new h.P(t,t),"top-right":new h.P(-t,t),bottom:new h.P(0,-d),"bottom-left":new h.P(t,-t),"bottom-right":new h.P(-t,-t),left:new h.P(d,0),right:new h.P(-d,0)}}if(d instanceof h.P||Array.isArray(d)){const t=h.P.convert(d);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:h.P.convert(d.center||[0,0]),top:h.P.convert(d.top||[0,0]),"top-left":h.P.convert(d["top-left"]||[0,0]),"top-right":h.P.convert(d["top-right"]||[0,0]),bottom:h.P.convert(d.bottom||[0,0]),"bottom-left":h.P.convert(d["bottom-left"]||[0,0]),"bottom-right":h.P.convert(d["bottom-right"]||[0,0]),left:h.P.convert(d.left||[0,0]),right:h.P.convert(d.right||[0,0])}}return lo(new h.P(0,0))}const Vl=ge;k.AJAXError=h.cG,k.EXTENT=h.a6,k.Event=h.n,k.Evented=h.E,k.LngLat=h.W,k.MercatorCoordinate=h.a7,k.Point=h.P,k.addProtocol=h.cH,k.config=h.c,k.removeProtocol=h.cI,k.AttributionControl=nr,k.BoxZoomHandler=Ir,k.CanvasSource=Vo,k.CooperativeGesturesHandler=ke,k.DoubleClickZoomHandler=kl,k.DragPanHandler=vr,k.DragRotateHandler=is,k.EdgeInsets=Ka,k.FullscreenControl=class extends h.E{constructor(d={}){var t;super(),this._onFullscreenChange=()=>{var a;let o=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;!((a=o?.shadowRoot)===null||a===void 0)&&a.fullscreenElement;)o=o.shadowRoot.fullscreenElement;o===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=(t=d.pseudo)!==null&&t!==void 0&&t,d?.container&&(d.container instanceof HTMLElement?this._container=d.container:h.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const d=this._fullscreenButton=de.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);de.create("span","maplibregl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.title=d}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new h.n("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new h.n("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},k.GeoJSONSource=_s,k.GeolocateControl=class extends h.E{constructor(d){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new h.n("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
800RROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new h.n("geolocate",t)),this._finish()}},this._updateCamera=t=>{const a=new h.W(t.coords.longitude,t.coords.latitude),o=t.coords.accuracy,c=this._map.getBearing(),f=h.e({bearing:c},this.options.fitBoundsOptions),y=Fe.fromLngLat(a,o);this._map.fitBounds(y,f,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const a=new h.W(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&ka)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new h.n("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;const a=t?.[0]instanceof ResizeObserverEntry;t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||a||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new h.n("trackuserlocationend")),this.fire(new h.n("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>{t.preventDefault()})),this._geolocateButton=de.create("button","maplibregl-ctrl-geolocate",this._container),de.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(t===!1){h.w("Geolocation support is not available so the GeolocateControl will be disabled.");const a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{const a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=de.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new os({element:this._dotElement}),this._circleElement=de.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new os({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=h.e({},Bl,d)}onAdd(d){return this._map=d,this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return h._(this,arguments,void 0,(function*(t=!1){if(Vr!==void 0&&!t)return Vr;if(window.navigator.permissions===void 0)return Vr=!!window.navigator.geolocation,Vr;try{Vr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Vr=!!window.navigator.geolocation}return Vr}))})().then((t=>this._finishSetupUI(t))),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,gn=0,ka=!1}_isOutOfMapMaxBounds(d){const t=this._map.getMaxBounds(),a=d.coords;return t&&(a.longitude<t.getWest()||a.longitude>t.getEast()||a.latitude<t.getSouth()||a.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
800RROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){const d=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&d))return;const t=this._map.project(d),a=this._map.unproject([t.x+100,t.y]),o=d.distanceTo(a)/100,c=2*this._accuracy/o;this._circleElement.style.width=`${c.toFixed(2)}px`,this._circleElement.style.height=`${c.toFixed(2)}px`}trigger(){if(!this._setup)return h.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new h.n("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":gn--,ka=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new h.n("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new h.n("trackuserlocationstart")),this.fire(new h.n("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),gn++,gn>1?(d={maximumAge:6e5,timeout:0},ka=!0):(d=this.options.positionOptions,ka=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},k.GlobeControl=class{constructor(){this._toggleProjection=()=>{var d;const t=(d=this._map.getProjection())===null||d===void 0?void 0:d.type;this._map.setProjection(t!=="mercator"&&t?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var d;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((d=this._map.getProjection())===null||d===void 0?void 0:d.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(d){return this._map=d,this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=de.create("button","maplibregl-ctrl-globe",this._container),de.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},k.Hash=Yn,k.ImageSource=Xr,k.KeyboardHandler=cu,k.LngLatBounds=Fe,k.LogoControl
vendor: 5,001 bytes, line 800
800=Ll,k.Map=ao,k.MapLibreMap=ao,k.MapMouseEvent=Xi,k.MapTouchEvent=Jn,k.MapWheelEvent=tu,k.Marker=os,k.NavigationControl=class{constructor(d){this._updateZoomButtons=()=>{const t=this._map.getZoom(),a=t===this._map.getMaxZoom(),o=t===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=o,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",o.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(t,a)=>{const o=this._map._getUIString(`NavigationControl.${a}`);t.title=o,t.setAttribute("aria-label",o)},this.options=h.e({},Fl,d),this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),de.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),de.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=de.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ns(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(d,t){const a=de.create("button",d,this._container);return a.type="button",a.addEventListener("click",t),a}},k.Popup=class extends h.E{constructor(d){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new h.n("close"))),this),this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=de.create("div","maplibregl-popup",this._map.getContainer()),this._tip=de.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const x of this.options.className.split(" "))this._container.classList.add(x);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}let a;if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=no(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),t&&"point"in t&&t.point&&(
800a=t.point),this._trackPointer&&!a)return;const o=this._flatPos=this._pos=this._trackPointer&&a?a:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&a?a:this._map.transform.locationToScreenPoint(this._lngLat));let c=this.options.anchor;const f=lo(this.options.offset);if(!c){const x=this._container.offsetWidth,w=this._container.offsetHeight,S=(function(E){var C,z,B,N;return E?{top:(C=E.top)!==null&&C!==void 0?C:0,right:(z=E.right)!==null&&z!==void 0?z:0,bottom:(B=E.bottom)!==null&&B!==void 0?B:0,left:(N=E.left)!==null&&N!==void 0?N:0}:{top:0,right:0,bottom:0,left:0}})(this.options.padding);let P;P=o.y+f.bottom.y<w+S.top?["top"]:o.y>this._map.transform.height-w-S.bottom?["bottom"]:[],o.x<x/2+S.left?P.push("left"):o.x>this._map.transform.width-x/2-S.right&&P.push("right"),c=P.length===0?"bottom":P.join("-")}let y=o.add(f[c]);this.options.subpixelPositioning||(y=y.round()),this._container.style.transform=`${ss[c]} translate(${y.x}px,${y.y}px)`,so(this._container,c,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=h.e(Object.create(Nl),d)}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new h.n("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(d){return this._lngLat=h.W.convert(d),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(document.createTextNode(d))}setHTML(d){const t=document.createDocumentFragment(),a=document.createElement("body");let o;for(a.innerHTML=d;o=a.firstChild,o;)t.appendChild(o);return this.setDOMContent(t)}getMaxWidth(){var d;return(d=this._container)===null||d===void 0?void 0:d.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=de.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(d){return this._container&&this._container.classList.add(d),this}removeClassName(d){return this._container&&this._container.classList.remove(d),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){if(this._container)return this._container.classList.toggle(d)}setSubpixelPositioning(d){this.options.subpixelPositioning=d}setPadding(d){this.options.padding=d,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=de.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(oo);d&&d.focus()}},k.RasterDEMTileSource=Jt,k.RasterTileSource=Ei,k.ScaleControl=class{constructor(d){this._onMove=()=>{ls(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,ls(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Ol),d)}getDefaultPosition(){return"bottom-left"}onAdd(d){return this._map=d,this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-scale",d.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}}
800,k.ScrollZoomHandler=Rl,k.Style=Pa,k.TerrainControl=class{constructor(d){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=d}onAdd(d){return this._map=d,this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=de.create("button","maplibregl-ctrl-terrain",this._container),de.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},k.TwoFingersTouchPitchHandler=Nr,k.TwoFingersTouchRotateHandler=lu,k.TwoFingersTouchZoomHandler=ou,k.TwoFingersTouchZoomRotateHandler=De,k.VectorTileSource=Kt,k.VideoSource=da,k.addSourceType=(d,t)=>h._(void 0,void 0,void 0,(function*(){if(ys(d))throw new Error(`A source type called "${d}" already exists.`);((a,o)=>{jo[a]=o})(d,t)})),k.clearPrewarmedResources=function(){const d=Mi;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(bt),Mi=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},k.createTileMesh=tn,k.getGlobalDispatcher=Yt,k.getMaxParallelImageRequests=function(){return h.c.MAX_PARALLEL_IMAGE_REQUESTS},k.getRTLTextPluginStatus=function(){return Yr().getRTLTextPluginStatus()},k.getVersion=function(){return Vl},k.getWorkerCount=function(){return lt.workerCount},k.getWorkerUrl=function(){return h.c.WORKER_URL},k.importScriptInWorkers=function(d){return Yt().broadcast("IS",d)},k.isTimeFrozen=function(){return ui.isFrozen()},k.now=je,k.prewarm=function(){tr().acquire(bt)},k.restoreNow=function(){ui.restoreNow()},k.setMaxParallelImageRequests=function(d){h.c.MAX_PARALLEL_IMAGE_REQUESTS=d},k.setNow=function(d){ui.setNow(d)},k.setRTLTextPlugin=function(d,t){return Yr().setRTLTextPlugin(d,t)},k.setWorkerCount=function(d){lt.workerCount=d},k.setWorkerUrl=function(d){h.c.WORKER_URL=d}}));var xt=Ue;return xt}))})(Uu)),Uu.exports}var Xy=Hy();const No=Py(Xy),Yy=.5,om=Math.PI/180,Cd=180/Math.PI;function lm(fe,Ie){const Ue=Ie*om,We=fe*om,Ge=Math.cos(Ue);return[Ge*Math.cos(We),Ge*Math.sin(We),Math.sin(Ue)]}function cm(fe,Ie){for(;fe-Ie>180;)fe-=360;for(;fe-Ie<-180;)fe+=360;return fe}function Ky(fe){const Ie=lm(fe.srcLng,fe.srcLat),Ue=lm(fe.dstLng,fe.dstLat),We=Math.max(-1,Math.min(1,Ie[0]*Ue[0]+Ie[1]*Ue[1]+Ie[2]*Ue[2])),Ge=Math.acos(We),xt=Math.max(1,Math.ceil(Ge*Cd/Yy)),k=Math.sin(Ge),h=[];for(let ge=0;ge<=xt;ge++){const pt=ge/xt;let at,Tt;if(ge===0)at=fe.srcLng,Tt=fe.srcLat;else if(ge===xt)at=fe.dstLng,Tt=fe.dstLat;else if(Math.abs(k)<1e-12)at=fe.srcLng+(cm(fe.dstLng,fe.srcLng)-fe.srcLng)*pt,Tt=fe.srcLat+(fe.dstLat-fe.srcLat)*pt;else{const Si=Math.sin((1-pt)*Ge)/k,ft=Math.sin(pt*Ge)/k,ui=Si*Ie[0]+ft*Ue[0],je=Si*Ie[1]+ft*Ue[1],ii=Si*Ie[2]+ft*Ue[2];at=Math.atan2(je,ui)*Cd,Tt=Math.atan2(ii,Math.sqrt(ui*ui+je*je))*Cd}h.length>0&&(at=cm(at,h[h.length-1][0])),h.push([at,Tt])}return{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:h}}}const Jy={"de-DE":"de","en-US":"en","es-ES":"es","es-LA":"es","fr-FR":"fr","it-IT":"it","ja-JP":"ja","ko-KR":"ko","pl-PL":"pl","pt-BR":"pt","pt-PT":"pt","ru-RU":"ru","zh-CN":"zh-Hans","zh-TW":"zh-Hant"};function wm(...fe){return fe.filter(Ie=>!!Ie).join(", ")}function Tm(fe){return Array.isArray(fe)&&typeof fe[0]=="string"}function Sm(fe,Ie){return fe[0]==="get"&&fe[1]==="name:en"?["coalesce",["get",Ie],["get","name:en"],["get","name"]]:fe[0]==="has"&&fe[1]==="name:en"?["any",["has",Ie],["has","name:en"],["has","name"]]:[fe[0],...fe.slice(1).map(Ue=>Tm(Ue)?Sm(Ue,Ie):Ue)]}function Pm(fe,Ie){const Ue=`name:${Jy[Ie]}`;return{...fe,layers:fe.layers?.map(We=>{if(We.type!=="symbol"||!We.layout?.["text-field"])return We;const Ge=We.layout["text-field"];return{...We,layout:{...We.layout,"text-field":Tm(Ge)?Sm(Ge,Ue):Ge}}})}}function um(fe,Ie,Ue){const We=Pm(Ie,Ue);for(const Ge of We.layers??[])Ge.type==="symbol"&&Ge.layout?.["text-field"]!==void 0&&fe.getLayer(Ge.id)&&fe.setLayoutProperty(Ge.id,"text-field",Ge.layout["text-field"])}const Qy="https://platform.dash.cloudflare.com/map-tiles/planet_z7.json",e0="https://fonts.static.dash.cloudflare.com/fonts/{fontstack}/{range}
800.pbf",t0={"#ffffff":"#191919","#fdfdfd":"#1b1b1b","#fcfcfc":"#1c1c1c","#fafafa":"#1e1e1e","#f8f8f8":"#202020","#f7f7f7":"#212121","#f6f6f6":"#222222","#f5f5f5":"#242424","#efefef":"#292929","#ebebeb":"#2c2c2c","#dcdcdc":"#353535","#d6d6d6":"#3a3a3a","#b8b8b8":"#9a9a9a","#b3b3b3":"#a1a1a1","#adadad":"#aaaaaa","#999999":"#bdbdbd","#8f8f8f":"#c6c6c6","#5c5c5c":"#e5e5e5"},i0=["step",["zoom"],["literal",["bottom","left","right","top"]],8,["literal",["center"]]],Gu={version:8,sources:{protomaps:{type:"vector",attribution:'<a rel="noopener noreferrer" href="https://github.com/protomaps/basemaps">Protomaps</a> © <a rel="noopener noreferrer" href="https://osm.org/copyright">OpenStreetMap</a>',url:Qy}},layers:[{id:"background",type:"background",paint:{"background-color":"#ffffff"}},{id:"earth",type:"fill",filter:["==","$type","Polygon"],source:"protomaps","source-layer":"earth",paint:{"fill-color":"#ffffff"}},{id:"landuse_park",type:"fill",source:"protomaps","source-layer":"landuse",filter:["in","kind","national_park","park","cemetery","protected_area","nature_reserve","forest","golf_course","wood","nature_reserve","forest","scrub","grassland","grass","military","naval_base","airfield"],paint:{"fill-opacity":["interpolate",["linear"],["zoom"],6,0,11,1],"fill-color":["case",["in",["get","kind"],["literal",["national_park","park","cemetery","protected_area","nature_reserve","forest","golf_course"]]],"#fcfcfc",["in",["get","kind"],["literal",["wood","nature_reserve","forest"]]],"#fafafa",["in",["get","kind"],["literal",["scrub","grassland","grass"]]],"#fafafa",["in",["get","kind"],["literal",["glacier"]]],"#fcfcfc",["in",["get","kind"],["literal",["sand"]]],"#fafafa",["in",["get","kind"],["literal",["military","naval_base","airfield"]]],"#f7f7f7","#ffffff"]}},{id:"landuse_urban_green",type:"fill",source:"protomaps","source-layer":"landuse",filter:["in","kind","allotments","village_green","playground"],paint:{"fill-color":"#fcfcfc","fill-opacity":.7}},{id:"landuse_hospital",type:"fill",source:"protomaps","source-layer":"landuse",filter:["==","kind","hospital"],paint:{"fill-color":"#f8f8f8"}},{id:"landuse_industrial",type:"fill",source:"protomaps","source-layer":"landuse",filter:["==","kind","industrial"],paint:{"fill-color":"#fcfcfc"}},{id:"landuse_school",type:"fill",source:"protomaps","source-layer":"landuse",filter:["in","kind","school","university","college"],paint:{"fill-color":"#f8f8f8"}},{id:"landuse_beach",type:"fill",source:"protomaps","source-layer":"landuse",filter:["in","kind","beach"],paint:{"fill-color":"#f6f6f6"}},{id:"landuse_zoo",type:"fill",source:"protomaps","source-layer":"landuse",filter:["in","kind","zoo"],paint:{"fill-color":"#f7f7f7"}},{id:"landuse_aerodrome",type:"fill",source:"protomaps","source-layer":"landuse",filter:["in","kind","aerodrome"],paint:{"fill-color":"#fdfdfd"}},{id:"roads_runway",type:"line",source:"protomaps","source-layer":"roads",filter:["==","kind_detail","runway"],paint:{"line-color":"#efefef","line-width":["interpolate",["exponential",1.6],["zoom"],10,0,12,4,18,30]}},{id:"roads_taxiway",type:"line",source:"protomaps","source-layer":"roads",minzoom:13,filter:["==","kind_detail","taxiway"],paint:{"line-color":"#efefef","line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,15,6]}},{id:"landuse_runway",type:"fill",source:"protomaps","source-layer":"landuse",filter:["any",["in","kind","runway","taxiway"]],paint:{"fill-color":"#efefef"}},{id:"water",type:"fill",filter:["==","$type","Polygon"],source:"protomaps","source-layer":"water",paint:{"fill-color":"#dcdcdc"}},{id:"water_stream",type:"line",source:"protomaps","source-layer":"water",minzoom:14,filter:["in","kind","stream"],paint:{"line-color":"#dcdcdc","line-width":.5}},{id:"water_river",type:"line",source:"protomaps","source-layer":"water",minzoom:9,filter:["in","kind","river"],paint:{"line-color":"#dcdcdc","line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1,18,12]}},{id:"landuse_pedestrian",type:"fill",source:"protomaps","source-layer":"landuse",filter:["in","kind","pedestrian","dam"],paint:{"fill-color":"#fdfdfd"}}
800,{id:"landuse_pier",type:"fill",source:"protomaps","source-layer":"landuse",filter:["==","kind","pier"],paint:{"fill-color":"#efefef"}},{id:"roads_tunnels_other_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["has","is_tunnel"],["in","kind","other","path"]],paint:{"line-color":"#d6d6d6","line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_tunnels_minor_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["has","is_tunnel"],["==","kind","minor_road"]],paint:{"line-color":"#fcfcfc","line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_tunnels_link_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["has","is_tunnel"],["has","is_link"]],paint:{"line-color":"#fcfcfc","line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_tunnels_major_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":"#fcfcfc","line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,18,13],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_tunnels_highway_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":"#fcfcfc","line-dasharray":[6,.5],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,15],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1,20,15]}},{id:"roads_tunnels_other",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["has","is_tunnel"],["in","kind","other","path"]],paint:{"line-color":"#d6d6d6","line-dasharray":[4.5,.5],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_tunnels_minor",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["has","is_tunnel"],["==","kind","minor_road"]],paint:{"line-color":"#d6d6d6","line-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11]}},{id:"roads_tunnels_link",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["has","is_tunnel"],["has","is_link"]],paint:{"line-color":"#d6d6d6","line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_tunnels_major",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["has","is_tunnel"],["==","kind","major_road"]],paint:{"line-color":"#d6d6d6","line-width":["interpolate",["exponential",1.6],["zoom"],6,0,12,1.6,15,3,18,13]}},{id:"roads_tunnels_highway",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["has","is_tunnel"],["==",["get","kind"],"highway"],["!",["has","is_link"]]],paint:{"line-color":"#d6d6d6","line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}},{id:"buildings",type:"fill",source:"protomaps","source-layer":"buildings",filter:["in","kind","building","building_part"],paint:{"fill-color":"#efefef","fill-opacity":.5}},{id:"roads_pier",type:"line",source:"protomaps","source-layer":"roads",filter:["==","kind_detail","pier"],paint:{"line-color":"#efefef","line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,16]}},{id:"roads_minor_service_casing",type:"line",source:"protomaps","source-layer":"roads",minzoom:13,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["==","kind_detail","service"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,18,8],"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,.8]}},{id:"roads_minor_casing",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["!=","kind_detail","service"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_link_casing",type:"line",source:"protomaps","source-layer":"roads",minzoom:13,filter:["has","is_link"],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1.5]}},{id:"roads_major_casing_late",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],6,0,12,1.6,15,3,18,13],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_highway_casing_late",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,15],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1,20,15]}},{id:"roads_other",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["in","kind","other","path"],["!=","kind_detail","pier"]],paint:{"line-color":"#f5f5f5","line-dasharray":[3,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_link",type:"line",source:"protomaps","source-layer":"roads",filter:["has","is_link"],paint:{"line-color":"#ebebeb","line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_minor_service",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["==","kind_detail","service"]],paint:{"line-color":"#f5f5f5","line-width":["interpolate",["exponential",1.6],["zoom"],13,0,18,8]}},{id:"roads_minor",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["!=","kind_detail","service"]],paint:{"line-color":["interpolate",["exponential",1.6],["zoom"],11,"#ebebeb",16,"#f5f5f5"],"line-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11]}},{id:"roads_major_casing_early",type:"line",source:"protomaps","source-layer":"roads",maxzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,
80018,13],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_major",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":"#ebebeb","line-width":["interpolate",["exponential",1.6],["zoom"],6,0,12,1.6,15,3,18,13]}},{id:"roads_highway_casing_early",type:"line",source:"protomaps","source-layer":"roads",maxzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,15],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1]}},{id:"roads_highway",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":"#ebebeb","line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}},{id:"roads_rail",type:"line",source:"protomaps","source-layer":"roads",filter:["==","kind","rail"],paint:{"line-dasharray":[.3,.75],"line-opacity":.5,"line-color":"#d6d6d6","line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,.15,18,9]}},{id:"roads_bridges_other_casing",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["in","kind","other","path"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_bridges_link_casing",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["has","is_link"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1.5]}},{id:"roads_bridges_minor_casing",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","minor_road"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,.8]}},{id:"roads_bridges_major_casing",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,18,10],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1.5]}},{id:"roads_bridges_other",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["in","kind","other","path"]],paint:{"line-color":"#f5f5f5","line-dasharray":[2,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_bridges_minor",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","minor_road"]],paint:{"line-color":"#f5f5f5","line-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11]}},{id:"roads_bridges_link",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["has","is_link"]],paint:{"line-color":"#f5f5f5","line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_bridges_major",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":"#ebebeb","line-width":["interpolate",["exponential",1.6],["zoom"],6,0,12,1.6,15,3,18,13]}},{id:"roads_bridges_highway_casing",type:"line",source:"protomaps","source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":"#ffffff","line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,15],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1,20,15]}},{id:"roads_bridges_highway",type:"line",source:"protomaps","source-layer":"roads",filter:["all",["has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":"#ebebeb","line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}},{id:"address_label",type:"symbol",source:"protomaps","source-layer":"buildings",minzoom:18,filter:["==","kind","address"],layout:{"symbol-placement":"point","text-font":["Noto Sans Italic"],"text-field":["get","addr_housenumber"],"text-size":12},paint:{"text-color":"#adadad","text-halo-color":"#ffffff","text-halo-width":1}},{id:"water_waterway_label",type:"symbol",source:"protomaps","source-layer":"water",minzoom:13,filter:["in","kind","river","stream"],layout:{"symbol-placement":"line","text-font":["Noto Sans Italic"],"text-field":["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["has","script"],["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","name:en"],["get","name:en"]],{},`
801`,{},["case",["all",["!",["has","name:en"]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{}]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",["has","script"],["has","script2"]],["format",["get","name:en"],{},`
802`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
803`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["has","script2"],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
804`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
805`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]],["case",["all",["has","script"],["has","script2"],["has","script3"]],["format",["get","name:en"],{},`
806`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
807`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
808`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["!",["has","script"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
809`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
810`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["!",["has","script2"]],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
811`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
812`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name3"],["get","name3"]],{},`
813`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
814`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]]],"text-size":12,"text-letter-spacing":.2},paint:{"text-color":"#adadad","text-halo-color":"#dcdcdc","text-halo-width":1}},{id:"roads_labels_minor",type:"symbol",source:"protomaps","source-layer":"roads",minzoom:15,filter:["in","kind","minor_road","other","path"],layout:{"symbol-sort-key":["get","min_zoom"],"symbol-placement":"line","text-font":["Noto Sans Regular"],"text-field":["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["has","script"],["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","name:en"],["get","name:en"]],{},`
815`,{},["case",["all",["!",["has","name:en"]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{}]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",["has","script"],["has","script2"]],["format",["get","name:en"],{},`
816`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
817`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["has","script2"],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
818`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
819`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]],["case",["all",["has","script"],["has","script2"],["has","script3"]],["format",["get","name:en"],{},`
820`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
821`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
822`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["!",["has","script"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
823`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
824`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["!",["has","script2"]],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
825`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
826`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name3"],["get","name3"]],{},`
827`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
828`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]]],"text-size":12},paint:{"text-color":"#adadad","text-halo-color":"#ffffff","text-halo-width":1}},{id:"water_label_ocean",type:"symbol",source:"protomaps","source-layer":"water",filter:["in","kind","sea","ocean","bay","strait","fjord"],layout:{"text-font":["Noto Sans Italic"],"text-field":["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["has","script"],["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","name:en"],["get","name:en"]],{},`
829`,{},["case",["all",["!",["has","name:en"]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{}]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",["has","script"],["has","script2"]],["format",["get","name:en"],{},`
830`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
831`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["has","script2"],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
832`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
833`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]],["case",["all",["has","script"],["has","script2"],["has","script3"]],["format",["get","name:en"],{},`
834`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
835`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
836`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["!",["has","script"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
837`,{},["coalesce",["get","pgf:name2"],["
837get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
838`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["!",["has","script2"]],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
839`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
840`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name3"],["get","name3"]],{},`
841`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
842`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]]],"text-size":["interpolate",["linear"],["zoom"],3,10,10,12],"text-letter-spacing":.1,"text-max-width":9,"text-transform":"uppercase"},paint:{"text-color":"#adadad","text-halo-width":1,"text-halo-color":"#dcdcdc"}},{id:"earth_label_islands",type:"symbol",source:"protomaps","source-layer":"earth",filter:["in","kind","island"],layout:{"text-font":["Noto Sans Italic"],"text-field":["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["has","script"],["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","name:en"],["get","name:en"]],{},`
843`,{},["case",["all",["!",["has","name:en"]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{}]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",["has","script"],["has","script2"]],["format",["get","name:en"],{},`
844`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
845`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["has","script2"],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
846`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
847`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]],["case",["all",["has","script"],["has","script2"],["has","script3"]],["format",["get","name:en"],{},`
848`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
849`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
850`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["!",["has","script"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
851`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
852`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["!",["has","script2"]],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
853`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
854`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name3"],["get","name3"]],{},`
855`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
856`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]]],"text-size":10,"text-letter-spacing":.1,"text-max-width":8},paint:{"text-color":"#8f8f8f","text-halo-color":"#ffffff","text-halo-width":1}},{id:"water_label_lakes",type:"symbol",source:"protomaps","source-layer":"water",filter:["in","kind","lake","water"],layout:{"text-font":["Noto Sans Italic"],"text-field":["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["has","script"],["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","name:en"],["get","name:en"]],{},`
857`,{},["case",["all",["!",["has","name:en"]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{}]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",["has","script"],["has","script2"]],["format",["get","name:en"],{},`
858`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
859`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["has","script2"],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
860`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
861`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]],["case",["all",["has","script"],["has","script2"],["has","script3"]],["format",["get","name:en"],{},`
862`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
863`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
864`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["!",["has","script"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
865`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
866`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["!",["has","script2"]],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
867`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
868`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name3"],["get","name3"]],{},`
869`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
870`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]]],"text-size":["interpolate",["linear"],["zoom"],3,10,6,12,10,12],"text-letter-spacing":.1,"text-max-width":9},paint:{"text-color":"#adadad","text-halo-color":"#dcdcdc","text-halo-width":1}},{id:"roads_labels_major",type:"symbol",source:"protomaps","source-layer":"roads",minzoom:11,filter:["in","kind","highway","major_road"],layout:{"symbol-sort-key":["get","min_zoom"],"symbol-placement":"line","text-font":["Noto Sans Regular"],"text-field":["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["has","script"],["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","name:en"],["get","name:en"]],{},`
871`,{},["case",["all",["!",["has","name:en"]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{}]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",["has","script"],["has","script2"]],["format",["get","name:en"],{},`
872`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
873`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["has","script2"],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
874`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
875`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]],["case",["all",["has","script"],["has","script2"],["has","script3"]],["format",["get","name:en"],{},`
876`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
877`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
878`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["!",["has","script"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
879`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
880`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["!",["has","script2"]],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
881`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
882`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name3"],["get","name3"]],{},`
883`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
884`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]]],"text-size":12},paint:{"text-color":"#999999","text-halo-color":"#ffffff","text-halo-width":1}},{id:"places_subplace",type:"symbol",source:"protomaps","source-layer":"places",filter:["in","kind","neighbourhood","macrohood"],layout:{"symbol-sort-key":["case",["has","sort_key"],["get","sort_key"],["get","min_zoom"]],"text-field":["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["has","script"],["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","name:en"],["get","name:en"]],{},`
885`,{},["case",["all",["!",["has","name:en"]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{}]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",["has","script"],["has","script2"]],["format",["get","name:en"],{},`
886`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
887`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["c
887ase",["has","script2"],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
888`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
889`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]],["case",["all",["has","script"],["has","script2"],["has","script3"]],["format",["get","name:en"],{},`
890`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
891`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
892`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["!",["has","script"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
893`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
894`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["!",["has","script2"]],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
895`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
896`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name3"],["get","name3"]],{},`
897`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
898`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]]],"text-font":["Noto Sans Regular"],"text-max-width":7,"text-letter-spacing":.1,"text-padding":["interpolate",["linear"],["zoom"],5,2,8,4,12,18,15,20],"text-size":["interpolate",["exponential",1.2],["zoom"],11,8,14,14,18,24],"text-transform":"uppercase"},paint:{"text-color":"#8f8f8f","text-halo-color":"#ffffff","text-halo-width":1}},{id:"places_region",type:"symbol",source:"protomaps","source-layer":"places",filter:["==","kind","region"],layout:{"symbol-sort-key":["get","sort_key"],"text-field":["step",["zoom"],["coalesce",["get","ref:en"],["get","ref"]],6,["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["has","script"],["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","name:en"],["get","name:en"]],{},`
899`,{},["case",["all",["!",["has","name:en"]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{}]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",["has","script"],["has","script2"]],["format",["get","name:en"],{},`
900`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
901`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["has","script2"],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
902`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
903`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]],["case",["all",["has","script"],["has","script2"],["has","script3"]],["format",["get","name:en"],{},`
904`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
905`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
906`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["!",["has","script"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
907`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
908`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["!",["has","script2"]],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
909`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
910`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name3"],["get","name3"]],{},`
911`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
912`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]]]],"text-font":["Noto Sans Regular"],"text-size":["interpolate",["linear"],["zoom"],3,11,7,16],"text-radial-offset":.2,"text-anchor":"center","text-transform":"uppercase"},paint:{"text-color":"#b3b3b3","text-halo-color":"#ffffff","text-halo-width":1}},{id:"places_locality",type:"symbol",source:"protomaps","source-layer":"places",filter:["==","kind","locality"],layout:{"text-field":["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["has","script"],["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","name:en"],["get","name:en"]],{},`
913`,{},["case",["all",["!",["has","name:en"]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{}]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",["has","script"],["has","script2"]],["format",["get","name:en"],{},`
914`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
915`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["has","script2"],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
916`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
917`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]],["case",["all",["has","script"],["has","script2"],["has","script3"]],["format",["get","name:en"],{},`
918`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
919`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
920`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["case",["!",["has","script"]],["format",["coalesce",["get","name:en"],["get","pgf:name"],["get","name"]],{},`
921`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
922`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["!",["has","script2"]],["format",["coalesce",["get","name:en"],["get","pgf:name2"],["get","name2"]],{},`
923`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
924`,{},["coalesce",["get","pgf:name3"],["get","name3"]],{"text-font":["case",["==",["get","script3"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}],["format",["coalesce",["get","name:en"],["get","pgf:name3"],["get","name3"]],{},`
925`,{},["coalesce",["get","pgf:name"],["get","name"]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]},`
926`,{},["coalesce",["get","pgf:name2"],["get","name2"]],{"text-font":["case",["==",["get","script2"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",["Noto Sans Regular"]]]}]]]],"text-font":["case",["<=",["get","min_zoom"],5],["literal",["Noto Sans Medium"]],["literal",["Noto Sans Regular"]]],"symbol-sort-key":["case",["has","sort_key"],["get","sort_key"],["get","min_zoom"]],"text-padding":["interpolate",["linear"],["zoom"],5,3,8,7,12,11],"text-size":["interpolate",["linear"],["zoom"],2,["case",["<",["get","population_rank"],13],8,[">=",["get","population_rank"],13],13,0],4,["case",["<",["get","population_rank"],13],10,[">=",["get","population_rank"],13],15,0],6,["case",["<",["get","population_rank"],12],11,[">=",["get","population_rank"],12],17,0],8,["case",["<",["get","population_rank"],11],11,[">=",["get","population_rank"],11],18,0],10,["case",["<",["get","population_rank"],9],12,[">=",["get","population_rank"],9],20,0],15,["case",["<",["get","population_rank"],8],12,[">=",["get","population_rank"],8],22,0]],"icon-padding":["interpolate",["linear"],["zoom"],0,0,8,4,10,8,12,6,22,2],"text-justify":"auto","text-variable-anchor":i0,"text-radial-offset":.3},paint:{"text-color":"#5c5c5c","text-halo-color":"#ffffff","text-halo-width":1}},{id:"places_country",type:"symbol",source:"protomaps","source-layer":"places",filter:["==","kind","country"],layout:{"symbol-sort-key":["case",["has","sort_key"],["get","sort_key"],["get","min_zoom"]],"text-field":["format",["coalesce",["get","name:en"],["get","name:en"]],{}],"text-font":["Noto Sans Medium"],"text-size":["interpolate",["linear"],["zoom"],2,["case",["<",["get","population_rank"],10],8,[">=",["get","population_rank"],10],12,0],6,["case",["<",["get","population_rank"],8],10,[">=",["get","population_rank"],8],18,0],8,["case",["<",["get","population_rank"],7],11,[">=",["get","population_rank"],7],20,0]],"icon-padding":["interpolate",["linear"],["zoom"],0,2,14,2,16,20,17,2,22,2],"text-transform":"uppercase"},paint:{"text-color":"#b8b8b8","text-halo-color":"#ffffff","text-halo-width":1}}],glyphs:e0};function zd(fe){return typeof fe=="string"?t0[fe]??fe:Array.isArray(fe)?fe.map(zd):!fe||typeof fe!="object"?fe:Object.fromEntries(Object.entries(fe).map(([Ie,Ue])=>[Ie,zd(Ue)]))}const Rd=zd(Gu);function hm(fe,Ie){const Ue=new Map((Ie.layers??[]).map(Ge=>[Ge.id,Ge])),We=[];for(const Ge of fe.layers??[]){const xt=Ue.get(Ge.id);if(!("paint"in Ge)||!Ge.paint||!xt||!("paint"in xt)||!xt.paint)continue;
926const k=new Map(Object.entries(xt.paint));for(const[h,ge]of Object.entries(Ge.paint))JSON.stringify(ge)!==JSON.stringify(k.get(h))&&We.push({layerId:Ge.id,property:h,value:ge})}return We}const r0={light:hm(Gu,Rd),dark:hm(Rd,Gu)};function Ad(fe){return fe==="dark"?Rd:Gu}function a0(fe){return r0[fe]}const n0={light:Ry.red[4],dark:"#ff7168"},s0="var(--st-map-client)",Mm=zy,Oo="speedtest-colos",gs="speedtest-colos",dm="speedtest-connection",kd="speedtest-connection";function Im(fe,{city:Ie,iata:Ue}){return fe(Ue,{ns:"colos",defaultValue:Ie||Ue})}function Em(fe,Ie){return Ie?fe(Ie.toUpperCase(),{ns:"countries",defaultValue:Ie}):void 0}function Cm(fe,Ie){return`${wm(Im(fe,Ie),Em(fe,Ie.cca2))} (${Ie.iata})`}function o0(fe,Ie,Ue){return{type:"FeatureCollection",features:fe.filter(({iata:We,lat:Ge,lon:xt})=>We!==Ie?.iata&&Zu(xt,Ge)).map(We=>({type:"Feature",geometry:{type:"Point",coordinates:[We.lon,We.lat]},properties:{tooltip:Cm(Ue,We)}}))}}function Zu(fe,Ie){return Number.isFinite(fe)&&fe>=-180&&fe<=180&&Number.isFinite(Ie)&&Ie>=-90&&Ie<=90}function Vu({icon:fe,children:Ie}){return dt.jsxs("li",{style:{display:"flex",columnGap:6,fontSize:13},children:[dt.jsx(fe,{size:16,style:{flexShrink:0}})," ",Ie]})}function ju({style:fe,...Ie}){return dt.jsx("b",{...Ie,style:{...fe,fontWeight:500}})}function pm(fe,Ie,Ue,We,Ge,xt,k){const h=document.createElement("button");h.type="button",h.className="map-marker-button rounded-[2px] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-kumo-brand";let ge=We,pt=!1;h.setAttribute("aria-label",ge);let at=!1;const Tt=()=>{pt=!0,Ge(h,Ie,ge)},Si=()=>{at||(pt=!1,xt(h))},ft=()=>{at=!1,pt=!1,xt(h)},ui=()=>{at=!at,at?Tt():(pt=!1,xt(h))};h.addEventListener("mouseenter",Tt),h.addEventListener("focus",Tt),h.addEventListener("mouseleave",Si),h.addEventListener("blur",ft),h.addEventListener("click",ui);const je=Ay.createRoot(h);let ii;try{je.render(Ue),ii=new No.Marker({element:h,anchor:k}).setLngLat(Ie).addTo(fe)}catch(Ut){throw je.unmount(),Ut}return{setTooltip(Ut){ge=Ut,h.setAttribute("aria-label",ge),pt&&Ge(h,Ie,ge)},remove(){h.removeEventListener("mouseenter",Tt),h.removeEventListener("focus",Tt),h.removeEventListener("mouseleave",Si),h.removeEventListener("blur",ft),h.removeEventListener("click",ui),xt(h),ii.remove(),je.unmount()}}}function Am(fe){return["interpolate",["linear"],["line-progress"],0,n0[fe],1,Mm]}function l0(fe){return{"CooperativeGesturesHandler.MacHelpText":fe("map.gestures.scroll.mac"),"CooperativeGesturesHandler.WindowsHelpText":fe("map.gestures.scroll.windows"),"CooperativeGesturesHandler.MobileHelpText":fe("map.gestures.move")}}function c0(fe,Ie){const Ue=fe.querySelector(".maplibregl-desktop-message"),We=fe.querySelector(".maplibregl-mobile-message");Ue&&(Ue.textContent=navigator.userAgent.includes("Mac")?Ie["CooperativeGesturesHandler.MacHelpText"]:Ie["CooperativeGesturesHandler.WindowsHelpText"]),We&&(We.textContent=Ie["CooperativeGesturesHandler.MobileHelpText"])}function fm(fe){const Ie=fe.querySelector(".maplibregl-ctrl-attrib");Ie?.removeAttribute("open"),Ie?.classList.remove("maplibregl-compact-show")}function mm(fe,Ie,Ue){for(const{layerId:We,property:Ge,value:xt}of a0(Ie))fe.getLayer(We)&&fe.setPaintProperty(We,Ge,xt);fe.getLayer(kd)&&fe.setPaintProperty(kd,"line-gradient",Am(Ie)),Ue&&fe.once("idle",Ue)}function u0({colos:fe,colo:Ie,asn:Ue,asOrganization:We,clientIp:Ge,latitude:xt,longitude:k,city:h,country:ge}){const{t:pt,i18n:at}=Ey(["common","colos","countries"]),{theme:Tt}=Cy(),{pathname:Si}=Iy(),ft=Id(Si)||Ed,ui=at.resolvedLanguage,je=he.useRef(null),ii=he.useRef(null),Ut=he.useRef(null),de=he.useRef(null),zt=he.useRef(null),[Dr,zr]=he.useState(!1),Bt=fe.find(({iata:_e})=>_e===Ie?.iata),ur=xt!==void 0&&k!==void 0&&Zu(k,xt),Qe=he.useEffectEvent(()=>Tt),W=he.useEffectEvent(()=>Ad(Tt)),K=he.useEffectEvent(_e=>{const Be=at.getFixedT(_e);return{colos:o0(fe,Bt,Be),connectedTooltip:Bt?Cm(Be,Bt):void 0,clientTooltip:ur?Be("map.attribution.you",{location:wm(h,Em(Be,ge))}):""}}),ee=he.useEffectEvent(_e=>l0(at.getFixedT(_e))),ve=he.useEffectEvent((_e,Be)=>
926{const Re=K(Be);um(_e,W(),Be);const Ce=_e.getSource(Oo);Ce instanceof No.GeoJSONSource&&Ce.setData(Re.colos),Ut.current?.remove(),Re.connectedTooltip&&zt.current?.setTooltip(Re.connectedTooltip),de.current?.setTooltip(Re.clientTooltip)});return he.useEffect(()=>{const _e=je.current;if(!_e)return;delete _e.dataset.mapLoaded;const Be=Id(window.location.pathname)||Ed,Re=Qe();let Ce,Ve,Xe=!1,Le=!1,bt,lt;const Pi=[],Mi=Bt?Zu(Bt.lon,Bt.lat):!1,er=ur&&Bt&&Mi?Ky({srcLat:xt,srcLng:k,dstLat:Bt.lat,dstLng:Bt.lon}):void 0,tr=Bt&&Mi?er?.geometry.coordinates.at(-1)??[Bt.lon,Bt.lat]:void 0,br=()=>{!Xe&&!Le&&zr(!0)};try{const et=Ad(Re);Ce=new No.Map({container:_e,style:Pm(et,Be),center:[0,30],zoom:1,cooperativeGestures:!0,locale:ee(Be),attributionControl:{compact:!0}}),ii.current=Ce,fm(_e),Ce.addControl(new No.NavigationControl({showCompass:!1}),"bottom-right"),Ve=new No.Popup({closeButton:!1,closeOnClick:!1,offset:10}),Ut.current=Ve}catch(et){console.error("Unable to initialize server location map",et),Ce?.remove(),br();return}const Yt=(et,Ot,hr)=>{Xe||(bt=et,Ve.setLngLat(Ot).setText(hr).addTo(Ce))},wr=et=>{bt===et&&(bt=void 0,Ve.remove())},Ii=()=>{if(!Xe)try{const et=Id(window.location.pathname)||Ed,Ot=Qe(),hr=Ad(Ot),dr=K(et);if(Ot!==Re?mm(Ce,Ot,()=>{Xe||(_e.dataset.mapTheme=Ot)}):_e.dataset.mapTheme=Ot,et!==Be&&um(Ce,hr,et),Ce.addSource(Oo,{type:"geojson",generateId:!0,data:dr.colos}),Ce.addLayer({id:gs,type:"circle",source:Oo,paint:{"circle-color":Mm,"circle-opacity":["case",["boolean",["feature-state","hovered"],!1],1,.7],"circle-radius":3.5}}),er&&(Ce.addSource(dm,{type:"geojson",lineMetrics:!0,data:er}),Ce.addLayer({id:kd,type:"line",source:dm,layout:{"line-cap":"round"},paint:{"line-width":1.5,"line-opacity":.7,"line-gradient":Am(Ot)}})),Bt&&tr){const Qt=pm(Ce,tr,dt.jsx(Ld,{variant:"glyph",width:"40px",height:`${17.95918367346939}px`,"aria-hidden":"true"}),dr.connectedTooltip??Bt.iata,Yt,wr,"center");zt.current=Qt,Pi.push(Qt)}if(ur){const Qt=pm(Ce,[k,xt],dt.jsx(ym,{size:24,weight:"fill",color:s0,"aria-hidden":!0}),dr.clientTooltip,Yt,wr,"bottom");de.current=Qt,Pi.push(Qt)}Le=!0,fm(_e),_e.dataset.mapLoaded="true",zr(!1)}catch(et){console.error("Unable to load server location map",et),br()}},Hr=()=>{br()},Gi=et=>{Ce.getCanvas().style.cursor="pointer";const Ot=et.features?.[0];if(Ot?.geometry.type!=="Point")return;Ot.id!==void 0&&(lt!==void 0&&Ce.setFeatureState({source:Oo,id:lt},{hovered:!1}),lt=Ot.id,Ce.setFeatureState({source:Oo,id:lt},{hovered:!0}));const[hr,dr]=Ot.geometry.coordinates;if(hr===void 0||dr===void 0||!Zu(hr,dr))return;const Qt=[hr,dr];for(;Math.abs(et.lngLat.lng-Qt[0])>180;)Qt[0]+=et.lngLat.lng>Qt[0]?360:-360;Yt(_e,Qt,String(Ot.properties?.tooltip??""))},Tr=()=>{Ce.getCanvas().style.cursor="",lt!==void 0&&(Ce.setFeatureState({source:Oo,id:lt},{hovered:!1}),lt=void 0),wr(_e)};Ce.on("load",Ii),Ce.on("error",Hr),Ce.on("mouseenter",gs,Gi),Ce.on("click",gs,Gi),Ce.on("mouseleave",gs,Tr);const Fe=()=>{Xe||Ce.resize()},Zt=typeof ResizeObserver>"u"?void 0:new ResizeObserver(Fe);Zt?.observe(_e);const Kt=requestAnimationFrame(Fe),Ei=window.setTimeout(br,1e4),Jt=window.setTimeout(()=>{if(Xe||!ur)return;const et=new No.LngLatBounds([k,xt],[k,xt]);tr&&et.extend(tr),Ce.fitBounds(et,{maxZoom:7.5,padding:50})},1500);return()=>{Xe=!0,delete _e.dataset.mapLoaded,delete _e.dataset.mapTheme,window.clearTimeout(Ei),window.clearTimeout(Jt),cancelAnimationFrame(Kt),Zt?.disconnect(),Ce.off("load",Ii),Ce.off("error",Hr),Ce.off("mouseenter",gs,Gi),Ce.off("click",gs,Gi),Ce.off("mouseleave",gs,Tr),Ve.remove();for(const et of Pi)et.remove();de.current=null,zt.current=null,Ut.current=null,ii.current===Ce&&(ii.current=null),Ce.remove()}},[fe,Bt,ur,xt,k]),he.useEffect(()=>{const _e=je.current;_e&&c0(_e,ee(ft))},[ft,ui]),he.useEffect(()=>{const _e=ii.current;if(!(!_e||je.current?.dataset.mapLoaded!=="true"))try{const Be=je.current;mm(_e,Tt,()=>{Be?.isConnected&&document.documentElement.dataset.mode===Tt&&(Be.dataset.mapTheme=Tt)})}catch(Be){console.error("Unable to update server location map theme",Be)}},[Tt]),he.useEffect(()=>{const _e=ii.current;if(!(!_e||je.current?.dataset.mapLoaded!=="true"))try{ve(_e,ft)}catch(Be){console.error("Unable to update server location map language",Be)}},[ft,pt]),Ie?.iata&&!Bt&&console.warn("Unable to find client colo:",Ie.iata),dt.jsxs(Dy,{p:3,height:"100%",display:"flex",flexDirection:"column",children:[dt.jsxs("div",{className:"map-responsive",children:[dt.jsx("div",{className:"map-canvas",ref:je}),Dr&&dt.jsx("output",{className:"map-fallback","aria-live":"polite",children:pt("map.info")})]}),dt.jsxs("ul",{style:{display:"flex",flexDirection:"column",gap:4,margin:"8px 0 0",padding:0,listStyle:"none"},children:[Ge&&dt.jsxs(Vu,{icon:xm,children:[pt("map.connected-via")," ",dt.jsx(ju,{children:Ge.includes(":")?"IPv6":"IPv4"})]}),Ie&&dt.jsxs(Vu,{icon:_m,children:[pt("map.server-location")," ",dt.jsx(ju,{children:Im(pt,Ie)})]}),Ue&&dt.jsxs(Vu,{icon:vm,children:[pt("map.network")," ",dt.jsxs(ju,{children:[We||""," ",dt.jsxs("span",{children:["(",dt.jsxs("a",{href:`https://radar.cloudflare.com/quality/as${Ue}`,target:"_blank",rel:"noreferrer",children:["AS",Ue]}),")"]})]})]}),Ge&&dt.jsxs(Vu,{icon:gm,children:[pt("map.ip-address")," ",dt.jsx(ju,{children:dt.jsx("a",{href:`https://radar.cloudflare.com/ip/${Ge}`,target:"_blank",rel:"noreferrer",children:Ge})})]})]})]})}const v0=My.memo(u0);export{v0 as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.