From c4f4207450a0c568a228cdb3d3fe34c63e51d7a7 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Wed, 2 Oct 2024 17:01:36 -0700 Subject: [PATCH] Update Go version, dependencies, Docker, and CI --- .github/actions/build_arm64/Dockerfile | 2 +- .../Dockerfile | 2 +- .../action.yml | 2 +- .../entrypoint.sh | 0 .github/workflows/docker.yml | 4 +- .github/workflows/release.yml | 4 +- .github/workflows/test.yml | 16 +- CHANGELOG.md | 4 +- Dockerfile | 4 +- LICENSE | 2 +- README.md | 8 +- go.mod | 22 +- go.sum | 70 +-- handlers/templates/static/.nvmrc | 1 + handlers/templates/static/dist/index.css | 2 +- handlers/templates/static/dist/index.js | 143 +++--- handlers/templates/static/package-lock.json | 435 ++++++++++-------- handlers/templates/static/package.json | 6 +- 18 files changed, 383 insertions(+), 344 deletions(-) rename .github/actions/{build_x386_64 => build_x86_64}/Dockerfile (90%) rename .github/actions/{build_x386_64 => build_x86_64}/action.yml (69%) rename .github/actions/{build_x386_64 => build_x86_64}/entrypoint.sh (100%) create mode 100644 handlers/templates/static/.nvmrc diff --git a/.github/actions/build_arm64/Dockerfile b/.github/actions/build_arm64/Dockerfile index f20a1a2..4509a80 100644 --- a/.github/actions/build_arm64/Dockerfile +++ b/.github/actions/build_arm64/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21-bullseye +FROM golang:1.23-bullseye RUN \ dpkg --add-architecture arm64 && \ diff --git a/.github/actions/build_x386_64/Dockerfile b/.github/actions/build_x86_64/Dockerfile similarity index 90% rename from .github/actions/build_x386_64/Dockerfile rename to .github/actions/build_x86_64/Dockerfile index 46e627d..adf9159 100644 --- a/.github/actions/build_x386_64/Dockerfile +++ b/.github/actions/build_x86_64/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21-bullseye +FROM golang:1.23-bullseye RUN \ apt-get update && \ diff --git a/.github/actions/build_x386_64/action.yml b/.github/actions/build_x86_64/action.yml similarity index 69% rename from .github/actions/build_x386_64/action.yml rename to .github/actions/build_x86_64/action.yml index 113d546..147b368 100644 --- a/.github/actions/build_x386_64/action.yml +++ b/.github/actions/build_x86_64/action.yml @@ -1,4 +1,4 @@ -name: "build_x386_64" +name: "build_x86_64" runs: using: "docker" image: "Dockerfile" diff --git a/.github/actions/build_x386_64/entrypoint.sh b/.github/actions/build_x86_64/entrypoint.sh similarity index 100% rename from .github/actions/build_x386_64/entrypoint.sh rename to .github/actions/build_x86_64/entrypoint.sh diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ed56d04..3aa65e8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -46,14 +46,14 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # add "type=ref,event=pr" if needed to test a PR tags: | type=raw,value=latest,enable={{is_default_branch}} type=semver,pattern={{version}} + type=ref,event=pr - name: Login to Github Container Registry if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5640ef..1cef0a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,13 +5,13 @@ on: types: [published, edited] jobs: - build_x386_64: + build_x86_64: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Make binaries - uses: ./.github/actions/build_x386_64 + uses: ./.github/actions/build_x86_64 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f4afe7..346486b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,8 +11,8 @@ jobs: strategy: fail-fast: false matrix: - go: [1.18.x, 1.19.x, 1.20.x, 1.21.x] - os: [ubuntu-22.04, ubuntu-20.04, macos-latest] + go: [1.21.x, 1.22.x, 1.23.x] + os: [ubuntu-latest, ubuntu-22.04, macos-latest] runs-on: ${{ matrix.os }} env: CGO_ENABLED: 1 @@ -29,7 +29,7 @@ jobs: sudo apt install -y gcc-multilib g++-multilib shell: bash - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} - name: Checkout code @@ -40,9 +40,9 @@ jobs: test-arm64: strategy: matrix: - go: [1.18.x, 1.19.x, 1.20.x, 1.21.x] + go: [1.21.x, 1.22.x, 1.23.x] - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest env: CGO_ENABLED: 1 GOOS: linux @@ -73,7 +73,7 @@ jobs: libsqlite3-dev:arm64 \ file - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} - name: Checkout code @@ -98,7 +98,7 @@ jobs: if: success() uses: actions/setup-go@v4 with: - go-version: 1.21.x + go-version: 1.23.x - name: Checkout code uses: actions/checkout@v4 - name: Calc coverage @@ -107,7 +107,7 @@ jobs: - name: Convert coverage.out to coverage.lcov uses: jandelgado/gcov2lcov-action@v1.0.9 - name: Coveralls - uses: coverallsapp/github-action@v2.2.3 + uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.github_token }} path-to-lcov: coverage.lcov diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e9e334..1d06757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ # Changelog -## 0.11.0 (in development) +## 0.11.0 - support returning missing image tiles as HTTP 404 instead of blank tiles using the `--missing-image-tile-404` option (#177). +### Breaking changes +- now requires Go 1.21+ (per Go version policy). ## 0.10.0 diff --git a/Dockerfile b/Dockerfile index 8ba301b..37cb391 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: compile mbtileserver -FROM golang:1.21-alpine3.18 +FROM golang:1.23-alpine3.20 WORKDIR / RUN apk add git build-base @@ -9,7 +9,7 @@ RUN GOOS=linux go build -o /mbtileserver # Stage 2: start from a smaller image -FROM alpine:3.17 +FROM alpine:3.20 WORKDIR / diff --git a/LICENSE b/LICENSE index 5c4028d..6f436cf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2022, Conservation Biology Institute +Copyright (c) 2014-2024, Conservation Biology Institute Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/README.md b/README.md index cce0fe3..bf7f7de 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ virtual machine without any issues. ## Supported Go versions -_Requires Go >= 1.18+._ +_Requires Go >= 1.21+._ -`mbtileserver` uses go modules and follows standard practices as of Go 1.18. +`mbtileserver` uses go modules and follows standard practices as of Go 1.21. ## Installation @@ -504,8 +504,8 @@ go build -a . to make subsequent builds much faster. -Development of the templates and static assets likely requires using -`node` and `npm`. Install these tools in the normal way. +Development of the templates and static assets requires using +NodeJS 20 and `npm`. Install these tools in the normal way. From the `handlers/templates/static` folder, run diff --git a/go.mod b/go.mod index 1566ad8..b09089c 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module github.com/consbio/mbtileserver require ( - github.com/brendan-ward/mbtiles-go v0.1.1-0.20230310232339-6c48cea51706 + github.com/brendan-ward/mbtiles-go v0.2.0 github.com/evalphobia/logrus_sentry v0.8.2 - github.com/fsnotify/fsnotify v1.6.0 - github.com/labstack/echo/v4 v4.11.2 + github.com/fsnotify/fsnotify v1.7.0 + github.com/labstack/echo/v4 v4.12.0 github.com/sirupsen/logrus v1.9.3 - github.com/spf13/cobra v1.7.0 - golang.org/x/crypto v0.14.0 + github.com/spf13/cobra v1.8.1 + golang.org/x/crypto v0.27.0 ) require ( @@ -16,17 +16,17 @@ require ( github.com/getsentry/raven-go v0.2.0 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/labstack/gommon v0.4.0 // indirect + github.com/labstack/gommon v0.4.2 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - golang.org/x/time v0.3.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/time v0.6.0 // indirect ) -go 1.18 +go 1.21 diff --git a/go.sum b/go.sum index bedb814..e953241 100644 --- a/go.sum +++ b/go.sum @@ -2,40 +2,31 @@ crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797 h1:yDf7ARQc637HoxDho7xjqdvO5Z crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk= crawshaw.io/sqlite v0.3.3-0.20220618202545-d1964889ea3c h1:wvzox0eLO6CKQAMcOqz7oH3UFqMpMmK7kwmwV+22HIs= crawshaw.io/sqlite v0.3.3-0.20220618202545-d1964889ea3c/go.mod h1:igAO5JulrQ1DbdZdtVq48mnZUBAPOeFzer7VhDWNtW4= -github.com/brendan-ward/mbtiles-go v0.1.1-0.20230310232339-6c48cea51706 h1:iyeXsLE2k04cfilGLUm2irLkEwTnQFF8diTy87TXhpQ= -github.com/brendan-ward/mbtiles-go v0.1.1-0.20230310232339-6c48cea51706/go.mod h1:6DAwYFi5s/wfKoDGLYfSlZ6Qx0AupAJd+AvTMLi61yw= +github.com/brendan-ward/mbtiles-go v0.2.0 h1:jtSbOrmkMEOUD1kY02UIuKHjE9sR4nevQaMRlHmz0bU= +github.com/brendan-ward/mbtiles-go v0.2.0/go.mod h1:dzvwuJtq2SurdmdLtkgGO4Zmhb49zmVO9gGyPUxBYc0= github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d h1:S2NE3iHSwP0XV47EEXL8mWmRdEfGscSJ+7EgePNgt0s= github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/evalphobia/logrus_sentry v0.8.2 h1:dotxHq+YLZsT1Bb45bB5UQbfCh3gM/nFFetyN46VoDQ= github.com/evalphobia/logrus_sentry v0.8.2/go.mod h1:pKcp+vriitUqu9KiWj/VRFbRfFNUwz95/UkgG8a6MNc= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/getsentry/raven-go v0.2.0 h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M= -github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k= -github.com/labstack/echo/v4 v4.11.2 h1:T+cTLQxWCDfqDEoydYm5kCobjmHwOwcv4OJAPHilmdE= -github.com/labstack/echo/v4 v4.11.2/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws= -github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= -github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/labstack/echo/v4 v4.12.0 h1:IKpw49IMryVB2p1a4dzwlhP1O2Tf2E0Ir/450lH+kI0= +github.com/labstack/echo/v4 v4.12.0/go.mod h1:UP9Cr2DJXbOK3Kr9ONYzNowSh7HP0aG0ShAyycHSJvM= +github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= +github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -43,51 +34,34 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/handlers/templates/static/.nvmrc b/handlers/templates/static/.nvmrc new file mode 100644 index 0000000..2edeafb --- /dev/null +++ b/handlers/templates/static/.nvmrc @@ -0,0 +1 @@ +20 \ No newline at end of file diff --git a/handlers/templates/static/dist/index.css b/handlers/templates/static/dist/index.css index 7b3f4b3..51c0b81 100644 --- a/handlers/templates/static/dist/index.css +++ b/handlers/templates/static/dist/index.css @@ -1 +1 @@ -.maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999} +.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:#0006;color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999} diff --git a/handlers/templates/static/dist/index.js b/handlers/templates/static/dist/index.js index bef05f3..679adf0 100644 --- a/handlers/templates/static/dist/index.js +++ b/handlers/templates/static/dist/index.js @@ -1,5 +1,5 @@ -(()=>{var yl=(rt,St)=>()=>(St||rt((St={exports:{}}).exports,St),St.exports);var fu=yl((zc,Mc)=>{(function(rt,St){typeof zc=="object"&&typeof Mc<"u"?Mc.exports=St():typeof define=="function"&&define.amd?define(St):(rt=typeof globalThis<"u"?globalThis:rt||self,rt.maplibregl=St())})(zc,function(){"use strict";var rt,St,Ct;function Kt(c,Wt){if(!rt)rt=Wt;else if(!St)St=Wt;else{var te="var sharedChunk = {}; ("+rt+")(sharedChunk); ("+St+")(sharedChunk);",Fe={};rt(Fe),Ct=Wt(Fe),typeof window<"u"&&(Ct.workerUrl=window.URL.createObjectURL(new Blob([te],{type:"text/javascript"})))}}Kt(["exports"],function(c){"use strict";function Wt(i,e,r,a){return new(r||(r=Promise))(function(o,u){function d(x){try{_(a.next(x))}catch(b){u(b)}}function m(x){try{_(a.throw(x))}catch(b){u(b)}}function _(x){var b;x.done?o(x.value):(b=x.value,b instanceof r?b:new r(function(T){T(b)})).then(d,m)}_((a=a.apply(i,e||[])).next())})}function te(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Fe=Pe;function Pe(i,e){this.x=i,this.y=e}Pe.prototype={clone:function(){return new Pe(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),o=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Pe.convert=function(i){return i instanceof Pe?i:Array.isArray(i)?new Pe(i[0],i[1]):i};var xe=te(Fe),Et=ii;function ii(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=a}ii.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)o?d=r:m=r,r=.5*(m-d)+d;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Yt=te(Et);let st,Ye;function At(){return st==null&&(st=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),st}function zt(){if(Ye==null&&(Ye=!1,At())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<5*5;a++){let o=4*a;e.fillStyle=`rgb(${o},${o+1},${o+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}let r=e.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&r[a]!==a){Ye=!0;break}}}return Ye||!1}function Ii(i,e,r,a){let o=new Yt(i,e,r,a);return function(u){return o.solve(u)}}let xr=Ii(.25,.1,.25,1);function ar(i,e,r){return Math.min(r,Math.max(e,i))}function qn(i,e,r){let a=r-e,o=((i-e)%a+a)%a+e;return o===e?r:o}function Jt(i,...e){for(let r of e)for(let a in r)i[a]=r[a];return i}let xa=1;function Tt(i,e,r){let a={};for(let o in i)a[o]=e.call(r||this,i[o],o,i);return a}function mn(i,e,r){let a={};for(let o in i)e.call(r||this,i[o],o,i)&&(a[o]=i[o]);return a}function Ki(i){return Array.isArray(i)?i.map(Ki):typeof i=="object"&&i?Tt(i,Ki):i}let kr={};function li(i){kr[i]||(typeof console<"u"&&console.warn(i),kr[i]=!0)}function Ci(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function vr(i){let e=0;for(let r,a,o=0,u=i.length,d=u-1;o"u")throw new Error("VideoFrame not supported");let u=new VideoFrame(i,{timestamp:0});try{let d=u?.format;if(!d||!d.startsWith("BGR")&&!d.startsWith("RGB"))throw new Error(`Unrecognized format ${d}`);let m=d.startsWith("BGR"),_=new Uint8ClampedArray(a*o*4);if(yield u.copyTo(_,function(x,b,T,I,z){let M=4*Math.max(-b,0),L=(Math.max(0,T)-T)*I*4+M,V=4*I,$=Math.max(0,b),W=Math.max(0,T);return{rect:{x:$,y:W,width:Math.min(x.width,b+I)-$,height:Math.min(x.height,T+z)-W},layout:[{offset:L,stride:V}]}}(i,e,r,a,o)),m)for(let x=0;x<_.length;x+=4){let b=_[x];_[x]=_[x+2],_[x+2]=b}return _}finally{u.close()}})}let mt,ci,Lr,Hr,fn={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){let e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){let e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(Lr||(Lr=document.createElement("a")),Lr.href=i,Lr.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Hr==null&&(Hr=matchMedia("(prefers-reduced-motion: reduce)")),Hr.matches)}},gn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class ji extends Error{constructor(e,r,a,o){super(`AJAXError: ${r} (${e}): ${a}`),this.status=e,this.statusText=r,this.url=a,this.body=o}}let Ai=Zi()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Gn=i=>gn.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function Wr(i,e){let r=new AbortController,a=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:Ai(),signal:r.signal}),o=!1,u=!1;return i.type==="json"&&a.headers.set("Accept","application/json"),u||fetch(a).then(d=>d.ok?(m=>{(i.type==="arrayBuffer"||i.type==="image"?m.arrayBuffer():i.type==="json"?m.json():m.text()).then(_=>{u||(o=!0,e(null,_,m.headers.get("Cache-Control"),m.headers.get("Expires")))}).catch(_=>{u||e(new Error(_.message))})})(d):d.blob().then(m=>e(new ji(d.status,d.statusText,i.url,m)))).catch(d=>{d.code!==20&&e(new Error(d.message))}),{cancel:()=>{u=!0,o||r.abort()}}}let _n=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Zi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Zi())return(Gn(i.url)||Wr)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(Ai())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Wr(i,e);if(Zi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(a,o){let u=new XMLHttpRequest;u.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(u.responseType="arraybuffer");for(let d in a.headers)u.setRequestHeader(d,a.headers[d]);return a.type==="json"&&(u.responseType="text",u.setRequestHeader("Accept","application/json")),u.withCredentials=a.credentials==="include",u.onerror=()=>{o(new Error(u.statusText))},u.onload=()=>{if((u.status>=200&&u.status<300||u.status===0)&&u.response!==null){let d=u.response;if(a.type==="json")try{d=JSON.parse(u.response)}catch(m){return o(m)}o(null,d,u.getResponseHeader("Cache-Control"),u.getResponseHeader("Expires"))}else{let d=new Blob([u.response],{type:u.getResponseHeader("Content-Type")});o(new ji(u.status,u.statusText,a.url,d))}},u.send(a.body),{cancel:()=>u.abort()}}(i,e)},br=function(i,e){return _n(Jt(i,{type:"arrayBuffer"}),e)};function yn(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;let e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function xn(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function Kr(i,e,r){if(r&&r[i]){let a=r[i].indexOf(e);a!==-1&&r[i].splice(a,1)}}class wr{constructor(e,r={}){Jt(this,r),this.type=e}}class Yr extends wr{constructor(e,r={}){super("error",Jt({error:e},r))}}class vn{on(e,r){return this._listeners=this._listeners||{},xn(e,r,this._listeners),this}off(e,r){return Kr(e,r,this._listeners),Kr(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},xn(e,r,this._oneTimeListeners),this):new Promise(a=>this.once(e,a))}fire(e,r){typeof e=="string"&&(e=new wr(e,r||{}));let a=e.type;if(this.listens(a)){e.target=this;let o=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(let m of o)m.call(this,e);let u=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(let m of u)Kr(a,m,this._oneTimeListeners),m.call(this,e);let d=this._eventedParent;d&&(Jt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(e))}else e instanceof Yr&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var re={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let zi=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function va(i,e){let r={};for(let a in i)a!=="ref"&&(r[a]=i[a]);return zi.forEach(a=>{a in e&&(r[a]=e[a])}),r}function ot(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}let X=[lr,ge,Ne,$e,hi,R,cr,F(qe),S,C,P];function j(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!j(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(let r of X)if(!j(r,e))return null}}return`Expected ${N(i)} but found ${N(e)} instead.`}function q(i,e){return e.some(r=>r.kind===i.kind)}function K(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function ne(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}let oe=.96422,le=.82521,De=4/29,Oe=6/29,Ae=3*Oe*Oe,ke=Oe*Oe*Oe,Ze=Math.PI/180,at=180/Math.PI;function ct(i){return(i%=360)<0&&(i+=360),i}function tt([i,e,r,a]){let o,u,d=ri((.2225045*(i=Qe(i))+.7168786*(e=Qe(e))+.0606169*(r=Qe(r)))/1);i===e&&e===r?o=u=d:(o=ri((.4360747*i+.3850649*e+.1430804*r)/oe),u=ri((.0139322*i+.0971045*e+.7141733*r)/le));let m=116*d-16;return[m<0?0:m,500*(o-d),200*(d-u),a]}function Qe(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function ri(i){return i>ke?Math.pow(i,1/3):i/Ae+De}function dt([i,e,r,a]){let o=(i+16)/116,u=isNaN(e)?o:o+e/500,d=isNaN(r)?o:o-r/200;return o=1*Vt(o),u=oe*Vt(u),d=le*Vt(d),[kt(3.1338561*u-1.6168667*o-.4906146*d),kt(-.9787684*u+1.9161415*o+.033454*d),kt(.0719453*u-.2289914*o+1.4052427*d),a]}function kt(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function Vt(i){return i>Oe?i*i*i:Ae*(i-De)}function Br(i){return parseInt(i.padEnd(2,i),16)/255}function yo(i,e){return hr(e?i/100:i,0,1)}function hr(i,e,r){return Math.min(Math.max(e,i),r)}function xo(i){return!i.some(Number.isNaN)}let xl={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class lt{constructor(e,r,a,o=1,u=!0){this.r=e,this.g=r,this.b=a,this.a=o,u||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[e,r,a,o]))}static parse(e){if(e instanceof lt)return e;if(typeof e!="string")return;let r=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];let o=xl[a];if(o){let[d,m,_]=o;return[d/255,m/255,_/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){let d=a.length<6?1:2,m=1;return[Br(a.slice(m,m+=d)),Br(a.slice(m,m+=d)),Br(a.slice(m,m+=d)),Br(a.slice(m,m+d)||"ff")]}if(a.startsWith("rgb")){let d=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){let[m,_,x,b,T,I,z,M,L,V,$,W]=d,Z=[b||" ",z||" ",V].join("");if(Z===" "||Z===" /"||Z===",,"||Z===",,,"){let Y=[x,I,L].join(""),Q=Y==="%%%"?100:Y===""?255:0;if(Q){let se=[hr(+_/Q,0,1),hr(+T/Q,0,1),hr(+M/Q,0,1),$?yo(+$,W):1];if(xo(se))return se}}return}}let u=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){let[d,m,_,x,b,T,I,z,M]=u,L=[_||" ",b||" ",I].join("");if(L===" "||L===" /"||L===",,"||L===",,,"){let V=[+m,hr(+x,0,100),hr(+T,0,100),z?yo(+z,M):1];if(xo(V))return function([$,W,Z,Y]){function Q(se){let be=(se+$/30)%12,Ie=W*Math.min(Z,1-Z);return Z-Ie*Math.max(-1,Math.min(be-3,9-be,1))}return $=ct($),W/=100,Z/=100,[Q(0),Q(8),Q(4),Y]}(V)}}}(e);return r?new lt(...r,!1):void 0}get rgb(){let{r:e,g:r,b:a,a:o}=this,u=o||1/0;return this.overwriteGetter("rgb",[e/u,r/u,a/u,o])}get hcl(){return this.overwriteGetter("hcl",function(e){let[r,a,o,u]=tt(e),d=Math.sqrt(a*a+o*o);return[Math.round(1e4*d)?ct(Math.atan2(o,a)*at):NaN,d,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",tt(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,a,o]=this.rgb;return`rgba(${[e,r,a].map(u=>Math.round(255*u)).join(",")},${o})`}}lt.black=new lt(0,0,0,1),lt.white=new lt(1,1,1,1),lt.transparent=new lt(0,0,0,0),lt.red=new lt(1,0,0,1);class wa{constructor(e,r,a){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class wn{constructor(e,r,a,o,u){this.text=e,this.image=r,this.scale=a,this.fontStack=o,this.textColor=u}}class Mi{constructor(e){this.sections=e}static fromString(e){return new Mi([new wn(e,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 Mi?e:Mi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class Pi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Pi)return e;if(typeof e=="number")return new Pi([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="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 Pi(e)}}toString(){return JSON.stringify(this.values)}}let vl=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Qt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Qt)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,e,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,e,r,a]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Rr(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof lt||i instanceof wa||i instanceof Mi||i instanceof Pi||i instanceof Qt||i instanceof xi)return!0;if(Array.isArray(i)){for(let e of i)if(!Rr(e))return!1;return!0}if(typeof i=="object"){for(let e in i)if(!Rr(i[e]))return!1;return!0}return!1}function Ue(i){if(i===null)return lr;if(typeof i=="string")return Ne;if(typeof i=="boolean")return $e;if(typeof i=="number")return ge;if(i instanceof lt)return hi;if(i instanceof wa)return tn;if(i instanceof Mi)return R;if(i instanceof Pi)return S;if(i instanceof Qt)return P;if(i instanceof xi)return C;if(Array.isArray(i)){let e=i.length,r;for(let a of i){let o=Ue(a);if(r){if(r===o)continue;r=qe;break}r=o}return F(r||qe,e)}return cr}function Xn(i){let e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof lt||i instanceof Mi||i instanceof Pi||i instanceof Qt||i instanceof xi?i.toString():JSON.stringify(i)}class Er{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Rr(e[1]))return r.error("invalid value");let a=e[1],o=Ue(a),u=r.expectedType;return o.kind!=="array"||o.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(o=u),new Er(o,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Dt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}let Hn={string:Ne,number:ge,boolean:$e,object:cr};class Gi{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a,o=1,u=e[0];if(u==="array"){let m,_;if(e.length>2){let x=e[1];if(typeof x!="string"||!(x in Hn)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=Hn[x],o++}else m=qe;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=e[2],o++}a=F(m,_)}else{if(!Hn[u])throw new Error(`Types doesn't contain name = ${u}`);a=Hn[u]}let d=[];for(;oe.outputDefined())}}let vo={"to-boolean":$e,"to-color":hi,"to-number":ge,"to-string":Ne};class Tr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a=e[0];if(!vo[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&e.length!==2)return r.error("Expected one argument.");let o=vo[a],u=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Ea(r[0],r[1],r[2],r[3]),!a))return new lt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Dt(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(let a of this.args){r=a.evaluate(e);let o=Pi.parse(r);if(o)return o}throw new Dt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(let a of this.args){r=a.evaluate(e);let o=Qt.parse(r);if(o)return o}throw new Dt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(let a of this.args){if(r=a.evaluate(e),r===null)return 0;let o=Number(r);if(!isNaN(o))return o}throw new Dt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Mi.fromString(Xn(this.args[0].evaluate(e)));case"resolvedImage":return xi.fromString(Xn(this.args[0].evaluate(e)));default:return Xn(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}let bo=["Unknown","Point","LineString","Polygon"];class wo{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?bo[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 r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=lt.parse(e)),r}}class Ta{constructor(e,r,a=[],o,u=new en,d=[]){this.registry=e,this.path=a,this.key=a.map(m=>`[${m}]`).join(""),this.scope=u,this.errors=d,this.expectedType=o,this._isConstant=r}parse(e,r,a,o,u={}){return r?this.concat(r,a,o)._parse(e,u):this._parse(e,u)}_parse(e,r){function a(o,u,d){return d==="assert"?new Gi(u,[o]):d==="coerce"?new Tr(u,[o]):o}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", []].');let o=e[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let u=this.registry[o];if(u){let d=u.parse(e,this);if(!d)return null;if(this.expectedType){let m=this.expectedType,_=d.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||_.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||_.kind!=="value"&&_.kind!=="string")if(m.kind!=="padding"||_.kind!=="value"&&_.kind!=="number"&&_.kind!=="array")if(m.kind!=="variableAnchorOffsetCollection"||_.kind!=="value"&&_.kind!=="array"){if(this.checkSubtype(m,_))return null}else d=a(d,m,r.typeAnnotation||"coerce");else d=a(d,m,r.typeAnnotation||"coerce");else d=a(d,m,r.typeAnnotation||"coerce");else d=a(d,m,r.typeAnnotation||"assert")}if(!(d instanceof Er)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){let m=new wo;try{d=new Er(d.type,d.evaluate(m))}catch(_){return this.error(_.message),null}}return d}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(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,r,a){let o=typeof e=="number"?this.path.concat(e):this.path,u=a?this.scope.concat(a):this.scope;return new Ta(this.registry,this._isConstant,o,r||null,u,this.errors)}error(e,...r){let a=`${this.key}${r.map(o=>`[${o}]`).join("")}`;this.errors.push(new yi(a,e))}checkSubtype(e,r){let a=j(e,r);return a&&this.error(a),a}}class Sa{constructor(e,r,a){this.type=tn,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let a=e[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");let o=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,$e);if(!o)return null;let u=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,$e);if(!u)return null;let d=null;return a.locale&&(d=r.parse(a.locale,1,Ne),!d)?null:new Sa(o,u,d)}evaluate(e){return new wa(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}}let Fr=8192;function Ia(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function Wn(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function bl(i,e){let r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(r*o*Fr),Math.round(a*o*Fr)]}function wl(i,e,r){let a=i[0]-e[0],o=i[1]-e[1],u=i[0]-r[0],d=i[1]-r[1];return a*d-u*o==0&&a*u<=0&&o*d<=0}function Kn(i,e){let r=!1;for(let d=0,m=e.length;d(a=i)[1]!=(u=_[x+1])[1]>a[1]&&a[0]<(u[0]-o[0])*(a[1]-o[1])/(u[1]-o[1])+o[0]&&(r=!r)}}var a,o,u;return r}function El(i,e){for(let r=0;r0&&m<0||d<0&&m>0}function Tl(i,e,r){for(let x of r)for(let b=0;br[2]){let o=.5*a,u=i[0]-r[0]>o?-a:r[0]-i[0]>o?a:0;u===0&&(u=i[0]-r[2]>o?-a:r[2]-i[0]>o?a:0),i[0]+=u}Ia(e,i)}function ms(i,e,r,a){let o=Math.pow(2,a.z)*Fr,u=[a.x*Fr,a.y*Fr],d=[];for(let m of i)for(let _ of m){let x=[_.x+u[0],_.y+u[1]];ds(x,e,r,o),d.push(x)}return d}function Io(i,e,r,a){let o=Math.pow(2,a.z)*Fr,u=[a.x*Fr,a.y*Fr],d=[];for(let _ of i){let x=[];for(let b of _){let T=[b.x+u[0],b.y+u[1]];Ia(e,T),x.push(T)}d.push(x)}if(e[2]-e[0]<=o/2){(m=e)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(let _ of d)for(let x of _)ds(x,e,r,o)}var m;return d}class rn{constructor(e,r){this.type=$e,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Rr(e[1])){let a=e[1];if(a.type==="FeatureCollection")for(let o=0;o!Array.isArray(x)||x.length===e.length-1),_=null;for(let[x,b]of m){_=new Ta(r.registry,Aa,r.path,null,r.scope);let T=[],I=!1;for(let z=1;z{return I=T,Array.isArray(I)?`(${I.map(N).join(", ")})`:`(${N(I.type)}...)`;var I}).join(" | "),b=[];for(let T=1;T{r=e?r&&Aa(a):r&&a instanceof Er}),!!r&&za(i)&&En(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function za(i){if(i instanceof Xi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof rn)return!1;let e=!0;return i.eachChild(r=>{e&&!za(r)&&(e=!1)}),e}function Yn(i){if(i instanceof Xi&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!Yn(r)&&(e=!1)}),e}function En(i,e){if(i instanceof Xi&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(a=>{r&&!En(a,e)&&(r=!1)}),r}function nn(i,e){let r=i.length-1,a,o,u=0,d=r,m=0;for(;u<=d;)if(m=Math.floor((u+d)/2),a=i[m],o=i[m+1],a<=e){if(m===r||ee))throw new Dt("Input is not a number.");d=m-1}return 0}class it{constructor(e,r,a){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(let[o,u]of a)this.labels.push(o),this.outputs.push(u)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");let a=r.parse(e[1],1,ge);if(!a)return null;let o=[],u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let d=1;d=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);let T=r.parse(_,b,u);if(!T)return null;u=u||T.type,o.push([m,T])}return new it(u,a,o)}evaluate(e){let r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);let o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);let u=r.length;return o>=r[u-1]?a[u-1].evaluate(e):a[nn(r,o)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function an(i,e,r){return i+r*(e-i)}function Ma(i,e,r){return i.map((a,o)=>an(a,e[o],r))}let ki={number:an,color:function(i,e,r,a="rgb"){switch(a){case"rgb":{let[o,u,d,m]=Ma(i.rgb,e.rgb,r);return new lt(o,u,d,m,!1)}case"hcl":{let[o,u,d,m]=i.hcl,[_,x,b,T]=e.hcl,I,z;if(isNaN(o)||isNaN(_))isNaN(o)?isNaN(_)?I=NaN:(I=_,d!==1&&d!==0||(z=x)):(I=o,b!==1&&b!==0||(z=u));else{let W=_-o;_>o&&W>180?W-=360:_180&&(W+=360),I=o+r*W}let[M,L,V,$]=function([W,Z,Y,Q]){return W=isNaN(W)?0:W*Ze,dt([Y,Math.cos(W)*Z,Math.sin(W)*Z,Q])}([I,z??an(u,x,r),an(d,b,r),an(m,T,r)]);return new lt(M,L,V,$,!1)}case"lab":{let[o,u,d,m]=dt(Ma(i.lab,e.lab,r));return new lt(o,u,d,m,!1)}}},array:Ma,padding:function(i,e,r){return new Pi(Ma(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){let a=i.values,o=e.values;if(a.length!==o.length)throw new Dt(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);let u=[];for(let d=0;dtypeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:x}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,ge),!u)return null;let m=[],_=null;a==="interpolate-hcl"||a==="interpolate-lab"?_=hi:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',I);let M=r.parse(T,z,_);if(!M)return null;_=_||M.type,m.push([b,M])}return ne(_,ge)||ne(_,hi)||ne(_,S)||ne(_,P)||ne(_,F(ge))?new Di(_,a,o,u,m):r.error(`Type ${N(_)} is not interpolatable.`)}evaluate(e){let r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);let o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);let u=r.length;if(o>=r[u-1])return a[u-1].evaluate(e);let d=nn(r,o),m=Di.interpolationFactor(this.interpolation,o,r[d],r[d+1]),_=a[d].evaluate(e),x=a[d+1].evaluate(e);switch(this.operator){case"interpolate":return ki[this.type.kind](_,x,m);case"interpolate-hcl":return ki.color(_,x,m,"hcl");case"interpolate-lab":return ki.color(_,x,m,"lab")}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function fs(i,e,r,a){let o=a-r,u=i-r;return o===0?0:e===1?u/o:(Math.pow(e,u)-1)/(Math.pow(e,o)-1)}class Pa{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let a=null,o=r.expectedType;o&&o.kind!=="value"&&(a=o);let u=[];for(let m of e.slice(1)){let _=r.parse(m,1+u.length,a,void 0,{typeAnnotation:"omit"});if(!_)return null;a=a||_.type,u.push(_)}if(!a)throw new Error("No output type");let d=o&&u.some(m=>j(o,m.type));return new Pa(d?qe:a,u)}evaluate(e){let r,a=null,o=0;for(let u of this.args)if(o++,a=u.evaluate(e),a&&a instanceof xi&&!a.available&&(r||(r=a.name),a=null,o===this.args.length&&(a=r)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class ka{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let a=[];for(let u=1;u=a.length)throw new Dt(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new Dt(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class _s{constructor(e,r){this.type=$e,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let a=r.parse(e[1],1,qe),o=r.parse(e[2],2,qe);return a&&o?q(a.type,[$e,Ne,ge,lr,qe])?new _s(a,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(a.type)} instead`):null}evaluate(e){let r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!K(r,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${N(Ue(r))} instead.`);if(!K(a,["string","array"]))throw new Dt(`Expected second argument to be of type array or string, but found ${N(Ue(a))} instead.`);return a.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Da{constructor(e,r,a){this.type=ge,this.needle=e,this.haystack=r,this.fromIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let a=r.parse(e[1],1,qe),o=r.parse(e[2],2,qe);if(!a||!o)return null;if(!q(a.type,[$e,Ne,ge,lr,qe]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(a.type)} instead`);if(e.length===4){let u=r.parse(e[3],3,ge);return u?new Da(a,o,u):null}return new Da(a,o)}evaluate(e){let r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!K(r,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${N(Ue(r))} instead.`);if(!K(a,["string","array"]))throw new Dt(`Expected second argument to be of type array or string, but found ${N(Ue(a))} instead.`);if(this.fromIndex){let o=this.fromIndex.evaluate(e);return a.indexOf(r,o)}return a.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class ys{constructor(e,r,a,o,u,d){this.inputType=e,this.type=r,this.input=a,this.cases=o,this.outputs=u,this.otherwise=d}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let a,o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);let u={},d=[];for(let x=2;xNumber.MAX_SAFE_INTEGER)return I.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof M=="number"&&Math.floor(M)!==M)return I.error("Numeric branch labels must be integer values.");if(a){if(I.checkSubtype(a,Ue(M)))return null}else a=Ue(M);if(u[String(M)]!==void 0)return I.error("Branch labels must be unique.");u[String(M)]=d.length}let z=r.parse(T,x,o);if(!z)return null;o=o||z.type,d.push(z)}let m=r.parse(e[1],1,qe);if(!m)return null;let _=r.parse(e[e.length-1],e.length-1,o);return _?m.type.kind!=="value"&&r.concat(1).checkSubtype(a,m.type)?null:new ys(a,o,m,u,d,_):null}evaluate(e){let r=this.input.evaluate(e);return(Ue(r)===this.inputType&&this.outputs[this.cases[r]]||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 xs{constructor(e,r,a){this.type=e,this.branches=r,this.otherwise=a}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);let o=[];for(let d=1;dr.outputDefined())&&this.otherwise.outputDefined()}}class La{constructor(e,r,a,o){this.type=e,this.input=r,this.beginIndex=a,this.endIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let a=r.parse(e[1],1,qe),o=r.parse(e[2],2,ge);if(!a||!o)return null;if(!q(a.type,[F(qe),Ne,qe]))return r.error(`Expected first argument to be of type array or string, but found ${N(a.type)} instead`);if(e.length===4){let u=r.parse(e[3],3,ge);return u?new La(a.type,a,o,u):null}return new La(a.type,a,o)}evaluate(e){let r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!K(r,["string","array"]))throw new Dt(`Expected first argument to be of type array or string, but found ${N(Ue(r))} instead.`);if(this.endIndex){let o=this.endIndex.evaluate(e);return r.slice(a,o)}return r.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Co(i,e){return i==="=="||i==="!="?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 Ao(i,e,r,a){return a.compare(e,r)===0}function Tn(i,e,r){let a=i!=="=="&&i!=="!=";return class mu{constructor(u,d,m){this.type=$e,this.lhs=u,this.rhs=d,this.collator=m,this.hasUntypedArgument=u.type.kind==="value"||d.type.kind==="value"}static parse(u,d){if(u.length!==3&&u.length!==4)return d.error("Expected two or three arguments.");let m=u[0],_=d.parse(u[1],1,qe);if(!_)return null;if(!Co(m,_.type))return d.concat(1).error(`"${m}" comparisons are not supported for type '${N(_.type)}'.`);let x=d.parse(u[2],2,qe);if(!x)return null;if(!Co(m,x.type))return d.concat(2).error(`"${m}" comparisons are not supported for type '${N(x.type)}'.`);if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${N(_.type)}' and '${N(x.type)}'.`);a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new Gi(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Gi(_.type,[x])));let b=null;if(u.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(u[3],3,tn),!b)return null}return new mu(_,x,b)}evaluate(u){let d=this.lhs.evaluate(u),m=this.rhs.evaluate(u);if(a&&this.hasUntypedArgument){let _=Ue(d),x=Ue(m);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new Dt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){let _=Ue(d),x=Ue(m);if(_.kind!=="string"||x.kind!=="string")return e(u,d,m)}return this.collator?r(u,d,m,this.collator.evaluate(u)):e(u,d,m)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}let Sl=Tn("==",function(i,e,r){return e===r},Ao),Il=Tn("!=",function(i,e,r){return e!==r},function(i,e,r,a){return!Ao(0,e,r,a)}),Cl=Tn("<",function(i,e,r){return e",function(i,e,r){return e>r},function(i,e,r,a){return a.compare(e,r)>0}),zl=Tn("<=",function(i,e,r){return e<=r},function(i,e,r,a){return a.compare(e,r)<=0}),Ml=Tn(">=",function(i,e,r){return e>=r},function(i,e,r,a){return a.compare(e,r)>=0});class vs{constructor(e,r,a,o,u){this.type=Ne,this.number=e,this.locale=r,this.currency=a,this.minFractionDigits=o,this.maxFractionDigits=u}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let a=r.parse(e[1],1,ge);if(!a)return null;let o=e[2];if(typeof o!="object"||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let u=null;if(o.locale&&(u=r.parse(o.locale,1,Ne),!u))return null;let d=null;if(o.currency&&(d=r.parse(o.currency,1,Ne),!d))return null;let m=null;if(o["min-fraction-digits"]&&(m=r.parse(o["min-fraction-digits"],1,ge),!m))return null;let _=null;return o["max-fraction-digits"]&&(_=r.parse(o["max-fraction-digits"],1,ge),!_)?null:new vs(a,u,d,m,_)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Ba{constructor(e){this.type=R,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a=e[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");let o=[],u=!1;for(let d=1;d<=e.length-1;++d){let m=e[d];if(u&&typeof m=="object"&&!Array.isArray(m)){u=!1;let _=null;if(m["font-scale"]&&(_=r.parse(m["font-scale"],1,ge),!_))return null;let x=null;if(m["text-font"]&&(x=r.parse(m["text-font"],1,F(Ne)),!x))return null;let b=null;if(m["text-color"]&&(b=r.parse(m["text-color"],1,hi),!b))return null;let T=o[o.length-1];T.scale=_,T.font=x,T.textColor=b}else{let _=r.parse(e[d],1,qe);if(!_)return null;let x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,o.push({content:_,scale:null,font:null,textColor:null})}}return new Ba(o)}evaluate(e){return new Mi(this.sections.map(r=>{let a=r.content.evaluate(e);return Ue(a)===C?new wn("",a,null,null,null):new wn(Xn(a),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class bs{constructor(e){this.type=C,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let a=r.parse(e[1],1,Ne);return a?new bs(a):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),a=xi.fromString(r);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(r)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class ws{constructor(e){this.type=ge,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let a=r.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${N(a.type)} instead.`):new ws(a):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Dt(`Expected value to be of type string or array, but found ${N(Ue(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let Sn={"==":Sl,"!=":Il,">":Al,"<":Cl,">=":Ml,"<=":zl,array:Gi,at:gs,boolean:Gi,case:xs,coalesce:Pa,collator:Sa,format:Ba,image:bs,in:_s,"index-of":Da,interpolate:Di,"interpolate-hcl":Di,"interpolate-lab":Di,length:ws,let:ka,literal:Er,match:ys,number:Gi,"number-format":vs,object:Gi,slice:La,step:it,string:Gi,"to-boolean":Tr,"to-color":Tr,"to-number":Tr,"to-string":Tr,var:Ca,within:rn};function zo(i,[e,r,a,o]){e=e.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);let u=o?o.evaluate(i):1,d=Ea(e,r,a,u);if(d)throw new Dt(d);return new lt(e/255,r/255,a/255,u,!1)}function Mo(i,e){return i in e}function Es(i,e){let r=e[i];return r===void 0?null:r}function sn(i){return{type:i}}function Ra(i){return{result:"success",value:i}}function In(i){return{result:"error",value:i}}function Cn(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Po(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Ts(i){return!!i.expression&&i.expression.interpolated}function Ve(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Fa(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function et(i){return i}function Oa(i,e){let r=e.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",o=a||!(a||i.property!==void 0),u=i.type||(Ts(e)?"exponential":"interval");if(r||e.type==="padding"){let b=r?lt.parse:Pi.parse;(i=$t({},i)).stops&&(i.stops=i.stops.map(T=>[T[0],b(T[1])])),i.default=b(i.default?i.default:e.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let m,_,x;if(u==="exponential")m=Ss;else if(u==="interval")m=Va;else if(u==="categorical"){m=_t,_=Object.create(null);for(let b of i.stops)_[b[0]]=b[1];x=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);m=Pl}if(a){let b={},T=[];for(let M=0;MM[0]),evaluate:({zoom:M},L)=>Ss({stops:I,base:i.base},e,M).evaluate(M,L)}}if(o){let b=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:Di.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(T=>T[0]),evaluate:({zoom:T})=>m(i,e,T,_,x)}}return{kind:"source",evaluate(b,T){let I=T&&T.properties?T.properties[i.property]:void 0;return I===void 0?ut(i.default,e.default):m(i,e,I,_,x)}}}function ut(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function _t(i,e,r,a,o){return ut(typeof r===o?a[r]:void 0,i.default,e.default)}function Va(i,e,r){if(Ve(r)!=="number")return ut(i.default,e.default);let a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];let o=nn(i.stops.map(u=>u[0]),r);return i.stops[o][1]}function Ss(i,e,r){let a=i.base!==void 0?i.base:1;if(Ve(r)!=="number")return ut(i.default,e.default);let o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];let u=nn(i.stops.map(b=>b[0]),r),d=function(b,T,I,z){let M=z-I,L=b-I;return M===0?0:T===1?L/M:(Math.pow(T,L)-1)/(Math.pow(T,M)-1)}(r,a,i.stops[u][0],i.stops[u+1][0]),m=i.stops[u][1],_=i.stops[u+1][1],x=ki[e.type]||et;return typeof m.evaluate=="function"?{evaluate(...b){let T=m.evaluate.apply(void 0,b),I=_.evaluate.apply(void 0,b);if(T!==void 0&&I!==void 0)return x(T,I,d,i.colorSpace)}}:x(m,_,d,i.colorSpace)}function Pl(i,e,r){switch(e.type){case"color":r=lt.parse(r);break;case"formatted":r=Mi.fromString(r.toString());break;case"resolvedImage":r=xi.fromString(r.toString());break;case"padding":r=Pi.parse(r);break;default:Ve(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return ut(r,i.default,e.default)}Xi.register(Sn,{error:[{kind:"error"},[Ne],(i,[e])=>{throw new Dt(e.evaluate(i))}],typeof:[Ne,[qe],(i,[e])=>N(Ue(e.evaluate(i)))],"to-rgba":[F(ge,4),[hi],(i,[e])=>{let[r,a,o,u]=e.evaluate(i).rgb;return[255*r,255*a,255*o,u]}],rgb:[hi,[ge,ge,ge],zo],rgba:[hi,[ge,ge,ge,ge],zo],has:{type:$e,overloads:[[[Ne],(i,[e])=>Mo(e.evaluate(i),i.properties())],[[Ne,cr],(i,[e,r])=>Mo(e.evaluate(i),r.evaluate(i))]]},get:{type:qe,overloads:[[[Ne],(i,[e])=>Es(e.evaluate(i),i.properties())],[[Ne,cr],(i,[e,r])=>Es(e.evaluate(i),r.evaluate(i))]]},"feature-state":[qe,[Ne],(i,[e])=>Es(e.evaluate(i),i.featureState||{})],properties:[cr,[],i=>i.properties()],"geometry-type":[Ne,[],i=>i.geometryType()],id:[qe,[],i=>i.id()],zoom:[ge,[],i=>i.globals.zoom],"heatmap-density":[ge,[],i=>i.globals.heatmapDensity||0],"line-progress":[ge,[],i=>i.globals.lineProgress||0],accumulated:[qe,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[ge,sn(ge),(i,e)=>{let r=0;for(let a of e)r+=a.evaluate(i);return r}],"*":[ge,sn(ge),(i,e)=>{let r=1;for(let a of e)r*=a.evaluate(i);return r}],"-":{type:ge,overloads:[[[ge,ge],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[ge],(i,[e])=>-e.evaluate(i)]]},"/":[ge,[ge,ge],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[ge,[ge,ge],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[ge,[],()=>Math.LN2],pi:[ge,[],()=>Math.PI],e:[ge,[],()=>Math.E],"^":[ge,[ge,ge],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[ge,[ge],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[ge,[ge],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[ge,[ge],(i,[e])=>Math.log(e.evaluate(i))],log2:[ge,[ge],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[ge,[ge],(i,[e])=>Math.sin(e.evaluate(i))],cos:[ge,[ge],(i,[e])=>Math.cos(e.evaluate(i))],tan:[ge,[ge],(i,[e])=>Math.tan(e.evaluate(i))],asin:[ge,[ge],(i,[e])=>Math.asin(e.evaluate(i))],acos:[ge,[ge],(i,[e])=>Math.acos(e.evaluate(i))],atan:[ge,[ge],(i,[e])=>Math.atan(e.evaluate(i))],min:[ge,sn(ge),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[ge,sn(ge),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[ge,[ge],(i,[e])=>Math.abs(e.evaluate(i))],round:[ge,[ge],(i,[e])=>{let r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[ge,[ge],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[$e,[Ne,qe],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[$e,[qe],(i,[e])=>i.id()===e.value],"filter-type-==":[$e,[Ne],(i,[e])=>i.geometryType()===e.value],"filter-<":[$e,[Ne,qe],(i,[e,r])=>{let a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a{let r=i.id(),a=e.value;return typeof r==typeof a&&r":[$e,[Ne,qe],(i,[e,r])=>{let a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>o}],"filter-id->":[$e,[qe],(i,[e])=>{let r=i.id(),a=e.value;return typeof r==typeof a&&r>a}],"filter-<=":[$e,[Ne,qe],(i,[e,r])=>{let a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[$e,[qe],(i,[e])=>{let r=i.id(),a=e.value;return typeof r==typeof a&&r<=a}],"filter->=":[$e,[Ne,qe],(i,[e,r])=>{let a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[$e,[qe],(i,[e])=>{let r=i.id(),a=e.value;return typeof r==typeof a&&r>=a}],"filter-has":[$e,[qe],(i,[e])=>e.value in i.properties()],"filter-has-id":[$e,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[$e,[F(Ne)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[$e,[F(qe)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[$e,[Ne,F(qe)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[$e,[Ne,F(qe)],(i,[e,r])=>function(a,o,u,d){for(;u<=d;){let m=u+d>>1;if(o[m]===a)return!0;o[m]>a?d=m-1:u=m+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:$e,overloads:[[[$e,$e],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[sn($e),(i,e)=>{for(let r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:$e,overloads:[[[$e,$e],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[sn($e),(i,e)=>{for(let r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[$e,[$e],(i,[e])=>!e.evaluate(i)],"is-supported-script":[$e,[Ne],(i,[e])=>{let r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[Ne,[Ne],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Ne,[Ne],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Ne,sn(qe),(i,e)=>e.map(r=>Xn(r.evaluate(i))).join("")],"resolved-locale":[Ne,[tn],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Is{constructor(e,r){var a;this.expression=e,this._warningHistory={},this._evaluator=new wo,this._defaultValue=r?(a=r).type==="color"&&Fa(a.default)?new lt(0,0,0,0):a.type==="color"?lt.parse(a.default)||null:a.type==="padding"?Pi.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?Qt.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,a,o,u,d){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(e,r,a,o,u,d){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d||null;try{let m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new Dt(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}}}function Ua(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Sn}function Na(i,e){let r=new Ta(Sn,Aa,[],e?function(o){let u={color:hi,string:Ne,number:ge,enum:Ne,boolean:$e,formatted:R,padding:S,resolvedImage:C,variableAnchorOffsetCollection:P};return o.type==="array"?F(u[o.value]||qe,o.length):u[o.type]}(e):void 0),a=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Ra(new Is(a,e)):In(r.errors)}class $a{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!Yn(r.expression)}evaluateWithoutErrorHandling(e,r,a,o,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,u,d)}evaluate(e,r,a,o,u,d){return this._styleExpression.evaluate(e,r,a,o,u,d)}}class qa{constructor(e,r,a,o){this.kind=e,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!Yn(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(e,r,a,o,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,u,d)}evaluate(e,r,a,o,u,d){return this._styleExpression.evaluate(e,r,a,o,u,d)}interpolationFactor(e,r,a){return this.interpolationType?Di.interpolationFactor(this.interpolationType,e,r,a):0}}function Cs(i,e){let r=Na(i,e);if(r.result==="error")return r;let a=r.value.expression,o=za(a);if(!o&&!Cn(e))return In([new yi("","data expressions not supported")]);let u=En(a,["zoom"]);if(!u&&!Po(e))return In([new yi("","zoom expressions not supported")]);let d=An(a);return d||u?d instanceof yi?In([d]):d instanceof Di&&!Ts(e)?In([new yi("",'"interpolate" expressions cannot be used with this property')]):Ra(d?new qa(o?"camera":"composite",r.value,d.labels,d instanceof Di?d.interpolation:void 0):new $a(o?"constant":"source",r.value)):In([new yi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Jn{constructor(e,r){this._parameters=e,this._specification=r,$t(this,Oa(this._parameters,this._specification))}static deserialize(e){return new Jn(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function An(i){let e=null;if(i instanceof ka)e=An(i.result);else if(i instanceof Pa){for(let r of i.args)if(e=An(r),e)break}else(i instanceof it||i instanceof Di)&&i.input instanceof Xi&&i.input.name==="zoom"&&(e=i);return e instanceof yi||i.eachChild(r=>{let a=An(r);a instanceof yi?e=a:!e&&a?e=new yi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new yi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function As(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(let e of i.slice(1))if(!As(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}let kl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function zs(i){if(i==null)return{filter:()=>!0,needGeometry:!1};As(i)||(i=Za(i));let e=Na(i,kl);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,a,o)=>e.value.evaluate(r,a,{},o),needGeometry:ko(i)}}function Dl(i,e){return ie?1:0}function ko(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?Ms(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(Za))):e==="all"?["all"].concat(i.slice(1).map(Za)):e==="none"?["all"].concat(i.slice(1).map(Za).map(Qn)):e==="in"?Do(i[1],i.slice(2)):e==="!in"?Qn(Do(i[1],i.slice(2))):e==="has"?Ps(i[1]):e==="!has"?Qn(Ps(i[1])):e!=="within"||i;var r}function Ms(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Do(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(Dl)]]:["filter-in-small",i,["literal",e]]}}function Ps(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Qn(i){return["!",i]}function zn(i){let e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let o="[";for(let u of i)o+=`${zn(u)},`;return`${o}]`}let r=Object.keys(i).sort(),a="{";for(let o=0;oa.maximum?[new me(e,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function Ds(i){let e=i.valueSpec,r=Mt(i.value.type),a,o,u,d={},m=r!=="categorical"&&i.value.property===void 0,_=!m,x=Ve(i.value.stops)==="array"&&Ve(i.value.stops[0])==="array"&&Ve(i.value.stops[0][0])==="object",b=ui({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(z){if(r==="identity")return[new me(z.key,z.value,'identity function may not have a "stops" property')];let M=[],L=z.value;return M=M.concat(ea({key:z.key,value:L,valueSpec:z.valueSpec,validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:T})),Ve(L)==="array"&&L.length===0&&M.push(new me(z.key,L,"array must have at least one stop")),M},default:function(z){return z.validateSpec({key:z.key,value:z.value,valueSpec:e,validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec})}}});return r==="identity"&&m&&b.push(new me(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new me(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Ts(i.valueSpec)&&b.push(new me(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!Cn(i.valueSpec)?b.push(new me(i.key,i.value,"property functions not supported")):m&&!Po(i.valueSpec)&&b.push(new me(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||b.push(new me(i.key,i.value,'"property" property is required')),b;function T(z){let M=[],L=z.value,V=z.key;if(Ve(L)!=="array")return[new me(V,L,`array expected, ${Ve(L)} found`)];if(L.length!==2)return[new me(V,L,`array length 2 expected, length ${L.length} found`)];if(x){if(Ve(L[0])!=="object")return[new me(V,L,`object expected, ${Ve(L[0])} found`)];if(L[0].zoom===void 0)return[new me(V,L,"object stop key must have zoom")];if(L[0].value===void 0)return[new me(V,L,"object stop key must have value")];if(u&&u>Mt(L[0].zoom))return[new me(V,L[0].zoom,"stop zoom values must appear in ascending order")];Mt(L[0].zoom)!==u&&(u=Mt(L[0].zoom),o=void 0,d={}),M=M.concat(ui({key:`${V}[0]`,value:L[0],valueSpec:{zoom:{}},validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:ta,value:I}}))}else M=M.concat(I({key:`${V}[0]`,value:L[0],valueSpec:{},validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec},L));return Ua(Sr(L[1]))?M.concat([new me(`${V}[1]`,L[1],"expressions are not allowed in function stops.")]):M.concat(z.validateSpec({key:`${V}[1]`,value:L[1],valueSpec:e,validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec}))}function I(z,M){let L=Ve(z.value),V=Mt(z.value),$=z.value!==null?z.value:M;if(a){if(L!==a)return[new me(z.key,$,`${L} stop domain type must match previous stop domain type ${a}`)]}else a=L;if(L!=="number"&&L!=="string"&&L!=="boolean")return[new me(z.key,$,"stop domain value must be a number, string, or boolean")];if(L!=="number"&&r!=="categorical"){let W=`number expected, ${L} found`;return Cn(e)&&r===void 0&&(W+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new me(z.key,$,W)]}return r!=="categorical"||L!=="number"||isFinite(V)&&Math.floor(V)===V?r!=="categorical"&&L==="number"&&o!==void 0&&Vnew me(`${i.key}${a.key}`,i.value,a.message));let r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new me(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Yn(r))return[new me(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Yn(r))return[new me(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!En(r,["zoom","feature-state"]))return[new me(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!za(r))return[new me(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Or(i){let e=i.key,r=i.value,a=i.valueSpec,o=[];return Array.isArray(a.values)?a.values.indexOf(Mt(r))===-1&&o.push(new me(e,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(Mt(r))===-1&&o.push(new me(e,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function Ls(i){return As(Sr(i.value))?Mn($t({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Lo(i)}function Lo(i){let e=i.value,r=i.key;if(Ve(e)!=="array")return[new me(r,e,`array expected, ${Ve(e)} found`)];let a=i.styleSpec,o,u=[];if(e.length<1)return[new me(r,e,"filter array must have at least 1 element")];switch(u=u.concat(Or({key:`${r}[0]`,value:e[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),Mt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Mt(e[1])==="$type"&&u.push(new me(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&u.push(new me(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(o=Ve(e[1]),o!=="string"&&u.push(new me(`${r}[1]`,e[1],`string expected, ${o} found`)));for(let d=2;d{x in r&&e.push(new me(a,r[x],`"${x}" is prohibited for ref layers`))}),o.layers.forEach(x=>{Mt(x.id)===m&&(_=x)}),_?_.ref?e.push(new me(a,r.ref,"ref cannot reference another ref layer")):d=Mt(_.type):e.push(new me(a,r.ref,`ref layer "${m}" not found`))}else if(d!=="background")if(r.source){let _=o.sources&&o.sources[r.source],x=_&&Mt(_.type);_?x==="vector"&&d==="raster"?e.push(new me(a,r.source,`layer "${r.id}" requires a raster source`)):x!=="raster-dem"&&d==="hillshade"?e.push(new me(a,r.source,`layer "${r.id}" requires a raster-dem source`)):x==="raster"&&d!=="raster"?e.push(new me(a,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&d!=="hillshade"?e.push(new me(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&_.lineMetrics||e.push(new me(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new me(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new me(a,r.source,`source "${r.source}" not found`))}else e.push(new me(a,r,'missing required property "source"'));return e=e.concat(ui({key:a,value:r,valueSpec:u.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:u.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Ls,layout:_=>ui({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>Fo($t({layerType:d},x))}}),paint:_=>ui({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>Ro($t({layerType:d},x))}})}})),e}function ur(i){let e=i.value,r=i.key,a=Ve(e);return a!=="string"?[new me(r,e,`string expected, ${a} found`)]:[]}let Li={promoteId:function({key:i,value:e}){if(Ve(e)==="string")return ur({key:i,value:e});{let r=[];for(let a in e)r.push(...ur({key:`${i}.${a}`,value:e[a]}));return r}}};function ra(i){let e=i.value,r=i.key,a=i.styleSpec,o=i.style,u=i.validateSpec;if(!e.type)return[new me(r,e,'"type" is required')];let d=Mt(e.type),m;switch(d){case"vector":case"raster":return m=ui({key:r,value:e,valueSpec:a[`source_${d.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:Li,validateSpec:u}),m;case"raster-dem":return m=function(_){var x;let b=(x=_.sourceName)!==null&&x!==void 0?x:"",T=_.value,I=_.styleSpec,z=I.source_raster_dem,M=_.style,L=[],V=Ve(T);if(T===void 0)return L;if(V!=="object")return L.push(new me("source_raster_dem",T,`object expected, ${V} found`)),L;let $=Mt(T.encoding)==="custom",W=["redFactor","greenFactor","blueFactor","baseShift"],Z=_.value.encoding?`"${_.value.encoding}"`:"Default";for(let Y in T)!$&&W.includes(Y)?L.push(new me(Y,T[Y],`In "${b}": "${Y}" is only valid when "encoding" is set to "custom". ${Z} encoding found`)):z[Y]?L=L.concat(_.validateSpec({key:Y,value:T[Y],valueSpec:z[Y],validateSpec:_.validateSpec,style:M,styleSpec:I})):L.push(new me(Y,T[Y],`unknown property "${Y}"`));return L}({sourceName:r,value:e,style:i.style,styleSpec:a,validateSpec:u}),m;case"geojson":if(m=ui({key:r,value:e,valueSpec:a.source_geojson,style:o,styleSpec:a,validateSpec:u,objectElementValidators:Li}),e.cluster)for(let _ in e.clusterProperties){let[x,b]=e.clusterProperties[_],T=typeof x=="string"?[x,["accumulated"],["get",_]]:x;m.push(...Mn({key:`${r}.${_}.map`,value:b,validateSpec:u,expressionContext:"cluster-map"})),m.push(...Mn({key:`${r}.${_}.reduce`,value:T,validateSpec:u,expressionContext:"cluster-reduce"}))}return m;case"video":return ui({key:r,value:e,valueSpec:a.source_video,style:o,validateSpec:u,styleSpec:a});case"image":return ui({key:r,value:e,valueSpec:a.source_image,style:o,validateSpec:u,styleSpec:a});case"canvas":return[new me(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Or({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:o,validateSpec:u,styleSpec:a})}}function Oo(i){let e=i.value,r=i.styleSpec,a=r.light,o=i.style,u=[],d=Ve(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new me("light",e,`object expected, ${d} found`)]),u;for(let m in e){let _=m.match(/^(.*)-transition$/);u=u.concat(_&&a[_[1]]&&a[_[1]].transition?i.validateSpec({key:m,value:e[m],valueSpec:r.transition,validateSpec:i.validateSpec,style:o,styleSpec:r}):a[m]?i.validateSpec({key:m,value:e[m],valueSpec:a[m],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new me(m,e[m],`unknown property "${m}"`)])}return u}function Vo(i){let e=i.value,r=i.styleSpec,a=r.terrain,o=i.style,u=[],d=Ve(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new me("terrain",e,`object expected, ${d} found`)]),u;for(let m in e)u=u.concat(a[m]?i.validateSpec({key:m,value:e[m],valueSpec:a[m],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new me(m,e[m],`unknown property "${m}"`)]);return u}function Uo(i){let e=[],r=i.value,a=i.key;if(Array.isArray(r)){let o=[],u=[];for(let d in r)r[d].id&&o.includes(r[d].id)&&e.push(new me(a,r,`all the sprites' ids must be unique, but ${r[d].id} is duplicated`)),o.push(r[d].id),r[d].url&&u.includes(r[d].url)&&e.push(new me(a,r,`all the sprites' URLs must be unique, but ${r[d].url} is duplicated`)),u.push(r[d].url),e=e.concat(ui({key:`${a}[${d}]`,value:r[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return ur({key:a,value:r})}let Pn={"*":()=>[],array:ea,boolean:function(i){let e=i.value,r=i.key,a=Ve(e);return a!=="boolean"?[new me(r,e,`boolean expected, ${a} found`)]:[]},number:ta,color:function(i){let e=i.key,r=i.value,a=Ve(r);return a!=="string"?[new me(e,r,`color expected, ${a} found`)]:lt.parse(String(r))?[]:[new me(e,r,`color expected, "${r}" found`)]},constants:ks,enum:Or,filter:Ls,function:Ds,layer:ia,object:ui,source:ra,light:Oo,terrain:Vo,string:ur,formatted:function(i){return ur(i).length===0?[]:Mn(i)},resolvedImage:function(i){return ur(i).length===0?[]:Mn(i)},padding:function(i){let e=i.key,r=i.value;if(Ve(r)==="array"){if(r.length<1||r.length>4)return[new me(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let a={type:"number"},o=[];for(let u=0;u[]}})),i.constants&&(r=r.concat(ks({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:na}))),No(r)}function Yi(i){return function(e){return i({...e,validateSpec:na})}}function No(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function Bi(i){return function(...e){return No(i.apply(this,e))}}pr.source=Bi(Yi(ra)),pr.sprite=Bi(Yi(Uo)),pr.glyphs=Bi(Yi(ja)),pr.light=Bi(Yi(Oo)),pr.terrain=Bi(Yi(Vo)),pr.layer=Bi(Yi(ia)),pr.filter=Bi(Yi(Ls)),pr.paintProperty=Bi(Yi(Ro)),pr.layoutProperty=Bi(Yi(Fo));let aa=pr,Bs=aa.light,$o=aa.paintProperty,Rs=aa.layoutProperty;function Fs(i,e){let r=!1;if(e&&e.length)for(let a of e)i.fire(new Yr(new Error(a.message))),r=!0;return r}class kn{constructor(e,r,a){let o=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let d=new Int32Array(this.arrayBuffer);e=d[0],this.d=(r=d[1])+2*(a=d[2]);for(let _=0;_=T[M+0]&&o>=T[M+1])?(m[z]=!0,d.push(b[z])):m[z]=!1}}}}_forEachCell(e,r,a,o,u,d,m,_){let x=this._convertToCellCoord(e),b=this._convertToCellCoord(r),T=this._convertToCellCoord(a),I=this._convertToCellCoord(o);for(let z=x;z<=T;z++)for(let M=b;M<=I;M++){let L=this.d*M+z;if((!_||_(this._convertFromCellCoord(z),this._convertFromCellCoord(M),this._convertFromCellCoord(z+1),this._convertFromCellCoord(M+1)))&&u.call(this,e,r,a,o,L,d,m,_))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;let e=this.cells,r=3+this.cells.length+1+1,a=0;for(let d=0;d=0)continue;let d=i[u];o[u]=Vr[a].shallow.indexOf(u)>=0?d:Dn(d,e)}i instanceof Error&&(o.message=i.message)}if(o.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(o.$name=a),o}throw new Error("can't serialize object of type "+typeof i)}function oa(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||sa(i)||jn(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(oa);if(typeof i=="object"){let e=i.$name||"Object";if(!Vr[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:r}=Vr[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);let a=Object.create(r.prototype);for(let o of Object.keys(i)){if(o==="$name")continue;let u=i[o];a[o]=Vr[e].shallow.indexOf(o)>=0?u:oa(u)}return a}throw new Error("can't deserialize object of type "+typeof i)}class Os{constructor(){this.first=!0}update(e,r){let a=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function la(i){for(let e of i)if(Vs(e.charCodeAt(0)))return!0;return!1}function Bl(i){for(let e of i)if(!Rl(e.charCodeAt(0)))return!1;return!0}function Rl(i){return!(we.Arabic(i)||we["Arabic Supplement"](i)||we["Arabic Extended-A"](i)||we["Arabic Presentation Forms-A"](i)||we["Arabic Presentation Forms-B"](i))}function Vs(i){return!(i!==746&&i!==747&&(i<4352||!(we["Bopomofo Extended"](i)||we.Bopomofo(i)||we["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||we["CJK Compatibility Ideographs"](i)||we["CJK Compatibility"](i)||we["CJK Radicals Supplement"](i)||we["CJK Strokes"](i)||!(!we["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||we["CJK Unified Ideographs Extension A"](i)||we["CJK Unified Ideographs"](i)||we["Enclosed CJK Letters and Months"](i)||we["Hangul Compatibility Jamo"](i)||we["Hangul Jamo Extended-A"](i)||we["Hangul Jamo Extended-B"](i)||we["Hangul Jamo"](i)||we["Hangul Syllables"](i)||we.Hiragana(i)||we["Ideographic Description Characters"](i)||we.Kanbun(i)||we["Kangxi Radicals"](i)||we["Katakana Phonetic Extensions"](i)||we.Katakana(i)&&i!==12540||!(!we["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!we["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||we["Unified Canadian Aboriginal Syllabics"](i)||we["Unified Canadian Aboriginal Syllabics Extended"](i)||we["Vertical Forms"](i)||we["Yijing Hexagram Symbols"](i)||we["Yi Syllables"](i)||we["Yi Radicals"](i))))}function qo(i){return!(Vs(i)||function(e){return!!(we["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||we["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||we["Letterlike Symbols"](e)||we["Number Forms"](e)||we["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||we["Control Pictures"](e)&&e!==9251||we["Optical Character Recognition"](e)||we["Enclosed Alphanumerics"](e)||we["Geometric Shapes"](e)||we["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||we["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||we["CJK Symbols and Punctuation"](e)||we.Katakana(e)||we["Private Use Area"](e)||we["CJK Compatibility Forms"](e)||we["Small Form Variants"](e)||we["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function Us(i){return i>=1424&&i<=2303||we["Arabic Presentation Forms-A"](i)||we["Arabic Presentation Forms-B"](i)}function Fl(i,e){return!(!e&&Us(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||we.Khmer(i))}function Ol(i){for(let e of i)if(Us(e.charCodeAt(0)))return!0;return!1}let Ns="deferred",$s="loading",qs="loaded",Zs=null,vi="unavailable",Ji=null,Zo=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(vi="error"),Zs&&Zs(i)};function ca(){js.fire(new wr("pluginStateChange",{pluginStatus:vi,pluginURL:Ji}))}let js=new vn,Gs=function(){return vi},Xs=function(){if(vi!==Ns||!Ji)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");vi=$s,ca(),Ji&&br({url:Ji},i=>{i?Zo(i):(vi=qs,ca())})},Ri={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>vi===qs||Ri.applyArabicShaping!=null,isLoading:()=>vi===$s,setState(i){if(!Zi())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");vi=i.pluginStatus,Ji=i.pluginURL},isParsed(){if(!Zi())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ri.applyArabicShaping!=null&&Ri.processBidirectionalText!=null&&Ri.processStyledBidirectionalText!=null},getPluginURL(){if(!Zi())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Ji}};class yt{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Os,this.transition={})}isSupportedScript(e){return function(r,a){for(let o of r)if(!Fl(o.charCodeAt(0),a))return!1;return!0}(e,Ri.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,r=e-Math.floor(e),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class Ga{constructor(e,r){this.property=e,this.value=r,this.expression=function(a,o){if(Fa(a))return new Jn(a,o);if(Ua(a)){let u=Cs(a,o);if(u.result==="error")throw new Error(u.value.map(d=>`${d.key}: ${d.message}`).join(", "));return u.value}{let u=a;return o.type==="color"&&typeof a=="string"?u=lt.parse(a):o.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?o.type==="variableAnchorOffsetCollection"&&Array.isArray(a)&&(u=Qt.parse(a)):u=Pi.parse(a),{kind:"constant",evaluate:()=>u}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,a){return this.property.possiblyEvaluate(this,e,r,a)}}class Hs{constructor(e){this.property=e,this.value=new Ga(e,void 0)}transitioned(e,r){return new Go(this.property,this.value,r,Jt({},e.transition,this.transition),e.now)}untransitioned(){return new Go(this.property,this.value,null,{},0)}}class jo{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Ki(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Hs(this._values[e].property)),this._values[e].value=new Ga(this._values[e].property,r===null?void 0:Ki(r))}getTransition(e){return Ki(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Hs(this._values[e].property)),this._values[e].transition=Ki(r)||void 0}serialize(){let e={};for(let r of Object.keys(this._values)){let a=this.getValue(r);a!==void 0&&(e[r]=a);let o=this.getTransition(r);o!==void 0&&(e[`${r}-transition`]=o)}return e}transitioned(e,r){let a=new Xo(this._properties);for(let o of Object.keys(this._values))a._values[o]=this._values[o].transitioned(e,r._values[o]);return a}untransitioned(){let e=new Xo(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class Go{constructor(e,r,a,o,u){this.property=e,this.value=r,this.begin=u+o.delay||0,this.end=this.begin+o.duration||0,e.specification.transition&&(o.delay||o.duration)&&(this.prior=a)}possiblyEvaluate(e,r,a){let o=e.now||0,u=this.value.possiblyEvaluate(e,r,a),d=this.prior;if(d){if(o>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(o=1)return 1;let x=_*_,b=x*_;return 4*(_<.5?b:3*(_-x)+b-.75)}(m))}}return u}}class Xo{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,a){let o=new Xa(this._properties);for(let u of Object.keys(this._values))o._values[u]=this._values[u].possiblyEvaluate(e,r,a);return o}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ln{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return Ki(this._values[e].value)}setValue(e,r){this._values[e]=new Ga(this._values[e].property,r===null?void 0:Ki(r))}serialize(){let e={};for(let r of Object.keys(this._values)){let a=this.getValue(r);a!==void 0&&(e[r]=a)}return e}possiblyEvaluate(e,r,a){let o=new Xa(this._properties);for(let u of Object.keys(this._values))o._values[u]=this._values[u].possiblyEvaluate(e,r,a);return o}}class dr{constructor(e,r,a){this.property=e,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,a,o){return this.property.evaluate(this.value,this.parameters,e,r,a,o)}}class Xa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Me{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,a){let o=ki[this.specification.type];return o?o(e,r,a):e}}class Be{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,a,o){return new dr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},a,o)}:e.expression,r)}interpolate(e,r,a){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new dr(this,{kind:"constant",value:void 0},e.parameters);let o=ki[this.specification.type];if(o){let u=o(e.value.value,r.value.value,a);return new dr(this,{kind:"constant",value:u},e.parameters)}return e}evaluate(e,r,a,o,u,d){return e.kind==="constant"?e.value:e.evaluate(r,a,o,u,d)}}class Ha extends Be{possiblyEvaluate(e,r,a,o){if(e.value===void 0)return new dr(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){let u=e.expression.evaluate(r,null,{},a,o),d=e.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,m=this._calculate(d,d,d,r);return new dr(this,{kind:"constant",value:m},r)}if(e.expression.kind==="camera"){let u=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new dr(this,{kind:"constant",value:u},r)}return new dr(this,e.expression,r)}evaluate(e,r,a,o,u,d){if(e.kind==="source"){let m=e.evaluate(r,a,o,u,d);return this._calculate(m,m,m,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},a,o),e.evaluate({zoom:Math.floor(r.zoom)},a,o),e.evaluate({zoom:Math.floor(r.zoom)+1},a,o),r):e.value}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class Ws{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){if(e.value!==void 0){if(e.expression.kind==="constant"){let u=e.expression.evaluate(r,null,{},a,o);return this._calculate(u,u,u,r)}return this._calculate(e.expression.evaluate(new yt(Math.floor(r.zoom-1),r)),e.expression.evaluate(new yt(Math.floor(r.zoom),r)),e.expression.evaluate(new yt(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class mr{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){return!!e.expression.evaluate(r,null,{},a,o)}interpolate(){return!1}}class pi{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in e){let a=e[r];a.specification.overridable&&this.overridableProperties.push(r);let o=this.defaultPropertyValues[r]=new Ga(a,void 0),u=this.defaultTransitionablePropertyValues[r]=new Hs(a);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=o.possiblyEvaluate({})}}}Ee("DataDrivenProperty",Be),Ee("DataConstantProperty",Me),Ee("CrossFadedDataDrivenProperty",Ha),Ee("CrossFadedProperty",Ws),Ee("ColorRampProperty",mr);let Wa="-transition";class Qi extends vn{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},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),r.layout&&(this._unevaluatedLayout=new Ln(r.layout)),r.paint)){this._transitionablePaint=new jo(r.paint);for(let a in e.paint)this.setPaintProperty(a,e.paint[a],{validate:!1});for(let a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Xa(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,a={}){r!=null&&this._validate(Rs,`layers.${this.id}.layout.${e}`,e,r,a)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Wa)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,a={}){if(r!=null&&this._validate($o,`layers.${this.id}.paint.${e}`,e,r,a))return!1;if(e.endsWith(Wa))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{let o=this._transitionablePaint._values[e],u=o.property.specification["property-type"]==="cross-faded-data-driven",d=o.value.isDataDriven(),m=o.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);let _=this._transitionablePaint._values[e].value;return _.isDataDriven()||d||u||this._handleOverridablePaintPropertyUpdate(e,m,_)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,a){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){let e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),mn(e,(r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length))}_validate(e,r,a,o,u={}){return(!u||u.validate!==!1)&&Fs(this,e.call(aa,{key:r,layerType:this.type,objectKey:a,value:o,styleSpec:re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let r=this.paint.get(e);if(r instanceof dr&&Cn(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}let Ks={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ha{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ft{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(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);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function xt(i,e=1){let r=0,a=0;return{members:i.map(o=>{let u=Ks[o.type].BYTES_PER_ELEMENT,d=r=Ho(r,Math.max(e,u)),m=o.components||1;return a=Math.max(a,u),r+=u*m,{name:o.name,type:o.type,components:m,offset:d}}),size:Ho(r,Math.max(a,e)),alignment:e}}function Ho(i,e){return Math.ceil(i/e)*e}class Bn extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){let o=2*e;return this.int16[o+0]=r,this.int16[o+1]=a,e}}Bn.prototype.bytesPerElement=4,Ee("StructArrayLayout2i4",Bn);class Ur extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){let u=3*e;return this.int16[u+0]=r,this.int16[u+1]=a,this.int16[u+2]=o,e}}Ur.prototype.bytesPerElement=6,Ee("StructArrayLayout3i6",Ur);class Ys extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o){let u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,o)}emplace(e,r,a,o,u){let d=4*e;return this.int16[d+0]=r,this.int16[d+1]=a,this.int16[d+2]=o,this.int16[d+3]=u,e}}Ys.prototype.bytesPerElement=8,Ee("StructArrayLayout4i8",Ys);class Js extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d){let m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,o,u,d)}emplace(e,r,a,o,u,d,m){let _=6*e;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=u,this.int16[_+4]=d,this.int16[_+5]=m,e}}Js.prototype.bytesPerElement=12,Ee("StructArrayLayout2i4i12",Js);class Ka extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d){let m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,o,u,d)}emplace(e,r,a,o,u,d,m){let _=4*e,x=8*e;return this.int16[_+0]=r,this.int16[_+1]=a,this.uint8[x+4]=o,this.uint8[x+5]=u,this.uint8[x+6]=d,this.uint8[x+7]=m,e}}Ka.prototype.bytesPerElement=8,Ee("StructArrayLayout2i4ub8",Ka);class ua extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){let o=2*e;return this.float32[o+0]=r,this.float32[o+1]=a,e}}ua.prototype.bytesPerElement=8,Ee("StructArrayLayout2f8",ua);class Qs extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d,m,_,x,b){let T=this.length;return this.resize(T+1),this.emplace(T,e,r,a,o,u,d,m,_,x,b)}emplace(e,r,a,o,u,d,m,_,x,b,T){let I=10*e;return this.uint16[I+0]=r,this.uint16[I+1]=a,this.uint16[I+2]=o,this.uint16[I+3]=u,this.uint16[I+4]=d,this.uint16[I+5]=m,this.uint16[I+6]=_,this.uint16[I+7]=x,this.uint16[I+8]=b,this.uint16[I+9]=T,e}}Qs.prototype.bytesPerElement=20,Ee("StructArrayLayout10ui20",Qs);class nt extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d,m,_,x,b,T,I){let z=this.length;return this.resize(z+1),this.emplace(z,e,r,a,o,u,d,m,_,x,b,T,I)}emplace(e,r,a,o,u,d,m,_,x,b,T,I,z){let M=12*e;return this.int16[M+0]=r,this.int16[M+1]=a,this.int16[M+2]=o,this.int16[M+3]=u,this.uint16[M+4]=d,this.uint16[M+5]=m,this.uint16[M+6]=_,this.uint16[M+7]=x,this.int16[M+8]=b,this.int16[M+9]=T,this.int16[M+10]=I,this.int16[M+11]=z,e}}nt.prototype.bytesPerElement=24,Ee("StructArrayLayout4i4ui4i24",nt);class h extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){let u=3*e;return this.float32[u+0]=r,this.float32[u+1]=a,this.float32[u+2]=o,e}}h.prototype.bytesPerElement=12,Ee("StructArrayLayout3f12",h);class t extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}t.prototype.bytesPerElement=4,Ee("StructArrayLayout1ul4",t);class n extends ft{_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,r,a,o,u,d,m,_,x){let b=this.length;return this.resize(b+1),this.emplace(b,e,r,a,o,u,d,m,_,x)}emplace(e,r,a,o,u,d,m,_,x,b){let T=10*e,I=5*e;return this.int16[T+0]=r,this.int16[T+1]=a,this.int16[T+2]=o,this.int16[T+3]=u,this.int16[T+4]=d,this.int16[T+5]=m,this.uint32[I+3]=_,this.uint16[T+8]=x,this.uint16[T+9]=b,e}}n.prototype.bytesPerElement=20,Ee("StructArrayLayout6i1ul2ui20",n);class s extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d){let m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,o,u,d)}emplace(e,r,a,o,u,d,m){let _=6*e;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=u,this.int16[_+4]=d,this.int16[_+5]=m,e}}s.prototype.bytesPerElement=12,Ee("StructArrayLayout2i2i2i12",s);class l extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u){let d=this.length;return this.resize(d+1),this.emplace(d,e,r,a,o,u)}emplace(e,r,a,o,u,d){let m=4*e,_=8*e;return this.float32[m+0]=r,this.float32[m+1]=a,this.float32[m+2]=o,this.int16[_+6]=u,this.int16[_+7]=d,e}}l.prototype.bytesPerElement=16,Ee("StructArrayLayout2f1f2i16",l);class p extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){let u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,o)}emplace(e,r,a,o,u){let d=12*e,m=3*e;return this.uint8[d+0]=r,this.uint8[d+1]=a,this.float32[m+1]=o,this.float32[m+2]=u,e}}p.prototype.bytesPerElement=12,Ee("StructArrayLayout2ub2f12",p);class f extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){let u=3*e;return this.uint16[u+0]=r,this.uint16[u+1]=a,this.uint16[u+2]=o,e}}f.prototype.bytesPerElement=6,Ee("StructArrayLayout3ui6",f);class g extends ft{_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,r,a,o,u,d,m,_,x,b,T,I,z,M,L,V,$){let W=this.length;return this.resize(W+1),this.emplace(W,e,r,a,o,u,d,m,_,x,b,T,I,z,M,L,V,$)}emplace(e,r,a,o,u,d,m,_,x,b,T,I,z,M,L,V,$,W){let Z=24*e,Y=12*e,Q=48*e;return this.int16[Z+0]=r,this.int16[Z+1]=a,this.uint16[Z+2]=o,this.uint16[Z+3]=u,this.uint32[Y+2]=d,this.uint32[Y+3]=m,this.uint32[Y+4]=_,this.uint16[Z+10]=x,this.uint16[Z+11]=b,this.uint16[Z+12]=T,this.float32[Y+7]=I,this.float32[Y+8]=z,this.uint8[Q+36]=M,this.uint8[Q+37]=L,this.uint8[Q+38]=V,this.uint32[Y+10]=$,this.int16[Z+22]=W,e}}g.prototype.bytesPerElement=48,Ee("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",g);class y extends ft{_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,r,a,o,u,d,m,_,x,b,T,I,z,M,L,V,$,W,Z,Y,Q,se,be,Ie,ve,ye,de,Te){let fe=this.length;return this.resize(fe+1),this.emplace(fe,e,r,a,o,u,d,m,_,x,b,T,I,z,M,L,V,$,W,Z,Y,Q,se,be,Ie,ve,ye,de,Te)}emplace(e,r,a,o,u,d,m,_,x,b,T,I,z,M,L,V,$,W,Z,Y,Q,se,be,Ie,ve,ye,de,Te,fe){let ue=32*e,Le=16*e;return this.int16[ue+0]=r,this.int16[ue+1]=a,this.int16[ue+2]=o,this.int16[ue+3]=u,this.int16[ue+4]=d,this.int16[ue+5]=m,this.int16[ue+6]=_,this.int16[ue+7]=x,this.uint16[ue+8]=b,this.uint16[ue+9]=T,this.uint16[ue+10]=I,this.uint16[ue+11]=z,this.uint16[ue+12]=M,this.uint16[ue+13]=L,this.uint16[ue+14]=V,this.uint16[ue+15]=$,this.uint16[ue+16]=W,this.uint16[ue+17]=Z,this.uint16[ue+18]=Y,this.uint16[ue+19]=Q,this.uint16[ue+20]=se,this.uint16[ue+21]=be,this.uint16[ue+22]=Ie,this.uint32[Le+12]=ve,this.float32[Le+13]=ye,this.float32[Le+14]=de,this.uint16[ue+30]=Te,this.uint16[ue+31]=fe,e}}y.prototype.bytesPerElement=64,Ee("StructArrayLayout8i15ui1ul2f2ui64",y);class v extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}v.prototype.bytesPerElement=4,Ee("StructArrayLayout1f4",v);class w extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){let u=3*e;return this.uint16[6*e+0]=r,this.float32[u+1]=a,this.float32[u+2]=o,e}}w.prototype.bytesPerElement=12,Ee("StructArrayLayout1ui2f12",w);class E extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){let u=4*e;return this.uint32[2*e+0]=r,this.uint16[u+2]=a,this.uint16[u+3]=o,e}}E.prototype.bytesPerElement=8,Ee("StructArrayLayout1ul2ui8",E);class A extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){let o=2*e;return this.uint16[o+0]=r,this.uint16[o+1]=a,e}}A.prototype.bytesPerElement=4,Ee("StructArrayLayout2ui4",A);class B extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}B.prototype.bytesPerElement=2,Ee("StructArrayLayout1ui2",B);class D extends ft{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){let u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,o)}emplace(e,r,a,o,u){let d=4*e;return this.float32[d+0]=r,this.float32[d+1]=a,this.float32[d+2]=o,this.float32[d+3]=u,e}}D.prototype.bytesPerElement=16,Ee("StructArrayLayout4f16",D);class O extends ha{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 xe(this.anchorPointX,this.anchorPointY)}}O.prototype.size=20;class k extends n{get(e){return new O(this,e)}}Ee("CollisionBoxArray",k);class G extends ha{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]}}G.prototype.size=48;class J extends g{get(e){return new G(this,e)}}Ee("PlacedSymbolArray",J);class U extends ha{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(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]}}U.prototype.size=64;class H extends y{get(e){return new U(this,e)}}Ee("SymbolInstanceArray",H);class ee extends v{getoffsetX(e){return this.float32[1*e+0]}}Ee("GlyphOffsetArray",ee);class ie extends Ur{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",ie);class ae extends ha{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]}}ae.prototype.size=12;class he extends w{get(e){return new ae(this,e)}}Ee("TextAnchorOffsetArray",he);class ce extends ha{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]}}ce.prototype.size=8;class pe extends E{get(e){return new ce(this,e)}}Ee("FeatureIndexArray",pe);class Se extends Bn{}class He extends Bn{}class _e extends Bn{}class Re extends Js{}class Ce extends Ka{}class vt extends ua{}class je extends Qs{}class Ge extends nt{}class We extends h{}class Lt extends t{}class pt extends s{}class Hi extends p{}class Pt extends f{}class It extends A{}let Fi=xt([{name:"a_pos",components:2,type:"Int16"}],4),{members:fr}=Fi;class bt{constructor(e=[]){this.segments=e}prepareSegment(e,r,a,o){let u=this.segments[this.segments.length-1];return e>bt.MAX_VERTEX_ARRAY_LENGTH&&li(`Max vertices per segment is ${bt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!u||u.vertexLength+e>bt.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==o)&&(u={vertexOffset:r.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},o!==void 0&&(u.sortKey=o),this.segments.push(u)),u}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,a,o){return new bt([{vertexOffset:e,primitiveOffset:r,vertexLength:a,primitiveLength:o,vaos:{},sortKey:0}])}}function Nr(i,e){return 256*(i=ar(Math.floor(i),0,255))+ar(Math.floor(e),0,255)}bt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ee("SegmentVector",bt);let $r=xt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Ir={exports:{}},on={exports:{}};on.exports=function(i,e){var r,a,o,u,d,m,_,x;for(a=i.length-(r=3&i.length),o=e,d=3432918353,m=461845907,x=0;x>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*m+(((_>>>16)*m&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(_=0,r){case 3:_^=(255&i.charCodeAt(x+2))<<16;case 2:_^=(255&i.charCodeAt(x+1))<<8;case 1:o^=_=(65535&(_=(_=(65535&(_^=255&i.charCodeAt(x)))*d+(((_>>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*m+(((_>>>16)*m&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0};var di=on.exports,ei={exports:{}};ei.exports=function(i,e){for(var r,a=i.length,o=e^a,u=0;a>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),a-=4,++u;switch(a){case 3:o^=(255&i.charCodeAt(u+2))<<16;case 2:o^=(255&i.charCodeAt(u+1))<<8;case 1:o=1540483477*(65535&(o^=255&i.charCodeAt(u)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0};var ni=di,pa=ei.exports;Ir.exports=ni,Ir.exports.murmur3=ni,Ir.exports.murmur2=pa;var Bt=te(Ir.exports);class Rt{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,a,o){this.ids.push(Oi(e)),this.positions.push(r,a,o)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=Oi(e),a=0,o=this.ids.length-1;for(;a>1;this.ids[d]>=r?o=d:a=d+1}let u=[];for(;this.ids[a]===r;)u.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return u}static serialize(e,r){let a=new Float64Array(e.ids),o=new Uint32Array(e.positions);return Ft(a,o,0,a.length-1),r&&r.push(a.buffer,o.buffer),{ids:a,positions:o}}static deserialize(e){let r=new Rt;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Oi(i){let e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Bt(String(i))}function Ft(i,e,r,a){for(;r>1],u=r-1,d=a+1;for(;;){do u++;while(i[u]o);if(u>=d)break;Ya(i,u,d),Ya(e,3*u,3*d),Ya(e,3*u+1,3*d+1),Ya(e,3*u+2,3*d+2)}d-r`u_${o}`),this.type=a}setUniform(e,r,a){e.set(a.constantOr(this.value))}getBinding(e,r,a){return this.type==="color"?new Ko(e,r):new Ja(e,r)}}class cn{constructor(e,r){this.uniformNames=r.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,a,o){let u=o==="u_pattern_to"?this.patternTo:o==="u_pattern_from"?this.patternFrom:o==="u_pixel_ratio_to"?this.pixelRatioTo:o==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&e.set(u)}getBinding(e,r,a){return a.substr(0,9)==="u_pattern"?new Wo(e,r):new Ja(e,r)}}class gr{constructor(e,r,a,o){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map(u=>({name:`a_${u}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new o}populatePaintArray(e,r,a,o,u){let d=this.paintVertexArray.length,m=this.expression.evaluate(new yt(0),r,{},o,[],u);this.paintVertexArray.resize(e),this._setPaintValue(d,e,m)}updatePaintArray(e,r,a,o){let u=this.expression.evaluate({zoom:0},a,o);this._setPaintValue(e,r,u)}_setPaintValue(e,r,a){if(this.type==="color"){let o=qr(a);for(let u=e;u`u_${m}_t`),this.type=a,this.useIntegerZoom=o,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=r.map(m=>({name:`a_${m}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(e,r,a,o,u){let d=this.expression.evaluate(new yt(this.zoom),r,{},o,[],u),m=this.expression.evaluate(new yt(this.zoom+1),r,{},o,[],u),_=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(_,e,d,m)}updatePaintArray(e,r,a,o){let u=this.expression.evaluate({zoom:this.zoom},a,o),d=this.expression.evaluate({zoom:this.zoom+1},a,o);this._setPaintValue(e,r,u,d)}_setPaintValue(e,r,a,o){if(this.type==="color"){let u=qr(a),d=qr(o);for(let m=e;m`#define HAS_UNIFORM_${o}`))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let a=this.binders[r];if(a instanceof gr||a instanceof Vi)for(let o=0;o!0){this.programConfigurations={};for(let o of e)this.programConfigurations[o.id]=new Qa(o,r,a);this.needsUpload=!1,this._featureMap=new Rt,this._bufferOffset=0}populatePaintArrays(e,r,a,o,u,d){for(let m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,r,o,u,d);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,a,o){for(let u of a)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,r,u,o)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}function vu(i,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-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Bc(i,e,r){let a={color:{source:ua,composite:D},number:{source:v,composite:ua}},o=function(u){return{"line-pattern":{source:je,composite:je},"fill-pattern":{source:je,composite:je},"fill-extrusion-pattern":{source:je,composite:je}}[u]}(i);return o&&o[r]||a[e][r]}Ee("ConstantBinder",Rn),Ee("CrossFadedConstantBinder",cn),Ee("SourceExpressionBinder",gr),Ee("CrossFadedCompositeBinder",Cr),Ee("CompositeExpressionBinder",Vi),Ee("ProgramConfiguration",Qa,{omit:["_buffers"]}),Ee("ProgramConfigurationSet",da);let Ut=8192,Ul=Math.pow(2,14)-1,Rc=-Ul-1;function ma(i){let e=Ut/i.extent,r=i.loadGeometry();for(let a=0;ad.x+1||_d.y+1)&&li("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function fa(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?ma(i):[]}}function Yo(i,e,r,a,o){i.emplaceBack(2*e+(a+1)/2,2*r+(o+1)/2)}class Nl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new He,this.indexArray=new Pt,this.segments=new bt,this.programConfigurations=new da(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){let o=this.layers[0],u=[],d=null,m=!1;o.type==="circle"&&(d=o.layout.get("circle-sort-key"),m=!d.isConstant());for(let{feature:_,id:x,index:b,sourceLayerIndex:T}of e){let I=this.layers[0]._featureFilter.needGeometry,z=fa(_,I);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),z,a))continue;let M=m?d.evaluate(z,{},a):void 0,L={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:b,geometry:I?z.geometry:ma(_),patterns:{},sortKey:M};u.push(L)}m&&u.sort((_,x)=>_.sortKey-x.sortKey);for(let _ of u){let{geometry:x,index:b,sourceLayerIndex:T}=_,I=e[b].feature;this.addFeature(_,x,b,a),r.featureIndex.insert(I,x,b,T,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,fr),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,r,a,o){for(let u of r)for(let d of u){let m=d.x,_=d.y;if(m<0||m>=Ut||_<0||_>=Ut)continue;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),b=x.vertexLength;Yo(this.layoutVertexArray,m,_,-1,-1),Yo(this.layoutVertexArray,m,_,1,-1),Yo(this.layoutVertexArray,m,_,1,1),Yo(this.layoutVertexArray,m,_,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{},o)}}function Fc(i,e){for(let r=0;r1){if($l(i,e))return!0;for(let a=0;a1?r:r.sub(e)._mult(o)._add(e))}function Uc(i,e){let r,a,o,u=!1;for(let d=0;de.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(u=!u)}return u}function es(i,e){let r=!1;for(let a=0,o=i.length-1;ae.y!=d.y>e.y&&e.x<(d.x-u.x)*(e.y-u.y)/(d.y-u.y)+u.x&&(r=!r)}return r}function Tu(i,e,r){let a=r[0],o=r[2];if(i.xo.x&&e.x>o.x||i.yo.y&&e.y>o.y)return!1;let u=Ci(i,e,r[0]);return u!==Ci(i,e,r[1])||u!==Ci(i,e,r[2])||u!==Ci(i,e,r[3])}function eo(i,e,r){let a=e.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(e.id).getMaxValue(i)}function Jo(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Qo(i,e,r,a,o){if(!e[0]&&!e[1])return i;let u=xe.convert(e)._mult(o);r==="viewport"&&u._rotate(-a);let d=[];for(let m=0;mZc(V,L))}(x,_),z=T?b*m:b;for(let M of o)for(let L of M){let V=T?L:Zc(L,_),$=z,W=el([],[L.x,L.y,0,1],_);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?$*=W[3]/d.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&($*=d.cameraToCenterDistance/W[3]),bu(I,V,$))return!0}return!1}}function Zc(i,e){let r=el([],[i.x,i.y,0,1],e);return new xe(r[0]/r[3],r[1]/r[3])}class jc extends Nl{}let Gc;Ee("HeatmapBucket",jc,{omit:["layers"]});var Au={get paint(){return Gc=Gc||new pi({"heatmap-radius":new Be(re.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Be(re.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Me(re.paint_heatmap["heatmap-intensity"]),"heatmap-color":new mr(re.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Me(re.paint_heatmap["heatmap-opacity"])})}};function jl(i,{width:e,height:r},a,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==e*r*a)throw new RangeError(`mismatched image size. expected: ${o.length} but got: ${e*r*a}`)}else o=new Uint8Array(e*r*a);return i.width=e,i.height=r,i.data=o,i}function Xc(i,{width:e,height:r},a){if(e===i.width&&r===i.height)return;let o=jl({},{width:e,height:r},a);Gl(i,o,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},a),i.width=e,i.height=r,i.data=o.data}function Gl(i,e,r,a,o,u){if(o.width===0||o.height===0)return e;if(o.width>i.width||o.height>i.height||r.x>i.width-o.width||r.y>i.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>e.width||o.height>e.height||a.x>e.width-o.width||a.y>e.height-o.height)throw new RangeError("out of range destination coordinates for image copy");let d=i.data,m=e.data;if(d===m)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_{e[i.evaluationKey]=_;let x=i.expression.evaluate(e);o.data[d+m+0]=Math.floor(255*x.r/x.a),o.data[d+m+1]=Math.floor(255*x.g/x.a),o.data[d+m+2]=Math.floor(255*x.b/x.a),o.data[d+m+3]=Math.floor(255*x.a)};if(i.clips)for(let d=0,m=0;d80*r){a=u=i[0],o=d=i[1];for(var M=r;Mu&&(u=m),_>d&&(d=_);x=(x=Math.max(u-a,d-o))!==0?32767/x:0}return ro(I,z,r,a,o,x,0),z}function Kc(i,e,r,a,o){var u,d;if(o===Kl(i,e,r,a)>0)for(u=e;u=e;u-=a)d=Qc(u,i[u],i[u+1],d);return d&&il(d,d.next)&&(ao(d),d=d.next),d}function ga(i,e){if(!i)return i;e||(e=i);var r,a=i;do if(r=!1,a.steiner||!il(a,a.next)&&Ot(a.prev,a,a.next)!==0)a=a.next;else{if(ao(a),(a=e=a.prev)===a.next)break;r=!0}while(r||a!==e);return e}function ro(i,e,r,a,o,u,d){if(i){!d&&u&&function(b,T,I,z){var M=b;do M.z===0&&(M.z=Hl(M.x,M.y,T,I,z)),M.prevZ=M.prev,M.nextZ=M.next,M=M.next;while(M!==b);M.prevZ.nextZ=null,M.prevZ=null,function(L){var V,$,W,Z,Y,Q,se,be,Ie=1;do{for($=L,L=null,Y=null,Q=0;$;){for(Q++,W=$,se=0,V=0;V0||be>0&&W;)se!==0&&(be===0||!W||$.z<=W.z)?(Z=$,$=$.nextZ,se--):(Z=W,W=W.nextZ,be--),Y?Y.nextZ=Z:L=Z,Z.prevZ=Y,Y=Z;$=W}Y.nextZ=null,Ie*=2}while(Q>1)}(M)}(i,a,o,u);for(var m,_,x=i;i.prev!==i.next;)if(m=i.prev,_=i.next,u?Bu(i,a,o,u):Lu(i))e.push(m.i/r|0),e.push(i.i/r|0),e.push(_.i/r|0),ao(i),i=_.next,x=_.next;else if((i=_)===x){d?d===1?ro(i=Ru(ga(i),e,r),e,r,a,o,u,2):d===2&&Fu(i,e,r,a,o,u):ro(ga(i),e,r,a,o,u,1);break}}}function Lu(i){var e=i.prev,r=i,a=i.next;if(Ot(e,r,a)>=0)return!1;for(var o=e.x,u=r.x,d=a.x,m=e.y,_=r.y,x=a.y,b=ou?o>d?o:d:u>d?u:d,z=m>_?m>x?m:x:_>x?_:x,M=a.next;M!==e;){if(M.x>=b&&M.x<=I&&M.y>=T&&M.y<=z&&is(o,m,u,_,d,x,M.x,M.y)&&Ot(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function Bu(i,e,r,a){var o=i.prev,u=i,d=i.next;if(Ot(o,u,d)>=0)return!1;for(var m=o.x,_=u.x,x=d.x,b=o.y,T=u.y,I=d.y,z=m<_?m_?m>x?m:x:_>x?_:x,V=b>T?b>I?b:I:T>I?T:I,$=Hl(z,M,e,r,a),W=Hl(L,V,e,r,a),Z=i.prevZ,Y=i.nextZ;Z&&Z.z>=$&&Y&&Y.z<=W;){if(Z.x>=z&&Z.x<=L&&Z.y>=M&&Z.y<=V&&Z!==o&&Z!==d&&is(m,b,_,T,x,I,Z.x,Z.y)&&Ot(Z.prev,Z,Z.next)>=0||(Z=Z.prevZ,Y.x>=z&&Y.x<=L&&Y.y>=M&&Y.y<=V&&Y!==o&&Y!==d&&is(m,b,_,T,x,I,Y.x,Y.y)&&Ot(Y.prev,Y,Y.next)>=0))return!1;Y=Y.nextZ}for(;Z&&Z.z>=$;){if(Z.x>=z&&Z.x<=L&&Z.y>=M&&Z.y<=V&&Z!==o&&Z!==d&&is(m,b,_,T,x,I,Z.x,Z.y)&&Ot(Z.prev,Z,Z.next)>=0)return!1;Z=Z.prevZ}for(;Y&&Y.z<=W;){if(Y.x>=z&&Y.x<=L&&Y.y>=M&&Y.y<=V&&Y!==o&&Y!==d&&is(m,b,_,T,x,I,Y.x,Y.y)&&Ot(Y.prev,Y,Y.next)>=0)return!1;Y=Y.nextZ}return!0}function Ru(i,e,r){var a=i;do{var o=a.prev,u=a.next.next;!il(o,u)&&Yc(o,a,a.next,u)&&no(o,u)&&no(u,o)&&(e.push(o.i/r|0),e.push(a.i/r|0),e.push(u.i/r|0),ao(a),ao(a.next),a=i=u),a=a.next}while(a!==i);return ga(a)}function Fu(i,e,r,a,o,u){var d=i;do{for(var m=d.next.next;m!==d.prev;){if(d.i!==m.i&&$u(d,m)){var _=Jc(d,m);return d=ga(d,d.next),_=ga(_,_.next),ro(d,e,r,a,o,u,0),void ro(_,e,r,a,o,u,0)}m=m.next}d=d.next}while(d!==i)}function Ou(i,e){return i.x-e.x}function Vu(i,e){var r=function(o,u){var d,m=u,_=o.x,x=o.y,b=-1/0;do{if(x<=m.y&&x>=m.next.y&&m.next.y!==m.y){var T=m.x+(x-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(T<=_&&T>b&&(b=T,d=m.x=m.x&&m.x>=M&&_!==m.x&&is(xd.x||m.x===d.x&&Uu(d,m)))&&(d=m,V=I)),m=m.next;while(m!==z);return d}(i,e);if(!r)return e;var a=Jc(r,i);return ga(a,a.next),ga(r,r.next)}function Uu(i,e){return Ot(i.prev,i,e.prev)<0&&Ot(e.next,i,i.next)<0}function Hl(i,e,r,a,o){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*o|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Nu(i){var e=i,r=i;do(e.x=(i-d)*(u-m)&&(i-d)*(a-m)>=(r-d)*(e-m)&&(r-d)*(u-m)>=(o-d)*(a-m)}function $u(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,a){var o=r;do{if(o.i!==r.i&&o.next.i!==r.i&&o.i!==a.i&&o.next.i!==a.i&&Yc(o,o.next,r,a))return!0;o=o.next}while(o!==r);return!1}(i,e)&&(no(i,e)&&no(e,i)&&function(r,a){var o=r,u=!1,d=(r.x+a.x)/2,m=(r.y+a.y)/2;do o.y>m!=o.next.y>m&&o.next.y!==o.y&&d<(o.next.x-o.x)*(m-o.y)/(o.next.y-o.y)+o.x&&(u=!u),o=o.next;while(o!==r);return u}(i,e)&&(Ot(i.prev,i,e.prev)||Ot(i,e.prev,e))||il(i,e)&&Ot(i.prev,i,i.next)>0&&Ot(e.prev,e,e.next)>0)}function Ot(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function il(i,e){return i.x===e.x&&i.y===e.y}function Yc(i,e,r,a){var o=nl(Ot(i,e,r)),u=nl(Ot(i,e,a)),d=nl(Ot(r,a,i)),m=nl(Ot(r,a,e));return o!==u&&d!==m||!(o!==0||!rl(i,r,e))||!(u!==0||!rl(i,a,e))||!(d!==0||!rl(r,i,a))||!(m!==0||!rl(r,e,a))}function rl(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function nl(i){return i>0?1:i<0?-1:0}function no(i,e){return Ot(i.prev,i,i.next)<0?Ot(i,e,i.next)>=0&&Ot(i,i.prev,e)>=0:Ot(i,e,i.prev)<0||Ot(i,i.next,e)<0}function Jc(i,e){var r=new Wl(i.i,i.x,i.y),a=new Wl(e.i,e.x,e.y),o=i.next,u=e.prev;return i.next=e,e.prev=i,r.next=o,o.prev=r,a.next=r,r.prev=a,u.next=a,a.prev=u,a}function Qc(i,e,r,a){var o=new Wl(i,e,r);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function ao(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Wl(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Kl(i,e,r,a){for(var o=0,u=e,d=r-a;u0&&r.holes.push(a+=i[o-1].length)}return r};var eh=te(Xl.exports);function qu(i,e,r,a,o){th(i,e,r||0,a||i.length-1,o||Zu)}function th(i,e,r,a,o){for(;a>r;){if(a-r>600){var u=a-r+1,d=e-r+1,m=Math.log(u),_=.5*Math.exp(2*m/3),x=.5*Math.sqrt(m*_*(u-_)/u)*(d-u/2<0?-1:1);th(i,e,Math.max(r,Math.floor(e-d*_/u+x)),Math.min(a,Math.floor(e+(u-d)*_/u+x)),o)}var b=i[e],T=r,I=a;for(so(i,r,e),o(i[a],b)>0&&so(i,r,a);T0;)I--}o(i[r],b)===0?so(i,r,I):so(i,++I,a),I<=e&&(r=I+1),e<=I&&(a=I-1)}}function so(i,e,r){var a=i[e];i[e]=i[r],i[r]=a}function Zu(i,e){return ie?1:0}function Yl(i,e){let r=i.length;if(r<=1)return[i];let a=[],o,u;for(let d=0;d1)for(let d=0;dr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new _e,this.indexArray=new Pt,this.indexArray2=new It,this.programConfigurations=new da(e.layers,e.zoom),this.segments=new bt,this.segments2=new bt,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=Jl("fill",this.layers,r);let o=this.layers[0].layout.get("fill-sort-key"),u=!o.isConstant(),d=[];for(let{feature:m,id:_,index:x,sourceLayerIndex:b}of e){let T=this.layers[0]._featureFilter.needGeometry,I=fa(m,T);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),I,a))continue;let z=u?o.evaluate(I,{},a,r.availableImages):void 0,M={id:_,properties:m.properties,type:m.type,sourceLayerIndex:b,index:x,geometry:T?I.geometry:ma(m),patterns:{},sortKey:z};d.push(M)}u&&d.sort((m,_)=>m.sortKey-_.sortKey);for(let m of d){let{geometry:_,index:x,sourceLayerIndex:b}=m;if(this.hasPattern){let T=Ql("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(m,_,x,a,{});r.featureIndex.insert(e[x].feature,_,x,b,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(let o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Du),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,r,a,o,u){for(let d of Yl(r,500)){let m=0;for(let z of d)m+=z.length;let _=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],T=[];for(let z of d){if(z.length===0)continue;z!==d[0]&&T.push(b.length/2);let M=this.segments2.prepareSegment(z.length,this.layoutVertexArray,this.indexArray2),L=M.vertexLength;this.layoutVertexArray.emplaceBack(z[0].x,z[0].y),this.indexArray2.emplaceBack(L+z.length-1,L),b.push(z[0].x),b.push(z[0].y);for(let V=1;V>3}if(o--,a===1||a===2)u+=i.readSVarint(),d+=i.readSVarint(),a===1&&(e&&m.push(e),e=[]),e.push(new Yu(u,d));else{if(a!==7)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&m.push(e),m},rs.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,a=0,o=0,u=0,d=1/0,m=-1/0,_=1/0,x=-1/0;i.pos>3}if(a--,r===1||r===2)(o+=i.readSVarint())m&&(m=o),(u+=i.readSVarint())<_&&(_=u),u>x&&(x=u);else if(r!==7)throw new Error("unknown command "+r)}return[d,_,m,x]},rs.prototype.toGeoJSON=function(i,e,r){var a,o,u=this.extent*Math.pow(2,r),d=this.extent*i,m=this.extent*e,_=this.loadGeometry(),x=rs.types[this.type];function b(z){for(var M=0;M>3;o=d===1?a.readString():d===2?a.readFloat():d===3?a.readDouble():d===4?a.readVarint64():d===5?a.readVarint():d===6?a.readSVarint():d===7?a.readBoolean():null}return o}(r))}sh.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new ep(this._pbf,e,this.extent,this._keys,this._values)};var ip=ah;function rp(i,e,r){if(i===3){var a=new ip(r,r.readVarint()+r.pos);a.length&&(e[a.name]=a)}}Fn.VectorTile=function(i,e){this.layers=i.readFields(rp,{},e)},Fn.VectorTileFeature=nh,Fn.VectorTileLayer=ah;let np=Fn.VectorTileFeature.types,tc=Math.pow(2,13);function oo(i,e,r,a,o,u,d,m){i.emplaceBack(e,r,2*Math.floor(a*tc)+d,o*tc*2,u*tc*2,Math.round(m))}class ic{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Re,this.centroidVertexArray=new Se,this.indexArray=new Pt,this.programConfigurations=new da(e.layers,e.zoom),this.segments=new bt,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.features=[],this.hasPattern=Jl("fill-extrusion",this.layers,r);for(let{feature:o,id:u,index:d,sourceLayerIndex:m}of e){let _=this.layers[0]._featureFilter.needGeometry,x=fa(o,_);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),x,a))continue;let b={id:u,sourceLayerIndex:m,index:d,geometry:_?x.geometry:ma(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(Ql("fill-extrusion",this.layers,b,this.zoom,r)):this.addFeature(b,b.geometry,d,a,{}),r.featureIndex.insert(o,b.geometry,d,m,this.index,!0)}}addFeatures(e,r,a){for(let o of this.features){let{geometry:u}=o;this.addFeature(o,u,o.index,r,a)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}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,Ku),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Wu.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,r,a,o,u){let d={x:0,y:0,vertexCount:0};for(let m of Yl(r,500)){let _=0;for(let M of m)_+=M.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let M of m){if(M.length===0||sp(M))continue;let L=0;for(let V=0;V=1){let W=M[V-1];if(!ap($,W)){x.vertexLength+4>bt.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let Z=$.sub(W)._perp()._unit(),Y=W.dist($);L+Y>32768&&(L=0),oo(this.layoutVertexArray,$.x,$.y,Z.x,Z.y,0,0,L),oo(this.layoutVertexArray,$.x,$.y,Z.x,Z.y,0,1,L),d.x+=2*$.x,d.y+=2*$.y,d.vertexCount+=2,L+=Y,oo(this.layoutVertexArray,W.x,W.y,Z.x,Z.y,0,0,L),oo(this.layoutVertexArray,W.x,W.y,Z.x,Z.y,0,1,L),d.x+=2*W.x,d.y+=2*W.y,d.vertexCount+=2;let Q=x.vertexLength;this.indexArray.emplaceBack(Q,Q+2,Q+1),this.indexArray.emplaceBack(Q+1,Q+2,Q+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+_>bt.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray)),np[e.type]!=="Polygon")continue;let b=[],T=[],I=x.vertexLength;for(let M of m)if(M.length!==0){M!==m[0]&&T.push(b.length/2);for(let L=0;LUt)||i.y===e.y&&(i.y<0||i.y>Ut)}function sp(i){return i.every(e=>e.x<0)||i.every(e=>e.x>Ut)||i.every(e=>e.y<0)||i.every(e=>e.y>Ut)}let oh;Ee("FillExtrusionBucket",ic,{omit:["layers","features"]});var op={get paint(){return oh=oh||new pi({"fill-extrusion-opacity":new Me(re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Be(re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Me(re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Me(re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ha(re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Be(re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Be(re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Me(re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class lp extends Qi{constructor(e){super(e,op)}createBucket(e){return new ic(e)}queryRadius(){return Jo(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,a,o,u,d,m,_){let x=Qo(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),d.angle,m),b=this.paint.get("fill-extrusion-height").evaluate(r,a),T=this.paint.get("fill-extrusion-base").evaluate(r,a),I=function(M,L,V,$){let W=[];for(let Z of M){let Y=[Z.x,Z.y,0,1];el(Y,Y,L),W.push(new xe(Y[0]/Y[3],Y[1]/Y[3]))}return W}(x,_),z=function(M,L,V,$){let W=[],Z=[],Y=$[8]*L,Q=$[9]*L,se=$[10]*L,be=$[11]*L,Ie=$[8]*V,ve=$[9]*V,ye=$[10]*V,de=$[11]*V;for(let Te of M){let fe=[],ue=[];for(let Le of Te){let ze=Le.x,Xe=Le.y,gt=$[0]*ze+$[4]*Xe+$[12],wt=$[1]*ze+$[5]*Xe+$[13],Zt=$[2]*ze+$[6]*Xe+$[14],Wi=$[3]*ze+$[7]*Xe+$[15],wi=Zt+se,Nt=Wi+be,ti=gt+Ie,si=wt+ve,Ei=Zt+ye,Ti=Wi+de,jt=new xe((gt+Y)/Nt,(wt+Q)/Nt);jt.z=wi/Nt,fe.push(jt);let Gt=new xe(ti/Ti,si/Ti);Gt.z=Ei/Ti,ue.push(Gt)}W.push(fe),Z.push(ue)}return[W,Z]}(o,T,b,_);return function(M,L,V){let $=1/0;Oc(V,L)&&($=lh(V,L[0]));for(let W=0;Wr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Ce,this.layoutVertexArray2=new vt,this.indexArray=new Pt,this.programConfigurations=new da(e.layers,e.zoom),this.segments=new bt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=Jl("line",this.layers,r);let o=this.layers[0].layout.get("line-sort-key"),u=!o.isConstant(),d=[];for(let{feature:m,id:_,index:x,sourceLayerIndex:b}of e){let T=this.layers[0]._featureFilter.needGeometry,I=fa(m,T);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),I,a))continue;let z=u?o.evaluate(I,{},a):void 0,M={id:_,properties:m.properties,type:m.type,sourceLayerIndex:b,index:x,geometry:T?I.geometry:ma(m),patterns:{},sortKey:z};d.push(M)}u&&d.sort((m,_)=>m.sortKey-_.sortKey);for(let m of d){let{geometry:_,index:x,sourceLayerIndex:b}=m;if(this.hasPattern){let T=Ql("line",this.layers,m,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(m,_,x,a,{});r.featureIndex.insert(e[x].feature,_,x,b,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(let o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,pp)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hp),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.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,a,o,u){let d=this.layers[0].layout,m=d.get("line-join").evaluate(e,{}),_=d.get("line-cap"),x=d.get("line-miter-limit"),b=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let T of r)this.addLine(T,e,m,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,u,o)}addLine(e,r,a,o,u,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let $=0;$=2&&e[_-1].equals(e[_-2]);)_--;let x=0;for(;x<_-1&&e[x].equals(e[x+1]);)x++;if(_<(m?3:2))return;a==="bevel"&&(u=1.05);let b=this.overscaling<=16?15*Ut/(512*this.overscaling):0,T=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray),I,z,M,L,V;this.e1=this.e2=-1,m&&(I=e[_-2],V=e[x].sub(I)._unit()._perp());for(let $=x;$<_;$++){if(M=$===_-1?m?e[x+1]:void 0:e[$+1],M&&e[$].equals(M))continue;V&&(L=V),I&&(z=I),I=e[$],V=M?M.sub(I)._unit()._perp():L,L=L||V;let W=L.add(V);W.x===0&&W.y===0||W._unit();let Z=L.x*V.x+L.y*V.y,Y=W.x*V.x+W.y*V.y,Q=Y!==0?1/Y:1/0,se=2*Math.sqrt(2-2*Y),be=Y0;if(be&&$>x){let de=I.dist(z);if(de>2*b){let Te=I.sub(I.sub(z)._mult(b/de)._round());this.updateDistance(z,Te),this.addCurrentVertex(Te,L,0,0,T),z=Te}}let ve=z&&M,ye=ve?a:m?"butt":o;if(ve&&ye==="round"&&(Qu&&(ye="bevel"),ye==="bevel"&&(Q>2&&(ye="flipbevel"),Q100)W=V.mult(-1);else{let de=Q*L.add(V).mag()/L.sub(V).mag();W._perp()._mult(de*(Ie?-1:1))}this.addCurrentVertex(I,W,0,0,T),this.addCurrentVertex(I,W.mult(-1),0,0,T)}else if(ye==="bevel"||ye==="fakeround"){let de=-Math.sqrt(Q*Q-1),Te=Ie?de:0,fe=Ie?0:de;if(z&&this.addCurrentVertex(I,L,Te,fe,T),ye==="fakeround"){let ue=Math.round(180*se/Math.PI/20);for(let Le=1;Le2*b){let Te=I.add(M.sub(I)._mult(b/de)._round());this.updateDistance(I,Te),this.addCurrentVertex(Te,V,0,0,T),I=Te}}}}addCurrentVertex(e,r,a,o,u,d=!1){let m=r.y*o-r.x,_=-r.y-r.x*o;this.addHalfVertex(e,r.x+r.y*a,r.y-r.x*a,d,!1,a,u),this.addHalfVertex(e,m,_,d,!0,-o,u),this.distance>ch/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,a,o,u,d))}addHalfVertex({x:e,y:r},a,o,u,d,m,_){let x=.5*(this.lineClips?this.scaledDistance*(ch-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(u?1:0),(r<<1)+(d?1:0),Math.round(63*a)+128,Math.round(63*o)+128,1+(m===0?0:m<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let b=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),_.primitiveLength++),d?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let hh,uh;Ee("LineBucket",rc,{omit:["layers","patternFeatures"]});var ph={get paint(){return uh=uh||new pi({"line-opacity":new Be(re.paint_line["line-opacity"]),"line-color":new Be(re.paint_line["line-color"]),"line-translate":new Me(re.paint_line["line-translate"]),"line-translate-anchor":new Me(re.paint_line["line-translate-anchor"]),"line-width":new Be(re.paint_line["line-width"]),"line-gap-width":new Be(re.paint_line["line-gap-width"]),"line-offset":new Be(re.paint_line["line-offset"]),"line-blur":new Be(re.paint_line["line-blur"]),"line-dasharray":new Ws(re.paint_line["line-dasharray"]),"line-pattern":new Ha(re.paint_line["line-pattern"]),"line-gradient":new mr(re.paint_line["line-gradient"])})},get layout(){return hh=hh||new pi({"line-cap":new Me(re.layout_line["line-cap"]),"line-join":new Be(re.layout_line["line-join"]),"line-miter-limit":new Me(re.layout_line["line-miter-limit"]),"line-round-limit":new Me(re.layout_line["line-round-limit"]),"line-sort-key":new Be(re.layout_line["line-sort-key"])})}};class fp extends Be{possiblyEvaluate(e,r){return r=new yt(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,a,o){return r=Jt({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,a,o)}}let al;class gp extends Qi{constructor(e){super(e,ph),this.gradientVersion=0,al||(al=new fp(ph.paint.properties["line-width"].specification),al.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let r=this.gradientExpression();this.stepInterpolant=!!function(a){return a._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof it,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=al.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new rc(e)}queryRadius(e){let r=e,a=dh(eo("line-width",this,r),eo("line-gap-width",this,r)),o=eo("line-offset",this,r);return a/2+Math.abs(o)+Jo(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,a,o,u,d,m){let _=Qo(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),d.angle,m),x=m/2*dh(this.paint.get("line-width").evaluate(r,a),this.paint.get("line-gap-width").evaluate(r,a)),b=this.paint.get("line-offset").evaluate(r,a);return b&&(o=function(T,I){let z=[];for(let M=0;M=3){for(let V=0;V0?e+2*i:i}let _p=xt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),yp=xt([{name:"a_projected_pos",components:3,type:"Float32"}],4);xt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let xp=xt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);xt([{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"}]);let mh=xt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),vp=xt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function bp(i,e,r){return i.sections.forEach(a=>{a.text=function(o,u,d){let m=u.layout.get("text-transform").evaluate(d,{});return m==="uppercase"?o=o.toLocaleUpperCase():m==="lowercase"&&(o=o.toLocaleLowerCase()),Ri.applyArabicShaping&&(o=Ri.applyArabicShaping(o)),o}(a.text,e,r)}),i}xt([{name:"triangle",components:3,type:"Uint16"}]),xt([{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"}]),xt([{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"}]),xt([{type:"Float32",name:"offsetX"}]),xt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),xt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let co={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var qt=24,fh=ht,gh=function(i,e,r,a,o){var u,d,m=8*o-a-1,_=(1<>1,b=-7,T=r?o-1:0,I=r?-1:1,z=i[e+T];for(T+=I,u=z&(1<<-b)-1,z>>=-b,b+=m;b>0;u=256*u+i[e+T],T+=I,b-=8);for(d=u&(1<<-b)-1,u>>=-b,b+=a;b>0;d=256*d+i[e+T],T+=I,b-=8);if(u===0)u=1-x;else{if(u===_)return d?NaN:1/0*(z?-1:1);d+=Math.pow(2,a),u-=x}return(z?-1:1)*d*Math.pow(2,u-a)},_h=function(i,e,r,a,o,u){var d,m,_,x=8*u-o-1,b=(1<>1,I=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=a?0:u-1,M=a?1:-1,L=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,d=b):(d=Math.floor(Math.log(e)/Math.LN2),e*(_=Math.pow(2,-d))<1&&(d--,_*=2),(e+=d+T>=1?I/_:I*Math.pow(2,1-T))*_>=2&&(d++,_/=2),d+T>=b?(m=0,d=b):d+T>=1?(m=(e*_-1)*Math.pow(2,o),d+=T):(m=e*Math.pow(2,T-1)*Math.pow(2,o),d=0));o>=8;i[r+z]=255&m,z+=M,m/=256,o-=8);for(d=d<0;i[r+z]=255&d,z+=M,d/=256,x-=8);i[r+z-M]|=128*L};function ht(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}ht.Varint=0,ht.Fixed64=1,ht.Bytes=2,ht.Fixed32=5;var nc=4294967296,yh=1/nc,xh=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function hn(i){return i.type===ht.Bytes?i.readVarint()+i.pos:i.pos+1}function ns(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function vh(i,e,r){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(a);for(var o=r.pos-1;o>=i;o--)r.buf[o+a]=r.buf[o]}function wp(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function bh(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}ht.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,u=this.pos;this.type=7&a,i(o,e,this),this.pos===u&&this.skip(a)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=sl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=bh(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=sl(this.buf,this.pos)+sl(this.buf,this.pos+4)*nc;return this.pos+=8,i},readSFixed64:function(){var i=sl(this.buf,this.pos)+bh(this.buf,this.pos+4)*nc;return this.pos+=8,i},readFloat:function(){var i=gh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=gh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,a=this.buf;return e=127&(r=a[this.pos++]),r<128?e:(e|=(127&(r=a[this.pos++]))<<7,r<128?e:(e|=(127&(r=a[this.pos++]))<<14,r<128?e:(e|=(127&(r=a[this.pos++]))<<21,r<128?e:function(o,u,d){var m,_,x=d.buf;if(m=(112&(_=x[d.pos++]))>>4,_<128||(m|=(127&(_=x[d.pos++]))<<3,_<128)||(m|=(127&(_=x[d.pos++]))<<10,_<128)||(m|=(127&(_=x[d.pos++]))<<17,_<128)||(m|=(127&(_=x[d.pos++]))<<24,_<128)||(m|=(1&(_=x[d.pos++]))<<31,_<128))return ns(o,m,u);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=a[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&xh?function(r,a,o){return xh.decode(r.subarray(a,o))}(this.buf,e,i):function(r,a,o){for(var u="",d=a;d239?4:b>223?3:b>191?2:1;if(d+I>o)break;I===1?b<128&&(T=b):I===2?(192&(m=r[d+1]))==128&&(T=(31&b)<<6|63&m)<=127&&(T=null):I===3?(_=r[d+2],(192&(m=r[d+1]))==128&&(192&_)==128&&((T=(15&b)<<12|(63&m)<<6|63&_)<=2047||T>=55296&&T<=57343)&&(T=null)):I===4&&(_=r[d+2],x=r[d+3],(192&(m=r[d+1]))==128&&(192&_)==128&&(192&x)==128&&((T=(15&b)<<18|(63&m)<<12|(63&_)<<6|63&x)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,I=1):T>65535&&(T-=65536,u+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),u+=String.fromCharCode(T),d+=I}return u}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==ht.Bytes)return i.push(this.readVarint(e));var r=hn(this);for(i=i||[];this.pos127;);else if(e===ht.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ht.Fixed32)this.pos+=4;else{if(e!==ht.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,r){var a,o;if(e>=0?(a=e%4294967296|0,o=e/4294967296|0):(o=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,o=o+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(u,d,m){m.buf[m.pos++]=127&u|128,u>>>=7,m.buf[m.pos++]=127&u|128,u>>>=7,m.buf[m.pos++]=127&u|128,u>>>=7,m.buf[m.pos++]=127&u|128,m.buf[m.pos]=127&(u>>>=7)}(a,0,r),function(u,d){var m=(7&u)<<4;d.buf[d.pos++]|=m|((u>>>=3)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u)))))}(o,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(a,o,u){for(var d,m,_=0;_55295&&d<57344){if(!m){d>56319||_+1===o.length?(a[u++]=239,a[u++]=191,a[u++]=189):m=d;continue}if(d<56320){a[u++]=239,a[u++]=191,a[u++]=189,m=d;continue}d=m-55296<<10|d-56320|65536,m=null}else m&&(a[u++]=239,a[u++]=191,a[u++]=189,m=null);d<128?a[u++]=d:(d<2048?a[u++]=d>>6|192:(d<65536?a[u++]=d>>12|224:(a[u++]=d>>18|240,a[u++]=d>>12&63|128),a[u++]=d>>6&63|128),a[u++]=63&d|128)}return u}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&vh(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),_h(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),_h(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&vh(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,e,r){this.writeTag(i,ht.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,wp,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Ep,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Ip,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Tp,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Sp,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Cp,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Ap,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,zp,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Mp,e)},writeBytesField:function(i,e){this.writeTag(i,ht.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,ht.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,ht.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,ht.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,ht.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,ht.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,ht.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,ht.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,ht.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,ht.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var ac=te(fh);let sc=3;function Pp(i,e,r){i===1&&r.readMessage(kp,e)}function kp(i,e,r){if(i===3){let{id:a,bitmap:o,width:u,height:d,left:m,top:_,advance:x}=r.readMessage(Dp,{});e.push({id:a,bitmap:new io({width:u+2*sc,height:d+2*sc},o),metrics:{width:u,height:d,left:m,top:_,advance:x}})}}function Dp(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}let wh=sc;function Eh(i){let e=0,r=0;for(let d of i)e+=d.w*d.h,r=Math.max(r,d.w);i.sort((d,m)=>m.h-d.h);let a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],o=0,u=0;for(let d of i)for(let m=a.length-1;m>=0;m--){let _=a[m];if(!(d.w>_.w||d.h>_.h)){if(d.x=_.x,d.y=_.y,u=Math.max(u,d.y+d.h),o=Math.max(o,d.x+d.w),d.w===_.w&&d.h===_.h){let x=a.pop();m=0&&a>=e&&ll[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){let a=new ss;return a.text=this.text.substring(e,r),a.sectionIndex=this.sectionIndex.slice(e,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(uo.forText(e.scale,e.fontStack||r));let a=this.sections.length-1;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function ol(i,e,r,a,o,u,d,m,_,x,b,T,I,z,M,L){let V=ss.fromFeature(i,o),$;T===c.WritingMode.vertical&&V.verticalizePunctuation();let{processBidirectionalText:W,processStyledBidirectionalText:Z}=Ri;if(W&&V.sections.length===1){$=[];let se=W(V.toString(),lc(V,x,u,e,a,z,M));for(let be of se){let Ie=new ss;Ie.text=be,Ie.sections=V.sections;for(let ve=0;ve0&&pn>Ni&&(Ni=pn)}else{let ir=Ie[Ke.fontStack],qi=ir&&ir[oi];if(qi&&qi.rect)Ar=qi.rect,_r=qi.metrics;else{let pn=be[Ke.fontStack],_o=pn&&pn[oi];if(!_o)continue;_r=_o.metrics}Ht=(Gt-Ke.scale)*qt}yr?(se.verticalizable=!0,fi.push({glyph:oi,imageName:zr,x:gt,y:wt+Ht,vertical:yr,scale:Ke.scale,fontStack:Ke.fontStack,sectionIndex:gi,metrics:_r,rect:Ar}),gt+=un*Ke.scale+Le):(fi.push({glyph:oi,imageName:zr,x:gt,y:wt+Ht,vertical:yr,scale:Ke.scale,fontStack:Ke.fontStack,sectionIndex:gi,metrics:_r,rect:Ar}),gt+=_r.advance*Ke.scale+Le)}fi.length!==0&&(Zt=Math.max(gt-Le,Zt),Rp(fi,0,fi.length-1,wi,Ni)),gt=0;let $i=de*Gt+Ni;Si.lineOffset=Math.max(Ni,mi),wt+=$i,Wi=Math.max($i,Wi),++Nt}var ti;let si=wt-ho,{horizontalAlign:Ei,verticalAlign:Ti}=cc(Te);(function(jt,Gt,mi,Si,fi,Ni,$i,Xt,Ke){let gi=(Gt-mi)*fi,oi=0;oi=Ni!==$i?-Xt*Si-ho:(-Si*Ke+.5)*$i;for(let Ht of jt)for(let _r of Ht.positionedGlyphs)_r.x+=gi,_r.y+=oi})(se.positionedLines,wi,Ei,Ti,Zt,Wi,de,si,ye.length),se.top+=-Ti*si,se.bottom=se.top+si,se.left+=-Ei*Zt,se.right=se.left+Zt}(Q,e,r,a,$,d,m,_,T,x,I,L),!function(se){for(let be of se)if(be.positionedGlyphs.length!==0)return!1;return!0}(Y)&&Q}let ll={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Lp={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Sh(i,e,r,a,o,u){if(e.imageName){let d=a[e.imageName];return d?d.displaySize[0]*e.scale*qt/u+o:0}{let d=r[e.fontStack],m=d&&d[i];return m?m.metrics.advance*e.scale+o:0}}function Ih(i,e,r,a){let o=Math.pow(i-e,2);return a?i=0,b=0;for(let I=0;Id.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Zl([]),this.placementViewportMatrix=Zl([]);let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Mh(this.zoom,r["text-size"]),this.iconSizeData=Mh(this.zoom,r["icon-size"]);let a=this.layers[0].layout,o=a.get("symbol-sort-key"),u=a.get("symbol-z-order");this.canOverlap=hc(a,"text-overlap","text-allow-overlap")!=="never"||hc(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!o.isConstant(),this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map(d=>c.WritingMode[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=e.sourceID}createArrays(){this.text=new pc(new da(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new pc(new da(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new ee,this.lineVertexArray=new ie,this.symbolInstances=new H,this.textAnchorOffsets=new he}calculateGlyphDependencies(e,r,a,o,u){for(let d=0;d0)&&(d.value.kind!=="constant"||d.value.value.length>0),b=_.value.kind!=="constant"||!!_.value.value||Object.keys(_.parameters).length>0,T=u.get("symbol-sort-key");if(this.features=[],!x&&!b)return;let I=r.iconDependencies,z=r.glyphDependencies,M=r.availableImages,L=new yt(this.zoom);for(let{feature:V,id:$,index:W,sourceLayerIndex:Z}of e){let Y=o._featureFilter.needGeometry,Q=fa(V,Y);if(!o._featureFilter.filter(L,Q,a))continue;let se,be;if(Y||(Q.geometry=ma(V)),x){let ve=o.getValueAndResolveTokens("text-field",Q,a,M),ye=Mi.factory(ve);Up(ye)&&(this.hasRTLText=!0),(!this.hasRTLText||Gs()==="unavailable"||this.hasRTLText&&Ri.isParsed())&&(se=bp(ye,o,Q))}if(b){let ve=o.getValueAndResolveTokens("icon-image",Q,a,M);be=ve instanceof xi?ve:xi.fromString(ve)}if(!se&&!be)continue;let Ie=this.sortFeaturesByKey?T.evaluate(Q,{},a):void 0;if(this.features.push({id:$,text:se,icon:be,index:W,sourceLayerIndex:Z,geometry:Q.geometry,properties:V.properties,type:Op[V.type],sortKey:Ie}),be&&(I[be.name]=!0),se){let ve=d.evaluate(Q,{},a).join(","),ye=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(c.WritingMode.vertical)>=0;for(let de of se.sections)if(de.image)I[de.image.name]=!0;else{let Te=la(se.toString()),fe=de.fontStack||ve,ue=z[fe]=z[fe]||{};this.calculateGlyphDependencies(de.text,ue,ye,this.allowVerticalPlacement,Te)}}}u.get("symbol-placement")==="line"&&(this.features=function(V){let $={},W={},Z=[],Y=0;function Q(ve){Z.push(V[ve]),Y++}function se(ve,ye,de){let Te=W[ve];return delete W[ve],W[ye]=Te,Z[Te].geometry[0].pop(),Z[Te].geometry[0]=Z[Te].geometry[0].concat(de[0]),Te}function be(ve,ye,de){let Te=$[ye];return delete $[ye],$[ve]=Te,Z[Te].geometry[0].shift(),Z[Te].geometry[0]=de[0].concat(Z[Te].geometry[0]),Te}function Ie(ve,ye,de){let Te=de?ye[0][ye[0].length-1]:ye[0][0];return`${ve}:${Te.x}:${Te.y}`}for(let ve=0;veve.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((V,$)=>V.sortKey-$.sortKey)}update(e,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,a))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(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,r){let a=this.lineVertexArray.length;if(e.segment!==void 0){let o=e.dist(r[e.segment+1]),u=e.dist(r[e.segment]),d={};for(let m=e.segment+1;m=0;m--)d[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:u},m>0&&(u+=r[m-1].dist(r[m]));for(let m=0;m0}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,r){let a=e.placedSymbolArray.get(r),o=a.vertexStartIndex+4*a.numGlyphs;for(let u=a.vertexStartIndex;uo[m]-o[_]||u[_]-u[m]),d}addToSortKeyRanges(e,r){let a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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(let r of this.symbolInstanceIndexes){let a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((o,u,d)=>{o>=0&&d.indexOf(o)===u&&this.addIndicesForPlacedSymbol(this.text,o)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Ph,kh;Ee("SymbolBucket",os,{omit:["layers","collisionBoxArray","features","compareText"]}),os.MAX_GLYPHS=65535,os.addDynamicAttributes=uc;var mc={get paint(){return kh=kh||new pi({"icon-opacity":new Be(re.paint_symbol["icon-opacity"]),"icon-color":new Be(re.paint_symbol["icon-color"]),"icon-halo-color":new Be(re.paint_symbol["icon-halo-color"]),"icon-halo-width":new Be(re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Be(re.paint_symbol["icon-halo-blur"]),"icon-translate":new Me(re.paint_symbol["icon-translate"]),"icon-translate-anchor":new Me(re.paint_symbol["icon-translate-anchor"]),"text-opacity":new Be(re.paint_symbol["text-opacity"]),"text-color":new Be(re.paint_symbol["text-color"],{runtimeType:hi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Be(re.paint_symbol["text-halo-color"]),"text-halo-width":new Be(re.paint_symbol["text-halo-width"]),"text-halo-blur":new Be(re.paint_symbol["text-halo-blur"]),"text-translate":new Me(re.paint_symbol["text-translate"]),"text-translate-anchor":new Me(re.paint_symbol["text-translate-anchor"])})},get layout(){return Ph=Ph||new pi({"symbol-placement":new Me(re.layout_symbol["symbol-placement"]),"symbol-spacing":new Me(re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Me(re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Be(re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Me(re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Me(re.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Me(re.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Me(re.layout_symbol["icon-ignore-placement"]),"icon-optional":new Me(re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Me(re.layout_symbol["icon-rotation-alignment"]),"icon-size":new Be(re.layout_symbol["icon-size"]),"icon-text-fit":new Me(re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Me(re.layout_symbol["icon-text-fit-padding"]),"icon-image":new Be(re.layout_symbol["icon-image"]),"icon-rotate":new Be(re.layout_symbol["icon-rotate"]),"icon-padding":new Be(re.layout_symbol["icon-padding"]),"icon-keep-upright":new Me(re.layout_symbol["icon-keep-upright"]),"icon-offset":new Be(re.layout_symbol["icon-offset"]),"icon-anchor":new Be(re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Me(re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Me(re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Me(re.layout_symbol["text-rotation-alignment"]),"text-field":new Be(re.layout_symbol["text-field"]),"text-font":new Be(re.layout_symbol["text-font"]),"text-size":new Be(re.layout_symbol["text-size"]),"text-max-width":new Be(re.layout_symbol["text-max-width"]),"text-line-height":new Me(re.layout_symbol["text-line-height"]),"text-letter-spacing":new Be(re.layout_symbol["text-letter-spacing"]),"text-justify":new Be(re.layout_symbol["text-justify"]),"text-radial-offset":new Be(re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Me(re.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Be(re.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Be(re.layout_symbol["text-anchor"]),"text-max-angle":new Me(re.layout_symbol["text-max-angle"]),"text-writing-mode":new Me(re.layout_symbol["text-writing-mode"]),"text-rotate":new Be(re.layout_symbol["text-rotate"]),"text-padding":new Me(re.layout_symbol["text-padding"]),"text-keep-upright":new Me(re.layout_symbol["text-keep-upright"]),"text-transform":new Be(re.layout_symbol["text-transform"]),"text-offset":new Be(re.layout_symbol["text-offset"]),"text-allow-overlap":new Me(re.layout_symbol["text-allow-overlap"]),"text-overlap":new Me(re.layout_symbol["text-overlap"]),"text-ignore-placement":new Me(re.layout_symbol["text-ignore-placement"]),"text-optional":new Me(re.layout_symbol["text-optional"])})}};class Dh{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:lr,this.defaultValue=e}evaluate(e){if(e.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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",Dh,{omit:["defaultValue"]});class hl extends Qi{constructor(e){super(e,mc)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let a=this.layout.get("text-writing-mode");if(a){let o=[];for(let u of a)o.indexOf(u)<0&&o.push(u);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,a,o){let u=this.layout.get(e).evaluate(r,{},a,o),d=this._unevaluatedLayout._values[e];return d.isDataDriven()||Ua(d.value)||!u?u:function(m,_){return _.replace(/{([^{}]+)}/g,(x,b)=>b in m?String(m[b]):"")}(r.properties,u)}createBucket(e){return new os(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of mc.paint.overridableProperties){if(!hl.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),a=new Dh(r),o=new Is(a,r.property.specification),u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new $a("source",o):new qa("composite",o,r.value.zoomStops),this.paint._values[e]=new dr(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&hl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let a=e.get("text-field"),o=mc.paint.properties[r],u=!1,d=m=>{for(let _ of m)if(o.overrides&&o.overrides.hasOverride(_))return void(u=!0)};if(a.value.kind==="constant"&&a.value.value instanceof Mi)d(a.value.value.sections);else if(a.value.kind==="source"){let m=x=>{u||(x instanceof Er&&Ue(x.value)===R?d(x.value.sections):x instanceof Ba?d(x.sections):x.eachChild(m))},_=a.value;_._styleExpression&&m(_._styleExpression.expression)}return u}}let Lh;var Np={get paint(){return Lh=Lh||new pi({"background-color":new Me(re.paint_background["background-color"]),"background-pattern":new Ws(re.paint_background["background-pattern"]),"background-opacity":new Me(re.paint_background["background-opacity"])})}};class $p extends Qi{constructor(e){super(e,Np)}}let Bh;var qp={get paint(){return Bh=Bh||new pi({"raster-opacity":new Me(re.paint_raster["raster-opacity"]),"raster-hue-rotate":new Me(re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Me(re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Me(re.paint_raster["raster-brightness-max"]),"raster-saturation":new Me(re.paint_raster["raster-saturation"]),"raster-contrast":new Me(re.paint_raster["raster-contrast"]),"raster-resampling":new Me(re.paint_raster["raster-resampling"]),"raster-fade-duration":new Me(re.paint_raster["raster-fade-duration"])})}};class Zp extends Qi{constructor(e){super(e,qp)}}class jp extends Qi{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=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 Gp{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}let fc=63710088e-1;class Un{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Un(qn(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,a=this.lat*r,o=e.lat*r,u=Math.sin(a)*Math.sin(o)+Math.cos(a)*Math.cos(o)*Math.cos((e.lng-this.lng)*r);return fc*Math.acos(Math.min(u,1))}static convert(e){if(e instanceof Un)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Un(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Un(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: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let Rh=2*Math.PI*fc;function Fh(i){return Rh*Math.cos(i*Math.PI/180)}function Oh(i){return(180+i)/360}function Vh(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Uh(i,e){return i/Fh(e)}function gc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class ul{constructor(e,r,a=0){this.x=+e,this.y=+r,this.z=+a}static fromLngLat(e,r=0){let a=Un.convert(e);return new ul(Oh(a.lng),Vh(a.lat),Uh(r,a.lat))}toLngLat(){return new Un(360*this.x-180,gc(this.y))}toAltitude(){return this.z*Fh(gc(this.y))}meterInMercatorCoordinateUnits(){return 1/Rh*(e=gc(this.y),1/Math.cos(e*Math.PI/180));var e}}function Nh(i,e,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class _c{constructor(e,r,a){if(e<0||e>25||a<0||a>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${a}, 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=r,this.y=a,this.key=mo(0,e,e,r,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,a){let o=(d=this.y,m=this.z,_=Nh(256*(u=this.x),256*(d=Math.pow(2,m)-d-1),m),x=Nh(256*(u+1),256*(d+1),m),_[0]+","+_[1]+","+x[0]+","+x[1]);var u,d,m,_,x;let b=function(T,I,z){let M,L="";for(let V=T;V>0;V--)M=1<1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,o)}isChildOf(e){let r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){let r=Math.pow(2,this.z);return new xe((e.x*r-this.x)*Ut,(e.y*r-this.y)*Ut)}toString(){return`${this.z}/${this.x}/${this.y}`}}class $h{constructor(e,r){this.wrap=e,this.canonical=r,this.key=mo(e,r.z,r.z,r.x,r.y)}}class tr{constructor(e,r,a,o,u){if(e= z; overscaledZ = ${e}; z = ${a}`);this.overscaledZ=e,this.wrap=r,this.canonical=new _c(a,+o,+u),this.key=mo(r,e,a,o,u)}clone(){return new tr(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}`);let r=this.canonical.z-e;return e>this.canonical.z?new tr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new tr(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let a=this.canonical.z-e;return e>this.canonical.z?mo(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):mo(this.wrap*+r,e,e,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new tr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,a=2*this.canonical.x,o=2*this.canonical.y;return[new tr(r,this.wrap,r,a,o),new tr(r,this.wrap,r,a+1,o),new tr(r,this.wrap,r,a,o+1),new tr(r,this.wrap,r,a+1,o+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=T),T=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,a){return e*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new er({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let o=r*this.dim,u=r*this.dim+this.dim,d=a*this.dim,m=a*this.dim+this.dim;switch(r){case-1:o=u-1;break;case 1:u=o+1}switch(a){case-1:d=m-1;break;case 1:m=d+1}let _=-r*this.dim,x=-a*this.dim;for(let b=d;b=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 jh{constructor(e,r,a,o,u){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=a,e._y=o,this.properties=e.properties,this.id=u}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class Gh{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new kn(Ut,16,0),this.grid3D=new kn(Ut,16,0),this.featureIndexArray=new pe,this.promoteId=r}insert(e,r,a,o,u,d){let m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,o,u);let _=d?this.grid3D:this.grid;for(let x=0;x=0&&T[3]>=0&&_.insert(m,T[0],T[1],T[2],T[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Fn.VectorTile(new ac(this.rawTileData)).layers,this.sourceLayerCoder=new Zh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,a,o){this.loadVTLayers();let u=e.params||{},d=Ut/e.tileSize/e.scale,m=zs(u.filter),_=e.queryGeometry,x=e.queryPadding*d,b=Hh(_),T=this.grid.query(b.minX-x,b.minY-x,b.maxX+x,b.maxY+x),I=Hh(e.cameraQueryGeometry),z=this.grid3D.query(I.minX-x,I.minY-x,I.maxX+x,I.maxY+x,(V,$,W,Z)=>function(Y,Q,se,be,Ie){for(let ye of Y)if(Q<=ye.x&&se<=ye.y&&be>=ye.x&&Ie>=ye.y)return!0;let ve=[new xe(Q,se),new xe(Q,Ie),new xe(be,Ie),new xe(be,se)];if(Y.length>2){for(let ye of ve)if(es(Y,ye))return!0}for(let ye=0;ye(Z||(Z=ma(Y)),Q.queryIntersectsFeature(_,Y,se,Z,this.z,e.transform,d,e.pixelPosMatrix)))}return M}loadMatchingFeature(e,r,a,o,u,d,m,_,x,b,T){let I=this.bucketLayerIDs[r];if(d&&!function(V,$){for(let W=0;W=0)return!0;return!1}(d,I))return;let z=this.sourceLayerCoder.decode(a),M=this.vtLayers[z].feature(o);if(u.needGeometry){let V=fa(M,!0);if(!u.filter(new yt(this.tileID.overscaledZ),V,this.tileID.canonical))return}else if(!u.filter(new yt(this.tileID.overscaledZ),M))return;let L=this.getId(M,z);for(let V=0;V{let m=e instanceof Xa?e.get(d):null;return m&&m.evaluate?m.evaluate(r,a,o):m})}function Hh(i){let e=1/0,r=1/0,a=-1/0,o=-1/0;for(let u of i)e=Math.min(e,u.x),r=Math.min(r,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y);return{minX:e,minY:r,maxX:a,maxY:o}}function Xp(i,e){return e-i}function Wh(i,e,r,a,o){let u=[];for(let d=0;d=a&&T.x>=a||(b.x>=a?b=new xe(a,b.y+(a-b.x)/(T.x-b.x)*(T.y-b.y))._round():T.x>=a&&(T=new xe(a,b.y+(a-b.x)/(T.x-b.x)*(T.y-b.y))._round()),b.y>=o&&T.y>=o||(b.y>=o?b=new xe(b.x+(o-b.y)/(T.y-b.y)*(T.x-b.x),o)._round():T.y>=o&&(T=new xe(b.x+(o-b.y)/(T.y-b.y)*(T.x-b.x),o)._round()),_&&b.equals(_[_.length-1])||(_=[b],u.push(_)),_.push(T)))))}}return u}Ee("FeatureIndex",Gh,{omit:["rawTileData","sourceLayerCoder"]});class Nn extends xe{constructor(e,r,a,o){super(e,r),this.angle=a,o!==void 0&&(this.segment=o)}clone(){return new Nn(this.x,this.y,this.angle,this.segment)}}function Kh(i,e,r,a,o){if(e.segment===void 0||r===0)return!0;let u=e,d=e.segment+1,m=0;for(;m>-r/2;){if(d--,d<0)return!1;m-=i[d].dist(u),u=i[d]}m+=i[d].dist(i[d+1]),d++;let _=[],x=0;for(;ma;)x-=_.shift().angleDelta;if(x>o)return!1;d++,m+=b.dist(T)}return!0}function Yh(i){let e=0;for(let r=0;rx){let M=(x-_)/z,L=ki.number(T.x,I.x,M),V=ki.number(T.y,I.y,M),$=new Nn(L,V,I.angleTo(T),b);return $._round(),!d||Kh(i,$,m,d,e)?$:void 0}_+=z}}function Wp(i,e,r,a,o,u,d,m,_){let x=Jh(a,u,d),b=Qh(a,o),T=b*d,I=i[0].x===0||i[0].x===_||i[0].y===0||i[0].y===_;return e-T=0&&Y<_&&Q>=0&&Q<_&&I-x>=0&&I+x<=b){let se=new Nn(Y,Q,W,M);se._round(),a&&!Kh(i,se,u,a,o)||z.push(se)}}T+=$}return m||z.length||d||(z=eu(i,T/2,r,a,o,u,d,!0,_)),z}Ee("Anchor",Nn);let ls=Ui;function tu(i,e,r,a){let o=[],u=i.image,d=u.pixelRatio,m=u.paddedRect.w-2*ls,_=u.paddedRect.h-2*ls,x=i.right-i.left,b=i.bottom-i.top,T=u.stretchX||[[0,m]],I=u.stretchY||[[0,_]],z=(de,Te)=>de+Te[1]-Te[0],M=T.reduce(z,0),L=I.reduce(z,0),V=m-M,$=_-L,W=0,Z=M,Y=0,Q=L,se=0,be=V,Ie=0,ve=$;if(u.content&&a){let de=u.content;W=pl(T,0,de[0]),Y=pl(I,0,de[1]),Z=pl(T,de[0],de[2]),Q=pl(I,de[1],de[3]),se=de[0]-W,Ie=de[1]-Y,be=de[2]-de[0]-Z,ve=de[3]-de[1]-Q}let ye=(de,Te,fe,ue)=>{let Le=dl(de.stretch-W,Z,x,i.left),ze=ml(de.fixed-se,be,de.stretch,M),Xe=dl(Te.stretch-Y,Q,b,i.top),gt=ml(Te.fixed-Ie,ve,Te.stretch,L),wt=dl(fe.stretch-W,Z,x,i.left),Zt=ml(fe.fixed-se,be,fe.stretch,M),Wi=dl(ue.stretch-Y,Q,b,i.top),wi=ml(ue.fixed-Ie,ve,ue.stretch,L),Nt=new xe(Le,Xe),ti=new xe(wt,Xe),si=new xe(wt,Wi),Ei=new xe(Le,Wi),Ti=new xe(ze/d,gt/d),jt=new xe(Zt/d,wi/d),Gt=e*Math.PI/180;if(Gt){let fi=Math.sin(Gt),Ni=Math.cos(Gt),$i=[Ni,-fi,fi,Ni];Nt._matMult($i),ti._matMult($i),Ei._matMult($i),si._matMult($i)}let mi=de.stretch+de.fixed,Si=Te.stretch+Te.fixed;return{tl:Nt,tr:ti,bl:Ei,br:si,tex:{x:u.paddedRect.x+ls+mi,y:u.paddedRect.y+ls+Si,w:fe.stretch+fe.fixed-mi,h:ue.stretch+ue.fixed-Si},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ti,pixelOffsetBR:jt,minFontScaleX:be/d/x,minFontScaleY:ve/d/b,isSDF:r}};if(a&&(u.stretchX||u.stretchY)){let de=iu(T,V,M),Te=iu(I,$,L);for(let fe=0;fe0&&(M=Math.max(10,M),this.circleDiameter=M)}else{let T=d.top*m-_[0],I=d.bottom*m+_[2],z=d.left*m-_[3],M=d.right*m+_[1],L=d.collisionPadding;if(L&&(z-=L[0]*m,T-=L[1]*m,M+=L[2]*m,I+=L[3]*m),b){let V=new xe(z,T),$=new xe(M,T),W=new xe(z,I),Z=new xe(M,I),Y=b*Math.PI/180;V._rotate(Y),$._rotate(Y),W._rotate(Y),Z._rotate(Y),z=Math.min(V.x,$.x,W.x,Z.x),M=Math.max(V.x,$.x,W.x,Z.x),T=Math.min(V.y,$.y,W.y,Z.y),I=Math.max(V.y,$.y,W.y,Z.y)}e.emplaceBack(r.x,r.y,z,T,M,I,a,o,u)}this.boxEndIndex=e.length}}class Kp{constructor(e=[],r=Yp){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:a}=this,o=r[e];for(;e>0;){let u=e-1>>1,d=r[u];if(a(o,d)>=0)break;r[e]=d,e=u}r[e]=o}_down(e){let{data:r,compare:a}=this,o=this.length>>1,u=r[e];for(;e=0)break;r[e]=m,e=d}r[e]=u}}function Yp(i,e){return ie?1:0}function Jp(i,e=1,r=!1){let a=1/0,o=1/0,u=-1/0,d=-1/0,m=i[0];for(let z=0;zu)&&(u=M.x),(!z||M.y>d)&&(d=M.y)}let _=Math.min(u-a,d-o),x=_/2,b=new Kp([],Qp);if(_===0)return new xe(a,o);for(let z=a;zT.d||!T.d)&&(T=z,r&&console.log("found best %d after %d probes",Math.round(1e4*z.d)/1e4,I)),z.max-T.d<=e||(x=z.h/2,b.push(new cs(z.p.x-x,z.p.y-x,x,i)),b.push(new cs(z.p.x+x,z.p.y-x,x,i)),b.push(new cs(z.p.x-x,z.p.y+x,x,i)),b.push(new cs(z.p.x+x,z.p.y+x,x,i)),I+=4)}return r&&(console.log(`num probes: ${I}`),console.log(`best distance: ${T.d}`)),T.p}function Qp(i,e){return e.max-i.max}function cs(i,e,r,a){this.p=new xe(i,e),this.h=r,this.d=function(o,u){let d=!1,m=1/0;for(let _=0;_o.y!=M.y>o.y&&o.x<(M.x-z.x)*(o.y-z.y)/(M.y-z.y)+z.x&&(d=!d),m=Math.min(m,Vc(o,z,M))}}return(d?1:-1)*Math.sqrt(m)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var ai;c.TextAnchorEnum=void 0,(ai=c.TextAnchorEnum||(c.TextAnchorEnum={}))[ai.center=1]="center",ai[ai.left=2]="left",ai[ai.right=3]="right",ai[ai.top=4]="top",ai[ai.bottom=5]="bottom",ai[ai["top-left"]=6]="top-left",ai[ai["top-right"]=7]="top-right",ai[ai["bottom-left"]=8]="bottom-left",ai[ai["bottom-right"]=9]="bottom-right";let $n=7,yc=Number.POSITIVE_INFINITY;function ru(i,e){return e[1]!==yc?function(r,a,o){let u=0,d=0;switch(a=Math.abs(a),o=Math.abs(o),r){case"top-right":case"top-left":case"top":d=o-$n;break;case"bottom-right":case"bottom-left":case"bottom":d=-o+$n}switch(r){case"top-right":case"bottom-right":case"right":u=-a;break;case"top-left":case"bottom-left":case"left":u=a}return[u,d]}(i,e[0],e[1]):function(r,a){let o=0,u=0;a<0&&(a=0);let d=a/Math.SQRT2;switch(r){case"top-right":case"top-left":u=d-$n;break;case"bottom-right":case"bottom-left":u=-d+$n;break;case"bottom":u=-a+$n;break;case"top":u=a-$n}switch(r){case"top-right":case"bottom-right":o=-d;break;case"top-left":case"bottom-left":o=d;break;case"left":o=a;break;case"right":o=-a}return[o,u]}(i,e[0])}function nu(i,e,r){var a;let o=i.layout,u=(a=o.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(e,{},r);if(u){let m=u.values,_=[];for(let x=0;xI*qt);b.startsWith("top")?T[1]-=$n:b.startsWith("bottom")&&(T[1]+=$n),_[x+1]=T}return new Qt(_)}let d=o.get("text-variable-anchor");if(d){let m;m=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[o.get("text-radial-offset").evaluate(e,{},r)*qt,yc]:o.get("text-offset").evaluate(e,{},r).map(x=>x*qt);let _=[];for(let x of d)_.push(x,ru(x,m));return new Qt(_)}return null}function xc(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ed(i,e,r,a,o,u,d,m,_,x,b){let T=u.textMaxSize.evaluate(e,{});T===void 0&&(T=d);let I=i.layers[0].layout,z=I.get("icon-offset").evaluate(e,{},b),M=su(r.horizontal),L=d/24,V=i.tilePixelRatio*L,$=i.tilePixelRatio*T/24,W=i.tilePixelRatio*m,Z=i.tilePixelRatio*I.get("symbol-spacing"),Y=I.get("text-padding")*i.tilePixelRatio,Q=function(ue,Le,ze,Xe=1){let gt=ue.get("icon-padding").evaluate(Le,{},ze),wt=gt&>.values;return[wt[0]*Xe,wt[1]*Xe,wt[2]*Xe,wt[3]*Xe]}(I,e,b,i.tilePixelRatio),se=I.get("text-max-angle")/180*Math.PI,be=I.get("text-rotation-alignment")!=="viewport"&&I.get("symbol-placement")!=="point",Ie=I.get("icon-rotation-alignment")==="map"&&I.get("symbol-placement")!=="point",ve=I.get("symbol-placement"),ye=Z/2,de=I.get("icon-text-fit"),Te;a&&de!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Te=zh(a,r.vertical,de,I.get("icon-text-fit-padding"),z,L)),M&&(a=zh(a,M,de,I.get("icon-text-fit-padding"),z,L)));let fe=(ue,Le)=>{Le.x<0||Le.x>=Ut||Le.y<0||Le.y>=Ut||function(ze,Xe,gt,wt,Zt,Wi,wi,Nt,ti,si,Ei,Ti,jt,Gt,mi,Si,fi,Ni,$i,Xt,Ke,gi,oi,Ht,_r){let Ar=ze.addToLineVertexArray(Xe,gt),zr,un,yr,ir,qi=0,pn=0,_o=0,hu=0,Cc=-1,Ac=-1,dn={},uu=Bt("");if(ze.allowVerticalPlacement&&wt.vertical){let _i=Nt.layout.get("text-rotate").evaluate(Ke,{},Ht)+90;yr=new fl(ti,Xe,si,Ei,Ti,wt.vertical,jt,Gt,mi,_i),wi&&(ir=new fl(ti,Xe,si,Ei,Ti,wi,fi,Ni,mi,_i))}if(Zt){let _i=Nt.layout.get("icon-rotate").evaluate(Ke,{}),rr=Nt.layout.get("icon-text-fit")!=="none",_a=tu(Zt,_i,oi,rr),Pr=wi?tu(wi,_i,oi,rr):void 0;un=new fl(ti,Xe,si,Ei,Ti,Zt,fi,Ni,!1,_i),qi=4*_a.length;let ya=ze.iconSizeData,jr=null;ya.kind==="source"?(jr=[Zr*Nt.layout.get("icon-size").evaluate(Ke,{})],jr[0]>Vn&&li(`${ze.layerIds[0]}: Value for "icon-size" is >= ${po}. Reduce your "icon-size".`)):ya.kind==="composite"&&(jr=[Zr*gi.compositeIconSizes[0].evaluate(Ke,{},Ht),Zr*gi.compositeIconSizes[1].evaluate(Ke,{},Ht)],(jr[0]>Vn||jr[1]>Vn)&&li(`${ze.layerIds[0]}: Value for "icon-size" is >= ${po}. Reduce your "icon-size".`)),ze.addSymbols(ze.icon,_a,jr,Xt,$i,Ke,c.WritingMode.none,Xe,Ar.lineStartIndex,Ar.lineLength,-1,Ht),Cc=ze.icon.placedSymbolArray.length-1,Pr&&(pn=4*Pr.length,ze.addSymbols(ze.icon,Pr,jr,Xt,$i,Ke,c.WritingMode.vertical,Xe,Ar.lineStartIndex,Ar.lineLength,-1,Ht),Ac=ze.icon.placedSymbolArray.length-1)}let pu=Object.keys(wt.horizontal);for(let _i of pu){let rr=wt.horizontal[_i];if(!zr){uu=Bt(rr.text);let Pr=Nt.layout.get("text-rotate").evaluate(Ke,{},Ht);zr=new fl(ti,Xe,si,Ei,Ti,rr,jt,Gt,mi,Pr)}let _a=rr.positionedLines.length===1;if(_o+=au(ze,Xe,rr,Wi,Nt,mi,Ke,Si,Ar,wt.vertical?c.WritingMode.horizontal:c.WritingMode.horizontalOnly,_a?pu:[_i],dn,Cc,gi,Ht),_a)break}wt.vertical&&(hu+=au(ze,Xe,wt.vertical,Wi,Nt,mi,Ke,Si,Ar,c.WritingMode.vertical,["vertical"],dn,Ac,gi,Ht));let rd=zr?zr.boxStartIndex:ze.collisionBoxArray.length,nd=zr?zr.boxEndIndex:ze.collisionBoxArray.length,ad=yr?yr.boxStartIndex:ze.collisionBoxArray.length,sd=yr?yr.boxEndIndex:ze.collisionBoxArray.length,od=un?un.boxStartIndex:ze.collisionBoxArray.length,ld=un?un.boxEndIndex:ze.collisionBoxArray.length,cd=ir?ir.boxStartIndex:ze.collisionBoxArray.length,hd=ir?ir.boxEndIndex:ze.collisionBoxArray.length,Mr=-1,_l=(_i,rr)=>_i&&_i.circleDiameter?Math.max(_i.circleDiameter,rr):rr;Mr=_l(zr,Mr),Mr=_l(yr,Mr),Mr=_l(un,Mr),Mr=_l(ir,Mr);let du=Mr>-1?1:0;du&&(Mr*=_r/qt),ze.glyphOffsetArray.length>=os.MAX_GLYPHS&&li("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ke.sortKey!==void 0&&ze.addToSortKeyRanges(ze.symbolInstances.length,Ke.sortKey);let ud=nu(Nt,Ke,Ht),[pd,dd]=function(_i,rr){let _a=_i.length,Pr=rr?.values;if(Pr?.length>0)for(let ya=0;ya=0?dn.right:-1,dn.center>=0?dn.center:-1,dn.left>=0?dn.left:-1,dn.vertical||-1,Cc,Ac,uu,rd,nd,ad,sd,od,ld,cd,hd,si,_o,hu,qi,pn,du,0,jt,Mr,pd,dd)}(i,Le,ue,r,a,o,Te,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,V,[Y,Y,Y,Y],be,_,W,Q,Ie,z,e,u,x,b,d)};if(ve==="line")for(let ue of Wh(e.geometry,0,0,Ut,Ut)){let Le=Wp(ue,Z,se,r.vertical||M,a,24,$,i.overscaling,Ut);for(let ze of Le)M&&td(i,M.text,ye,ze)||fe(ue,ze)}else if(ve==="line-center"){for(let ue of e.geometry)if(ue.length>1){let Le=Hp(ue,se,r.vertical||M,a,24,$);Le&&fe(ue,Le)}}else if(e.type==="Polygon")for(let ue of Yl(e.geometry,0)){let Le=Jp(ue,16);fe(ue[0],new Nn(Le.x,Le.y,0))}else if(e.type==="LineString")for(let ue of e.geometry)fe(ue,new Nn(ue[0].x,ue[0].y,0));else if(e.type==="Point")for(let ue of e.geometry)for(let Le of ue)fe([Le],new Nn(Le.x,Le.y,0))}function au(i,e,r,a,o,u,d,m,_,x,b,T,I,z,M){let L=function(W,Z,Y,Q,se,be,Ie,ve){let ye=Q.layout.get("text-rotate").evaluate(be,{})*Math.PI/180,de=[];for(let Te of Z.positionedLines)for(let fe of Te.positionedGlyphs){if(!fe.rect)continue;let ue=fe.rect||{},Le=wh+1,ze=!0,Xe=1,gt=0,wt=(se||ve)&&fe.vertical,Zt=fe.metrics.advance*fe.scale/2;if(ve&&Z.verticalizable&&(gt=Te.lineOffset/2-(fe.imageName?-(qt-fe.metrics.width*fe.scale)/2:(fe.scale-1)*qt)),fe.imageName){let Xt=Ie[fe.imageName];ze=Xt.sdf,Xe=Xt.pixelRatio,Le=Ui/Xe}let Wi=se?[fe.x+Zt,fe.y]:[0,0],wi=se?[0,0]:[fe.x+Zt+Y[0],fe.y+Y[1]-gt],Nt=[0,0];wt&&(Nt=wi,wi=[0,0]);let ti=fe.metrics.isDoubleResolution?2:1,si=(fe.metrics.left-Le)*fe.scale-Zt+wi[0],Ei=(-fe.metrics.top-Le)*fe.scale+wi[1],Ti=si+ue.w/ti*fe.scale/Xe,jt=Ei+ue.h/ti*fe.scale/Xe,Gt=new xe(si,Ei),mi=new xe(Ti,Ei),Si=new xe(si,jt),fi=new xe(Ti,jt);if(wt){let Xt=new xe(-Zt,Zt-ho),Ke=-Math.PI/2,gi=qt/2-Zt,oi=new xe(5-ho-gi,-(fe.imageName?gi:0)),Ht=new xe(...Nt);Gt._rotateAround(Ke,Xt)._add(oi)._add(Ht),mi._rotateAround(Ke,Xt)._add(oi)._add(Ht),Si._rotateAround(Ke,Xt)._add(oi)._add(Ht),fi._rotateAround(Ke,Xt)._add(oi)._add(Ht)}if(ye){let Xt=Math.sin(ye),Ke=Math.cos(ye),gi=[Ke,-Xt,Xt,Ke];Gt._matMult(gi),mi._matMult(gi),Si._matMult(gi),fi._matMult(gi)}let Ni=new xe(0,0),$i=new xe(0,0);de.push({tl:Gt,tr:mi,bl:Si,br:fi,tex:ue,writingMode:Z.writingMode,glyphOffset:Wi,sectionIndex:fe.sectionIndex,isSDF:ze,pixelOffsetTL:Ni,pixelOffsetBR:$i,minFontScaleX:0,minFontScaleY:0})}return de}(0,r,m,o,u,d,a,i.allowVerticalPlacement),V=i.textSizeData,$=null;V.kind==="source"?($=[Zr*o.layout.get("text-size").evaluate(d,{})],$[0]>Vn&&li(`${i.layerIds[0]}: Value for "text-size" is >= ${po}. Reduce your "text-size".`)):V.kind==="composite"&&($=[Zr*z.compositeTextSizes[0].evaluate(d,{},M),Zr*z.compositeTextSizes[1].evaluate(d,{},M)],($[0]>Vn||$[1]>Vn)&&li(`${i.layerIds[0]}: Value for "text-size" is >= ${po}. Reduce your "text-size".`)),i.addSymbols(i.text,L,$,m,u,d,x,e,_.lineStartIndex,_.lineLength,I,M);for(let W of b)T[W]=i.text.placedSymbolArray.length-1;return 4*L.length}function su(i){for(let e in i)return i[e];return null}function td(i,e,r,a){let o=i.compareText;if(e in o){let u=o[e];for(let d=u.length-1;d>=0;d--)if(a.dist(u[d])>4;if(o!==1)throw new Error(`Got v${o} data when expected v1.`);let u=ou[15&a];if(!u)throw new Error("Unrecognized array type.");let[d]=new Uint16Array(e,2,1),[m]=new Uint32Array(e,4,1);return new vc(m,d,u,e)}constructor(e,r=64,a=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let u=ou.indexOf(this.ArrayType),d=2*e*this.ArrayType.BYTES_PER_ELEMENT,m=e*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-m%8)%8;if(u<0)throw new Error(`Unexpected typed array class: ${a}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+_,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+d+m+_),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+_,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+u]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){let a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=r,a}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return bc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,a,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:u,coords:d,nodeSize:m}=this,_=[0,u.length-1,0],x=[];for(;_.length;){let b=_.pop()||0,T=_.pop()||0,I=_.pop()||0;if(T-I<=m){for(let V=I;V<=T;V++){let $=d[2*V],W=d[2*V+1];$>=e&&$<=a&&W>=r&&W<=o&&x.push(u[V])}continue}let z=I+T>>1,M=d[2*z],L=d[2*z+1];M>=e&&M<=a&&L>=r&&L<=o&&x.push(u[z]),(b===0?e<=M:r<=L)&&(_.push(I),_.push(z-1),_.push(1-b)),(b===0?a>=M:o>=L)&&(_.push(z+1),_.push(T),_.push(1-b))}return x}within(e,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:u,nodeSize:d}=this,m=[0,o.length-1,0],_=[],x=a*a;for(;m.length;){let b=m.pop()||0,T=m.pop()||0,I=m.pop()||0;if(T-I<=d){for(let V=I;V<=T;V++)cu(u[2*V],u[2*V+1],e,r)<=x&&_.push(o[V]);continue}let z=I+T>>1,M=u[2*z],L=u[2*z+1];cu(M,L,e,r)<=x&&_.push(o[z]),(b===0?e-a<=M:r-a<=L)&&(m.push(I),m.push(z-1),m.push(1-b)),(b===0?e+a>=M:r+a>=L)&&(m.push(z+1),m.push(T),m.push(1-b))}return _}}function bc(i,e,r,a,o,u){if(o-a<=r)return;let d=a+o>>1;lu(i,e,d,a,o,u),bc(i,e,r,a,d-1,1-u),bc(i,e,r,d+1,o,1-u)}function lu(i,e,r,a,o,u){for(;o>a;){if(o-a>600){let x=o-a+1,b=r-a+1,T=Math.log(x),I=.5*Math.exp(2*T/3),z=.5*Math.sqrt(T*I*(x-I)/x)*(b-x/2<0?-1:1);lu(i,e,r,Math.max(a,Math.floor(r-b*I/x+z)),Math.min(o,Math.floor(r+(x-b)*I/x+z)),u)}let d=e[2*r+u],m=a,_=o;for(fo(i,e,a,r),e[2*o+u]>d&&fo(i,e,a,o);m<_;){for(fo(i,e,m,_),m++,_--;e[2*m+u]d;)_--}e[2*a+u]===d?fo(i,e,a,_):(_++,fo(i,e,_,o)),_<=r&&(a=_+1),r<=_&&(o=_-1)}}function fo(i,e,r,a){wc(i,r,a),wc(e,2*r,2*a),wc(e,2*r+1,2*a+1)}function wc(i,e,r){let a=i[e];i[e]=i[r],i[r]=a}function cu(i,e,r,a){let o=i-r,u=e-a;return o*o+u*u}var Ec;c.PerformanceMarkers=void 0,(Ec=c.PerformanceMarkers||(c.PerformanceMarkers={})).create="create",Ec.load="load",Ec.fullLoad="fullLoad";let gl=null,go=[],Tc=1e3/60,Sc="loadTime",Ic="fullLoadTime",id={mark(i){performance.mark(i)},frame(i){let e=i;gl!=null&&go.push(e-gl),gl=e},clearMetrics(){gl=null,go=[],performance.clearMeasures(Sc),performance.clearMeasures(Ic);for(let i in c.PerformanceMarkers)performance.clearMarks(c.PerformanceMarkers[i])},getPerformanceMetrics(){performance.measure(Sc,c.PerformanceMarkers.create,c.PerformanceMarkers.load),performance.measure(Ic,c.PerformanceMarkers.create,c.PerformanceMarkers.fullLoad);let i=performance.getEntriesByName(Sc)[0].duration,e=performance.getEntriesByName(Ic)[0].duration,r=go.length,a=1/(go.reduce((u,d)=>u+d,0)/r/1e3),o=go.filter(u=>u>Tc).reduce((u,d)=>u+(d-Tc)/Tc,0);return{loadTime:i,fullLoadTime:e,fps:a,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}};c.AJAXError=ji,c.ARRAY_TYPE=ts,c.Actor=class{constructor(i,e,r){this.receive=a=>{let o=a.data,u=o.id;if(u&&(!o.targetMapId||this.mapId===o.targetMapId))if(o.type===""){delete this.tasks[u];let d=this.cancelCallbacks[u];delete this.cancelCallbacks[u],d&&d()}else Zi()||o.mustQueue?(this.tasks[u]=o,this.taskQueue.push(u),this.invoker.trigger()):this.processTask(u,o)},this.process=()=>{if(!this.taskQueue.length)return;let a=this.taskQueue.shift(),o=this.tasks[a];delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),o&&this.processTask(a,o)},this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Gp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Zi()?i:window}send(i,e,r,a,o=!1){let u=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[u]=r);let d=Zn(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:i,hasCallback:!!r,targetMapId:a,mustQueue:o,sourceMapId:this.mapId,data:Dn(e,d)},d),{cancel:()=>{r&&delete this.callbacks[u],this.target.postMessage({id:u,type:"",targetMapId:a,sourceMapId:this.mapId})}}}processTask(i,e){if(e.type===""){let r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(oa(e.error)):r(null,oa(e.data)))}else{let r=!1,a=Zn(this.globalScope)?void 0:[],o=e.hasCallback?(m,_)=>{r=!0,delete this.cancelCallbacks[i],this.target.postMessage({id:i,type:"",sourceMapId:this.mapId,error:m?Dn(m):null,data:Dn(_,a)},a)}:m=>{r=!0},u=null,d=oa(e.data);if(this.parent[e.type])u=this.parent[e.type](e.sourceMapId,d,o);else if(this.parent.getWorkerSource){let m=e.type.split(".");u=this.parent.getWorkerSource(e.sourceMapId,m[0],d.source)[m[1]](d,o)}else o(new Error(`Could not find function ${e.type}`));!r&&u&&u.cancel&&(this.cancelCallbacks[i]=u.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},c.AlphaImage=io,c.CanonicalTileID=_c,c.CollisionBoxArray=k,c.CollisionCircleLayoutArray=class extends l{},c.Color=lt,c.DEMData=qh,c.DataConstantProperty=Me,c.DictionaryCoder=Zh,c.EXTENT=Ut,c.ErrorEvent=Yr,c.EvaluationParameters=yt,c.Event=wr,c.Evented=vn,c.FeatureIndex=Gh,c.FillBucket=ec,c.FillExtrusionBucket=ic,c.GeoJSONFeature=jh,c.ImageAtlas=Th,c.ImagePosition=oc,c.KDBush=vc,c.LineBucket=rc,c.LineStripIndexArray=class extends B{},c.LngLat=Un,c.MercatorCoordinate=ul,c.ONE_EM=qt,c.OverscaledTileID=tr,c.PerformanceUtils=id,c.Point=xe,c.Pos3dArray=class extends Ur{},c.PosArray=Se,c.Properties=pi,c.Protobuf=ac,c.QuadTriangleArray=class extends f{},c.RGBAImage=er,c.RasterBoundsArray=class extends Ys{},c.RequestPerformance=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},c.SegmentVector=bt,c.SymbolBucket=os,c.Transitionable=jo,c.TriangleIndexArray=Pt,c.Uniform1f=Ja,c.Uniform1i=class extends ln{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},c.Uniform2f=class extends ln{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},c.Uniform3f=class extends ln{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},c.Uniform4f=Wo,c.UniformColor=Ko,c.UniformMatrix4f=class extends ln{constructor(i,e){super(i,e),this.current=Vl}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},c.UnwrappedTileID=$h,c.ValidationError=me,c.ZoomHistory=Os,c.__awaiter=Wt,c.addDynamicAttributes=uc,c.arrayBufferToImage=function(i,e){let r=new Image;r.onload=()=>{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=Dr})},r.onerror=()=>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."));let a=new Blob([new Uint8Array(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(a):Dr},c.arrayBufferToImageBitmap=function(i,e){let r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).then(a=>{e(null,a)}).catch(a=>{e(new Error(`Could not load image because of ${a.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},c.asyncAll=function(i,e,r){if(!i.length)return r(null,[]);let a=i.length,o=new Array(i.length),u=null;i.forEach((d,m)=>{e(d,(_,x)=>{_&&(u=_),o[m]=x,--a==0&&r(u,o)})})},c.bezier=Ii,c.browser=fn,c.clamp=ar,c.clipLine=Wh,c.clone=function(i){var e=new ts(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},c.clone$1=Ki,c.collisionCircleLayout=vp,c.config=gn,c.copy=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.create=function(){var i=new ts(16);return ts!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},c.createExpression=Na,c.createFilter=zs,c.createLayout=xt,c.createStyleLayer=function(i){if(i.type==="custom")return new jp(i);switch(i.type){case"background":return new $p(i);case"circle":return new Cu(i);case"fill":return new Xu(i);case"fill-extrusion":return new lp(i);case"heatmap":return new zu(i);case"hillshade":return new Pu(i);case"line":return new gp(i);case"raster":return new Zp(i);case"symbol":return new hl(i)}},c.deepEqual=function i(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let a=0;a{a[d.source]?r.push({command:Je.removeLayer,args:[d.id]}):u.push(d)}),r=r.concat(o),function(d,m,_){m=m||[];let x=(d=d||[]).map(Jr),b=m.map(Jr),T=d.reduce(Qr,{}),I=m.reduce(Qr,{}),z=x.slice(),M=Object.create(null),L,V,$,W,Z,Y,Q;for(L=0,V=0;L{}}},c.groupByLayout=function(i,e){let r={};for(let o=0;o@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,a,o,u)=>{let d=o||u;return e[a]=!d||d.toLowerCase(),""}),e["max-age"]){let r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},c.parseGlyphPbf=function(i){return new ac(i).readFields(Pp,[])},c.pbf=fh,c.performSymbolLayout=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=Ut/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;let e=i.bucket.layers[0],r=e.layout,a=e._unevaluatedLayout._values,o={layoutIconSize:a["icon-size"].possiblyEvaluate(new yt(i.bucket.zoom+1),i.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new yt(i.bucket.zoom+1),i.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new yt(18))};if(i.bucket.textSizeData.kind==="composite"){let{minZoom:x,maxZoom:b}=i.bucket.textSizeData;o.compositeTextSizes=[a["text-size"].possiblyEvaluate(new yt(x),i.canonical),a["text-size"].possiblyEvaluate(new yt(b),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){let{minZoom:x,maxZoom:b}=i.bucket.iconSizeData;o.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new yt(x),i.canonical),a["icon-size"].possiblyEvaluate(new yt(b),i.canonical)]}let u=r.get("text-line-height")*qt,d=r.get("text-rotation-alignment")!=="viewport"&&r.get("symbol-placement")!=="point",m=r.get("text-keep-upright"),_=r.get("text-size");for(let x of i.bucket.features){let b=r.get("text-font").evaluate(x,{},i.canonical).join(","),T=_.evaluate(x,{},i.canonical),I=o.layoutTextSize.evaluate(x,{},i.canonical),z=o.layoutIconSize.evaluate(x,{},i.canonical),M={horizontal:{},vertical:void 0},L=x.text,V,$=[0,0];if(L){let Y=L.toString(),Q=r.get("text-letter-spacing").evaluate(x,{},i.canonical)*qt,se=Bl(Y)?Q:0,be=r.get("text-anchor").evaluate(x,{},i.canonical),Ie=nu(e,x,i.canonical);if(!Ie){let fe=r.get("text-radial-offset").evaluate(x,{},i.canonical);$=fe?ru(be,[fe*qt,yc]):r.get("text-offset").evaluate(x,{},i.canonical).map(ue=>ue*qt)}let ve=d?"center":r.get("text-justify").evaluate(x,{},i.canonical),ye=r.get("symbol-placement"),de=ye==="point"?r.get("text-max-width").evaluate(x,{},i.canonical)*qt:0,Te=()=>{i.bucket.allowVerticalPlacement&&la(Y)&&(M.vertical=ol(L,i.glyphMap,i.glyphPositions,i.imagePositions,b,de,u,be,"left",se,$,c.WritingMode.vertical,!0,ye,I,T))};if(!d&&Ie){let fe=new Set;if(ve==="auto")for(let Le=0;Lethis._layers[oe.id]),X=N[0];if(X.visibility==="none")continue;let j=X.source||"",q=this.familiesBySource[j];q||(q=this.familiesBySource[j]={});let K=X.sourceLayer||"_geojsonTileLayer",ne=q[K];ne||(ne=q[K]=[]),ne.push(N)}}}class te{constructor(S){let C={},P=[];for(let j in S){let q=S[j],K=C[j]={};for(let ne in q){let oe=q[+ne];if(!oe||oe.bitmap.width===0||oe.bitmap.height===0)continue;let le={x:0,y:0,w:oe.bitmap.width+2,h:oe.bitmap.height+2};P.push(le),K[ne]={rect:le,metrics:oe.metrics}}}let{w:F,h:N}=c.potpack(P),X=new c.AlphaImage({width:F||1,height:N||1});for(let j in S){let q=S[j];for(let K in q){let ne=q[+K];if(!ne||ne.bitmap.width===0||ne.bitmap.height===0)continue;let oe=C[j][K].rect;c.AlphaImage.copy(ne.bitmap,X,{x:0,y:0},{x:oe.x+1,y:oe.y+1},ne.bitmap)}}this.image=X,this.positions=C}}c.register("GlyphAtlas",te);class Fe{constructor(S){this.tileID=new c.OverscaledTileID(S.tileID.overscaledZ,S.tileID.wrap,S.tileID.canonical.z,S.tileID.canonical.x,S.tileID.canonical.y),this.uid=S.uid,this.zoom=S.zoom,this.pixelRatio=S.pixelRatio,this.tileSize=S.tileSize,this.source=S.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=S.showCollisionBoxes,this.collectResourceTiming=!!S.collectResourceTiming,this.returnDependencies=!!S.returnDependencies,this.promoteId=S.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(S,C,P,F,N){this.status="parsing",this.data=S,this.collisionBoxArray=new c.CollisionBoxArray;let X=new c.DictionaryCoder(Object.keys(S.layers).sort()),j=new c.FeatureIndex(this.tileID,this.promoteId);j.bucketLayerIDs=[];let q={},K={featureIndex:j,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:P},ne=C.familiesBySource[this.source];for(let tt in ne){let Qe=S.layers[tt];if(!Qe)continue;Qe.version===1&&c.warnOnce(`Vector tile source "${this.source}" layer "${tt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let ri=X.encode(tt),dt=[];for(let kt=0;kt=Vt.maxzoom||Vt.visibility!=="none"&&(Pe(kt,this.zoom,P),(q[Vt.id]=Vt.createBucket({index:j.bucketLayerIDs.length,layers:kt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ri,sourceID:this.source})).populate(dt,K,this.tileID.canonical),j.bucketLayerIDs.push(kt.map(Br=>Br.id)))}}let oe,le,De,Oe,Ae=c.mapObject(K.glyphDependencies,tt=>Object.keys(tt).map(Number));this.inFlightDependencies.forEach(tt=>tt?.cancel()),this.inFlightDependencies=[];let ke=++this.dependencySentinel;Object.keys(Ae).length?this.inFlightDependencies.push(F.send("getGlyphs",{uid:this.uid,stacks:Ae,source:this.source,tileID:this.tileID,type:"glyphs"},(tt,Qe)=>{ke===this.dependencySentinel&&(oe||(oe=tt,le=Qe,ct.call(this)))})):le={};let Ze=Object.keys(K.iconDependencies);Ze.length?this.inFlightDependencies.push(F.send("getImages",{icons:Ze,source:this.source,tileID:this.tileID,type:"icons"},(tt,Qe)=>{ke===this.dependencySentinel&&(oe||(oe=tt,De=Qe,ct.call(this)))})):De={};let at=Object.keys(K.patternDependencies);function ct(){if(oe)return N(oe);if(le&&De&&Oe){let tt=new te(le),Qe=new c.ImageAtlas(De,Oe);for(let ri in q){let dt=q[ri];dt instanceof c.SymbolBucket?(Pe(dt.layers,this.zoom,P),c.performSymbolLayout({bucket:dt,glyphMap:le,glyphPositions:tt.positions,imageMap:De,imagePositions:Qe.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):dt.hasPattern&&(dt instanceof c.LineBucket||dt instanceof c.FillBucket||dt instanceof c.FillExtrusionBucket)&&(Pe(dt.layers,this.zoom,P),dt.addFeatures(K,this.tileID.canonical,Qe.patternPositions))}this.status="done",N(null,{buckets:Object.values(q).filter(ri=>!ri.isEmpty()),featureIndex:j,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:tt.image,imageAtlas:Qe,glyphMap:this.returnDependencies?le:null,iconMap:this.returnDependencies?De:null,glyphPositions:this.returnDependencies?tt.positions:null})}}at.length?this.inFlightDependencies.push(F.send("getImages",{icons:at,source:this.source,tileID:this.tileID,type:"patterns"},(tt,Qe)=>{ke===this.dependencySentinel&&(oe||(oe=tt,Oe=Qe,ct.call(this)))})):Oe={},ct.call(this)}}function Pe(R,S,C){let P=new c.EvaluationParameters(S);for(let F of R)F.recalculate(P,C)}function xe(R,S){let C=c.getArrayBuffer(R.request,(P,F,N,X)=>{if(P)S(P);else if(F)try{let j=new c.vectorTile.VectorTile(new c.Protobuf(F));S(null,{vectorTile:j,rawData:F,cacheControl:N,expires:X})}catch(j){let q=new Uint8Array(F),K=`Unable to parse the tile at ${R.request.url}, `;K+=q[0]===31&&q[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${j.messge}`,S(new Error(K))}});return()=>{C.cancel(),S()}}class Et{constructor(S,C,P,F){this.actor=S,this.layerIndex=C,this.availableImages=P,this.loadVectorData=F||xe,this.fetching={},this.loading={},this.loaded={}}loadTile(S,C){let P=S.uid;this.loading||(this.loading={});let F=!!(S&&S.request&&S.request.collectResourceTiming)&&new c.RequestPerformance(S.request),N=this.loading[P]=new Fe(S);N.abort=this.loadVectorData(S,(X,j)=>{if(delete this.loading[P],X||!j)return N.status="done",this.loaded[P]=N,C(X);let q=j.rawData,K={};j.expires&&(K.expires=j.expires),j.cacheControl&&(K.cacheControl=j.cacheControl);let ne={};if(F){let oe=F.finish();oe&&(ne.resourceTiming=JSON.parse(JSON.stringify(oe)))}N.vectorTile=j.vectorTile,N.parse(j.vectorTile,this.layerIndex,this.availableImages,this.actor,(oe,le)=>{if(delete this.fetching[P],oe||!le)return C(oe);C(null,c.extend({rawTileData:q.slice(0)},le,K,ne))}),this.loaded=this.loaded||{},this.loaded[P]=N,this.fetching[P]={rawTileData:q,cacheControl:K,resourceTiming:ne}})}reloadTile(S,C){let P=this.loaded,F=S.uid;if(P&&P[F]){let N=P[F];N.showCollisionBoxes=S.showCollisionBoxes,N.status==="parsing"?N.parse(N.vectorTile,this.layerIndex,this.availableImages,this.actor,(X,j)=>{if(X||!j)return C(X,j);let q;if(this.fetching[F]){let{rawTileData:K,cacheControl:ne,resourceTiming:oe}=this.fetching[F];delete this.fetching[F],q=c.extend({rawTileData:K.slice(0)},j,ne,oe)}else q=j;C(null,q)}):N.status==="done"&&(N.vectorTile?N.parse(N.vectorTile,this.layerIndex,this.availableImages,this.actor,C):C())}}abortTile(S,C){let P=this.loading,F=S.uid;P&&P[F]&&P[F].abort&&(P[F].abort(),delete P[F]),C()}removeTile(S,C){let P=this.loaded,F=S.uid;P&&P[F]&&delete P[F],C()}}class ii{constructor(){this.loaded={}}loadTile(S,C){return c.__awaiter(this,void 0,void 0,function*(){let{uid:P,encoding:F,rawImageData:N,redFactor:X,greenFactor:j,blueFactor:q,baseShift:K}=S,ne=N.width+2,oe=N.height+2,le=c.isImageBitmap(N)?new c.RGBAImage({width:ne,height:oe},yield c.getImageData(N,-1,-1,ne,oe)):N,De=new c.DEMData(P,le,F,X,j,q,K);this.loaded=this.loaded||{},this.loaded[P]=De,C(null,De)})}removeTile(S){let C=this.loaded,P=S.uid;C&&C[P]&&delete C[P]}}function Yt(R,S){if(R.length!==0){st(R[0],S);for(var C=1;C=Math.abs(j)?C-q+j:j-q+C,C=q}C+P>=0!=!!S&&R.reverse()}var Ye=c.getDefaultExportFromCjs(function R(S,C){var P,F=S&&S.type;if(F==="FeatureCollection")for(P=0;P>31}function Zi(R,S){for(var C=R.loadGeometry(),P=R.type,F=0,N=0,X=C.length,j=0;jR},Dr=Math.fround||(Xr=new Float32Array(1),R=>(Xr[0]=+R,Xr[0]));var Xr;let mt=3,ci=5,Lr=6;class Hr{constructor(S){this.options=Object.assign(Object.create(jn),S),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(S){let{log:C,minZoom:P,maxZoom:F}=this.options;C&&console.time("total time");let N=`prepare ${S.length} points`;C&&console.time(N),this.points=S;let X=[];for(let q=0;q=P;q--){let K=+Date.now();j=this.trees[q]=this._createTree(this._cluster(j,q)),C&&console.log("z%d: %d clusters in %dms",q,j.numItems,+Date.now()-K)}return C&&console.timeEnd("total time"),this}getClusters(S,C){let P=((S[0]+180)%360+360)%360-180,F=Math.max(-90,Math.min(90,S[1])),N=S[2]===180?180:((S[2]+180)%360+360)%360-180,X=Math.max(-90,Math.min(90,S[3]));if(S[2]-S[0]>=360)P=-180,N=180;else if(P>N){let oe=this.getClusters([P,F,180,X],C),le=this.getClusters([-180,F,N,X],C);return oe.concat(le)}let j=this.trees[this._limitZoom(C)],q=j.range(ji(P),Ai(X),ji(N),Ai(F)),K=j.data,ne=[];for(let oe of q){let le=this.stride*oe;ne.push(K[le+ci]>1?fn(K,le,this.clusterProps):this.points[K[le+mt]])}return ne}getChildren(S){let C=this._getOriginId(S),P=this._getOriginZoom(S),F="No cluster with the specified id.",N=this.trees[P];if(!N)throw new Error(F);let X=N.data;if(C*this.stride>=X.length)throw new Error(F);let j=this.options.radius/(this.options.extent*Math.pow(2,P-1)),q=N.within(X[C*this.stride],X[C*this.stride+1],j),K=[];for(let ne of q){let oe=ne*this.stride;X[oe+4]===S&&K.push(X[oe+ci]>1?fn(X,oe,this.clusterProps):this.points[X[oe+mt]])}if(K.length===0)throw new Error(F);return K}getLeaves(S,C,P){let F=[];return this._appendLeaves(F,S,C=C||10,P=P||0,0),F}getTile(S,C,P){let F=this.trees[this._limitZoom(S)],N=Math.pow(2,S),{extent:X,radius:j}=this.options,q=j/X,K=(P-q)/N,ne=(P+1+q)/N,oe={features:[]};return this._addTileFeatures(F.range((C-q)/N,K,(C+1+q)/N,ne),F.data,C,P,N,oe),C===0&&this._addTileFeatures(F.range(1-q/N,K,1,ne),F.data,N,P,N,oe),C===N-1&&this._addTileFeatures(F.range(0,K,q/N,ne),F.data,-1,P,N,oe),oe.features.length?oe:null}getClusterExpansionZoom(S){let C=this._getOriginZoom(S)-1;for(;C<=this.options.maxZoom;){let P=this.getChildren(S);if(C++,P.length!==1)break;S=P[0].properties.cluster_id}return C}_appendLeaves(S,C,P,F,N){let X=this.getChildren(C);for(let j of X){let q=j.properties;if(q&&q.cluster?N+q.point_count<=F?N+=q.point_count:N=this._appendLeaves(S,q.cluster_id,P,F,N):N1,ne,oe,le;if(K)ne=gn(C,q,this.clusterProps),oe=C[q],le=C[q+1];else{let Ae=this.points[C[q+mt]];ne=Ae.properties;let[ke,Ze]=Ae.geometry.coordinates;oe=ji(ke),le=Ai(Ze)}let De={type:1,geometry:[[Math.round(this.options.extent*(oe*N-P)),Math.round(this.options.extent*(le*N-F))]],tags:ne},Oe;Oe=K||this.options.generateId?C[q+mt]:this.points[C[q+mt]].id,Oe!==void 0&&(De.id=Oe),X.features.push(De)}}_limitZoom(S){return Math.max(this.options.minZoom,Math.min(Math.floor(+S),this.options.maxZoom+1))}_cluster(S,C){let{radius:P,extent:F,reduce:N,minPoints:X}=this.options,j=P/(F*Math.pow(2,C)),q=S.data,K=[],ne=this.stride;for(let oe=0;oeC&&(ke+=q[at+ci])}if(ke>Ae&&ke>=X){let Ze,at=le*Ae,ct=De*Ae,tt=-1,Qe=((oe/ne|0)<<5)+(C+1)+this.points.length;for(let ri of Oe){let dt=ri*ne;if(q[dt+2]<=C)continue;q[dt+2]=C;let kt=q[dt+ci];at+=q[dt]*kt,ct+=q[dt+1]*kt,q[dt+4]=Qe,N&&(Ze||(Ze=this._map(q,oe,!0),tt=this.clusterProps.length,this.clusterProps.push(Ze)),N(Ze,this._map(q,dt)))}q[oe+4]=Qe,K.push(at/ke,ct/ke,1/0,Qe,-1,ke),N&&K.push(tt)}else{for(let Ze=0;Ze1)for(let Ze of Oe){let at=Ze*ne;if(!(q[at+2]<=C)){q[at+2]=C;for(let ct=0;ct>5}_getOriginZoom(S){return(S-this.points.length)%32}_map(S,C,P){if(S[C+ci]>1){let X=this.clusterProps[S[C+Lr]];return P?Object.assign({},X):X}let F=this.points[S[C+mt]].properties,N=this.options.map(F);return P&&N===F?Object.assign({},N):N}}function fn(R,S,C){return{type:"Feature",id:R[S+mt],properties:gn(R,S,C),geometry:{type:"Point",coordinates:[(P=R[S],360*(P-.5)),Gn(R[S+1])]}};var P}function gn(R,S,C){let P=R[S+ci],F=P>=1e4?`${Math.round(P/1e3)}k`:P>=1e3?Math.round(P/100)/10+"k":P,N=R[S+Lr],X=N===-1?{}:Object.assign({},C[N]);return Object.assign(X,{cluster:!0,cluster_id:R[S+mt],point_count:P,point_count_abbreviated:F})}function ji(R){return R/360+.5}function Ai(R){let S=Math.sin(R*Math.PI/180),C=.5-.25*Math.log((1+S)/(1-S))/Math.PI;return C<0?0:C>1?1:C}function Gn(R){let S=(180-360*R)*Math.PI/180;return 360*Math.atan(Math.exp(S))/Math.PI-90}function Wr(R,S,C,P){for(var F,N=P,X=C-S>>1,j=C-S,q=R[S],K=R[S+1],ne=R[C],oe=R[C+1],le=S+3;leN)F=le,N=De;else if(De===N){var Oe=Math.abs(le-X);OeP&&(F-S>3&&Wr(R,S,F,P),R[F+2]=N,C-F>3&&Wr(R,F,C,P))}function _n(R,S,C,P,F,N){var X=F-C,j=N-P;if(X!==0||j!==0){var q=((R-C)*X+(S-P)*j)/(X*X+j*j);q>1?(C=F,P=N):q>0&&(C+=X*q,P+=j*q)}return(X=R-C)*X+(j=S-P)*j}function br(R,S,C,P){var F={id:R===void 0?null:R,type:S,geometry:C,tags:P,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(N){var X=N.geometry,j=N.type;if(j==="Point"||j==="MultiPoint"||j==="LineString")yn(N,X);else if(j==="Polygon"||j==="MultiLineString")for(var q=0;q0&&(X+=P?(F*K-q*N)/2:Math.sqrt(Math.pow(q-F,2)+Math.pow(K-N,2))),F=q,N=K}var ne=S.length-3;S[2]=1,Wr(S,0,ne,C),S[ne+2]=1,S.size=Math.abs(X),S.start=0,S.end=S.size}function Yr(R,S,C,P){for(var F=0;F1?1:C}function zi(R,S,C,P,F,N,X,j){if(P/=S,N>=(C/=S)&&X=P)return null;for(var q=[],K=0;K=C&&Oe=P)){var Ae=[];if(le==="Point"||le==="MultiPoint")va(oe,Ae,C,P,F);else if(le==="LineString")ot(oe,Ae,C,P,F,!1,j.lineMetrics);else if(le==="MultiLineString")bn(oe,Ae,C,P,F,!1);else if(le==="Polygon")bn(oe,Ae,C,P,F,!0);else if(le==="MultiPolygon")for(var ke=0;ke=C&&X<=P&&(S.push(R[N]),S.push(R[N+1]),S.push(R[N+2]))}}function ot(R,S,C,P,F,N,X){for(var j,q,K=Je(R),ne=F===0?ba:hs,oe=R.start,le=0;leC&&(q=ne(K,De,Oe,ke,Ze,C),X&&(K.start=oe+j*q)):at>P?ct=C&&(q=ne(K,De,Oe,ke,Ze,C),tt=!0),ct>P&&at<=P&&(q=ne(K,De,Oe,ke,Ze,P),tt=!0),!N&&tt&&(X&&(K.end=oe+j*q),S.push(K),K=Je(R)),X&&(oe+=j)}var Qe=R.length-3;De=R[Qe],Oe=R[Qe+1],Ae=R[Qe+2],(at=F===0?De:Oe)>=C&&at<=P&&sr(K,De,Oe,Ae),Qe=K.length-3,N&&Qe>=3&&(K[Qe]!==K[0]||K[Qe+1]!==K[1])&&sr(K,K[0],K[1],K[2]),K.length&&S.push(K)}function Je(R){var S=[];return S.size=R.size,S.start=R.start,S.end=R.end,S}function bn(R,S,C,P,F,N){for(var X=0;XX.maxX&&(X.maxX=ne),oe>X.maxY&&(X.maxY=oe)}return X}function yi(R,S,C,P){var F=S.geometry,N=S.type,X=[];if(N==="Point"||N==="MultiPoint")for(var j=0;j0&&S.size<(F?X:P))C.numPoints+=S.length/3;else{for(var j=[],q=0;qX)&&(C.numSimplified++,j.push(S[q]),j.push(S[q+1])),C.numPoints++;F&&function(K,ne){for(var oe=0,le=0,De=K.length,Oe=De-2;le0===ne)for(le=0,De=K.length;le24)throw new Error("maxZoom should be in the 0-24 range");if(S.promoteId&&S.generateId)throw new Error("promoteId and generateId cannot be used together.");var P=function(F,N){var X=[];if(F.type==="FeatureCollection")for(var j=0;j1&&console.time("creation"),le=this.tiles[oe]=$t(R,S,C,P,q),this.tileCoords.push({z:S,x:C,y:P}),K)){K>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",S,C,P,le.numFeatures,le.numPoints,le.numSimplified),console.timeEnd("creation"));var De="z"+S;this.stats[De]=(this.stats[De]||0)+1,this.total++}if(le.source=R,F){if(S===q.maxZoom||S===F)continue;var Oe=1<1&&console.time("clipping");var Ae,ke,Ze,at,ct,tt,Qe=.5*q.buffer/q.extent,ri=.5-Qe,dt=.5+Qe,kt=1+Qe;Ae=ke=Ze=at=null,ct=zi(R,ne,C-Qe,C+dt,0,le.minX,le.maxX,q),tt=zi(R,ne,C+ri,C+kt,0,le.minX,le.maxX,q),R=null,ct&&(Ae=zi(ct,ne,P-Qe,P+dt,1,le.minY,le.maxY,q),ke=zi(ct,ne,P+ri,P+kt,1,le.minY,le.maxY,q),ct=null),tt&&(Ze=zi(tt,ne,P-Qe,P+dt,1,le.minY,le.maxY,q),at=zi(tt,ne,P+ri,P+kt,1,le.minY,le.maxY,q),tt=null),K>1&&console.timeEnd("clipping"),j.push(Ae||[],S+1,2*C,2*P),j.push(ke||[],S+1,2*C,2*P+1),j.push(Ze||[],S+1,2*C+1,2*P),j.push(at||[],S+1,2*C+1,2*P+1)}}},lr.prototype.getTile=function(R,S,C){var P=this.options,F=P.extent,N=P.debug;if(R<0||R>24)return null;var X=1<1&&console.log("drilling down to z%d-%d-%d",R,S,C);for(var q,K=R,ne=S,oe=C;!q&&K>0;)K--,ne=Math.floor(ne/2),oe=Math.floor(oe/2),q=this.tiles[ge(K,ne,oe)];return q&&q.source?(N>1&&console.log("found parent tile z%d-%d-%d",K,ne,oe),N>1&&console.time("drilling down"),this.splitTile(q.source,K,ne,oe,R,S,C),N>1&&console.timeEnd("drilling down"),this.tiles[j]?Qr(this.tiles[j],F):null):null};class qe extends Et{constructor(S,C,P,F){super(S,C,P,cr),this._dataUpdateable=new Map,this.loadGeoJSON=(N,X)=>{let{promoteId:j}=N;if(N.request)return c.getJSON(N.request,(q,K,ne,oe)=>{this._dataUpdateable=$e(K,j)?hi(K,j):void 0,X(q,K,ne,oe)});if(typeof N.data=="string")try{let q=JSON.parse(N.data);this._dataUpdateable=$e(q,j)?hi(q,j):void 0,X(null,q)}catch{X(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`))}else N.dataDiff?this._dataUpdateable?(function(q,K,ne){var oe,le,De,Oe;if(K.removeAll&&q.clear(),K.remove)for(let Ae of K.remove)q.delete(Ae);if(K.add)for(let Ae of K.add){let ke=Ne(Ae,ne);ke!=null&&q.set(ke,Ae)}if(K.update)for(let Ae of K.update){let ke=q.get(Ae.id);if(ke==null)continue;let Ze=!Ae.removeAllProperties&&(((oe=Ae.removeProperties)===null||oe===void 0?void 0:oe.length)>0||((le=Ae.addOrUpdateProperties)===null||le===void 0?void 0:le.length)>0);if((Ae.newGeometry||Ae.removeAllProperties||Ze)&&(ke=Object.assign({},ke),q.set(Ae.id,ke),Ze&&(ke.properties=Object.assign({},ke.properties))),Ae.newGeometry&&(ke.geometry=Ae.newGeometry),Ae.removeAllProperties)ke.properties={};else if(((De=Ae.removeProperties)===null||De===void 0?void 0:De.length)>0)for(let at of Ae.removeProperties)Object.prototype.hasOwnProperty.call(ke.properties,at)&&delete ke.properties[at];if(((Oe=Ae.addOrUpdateProperties)===null||Oe===void 0?void 0:Oe.length)>0)for(let{key:at,value:ct}of Ae.addOrUpdateProperties)ke.properties[at]=ct}}(this._dataUpdateable,N.dataDiff,j),X(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):X(new Error(`Cannot update existing geojson data in ${N.source}`)):X(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},F&&(this.loadGeoJSON=F)}loadData(S,C){var P;(P=this._pendingRequest)===null||P===void 0||P.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});let F=!!(S&&S.request&&S.request.collectResourceTiming)&&new c.RequestPerformance(S.request);this._pendingCallback=C,this._pendingRequest=this.loadGeoJSON(S,(N,X)=>{if(delete this._pendingCallback,delete this._pendingRequest,N||!X)return C(N);if(typeof X!="object")return C(new Error(`Input data given to '${S.source}' is not a valid GeoJSON object.`));{Ye(X,!0);try{if(S.filter){let q=c.createExpression(S.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(q.result==="error")throw new Error(q.value.map(ne=>`${ne.key}: ${ne.message}`).join(", "));X={type:"FeatureCollection",features:X.features.filter(ne=>q.value.evaluate({zoom:0},ne))}}this._geoJSONIndex=S.cluster?new Hr(function({superclusterOptions:q,clusterProperties:K}){if(!K||!q)return q;let ne={},oe={},le={accumulated:null,zoom:0},De={properties:null},Oe=Object.keys(K);for(let Ae of Oe){let[ke,Ze]=K[Ae],at=c.createExpression(Ze),ct=c.createExpression(typeof ke=="string"?[ke,["accumulated"],["get",Ae]]:ke);ne[Ae]=at.value,oe[Ae]=ct.value}return q.map=Ae=>{De.properties=Ae;let ke={};for(let Ze of Oe)ke[Ze]=ne[Ze].evaluate(le,De);return ke},q.reduce=(Ae,ke)=>{De.properties=ke;for(let Ze of Oe)le.accumulated=Ae[Ze],Ae[Ze]=oe[Ze].evaluate(le,De)},q}(S)).load(X.features):function(q,K){return new lr(q,K)}(X,S.geojsonVtOptions)}catch(q){return C(q)}this.loaded={};let j={};if(F){let q=F.finish();q&&(j.resourceTiming={},j.resourceTiming[S.source]=JSON.parse(JSON.stringify(q)))}C(null,j)}})}reloadTile(S,C){let P=this.loaded;return P&&P[S.uid]?super.reloadTile(S,C):this.loadTile(S,C)}removeSource(S,C){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),C()}getClusterExpansionZoom(S,C){try{C(null,this._geoJSONIndex.getClusterExpansionZoom(S.clusterId))}catch(P){C(P)}}getClusterChildren(S,C){try{C(null,this._geoJSONIndex.getChildren(S.clusterId))}catch(P){C(P)}}getClusterLeaves(S,C){try{C(null,this._geoJSONIndex.getLeaves(S.clusterId,S.limit,S.offset))}catch(P){C(P)}}}class tn{constructor(S){this.self=S,this.actor=new c.Actor(S,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Et,geojson:qe},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(C,P)=>{if(this.workerSourceTypes[C])throw new Error(`Worker source with name "${C}" already registered.`);this.workerSourceTypes[C]=P},this.self.registerRTLTextPlugin=C=>{if(c.plugin.isParsed())throw new Error("RTL text plugin already registered.");c.plugin.applyArabicShaping=C.applyArabicShaping,c.plugin.processBidirectionalText=C.processBidirectionalText,c.plugin.processStyledBidirectionalText=C.processStyledBidirectionalText}}setReferrer(S,C){this.referrer=C}setImages(S,C,P){this.availableImages[S]=C;for(let F in this.workerSources[S]){let N=this.workerSources[S][F];for(let X in N)N[X].availableImages=C}P()}setLayers(S,C,P){this.getLayerIndex(S).replace(C),P()}updateLayers(S,C,P){this.getLayerIndex(S).update(C.layers,C.removedIds),P()}loadTile(S,C,P){this.getWorkerSource(S,C.type,C.source).loadTile(C,P)}loadDEMTile(S,C,P){this.getDEMWorkerSource(S,C.source).loadTile(C,P)}reloadTile(S,C,P){this.getWorkerSource(S,C.type,C.source).reloadTile(C,P)}abortTile(S,C,P){this.getWorkerSource(S,C.type,C.source).abortTile(C,P)}removeTile(S,C,P){this.getWorkerSource(S,C.type,C.source).removeTile(C,P)}removeDEMTile(S,C){this.getDEMWorkerSource(S,C.source).removeTile(C)}removeSource(S,C,P){if(!this.workerSources[S]||!this.workerSources[S][C.type]||!this.workerSources[S][C.type][C.source])return;let F=this.workerSources[S][C.type][C.source];delete this.workerSources[S][C.type][C.source],F.removeSource!==void 0?F.removeSource(C,P):P()}loadWorkerSource(S,C,P){try{this.self.importScripts(C.url),P()}catch(F){P(F.toString())}}syncRTLPluginState(S,C,P){try{c.plugin.setState(C);let F=c.plugin.getPluginURL();if(c.plugin.isLoaded()&&!c.plugin.isParsed()&&F!=null){this.self.importScripts(F);let N=c.plugin.isParsed();P(N?void 0:new Error(`RTL Text Plugin failed to import scripts from ${F}`),N)}}catch(F){P(F.toString())}}getAvailableImages(S){let C=this.availableImages[S];return C||(C=[]),C}getLayerIndex(S){let C=this.layerIndexes[S];return C||(C=this.layerIndexes[S]=new Wt),C}getWorkerSource(S,C,P){if(this.workerSources[S]||(this.workerSources[S]={}),this.workerSources[S][C]||(this.workerSources[S][C]={}),!this.workerSources[S][C][P]){let F={send:(N,X,j)=>{this.actor.send(N,X,j,S)}};this.workerSources[S][C][P]=new this.workerSourceTypes[C](F,this.getLayerIndex(S),this.getAvailableImages(S))}return this.workerSources[S][C][P]}getDEMWorkerSource(S,C){return this.demWorkerSources[S]||(this.demWorkerSources[S]={}),this.demWorkerSources[S][C]||(this.demWorkerSources[S][C]=new ii),this.demWorkerSources[S][C]}}return c.isWorker()&&(self.worker=new tn(self)),tn}),Kt(["./shared"],function(c){"use strict";var Wt="3.5.1";class te{static testProp(t){if(!te.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",te.suppressClickInternal,!0)},0)}static mousePos(t,n){let s=t.getBoundingClientRect();return new c.Point(n.clientX-s.left-t.clientLeft,n.clientY-s.top-t.clientTop)}static touchPos(t,n){let s=t.getBoundingClientRect(),l=[];for(let p=0;p{t=[],n=0,s=0,l={}},h.addThrottleControl=v=>{let w=s++;return l[w]=v,w},h.removeThrottleControl=v=>{delete l[v],g()},h.getImage=(v,w,E=!0)=>{Fe.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*");let A={requestParameters:v,supportImageRefresh:E,callback:w,cancelled:!1,completed:!1,cancel:()=>{A.completed||A.cancelled||(A.cancelled=!0,A.innerRequest&&(A.innerRequest.cancel(),n--),g())}};return t.push(A),g(),A};let p=v=>{let{requestParameters:w,supportImageRefresh:E,callback:A}=v;return c.extend(w,{type:"image"}),(E!==!1||c.isWorker()||c.getProtocolAction(w.url)||w.headers&&!Object.keys(w.headers).reduce((B,D)=>B&&D==="accept",!0)?c.makeRequest:y)(w,(B,D,O,k)=>{f(v,A,B,D,O,k)})},f=(v,w,E,A,B,D)=>{E?w(E):A instanceof HTMLImageElement||c.isImageBitmap(A)?w(null,A):A&&((O,k)=>{typeof createImageBitmap=="function"?c.arrayBufferToImageBitmap(O,k):c.arrayBufferToImage(O,k)})(A,(O,k)=>{O!=null?w(O):k!=null&&w(null,k,{cacheControl:B,expires:D})}),v.cancelled||(v.completed=!0,n--,g())},g=()=>{let v=(()=>{let w=Object.keys(l),E=!1;if(w.length>0){for(let A of w)if(E=l[A](),E)break}return E})()?c.config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.config.MAX_PARALLEL_IMAGE_REQUESTS;for(let w=n;w0;w++){let E=t.shift();if(E.cancelled){w--;continue}let A=p(E);n++,E.innerRequest=A}},y=(v,w)=>{let E=new Image,A=v.url,B=!1,D=v.credentials;return D&&D==="include"?E.crossOrigin="use-credentials":(D&&D==="same-origin"||!c.sameOrigin(A))&&(E.crossOrigin="anonymous"),E.fetchPriority="high",E.onload=()=>{w(null,E),E.onerror=E.onload=null},E.onerror=()=>{B||w(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),E.onerror=E.onload=null},E.src=A,{cancel:()=>{B=!0,E.src=""}}}}(st||(st={})),st.resetRequestQueue(),function(h){h.Glyphs="Glyphs",h.Image="Image",h.Source="Source",h.SpriteImage="SpriteImage",h.SpriteJSON="SpriteJSON",h.Style="Style",h.Tile="Tile",h.Unknown="Unknown"}(Ye||(Ye={}));class At{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,s){let l=function(p){let f=p.match(zt);if(!f)throw new Error(`Unable to parse URL "${p}"`);return{protocol:f[1],authority:f[2],path:f[3]||"/",params:f[4]?f[4].split("&"):[]}}(t);return l.path+=`${n}${s}`,function(p){let f=p.params.length?`?${p.params.join("&")}`:"";return`${p.protocol}://${p.authority}${p.path}${f}`}(l)}setTransformRequest(t){this._transformRequestFn=t}}let zt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ii(h){var t=new c.ARRAY_TYPE(3);return t[0]=h[0],t[1]=h[1],t[2]=h[2],t}var xr,ar=function(h,t,n){return h[0]=t[0]-n[0],h[1]=t[1]-n[1],h[2]=t[2]-n[2],h};xr=new c.ARRAY_TYPE(3),c.ARRAY_TYPE!=Float32Array&&(xr[0]=0,xr[1]=0,xr[2]=0);var qn=function(h){var t=h[0],n=h[1];return t*t+n*n};function Jt(h){let t=[];if(typeof h=="string")t.push({id:"default",url:h});else if(h&&h.length>0){let n=[];for(let{id:s,url:l}of h){let p=`${s}${l}`;n.indexOf(p)===-1&&(n.push(p),t.push({id:s,url:l}))}}return t}function xa(h,t,n,s,l){if(s)return void h(s);if(l!==Object.values(t).length||l!==Object.values(n).length)return;let p={};for(let f in t){p[f]={};let g=c.browser.getImageCanvasContext(n[f]),y=t[f];for(let v in y){let{width:w,height:E,x:A,y:B,sdf:D,pixelRatio:O,stretchX:k,stretchY:G,content:J}=y[v];p[f][v]={data:null,pixelRatio:O,sdf:D,stretchX:k,stretchY:G,content:J,spriteData:{width:w,height:E,x:A,y:B,context:g}}}}h(null,p)}(function(){var h=new c.ARRAY_TYPE(2);c.ARRAY_TYPE!=Float32Array&&(h[0]=0,h[1]=0)})();class Tt{constructor(t,n,s,l){this.context=t,this.format=s,this.texture=t.gl.createTexture(),this.update(n,l)}update(t,n,s){let{width:l,height:p}=t,f=!(this.size&&this.size[0]===l&&this.size[1]===p||s),{context:g}=this,{gl:y}=g;if(this.useMipmap=!!(n&&n.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1),g.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!n||n.premultiply!==!1)),f)this.size=[l,p],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.isImageBitmap(t)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,t):y.texImage2D(y.TEXTURE_2D,0,this.format,l,p,0,this.format,y.UNSIGNED_BYTE,t.data);else{let{x:v,y:w}=s||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.isImageBitmap(t)?y.texSubImage2D(y.TEXTURE_2D,0,v,w,y.RGBA,y.UNSIGNED_BYTE,t):y.texSubImage2D(y.TEXTURE_2D,0,v,w,l,p,y.RGBA,y.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(t,n,s){let{context:l}=this,{gl:p}=l;p.bindTexture(p.TEXTURE_2D,this.texture),s!==p.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=p.LINEAR),t!==this.filter&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,t),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,s||t),this.filter=t),n!==this.wrap&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,n),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function mn(h){let{userImage:t}=h;return!!(t&&t.render&&t.render())&&(h.data.replace(new Uint8Array(t.data.buffer)),!0)}class Ki extends c.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:n,callback:s}of this.requestors)this._notify(n,s);this.requestors=[]}}getImage(t){let n=this.images[t];if(n&&!n.data&&n.spriteData){let s=n.spriteData;n.data=new c.RGBAImage({width:s.width,height:s.height},s.context.getImageData(s.x,s.y,s.width,s.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let s=!0,l=n.data||n.spriteData;return this._validateStretch(n.stretchX,l&&l.width)||(this.fire(new c.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),s=!1),this._validateStretch(n.stretchY,l&&l.height)||(this.fire(new c.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),s=!1),this._validateContent(n.content,n)||(this.fire(new c.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),s=!1),s}_validateStretch(t,n){if(!t)return!0;let s=0;for(let l of t){if(l[0]-1);y++,p[y]=g,f[y]=v,f[y+1]=kr}for(let g=0,y=0;g{let g=this.entries[l];g||(g=this.entries[l]={glyphs:{},requests:{},ranges:{}});let y=g.glyphs[p];if(y!==void 0)return void f(null,{stack:l,id:p,glyph:y});if(y=this._tinySDF(g,l,p),y)return g.glyphs[p]=y,void f(null,{stack:l,id:p,glyph:y});let v=Math.floor(p/256);if(256*v>65535)return void f(new Error("glyphs > 65535 not supported"));if(g.ranges[v])return void f(null,{stack:l,id:p,glyph:y});if(!this.url)return void f(new Error("glyphsUrl is not set"));let w=g.requests[v];w||(w=g.requests[v]=[],vr.loadGlyphRange(l,v,this.url,this.requestManager,(E,A)=>{if(A){for(let B in A)this._doesCharSupportLocalGlyph(+B)||(g.glyphs[+B]=A[+B]);g.ranges[v]=!0}for(let B of w)B(E,A);delete g.requests[v]})),w.push((E,A)=>{E?f(E):A&&f(null,{stack:l,id:p,glyph:A[p]||null})})},(l,p)=>{if(l)n(l);else if(p){let f={};for(let{stack:g,id:y,glyph:v}of p)(f[g]||(f[g]={}))[y]=v&&{id:v.id,bitmap:v.bitmap.clone(),metrics:v.metrics};n(null,f)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(c.unicodeBlockLookup["CJK Unified Ideographs"](t)||c.unicodeBlockLookup["Hangul Syllables"](t)||c.unicodeBlockLookup.Hiragana(t)||c.unicodeBlockLookup.Katakana(t))}_tinySDF(t,n,s){let l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(s))return;let p=t.tinySDF;if(!p){let g="400";/bold/i.test(n)?g="900":/medium/i.test(n)?g="500":/light/i.test(n)&&(g="200"),p=t.tinySDF=new vr.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:g})}let f=p.draw(String.fromCharCode(s));return{id:s,bitmap:new c.AlphaImage({width:f.width||60,height:f.height||60},f.data),metrics:{width:f.glyphWidth/2||24,height:f.glyphHeight/2||24,left:f.glyphLeft/2+.5||0,top:f.glyphTop/2-27.5||-8,advance:f.glyphAdvance/2||24,isDoubleResolution:!0}}}}vr.loadGlyphRange=function(h,t,n,s,l){let p=256*t,f=p+255,g=s.transformRequest(n.replace("{fontstack}",h).replace("{range}",`${p}-${f}`),Ye.Glyphs);c.getArrayBuffer(g,(y,v)=>{if(y)l(y);else if(v){let w={};for(let E of c.parseGlyphPbf(v))w[E.id]=E;l(null,w)}})},vr.TinySDF=class{constructor({fontSize:h=24,buffer:t=3,radius:n=8,cutoff:s=.25,fontFamily:l="sans-serif",fontWeight:p="normal",fontStyle:f="normal"}={}){this.buffer=t,this.cutoff=s,this.radius=n;let g=this.size=h+4*t,y=this._createCanvas(g),v=this.ctx=y.getContext("2d",{willReadFrequently:!0});v.font=`${f} ${p} ${h}px ${l}`,v.textBaseline="alphabetic",v.textAlign="left",v.fillStyle="black",this.gridOuter=new Float64Array(g*g),this.gridInner=new Float64Array(g*g),this.f=new Float64Array(g),this.z=new Float64Array(g+1),this.v=new Uint16Array(g)}_createCanvas(h){let t=document.createElement("canvas");return t.width=t.height=h,t}draw(h){let{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:l,actualBoundingBoxRight:p}=this.ctx.measureText(h),f=Math.ceil(n),g=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-l))),y=Math.min(this.size-this.buffer,f+Math.ceil(s)),v=g+2*this.buffer,w=y+2*this.buffer,E=Math.max(v*w,0),A=new Uint8ClampedArray(E),B={data:A,width:v,height:w,glyphWidth:g,glyphHeight:y,glyphTop:f,glyphLeft:0,glyphAdvance:t};if(g===0||y===0)return B;let{ctx:D,buffer:O,gridInner:k,gridOuter:G}=this;D.clearRect(O,O,g,y),D.fillText(h,O,O+f);let J=D.getImageData(O,O,g,y);G.fill(kr,0,E),k.fill(0,0,E);for(let U=0;U0?ae*ae:0,k[ie]=ae<0?ae*ae:0}}li(G,0,0,v,w,v,this.f,this.v,this.z),li(k,O,O,g,y,v,this.f,this.v,this.z);for(let U=0;U1&&(y=t[++g]);let w=Math.abs(v-y.left),E=Math.abs(v-y.right),A=Math.min(w,E),B,D=p/s*(l+1);if(y.isDash){let O=l-Math.abs(D);B=Math.sqrt(A*A+O*O)}else B=l-Math.sqrt(A*A+D*D);this.data[f+v]=Math.max(0,Math.min(255,B+128))}}}addRegularDash(t){for(let g=t.length-1;g>=0;--g){let y=t[g],v=t[g+1];y.zeroLength?t.splice(g,1):v&&v.isDash===y.isDash&&(v.left=y.left,t.splice(g,1))}let n=t[0],s=t[t.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);let l=this.width*this.nextRow,p=0,f=t[p];for(let g=0;g1&&(f=t[++p]);let y=Math.abs(g-f.left),v=Math.abs(g-f.right),w=Math.min(y,v);this.data[l+g]=Math.max(0,Math.min(255,(f.isDash?w:-w)+128))}}addDash(t,n){let s=n?7:0,l=2*s+1;if(this.nextRow+l>this.height)return c.warnOnce("LineAtlas out of space"),null;let p=0;for(let g=0;g{l.send(t,n,p)},s=s||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(n=>{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function Xr(h,t,n){let s=function(l,p){if(l)return n(l);if(p){let f=c.pick(c.extend(p,h),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);p.vector_layers&&(f.vectorLayers=p.vector_layers,f.vectorLayerIds=f.vectorLayers.map(g=>g.id)),n(null,f)}};return h.url?c.getJSON(t.transformRequest(h.url,Ye.Source),s):c.browser.frame(()=>s(null,h))}Dr.Actor=c.Actor;class mt{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):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 c.LngLat?new c.LngLat(t.lng,t.lat):c.LngLat.convert(t),this}setSouthWest(t){return this._sw=t instanceof c.LngLat?new c.LngLat(t.lng,t.lat):c.LngLat.convert(t),this}extend(t){let n=this._sw,s=this._ne,l,p;if(t instanceof c.LngLat)l=t,p=t;else{if(!(t instanceof mt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(mt.convert(t)):this.extend(c.LngLat.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(c.LngLat.convert(t)):this;if(l=t._sw,p=t._ne,!l||!p)return this}return n||s?(n.lng=Math.min(l.lng,n.lng),n.lat=Math.min(l.lat,n.lat),s.lng=Math.max(p.lng,s.lng),s.lat=Math.max(p.lat,s.lat)):(this._sw=new c.LngLat(l.lng,l.lat),this._ne=new c.LngLat(p.lng,p.lat)),this}getCenter(){return new c.LngLat((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 c.LngLat(this.getWest(),this.getNorth())}getSouthEast(){return new c.LngLat(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){let{lng:n,lat:s}=c.LngLat.convert(t),l=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=s&&s<=this._ne.lat&&l}static convert(t){return t instanceof mt?t:t&&new mt(t)}static fromLngLat(t,n=0){let s=360*n/40075017,l=s/Math.cos(Math.PI/180*t.lat);return new mt(new c.LngLat(t.lng-l,t.lat-s),new c.LngLat(t.lng+l,t.lat+s))}}class ci{constructor(t,n,s){this.bounds=mt.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=s||24}validateBounds(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){let n=Math.pow(2,t.z),s=Math.floor(c.mercatorXfromLng(this.bounds.getWest())*n),l=Math.floor(c.mercatorYfromLat(this.bounds.getNorth())*n),p=Math.ceil(c.mercatorXfromLng(this.bounds.getEast())*n),f=Math.ceil(c.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=s&&t.x=l&&t.y{this._loaded=!1,this.fire(new c.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Xr(this._options,this.map._requestManager,(p,f)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),p?this.fire(new c.ErrorEvent(p)):f&&(c.extend(this,f),f.bounds&&(this.tileBounds=new ci(f.bounds,this.minzoom,this.maxzoom)),this.fire(new c.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.Event("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>c.extend({},this._options),this.id=t,this.dispatcher=s,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,c.extend(this,c.pick(n,["url","scheme","tileSize","promoteId"])),this._options=c.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}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.cancel(),t(),this.load()}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.cancel(),this._tileJSONRequest=null)}loadTile(t,n){let s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l={request:this.map._requestManager.transformRequest(s,Ye.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function p(f,g){return delete t.request,t.aborted?n(null):f&&f.status!==404?n(f):(g&&g.resourceTiming&&(t.resourceTiming=g.resourceTiming),this.map._refreshExpiredTiles&&g&&t.setExpiryData(g),t.loadVectorData(g,this.map.painter),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}l.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",l,p.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",l,p.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Hr extends c.Evented{constructor(t,n,s,l){super(),this.id=t,this.dispatcher=s,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.extend({type:"raster"},n),c.extend(this,c.pick(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new c.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Xr(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new c.ErrorEvent(t)):n&&(c.extend(this,n),n.bounds&&(this.tileBounds=new ci(n.bounds,this.minzoom,this.maxzoom)),this.fire(new c.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}serialize(){return c.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){let s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=st.getImage(this.map._requestManager.transformRequest(s,Ye.Tile),(l,p,f)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(l)t.state="errored",n(l);else if(p){this.map._refreshExpiredTiles&&f&&t.setExpiryData(f);let g=this.map.painter.context,y=g.gl;t.texture=this.map.painter.getTileTexture(p.width),t.texture?t.texture.update(p,{useMipmap:!0}):(t.texture=new Tt(g,p,y.RGBA,{useMipmap:!0}),t.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST),g.extTextureFilterAnisotropic&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax)),t.state="loaded",n(null)}},this.map._refreshExpiredTiles)}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}class fn extends Hr{constructor(t,n,s,l){super(t,n,s,l),this.type="raster-dem",this.maxzoom=22,this._options=c.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t,n){let s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l=this.map._requestManager.transformRequest(s,Ye.Tile);function p(f,g){f&&(t.state="errored",n(f)),g&&(t.dem=g,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=st.getImage(l,(f,g,y)=>c.__awaiter(this,void 0,void 0,function*(){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(f)t.state="errored",n(f);else if(g){this.map._refreshExpiredTiles&&t.setExpiryData(y);let v=c.isImageBitmap(g)&&c.offscreenCanvasSupported()?g:yield function(E){return c.__awaiter(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.isOffscreenCanvasDistorted()){let A=E.width+2,B=E.height+2;try{return new c.RGBAImage({width:A,height:B},yield c.readImageUsingVideoFrame(E,-1,-1,A,B))}catch{}}return c.browser.getImageData(E,1)})}(g),w={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:v,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",w,p))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){let n=t.canonical,s=Math.pow(2,n.z),l=(n.x-1+s)%s,p=n.x===0?t.wrap-1:t.wrap,f=(n.x+1+s)%s,g=n.x+1===s?t.wrap+1:t.wrap,y={};return y[new c.OverscaledTileID(t.overscaledZ,p,n.z,l,n.y).key]={backfilled:!1},y[new c.OverscaledTileID(t.overscaledZ,g,n.z,f,n.y).key]={backfilled:!1},n.y>0&&(y[new c.OverscaledTileID(t.overscaledZ,p,n.z,l,n.y-1).key]={backfilled:!1},y[new c.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new c.OverscaledTileID(t.overscaledZ,g,n.z,f,n.y-1).key]={backfilled:!1}),n.y+1{this._updateWorkerData()},this.serialize=()=>c.extend({},this._options,{type:this.type,data:this._data}),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._pendingLoads=0,this.actor=s.getActor(),this.setEventedParent(l),this._data=n.data,this._options=c.extend({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;let p=c.EXTENT/this.tileSize;this.workerOptions=c.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(n.buffer!==void 0?n.buffer:128)*p,tolerance:(n.tolerance!==void 0?n.tolerance:.375)*p,extent:c.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:n.clusterMaxZoom!==void 0?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:c.EXTENT,radius:(n.clusterRadius||50)*p,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),t.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t,n){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},n),this}getClusterChildren(t,n){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},n),this}getClusterLeaves(t,n,s,l){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:n,offset:s},l),this}_updateWorkerData(t){let n=c.extend({},this.workerOptions);t?n.dataDiff=t:typeof this._data=="string"?(n.request=this.map._requestManager.transformRequest(c.browser.resolveURL(this._data),Ye.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new c.Event("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,n,(s,l)=>{if(this._pendingLoads--,this._removed||l&&l.abandoned)return void this.fire(new c.Event("dataabort",{dataType:"source"}));let p=null;if(l&&l.resourceTiming&&l.resourceTiming[this.id]&&(p=l.resourceTiming[this.id].slice(0)),s)return void this.fire(new c.ErrorEvent(s));let f={dataType:"source"};this._collectResourceTiming&&p&&p.length>0&&c.extend(f,{resourceTiming:p}),this.fire(new c.Event("data",Object.assign(Object.assign({},f),{sourceDataType:"metadata"}))),this.fire(new c.Event("data",Object.assign(Object.assign({},f),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(t,n){let s=t.actor?"reloadTile":"loadTile";t.actor=this.actor;let l={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};t.request=this.actor.send(s,l,(p,f)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):p?n(p):(t.loadVectorData(f,this.map.painter,s==="reloadTile"),n(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var ji=c.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Ai extends c.Evented{constructor(t,n,s,l){super(),this.load=(p,f)=>{this._loaded=!1,this.fire(new c.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=st.getImage(this.map._requestManager.transformRequest(this.url,Ye.Image),(g,y)=>{this._request=null,this._loaded=!0,g?this.fire(new c.ErrorEvent(g)):y&&(this.image=y,p&&(this.coordinates=p),f&&f(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;let p=this.map.painter.context,f=p.gl;this.boundsBuffer||(this.boundsBuffer=p.createVertexBuffer(this._boundsArray,ji.members)),this.boundsSegments||(this.boundsSegments=c.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Tt(p,this.image,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let g=!1;for(let y in this.tiles){let v=this.tiles[y];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,g=!0)}g&&this.fire(new c.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=t,this.dispatcher=s,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=n}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;let n=t.map(c.MercatorCoordinate.fromLngLat);this.tileID=function(l){let p=1/0,f=1/0,g=-1/0,y=-1/0;for(let A of l)p=Math.min(p,A.x),f=Math.min(f,A.y),g=Math.max(g,A.x),y=Math.max(y,A.y);let v=Math.max(g-p,y-f),w=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),E=Math.pow(2,w);return new c.CanonicalTileID(w,Math.floor((p+g)/2*E),Math.floor((f+y)/2*E))}(n),this.minzoom=this.maxzoom=this.tileID.z;let s=n.map(l=>this.tileID.getTilePoint(l)._round());return this._boundsArray=new c.RasterBoundsArray,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,c.EXTENT,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,c.EXTENT),this._boundsArray.emplaceBack(s[2].x,s[2].y,c.EXTENT,c.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.Event("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}hasTransition(){return!1}}class Gn extends Ai{constructor(t,n,s,l){super(t,n,s,l),this.load=()=>{this._loaded=!1;let p=this.options;this.urls=[];for(let f of p.urls)this.urls.push(this.map._requestManager.transformRequest(f,Ye.Source).url);c.getVideo(this.urls,(f,g)=>{this._loaded=!0,f?this.fire(new c.ErrorEvent(f)):g&&(this.video=g,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let p=this.map.painter.context,f=p.gl;this.boundsBuffer||(this.boundsBuffer=p.createVertexBuffer(this._boundsArray,ji.members)),this.boundsSegments||(this.boundsSegments=c.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE),f.texSubImage2D(f.TEXTURE_2D,0,0,0,f.RGBA,f.UNSIGNED_BYTE,this.video)):(this.texture=new Tt(p,this.video,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let g=!1;for(let y in this.tiles){let v=this.tiles[y];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,g=!0)}g&&this.fire(new c.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=n}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let n=this.video.seekable;tn.end(0)?this.fire(new c.ErrorEvent(new c.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class Wr extends Ai{constructor(t,n,s,l){super(t,n,s,l),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},this.prepare=()=>{let p=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,p=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,p=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let f=this.map.painter.context,g=f.gl;this.boundsBuffer||(this.boundsBuffer=f.createVertexBuffer(this._boundsArray,ji.members)),this.boundsSegments||(this.boundsSegments=c.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(p||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Tt(f,this.canvas,g.RGBA,{premultiply:!0});let y=!1;for(let v in this.tiles){let w=this.tiles[v];w.state!=="loaded"&&(w.state="loaded",w.texture=this.texture,y=!0)}y&&this.fire(new c.Event("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(p=>!Array.isArray(p)||p.length!==2||p.some(f=>typeof f!="number"))||this.fire(new c.ErrorEvent(new c.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.ErrorEvent(new c.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new c.ErrorEvent(new c.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new c.ErrorEvent(new c.ValidationError(`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 c.ErrorEvent(new c.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}let _n={},br=h=>{switch(h){case"geojson":return gn;case"image":return Ai;case"raster":return Hr;case"raster-dem":return fn;case"vector":return Lr;case"video":return Gn;case"canvas":return Wr}return _n[h]};function yn(h,t){let n=c.create();return c.translate(n,n,[1,1,0]),c.scale(n,n,[.5*h.width,.5*h.height,1]),c.multiply(n,n,h.calculatePosMatrix(t.toUnwrapped()))}function xn(h,t,n,s,l,p){let f=function(E,A,B){if(E)for(let D of E){let O=A[D];if(O&&O.source===B&&O.type==="fill-extrusion")return!0}else for(let D in A){let O=A[D];if(O.source===B&&O.type==="fill-extrusion")return!0}return!1}(l&&l.layers,t,h.id),g=p.maxPitchScaleFactor(),y=h.tilesIn(s,g,f);y.sort(Kr);let v=[];for(let E of y)v.push({wrappedTileID:E.tileID.wrapped().key,queryResults:E.tile.queryRenderedFeatures(t,n,h._state,E.queryGeometry,E.cameraQueryGeometry,E.scale,l,p,g,yn(h.transform,E.tileID))});let w=function(E){let A={},B={};for(let D of E){let O=D.queryResults,k=D.wrappedTileID,G=B[k]=B[k]||{};for(let J in O){let U=O[J],H=G[J]=G[J]||{},ee=A[J]=A[J]||[];for(let ie of U)H[ie.featureIndex]||(H[ie.featureIndex]=!0,ee.push(ie))}}return A}(v);for(let E in w)w[E].forEach(A=>{let B=A.feature,D=h.getFeatureState(B.layer["source-layer"],B.id);B.source=B.layer.source,B.layer["source-layer"]&&(B.sourceLayer=B.layer["source-layer"]),B.state=D});return w}function Kr(h,t){let n=h.tileID,s=t.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}class wr{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=c.uniqueId(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){let n=t+this.timeAdded;np.getLayer(v)).filter(Boolean);if(y.length!==0){g.layers=y,g.stateDependentLayerIds&&(g.stateDependentLayers=g.stateDependentLayerIds.map(v=>y.filter(w=>w.id===v)[0]));for(let v of y)f[v.id]=g}}return f}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(let l in this.buckets){let p=this.buckets[l];if(p instanceof c.SymbolBucket){if(this.hasSymbolBuckets=!0,!s)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let l in this.buckets){let p=this.buckets[l];if(p instanceof c.SymbolBucket&&p.hasRTLText){this.hasRTLText=!0,c.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(let l in this.buckets){let p=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(l).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new c.CollisionBoxArray}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let s in this.buckets){let l=this.buckets[s];l.uploadPending()&&l.upload(t)}let n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Tt(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Tt(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,s,l,p,f,g,y,v,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:p,scale:f,tileSize:this.tileSize,pixelPosMatrix:w,transform:y,params:g,queryPadding:this.queryPadding*v},t,n,s):{}}querySourceFeatures(t,n){let s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;let l=s.loadVTLayers(),p=n&&n.sourceLayer?n.sourceLayer:"",f=l._geojsonTileLayer||l[p];if(!f)return;let g=c.createFilter(n&&n.filter),{z:y,x:v,y:w}=this.tileID.canonical,E={z:y,x:v,y:w};for(let A=0;As)l=!1;else if(n)if(this.expirationTime{this.remove(t,p)},s)),this.data[l].push(p),this.order.push(l),this.order.length>this.max){let f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){let n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){let n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;let s=t.wrapped().key,l=n===void 0?0:this.data[s].indexOf(n),p=this.data[s][l];return this.data[s].splice(l,1),p.timeout&&clearTimeout(p.timeout),this.data[s].length===0&&delete this.data[s],this.onRemove(p.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){let n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){let n=[];for(let s in this.data)for(let l of this.data[s])t(l.value)||n.push(l);for(let s of n)this.remove(s.value.tileID,s)}}class vn{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,s){let l=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][l]=this.stateChanges[t][l]||{},c.extend(this.stateChanges[t][l],s),this.deletedStates[t]===null){this.deletedStates[t]={};for(let p in this.state[t])p!==l&&(this.deletedStates[t][p]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][l]===null){this.deletedStates[t][l]={};for(let p in this.state[t][l])s[p]||(this.deletedStates[t][l][p]=null)}else for(let p in s)this.deletedStates[t]&&this.deletedStates[t][l]&&this.deletedStates[t][l][p]===null&&delete this.deletedStates[t][l][p]}removeFeatureState(t,n,s){if(this.deletedStates[t]===null)return;let l=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},s&&n!==void 0)this.deletedStates[t][l]!==null&&(this.deletedStates[t][l]=this.deletedStates[t][l]||{},this.deletedStates[t][l][s]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][l])for(s in this.deletedStates[t][l]={},this.stateChanges[t][l])this.deletedStates[t][l][s]=null;else this.deletedStates[t][l]=null;else this.deletedStates[t]=null}getState(t,n){let s=String(n),l=c.extend({},(this.state[t]||{})[s],(this.stateChanges[t]||{})[s]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){let p=this.deletedStates[t][n];if(p===null)return{};for(let f in p)delete l[f]}return l}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){let s={};for(let l in this.stateChanges){this.state[l]=this.state[l]||{};let p={};for(let f in this.stateChanges[l])this.state[l][f]||(this.state[l][f]={}),c.extend(this.state[l][f],this.stateChanges[l][f]),p[f]=this.state[l][f];s[l]=p}for(let l in this.deletedStates){this.state[l]=this.state[l]||{};let p={};if(this.deletedStates[l]===null)for(let f in this.state[l])p[f]={},this.state[l][f]={};else for(let f in this.deletedStates[l]){if(this.deletedStates[l][f]===null)this.state[l][f]={};else for(let g of Object.keys(this.deletedStates[l][f]))delete this.state[l][f][g];p[f]=this.state[l][f]}s[l]=s[l]||{},c.extend(s[l],p)}if(this.stateChanges={},this.deletedStates={},Object.keys(s).length!==0)for(let l in t)t[l].setFeatureState(s,n)}}class re extends c.Evented{constructor(t,n,s){super(),this.id=t,this.dispatcher=s,this.on("data",l=>{l.dataType==="source"&&l.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&l.dataType==="source"&&l.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((l,p,f,g)=>{let y=new(br(p.type))(l,p,f,g);if(y.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${y.id}`);return y})(t,n,s,this),this._tiles={},this._cache=new Yr(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new vn,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}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(let t in this._tiles){let n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new c.Event("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._tiles,this.map?this.map.painter:null);for(let n in this._tiles){let s=this._tiles[n];s.upload(t),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(zi).map(t=>t.key)}getRenderableIds(t){let n=[];for(let s in this._tiles)this._isIdRenderable(s,t)&&n.push(this._tiles[s]);return t?n.sort((s,l)=>{let p=s.tileID,f=l.tileID,g=new c.Point(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),y=new c.Point(f.canonical.x,f.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-f.overscaledZ||y.y-g.y||y.x-g.x}).map(s=>s.tileID.key):n.map(s=>s.tileID).sort(zi).map(s=>s.key)}hasRenderableParent(t){let n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,n){let s=this._tiles[t];s&&(s.state!=="loading"&&(s.state=n),this._loadTile(s,this._tileLoaded.bind(this,s,t,n)))}_tileLoaded(t,n,s,l){if(l)return t.state="errored",void(l.status!==404?this._source.fire(new c.ErrorEvent(l,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=c.browser.now(),s==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new c.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){let n=this.getRenderableIds();for(let l=0;l1||(Math.abs(f)>1&&(Math.abs(f+y)===1?f+=y:Math.abs(f-y)===1&&(f-=y)),p.dem&&l.dem&&(l.dem.backfillBorder(p.dem,f,g),l.neighboringTiles&&l.neighboringTiles[v]&&(l.neighboringTiles[v].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,s,l){for(let p in this._tiles){let f=this._tiles[p];if(l[p]||!f.hasData()||f.tileID.overscaledZ<=n||f.tileID.overscaledZ>s)continue;let g=f.tileID;for(;f&&f.tileID.overscaledZ>n+1;){let v=f.tileID.scaledTo(f.tileID.overscaledZ-1);f=this._tiles[v.key],f&&f.hasData()&&(g=v)}let y=g;for(;y.overscaledZ>n;)if(y=y.scaledTo(y.overscaledZ-1),t[y.key]){l[g.key]=g;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){let s=this._loadedParentTiles[t.key];return s&&s.tileID.overscaledZ>=n?s:null}for(let s=t.overscaledZ-1;s>=n;s--){let l=t.scaledTo(s),p=this._getLoadedTile(l);if(p)return p}}_getLoadedTile(t){let n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){let n=Math.ceil(t.width/this._source.tileSize)+1,s=Math.ceil(t.height/this._source.tileSize)+1,l=Math.floor(n*s*(this._maxTileCacheZoomLevels===null?c.config.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(p)}handleWrapJump(t){let n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){let s={};for(let l in this._tiles){let p=this._tiles[l];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+n),s[p.tileID.key]=p}this._tiles=s;for(let l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(let l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let s;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(w=>new c.OverscaledTileID(w.canonical.z,w.wrap,w.canonical.z,w.canonical.x,w.canonical.y)):(s=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(s=s.filter(w=>this._source.hasTile(w)))):s=[];let l=t.coveringZoomLevel(this._source),p=Math.max(l-re.maxOverzooming,this._source.minzoom),f=Math.max(l+re.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let w={};for(let E of s)if(E.canonical.z>this._source.minzoom){let A=E.scaledTo(E.canonical.z-1);w[A.key]=A;let B=E.scaledTo(Math.max(this._source.minzoom,Math.min(E.canonical.z,5)));w[B.key]=B}s=s.concat(Object.values(w))}let g=s.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,g&&this.fire(new c.Event("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let y=this._updateRetainedTiles(s,l);if(va(this._source.type)){let w={},E={},A=Object.keys(y),B=c.browser.now();for(let D of A){let O=y[D],k=this._tiles[D];if(!k||k.fadeEndTime!==0&&k.fadeEndTime<=B)continue;let G=this.findLoadedParent(O,p);G&&(this._addTile(G.tileID),w[G.tileID.key]=G.tileID),E[D]=O}this._retainLoadedChildren(E,l,f,y);for(let D in w)y[D]||(this._coveredTiles[D]=!0,y[D]=w[D]);if(n){let D={},O={};for(let k of s)this._tiles[k.key].hasData()?D[k.key]=k:O[k.key]=k;for(let k in O){let G=O[k].children(this._source.maxzoom);this._tiles[G[0].key]&&this._tiles[G[1].key]&&this._tiles[G[2].key]&&this._tiles[G[3].key]&&(D[G[0].key]=y[G[0].key]=G[0],D[G[1].key]=y[G[1].key]=G[1],D[G[2].key]=y[G[2].key]=G[2],D[G[3].key]=y[G[3].key]=G[3],delete O[k])}for(let k in O){let G=this.findLoadedParent(O[k],this._source.minzoom);if(G){D[G.tileID.key]=y[G.tileID.key]=G.tileID;for(let J in D)D[J].isChildOf(G.tileID)&&delete D[J]}}for(let k in this._tiles)D[k]||(this._coveredTiles[k]=!0)}}for(let w in y)this._tiles[w].clearFadeHold();let v=c.keysDifference(this._tiles,y);for(let w of v){let E=this._tiles[w];E.hasSymbolBuckets&&!E.holdingForFade()?E.setHoldDuration(this.map._fadeDuration):E.hasSymbolBuckets&&!E.symbolFadeFinished()||this._removeTile(w)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(let t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){let s={},l={},p=Math.max(n-re.maxOverzooming,this._source.minzoom),f=Math.max(n+re.maxUnderzooming,this._source.minzoom),g={};for(let y of t){let v=this._addTile(y);s[y.key]=y,v.hasData()||nthis._source.maxzoom){let E=y.children(this._source.maxzoom)[0],A=this.getTile(E);if(A&&A.hasData()){s[E.key]=E;continue}}else{let E=y.children(this._source.maxzoom);if(s[E[0].key]&&s[E[1].key]&&s[E[2].key]&&s[E[3].key])continue}let w=v.wasRequested();for(let E=y.overscaledZ-1;E>=p;--E){let A=y.scaledTo(E);if(l[A.key])break;if(l[A.key]=!0,v=this.getTile(A),!v&&w&&(v=this._addTile(A)),v){let B=v.hasData();if((w||B)&&(s[A.key]=A),w=v.wasRequested(),B)break}}}return s}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let t in this._tiles){let n=[],s,l=this._tiles[t].tileID;for(;l.overscaledZ>0;){if(l.key in this._loadedParentTiles){s=this._loadedParentTiles[l.key];break}n.push(l.key);let p=l.scaledTo(l.overscaledZ-1);if(s=this._getLoadedTile(p),s)break;l=p}for(let p of n)this._loadedParentTiles[p]=s}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));let s=n;return n||(n=new wr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,s||this._source.fire(new c.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);let s=n.getExpiryTimeout();s&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},s))}_removeTile(t){let n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,s){let l=[],p=this.transform;if(!p)return l;let f=s?p.getCameraQueryGeometry(t):t,g=t.map(D=>p.pointCoordinate(D,this.terrain)),y=f.map(D=>p.pointCoordinate(D,this.terrain)),v=this.getIds(),w=1/0,E=1/0,A=-1/0,B=-1/0;for(let D of y)w=Math.min(w,D.x),E=Math.min(E,D.y),A=Math.max(A,D.x),B=Math.max(B,D.y);for(let D=0;D=0&&U[1].y+J>=0){let H=g.map(ie=>k.getTilePoint(ie)),ee=y.map(ie=>k.getTilePoint(ie));l.push({tile:O,tileID:k,queryGeometry:H,cameraQueryGeometry:ee,scale:G})}}return l}getVisibleCoordinates(t){let n=this.getRenderableIds(t).map(s=>this._tiles[s].tileID);for(let s of n)s.posMatrix=this.transform.calculatePosMatrix(s.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(va(this._source.type)){let t=c.browser.now();for(let n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,s){this._state.updateState(t=t||"_geojsonTileLayer",n,s)}removeFeatureState(t,n,s){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,s)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,s){let l=this._tiles[t];l&&l.setDependencies(n,s)}reloadTilesForDependencies(t,n){for(let s in this._tiles)this._tiles[s].hasDependency(t,n)&&this._reloadTile(s,"reloading");this._cache.filter(s=>!s.hasDependency(t,n))}}function zi(h,t){let n=Math.abs(2*h.wrap)-+(h.wrap<0),s=Math.abs(2*t.wrap)-+(t.wrap<0);return h.overscaledZ-t.overscaledZ||s-n||t.canonical.y-h.canonical.y||t.canonical.x-h.canonical.x}function va(h){return h==="raster"||h==="image"||h==="video"}re.maxOverzooming=10,re.maxUnderzooming=3;let ot="mapboxgl_preloaded_worker_pool";class Je{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ot]}numActive(){return Object.keys(this.active).length}}let bn=Math.floor(c.browser.hardwareConcurrency/2),sr;function ba(){return sr||(sr=new Je),sr}Je.workerCount=c.isSafari(globalThis)?Math.max(Math.min(bn,3),1):1;class hs{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let s=1;s0?(l-f)/g:0;return this.points[p].mult(1-y).add(this.points[n].mult(y))}}function or(h,t){let n=!0;return h==="always"||h!=="never"&&t!=="never"||(n=!1),n}class Jr{constructor(t,n,s){let l=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(t/s),this.yCellCount=Math.ceil(n/s);for(let f=0;fthis.width||l<0||n>this.height)return[];let y=[];if(t<=0&&n<=0&&this.width<=s&&this.height<=l){if(p)return[{key:null,x1:t,y1:n,x2:s,y2:l}];for(let v=0;v0}hitTestCircle(t,n,s,l,p){let f=t-s,g=t+s,y=n-s,v=n+s;if(g<0||f>this.width||v<0||y>this.height)return!1;let w=[];return this._forEachCell(f,y,g,v,this._queryCellCircle,w,{hitTest:!0,overlapMode:l,circle:{x:t,y:n,radius:s},seenUids:{box:{},circle:{}}},p),w.length>0}_queryCell(t,n,s,l,p,f,g,y){let{seenUids:v,hitTest:w,overlapMode:E}=g,A=this.boxCells[p];if(A!==null){let D=this.bboxes;for(let O of A)if(!v.box[O]){v.box[O]=!0;let k=4*O,G=this.boxKeys[O];if(t<=D[k+2]&&n<=D[k+3]&&s>=D[k+0]&&l>=D[k+1]&&(!y||y(G))&&(!w||!or(E,G.overlapMode))&&(f.push({key:G,x1:D[k],y1:D[k+1],x2:D[k+2],y2:D[k+3]}),w))return!0}}let B=this.circleCells[p];if(B!==null){let D=this.circles;for(let O of B)if(!v.circle[O]){v.circle[O]=!0;let k=3*O,G=this.circleKeys[O];if(this._circleAndRectCollide(D[k],D[k+1],D[k+2],t,n,s,l)&&(!y||y(G))&&(!w||!or(E,G.overlapMode))){let J=D[k],U=D[k+1],H=D[k+2];if(f.push({key:G,x1:J-H,y1:U-H,x2:J+H,y2:U+H}),w)return!0}}}return!1}_queryCellCircle(t,n,s,l,p,f,g,y){let{circle:v,seenUids:w,overlapMode:E}=g,A=this.boxCells[p];if(A!==null){let D=this.bboxes;for(let O of A)if(!w.box[O]){w.box[O]=!0;let k=4*O,G=this.boxKeys[O];if(this._circleAndRectCollide(v.x,v.y,v.radius,D[k+0],D[k+1],D[k+2],D[k+3])&&(!y||y(G))&&!or(E,G.overlapMode))return f.push(!0),!0}}let B=this.circleCells[p];if(B!==null){let D=this.circles;for(let O of B)if(!w.circle[O]){w.circle[O]=!0;let k=3*O,G=this.circleKeys[O];if(this._circlesCollide(D[k],D[k+1],D[k+2],v.x,v.y,v.radius)&&(!y||y(G))&&!or(E,G.overlapMode))return f.push(!0),!0}}}_forEachCell(t,n,s,l,p,f,g,y){let v=this._convertToXCellCoord(t),w=this._convertToYCellCoord(n),E=this._convertToXCellCoord(s),A=this._convertToYCellCoord(l);for(let B=v;B<=E;B++)for(let D=w;D<=A;D++)if(p.call(this,t,n,s,l,this.xCellCount*D+B,f,g,y))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,n,s,l,p,f){let g=l-t,y=p-n,v=s+f;return v*v>g*g+y*y}_circleAndRectCollide(t,n,s,l,p,f,g){let y=(f-l)/2,v=Math.abs(t-(l+y));if(v>y+s)return!1;let w=(g-p)/2,E=Math.abs(n-(p+w));if(E>w+s)return!1;if(v<=y||E<=w)return!0;let A=v-y,B=E-w;return A*A+B*B<=s*s}}function Qr(h,t,n,s,l){let p=c.create();return t?(c.scale(p,p,[1/l,1/l,1]),n||c.rotateZ(p,p,s.angle)):c.multiply(p,s.labelPlaneMatrix,h),p}function me(h,t,n,s,l){if(t){let p=c.clone(h);return c.scale(p,p,[l,l,1]),n||c.rotateZ(p,p,-s.angle),p}return s.glCoordMatrix}function $t(h,t,n){let s;n?(s=[h.x,h.y,n(h.x,h.y),1],c.transformMat4(s,s,t)):(s=[h.x,h.y,0,1],P(s,s,t));let l=s[3];return{point:new c.Point(s[0]/l,s[1]/l),signedDistanceFromCamera:l}}function yi(h,t){return .5+h/t*.5}function en(h,t){let n=h[0]/h[3],s=h[1]/h[3];return n>=-t[0]&&n<=t[0]&&s>=-t[1]&&s<=t[1]}function lr(h,t,n,s,l,p,f,g,y,v){let w=s?h.textSizeData:h.iconSizeData,E=c.evaluateSizeForZoom(w,n.transform.zoom),A=[256/n.width*2+1,256/n.height*2+1],B=s?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;B.clear();let D=h.lineVertexArray,O=s?h.text.placedSymbolArray:h.icon.placedSymbolArray,k=n.transform.width/n.transform.height,G=!1;for(let J=0;JMath.abs(n.x-t.x)*s?{useVertical:!0}:(h===c.WritingMode.vertical?t.yn.x)?{needsFlipping:!0}:null}function $e(h,t,n,s,l,p,f,g,y,v,w,E,A,B,D,O){let k=t/24,G=h.lineOffsetX*k,J=h.lineOffsetY*k,U;if(h.numGlyphs>1){let H=h.glyphStartIndex+h.numGlyphs,ee=h.lineStartIndex,ie=h.lineStartIndex+h.lineLength,ae=ge(k,g,G,J,n,w,E,h,y,p,A,D,O);if(!ae)return{notEnoughRoom:!0};let he=$t(ae.first.point,f,O).point,ce=$t(ae.last.point,f,O).point;if(s&&!n){let pe=Ne(h.writingMode,he,ce,B);if(pe)return pe}U=[ae.first];for(let pe=h.glyphStartIndex+1;pe0?he.point:hi(E,ae,ee,1,l,O),pe=Ne(h.writingMode,ee,ce,B);if(pe)return pe}let H=R(k*g.getoffsetX(h.glyphStartIndex),G,J,n,w,E,h.segment,h.lineStartIndex,h.lineStartIndex+h.lineLength,y,p,A,D,O);if(!H)return{notEnoughRoom:!0};U=[H]}for(let H of U)c.addDynamicAttributes(v,H.point,H.angle);return{}}function hi(h,t,n,s,l,p){let f=$t(h.add(h.sub(t)._unit()),l,p).point,g=n.sub(f);return n.add(g._mult(s/g.mag()))}function cr(h,t){let{projectionCache:n,lineVertexArray:s,labelPlaneMatrix:l,tileAnchorPoint:p,distanceFromAnchor:f,getElevation:g,previousVertex:y,direction:v,absOffsetX:w}=t;if(n.projections[h])return n.projections[h];let E=new c.Point(s.getx(h),s.gety(h)),A=$t(E,l,g);if(A.signedDistanceFromCamera>0)return n.projections[h]=A.point,A.point;let B=h-v;return hi(f===0?p:new c.Point(s.getx(B),s.gety(B)),E,y,w-f+1,l,g)}function qe(h,t,n){return h._unit()._perp()._mult(t*n)}function tn(h,t,n,s,l,p,f,g){let{projectionCache:y,direction:v}=g;if(y.offsets[h])return y.offsets[h];let w=n.add(t);if(h+v=l)return y.offsets[h]=w,w;let E=cr(h+v,g),A=qe(E.sub(n),f,v),B=n.add(A),D=E.add(A);return y.offsets[h]=c.findLineIntersection(p,w,B,D)||w,y.offsets[h]}function R(h,t,n,s,l,p,f,g,y,v,w,E,A,B){let D=s?h-t:h+t,O=D>0?1:-1,k=0;s&&(O*=-1,k=Math.PI),O<0&&(k+=Math.PI);let G,J,U=O>0?g+f:g+f+1,H=l,ee=l,ie=0,ae=0,he=Math.abs(D),ce=[],pe;for(;ie+ae<=he;){if(U+=O,U=y)return null;ie+=ae,ee=H,J=G;let _e={projectionCache:E,lineVertexArray:v,labelPlaneMatrix:w,tileAnchorPoint:p,distanceFromAnchor:ie,getElevation:B,previousVertex:ee,direction:O,absOffsetX:he};if(H=cr(U,_e),n===0)ce.push(ee),pe=H.sub(ee);else{let Re,Ce=H.sub(ee);Re=Ce.mag()===0?qe(cr(U+O,_e).sub(H),n,O):qe(Ce,n,O),J||(J=ee.add(Re)),G=tn(U,Re,H,g,y,J,n,_e),ce.push(J),pe=G.sub(J)}ae=pe.mag()}let Se=pe._mult((he-ie)/ae)._add(J||ee),He=k+Math.atan2(H.y-ee.y,H.x-ee.x);return ce.push(Se),{point:Se,angle:A?He:0,path:ce}}let S=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function C(h,t){for(let n=0;n=1;Ge--)Ce.push(_e.path[Ge]);for(let Ge=1;Ge$t(We,y,D));Ce=Ge.some(We=>We.signedDistanceFromCamera<=0)?[]:Ge.map(We=>We.point)}let je=[];if(Ce.length>0){let Ge=Ce[0].clone(),We=Ce[0].clone();for(let Lt=1;Lt=pe.x&&We.x<=Se.x&&Ge.y>=pe.y&&We.y<=Se.y?[Ce]:We.xSe.x||We.ySe.y?[]:c.clipLine([Ce],pe.x,pe.y,Se.x,Se.y)}for(let Ge of je){He.reset(Ge,.25*ce);let We=0;We=He.length<=.5*ce?1:Math.ceil(He.paddedLength/vt)+1;for(let Lt=0;Lt=this.screenRightBoundary||lthis.screenBottomBoundary}isInsideGrid(t,n,s,l){return s>=0&&t=0&&ns.collisionGroupID===n}}return this.collisionGroups[t]}}function De(h,t,n,s,l){let{horizontalAlign:p,verticalAlign:f}=c.getAnchorAlignment(h);return new c.Point(-(p-.5)*t+s[0]*l,-(f-.5)*n+s[1]*l)}function Oe(h,t,n,s,l,p){let{x1:f,x2:g,y1:y,y2:v,anchorPointX:w,anchorPointY:E}=h,A=new c.Point(t,n);return s&&A._rotate(l?p:-p),{x1:f+A.x,y1:y+A.y,x2:g+A.x,y2:v+A.y,anchorPointX:w,anchorPointY:E}}class Ae{constructor(t,n,s,l,p){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new N(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new le(l),this.collisionCircleArrays={},this.prevPlacement=p,p&&(p.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,s,l){let p=s.getBucket(n),f=s.latestFeatureIndex;if(!p||!f||n.id!==p.layerIds[0])return;let g=s.collisionBoxArray,y=p.layers[0].layout,v=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),w=s.tileSize/c.EXTENT,E=this.transform.calculatePosMatrix(s.tileID.toUnwrapped()),A=y.get("text-pitch-alignment")==="map",B=y.get("text-rotation-alignment")==="map",D=X(s,1,this.transform.zoom),O=Qr(E,A,B,this.transform,D),k=null;if(A){let J=me(E,A,B,this.transform,D);k=c.multiply([],this.transform.labelPlaneMatrix,J)}this.retainedQueryData[p.bucketInstanceId]=new oe(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,s.tileID);let G={bucket:p,layout:y,posMatrix:E,textLabelPlaneMatrix:O,labelToScreenMatrix:k,scale:v,textPixelRatio:w,holdingForFade:s.holdingForFade(),collisionBoxArray:g,partiallyEvaluatedTextSize:c.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(l)for(let J of p.sortKeyRanges){let{sortKey:U,symbolInstanceStart:H,symbolInstanceEnd:ee}=J;t.push({sortKey:U,symbolInstanceStart:H,symbolInstanceEnd:ee,parameters:G})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:G})}attemptAnchorPlacement(t,n,s,l,p,f,g,y,v,w,E,A,B,D,O,k){let G=c.TextAnchorEnum[t.textAnchor],J=[t.textOffset0,t.textOffset1],U=De(G,s,l,J,p),H=this.collisionIndex.placeCollisionBox(Oe(n,U.x,U.y,f,g,this.transform.angle),E,y,v,w.predicate,k);if((!O||this.collisionIndex.placeCollisionBox(Oe(O,U.x,U.y,f,g,this.transform.angle),E,y,v,w.predicate,k).box.length!==0)&&H.box.length>0){let ee;if(this.prevPlacement&&this.prevPlacement.variableOffsets[A.crossTileID]&&this.prevPlacement.placements[A.crossTileID]&&this.prevPlacement.placements[A.crossTileID].text&&(ee=this.prevPlacement.variableOffsets[A.crossTileID].anchor),A.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[A.crossTileID]={textOffset:J,width:s,height:l,anchor:G,textBoxScale:p,prevAnchor:ee},this.markUsedJustification(B,G,A,D),B.allowVerticalPlacement&&(this.markUsedOrientation(B,D,A),this.placedOrientations[A.crossTileID]=D),{shift:U,placedGlyphBoxes:H}}}placeLayerBucketPart(t,n,s){let{bucket:l,layout:p,posMatrix:f,textLabelPlaneMatrix:g,labelToScreenMatrix:y,textPixelRatio:v,holdingForFade:w,collisionBoxArray:E,partiallyEvaluatedTextSize:A,collisionGroup:B}=t.parameters,D=p.get("text-optional"),O=p.get("icon-optional"),k=c.getOverlapMode(p,"text-overlap","text-allow-overlap"),G=k==="always",J=c.getOverlapMode(p,"icon-overlap","icon-allow-overlap"),U=J==="always",H=p.get("text-rotation-alignment")==="map",ee=p.get("text-pitch-alignment")==="map",ie=p.get("icon-text-fit")!=="none",ae=p.get("symbol-z-order")==="viewport-y",he=G&&(U||!l.hasIconData()||O),ce=U&&(G||!l.hasTextData()||D);!l.collisionArrays&&E&&l.deserializeCollisionBoxes(E);let pe=this.retainedQueryData[l.bucketInstanceId].tileID,Se=this.terrain?(_e,Re)=>this.terrain.getElevation(pe,_e,Re):null,He=(_e,Re)=>{var Ce,vt;if(n[_e.crossTileID])return;if(w)return void(this.placements[_e.crossTileID]=new K(!1,!1,!1));let je=!1,Ge=!1,We=!0,Lt=null,pt={box:null,offscreen:null},Hi={box:null,offscreen:null},Pt=null,It=null,Fi=null,fr=0,bt=0,Nr=0;Re.textFeatureIndex?fr=Re.textFeatureIndex:_e.useRuntimeCollisionCircles&&(fr=_e.featureIndex),Re.verticalTextFeatureIndex&&(bt=Re.verticalTextFeatureIndex);let $r=Re.textBox;if($r){let di=Bt=>{let Rt=c.WritingMode.horizontal;if(l.allowVerticalPlacement&&!Bt&&this.prevPlacement){let Oi=this.prevPlacement.placedOrientations[_e.crossTileID];Oi&&(this.placedOrientations[_e.crossTileID]=Oi,Rt=Oi,this.markUsedOrientation(l,Rt,_e))}return Rt},ei=(Bt,Rt)=>{if(l.allowVerticalPlacement&&_e.numVerticalGlyphVertices>0&&Re.verticalTextBox){for(let Oi of l.writingModes)if(Oi===c.WritingMode.vertical?(pt=Rt(),Hi=pt):pt=Bt(),pt&&pt.box&&pt.box.length)break}else pt=Bt()},ni=_e.textAnchorOffsetStartIndex,pa=_e.textAnchorOffsetEndIndex;if(pa===ni){let Bt=(Rt,Oi)=>{let Ft=this.collisionIndex.placeCollisionBox(Rt,k,v,f,B.predicate,Se);return Ft&&Ft.box&&Ft.box.length&&(this.markUsedOrientation(l,Oi,_e),this.placedOrientations[_e.crossTileID]=Oi),Ft};ei(()=>Bt($r,c.WritingMode.horizontal),()=>{let Rt=Re.verticalTextBox;return l.allowVerticalPlacement&&_e.numVerticalGlyphVertices>0&&Rt?Bt(Rt,c.WritingMode.vertical):{box:null,offscreen:null}}),di(pt&&pt.box&&pt.box.length)}else{let Bt=c.TextAnchorEnum[(vt=(Ce=this.prevPlacement)===null||Ce===void 0?void 0:Ce.variableOffsets[_e.crossTileID])===null||vt===void 0?void 0:vt.anchor],Rt=(Ft,Ya,ln)=>{let Ja=Ft.x2-Ft.x1,Wo=Ft.y2-Ft.y1,Ko=_e.textBoxScale,Vl=ie&&J==="never"?Ya:null,qr={box:[],offscreen:!1},Rn=k==="never"?1:2,cn="never";Bt&&Rn++;for(let gr=0;grRt($r,Re.iconBox,c.WritingMode.horizontal),()=>{let Ft=Re.verticalTextBox;return l.allowVerticalPlacement&&!(pt&&pt.box&&pt.box.length)&&_e.numVerticalGlyphVertices>0&&Ft?Rt(Ft,Re.verticalIconBox,c.WritingMode.vertical):{box:null,offscreen:null}}),pt&&(je=pt.box,We=pt.offscreen);let Oi=di(pt&&pt.box);if(!je&&this.prevPlacement){let Ft=this.prevPlacement.variableOffsets[_e.crossTileID];Ft&&(this.variableOffsets[_e.crossTileID]=Ft,this.markUsedJustification(l,Ft.anchor,_e,Oi))}}}if(Pt=pt,je=Pt&&Pt.box&&Pt.box.length>0,We=Pt&&Pt.offscreen,_e.useRuntimeCollisionCircles){let di=l.text.placedSymbolArray.get(_e.centerJustifiedTextSymbolIndex),ei=c.evaluateSizeForFeature(l.textSizeData,A,di),ni=p.get("text-padding");It=this.collisionIndex.placeCollisionCircles(k,di,l.lineVertexArray,l.glyphOffsetArray,ei,f,g,y,s,ee,B.predicate,_e.collisionCircleDiameter,ni,Se),It.circles.length&&It.collisionDetected&&!s&&c.warnOnce("Collisions detected, but collision boxes are not shown"),je=G||It.circles.length>0&&!It.collisionDetected,We=We&&It.offscreen}if(Re.iconFeatureIndex&&(Nr=Re.iconFeatureIndex),Re.iconBox){let di=ei=>{let ni=ie&&Lt?Oe(ei,Lt.x,Lt.y,H,ee,this.transform.angle):ei;return this.collisionIndex.placeCollisionBox(ni,J,v,f,B.predicate,Se)};Hi&&Hi.box&&Hi.box.length&&Re.verticalIconBox?(Fi=di(Re.verticalIconBox),Ge=Fi.box.length>0):(Fi=di(Re.iconBox),Ge=Fi.box.length>0),We=We&&Fi.offscreen}let Ir=D||_e.numHorizontalGlyphVertices===0&&_e.numVerticalGlyphVertices===0,on=O||_e.numIconVertices===0;if(Ir||on?on?Ir||(Ge=Ge&&je):je=Ge&&je:Ge=je=Ge&&je,je&&Pt&&Pt.box&&this.collisionIndex.insertCollisionBox(Pt.box,k,p.get("text-ignore-placement"),l.bucketInstanceId,Hi&&Hi.box&&bt?bt:fr,B.ID),Ge&&Fi&&this.collisionIndex.insertCollisionBox(Fi.box,J,p.get("icon-ignore-placement"),l.bucketInstanceId,Nr,B.ID),It&&(je&&this.collisionIndex.insertCollisionCircles(It.circles,k,p.get("text-ignore-placement"),l.bucketInstanceId,fr,B.ID),s)){let di=l.bucketInstanceId,ei=this.collisionCircleArrays[di];ei===void 0&&(ei=this.collisionCircleArrays[di]=new ne);for(let ni=0;ni=0;--Re){let Ce=_e[Re];He(l.symbolInstances.get(Ce),l.collisionArrays[Ce])}}else for(let _e=t.symbolInstanceStart;_e=0&&(t.text.placedSymbolArray.get(g).crossTileID=p>=0&&g!==p?0:s.crossTileID)}markUsedOrientation(t,n,s){let l=n===c.WritingMode.horizontal||n===c.WritingMode.horizontalOnly?n:0,p=n===c.WritingMode.vertical?n:0,f=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(let g of f)t.text.placedSymbolArray.get(g).placedOrientation=l;s.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=p)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let n=this.prevPlacement,s=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;let l=n?n.symbolFadeChange(t):1,p=n?n.opacities:{},f=n?n.variableOffsets:{},g=n?n.placedOrientations:{};for(let y in this.placements){let v=this.placements[y],w=p[y];w?(this.opacities[y]=new q(w,l,v.text,v.icon),s=s||v.text!==w.text.placed||v.icon!==w.icon.placed):(this.opacities[y]=new q(null,l,v.text,v.icon,v.skipFade),s=s||v.text||v.icon)}for(let y in p){let v=p[y];if(!this.opacities[y]){let w=new q(v,l,!1,!1);w.isHidden()||(this.opacities[y]=w,s=s||v.text.placed||v.icon.placed)}}for(let y in f)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=f[y]);for(let y in g)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=g[y]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){let s={};for(let l of n){let p=l.getBucket(t);p&&l.latestFeatureIndex&&t.id===p.layerIds[0]&&this.updateBucketOpacities(p,s,l.collisionBoxArray)}}updateBucketOpacities(t,n,s){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();let l=t.layers[0],p=l.layout,f=new q(null,0,!1,!1,!0),g=p.get("text-allow-overlap"),y=p.get("icon-allow-overlap"),v=l._unevaluatedLayout.hasValue("text-variable-anchor")||l._unevaluatedLayout.hasValue("text-variable-anchor-offset"),w=p.get("text-rotation-alignment")==="map",E=p.get("text-pitch-alignment")==="map",A=p.get("icon-text-fit")!=="none",B=new q(null,0,g&&(y||!t.hasIconData()||p.get("icon-optional")),y&&(g||!t.hasTextData()||p.get("text-optional")),!0);!t.collisionArrays&&s&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(s);let D=(O,k,G)=>{for(let J=0;J0,ie=this.placedOrientations[k.crossTileID],ae=ie===c.WritingMode.vertical,he=ie===c.WritingMode.horizontal||ie===c.WritingMode.horizontalOnly;if(G>0||J>0){let ce=kt(H.text);D(t.text,G,ae?Vt:ce),D(t.text,J,he?Vt:ce);let pe=H.text.isHidden();[k.rightJustifiedTextSymbolIndex,k.centerJustifiedTextSymbolIndex,k.leftJustifiedTextSymbolIndex].forEach(_e=>{_e>=0&&(t.text.placedSymbolArray.get(_e).hidden=pe||ae?1:0)}),k.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(k.verticalPlacedTextSymbolIndex).hidden=pe||he?1:0);let Se=this.variableOffsets[k.crossTileID];Se&&this.markUsedJustification(t,Se.anchor,k,ie);let He=this.placedOrientations[k.crossTileID];He&&(this.markUsedJustification(t,"left",k,He),this.markUsedOrientation(t,He,k))}if(ee){let ce=kt(H.icon),pe=!(A&&k.verticalPlacedIconSymbolIndex&&ae);k.placedIconSymbolIndex>=0&&(D(t.icon,k.numIconVertices,pe?ce:Vt),t.icon.placedSymbolArray.get(k.placedIconSymbolIndex).hidden=H.icon.isHidden()),k.verticalPlacedIconSymbolIndex>=0&&(D(t.icon,k.numVerticalIconVertices,pe?Vt:ce),t.icon.placedSymbolArray.get(k.verticalPlacedIconSymbolIndex).hidden=H.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let ce=t.collisionArrays[O];if(ce){let pe=new c.Point(0,0);if(ce.textBox||ce.verticalTextBox){let He=!0;if(v){let _e=this.variableOffsets[U];_e?(pe=De(_e.anchor,_e.width,_e.height,_e.textOffset,_e.textBoxScale),w&&pe._rotate(E?this.transform.angle:-this.transform.angle)):He=!1}ce.textBox&&ke(t.textCollisionBox.collisionVertexArray,H.text.placed,!He||ae,pe.x,pe.y),ce.verticalTextBox&&ke(t.textCollisionBox.collisionVertexArray,H.text.placed,!He||he,pe.x,pe.y)}let Se=!!(!he&&ce.verticalIconBox);ce.iconBox&&ke(t.iconCollisionBox.collisionVertexArray,H.icon.placed,Se,A?pe.x:0,A?pe.y:0),ce.verticalIconBox&&ke(t.iconCollisionBox.collisionVertexArray,H.icon.placed,!Se,A?pe.x:0,A?pe.y:0)}}}if(t.sortFeatures(this.transform.angle),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`);if(t.bucketInstanceId in this.collisionCircleArrays){let O=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=O.invProjMatrix,t.placementViewportMatrix=O.viewportMatrix,t.collisionCircleArray=O.circles,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.lastPlacementChangeTimet}setStale(){this.stale=!0}}function ke(h,t,n,s,l){h.emplaceBack(t?1:0,n?1:0,s||0,l||0),h.emplaceBack(t?1:0,n?1:0,s||0,l||0),h.emplaceBack(t?1:0,n?1:0,s||0,l||0),h.emplaceBack(t?1:0,n?1:0,s||0,l||0)}let Ze=Math.pow(2,25),at=Math.pow(2,24),ct=Math.pow(2,17),tt=Math.pow(2,16),Qe=Math.pow(2,9),ri=Math.pow(2,8),dt=Math.pow(2,1);function kt(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;let t=h.placed?1:0,n=Math.floor(127*h.opacity);return n*Ze+t*at+n*ct+t*tt+n*Qe+t*ri+n*dt+t}let Vt=0;class Br{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,n,s,l,p){let f=this._bucketParts;for(;this._currentTileIndexg.sortKey-y.sortKey));this._currentPartIndex!this._forceFullPlacement&&c.browser.now()-l>2;for(;this._currentPlacementIndex>=0;){let f=n[t[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(f.type==="symbol"&&(!f.minzoom||f.minzoom<=g)&&(!f.maxzoom||f.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new Br(f)),this._inProgressLayer.continuePlacement(s[f.source],this.placement,this._showCollisionBoxes,f,p))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let hr=512/c.EXTENT/2;class xo{constructor(t,n,s){this.tileID=t,this.bucketInstanceId=s,this._symbolsByKey={};let l=new Map;for(let p=0;p({x:Math.floor(y.anchorX*hr),y:Math.floor(y.anchorY*hr)})),crossTileIDs:f.map(y=>y.crossTileID)};if(g.positions.length>128){let y=new c.KDBush(g.positions.length,16,Uint16Array);for(let{x:v,y:w}of g.positions)y.add(v,w);y.finish(),delete g.positions,g.index=y}this._symbolsByKey[p]=g}}getScaledCoordinates(t,n){let{x:s,y:l,z:p}=this.tileID.canonical,{x:f,y:g,z:y}=n.canonical,v=hr/Math.pow(2,y-p),w=(g*c.EXTENT+t.anchorY)*v,E=l*c.EXTENT*hr;return{x:Math.floor((f*c.EXTENT+t.anchorX)*v-s*c.EXTENT*hr),y:Math.floor(w-E)}}findMatches(t,n,s){let l=this.tileID.canonical.zt)}}class xl{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class lt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let n=Math.round((t-this.lng)/360);if(n!==0)for(let s in this.indexes){let l=this.indexes[s],p={};for(let f in l){let g=l[f];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+n),p[g.tileID.key]=g}this.indexes[s]=p}this.lng=t}addBucket(t,n,s){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let p=0;pt.overscaledZ)for(let g in f){let y=f[g];y.tileID.isChildOf(t)&&y.findMatches(n.symbolInstances,t,l)}else{let g=f[t.scaledTo(Number(p)).key];g&&g.findMatches(n.symbolInstances,t,l)}}for(let p=0;p{n[s]=!0});for(let s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}let wn=(h,t)=>c.emitValidationErrors(h,t&&t.filter(n=>n.identifier!=="source.canvas")),Mi=c.pick(c.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Pi=c.pick(c.operations,["setCenter","setZoom","setBearing","setPitch"]),vl=c.emptyStyle();class Qt extends c.Evented{constructor(t,n={}){super(),this.map=t,this.dispatcher=new Dr(ba(),this,t._getMapId()),this.imageManager=new Ki,this.imageManager.setEventedParent(this),this.glyphManager=new vr(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new jn(256,512),this.crossTileSymbolIndex=new wa,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",c.getReferrer());let s=this;this._rtlTextPluginCallback=Qt.registerForPluginStateChange(l=>{s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:l.pluginStatus,pluginURL:l.pluginURL},(p,f)=>{if(c.triggerPluginCompletionEvent(p),f&&f.every(g=>g))for(let g in s.sourceCaches){let y=s.sourceCaches[g].getSource().type;y!=="vector"&&y!=="geojson"||s.sourceCaches[g].reload()}})}),this.on("data",l=>{if(l.dataType!=="source"||l.sourceDataType!=="metadata")return;let p=this.sourceCaches[l.sourceId];if(!p)return;let f=p.getSource();if(f&&f.vectorLayerIds)for(let g in this._layers){let y=this._layers[g];y.source===f.id&&this._validateLayer(y)}})}loadURL(t,n={},s){this.fire(new c.Event("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;let l=this.map._requestManager.transformRequest(t,Ye.Style);this._request=c.getJSON(l,(p,f)=>{this._request=null,p?this.fire(new c.ErrorEvent(p)):f&&this._load(f,n,s)})}loadJSON(t,n={},s){this.fire(new c.Event("dataloading",{dataType:"style"})),this._request=c.browser.frame(()=>{this._request=null,n.validate=n.validate!==!1,this._load(t,n,s)})}loadEmpty(){this.fire(new c.Event("dataloading",{dataType:"style"})),this._load(vl,{validate:!1})}_load(t,n,s){var l;let p=n.transformStyle?n.transformStyle(s,t):t;if(!n.validate||!wn(this,c.validateStyle(p))){this._loaded=!0,this.stylesheet=p;for(let f in p.sources)this.addSource(f,p.sources[f],{validate:!1});p.sprite?this._loadSprite(p.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(p.glyphs),this._createLayers(),this.light=new Zn(this.stylesheet.light),this.map.setTerrain((l=this.stylesheet.terrain)!==null&&l!==void 0?l:null),this.fire(new c.Event("data",{dataType:"style"})),this.fire(new c.Event("style.load"))}}_createLayers(){let t=c.derefLayers(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(let n of t){let s=c.createStyleLayer(n);s.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=s}}_loadSprite(t,n=!1,s=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(l,p,f,g){let y=Jt(l),v=y.length,w=f>1?"@2x":"",E={},A={},B={};for(let{id:D,url:O}of y){let k=p.transformRequest(p.normalizeSpriteURL(O,w,".json"),Ye.SpriteJSON),G=`${D}_${k.url}`;E[G]=c.getJSON(k,(H,ee)=>{delete E[G],A[D]=ee,xa(g,A,B,H,v)});let J=p.transformRequest(p.normalizeSpriteURL(O,w,".png"),Ye.SpriteImage),U=`${D}_${J.url}`;E[U]=st.getImage(J,(H,ee)=>{delete E[U],B[D]=ee,xa(g,A,B,H,v)})}return{cancel(){for(let D of Object.values(E))D.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(l,p)=>{if(this._spriteRequest=null,l)this.fire(new c.ErrorEvent(l));else if(p)for(let f in p){this._spritesImagesIds[f]=[];let g=this._spritesImagesIds[f]?this._spritesImagesIds[f].filter(y=>!(y in p)):[];for(let y of g)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(let y in p[f]){let v=f==="default"?y:`${f}:${y}`;this._spritesImagesIds[f].push(v),v in this.imageManager.images?this.imageManager.updateImage(v,p[f][y],!1):this.imageManager.addImage(v,p[f][y]),n&&(this._changedImages[v]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.Event("data",{dataType:"style"})),s&&s(l)})}_unloadSprite(){for(let 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("setImages",this._availableImages),this.fire(new c.Event("data",{dataType:"style"}))}_validateLayer(t){let n=this.sourceCaches[t.source];if(!n)return;let s=t.sourceLayer;if(!s)return;let l=n.getSource();(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(s)===-1)&&this.fire(new c.ErrorEvent(new Error(`Source layer "${s}" does not exist on source "${l.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){let n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);let s=[];for(let l of t)n[l]&&s.push(n[l]);return s}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let n=Object.keys(this._layers);for(let s of n){let l=this._layers[s];l.type!=="custom"&&(t[s]=l.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(let t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(let t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;let n=this._changed;if(this._changed){let l=Object.keys(this._updatedLayers),p=Object.keys(this._removedLayers);(l.length||p.length)&&this._updateWorkerLayers(l,p);for(let f in this._updatedSources){let g=this._updatedSources[f];if(g==="reload")this._reloadSource(f);else{if(g!=="clear")throw new Error(`Invalid action ${g}`);this._clearSource(f)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let f in this._updatedPaintProps)this._layers[f].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}let s={};for(let l in this.sourceCaches){let p=this.sourceCaches[l];s[l]=p.used,p.used=!1}for(let l of this._order){let p=this._layers[l];p.recalculate(t,this._availableImages),!p.isHidden(t.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}for(let l in s){let p=this.sourceCaches[l];s[l]!==p.used&&p.fire(new c.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new c.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();let s=this.serialize();if(t=n.transformStyle?n.transformStyle(s,t):t,wn(this,c.validateStyle(t)))return!1;(t=c.clone$1(t)).layers=c.derefLayers(t.layers);let l=c.diffStyles(s,t).filter(f=>!(f.command in Pi));if(l.length===0)return!1;let p=l.filter(f=>!(f.command in Mi));if(p.length>0)throw new Error(`Unimplemented: ${p.map(f=>f.command).join(", ")}.`);for(let f of l)f.command!=="setTransition"&&this[f.command].apply(this,f.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,n){if(this.getImage(t))return this.fire(new c.ErrorEvent(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new c.ErrorEvent(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("setImages",this._availableImages),this.fire(new c.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,s={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(c.validateStyle.source,`sources.${t}`,n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);let l=this.sourceCaches[t]=new re(t,n,this.dispatcher);l.style=this,l.setEventedParent(this,()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:t})),l.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(let s in this._layers)if(this._layers[s].source===t)return this.fire(new c.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${s}" is using it.`)));let n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new c.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);let s=this.sourceCaches[t].getSource();if(s.type!=="geojson")throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,s={}){this._checkLoaded();let l=t.id;if(this.getLayer(l))return void this.fire(new c.ErrorEvent(new Error(`Layer "${l}" already exists on this map.`)));let p;if(t.type==="custom"){if(wn(this,c.validateCustomStyleLayer(t)))return;p=c.createStyleLayer(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(l,t.source),t=c.clone$1(t),t=c.extend(t,{source:l})),this._validate(c.validateStyle.layer,`layers.${l}`,t,{arrayIndex:-1},s))return;p=c.createStyleLayer(t),this._validateLayer(p),p.setEventedParent(this,{layer:{id:l}})}let f=n?this._order.indexOf(n):this._order.length;if(n&&f===-1)this.fire(new c.ErrorEvent(new Error(`Cannot add layer "${l}" before non-existing layer "${n}".`)));else{if(this._order.splice(f,0,l),this._layerOrderChanged=!0,this._layers[l]=p,this._removedLayers[l]&&p.source&&p.type!=="custom"){let g=this._removedLayers[l];delete this._removedLayers[l],g.type!==p.type?this._updatedSources[p.source]="clear":(this._updatedSources[p.source]="reload",this.sourceCaches[p.source].pause())}this._updateLayer(p),p.onAdd&&p.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new c.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;let s=this._order.indexOf(t);this._order.splice(s,1);let l=n?this._order.indexOf(n):this._order.length;n&&l===-1?this.fire(new c.ErrorEvent(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(l,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let n=this._layers[t];if(!n)return void this.fire(new c.ErrorEvent(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);let s=this._order.indexOf(t);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,s){this._checkLoaded();let l=this.getLayer(t);l?l.minzoom===n&&l.maxzoom===s||(n!=null&&(l.minzoom=n),s!=null&&(l.maxzoom=s),this._updateLayer(l)):this.fire(new c.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,s={}){this._checkLoaded();let l=this.getLayer(t);if(l){if(!c.deepEqual(l.filter,n))return n==null?(l.filter=void 0,void this._updateLayer(l)):void(this._validate(c.validateStyle.filter,`layers.${l.id}.filter`,n,null,s)||(l.filter=c.clone$1(n),this._updateLayer(l)))}else this.fire(new c.ErrorEvent(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return c.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,n,s,l={}){this._checkLoaded();let p=this.getLayer(t);p?c.deepEqual(p.getLayoutProperty(n),s)||(p.setLayoutProperty(n,s,l),this._updateLayer(p)):this.fire(new c.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){let s=this.getLayer(t);if(s)return s.getLayoutProperty(n);this.fire(new c.ErrorEvent(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,s,l={}){this._checkLoaded();let p=this.getLayer(t);p?c.deepEqual(p.getPaintProperty(n),s)||(p.setPaintProperty(n,s,l)&&this._updateLayer(p),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new c.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();let s=t.source,l=t.sourceLayer,p=this.sourceCaches[s];if(p===void 0)return void this.fire(new c.ErrorEvent(new Error(`The source '${s}' does not exist in the map's style.`)));let f=p.getSource().type;f==="geojson"&&l?this.fire(new c.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):f!=="vector"||l?(t.id===void 0&&this.fire(new c.ErrorEvent(new Error("The feature id parameter must be provided."))),p.setFeatureState(l,t.id,n)):this.fire(new c.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();let s=t.source,l=this.sourceCaches[s];if(l===void 0)return void this.fire(new c.ErrorEvent(new Error(`The source '${s}' does not exist in the map's style.`)));let p=l.getSource().type,f=p==="vector"?t.sourceLayer:void 0;p!=="vector"||f?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new c.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(f,t.id,n):this.fire(new c.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let n=t.source,s=t.sourceLayer,l=this.sourceCaches[n];if(l!==void 0)return l.getSource().type!=="vector"||s?(t.id===void 0&&this.fire(new c.ErrorEvent(new Error("The feature id parameter must be provided."))),l.getFeatureState(s,t.id)):void this.fire(new c.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return c.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let t=c.mapObject(this.sourceCaches,l=>l.serialize()),n=this._serializeByIds(this._order),s=this.stylesheet;return c.filterObject({version:s.version,name:s.name,metadata:s.metadata,light:s.light,center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,sprite:s.sprite,glyphs:s.glyphs,transition:s.transition,sources:t,layers:n},l=>l!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let n=f=>this._layers[f].type==="fill-extrusion",s={},l=[];for(let f=this._order.length-1;f>=0;f--){let g=this._order[f];if(n(g)){s[g]=f;for(let y of t){let v=y[g];if(v)for(let w of v)l.push(w)}}}l.sort((f,g)=>g.intersectionZ-f.intersectionZ);let p=[];for(let f=this._order.length-1;f>=0;f--){let g=this._order[f];if(n(g))for(let y=l.length-1;y>=0;y--){let v=l[y].feature;if(s[v.layer.id]{let he=G.featureSortOrder;if(he){let ce=he.indexOf(ie.featureIndex);return he.indexOf(ae.featureIndex)-ce}return ae.featureIndex-ie.featureIndex});for(let ie of ee)H.push(ie)}}for(let G in D)D[G].forEach(J=>{let U=J.feature,H=v[g[G].source].getFeatureState(U.layer["source-layer"],U.id);U.source=U.layer.source,U.layer["source-layer"]&&(U.sourceLayer=U.layer["source-layer"]),U.state=H});return D}(this._layers,f,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(p)}querySourceFeatures(t,n){n&&n.filter&&this._validate(c.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);let s=this.sourceCaches[t];return s?function(l,p){let f=l.getRenderableIds().map(v=>l.getTileByID(v)),g=[],y={};for(let v=0;v{_n[l]=p})(t,n),n.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:n.workerSourceURL},s):s(null,null))}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();let s=this.light.getLight(),l=!1;for(let f in t)if(!c.deepEqual(t[f],s[f])){l=!0;break}if(!l)return;let p={now:c.browser.now(),transition:c.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(p)}_validate(t,n,s,l,p={}){return(!p||p.validate!==!1)&&wn(this,t.call(c.validateStyle,c.extend({key:n,style:this.serialize(),value:s,styleSpec:c.v8Spec},l)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),c.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(let n in this._layers)this._layers[n].setEventedParent(null);for(let n in this.sourceCaches){let s=this.sourceCaches[n];s.setEventedParent(null),s.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(let n in this.sourceCaches)this.sourceCaches[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,n,s,l,p=!1){let f=!1,g=!1,y={};for(let v of this._order){let w=this._layers[v];if(w.type!=="symbol")continue;if(!y[w.source]){let A=this.sourceCaches[w.source];y[w.source]=A.getRenderableIds(!0).map(B=>A.getTileByID(B)).sort((B,D)=>D.tileID.overscaledZ-B.tileID.overscaledZ||(B.tileID.isLessThan(D.tileID)?-1:1))}let E=this.crossTileSymbolIndex.addLayer(w,y[w.source],t.center.lng);f=f||E}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((p=p||this._layerOrderChanged||s===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(c.browser.now(),t.zoom))&&(this.pauseablePlacement=new yo(t,this.map.terrain,this._order,p,n,s,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(c.browser.now()),g=!0),f&&this.pauseablePlacement.placement.setStale()),g||f)for(let v of this._order){let w=this._layers[v];w.type==="symbol"&&this.placement.updateLayerOpacities(w,y[w.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(c.browser.now())}_releaseSymbolFadeTiles(){for(let t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,s){this.imageManager.getImages(n.icons,s),this._updateTilesForChangedImages();let l=this.sourceCaches[n.source];l&&l.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,s){this.glyphManager.getGlyphs(n.stacks,s);let l=this.sourceCaches[n.source];l&&l.setDependencies(n.tileID.key,n.type,[""])}getResource(t,n,s){return c.makeRequest(n,s)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(c.validateStyle.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,s={},l){this._checkLoaded();let p=[{id:t,url:n}],f=[...Jt(this.stylesheet.sprite),...p];this._validate(c.validateStyle.sprite,"sprite",f,null,s)||(this.stylesheet.sprite=f,this._loadSprite(p,!0,l))}removeSprite(t){this._checkLoaded();let n=Jt(this.stylesheet.sprite);if(n.find(s=>s.id===t)){if(this._spritesImagesIds[t])for(let s of this._spritesImagesIds[t])this.imageManager.removeImage(s),this._changedImages[s]=!0;n.splice(n.findIndex(s=>s.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.Event("data",{dataType:"style"}))}else this.fire(new c.ErrorEvent(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return Jt(this.stylesheet.sprite)}setSprite(t,n={},s){this._checkLoaded(),t&&this._validate(c.validateStyle.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,s):(this._unloadSprite(),s&&s(null)))}}Qt.registerForPluginStateChange=c.registerForPluginStateChange;var xi=c.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ea="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";let Rr={prelude:Ue(`#ifdef GL_ES +(()=>{var Bl=(Qe,wt)=>()=>(wt||Qe((wt={exports:{}}).exports,wt),wt.exports);var ju=Bl((Yc,Qc)=>{(function(Qe,wt){typeof Yc=="object"&&typeof Qc<"u"?Qc.exports=wt():typeof define=="function"&&define.amd?define(wt):(Qe=typeof globalThis<"u"?globalThis:Qe||self,Qe.maplibregl=wt())})(Yc,function(){"use strict";var Qe={},wt={};function Et(P,d,qt){if(wt[P]=qt,P==="index"){var gt="var sharedModule = {}; ("+wt.shared+")(sharedModule); ("+wt.worker+")(sharedModule);",De={};return wt.shared(De),wt.index(Qe,De),typeof window<"u"&&Qe.setWorkerUrl(window.URL.createObjectURL(new Blob([gt],{type:"text/javascript"}))),Qe}}Et("shared",["exports"],function(P){"use strict";function d(i,t,r,n){return new(r||(r=Promise))(function(l,u){function p(x){try{g(n.next(x))}catch(v){u(v)}}function m(x){try{g(n.throw(x))}catch(v){u(v)}}function g(x){var v;x.done?l(x.value):(v=x.value,v instanceof r?v:new r(function(w){w(v)})).then(p,m)}g((n=n.apply(i,t||[])).next())})}function qt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var gt=De;function De(i,t){this.x=i,this.y=t}De.prototype={clone:function(){return new De(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,t){return this.clone()._rotateAround(i,t)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var t=i.x-this.x,r=i.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,t){return Math.atan2(this.x*t-this.y*i,this.x*i+this.y*t)},_matMult:function(i){var t=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=t,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var t=Math.cos(i),r=Math.sin(i),n=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=n,this},_rotateAround:function(i,t){var r=Math.cos(i),n=Math.sin(i),l=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-n*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},De.convert=function(i){return i instanceof De?i:Array.isArray(i)?new De(i[0],i[1]):i};var se=qt(gt),te=Tt;function Tt(i,t,r,n){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=n}Tt.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,n=0;n<8;n++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?p=r:m=r,r=.5*(m-p)+p;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var Nt=qt(te);let Lt,It;function pt(){return Lt==null&&(Lt=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Lt}function Ct(){if(It==null&&(It=!1,pt())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let n=0;n<5*5;n++){let l=4*n;t.fillStyle=`rgb(${l},${l+1},${l+2})`,t.fillRect(n%5,Math.floor(n/5),1,1)}let r=t.getImageData(0,0,5,5).data;for(let n=0;n<5*5*4;n++)if(n%4!=3&&r[n]!==n){It=!0;break}}}return It||!1}function dt(i,t,r,n){let l=new Nt(i,t,r,n);return u=>l.solve(u)}let Ui=dt(.25,.1,.25,1);function di(i,t,r){return Math.min(r,Math.max(t,i))}function nr(i,t,r){let n=r-t,l=((i-t)%n+n)%n+t;return l===t?r:l}function Di(i,...t){for(let r of t)for(let n in r)i[n]=r[n];return i}let kn=1;function sr(i,t,r){let n={};for(let l in i)n[l]=t.call(this,i[l],l,i);return n}function Wa(i,t,r){let n={};for(let l in i)t.call(this,i[l],l,i)&&(n[l]=i[l]);return n}function ot(i){return Array.isArray(i)?i.map(ot):typeof i=="object"&&i?sr(i,ot):i}let zn={};function Kt(i){zn[i]||(typeof console<"u"&&console.warn(i),zn[i]=!0)}function si(i,t,r){return(r.y-i.y)*(t.x-i.x)>(t.y-i.y)*(r.x-i.x)}function xr(i){return typeof WorkerGlobalScope<"u"&&i!==void 0&&i instanceof WorkerGlobalScope}let ha=null;function or(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}let En="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Ur(i,t,r,n,l){return d(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let u=new VideoFrame(i,{timestamp:0});try{let p=u?.format;if(!p||!p.startsWith("BGR")&&!p.startsWith("RGB"))throw new Error(`Unrecognized format ${p}`);let m=p.startsWith("BGR"),g=new Uint8ClampedArray(n*l*4);if(yield u.copyTo(g,function(x,v,w,I,k){let E=4*Math.max(-v,0),A=(Math.max(0,w)-w)*I*4+E,F=4*I,N=Math.max(0,v),Q=Math.max(0,w);return{rect:{x:N,y:Q,width:Math.min(x.width,v+I)-N,height:Math.min(x.height,w+k)-Q},layout:[{offset:A,stride:F}]}}(i,t,r,n,l)),m)for(let x=0;xxr(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,$r=function(i,t){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){let n=lr(i.url);if(n)return n(i,t);if(xr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,targetMapId:pa},t)}if(!(/^file:/.test(r=i.url)||/^file:/.test(Zi())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(n,l){return d(this,void 0,void 0,function*(){let u=new Request(n.url,{method:n.method||"GET",body:n.body,credentials:n.credentials,headers:n.headers,cache:n.cache,referrer:Zi(),signal:l.signal});n.type!=="json"||u.headers.has("Accept")||u.headers.set("Accept","application/json");let p=yield fetch(u);if(!p.ok){let x=yield p.blob();throw new Si(p.status,p.statusText,n.url,x)}let m;m=n.type==="arrayBuffer"||n.type==="image"?p.arrayBuffer():n.type==="json"?p.json():p.text();let g=yield m;if(l.signal.aborted)throw ua();return{data:g,cacheControl:p.headers.get("Cache-Control"),expires:p.headers.get("Expires")}})}(i,t);if(xr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,mustQueue:!0,targetMapId:pa},t)}var r;return function(n,l){return new Promise((u,p)=>{var m;let g=new XMLHttpRequest;g.open(n.method||"GET",n.url,!0),n.type!=="arrayBuffer"&&n.type!=="image"||(g.responseType="arraybuffer");for(let x in n.headers)g.setRequestHeader(x,n.headers[x]);n.type==="json"&&(g.responseType="text",!((m=n.headers)===null||m===void 0)&&m.Accept||g.setRequestHeader("Accept","application/json")),g.withCredentials=n.credentials==="include",g.onerror=()=>{p(new Error(g.statusText))},g.onload=()=>{if(!l.signal.aborted)if((g.status>=200&&g.status<300||g.status===0)&&g.response!==null){let x=g.response;if(n.type==="json")try{x=JSON.parse(g.response)}catch(v){return void p(v)}u({data:x,cacheControl:g.getResponseHeader("Cache-Control"),expires:g.getResponseHeader("Expires")})}else{let x=new Blob([g.response],{type:g.getResponseHeader("Content-Type")});p(new Si(g.status,g.statusText,n.url,x))}},l.signal.addEventListener("abort",()=>{g.abort(),p(ua())}),g.send(n.body)})}(i,t)};function Zr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;let t=new URL(i),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function Ka(i,t,r){r[i]&&r[i].indexOf(t)!==-1||(r[i]=r[i]||[],r[i].push(t))}function br(i,t,r){if(r&&r[i]){let n=r[i].indexOf(t);n!==-1&&r[i].splice(n,1)}}class Er{constructor(t,r={}){Di(this,r),this.type=t}}class Ar extends Er{constructor(t,r={}){super("error",Di({error:t},r))}}class da{on(t,r){return this._listeners=this._listeners||{},Ka(t,r,this._listeners),this}off(t,r){return br(t,r,this._listeners),br(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Ka(t,r,this._oneTimeListeners),this):new Promise(n=>this.once(t,n))}fire(t,r){typeof t=="string"&&(t=new Er(t,r||{}));let n=t.type;if(this.listens(n)){t.target=this;let l=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let m of l)m.call(this,t);let u=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let m of u)br(n,m,this._oneTimeListeners),m.call(this,t);let p=this._eventedParent;p&&(Di(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(t))}else t instanceof Ar&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var re={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},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:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let Gr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ja(i,t){let r={};for(let n in i)n!=="ref"&&(r[n]=i[n]);return Gr.forEach(n=>{n in t&&(r[n]=t[n])}),r}function it(i,t){if(Array.isArray(i)){if(!Array.isArray(t)||i.length!==t.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${t}>`}return i.kind}let L=[Dr,ge,$e,Fe,fi,Tr,Gi,M(Ne),Lr,pr,q];function O(i,t){if(t.kind==="error")return null;if(i.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!O(i.itemType,t.itemType))&&(typeof i.N!="number"||i.N===t.N))return null}else{if(i.kind===t.kind)return null;if(i.kind==="value"){for(let r of L)if(!O(r,t))return null}}return`Expected ${C(i)} but found ${C(t)} instead.`}function H(i,t){return t.some(r=>r.kind===i.kind)}function W(i,t){return t.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function Y(i,t){return i.kind==="array"&&t.kind==="array"?i.itemType.kind===t.itemType.kind&&typeof i.N=="number":i.kind===t.kind}let $=.96422,ne=.82521,ce=4/29,ie=6/29,de=3*ie*ie,Pe=ie*ie*ie,Le=Math.PI/180,Je=180/Math.PI;function je(i){return(i%=360)<0&&(i+=360),i}function Ye([i,t,r,n]){let l,u,p=Ft((.2225045*(i=He(i))+.7168786*(t=He(t))+.0606169*(r=He(r)))/1);i===t&&t===r?l=u=p:(l=Ft((.4360747*i+.3850649*t+.1430804*r)/$),u=Ft((.0139322*i+.0971045*t+.7141733*r)/ne));let m=116*p-16;return[m<0?0:m,500*(l-p),200*(p-u),n]}function He(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Ft(i){return i>Pe?Math.pow(i,1/3):i/de+ce}function kt([i,t,r,n]){let l=(i+16)/116,u=isNaN(t)?l:l+t/500,p=isNaN(r)?l:l-r/200;return l=1*nt(l),u=$*nt(u),p=ne*nt(p),[Ze(3.1338561*u-1.6168667*l-.4906146*p),Ze(-.9787684*u+1.9161415*l+.033454*p),Ze(.0719453*u-.2289914*l+1.4052427*p),n]}function Ze(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function nt(i){return i>ie?i*i*i:de*(i-ce)}function St(i){return parseInt(i.padEnd(2,i),16)/255}function Ut(i,t){return Ht(t?i/100:i,0,1)}function Ht(i,t,r){return Math.min(Math.max(t,i),r)}function li(i){return!i.some(Number.isNaN)}let fa={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class st{constructor(t,r,n,l=1,u=!0){this.r=t,this.g=r,this.b=n,this.a=l,u||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[t,r,n,l]))}static parse(t){if(t instanceof st)return t;if(typeof t!="string")return;let r=function(n){if((n=n.toLowerCase().trim())==="transparent")return[0,0,0,0];let l=fa[n];if(l){let[p,m,g]=l;return[p/255,m/255,g/255,1]}if(n.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(n)){let p=n.length<6?1:2,m=1;return[St(n.slice(m,m+=p)),St(n.slice(m,m+=p)),St(n.slice(m,m+=p)),St(n.slice(m,m+p)||"ff")]}if(n.startsWith("rgb")){let p=n.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){let[m,g,x,v,w,I,k,E,A,F,N,Q]=p,G=[v||" ",k||" ",F].join("");if(G===" "||G===" /"||G===",,"||G===",,,"){let J=[x,I,A].join(""),ae=J==="%%%"?100:J===""?255:0;if(ae){let he=[Ht(+g/ae,0,1),Ht(+w/ae,0,1),Ht(+E/ae,0,1),N?Ut(+N,Q):1];if(li(he))return he}}return}}let u=n.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){let[p,m,g,x,v,w,I,k,E]=u,A=[g||" ",v||" ",I].join("");if(A===" "||A===" /"||A===",,"||A===",,,"){let F=[+m,Ht(+x,0,100),Ht(+w,0,100),k?Ut(+k,E):1];if(li(F))return function([N,Q,G,J]){function ae(he){let we=(he+N/30)%12,Re=Q*Math.min(G,1-G);return G-Re*Math.max(-1,Math.min(we-3,9-we,1))}return N=je(N),Q/=100,G/=100,[ae(0),ae(8),ae(4),J]}(F)}}}(t);return r?new st(...r,!1):void 0}get rgb(){let{r:t,g:r,b:n,a:l}=this,u=l||1/0;return this.overwriteGetter("rgb",[t/u,r/u,n/u,l])}get hcl(){return this.overwriteGetter("hcl",function(t){let[r,n,l,u]=Ye(t),p=Math.sqrt(n*n+l*l);return[Math.round(1e4*p)?je(Math.atan2(l,n)*Je):NaN,p,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ye(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){let[t,r,n,l]=this.rgb;return`rgba(${[t,r,n].map(u=>Math.round(255*u)).join(",")},${l})`}}st.black=new st(0,0,0,1),st.white=new st(1,1,1,1),st.transparent=new st(0,0,0,0),st.red=new st(1,0,0,1);class Is{constructor(t,r,n){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Cs{constructor(t,r,n,l,u){this.text=t,this.image=r,this.scale=n,this.fontStack=l,this.textColor=u}}class Ii{constructor(t){this.sections=t}static fromString(t){return new Ii([new Cs(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof Ii?t:Ii.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class Ci{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Ci)return t;if(typeof t=="number")return new Ci([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Ci(t)}}toString(){return JSON.stringify(this.values)}}let Fl=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ri{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Ri)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r=0&&i<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?n===void 0||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[i,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[i,t,r,n]:[i,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Hr(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof st||i instanceof Is||i instanceof Ii||i instanceof Ci||i instanceof Ri||i instanceof Mi)return!0;if(Array.isArray(i)){for(let t of i)if(!Hr(t))return!1;return!0}if(typeof i=="object"){for(let t in i)if(!Hr(i[t]))return!1;return!0}return!1}function Ot(i){if(i===null)return Dr;if(typeof i=="string")return $e;if(typeof i=="boolean")return Fe;if(typeof i=="number")return ge;if(i instanceof st)return fi;if(i instanceof Is)return ur;if(i instanceof Ii)return Tr;if(i instanceof Ci)return Lr;if(i instanceof Ri)return q;if(i instanceof Mi)return pr;if(Array.isArray(i)){let t=i.length,r;for(let n of i){let l=Ot(n);if(r){if(r===l)continue;r=Ne;break}r=l}return M(r||Ne,t)}return Gi}function tn(i){let t=typeof i;return i===null?"":t==="string"||t==="number"||t==="boolean"?String(i):i instanceof st||i instanceof Ii||i instanceof Ci||i instanceof Ri||i instanceof Mi?i.toString():JSON.stringify(i)}class Hi{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Hr(t[1]))return r.error("invalid value");let n=t[1],l=Ot(n),u=r.expectedType;return l.kind!=="array"||l.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(l=u),new Hi(l,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Rt{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}let An={string:$e,number:ge,boolean:Fe,object:Gi};class Xi{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n,l=1,u=t[0];if(u==="array"){let m,g;if(t.length>2){let x=t[1];if(typeof x!="string"||!(x in An)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=An[x],l++}else m=Ne;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);g=t[2],l++}n=M(m,g)}else{if(!An[u])throw new Error(`Types doesn't contain name = ${u}`);n=An[u]}let p=[];for(;lt.outputDefined())}}let Ms={"to-boolean":Fe,"to-color":fi,"to-number":ge,"to-string":$e};class Wi{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n=t[0];if(!Ms[n])throw new Error(`Can't parse ${n} as it is not part of the known types`);if((n==="to-boolean"||n==="to-string")&&t.length!==2)return r.error("Expected one argument.");let l=Ms[n],u=[];for(let p=1;p4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:ga(r[0],r[1],r[2],r[3]),!n))return new st(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Rt(n||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(let n of this.args){r=n.evaluate(t);let l=Ci.parse(r);if(l)return l}throw new Rt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(let n of this.args){r=n.evaluate(t);let l=Ri.parse(r);if(l)return l}throw new Rt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(let n of this.args){if(r=n.evaluate(t),r===null)return 0;let l=Number(r);if(!isNaN(l))return l}throw new Rt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Ii.fromString(tn(this.args[0].evaluate(t)));case"resolvedImage":return Mi.fromString(tn(this.args[0].evaluate(t)));default:return tn(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}let Ol=["Unknown","Point","LineString","Polygon"];class Pn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ol[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache[t];return r||(r=this._parseColorCache[t]=st.parse(t)),r}}class Xr{constructor(t,r,n=[],l,u=new hr,p=[]){this.registry=t,this.path=n,this.key=n.map(m=>`[${m}]`).join(""),this.scope=u,this.errors=p,this.expectedType=l,this._isConstant=r}parse(t,r,n,l,u={}){return r?this.concat(r,n,l)._parse(t,u):this._parse(t,u)}_parse(t,r){function n(l,u,p){return p==="assert"?new Xi(u,[l]):p==="coerce"?new Wi(u,[l]):l}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let l=t[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let u=this.registry[l];if(u){let p=u.parse(t,this);if(!p)return null;if(this.expectedType){let m=this.expectedType,g=p.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||g.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(m.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array")if(m.kind!=="variableAnchorOffsetCollection"||g.kind!=="value"&&g.kind!=="array"){if(this.checkSubtype(m,g))return null}else p=n(p,m,r.typeAnnotation||"coerce");else p=n(p,m,r.typeAnnotation||"coerce");else p=n(p,m,r.typeAnnotation||"coerce");else p=n(p,m,r.typeAnnotation||"assert")}if(!(p instanceof Hi)&&p.type.kind!=="resolvedImage"&&this._isConstant(p)){let m=new Pn;try{p=new Hi(p.type,p.evaluate(m))}catch(g){return this.error(g.message),null}}return p}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,n){let l=typeof t=="number"?this.path.concat(t):this.path,u=n?this.scope.concat(n):this.scope;return new Xr(this.registry,this._isConstant,l,r||null,u,this.errors)}error(t,...r){let n=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new oi(n,t))}checkSubtype(t,r){let n=O(t,r);return n&&this.error(n),n}}class Rr{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let n=[];for(let u=1;u=n.length)throw new Rt(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r!==Math.floor(r))throw new Rt(`Array index must be an integer, but found ${r} instead.`);return n[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class zs{constructor(t,r){this.type=Fe,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let n=r.parse(t[1],1,Ne),l=r.parse(t[2],2,Ne);return n&&l?H(n.type,[Fe,$e,ge,Dr,Ne])?new zs(n,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${C(n.type)} instead`):null}evaluate(t){let r=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!n)return!1;if(!W(r,["boolean","string","number","null"]))throw new Rt(`Expected first argument to be of type boolean, string, number or null, but found ${C(Ot(r))} instead.`);if(!W(n,["string","array"]))throw new Rt(`Expected second argument to be of type array or string, but found ${C(Ot(n))} instead.`);return n.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class _a{constructor(t,r,n){this.type=ge,this.needle=t,this.haystack=r,this.fromIndex=n}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let n=r.parse(t[1],1,Ne),l=r.parse(t[2],2,Ne);if(!n||!l)return null;if(!H(n.type,[Fe,$e,ge,Dr,Ne]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${C(n.type)} instead`);if(t.length===4){let u=r.parse(t[3],3,ge);return u?new _a(n,l,u):null}return new _a(n,l)}evaluate(t){let r=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!W(r,["boolean","string","number","null"]))throw new Rt(`Expected first argument to be of type boolean, string, number or null, but found ${C(Ot(r))} instead.`);let l;if(this.fromIndex&&(l=this.fromIndex.evaluate(t)),W(n,["string"])){let u=n.indexOf(r,l);return u===-1?-1:[...n.slice(0,u)].length}if(W(n,["array"]))return n.indexOf(r,l);throw new Rt(`Expected second argument to be of type array or string, but found ${C(Ot(n))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Es{constructor(t,r,n,l,u,p){this.inputType=t,this.type=r,this.input=n,this.cases=l,this.outputs=u,this.otherwise=p}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let n,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);let u={},p=[];for(let x=2;xNumber.MAX_SAFE_INTEGER)return I.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof E=="number"&&Math.floor(E)!==E)return I.error("Numeric branch labels must be integer values.");if(n){if(I.checkSubtype(n,Ot(E)))return null}else n=Ot(E);if(u[String(E)]!==void 0)return I.error("Branch labels must be unique.");u[String(E)]=p.length}let k=r.parse(w,x,l);if(!k)return null;l=l||k.type,p.push(k)}let m=r.parse(t[1],1,Ne);if(!m)return null;let g=r.parse(t[t.length-1],t.length-1,l);return g?m.type.kind!=="value"&&r.concat(1).checkSubtype(n,m.type)?null:new Es(n,l,m,u,p,g):null}evaluate(t){let r=this.input.evaluate(t);return(Ot(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Dn{constructor(t,r,n){this.type=t,this.branches=r,this.otherwise=n}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let l=[];for(let p=1;pr.outputDefined())&&this.otherwise.outputDefined()}}class rn{constructor(t,r,n,l){this.type=t,this.input=r,this.beginIndex=n,this.endIndex=l}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let n=r.parse(t[1],1,Ne),l=r.parse(t[2],2,ge);if(!n||!l)return null;if(!H(n.type,[M(Ne),$e,Ne]))return r.error(`Expected first argument to be of type array or string, but found ${C(n.type)} instead`);if(t.length===4){let u=r.parse(t[3],3,ge);return u?new rn(n.type,n,l,u):null}return new rn(n.type,n,l)}evaluate(t){let r=this.input.evaluate(t),n=this.beginIndex.evaluate(t),l;if(this.endIndex&&(l=this.endIndex.evaluate(t)),W(r,["string"]))return[...r].slice(n,l).join("");if(W(r,["array"]))return r.slice(n,l);throw new Rt(`Expected first argument to be of type array or string, but found ${C(Ot(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Ln(i,t){let r=i.length-1,n,l,u=0,p=r,m=0;for(;u<=p;)if(m=Math.floor((u+p)/2),n=i[m],l=i[m+1],n<=t){if(m===r||tt))throw new Rt("Input is not a number.");p=m-1}return 0}class ya{constructor(t,r,n){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(let[l,u]of n)this.labels.push(l),this.outputs.push(u)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");let n=r.parse(t[1],1,ge);if(!n)return null;let l=[],u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let p=1;p=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);let w=r.parse(g,v,u);if(!w)return null;u=u||w.type,l.push([m,w])}return new ya(u,n,l)}evaluate(t){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(t);let l=this.input.evaluate(t);if(l<=r[0])return n[0].evaluate(t);let u=r.length;return l>=r[u-1]?n[u-1].evaluate(t):n[Ln(r,l)].evaluate(t)}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Lo(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Vl=Ro;function Ro(i,t,r,n){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=n}Ro.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,n=0;n<8;n++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?p=r:m=r,r=.5*(m-p)+p;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var ql=Lo(Vl);function Wr(i,t,r){return i+r*(t-i)}function an(i,t,r){return i.map((n,l)=>Wr(n,t[l],r))}let gi={number:Wr,color:function(i,t,r,n="rgb"){switch(n){case"rgb":{let[l,u,p,m]=an(i.rgb,t.rgb,r);return new st(l,u,p,m,!1)}case"hcl":{let[l,u,p,m]=i.hcl,[g,x,v,w]=t.hcl,I,k;if(isNaN(l)||isNaN(g))isNaN(l)?isNaN(g)?I=NaN:(I=g,p!==1&&p!==0||(k=x)):(I=l,v!==1&&v!==0||(k=u));else{let Q=g-l;g>l&&Q>180?Q-=360:g180&&(Q+=360),I=l+r*Q}let[E,A,F,N]=function([Q,G,J,ae]){return Q=isNaN(Q)?0:Q*Le,kt([J,Math.cos(Q)*G,Math.sin(Q)*G,ae])}([I,k??Wr(u,x,r),Wr(p,v,r),Wr(m,w,r)]);return new st(E,A,F,N,!1)}case"lab":{let[l,u,p,m]=kt(an(i.lab,t.lab,r));return new st(l,u,p,m,!1)}}},array:an,padding:function(i,t,r){return new Ci(an(i.values,t.values,r))},variableAnchorOffsetCollection:function(i,t,r){let n=i.values,l=t.values;if(n.length!==l.length)throw new Rt(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${t.toString()}`);let u=[];for(let p=0;ptypeof v!="number"||v<0||v>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:x}}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,ge),!u)return null;let m=[],g=null;n==="interpolate-hcl"||n==="interpolate-lab"?g=fi:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let x=0;x=v)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',I);let E=r.parse(w,k,g);if(!E)return null;g=g||E.type,m.push([v,E])}return Y(g,ge)||Y(g,fi)||Y(g,Lr)||Y(g,q)||Y(g,M(ge))?new _i(g,n,l,u,m):r.error(`Type ${C(g)} is not interpolatable.`)}evaluate(t){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(t);let l=this.input.evaluate(t);if(l<=r[0])return n[0].evaluate(t);let u=r.length;if(l>=r[u-1])return n[u-1].evaluate(t);let p=Ln(r,l),m=_i.interpolationFactor(this.interpolation,l,r[p],r[p+1]),g=n[p].evaluate(t),x=n[p+1].evaluate(t);switch(this.operator){case"interpolate":return gi[this.type.kind](g,x,m);case"interpolate-hcl":return gi.color(g,x,m,"hcl");case"interpolate-lab":return gi.color(g,x,m,"lab")}}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Rn(i,t,r,n){let l=n-r,u=i-r;return l===0?0:t===1?u/l:(Math.pow(t,u)-1)/(Math.pow(t,l)-1)}class Bn{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let n=null,l=r.expectedType;l&&l.kind!=="value"&&(n=l);let u=[];for(let m of t.slice(1)){let g=r.parse(m,1+u.length,n,void 0,{typeAnnotation:"omit"});if(!g)return null;n=n||g.type,u.push(g)}if(!n)throw new Error("No output type");let p=l&&u.some(m=>O(l,m.type));return new Bn(p?Ne:n,u)}evaluate(t){let r,n=null,l=0;for(let u of this.args)if(l++,n=u.evaluate(t),n&&n instanceof Mi&&!n.available&&(r||(r=n.name),n=null,l===this.args.length&&(n=r)),n!==null)break;return n}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Fn(i,t){return i==="=="||i==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Bo(i,t,r,n){return n.compare(t,r)===0}function xa(i,t,r){let n=i!=="=="&&i!=="!=";return class Nu{constructor(u,p,m){this.type=Fe,this.lhs=u,this.rhs=p,this.collator=m,this.hasUntypedArgument=u.type.kind==="value"||p.type.kind==="value"}static parse(u,p){if(u.length!==3&&u.length!==4)return p.error("Expected two or three arguments.");let m=u[0],g=p.parse(u[1],1,Ne);if(!g)return null;if(!Fn(m,g.type))return p.concat(1).error(`"${m}" comparisons are not supported for type '${C(g.type)}'.`);let x=p.parse(u[2],2,Ne);if(!x)return null;if(!Fn(m,x.type))return p.concat(2).error(`"${m}" comparisons are not supported for type '${C(x.type)}'.`);if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error(`Cannot compare types '${C(g.type)}' and '${C(x.type)}'.`);n&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new Xi(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new Xi(g.type,[x])));let v=null;if(u.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(v=p.parse(u[3],3,ur),!v)return null}return new Nu(g,x,v)}evaluate(u){let p=this.lhs.evaluate(u),m=this.rhs.evaluate(u);if(n&&this.hasUntypedArgument){let g=Ot(p),x=Ot(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new Rt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${g.kind}, ${x.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let g=Ot(p),x=Ot(m);if(g.kind!=="string"||x.kind!=="string")return t(u,p,m)}return this.collator?r(u,p,m,this.collator.evaluate(u)):t(u,p,m)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}let Nl=xa("==",function(i,t,r){return t===r},Bo),Fo=xa("!=",function(i,t,r){return t!==r},function(i,t,r,n){return!Bo(0,t,r,n)}),Oo=xa("<",function(i,t,r){return t",function(i,t,r){return t>r},function(i,t,r,n){return n.compare(t,r)>0}),Ul=xa("<=",function(i,t,r){return t<=r},function(i,t,r,n){return n.compare(t,r)<=0}),Vo=xa(">=",function(i,t,r){return t>=r},function(i,t,r,n){return n.compare(t,r)>=0});class nn{constructor(t,r,n){this.type=ur,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");let n=t[1];if(typeof n!="object"||Array.isArray(n))return r.error("Collator options argument must be an object.");let l=r.parse(n["case-sensitive"]!==void 0&&n["case-sensitive"],1,Fe);if(!l)return null;let u=r.parse(n["diacritic-sensitive"]!==void 0&&n["diacritic-sensitive"],1,Fe);if(!u)return null;let p=null;return n.locale&&(p=r.parse(n.locale,1,$e),!p)?null:new nn(l,u,p)}evaluate(t){return new Is(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class As{constructor(t,r,n,l,u){this.type=$e,this.number=t,this.locale=r,this.currency=n,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");let n=r.parse(t[1],1,ge);if(!n)return null;let l=t[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let u=null;if(l.locale&&(u=r.parse(l.locale,1,$e),!u))return null;let p=null;if(l.currency&&(p=r.parse(l.currency,1,$e),!p))return null;let m=null;if(l["min-fraction-digits"]&&(m=r.parse(l["min-fraction-digits"],1,ge),!m))return null;let g=null;return l["max-fraction-digits"]&&(g=r.parse(l["max-fraction-digits"],1,ge),!g)?null:new As(n,u,p,m,g)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class On{constructor(t){this.type=Tr,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n=t[1];if(!Array.isArray(n)&&typeof n=="object")return r.error("First argument must be an image or text section.");let l=[],u=!1;for(let p=1;p<=t.length-1;++p){let m=t[p];if(u&&typeof m=="object"&&!Array.isArray(m)){u=!1;let g=null;if(m["font-scale"]&&(g=r.parse(m["font-scale"],1,ge),!g))return null;let x=null;if(m["text-font"]&&(x=r.parse(m["text-font"],1,M($e)),!x))return null;let v=null;if(m["text-color"]&&(v=r.parse(m["text-color"],1,fi),!v))return null;let w=l[l.length-1];w.scale=g,w.font=x,w.textColor=v}else{let g=r.parse(t[p],1,Ne);if(!g)return null;let x=g.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,l.push({content:g,scale:null,font:null,textColor:null})}}return new On(l)}evaluate(t){return new Ii(this.sections.map(r=>{let n=r.content.evaluate(t);return Ot(n)===pr?new Cs("",n,null,null,null):new Cs(tn(n),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null)}))}eachChild(t){for(let r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}outputDefined(){return!1}}class Ps{constructor(t){this.type=pr,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");let n=r.parse(t[1],1,$e);return n?new Ps(n):r.error("No image name provided.")}evaluate(t){let r=this.input.evaluate(t),n=Mi.fromString(r);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(r)>-1),n}eachChild(t){t(this.input)}outputDefined(){return!1}}class Ds{constructor(t){this.type=ge,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let n=r.parse(t[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${C(n.type)} instead.`):new Ds(n):null}evaluate(t){let r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new Rt(`Expected value to be of type string or array, but found ${C(Ot(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}let dr=8192;function $l(i,t){let r=(180+i[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*dr),Math.round(n*l*dr)]}function Ls(i,t){let r=Math.pow(2,t.z);return[(l=(i[0]/dr+t.x)/r,360*l-180),(n=(i[1]/dr+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,l}function Kr(i,t){i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.max(i[2],t[0]),i[3]=Math.max(i[3],t[1])}function Br(i,t){return!(i[0]<=t[0]||i[2]>=t[2]||i[1]<=t[1]||i[3]>=t[3])}function at(i,t,r){let n=i[0]-t[0],l=i[1]-t[1],u=i[0]-r[0],p=i[1]-r[1];return n*p-u*l==0&&n*u<=0&&l*p<=0}function Vn(i,t,r,n){return(l=[n[0]-r[0],n[1]-r[1]])[0]*(u=[t[0]-i[0],t[1]-i[1]])[1]-l[1]*u[0]!=0&&!(!No(i,t,r,n)||!No(r,n,i,t));var l,u}function Zl(i,t,r){for(let n of r)for(let l=0;l(l=i)[1]!=(p=m[g+1])[1]>l[1]&&l[0]<(p[0]-u[0])*(l[1]-u[1])/(p[1]-u[1])+u[0]&&(n=!n)}var l,u,p;return n}function Gl(i,t){for(let r of t)if(va(i,r))return!0;return!1}function qo(i,t){for(let r of i)if(!va(r,t))return!1;for(let r=0;r0&&m<0||p<0&&m>0}function Rs(i,t,r){let n=[];for(let l=0;lr[2]){let l=.5*n,u=i[0]-r[0]>l?-n:r[0]-i[0]>l?n:0;u===0&&(u=i[0]-r[2]>l?-n:r[2]-i[0]>l?n:0),i[0]+=u}Kr(t,i)}function $o(i,t,r,n){let l=Math.pow(2,n.z)*dr,u=[n.x*dr,n.y*dr],p=[];for(let m of i)for(let g of m){let x=[g.x+u[0],g.y+u[1]];Uo(x,t,r,l),p.push(x)}return p}function Zo(i,t,r,n){let l=Math.pow(2,n.z)*dr,u=[n.x*dr,n.y*dr],p=[];for(let g of i){let x=[];for(let v of g){let w=[v.x+u[0],v.y+u[1]];Kr(t,w),x.push(w)}p.push(x)}if(t[2]-t[0]<=l/2){(m=t)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(let g of p)for(let x of g)Uo(x,t,r,l)}var m;return p}class Jr{constructor(t,r){this.type=Fe,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Hr(t[1])){let n=t[1];if(n.type==="FeatureCollection"){let l=[];for(let u of n.features){let{type:p,coordinates:m}=u.geometry;p==="Polygon"&&l.push(m),p==="MultiPolygon"&&l.push(...m)}if(l.length)return new Jr(n,{type:"MultiPolygon",coordinates:l})}else if(n.type==="Feature"){let l=n.geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new Jr(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new Jr(n,n)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,n){let l=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if(n.type==="Polygon"){let m=Rs(n.coordinates,u,p),g=$o(r.geometry(),l,u,p);if(!Br(l,u))return!1;for(let x of g)if(!va(x,m))return!1}if(n.type==="MultiPolygon"){let m=jo(n.coordinates,u,p),g=$o(r.geometry(),l,u,p);if(!Br(l,u))return!1;for(let x of g)if(!Gl(x,m))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,n){let l=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if(n.type==="Polygon"){let m=Rs(n.coordinates,u,p),g=Zo(r.geometry(),l,u,p);if(!Br(l,u))return!1;for(let x of g)if(!qo(x,m))return!1}if(n.type==="MultiPolygon"){let m=jo(n.coordinates,u,p),g=Zo(r.geometry(),l,u,p);if(!Br(l,u))return!1;for(let x of g)if(!Hl(x,m))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Go=class{constructor(i=[],t=(r,n)=>rn?1:0){if(this.data=i,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(i){this.data.push(i),this._up(this.length++)}pop(){if(this.length===0)return;let i=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),i}peek(){return this.data[0]}_up(i){let{data:t,compare:r}=this,n=t[i];for(;i>0;){let l=i-1>>1,u=t[l];if(r(n,u)>=0)break;t[i]=u,i=l}t[i]=n}_down(i){let{data:t,compare:r}=this,n=this.length>>1,l=t[i];for(;i=0)break;t[i]=t[u],i=u}t[i]=l}};function Xl(i,t,r,n,l){Ho(i,t,r,n||i.length-1,l||Wl)}function Ho(i,t,r,n,l){for(;n>r;){if(n-r>600){var u=n-r+1,p=t-r+1,m=Math.log(u),g=.5*Math.exp(2*m/3),x=.5*Math.sqrt(m*g*(u-g)/u)*(p-u/2<0?-1:1);Ho(i,t,Math.max(r,Math.floor(t-p*g/u+x)),Math.min(n,Math.floor(t+(u-p)*g/u+x)),l)}var v=i[t],w=r,I=n;for(sn(i,r,t),l(i[n],v)>0&&sn(i,r,n);w0;)I--}l(i[r],v)===0?sn(i,r,I):sn(i,++I,n),I<=t&&(r=I+1),t<=I&&(n=I-1)}}function sn(i,t,r){var n=i[t];i[t]=i[r],i[r]=n}function Wl(i,t){return it?1:0}function qn(i,t){if(i.length<=1)return[i];let r=[],n,l;for(let u of i){let p=Jl(u);p!==0&&(u.area=Math.abs(p),l===void 0&&(l=p<0),l===p<0?(n&&r.push(n),n=[u]):n.push(u))}if(n&&r.push(n),t>1)for(let u=0;u1?(x=t[g+1][0],v=t[g+1][1]):k>0&&(x+=w/this.kx*k,v+=I/this.ky*k)),w=this.wrap(r[0]-x)*this.kx,I=(r[1]-v)*this.ky;let E=w*w+I*I;E180;)t-=360;return t}}function Jo(i,t){return t[0]-i[0]}function Nn(i){return i[1]-i[0]+1}function Sr(i,t){return i[1]>=i[0]&&i[1]i[1])return[null,null];let r=Nn(i);if(t){if(r===2)return[i,null];let l=Math.floor(r/2);return[[i[0],i[0]+l],[i[0]+l,i[1]]]}if(r===1)return[i,null];let n=Math.floor(r/2)-1;return[[i[0],i[0]+n],[i[0]+n+1,i[1]]]}function Os(i,t){if(!Sr(t,i.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)Kr(r,i[n]);return r}function Vs(i){let t=[1/0,1/0,-1/0,-1/0];for(let r of i)for(let n of r)Kr(t,n);return t}function jn(i){return i[0]!==-1/0&&i[1]!==-1/0&&i[2]!==1/0&&i[3]!==1/0}function qs(i,t,r){if(!jn(i)||!jn(t))return NaN;let n=0,l=0;return i[2]t[2]&&(n=i[0]-t[2]),i[1]>t[3]&&(l=i[1]-t[3]),i[3]=n)return n;if(Br(l,u)){if(Un(i,t))return 0}else if(Un(t,i))return 0;let p=1/0;for(let m of i)for(let g=0,x=m.length,v=x-1;g0;){let g=p.pop();if(g[0]>=u)continue;let x=g[1],v=t?50:100;if(Nn(x)<=v){if(!Sr(x,i.length))return NaN;if(t){let w=Ge(i,x,r,n);if(isNaN(w)||w===0)return w;u=Math.min(u,w)}else for(let w=x[0];w<=x[1];++w){let I=Ql(i[w],r,n);if(u=Math.min(u,I),u===0)return 0}}else{let w=Fs(x,t);lt(p,u,n,i,m,w[0]),lt(p,u,n,i,m,w[1])}}return u}function ln(i,t,r,n,l,u=1/0){let p=Math.min(u,l.distance(i[0],r[0]));if(p===0)return p;let m=new Go([[0,[0,i.length-1],[0,r.length-1]]],Jo);for(;m.length>0;){let g=m.pop();if(g[0]>=p)continue;let x=g[1],v=g[2],w=t?50:100,I=n?50:100;if(Nn(x)<=w&&Nn(v)<=I){if(!Sr(x,i.length)&&Sr(v,r.length))return NaN;let k;if(t&&n)k=Yl(i,x,r,v,l),p=Math.min(p,k);else if(t&&!n){let E=i.slice(x[0],x[1]+1);for(let A=v[0];A<=v[1];++A)if(k=Yr(r[A],E,l),p=Math.min(p,k),p===0)return p}else if(!t&&n){let E=r.slice(v[0],v[1]+1);for(let A=x[0];A<=x[1];++A)if(k=Yr(i[A],E,l),p=Math.min(p,k),p===0)return p}else k=At(i,x,r,v,l),p=Math.min(p,k)}else{let k=Fs(x,t),E=Fs(v,n);Qr(m,p,l,i,r,k[0],E[0]),Qr(m,p,l,i,r,k[0],E[1]),Qr(m,p,l,i,r,k[1],E[0]),Qr(m,p,l,i,r,k[1],E[1])}}return p}function js(i){return i.type==="MultiPolygon"?i.coordinates.map(t=>({type:"Polygon",coordinates:t})):i.type==="MultiLineString"?i.coordinates.map(t=>({type:"LineString",coordinates:t})):i.type==="MultiPoint"?i.coordinates.map(t=>({type:"Point",coordinates:t})):[i]}class ea{constructor(t,r){this.type=ge,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Hr(t[1])){let n=t[1];if(n.type==="FeatureCollection")return new ea(n,n.features.map(l=>js(l.geometry)).flat());if(n.type==="Feature")return new ea(n,js(n.geometry));if("type"in n&&"coordinates"in n)return new ea(n,js(n))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,n){let l=r.geometry(),u=l.flat().map(g=>Ls([g.x,g.y],r.canonical));if(l.length===0)return NaN;let p=new Bs(u[0][1]),m=1/0;for(let g of n){switch(g.type){case"Point":m=Math.min(m,ln(u,!1,[g.coordinates],!1,p,m));break;case"LineString":m=Math.min(m,ln(u,!1,g.coordinates,!0,p,m));break;case"Polygon":m=Math.min(m,on(u,!1,g.coordinates,p,m))}if(m===0)return m}return m}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,n){let l=r.geometry(),u=l.flat().map(g=>Ls([g.x,g.y],r.canonical));if(l.length===0)return NaN;let p=new Bs(u[0][1]),m=1/0;for(let g of n){switch(g.type){case"Point":m=Math.min(m,ln(u,!0,[g.coordinates],!1,p,m));break;case"LineString":m=Math.min(m,ln(u,!0,g.coordinates,!0,p,m));break;case"Polygon":m=Math.min(m,on(u,!0,g.coordinates,p,m))}if(m===0)return m}return m}(t,this.geometries);if(t.geometryType()==="Polygon")return function(r,n){let l=r.geometry();if(l.length===0||l[0].length===0)return NaN;let u=qn(l,0).map(g=>g.map(x=>x.map(v=>Ls([v.x,v.y],r.canonical)))),p=new Bs(u[0][0][0][1]),m=1/0;for(let g of n)for(let x of u){switch(g.type){case"Point":m=Math.min(m,on([g.coordinates],!1,x,p,m));break;case"LineString":m=Math.min(m,on(g.coordinates,!0,x,p,m));break;case"Polygon":m=Math.min(m,mt(x,g.coordinates,p,m))}if(m===0)return m}return m}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let ba={"==":Nl,"!=":Fo,">":jl,"<":Oo,">=":Vo,"<=":Ul,array:Xi,at:ks,boolean:Xi,case:Dn,coalesce:Bn,collator:nn,format:On,image:Ps,in:zs,"index-of":_a,interpolate:_i,"interpolate-hcl":_i,"interpolate-lab":_i,length:Ds,let:Rr,literal:Hi,match:Es,number:Xi,"number-format":As,object:Xi,slice:rn,step:ya,string:Xi,"to-boolean":Wi,"to-color":Wi,"to-number":Wi,"to-string":Wi,var:rt,within:Jr,distance:ea};class Bi{constructor(t,r,n,l){this.name=t,this.type=r,this._evaluate=n,this.args=l}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){let n=t[0],l=Bi.definitions[n];if(!l)return r.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let u=Array.isArray(l)?l[0]:l.type,p=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,m=p.filter(([x])=>!Array.isArray(x)||x.length===t.length-1),g=null;for(let[x,v]of m){g=new Xr(r.registry,cn,r.path,null,r.scope);let w=[],I=!1;for(let k=1;k{return I=w,Array.isArray(I)?`(${I.map(C).join(", ")})`:`(${C(I.type)}...)`;var I}).join(" | "),v=[];for(let w=1;w{r=t?r&&cn(n):r&&n instanceof Hi}),!!r&&hn(i)&&un(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function hn(i){if(i instanceof Bi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Jr||i instanceof ea)return!1;let t=!0;return i.eachChild(r=>{t&&!hn(r)&&(t=!1)}),t}function wa(i){if(i instanceof Bi&&i.name==="feature-state")return!1;let t=!0;return i.eachChild(r=>{t&&!wa(r)&&(t=!1)}),t}function un(i,t){if(i instanceof Bi&&t.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(n=>{r&&!un(n,t)&&(r=!1)}),r}function $n(i){return{result:"success",value:i}}function Ta(i){return{result:"error",value:i}}function Sa(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Yo(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Gs(i){return!!i.expression&&i.expression.interpolated}function et(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Zn(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ec(i){return i}function Qo(i,t){let r=t.type==="color",n=i.stops&&typeof i.stops[0][0]=="object",l=n||!(n||i.property!==void 0),u=i.type||(Gs(t)?"exponential":"interval");if(r||t.type==="padding"){let v=r?st.parse:Ci.parse;(i=cr({},i)).stops&&(i.stops=i.stops.map(w=>[w[0],v(w[1])])),i.default=v(i.default?i.default:t.default)}if(i.colorSpace&&(p=i.colorSpace)!=="rgb"&&p!=="hcl"&&p!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var p;let m,g,x;if(u==="exponential")m=tl;else if(u==="interval")m=Gn;else if(u==="categorical"){m=el,g=Object.create(null);for(let v of i.stops)g[v[0]]=v[1];x=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);m=il}if(n){let v={},w=[];for(let E=0;EE[0]),evaluate:({zoom:E},A)=>tl({stops:I,base:i.base},t,E).evaluate(E,A)}}if(l){let v=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:_i.interpolationFactor.bind(void 0,v),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>m(i,t,w,g,x)}}return{kind:"source",evaluate(v,w){let I=w&&w.properties?w.properties[i.property]:void 0;return I===void 0?Ia(i.default,t.default):m(i,t,I,g,x)}}}function Ia(i,t,r){return i!==void 0?i:t!==void 0?t:r!==void 0?r:void 0}function el(i,t,r,n,l){return Ia(typeof r===l?n[r]:void 0,i.default,t.default)}function Gn(i,t,r){if(et(r)!=="number")return Ia(i.default,t.default);let n=i.stops.length;if(n===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[n-1][0])return i.stops[n-1][1];let l=Ln(i.stops.map(u=>u[0]),r);return i.stops[l][1]}function tl(i,t,r){let n=i.base!==void 0?i.base:1;if(et(r)!=="number")return Ia(i.default,t.default);let l=i.stops.length;if(l===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[l-1][0])return i.stops[l-1][1];let u=Ln(i.stops.map(v=>v[0]),r),p=function(v,w,I,k){let E=k-I,A=v-I;return E===0?0:w===1?A/E:(Math.pow(w,A)-1)/(Math.pow(w,E)-1)}(r,n,i.stops[u][0],i.stops[u+1][0]),m=i.stops[u][1],g=i.stops[u+1][1],x=gi[t.type]||ec;return typeof m.evaluate=="function"?{evaluate(...v){let w=m.evaluate.apply(void 0,v),I=g.evaluate.apply(void 0,v);if(w!==void 0&&I!==void 0)return x(w,I,p,i.colorSpace)}}:x(m,g,p,i.colorSpace)}function il(i,t,r){switch(t.type){case"color":r=st.parse(r);break;case"formatted":r=Ii.fromString(r.toString());break;case"resolvedImage":r=Mi.fromString(r.toString());break;case"padding":r=Ci.parse(r);break;default:et(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return Ia(r,i.default,t.default)}Bi.register(ba,{error:[{kind:"error"},[$e],(i,[t])=>{throw new Rt(t.evaluate(i))}],typeof:[$e,[Ne],(i,[t])=>C(Ot(t.evaluate(i)))],"to-rgba":[M(ge,4),[fi],(i,[t])=>{let[r,n,l,u]=t.evaluate(i).rgb;return[255*r,255*n,255*l,u]}],rgb:[fi,[ge,ge,ge],Us],rgba:[fi,[ge,ge,ge,ge],Us],has:{type:Fe,overloads:[[[$e],(i,[t])=>$s(t.evaluate(i),i.properties())],[[$e,Gi],(i,[t,r])=>$s(t.evaluate(i),r.evaluate(i))]]},get:{type:Ne,overloads:[[[$e],(i,[t])=>Zs(t.evaluate(i),i.properties())],[[$e,Gi],(i,[t,r])=>Zs(t.evaluate(i),r.evaluate(i))]]},"feature-state":[Ne,[$e],(i,[t])=>Zs(t.evaluate(i),i.featureState||{})],properties:[Gi,[],i=>i.properties()],"geometry-type":[$e,[],i=>i.geometryType()],id:[Ne,[],i=>i.id()],zoom:[ge,[],i=>i.globals.zoom],"heatmap-density":[ge,[],i=>i.globals.heatmapDensity||0],"line-progress":[ge,[],i=>i.globals.lineProgress||0],accumulated:[Ne,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[ge,ta(ge),(i,t)=>{let r=0;for(let n of t)r+=n.evaluate(i);return r}],"*":[ge,ta(ge),(i,t)=>{let r=1;for(let n of t)r*=n.evaluate(i);return r}],"-":{type:ge,overloads:[[[ge,ge],(i,[t,r])=>t.evaluate(i)-r.evaluate(i)],[[ge],(i,[t])=>-t.evaluate(i)]]},"/":[ge,[ge,ge],(i,[t,r])=>t.evaluate(i)/r.evaluate(i)],"%":[ge,[ge,ge],(i,[t,r])=>t.evaluate(i)%r.evaluate(i)],ln2:[ge,[],()=>Math.LN2],pi:[ge,[],()=>Math.PI],e:[ge,[],()=>Math.E],"^":[ge,[ge,ge],(i,[t,r])=>Math.pow(t.evaluate(i),r.evaluate(i))],sqrt:[ge,[ge],(i,[t])=>Math.sqrt(t.evaluate(i))],log10:[ge,[ge],(i,[t])=>Math.log(t.evaluate(i))/Math.LN10],ln:[ge,[ge],(i,[t])=>Math.log(t.evaluate(i))],log2:[ge,[ge],(i,[t])=>Math.log(t.evaluate(i))/Math.LN2],sin:[ge,[ge],(i,[t])=>Math.sin(t.evaluate(i))],cos:[ge,[ge],(i,[t])=>Math.cos(t.evaluate(i))],tan:[ge,[ge],(i,[t])=>Math.tan(t.evaluate(i))],asin:[ge,[ge],(i,[t])=>Math.asin(t.evaluate(i))],acos:[ge,[ge],(i,[t])=>Math.acos(t.evaluate(i))],atan:[ge,[ge],(i,[t])=>Math.atan(t.evaluate(i))],min:[ge,ta(ge),(i,t)=>Math.min(...t.map(r=>r.evaluate(i)))],max:[ge,ta(ge),(i,t)=>Math.max(...t.map(r=>r.evaluate(i)))],abs:[ge,[ge],(i,[t])=>Math.abs(t.evaluate(i))],round:[ge,[ge],(i,[t])=>{let r=t.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],(i,[t])=>Math.floor(t.evaluate(i))],ceil:[ge,[ge],(i,[t])=>Math.ceil(t.evaluate(i))],"filter-==":[Fe,[$e,Ne],(i,[t,r])=>i.properties()[t.value]===r.value],"filter-id-==":[Fe,[Ne],(i,[t])=>i.id()===t.value],"filter-type-==":[Fe,[$e],(i,[t])=>i.geometryType()===t.value],"filter-<":[Fe,[$e,Ne],(i,[t,r])=>{let n=i.properties()[t.value],l=r.value;return typeof n==typeof l&&n{let r=i.id(),n=t.value;return typeof r==typeof n&&r":[Fe,[$e,Ne],(i,[t,r])=>{let n=i.properties()[t.value],l=r.value;return typeof n==typeof l&&n>l}],"filter-id->":[Fe,[Ne],(i,[t])=>{let r=i.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[Fe,[$e,Ne],(i,[t,r])=>{let n=i.properties()[t.value],l=r.value;return typeof n==typeof l&&n<=l}],"filter-id-<=":[Fe,[Ne],(i,[t])=>{let r=i.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[Fe,[$e,Ne],(i,[t,r])=>{let n=i.properties()[t.value],l=r.value;return typeof n==typeof l&&n>=l}],"filter-id->=":[Fe,[Ne],(i,[t])=>{let r=i.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[Fe,[Ne],(i,[t])=>t.value in i.properties()],"filter-has-id":[Fe,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Fe,[M($e)],(i,[t])=>t.value.indexOf(i.geometryType())>=0],"filter-id-in":[Fe,[M(Ne)],(i,[t])=>t.value.indexOf(i.id())>=0],"filter-in-small":[Fe,[$e,M(Ne)],(i,[t,r])=>r.value.indexOf(i.properties()[t.value])>=0],"filter-in-large":[Fe,[$e,M(Ne)],(i,[t,r])=>function(n,l,u,p){for(;u<=p;){let m=u+p>>1;if(l[m]===n)return!0;l[m]>n?p=m-1:u=m+1}return!1}(i.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Fe,overloads:[[[Fe,Fe],(i,[t,r])=>t.evaluate(i)&&r.evaluate(i)],[ta(Fe),(i,t)=>{for(let r of t)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Fe,overloads:[[[Fe,Fe],(i,[t,r])=>t.evaluate(i)||r.evaluate(i)],[ta(Fe),(i,t)=>{for(let r of t)if(r.evaluate(i))return!0;return!1}]]},"!":[Fe,[Fe],(i,[t])=>!t.evaluate(i)],"is-supported-script":[Fe,[$e],(i,[t])=>{let r=i.globals&&i.globals.isSupportedScript;return!r||r(t.evaluate(i))}],upcase:[$e,[$e],(i,[t])=>t.evaluate(i).toUpperCase()],downcase:[$e,[$e],(i,[t])=>t.evaluate(i).toLowerCase()],concat:[$e,ta(Ne),(i,t)=>t.map(r=>tn(r.evaluate(i))).join("")],"resolved-locale":[$e,[ur],(i,[t])=>t.evaluate(i).resolvedLocale()]});class Hn{constructor(t,r){var n;this.expression=t,this._warningHistory={},this._evaluator=new Pn,this._defaultValue=r?(n=r).type==="color"&&Zn(n.default)?new st(0,0,0,0):n.type==="color"?st.parse(n.default)||null:n.type==="padding"?Ci.parse(n.default)||null:n.type==="variableAnchorOffsetCollection"?Ri.parse(n.default)||null:n.default===void 0?null:n.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(t,r,n,l,u,p){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(t,r,n,l,u,p){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=p||null;try{let m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new Rt(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}}}function Xn(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in ba}function Ca(i,t){let r=new Xr(ba,cn,[],t?function(l){let u={color:fi,string:$e,number:ge,enum:$e,boolean:Fe,formatted:Tr,padding:Lr,resolvedImage:pr,variableAnchorOffsetCollection:q};return l.type==="array"?M(u[l.value]||Ne,l.length):u[l.type]}(t):void 0),n=r.parse(i,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?$n(new Hn(n,t)):Ta(r.errors)}class Ma{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!wa(r.expression)}evaluateWithoutErrorHandling(t,r,n,l,u,p){return this._styleExpression.evaluateWithoutErrorHandling(t,r,n,l,u,p)}evaluate(t,r,n,l,u,p){return this._styleExpression.evaluate(t,r,n,l,u,p)}}class ka{constructor(t,r,n,l){this.kind=t,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!wa(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(t,r,n,l,u,p){return this._styleExpression.evaluateWithoutErrorHandling(t,r,n,l,u,p)}evaluate(t,r,n,l,u,p){return this._styleExpression.evaluate(t,r,n,l,u,p)}interpolationFactor(t,r,n){return this.interpolationType?_i.interpolationFactor(this.interpolationType,t,r,n):0}}function Hs(i,t){let r=Ca(i,t);if(r.result==="error")return r;let n=r.value.expression,l=hn(n);if(!l&&!Sa(t))return Ta([new oi("","data expressions not supported")]);let u=un(n,["zoom"]);if(!u&&!Yo(t))return Ta([new oi("","zoom expressions not supported")]);let p=pn(n);return p||u?p instanceof oi?Ta([p]):p instanceof _i&&!Gs(t)?Ta([new oi("",'"interpolate" expressions cannot be used with this property')]):$n(p?new ka(l?"camera":"composite",r.value,p.labels,p instanceof _i?p.interpolation:void 0):new Ma(l?"constant":"source",r.value)):Ta([new oi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class za{constructor(t,r){this._parameters=t,this._specification=r,cr(this,Qo(this._parameters,this._specification))}static deserialize(t){return new za(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function pn(i){let t=null;if(i instanceof Rr)t=pn(i.result);else if(i instanceof Bn){for(let r of i.args)if(t=pn(r),t)break}else(i instanceof ya||i instanceof _i)&&i.input instanceof Bi&&i.input.name==="zoom"&&(t=i);return t instanceof oi||i.eachChild(r=>{let n=pn(r);n instanceof oi?t=n:!t&&n?t=new oi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&n&&t!==n&&(t=new oi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function Wn(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(let t of i.slice(1))if(!Wn(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}let Kn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Xs(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Wn(i)||(i=Jn(i));let t=Ca(i,Kn);if(t.result==="error")throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,n,l)=>t.value.evaluate(r,n,{},l),needGeometry:rl(i)}}function tc(i,t){return it?1:0}function rl(i){if(!Array.isArray(i))return!1;if(i[0]==="within"||i[0]==="distance")return!0;for(let t=1;t"||t==="<="||t===">="?Ws(i[1],i[2],t):t==="any"?(r=i.slice(1),["any"].concat(r.map(Jn))):t==="all"?["all"].concat(i.slice(1).map(Jn)):t==="none"?["all"].concat(i.slice(1).map(Jn).map(Jt)):t==="in"?dn(i[1],i.slice(2)):t==="!in"?Jt(dn(i[1],i.slice(2))):t==="has"?mn(i[1]):t!=="!has"||Jt(mn(i[1]));var r}function Ws(i,t,r){switch(i){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,i,t]}}function dn(i,t){if(t.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",i,["literal",t.sort(tc)]]:["filter-in-small",i,["literal",t]]}}function mn(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Jt(i){return["!",i]}function ia(i){let t=typeof i;if(t==="number"||t==="boolean"||t==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(let u of i)l+=`${ia(u)},`;return`${l}]`}let r=Object.keys(i).sort(),n="{";for(let l=0;ln.maximum?[new pe(t,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function Yn(i){let t=i.valueSpec,r=Pt(i.value.type),n,l,u,p={},m=r!=="categorical"&&i.value.property===void 0,g=!m,x=et(i.value.stops)==="array"&&et(i.value.stops[0])==="array"&&et(i.value.stops[0][0])==="object",v=ki({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(k){if(r==="identity")return[new pe(k.key,k.value,'identity function may not have a "stops" property')];let E=[],A=k.value;return E=E.concat(fn({key:k.key,value:A,valueSpec:k.valueSpec,validateSpec:k.validateSpec,style:k.style,styleSpec:k.styleSpec,arrayElementValidator:w})),et(A)==="array"&&A.length===0&&E.push(new pe(k.key,A,"array must have at least one stop")),E},default:function(k){return k.validateSpec({key:k.key,value:k.value,valueSpec:t,validateSpec:k.validateSpec,style:k.style,styleSpec:k.styleSpec})}}});return r==="identity"&&m&&v.push(new pe(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||v.push(new pe(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Gs(i.valueSpec)&&v.push(new pe(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!Sa(i.valueSpec)?v.push(new pe(i.key,i.value,"property functions not supported")):m&&!Yo(i.valueSpec)&&v.push(new pe(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||v.push(new pe(i.key,i.value,'"property" property is required')),v;function w(k){let E=[],A=k.value,F=k.key;if(et(A)!=="array")return[new pe(F,A,`array expected, ${et(A)} found`)];if(A.length!==2)return[new pe(F,A,`array length 2 expected, length ${A.length} found`)];if(x){if(et(A[0])!=="object")return[new pe(F,A,`object expected, ${et(A[0])} found`)];if(A[0].zoom===void 0)return[new pe(F,A,"object stop key must have zoom")];if(A[0].value===void 0)return[new pe(F,A,"object stop key must have value")];if(u&&u>Pt(A[0].zoom))return[new pe(F,A[0].zoom,"stop zoom values must appear in ascending order")];Pt(A[0].zoom)!==u&&(u=Pt(A[0].zoom),l=void 0,p={}),E=E.concat(ki({key:`${F}[0]`,value:A[0],valueSpec:{zoom:{}},validateSpec:k.validateSpec,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{zoom:Ks,value:I}}))}else E=E.concat(I({key:`${F}[0]`,value:A[0],valueSpec:{},validateSpec:k.validateSpec,style:k.style,styleSpec:k.styleSpec},A));return Xn(Ki(A[1]))?E.concat([new pe(`${F}[1]`,A[1],"expressions are not allowed in function stops.")]):E.concat(k.validateSpec({key:`${F}[1]`,value:A[1],valueSpec:t,validateSpec:k.validateSpec,style:k.style,styleSpec:k.styleSpec}))}function I(k,E){let A=et(k.value),F=Pt(k.value),N=k.value!==null?k.value:E;if(n){if(A!==n)return[new pe(k.key,N,`${A} stop domain type must match previous stop domain type ${n}`)]}else n=A;if(A!=="number"&&A!=="string"&&A!=="boolean")return[new pe(k.key,N,"stop domain value must be a number, string, or boolean")];if(A!=="number"&&r!=="categorical"){let Q=`number expected, ${A} found`;return Sa(t)&&r===void 0&&(Q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new pe(k.key,N,Q)]}return r!=="categorical"||A!=="number"||isFinite(F)&&Math.floor(F)===F?r!=="categorical"&&A==="number"&&l!==void 0&&Fnew pe(`${i.key}${n.key}`,i.value,n.message));let r=t.value.expression||t.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new pe(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!wa(r))return[new pe(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!wa(r))return[new pe(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!un(r,["zoom","feature-state"]))return[new pe(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!hn(r))return[new pe(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ir(i){let t=i.key,r=i.value,n=i.valueSpec,l=[];return Array.isArray(n.values)?n.values.indexOf(Pt(r))===-1&&l.push(new pe(t,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(n.values).indexOf(Pt(r))===-1&&l.push(new pe(t,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function Js(i){return Wn(Ki(i.value))?Ea(cr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Qn(i)}function Qn(i){let t=i.value,r=i.key;if(et(t)!=="array")return[new pe(r,t,`array expected, ${et(t)} found`)];let n=i.styleSpec,l,u=[];if(t.length<1)return[new pe(r,t,"filter array must have at least 1 element")];switch(u=u.concat(Ir({key:`${r}[0]`,value:t[0],valueSpec:n.filter_operator,style:i.style,styleSpec:i.styleSpec})),Pt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&Pt(t[1])==="$type"&&u.push(new pe(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&u.push(new pe(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(l=et(t[1]),l!=="string"&&u.push(new pe(`${r}[1]`,t[1],`string expected, ${l} found`)));for(let p=2;p{x in r&&t.push(new pe(n,r[x],`"${x}" is prohibited for ref layers`))}),l.layers.forEach(x=>{Pt(x.id)===m&&(g=x)}),g?g.ref?t.push(new pe(n,r.ref,"ref cannot reference another ref layer")):p=Pt(g.type):t.push(new pe(n,r.ref,`ref layer "${m}" not found`))}else if(p!=="background")if(r.source){let g=l.sources&&l.sources[r.source],x=g&&Pt(g.type);g?x==="vector"&&p==="raster"?t.push(new pe(n,r.source,`layer "${r.id}" requires a raster source`)):x!=="raster-dem"&&p==="hillshade"?t.push(new pe(n,r.source,`layer "${r.id}" requires a raster-dem source`)):x==="raster"&&p!=="raster"?t.push(new pe(n,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&p!=="hillshade"?t.push(new pe(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):p!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&g.lineMetrics||t.push(new pe(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new pe(n,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new pe(n,r.source,`source "${r.source}" not found`))}else t.push(new pe(n,r,'missing required property "source"'));return t=t.concat(ki({key:n,value:r,valueSpec:u.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${n}.type`,value:r.type,valueSpec:u.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Js,layout:g=>ki({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":x=>Qs(cr({layerType:p},x))}}),paint:g=>ki({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":x=>es(cr({layerType:p},x))}})}})),t}function ra(i){let t=i.value,r=i.key,n=et(t);return n!=="string"?[new pe(r,t,`string expected, ${n} found`)]:[]}let ts={promoteId:function({key:i,value:t}){if(et(t)==="string")return ra({key:i,value:t});{let r=[];for(let n in t)r.push(...ra({key:`${i}.${n}`,value:t[n]}));return r}}};function gn(i){let t=i.value,r=i.key,n=i.styleSpec,l=i.style,u=i.validateSpec;if(!t.type)return[new pe(r,t,'"type" is required')];let p=Pt(t.type),m;switch(p){case"vector":case"raster":return m=ki({key:r,value:t,valueSpec:n[`source_${p.replace("-","_")}`],style:i.style,styleSpec:n,objectElementValidators:ts,validateSpec:u}),m;case"raster-dem":return m=function(g){var x;let v=(x=g.sourceName)!==null&&x!==void 0?x:"",w=g.value,I=g.styleSpec,k=I.source_raster_dem,E=g.style,A=[],F=et(w);if(w===void 0)return A;if(F!=="object")return A.push(new pe("source_raster_dem",w,`object expected, ${F} found`)),A;let N=Pt(w.encoding)==="custom",Q=["redFactor","greenFactor","blueFactor","baseShift"],G=g.value.encoding?`"${g.value.encoding}"`:"Default";for(let J in w)!N&&Q.includes(J)?A.push(new pe(J,w[J],`In "${v}": "${J}" is only valid when "encoding" is set to "custom". ${G} encoding found`)):k[J]?A=A.concat(g.validateSpec({key:J,value:w[J],valueSpec:k[J],validateSpec:g.validateSpec,style:E,styleSpec:I})):A.push(new pe(J,w[J],`unknown property "${J}"`));return A}({sourceName:r,value:t,style:i.style,styleSpec:n,validateSpec:u}),m;case"geojson":if(m=ki({key:r,value:t,valueSpec:n.source_geojson,style:l,styleSpec:n,validateSpec:u,objectElementValidators:ts}),t.cluster)for(let g in t.clusterProperties){let[x,v]=t.clusterProperties[g],w=typeof x=="string"?[x,["accumulated"],["get",g]]:x;m.push(...Ea({key:`${r}.${g}.map`,value:v,validateSpec:u,expressionContext:"cluster-map"})),m.push(...Ea({key:`${r}.${g}.reduce`,value:w,validateSpec:u,expressionContext:"cluster-reduce"}))}return m;case"video":return ki({key:r,value:t,valueSpec:n.source_video,style:l,validateSpec:u,styleSpec:n});case"image":return ki({key:r,value:t,valueSpec:n.source_image,style:l,validateSpec:u,styleSpec:n});case"canvas":return[new pe(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ir({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:l,validateSpec:u,styleSpec:n})}}function to(i){let t=i.value,r=i.styleSpec,n=r.light,l=i.style,u=[],p=et(t);if(t===void 0)return u;if(p!=="object")return u=u.concat([new pe("light",t,`object expected, ${p} found`)]),u;for(let m in t){let g=m.match(/^(.*)-transition$/);u=u.concat(g&&n[g[1]]&&n[g[1]].transition?i.validateSpec({key:m,value:t[m],valueSpec:r.transition,validateSpec:i.validateSpec,style:l,styleSpec:r}):n[m]?i.validateSpec({key:m,value:t[m],valueSpec:n[m],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new pe(m,t[m],`unknown property "${m}"`)])}return u}function io(i){let t=i.value,r=i.styleSpec,n=r.sky,l=i.style,u=et(t);if(t===void 0)return[];if(u!=="object")return[new pe("sky",t,`object expected, ${u} found`)];let p=[];for(let m in t)p=p.concat(n[m]?i.validateSpec({key:m,value:t[m],valueSpec:n[m],style:l,styleSpec:r}):[new pe(m,t[m],`unknown property "${m}"`)]);return p}function ro(i){let t=i.value,r=i.styleSpec,n=r.terrain,l=i.style,u=[],p=et(t);if(t===void 0)return u;if(p!=="object")return u=u.concat([new pe("terrain",t,`object expected, ${p} found`)]),u;for(let m in t)u=u.concat(n[m]?i.validateSpec({key:m,value:t[m],valueSpec:n[m],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new pe(m,t[m],`unknown property "${m}"`)]);return u}function ao(i){let t=[],r=i.value,n=i.key;if(Array.isArray(r)){let l=[],u=[];for(let p in r)r[p].id&&l.includes(r[p].id)&&t.push(new pe(n,r,`all the sprites' ids must be unique, but ${r[p].id} is duplicated`)),l.push(r[p].id),r[p].url&&u.includes(r[p].url)&&t.push(new pe(n,r,`all the sprites' URLs must be unique, but ${r[p].url} is duplicated`)),u.push(r[p].url),t=t.concat(ki({key:`${n}[${p}]`,value:r[p],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return t}return ra({key:n,value:r})}let is={"*":()=>[],array:fn,boolean:function(i){let t=i.value,r=i.key,n=et(t);return n!=="boolean"?[new pe(r,t,`boolean expected, ${n} found`)]:[]},number:Ks,color:function(i){let t=i.key,r=i.value,n=et(r);return n!=="string"?[new pe(t,r,`color expected, ${n} found`)]:st.parse(String(r))?[]:[new pe(t,r,`color expected, "${r}" found`)]},constants:nl,enum:Ir,filter:Js,function:Yn,layer:eo,object:ki,source:gn,light:to,sky:io,terrain:ro,projection:function(i){let t=i.value,r=i.styleSpec,n=r.projection,l=i.style,u=et(t);if(t===void 0)return[];if(u!=="object")return[new pe("projection",t,`object expected, ${u} found`)];let p=[];for(let m in t)p=p.concat(n[m]?i.validateSpec({key:m,value:t[m],valueSpec:n[m],style:l,styleSpec:r}):[new pe(m,t[m],`unknown property "${m}"`)]);return p},string:ra,formatted:function(i){return ra(i).length===0?[]:Ea(i)},resolvedImage:function(i){return ra(i).length===0?[]:Ea(i)},padding:function(i){let t=i.key,r=i.value;if(et(r)==="array"){if(r.length<1||r.length>4)return[new pe(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let n={type:"number"},l=[];for(let u=0;u[]}})),i.constants&&(r=r.concat(nl({key:"constants",value:i.constants,style:i,styleSpec:t,validateSpec:Aa}))),no(r)}function mr(i){return function(t){return i({...t,validateSpec:Aa})}}function no(i){return[].concat(i).sort((t,r)=>t.line-r.line)}function Ji(i){return function(...t){return no(i.apply(this,t))}}Fi.source=Ji(mr(gn)),Fi.sprite=Ji(mr(ao)),Fi.glyphs=Ji(mr(sl)),Fi.light=Ji(mr(to)),Fi.sky=Ji(mr(io)),Fi.terrain=Ji(mr(ro)),Fi.layer=Ji(mr(eo)),Fi.filter=Ji(mr(Js)),Fi.paintProperty=Ji(mr(es)),Fi.layoutProperty=Ji(mr(Qs));let aa=Fi,ic=aa.light,rc=aa.sky,ol=aa.paintProperty,ll=aa.layoutProperty;function so(i,t){let r=!1;if(t&&t.length)for(let n of t)i.fire(new Ar(new Error(n.message))),r=!0;return r}class Pa{constructor(t,r,n){let l=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;let p=new Int32Array(this.arrayBuffer);t=p[0],this.d=(r=p[1])+2*(n=p[2]);for(let g=0;g=w[E+0]&&l>=w[E+1])?(m[k]=!0,p.push(v[k])):m[k]=!1}}}}_forEachCell(t,r,n,l,u,p,m,g){let x=this._convertToCellCoord(t),v=this._convertToCellCoord(r),w=this._convertToCellCoord(n),I=this._convertToCellCoord(l);for(let k=x;k<=w;k++)for(let E=v;E<=I;E++){let A=this.d*E+k;if((!g||g(this._convertFromCellCoord(k),this._convertFromCellCoord(E),this._convertFromCellCoord(k+1),this._convertFromCellCoord(E+1)))&&u.call(this,t,r,n,l,A,p,m,g))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,r=3+this.cells.length+1+1,n=0;for(let p=0;p=0)continue;let p=i[u];l[u]=Oi[r].shallow.indexOf(u)>=0?p:Da(p,t)}i instanceof Error&&(l.message=i.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(l.$name=r),l}function La(i){if(cl(i))return i;if(Array.isArray(i))return i.map(La);if(typeof i!="object")throw new Error("can't deserialize object of type "+typeof i);let t=oo(i)||"Object";if(!Oi[t])throw new Error(`can't deserialize unregistered class ${t}`);let{klass:r}=Oi[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(i);let n=Object.create(r.prototype);for(let l of Object.keys(i)){if(l==="$name")continue;let u=i[l];n[l]=Oi[t].shallow.indexOf(l)>=0?u:La(u)}return n}class lo{constructor(){this.first=!0}update(t,r){let n=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,"Hangul Jamo":i=>i>=4352&&i<=4607,Khmer:i=>i>=6016&&i<=6143,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Katakana:i=>i>=12448&&i<=12543,Kanbun:i=>i>=12688&&i<=12703,"CJK Strokes":i=>i>=12736&&i<=12783,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"Private Use Area":i=>i>=57344&&i<=63743,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function co(i){for(let t of i)if(uo(t.charCodeAt(0)))return!0;return!1}function ac(i){for(let t of i)if(!Ra(t.charCodeAt(0)))return!1;return!0}function ho(i){let t=i.map(r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}}).filter(r=>r);return new RegExp(t.join("|"),"u")}let nc=ho(["Arab","Dupl","Mong","Ougr","Syrc"]);function Ra(i){return!nc.test(String.fromCodePoint(i))}let hl=ho(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function uo(i){return!(i!==746&&i!==747&&(i<4352||!(We["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||We["CJK Compatibility"](i)||We["CJK Strokes"](i)||!(!We["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||We["Enclosed CJK Letters and Months"](i)||We["Ideographic Description Characters"](i)||We.Kanbun(i)||We.Katakana(i)&&i!==12540||!(!We["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!We["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||We["Vertical Forms"](i)||We["Yijing Hexagram Symbols"](i)||/\p{sc=Cans}/u.test(String.fromCodePoint(i))||/\p{sc=Hang}/u.test(String.fromCodePoint(i))||hl.test(String.fromCodePoint(i)))))}function ul(i){return!(uo(i)||function(t){return!!(We["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||We["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||We["Letterlike Symbols"](t)||We["Number Forms"](t)||We["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||We["Control Pictures"](t)&&t!==9251||We["Optical Character Recognition"](t)||We["Enclosed Alphanumerics"](t)||We["Geometric Shapes"](t)||We["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||We["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||We["CJK Symbols and Punctuation"](t)||We.Katakana(t)||We["Private Use Area"](t)||We["CJK Compatibility Forms"](t)||We["Small Form Variants"](t)||We["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(i))}let sc=ho(["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 po(i){return sc.test(String.fromCodePoint(i))}function oc(i,t){return!(!t&&po(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||We.Khmer(i))}function lc(i){for(let t of i)if(po(t.charCodeAt(0)))return!0;return!1}let zi=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(i){this.pluginStatus=i.pluginStatus,this.pluginURL=i.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(i){this.applyArabicShaping=i.applyArabicShaping,this.processBidirectionalText=i.processBidirectionalText,this.processStyledBidirectionalText=i.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class _t{constructor(t,r){this.zoom=t,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new lo,this.transition={})}isSupportedScript(t){return function(r,n){for(let l of r)if(!oc(l.charCodeAt(0),n))return!1;return!0}(t,zi.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,r=t-Math.floor(t),n=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*r}}}class Ba{constructor(t,r){this.property=t,this.value=r,this.expression=function(n,l){if(Zn(n))return new za(n,l);if(Xn(n)){let u=Hs(n,l);if(u.result==="error")throw new Error(u.value.map(p=>`${p.key}: ${p.message}`).join(", "));return u.value}{let u=n;return l.type==="color"&&typeof n=="string"?u=st.parse(n):l.type!=="padding"||typeof n!="number"&&!Array.isArray(n)?l.type==="variableAnchorOffsetCollection"&&Array.isArray(n)&&(u=Ri.parse(n)):u=Ci.parse(n),{kind:"constant",evaluate:()=>u}}}(r===void 0?t.specification.default:r,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,r,n){return this.property.possiblyEvaluate(this,t,r,n)}}class as{constructor(t){this.property=t,this.value=new Ba(t,void 0)}transitioned(t,r){return new pl(this.property,this.value,r,Di({},t.transition,this.transition),t.now)}untransitioned(){return new pl(this.property,this.value,null,{},0)}}class ns{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return ot(this._values[t].value.value)}setValue(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new as(this._values[t].property)),this._values[t].value=new Ba(this._values[t].property,r===null?void 0:ot(r))}getTransition(t){return ot(this._values[t].transition)}setTransition(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new as(this._values[t].property)),this._values[t].transition=ot(r)||void 0}serialize(){let t={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(t[r]=n);let l=this.getTransition(r);l!==void 0&&(t[`${r}-transition`]=l)}return t}transitioned(t,r){let n=new _n(this._properties);for(let l of Object.keys(this._values))n._values[l]=this._values[l].transitioned(t,r._values[l]);return n}untransitioned(){let t=new _n(this._properties);for(let r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}}class pl{constructor(t,r,n,l,u){this.property=t,this.value=r,this.begin=u+l.delay||0,this.end=this.begin+l.duration||0,t.specification.transition&&(l.delay||l.duration)&&(this.prior=n)}possiblyEvaluate(t,r,n){let l=t.now||0,u=this.value.possiblyEvaluate(t,r,n),p=this.prior;if(p){if(l>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(l=1)return 1;let x=g*g,v=x*g;return 4*(g<.5?v:3*(g-x)+v-.75)}(m))}}return u}}class _n{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,n){let l=new xn(this._properties);for(let u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(t,r,n);return l}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class yn{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return this._values[t].value!==void 0}getValue(t){return ot(this._values[t].value)}setValue(t,r){this._values[t]=new Ba(this._values[t].property,r===null?void 0:ot(r))}serialize(){let t={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(t[r]=n)}return t}possiblyEvaluate(t,r,n){let l=new xn(this._properties);for(let u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(t,r,n);return l}}class fr{constructor(t,r,n){this.property=t,this.value=r,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,r,n,l){return this.property.evaluate(this.value,this.parameters,t,r,n,l)}}class xn{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Me{constructor(t){this.specification=t}possiblyEvaluate(t,r){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,n){let l=gi[this.specification.type];return l?l(t,r,n):t}}class Be{constructor(t,r){this.specification=t,this.overrides=r}possiblyEvaluate(t,r,n,l){return new fr(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(r,null,{},n,l)}:t.expression,r)}interpolate(t,r,n){if(t.value.kind!=="constant"||r.value.kind!=="constant")return t;if(t.value.value===void 0||r.value.value===void 0)return new fr(this,{kind:"constant",value:void 0},t.parameters);let l=gi[this.specification.type];if(l){let u=l(t.value.value,r.value.value,n);return new fr(this,{kind:"constant",value:u},t.parameters)}return t}evaluate(t,r,n,l,u,p){return t.kind==="constant"?t.value:t.evaluate(r,n,l,u,p)}}class ss extends Be{possiblyEvaluate(t,r,n,l){if(t.value===void 0)return new fr(this,{kind:"constant",value:void 0},r);if(t.expression.kind==="constant"){let u=t.expression.evaluate(r,null,{},n,l),p=t.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,m=this._calculate(p,p,p,r);return new fr(this,{kind:"constant",value:m},r)}if(t.expression.kind==="camera"){let u=this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r);return new fr(this,{kind:"constant",value:u},r)}return new fr(this,t.expression,r)}evaluate(t,r,n,l,u,p){if(t.kind==="source"){let m=t.evaluate(r,n,l,u,p);return this._calculate(m,m,m,r)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},n,l),t.evaluate({zoom:Math.floor(r.zoom)},n,l),t.evaluate({zoom:Math.floor(r.zoom)+1},n,l),r):t.value}_calculate(t,r,n,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:n,to:r}}interpolate(t){return t}}class os{constructor(t){this.specification=t}possiblyEvaluate(t,r,n,l){if(t.value!==void 0){if(t.expression.kind==="constant"){let u=t.expression.evaluate(r,null,{},n,l);return this._calculate(u,u,u,r)}return this._calculate(t.expression.evaluate(new _t(Math.floor(r.zoom-1),r)),t.expression.evaluate(new _t(Math.floor(r.zoom),r)),t.expression.evaluate(new _t(Math.floor(r.zoom+1),r)),r)}}_calculate(t,r,n,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:n,to:r}}interpolate(t){return t}}class mo{constructor(t){this.specification=t}possiblyEvaluate(t,r,n,l){return!!t.expression.evaluate(r,null,{},n,l)}interpolate(){return!1}}class h{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in t){let n=t[r];n.specification.overridable&&this.overridableProperties.push(r);let l=this.defaultPropertyValues[r]=new Ba(n,void 0),u=this.defaultTransitionablePropertyValues[r]=new as(n);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=l.possiblyEvaluate({})}}}Ie("DataDrivenProperty",Be),Ie("DataConstantProperty",Me),Ie("CrossFadedDataDrivenProperty",ss),Ie("CrossFadedProperty",os),Ie("ColorRampProperty",mo);let e="-transition";class a extends da{constructor(t,r){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new yn(r.layout)),r.paint)){this._transitionablePaint=new ns(r.paint);for(let n in t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(let n in t.layout)this.setLayoutProperty(n,t.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new xn(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,r,n={}){r!=null&&this._validate(ll,`layers.${this.id}.layout.${t}`,t,r,n)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,r):this.visibility=r)}getPaintProperty(t){return t.endsWith(e)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,r,n={}){if(r!=null&&this._validate(ol,`layers.${this.id}.paint.${t}`,t,r,n))return!1;if(t.endsWith(e))return this._transitionablePaint.setTransition(t.slice(0,-11),r||void 0),!1;{let l=this._transitionablePaint._values[t],u=l.property.specification["property-type"]==="cross-faded-data-driven",p=l.value.isDataDriven(),m=l.value;this._transitionablePaint.setValue(t,r),this._handleSpecialPaintPropertyUpdate(t);let g=this._transitionablePaint._values[t].value;return g.isDataDriven()||p||u||this._handleOverridablePaintPropertyUpdate(t,m,g)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,r,n){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,r){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,r)}serialize(){let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),Wa(t,(r,n)=>!(r===void 0||n==="layout"&&!Object.keys(r).length||n==="paint"&&!Object.keys(r).length))}_validate(t,r,n,l,u={}){return(!u||u.validate!==!1)&&so(this,t.call(aa,{key:r,layerType:this.type,objectKey:n,value:l,styleSpec:re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let r=this.paint.get(t);if(r instanceof fr&&Sa(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}let s={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class o{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class c{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function f(i,t=1){let r=0,n=0;return{members:i.map(l=>{let u=s[l.type].BYTES_PER_ELEMENT,p=r=_(r,Math.max(t,u)),m=l.components||1;return n=Math.max(n,u),r+=u*m,{name:l.name,type:l.type,components:m,offset:p}}),size:_(r,Math.max(n,t)),alignment:t}}function _(i,t){return Math.ceil(i/t)*t}class y extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,r)}emplace(t,r,n){let l=2*t;return this.int16[l+0]=r,this.int16[l+1]=n,t}}y.prototype.bytesPerElement=4,Ie("StructArrayLayout2i4",y);class b extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,n){let l=this.length;return this.resize(l+1),this.emplace(l,t,r,n)}emplace(t,r,n,l){let u=3*t;return this.int16[u+0]=r,this.int16[u+1]=n,this.int16[u+2]=l,t}}b.prototype.bytesPerElement=6,Ie("StructArrayLayout3i6",b);class T extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,n,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,r,n,l)}emplace(t,r,n,l,u){let p=4*t;return this.int16[p+0]=r,this.int16[p+1]=n,this.int16[p+2]=l,this.int16[p+3]=u,t}}T.prototype.bytesPerElement=8,Ie("StructArrayLayout4i8",T);class S extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u,p){let m=this.length;return this.resize(m+1),this.emplace(m,t,r,n,l,u,p)}emplace(t,r,n,l,u,p,m){let g=6*t;return this.int16[g+0]=r,this.int16[g+1]=n,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=p,this.int16[g+5]=m,t}}S.prototype.bytesPerElement=12,Ie("StructArrayLayout2i4i12",S);class z extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u,p){let m=this.length;return this.resize(m+1),this.emplace(m,t,r,n,l,u,p)}emplace(t,r,n,l,u,p,m){let g=4*t,x=8*t;return this.int16[g+0]=r,this.int16[g+1]=n,this.uint8[x+4]=l,this.uint8[x+5]=u,this.uint8[x+6]=p,this.uint8[x+7]=m,t}}z.prototype.bytesPerElement=8,Ie("StructArrayLayout2i4ub8",z);class D extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,r)}emplace(t,r,n){let l=2*t;return this.float32[l+0]=r,this.float32[l+1]=n,t}}D.prototype.bytesPerElement=8,Ie("StructArrayLayout2f8",D);class R extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u,p,m,g,x,v){let w=this.length;return this.resize(w+1),this.emplace(w,t,r,n,l,u,p,m,g,x,v)}emplace(t,r,n,l,u,p,m,g,x,v,w){let I=10*t;return this.uint16[I+0]=r,this.uint16[I+1]=n,this.uint16[I+2]=l,this.uint16[I+3]=u,this.uint16[I+4]=p,this.uint16[I+5]=m,this.uint16[I+6]=g,this.uint16[I+7]=x,this.uint16[I+8]=v,this.uint16[I+9]=w,t}}R.prototype.bytesPerElement=20,Ie("StructArrayLayout10ui20",R);class V extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u,p,m,g,x,v,w,I){let k=this.length;return this.resize(k+1),this.emplace(k,t,r,n,l,u,p,m,g,x,v,w,I)}emplace(t,r,n,l,u,p,m,g,x,v,w,I,k){let E=12*t;return this.int16[E+0]=r,this.int16[E+1]=n,this.int16[E+2]=l,this.int16[E+3]=u,this.uint16[E+4]=p,this.uint16[E+5]=m,this.uint16[E+6]=g,this.uint16[E+7]=x,this.int16[E+8]=v,this.int16[E+9]=w,this.int16[E+10]=I,this.int16[E+11]=k,t}}V.prototype.bytesPerElement=24,Ie("StructArrayLayout4i4ui4i24",V);class j extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,n){let l=this.length;return this.resize(l+1),this.emplace(l,t,r,n)}emplace(t,r,n,l){let u=3*t;return this.float32[u+0]=r,this.float32[u+1]=n,this.float32[u+2]=l,t}}j.prototype.bytesPerElement=12,Ie("StructArrayLayout3f12",j);class U extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint32[1*t+0]=r,t}}U.prototype.bytesPerElement=4,Ie("StructArrayLayout1ul4",U);class Z extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u,p,m,g,x){let v=this.length;return this.resize(v+1),this.emplace(v,t,r,n,l,u,p,m,g,x)}emplace(t,r,n,l,u,p,m,g,x,v){let w=10*t,I=5*t;return this.int16[w+0]=r,this.int16[w+1]=n,this.int16[w+2]=l,this.int16[w+3]=u,this.int16[w+4]=p,this.int16[w+5]=m,this.uint32[I+3]=g,this.uint16[w+8]=x,this.uint16[w+9]=v,t}}Z.prototype.bytesPerElement=20,Ie("StructArrayLayout6i1ul2ui20",Z);class B extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u,p){let m=this.length;return this.resize(m+1),this.emplace(m,t,r,n,l,u,p)}emplace(t,r,n,l,u,p,m){let g=6*t;return this.int16[g+0]=r,this.int16[g+1]=n,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=p,this.int16[g+5]=m,t}}B.prototype.bytesPerElement=12,Ie("StructArrayLayout2i2i2i12",B);class X extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u){let p=this.length;return this.resize(p+1),this.emplace(p,t,r,n,l,u)}emplace(t,r,n,l,u,p){let m=4*t,g=8*t;return this.float32[m+0]=r,this.float32[m+1]=n,this.float32[m+2]=l,this.int16[g+6]=u,this.int16[g+7]=p,t}}X.prototype.bytesPerElement=16,Ie("StructArrayLayout2f1f2i16",X);class K extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u,p){let m=this.length;return this.resize(m+1),this.emplace(m,t,r,n,l,u,p)}emplace(t,r,n,l,u,p,m){let g=16*t,x=4*t,v=8*t;return this.uint8[g+0]=r,this.uint8[g+1]=n,this.float32[x+1]=l,this.float32[x+2]=u,this.int16[v+6]=p,this.int16[v+7]=m,t}}K.prototype.bytesPerElement=16,Ie("StructArrayLayout2ub2f2i16",K);class ee extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,n){let l=this.length;return this.resize(l+1),this.emplace(l,t,r,n)}emplace(t,r,n,l){let u=3*t;return this.uint16[u+0]=r,this.uint16[u+1]=n,this.uint16[u+2]=l,t}}ee.prototype.bytesPerElement=6,Ie("StructArrayLayout3ui6",ee);class le extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u,p,m,g,x,v,w,I,k,E,A,F,N){let Q=this.length;return this.resize(Q+1),this.emplace(Q,t,r,n,l,u,p,m,g,x,v,w,I,k,E,A,F,N)}emplace(t,r,n,l,u,p,m,g,x,v,w,I,k,E,A,F,N,Q){let G=24*t,J=12*t,ae=48*t;return this.int16[G+0]=r,this.int16[G+1]=n,this.uint16[G+2]=l,this.uint16[G+3]=u,this.uint32[J+2]=p,this.uint32[J+3]=m,this.uint32[J+4]=g,this.uint16[G+10]=x,this.uint16[G+11]=v,this.uint16[G+12]=w,this.float32[J+7]=I,this.float32[J+8]=k,this.uint8[ae+36]=E,this.uint8[ae+37]=A,this.uint8[ae+38]=F,this.uint32[J+10]=N,this.int16[G+22]=Q,t}}le.prototype.bytesPerElement=48,Ie("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",le);class ue extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,n,l,u,p,m,g,x,v,w,I,k,E,A,F,N,Q,G,J,ae,he,we,Re,ve,ye,Ee,Ce){let Se=this.length;return this.resize(Se+1),this.emplace(Se,t,r,n,l,u,p,m,g,x,v,w,I,k,E,A,F,N,Q,G,J,ae,he,we,Re,ve,ye,Ee,Ce)}emplace(t,r,n,l,u,p,m,g,x,v,w,I,k,E,A,F,N,Q,G,J,ae,he,we,Re,ve,ye,Ee,Ce,Se){let oe=32*t,Ae=16*t;return this.int16[oe+0]=r,this.int16[oe+1]=n,this.int16[oe+2]=l,this.int16[oe+3]=u,this.int16[oe+4]=p,this.int16[oe+5]=m,this.int16[oe+6]=g,this.int16[oe+7]=x,this.uint16[oe+8]=v,this.uint16[oe+9]=w,this.uint16[oe+10]=I,this.uint16[oe+11]=k,this.uint16[oe+12]=E,this.uint16[oe+13]=A,this.uint16[oe+14]=F,this.uint16[oe+15]=N,this.uint16[oe+16]=Q,this.uint16[oe+17]=G,this.uint16[oe+18]=J,this.uint16[oe+19]=ae,this.uint16[oe+20]=he,this.uint16[oe+21]=we,this.uint16[oe+22]=Re,this.uint32[Ae+12]=ve,this.float32[Ae+13]=ye,this.float32[Ae+14]=Ee,this.uint16[oe+30]=Ce,this.uint16[oe+31]=Se,t}}ue.prototype.bytesPerElement=64,Ie("StructArrayLayout8i15ui1ul2f2ui64",ue);class xe extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.float32[1*t+0]=r,t}}xe.prototype.bytesPerElement=4,Ie("StructArrayLayout1f4",xe);class Te extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,n){let l=this.length;return this.resize(l+1),this.emplace(l,t,r,n)}emplace(t,r,n,l){let u=3*t;return this.uint16[6*t+0]=r,this.float32[u+1]=n,this.float32[u+2]=l,t}}Te.prototype.bytesPerElement=12,Ie("StructArrayLayout1ui2f12",Te);class fe extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,n){let l=this.length;return this.resize(l+1),this.emplace(l,t,r,n)}emplace(t,r,n,l){let u=4*t;return this.uint32[2*t+0]=r,this.uint16[u+2]=n,this.uint16[u+3]=l,t}}fe.prototype.bytesPerElement=8,Ie("StructArrayLayout1ul2ui8",fe);class me extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,r)}emplace(t,r,n){let l=2*t;return this.uint16[l+0]=r,this.uint16[l+1]=n,t}}me.prototype.bytesPerElement=4,Ie("StructArrayLayout2ui4",me);class ke extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint16[1*t+0]=r,t}}ke.prototype.bytesPerElement=2,Ie("StructArrayLayout1ui2",ke);class qe extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,n,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,r,n,l)}emplace(t,r,n,l,u){let p=4*t;return this.float32[p+0]=r,this.float32[p+1]=n,this.float32[p+2]=l,this.float32[p+3]=u,t}}qe.prototype.bytesPerElement=16,Ie("StructArrayLayout4f16",qe);class _e extends o{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 se(this.anchorPointX,this.anchorPointY)}}_e.prototype.size=20;class be extends Z{get(t){return new _e(this,t)}}Ie("CollisionBoxArray",be);class Oe extends o{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Oe.prototype.size=48;class yt extends le{get(t){return new Oe(this,t)}}Ie("PlacedSymbolArray",yt);class Ue extends o{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Ue.prototype.size=64;class Xe extends ue{get(t){return new Ue(this,t)}}Ie("SymbolInstanceArray",Xe);class xt extends xe{getoffsetX(t){return this.float32[1*t+0]}}Ie("GlyphOffsetArray",xt);class Yt extends b{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Ie("SymbolLineVertexArray",Yt);class Yi extends o{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]}}Yi.prototype.size=12;class vt extends Te{get(t){return new Yi(this,t)}}Ie("TextAnchorOffsetArray",vt);class yi extends o{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]}}yi.prototype.size=8;class ci extends fe{get(t){return new yi(this,t)}}Ie("FeatureIndexArray",ci);class Qt extends y{}class hi extends y{}class gr extends y{}class Fa extends S{}class ls extends z{}class Oa extends D{}class Vi extends R{}class cs extends V{}class fo extends j{}class qi extends U{}class Ni extends B{}class Fr extends K{}class Qi extends ee{}class Xt extends me{}let ei=f([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ei}=ei;class Ke{constructor(t=[]){this.segments=t}prepareSegment(t,r,n,l){let u=this.segments[this.segments.length-1];return t>Ke.MAX_VERTEX_ARRAY_LENGTH&&Kt(`Max vertices per segment is ${Ke.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!u||u.vertexLength+t>Ke.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==l)&&(u={vertexOffset:r.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},l!==void 0&&(u.sortKey=l),this.segments.push(u)),u}get(){return this.segments}destroy(){for(let t of this.segments)for(let r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,n,l){return new Ke([{vertexOffset:t,primitiveOffset:r,vertexLength:n,primitiveLength:l,vaos:{},sortKey:0}])}}function na(i,t){return 256*(i=di(Math.floor(i),0,255))+di(Math.floor(t),0,255)}Ke.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ie("SegmentVector",Ke);let Va=f([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var qa={exports:{}},dl={exports:{}};dl.exports=function(i,t){var r,n,l,u,p,m,g,x;for(n=i.length-(r=3&i.length),l=t,p=3432918353,m=461845907,x=0;x>>16)*p&65535)<<16)&4294967295)<<15|g>>>17))*m+(((g>>>16)*m&65535)<<16)&4294967295)<<13|l>>>19))+((5*(l>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(g=0,r){case 3:g^=(255&i.charCodeAt(x+2))<<16;case 2:g^=(255&i.charCodeAt(x+1))<<8;case 1:l^=g=(65535&(g=(g=(65535&(g^=255&i.charCodeAt(x)))*p+(((g>>>16)*p&65535)<<16)&4294967295)<<15|g>>>17))*m+(((g>>>16)*m&65535)<<16)&4294967295}return l^=i.length,l=2246822507*(65535&(l^=l>>>16))+((2246822507*(l>>>16)&65535)<<16)&4294967295,l=3266489909*(65535&(l^=l>>>13))+((3266489909*(l>>>16)&65535)<<16)&4294967295,(l^=l>>>16)>>>0};var cc=dl.exports,ml={exports:{}};ml.exports=function(i,t){for(var r,n=i.length,l=t^n,u=0;n>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(r>>>16)&65535)<<16),l=1540483477*(65535&l)+((1540483477*(l>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++u;switch(n){case 3:l^=(255&i.charCodeAt(u+2))<<16;case 2:l^=(255&i.charCodeAt(u+1))<<8;case 1:l=1540483477*(65535&(l^=255&i.charCodeAt(u)))+((1540483477*(l>>>16)&65535)<<16)}return l=1540483477*(65535&(l^=l>>>13))+((1540483477*(l>>>16)&65535)<<16),(l^=l>>>15)>>>0};var Or=cc,fl=ml.exports;qa.exports=Or,qa.exports.murmur3=Or,qa.exports.murmur2=fl;var hs=qt(qa.exports);class vn{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,n,l){this.ids.push(us(t)),this.positions.push(r,n,l)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=us(t),n=0,l=this.ids.length-1;for(;n>1;this.ids[p]>=r?l=p:n=p+1}let u=[];for(;this.ids[n]===r;)u.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return u}static serialize(t,r){let n=new Float64Array(t.ids),l=new Uint32Array(t.positions);return ps(n,l,0,n.length-1),r&&r.push(n.buffer,l.buffer),{ids:n,positions:l}}static deserialize(t){let r=new vn;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}}function us(i){let t=+i;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:hs(String(i))}function ps(i,t,r,n){for(;r>1],u=r-1,p=n+1;for(;;){do u++;while(i[u]l);if(u>=p)break;Na(i,u,p),Na(t,3*u,3*p),Na(t,3*u+1,3*p+1),Na(t,3*u+2,3*p+2)}p-r`u_${l}`),this.type=n}setUniform(t,r,n){t.set(n.constantOr(this.value))}getBinding(t,r,n){return this.type==="color"?new nh(t,r):new gl(t,r)}}class ds{constructor(t,r){this.uniformNames=r.map(n=>`u_${n}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setUniform(t,r,n,l){let u=l==="u_pattern_to"?this.patternTo:l==="u_pattern_from"?this.patternFrom:l==="u_pixel_ratio_to"?this.pixelRatioTo:l==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&t.set(u)}getBinding(t,r,n){return n.substr(0,9)==="u_pattern"?new ah(t,r):new gl(t,r)}}class sa{constructor(t,r,n,l){this.expression=t,this.type=n,this.maxValue=0,this.paintVertexAttributes=r.map(u=>({name:`a_${u}`,type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new l}populatePaintArray(t,r,n,l,u){let p=this.paintVertexArray.length,m=this.expression.evaluate(new _t(0),r,{},l,[],u);this.paintVertexArray.resize(t),this._setPaintValue(p,t,m)}updatePaintArray(t,r,n,l){let u=this.expression.evaluate({zoom:0},n,l);this._setPaintValue(t,r,u)}_setPaintValue(t,r,n){if(this.type==="color"){let l=hc(n);for(let u=t;u`u_${m}_t`),this.type=n,this.useIntegerZoom=l,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=r.map(m=>({name:`a_${m}`,type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new p}populatePaintArray(t,r,n,l,u){let p=this.expression.evaluate(new _t(this.zoom),r,{},l,[],u),m=this.expression.evaluate(new _t(this.zoom+1),r,{},l,[],u),g=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(g,t,p,m)}updatePaintArray(t,r,n,l){let u=this.expression.evaluate({zoom:this.zoom},n,l),p=this.expression.evaluate({zoom:this.zoom+1},n,l);this._setPaintValue(t,r,u,p)}_setPaintValue(t,r,n,l){if(this.type==="color"){let u=hc(n),p=hc(l);for(let m=t;m`#define HAS_UNIFORM_${l}`))}return t}getBinderAttributes(){let t=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof sa||n instanceof Cr)for(let l=0;l!0){this.programConfigurations={};for(let l of t)this.programConfigurations[l.id]=new sh(l,r,n);this.needsUpload=!1,this._featureMap=new vn,this._bufferOffset=0}populatePaintArrays(t,r,n,l,u,p){for(let m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(t,r,l,u,p);r.id!==void 0&&this._featureMap.add(r.id,n,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,n,l){for(let u of n)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(t,this._featureMap,r,u,l)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Xu(i,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${t}-`,"").replace(/-/g,"_")]}function oh(i,t,r){let n={color:{source:D,composite:qe},number:{source:xe,composite:D}},l=function(u){return{"line-pattern":{source:Vi,composite:Vi},"fill-pattern":{source:Vi,composite:Vi},"fill-extrusion-pattern":{source:Vi,composite:Vi}}[u]}(i);return l&&l[r]||n[t][r]}Ie("ConstantBinder",go),Ie("CrossFadedConstantBinder",ds),Ie("SourceExpressionBinder",sa),Ie("CrossFadedCompositeBinder",ja),Ie("CompositeExpressionBinder",Cr),Ie("ProgramConfiguration",sh,{omit:["_buffers"]}),Ie("ProgramConfigurationSet",wn);let Vt=8192,uc=Math.pow(2,14)-1,lh=-uc-1;function Tn(i){let t=Vt/i.extent,r=i.loadGeometry();for(let n=0;np.x+1||gp.y+1)&&Kt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Sn(i,t){return{type:i.type,id:i.id,properties:i.properties,geometry:t?Tn(i):[]}}function _l(i,t,r,n,l){i.emplaceBack(2*t+(n+1)/2,2*r+(l+1)/2)}class pc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new hi,this.indexArray=new Qi,this.segments=new Ke,this.programConfigurations=new wn(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,n){let l=this.layers[0],u=[],p=null,m=!1;l.type==="circle"&&(p=l.layout.get("circle-sort-key"),m=!p.isConstant());for(let{feature:g,id:x,index:v,sourceLayerIndex:w}of t){let I=this.layers[0]._featureFilter.needGeometry,k=Sn(g,I);if(!this.layers[0]._featureFilter.filter(new _t(this.zoom),k,n))continue;let E=m?p.evaluate(k,{},n):void 0,A={id:x,properties:g.properties,type:g.type,sourceLayerIndex:w,index:v,geometry:I?k.geometry:Tn(g),patterns:{},sortKey:E};u.push(A)}m&&u.sort((g,x)=>g.sortKey-x.sortKey);for(let g of u){let{geometry:x,index:v,sourceLayerIndex:w}=g,I=t[v].feature;this.addFeature(g,x,v,n),r.featureIndex.insert(I,x,v,w,this.index)}}update(t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ei),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,n,l){for(let u of r)for(let p of u){let m=p.x,g=p.y;if(m<0||m>=Vt||g<0||g>=Vt)continue;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),v=x.vertexLength;_l(this.layoutVertexArray,m,g,-1,-1),_l(this.layoutVertexArray,m,g,1,-1),_l(this.layoutVertexArray,m,g,1,1),_l(this.layoutVertexArray,m,g,-1,1),this.indexArray.emplaceBack(v,v+1,v+2),this.indexArray.emplaceBack(v,v+3,v+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{},l)}}function ch(i,t){for(let r=0;r1){if(dc(i,t))return!0;for(let n=0;n1?r:r.sub(t)._mult(l)._add(t))}function ph(i,t){let r,n,l,u=!1;for(let p=0;pt.y!=l.y>t.y&&t.x<(l.x-n.x)*(t.y-n.y)/(l.y-n.y)+n.x&&(u=!u)}return u}function ms(i,t){let r=!1;for(let n=0,l=i.length-1;nt.y!=p.y>t.y&&t.x<(p.x-u.x)*(t.y-u.y)/(p.y-u.y)+u.x&&(r=!r)}return r}function Yu(i,t,r){let n=r[0],l=r[2];if(i.xl.x&&t.x>l.x||i.yl.y&&t.y>l.y)return!1;let u=si(i,t,r[0]);return u!==si(i,t,r[1])||u!==si(i,t,r[2])||u!==si(i,t,r[3])}function _o(i,t,r){let n=t.paint.get(i).value;return n.kind==="constant"?n.value:r.programConfigurations.get(t.id).getMaxValue(i)}function yl(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function xl(i,t,r,n,l){if(!t[0]&&!t[1])return i;let u=se.convert(t)._mult(l);r==="viewport"&&u._rotate(-n);let p=[];for(let m=0;mgh(F,A))}(x,g),k=w?v*m:v;for(let E of l)for(let A of E){let F=w?A:gh(A,g),N=k,Q=vl([],[A.x,A.y,0,1],g);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?N*=Q[3]/p.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(N*=p.cameraToCenterDistance/Q[3]),Wu(I,F,N))return!0}return!1}}function gh(i,t){let r=vl([],[i.x,i.y,0,1],t);return new se(r[0]/r[3],r[1]/r[3])}class _h extends pc{}let yh;Ie("HeatmapBucket",_h,{omit:["layers"]});var ip={get paint(){return yh=yh||new h({"heatmap-radius":new Be(re.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Be(re.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Me(re.paint_heatmap["heatmap-intensity"]),"heatmap-color":new mo(re.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Me(re.paint_heatmap["heatmap-opacity"])})}};function gc(i,{width:t,height:r},n,l){if(l){if(l instanceof Uint8ClampedArray)l=new Uint8Array(l.buffer);else if(l.length!==t*r*n)throw new RangeError(`mismatched image size. expected: ${l.length} but got: ${t*r*n}`)}else l=new Uint8Array(t*r*n);return i.width=t,i.height=r,i.data=l,i}function xh(i,{width:t,height:r},n){if(t===i.width&&r===i.height)return;let l=gc({},{width:t,height:r},n);_c(i,l,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,t),height:Math.min(i.height,r)},n),i.width=t,i.height=r,i.data=l.data}function _c(i,t,r,n,l,u){if(l.width===0||l.height===0)return t;if(l.width>i.width||l.height>i.height||r.x>i.width-l.width||r.y>i.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||n.x>t.width-l.width||n.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");let p=i.data,m=t.data;if(p===m)throw new Error("srcData equals dstData, so image is already copied");for(let g=0;g{t[i.evaluationKey]=g;let x=i.expression.evaluate(t);l.data[p+m+0]=Math.floor(255*x.r/x.a),l.data[p+m+1]=Math.floor(255*x.g/x.a),l.data[p+m+2]=Math.floor(255*x.b/x.a),l.data[p+m+3]=Math.floor(255*x.a)};if(i.clips)for(let p=0,m=0;p80*r){m=1/0,g=1/0;let v=-1/0,w=-1/0;for(let I=r;Iv&&(v=k),E>w&&(w=E)}x=Math.max(v-m,w-g),x=x!==0?32767/x:0}return vo(u,p,r,m,g,x,0),p}function Th(i,t,r,n,l){let u;if(l===function(p,m,g,x){let v=0;for(let w=m,I=g-x;w0)for(let p=t;p=t;p-=n)u=Ch(p/n|0,i[p],i[p+1],u);return u&&bl(u,u.next)&&(wo(u),u=u.next),u}function In(i,t){if(!i)return i;t||(t=i);let r,n=i;do if(r=!1,n.steiner||!bl(n,n.next)&&Bt(n.prev,n,n.next)!==0)n=n.next;else{if(wo(n),n=t=n.prev,n===n.next)break;r=!0}while(r||n!==t);return t}function vo(i,t,r,n,l,u,p){if(!i)return;!p&&u&&function(g,x,v,w){let I=g;do I.z===0&&(I.z=xc(I.x,I.y,x,v,w)),I.prevZ=I.prev,I.nextZ=I.next,I=I.next;while(I!==g);I.prevZ.nextZ=null,I.prevZ=null,function(k){let E,A=1;do{let F,N=k;k=null;let Q=null;for(E=0;N;){E++;let G=N,J=0;for(let he=0;he0||ae>0&&G;)J!==0&&(ae===0||!G||N.z<=G.z)?(F=N,N=N.nextZ,J--):(F=G,G=G.nextZ,ae--),Q?Q.nextZ=F:k=F,F.prevZ=Q,Q=F;N=G}Q.nextZ=null,A*=2}while(E>1)}(I)}(i,n,l,u);let m=i;for(;i.prev!==i.next;){let g=i.prev,x=i.next;if(u?cp(i,n,l,u):lp(i))t.push(g.i,i.i,x.i),wo(i),i=x.next,m=x.next;else if((i=x)===m){p?p===1?vo(i=hp(In(i),t),t,r,n,l,u,2):p===2&&up(i,t,r,n,l,u):vo(In(i),t,r,n,l,u,1);break}}}function lp(i){let t=i.prev,r=i,n=i.next;if(Bt(t,r,n)>=0)return!1;let l=t.x,u=r.x,p=n.x,m=t.y,g=r.y,x=n.y,v=lu?l>p?l:p:u>p?u:p,k=m>g?m>x?m:x:g>x?g:x,E=n.next;for(;E!==t;){if(E.x>=v&&E.x<=I&&E.y>=w&&E.y<=k&&gs(l,m,u,g,p,x,E.x,E.y)&&Bt(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function cp(i,t,r,n){let l=i.prev,u=i,p=i.next;if(Bt(l,u,p)>=0)return!1;let m=l.x,g=u.x,x=p.x,v=l.y,w=u.y,I=p.y,k=mg?m>x?m:x:g>x?g:x,F=v>w?v>I?v:I:w>I?w:I,N=xc(k,E,t,r,n),Q=xc(A,F,t,r,n),G=i.prevZ,J=i.nextZ;for(;G&&G.z>=N&&J&&J.z<=Q;){if(G.x>=k&&G.x<=A&&G.y>=E&&G.y<=F&&G!==l&&G!==p&&gs(m,v,g,w,x,I,G.x,G.y)&&Bt(G.prev,G,G.next)>=0||(G=G.prevZ,J.x>=k&&J.x<=A&&J.y>=E&&J.y<=F&&J!==l&&J!==p&&gs(m,v,g,w,x,I,J.x,J.y)&&Bt(J.prev,J,J.next)>=0))return!1;J=J.nextZ}for(;G&&G.z>=N;){if(G.x>=k&&G.x<=A&&G.y>=E&&G.y<=F&&G!==l&&G!==p&&gs(m,v,g,w,x,I,G.x,G.y)&&Bt(G.prev,G,G.next)>=0)return!1;G=G.prevZ}for(;J&&J.z<=Q;){if(J.x>=k&&J.x<=A&&J.y>=E&&J.y<=F&&J!==l&&J!==p&&gs(m,v,g,w,x,I,J.x,J.y)&&Bt(J.prev,J,J.next)>=0)return!1;J=J.nextZ}return!0}function hp(i,t){let r=i;do{let n=r.prev,l=r.next.next;!bl(n,l)&&Sh(n,r,r.next,l)&&bo(n,l)&&bo(l,n)&&(t.push(n.i,r.i,l.i),wo(r),wo(r.next),r=i=l),r=r.next}while(r!==i);return In(r)}function up(i,t,r,n,l,u){let p=i;do{let m=p.next.next;for(;m!==p.prev;){if(p.i!==m.i&&gp(p,m)){let g=Ih(p,m);return p=In(p,p.next),g=In(g,g.next),vo(p,t,r,n,l,u,0),void vo(g,t,r,n,l,u,0)}m=m.next}p=p.next}while(p!==i)}function pp(i,t){return i.x-t.x}function dp(i,t){let r=function(l,u){let p=u,m=l.x,g=l.y,x,v=-1/0;do{if(g<=p.y&&g>=p.next.y&&p.next.y!==p.y){let A=p.x+(g-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(A<=m&&A>v&&(v=A,x=p.x=p.x&&p.x>=I&&m!==p.x&&gs(gx.x||p.x===x.x&&mp(x,p)))&&(x=p,E=A)}p=p.next}while(p!==w);return x}(i,t);if(!r)return t;let n=Ih(r,i);return In(n,n.next),In(r,r.next)}function mp(i,t){return Bt(i.prev,i,t.prev)<0&&Bt(t.next,i,i.next)<0}function xc(i,t,r,n,l){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*l|0)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*l|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function fp(i){let t=i,r=i;do(t.x=(i-p)*(u-m)&&(i-p)*(n-m)>=(r-p)*(t-m)&&(r-p)*(u-m)>=(l-p)*(n-m)}function gp(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(r,n){let l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==n.i&&l.next.i!==n.i&&Sh(l,l.next,r,n))return!0;l=l.next}while(l!==r);return!1}(i,t)&&(bo(i,t)&&bo(t,i)&&function(r,n){let l=r,u=!1,p=(r.x+n.x)/2,m=(r.y+n.y)/2;do l.y>m!=l.next.y>m&&l.next.y!==l.y&&p<(l.next.x-l.x)*(m-l.y)/(l.next.y-l.y)+l.x&&(u=!u),l=l.next;while(l!==r);return u}(i,t)&&(Bt(i.prev,i,t.prev)||Bt(i,t.prev,t))||bl(i,t)&&Bt(i.prev,i,i.next)>0&&Bt(t.prev,t,t.next)>0)}function Bt(i,t,r){return(t.y-i.y)*(r.x-t.x)-(t.x-i.x)*(r.y-t.y)}function bl(i,t){return i.x===t.x&&i.y===t.y}function Sh(i,t,r,n){let l=Tl(Bt(i,t,r)),u=Tl(Bt(i,t,n)),p=Tl(Bt(r,n,i)),m=Tl(Bt(r,n,t));return l!==u&&p!==m||!(l!==0||!wl(i,r,t))||!(u!==0||!wl(i,n,t))||!(p!==0||!wl(r,i,n))||!(m!==0||!wl(r,t,n))}function wl(i,t,r){return t.x<=Math.max(i.x,r.x)&&t.x>=Math.min(i.x,r.x)&&t.y<=Math.max(i.y,r.y)&&t.y>=Math.min(i.y,r.y)}function Tl(i){return i>0?1:i<0?-1:0}function bo(i,t){return Bt(i.prev,i,i.next)<0?Bt(i,t,i.next)>=0&&Bt(i,i.prev,t)>=0:Bt(i,t,i.prev)<0||Bt(i,i.next,t)<0}function Ih(i,t){let r=vc(i.i,i.x,i.y),n=vc(t.i,t.x,t.y),l=i.next,u=t.prev;return i.next=t,t.prev=i,r.next=l,l.prev=r,n.next=r,r.prev=n,u.next=n,n.prev=u,n}function Ch(i,t,r,n){let l=vc(i,t,r);return n?(l.next=n.next,l.prev=n,n.next.prev=l,n.next=l):(l.prev=l,l.next=l),l}function wo(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function vc(i,t,r){return{i,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function bc(i,t,r){let n=r.patternDependencies,l=!1;for(let u of t){let p=u.paint.get(`${i}-pattern`);p.isConstant()||(l=!0);let m=p.constantOr(null);m&&(l=!0,n[m.to]=!0,n[m.from]=!0)}return l}function wc(i,t,r,n,l){let u=l.patternDependencies;for(let p of t){let m=p.paint.get(`${i}-pattern`).value;if(m.kind!=="constant"){let g=m.evaluate({zoom:n-1},r,{},l.availableImages),x=m.evaluate({zoom:n},r,{},l.availableImages),v=m.evaluate({zoom:n+1},r,{},l.availableImages);g=g&&g.name?g.name:g,x=x&&x.name?x.name:x,v=v&&v.name?v.name:v,u[g]=!0,u[x]=!0,u[v]=!0,r.patterns[p.id]={min:g,mid:x,max:v}}}return r}class Tc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new gr,this.indexArray=new Qi,this.indexArray2=new Xt,this.programConfigurations=new wn(t.layers,t.zoom),this.segments=new Ke,this.segments2=new Ke,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,n){this.hasPattern=bc("fill",this.layers,r);let l=this.layers[0].layout.get("fill-sort-key"),u=!l.isConstant(),p=[];for(let{feature:m,id:g,index:x,sourceLayerIndex:v}of t){let w=this.layers[0]._featureFilter.needGeometry,I=Sn(m,w);if(!this.layers[0]._featureFilter.filter(new _t(this.zoom),I,n))continue;let k=u?l.evaluate(I,{},n,r.availableImages):void 0,E={id:g,properties:m.properties,type:m.type,sourceLayerIndex:v,index:x,geometry:w?I.geometry:Tn(m),patterns:{},sortKey:k};p.push(E)}u&&p.sort((m,g)=>m.sortKey-g.sortKey);for(let m of p){let{geometry:g,index:x,sourceLayerIndex:v}=m;if(this.hasPattern){let w=wc("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(m,g,x,n,{});r.featureIndex.insert(t[x].feature,g,x,v,this.index)}}update(t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,n)}addFeatures(t,r,n){for(let l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,op),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,n,l,u){for(let p of qn(r,500)){let m=0;for(let k of p)m+=k.length;let g=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=g.vertexLength,v=[],w=[];for(let k of p){if(k.length===0)continue;k!==p[0]&&w.push(v.length/2);let E=this.segments2.prepareSegment(k.length,this.layoutVertexArray,this.indexArray2),A=E.vertexLength;this.layoutVertexArray.emplaceBack(k[0].x,k[0].y),this.indexArray2.emplaceBack(A+k.length-1,A),v.push(k[0].x),v.push(k[0].y);for(let F=1;F>3}if(l--,n===1||n===2)u+=i.readSVarint(),p+=i.readSVarint(),n===1&&(t&&m.push(t),t=[]),t.push(new wp(u,p));else{if(n!==7)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&m.push(t),m},_s.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var t=i.readVarint()+i.pos,r=1,n=0,l=0,u=0,p=1/0,m=-1/0,g=1/0,x=-1/0;i.pos>3}if(n--,r===1||r===2)(l+=i.readSVarint())m&&(m=l),(u+=i.readSVarint())x&&(x=u);else if(r!==7)throw new Error("unknown command "+r)}return[p,g,m,x]},_s.prototype.toGeoJSON=function(i,t,r){var n,l,u=this.extent*Math.pow(2,r),p=this.extent*i,m=this.extent*t,g=this.loadGeometry(),x=_s.types[this.type];function v(k){for(var E=0;E>3;l=p===1?n.readString():p===2?n.readFloat():p===3?n.readDouble():p===4?n.readVarint64():p===5?n.readVarint():p===6?n.readSVarint():p===7?n.readBoolean():null}return l}(r))}Ah.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var t=this._pbf.readVarint()+this._pbf.pos;return new Ip(this._pbf,t,this.extent,this._keys,this._values)};var Mp=Eh;function kp(i,t,r){if(i===3){var n=new Mp(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}Ua.VectorTile=function(i,t){this.layers=i.readFields(kp,{},t)},Ua.VectorTileFeature=zh,Ua.VectorTileLayer=Eh;let zp=Ua.VectorTileFeature.types,Sc=Math.pow(2,13);function To(i,t,r,n,l,u,p,m){i.emplaceBack(t,r,2*Math.floor(n*Sc)+p,l*Sc*2,u*Sc*2,Math.round(m))}class Ic{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Fa,this.centroidVertexArray=new Qt,this.indexArray=new Qi,this.programConfigurations=new wn(t.layers,t.zoom),this.segments=new Ke,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,n){this.features=[],this.hasPattern=bc("fill-extrusion",this.layers,r);for(let{feature:l,id:u,index:p,sourceLayerIndex:m}of t){let g=this.layers[0]._featureFilter.needGeometry,x=Sn(l,g);if(!this.layers[0]._featureFilter.filter(new _t(this.zoom),x,n))continue;let v={id:u,sourceLayerIndex:m,index:p,geometry:g?x.geometry:Tn(l),properties:l.properties,type:l.type,patterns:{}};this.hasPattern?this.features.push(wc("fill-extrusion",this.layers,v,this.zoom,r)):this.addFeature(v,v.geometry,p,n,{}),r.featureIndex.insert(l,v.geometry,p,m,this.index,!0)}}addFeatures(t,r,n){for(let l of this.features){let{geometry:u}=l;this.addFeature(l,u,l.index,r,n)}}update(t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,bp),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,vp.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,n,l,u){for(let p of qn(r,500)){let m={x:0,y:0,vertexCount:0},g=0;for(let E of p)g+=E.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let E of p){if(E.length===0||Ap(E))continue;let A=0;for(let F=0;F=1){let Q=E[F-1];if(!Ep(N,Q)){x.vertexLength+4>Ke.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let G=N.sub(Q)._perp()._unit(),J=Q.dist(N);A+J>32768&&(A=0),To(this.layoutVertexArray,N.x,N.y,G.x,G.y,0,0,A),To(this.layoutVertexArray,N.x,N.y,G.x,G.y,0,1,A),m.x+=2*N.x,m.y+=2*N.y,m.vertexCount+=2,A+=J,To(this.layoutVertexArray,Q.x,Q.y,G.x,G.y,0,0,A),To(this.layoutVertexArray,Q.x,Q.y,G.x,G.y,0,1,A),m.x+=2*Q.x,m.y+=2*Q.y,m.vertexCount+=2;let ae=x.vertexLength;this.indexArray.emplaceBack(ae,ae+2,ae+1),this.indexArray.emplaceBack(ae+1,ae+2,ae+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+g>Ke.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),zp[t.type]!=="Polygon")continue;let v=[],w=[],I=x.vertexLength;for(let E of p)if(E.length!==0){E!==p[0]&&w.push(v.length/2);for(let A=0;AVt)||i.y===t.y&&(i.y<0||i.y>Vt)}function Ap(i){return i.every(t=>t.x<0)||i.every(t=>t.x>Vt)||i.every(t=>t.y<0)||i.every(t=>t.y>Vt)}let Ph;Ie("FillExtrusionBucket",Ic,{omit:["layers","features"]});var Pp={get paint(){return Ph=Ph||new h({"fill-extrusion-opacity":new Me(re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Be(re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Me(re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Me(re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ss(re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Be(re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Be(re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Me(re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Dp extends a{constructor(t){super(t,Pp)}createBucket(t){return new Ic(t)}queryRadius(){return yl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,r,n,l,u,p,m,g){let x=xl(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,m),v=this.paint.get("fill-extrusion-height").evaluate(r,n),w=this.paint.get("fill-extrusion-base").evaluate(r,n),I=function(E,A,F,N){let Q=[];for(let G of E){let J=[G.x,G.y,0,1];vl(J,J,A),Q.push(new se(J[0]/J[3],J[1]/J[3]))}return Q}(x,g),k=function(E,A,F,N){let Q=[],G=[],J=N[8]*A,ae=N[9]*A,he=N[10]*A,we=N[11]*A,Re=N[8]*F,ve=N[9]*F,ye=N[10]*F,Ee=N[11]*F;for(let Ce of E){let Se=[],oe=[];for(let Ae of Ce){let ze=Ae.x,Ve=Ae.y,ut=N[0]*ze+N[4]*Ve+N[12],ht=N[1]*ze+N[5]*Ve+N[13],$t=N[2]*ze+N[6]*Ve+N[14],_r=N[3]*ze+N[7]*Ve+N[15],ii=$t+he,Zt=_r+we,vi=ut+Re,bi=ht+ve,wi=$t+ye,Dt=_r+Ee,Gt=new se((ut+J)/Zt,(ht+ae)/Zt);Gt.z=ii/Zt,Se.push(Gt);let ui=new se(vi/Dt,bi/Dt);ui.z=wi/Dt,oe.push(ui)}Q.push(Se),G.push(oe)}return[Q,G]}(l,w,v,g);return function(E,A,F){let N=1/0;hh(F,A)&&(N=Dh(F,A[0]));for(let Q=0;Qr.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new ls,this.layoutVertexArray2=new Oa,this.indexArray=new Qi,this.programConfigurations=new wn(t.layers,t.zoom),this.segments=new Ke,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,n){this.hasPattern=bc("line",this.layers,r);let l=this.layers[0].layout.get("line-sort-key"),u=!l.isConstant(),p=[];for(let{feature:m,id:g,index:x,sourceLayerIndex:v}of t){let w=this.layers[0]._featureFilter.needGeometry,I=Sn(m,w);if(!this.layers[0]._featureFilter.filter(new _t(this.zoom),I,n))continue;let k=u?l.evaluate(I,{},n):void 0,E={id:g,properties:m.properties,type:m.type,sourceLayerIndex:v,index:x,geometry:w?I.geometry:Tn(m),patterns:{},sortKey:k};p.push(E)}u&&p.sort((m,g)=>m.sortKey-g.sortKey);for(let m of p){let{geometry:g,index:x,sourceLayerIndex:v}=m;if(this.hasPattern){let w=wc("line",this.layers,m,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(m,g,x,n,{});r.featureIndex.insert(t[x].feature,g,x,v,this.index)}}update(t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,n)}addFeatures(t,r,n){for(let l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Fp)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Rp),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,r,n,l,u){let p=this.layers[0].layout,m=p.get("line-join").evaluate(t,{}),g=p.get("line-cap"),x=p.get("line-miter-limit"),v=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(let w of r)this.addLine(w,t,m,g,x,v);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,u,l)}addLine(t,r,n,l,u,p){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let N=0;N=2&&t[g-1].equals(t[g-2]);)g--;let x=0;for(;x0;if(we&&N>x){let Ee=I.dist(k);if(Ee>2*v){let Ce=I.sub(I.sub(k)._mult(v/Ee)._round());this.updateDistance(k,Ce),this.addCurrentVertex(Ce,A,0,0,w),k=Ce}}let ve=k&&E,ye=ve?n:m?"butt":l;if(ve&&ye==="round"&&(aeu&&(ye="bevel"),ye==="bevel"&&(ae>2&&(ye="flipbevel"),ae100)Q=F.mult(-1);else{let Ee=ae*A.add(F).mag()/A.sub(F).mag();Q._perp()._mult(Ee*(Re?-1:1))}this.addCurrentVertex(I,Q,0,0,w),this.addCurrentVertex(I,Q.mult(-1),0,0,w)}else if(ye==="bevel"||ye==="fakeround"){let Ee=-Math.sqrt(ae*ae-1),Ce=Re?Ee:0,Se=Re?0:Ee;if(k&&this.addCurrentVertex(I,A,Ce,Se,w),ye==="fakeround"){let oe=Math.round(180*he/Math.PI/20);for(let Ae=1;Ae2*v){let Ce=I.add(E.sub(I)._mult(v/Ee)._round());this.updateDistance(I,Ce),this.addCurrentVertex(Ce,F,0,0,w),I=Ce}}}}addCurrentVertex(t,r,n,l,u,p=!1){let m=r.y*l-r.x,g=-r.y-r.x*l;this.addHalfVertex(t,r.x+r.y*n,r.y-r.x*n,p,!1,n,u),this.addHalfVertex(t,m,g,p,!0,-l,u),this.distance>Lh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,n,l,u,p))}addHalfVertex({x:t,y:r},n,l,u,p,m,g){let x=.5*(this.lineClips?this.scaledDistance*(Lh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(u?1:0),(r<<1)+(p?1:0),Math.round(63*n)+128,Math.round(63*l)+128,1+(m===0?0:m<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let v=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,v),g.primitiveLength++),p?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(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}}let Rh,Bh;Ie("LineBucket",Cc,{omit:["layers","patternFeatures"]});var Fh={get paint(){return Bh=Bh||new h({"line-opacity":new Be(re.paint_line["line-opacity"]),"line-color":new Be(re.paint_line["line-color"]),"line-translate":new Me(re.paint_line["line-translate"]),"line-translate-anchor":new Me(re.paint_line["line-translate-anchor"]),"line-width":new Be(re.paint_line["line-width"]),"line-gap-width":new Be(re.paint_line["line-gap-width"]),"line-offset":new Be(re.paint_line["line-offset"]),"line-blur":new Be(re.paint_line["line-blur"]),"line-dasharray":new os(re.paint_line["line-dasharray"]),"line-pattern":new ss(re.paint_line["line-pattern"]),"line-gradient":new mo(re.paint_line["line-gradient"])})},get layout(){return Rh=Rh||new h({"line-cap":new Me(re.layout_line["line-cap"]),"line-join":new Be(re.layout_line["line-join"]),"line-miter-limit":new Me(re.layout_line["line-miter-limit"]),"line-round-limit":new Me(re.layout_line["line-round-limit"]),"line-sort-key":new Be(re.layout_line["line-sort-key"])})}};class qp extends Be{possiblyEvaluate(t,r){return r=new _t(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(t,r)}evaluate(t,r,n,l){return r=Di({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(t,r,n,l)}}let Sl;class Np extends a{constructor(t){super(t,Fh),this.gradientVersion=0,Sl||(Sl=new qp(Fh.paint.properties["line-width"].specification),Sl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){let r=this.gradientExpression();this.stepInterpolant=!!function(n){return n._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof ya,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,r){super.recalculate(t,r),this.paint._values["line-floorwidth"]=Sl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Cc(t)}queryRadius(t){let r=t,n=Oh(_o("line-width",this,r),_o("line-gap-width",this,r)),l=_o("line-offset",this,r);return n/2+Math.abs(l)+yl(this.paint.get("line-translate"))}queryIntersectsFeature(t,r,n,l,u,p,m){let g=xl(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),p.angle,m),x=m/2*Oh(this.paint.get("line-width").evaluate(r,n),this.paint.get("line-gap-width").evaluate(r,n)),v=this.paint.get("line-offset").evaluate(r,n);return v&&(l=function(w,I){let k=[];for(let E=0;E=3){for(let F=0;F0?t+2*i:i}let jp=f([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Up=f([{name:"a_projected_pos",components:3,type:"Float32"}],4);f([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let $p=f([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);f([{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"}]);let Vh=f([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Zp=f([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Gp(i,t,r){return i.sections.forEach(n=>{n.text=function(l,u,p){let m=u.layout.get("text-transform").evaluate(p,{});return m==="uppercase"?l=l.toLocaleUpperCase():m==="lowercase"&&(l=l.toLocaleLowerCase()),zi.applyArabicShaping&&(l=zi.applyArabicShaping(l)),l}(n.text,t,r)}),i}f([{name:"triangle",components:3,type:"Uint16"}]),f([{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"}]),f([{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"}]),f([{type:"Float32",name:"offsetX"}]),f([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),f([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let Io={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var jt=24,qh=ct,Nh=function(i,t,r,n,l){var u,p,m=8*l-n-1,g=(1<>1,v=-7,w=r?l-1:0,I=r?-1:1,k=i[t+w];for(w+=I,u=k&(1<<-v)-1,k>>=-v,v+=m;v>0;u=256*u+i[t+w],w+=I,v-=8);for(p=u&(1<<-v)-1,u>>=-v,v+=n;v>0;p=256*p+i[t+w],w+=I,v-=8);if(u===0)u=1-x;else{if(u===g)return p?NaN:1/0*(k?-1:1);p+=Math.pow(2,n),u-=x}return(k?-1:1)*p*Math.pow(2,u-n)},jh=function(i,t,r,n,l,u){var p,m,g,x=8*u-l-1,v=(1<>1,I=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=n?0:u-1,E=n?1:-1,A=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,p=v):(p=Math.floor(Math.log(t)/Math.LN2),t*(g=Math.pow(2,-p))<1&&(p--,g*=2),(t+=p+w>=1?I/g:I*Math.pow(2,1-w))*g>=2&&(p++,g/=2),p+w>=v?(m=0,p=v):p+w>=1?(m=(t*g-1)*Math.pow(2,l),p+=w):(m=t*Math.pow(2,w-1)*Math.pow(2,l),p=0));l>=8;i[r+k]=255&m,k+=E,m/=256,l-=8);for(p=p<0;i[r+k]=255&p,k+=E,p/=256,x-=8);i[r+k-E]|=128*A};function ct(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}ct.Varint=0,ct.Fixed64=1,ct.Bytes=2,ct.Fixed32=5;var Mc=4294967296,Uh=1/Mc,$h=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function oa(i){return i.type===ct.Bytes?i.readVarint()+i.pos:i.pos+1}function ys(i,t,r){return r?4294967296*t+(i>>>0):4294967296*(t>>>0)+(i>>>0)}function Zh(i,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var l=r.pos-1;l>=i;l--)r.buf[l+n]=r.buf[l]}function Hp(i,t){for(var r=0;r>>8,i[r+2]=t>>>16,i[r+3]=t>>>24}function Gh(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16)+(i[t+3]<<24)}ct.prototype={destroy:function(){this.buf=null},readFields:function(i,t,r){for(r=r||this.length;this.pos>3,u=this.pos;this.type=7&n,i(l,t,this),this.pos===u&&this.skip(n)}return t},readMessage:function(i,t){return this.readFields(i,t,this.readVarint()+this.pos)},readFixed32:function(){var i=Il(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Gh(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Il(this.buf,this.pos)+Il(this.buf,this.pos+4)*Mc;return this.pos+=8,i},readSFixed64:function(){var i=Il(this.buf,this.pos)+Gh(this.buf,this.pos+4)*Mc;return this.pos+=8,i},readFloat:function(){var i=Nh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Nh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(l,u,p){var m,g,x=p.buf;if(m=(112&(g=x[p.pos++]))>>4,g<128||(m|=(127&(g=x[p.pos++]))<<3,g<128)||(m|=(127&(g=x[p.pos++]))<<10,g<128)||(m|=(127&(g=x[p.pos++]))<<17,g<128)||(m|=(127&(g=x[p.pos++]))<<24,g<128)||(m|=(1&(g=x[p.pos++]))<<31,g<128))return ys(l,m,u);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,t=this.pos;return this.pos=i,i-t>=12&&$h?function(r,n,l){return $h.decode(r.subarray(n,l))}(this.buf,t,i):function(r,n,l){for(var u="",p=n;p239?4:v>223?3:v>191?2:1;if(p+I>l)break;I===1?v<128&&(w=v):I===2?(192&(m=r[p+1]))==128&&(w=(31&v)<<6|63&m)<=127&&(w=null):I===3?(g=r[p+2],(192&(m=r[p+1]))==128&&(192&g)==128&&((w=(15&v)<<12|(63&m)<<6|63&g)<=2047||w>=55296&&w<=57343)&&(w=null)):I===4&&(g=r[p+2],x=r[p+3],(192&(m=r[p+1]))==128&&(192&g)==128&&(192&x)==128&&((w=(15&v)<<18|(63&m)<<12|(63&g)<<6|63&x)<=65535||w>=1114112)&&(w=null)),w===null?(w=65533,I=1):w>65535&&(w-=65536,u+=String.fromCharCode(w>>>10&1023|55296),w=56320|1023&w),u+=String.fromCharCode(w),p+=I}return u}(this.buf,t,i)},readBytes:function(){var i=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,i);return this.pos=i,t},readPackedVarint:function(i,t){if(this.type!==ct.Bytes)return i.push(this.readVarint(t));var r=oa(this);for(i=i||[];this.pos127;);else if(t===ct.Bytes)this.pos=this.readVarint()+this.pos;else if(t===ct.Fixed32)this.pos+=4;else{if(t!==ct.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(i,t){this.writeVarint(i<<3|t)},realloc:function(i){for(var t=this.length||16;t268435455||i<0?function(t,r){var n,l;if(t>=0?(n=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(u,p,m){m.buf[m.pos++]=127&u|128,u>>>=7,m.buf[m.pos++]=127&u|128,u>>>=7,m.buf[m.pos++]=127&u|128,u>>>=7,m.buf[m.pos++]=127&u|128,m.buf[m.pos]=127&(u>>>=7)}(n,0,r),function(u,p){var m=(7&u)<<4;p.buf[p.pos++]|=m|((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,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var t=this.pos;this.pos=function(n,l,u){for(var p,m,g=0;g55295&&p<57344){if(!m){p>56319||g+1===l.length?(n[u++]=239,n[u++]=191,n[u++]=189):m=p;continue}if(p<56320){n[u++]=239,n[u++]=191,n[u++]=189,m=p;continue}p=m-55296<<10|p-56320|65536,m=null}else m&&(n[u++]=239,n[u++]=191,n[u++]=189,m=null);p<128?n[u++]=p:(p<2048?n[u++]=p>>6|192:(p<65536?n[u++]=p>>12|224:(n[u++]=p>>18|240,n[u++]=p>>12&63|128),n[u++]=p>>6&63|128),n[u++]=63&p|128)}return u}(this.buf,i,this.pos);var r=this.pos-t;r>=128&&Zh(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),jh(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),jh(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var t=i.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&Zh(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(i,t,r){this.writeTag(i,ct.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(i,t){t.length&&this.writeMessage(i,Hp,t)},writePackedSVarint:function(i,t){t.length&&this.writeMessage(i,Xp,t)},writePackedBoolean:function(i,t){t.length&&this.writeMessage(i,Jp,t)},writePackedFloat:function(i,t){t.length&&this.writeMessage(i,Wp,t)},writePackedDouble:function(i,t){t.length&&this.writeMessage(i,Kp,t)},writePackedFixed32:function(i,t){t.length&&this.writeMessage(i,Yp,t)},writePackedSFixed32:function(i,t){t.length&&this.writeMessage(i,Qp,t)},writePackedFixed64:function(i,t){t.length&&this.writeMessage(i,ed,t)},writePackedSFixed64:function(i,t){t.length&&this.writeMessage(i,td,t)},writeBytesField:function(i,t){this.writeTag(i,ct.Bytes),this.writeBytes(t)},writeFixed32Field:function(i,t){this.writeTag(i,ct.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(i,t){this.writeTag(i,ct.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(i,t){this.writeTag(i,ct.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(i,t){this.writeTag(i,ct.Fixed64),this.writeSFixed64(t)},writeVarintField:function(i,t){this.writeTag(i,ct.Varint),this.writeVarint(t)},writeSVarintField:function(i,t){this.writeTag(i,ct.Varint),this.writeSVarint(t)},writeStringField:function(i,t){this.writeTag(i,ct.Bytes),this.writeString(t)},writeFloatField:function(i,t){this.writeTag(i,ct.Fixed32),this.writeFloat(t)},writeDoubleField:function(i,t){this.writeTag(i,ct.Fixed64),this.writeDouble(t)},writeBooleanField:function(i,t){this.writeVarintField(i,!!t)}};var kc=qt(qh);let zc=3;function id(i,t,r){i===1&&r.readMessage(rd,t)}function rd(i,t,r){if(i===3){let{id:n,bitmap:l,width:u,height:p,left:m,top:g,advance:x}=r.readMessage(ad,{});t.push({id:n,bitmap:new xo({width:u+2*zc,height:p+2*zc},l),metrics:{width:u,height:p,left:m,top:g,advance:x}})}}function ad(i,t,r){i===1?t.id=r.readVarint():i===2?t.bitmap=r.readBytes():i===3?t.width=r.readVarint():i===4?t.height=r.readVarint():i===5?t.left=r.readSVarint():i===6?t.top=r.readSVarint():i===7&&(t.advance=r.readVarint())}let Hh=zc;function Xh(i){let t=0,r=0;for(let p of i)t+=p.w*p.h,r=Math.max(r,p.w);i.sort((p,m)=>m.h-p.h);let n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],l=0,u=0;for(let p of i)for(let m=n.length-1;m>=0;m--){let g=n[m];if(!(p.w>g.w||p.h>g.h)){if(p.x=g.x,p.y=g.y,u=Math.max(u,p.y+p.h),l=Math.max(l,p.x+p.w),p.w===g.w&&p.h===g.h){let x=n.pop();m=0&&n>=t&&Ml[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)}substring(t,r){let n=new vs;return n.text=this.text.substring(t,r),n.sectionIndex=this.sectionIndex.slice(t,r),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}addTextSection(t,r){this.text+=t.text,this.sections.push(Mo.forText(t.scale,t.fontStack||r));let n=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Cl(i,t,r,n,l,u,p,m,g,x,v,w,I,k,E){let A=vs.fromFeature(i,l),F;w===P.ah.vertical&&A.verticalizePunctuation();let{processBidirectionalText:N,processStyledBidirectionalText:Q}=zi;if(N&&A.sections.length===1){F=[];let ae=N(A.toString(),Ac(A,x,u,t,n,k));for(let he of ae){let we=new vs;we.text=he,we.sections=A.sections;for(let Re=0;Re0&&la>ai&&(ai=la)}else{let rr=we[tt.fontStack],Wt=rr&&rr[bt];if(Wt&&Wt.rect)Ss=Wt.rect,zt=Wt.metrics;else{let la=he[tt.fontStack],Do=la&&la[bt];if(!Do)continue;zt=Do.metrics}ji=(Gt-tt.scale)*jt}yr?(ae.verticalizable=!0,Ti.push({glyph:bt,imageName:qr,x:Ve,y:ut+ji,vertical:yr,scale:tt.scale,fontStack:tt.fontStack,sectionIndex:ft,metrics:zt,rect:Ss}),Ve+=Nr*tt.scale+oe):(Ti.push({glyph:bt,imageName:qr,x:Ve,y:ut+ji,vertical:yr,scale:tt.scale,fontStack:tt.fontStack,sectionIndex:ft,metrics:zt,rect:Ss}),Ve+=zt.advance*tt.scale+oe)}Ti.length!==0&&(ht=Math.max(Ve-oe,ht),ld(Ti,0,Ti.length-1,_r,ai)),Ve=0;let ir=ye*Gt+ai;ri.lineOffset=Math.max(ai,ui),ut+=ir,$t=Math.max(ir,$t),++ii}var Zt;let vi=ut-Co,{horizontalAlign:bi,verticalAlign:wi}=Pc(Ee);(function(Dt,Gt,ui,ri,Ti,ai,ir,Pi,tt){let ft=(Gt-ui)*Ti,bt=0;bt=ai!==ir?-Pi*ri-Co:(-ri*tt+.5)*ir;for(let ji of Dt)for(let zt of ji.positionedGlyphs)zt.x+=ft,zt.y+=bt})(ae.positionedLines,_r,bi,wi,ht,$t,ye,vi,ve.length),ae.top+=-wi*vi,ae.bottom=ae.top+vi,ae.left+=-bi*ht,ae.right=ae.left+ht}(J,t,r,n,F,p,m,g,w,x,I,E),!function(ae){for(let he of ae)if(he.positionedGlyphs.length!==0)return!1;return!0}(G)&&J}let Ml={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},nd={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},sd={40:!0};function Kh(i,t,r,n,l,u){if(t.imageName){let p=n[t.imageName];return p?p.displaySize[0]*t.scale*jt/u+l:0}{let p=r[t.fontStack],m=p&&p[i];return m?m.metrics.advance*t.scale+l:0}}function Jh(i,t,r,n){let l=Math.pow(i-t,2);return n?i=0,x=0;for(let w=0;wx){let v=Math.ceil(u/x);l*=v/p,p=v}return{x1:n,y1:l,x2:n+u,y2:l+p}}function tu(i,t,r,n,l,u){let p=i.image,m;if(p.content){let F=p.content,N=p.pixelRatio||1;m=[F[0]/N,F[1]/N,p.displaySize[0]-F[2]/N,p.displaySize[1]-F[3]/N]}let g=t.left*u,x=t.right*u,v,w,I,k;r==="width"||r==="both"?(k=l[0]+g-n[3],w=l[0]+x+n[1]):(k=l[0]+(g+x-p.displaySize[0])/2,w=k+p.displaySize[0]);let E=t.top*u,A=t.bottom*u;return r==="height"||r==="both"?(v=l[1]+E-n[0],I=l[1]+A+n[2]):(v=l[1]+(E+A-p.displaySize[1])/2,I=v+p.displaySize[1]),{image:p,top:v,right:w,bottom:I,left:k,collisionPadding:m}}let ko=255,Vr=128,Za=ko*Vr;function iu(i,t){let{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new _t(i+1))};if(r.kind==="source")return{kind:"source"};{let{zoomStops:n,interpolationType:l}=r,u=0;for(;up.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=fc([]),this.placementViewportMatrix=fc([]);let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=iu(this.zoom,r["text-size"]),this.iconSizeData=iu(this.zoom,r["icon-size"]);let n=this.layers[0].layout,l=n.get("symbol-sort-key"),u=n.get("symbol-z-order");this.canOverlap=Dc(n,"text-overlap","text-allow-overlap")!=="never"||Dc(n,"icon-overlap","icon-allow-overlap")!=="never"||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!l.isConstant(),this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,n.get("symbol-placement")==="point"&&(this.writingModes=n.get("text-writing-mode").map(p=>P.ah[p])),this.stateDependentLayerIds=this.layers.filter(p=>p.isStateDependent()).map(p=>p.id),this.sourceID=t.sourceID}createArrays(){this.text=new Rc(new wn(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new Rc(new wn(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new xt,this.lineVertexArray=new Yt,this.symbolInstances=new Xe,this.textAnchorOffsets=new vt}calculateGlyphDependencies(t,r,n,l,u){for(let p=0;p0)&&(p.value.kind!=="constant"||p.value.value.length>0),v=g.value.kind!=="constant"||!!g.value.value||Object.keys(g.parameters).length>0,w=u.get("symbol-sort-key");if(this.features=[],!x&&!v)return;let I=r.iconDependencies,k=r.glyphDependencies,E=r.availableImages,A=new _t(this.zoom);for(let{feature:F,id:N,index:Q,sourceLayerIndex:G}of t){let J=l._featureFilter.needGeometry,ae=Sn(F,J);if(!l._featureFilter.filter(A,ae,n))continue;let he,we;if(J||(ae.geometry=Tn(F)),x){let ve=l.getValueAndResolveTokens("text-field",ae,n,E),ye=Ii.factory(ve),Ee=this.hasRTLText=this.hasRTLText||pd(ye);(!Ee||zi.getRTLTextPluginStatus()==="unavailable"||Ee&&zi.isParsed())&&(he=Gp(ye,l,ae))}if(v){let ve=l.getValueAndResolveTokens("icon-image",ae,n,E);we=ve instanceof Mi?ve:Mi.fromString(ve)}if(!he&&!we)continue;let Re=this.sortFeaturesByKey?w.evaluate(ae,{},n):void 0;if(this.features.push({id:N,text:he,icon:we,index:Q,sourceLayerIndex:G,geometry:ae.geometry,properties:F.properties,type:hd[F.type],sortKey:Re}),we&&(I[we.name]=!0),he){let ve=p.evaluate(ae,{},n).join(","),ye=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(P.ah.vertical)>=0;for(let Ee of he.sections)if(Ee.image)I[Ee.image.name]=!0;else{let Ce=co(he.toString()),Se=Ee.fontStack||ve,oe=k[Se]=k[Se]||{};this.calculateGlyphDependencies(Ee.text,oe,ye,this.allowVerticalPlacement,Ce)}}}u.get("symbol-placement")==="line"&&(this.features=function(F){let N={},Q={},G=[],J=0;function ae(ve){G.push(F[ve]),J++}function he(ve,ye,Ee){let Ce=Q[ve];return delete Q[ve],Q[ye]=Ce,G[Ce].geometry[0].pop(),G[Ce].geometry[0]=G[Ce].geometry[0].concat(Ee[0]),Ce}function we(ve,ye,Ee){let Ce=N[ye];return delete N[ye],N[ve]=Ce,G[Ce].geometry[0].shift(),G[Ce].geometry[0]=Ee[0].concat(G[Ce].geometry[0]),Ce}function Re(ve,ye,Ee){let Ce=Ee?ye[0][ye[0].length-1]:ye[0][0];return`${ve}:${Ce.x}:${Ce.y}`}for(let ve=0;veve.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((F,N)=>F.sortKey-N.sortKey)}update(t,r,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,n),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,n))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){let n=this.lineVertexArray.length;if(t.segment!==void 0){let l=t.dist(r[t.segment+1]),u=t.dist(r[t.segment]),p={};for(let m=t.segment+1;m=0;m--)p[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:u},m>0&&(u+=r[m-1].dist(r[m]));for(let m=0;m0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){let n=t.placedSymbolArray.get(r),l=n.vertexStartIndex+4*n.numGlyphs;for(let u=n.vertexStartIndex;ul[m]-l[g]||u[g]-u[m]),p}addToSortKeyRanges(t,r){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===r?n.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let r of this.symbolInstanceIndexes){let n=this.symbolInstances.get(r);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((l,u,p)=>{l>=0&&p.indexOf(l)===u&&this.addIndicesForPlacedSymbol(this.text,l)}),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 ru,au;Ie("SymbolBucket",bs,{omit:["layers","collisionBoxArray","features","compareText"]}),bs.MAX_GLYPHS=65535,bs.addDynamicAttributes=Lc;var Fc={get paint(){return au=au||new h({"icon-opacity":new Be(re.paint_symbol["icon-opacity"]),"icon-color":new Be(re.paint_symbol["icon-color"]),"icon-halo-color":new Be(re.paint_symbol["icon-halo-color"]),"icon-halo-width":new Be(re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Be(re.paint_symbol["icon-halo-blur"]),"icon-translate":new Me(re.paint_symbol["icon-translate"]),"icon-translate-anchor":new Me(re.paint_symbol["icon-translate-anchor"]),"text-opacity":new Be(re.paint_symbol["text-opacity"]),"text-color":new Be(re.paint_symbol["text-color"],{runtimeType:fi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Be(re.paint_symbol["text-halo-color"]),"text-halo-width":new Be(re.paint_symbol["text-halo-width"]),"text-halo-blur":new Be(re.paint_symbol["text-halo-blur"]),"text-translate":new Me(re.paint_symbol["text-translate"]),"text-translate-anchor":new Me(re.paint_symbol["text-translate-anchor"])})},get layout(){return ru=ru||new h({"symbol-placement":new Me(re.layout_symbol["symbol-placement"]),"symbol-spacing":new Me(re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Me(re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Be(re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Me(re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Me(re.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Me(re.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Me(re.layout_symbol["icon-ignore-placement"]),"icon-optional":new Me(re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Me(re.layout_symbol["icon-rotation-alignment"]),"icon-size":new Be(re.layout_symbol["icon-size"]),"icon-text-fit":new Me(re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Me(re.layout_symbol["icon-text-fit-padding"]),"icon-image":new Be(re.layout_symbol["icon-image"]),"icon-rotate":new Be(re.layout_symbol["icon-rotate"]),"icon-padding":new Be(re.layout_symbol["icon-padding"]),"icon-keep-upright":new Me(re.layout_symbol["icon-keep-upright"]),"icon-offset":new Be(re.layout_symbol["icon-offset"]),"icon-anchor":new Be(re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Me(re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Me(re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Me(re.layout_symbol["text-rotation-alignment"]),"text-field":new Be(re.layout_symbol["text-field"]),"text-font":new Be(re.layout_symbol["text-font"]),"text-size":new Be(re.layout_symbol["text-size"]),"text-max-width":new Be(re.layout_symbol["text-max-width"]),"text-line-height":new Me(re.layout_symbol["text-line-height"]),"text-letter-spacing":new Be(re.layout_symbol["text-letter-spacing"]),"text-justify":new Be(re.layout_symbol["text-justify"]),"text-radial-offset":new Be(re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Me(re.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Be(re.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Be(re.layout_symbol["text-anchor"]),"text-max-angle":new Me(re.layout_symbol["text-max-angle"]),"text-writing-mode":new Me(re.layout_symbol["text-writing-mode"]),"text-rotate":new Be(re.layout_symbol["text-rotate"]),"text-padding":new Me(re.layout_symbol["text-padding"]),"text-keep-upright":new Me(re.layout_symbol["text-keep-upright"]),"text-transform":new Be(re.layout_symbol["text-transform"]),"text-offset":new Be(re.layout_symbol["text-offset"]),"text-allow-overlap":new Me(re.layout_symbol["text-allow-overlap"]),"text-overlap":new Me(re.layout_symbol["text-overlap"]),"text-ignore-placement":new Me(re.layout_symbol["text-ignore-placement"]),"text-optional":new Me(re.layout_symbol["text-optional"])})}};class nu{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:Dr,this.defaultValue=t}evaluate(t){if(t.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ie("FormatSectionOverride",nu,{omit:["defaultValue"]});class zl extends a{constructor(t){super(t,Fc)}recalculate(t,r){if(super.recalculate(t,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let l=[];for(let u of n)l.indexOf(u)<0&&l.push(u);this.layout._values["text-writing-mode"]=l}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,n,l){let u=this.layout.get(t).evaluate(r,{},n,l),p=this._unevaluatedLayout._values[t];return p.isDataDriven()||Xn(p.value)||!u?u:function(m,g){return g.replace(/{([^{}]+)}/g,(x,v)=>m&&v in m?String(m[v]):"")}(r.properties,u)}createBucket(t){return new bs(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of Fc.paint.overridableProperties){if(!zl.hasPaintOverride(this.layout,t))continue;let r=this.paint.get(t),n=new nu(r),l=new Hn(n,r.property.specification),u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new Ma("source",l):new ka("composite",l,r.value.zoomStops),this.paint._values[t]=new fr(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&zl.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){let n=t.get("text-field"),l=Fc.paint.properties[r],u=!1,p=m=>{for(let g of m)if(l.overrides&&l.overrides.hasOverride(g))return void(u=!0)};if(n.value.kind==="constant"&&n.value.value instanceof Ii)p(n.value.value.sections);else if(n.value.kind==="source"){let m=x=>{u||(x instanceof Hi&&Ot(x.value)===Tr?p(x.value.sections):x instanceof On?p(x.sections):x.eachChild(m))},g=n.value;g._styleExpression&&m(g._styleExpression.expression)}return u}}let su;var dd={get paint(){return su=su||new h({"background-color":new Me(re.paint_background["background-color"]),"background-pattern":new os(re.paint_background["background-pattern"]),"background-opacity":new Me(re.paint_background["background-opacity"])})}};class md extends a{constructor(t){super(t,dd)}}let ou;var fd={get paint(){return ou=ou||new h({"raster-opacity":new Me(re.paint_raster["raster-opacity"]),"raster-hue-rotate":new Me(re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Me(re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Me(re.paint_raster["raster-brightness-max"]),"raster-saturation":new Me(re.paint_raster["raster-saturation"]),"raster-contrast":new Me(re.paint_raster["raster-contrast"]),"raster-resampling":new Me(re.paint_raster["raster-resampling"]),"raster-fade-duration":new Me(re.paint_raster["raster-fade-duration"])})}};class gd extends a{constructor(t){super(t,fd)}}class _d extends a{constructor(t){super(t,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class yd{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let Oc=63710088e-1;class Ga{constructor(t,r){if(isNaN(t)||isNaN(r))throw new Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ga(nr(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){let r=Math.PI/180,n=this.lat*r,l=t.lat*r,u=Math.sin(n)*Math.sin(l)+Math.cos(n)*Math.cos(l)*Math.cos((t.lng-this.lng)*r);return Oc*Math.acos(Math.min(u,1))}static convert(t){if(t instanceof Ga)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new Ga(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new Ga(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let lu=2*Math.PI*Oc;function cu(i){return lu*Math.cos(i*Math.PI/180)}function hu(i){return(180+i)/360}function uu(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function pu(i,t){return i/cu(t)}function Vc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class zo{constructor(t,r,n=0){this.x=+t,this.y=+r,this.z=+n}static fromLngLat(t,r=0){let n=Ga.convert(t);return new zo(hu(n.lng),uu(n.lat),pu(r,n.lat))}toLngLat(){return new Ga(360*this.x-180,Vc(this.y))}toAltitude(){return this.z*cu(Vc(this.y))}meterInMercatorCoordinateUnits(){return 1/lu*(t=Vc(this.y),1/Math.cos(t*Math.PI/180));var t}}function du(i,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[i*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}class qc{constructor(t,r,n){if(!function(l,u,p){return!(l<0||l>25||p<0||p>=Math.pow(2,l)||u<0||u>=Math.pow(2,l))}(t,r,n))throw new Error(`x=${r}, y=${n}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=r,this.y=n,this.key=Eo(0,t,t,r,n)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,n){let l=(p=this.y,m=this.z,g=du(256*(u=this.x),256*(p=Math.pow(2,m)-p-1),m),x=du(256*(u+1),256*(p+1),m),g[0]+","+g[1]+","+x[0]+","+x[1]);var u,p,m,g,x;let v=function(w,I,k){let E,A="";for(let F=w;F>0;F--)E=1<1?"@2x":"").replace(/{quadkey}/g,v).replace(/{bbox-epsg-3857}/g,l)}isChildOf(t){let r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){let r=Math.pow(2,this.z);return new se((t.x*r-this.x)*Vt,(t.y*r-this.y)*Vt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class mu{constructor(t,r){this.wrap=t,this.canonical=r,this.key=Eo(t,r.z,r.z,r.x,r.y)}}class tr{constructor(t,r,n,l,u){if(t= z; overscaledZ = ${t}; z = ${n}`);this.overscaledZ=t,this.wrap=r,this.canonical=new qc(n,+l,+u),this.key=Eo(r,t,n,l,u)}clone(){return new tr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?new tr(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new tr(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(t,r){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let n=this.canonical.z-t;return t>this.canonical.z?Eo(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):Eo(this.wrap*+r,t,t,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(t){if(t.wrap!==this.wrap)return!1;let r=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new tr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,n=2*this.canonical.x,l=2*this.canonical.y;return[new tr(r,this.wrap,r,n,l),new tr(r,this.wrap,r,n+1,l),new tr(r,this.wrap,r,n,l+1),new tr(r,this.wrap,r,n+1,l+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.ythis.max&&(this.max=w),w=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(t+1)}unpack(t,r,n){return t*this.redFactor+r*this.greenFactor+n*this.blueFactor-this.baseShift}getPixels(){return new er({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,r,n){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let l=r*this.dim,u=r*this.dim+this.dim,p=n*this.dim,m=n*this.dim+this.dim;switch(r){case-1:l=u-1;break;case 1:u=l+1}switch(n){case-1:p=m-1;break;case 1:m=p+1}let g=-r*this.dim,x=-n*this.dim;for(let v=p;v=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class _u{constructor(t,r,n,l,u){this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=n,t._y=l,this.properties=t.properties,this.id=u}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(t[r]=this[r]);return t}}class yu{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Pa(Vt,16,0),this.grid3D=new Pa(Vt,16,0),this.featureIndexArray=new ci,this.promoteId=r}insert(t,r,n,l,u,p){let m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,l,u);let g=p?this.grid3D:this.grid;for(let x=0;x=0&&w[3]>=0&&g.insert(m,w[0],w[1],w[2],w[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ua.VectorTile(new kc(this.rawTileData)).layers,this.sourceLayerCoder=new gu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,r,n,l){this.loadVTLayers();let u=t.params||{},p=Vt/t.tileSize/t.scale,m=Xs(u.filter),g=t.queryGeometry,x=t.queryPadding*p,v=vu(g),w=this.grid.query(v.minX-x,v.minY-x,v.maxX+x,v.maxY+x),I=vu(t.cameraQueryGeometry),k=this.grid3D.query(I.minX-x,I.minY-x,I.maxX+x,I.maxY+x,(F,N,Q,G)=>function(J,ae,he,we,Re){for(let ye of J)if(ae<=ye.x&&he<=ye.y&&we>=ye.x&&Re>=ye.y)return!0;let ve=[new se(ae,he),new se(ae,Re),new se(we,Re),new se(we,he)];if(J.length>2){for(let ye of ve)if(ms(J,ye))return!0}for(let ye=0;ye(G||(G=Tn(J)),ae.queryIntersectsFeature(g,J,he,G,this.z,t.transform,p,t.pixelPosMatrix)))}return E}loadMatchingFeature(t,r,n,l,u,p,m,g,x,v,w){let I=this.bucketLayerIDs[r];if(p&&!function(F,N){for(let Q=0;Q=0)return!0;return!1}(p,I))return;let k=this.sourceLayerCoder.decode(n),E=this.vtLayers[k].feature(l);if(u.needGeometry){let F=Sn(E,!0);if(!u.filter(new _t(this.tileID.overscaledZ),F,this.tileID.canonical))return}else if(!u.filter(new _t(this.tileID.overscaledZ),E))return;let A=this.getId(E,k);for(let F=0;F{let m=t instanceof xn?t.get(p):null;return m&&m.evaluate?m.evaluate(r,n,l):m})}function vu(i){let t=1/0,r=1/0,n=-1/0,l=-1/0;for(let u of i)t=Math.min(t,u.x),r=Math.min(r,u.y),n=Math.max(n,u.x),l=Math.max(l,u.y);return{minX:t,minY:r,maxX:n,maxY:l}}function xd(i,t){return t-i}function bu(i,t,r,n,l){let u=[];for(let p=0;p=n&&w.x>=n||(v.x>=n?v=new se(n,v.y+(n-v.x)/(w.x-v.x)*(w.y-v.y))._round():w.x>=n&&(w=new se(n,v.y+(n-v.x)/(w.x-v.x)*(w.y-v.y))._round()),v.y>=l&&w.y>=l||(v.y>=l?v=new se(v.x+(l-v.y)/(w.y-v.y)*(w.x-v.x),l)._round():w.y>=l&&(w=new se(v.x+(l-v.y)/(w.y-v.y)*(w.x-v.x),l)._round()),g&&v.equals(g[g.length-1])||(g=[v],u.push(g)),g.push(w)))))}}return u}Ie("FeatureIndex",yu,{omit:["rawTileData","sourceLayerCoder"]});class Ha extends se{constructor(t,r,n,l){super(t,r),this.angle=n,l!==void 0&&(this.segment=l)}clone(){return new Ha(this.x,this.y,this.angle,this.segment)}}function wu(i,t,r,n,l){if(t.segment===void 0||r===0)return!0;let u=t,p=t.segment+1,m=0;for(;m>-r/2;){if(p--,p<0)return!1;m-=i[p].dist(u),u=i[p]}m+=i[p].dist(i[p+1]),p++;let g=[],x=0;for(;mn;)x-=g.shift().angleDelta;if(x>l)return!1;p++,m+=v.dist(w)}return!0}function Tu(i){let t=0;for(let r=0;rx){let E=(x-g)/k,A=gi.number(w.x,I.x,E),F=gi.number(w.y,I.y,E),N=new Ha(A,F,I.angleTo(w),v);return N._round(),!p||wu(i,N,m,p,t)?N:void 0}g+=k}}function bd(i,t,r,n,l,u,p,m,g){let x=Su(n,u,p),v=Iu(n,l),w=v*p,I=i[0].x===0||i[0].x===g||i[0].y===0||i[0].y===g;return t-w=0&&J=0&&ae=0&&I+x<=v){let he=new Ha(J,ae,Q,E);he._round(),n&&!wu(i,he,u,n,l)||k.push(he)}}w+=N}return m||k.length||p||(k=Cu(i,w/2,r,n,l,u,p,!0,g)),k}Ie("Anchor",Ha);let ws=Ai;function Mu(i,t,r,n){let l=[],u=i.image,p=u.pixelRatio,m=u.paddedRect.w-2*ws,g=u.paddedRect.h-2*ws,x={x1:i.left,y1:i.top,x2:i.right,y2:i.bottom},v=u.stretchX||[[0,m]],w=u.stretchY||[[0,g]],I=(oe,Ae)=>oe+Ae[1]-Ae[0],k=v.reduce(I,0),E=w.reduce(I,0),A=m-k,F=g-E,N=0,Q=k,G=0,J=E,ae=0,he=A,we=0,Re=F;if(u.content&&n){let oe=u.content,Ae=oe[2]-oe[0],ze=oe[3]-oe[1];(u.textFitWidth||u.textFitHeight)&&(x=eu(i)),N=El(v,0,oe[0]),G=El(w,0,oe[1]),Q=El(v,oe[0],oe[2]),J=El(w,oe[1],oe[3]),ae=oe[0]-N,we=oe[1]-G,he=Ae-Q,Re=ze-J}let ve=x.x1,ye=x.y1,Ee=x.x2-ve,Ce=x.y2-ye,Se=(oe,Ae,ze,Ve)=>{let ut=Al(oe.stretch-N,Q,Ee,ve),ht=Pl(oe.fixed-ae,he,oe.stretch,k),$t=Al(Ae.stretch-G,J,Ce,ye),_r=Pl(Ae.fixed-we,Re,Ae.stretch,E),ii=Al(ze.stretch-N,Q,Ee,ve),Zt=Pl(ze.fixed-ae,he,ze.stretch,k),vi=Al(Ve.stretch-G,J,Ce,ye),bi=Pl(Ve.fixed-we,Re,Ve.stretch,E),wi=new se(ut,$t),Dt=new se(ii,$t),Gt=new se(ii,vi),ui=new se(ut,vi),ri=new se(ht/p,_r/p),Ti=new se(Zt/p,bi/p),ai=t*Math.PI/180;if(ai){let tt=Math.sin(ai),ft=Math.cos(ai),bt=[ft,-tt,tt,ft];wi._matMult(bt),Dt._matMult(bt),ui._matMult(bt),Gt._matMult(bt)}let ir=oe.stretch+oe.fixed,Pi=Ae.stretch+Ae.fixed;return{tl:wi,tr:Dt,bl:ui,br:Gt,tex:{x:u.paddedRect.x+ws+ir,y:u.paddedRect.y+ws+Pi,w:ze.stretch+ze.fixed-ir,h:Ve.stretch+Ve.fixed-Pi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ri,pixelOffsetBR:Ti,minFontScaleX:he/p/Ee,minFontScaleY:Re/p/Ce,isSDF:r}};if(n&&(u.stretchX||u.stretchY)){let oe=ku(v,A,k),Ae=ku(w,F,E);for(let ze=0;ze0&&(A=Math.max(10,A),this.circleDiameter=A)}else{let I=!((w=p.image)===null||w===void 0)&&w.content&&(p.image.textFitWidth||p.image.textFitHeight)?eu(p):{x1:p.left,y1:p.top,x2:p.right,y2:p.bottom};I.y1=I.y1*m-g[0],I.y2=I.y2*m+g[2],I.x1=I.x1*m-g[3],I.x2=I.x2*m+g[1];let k=p.collisionPadding;if(k&&(I.x1-=k[0]*m,I.y1-=k[1]*m,I.x2+=k[2]*m,I.y2+=k[3]*m),v){let E=new se(I.x1,I.y1),A=new se(I.x2,I.y1),F=new se(I.x1,I.y2),N=new se(I.x2,I.y2),Q=v*Math.PI/180;E._rotate(Q),A._rotate(Q),F._rotate(Q),N._rotate(Q),I.x1=Math.min(E.x,A.x,F.x,N.x),I.x2=Math.max(E.x,A.x,F.x,N.x),I.y1=Math.min(E.y,A.y,F.y,N.y),I.y2=Math.max(E.y,A.y,F.y,N.y)}t.emplaceBack(r.x,r.y,I.x1,I.y1,I.x2,I.y2,n,l,u)}this.boxEndIndex=t.length}}class wd{constructor(t=[],r=(n,l)=>nl?1:0){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:r,compare:n}=this,l=r[t];for(;t>0;){let u=t-1>>1,p=r[u];if(n(l,p)>=0)break;r[t]=p,t=u}r[t]=l}_down(t){let{data:r,compare:n}=this,l=this.length>>1,u=r[t];for(;t=0)break;r[t]=r[p],t=p}r[t]=u}}function Td(i,t=1,r=!1){let n=1/0,l=1/0,u=-1/0,p=-1/0,m=i[0];for(let k=0;ku)&&(u=E.x),(!k||E.y>p)&&(p=E.y)}let g=Math.min(u-n,p-l),x=g/2,v=new wd([],Sd);if(g===0)return new se(n,l);for(let k=n;kw.d||!w.d)&&(w=k,r&&console.log("found best %d after %d probes",Math.round(1e4*k.d)/1e4,I)),k.max-w.d<=t||(x=k.h/2,v.push(new Ts(k.p.x-x,k.p.y-x,x,i)),v.push(new Ts(k.p.x+x,k.p.y-x,x,i)),v.push(new Ts(k.p.x-x,k.p.y+x,x,i)),v.push(new Ts(k.p.x+x,k.p.y+x,x,i)),I+=4)}return r&&(console.log(`num probes: ${I}`),console.log(`best distance: ${w.d}`)),w.p}function Sd(i,t){return t.max-i.max}function Ts(i,t,r,n){this.p=new se(i,t),this.h=r,this.d=function(l,u){let p=!1,m=1/0;for(let g=0;gl.y!=E.y>l.y&&l.x<(E.x-k.x)*(l.y-k.y)/(E.y-k.y)+k.x&&(p=!p),m=Math.min(m,uh(l,k,E))}}return(p?1:-1)*Math.sqrt(m)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var ti;P.aq=void 0,(ti=P.aq||(P.aq={}))[ti.center=1]="center",ti[ti.left=2]="left",ti[ti.right=3]="right",ti[ti.top=4]="top",ti[ti.bottom=5]="bottom",ti[ti["top-left"]=6]="top-left",ti[ti["top-right"]=7]="top-right",ti[ti["bottom-left"]=8]="bottom-left",ti[ti["bottom-right"]=9]="bottom-right";let Xa=7,Nc=Number.POSITIVE_INFINITY;function zu(i,t){return t[1]!==Nc?function(r,n,l){let u=0,p=0;switch(n=Math.abs(n),l=Math.abs(l),r){case"top-right":case"top-left":case"top":p=l-Xa;break;case"bottom-right":case"bottom-left":case"bottom":p=-l+Xa}switch(r){case"top-right":case"bottom-right":case"right":u=-n;break;case"top-left":case"bottom-left":case"left":u=n}return[u,p]}(i,t[0],t[1]):function(r,n){let l=0,u=0;n<0&&(n=0);let p=n/Math.SQRT2;switch(r){case"top-right":case"top-left":u=p-Xa;break;case"bottom-right":case"bottom-left":u=-p+Xa;break;case"bottom":u=-n+Xa;break;case"top":u=n-Xa}switch(r){case"top-right":case"bottom-right":l=-p;break;case"top-left":case"bottom-left":l=p;break;case"left":l=n;break;case"right":l=-n}return[l,u]}(i,t[0])}function Eu(i,t,r){var n;let l=i.layout,u=(n=l.get("text-variable-anchor-offset"))===null||n===void 0?void 0:n.evaluate(t,{},r);if(u){let m=u.values,g=[];for(let x=0;xI*jt);v.startsWith("top")?w[1]-=Xa:v.startsWith("bottom")&&(w[1]+=Xa),g[x+1]=w}return new Ri(g)}let p=l.get("text-variable-anchor");if(p){let m;m=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[l.get("text-radial-offset").evaluate(t,{},r)*jt,Nc]:l.get("text-offset").evaluate(t,{},r).map(x=>x*jt);let g=[];for(let x of p)g.push(x,zu(x,m));return new Ri(g)}return null}function jc(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Id(i,t,r,n,l,u,p,m,g,x,v){let w=u.textMaxSize.evaluate(t,{});w===void 0&&(w=p);let I=i.layers[0].layout,k=I.get("icon-offset").evaluate(t,{},v),E=Pu(r.horizontal),A=p/24,F=i.tilePixelRatio*A,N=i.tilePixelRatio*w/24,Q=i.tilePixelRatio*m,G=i.tilePixelRatio*I.get("symbol-spacing"),J=I.get("text-padding")*i.tilePixelRatio,ae=function(oe,Ae,ze,Ve=1){let ut=oe.get("icon-padding").evaluate(Ae,{},ze),ht=ut&&ut.values;return[ht[0]*Ve,ht[1]*Ve,ht[2]*Ve,ht[3]*Ve]}(I,t,v,i.tilePixelRatio),he=I.get("text-max-angle")/180*Math.PI,we=I.get("text-rotation-alignment")!=="viewport"&&I.get("symbol-placement")!=="point",Re=I.get("icon-rotation-alignment")==="map"&&I.get("symbol-placement")!=="point",ve=I.get("symbol-placement"),ye=G/2,Ee=I.get("icon-text-fit"),Ce;n&&Ee!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Ce=tu(n,r.vertical,Ee,I.get("icon-text-fit-padding"),k,A)),E&&(n=tu(n,E,Ee,I.get("icon-text-fit-padding"),k,A)));let Se=(oe,Ae)=>{Ae.x<0||Ae.x>=Vt||Ae.y<0||Ae.y>=Vt||function(ze,Ve,ut,ht,$t,_r,ii,Zt,vi,bi,wi,Dt,Gt,ui,ri,Ti,ai,ir,Pi,tt,ft,bt,ji,zt,Ss){let qr=ze.addToLineVertexArray(Ve,ut),Nr,yr,rr,Wt,la=0,Do=0,Bu=0,Fu=0,Kc=-1,Jc=-1,ca={},Ou=hs("");if(ze.allowVerticalPlacement&&ht.vertical){let pi=Zt.layout.get("text-rotate").evaluate(ft,{},zt)+90;rr=new Dl(vi,Ve,bi,wi,Dt,ht.vertical,Gt,ui,ri,pi),ii&&(Wt=new Dl(vi,Ve,bi,wi,Dt,ii,ai,ir,ri,pi))}if($t){let pi=Zt.layout.get("icon-rotate").evaluate(ft,{}),ar=Zt.layout.get("icon-text-fit")!=="none",Cn=Mu($t,pi,ji,ar),kr=ii?Mu(ii,pi,ji,ar):void 0;yr=new Dl(vi,Ve,bi,wi,Dt,$t,ai,ir,!1,pi),la=4*Cn.length;let Mn=ze.iconSizeData,jr=null;Mn.kind==="source"?(jr=[Vr*Zt.layout.get("icon-size").evaluate(ft,{})],jr[0]>Za&&Kt(`${ze.layerIds[0]}: Value for "icon-size" is >= ${ko}. Reduce your "icon-size".`)):Mn.kind==="composite"&&(jr=[Vr*bt.compositeIconSizes[0].evaluate(ft,{},zt),Vr*bt.compositeIconSizes[1].evaluate(ft,{},zt)],(jr[0]>Za||jr[1]>Za)&&Kt(`${ze.layerIds[0]}: Value for "icon-size" is >= ${ko}. Reduce your "icon-size".`)),ze.addSymbols(ze.icon,Cn,jr,tt,Pi,ft,P.ah.none,Ve,qr.lineStartIndex,qr.lineLength,-1,zt),Kc=ze.icon.placedSymbolArray.length-1,kr&&(Do=4*kr.length,ze.addSymbols(ze.icon,kr,jr,tt,Pi,ft,P.ah.vertical,Ve,qr.lineStartIndex,qr.lineLength,-1,zt),Jc=ze.icon.placedSymbolArray.length-1)}let Vu=Object.keys(ht.horizontal);for(let pi of Vu){let ar=ht.horizontal[pi];if(!Nr){Ou=hs(ar.text);let kr=Zt.layout.get("text-rotate").evaluate(ft,{},zt);Nr=new Dl(vi,Ve,bi,wi,Dt,ar,Gt,ui,ri,kr)}let Cn=ar.positionedLines.length===1;if(Bu+=Au(ze,Ve,ar,_r,Zt,ri,ft,Ti,qr,ht.vertical?P.ah.horizontal:P.ah.horizontalOnly,Cn?Vu:[pi],ca,Kc,bt,zt),Cn)break}ht.vertical&&(Fu+=Au(ze,Ve,ht.vertical,_r,Zt,ri,ft,Ti,qr,P.ah.vertical,["vertical"],ca,Jc,bt,zt));let kd=Nr?Nr.boxStartIndex:ze.collisionBoxArray.length,zd=Nr?Nr.boxEndIndex:ze.collisionBoxArray.length,Ed=rr?rr.boxStartIndex:ze.collisionBoxArray.length,Ad=rr?rr.boxEndIndex:ze.collisionBoxArray.length,Pd=yr?yr.boxStartIndex:ze.collisionBoxArray.length,Dd=yr?yr.boxEndIndex:ze.collisionBoxArray.length,Ld=Wt?Wt.boxStartIndex:ze.collisionBoxArray.length,Rd=Wt?Wt.boxEndIndex:ze.collisionBoxArray.length,Mr=-1,Rl=(pi,ar)=>pi&&pi.circleDiameter?Math.max(pi.circleDiameter,ar):ar;Mr=Rl(Nr,Mr),Mr=Rl(rr,Mr),Mr=Rl(yr,Mr),Mr=Rl(Wt,Mr);let qu=Mr>-1?1:0;qu&&(Mr*=Ss/jt),ze.glyphOffsetArray.length>=bs.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&&ze.addToSortKeyRanges(ze.symbolInstances.length,ft.sortKey);let Bd=Eu(Zt,ft,zt),[Fd,Od]=function(pi,ar){let Cn=pi.length,kr=ar?.values;if(kr?.length>0)for(let Mn=0;Mn=0?ca.right:-1,ca.center>=0?ca.center:-1,ca.left>=0?ca.left:-1,ca.vertical||-1,Kc,Jc,Ou,kd,zd,Ed,Ad,Pd,Dd,Ld,Rd,bi,Bu,Fu,la,Do,qu,0,Gt,Mr,Fd,Od)}(i,Ae,oe,r,n,l,Ce,i.layers[0],i.collisionBoxArray,t.index,t.sourceLayerIndex,i.index,F,[J,J,J,J],we,g,Q,ae,Re,k,t,u,x,v,p)};if(ve==="line")for(let oe of bu(t.geometry,0,0,Vt,Vt)){let Ae=bd(oe,G,he,r.vertical||E,n,24,N,i.overscaling,Vt);for(let ze of Ae)E&&Cd(i,E.text,ye,ze)||Se(oe,ze)}else if(ve==="line-center"){for(let oe of t.geometry)if(oe.length>1){let Ae=vd(oe,he,r.vertical||E,n,24,N);Ae&&Se(oe,Ae)}}else if(t.type==="Polygon")for(let oe of qn(t.geometry,0)){let Ae=Td(oe,16);Se(oe[0],new Ha(Ae.x,Ae.y,0))}else if(t.type==="LineString")for(let oe of t.geometry)Se(oe,new Ha(oe[0].x,oe[0].y,0));else if(t.type==="Point")for(let oe of t.geometry)for(let Ae of oe)Se([Ae],new Ha(Ae.x,Ae.y,0))}function Au(i,t,r,n,l,u,p,m,g,x,v,w,I,k,E){let A=function(Q,G,J,ae,he,we,Re,ve){let ye=ae.layout.get("text-rotate").evaluate(we,{})*Math.PI/180,Ee=[];for(let Ce of G.positionedLines)for(let Se of Ce.positionedGlyphs){if(!Se.rect)continue;let oe=Se.rect||{},Ae=Hh+1,ze=!0,Ve=1,ut=0,ht=(he||ve)&&Se.vertical,$t=Se.metrics.advance*Se.scale/2;if(ve&&G.verticalizable&&(ut=Ce.lineOffset/2-(Se.imageName?-(jt-Se.metrics.width*Se.scale)/2:(Se.scale-1)*jt)),Se.imageName){let tt=Re[Se.imageName];ze=tt.sdf,Ve=tt.pixelRatio,Ae=Ai/Ve}let _r=he?[Se.x+$t,Se.y]:[0,0],ii=he?[0,0]:[Se.x+$t+J[0],Se.y+J[1]-ut],Zt=[0,0];ht&&(Zt=ii,ii=[0,0]);let vi=Se.metrics.isDoubleResolution?2:1,bi=(Se.metrics.left-Ae)*Se.scale-$t+ii[0],wi=(-Se.metrics.top-Ae)*Se.scale+ii[1],Dt=bi+oe.w/vi*Se.scale/Ve,Gt=wi+oe.h/vi*Se.scale/Ve,ui=new se(bi,wi),ri=new se(Dt,wi),Ti=new se(bi,Gt),ai=new se(Dt,Gt);if(ht){let tt=new se(-$t,$t-Co),ft=-Math.PI/2,bt=jt/2-$t,ji=new se(5-Co-bt,-(Se.imageName?bt:0)),zt=new se(...Zt);ui._rotateAround(ft,tt)._add(ji)._add(zt),ri._rotateAround(ft,tt)._add(ji)._add(zt),Ti._rotateAround(ft,tt)._add(ji)._add(zt),ai._rotateAround(ft,tt)._add(ji)._add(zt)}if(ye){let tt=Math.sin(ye),ft=Math.cos(ye),bt=[ft,-tt,tt,ft];ui._matMult(bt),ri._matMult(bt),Ti._matMult(bt),ai._matMult(bt)}let ir=new se(0,0),Pi=new se(0,0);Ee.push({tl:ui,tr:ri,bl:Ti,br:ai,tex:oe,writingMode:G.writingMode,glyphOffset:_r,sectionIndex:Se.sectionIndex,isSDF:ze,pixelOffsetTL:ir,pixelOffsetBR:Pi,minFontScaleX:0,minFontScaleY:0})}return Ee}(0,r,m,l,u,p,n,i.allowVerticalPlacement),F=i.textSizeData,N=null;F.kind==="source"?(N=[Vr*l.layout.get("text-size").evaluate(p,{})],N[0]>Za&&Kt(`${i.layerIds[0]}: Value for "text-size" is >= ${ko}. Reduce your "text-size".`)):F.kind==="composite"&&(N=[Vr*k.compositeTextSizes[0].evaluate(p,{},E),Vr*k.compositeTextSizes[1].evaluate(p,{},E)],(N[0]>Za||N[1]>Za)&&Kt(`${i.layerIds[0]}: Value for "text-size" is >= ${ko}. Reduce your "text-size".`)),i.addSymbols(i.text,A,N,m,u,p,x,t,g.lineStartIndex,g.lineLength,I,E);for(let Q of v)w[Q]=i.text.placedSymbolArray.length-1;return 4*A.length}function Pu(i){for(let t in i)return i[t];return null}function Cd(i,t,r,n){let l=i.compareText;if(t in l){let u=l[t];for(let p=u.length-1;p>=0;p--)if(n.dist(u[p])>4;if(l!==1)throw new Error(`Got v${l} data when expected v1.`);let u=Du[15&n];if(!u)throw new Error("Unrecognized array type.");let[p]=new Uint16Array(t,2,1),[m]=new Uint32Array(t,4,1);return new Uc(m,p,u,t)}constructor(t,r=64,n=Float64Array,l){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=n,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let u=Du.indexOf(this.ArrayType),p=2*t*this.ArrayType.BYTES_PER_ELEMENT,m=t*this.IndexArrayType.BYTES_PER_ELEMENT,g=(8-m%8)%8;if(u<0)throw new Error(`Unexpected typed array class: ${n}.`);l&&l instanceof ArrayBuffer?(this.data=l,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+m+g,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+p+m+g),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+m+g,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+u]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=t,this.coords[this._pos++]=r,n}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return $c(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,n,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:u,coords:p,nodeSize:m}=this,g=[0,u.length-1,0],x=[];for(;g.length;){let v=g.pop()||0,w=g.pop()||0,I=g.pop()||0;if(w-I<=m){for(let F=I;F<=w;F++){let N=p[2*F],Q=p[2*F+1];N>=t&&N<=n&&Q>=r&&Q<=l&&x.push(u[F])}continue}let k=I+w>>1,E=p[2*k],A=p[2*k+1];E>=t&&E<=n&&A>=r&&A<=l&&x.push(u[k]),(v===0?t<=E:r<=A)&&(g.push(I),g.push(k-1),g.push(1-v)),(v===0?n>=E:l>=A)&&(g.push(k+1),g.push(w),g.push(1-v))}return x}within(t,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:l,coords:u,nodeSize:p}=this,m=[0,l.length-1,0],g=[],x=n*n;for(;m.length;){let v=m.pop()||0,w=m.pop()||0,I=m.pop()||0;if(w-I<=p){for(let F=I;F<=w;F++)Ru(u[2*F],u[2*F+1],t,r)<=x&&g.push(l[F]);continue}let k=I+w>>1,E=u[2*k],A=u[2*k+1];Ru(E,A,t,r)<=x&&g.push(l[k]),(v===0?t-n<=E:r-n<=A)&&(m.push(I),m.push(k-1),m.push(1-v)),(v===0?t+n>=E:r+n>=A)&&(m.push(k+1),m.push(w),m.push(1-v))}return g}}function $c(i,t,r,n,l,u){if(l-n<=r)return;let p=n+l>>1;Lu(i,t,p,n,l,u),$c(i,t,r,n,p-1,1-u),$c(i,t,r,p+1,l,1-u)}function Lu(i,t,r,n,l,u){for(;l>n;){if(l-n>600){let x=l-n+1,v=r-n+1,w=Math.log(x),I=.5*Math.exp(2*w/3),k=.5*Math.sqrt(w*I*(x-I)/x)*(v-x/2<0?-1:1);Lu(i,t,r,Math.max(n,Math.floor(r-v*I/x+k)),Math.min(l,Math.floor(r+(x-v)*I/x+k)),u)}let p=t[2*r+u],m=n,g=l;for(Ao(i,t,n,r),t[2*l+u]>p&&Ao(i,t,n,l);mp;)g--}t[2*n+u]===p?Ao(i,t,n,g):(g++,Ao(i,t,g,l)),g<=r&&(n=g+1),r<=g&&(l=g-1)}}function Ao(i,t,r,n){Zc(i,r,n),Zc(t,2*r,2*n),Zc(t,2*r+1,2*n+1)}function Zc(i,t,r){let n=i[t];i[t]=i[r],i[r]=n}function Ru(i,t,r,n){let l=i-r,u=t-n;return l*l+u*u}var Gc;P.bg=void 0,(Gc=P.bg||(P.bg={})).create="create",Gc.load="load",Gc.fullLoad="fullLoad";let Ll=null,Po=[],Hc=1e3/60,Xc="loadTime",Wc="fullLoadTime",Md={mark(i){performance.mark(i)},frame(i){let t=i;Ll!=null&&Po.push(t-Ll),Ll=t},clearMetrics(){Ll=null,Po=[],performance.clearMeasures(Xc),performance.clearMeasures(Wc);for(let i in P.bg)performance.clearMarks(P.bg[i])},getPerformanceMetrics(){performance.measure(Xc,P.bg.create,P.bg.load),performance.measure(Wc,P.bg.create,P.bg.fullLoad);let i=performance.getEntriesByName(Xc)[0].duration,t=performance.getEntriesByName(Wc)[0].duration,r=Po.length,n=1/(Po.reduce((u,p)=>u+p,0)/r/1e3),l=Po.filter(u=>u>Hc).reduce((u,p)=>u+(p-Hc)/Hc,0);return{loadTime:i,fullLoadTime:t,fps:n,percentDroppedFrames:l/(r+l)*100,totalFrames:r}}};P.$=class extends T{},P.A=fs,P.B=rc,P.C=function(i){if(ha==null){let t=i.navigator?i.navigator.userAgent:null;ha=!!i.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return ha},P.D=Me,P.E=da,P.F=class{constructor(i,t){this.target=i,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new yd(()=>this.process()),this.subscription=function(r,n,l,u){return r.addEventListener(n,l,!1),{unsubscribe:()=>{r.removeEventListener(n,l,!1)}}}(this.target,"message",r=>this.receive(r)),this.globalScope=xr(self)?i:window}registerMessageHandler(i,t){this.messageHandlers[i]=t}sendAsync(i,t){return new Promise((r,n)=>{let l=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[l]={resolve:r,reject:n},t&&t.signal.addEventListener("abort",()=>{delete this.resolveRejects[l];let m={id:l,type:"",origin:location.origin,targetMapId:i.targetMapId,sourceMapId:this.mapId};this.target.postMessage(m)},{once:!0});let u=[],p=Object.assign(Object.assign({},i),{id:l,sourceMapId:this.mapId,origin:location.origin,data:Da(i.data,u)});this.target.postMessage(p,{transfer:u})})}receive(i){let t=i.data,r=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type===""){delete this.tasks[r];let n=this.abortControllers[r];return delete this.abortControllers[r],void(n&&n.abort())}if(xr(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(this.taskQueue.length===0)return;let i=this.taskQueue.shift(),t=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(i,t)}processTask(i,t){return d(this,void 0,void 0,function*(){if(t.type===""){let l=this.resolveRejects[i];return delete this.resolveRejects[i],l?void(t.error?l.reject(La(t.error)):l.resolve(La(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let r=La(t.data),n=new AbortController;this.abortControllers[i]=n;try{let l=yield this.messageHandlers[t.type](t.sourceMapId,r,n);this.completeTask(i,null,l)}catch(l){this.completeTask(i,l)}})}completeTask(i,t,r){let n=[];delete this.abortControllers[i];let l={id:i,type:"",sourceMapId:this.mapId,origin:location.origin,error:t?Da(t):null,data:Da(r,n)};this.target.postMessage(l,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},P.G=pa,P.H=function(){var i=new fs(16);return fs!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},P.I=Ec,P.J=function(i,t,r){var n,l,u,p,m,g,x,v,w,I,k,E,A=r[0],F=r[1],N=r[2];return t===i?(i[12]=t[0]*A+t[4]*F+t[8]*N+t[12],i[13]=t[1]*A+t[5]*F+t[9]*N+t[13],i[14]=t[2]*A+t[6]*F+t[10]*N+t[14],i[15]=t[3]*A+t[7]*F+t[11]*N+t[15]):(l=t[1],u=t[2],p=t[3],m=t[4],g=t[5],x=t[6],v=t[7],w=t[8],I=t[9],k=t[10],E=t[11],i[0]=n=t[0],i[1]=l,i[2]=u,i[3]=p,i[4]=m,i[5]=g,i[6]=x,i[7]=v,i[8]=w,i[9]=I,i[10]=k,i[11]=E,i[12]=n*A+m*F+w*N+t[12],i[13]=l*A+g*F+I*N+t[13],i[14]=u*A+x*F+k*N+t[14],i[15]=p*A+v*F+E*N+t[15]),i},P.K=function(i,t,r){var n=r[0],l=r[1],u=r[2];return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*l,i[5]=t[5]*l,i[6]=t[6]*l,i[7]=t[7]*l,i[8]=t[8]*u,i[9]=t[9]*u,i[10]=t[10]*u,i[11]=t[11]*u,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i},P.L=fh,P.M=function(i,t){let r={};for(let n=0;n{let t=window.document.createElement("video");return t.muted=!0,new Promise(r=>{t.onloadstart=()=>{r(t)};for(let n of i){let l=window.document.createElement("source");Zr(n)||(t.crossOrigin="Anonymous"),l.src=n,t.appendChild(l)}})},P.a4=function(){return kn++},P.a5=be,P.a6=bs,P.a7=Xs,P.a8=Sn,P.a9=_u,P.aA=function(i){if(i.type==="custom")return new _d(i);switch(i.type){case"background":return new md(i);case"circle":return new tp(i);case"fill":return new yp(i);case"fill-extrusion":return new Dp(i);case"heatmap":return new rp(i);case"hillshade":return new np(i);case"line":return new Np(i);case"raster":return new gd(i);case"symbol":return new zl(i)}},P.aB=ot,P.aC=function(i,t){if(!i)return[{command:"setStyle",args:[t]}];let r=[];try{if(!it(i.version,t.version))return[{command:"setStyle",args:[t]}];it(i.center,t.center)||r.push({command:"setCenter",args:[t.center]}),it(i.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),it(i.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),it(i.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),it(i.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),it(i.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),it(i.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),it(i.light,t.light)||r.push({command:"setLight",args:[t.light]}),it(i.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),it(i.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),it(i.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});let n={},l=[];(function(p,m,g,x){let v;for(v in m=m||{},p=p||{})Object.prototype.hasOwnProperty.call(p,v)&&(Object.prototype.hasOwnProperty.call(m,v)||Pr(v,g,x));for(v in m)Object.prototype.hasOwnProperty.call(m,v)&&(Object.prototype.hasOwnProperty.call(p,v)?it(p[v],m[v])||(p[v].type==="geojson"&&m[v].type==="geojson"&&ma(p,m,v)?Mt(g,{command:"setGeoJSONSourceData",args:[v,m[v].data]}):wr(v,m,g,x)):Ya(v,m,g))})(i.sources,t.sources,l,n);let u=[];i.layers&&i.layers.forEach(p=>{"source"in p&&n[p.source]?r.push({command:"removeLayer",args:[p.id]}):u.push(p)}),r=r.concat(l),function(p,m,g){m=m||[];let x=(p=p||[]).map(Qa),v=m.map(Qa),w=p.reduce(en,{}),I=m.reduce(en,{}),k=x.slice(),E=Object.create(null),A,F,N,Q,G;for(let J=0,ae=0;J@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,n,l,u)=>{let p=l||u;return t[n]=!p||p.toLowerCase(),""}),t["max-age"]){let r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t},P.ab=function(i,t){let r=[];for(let n in i)n in t||r.push(n);return r},P.ac=di,P.ad=function(i,t,r){var n=Math.sin(r),l=Math.cos(r),u=t[0],p=t[1],m=t[2],g=t[3],x=t[4],v=t[5],w=t[6],I=t[7];return t!==i&&(i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[0]=u*l+x*n,i[1]=p*l+v*n,i[2]=m*l+w*n,i[3]=g*l+I*n,i[4]=x*l-u*n,i[5]=v*l-p*n,i[6]=w*l-m*n,i[7]=I*l-g*n,i},P.ae=function(i){var t=new fs(16);return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t},P.af=vl,P.ag=function(i,t){let r=0,n=0;if(i.kind==="constant")n=i.layoutSize;else if(i.kind!=="source"){let{interpolationType:l,minZoom:u,maxZoom:p}=i,m=l?di(_i.interpolationFactor(l,t,u,p),0,1):0;i.kind==="camera"?n=gi.number(i.minSize,i.maxSize,m):r=m}return{uSizeT:r,uSize:n}},P.ai=function(i,{uSize:t,uSizeT:r},{lowerSize:n,upperSize:l}){return i.kind==="source"?n/Vr:i.kind==="composite"?gi.number(n/Vr,l/Vr,r):t},P.aj=Lc,P.ak=function(i,t,r,n){let l=t.y-i.y,u=t.x-i.x,p=n.y-r.y,m=n.x-r.x,g=p*u-m*l;if(g===0)return null;let x=(m*(i.y-r.y)-p*(i.x-r.x))/g;return new se(i.x+x*u,i.y+x*l)},P.al=bu,P.am=ch,P.an=fc,P.ao=function(i){let t=1/0,r=1/0,n=-1/0,l=-1/0;for(let u of i)t=Math.min(t,u.x),r=Math.min(r,u.y),n=Math.max(n,u.x),l=Math.max(l,u.y);return[t,r,n,l]},P.ap=jt,P.ar=Dc,P.as=function(i,t){var r=t[0],n=t[1],l=t[2],u=t[3],p=t[4],m=t[5],g=t[6],x=t[7],v=t[8],w=t[9],I=t[10],k=t[11],E=t[12],A=t[13],F=t[14],N=t[15],Q=r*m-n*p,G=r*g-l*p,J=r*x-u*p,ae=n*g-l*m,he=n*x-u*m,we=l*x-u*g,Re=v*A-w*E,ve=v*F-I*E,ye=v*N-k*E,Ee=w*F-I*A,Ce=w*N-k*A,Se=I*N-k*F,oe=Q*Se-G*Ce+J*Ee+ae*ye-he*ve+we*Re;return oe?(i[0]=(m*Se-g*Ce+x*Ee)*(oe=1/oe),i[1]=(l*Ce-n*Se-u*Ee)*oe,i[2]=(A*we-F*he+N*ae)*oe,i[3]=(I*he-w*we-k*ae)*oe,i[4]=(g*ye-p*Se-x*ve)*oe,i[5]=(r*Se-l*ye+u*ve)*oe,i[6]=(F*J-E*we-N*G)*oe,i[7]=(v*we-I*J+k*G)*oe,i[8]=(p*Ce-m*ye+x*Re)*oe,i[9]=(n*ye-r*Ce-u*Re)*oe,i[10]=(E*he-A*J+N*Q)*oe,i[11]=(w*J-v*he-k*Q)*oe,i[12]=(m*ve-p*Ee-g*Re)*oe,i[13]=(r*Ee-n*ve+l*Re)*oe,i[14]=(A*G-E*ae-F*Q)*oe,i[15]=(v*ae-w*G+I*Q)*oe,i):null},P.at=jc,P.au=Pc,P.av=Uc,P.aw=function(){let i={},t=re.$version;for(let r in re.$root){let n=re.$root[r];if(n.required){let l=null;l=r==="version"?t:n.type==="array"?[]:{},l!=null&&(i[r]=l)}}return i},P.ax=lo,P.ay=Zi,P.az=function(i){i=i.slice();let t=Object.create(null);for(let r=0;r25||n<0||n>=1||r<0||r>=1)},P.bc=function(i,t){return i[0]=t[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},P.bd=class extends b{},P.be=Oc,P.bf=Md,P.bh=Si,P.bi=function(i,t){zr.REGISTERED_PROTOCOLS[i]=t},P.bj=function(i){delete zr.REGISTERED_PROTOCOLS[i]},P.bk=function(i,t){let r={};for(let l=0;lSe*jt)}let ve=p?"center":r.get("text-justify").evaluate(x,{},i.canonical),ye=r.get("symbol-placement")==="point"?r.get("text-max-width").evaluate(x,{},i.canonical)*jt:1/0,Ee=()=>{i.bucket.allowVerticalPlacement&&co(J)&&(E.vertical=Cl(A,i.glyphMap,i.glyphPositions,i.imagePositions,v,ye,u,we,"left",he,N,P.ah.vertical,!0,I,w))};if(!p&&Re){let Ce=new Set;if(ve==="auto")for(let oe=0;oed(void 0,void 0,void 0,function*(){if(i.byteLength===0)return createImageBitmap(new ImageData(1,1));let t=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(t)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),P.e=Di,P.f=i=>new Promise((t,r)=>{let n=new Image;n.onload=()=>{t(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame(()=>{n.src=En})},n.onerror=()=>r(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."));let l=new Blob([new Uint8Array(i)],{type:"image/png"});n.src=i.byteLength?URL.createObjectURL(l):En}),P.g=lr,P.h=(i,t)=>$r(Di(i,{type:"json"}),t),P.i=xr,P.j=Ar,P.k=Er,P.l=(i,t)=>$r(Di(i,{type:"arrayBuffer"}),t),P.m=$r,P.n=function(i){return new kc(i).readFields(id,[])},P.o=xo,P.p=Xh,P.q=h,P.r=ic,P.s=Zr,P.t=so,P.u=aa,P.v=re,P.w=Kt,P.x=function([i,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(t)*Math.sin(r),y:i*Math.sin(t)*Math.sin(r),z:i*Math.cos(r)}},P.y=gi,P.z=_t}),Et("worker",["./shared"],function(P){"use strict";class d{constructor(M){this.keyCache={},M&&this.replace(M)}replace(M){this._layerConfigs={},this._layers={},this.update(M,[])}update(M,C){for(let O of M){this._layerConfigs[O.id]=O;let H=this._layers[O.id]=P.aA(O);H._featureFilter=P.a7(H.filter),this.keyCache[O.id]&&delete this.keyCache[O.id]}for(let O of C)delete this.keyCache[O],delete this._layerConfigs[O],delete this._layers[O];this.familiesBySource={};let L=P.bk(Object.values(this._layerConfigs),this.keyCache);for(let O of L){let H=O.map(ie=>this._layers[ie.id]),W=H[0];if(W.visibility==="none")continue;let Y=W.source||"",$=this.familiesBySource[Y];$||($=this.familiesBySource[Y]={});let ne=W.sourceLayer||"_geojsonTileLayer",ce=$[ne];ce||(ce=$[ne]=[]),ce.push(H)}}}class qt{constructor(M){let C={},L=[];for(let Y in M){let $=M[Y],ne=C[Y]={};for(let ce in $){let ie=$[+ce];if(!ie||ie.bitmap.width===0||ie.bitmap.height===0)continue;let de={x:0,y:0,w:ie.bitmap.width+2,h:ie.bitmap.height+2};L.push(de),ne[ce]={rect:de,metrics:ie.metrics}}}let{w:O,h:H}=P.p(L),W=new P.o({width:O||1,height:H||1});for(let Y in M){let $=M[Y];for(let ne in $){let ce=$[+ne];if(!ce||ce.bitmap.width===0||ce.bitmap.height===0)continue;let ie=C[Y][ne].rect;P.o.copy(ce.bitmap,W,{x:0,y:0},{x:ie.x+1,y:ie.y+1},ce.bitmap)}}this.image=W,this.positions=C}}P.bl("GlyphAtlas",qt);class gt{constructor(M){this.tileID=new P.S(M.tileID.overscaledZ,M.tileID.wrap,M.tileID.canonical.z,M.tileID.canonical.x,M.tileID.canonical.y),this.uid=M.uid,this.zoom=M.zoom,this.pixelRatio=M.pixelRatio,this.tileSize=M.tileSize,this.source=M.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=M.showCollisionBoxes,this.collectResourceTiming=!!M.collectResourceTiming,this.returnDependencies=!!M.returnDependencies,this.promoteId=M.promoteId,this.inFlightDependencies=[]}parse(M,C,L,O){return P._(this,void 0,void 0,function*(){this.status="parsing",this.data=M,this.collisionBoxArray=new P.a5;let H=new P.bm(Object.keys(M.layers).sort()),W=new P.bn(this.tileID,this.promoteId);W.bucketLayerIDs=[];let Y={},$={featureIndex:W,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:L},ne=C.familiesBySource[this.source];for(let Ze in ne){let nt=M.layers[Ze];if(!nt)continue;nt.version===1&&P.w(`Vector tile source "${this.source}" layer "${Ze}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let St=H.encode(Ze),Ut=[];for(let Ht=0;Ht=li.maxzoom||li.visibility!=="none"&&(De(Ht,this.zoom,L),(Y[li.id]=li.createBucket({index:W.bucketLayerIDs.length,layers:Ht,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:St,sourceID:this.source})).populate(Ut,$,this.tileID.canonical),W.bucketLayerIDs.push(Ht.map(fa=>fa.id)))}}let ce=P.aF($.glyphDependencies,Ze=>Object.keys(Ze).map(Number));this.inFlightDependencies.forEach(Ze=>Ze?.abort()),this.inFlightDependencies=[];let ie=Promise.resolve({});if(Object.keys(ce).length){let Ze=new AbortController;this.inFlightDependencies.push(Ze),ie=O.sendAsync({type:"GG",data:{stacks:ce,source:this.source,tileID:this.tileID,type:"glyphs"}},Ze)}let de=Object.keys($.iconDependencies),Pe=Promise.resolve({});if(de.length){let Ze=new AbortController;this.inFlightDependencies.push(Ze),Pe=O.sendAsync({type:"GI",data:{icons:de,source:this.source,tileID:this.tileID,type:"icons"}},Ze)}let Le=Object.keys($.patternDependencies),Je=Promise.resolve({});if(Le.length){let Ze=new AbortController;this.inFlightDependencies.push(Ze),Je=O.sendAsync({type:"GI",data:{icons:Le,source:this.source,tileID:this.tileID,type:"patterns"}},Ze)}let[je,Ye,He]=yield Promise.all([ie,Pe,Je]),Ft=new qt(je),kt=new P.bo(Ye,He);for(let Ze in Y){let nt=Y[Ze];nt instanceof P.a6?(De(nt.layers,this.zoom,L),P.bp({bucket:nt,glyphMap:je,glyphPositions:Ft.positions,imageMap:Ye,imagePositions:kt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):nt.hasPattern&&(nt instanceof P.bq||nt instanceof P.br||nt instanceof P.bs)&&(De(nt.layers,this.zoom,L),nt.addFeatures($,this.tileID.canonical,kt.patternPositions))}return this.status="done",{buckets:Object.values(Y).filter(Ze=>!Ze.isEmpty()),featureIndex:W,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ft.image,imageAtlas:kt,glyphMap:this.returnDependencies?je:null,iconMap:this.returnDependencies?Ye:null,glyphPositions:this.returnDependencies?Ft.positions:null}})}}function De(q,M,C){let L=new P.z(M);for(let O of q)O.recalculate(L,C)}class se{constructor(M,C,L){this.actor=M,this.layerIndex=C,this.availableImages=L,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(M,C){return P._(this,void 0,void 0,function*(){let L=yield P.l(M.request,C);try{return{vectorTile:new P.bt.VectorTile(new P.bu(L.data)),rawData:L.data,cacheControl:L.cacheControl,expires:L.expires}}catch(O){let H=new Uint8Array(L.data),W=`Unable to parse the tile at ${M.request.url}, `;throw W+=H[0]===31&&H[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${O.message}`,new Error(W)}})}loadTile(M){return P._(this,void 0,void 0,function*(){let C=M.uid,L=!!(M&&M.request&&M.request.collectResourceTiming)&&new P.bv(M.request),O=new gt(M);this.loading[C]=O;let H=new AbortController;O.abort=H;try{let W=yield this.loadVectorTile(M,H);if(delete this.loading[C],!W)return null;let Y=W.rawData,$={};W.expires&&($.expires=W.expires),W.cacheControl&&($.cacheControl=W.cacheControl);let ne={};if(L){let ie=L.finish();ie&&(ne.resourceTiming=JSON.parse(JSON.stringify(ie)))}O.vectorTile=W.vectorTile;let ce=O.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[C]=O,this.fetching[C]={rawTileData:Y,cacheControl:$,resourceTiming:ne};try{let ie=yield ce;return P.e({rawTileData:Y.slice(0)},ie,$,ne)}finally{delete this.fetching[C]}}catch(W){throw delete this.loading[C],O.status="done",this.loaded[C]=O,W}})}reloadTile(M){return P._(this,void 0,void 0,function*(){let C=M.uid;if(!this.loaded||!this.loaded[C])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let L=this.loaded[C];if(L.showCollisionBoxes=M.showCollisionBoxes,L.status==="parsing"){let O=yield L.parse(L.vectorTile,this.layerIndex,this.availableImages,this.actor),H;if(this.fetching[C]){let{rawTileData:W,cacheControl:Y,resourceTiming:$}=this.fetching[C];delete this.fetching[C],H=P.e({rawTileData:W.slice(0)},O,Y,$)}else H=O;return H}if(L.status==="done"&&L.vectorTile)return L.parse(L.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(M){return P._(this,void 0,void 0,function*(){let C=this.loading,L=M.uid;C&&C[L]&&C[L].abort&&(C[L].abort.abort(),delete C[L])})}removeTile(M){return P._(this,void 0,void 0,function*(){this.loaded&&this.loaded[M.uid]&&delete this.loaded[M.uid]})}}class te{constructor(){this.loaded={}}loadTile(M){return P._(this,void 0,void 0,function*(){let{uid:C,encoding:L,rawImageData:O,redFactor:H,greenFactor:W,blueFactor:Y,baseShift:$}=M,ne=O.width+2,ce=O.height+2,ie=P.b(O)?new P.R({width:ne,height:ce},yield P.bw(O,-1,-1,ne,ce)):O,de=new P.bx(C,ie,L,H,W,Y,$);return this.loaded=this.loaded||{},this.loaded[C]=de,de})}removeTile(M){let C=this.loaded,L=M.uid;C&&C[L]&&delete C[L]}}function Tt(q,M){if(q.length!==0){Nt(q[0],M);for(var C=1;C=Math.abs(Y)?C-$+Y:Y-$+C,C=$}C+L>=0!=!!M&&q.reverse()}var Lt=P.by(function q(M,C){var L,O=M&&M.type;if(O==="FeatureCollection")for(L=0;L>31}function xr(q,M){for(var C=q.loadGeometry(),L=q.type,O=0,H=0,W=C.length,Y=0;Yq},Ur=Math.fround||(vr=new Float32Array(1),q=>(vr[0]=+q,vr[0]));var vr;let mi=3,$i=5,ua=6;class zr{constructor(M){this.options=Object.assign(Object.create(En),M),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(M){let{log:C,minZoom:L,maxZoom:O}=this.options;C&&console.time("total time");let H=`prepare ${M.length} points`;C&&console.time(H),this.points=M;let W=[];for(let $=0;$=L;$--){let ne=+Date.now();Y=this.trees[$]=this._createTree(this._cluster(Y,$)),C&&console.log("z%d: %d clusters in %dms",$,Y.numItems,+Date.now()-ne)}return C&&console.timeEnd("total time"),this}getClusters(M,C){let L=((M[0]+180)%360+360)%360-180,O=Math.max(-90,Math.min(90,M[1])),H=M[2]===180?180:((M[2]+180)%360+360)%360-180,W=Math.max(-90,Math.min(90,M[3]));if(M[2]-M[0]>=360)L=-180,H=180;else if(L>H){let ie=this.getClusters([L,O,180,W],C),de=this.getClusters([-180,O,H,W],C);return ie.concat(de)}let Y=this.trees[this._limitZoom(C)],$=Y.range(Si(L),Zi(W),Si(H),Zi(O)),ne=Y.data,ce=[];for(let ie of $){let de=this.stride*ie;ce.push(ne[de+$i]>1?lr(ne,de,this.clusterProps):this.points[ne[de+mi]])}return ce}getChildren(M){let C=this._getOriginId(M),L=this._getOriginZoom(M),O="No cluster with the specified id.",H=this.trees[L];if(!H)throw new Error(O);let W=H.data;if(C*this.stride>=W.length)throw new Error(O);let Y=this.options.radius/(this.options.extent*Math.pow(2,L-1)),$=H.within(W[C*this.stride],W[C*this.stride+1],Y),ne=[];for(let ce of $){let ie=ce*this.stride;W[ie+4]===M&&ne.push(W[ie+$i]>1?lr(W,ie,this.clusterProps):this.points[W[ie+mi]])}if(ne.length===0)throw new Error(O);return ne}getLeaves(M,C,L){let O=[];return this._appendLeaves(O,M,C=C||10,L=L||0,0),O}getTile(M,C,L){let O=this.trees[this._limitZoom(M)],H=Math.pow(2,M),{extent:W,radius:Y}=this.options,$=Y/W,ne=(L-$)/H,ce=(L+1+$)/H,ie={features:[]};return this._addTileFeatures(O.range((C-$)/H,ne,(C+1+$)/H,ce),O.data,C,L,H,ie),C===0&&this._addTileFeatures(O.range(1-$/H,ne,1,ce),O.data,H,L,H,ie),C===H-1&&this._addTileFeatures(O.range(0,ne,$/H,ce),O.data,-1,L,H,ie),ie.features.length?ie:null}getClusterExpansionZoom(M){let C=this._getOriginZoom(M)-1;for(;C<=this.options.maxZoom;){let L=this.getChildren(M);if(C++,L.length!==1)break;M=L[0].properties.cluster_id}return C}_appendLeaves(M,C,L,O,H){let W=this.getChildren(C);for(let Y of W){let $=Y.properties;if($&&$.cluster?H+$.point_count<=O?H+=$.point_count:H=this._appendLeaves(M,$.cluster_id,L,O,H):H1,ce,ie,de;if(ne)ce=pa(C,$,this.clusterProps),ie=C[$],de=C[$+1];else{let Je=this.points[C[$+mi]];ce=Je.properties;let[je,Ye]=Je.geometry.coordinates;ie=Si(je),de=Zi(Ye)}let Pe={type:1,geometry:[[Math.round(this.options.extent*(ie*H-L)),Math.round(this.options.extent*(de*H-O))]],tags:ce},Le;Le=ne||this.options.generateId?C[$+mi]:this.points[C[$+mi]].id,Le!==void 0&&(Pe.id=Le),W.features.push(Pe)}}_limitZoom(M){return Math.max(this.options.minZoom,Math.min(Math.floor(+M),this.options.maxZoom+1))}_cluster(M,C){let{radius:L,extent:O,reduce:H,minPoints:W}=this.options,Y=L/(O*Math.pow(2,C)),$=M.data,ne=[],ce=this.stride;for(let ie=0;ie<$.length;ie+=ce){if($[ie+2]<=C)continue;$[ie+2]=C;let de=$[ie],Pe=$[ie+1],Le=M.within($[ie],$[ie+1],Y),Je=$[ie+$i],je=Je;for(let Ye of Le){let He=Ye*ce;$[He+2]>C&&(je+=$[He+$i])}if(je>Je&&je>=W){let Ye,He=de*Je,Ft=Pe*Je,kt=-1,Ze=((ie/ce|0)<<5)+(C+1)+this.points.length;for(let nt of Le){let St=nt*ce;if($[St+2]<=C)continue;$[St+2]=C;let Ut=$[St+$i];He+=$[St]*Ut,Ft+=$[St+1]*Ut,$[St+4]=Ze,H&&(Ye||(Ye=this._map($,ie,!0),kt=this.clusterProps.length,this.clusterProps.push(Ye)),H(Ye,this._map($,St)))}$[ie+4]=Ze,ne.push(He/je,Ft/je,1/0,Ze,-1,je),H&&ne.push(kt)}else{for(let Ye=0;Ye1)for(let Ye of Le){let He=Ye*ce;if(!($[He+2]<=C)){$[He+2]=C;for(let Ft=0;Ft>5}_getOriginZoom(M){return(M-this.points.length)%32}_map(M,C,L){if(M[C+$i]>1){let W=this.clusterProps[M[C+ua]];return L?Object.assign({},W):W}let O=this.points[M[C+mi]].properties,H=this.options.map(O);return L&&H===O?Object.assign({},H):H}}function lr(q,M,C){return{type:"Feature",id:q[M+mi],properties:pa(q,M,C),geometry:{type:"Point",coordinates:[(L=q[M],360*(L-.5)),$r(q[M+1])]}};var L}function pa(q,M,C){let L=q[M+$i],O=L>=1e4?`${Math.round(L/1e3)}k`:L>=1e3?Math.round(L/100)/10+"k":L,H=q[M+ua],W=H===-1?{}:Object.assign({},C[H]);return Object.assign(W,{cluster:!0,cluster_id:q[M+mi],point_count:L,point_count_abbreviated:O})}function Si(q){return q/360+.5}function Zi(q){let M=Math.sin(q*Math.PI/180),C=.5-.25*Math.log((1+M)/(1-M))/Math.PI;return C<0?0:C>1?1:C}function $r(q){let M=(180-360*q)*Math.PI/180;return 360*Math.atan(Math.exp(M))/Math.PI-90}function Zr(q,M,C,L){let O=L,H=M+(C-M>>1),W,Y=C-M,$=q[M],ne=q[M+1],ce=q[C],ie=q[C+1];for(let de=M+3;deO)W=de,O=Pe;else if(Pe===O){let Le=Math.abs(de-H);LeL&&(W-M>3&&Zr(q,M,W,L),q[W+2]=O,C-W>3&&Zr(q,W,C,L))}function Ka(q,M,C,L,O,H){let W=O-C,Y=H-L;if(W!==0||Y!==0){let $=((q-C)*W+(M-L)*Y)/(W*W+Y*Y);$>1?(C=O,L=H):$>0&&(C+=W*$,L+=Y*$)}return W=q-C,Y=M-L,W*W+Y*Y}function br(q,M,C,L){let O={id:q??null,type:M,geometry:C,tags:L,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(M==="Point"||M==="MultiPoint"||M==="LineString")Er(O,C);else if(M==="Polygon")Er(O,C[0]);else if(M==="MultiLineString")for(let H of C)Er(O,H);else if(M==="MultiPolygon")for(let H of C)Er(O,H[0]);return O}function Er(q,M){for(let C=0;C0&&(W+=L?(O*ce-ne*H)/2:Math.sqrt(Math.pow(ne-O,2)+Math.pow(ce-H,2))),O=ne,H=ce}let Y=M.length-3;M[2]=1,Zr(M,0,Y,C),M[Y+2]=1,M.size=Math.abs(W),M.start=0,M.end=M.size}function Gr(q,M,C,L){for(let O=0;O1?1:C}function Mt(q,M,C,L,O,H,W,Y){if(L/=M,H>=(C/=M)&&W=L)return null;let $=[];for(let ne of q){let ce=ne.geometry,ie=ne.type,de=O===0?ne.minX:ne.minY,Pe=O===0?ne.maxX:ne.maxY;if(de>=C&&Pe=L)continue;let Le=[];if(ie==="Point"||ie==="MultiPoint")Ya(ce,Le,C,L,O);else if(ie==="LineString")Pr(ce,Le,C,L,O,!1,Y.lineMetrics);else if(ie==="MultiLineString")ma(ce,Le,C,L,O,!1);else if(ie==="Polygon")ma(ce,Le,C,L,O,!0);else if(ie==="MultiPolygon")for(let Je of ce){let je=[];ma(Je,je,C,L,O,!0),je.length&&Le.push(je)}if(Le.length){if(Y.lineMetrics&&ie==="LineString"){for(let Je of Le)$.push(br(ne.id,ie,Je,ne.tags));continue}ie!=="LineString"&&ie!=="MultiLineString"||(Le.length===1?(ie="LineString",Le=Le[0]):ie="MultiLineString"),ie!=="Point"&&ie!=="MultiPoint"||(ie=Le.length===3?"Point":"MultiPoint"),$.push(br(ne.id,ie,Le,ne.tags))}}return $.length?$:null}function Ya(q,M,C,L,O){for(let H=0;H=C&&W<=L&&Li(M,q[H],q[H+1],q[H+2])}}function Pr(q,M,C,L,O,H,W){let Y=wr(q),$=O===0?Qa:en,ne,ce,ie=q.start;for(let je=0;jeC&&(ce=$(Y,Ye,He,kt,Ze,C),W&&(Y.start=ie+ne*ce)):nt>L?St=C&&(ce=$(Y,Ye,He,kt,Ze,C),Ut=!0),St>L&&nt<=L&&(ce=$(Y,Ye,He,kt,Ze,L),Ut=!0),!H&&Ut&&(W&&(Y.end=ie+ne*ce),M.push(Y),Y=wr(q)),W&&(ie+=ne)}let de=q.length-3,Pe=q[de],Le=q[de+1],Je=O===0?Pe:Le;Je>=C&&Je<=L&&Li(Y,Pe,Le,q[de+2]),de=Y.length-3,H&&de>=3&&(Y[de]!==Y[0]||Y[de+1]!==Y[1])&&Li(Y,Y[0],Y[1],Y[2]),Y.length&&M.push(Y)}function wr(q){let M=[];return M.size=q.size,M.start=q.start,M.end=q.end,M}function ma(q,M,C,L,O,H){for(let W of q)Pr(W,M,C,L,O,H,!1)}function Li(q,M,C,L){q.push(M,C,L)}function Qa(q,M,C,L,O,H){let W=(H-M)/(L-M);return Li(q,H,C+(O-C)*W,1),W}function en(q,M,C,L,O,H){let W=(H-C)/(O-C);return Li(q,M+(L-M)*W,H,1),W}function pe(q,M){let C=[];for(let L=0;L0&&M.size<(O?W:L))return void(C.numPoints+=M.length/3);let Y=[];for(let $=0;$W)&&(C.numSimplified++,Y.push(M[$],M[$+1])),C.numPoints++;O&&function($,ne){let ce=0;for(let ie=0,de=$.length,Pe=de-2;ie0===ne)for(let ie=0,de=$.length;ie24)throw new Error("maxZoom should be in the 0-24 range");if(C.promoteId&&C.generateId)throw new Error("promoteId and generateId cannot be used together.");let O=function(H,W){let Y=[];if(H.type==="FeatureCollection")for(let $=0;$1&&console.time("creation"),Pe=this.tiles[de]=Dr(M,C,L,O,ne),this.tileCoords.push({z:C,x:L,y:O}),ce)){ce>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",C,L,O,Pe.numFeatures,Pe.numPoints,Pe.numSimplified),console.timeEnd("creation"));let Ut=`z${C}`;this.stats[Ut]=(this.stats[Ut]||0)+1,this.total++}if(Pe.source=M,H==null){if(C===ne.indexMaxZoom||Pe.numPoints<=ne.indexMaxPoints)continue}else{if(C===ne.maxZoom||C===H)continue;if(H!=null){let Ut=H-C;if(L!==W>>Ut||O!==Y>>Ut)continue}}if(Pe.source=null,M.length===0)continue;ce>1&&console.time("clipping");let Le=.5*ne.buffer/ne.extent,Je=.5-Le,je=.5+Le,Ye=1+Le,He=null,Ft=null,kt=null,Ze=null,nt=Mt(M,ie,L-Le,L+je,0,Pe.minX,Pe.maxX,ne),St=Mt(M,ie,L+Je,L+Ye,0,Pe.minX,Pe.maxX,ne);M=null,nt&&(He=Mt(nt,ie,O-Le,O+je,1,Pe.minY,Pe.maxY,ne),Ft=Mt(nt,ie,O+Je,O+Ye,1,Pe.minY,Pe.maxY,ne),nt=null),St&&(kt=Mt(St,ie,O-Le,O+je,1,Pe.minY,Pe.maxY,ne),Ze=Mt(St,ie,O+Je,O+Ye,1,Pe.minY,Pe.maxY,ne),St=null),ce>1&&console.timeEnd("clipping"),$.push(He||[],C+1,2*L,2*O),$.push(Ft||[],C+1,2*L,2*O+1),$.push(kt||[],C+1,2*L+1,2*O),$.push(Ze||[],C+1,2*L+1,2*O+1)}}getTile(M,C,L){M=+M,C=+C,L=+L;let O=this.options,{extent:H,debug:W}=O;if(M<0||M>24)return null;let Y=1<1&&console.log("drilling down to z%d-%d-%d",M,C,L);let ne,ce=M,ie=C,de=L;for(;!ne&&ce>0;)ce--,ie>>=1,de>>=1,ne=this.tiles[Gi(ce,ie,de)];return ne&&ne.source?(W>1&&(console.log("found parent tile z%d-%d-%d",ce,ie,de),console.time("drilling down")),this.splitTile(ne.source,ce,ie,de,M,C,L),W>1&&console.timeEnd("drilling down"),this.tiles[$]?oi(this.tiles[$],H):null):null}}function Gi(q,M,C){return 32*((1<{ie.properties=Pe;let Le={};for(let Je of de)Le[Je]=$[Je].evaluate(ce,ie);return Le},W.reduce=(Pe,Le)=>{ie.properties=Le;for(let Je of de)ce.accumulated=Pe[Je],Pe[Je]=ne[Je].evaluate(ce,ie)},W}(M)).load((yield this._pendingData).features):(O=yield this._pendingData,new fi(O,M.geojsonVtOptions)),this.loaded={};let H={};if(L){let W=L.finish();W&&(H.resourceTiming={},H.resourceTiming[M.source]=JSON.parse(JSON.stringify(W)))}return H}catch(H){if(delete this._pendingRequest,P.bB(H))return{abandoned:!0};throw H}var O})}getData(){return P._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(M){let C=this.loaded;return C&&C[M.uid]?super.reloadTile(M):this.loadTile(M)}loadAndProcessGeoJSON(M,C){return P._(this,void 0,void 0,function*(){let L=yield this.loadGeoJSON(M,C);if(delete this._pendingRequest,typeof L!="object")throw new Error(`Input data given to '${M.source}' is not a valid GeoJSON object.`);if(Lt(L,!0),M.filter){let O=P.bC(M.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(O.result==="error")throw new Error(O.value.map(W=>`${W.key}: ${W.message}`).join(", "));L={type:"FeatureCollection",features:L.features.filter(W=>O.value.evaluate({zoom:0},W))}}return L})}loadGeoJSON(M,C){return P._(this,void 0,void 0,function*(){let{promoteId:L}=M;if(M.request){let O=yield P.h(M.request,C);return this._dataUpdateable=ur(O.data,L)?Tr(O.data,L):void 0,O.data}if(typeof M.data=="string")try{let O=JSON.parse(M.data);return this._dataUpdateable=ur(O,L)?Tr(O,L):void 0,O}catch{throw new Error(`Input data given to '${M.source}' is not a valid GeoJSON object.`)}if(!M.dataDiff)throw new Error(`Input data given to '${M.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${M.source}`);return function(O,H,W){var Y,$,ne,ce;if(H.removeAll&&O.clear(),H.remove)for(let ie of H.remove)O.delete(ie);if(H.add)for(let ie of H.add){let de=Ne(ie,W);de!=null&&O.set(de,ie)}if(H.update)for(let ie of H.update){let de=O.get(ie.id);if(de==null)continue;let Pe=!ie.removeAllProperties&&(((Y=ie.removeProperties)===null||Y===void 0?void 0:Y.length)>0||(($=ie.addOrUpdateProperties)===null||$===void 0?void 0:$.length)>0);if((ie.newGeometry||ie.removeAllProperties||Pe)&&(de=Object.assign({},de),O.set(ie.id,de),Pe&&(de.properties=Object.assign({},de.properties))),ie.newGeometry&&(de.geometry=ie.newGeometry),ie.removeAllProperties)de.properties={};else if(((ne=ie.removeProperties)===null||ne===void 0?void 0:ne.length)>0)for(let Le of ie.removeProperties)Object.prototype.hasOwnProperty.call(de.properties,Le)&&delete de.properties[Le];if(((ce=ie.addOrUpdateProperties)===null||ce===void 0?void 0:ce.length)>0)for(let{key:Le,value:Je}of ie.addOrUpdateProperties)de.properties[Le]=Je}}(this._dataUpdateable,M.dataDiff,L),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(M){return P._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(M){return this._geoJSONIndex.getClusterExpansionZoom(M.clusterId)}getClusterChildren(M){return this._geoJSONIndex.getChildren(M.clusterId)}getClusterLeaves(M){return this._geoJSONIndex.getLeaves(M.clusterId,M.limit,M.offset)}}class pr{constructor(M){this.self=M,this.actor=new P.F(M),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(C,L)=>{if(this.externalWorkerSourceTypes[C])throw new Error(`Worker source with name "${C}" already registered.`);this.externalWorkerSourceTypes[C]=L},this.self.addProtocol=P.bi,this.self.removeProtocol=P.bj,this.self.registerRTLTextPlugin=C=>{if(P.bD.isParsed())throw new Error("RTL text plugin already registered.");P.bD.setMethods(C)},this.actor.registerMessageHandler("LDT",(C,L)=>this._getDEMWorkerSource(C,L.source).loadTile(L)),this.actor.registerMessageHandler("RDT",(C,L)=>P._(this,void 0,void 0,function*(){this._getDEMWorkerSource(C,L.source).removeTile(L)})),this.actor.registerMessageHandler("GCEZ",(C,L)=>P._(this,void 0,void 0,function*(){return this._getWorkerSource(C,L.type,L.source).getClusterExpansionZoom(L)})),this.actor.registerMessageHandler("GCC",(C,L)=>P._(this,void 0,void 0,function*(){return this._getWorkerSource(C,L.type,L.source).getClusterChildren(L)})),this.actor.registerMessageHandler("GCL",(C,L)=>P._(this,void 0,void 0,function*(){return this._getWorkerSource(C,L.type,L.source).getClusterLeaves(L)})),this.actor.registerMessageHandler("LD",(C,L)=>this._getWorkerSource(C,L.type,L.source).loadData(L)),this.actor.registerMessageHandler("GD",(C,L)=>this._getWorkerSource(C,L.type,L.source).getData()),this.actor.registerMessageHandler("LT",(C,L)=>this._getWorkerSource(C,L.type,L.source).loadTile(L)),this.actor.registerMessageHandler("RT",(C,L)=>this._getWorkerSource(C,L.type,L.source).reloadTile(L)),this.actor.registerMessageHandler("AT",(C,L)=>this._getWorkerSource(C,L.type,L.source).abortTile(L)),this.actor.registerMessageHandler("RMT",(C,L)=>this._getWorkerSource(C,L.type,L.source).removeTile(L)),this.actor.registerMessageHandler("RS",(C,L)=>P._(this,void 0,void 0,function*(){if(!this.workerSources[C]||!this.workerSources[C][L.type]||!this.workerSources[C][L.type][L.source])return;let O=this.workerSources[C][L.type][L.source];delete this.workerSources[C][L.type][L.source],O.removeSource!==void 0&&O.removeSource(L)})),this.actor.registerMessageHandler("RM",C=>P._(this,void 0,void 0,function*(){delete this.layerIndexes[C],delete this.availableImages[C],delete this.workerSources[C],delete this.demWorkerSources[C]})),this.actor.registerMessageHandler("SR",(C,L)=>P._(this,void 0,void 0,function*(){this.referrer=L})),this.actor.registerMessageHandler("SRPS",(C,L)=>this._syncRTLPluginState(C,L)),this.actor.registerMessageHandler("IS",(C,L)=>P._(this,void 0,void 0,function*(){this.self.importScripts(L)})),this.actor.registerMessageHandler("SI",(C,L)=>this._setImages(C,L)),this.actor.registerMessageHandler("UL",(C,L)=>P._(this,void 0,void 0,function*(){this._getLayerIndex(C).update(L.layers,L.removedIds)})),this.actor.registerMessageHandler("SL",(C,L)=>P._(this,void 0,void 0,function*(){this._getLayerIndex(C).replace(L)}))}_setImages(M,C){return P._(this,void 0,void 0,function*(){this.availableImages[M]=C;for(let L in this.workerSources[M]){let O=this.workerSources[M][L];for(let H in O)O[H].availableImages=C}})}_syncRTLPluginState(M,C){return P._(this,void 0,void 0,function*(){if(P.bD.isParsed())return P.bD.getState();if(C.pluginStatus!=="loading")return P.bD.setState(C),C;let L=C.pluginURL;if(this.self.importScripts(L),P.bD.isParsed()){let O={pluginStatus:"loaded",pluginURL:L};return P.bD.setState(O),O}throw P.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${L}`)})}_getAvailableImages(M){let C=this.availableImages[M];return C||(C=[]),C}_getLayerIndex(M){let C=this.layerIndexes[M];return C||(C=this.layerIndexes[M]=new d),C}_getWorkerSource(M,C,L){if(this.workerSources[M]||(this.workerSources[M]={}),this.workerSources[M][C]||(this.workerSources[M][C]={}),!this.workerSources[M][C][L]){let O={sendAsync:(H,W)=>(H.targetMapId=M,this.actor.sendAsync(H,W))};switch(C){case"vector":this.workerSources[M][C][L]=new se(O,this._getLayerIndex(M),this._getAvailableImages(M));break;case"geojson":this.workerSources[M][C][L]=new Lr(O,this._getLayerIndex(M),this._getAvailableImages(M));break;default:this.workerSources[M][C][L]=new this.externalWorkerSourceTypes[C](O,this._getLayerIndex(M),this._getAvailableImages(M))}}return this.workerSources[M][C][L]}_getDEMWorkerSource(M,C){return this.demWorkerSources[M]||(this.demWorkerSources[M]={}),this.demWorkerSources[M][C]||(this.demWorkerSources[M][C]=new te),this.demWorkerSources[M][C]}}return P.i(self)&&(self.worker=new pr(self)),pr}),Et("index",["exports","./shared"],function(P,d){"use strict";var qt="4.7.1";let gt,De,se={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:h=>new Promise((e,a)=>{let s=requestAnimationFrame(e);h.signal.addEventListener("abort",()=>{cancelAnimationFrame(s),a(d.c())})}),getImageData(h,e=0){return this.getImageCanvasContext(h).getImageData(-e,-e,h.width+2*e,h.height+2*e)},getImageCanvasContext(h){let e=window.document.createElement("canvas"),a=e.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return e.width=h.width,e.height=h.height,a.drawImage(h,0,0,h.width,h.height),a},resolveURL:h=>(gt||(gt=document.createElement("a")),gt.href=h,gt.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(De==null&&(De=matchMedia("(prefers-reduced-motion: reduce)")),De.matches)}};class te{static testProp(e){if(!te.docStyle)return e[0];for(let a=0;a{window.removeEventListener("click",te.suppressClickInternal,!0)},0)}static getScale(e){let a=e.getBoundingClientRect();return{x:a.width/e.offsetWidth||1,y:a.height/e.offsetHeight||1,boundingClientRect:a}}static getPoint(e,a,s){let o=a.boundingClientRect;return new d.P((s.clientX-o.left)/a.x-e.clientLeft,(s.clientY-o.top)/a.y-e.clientTop)}static mousePos(e,a){let s=te.getScale(e);return te.getPoint(e,s,a)}static touchPos(e,a){let s=[],o=te.getScale(e);for(let c=0;c{Nt&&Ct(Nt),Nt=null,pt=!0},Lt.onerror=()=>{It=!0,Nt=null},Lt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(h){let e,a,s,o;h.resetRequestQueue=()=>{e=[],a=0,s=0,o={}},h.addThrottleControl=y=>{let b=s++;return o[b]=y,b},h.removeThrottleControl=y=>{delete o[y],f()},h.getImage=(y,b,T=!0)=>new Promise((S,z)=>{Tt.supported&&(y.headers||(y.headers={}),y.headers.accept="image/webp,*/*"),d.e(y,{type:"image"}),e.push({abortController:b,requestParameters:y,supportImageRefresh:T,state:"queued",onError:D=>{z(D)},onSuccess:D=>{S(D)}}),f()});let c=y=>d._(this,void 0,void 0,function*(){y.state="running";let{requestParameters:b,supportImageRefresh:T,onError:S,onSuccess:z,abortController:D}=y,R=T===!1&&!d.i(self)&&!d.g(b.url)&&(!b.headers||Object.keys(b.headers).reduce((U,Z)=>U&&Z==="accept",!0));a++;let V=R?_(b,D):d.m(b,D);try{let U=yield V;delete y.abortController,y.state="completed",U.data instanceof HTMLImageElement||d.b(U.data)?z(U):U.data&&z({data:yield(j=U.data,typeof createImageBitmap=="function"?d.d(j):d.f(j)),cacheControl:U.cacheControl,expires:U.expires})}catch(U){delete y.abortController,S(U)}finally{a--,f()}var j}),f=()=>{let y=(()=>{for(let b of Object.keys(o))if(o[b]())return!0;return!1})()?d.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:d.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let b=a;b0;b++){let T=e.shift();T.abortController.signal.aborted?b--:c(T)}},_=(y,b)=>new Promise((T,S)=>{let z=new Image,D=y.url,R=y.credentials;R&&R==="include"?z.crossOrigin="use-credentials":(R&&R==="same-origin"||!d.s(D))&&(z.crossOrigin="anonymous"),b.signal.addEventListener("abort",()=>{z.src="",S(d.c())}),z.fetchPriority="high",z.onload=()=>{z.onerror=z.onload=null,T({data:z})},z.onerror=()=>{z.onerror=z.onload=null,b.signal.aborted||S(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."))},z.src=D})}(dt||(dt={})),dt.resetRequestQueue();class Ui{constructor(e){this._transformRequestFn=e}transformRequest(e,a){return this._transformRequestFn&&this._transformRequestFn(e,a)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function di(h){var e=new d.A(3);return e[0]=h[0],e[1]=h[1],e[2]=h[2],e}var nr,Di=function(h,e,a){return h[0]=e[0]-a[0],h[1]=e[1]-a[1],h[2]=e[2]-a[2],h};nr=new d.A(3),d.A!=Float32Array&&(nr[0]=0,nr[1]=0,nr[2]=0);var kn=function(h){var e=h[0],a=h[1];return e*e+a*a};function sr(h){let e=[];if(typeof h=="string")e.push({id:"default",url:h});else if(h&&h.length>0){let a=[];for(let{id:s,url:o}of h){let c=`${s}${o}`;a.indexOf(c)===-1&&(a.push(c),e.push({id:s,url:o}))}}return e}function Wa(h,e,a){let s=h.split("?");return s[0]+=`${e}${a}`,s.join("?")}(function(){var h=new d.A(2);d.A!=Float32Array&&(h[0]=0,h[1]=0)})();class ot{constructor(e,a,s,o){this.context=e,this.format=s,this.texture=e.gl.createTexture(),this.update(a,o)}update(e,a,s){let{width:o,height:c}=e,f=!(this.size&&this.size[0]===o&&this.size[1]===c||s),{context:_}=this,{gl:y}=_;if(this.useMipmap=!!(a&&a.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),_.pixelStoreUnpackFlipY.set(!1),_.pixelStoreUnpack.set(1),_.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!a||a.premultiply!==!1)),f)this.size=[o,c],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||d.b(e)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,e):y.texImage2D(y.TEXTURE_2D,0,this.format,o,c,0,this.format,y.UNSIGNED_BYTE,e.data);else{let{x:b,y:T}=s||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||d.b(e)?y.texSubImage2D(y.TEXTURE_2D,0,b,T,y.RGBA,y.UNSIGNED_BYTE,e):y.texSubImage2D(y.TEXTURE_2D,0,b,T,o,c,y.RGBA,y.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(e,a,s){let{context:o}=this,{gl:c}=o;c.bindTexture(c.TEXTURE_2D,this.texture),s!==c.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=c.LINEAR),e!==this.filter&&(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,e),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,s||e),this.filter=e),a!==this.wrap&&(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,a),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,a),this.wrap=a)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function zn(h){let{userImage:e}=h;return!!(e&&e.render&&e.render())&&(h.data.replace(new Uint8Array(e.data.buffer)),!0)}class Kt extends d.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new d.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:a,promiseResolve:s}of this.requestors)s(this._getImagesForIds(a));this.requestors=[]}}getImage(e){let a=this.images[e];if(a&&!a.data&&a.spriteData){let s=a.spriteData;a.data=new d.R({width:s.width,height:s.height},s.context.getImageData(s.x,s.y,s.width,s.height).data),a.spriteData=null}return a}addImage(e,a){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,a)&&(this.images[e]=a)}_validate(e,a){let s=!0,o=a.data||a.spriteData;return this._validateStretch(a.stretchX,o&&o.width)||(this.fire(new d.j(new Error(`Image "${e}" has invalid "stretchX" value`))),s=!1),this._validateStretch(a.stretchY,o&&o.height)||(this.fire(new d.j(new Error(`Image "${e}" has invalid "stretchY" value`))),s=!1),this._validateContent(a.content,a)||(this.fire(new d.j(new Error(`Image "${e}" has invalid "content" value`))),s=!1),s}_validateStretch(e,a){if(!e)return!0;let s=0;for(let o of e){if(o[0]{let o=!0;if(!this.isLoaded())for(let c of e)this.images[c]||(o=!1);this.isLoaded()||o?a(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:a})})}_getImagesForIds(e){let a={};for(let s of e){let o=this.getImage(s);o||(this.fire(new d.k("styleimagemissing",{id:s})),o=this.getImage(s)),o?a[s]={data:o.data.clone(),pixelRatio:o.pixelRatio,sdf:o.sdf,version:o.version,stretchX:o.stretchX,stretchY:o.stretchY,content:o.content,textFitWidth:o.textFitWidth,textFitHeight:o.textFitHeight,hasRenderCallback:!!(o.userImage&&o.userImage.render)}:d.w(`Image "${s}" 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 a}getPixelSize(){let{width:e,height:a}=this.atlasImage;return{width:e,height:a}}getPattern(e){let a=this.patterns[e],s=this.getImage(e);if(!s)return null;if(a&&a.position.version===s.version)return a.position;if(a)a.position.version=s.version;else{let o={w:s.data.width+2,h:s.data.height+2,x:0,y:0},c=new d.I(o,s);this.patterns[e]={bin:o,position:c}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){let a=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new ot(e,this.atlasImage,a.RGBA),this.atlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(){let e=[];for(let c in this.patterns)e.push(this.patterns[c].bin);let{w:a,h:s}=d.p(e),o=this.atlasImage;o.resize({width:a||1,height:s||1});for(let c in this.patterns){let{bin:f}=this.patterns[c],_=f.x+1,y=f.y+1,b=this.getImage(c).data,T=b.width,S=b.height;d.R.copy(b,o,{x:0,y:0},{x:_,y},{width:T,height:S}),d.R.copy(b,o,{x:0,y:S-1},{x:_,y:y-1},{width:T,height:1}),d.R.copy(b,o,{x:0,y:0},{x:_,y:y+S},{width:T,height:1}),d.R.copy(b,o,{x:T-1,y:0},{x:_-1,y},{width:1,height:S}),d.R.copy(b,o,{x:0,y:0},{x:_+T,y},{width:1,height:S})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let a of e){if(this.callbackDispatchedThisFrame[a])continue;this.callbackDispatchedThisFrame[a]=!0;let s=this.getImage(a);s||d.w(`Image with ID: "${a}" was not found`),zn(s)&&this.updateImage(a,s)}}}let si=1e20;function xr(h,e,a,s,o,c,f,_,y){for(let b=e;b-1);y++,c[y]=_,f[y]=b,f[y+1]=si}for(let _=0,y=0;_65535)throw new Error("glyphs > 65535 not supported");if(s.ranges[c])return{stack:e,id:a,glyph:o};if(!this.url)throw new Error("glyphsUrl is not set");if(!s.requests[c]){let _=or.loadGlyphRange(e,c,this.url,this.requestManager);s.requests[c]=_}let f=yield s.requests[c];for(let _ in f)this._doesCharSupportLocalGlyph(+_)||(s.glyphs[+_]=f[+_]);return s.ranges[c]=!0,{stack:e,id:a,glyph:f[a]||null}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&/\p{Ideo}|\p{sc=Hang}|\p{sc=Hira}|\p{sc=Kana}/u.test(String.fromCodePoint(e))}_tinySDF(e,a,s){let o=this.localIdeographFontFamily;if(!o||!this._doesCharSupportLocalGlyph(s))return;let c=e.tinySDF;if(!c){let _="400";/bold/i.test(a)?_="900":/medium/i.test(a)?_="500":/light/i.test(a)&&(_="200"),c=e.tinySDF=new or.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:o,fontWeight:_})}let f=c.draw(String.fromCharCode(s));return{id:s,bitmap:new d.o({width:f.width||60,height:f.height||60},f.data),metrics:{width:f.glyphWidth/2||24,height:f.glyphHeight/2||24,left:f.glyphLeft/2+.5||0,top:f.glyphTop/2-27.5||-8,advance:f.glyphAdvance/2||24,isDoubleResolution:!0}}}}or.loadGlyphRange=function(h,e,a,s){return d._(this,void 0,void 0,function*(){let o=256*e,c=o+255,f=s.transformRequest(a.replace("{fontstack}",h).replace("{range}",`${o}-${c}`),"Glyphs"),_=yield d.l(f,new AbortController);if(!_||!_.data)throw new Error(`Could not load glyph range. range: ${e}, ${o}-${c}`);let y={};for(let b of d.n(_.data))y[b.id]=b;return y})},or.TinySDF=class{constructor({fontSize:h=24,buffer:e=3,radius:a=8,cutoff:s=.25,fontFamily:o="sans-serif",fontWeight:c="normal",fontStyle:f="normal"}={}){this.buffer=e,this.cutoff=s,this.radius=a;let _=this.size=h+4*e,y=this._createCanvas(_),b=this.ctx=y.getContext("2d",{willReadFrequently:!0});b.font=`${f} ${c} ${h}px ${o}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(_*_),this.gridInner=new Float64Array(_*_),this.f=new Float64Array(_),this.z=new Float64Array(_+1),this.v=new Uint16Array(_)}_createCanvas(h){let e=document.createElement("canvas");return e.width=e.height=h,e}draw(h){let{width:e,actualBoundingBoxAscent:a,actualBoundingBoxDescent:s,actualBoundingBoxLeft:o,actualBoundingBoxRight:c}=this.ctx.measureText(h),f=Math.ceil(a),_=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-o))),y=Math.min(this.size-this.buffer,f+Math.ceil(s)),b=_+2*this.buffer,T=y+2*this.buffer,S=Math.max(b*T,0),z=new Uint8ClampedArray(S),D={data:z,width:b,height:T,glyphWidth:_,glyphHeight:y,glyphTop:f,glyphLeft:0,glyphAdvance:e};if(_===0||y===0)return D;let{ctx:R,buffer:V,gridInner:j,gridOuter:U}=this;R.clearRect(V,V,_,y),R.fillText(h,V,V+f);let Z=R.getImageData(V,V,_,y);U.fill(si,0,S),j.fill(0,0,S);for(let B=0;B0?le*le:0,j[ee]=le<0?le*le:0}}xr(U,0,0,b,T,b,this.f,this.v,this.z),xr(j,V,V,_,y,b,this.f,this.v,this.z);for(let B=0;B1&&(y=e[++_]);let T=Math.abs(b-y.left),S=Math.abs(b-y.right),z=Math.min(T,S),D,R=c/s*(o+1);if(y.isDash){let V=o-Math.abs(R);D=Math.sqrt(z*z+V*V)}else D=o-Math.sqrt(z*z+R*R);this.data[f+b]=Math.max(0,Math.min(255,D+128))}}}addRegularDash(e){for(let _=e.length-1;_>=0;--_){let y=e[_],b=e[_+1];y.zeroLength?e.splice(_,1):b&&b.isDash===y.isDash&&(b.left=y.left,e.splice(_,1))}let a=e[0],s=e[e.length-1];a.isDash===s.isDash&&(a.left=s.left-this.width,s.right=a.right+this.width);let o=this.width*this.nextRow,c=0,f=e[c];for(let _=0;_1&&(f=e[++c]);let y=Math.abs(_-f.left),b=Math.abs(_-f.right),T=Math.min(y,b);this.data[o+_]=Math.max(0,Math.min(255,(f.isDash?T:-T)+128))}}addDash(e,a){let s=a?7:0,o=2*s+1;if(this.nextRow+o>this.height)return d.w("LineAtlas out of space"),null;let c=0;for(let _=0;_{a.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[zr]}numActive(){return Object.keys(this.active).length}}let pa=Math.floor(se.hardwareConcurrency/2),Si,Zi;function $r(){return Si||(Si=new lr),Si}lr.workerCount=d.C(globalThis)?Math.max(Math.min(pa,3),1):1;class Zr{constructor(e,a){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=a;let s=this.workerPool.acquire(a);for(let o=0;o{a.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,a){for(let s of this.actors)s.registerMessageHandler(e,a)}}function Ka(){return Zi||(Zi=new Zr($r(),d.G),Zi.registerMessageHandler("GR",(h,e,a)=>d.m(e,a))),Zi}function br(h,e){let a=d.H();return d.J(a,a,[1,1,0]),d.K(a,a,[.5*h.width,.5*h.height,1]),d.L(a,a,h.calculatePosMatrix(e.toUnwrapped()))}function Er(h,e,a,s,o,c){let f=function(S,z,D){if(S)for(let R of S){let V=z[R];if(V&&V.source===D&&V.type==="fill-extrusion")return!0}else for(let R in z){let V=z[R];if(V.source===D&&V.type==="fill-extrusion")return!0}return!1}(o&&o.layers,e,h.id),_=c.maxPitchScaleFactor(),y=h.tilesIn(s,_,f);y.sort(Ar);let b=[];for(let S of y)b.push({wrappedTileID:S.tileID.wrapped().key,queryResults:S.tile.queryRenderedFeatures(e,a,h._state,S.queryGeometry,S.cameraQueryGeometry,S.scale,o,c,_,br(h.transform,S.tileID))});let T=function(S){let z={},D={};for(let R of S){let V=R.queryResults,j=R.wrappedTileID,U=D[j]=D[j]||{};for(let Z in V){let B=V[Z],X=U[Z]=U[Z]||{},K=z[Z]=z[Z]||[];for(let ee of B)X[ee.featureIndex]||(X[ee.featureIndex]=!0,K.push(ee))}}return z}(b);for(let S in T)T[S].forEach(z=>{let D=z.feature,R=h.getFeatureState(D.layer["source-layer"],D.id);D.source=D.layer.source,D.layer["source-layer"]&&(D.sourceLayer=D.layer["source-layer"]),D.state=R});return T}function Ar(h,e){let a=h.tileID,s=e.tileID;return a.overscaledZ-s.overscaledZ||a.canonical.y-s.canonical.y||a.wrap-s.wrap||a.canonical.x-s.canonical.x}function da(h,e,a){return d._(this,void 0,void 0,function*(){let s=h;if(h.url?s=(yield d.h(e.transformRequest(h.url,"Source"),a)).data:yield se.frameAsync(a),!s)return null;let o=d.M(d.e(s,h),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in s&&s.vector_layers&&(o.vectorLayerIds=s.vector_layers.map(c=>c.id)),o})}class re{constructor(e,a){e&&(a?this.setSouthWest(e).setNorthEast(a):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof d.N?new d.N(e.lng,e.lat):d.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof d.N?new d.N(e.lng,e.lat):d.N.convert(e),this}extend(e){let a=this._sw,s=this._ne,o,c;if(e instanceof d.N)o=e,c=e;else{if(!(e instanceof re))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(re.convert(e)):this.extend(d.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(d.N.convert(e)):this;if(o=e._sw,c=e._ne,!o||!c)return this}return a||s?(a.lng=Math.min(o.lng,a.lng),a.lat=Math.min(o.lat,a.lat),s.lng=Math.max(c.lng,s.lng),s.lat=Math.max(c.lat,s.lat)):(this._sw=new d.N(o.lng,o.lat),this._ne=new d.N(c.lng,c.lat)),this}getCenter(){return new d.N((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 d.N(this.getWest(),this.getNorth())}getSouthEast(){return new d.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:a,lat:s}=d.N.convert(e),o=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=a&&a>=this._ne.lng),this._sw.lat<=s&&s<=this._ne.lat&&o}static convert(e){return e instanceof re?e:e&&new re(e)}static fromLngLat(e,a=0){let s=360*a/40075017,o=s/Math.cos(Math.PI/180*e.lat);return new re(new d.N(e.lng-o,e.lat-s),new d.N(e.lng+o,e.lat+s))}adjustAntiMeridian(){let e=new d.N(this._sw.lng,this._sw.lat),a=new d.N(this._ne.lng,this._ne.lat);return new re(e,e.lng>a.lng?new d.N(a.lng+360,a.lat):a)}}class Gr{constructor(e,a,s){this.bounds=re.convert(this.validateBounds(e)),this.minzoom=a||0,this.maxzoom=s||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){let a=Math.pow(2,e.z),s=Math.floor(d.O(this.bounds.getWest())*a),o=Math.floor(d.Q(this.bounds.getNorth())*a),c=Math.ceil(d.O(this.bounds.getEast())*a),f=Math.ceil(d.Q(this.bounds.getSouth())*a);return e.x>=s&&e.x=o&&e.y{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return d.e({},this._options)}loadTile(e){return d._(this,void 0,void 0,function*(){let a=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s={request:this.map._requestManager.transformRequest(a,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.request.collectResourceTiming=this._collectResourceTiming;let o="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise((c,f)=>{e.reloadPromise={resolve:c,reject:f}})}else e.actor=this.dispatcher.getActor(),o="LT";e.abortController=new AbortController;try{let c=yield e.actor.sendAsync({type:o,data:s},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,c)}catch(c){if(delete e.abortController,e.aborted)return;if(c&&c.status!==404)throw c;this._afterTileLoadWorkerResponse(e,null)}})}_afterTileLoadWorkerResponse(e,a){if(a&&a.resourceTiming&&(e.resourceTiming=a.resourceTiming),a&&this.map._refreshExpiredTiles&&e.setExpiryData(a),e.loadVectorData(a,this.map.painter),e.reloadPromise){let s=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(s.resolve).catch(s.reject)}}abortTile(e){return d._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return d._(this,void 0,void 0,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class it extends d.E{constructor(e,a,s,o){super(),this.id=e,this.dispatcher=s,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=d.e({type:"raster"},a),d.e(this,d.M(a,["url","scheme","tileSize"]))}load(){return d._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new d.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let e=yield da(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(d.e(this,e),e.bounds&&(this.tileBounds=new Gr(e.bounds,this.minzoom,this.maxzoom)),this.fire(new d.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new d.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new d.j(e))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return d.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return d._(this,void 0,void 0,function*(){let a=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{let s=yield dt.getImage(this.map._requestManager.transformRequest(a,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(s&&s.data){this.map._refreshExpiredTiles&&s.cacheControl&&s.expires&&e.setExpiryData({cacheControl:s.cacheControl,expires:s.expires});let o=this.map.painter.context,c=o.gl,f=s.data;e.texture=this.map.painter.getTileTexture(f.width),e.texture?e.texture.update(f,{useMipmap:!0}):(e.texture=new ot(o,f,c.RGBA,{useMipmap:!0}),e.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE,c.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(s){if(delete e.abortController,e.aborted)e.state="unloaded";else if(s)throw e.state="errored",s}})}abortTile(e){return d._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return d._(this,void 0,void 0,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}}class Mt extends it{constructor(e,a,s,o){super(e,a,s,o),this.type="raster-dem",this.maxzoom=22,this._options=d.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(e){return d._(this,void 0,void 0,function*(){let a=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s=this.map._requestManager.transformRequest(a,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let o=yield dt.getImage(s,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(o&&o.data){let c=o.data;this.map._refreshExpiredTiles&&o.cacheControl&&o.expires&&e.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});let f=d.b(c)&&d.U()?c:yield this.readImageNow(c),_={type:this.type,uid:e.uid,source:this.id,rawImageData:f,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();let y=yield e.actor.sendAsync({type:"LDT",data:_});e.dem=y,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(o){if(delete e.abortController,e.aborted)e.state="unloaded";else if(o)throw e.state="errored",o}})}readImageNow(e){return d._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&d.V()){let a=e.width+2,s=e.height+2;try{return new d.R({width:a,height:s},yield d.W(e,-1,-1,a,s))}catch{}}return se.getImageData(e,1)})}_getNeighboringTiles(e){let a=e.canonical,s=Math.pow(2,a.z),o=(a.x-1+s)%s,c=a.x===0?e.wrap-1:e.wrap,f=(a.x+1+s)%s,_=a.x+1===s?e.wrap+1:e.wrap,y={};return y[new d.S(e.overscaledZ,c,a.z,o,a.y).key]={backfilled:!1},y[new d.S(e.overscaledZ,_,a.z,f,a.y).key]={backfilled:!1},a.y>0&&(y[new d.S(e.overscaledZ,c,a.z,o,a.y-1).key]={backfilled:!1},y[new d.S(e.overscaledZ,e.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},y[new d.S(e.overscaledZ,_,a.z,f,a.y-1).key]={backfilled:!1}),a.y+10&&d.e(c,{resourceTiming:o}),this.fire(new d.k("data",Object.assign(Object.assign({},c),{sourceDataType:"metadata"}))),this.fire(new d.k("data",Object.assign(Object.assign({},c),{sourceDataType:"content"})))}catch(s){if(this._pendingLoads--,this._removed)return void this.fire(new d.k("dataabort",{dataType:"source"}));this.fire(new d.j(s))}})}loaded(){return this._pendingLoads===0}loadTile(e){return d._(this,void 0,void 0,function*(){let a=e.actor?"RT":"LT";e.actor=this.actor;let s={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;let o=yield this.actor.sendAsync({type:a,data:s},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(o,this.map.painter,a==="RT")})}abortTile(e){return d._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return d._(this,void 0,void 0,function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return d.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Pr=d.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class wr extends d.E{constructor(e,a,s,o){super(),this.id=e,this.dispatcher=s,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=a}load(e){return d._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new d.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let a=yield dt.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,a&&a.data&&(this.image=a.data,e&&(this.coordinates=e),this._finishLoading())}catch(a){this._request=null,this._loaded=!0,this.fire(new d.j(a))}})}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new d.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;let a=e.map(d.Z.fromLngLat);this.tileID=function(o){let c=1/0,f=1/0,_=-1/0,y=-1/0;for(let z of o)c=Math.min(c,z.x),f=Math.min(f,z.y),_=Math.max(_,z.x),y=Math.max(y,z.y);let b=Math.max(_-c,y-f),T=Math.max(0,Math.floor(-Math.log(b)/Math.LN2)),S=Math.pow(2,T);return new d.a1(T,Math.floor((c+_)/2*S),Math.floor((f+y)/2*S))}(a),this.minzoom=this.maxzoom=this.tileID.z;let s=a.map(o=>this.tileID.getTilePoint(o)._round());return this._boundsArray=new d.$,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,d.X,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,d.X),this._boundsArray.emplaceBack(s[2].x,s[2].y,d.X,d.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new d.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,a=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Pr.members)),this.boundsSegments||(this.boundsSegments=d.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new ot(e,this.image,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let s=!1;for(let o in this.tiles){let c=this.tiles[o];c.state!=="loaded"&&(c.state="loaded",c.texture=this.texture,s=!0)}s&&this.fire(new d.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return d._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ma extends wr{constructor(e,a,s,o){super(e,a,s,o),this.roundZoom=!0,this.type="video",this.options=a}load(){return d._(this,void 0,void 0,function*(){this._loaded=!1;let e=this.options;this.urls=[];for(let a of e.urls)this.urls.push(this.map._requestManager.transformRequest(a,"Source").url);try{let a=yield d.a3(this.urls);if(this._loaded=!0,!a)return;this.video=a,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(a){this.fire(new d.j(a))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let a=this.video.seekable;ea.end(0)?this.fire(new d.j(new d.a2(`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=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,a=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Pr.members)),this.boundsSegments||(this.boundsSegments=d.a0.simpleSegment(0,0,4,2)),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 ot(e,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let s=!1;for(let o in this.tiles){let c=this.tiles[o];c.state!=="loaded"&&(c.state="loaded",c.texture=this.texture,s=!0)}s&&this.fire(new d.k("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 Li extends wr{constructor(e,a,s,o){super(e,a,s,o),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some(c=>!Array.isArray(c)||c.length!==2||c.some(f=>typeof f!="number"))||this.fire(new d.j(new d.a2(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new d.j(new d.a2(`sources.${e}`,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new d.j(new d.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof HTMLCanvasElement||this.fire(new d.j(new d.a2(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new d.j(new d.a2(`sources.${e}`,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}load(){return d._(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 d.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let a=this.map.painter.context,s=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,Pr.members)),this.boundsSegments||(this.boundsSegments=d.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new ot(a,this.canvas,s.RGBA,{premultiply:!0});let o=!1;for(let c in this.tiles){let f=this.tiles[c];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture,o=!0)}o&&this.fire(new d.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}let Qa={},en=h=>{switch(h){case"geojson":return Ya;case"image":return wr;case"raster":return it;case"raster-dem":return Mt;case"vector":return Ja;case"video":return ma;case"canvas":return Li}return Qa[h]},pe="RTLPluginLoaded";class cr extends d.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Ka()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(a=>{throw this.status="error",a})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return d._(this,arguments,void 0,function*(a,s=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=se.resolveURL(a),!this.url)throw new Error(`requested url ${a} is invalid`);if(this.status==="unavailable"){if(!s)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return d._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new d.k(pe))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let oi=null;function hr(){return oi||(oi=new cr),oi}class Dr{constructor(e,a){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=d.a4(),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.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){let a=e+this.timeAdded;ac.getLayer(b)).filter(Boolean);if(y.length!==0){_.layers=y,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map(b=>y.filter(T=>T.id===b)[0]));for(let b of y)f[b.id]=_}}return f}(e.buckets,a.style),this.hasSymbolBuckets=!1;for(let o in this.buckets){let c=this.buckets[o];if(c instanceof d.a6){if(this.hasSymbolBuckets=!0,!s)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let o in this.buckets){let c=this.buckets[o];if(c instanceof d.a6&&c.hasRTLText){this.hasRTLText=!0,hr().lazyLoad();break}}this.queryPadding=0;for(let o in this.buckets){let c=this.buckets[o];this.queryPadding=Math.max(this.queryPadding,a.style.getLayer(o).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new d.a5}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let s in this.buckets){let o=this.buckets[s];o.uploadPending()&&o.upload(e)}let a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ot(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new ot(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,a,s,o,c,f,_,y,b,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:o,cameraQueryGeometry:c,scale:f,tileSize:this.tileSize,pixelPosMatrix:T,transform:y,params:_,queryPadding:this.queryPadding*b},e,a,s):{}}querySourceFeatures(e,a){let s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;let o=s.loadVTLayers(),c=a&&a.sourceLayer?a.sourceLayer:"",f=o._geojsonTileLayer||o[c];if(!f)return;let _=d.a7(a&&a.filter),{z:y,x:b,y:T}=this.tileID.canonical,S={z:y,x:b,y:T};for(let z=0;zs)o=!1;else if(a)if(this.expirationTime{this.remove(e,c)},s)),this.data[o].push(c),this.order.push(o),this.order.length>this.max){let f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let a=this.data[e].shift();return a.timeout&&clearTimeout(a.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),a.value}getByKey(e){let a=this.data[e];return a?a[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,a){if(!this.has(e))return this;let s=e.wrapped().key,o=a===void 0?0:this.data[s].indexOf(a),c=this.data[s][o];return this.data[s].splice(o,1),c.timeout&&clearTimeout(c.timeout),this.data[s].length===0&&delete this.data[s],this.onRemove(c.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this}filter(e){let a=[];for(let s in this.data)for(let o of this.data[s])e(o.value)||a.push(o);for(let s of a)this.remove(s.value.tileID,s)}}class $e{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,a,s){let o=String(a);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][o]=this.stateChanges[e][o]||{},d.e(this.stateChanges[e][o],s),this.deletedStates[e]===null){this.deletedStates[e]={};for(let c in this.state[e])c!==o&&(this.deletedStates[e][c]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][o]===null){this.deletedStates[e][o]={};for(let c in this.state[e][o])s[c]||(this.deletedStates[e][o][c]=null)}else for(let c in s)this.deletedStates[e]&&this.deletedStates[e][o]&&this.deletedStates[e][o][c]===null&&delete this.deletedStates[e][o][c]}removeFeatureState(e,a,s){if(this.deletedStates[e]===null)return;let o=String(a);if(this.deletedStates[e]=this.deletedStates[e]||{},s&&a!==void 0)this.deletedStates[e][o]!==null&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][s]=null);else if(a!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][o])for(s in this.deletedStates[e][o]={},this.stateChanges[e][o])this.deletedStates[e][o][s]=null;else this.deletedStates[e][o]=null;else this.deletedStates[e]=null}getState(e,a){let s=String(a),o=d.e({},(this.state[e]||{})[s],(this.stateChanges[e]||{})[s]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let c=this.deletedStates[e][a];if(c===null)return{};for(let f in c)delete o[f]}return o}initializeTileState(e,a){e.setFeatureState(this.state,a)}coalesceChanges(e,a){let s={};for(let o in this.stateChanges){this.state[o]=this.state[o]||{};let c={};for(let f in this.stateChanges[o])this.state[o][f]||(this.state[o][f]={}),d.e(this.state[o][f],this.stateChanges[o][f]),c[f]=this.state[o][f];s[o]=c}for(let o in this.deletedStates){this.state[o]=this.state[o]||{};let c={};if(this.deletedStates[o]===null)for(let f in this.state[o])c[f]={},this.state[o][f]={};else for(let f in this.deletedStates[o]){if(this.deletedStates[o][f]===null)this.state[o][f]={};else for(let _ of Object.keys(this.deletedStates[o][f]))delete this.state[o][f][_];c[f]=this.state[o][f]}s[o]=s[o]||{},d.e(s[o],c)}if(this.stateChanges={},this.deletedStates={},Object.keys(s).length!==0)for(let o in e)e[o].setFeatureState(s,a)}}class Fe extends d.E{constructor(e,a,s){super(),this.id=e,this.dispatcher=s,this.on("data",o=>this._dataHandler(o)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((o,c,f,_)=>{let y=new(en(c.type))(o,c,f,_);if(y.id!==o)throw new Error(`Expected Source id to be ${o} instead of ${y.id}`);return y})(e,a,s,this),this._tiles={},this._cache=new ge(0,o=>this._unloadTile(o)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new $e,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let e in this._tiles){let a=this._tiles[e];if(a.state!=="loaded"&&a.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,a,s){return d._(this,void 0,void 0,function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,a,s)}catch(o){e.state="errored",o.status!==404?this._source.fire(new d.j(o,{tile:e})):this.update(this.transform,this.terrain)}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new d.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let a in this._tiles){let s=this._tiles[a];s.upload(e),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(fi).map(e=>e.key)}getRenderableIds(e){let a=[];for(let s in this._tiles)this._isIdRenderable(s,e)&&a.push(this._tiles[s]);return e?a.sort((s,o)=>{let c=s.tileID,f=o.tileID,_=new d.P(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),y=new d.P(f.canonical.x,f.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-f.overscaledZ||y.y-_.y||y.x-_.x}).map(s=>s.tileID.key):a.map(s=>s.tileID).sort(fi).map(s=>s.key)}hasRenderableParent(e){let a=this.findLoadedParent(e,0);return!!a&&this._isIdRenderable(a.tileID.key)}_isIdRenderable(e,a){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(a||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(e,"reloading")}}_reloadTile(e,a){return d._(this,void 0,void 0,function*(){let s=this._tiles[e];s&&(s.state!=="loading"&&(s.state=a),yield this._loadTile(s,e,a))})}_tileLoaded(e,a,s){e.timeAdded=se.now(),s==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(a,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new d.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){let a=this.getRenderableIds();for(let o=0;o1||(Math.abs(f)>1&&(Math.abs(f+y)===1?f+=y:Math.abs(f-y)===1&&(f-=y)),c.dem&&o.dem&&(o.dem.backfillBorder(c.dem,f,_),o.neighboringTiles&&o.neighboringTiles[b]&&(o.neighboringTiles[b].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,a,s,o){for(let c in this._tiles){let f=this._tiles[c];if(o[c]||!f.hasData()||f.tileID.overscaledZ<=a||f.tileID.overscaledZ>s)continue;let _=f.tileID;for(;f&&f.tileID.overscaledZ>a+1;){let b=f.tileID.scaledTo(f.tileID.overscaledZ-1);f=this._tiles[b.key],f&&f.hasData()&&(_=b)}let y=_;for(;y.overscaledZ>a;)if(y=y.scaledTo(y.overscaledZ-1),e[y.key]){o[_.key]=_;break}}}findLoadedParent(e,a){if(e.key in this._loadedParentTiles){let s=this._loadedParentTiles[e.key];return s&&s.tileID.overscaledZ>=a?s:null}for(let s=e.overscaledZ-1;s>=a;s--){let o=e.scaledTo(s),c=this._getLoadedTile(o);if(c)return c}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){let a=this._tiles[e.key];return a&&a.hasData()?a:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){let a=Math.ceil(e.width/this._source.tileSize)+1,s=Math.ceil(e.height/this._source.tileSize)+1,o=Math.floor(a*s*(this._maxTileCacheZoomLevels===null?d.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),c=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(c)}handleWrapJump(e){let a=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,a){let s={};for(let o in this._tiles){let c=this._tiles[o];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+a),s[c.tileID.key]=c}this._tiles=s;for(let o in this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(let o in this._tiles)this._setTileReloadTimer(o,this._tiles[o])}}_updateCoveredAndRetainedTiles(e,a,s,o,c,f){let _={},y={},b=Object.keys(e),T=se.now();for(let S of b){let z=e[S],D=this._tiles[S];if(!D||D.fadeEndTime!==0&&D.fadeEndTime<=T)continue;let R=this.findLoadedParent(z,a),V=this.findLoadedSibling(z),j=R||V||null;j&&(this._addTile(j.tileID),_[j.tileID.key]=j.tileID),y[S]=z}this._retainLoadedChildren(y,o,s,e);for(let S in _)e[S]||(this._coveredTiles[S]=!0,e[S]=_[S]);if(f){let S={},z={};for(let D of c)this._tiles[D.key].hasData()?S[D.key]=D:z[D.key]=D;for(let D in z){let R=z[D].children(this._source.maxzoom);this._tiles[R[0].key]&&this._tiles[R[1].key]&&this._tiles[R[2].key]&&this._tiles[R[3].key]&&(S[R[0].key]=e[R[0].key]=R[0],S[R[1].key]=e[R[1].key]=R[1],S[R[2].key]=e[R[2].key]=R[2],S[R[3].key]=e[R[3].key]=R[3],delete z[D])}for(let D in z){let R=z[D],V=this.findLoadedParent(R,this._source.minzoom),j=this.findLoadedSibling(R),U=V||j||null;if(U){S[U.tileID.key]=e[U.tileID.key]=U.tileID;for(let Z in S)S[Z].isChildOf(U.tileID)&&delete S[Z]}}for(let D in this._tiles)S[D]||(this._coveredTiles[D]=!0)}}update(e,a){if(!this._sourceLoaded||this._paused)return;let s;this.transform=e,this.terrain=a,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(T=>new d.S(T.canonical.z,T.wrap,T.canonical.z,T.canonical.x,T.canonical.y)):(s=e.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:a}),this._source.hasTile&&(s=s.filter(T=>this._source.hasTile(T)))):s=[];let o=e.coveringZoomLevel(this._source),c=Math.max(o-Fe.maxOverzooming,this._source.minzoom),f=Math.max(o+Fe.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let T={};for(let S of s)if(S.canonical.z>this._source.minzoom){let z=S.scaledTo(S.canonical.z-1);T[z.key]=z;let D=S.scaledTo(Math.max(this._source.minzoom,Math.min(S.canonical.z,5)));T[D.key]=D}s=s.concat(Object.values(T))}let _=s.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,_&&this.fire(new d.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let y=this._updateRetainedTiles(s,o);Gi(this._source.type)&&this._updateCoveredAndRetainedTiles(y,c,f,o,s,a);for(let T in y)this._tiles[T].clearFadeHold();let b=d.ab(this._tiles,y);for(let T of b){let S=this._tiles[T];S.hasSymbolBuckets&&!S.holdingForFade()?S.setHoldDuration(this.map._fadeDuration):S.hasSymbolBuckets&&!S.symbolFadeFinished()||this._removeTile(T)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,a){var s;let o={},c={},f=Math.max(a-Fe.maxOverzooming,this._source.minzoom),_=Math.max(a+Fe.maxUnderzooming,this._source.minzoom),y={};for(let b of e){let T=this._addTile(b);o[b.key]=b,T.hasData()||athis._source.maxzoom){let z=b.children(this._source.maxzoom)[0],D=this.getTile(z);if(D&&D.hasData()){o[z.key]=z;continue}}else{let z=b.children(this._source.maxzoom);if(o[z[0].key]&&o[z[1].key]&&o[z[2].key]&&o[z[3].key])continue}let S=T.wasRequested();for(let z=b.overscaledZ-1;z>=f;--z){let D=b.scaledTo(z);if(c[D.key])break;if(c[D.key]=!0,T=this.getTile(D),!T&&S&&(T=this._addTile(D)),T){let R=T.hasData();if((R||!(!((s=this.map)===null||s===void 0)&&s.cancelPendingTileRequestsWhileZooming)||S)&&(o[D.key]=D),S=T.wasRequested(),R)break}}}return o}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let e in this._tiles){let a=[],s,o=this._tiles[e].tileID;for(;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){s=this._loadedParentTiles[o.key];break}a.push(o.key);let c=o.scaledTo(o.overscaledZ-1);if(s=this._getLoadedTile(c),s)break;o=c}for(let c of a)this._loadedParentTiles[c]=s}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let e in this._tiles){let a=this._tiles[e].tileID,s=this._getLoadedTile(a);this._loadedSiblingTiles[a.key]=s}}_addTile(e){let a=this._tiles[e.key];if(a)return a;a=this._cache.getAndRemove(e),a&&(this._setTileReloadTimer(e.key,a),a.tileID=e,this._state.initializeTileState(a,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,a)));let s=a;return a||(a=new Dr(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(a,e.key,a.state)),a.uses++,this._tiles[e.key]=a,s||this._source.fire(new d.k("dataloading",{tile:a,coord:a.tileID,dataType:"source"})),a}_setTileReloadTimer(e,a){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);let s=a.getExpiryTimeout();s&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},s))}_removeTile(e){let a=this._tiles[e];a&&(a.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),a.uses>0||(a.hasData()&&a.state!=="reloading"?this._cache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))}_dataHandler(e){let a=e.sourceDataType;e.dataType==="source"&&a==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType==="source"&&a==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,a,s){let o=[],c=this.transform;if(!c)return o;let f=s?c.getCameraQueryGeometry(e):e,_=e.map(R=>c.pointCoordinate(R,this.terrain)),y=f.map(R=>c.pointCoordinate(R,this.terrain)),b=this.getIds(),T=1/0,S=1/0,z=-1/0,D=-1/0;for(let R of y)T=Math.min(T,R.x),S=Math.min(S,R.y),z=Math.max(z,R.x),D=Math.max(D,R.y);for(let R=0;R=0&&B[1].y+Z>=0){let X=_.map(ee=>j.getTilePoint(ee)),K=y.map(ee=>j.getTilePoint(ee));o.push({tile:V,tileID:j,queryGeometry:X,cameraQueryGeometry:K,scale:U})}}return o}getVisibleCoordinates(e){let a=this.getRenderableIds(e).map(s=>this._tiles[s].tileID);for(let s of a)s.posMatrix=this.transform.calculatePosMatrix(s.toUnwrapped());return a}hasTransition(){if(this._source.hasTransition())return!0;if(Gi(this._source.type)){let e=se.now();for(let a in this._tiles)if(this._tiles[a].fadeEndTime>=e)return!0}return!1}setFeatureState(e,a,s){this._state.updateState(e=e||"_geojsonTileLayer",a,s)}removeFeatureState(e,a,s){this._state.removeFeatureState(e=e||"_geojsonTileLayer",a,s)}getFeatureState(e,a){return this._state.getState(e=e||"_geojsonTileLayer",a)}setDependencies(e,a,s){let o=this._tiles[e];o&&o.setDependencies(a,s)}reloadTilesForDependencies(e,a){for(let s in this._tiles)this._tiles[s].hasDependency(e,a)&&this._reloadTile(s,"reloading");this._cache.filter(s=>!s.hasDependency(e,a))}}function fi(h,e){let a=Math.abs(2*h.wrap)-+(h.wrap<0),s=Math.abs(2*e.wrap)-+(e.wrap<0);return h.overscaledZ-e.overscaledZ||s-a||e.canonical.y-h.canonical.y||e.canonical.x-h.canonical.x}function Gi(h){return h==="raster"||h==="image"||h==="video"}Fe.maxOverzooming=10,Fe.maxUnderzooming=3;class Ne{constructor(e,a){this.reset(e,a)}reset(e,a){this.points=e||[],this._distances=[0];for(let s=1;s0?(o-f)/_:0;return this.points[c].mult(1-y).add(this.points[a].mult(y))}}function ur(h,e){let a=!0;return h==="always"||h!=="never"&&e!=="never"||(a=!1),a}class Tr{constructor(e,a,s){let o=this.boxCells=[],c=this.circleCells=[];this.xCellCount=Math.ceil(e/s),this.yCellCount=Math.ceil(a/s);for(let f=0;fthis.width||o<0||a>this.height)return[];let y=[];if(e<=0&&a<=0&&this.width<=s&&this.height<=o){if(c)return[{key:null,x1:e,y1:a,x2:s,y2:o}];for(let b=0;b0}hitTestCircle(e,a,s,o,c){let f=e-s,_=e+s,y=a-s,b=a+s;if(_<0||f>this.width||b<0||y>this.height)return!1;let T=[];return this._forEachCell(f,y,_,b,this._queryCellCircle,T,{hitTest:!0,overlapMode:o,circle:{x:e,y:a,radius:s},seenUids:{box:{},circle:{}}},c),T.length>0}_queryCell(e,a,s,o,c,f,_,y){let{seenUids:b,hitTest:T,overlapMode:S}=_,z=this.boxCells[c];if(z!==null){let R=this.bboxes;for(let V of z)if(!b.box[V]){b.box[V]=!0;let j=4*V,U=this.boxKeys[V];if(e<=R[j+2]&&a<=R[j+3]&&s>=R[j+0]&&o>=R[j+1]&&(!y||y(U))&&(!T||!ur(S,U.overlapMode))&&(f.push({key:U,x1:R[j],y1:R[j+1],x2:R[j+2],y2:R[j+3]}),T))return!0}}let D=this.circleCells[c];if(D!==null){let R=this.circles;for(let V of D)if(!b.circle[V]){b.circle[V]=!0;let j=3*V,U=this.circleKeys[V];if(this._circleAndRectCollide(R[j],R[j+1],R[j+2],e,a,s,o)&&(!y||y(U))&&(!T||!ur(S,U.overlapMode))){let Z=R[j],B=R[j+1],X=R[j+2];if(f.push({key:U,x1:Z-X,y1:B-X,x2:Z+X,y2:B+X}),T)return!0}}}return!1}_queryCellCircle(e,a,s,o,c,f,_,y){let{circle:b,seenUids:T,overlapMode:S}=_,z=this.boxCells[c];if(z!==null){let R=this.bboxes;for(let V of z)if(!T.box[V]){T.box[V]=!0;let j=4*V,U=this.boxKeys[V];if(this._circleAndRectCollide(b.x,b.y,b.radius,R[j+0],R[j+1],R[j+2],R[j+3])&&(!y||y(U))&&!ur(S,U.overlapMode))return f.push(!0),!0}}let D=this.circleCells[c];if(D!==null){let R=this.circles;for(let V of D)if(!T.circle[V]){T.circle[V]=!0;let j=3*V,U=this.circleKeys[V];if(this._circlesCollide(R[j],R[j+1],R[j+2],b.x,b.y,b.radius)&&(!y||y(U))&&!ur(S,U.overlapMode))return f.push(!0),!0}}}_forEachCell(e,a,s,o,c,f,_,y){let b=this._convertToXCellCoord(e),T=this._convertToYCellCoord(a),S=this._convertToXCellCoord(s),z=this._convertToYCellCoord(o);for(let D=b;D<=S;D++)for(let R=T;R<=z;R++)if(c.call(this,e,a,s,o,this.xCellCount*R+D,f,_,y))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,a,s,o,c,f){let _=o-e,y=c-a,b=s+f;return b*b>_*_+y*y}_circleAndRectCollide(e,a,s,o,c,f,_){let y=(f-o)/2,b=Math.abs(e-(o+y));if(b>y+s)return!1;let T=(_-c)/2,S=Math.abs(a-(c+T));if(S>T+s)return!1;if(b<=y||S<=T)return!0;let z=b-y,D=S-T;return z*z+D*D<=s*s}}function Lr(h,e,a,s,o){let c=d.H();return e?(d.K(c,c,[1/o,1/o,1]),a||d.ad(c,c,s.angle)):d.L(c,s.labelPlaneMatrix,h),c}function pr(h,e,a,s,o){if(e){let c=d.ae(h);return d.K(c,c,[o,o,1]),a||d.ad(c,c,-s.angle),c}return s.glCoordMatrix}function q(h,e,a,s){let o;s?(o=[h,e,s(h,e),1],d.af(o,o,a)):(o=[h,e,0,1],Je(o,o,a));let c=o[3];return{point:new d.P(o[0]/c,o[1]/c),signedDistanceFromCamera:c,isOccluded:!1}}function M(h,e){return .5+h/e*.5}function C(h,e){return h.x>=-e[0]&&h.x<=e[0]&&h.y>=-e[1]&&h.y<=e[1]}function L(h,e,a,s,o,c,f,_,y,b,T,S,z,D,R){let V=s?h.textSizeData:h.iconSizeData,j=d.ag(V,a.transform.zoom),U=[256/a.width*2+1,256/a.height*2+1],Z=s?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;Z.clear();let B=h.lineVertexArray,X=s?h.text.placedSymbolArray:h.icon.placedSymbolArray,K=a.transform.width/a.transform.height,ee=!1;for(let le=0;leMath.abs(a.x-e.x)*s?{useVertical:!0}:(h===d.ah.vertical?e.ya.x)?{needsFlipping:!0}:null}function W(h,e,a,s,o,c,f,_,y,b,T){let S=a/24,z=e.lineOffsetX*S,D=e.lineOffsetY*S,R;if(e.numGlyphs>1){let V=e.glyphStartIndex+e.numGlyphs,j=e.lineStartIndex,U=e.lineStartIndex+e.lineLength,Z=O(S,_,z,D,s,e,T,h);if(!Z)return{notEnoughRoom:!0};let B=q(Z.first.point.x,Z.first.point.y,f,h.getElevation).point,X=q(Z.last.point.x,Z.last.point.y,f,h.getElevation).point;if(o&&!s){let K=H(e.writingMode,B,X,b);if(K)return K}R=[Z.first];for(let K=e.glyphStartIndex+1;K0?B.point:function(ee,le,ue,xe,Te,fe){return Y(ee,le,ue,1,Te,fe)}(h.tileAnchorPoint,Z,j,0,c,h),K=H(e.writingMode,j,X,b);if(K)return K}let V=de(S*_.getoffsetX(e.glyphStartIndex),z,D,s,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,h,T);if(!V||h.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};R=[V]}for(let V of R)d.aj(y,V.point,V.angle);return{}}function Y(h,e,a,s,o,c){let f=h.add(h.sub(e)._unit()),_=o!==void 0?q(f.x,f.y,o,c.getElevation).point:ne(f.x,f.y,c).point,y=a.sub(_);return a.add(y._mult(s/y.mag()))}function $(h,e,a){let s=e.projectionCache;if(s.projections[h])return s.projections[h];let o=new d.P(e.lineVertexArray.getx(h),e.lineVertexArray.gety(h)),c=ne(o.x,o.y,e);if(c.signedDistanceFromCamera>0)return s.projections[h]=c.point,s.anyProjectionOccluded=s.anyProjectionOccluded||c.isOccluded,c.point;let f=h-a.direction;return function(_,y,b,T,S){return Y(_,y,b,T,void 0,S)}(a.distanceFromAnchor===0?e.tileAnchorPoint:new d.P(e.lineVertexArray.getx(f),e.lineVertexArray.gety(f)),o,a.previousVertex,a.absOffsetX-a.distanceFromAnchor+1,e)}function ne(h,e,a){let s=h+a.translation[0],o=e+a.translation[1],c;return!a.pitchWithMap&&a.projection.useSpecialProjectionForSymbols?(c=a.projection.projectTileCoordinates(s,o,a.unwrappedTileID,a.getElevation),c.point.x=(.5*c.point.x+.5)*a.width,c.point.y=(.5*-c.point.y+.5)*a.height):(c=q(s,o,a.labelPlaneMatrix,a.getElevation),c.isOccluded=!1),c}function ce(h,e,a){return h._unit()._perp()._mult(e*a)}function ie(h,e,a,s,o,c,f,_,y){if(_.projectionCache.offsets[h])return _.projectionCache.offsets[h];let b=a.add(e);if(h+y.direction=o)return _.projectionCache.offsets[h]=b,b;let T=$(h+y.direction,_,y),S=ce(T.sub(a),f,y.direction),z=a.add(S),D=T.add(S);return _.projectionCache.offsets[h]=d.ak(c,b,z,D)||b,_.projectionCache.offsets[h]}function de(h,e,a,s,o,c,f,_,y){let b=s?h-e:h+e,T=b>0?1:-1,S=0;s&&(T*=-1,S=Math.PI),T<0&&(S+=Math.PI);let z,D=T>0?c+o:c+o+1;_.projectionCache.cachedAnchorPoint?z=_.projectionCache.cachedAnchorPoint:(z=ne(_.tileAnchorPoint.x,_.tileAnchorPoint.y,_).point,_.projectionCache.cachedAnchorPoint=z);let R,V,j=z,U=z,Z=0,B=0,X=Math.abs(b),K=[],ee;for(;Z+B<=X;){if(D+=T,D=f)return null;Z+=B,U=j,V=R;let xe={absOffsetX:X,direction:T,distanceFromAnchor:Z,previousVertex:U};if(j=$(D,_,xe),a===0)K.push(U),ee=j.sub(U);else{let Te,fe=j.sub(U);Te=fe.mag()===0?ce($(D+T,_,xe).sub(j),a,T):ce(fe,a,T),V||(V=U.add(Te)),R=ie(D,Te,j,c,f,V,a,_,xe),K.push(V),ee=R.sub(V)}B=ee.mag()}let le=ee._mult((X-Z)/B)._add(V||U),ue=S+Math.atan2(j.y-U.y,j.x-U.x);return K.push(le),{point:le,angle:y?ue:0,path:K}}let Pe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Le(h,e){for(let a=0;a=1;Ue--)be.push(qe.path[Ue]);for(let Ue=1;Ue<_e.path.length;Ue++)be.push(_e.path[Ue]);let Oe=2.5*Te;if(b){let Ue=this.projectPathToScreenSpace(be,K,b);be=Ue.some(Xe=>Xe.signedDistanceFromCamera<=0)?[]:Ue.map(Xe=>Xe.point)}let yt=[];if(be.length>0){let Ue=be[0].clone(),Xe=be[0].clone();for(let xt=1;xt=fe.x&&Xe.x<=me.x&&Ue.y>=fe.y&&Xe.y<=me.y?[be]:Xe.xme.x||Xe.yme.y?[]:d.al([be],fe.x,fe.y,me.x,me.y)}for(let Ue of yt){ke.reset(Ue,.25*Te);let Xe=0;Xe=ke.length<=.5*Te?1:Math.ceil(ke.paddedLength/Oe)+1;for(let xt=0;xtq(o.x,o.y,s,a.getElevation))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let a=[],s=1/0,o=1/0,c=-1/0,f=-1/0;for(let T of e){let S=new d.P(T.x+je,T.y+je);s=Math.min(s,S.x),o=Math.min(o,S.y),c=Math.max(c,S.x),f=Math.max(f,S.y),a.push(S)}let _=this.grid.query(s,o,c,f).concat(this.ignoredGrid.query(s,o,c,f)),y={},b={};for(let T of _){let S=T.key;if(y[S.bucketInstanceId]===void 0&&(y[S.bucketInstanceId]={}),y[S.bucketInstanceId][S.featureIndex])continue;let z=[new d.P(T.x1,T.y1),new d.P(T.x2,T.y1),new d.P(T.x2,T.y2),new d.P(T.x1,T.y2)];d.am(a,z)&&(y[S.bucketInstanceId][S.featureIndex]=!0,b[S.bucketInstanceId]===void 0&&(b[S.bucketInstanceId]=[]),b[S.bucketInstanceId].push(S.featureIndex))}return b}insertCollisionBox(e,a,s,o,c,f){(s?this.ignoredGrid:this.grid).insert({bucketInstanceId:o,featureIndex:c,collisionGroupID:f,overlapMode:a},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,a,s,o,c,f){let _=s?this.ignoredGrid:this.grid,y={bucketInstanceId:o,featureIndex:c,collisionGroupID:f,overlapMode:a};for(let b=0;b=this.screenRightBoundary||othis.screenBottomBoundary}isInsideGrid(e,a,s,o){return s>=0&&e=0&&athis.projectAndGetPerspectiveRatio(s,Te.x,Te.y,o,b));ue=xe.some(Te=>!Te.isOccluded),le=xe.map(Te=>Te.point)}else ue=!0;return{box:d.ao(le),allPointsOccluded:!ue}}}function He(h,e,a){return e*(d.X/(h.tileSize*Math.pow(2,a-h.tileID.overscaledZ)))}class Ft{constructor(e,a,s,o){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?a:-a))):o&&s?1:0,this.placed=s}isHidden(){return this.opacity===0&&!this.placed}}class kt{constructor(e,a,s,o,c){this.text=new Ft(e?e.text:null,a,s,c),this.icon=new Ft(e?e.icon:null,a,o,c)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ze{constructor(e,a,s){this.text=e,this.icon=a,this.skipFade=s}}class nt{constructor(){this.invProjMatrix=d.H(),this.viewportMatrix=d.H(),this.circles=[]}}class St{constructor(e,a,s,o,c){this.bucketInstanceId=e,this.featureIndex=a,this.sourceLayerIndex=s,this.bucketIndex=o,this.tileID=c}}class Ut{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let a=++this.maxGroupID;this.collisionGroups[e]={ID:a,predicate:s=>s.collisionGroupID===a}}return this.collisionGroups[e]}}function Ht(h,e,a,s,o){let{horizontalAlign:c,verticalAlign:f}=d.au(h);return new d.P(-(c-.5)*e+s[0]*o,-(f-.5)*a+s[1]*o)}class li{constructor(e,a,s,o,c,f){this.transform=e.clone(),this.terrain=s,this.collisionIndex=new Ye(this.transform,a),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new Ut(c),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=f,f&&(f.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let a=this.terrain;return a?(s,o)=>a.getElevation(e,s,o):null}getBucketParts(e,a,s,o){let c=s.getBucket(a),f=s.latestFeatureIndex;if(!c||!f||a.id!==c.layerIds[0])return;let _=s.collisionBoxArray,y=c.layers[0].layout,b=c.layers[0].paint,T=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),S=s.tileSize/d.X,z=s.tileID.toUnwrapped(),D=this.transform.calculatePosMatrix(z),R=y.get("text-pitch-alignment")==="map",V=y.get("text-rotation-alignment")==="map",j=He(s,1,this.transform.zoom),U=this.collisionIndex.mapProjection.translatePosition(this.transform,s,b.get("text-translate"),b.get("text-translate-anchor")),Z=this.collisionIndex.mapProjection.translatePosition(this.transform,s,b.get("icon-translate"),b.get("icon-translate-anchor")),B=Lr(D,R,V,this.transform,j),X=null;if(R){let ee=pr(D,R,V,this.transform,j);X=d.L([],this.transform.labelPlaneMatrix,ee)}this.retainedQueryData[c.bucketInstanceId]=new St(c.bucketInstanceId,f,c.sourceLayerIndex,c.index,s.tileID);let K={bucket:c,layout:y,translationText:U,translationIcon:Z,posMatrix:D,unwrappedTileID:z,textLabelPlaneMatrix:B,labelToScreenMatrix:X,scale:T,textPixelRatio:S,holdingForFade:s.holdingForFade(),collisionBoxArray:_,partiallyEvaluatedTextSize:d.ag(c.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(c.sourceID)};if(o)for(let ee of c.sortKeyRanges){let{sortKey:le,symbolInstanceStart:ue,symbolInstanceEnd:xe}=ee;e.push({sortKey:le,symbolInstanceStart:ue,symbolInstanceEnd:xe,parameters:K})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:c.symbolInstances.length,parameters:K})}attemptAnchorPlacement(e,a,s,o,c,f,_,y,b,T,S,z,D,R,V,j,U,Z,B){let X=d.aq[e.textAnchor],K=[e.textOffset0,e.textOffset1],ee=Ht(X,s,o,K,c),le=this.collisionIndex.placeCollisionBox(a,z,y,b,T,_,f,j,S.predicate,B,ee);if((!Z||this.collisionIndex.placeCollisionBox(Z,z,y,b,T,_,f,U,S.predicate,B,ee).placeable)&&le.placeable){let ue;if(this.prevPlacement&&this.prevPlacement.variableOffsets[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID].text&&(ue=this.prevPlacement.variableOffsets[D.crossTileID].anchor),D.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[D.crossTileID]={textOffset:K,width:s,height:o,anchor:X,textBoxScale:c,prevAnchor:ue},this.markUsedJustification(R,X,D,V),R.allowVerticalPlacement&&(this.markUsedOrientation(R,V,D),this.placedOrientations[D.crossTileID]=V),{shift:ee,placedGlyphBoxes:le}}}placeLayerBucketPart(e,a,s){let{bucket:o,layout:c,translationText:f,translationIcon:_,posMatrix:y,unwrappedTileID:b,textLabelPlaneMatrix:T,labelToScreenMatrix:S,textPixelRatio:z,holdingForFade:D,collisionBoxArray:R,partiallyEvaluatedTextSize:V,collisionGroup:j}=e.parameters,U=c.get("text-optional"),Z=c.get("icon-optional"),B=d.ar(c,"text-overlap","text-allow-overlap"),X=B==="always",K=d.ar(c,"icon-overlap","icon-allow-overlap"),ee=K==="always",le=c.get("text-rotation-alignment")==="map",ue=c.get("text-pitch-alignment")==="map",xe=c.get("icon-text-fit")!=="none",Te=c.get("symbol-z-order")==="viewport-y",fe=X&&(ee||!o.hasIconData()||Z),me=ee&&(X||!o.hasTextData()||U);!o.collisionArrays&&R&&o.deserializeCollisionBoxes(R);let ke=this._getTerrainElevationFunc(this.retainedQueryData[o.bucketInstanceId].tileID),qe=(_e,be,Oe)=>{var yt,Ue;if(a[_e.crossTileID])return;if(D)return void(this.placements[_e.crossTileID]=new Ze(!1,!1,!1));let Xe=!1,xt=!1,Yt=!0,Yi=null,vt={box:null,placeable:!1,offscreen:null},yi={box:null,placeable:!1,offscreen:null},ci=null,Qt=null,hi=null,gr=0,Fa=0,ls=0;be.textFeatureIndex?gr=be.textFeatureIndex:_e.useRuntimeCollisionCircles&&(gr=_e.featureIndex),be.verticalTextFeatureIndex&&(Fa=be.verticalTextFeatureIndex);let Oa=be.textBox;if(Oa){let qi=Xt=>{let ei=d.ah.horizontal;if(o.allowVerticalPlacement&&!Xt&&this.prevPlacement){let Ei=this.prevPlacement.placedOrientations[_e.crossTileID];Ei&&(this.placedOrientations[_e.crossTileID]=Ei,ei=Ei,this.markUsedOrientation(o,ei,_e))}return ei},Ni=(Xt,ei)=>{if(o.allowVerticalPlacement&&_e.numVerticalGlyphVertices>0&&be.verticalTextBox){for(let Ei of o.writingModes)if(Ei===d.ah.vertical?(vt=ei(),yi=vt):vt=Xt(),vt&&vt.placeable)break}else vt=Xt()},Fr=_e.textAnchorOffsetStartIndex,Qi=_e.textAnchorOffsetEndIndex;if(Qi===Fr){let Xt=(ei,Ei)=>{let Ke=this.collisionIndex.placeCollisionBox(ei,B,z,y,b,ue,le,f,j.predicate,ke);return Ke&&Ke.placeable&&(this.markUsedOrientation(o,Ei,_e),this.placedOrientations[_e.crossTileID]=Ei),Ke};Ni(()=>Xt(Oa,d.ah.horizontal),()=>{let ei=be.verticalTextBox;return o.allowVerticalPlacement&&_e.numVerticalGlyphVertices>0&&ei?Xt(ei,d.ah.vertical):{box:null,offscreen:null}}),qi(vt&&vt.placeable)}else{let Xt=d.aq[(Ue=(yt=this.prevPlacement)===null||yt===void 0?void 0:yt.variableOffsets[_e.crossTileID])===null||Ue===void 0?void 0:Ue.anchor],ei=(Ke,na,Va)=>{let qa=Ke.x2-Ke.x1,dl=Ke.y2-Ke.y1,cc=_e.textBoxScale,ml=xe&&K==="never"?na:null,Or=null,fl=B==="never"?1:2,hs="never";Xt&&fl++;for(let vn=0;vnei(Oa,be.iconBox,d.ah.horizontal),()=>{let Ke=be.verticalTextBox;return o.allowVerticalPlacement&&(!vt||!vt.placeable)&&_e.numVerticalGlyphVertices>0&&Ke?ei(Ke,be.verticalIconBox,d.ah.vertical):{box:null,occluded:!0,offscreen:null}}),vt&&(Xe=vt.placeable,Yt=vt.offscreen);let Ei=qi(vt&&vt.placeable);if(!Xe&&this.prevPlacement){let Ke=this.prevPlacement.variableOffsets[_e.crossTileID];Ke&&(this.variableOffsets[_e.crossTileID]=Ke,this.markUsedJustification(o,Ke.anchor,_e,Ei))}}}if(ci=vt,Xe=ci&&ci.placeable,Yt=ci&&ci.offscreen,_e.useRuntimeCollisionCircles){let qi=o.text.placedSymbolArray.get(_e.centerJustifiedTextSymbolIndex),Ni=d.ai(o.textSizeData,V,qi),Fr=c.get("text-padding");Qt=this.collisionIndex.placeCollisionCircles(B,qi,o.lineVertexArray,o.glyphOffsetArray,Ni,y,b,T,S,s,ue,j.predicate,_e.collisionCircleDiameter,Fr,f,ke),Qt.circles.length&&Qt.collisionDetected&&!s&&d.w("Collisions detected, but collision boxes are not shown"),Xe=X||Qt.circles.length>0&&!Qt.collisionDetected,Yt=Yt&&Qt.offscreen}if(be.iconFeatureIndex&&(ls=be.iconFeatureIndex),be.iconBox){let qi=Ni=>this.collisionIndex.placeCollisionBox(Ni,K,z,y,b,ue,le,_,j.predicate,ke,xe&&Yi?Yi:void 0);yi&&yi.placeable&&be.verticalIconBox?(hi=qi(be.verticalIconBox),xt=hi.placeable):(hi=qi(be.iconBox),xt=hi.placeable),Yt=Yt&&hi.offscreen}let Vi=U||_e.numHorizontalGlyphVertices===0&&_e.numVerticalGlyphVertices===0,cs=Z||_e.numIconVertices===0;Vi||cs?cs?Vi||(xt=xt&&Xe):Xe=xt&&Xe:xt=Xe=xt&&Xe;let fo=xt&&hi.placeable;if(Xe&&ci.placeable&&this.collisionIndex.insertCollisionBox(ci.box,B,c.get("text-ignore-placement"),o.bucketInstanceId,yi&&yi.placeable&&Fa?Fa:gr,j.ID),fo&&this.collisionIndex.insertCollisionBox(hi.box,K,c.get("icon-ignore-placement"),o.bucketInstanceId,ls,j.ID),Qt&&Xe&&this.collisionIndex.insertCollisionCircles(Qt.circles,B,c.get("text-ignore-placement"),o.bucketInstanceId,gr,j.ID),s&&this.storeCollisionData(o.bucketInstanceId,Oe,be,ci,hi,Qt),_e.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(o.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[_e.crossTileID]=new Ze(Xe||fe,xt||me,Yt||o.justReloaded),a[_e.crossTileID]=!0};if(Te){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let _e=o.getSortedSymbolIndexes(this.transform.angle);for(let be=_e.length-1;be>=0;--be){let Oe=_e[be];qe(o.symbolInstances.get(Oe),o.collisionArrays[Oe],Oe)}}else for(let _e=e.symbolInstanceStart;_e=0&&(e.text.placedSymbolArray.get(_).crossTileID=c>=0&&_!==c?0:s.crossTileID)}markUsedOrientation(e,a,s){let o=a===d.ah.horizontal||a===d.ah.horizontalOnly?a:0,c=a===d.ah.vertical?a:0,f=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(let _ of f)e.text.placedSymbolArray.get(_).placedOrientation=o;s.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=c)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let a=this.prevPlacement,s=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;let o=a?a.symbolFadeChange(e):1,c=a?a.opacities:{},f=a?a.variableOffsets:{},_=a?a.placedOrientations:{};for(let y in this.placements){let b=this.placements[y],T=c[y];T?(this.opacities[y]=new kt(T,o,b.text,b.icon),s=s||b.text!==T.text.placed||b.icon!==T.icon.placed):(this.opacities[y]=new kt(null,o,b.text,b.icon,b.skipFade),s=s||b.text||b.icon)}for(let y in c){let b=c[y];if(!this.opacities[y]){let T=new kt(b,o,!1,!1);T.isHidden()||(this.opacities[y]=T,s=s||b.text.placed||b.icon.placed)}}for(let y in f)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=f[y]);for(let y in _)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=_[y]);if(a&&a.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=a?a.lastPlacementChangeTime:e)}updateLayerOpacities(e,a){let s={};for(let o of a){let c=o.getBucket(e);c&&o.latestFeatureIndex&&e.id===c.layerIds[0]&&this.updateBucketOpacities(c,o.tileID,s,o.collisionBoxArray)}}updateBucketOpacities(e,a,s,o){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let c=e.layers[0],f=c.layout,_=new kt(null,0,!1,!1,!0),y=f.get("text-allow-overlap"),b=f.get("icon-allow-overlap"),T=c._unevaluatedLayout.hasValue("text-variable-anchor")||c._unevaluatedLayout.hasValue("text-variable-anchor-offset"),S=f.get("text-rotation-alignment")==="map",z=f.get("text-pitch-alignment")==="map",D=f.get("icon-text-fit")!=="none",R=new kt(null,0,y&&(b||!e.hasIconData()||f.get("icon-optional")),b&&(y||!e.hasTextData()||f.get("text-optional")),!0);!e.collisionArrays&&o&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(o);let V=(U,Z,B)=>{for(let X=0;X0,ue=this.placedOrientations[Z.crossTileID],xe=ue===d.ah.vertical,Te=ue===d.ah.horizontal||ue===d.ah.horizontalOnly;if(B>0||X>0){let me=Mi(ee.text);V(e.text,B,xe?ga:me),V(e.text,X,Te?ga:me);let ke=ee.text.isHidden();[Z.rightJustifiedTextSymbolIndex,Z.centerJustifiedTextSymbolIndex,Z.leftJustifiedTextSymbolIndex].forEach(be=>{be>=0&&(e.text.placedSymbolArray.get(be).hidden=ke||xe?1:0)}),Z.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(Z.verticalPlacedTextSymbolIndex).hidden=ke||Te?1:0);let qe=this.variableOffsets[Z.crossTileID];qe&&this.markUsedJustification(e,qe.anchor,Z,ue);let _e=this.placedOrientations[Z.crossTileID];_e&&(this.markUsedJustification(e,"left",Z,_e),this.markUsedOrientation(e,_e,Z))}if(le){let me=Mi(ee.icon),ke=!(D&&Z.verticalPlacedIconSymbolIndex&&xe);Z.placedIconSymbolIndex>=0&&(V(e.icon,Z.numIconVertices,ke?me:ga),e.icon.placedSymbolArray.get(Z.placedIconSymbolIndex).hidden=ee.icon.isHidden()),Z.verticalPlacedIconSymbolIndex>=0&&(V(e.icon,Z.numVerticalIconVertices,ke?ga:me),e.icon.placedSymbolArray.get(Z.verticalPlacedIconSymbolIndex).hidden=ee.icon.isHidden())}let fe=j&&j.has(U)?j.get(U):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let me=e.collisionArrays[U];if(me){let ke=new d.P(0,0);if(me.textBox||me.verticalTextBox){let qe=!0;if(T){let _e=this.variableOffsets[K];_e?(ke=Ht(_e.anchor,_e.width,_e.height,_e.textOffset,_e.textBoxScale),S&&ke._rotate(z?this.transform.angle:-this.transform.angle)):qe=!1}if(me.textBox||me.verticalTextBox){let _e;me.textBox&&(_e=xe),me.verticalTextBox&&(_e=Te),fa(e.textCollisionBox.collisionVertexArray,ee.text.placed,!qe||_e,fe.text,ke.x,ke.y)}}if(me.iconBox||me.verticalIconBox){let qe=!!(!Te&&me.verticalIconBox),_e;me.iconBox&&(_e=qe),me.verticalIconBox&&(_e=!qe),fa(e.iconCollisionBox.collisionVertexArray,ee.icon.placed,_e,fe.icon,D?ke.x:0,D?ke.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){let U=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=U.invProjMatrix,e.placementViewportMatrix=U.viewportMatrix,e.collisionCircleArray=U.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTimee}setStale(){this.stale=!0}}function fa(h,e,a,s,o,c){s&&s.length!==0||(s=[0,0,0,0]);let f=s[0]-je,_=s[1]-je,y=s[2]-je,b=s[3]-je;h.emplaceBack(e?1:0,a?1:0,o||0,c||0,f,_),h.emplaceBack(e?1:0,a?1:0,o||0,c||0,y,_),h.emplaceBack(e?1:0,a?1:0,o||0,c||0,y,b),h.emplaceBack(e?1:0,a?1:0,o||0,c||0,f,b)}let st=Math.pow(2,25),Is=Math.pow(2,24),Cs=Math.pow(2,17),Ii=Math.pow(2,16),Ci=Math.pow(2,9),Fl=Math.pow(2,8),Ri=Math.pow(2,1);function Mi(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;let e=h.placed?1:0,a=Math.floor(127*h.opacity);return a*st+e*Is+a*Cs+e*Ii+a*Ci+e*Fl+a*Ri+e}let ga=0;function Hr(){return{isOccluded:(h,e,a)=>!1,getPitchedTextCorrection:(h,e,a)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(h,e,a,s){throw new Error("Not implemented.")},translatePosition:(h,e,a,s)=>function(o,c,f,_,y=!1){if(!f[0]&&!f[1])return[0,0];let b=y?_==="map"?o.angle:0:_==="viewport"?-o.angle:0;if(b){let T=Math.sin(b),S=Math.cos(b);f=[f[0]*S-f[1]*T,f[0]*T+f[1]*S]}return[y?f[0]:He(c,f[0],o.zoom),y?f[1]:He(c,f[1],o.zoom)]}(h,e,a,s),getCircleRadiusCorrection:h=>1}}class Ot{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,a,s,o,c){let f=this._bucketParts;for(;this._currentTileIndex_.sortKey-y.sortKey));this._currentPartIndex!this._forceFullPlacement&&se.now()-o>2;for(;this._currentPlacementIndex>=0;){let f=a[e[this._currentPlacementIndex]],_=this.placement.collisionIndex.transform.zoom;if(f.type==="symbol"&&(!f.minzoom||f.minzoom<=_)&&(!f.maxzoom||f.maxzoom>_)){if(this._inProgressLayer||(this._inProgressLayer=new Ot(f)),this._inProgressLayer.continuePlacement(s[f.source],this.placement,this._showCollisionBoxes,f,c))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}let Hi=512/d.X/2;class Rt{constructor(e,a,s){this.tileID=e,this.bucketInstanceId=s,this._symbolsByKey={};let o=new Map;for(let c=0;c({x:Math.floor(y.anchorX*Hi),y:Math.floor(y.anchorY*Hi)})),crossTileIDs:f.map(y=>y.crossTileID)};if(_.positions.length>128){let y=new d.av(_.positions.length,16,Uint16Array);for(let{x:b,y:T}of _.positions)y.add(b,T);y.finish(),delete _.positions,_.index=y}this._symbolsByKey[c]=_}}getScaledCoordinates(e,a){let{x:s,y:o,z:c}=this.tileID.canonical,{x:f,y:_,z:y}=a.canonical,b=Hi/Math.pow(2,y-c),T=(_*d.X+e.anchorY)*b,S=o*d.X*Hi;return{x:Math.floor((f*d.X+e.anchorX)*b-s*d.X*Hi),y:Math.floor(T-S)}}findMatches(e,a,s){let o=this.tileID.canonical.ze)}}class An{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Xi{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let a=Math.round((e-this.lng)/360);if(a!==0)for(let s in this.indexes){let o=this.indexes[s],c={};for(let f in o){let _=o[f];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+a),c[_.tileID.key]=_}this.indexes[s]=c}this.lng=e}addBucket(e,a,s){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let c=0;ce.overscaledZ)for(let _ in f){let y=f[_];y.tileID.isChildOf(e)&&y.findMatches(a.symbolInstances,e,o)}else{let _=f[e.scaledTo(Number(c)).key];_&&_.findMatches(a.symbolInstances,e,o)}}for(let c=0;c{a[s]=!0});for(let s in this.layerIndexes)a[s]||delete this.layerIndexes[s]}}let Wi=(h,e)=>d.t(h,e&&e.filter(a=>a.identifier!=="source.canvas")),Ol=d.aw();class Pn extends d.E{constructor(e,a={}){super(),this._rtlPluginLoaded=()=>{for(let s in this.sourceCaches){let o=this.sourceCaches[s].getSource().type;o!=="vector"&&o!=="geojson"||this.sourceCaches[s].reload()}},this.map=e,this.dispatcher=new Zr($r(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(s,o)=>this.getGlyphs(s,o)),this.dispatcher.registerMessageHandler("GI",(s,o)=>this.getImages(s,o)),this.imageManager=new Kt,this.imageManager.setEventedParent(this),this.glyphManager=new or(e._requestManager,a.localIdeographFontFamily),this.lineAtlas=new ua(256,512),this.crossTileSymbolIndex=new Ms,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new d.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",d.ay()),hr().on(pe,this._rtlPluginLoaded),this.on("data",s=>{if(s.dataType!=="source"||s.sourceDataType!=="metadata")return;let o=this.sourceCaches[s.sourceId];if(!o)return;let c=o.getSource();if(c&&c.vectorLayerIds)for(let f in this._layers){let _=this._layers[f];_.source===c.id&&this._validateLayer(_)}})}loadURL(e,a={},s){this.fire(new d.k("dataloading",{dataType:"style"})),a.validate=typeof a.validate!="boolean"||a.validate;let o=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;let c=this._loadStyleRequest;d.h(o,this._loadStyleRequest).then(f=>{this._loadStyleRequest=null,this._load(f.data,a,s)}).catch(f=>{this._loadStyleRequest=null,f&&!c.signal.aborted&&this.fire(new d.j(f))})}loadJSON(e,a={},s){this.fire(new d.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,se.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,a.validate=a.validate!==!1,this._load(e,a,s)}).catch(()=>{})}loadEmpty(){this.fire(new d.k("dataloading",{dataType:"style"})),this._load(Ol,{validate:!1})}_load(e,a,s){var o;let c=a.transformStyle?a.transformStyle(s,e):e;if(!a.validate||!Wi(this,d.u(c))){this._loaded=!0,this.stylesheet=c;for(let f in c.sources)this.addSource(f,c.sources[f],{validate:!1});c.sprite?this._loadSprite(c.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(c.glyphs),this._createLayers(),this.light=new vr(this.stylesheet.light),this.sky=new $i(this.stylesheet.sky),this.map.setTerrain((o=this.stylesheet.terrain)!==null&&o!==void 0?o:null),this.fire(new d.k("data",{dataType:"style"})),this.fire(new d.k("style.load"))}}_createLayers(){let e=d.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map(a=>a.id),this._layers={},this._serializedLayers=null;for(let a of e){let s=d.aA(a);s.setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=s}}_loadSprite(e,a=!1,s=void 0){let o;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(c,f,_,y){return d._(this,void 0,void 0,function*(){let b=sr(c),T=_>1?"@2x":"",S={},z={};for(let{id:D,url:R}of b){let V=f.transformRequest(Wa(R,T,".json"),"SpriteJSON");S[D]=d.h(V,y);let j=f.transformRequest(Wa(R,T,".png"),"SpriteImage");z[D]=dt.getImage(j,y)}return yield Promise.all([...Object.values(S),...Object.values(z)]),function(D,R){return d._(this,void 0,void 0,function*(){let V={};for(let j in D){V[j]={};let U=se.getImageCanvasContext((yield R[j]).data),Z=(yield D[j]).data;for(let B in Z){let{width:X,height:K,x:ee,y:le,sdf:ue,pixelRatio:xe,stretchX:Te,stretchY:fe,content:me,textFitWidth:ke,textFitHeight:qe}=Z[B];V[j][B]={data:null,pixelRatio:xe,sdf:ue,stretchX:Te,stretchY:fe,content:me,textFitWidth:ke,textFitHeight:qe,spriteData:{width:X,height:K,x:ee,y:le,context:U}}}}return V})}(S,z)})}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(c=>{if(this._spriteRequest=null,c)for(let f in c){this._spritesImagesIds[f]=[];let _=this._spritesImagesIds[f]?this._spritesImagesIds[f].filter(y=>!(y in c)):[];for(let y of _)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(let y in c[f]){let b=f==="default"?y:`${f}:${y}`;this._spritesImagesIds[f].push(b),b in this.imageManager.images?this.imageManager.updateImage(b,c[f][y],!1):this.imageManager.addImage(b,c[f][y]),a&&(this._changedImages[b]=!0)}}}).catch(c=>{this._spriteRequest=null,o=c,this.fire(new d.j(o))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),a&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new d.k("data",{dataType:"style"})),s&&s(o)})}_unloadSprite(){for(let e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new d.k("data",{dataType:"style"}))}_validateLayer(e){let a=this.sourceCaches[e.source];if(!a)return;let s=e.sourceLayer;if(!s)return;let o=a.getSource();(o.type==="geojson"||o.vectorLayerIds&&o.vectorLayerIds.indexOf(s)===-1)&&this.fire(new d.j(new Error(`Source layer "${s}" does not exist on source "${o.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,a=!1){let s=this._serializedAllLayers();if(!e||e.length===0)return Object.values(a?d.aB(s):s);let o=[];for(let c of e)if(s[c]){let f=a?d.aB(s[c]):s[c];o.push(f)}return o}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};let a=Object.keys(this._layers);for(let s of a){let o=this._layers[s];o.type!=="custom"&&(e[s]=o.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(let e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;let a=this._changed;if(a){let o=Object.keys(this._updatedLayers),c=Object.keys(this._removedLayers);(o.length||c.length)&&this._updateWorkerLayers(o,c);for(let f in this._updatedSources){let _=this._updatedSources[f];if(_==="reload")this._reloadSource(f);else{if(_!=="clear")throw new Error(`Invalid action ${_}`);this._clearSource(f)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let f in this._updatedPaintProps)this._layers[f].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}let s={};for(let o in this.sourceCaches){let c=this.sourceCaches[o];s[o]=c.used,c.used=!1}for(let o of this._order){let c=this._layers[o];c.recalculate(e,this._availableImages),!c.isHidden(e.zoom)&&c.source&&(this.sourceCaches[c.source].used=!0)}for(let o in s){let c=this.sourceCaches[o];!!s[o]!=!!c.used&&c.fire(new d.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:o}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,a&&this.fire(new d.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let e=Object.keys(this._changedImages);if(e.length){for(let a in this.sourceCaches)this.sourceCaches[a].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,a){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:a})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,a={}){var s;this._checkLoaded();let o=this.serialize();if(e=a.transformStyle?a.transformStyle(o,e):e,((s=a.validate)===null||s===void 0||s)&&Wi(this,d.u(e)))return!1;(e=d.aB(e)).layers=d.az(e.layers);let c=d.aC(o,e),f=this._getOperationsToPerform(c);if(f.unimplemented.length>0)throw new Error(`Unimplemented: ${f.unimplemented.join(", ")}.`);if(f.operations.length===0)return!1;for(let _ of f.operations)_();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){let a=[],s=[];for(let o of e)switch(o.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":a.push(()=>this.addLayer.apply(this,o.args));break;case"removeLayer":a.push(()=>this.removeLayer.apply(this,o.args));break;case"setPaintProperty":a.push(()=>this.setPaintProperty.apply(this,o.args));break;case"setLayoutProperty":a.push(()=>this.setLayoutProperty.apply(this,o.args));break;case"setFilter":a.push(()=>this.setFilter.apply(this,o.args));break;case"addSource":a.push(()=>this.addSource.apply(this,o.args));break;case"removeSource":a.push(()=>this.removeSource.apply(this,o.args));break;case"setLayerZoomRange":a.push(()=>this.setLayerZoomRange.apply(this,o.args));break;case"setLight":a.push(()=>this.setLight.apply(this,o.args));break;case"setGeoJSONSourceData":a.push(()=>this.setGeoJSONSourceData.apply(this,o.args));break;case"setGlyphs":a.push(()=>this.setGlyphs.apply(this,o.args));break;case"setSprite":a.push(()=>this.setSprite.apply(this,o.args));break;case"setSky":a.push(()=>this.setSky.apply(this,o.args));break;case"setTerrain":a.push(()=>this.map.setTerrain.apply(this,o.args));break;case"setTransition":a.push(()=>{});break;default:s.push(o.command)}return{operations:a,unimplemented:s}}addImage(e,a){if(this.getImage(e))return this.fire(new d.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,a),this._afterImageUpdated(e)}updateImage(e,a){this.imageManager.updateImage(e,a)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new d.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new d.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,a,s={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error(`Source "${e}" 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"].indexOf(a.type)>=0&&this._validate(d.u.source,`sources.${e}`,a,null,s))return;this.map&&this.map._collectResourceTiming&&(a.collectResourceTiming=!0);let o=this.sourceCaches[e]=new Fe(e,a,this.dispatcher);o.style=this,o.setEventedParent(this,()=>({isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:e})),o.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(let s in this._layers)if(this._layers[s].source===e)return this.fire(new d.j(new Error(`Source "${e}" cannot be removed while layer "${s}" is using it.`)));let a=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],a.fire(new d.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),a.setEventedParent(null),a.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,a){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error(`There is no source with this ID=${e}`);let s=this.sourceCaches[e].getSource();if(s.type!=="geojson")throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(a),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,a,s={}){this._checkLoaded();let o=e.id;if(this.getLayer(o))return void this.fire(new d.j(new Error(`Layer "${o}" already exists on this map.`)));let c;if(e.type==="custom"){if(Wi(this,d.aD(e)))return;c=d.aA(e)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(o,e.source),e=d.aB(e),e=d.e(e,{source:o})),this._validate(d.u.layer,`layers.${o}`,e,{arrayIndex:-1},s))return;c=d.aA(e),this._validateLayer(c),c.setEventedParent(this,{layer:{id:o}})}let f=a?this._order.indexOf(a):this._order.length;if(a&&f===-1)this.fire(new d.j(new Error(`Cannot add layer "${o}" before non-existing layer "${a}".`)));else{if(this._order.splice(f,0,o),this._layerOrderChanged=!0,this._layers[o]=c,this._removedLayers[o]&&c.source&&c.type!=="custom"){let _=this._removedLayers[o];delete this._removedLayers[o],_.type!==c.type?this._updatedSources[c.source]="clear":(this._updatedSources[c.source]="reload",this.sourceCaches[c.source].pause())}this._updateLayer(c),c.onAdd&&c.onAdd(this.map)}}moveLayer(e,a){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new d.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===a)return;let s=this._order.indexOf(e);this._order.splice(s,1);let o=a?this._order.indexOf(a):this._order.length;a&&o===-1?this.fire(new d.j(new Error(`Cannot move layer "${e}" before non-existing layer "${a}".`))):(this._order.splice(o,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();let a=this._layers[e];if(!a)return void this.fire(new d.j(new Error(`Cannot remove non-existing layer "${e}".`)));a.setEventedParent(null);let s=this._order.indexOf(e);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=a,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],a.onRemove&&a.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,a,s){this._checkLoaded();let o=this.getLayer(e);o?o.minzoom===a&&o.maxzoom===s||(a!=null&&(o.minzoom=a),s!=null&&(o.maxzoom=s),this._updateLayer(o)):this.fire(new d.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,a,s={}){this._checkLoaded();let o=this.getLayer(e);if(o){if(!d.aE(o.filter,a))return a==null?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(d.u.filter,`layers.${o.id}.filter`,a,null,s)||(o.filter=d.aB(a),this._updateLayer(o)))}else this.fire(new d.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return d.aB(this.getLayer(e).filter)}setLayoutProperty(e,a,s,o={}){this._checkLoaded();let c=this.getLayer(e);c?d.aE(c.getLayoutProperty(a),s)||(c.setLayoutProperty(a,s,o),this._updateLayer(c)):this.fire(new d.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,a){let s=this.getLayer(e);if(s)return s.getLayoutProperty(a);this.fire(new d.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,a,s,o={}){this._checkLoaded();let c=this.getLayer(e);c?d.aE(c.getPaintProperty(a),s)||(c.setPaintProperty(a,s,o)&&this._updateLayer(c),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new d.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,a){return this.getLayer(e).getPaintProperty(a)}setFeatureState(e,a){this._checkLoaded();let s=e.source,o=e.sourceLayer,c=this.sourceCaches[s];if(c===void 0)return void this.fire(new d.j(new Error(`The source '${s}' does not exist in the map's style.`)));let f=c.getSource().type;f==="geojson"&&o?this.fire(new d.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):f!=="vector"||o?(e.id===void 0&&this.fire(new d.j(new Error("The feature id parameter must be provided."))),c.setFeatureState(o,e.id,a)):this.fire(new d.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,a){this._checkLoaded();let s=e.source,o=this.sourceCaches[s];if(o===void 0)return void this.fire(new d.j(new Error(`The source '${s}' does not exist in the map's style.`)));let c=o.getSource().type,f=c==="vector"?e.sourceLayer:void 0;c!=="vector"||f?a&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new d.j(new Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(f,e.id,a):this.fire(new d.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();let a=e.source,s=e.sourceLayer,o=this.sourceCaches[a];if(o!==void 0)return o.getSource().type!=="vector"||s?(e.id===void 0&&this.fire(new d.j(new Error("The feature id parameter must be provided."))),o.getFeatureState(s,e.id)):void this.fire(new d.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new d.j(new Error(`The source '${a}' does not exist in the map's style.`)))}getTransition(){return d.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let e=d.aF(this.sourceCaches,c=>c.serialize()),a=this._serializeByIds(this._order,!0),s=this.map.getTerrain()||void 0,o=this.stylesheet;return d.aG({version:o.version,name:o.name,metadata:o.metadata,light:o.light,sky:o.sky,center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,sprite:o.sprite,glyphs:o.glyphs,transition:o.transition,sources:e,layers:a,terrain:s},c=>c!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let a=f=>this._layers[f].type==="fill-extrusion",s={},o=[];for(let f=this._order.length-1;f>=0;f--){let _=this._order[f];if(a(_)){s[_]=f;for(let y of e){let b=y[_];if(b)for(let T of b)o.push(T)}}}o.sort((f,_)=>_.intersectionZ-f.intersectionZ);let c=[];for(let f=this._order.length-1;f>=0;f--){let _=this._order[f];if(a(_))for(let y=o.length-1;y>=0;y--){let b=o[y].feature;if(s[b.layer.id]{let ue=U.featureSortOrder;if(ue){let xe=ue.indexOf(ee.featureIndex);return ue.indexOf(le.featureIndex)-xe}return le.featureIndex-ee.featureIndex});for(let ee of K)X.push(ee)}}for(let U in R)R[U].forEach(Z=>{let B=Z.feature,X=b[_[U].source].getFeatureState(B.layer["source-layer"],B.id);B.source=B.layer.source,B.layer["source-layer"]&&(B.sourceLayer=B.layer["source-layer"]),B.state=X});return R}(this._layers,f,this.sourceCaches,e,a,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)}querySourceFeatures(e,a){a&&a.filter&&this._validate(d.u.filter,"querySourceFeatures.filter",a.filter,null,a);let s=this.sourceCaches[e];return s?function(o,c){let f=o.getRenderableIds().map(b=>o.getTileByID(b)),_=[],y={};for(let b=0;bz.getTileByID(D)).sort((D,R)=>R.tileID.overscaledZ-D.tileID.overscaledZ||(D.tileID.isLessThan(R.tileID)?-1:1))}let S=this.crossTileSymbolIndex.addLayer(T,y[T.source],e.center.lng);f=f||S}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((c=c||this._layerOrderChanged||s===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(se.now(),e.zoom))&&(this.pauseablePlacement=new tn(e,this.map.terrain,this._order,c,a,s,o,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(se.now()),_=!0),f&&this.pauseablePlacement.placement.setStale()),_||f)for(let b of this._order){let T=this._layers[b];T.type==="symbol"&&this.placement.updateLayerOpacities(T,y[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(se.now())}_releaseSymbolFadeTiles(){for(let e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,a){return d._(this,void 0,void 0,function*(){let s=yield this.imageManager.getImages(a.icons);this._updateTilesForChangedImages();let o=this.sourceCaches[a.source];return o&&o.setDependencies(a.tileID.key,a.type,a.icons),s})}getGlyphs(e,a){return d._(this,void 0,void 0,function*(){let s=yield this.glyphManager.getGlyphs(a.stacks),o=this.sourceCaches[a.source];return o&&o.setDependencies(a.tileID.key,a.type,[""]),s})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,a={}){this._checkLoaded(),e&&this._validate(d.u.glyphs,"glyphs",e,null,a)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,a,s={},o){this._checkLoaded();let c=[{id:e,url:a}],f=[...sr(this.stylesheet.sprite),...c];this._validate(d.u.sprite,"sprite",f,null,s)||(this.stylesheet.sprite=f,this._loadSprite(c,!0,o))}removeSprite(e){this._checkLoaded();let a=sr(this.stylesheet.sprite);if(a.find(s=>s.id===e)){if(this._spritesImagesIds[e])for(let s of this._spritesImagesIds[e])this.imageManager.removeImage(s),this._changedImages[s]=!0;a.splice(a.findIndex(s=>s.id===e),1),this.stylesheet.sprite=a.length>0?a:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new d.k("data",{dataType:"style"}))}else this.fire(new d.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return sr(this.stylesheet.sprite)}setSprite(e,a={},s){this._checkLoaded(),e&&this._validate(d.u.sprite,"sprite",e,null,a)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,s):(this._unloadSprite(),s&&s(null)))}}var Xr=d.Y([{name:"a_pos",type:"Int16",components:2}]);let Rr={prelude:rt(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -54,15 +54,15 @@ vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=frac #else return 0.0; #endif -}`),background:Ue(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +}`),background:rt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Ue(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:rt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Ue(`varying vec3 v_data;varying float v_visibility; +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:rt(`varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur @@ -78,7 +78,7 @@ void main() { #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +vec2 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));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif @@ -98,7 +98,7 @@ void main(void) { #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Ue("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Ue(`uniform highp float u_intensity;varying vec2 v_extrude; +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:rt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:rt(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { @@ -115,11 +115,11 @@ const highp float ZERO=1.0/255.0/16.0; void main(void) { #pragma mapbox: initialize highp float weight #pragma mapbox: initialize mediump float radius -vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Ue(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:rt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(0.0); #endif -}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Ue("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ue("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Ue("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Ue(`#pragma mapbox: define highp vec4 color +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:rt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}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:rt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:rt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:rt(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color @@ -134,7 +134,7 @@ gl_FragColor=vec4(1.0); void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Ue(`varying vec2 v_pos; +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:rt(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { @@ -150,7 +150,7 @@ gl_FragColor=vec4(1.0); void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Ue(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:rt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to @@ -174,7 +174,7 @@ void main() { #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Ue(`#ifdef GL_ES +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:rt(`#ifdef GL_ES precision highp float; #endif uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; @@ -201,7 +201,7 @@ void main() { #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Ue(`varying vec4 v_color;void main() {gl_FragColor=v_color; +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:rt(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif @@ -223,7 +223,7 @@ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_off #else float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Ue(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:rt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from @@ -267,20 +267,20 @@ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Ue(`#ifdef GL_ES +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:rt(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Ue(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:rt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Ue(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:rt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -314,7 +314,7 @@ v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif -v_width2=vec2(outset,inset);}`),lineGradient:Ue(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +v_width2=vec2(outset,inset);}`),lineGradient:rt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { @@ -344,7 +344,7 @@ v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif -v_width2=vec2(outset,inset);}`),linePattern:Ue(`#ifdef GL_ES +v_width2=vec2(outset,inset);}`),linePattern:rt(`#ifdef GL_ES precision highp float; #endif uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; @@ -396,7 +396,7 @@ v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ue(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:rt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -437,11 +437,11 @@ v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif -v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Ue(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:rt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Ue(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:rt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity @@ -449,13 +449,13 @@ lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)* #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; +}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Ue(`#define SDF_PX 8.0 +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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;vec4 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;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:rt(`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color @@ -472,7 +472,7 @@ float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scal #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; +}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform 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;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity @@ -484,9 +484,9 @@ void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Ue(`#define SDF_PX 8.0 +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*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;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:rt(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; @@ -509,7 +509,7 @@ return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float ga #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; +}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity @@ -521,60 +521,65 @@ void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Ue("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ea),terrainDepth:Ue("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Ea),terrainCoords:Ue("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Ea)};function Ue(h,t){let n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=t.match(/attribute ([\w]+) ([\w]+)/g),l=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),p=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=p?p.concat(l):l,g={};return{fragmentSource:h=h.replace(n,(y,v,w,E,A)=>(g[A]=!0,v==="define"?` -#ifndef HAS_UNIFORM_u_${A} -varying ${w} ${E} ${A}; +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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;vec4 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;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:rt("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;varying vec2 v_texture_pos;varying 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=texture2D(u_texture,v_texture_pos);if (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);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying 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=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:rt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying 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=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:rt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying 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=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:rt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function rt(h,e){let a=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=e.match(/attribute ([\w]+) ([\w]+)/g),o=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),c=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=c?c.concat(o):o,_={};return{fragmentSource:h=h.replace(a,(y,b,T,S,z)=>(_[z]=!0,b==="define"?` +#ifndef HAS_UNIFORM_u_${z} +varying ${T} ${S} ${z}; #else -uniform ${w} ${E} u_${A}; +uniform ${T} ${S} u_${z}; #endif `:` -#ifdef HAS_UNIFORM_u_${A} - ${w} ${E} ${A} = u_${A}; -#endif -`)),vertexSource:t=t.replace(n,(y,v,w,E,A)=>{let B=E==="float"?"vec2":"vec4",D=A.match(/color/)?"color":B;return g[A]?v==="define"?` -#ifndef HAS_UNIFORM_u_${A} -uniform lowp float u_${A}_t; -attribute ${w} ${B} a_${A}; -varying ${w} ${E} ${A}; +#ifdef HAS_UNIFORM_u_${z} + ${T} ${S} ${z} = u_${z}; +#endif +`)),vertexSource:e=e.replace(a,(y,b,T,S,z)=>{let D=S==="float"?"vec2":"vec4",R=z.match(/color/)?"color":D;return _[z]?b==="define"?` +#ifndef HAS_UNIFORM_u_${z} +uniform lowp float u_${z}_t; +attribute ${T} ${D} a_${z}; +varying ${T} ${S} ${z}; #else -uniform ${w} ${E} u_${A}; +uniform ${T} ${S} u_${z}; #endif -`:D==="vec4"?` -#ifndef HAS_UNIFORM_u_${A} - ${A} = a_${A}; +`:R==="vec4"?` +#ifndef HAS_UNIFORM_u_${z} + ${z} = a_${z}; #else - ${w} ${E} ${A} = u_${A}; + ${T} ${S} ${z} = u_${z}; #endif `:` -#ifndef HAS_UNIFORM_u_${A} - ${A} = unpack_mix_${D}(a_${A}, u_${A}_t); +#ifndef HAS_UNIFORM_u_${z} + ${z} = unpack_mix_${R}(a_${z}, u_${z}_t); #else - ${w} ${E} ${A} = u_${A}; + ${T} ${S} ${z} = u_${z}; #endif -`:v==="define"?` -#ifndef HAS_UNIFORM_u_${A} -uniform lowp float u_${A}_t; -attribute ${w} ${B} a_${A}; +`:b==="define"?` +#ifndef HAS_UNIFORM_u_${z} +uniform lowp float u_${z}_t; +attribute ${T} ${D} a_${z}; #else -uniform ${w} ${E} u_${A}; +uniform ${T} ${S} u_${z}; #endif -`:D==="vec4"?` -#ifndef HAS_UNIFORM_u_${A} - ${w} ${E} ${A} = a_${A}; +`:R==="vec4"?` +#ifndef HAS_UNIFORM_u_${z} + ${T} ${S} ${z} = a_${z}; #else - ${w} ${E} ${A} = u_${A}; + ${T} ${S} ${z} = u_${z}; #endif `:` -#ifndef HAS_UNIFORM_u_${A} - ${w} ${E} ${A} = unpack_mix_${D}(a_${A}, u_${A}_t); +#ifndef HAS_UNIFORM_u_${z} + ${T} ${S} ${z} = unpack_mix_${R}(a_${z}, u_${z}_t); #else - ${w} ${E} ${A} = u_${A}; -#endif -`}),staticAttributes:s,staticUniforms:f}}class Xn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,s,l,p,f,g,y,v){this.context=t;let w=this.boundPaintVertexBuffers.length!==l.length;for(let E=0;!w&&E({u_depth:new c.Uniform1i(ie,ae.u_depth),u_terrain:new c.Uniform1i(ie,ae.u_terrain),u_terrain_dim:new c.Uniform1f(ie,ae.u_terrain_dim),u_terrain_matrix:new c.UniformMatrix4f(ie,ae.u_terrain_matrix),u_terrain_unpack:new c.Uniform4f(ie,ae.u_terrain_unpack),u_terrain_exaggeration:new c.Uniform1f(ie,ae.u_terrain_exaggeration)}))(t,ee),this.binderUniforms=s?s.getUniforms(t,ee):[]}draw(t,n,s,l,p,f,g,y,v,w,E,A,B,D,O,k,G,J){let U=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(s),t.setStencilMode(l),t.setColorMode(p),t.setCullFace(f),y){t.activeTexture.set(U.TEXTURE2),U.bindTexture(U.TEXTURE_2D,y.depthTexture),t.activeTexture.set(U.TEXTURE3),U.bindTexture(U.TEXTURE_2D,y.texture);for(let ee in this.terrainUniforms)this.terrainUniforms[ee].set(y[ee])}for(let ee in this.fixedUniforms)this.fixedUniforms[ee].set(g[ee]);O&&O.setUniforms(t,this.binderUniforms,B,{zoom:D});let H=0;switch(n){case U.LINES:H=2;break;case U.TRIANGLES:H=3;break;case U.LINE_STRIP:H=1}for(let ee of A.get()){let ie=ee.vaos||(ee.vaos={});(ie[v]||(ie[v]=new Xn)).bind(t,this,w,O?O.getPaintVertexBuffers():[],E,ee.vertexOffset,k,G,J),U.drawElements(n,ee.primitiveLength*H,U.UNSIGNED_SHORT,ee.primitiveOffset*H*2)}}}function Hn(h,t,n){let s=1/X(n,1,t.transform.tileZoom),l=Math.pow(2,n.tileID.overscaledZ),p=n.tileSize*Math.pow(2,t.transform.tileZoom)/l,f=p*(n.tileID.canonical.x+n.tileID.wrap*l),g=p*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[f>>16,g>>16],u_pixel_coord_lower:[65535&f,65535&g]}}let Gi=(h,t,n,s)=>{let l=t.style.light,p=l.properties.get("position"),f=[p.x,p.y,p.z],g=function(){var v=new c.ARRAY_TYPE(9);return c.ARRAY_TYPE!=Float32Array&&(v[1]=0,v[2]=0,v[3]=0,v[5]=0,v[6]=0,v[7]=0),v[0]=1,v[4]=1,v[8]=1,v}();l.properties.get("anchor")==="viewport"&&function(v,w){var E=Math.sin(w),A=Math.cos(w);v[0]=A,v[1]=E,v[2]=0,v[3]=-E,v[4]=A,v[5]=0,v[6]=0,v[7]=0,v[8]=1}(g,-t.transform.angle),function(v,w,E){var A=w[0],B=w[1],D=w[2];v[0]=A*E[0]+B*E[3]+D*E[6],v[1]=A*E[1]+B*E[4]+D*E[7],v[2]=A*E[2]+B*E[5]+D*E[8]}(f,f,g);let y=l.properties.get("color");return{u_matrix:h,u_lightpos:f,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_vertical_gradient:+n,u_opacity:s}},vo=(h,t,n,s,l,p,f)=>c.extend(Gi(h,t,n,s),Hn(p,t,f),{u_height_factor:-Math.pow(2,l.overscaledZ)/f.tileSize/8}),Tr=h=>({u_matrix:h}),bo=(h,t,n,s)=>c.extend(Tr(h),Hn(n,t,s)),wo=(h,t)=>({u_matrix:h,u_world:t}),Ta=(h,t,n,s,l)=>c.extend(bo(h,t,n,s),{u_world:l}),Sa=(h,t,n,s)=>{let l=h.transform,p,f;if(s.paint.get("circle-pitch-alignment")==="map"){let g=X(n,1,l.zoom);p=!0,f=[g,g]}else p=!1,f=l.pixelsToGLUnits;return{u_camera_to_center_distance:l.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:h.translatePosMatrix(t.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:h.pixelRatio,u_extrude_scale:f}},Fr=(h,t,n)=>{let s=X(n,1,t.zoom),l=Math.pow(2,t.zoom-n.tileID.overscaledZ),p=n.tileID.overscaleFactor();return{u_matrix:h,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[t.pixelsToGLUnits[0]/(s*l),t.pixelsToGLUnits[1]/(s*l)],u_overscale_factor:p}},Ia=(h,t,n=1)=>({u_matrix:h,u_color:t,u_overlay:0,u_overlay_scale:n}),Wn=h=>({u_matrix:h}),bl=(h,t,n,s)=>({u_matrix:h,u_extrude_scale:X(t,1,n),u_intensity:s});function wl(h,t){let n=Math.pow(2,t.canonical.z),s=t.canonical.y;return[new c.MercatorCoordinate(0,s/n).toLngLat().lat,new c.MercatorCoordinate(0,(s+1)/n).toLngLat().lat]}let Kn=(h,t,n,s)=>{let l=h.transform;return{u_matrix:To(h,t,n,s),u_ratio:1/X(t,1,l.zoom),u_device_pixel_ratio:h.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},El=(h,t,n,s,l)=>c.extend(Kn(h,t,n,l),{u_image:0,u_image_height:s}),Eo=(h,t,n,s,l)=>{let p=h.transform,f=us(t,p);return{u_matrix:To(h,t,n,l),u_texsize:t.imageAtlasTexture.size,u_ratio:1/X(t,1,p.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[f,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Tl=(h,t,n,s,l,p)=>{let f=h.lineAtlas,g=us(t,h.transform),y=n.layout.get("line-cap")==="round",v=f.getDash(s.from,y),w=f.getDash(s.to,y),E=v.width*l.fromScale,A=w.width*l.toScale;return c.extend(Kn(h,t,n,p),{u_patternscale_a:[g/E,-v.height/2],u_patternscale_b:[g/A,-w.height/2],u_sdfgamma:f.width/(256*Math.min(E,A)*h.pixelRatio)/2,u_image:0,u_tex_y_a:v.y,u_tex_y_b:w.y,u_mix:l.t})};function us(h,t){return 1/X(h,1,t.tileZoom)}function To(h,t,n,s){return h.translatePosMatrix(s?s.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}let ps=(h,t,n,s,l)=>{return{u_matrix:h,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*l.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:l.paint.get("raster-brightness-min"),u_brightness_high:l.paint.get("raster-brightness-max"),u_saturation_factor:(f=l.paint.get("raster-saturation"),f>0?1-1/(1.001-f):-f),u_contrast_factor:(p=l.paint.get("raster-contrast"),p>0?1/(1-p):1+p),u_spin_weights:So(l.paint.get("raster-hue-rotate"))};var p,f};function So(h){h*=Math.PI/180;let t=Math.sin(h),n=Math.cos(h);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}let ds=(h,t,n,s,l,p,f,g,y,v)=>{let w=l.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:w.cameraToCenterDistance,u_pitch:w.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:w.width/w.height,u_fade_change:l.options.fadeDuration?l.symbolFadeChange:1,u_matrix:p,u_label_plane_matrix:f,u_coord_matrix:g,u_is_text:+y,u_pitch_with_map:+s,u_texsize:v,u_texture:0}},ms=(h,t,n,s,l,p,f,g,y,v,w)=>{let E=l.transform;return c.extend(ds(h,t,n,s,l,p,f,g,y,v),{u_gamma_scale:s?Math.cos(E._pitch)*E.cameraToCenterDistance:1,u_device_pixel_ratio:l.pixelRatio,u_is_halo:+w})},Io=(h,t,n,s,l,p,f,g,y,v)=>c.extend(ms(h,t,n,s,l,p,f,g,!0,y,!0),{u_texsize_icon:v,u_texture_icon:1}),rn=(h,t,n)=>({u_matrix:h,u_opacity:t,u_color:n}),Ca=(h,t,n,s,l,p)=>c.extend(function(f,g,y,v){let w=y.imageManager.getPattern(f.from.toString()),E=y.imageManager.getPattern(f.to.toString()),{width:A,height:B}=y.imageManager.getPixelSize(),D=Math.pow(2,v.tileID.overscaledZ),O=v.tileSize*Math.pow(2,y.transform.tileZoom)/D,k=O*(v.tileID.canonical.x+v.tileID.wrap*D),G=O*v.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:w.tl,u_pattern_br_a:w.br,u_pattern_tl_b:E.tl,u_pattern_br_b:E.br,u_texsize:[A,B],u_mix:g.t,u_pattern_size_a:w.displaySize,u_pattern_size_b:E.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/X(v,1,y.transform.tileZoom),u_pixel_coord_upper:[k>>16,G>>16],u_pixel_coord_lower:[65535&k,65535&G]}}(s,p,n,l),{u_matrix:h,u_opacity:t}),Xi={fillExtrusion:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_lightpos:new c.Uniform3f(h,t.u_lightpos),u_lightintensity:new c.Uniform1f(h,t.u_lightintensity),u_lightcolor:new c.Uniform3f(h,t.u_lightcolor),u_vertical_gradient:new c.Uniform1f(h,t.u_vertical_gradient),u_opacity:new c.Uniform1f(h,t.u_opacity)}),fillExtrusionPattern:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_lightpos:new c.Uniform3f(h,t.u_lightpos),u_lightintensity:new c.Uniform1f(h,t.u_lightintensity),u_lightcolor:new c.Uniform3f(h,t.u_lightcolor),u_vertical_gradient:new c.Uniform1f(h,t.u_vertical_gradient),u_height_factor:new c.Uniform1f(h,t.u_height_factor),u_image:new c.Uniform1i(h,t.u_image),u_texsize:new c.Uniform2f(h,t.u_texsize),u_pixel_coord_upper:new c.Uniform2f(h,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.Uniform2f(h,t.u_pixel_coord_lower),u_scale:new c.Uniform3f(h,t.u_scale),u_fade:new c.Uniform1f(h,t.u_fade),u_opacity:new c.Uniform1f(h,t.u_opacity)}),fill:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix)}),fillPattern:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_image:new c.Uniform1i(h,t.u_image),u_texsize:new c.Uniform2f(h,t.u_texsize),u_pixel_coord_upper:new c.Uniform2f(h,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.Uniform2f(h,t.u_pixel_coord_lower),u_scale:new c.Uniform3f(h,t.u_scale),u_fade:new c.Uniform1f(h,t.u_fade)}),fillOutline:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_world:new c.Uniform2f(h,t.u_world)}),fillOutlinePattern:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_world:new c.Uniform2f(h,t.u_world),u_image:new c.Uniform1i(h,t.u_image),u_texsize:new c.Uniform2f(h,t.u_texsize),u_pixel_coord_upper:new c.Uniform2f(h,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.Uniform2f(h,t.u_pixel_coord_lower),u_scale:new c.Uniform3f(h,t.u_scale),u_fade:new c.Uniform1f(h,t.u_fade)}),circle:(h,t)=>({u_camera_to_center_distance:new c.Uniform1f(h,t.u_camera_to_center_distance),u_scale_with_map:new c.Uniform1i(h,t.u_scale_with_map),u_pitch_with_map:new c.Uniform1i(h,t.u_pitch_with_map),u_extrude_scale:new c.Uniform2f(h,t.u_extrude_scale),u_device_pixel_ratio:new c.Uniform1f(h,t.u_device_pixel_ratio),u_matrix:new c.UniformMatrix4f(h,t.u_matrix)}),collisionBox:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_camera_to_center_distance:new c.Uniform1f(h,t.u_camera_to_center_distance),u_pixels_to_tile_units:new c.Uniform1f(h,t.u_pixels_to_tile_units),u_extrude_scale:new c.Uniform2f(h,t.u_extrude_scale),u_overscale_factor:new c.Uniform1f(h,t.u_overscale_factor)}),collisionCircle:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_inv_matrix:new c.UniformMatrix4f(h,t.u_inv_matrix),u_camera_to_center_distance:new c.Uniform1f(h,t.u_camera_to_center_distance),u_viewport_size:new c.Uniform2f(h,t.u_viewport_size)}),debug:(h,t)=>({u_color:new c.UniformColor(h,t.u_color),u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_overlay:new c.Uniform1i(h,t.u_overlay),u_overlay_scale:new c.Uniform1f(h,t.u_overlay_scale)}),clippingMask:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix)}),heatmap:(h,t)=>({u_extrude_scale:new c.Uniform1f(h,t.u_extrude_scale),u_intensity:new c.Uniform1f(h,t.u_intensity),u_matrix:new c.UniformMatrix4f(h,t.u_matrix)}),heatmapTexture:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_world:new c.Uniform2f(h,t.u_world),u_image:new c.Uniform1i(h,t.u_image),u_color_ramp:new c.Uniform1i(h,t.u_color_ramp),u_opacity:new c.Uniform1f(h,t.u_opacity)}),hillshade:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_image:new c.Uniform1i(h,t.u_image),u_latrange:new c.Uniform2f(h,t.u_latrange),u_light:new c.Uniform2f(h,t.u_light),u_shadow:new c.UniformColor(h,t.u_shadow),u_highlight:new c.UniformColor(h,t.u_highlight),u_accent:new c.UniformColor(h,t.u_accent)}),hillshadePrepare:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_image:new c.Uniform1i(h,t.u_image),u_dimension:new c.Uniform2f(h,t.u_dimension),u_zoom:new c.Uniform1f(h,t.u_zoom),u_unpack:new c.Uniform4f(h,t.u_unpack)}),line:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_ratio:new c.Uniform1f(h,t.u_ratio),u_device_pixel_ratio:new c.Uniform1f(h,t.u_device_pixel_ratio),u_units_to_pixels:new c.Uniform2f(h,t.u_units_to_pixels)}),lineGradient:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_ratio:new c.Uniform1f(h,t.u_ratio),u_device_pixel_ratio:new c.Uniform1f(h,t.u_device_pixel_ratio),u_units_to_pixels:new c.Uniform2f(h,t.u_units_to_pixels),u_image:new c.Uniform1i(h,t.u_image),u_image_height:new c.Uniform1f(h,t.u_image_height)}),linePattern:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_texsize:new c.Uniform2f(h,t.u_texsize),u_ratio:new c.Uniform1f(h,t.u_ratio),u_device_pixel_ratio:new c.Uniform1f(h,t.u_device_pixel_ratio),u_image:new c.Uniform1i(h,t.u_image),u_units_to_pixels:new c.Uniform2f(h,t.u_units_to_pixels),u_scale:new c.Uniform3f(h,t.u_scale),u_fade:new c.Uniform1f(h,t.u_fade)}),lineSDF:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_ratio:new c.Uniform1f(h,t.u_ratio),u_device_pixel_ratio:new c.Uniform1f(h,t.u_device_pixel_ratio),u_units_to_pixels:new c.Uniform2f(h,t.u_units_to_pixels),u_patternscale_a:new c.Uniform2f(h,t.u_patternscale_a),u_patternscale_b:new c.Uniform2f(h,t.u_patternscale_b),u_sdfgamma:new c.Uniform1f(h,t.u_sdfgamma),u_image:new c.Uniform1i(h,t.u_image),u_tex_y_a:new c.Uniform1f(h,t.u_tex_y_a),u_tex_y_b:new c.Uniform1f(h,t.u_tex_y_b),u_mix:new c.Uniform1f(h,t.u_mix)}),raster:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_tl_parent:new c.Uniform2f(h,t.u_tl_parent),u_scale_parent:new c.Uniform1f(h,t.u_scale_parent),u_buffer_scale:new c.Uniform1f(h,t.u_buffer_scale),u_fade_t:new c.Uniform1f(h,t.u_fade_t),u_opacity:new c.Uniform1f(h,t.u_opacity),u_image0:new c.Uniform1i(h,t.u_image0),u_image1:new c.Uniform1i(h,t.u_image1),u_brightness_low:new c.Uniform1f(h,t.u_brightness_low),u_brightness_high:new c.Uniform1f(h,t.u_brightness_high),u_saturation_factor:new c.Uniform1f(h,t.u_saturation_factor),u_contrast_factor:new c.Uniform1f(h,t.u_contrast_factor),u_spin_weights:new c.Uniform3f(h,t.u_spin_weights)}),symbolIcon:(h,t)=>({u_is_size_zoom_constant:new c.Uniform1i(h,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.Uniform1i(h,t.u_is_size_feature_constant),u_size_t:new c.Uniform1f(h,t.u_size_t),u_size:new c.Uniform1f(h,t.u_size),u_camera_to_center_distance:new c.Uniform1f(h,t.u_camera_to_center_distance),u_pitch:new c.Uniform1f(h,t.u_pitch),u_rotate_symbol:new c.Uniform1i(h,t.u_rotate_symbol),u_aspect_ratio:new c.Uniform1f(h,t.u_aspect_ratio),u_fade_change:new c.Uniform1f(h,t.u_fade_change),u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_label_plane_matrix:new c.UniformMatrix4f(h,t.u_label_plane_matrix),u_coord_matrix:new c.UniformMatrix4f(h,t.u_coord_matrix),u_is_text:new c.Uniform1i(h,t.u_is_text),u_pitch_with_map:new c.Uniform1i(h,t.u_pitch_with_map),u_texsize:new c.Uniform2f(h,t.u_texsize),u_texture:new c.Uniform1i(h,t.u_texture)}),symbolSDF:(h,t)=>({u_is_size_zoom_constant:new c.Uniform1i(h,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.Uniform1i(h,t.u_is_size_feature_constant),u_size_t:new c.Uniform1f(h,t.u_size_t),u_size:new c.Uniform1f(h,t.u_size),u_camera_to_center_distance:new c.Uniform1f(h,t.u_camera_to_center_distance),u_pitch:new c.Uniform1f(h,t.u_pitch),u_rotate_symbol:new c.Uniform1i(h,t.u_rotate_symbol),u_aspect_ratio:new c.Uniform1f(h,t.u_aspect_ratio),u_fade_change:new c.Uniform1f(h,t.u_fade_change),u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_label_plane_matrix:new c.UniformMatrix4f(h,t.u_label_plane_matrix),u_coord_matrix:new c.UniformMatrix4f(h,t.u_coord_matrix),u_is_text:new c.Uniform1i(h,t.u_is_text),u_pitch_with_map:new c.Uniform1i(h,t.u_pitch_with_map),u_texsize:new c.Uniform2f(h,t.u_texsize),u_texture:new c.Uniform1i(h,t.u_texture),u_gamma_scale:new c.Uniform1f(h,t.u_gamma_scale),u_device_pixel_ratio:new c.Uniform1f(h,t.u_device_pixel_ratio),u_is_halo:new c.Uniform1i(h,t.u_is_halo)}),symbolTextAndIcon:(h,t)=>({u_is_size_zoom_constant:new c.Uniform1i(h,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.Uniform1i(h,t.u_is_size_feature_constant),u_size_t:new c.Uniform1f(h,t.u_size_t),u_size:new c.Uniform1f(h,t.u_size),u_camera_to_center_distance:new c.Uniform1f(h,t.u_camera_to_center_distance),u_pitch:new c.Uniform1f(h,t.u_pitch),u_rotate_symbol:new c.Uniform1i(h,t.u_rotate_symbol),u_aspect_ratio:new c.Uniform1f(h,t.u_aspect_ratio),u_fade_change:new c.Uniform1f(h,t.u_fade_change),u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_label_plane_matrix:new c.UniformMatrix4f(h,t.u_label_plane_matrix),u_coord_matrix:new c.UniformMatrix4f(h,t.u_coord_matrix),u_is_text:new c.Uniform1i(h,t.u_is_text),u_pitch_with_map:new c.Uniform1i(h,t.u_pitch_with_map),u_texsize:new c.Uniform2f(h,t.u_texsize),u_texsize_icon:new c.Uniform2f(h,t.u_texsize_icon),u_texture:new c.Uniform1i(h,t.u_texture),u_texture_icon:new c.Uniform1i(h,t.u_texture_icon),u_gamma_scale:new c.Uniform1f(h,t.u_gamma_scale),u_device_pixel_ratio:new c.Uniform1f(h,t.u_device_pixel_ratio),u_is_halo:new c.Uniform1i(h,t.u_is_halo)}),background:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_opacity:new c.Uniform1f(h,t.u_opacity),u_color:new c.UniformColor(h,t.u_color)}),backgroundPattern:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_opacity:new c.Uniform1f(h,t.u_opacity),u_image:new c.Uniform1i(h,t.u_image),u_pattern_tl_a:new c.Uniform2f(h,t.u_pattern_tl_a),u_pattern_br_a:new c.Uniform2f(h,t.u_pattern_br_a),u_pattern_tl_b:new c.Uniform2f(h,t.u_pattern_tl_b),u_pattern_br_b:new c.Uniform2f(h,t.u_pattern_br_b),u_texsize:new c.Uniform2f(h,t.u_texsize),u_mix:new c.Uniform1f(h,t.u_mix),u_pattern_size_a:new c.Uniform2f(h,t.u_pattern_size_a),u_pattern_size_b:new c.Uniform2f(h,t.u_pattern_size_b),u_scale_a:new c.Uniform1f(h,t.u_scale_a),u_scale_b:new c.Uniform1f(h,t.u_scale_b),u_pixel_coord_upper:new c.Uniform2f(h,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.Uniform2f(h,t.u_pixel_coord_lower),u_tile_units_to_pixels:new c.Uniform1f(h,t.u_tile_units_to_pixels)}),terrain:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_texture:new c.Uniform1i(h,t.u_texture),u_ele_delta:new c.Uniform1f(h,t.u_ele_delta)}),terrainDepth:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_ele_delta:new c.Uniform1f(h,t.u_ele_delta)}),terrainCoords:(h,t)=>({u_matrix:new c.UniformMatrix4f(h,t.u_matrix),u_texture:new c.Uniform1i(h,t.u_texture),u_terrain_coords_id:new c.Uniform1f(h,t.u_terrain_coords_id),u_ele_delta:new c.Uniform1f(h,t.u_ele_delta)})};class Aa{constructor(t,n,s){this.context=t;let l=t.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let za={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Yn{constructor(t,n,s,l){this.length=n.length,this.attributes=s,this.itemSize=n.bytesPerElement,this.dynamicDraw=l,this.context=t;let p=t.gl;this.buffer=p.createBuffer(),t.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}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}`);let n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let s=0;s0){let pe=c.create(),Se=ae;c.mul(pe,ie.placementInvProjMatrix,h.transform.glCoordMatrix),c.mul(pe,pe,ie.placementViewportMatrix),w.push({circleArray:ce,circleOffset:A,transform:Se,invTransform:pe,coord:H}),E+=ce.length/4,A=E}he&&v.draw(g,y.LINES,et.disabled,ut.disabled,h.colorModeForRenderPass(),_t.disabled,Fr(ae,h.transform,ee),h.style.map.terrain&&h.style.map.terrain.getTerrainData(H),n.id,he.layoutVertexBuffer,he.indexBuffer,he.segments,null,h.transform.zoom,null,null,he.collisionVertexBuffer)}if(!f||!w.length)return;let B=h.useProgram("collisionCircle"),D=new c.CollisionCircleLayoutArray;D.resize(4*E),D._trim();let O=0;for(let U of w)for(let H=0;H=0&&(D[k.associatedIconIndex]={shiftedAnchor:He,angle:_e})}else C(k.numGlyphs,A)}if(v){B.clear();let O=h.icon.placedSymbolArray;for(let k=0;kh.style.map.terrain.getElevation(he,Oi,Ft):null,Rt=n.layout.get("text-rotation-alignment")==="map";lr(pe,he.posMatrix,h,l,fr,bt,k,v,Rt,Bt)}let Ir=h.translatePosMatrix(he.posMatrix,ce,p,f),on=G||l&&ie||$r?Pl:fr,di=h.translatePosMatrix(bt,ce,p,f,!0),ei=_e&&n.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ni;ni=_e?pe.iconsInText?Io(Re.kind,je,J,k,h,Ir,on,di,We,Pt):ms(Re.kind,je,J,k,h,Ir,on,di,l,We,!0):ds(Re.kind,je,J,k,h,Ir,on,di,l,We);let pa={program:vt,buffers:Se,uniformValues:ni,atlasTexture:Lt,atlasTextureIcon:It,atlasInterpolation:pt,atlasInterpolationIcon:Hi,isSDF:_e,hasHalo:ei};if(U&&pe.canOverlap){H=!0;let Bt=Se.segments.get();for(let Rt of Bt)ae.push({segments:new c.SegmentVector([Rt]),sortKey:Rt.sortKey,state:pa,terrainData:Ge})}else ae.push({segments:Se.segments,sortKey:0,state:pa,terrainData:Ge})}H&&ae.sort((he,ce)=>he.sortKey-ce.sortKey);for(let he of ae){let ce=he.state;if(A.activeTexture.set(B.TEXTURE0),ce.atlasTexture.bind(ce.atlasInterpolation,B.CLAMP_TO_EDGE),ce.atlasTextureIcon&&(A.activeTexture.set(B.TEXTURE1),ce.atlasTextureIcon&&ce.atlasTextureIcon.bind(ce.atlasInterpolationIcon,B.CLAMP_TO_EDGE)),ce.isSDF){let pe=ce.uniformValues;ce.hasHalo&&(pe.u_is_halo=1,qa(ce.buffers,he.segments,n,h,ce.program,ee,w,E,pe,he.terrainData)),pe.u_is_halo=0}qa(ce.buffers,he.segments,n,h,ce.program,ee,w,E,ce.uniformValues,he.terrainData)}}function qa(h,t,n,s,l,p,f,g,y,v){let w=s.context;l.draw(w,w.gl.TRIANGLES,p,f,g,_t.disabled,y,v,n.id,h.layoutVertexBuffer,h.indexBuffer,t,n.paint,s.transform.zoom,h.programConfigurations.get(n.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function Cs(h,t,n,s,l){if(!n||!s||!s.imageAtlas)return;let p=s.imageAtlas.patternPositions,f=p[n.to.toString()],g=p[n.from.toString()];if(!f||!g){let y=l.getPaintProperty(t);f=p[y],g=p[y]}f&&g&&h.setConstantPatternPositions(f,g)}function Jn(h,t,n,s,l,p,f){let g=h.context.gl,y="fill-pattern",v=n.paint.get(y),w=v&&v.constantOr(1),E=n.getCrossfadeParameters(),A,B,D,O,k;f?(B=w&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",A=g.LINES):(B=w?"fillPattern":"fill",A=g.TRIANGLES);let G=v.constantOr(null);for(let J of s){let U=t.getTile(J);if(w&&!U.patternsLoaded())continue;let H=U.getBucket(n);if(!H)continue;let ee=H.programConfigurations.get(n.id),ie=h.useProgram(B,ee),ae=h.style.map.terrain&&h.style.map.terrain.getTerrainData(J);w&&(h.context.activeTexture.set(g.TEXTURE0),U.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),ee.updatePaintBuffers(E)),Cs(ee,y,G,U,n);let he=ae?J:null,ce=h.translatePosMatrix(he?he.posMatrix:J.posMatrix,U,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(f){O=H.indexBuffer2,k=H.segments2;let pe=[g.drawingBufferWidth,g.drawingBufferHeight];D=B==="fillOutlinePattern"&&w?Ta(ce,h,E,U,pe):wo(ce,pe)}else O=H.indexBuffer,k=H.segments,D=w?bo(ce,h,E,U):Tr(ce);ie.draw(h.context,A,l,h.stencilModeForClipping(J),p,_t.disabled,D,ae,n.id,H.layoutVertexBuffer,O,k,n.paint,h.transform.zoom,ee)}}function An(h,t,n,s,l,p,f){let g=h.context,y=g.gl,v="fill-extrusion-pattern",w=n.paint.get(v),E=w.constantOr(1),A=n.getCrossfadeParameters(),B=n.paint.get("fill-extrusion-opacity"),D=w.constantOr(null);for(let O of s){let k=t.getTile(O),G=k.getBucket(n);if(!G)continue;let J=h.style.map.terrain&&h.style.map.terrain.getTerrainData(O),U=G.programConfigurations.get(n.id),H=h.useProgram(E?"fillExtrusionPattern":"fillExtrusion",U);E&&(h.context.activeTexture.set(y.TEXTURE0),k.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),U.updatePaintBuffers(A)),Cs(U,v,D,k,n);let ee=h.translatePosMatrix(O.posMatrix,k,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),ie=n.paint.get("fill-extrusion-vertical-gradient"),ae=E?vo(ee,h,ie,B,O,A,k):Gi(ee,h,ie,B);H.draw(g,g.gl.TRIANGLES,l,p,f,_t.backCCW,ae,J,n.id,G.layoutVertexBuffer,G.indexBuffer,G.segments,n.paint,h.transform.zoom,U,h.style.map.terrain&&G.centroidVertexBuffer)}}function As(h,t,n,s,l,p,f){let g=h.context,y=g.gl,v=n.fbo;if(!v)return;let w=h.useProgram("hillshade"),E=h.style.map.terrain&&h.style.map.terrain.getTerrainData(t);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,v.colorAttachment.get()),w.draw(g,y.TRIANGLES,l,p,f,_t.disabled,((A,B,D,O)=>{let k=D.paint.get("hillshade-shadow-color"),G=D.paint.get("hillshade-highlight-color"),J=D.paint.get("hillshade-accent-color"),U=D.paint.get("hillshade-illumination-direction")*(Math.PI/180);D.paint.get("hillshade-illumination-anchor")==="viewport"&&(U-=A.transform.angle);let H=!A.options.moving;return{u_matrix:O?O.posMatrix:A.transform.calculatePosMatrix(B.tileID.toUnwrapped(),H),u_image:0,u_latrange:wl(0,B.tileID),u_light:[D.paint.get("hillshade-exaggeration"),U],u_shadow:k,u_highlight:G,u_accent:J}})(h,n,s,E?t:null),E,s.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}function kl(h,t,n,s,l,p){let f=h.context,g=f.gl,y=t.dem;if(y&&y.data){let v=y.dim,w=y.stride,E=y.getPixels();if(f.activeTexture.set(g.TEXTURE1),f.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||h.getTileTexture(w),t.demTexture){let B=t.demTexture;B.update(E,{premultiply:!1}),B.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else t.demTexture=new Tt(f,E,g.RGBA,{premultiply:!1}),t.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);f.activeTexture.set(g.TEXTURE0);let A=t.fbo;if(!A){let B=new Tt(f,{width:v,height:v,data:null},g.RGBA);B.bind(g.LINEAR,g.CLAMP_TO_EDGE),A=t.fbo=f.createFramebuffer(v,v,!0,!1),A.colorAttachment.set(B.texture)}f.bindFramebuffer.set(A.framebuffer),f.viewport.set([0,0,v,v]),h.useProgram("hillshadePrepare").draw(f,g.TRIANGLES,s,l,p,_t.disabled,((B,D)=>{let O=D.stride,k=c.create();return c.ortho(k,0,c.EXTENT,-c.EXTENT,0,0,1),c.translate(k,k,[0,-c.EXTENT,0]),{u_matrix:k,u_image:1,u_dimension:[O,O],u_zoom:B.overscaledZ,u_unpack:D.getUnpackVector()}})(t.tileID,y),null,n.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function zs(h,t,n,s,l,p){let f=s.paint.get("raster-fade-duration");if(!p&&f>0){let g=c.browser.now(),y=(g-h.timeAdded)/f,v=t?(g-t.timeAdded)/f:-1,w=n.getSource(),E=l.coveringZoomLevel({tileSize:w.tileSize,roundZoom:w.roundZoom}),A=!t||Math.abs(t.tileID.overscaledZ-E)>Math.abs(h.tileID.overscaledZ-E),B=A&&h.refreshedUponExpiration?1:c.clamp(A?y:1-v,0,1);return h.refreshedUponExpiration&&y>=1&&(h.refreshedUponExpiration=!1),t?{opacity:1,mix:1-B}:{opacity:B,mix:0}}return{opacity:1,mix:0}}let Dl=new c.Color(1,0,0,1),ko=new c.Color(0,1,0,1),Za=new c.Color(0,0,1,1),Ms=new c.Color(1,0,1,1),Do=new c.Color(0,1,1,1);function Ps(h,t,n,s){zn(h,0,t+n/2,h.transform.width,n,s)}function Qn(h,t,n,s){zn(h,t-n/2,0,n,h.transform.height,s)}function zn(h,t,n,s,l,p){let f=h.context,g=f.gl;g.enable(g.SCISSOR_TEST),g.scissor(t*h.pixelRatio,n*h.pixelRatio,s*h.pixelRatio,l*h.pixelRatio),f.clear({color:p}),g.disable(g.SCISSOR_TEST)}function Ll(h,t,n){let s=h.context,l=s.gl,p=n.posMatrix,f=h.useProgram("debug"),g=et.disabled,y=ut.disabled,v=h.colorModeForRenderPass(),w="$debug",E=h.style.map.terrain&&h.style.map.terrain.getTerrainData(n);s.activeTexture.set(l.TEXTURE0);let A=t.getTileByID(n.key).latestRawTileData,B=Math.floor((A&&A.byteLength||0)/1024),D=t.getTile(n).tileSize,O=512/Math.min(D,512)*(n.overscaledZ/h.transform.zoom)*.5,k=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(k+=` => ${n.overscaledZ}`),function(G,J){G.initDebugOverlayCanvas();let U=G.debugOverlayCanvas,H=G.context.gl,ee=G.debugOverlayCanvas.getContext("2d");ee.clearRect(0,0,U.width,U.height),ee.shadowColor="white",ee.shadowBlur=2,ee.lineWidth=1.5,ee.strokeStyle="white",ee.textBaseline="top",ee.font="bold 36px Open Sans, sans-serif",ee.fillText(J,5,5),ee.strokeText(J,5,5),G.debugOverlayTexture.update(U),G.debugOverlayTexture.bind(H.LINEAR,H.CLAMP_TO_EDGE)}(h,`${k} ${B}kB`),f.draw(s,l.TRIANGLES,g,y,Ve.alphaBlended,_t.disabled,Ia(p,c.Color.transparent,O),null,w,h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments),f.draw(s,l.LINE_STRIP,g,y,v,_t.disabled,Ia(p,c.Color.red),E,w,h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments)}function ks(h,t,n){let s=h.context,l=s.gl,p=h.colorModeForRenderPass(),f=new et(l.LEQUAL,et.ReadWrite,h.depthRangeFor3D),g=h.useProgram("terrain"),y=t.getTerrainMesh();s.bindFramebuffer.set(null),s.viewport.set([0,0,h.width,h.height]);for(let v of n){let w=h.renderToTexture.getTexture(v),E=t.getTerrainData(v.tileID);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,w.texture);let A={u_matrix:h.transform.calculatePosMatrix(v.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(h.transform.zoom)};g.draw(s,l.TRIANGLES,f,ut.disabled,p,_t.backCCW,A,E,"terrain",y.vertexBuffer,y.indexBuffer,y.segments)}}class Mt{constructor(t,n){this.context=new Fa(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.create(),renderTime:0},this.setup(),this.numSublayers=re.maxUnderzooming+re.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new wa}resize(t,n,s){if(this.width=Math.floor(t*s),this.height=Math.floor(n*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let l of this.style._order)this.style._layers[l].resize()}setup(){let t=this.context,n=new c.PosArray;n.emplaceBack(0,0),n.emplaceBack(c.EXTENT,0),n.emplaceBack(0,c.EXTENT),n.emplaceBack(c.EXTENT,c.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(n,xi.members),this.tileExtentSegments=c.SegmentVector.simpleSegment(0,0,4,2);let s=new c.PosArray;s.emplaceBack(0,0),s.emplaceBack(c.EXTENT,0),s.emplaceBack(0,c.EXTENT),s.emplaceBack(c.EXTENT,c.EXTENT),this.debugBuffer=t.createVertexBuffer(s,xi.members),this.debugSegments=c.SegmentVector.simpleSegment(0,0,4,5);let l=new c.RasterBoundsArray;l.emplaceBack(0,0,0,0),l.emplaceBack(c.EXTENT,0,c.EXTENT,0),l.emplaceBack(0,c.EXTENT,0,c.EXTENT),l.emplaceBack(c.EXTENT,c.EXTENT,c.EXTENT,c.EXTENT),this.rasterBoundsBuffer=t.createVertexBuffer(l,ji.members),this.rasterBoundsSegments=c.SegmentVector.simpleSegment(0,0,4,2);let p=new c.PosArray;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(p,xi.members),this.viewportSegments=c.SegmentVector.simpleSegment(0,0,4,2);let f=new c.LineStripIndexArray;f.emplaceBack(0),f.emplaceBack(1),f.emplaceBack(3),f.emplaceBack(2),f.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(f);let g=new c.TriangleIndexArray;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(g);let y=this.context.gl;this.stencilClearMode=new ut({func:y.ALWAYS,mask:0},0,255,y.ZERO,y.ZERO,y.ZERO)}clearStencil(){let t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let s=c.create();c.ortho(s,0,this.width,this.height,0,0,1),c.scale(s,s,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,et.disabled,this.stencilClearMode,Ve.disabled,_t.disabled,Wn(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source;let s=this.context,l=s.gl;this.nextStencilID+n.length>256&&this.clearStencil(),s.setColorMode(Ve.disabled),s.setDepthMode(et.disabled);let p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let f of n){let g=this._tileClippingMaskIDs[f.key]=this.nextStencilID++,y=this.style.map.terrain&&this.style.map.terrain.getTerrainData(f);p.draw(s,l.TRIANGLES,et.disabled,new ut({func:l.ALWAYS,mask:0},g,255,l.KEEP,l.KEEP,l.REPLACE),Ve.disabled,_t.disabled,Wn(f.posMatrix),y,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,n=this.context.gl;return new ut({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){let n=this.context.gl;return new ut({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){let n=this.context.gl,s=t.sort((f,g)=>g.overscaledZ-f.overscaledZ),l=s[s.length-1].overscaledZ,p=s[0].overscaledZ-l+1;if(p>1){this.currentStencilSource=void 0,this.nextStencilID+p>256&&this.clearStencil();let f={};for(let g=0;g=0;this.currentLayer--){let y=this.style._layers[s[this.currentLayer]],v=l[y.source],w=p[y.source];this._renderTileClippingMasks(y,w),this.renderLayer(this,v,y,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerk.source&&!k.isHidden(w)?[v.sourceCaches[k.source]]:[]),B=A.filter(k=>k.getSource().type==="vector"),D=A.filter(k=>k.getSource().type!=="vector"),O=k=>{(!E||E.getSource().maxzoomO(k)),E||D.forEach(k=>O(k)),E}(this.style,this.transform.zoom);y&&function(v,w,E){for(let A=0;AB.style.map.terrain.getElevation(ie,Re,Ce):null)}}}(y,p,g,f,g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),v),g.paint.get("icon-opacity").constantOr(1)!==0&&$a(p,f,g,y,!1,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),g.layout.get("icon-rotation-alignment"),g.layout.get("icon-pitch-alignment"),g.layout.get("icon-keep-upright"),w,E),g.paint.get("text-opacity").constantOr(1)!==0&&$a(p,f,g,y,!0,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.layout.get("text-keep-upright"),w,E),f.map.showCollisionBoxes&&(Ss(p,f,g,y,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),!0),Ss(p,f,g,y,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),!1))})(t,n,s,l,this.style.placement.variableOffsets);break;case"circle":(function(p,f,g,y){if(p.renderPass!=="translucent")return;let v=g.paint.get("circle-opacity"),w=g.paint.get("circle-stroke-width"),E=g.paint.get("circle-stroke-opacity"),A=!g.layout.get("circle-sort-key").isConstant();if(v.constantOr(1)===0&&(w.constantOr(1)===0||E.constantOr(1)===0))return;let B=p.context,D=B.gl,O=p.depthModeForSublayer(0,et.ReadOnly),k=ut.disabled,G=p.colorModeForRenderPass(),J=[];for(let U=0;UU.sortKey-H.sortKey);for(let U of J){let{programConfiguration:H,program:ee,layoutVertexBuffer:ie,indexBuffer:ae,uniformValues:he,terrainData:ce}=U.state;ee.draw(B,D.TRIANGLES,O,k,G,_t.disabled,he,ce,g.id,ie,ae,U.segments,g.paint,p.transform.zoom,H)}})(t,n,s,l);break;case"heatmap":(function(p,f,g,y){if(g.paint.get("heatmap-opacity")!==0)if(p.renderPass==="offscreen"){let v=p.context,w=v.gl,E=ut.disabled,A=new Ve([w.ONE,w.ONE],c.Color.transparent,[!0,!0,!0,!0]);(function(B,D,O){let k=B.gl;B.activeTexture.set(k.TEXTURE1),B.viewport.set([0,0,D.width/4,D.height/4]);let G=O.heatmapFbo;if(G)k.bindTexture(k.TEXTURE_2D,G.colorAttachment.get()),B.bindFramebuffer.set(G.framebuffer);else{let J=k.createTexture();k.bindTexture(k.TEXTURE_2D,J),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MIN_FILTER,k.LINEAR),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MAG_FILTER,k.LINEAR),G=O.heatmapFbo=B.createFramebuffer(D.width/4,D.height/4,!1,!1),function(U,H,ee,ie){var ae,he;let ce=U.gl,pe=(ae=U.HALF_FLOAT)!==null&&ae!==void 0?ae:ce.UNSIGNED_BYTE,Se=(he=U.RGBA16F)!==null&&he!==void 0?he:ce.RGBA;ce.texImage2D(ce.TEXTURE_2D,0,Se,H.width/4,H.height/4,0,ce.RGBA,pe,null),ie.colorAttachment.set(ee)}(B,D,J,G)}})(v,p,g),v.clear({color:c.Color.transparent});for(let B=0;B{let U=c.create();c.ortho(U,0,O.width,O.height,0,0,1);let H=O.context.gl;return{u_matrix:U,u_world:[H.drawingBufferWidth,H.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:k.paint.get("heatmap-opacity")}})(v,w),null,w.id,v.viewportBuffer,v.quadTriangleIndexBuffer,v.viewportSegments,w.paint,v.transform.zoom)}(p,g))})(t,n,s,l);break;case"line":(function(p,f,g,y){if(p.renderPass!=="translucent")return;let v=g.paint.get("line-opacity"),w=g.paint.get("line-width");if(v.constantOr(1)===0||w.constantOr(1)===0)return;let E=p.depthModeForSublayer(0,et.ReadOnly),A=p.colorModeForRenderPass(),B=g.paint.get("line-dasharray"),D=g.paint.get("line-pattern"),O=D.constantOr(1),k=g.paint.get("line-gradient"),G=g.getCrossfadeParameters(),J=O?"linePattern":B?"lineSDF":k?"lineGradient":"line",U=p.context,H=U.gl,ee=!0;for(let ie of y){let ae=f.getTile(ie);if(O&&!ae.patternsLoaded())continue;let he=ae.getBucket(g);if(!he)continue;let ce=he.programConfigurations.get(g.id),pe=p.context.program.get(),Se=p.useProgram(J,ce),He=ee||Se.program!==pe,_e=p.style.map.terrain&&p.style.map.terrain.getTerrainData(ie),Re=D.constantOr(null);if(Re&&ae.imageAtlas){let je=ae.imageAtlas,Ge=je.patternPositions[Re.to.toString()],We=je.patternPositions[Re.from.toString()];Ge&&We&&ce.setConstantPatternPositions(Ge,We)}let Ce=_e?ie:null,vt=O?Eo(p,ae,g,G,Ce):B?Tl(p,ae,g,B,G,Ce):k?El(p,ae,g,he.lineClipsArray.length,Ce):Kn(p,ae,g,Ce);if(O)U.activeTexture.set(H.TEXTURE0),ae.imageAtlasTexture.bind(H.LINEAR,H.CLAMP_TO_EDGE),ce.updatePaintBuffers(G);else if(B&&(He||p.lineAtlas.dirty))U.activeTexture.set(H.TEXTURE0),p.lineAtlas.bind(U);else if(k){let je=he.gradients[g.id],Ge=je.texture;if(g.gradientVersion!==je.version){let We=256;if(g.stepInterpolant){let Lt=f.getSource().maxzoom,pt=ie.canonical.z===Lt?Math.ceil(1<0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let n=this.imageManager.getPattern(t.from.toString()),s=this.imageManager.getPattern(t.to.toString());return!n||!s}useProgram(t,n){this.cache=this.cache||{};let s=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[s]||(this.cache[s]=new Dt(this.context,Rr[t],n,Xi[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[s]}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(){let 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 Tt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}class Sr{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,s){let l=Math.pow(2,s),p=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(g=>{let y=1/(g=c.transformMat4([],g,t))[3]/n*l;return c.mul$1(g,g,[y,y,1/g[3],y])}),f=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(g=>{let y=function(A,B){var D=B[0],O=B[1],k=B[2],G=D*D+O*O+k*k;return G>0&&(G=1/Math.sqrt(G)),A[0]=B[0]*G,A[1]=B[1]*G,A[2]=B[2]*G,A}([],function(A,B,D){var O=B[0],k=B[1],G=B[2],J=D[0],U=D[1],H=D[2];return A[0]=k*H-G*U,A[1]=G*J-O*H,A[2]=O*U-k*J,A}([],ar([],p[g[0]],p[g[1]]),ar([],p[g[2]],p[g[1]]))),v=-((w=y)[0]*(E=p[g[1]])[0]+w[1]*E[1]+w[2]*E[2]);var w,E;return y.concat(v)});return new Sr(p,f)}}class ui{constructor(t,n){this.min=t,this.max=n,this.center=function(s,l,p){return s[0]=.5*l[0],s[1]=.5*l[1],s[2]=.5*l[2],s}([],function(s,l,p){return s[0]=l[0]+p[0],s[1]=l[1]+p[1],s[2]=l[2]+p[2],s}([],this.min,this.max))}quadrant(t){let n=[t%2==0,t<2],s=Ii(this.min),l=Ii(this.max);for(let p=0;p=0&&f++;if(f===0)return 0;f!==n.length&&(s=!1)}if(s)return 2;for(let l=0;l<3;l++){let p=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let g=0;gthis.max[l]-this.min[l])return 0}return 1}}class ea{constructor(t=0,n=0,s=0,l=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(s)||s<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=s,this.right=l}interpolate(t,n,s){return n.top!=null&&t.top!=null&&(this.top=c.interpolate.number(t.top,n.top,s)),n.bottom!=null&&t.bottom!=null&&(this.bottom=c.interpolate.number(t.bottom,n.bottom,s)),n.left!=null&&t.left!=null&&(this.left=c.interpolate.number(t.left,n.left,s)),n.right!=null&&t.right!=null&&(this.right=c.interpolate.number(t.right,n.right,s)),this}getCenter(t,n){let s=c.clamp((this.left+t-this.right)/2,0,t),l=c.clamp((this.top+n-this.bottom)/2,0,n);return new c.Point(s,l)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new ea(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class ta{constructor(t,n,s,l,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||!!p,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=s??0,this._maxPitch=l??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ea,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){let t=new ta(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this._minEleveationForCurrentTile=t._minEleveationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.Point(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){let n=-c.wrap(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var s=new c.ARRAY_TYPE(4);return c.ARRAY_TYPE!=Float32Array&&(s[1]=0,s[2]=0),s[0]=1,s[3]=1,s}(),function(s,l,p){var f=l[0],g=l[1],y=l[2],v=l[3],w=Math.sin(p),E=Math.cos(p);s[0]=f*E+y*w,s[1]=g*E+v*w,s[2]=f*-w+y*E,s[3]=g*-w+v*E}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){let n=c.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){let n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(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)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,s){this._unmodified=!1,this._edgeInsets.interpolate(t,n,s),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){let n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){let n=[new c.UnwrappedTileID(0,t)];if(this._renderWorldCopies){let s=this.pointCoordinate(new c.Point(0,0)),l=this.pointCoordinate(new c.Point(this.width,0)),p=this.pointCoordinate(new c.Point(this.width,this.height)),f=this.pointCoordinate(new c.Point(0,this.height)),g=Math.floor(Math.min(s.x,l.x,p.x,f.x)),y=Math.floor(Math.max(s.x,l.x,p.x,f.x)),v=1;for(let w=g-v;w<=y+v;w++)w!==0&&n.push(new c.UnwrappedTileID(w,t))}return n}coveringTiles(t){var n,s;let l=this.coveringZoomLevel(t),p=l;if(t.minzoom!==void 0&&lt.maxzoom&&(l=t.maxzoom);let f=this.pointCoordinate(this.getCameraPoint()),g=c.MercatorCoordinate.fromLngLat(this.center),y=Math.pow(2,l),v=[y*f.x,y*f.y,0],w=[y*g.x,y*g.y,0],E=Sr.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,l),A=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(A=l);let B=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,D=U=>({aabb:new ui([U*y,0,0],[(U+1)*y,y,0]),zoom:0,x:0,y:0,wrap:U,fullyVisible:!1}),O=[],k=[],G=l,J=t.reparseOverscaled?p:l;if(this._renderWorldCopies)for(let U=1;U<=3;U++)O.push(D(-U)),O.push(D(U));for(O.push(D(0));O.length>0;){let U=O.pop(),H=U.x,ee=U.y,ie=U.fullyVisible;if(!ie){let Se=U.aabb.intersects(E);if(Se===0)continue;ie=Se===2}let ae=t.terrain?v:w,he=U.aabb.distanceX(ae),ce=U.aabb.distanceY(ae),pe=Math.max(Math.abs(he),Math.abs(ce));if(U.zoom===G||pe>B+(1<=A){let Se=G-U.zoom,He=v[0]-.5-(H<>1),Re=U.zoom+1,Ce=U.aabb.quadrant(Se);if(t.terrain){let vt=new c.OverscaledTileID(Re,U.wrap,Re,He,_e),je=t.terrain.getMinMaxElevation(vt),Ge=(n=je.minElevation)!==null&&n!==void 0?n:this.elevation,We=(s=je.maxElevation)!==null&&s!==void 0?s:this.elevation;Ce=new ui([Ce.min[0],Ce.min[1],Ge],[Ce.max[0],Ce.max[1],We])}O.push({aabb:Ce,zoom:Re,x:He,y:_e,wrap:U.wrap,fullyVisible:ie})}}return k.sort((U,H)=>U.distanceSq-H.distanceSq).map(U=>U.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){let n=c.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new c.Point(c.mercatorXfromLng(t.lng)*this.worldSize,c.mercatorYfromLat(n)*this.worldSize)}unproject(t){return new c.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){let n=this.pointLocation(this.centerPoint,t),s=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-s))return;let l=this.getCameraPosition(),p=c.MercatorCoordinate.fromLngLat(l.lngLat,l.altitude),f=c.MercatorCoordinate.fromLngLat(n,s),g=p.x-f.x,y=p.y-f.y,v=p.z-f.z,w=Math.sqrt(g*g+y*y+v*v),E=this.scaleZoom(this.cameraToCenterDistance/w/this.tileSize);this._elevation=s,this._center=n,this.zoom=E}setLocationAtPoint(t,n){let s=this.pointCoordinate(n),l=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(t),f=new c.MercatorCoordinate(p.x-(s.x-l.x),p.y-(s.y-l.y));this.center=this.coordinateLocation(f),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,n){return n?this.coordinatePoint(this.locationCoordinate(t),n.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,n){return this.coordinateLocation(this.pointCoordinate(t,n))}locationCoordinate(t){return c.MercatorCoordinate.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,n){if(n){let A=n.pointCoordinate(t);if(A!=null)return A}let s=[t.x,t.y,0,1],l=[t.x,t.y,1,1];c.transformMat4(s,s,this.pixelMatrixInverse),c.transformMat4(l,l,this.pixelMatrixInverse);let p=s[3],f=l[3],g=s[1]/p,y=l[1]/f,v=s[2]/p,w=l[2]/f,E=v===w?0:(0-v)/(w-v);return new c.MercatorCoordinate(c.interpolate.number(s[0]/p,l[0]/f,E)/this.worldSize,c.interpolate.number(g,y,E)/this.worldSize)}coordinatePoint(t,n=0,s=this.pixelMatrix){let l=[t.x*this.worldSize,t.y*this.worldSize,n,1];return c.transformMat4(l,l,s),new c.Point(l[0]/l[3],l[1]/l[3])}getBounds(){let t=Math.max(0,this.height/2-this.getHorizon());return new mt().extend(this.pointLocation(new c.Point(0,t))).extend(this.pointLocation(new c.Point(this.width,t))).extend(this.pointLocation(new c.Point(this.width,this.height))).extend(this.pointLocation(new c.Point(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new mt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,n=!1){let s=t.key,l=n?this._alignedPosMatrixCache:this._posMatrixCache;if(l[s])return l[s];let p=t.canonical,f=this.worldSize/this.zoomScale(p.z),g=p.x+Math.pow(2,p.z)*t.wrap,y=c.identity(new Float64Array(16));return c.translate(y,y,[g*f,p.y*f,0]),c.scale(y,y,[f/c.EXTENT,f/c.EXTENT,1]),c.multiply(y,n?this.alignedProjMatrix:this.projMatrix,y),l[s]=new Float32Array(y),l[s]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,n,s,l,p=-90,f=90,g=-180,y=180,v=this.size,w=this._unmodified;if(this.latRange){let B=this.latRange;p=c.mercatorYfromLat(B[1])*this.worldSize,f=c.mercatorYfromLat(B[0])*this.worldSize,t=f-pf&&(l=f-D)}if(this.lngRange){let B=(g+y)/2,D=c.wrap(E.x,B-this.worldSize/2,B+this.worldSize/2),O=v.x/2;D-Oy&&(s=y-O)}s===void 0&&l===void 0||(this.center=this.unproject(new c.Point(s!==void 0?s:E.x,l!==void 0?l:E.y)).wrap()),this._unmodified=w,this._constraining=!1}_calcMatrices(){if(!this.height)return;let t=this.centerOffset,n=this.point.x,s=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let l=c.identity(new Float64Array(16));c.scale(l,l,[this.width/2,-this.height/2,1]),c.translate(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=c.identity(new Float64Array(16)),c.scale(l,l,[1,-1,1]),c.translate(l,l,[-1,-1,0]),c.scale(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l;let p=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),f=Math.min(this.elevation,this._minEleveationForCurrentTile),g=p-f*this._pixelPerMeter/Math.cos(this._pitch),y=f<0?g:p,v=Math.PI/2+this._pitch,w=this._fov*(.5+t.y/this.height),E=Math.sin(w)*y/Math.sin(c.clamp(Math.PI-v-w,.01,Math.PI-.01)),A=this.getHorizon(),B=2*Math.atan(A/this.cameraToCenterDistance)*(.5+t.y/(2*A)),D=Math.sin(B)*y/Math.sin(c.clamp(Math.PI-v-B,.01,Math.PI-.01)),O=Math.min(E,D),k=1.01*(Math.cos(Math.PI/2-this._pitch)*O+y),G=this.height/50;l=new Float64Array(16),c.perspective(l,this._fov,this.width/this.height,G,k),l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,c.scale(l,l,[1,-1,1]),c.translate(l,l,[0,0,-this.cameraToCenterDistance]),c.rotateX(l,l,this._pitch),c.rotateZ(l,l,this.angle),c.translate(l,l,[-n,-s,0]),this.mercatorMatrix=c.scale([],l,[this.worldSize,this.worldSize,this.worldSize]),c.scale(l,l,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.multiply(new Float64Array(16),this.labelPlaneMatrix,l),c.translate(l,l,[0,0,-this.elevation]),this.projMatrix=l,this.invProjMatrix=c.invert([],l),this.pixelMatrix3D=c.multiply(new Float64Array(16),this.labelPlaneMatrix,l);let J=this.width%2/2,U=this.height%2/2,H=Math.cos(this.angle),ee=Math.sin(this.angle),ie=n-Math.round(n)+H*J+ee*U,ae=s-Math.round(s)+H*U+ee*J,he=new Float64Array(l);if(c.translate(he,he,[ie>.5?ie-1:ie,ae>.5?ae-1:ae,0]),this.alignedProjMatrix=he,l=c.invert(new Float64Array(16),this.pixelMatrix),!l)throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let t=this.pointCoordinate(new c.Point(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return c.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.Point(0,t))}getCameraQueryGeometry(t){let n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let s=n.x,l=n.y,p=n.x,f=n.y;for(let g of t)s=Math.min(s,g.x),l=Math.min(l,g.y),p=Math.max(p,g.x),f=Math.max(f,g.y);return[new c.Point(s,l),new c.Point(p,l),new c.Point(p,f),new c.Point(s,f),new c.Point(s,l)]}}}function Ds(h,t){let n,s=!1,l=null,p=null,f=()=>{l=null,s&&(h.apply(p,n),l=setTimeout(f,t),s=!1)};return(...g)=>(s=!0,p=this,n=g,l||f(),l)}class Mn{constructor(t){this._getCurrentHash=()=>{let n=window.location.hash.replace("#","");if(this._hashName){let s;return n.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(s=l)}),(s&&s[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{let n=this._getCurrentHash();if(n.length>=3&&!n.some(s=>isNaN(s))){let s=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:s,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}},this._updateHash=Ds(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()),delete this._map,this}getHashString(t){let n=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,l=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,l),f=Math.round(n.lng*p)/p,g=Math.round(n.lat*p)/p,y=this._map.getBearing(),v=this._map.getPitch(),w="";if(w+=t?`/${f}/${g}/${s}`:`${s}/${g}/${f}`,(y||v)&&(w+="/"+Math.round(10*y)/10),v&&(w+=`/${Math.round(v)}`),this._hashName){let E=this._hashName,A=!1,B=window.location.hash.slice(1).split("&").map(D=>{let O=D.split("=")[0];return O===E?(A=!0,`${O}=${w}`):D}).filter(D=>D);return A||B.push(`${E}=${w}`),`#${B.join("&")}`}return`#${w}`}}let Or={linearity:.3,easing:c.bezier(0,0,.3,1)},Ls=c.extend({deceleration:2500,maxSpeed:1400},Or),Lo=c.extend({deceleration:20,maxSpeed:1400},Or),Bo=c.extend({deceleration:1e3,maxSpeed:360},Or),Ro=c.extend({deceleration:1e3,maxSpeed:90},Or);class Fo{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c.browser.now(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,n=c.browser.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let n={zoom:0,bearing:0,pitch:0,pan:new c.Point(0,0),pinchAround:void 0,around:void 0};for(let{settings:p}of this._inertiaBuffer)n.zoom+=p.zoomDelta||0,n.bearing+=p.bearingDelta||0,n.pitch+=p.pitchDelta||0,p.panDelta&&n.pan._add(p.panDelta),p.around&&(n.around=p.around),p.pinchAround&&(n.pinchAround=p.pinchAround);let s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(n.pan.mag()){let p=ur(n.pan.mag(),s,c.extend({},Ls,t||{}));l.offset=n.pan.mult(p.amount/n.pan.mag()),l.center=this._map.transform.center,ia(l,p)}if(n.zoom){let p=ur(n.zoom,s,Lo);l.zoom=this._map.transform.zoom+p.amount,ia(l,p)}if(n.bearing){let p=ur(n.bearing,s,Bo);l.bearing=this._map.transform.bearing+c.clamp(p.amount,-179,179),ia(l,p)}if(n.pitch){let p=ur(n.pitch,s,Ro);l.pitch=this._map.transform.pitch+p.amount,ia(l,p)}if(l.zoom||l.bearing){let p=n.pinchAround===void 0?n.around:n.pinchAround;l.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),c.extend(l,{noMoveStart:!0})}}function ia(h,t){(!h.duration||h.durationn.unproject(y)),g=p.reduce((y,v,w,E)=>y.add(v.div(E.length)),new c.Point(0,0));super(t,{points:p,point:g,lngLats:f,lngLat:n.unproject(g),originalEvent:s}),this._defaultPrevented=!1}}class Oo extends c.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,s){super(t,{originalEvent:s}),this._defaultPrevented=!1}}class Vo{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Oo(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Li(t.type,this._map,t))}mouseup(t){this._map.fire(new Li(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Li(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Li(t.type,this._map,t))}mouseover(t){this._map.fire(new Li(t.type,this._map,t))}mouseout(t){this._map.fire(new Li(t.type,this._map,t))}touchstart(t){return this._firePreventable(new ra(t.type,this._map,t))}touchmove(t){this._map.fire(new ra(t.type,this._map,t))}touchend(t){this._map.fire(new ra(t.type,this._map,t))}touchcancel(t){this._map.fire(new ra(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Uo{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Li(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Li("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Li(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Pn{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.pointLocation(c.Point.convert(t),this._map.terrain)}}class na{constructor(t,n){this._map=t,this._tr=new Pn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(te.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;let s=n;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)p.fitScreenCoordinates(s,l,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&&(te.remove(this._box),this._box=null),te.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new c.Event(t,{originalEvent:n}))}}function ja(h,t){if(h.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${h.length}, points ${t.length}`);let n={};for(let s=0;sthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),s.length===this.numTouches&&(this.centroid=function(l){let p=new c.Point(0,0);for(let f of l)p._add(f);return p.div(l.length)}(n),this.touches=ja(s,n)))}touchmove(t,n,s){if(this.aborted||!this.centroid)return;let l=ja(s,n);for(let p in this.touches){let f=l[p];(!f||f.dist(this.touches[p])>30)&&(this.aborted=!0)}}touchend(t,n,s){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){let l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class Yi{constructor(t){this.singleTap=new pr(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,s){this.singleTap.touchstart(t,n,s)}touchmove(t,n,s){this.singleTap.touchmove(t,n,s)}touchend(t,n,s){let l=this.singleTap.touchend(t,n,s);if(l){let p=t.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(l)<30;if(p&&f||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class No{constructor(t){this._tr=new Pn(t),this._zoomIn=new Yi({numTouches:1,numTaps:2}),this._zoomOut=new Yi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,s){this._zoomIn.touchstart(t,n,s),this._zoomOut.touchstart(t,n,s)}touchmove(t,n,s){this._zoomIn.touchmove(t,n,s),this._zoomOut.touchmove(t,n,s)}touchend(t,n,s){let l=this._zoomIn.touchend(t,n,s),p=this._zoomOut.touchend(t,n,s),f=this._tr;return l?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:f.zoom+1,around:f.unproject(l)},{originalEvent:t})}):p?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:f.zoom-1,around:f.unproject(p)},{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 Bi{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){let n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;let s=this._lastPoint;if(!s)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let l=n.length?n[0]:n;return!this._moved&&l.dist(s){h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=function(t){t.preventDefault()}},Fs=({enable:h,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{let s=new Bs({checkCorrectEvent:l=>te.mouseButton(l)===0&&l.ctrlKey||te.mouseButton(l)===2});return new Bi({clickTolerance:t,move:(l,p)=>({bearingDelta:(p.x-l.x)*n}),moveStateManager:s,enable:h,assignEvents:Rs})},kn=({enable:h,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{let s=new Bs({checkCorrectEvent:l=>te.mouseButton(l)===0&&l.ctrlKey||te.mouseButton(l)===2});return new Bi({clickTolerance:t,move:(l,p)=>({pitchDelta:(p.y-l.y)*n}),moveStateManager:s,enable:h,assignEvents:Rs})};class Vr{constructor(t,n){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.Point(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,n,s){return this._calculateTransform(t,n,s)}touchmove(t,n,s){if(this._map._cooperativeGestures&&(this._minTouches===2&&s.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,s.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(s.length0&&(this._active=!0);let l=ja(s,n),p=new c.Point(0,0),f=new c.Point(0,0),g=0;for(let v in l){let w=l[v],E=this._touches[v];E&&(p._add(w),f._add(w.sub(E)),g++,l[v]=w)}if(this._touches=l,gMath.abs(h.x)}class Bl extends Ee{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,s){super.touchstart(t,n,s),this._currentTouchCount=s.length}_start(t){this._lastPoints=t,la(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,s){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;let l=t[0].sub(this._lastPoints[0]),p=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,p,s.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(l.y+p.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,s){if(this._valid!==void 0)return this._valid;let l=t.mag()>=2,p=n.mag()>=2;if(!l&&!p)return;if(!l||!p)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;let f=t.y>0==n.y>0;return la(t)&&la(n)&&f}}let Rl={panStep:100,bearingStep:15,pitchStep:10};class Vs{constructor(t){this._tr=new Pn(t);let n=Rl;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,s=0,l=0,p=0,f=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?s=-1:(t.preventDefault(),p=-1);break;case 39:t.shiftKey?s=1:(t.preventDefault(),p=1);break;case 38:t.shiftKey?l=1:(t.preventDefault(),f=-1);break;case 40:t.shiftKey?l=-1:(t.preventDefault(),f=1);break;default:return}return this._rotationDisabled&&(s=0,l=0),{cameraAnimation:g=>{let y=this._tr;g.easeTo({duration:300,easeId:"keyboardHandler",easing:qo,zoom:n?Math.round(y.zoom)+n*(t.shiftKey?2:1):y.zoom,bearing:y.bearing+s*this._bearingStep,pitch:y.pitch+l*this._pitchStep,offset:[-p*this._panStep,-f*this._panStep],center:y.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 qo(h){return h*(2-h)}let Us=4.000244140625;class Fl{constructor(t,n){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=t,this._tr=new Pn(t),this._el=t.getCanvasContainer(),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}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)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,s=c.browser.now(),l=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,n!==0&&n%Us==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(l*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let n=te.mousePos(this._el,t),s=this._tr;this._around=c.LngLat.convert(this._aroundCenter?s.center:s.unproject(n)),this._aroundPoint=s.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._tr.transform;if(this._delta!==0){let g=this._type==="wheel"&&Math.abs(this._delta)>Us?this._wheelZoomRate:this._defaultZoomRate,y=2/(1+Math.exp(-Math.abs(this._delta*g)));this._delta<0&&y!==0&&(y=1/y);let v=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(v*y))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,s=this._startZoom,l=this._easing,p,f=!1;if(this._type==="wheel"&&s&&l){let g=Math.min((c.browser.now()-this._lastWheelEventTime)/200,1),y=l(g);p=c.interpolate.number(s,n,y),g<1?this._frameId||(this._frameId=!0):f=!0}else p=n,f=!0;return this._active=!0,f&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!f,zoomDelta:p-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=c.defaultEasing;if(this._prevEase){let s=this._prevEase,l=(c.browser.now()-s.start)/s.duration,p=s.easing(l+.01)-s.easing(l),f=.27/Math.sqrt(p*p+1e-4)*.01,g=Math.sqrt(.0729-f*f);n=c.bezier(f,g,.25,1)}return this._prevEase={start:c.browser.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ol{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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 Ns{constructor(t){this._tr=new Pn(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class $s{constructor(){this._tap=new Yi({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,s){if(!this._swipePoint)if(this._tapTime){let l=n[0],p=t.timeStamp-this._tapTime<500,f=this._tapPoint.dist(l)<30;p&&f?s.length>0&&(this._swipePoint=l,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(t,n,s)}touchmove(t,n,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;let l=n[0],p=l.y-this._swipePoint.y;return this._swipePoint=l,t.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(t,n,s)}touchend(t,n,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{let l=this._tap.touchend(t,n,s);l&&(this._tapTime=t.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class qs{constructor(t,n,s){this._el=t,this._mousePan=n,this._touchPan=s}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 Zs{constructor(t,n,s){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=s}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class vi{constructor(t,n,s,l){this._el=t,this._touchZoom=n,this._touchRotate=s,this._tapDragZoom=l,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()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}let Ji=h=>h.zoom||h.drag||h.pitch||h.rotate;class Zo extends c.Event{}function ca(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}class js{constructor(t,n){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,p)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let f=l.type==="renderFrame"?void 0:l,g={needsRenderFrame:!1},y={},v={},w=l.touches,E=w?this._getMapTouches(w):void 0,A=E?te.touchPos(this._el,E):te.mousePos(this._el,l);for(let{handlerName:O,handler:k,allowed:G}of this._handlers){if(!k.isEnabled())continue;let J;this._blockedByActive(v,G,O)?k.reset():k[p||l.type]&&(J=k[p||l.type](l,A,E),this.mergeHandlerResult(g,y,J,O,f),J&&J.needsRenderFrame&&this._triggerRenderFrame()),(J||k.isActive())&&(v[O]=k)}let B={};for(let O in this._previousActiveHandlers)v[O]||(B[O]=f);this._previousActiveHandlers=v,(Object.keys(B).length||ca(g))&&(this._changes.push([g,y,B]),this._triggerRenderFrame()),(Object.keys(v).length||ca(g))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:D}=g;D&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],D(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Fo(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);let s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[window,"blur",void 0]];for(let[l,p,f]of this._listeners)te.addEventListener(l,p,l===document?this.handleWindowEvent:this.handleEvent,f)}destroy(){for(let[t,n,s]of this._listeners)te.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(t){let n=this._map,s=n.getCanvasContainer();this._add("mapEvent",new Vo(n,t));let l=n.boxZoom=new na(n,t);this._add("boxZoom",l),t.interactive&&t.boxZoom&&l.enable();let p=new No(n),f=new Ns(n);n.doubleClickZoom=new Ol(f,p),this._add("tapZoom",p),this._add("clickZoom",f),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();let g=new $s;this._add("tapDragZoom",g);let y=n.touchPitch=new Bl(n);this._add("touchPitch",y),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);let v=Fs(t),w=kn(t);n.dragRotate=new Zs(t,v,w),this._add("mouseRotate",v,["mousePitch"]),this._add("mousePitch",w,["mouseRotate"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();let E=(({enable:G,clickTolerance:J})=>{let U=new Bs({checkCorrectEvent:H=>te.mouseButton(H)===0&&!H.ctrlKey});return new Bi({clickTolerance:J,move:(H,ee)=>({around:ee,panDelta:ee.sub(H)}),activateOnStart:!0,moveStateManager:U,enable:G,assignEvents:Rs})})(t),A=new Vr(t,n);n.dragPan=new qs(s,E,A),this._add("mousePan",E),this._add("touchPan",A,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);let B=new we,D=new oa;n.touchZoomRotate=new vi(s,D,B,g),this._add("touchRotate",B,["touchPan","touchZoom"]),this._add("touchZoom",D,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate);let O=n.scrollZoom=new Fl(n,()=>this._triggerRenderFrame());this._add("scrollZoom",O,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);let k=n.keyboard=new Vs(n);this._add("keyboard",k),t.interactive&&t.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new Uo(n))}_add(t,n,s){this._handlers.push({handlerName:t,handler:n,allowed:s}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(let{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{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!!Ji(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,s){for(let l in t)if(l!==s&&(!n||n.indexOf(l)<0))return!0;return!1}_getMapTouches(t){let n=[];for(let s of t)this._el.contains(s.target)&&n.push(s);return n}mergeHandlerResult(t,n,s,l,p){if(!s)return;c.extend(t,s);let f={handlerName:l,originalEvent:s.originalEvent||p};s.zoomDelta!==void 0&&(n.zoom=f),s.panDelta!==void 0&&(n.drag=f),s.pitchDelta!==void 0&&(n.pitch=f),s.bearingDelta!==void 0&&(n.rotate=f)}_applyChanges(){let t={},n={},s={};for(let[l,p,f]of this._changes)l.panDelta&&(t.panDelta=(t.panDelta||new c.Point(0,0))._add(l.panDelta)),l.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+l.pitchDelta),l.around!==void 0&&(t.around=l.around),l.pinchAround!==void 0&&(t.pinchAround=l.pinchAround),l.noInertia&&(t.noInertia=l.noInertia),c.extend(n,p),c.extend(s,f);this._updateMapTransform(t,n,s),this._changes=[]}_updateMapTransform(t,n,s){let l=this._map,p=l._getTransformForUpdate(),f=l.terrain;if(!(ca(t)||f&&this._terrainMovement))return this._fireEvents(n,s,!0);let{panDelta:g,zoomDelta:y,bearingDelta:v,pitchDelta:w,around:E,pinchAround:A}=t;A!==void 0&&(E=A),l._stop(!0),E=E||l.transform.centerPoint;let B=p.pointLocation(g?E.sub(g):E);v&&(p.bearing+=v),w&&(p.pitch+=w),y&&(p.zoom+=y),f?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?p.center=p.pointLocation(p.centerPoint.sub(g)):p.setLocationAtPoint(B,E):(this._terrainMovement=!0,this._map._elevationFreeze=!0,p.setLocationAtPoint(B,E),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,p.recalculateZoom(l.terrain)})):p.setLocationAtPoint(B,E),l._applyUpdatedTransform(p),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,s,!0)}_fireEvents(t,n,s){let l=Ji(this._eventsInProgress),p=Ji(t),f={};for(let w in t){let{originalEvent:E}=t[w];this._eventsInProgress[w]||(f[`${w}start`]=E),this._eventsInProgress[w]=t[w]}!l&&p&&this._fireEvent("movestart",p.originalEvent);for(let w in f)this._fireEvent(w,f[w]);p&&this._fireEvent("move",p.originalEvent);for(let w in t){let{originalEvent:E}=t[w];this._fireEvent(w,E)}let g={},y;for(let w in this._eventsInProgress){let{handlerName:E,originalEvent:A}=this._eventsInProgress[w];this._handlersById[E].isActive()||(delete this._eventsInProgress[w],y=n[E]||A,g[`${w}end`]=y)}for(let w in g)this._fireEvent(w,g[w]);let v=Ji(this._eventsInProgress);if(s&&(l||p)&&!v){this._updatingCamera=!0;let w=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),E=A=>A!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Zo("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Gs extends c.Evented{constructor(t,n){super(),this._renderFrameCallback=()=>{let s=Math.min((c.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,s){return t=c.Point.convert(t).mult(-1),this.panTo(this.transform.center,c.extend({offset:t},n),s)}panTo(t,n,s){return this.easeTo(c.extend({center:t},n),s)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,s){return this.easeTo(c.extend({zoom:t},n),s)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,s){return this.easeTo(c.extend({bearing:t},n),s)}resetNorth(t,n){return this.rotateTo(0,c.extend({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(c.extend({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(s.zoom=c.interpolate.number(l,y,ie)),this._rotating&&(s.bearing=c.interpolate.number(p,v,ie)),this._pitching&&(s.pitch=c.interpolate.number(f,w,ie)),this._padding&&(s.interpolatePadding(g,E,ie),B=s.centerPoint.add(A)),this.terrain&&!t.freezeElevation&&this._updateElevation(ie),U)s.setLocationAtPoint(U,H);else{let ae=s.zoomScale(s.zoom-l),he=y>l?Math.min(2,J):Math.max(.5,J),ce=Math.pow(he,1-ie),pe=s.unproject(k.add(G.mult(ie*ce)).mult(ae));s.setLocationAtPoint(s.renderWorldCopies?pe.wrap():pe,B)}this._applyUpdatedTransform(s),this._fireMoveEvents(n)},ie=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,ie)},t),this}_prepareEase(t,n,s={}){this._moving=!0,n||s.moving||this.fire(new c.Event("movestart",t)),this._zooming&&!s.zooming&&this.fire(new c.Event("zoomstart",t)),this._rotating&&!s.rotating&&this.fire(new c.Event("rotatestart",t)),this._pitching&&!s.pitching&&this.fire(new c.Event("pitchstart",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.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){let s=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(s-(n-(s*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=c.interpolate.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;let n=t.clone(),{center:s,zoom:l,pitch:p,bearing:f,elevation:g}=this.transformCameraUpdate(n);s&&(n.center=s),l!==void 0&&(n.zoom=l),p!==void 0&&(n.pitch=p),f!==void 0&&(n.bearing=f),g!==void 0&&(n.elevation=g),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new c.Event("move",t)),this._zooming&&this.fire(new c.Event("zoom",t)),this._rotating&&this.fire(new c.Event("rotate",t)),this._pitching&&this.fire(new c.Event("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let s=this._zooming,l=this._rotating,p=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,s&&this.fire(new c.Event("zoomend",t)),l&&this.fire(new c.Event("rotateend",t)),p&&this.fire(new c.Event("pitchend",t)),this.fire(new c.Event("moveend",t))}flyTo(t,n){if(!t.essential&&c.browser.prefersReducedMotion){let Ce=c.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ce,n)}this.stop(),t=c.extend({offset:[0,0],speed:1.2,curve:1.42,easing:c.defaultEasing},t);let s=this._getTransformForUpdate(),l=this.getZoom(),p=this.getBearing(),f=this.getPitch(),g=this.getPadding(),y="zoom"in t?c.clamp(+t.zoom,s.minZoom,s.maxZoom):l,v="bearing"in t?this._normalizeBearing(t.bearing,p):p,w="pitch"in t?+t.pitch:f,E="padding"in t?t.padding:s.padding,A=s.zoomScale(y-l),B=c.Point.convert(t.offset),D=s.centerPoint.add(B),O=s.pointLocation(D),k=c.LngLat.convert(t.center||O);this._normalizeCenter(k);let G=s.project(O),J=s.project(k).sub(G),U=t.curve,H=Math.max(s.width,s.height),ee=H/A,ie=J.mag();if("minZoom"in t){let Ce=c.clamp(Math.min(t.minZoom,l,y),s.minZoom,s.maxZoom),vt=H/s.zoomScale(Ce-l);U=Math.sqrt(vt/ie*2)}let ae=U*U;function he(Ce){let vt=(ee*ee-H*H+(Ce?-1:1)*ae*ae*ie*ie)/(2*(Ce?ee:H)*ae*ie);return Math.log(Math.sqrt(vt*vt+1)-vt)}function ce(Ce){return(Math.exp(Ce)-Math.exp(-Ce))/2}function pe(Ce){return(Math.exp(Ce)+Math.exp(-Ce))/2}let Se=he(!1),He=function(Ce){return pe(Se)/pe(Se+U*Ce)},_e=function(Ce){return H*((pe(Se)*(ce(vt=Se+U*Ce)/pe(vt))-ce(Se))/ae)/ie;var vt},Re=(he(!0)-Se)/U;if(Math.abs(ie)<1e-6||!isFinite(Re)){if(Math.abs(H-ee)<1e-6)return this.easeTo(t,n);let Ce=eet.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=p!==v,this._pitching=w!==f,this._padding=!s.isPaddingEqual(E),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(k),this._ease(Ce=>{let vt=Ce*Re,je=1/He(vt);s.zoom=Ce===1?y:l+s.scaleZoom(je),this._rotating&&(s.bearing=c.interpolate.number(p,v,Ce)),this._pitching&&(s.pitch=c.interpolate.number(f,w,Ce)),this._padding&&(s.interpolatePadding(g,E,Ce),D=s.centerPoint.add(B)),this.terrain&&!t.freezeElevation&&this._updateElevation(Ce);let Ge=Ce===1?k:s.unproject(G.add(J.mult(_e(vt))).mult(je));s.setLocationAtPoint(s.renderWorldCopies?Ge.wrap():Ge,D),this._applyUpdatedTransform(s),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let s=this._onEaseEnd;delete this._onEaseEnd,s.call(this,n)}if(!t){let s=this.handlers;s&&s.stop(!1)}return this}_ease(t,n,s){s.animate===!1||s.duration===0?(t(1),n()):(this._easeStart=c.browser.now(),this._easeOptions=s,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=c.wrap(t,-180,180);let s=Math.abs(t-n);return Math.abs(t-360-n)180?-360:s<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(c.LngLat.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}class Xs{constructor(t={}){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=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.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&&this.options.compact,this._container=te.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=te.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=te.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(){te.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){let s=this._map._getUIString(`AttributionControl.${n}`);t.title=s,t.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}let n=this._map.style.sourceCaches;for(let l in n){let p=n[l];if(p.used||p.usedForTerrain){let f=p.getSource();f.attribution&&t.indexOf(f.attribution)<0&&t.push(f.attribution)}}t=t.filter(l=>String(l).trim()),t.sort((l,p)=>l.length-p.length),t=t.filter((l,p)=>{for(let f=p+1;f=0)return!1;return!0});let s=t.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,t.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ri{constructor(t={}){this._updateCompact=()=>{let n=this._container.children;if(n.length){let s=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&s.classList.add("maplibregl-compact"):s.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=te.create("div","maplibregl-ctrl");let n=te.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){te.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class yt{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){let n=this._currentlyRunning,s=n?this._queue.concat(n):this._queue;for(let l of s)if(l.id===t)return void(l.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let n=this._currentlyRunning=this._queue;this._queue=[];for(let s of n)if(!s.cancelled&&(s.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}let Ga={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var Hs=c.createLayout([{name:"a_pos3d",type:"Int16",components:3}]);class jo extends c.Evented{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];let s={};for(let l of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))s[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.posMatrix=new Float64Array(16),c.ortho(l.posMatrix,0,c.EXTENT,0,c.EXTENT,0,1),this._tiles[l.key]=new wr(l,this.tileSize));for(let l in this._tiles)s[l]||delete this._tiles[l]}freeRtt(t){for(let n in this._tiles){let s=this._tiles[n];(!t||s.tileID.equals(t)||s.tileID.isChildOf(t)||t.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){let n={};for(let s of this._renderableTilesKeys){let l=this._tiles[s].tileID;if(l.canonical.equals(t.canonical)){let p=t.clone();p.posMatrix=new Float64Array(16),c.ortho(p.posMatrix,0,c.EXTENT,0,c.EXTENT,0,1),n[s]=p}else if(l.canonical.isChildOf(t.canonical)){let p=t.clone();p.posMatrix=new Float64Array(16);let f=l.canonical.z-t.canonical.z,g=l.canonical.x-(l.canonical.x>>f<>f<>f;c.ortho(p.posMatrix,0,v,0,v,0,1),c.translate(p.posMatrix,p.posMatrix,[-g*v,-y*v,0]),n[s]=p}else if(t.canonical.isChildOf(l.canonical)){let p=t.clone();p.posMatrix=new Float64Array(16);let f=t.canonical.z-l.canonical.z,g=t.canonical.x-(t.canonical.x>>f<>f<>f;c.ortho(p.posMatrix,0,c.EXTENT,0,c.EXTENT,0,1),c.translate(p.posMatrix,p.posMatrix,[g*v,y*v,0]),c.scale(p.posMatrix,p.posMatrix,[1/2**f,1/2**f,0]),n[s]=p}}return n}getSourceTile(t,n){let s=this.sourceCache._source,l=t.overscaledZ-this.deltaZoom;if(l>s.maxzoom&&(l=s.maxzoom),l=s.minzoom&&(!p||!p.dem);)p=this.sourceCache.getTileByID(t.scaledTo(l--).key);return p}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class Go{constructor(t,n,s){this.painter=t,this.sourceCache=new jo(n),this.options=s,this.exaggeration=typeof s.exaggeration=="number"?s.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,s,l=c.EXTENT){var p;if(!(n>=0&&n=0&&st.canonical.z&&(t.canonical.z>=l?p=t.canonical.z-l:c.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let f=t.canonical.x-(t.canonical.x>>p<>p<>8<<4|p>>8,n[f+3]=0;let s=new c.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),l=new Tt(t,s,t.gl.RGBA,{premultiply:!1});return l.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(t){let n=new Uint8Array(4),s=this.painter.context,l=s.gl;s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,n),s.bindFramebuffer.set(null);let p=n[0]+(n[2]>>4<<8),f=n[1]+((15&n[2])<<8),g=this.coordsIndex[255-n[3]],y=g&&this.sourceCache.getTileByID(g);if(!y)return null;let v=this._coordsTextureSize,w=(1<t.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}let Ln={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class dr{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new Xo(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(s=>!t._layers[s].isHidden(n)),this._coordsDescendingInv={};for(let s in t.sourceCaches){this._coordsDescendingInv[s]={};let l=t.sourceCaches[s].getVisibleCoordinates();for(let p of l){let f=this.terrain.sourceCache.getTerrainCoords(p);for(let g in f)this._coordsDescendingInv[s][g]||(this._coordsDescendingInv[s][g]=[]),this._coordsDescendingInv[s][g].push(f[g])}}this._coordsDescendingInvStr={};for(let s of t._order){let l=t._layers[s],p=l.source;if(Ln[l.type]&&!this._coordsDescendingInvStr[p]){this._coordsDescendingInvStr[p]={};for(let f in this._coordsDescendingInv[p])this._coordsDescendingInvStr[p][f]=this._coordsDescendingInv[p][f].map(g=>g.key).sort().join()}}for(let s of this._renderableTiles)for(let l in this._coordsDescendingInvStr){let p=this._coordsDescendingInvStr[l][s.tileID.key];p&&p!==s.rttCoords[l]&&(s.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;let n=t.type,s=this.painter,l=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Ln[n]&&(this._prevType&&Ln[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!l))return!0;if(Ln[this._prevType]||Ln[n]&&l){this._prevType=n;let p=this._stacks.length-1,f=this._stacks[p]||[];for(let g of this._renderableTiles){if(this.pool.isFull()&&(ks(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(g),g.rtt[p]){let v=this.pool.getObjectForId(g.rtt[p].id);if(v.stamp===g.rtt[p].stamp){this.pool.useObject(v);continue}}let y=this.pool.getOrCreateFreeObject();this.pool.useObject(y),this.pool.stampObject(y),g.rtt[p]={id:y.id,stamp:y.stamp},s.context.bindFramebuffer.set(y.fbo.framebuffer),s.context.clear({color:c.Color.transparent,stencil:0}),s.currentStencilSource=void 0;for(let v=0;v{h.touchstart=h.dragStart,h.touchmoveWindow=h.dragMove,h.touchend=h.dragEnd},Ha={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ws{constructor(t,n,s=!1){this.mousedown=f=>{this.startMouse(c.extend({},f,{ctrlKey:!0,preventDefault:()=>f.preventDefault()}),te.mousePos(this.element,f)),te.addEventListener(window,"mousemove",this.mousemove),te.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=f=>{this.moveMouse(f,te.mousePos(this.element,f))},this.mouseup=f=>{this.mouseRotate.dragEnd(f),this.mousePitch&&this.mousePitch.dragEnd(f),this.offTemp()},this.touchstart=f=>{f.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=te.touchPos(this.element,f.targetTouches)[0],this.startTouch(f,this._startPos),te.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),te.addEventListener(window,"touchend",this.touchend))},this.touchmove=f=>{f.targetTouches.length!==1?this.reset():(this._lastPos=te.touchPos(this.element,f.targetTouches)[0],this.moveTouch(f,this._lastPos))},this.touchend=f=>{f.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let l=t.dragRotate._mouseRotate.getClickTolerance(),p=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=Fs({clickTolerance:l,enable:!0}),this.touchRotate=(({enable:f,clickTolerance:g,bearingDegreesPerPixelMoved:y=.8})=>{let v=new $o;return new Bi({clickTolerance:g,move:(w,E)=>({bearingDelta:(E.x-w.x)*y}),moveStateManager:v,enable:f,assignEvents:Be})})({clickTolerance:l,enable:!0}),this.map=t,s&&(this.mousePitch=kn({clickTolerance:p,enable:!0}),this.touchPitch=(({enable:f,clickTolerance:g,pitchDegreesPerPixelMoved:y=-.5})=>{let v=new $o;return new Bi({clickTolerance:g,move:(w,E)=>({pitchDelta:(E.y-w.y)*y}),moveStateManager:v,enable:f,assignEvents:Be})})({clickTolerance:p,enable:!0})),te.addEventListener(n,"mousedown",this.mousedown),te.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),te.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),te.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),te.disableDrag()}moveMouse(t,n){let s=this.map,{bearingDelta:l}=this.mouseRotate.dragMove(t,n)||{};if(l&&s.setBearing(s.getBearing()+l),this.mousePitch){let{pitchDelta:p}=this.mousePitch.dragMove(t,n)||{};p&&s.setPitch(s.getPitch()+p)}}moveTouch(t,n){let s=this.map,{bearingDelta:l}=this.touchRotate.dragMove(t,n)||{};if(l&&s.setBearing(s.getBearing()+l),this.touchPitch){let{pitchDelta:p}=this.touchPitch.dragMove(t,n)||{};p&&s.setPitch(s.getPitch()+p)}}off(){let t=this.element;te.removeEventListener(t,"mousedown",this.mousedown),te.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),te.removeEventListener(window,"touchend",this.touchend),te.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){te.enableDrag(),te.removeEventListener(window,"mousemove",this.mousemove),te.removeEventListener(window,"mouseup",this.mouseup),te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),te.removeEventListener(window,"touchend",this.touchend)}}let mr;function pi(h,t,n){if(h=new c.LngLat(h.lng,h.lat),t){let s=new c.LngLat(h.lng-360,h.lat),l=new c.LngLat(h.lng+360,h.lat),p=n.locationPoint(h).distSqr(t);n.locationPoint(s).distSqr(t)180;){let s=n.locationPoint(h);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;h.lng>n.center.lng?h.lng-=360:h.lng+=360}return h}let Wa={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 Qi(h,t,n){let s=h.classList;for(let l in Wa)s.remove(`maplibregl-${n}-anchor-${l}`);s.add(`maplibregl-${n}-anchor-${t}`)}class Ks extends c.Evented{constructor(t){if(super(),this._onKeyPress=n=>{let s=n.code,l=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=n=>{let s=n.originalEvent.target,l=this._element;this._popup&&(s===l||l.contains(s))&&this.togglePopup()},this._update=n=>{if(!this._map)return;let s=this._map.loaded()&&!this._map.isMoving();(n?.type==="terrain"||n?.type==="render"&&!s)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=pi(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p=`rotateX(${this._map.getPitch()}deg)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),te.setTransform(this._element,`${Wa[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${p} ${l}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{let f=this._map.unproject(this._pos),g=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=f.distanceTo(this._lngLat)>20*g?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=n=>{if(!this._isDragging){let s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.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 c.Event("dragstart"))),this.fire(new c.Event("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 c.Event("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.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&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=c.Point.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=te.create("div"),this._element.setAttribute("aria-label","Map marker");let n=te.createNS("http://www.w3.org/2000/svg","svg"),s=41,l=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${s}px`),n.setAttributeNS(null,"width",`${l}px`),n.setAttributeNS(null,"viewBox",`0 0 ${l} ${s}`);let p=te.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"stroke","none"),p.setAttributeNS(null,"stroke-width","1"),p.setAttributeNS(null,"fill","none"),p.setAttributeNS(null,"fill-rule","evenodd");let f=te.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill-rule","nonzero");let g=te.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");let y=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let G of y){let J=te.createNS("http://www.w3.org/2000/svg","ellipse");J.setAttributeNS(null,"opacity","0.04"),J.setAttributeNS(null,"cx","10.5"),J.setAttributeNS(null,"cy","5.80029008"),J.setAttributeNS(null,"rx",G.rx),J.setAttributeNS(null,"ry",G.ry),g.appendChild(J)}let v=te.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"fill",this._color);let w=te.createNS("http://www.w3.org/2000/svg","path");w.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),v.appendChild(w);let E=te.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"opacity","0.25"),E.setAttributeNS(null,"fill","#000000");let A=te.createNS("http://www.w3.org/2000/svg","path");A.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(A);let B=te.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(6.0, 7.0)"),B.setAttributeNS(null,"fill","#FFFFFF");let D=te.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"transform","translate(8.0, 8.0)");let O=te.createNS("http://www.w3.org/2000/svg","circle");O.setAttributeNS(null,"fill","#000000"),O.setAttributeNS(null,"opacity","0.25"),O.setAttributeNS(null,"cx","5.5"),O.setAttributeNS(null,"cy","5.5"),O.setAttributeNS(null,"r","5.4999962");let k=te.createNS("http://www.w3.org/2000/svg","circle");k.setAttributeNS(null,"fill","#FFFFFF"),k.setAttributeNS(null,"cx","5.5"),k.setAttributeNS(null,"cy","5.5"),k.setAttributeNS(null,"r","5.4999962"),D.appendChild(O),D.appendChild(k),f.appendChild(g),f.appendChild(v),f.appendChild(E),f.appendChild(B),f.appendChild(D),n.appendChild(f),n.setAttributeNS(null,"height",s*this._scale+"px"),n.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(n),this._offset=c.Point.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),Qi(this._element,this._anchor,"marker"),t&&t.className)for(let n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),te.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=c.LngLat.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)){let l=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){let t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(t){return this._offset=c.Point.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}}let ha={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ft=0,xt=!1,Ho={maxWidth:100,unit:"metric"};function Bn(h,t,n){let s=n&&n.maxWidth||100,l=h._container.clientHeight/2,p=h.unproject([0,l]),f=h.unproject([s,l]),g=p.distanceTo(f);if(n&&n.unit==="imperial"){let y=3.2808*g;y>5280?Ur(t,s,y/5280,h._getUIString("ScaleControl.Miles")):Ur(t,s,y,h._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?Ur(t,s,g/1852,h._getUIString("ScaleControl.NauticalMiles")):g>=1e3?Ur(t,s,g/1e3,h._getUIString("ScaleControl.Kilometers")):Ur(t,s,g,h._getUIString("ScaleControl.Meters"))}function Ur(h,t,n,s){let l=function(p){let f=Math.pow(10,`${Math.floor(p)}`.length-1),g=p/f;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:g>=1?1:function(y){let v=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*v)/v}(g),f*g}(n);h.style.width=t*(l/n)+"px",h.innerHTML=`${l} ${s}`}let Ys={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Js=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ka(h){if(h){if(typeof h=="number"){let t=Math.round(Math.abs(h)/Math.SQRT2);return{center:new c.Point(0,0),top:new c.Point(0,h),"top-left":new c.Point(t,t),"top-right":new c.Point(-t,t),bottom:new c.Point(0,-h),"bottom-left":new c.Point(t,-t),"bottom-right":new c.Point(-t,-t),left:new c.Point(h,0),right:new c.Point(-h,0)}}if(h instanceof c.Point||Array.isArray(h)){let t=c.Point.convert(h);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:c.Point.convert(h.center||[0,0]),top:c.Point.convert(h.top||[0,0]),"top-left":c.Point.convert(h["top-left"]||[0,0]),"top-right":c.Point.convert(h["top-right"]||[0,0]),bottom:c.Point.convert(h.bottom||[0,0]),"bottom-left":c.Point.convert(h["bottom-left"]||[0,0]),"bottom-right":c.Point.convert(h["bottom-right"]||[0,0]),left:c.Point.convert(h.left||[0,0]),right:c.Point.convert(h.right||[0,0])}}return Ka(new c.Point(0,0))}let ua={extend:(h,...t)=>c.extend(h,...t),run(h){h()},logToElement(h,t=!1,n="log"){let s=window.document.getElementById(n);s&&(t&&(s.innerHTML=""),s.innerHTML+=`
${h}`)}},Qs=Wt;class nt{static get version(){return Qs}static get workerCount(){return Je.workerCount}static set workerCount(t){Je.workerCount=t}static get maxParallelImageRequests(){return c.config.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){c.config.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return c.config.WORKER_URL}static set workerUrl(t){c.config.WORKER_URL=t}static addProtocol(t,n){c.config.REGISTERED_PROTOCOLS[t]=n}static removeProtocol(t){delete c.config.REGISTERED_PROTOCOLS[t]}}return nt.Map=class extends Gs{constructor(h){if(c.PerformanceUtils.mark(c.PerformanceMarkers.create),(h=c.extend({},Me,h)).minZoom!=null&&h.maxZoom!=null&&h.minZoom>h.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(h.minPitch!=null&&h.maxPitch!=null&&h.minPitch>h.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(h.minPitch!=null&&h.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(h.maxPitch!=null&&h.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new ta(h.minZoom,h.maxZoom,h.minPitch,h.maxPitch,h.renderWorldCopies),{bearingSnap:h.bearingSnap}),this._cooperativeGesturesOnWheel=t=>{this._onCooperativeGesture(t,t[this._metaKey],1)},this._contextLost=t=>{t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new c.Event("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.Event("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=h.interactive,this._cooperativeGestures=h.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=h.maxTileCacheSize,this._maxTileCacheZoomLevels=h.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=h.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=h.preserveDrawingBuffer,this._antialias=h.antialias,this._trackResize=h.trackResize,this._bearingSnap=h.bearingSnap,this._refreshExpiredTiles=h.refreshExpiredTiles,this._fadeDuration=h.fadeDuration,this._crossSourceCollisions=h.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=h.collectResourceTiming,this._renderTaskQueue=new yt,this._controls=[],this._mapId=c.uniqueId(),this._locale=c.extend({},Ga,h.locale),this._clickTolerance=h.clickTolerance,this._overridePixelRatio=h.pixelRatio,this._maxCanvasSize=h.maxCanvasSize,this.transformCameraUpdate=h.transformCameraUpdate,this._imageQueueHandle=st.addThrottleControl(()=>this.isMoving()),this._requestManager=new At(h.transformRequest),typeof h.container=="string"){if(this._container=document.getElementById(h.container),!this._container)throw new Error(`Container '${h.container}' not found.`)}else{if(!(h.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=h.container}if(h.maxBounds&&this.setMaxBounds(h.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let t=!1,n=Ds(s=>{this._trackResize&&!this._removed&&this.resize(s)._update()},50);this._resizeObserver=new ResizeObserver(s=>{t?n(s):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new js(this,h),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=h.hash&&new Mn(typeof h.hash=="string"&&h.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:h.center,zoom:h.zoom,bearing:h.bearing,pitch:h.pitch}),h.bounds&&(this.resize(),this.fitBounds(h.bounds,c.extend({},h.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=h.localIdeographFontFamily,this._validateStyle=h.validateStyle,h.style&&this.setStyle(h.style,{localIdeographFontFamily:h.localIdeographFontFamily}),h.attributionControl&&this.addControl(new Xs({customAttribution:h.customAttribution})),h.maplibreLogo&&this.addControl(new Ri,h.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update(t.dataType==="style"),this.fire(new c.Event(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new c.Event(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new c.Event("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(h,t){if(t===void 0&&(t=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new c.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let n=h.onAdd(this);this._controls.push(h);let s=this._controlPositions[t];return t.indexOf("bottom")!==-1?s.insertBefore(n,s.firstChild):s.appendChild(n),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new c.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(h);return t>-1&&this._controls.splice(t,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}calculateCameraOptionsFromTo(h,t,n,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,t,n,s)}resize(h){var t;let n=this._containerDimensions(),s=n[0],l=n[1],p=this._getClampedPixelRatio(s,l);if(this._resizeCanvas(s,l,p),this.painter.resize(s,l,p),this.painter.overLimit()){let g=this.painter.context.gl;this._maxCanvasSize=[g.drawingBufferWidth,g.drawingBufferHeight];let y=this._getClampedPixelRatio(s,l);this._resizeCanvas(s,l,y),this.painter.resize(s,l,y)}this.transform.resize(s,l),(t=this._requestedCameraState)===null||t===void 0||t.resize(s,l);let f=!this._moving;return f&&(this.stop(),this.fire(new c.Event("movestart",h)).fire(new c.Event("move",h))),this.fire(new c.Event("resize",h)),f&&this.fire(new c.Event("moveend",h)),this}_getClampedPixelRatio(h,t){let{0:n,1:s}=this._maxCanvasSize,l=this.getPixelRatio(),p=h*l,f=t*l;return Math.min(p>n?n/p:1,f>s?s/f:1)*l}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(mt.convert(h)),this._update()}setMinZoom(h){if((h=h??-2)>=-2&&h<=this.transform.maxZoom)return this.transform.minZoom=h,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=h,this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.minPitch=h,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(h>=this.transform.minPitch)return this.transform.maxPitch=h,this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.renderWorldCopies=h,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(h){return this._cooperativeGestures=h,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(h){return this.transform.locationPoint(c.LngLat.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.pointLocation(c.Point.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,t,n){if(h==="mouseenter"||h==="mouseover"){let s=!1;return{layer:t,listener:n,delegates:{mousemove:p=>{let f=this.getLayer(t)?this.queryRenderedFeatures(p.point,{layers:[t]}):[];f.length?s||(s=!0,n.call(this,new Li(h,this,p.originalEvent,{features:f}))):s=!1},mouseout:()=>{s=!1}}}}if(h==="mouseleave"||h==="mouseout"){let s=!1;return{layer:t,listener:n,delegates:{mousemove:f=>{(this.getLayer(t)?this.queryRenderedFeatures(f.point,{layers:[t]}):[]).length?s=!0:s&&(s=!1,n.call(this,new Li(h,this,f.originalEvent)))},mouseout:f=>{s&&(s=!1,n.call(this,new Li(h,this,f.originalEvent)))}}}}{let s=l=>{let p=this.getLayer(t)?this.queryRenderedFeatures(l.point,{layers:[t]}):[];p.length&&(l.features=p,n.call(this,l),delete l.features)};return{layer:t,listener:n,delegates:{[h]:s}}}}on(h,t,n){if(n===void 0)return super.on(h,t);let s=this._createDelegatedListener(h,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(s);for(let l in s.delegates)this.on(l,s.delegates[l]);return this}once(h,t,n){if(n===void 0)return super.once(h,t);let s=this._createDelegatedListener(h,t,n);for(let l in s.delegates)this.once(l,s.delegates[l]);return this}off(h,t,n){return n===void 0?super.off(h,t):(this._delegatedListeners&&this._delegatedListeners[h]&&(s=>{let l=this._delegatedListeners[h];for(let p=0;pthis._updateStyle(h,t));let n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new Qt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,t,n):this.style.loadJSON(h,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Qt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,t){if(typeof h=="string"){let n=this._requestManager.transformRequest(h,Ye.Style);c.getJSON(n,(s,l)=>{s?this.fire(new c.ErrorEvent(s)):l&&this._updateDiff(l,t)})}else typeof h=="object"&&this._updateDiff(h,t)}_updateDiff(h,t){try{this.style.setState(h,t)&&this._update(!0)}catch(n){c.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(h,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.warnOnce("There is no style added to the map.")}addSource(h,t){return this._lazyInitEmptyStyle(),this.style.addSource(h,t),this._update(!0)}isSourceLoaded(h){let t=this.style&&this.style.sourceCaches[h];if(t!==void 0)return t.loaded();this.fire(new c.ErrorEvent(new Error(`There is no source with ID '${h}'`)))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){let t=this.style.sourceCaches[h.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${h.source}`);for(let n in this.style._layers){let s=this.style._layers[n];s.type==="hillshade"&&s.source===h.source&&c.warnOnce("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Go(this.painter,t,h),this.painter.renderToTexture=new dr(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==h.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.Event("terrain",{terrain:h})),this}getTerrain(){var h,t;return(t=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&t!==void 0?t:null}areTilesLoaded(){let h=this.style&&this.style.sourceCaches;for(let t in h){let n=h[t]._tiles;for(let s in n){let l=n[s];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}addSourceType(h,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(h,t,n)}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}addImage(h,t,n={}){let{pixelRatio:s=1,sdf:l=!1,stretchX:p,stretchY:f,content:g}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||c.isImageBitmap(t))){if(t.width===void 0||t.height===void 0)return this.fire(new c.ErrorEvent(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`")));{let{width:y,height:v,data:w}=t,E=t;return this.style.addImage(h,{data:new c.RGBAImage({width:y,height:v},new Uint8Array(w)),pixelRatio:s,stretchX:p,stretchY:f,content:g,sdf:l,version:0,userImage:E}),E.onAdd&&E.onAdd(this,h),this}}{let{width:y,height:v,data:w}=c.browser.getImageData(t);this.style.addImage(h,{data:new c.RGBAImage({width:y,height:v},w),pixelRatio:s,stretchX:p,stretchY:f,content:g,sdf:l,version:0})}}updateImage(h,t){let n=this.style.getImage(h);if(!n)return this.fire(new c.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let s=t instanceof HTMLImageElement||c.isImageBitmap(t)?c.browser.getImageData(t):t,{width:l,height:p,data:f}=s;if(l===void 0||p===void 0)return this.fire(new c.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==n.data.width||p!==n.data.height)return this.fire(new c.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));let g=!(t instanceof HTMLImageElement||c.isImageBitmap(t));return n.data.replace(f,g),this.style.updateImage(h,n),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new c.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h,t){st.getImage(this._requestManager.transformRequest(h,Ye.Image),t)}listImages(){return this.style.listImages()}addLayer(h,t){return this._lazyInitEmptyStyle(),this.style.addLayer(h,t),this._update(!0)}moveLayer(h,t){return this.style.moveLayer(h,t),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}setLayerZoomRange(h,t,n){return this.style.setLayerZoomRange(h,t,n),this._update(!0)}setFilter(h,t,n={}){return this.style.setFilter(h,t,n),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,t,n,s={}){return this.style.setPaintProperty(h,t,n,s),this._update(!0)}getPaintProperty(h,t){return this.style.getPaintProperty(h,t)}setLayoutProperty(h,t,n,s={}){return this.style.setLayoutProperty(h,t,n,s),this._update(!0)}getLayoutProperty(h,t){return this.style.getLayoutProperty(h,t)}setGlyphs(h,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,t,n,s=>{s||this._update(!0)}),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,t,n=>{n||this._update(!0)}),this}setLight(h,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(h,t){return this.style.setFeatureState(h,t),this._update()}removeFeatureState(h,t){return this.style.removeFeatureState(h,t),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,t=0;return this._container&&(h=this._container.clientWidth||400,t=this._container.clientHeight||300),[h,t]}_setupContainer(){let h=this._container;h.classList.add("maplibregl-map");let t=this._canvasContainer=te.create("div","maplibregl-canvas-container",h);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=te.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let n=this._containerDimensions(),s=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],s);let l=this._controlContainer=te.create("div","maplibregl-control-container",h),p=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(f=>{p[f]=te.create("div",`maplibregl-ctrl-${f} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=te.create("div","maplibregl-cooperative-gesture-screen",this._container);let h=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(h=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=` -
${h}
-
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
- `,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){te.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(h,t,n){this._canvas.width=Math.floor(n*h),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${h}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let h={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},t=null;this._canvas.addEventListener("webglcontextcreationerror",s=>{t={requestedAttributes:h},s&&(t.statusMessage=s.statusMessage,t.type=s.type)},{once:!0});let n=this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h);if(!n){let s="Failed to initialize WebGL";throw t?(t.message=s,new Error(JSON.stringify(t))):new Error(s)}this.painter=new Mt(n,this.transform),Fe.testSupport(n)}_onCooperativeGesture(h,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){let t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let l=this.transform.zoom,p=c.browser.now();this.style.zoomHistory.update(l,p);let f=new c.EvaluationParameters(l,{now:p,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),g=f.crossFadingFactor();g===1&&g===this._crossFadingFactor||(n=!0,this._crossFadingFactor=g),this.style.update(f)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new c.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.PerformanceUtils.mark(c.PerformanceMarkers.load),this.fire(new c.Event("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.Event("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,c.PerformanceUtils.mark(c.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(let n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),st.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),te.remove(this._canvasContainer),te.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),c.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new c.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=c.browser.frame(h=>{c.PerformanceUtils.frame(h),this._frame=null,this._render(h)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return Xa}getCameraTargetElevation(){return this.transform.elevation}},nt.NavigationControl=class{constructor(h){this._updateZoomButtons=()=>{let t=this._map.getZoom(),n=t===this._map.getMaxZoom(),s=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.toString())},this._rotateCompassArrow=()=>{let t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,n)=>{let s=this._map._getUIString(`NavigationControl.${n}`);t.title=s,t.setAttribute("aria-label",s)},this.options=c.extend({},Ha,h),this._container=te.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})),te.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})),te.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=te.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ws(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){te.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,t){let n=te.create("button",h,this._container);return n.type="button",n.addEventListener("click",t),n}},nt.GeolocateControl=class extends c.Evented{constructor(h){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new c.Event("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_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(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 c.Event("geolocate",t)),this._finish()}},this._updateCamera=t=>{let n=new c.LngLat(t.coords.longitude,t.coords.latitude),s=t.coords.accuracy,l=this._map.getBearing(),p=c.extend({bearing:l},this.options.fitBoundsOptions),f=mt.fromLngLat(n,s);this._map.fitBounds(f,p,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let n=new c.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)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;let n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&xt)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.Event("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=te.create("button","maplibregl-ctrl-geolocate",this._container),te.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){c.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");let n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{let n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=te.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ks({element:this._dotElement}),this._circleElement=te.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ks({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.Event("trackuserlocationend")))})}},this.options=c.extend({},ha,h)}onAdd(h){return this._map=h,this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,n=!1){mr===void 0||n?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(s=>{mr=s.state!=="denied",t(mr)}).catch(()=>{mr=!!window.navigator.geolocation,t(mr)}):(mr=!!window.navigator.geolocation,t(mr)):t(mr)}(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),te.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ft=0,xt=!1}_isOutOfMapMaxBounds(h){let t=this._map.getMaxBounds(),n=h.coords;return t&&(n.longitudet.getEast()||n.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let h=this._map.getBounds(),t=h.getSouthEast(),n=h.getNorthEast(),s=t.distanceTo(n),l=Math.ceil(this._accuracy/(s/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return c.warnOnce("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 c.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ft--,xt=!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 c.Event("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 c.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ft++,ft>1?(h={maximumAge:6e5,timeout:0},xt=!0):(h=this.options.positionOptions,xt=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},nt.AttributionControl=Xs,nt.LogoControl=Ri,nt.ScaleControl=class{constructor(h){this._onMove=()=>{Bn(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Bn(this._map,this._container,this.options)},this.options=c.extend({},Ho,h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){te.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},nt.FullscreenControl=class extends c.Evented{constructor(h={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:c.warnOnce("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){te.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let h=this._fullscreenButton=te.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);te.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.Event("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new c.Event("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},nt.TerrainControl=class{constructor(h){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=h}onAdd(h){return this._map=h,this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=te.create("button","maplibregl-ctrl-terrain",this._container),te.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(){te.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},nt.Popup=class extends c.Evented{constructor(h){super(),this.remove=()=>(this._content&&te.remove(this._content),this._container&&(te.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new c.Event("close")),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=te.create("div","maplibregl-popup",this._map.getContainer()),this._tip=te.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let f of this.options.className.split(" "))this._container.classList.add(f);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=pi(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;let n=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),s=this.options.anchor,l=Ka(this.options.offset);if(!s){let f=this._container.offsetWidth,g=this._container.offsetHeight,y;y=n.y+l.bottom.ythis._map.transform.height-g?["bottom"]:[],n.xthis._map.transform.width-f/2&&y.push("right"),s=y.length===0?"bottom":y.join("-")}let p=n.add(l[s]).round();te.setTransform(this._container,`${Wa[s]} translate(${p.x}px,${p.y}px)`),Qi(this._container,s,"popup")},this._onClose=()=>{this.remove()},this.options=c.extend(Object.create(Ys),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.Event("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=c.LngLat.convert(h),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){let t=document.createDocumentFragment(),n=document.createElement("body"),s;for(n.innerHTML=h;s=n.firstChild,s;)t.appendChild(s);return this.setDOMContent(t)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=te.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){this._container&&this._container.classList.add(h)}removeClassName(h){this._container&&this._container.classList.remove(h)}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}_createCloseButton(){this.options.closeButton&&(this._closeButton=te.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let h=this._container.querySelector(Js);h&&h.focus()}},nt.Marker=Ks,nt.Style=Qt,nt.LngLat=c.LngLat,nt.LngLatBounds=mt,nt.Point=c.Point,nt.MercatorCoordinate=c.MercatorCoordinate,nt.Evented=c.Evented,nt.AJAXError=c.AJAXError,nt.config=c.config,nt.CanvasSource=Wr,nt.GeoJSONSource=gn,nt.ImageSource=Ai,nt.RasterDEMTileSource=fn,nt.RasterTileSource=Hr,nt.VectorTileSource=Lr,nt.VideoSource=Gn,nt.setRTLTextPlugin=c.setRTLTextPlugin,nt.getRTLTextPluginStatus=c.getRTLTextPluginStatus,nt.prewarm=function(){ba().acquire(ot)},nt.clearPrewarmedResources=function(){let h=sr;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(ot),sr=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()"))},ua.extend(nt,{isSafari:c.isSafari,getPerformanceMetrics:c.PerformanceUtils.getPerformanceMetrics}),nt});var nr=Ct;return nr})});var gu=yl((Pc,kc)=>{var md=function(){var rt={},St=1e-10,Ct=Math.PI/180,Kt=180/Math.PI,nr=6378137,c=20037508342789244e-9;function Wt(Fe){return Number(Fe)===Fe&&Fe%1!==0}function te(Fe){if(Fe=Fe||{},this.size=Fe.size||256,this.expansion=Fe.antimeridian===!0?2:1,!rt[this.size]){var Pe=this.size,xe=rt[this.size]={};xe.Bc=[],xe.Cc=[],xe.zc=[],xe.Ac=[];for(var Et=0;Et<30;Et++)xe.Bc.push(Pe/360),xe.Cc.push(Pe/(2*Math.PI)),xe.zc.push(Pe/2),xe.Ac.push(Pe),Pe*=2}this.Bc=rt[this.size].Bc,this.Cc=rt[this.size].Cc,this.zc=rt[this.size].zc,this.Ac=rt[this.size].Ac}return te.prototype.px=function(Fe,Pe){if(Wt(Pe)){var xe=this.size*Math.pow(2,Pe),Et=xe/2,ii=xe/360,Yt=xe/(2*Math.PI),st=xe,Ye=Math.min(Math.max(Math.sin(Ct*Fe[1]),-.9999),.9999),At=Et+Fe[0]*ii,zt=Et+.5*Math.log((1+Ye)/(1-Ye))*-Yt;return At>st*this.expansion&&(At=st*this.expansion),zt>st&&(zt=st),[At,zt]}else{var Et=this.zc[Pe],Ye=Math.min(Math.max(Math.sin(Ct*Fe[1]),-.9999),.9999),At=Math.round(Et+Fe[0]*this.Bc[Pe]),zt=Math.round(Et+.5*Math.log((1+Ye)/(1-Ye))*-this.Cc[Pe]);return At>this.Ac[Pe]*this.expansion&&(At=this.Ac[Pe]*this.expansion),zt>this.Ac[Pe]&&(zt=this.Ac[Pe]),[At,zt]}},te.prototype.ll=function(Fe,Pe){if(Wt(Pe)){var xe=this.size*Math.pow(2,Pe),Et=xe/360,ii=xe/(2*Math.PI),Yt=xe/2,st=(Fe[1]-Yt)/-ii,Ye=(Fe[0]-Yt)/Et,At=Kt*(2*Math.atan(Math.exp(st))-.5*Math.PI);return[Ye,At]}else{var st=(Fe[1]-this.zc[Pe])/-this.Cc[Pe],Ye=(Fe[0]-this.zc[Pe])/this.Bc[Pe],At=Kt*(2*Math.atan(Math.exp(st))-.5*Math.PI);return[Ye,At]}},te.prototype.bbox=function(Fe,Pe,xe,Et,ii){Et&&(Pe=Math.pow(2,xe)-1-Pe);var Yt=[Fe*this.size,(+Pe+1)*this.size],st=[(+Fe+1)*this.size,Pe*this.size],Ye=this.ll(Yt,xe).concat(this.ll(st,xe));return ii==="900913"?this.convert(Ye,"900913"):Ye},te.prototype.xyz=function(Fe,Pe,xe,Et){Et==="900913"&&(Fe=this.convert(Fe,"WGS84"));var ii=[Fe[0],Fe[1]],Yt=[Fe[2],Fe[3]],st=this.px(ii,Pe),Ye=this.px(Yt,Pe),At=[Math.floor(st[0]/this.size),Math.floor((Ye[0]-1)/this.size)],zt=[Math.floor(Ye[1]/this.size),Math.floor((st[1]-1)/this.size)],Ii={minX:Math.min.apply(Math,At)<0?0:Math.min.apply(Math,At),minY:Math.min.apply(Math,zt)<0?0:Math.min.apply(Math,zt),maxX:Math.max.apply(Math,At),maxY:Math.max.apply(Math,zt)};if(xe){var xr={minY:Math.pow(2,Pe)-1-Ii.maxY,maxY:Math.pow(2,Pe)-1-Ii.minY};Ii.minY=xr.minY,Ii.maxY=xr.maxY}return Ii},te.prototype.convert=function(Fe,Pe){return Pe==="900913"?this.forward(Fe.slice(0,2)).concat(this.forward(Fe.slice(2,4))):this.inverse(Fe.slice(0,2)).concat(this.inverse(Fe.slice(2,4)))},te.prototype.forward=function(Fe){var Pe=[nr*Fe[0]*Ct,nr*Math.log(Math.tan(Math.PI*.25+.5*Fe[1]*Ct))];return Pe[0]>c&&(Pe[0]=c),Pe[0]<-c&&(Pe[0]=-c),Pe[1]>c&&(Pe[1]=c),Pe[1]<-c&&(Pe[1]=-c),Pe},te.prototype.inverse=function(Fe){return[Fe[0]*Kt/nr,(Math.PI*.5-2*Math.atan(Math.exp(-Fe[1]/nr)))*Kt]},te}();typeof kc<"u"&&typeof Pc<"u"&&(kc.exports=Pc=md)});var yu=yl(($d,Lc)=>{var fd=gu(),Dc={};Lc.exports.viewport=_d;Lc.exports.bounds=yd;function _u(rt,St){rt=rt||256,antiMeridian=St||!1;var Ct=rt+String(antiMeridian);return Dc[Ct]||(Dc[Ct]=new fd({size:rt,antimeridian:antiMeridian})),Dc[Ct]}function gd(rt,St,Ct){var Kt=Math.min(rt-Math.log(St[0])/Math.log(2),rt-Math.log(St[1])/Math.log(2));return Ct?Kt:Math.floor(Kt)}function _d(rt,St,Ct,Kt,nr,c,Wt){Ct=Ct===void 0?0:Ct,Kt=Kt===void 0?20:Kt;var te=_u(nr,Wt),Fe=Kt,Pe=te.px([rt[0],rt[1]],Fe),xe=te.px([rt[2],rt[3]],Fe),Et=xe[0]-Pe[0],ii=Pe[1]-xe[1],Yt=Pe[0]+Et/2,st=xe[1]+ii/2,Ye=[Et/St[0],ii/St[1]],At=gd(Fe,Ye,c),zt=te.ll([Yt,st],Fe),Ii=Math.max(Ct,Math.min(Kt,At));return{center:zt,zoom:Ii}}function yd(rt,St,Ct,Kt){rt.lon!==void 0&&(rt=[rt.lon,rt.lat]);var nr=_u(Kt),c=nr.px(rt,St),Wt=nr.ll([c[0]-Ct[0]/2,c[1]-Ct[1]/2],St),te=nr.ll([c[0]+Ct[0]/2,c[1]+Ct[1]/2],St);return[Wt[0],te[1],te[0],Wt[1]]}});var xu=yl((qd,xd)=>{xd.exports={}});window.maplibregl=fu();window.geoViewport=yu();xu();})(); + ${T} ${S} ${z} = u_${z}; +#endif +`}),staticAttributes:s,staticUniforms:f}}class ks{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,a,s,o,c,f,_,y,b){this.context=e;let T=this.boundPaintVertexBuffers.length!==o.length;for(let S=0;!T&&S({u_matrix:h,u_texture:0,u_ele_delta:e,u_fog_matrix:a,u_fog_color:s?s.properties.get("fog-color"):d.aM.white,u_fog_ground_blend:s?s.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:s?s.calculateFogBlendOpacity(o):0,u_horizon_color:s?s.properties.get("horizon-color"):d.aM.white,u_horizon_fog_blend:s?s.properties.get("horizon-fog-blend"):1});function _a(h){let e=[];for(let a=0;a({u_depth:new d.aH(ee,le.u_depth),u_terrain:new d.aH(ee,le.u_terrain),u_terrain_dim:new d.aI(ee,le.u_terrain_dim),u_terrain_matrix:new d.aJ(ee,le.u_terrain_matrix),u_terrain_unpack:new d.aK(ee,le.u_terrain_unpack),u_terrain_exaggeration:new d.aI(ee,le.u_terrain_exaggeration)}))(e,K),this.binderUniforms=s?s.getUniforms(e,K):[]}draw(e,a,s,o,c,f,_,y,b,T,S,z,D,R,V,j,U,Z){let B=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(s),e.setStencilMode(o),e.setColorMode(c),e.setCullFace(f),y){e.activeTexture.set(B.TEXTURE2),B.bindTexture(B.TEXTURE_2D,y.depthTexture),e.activeTexture.set(B.TEXTURE3),B.bindTexture(B.TEXTURE_2D,y.texture);for(let K in this.terrainUniforms)this.terrainUniforms[K].set(y[K])}for(let K in this.fixedUniforms)this.fixedUniforms[K].set(_[K]);V&&V.setUniforms(e,this.binderUniforms,D,{zoom:R});let X=0;switch(a){case B.LINES:X=2;break;case B.TRIANGLES:X=3;break;case B.LINE_STRIP:X=1}for(let K of z.get()){let ee=K.vaos||(K.vaos={});(ee[b]||(ee[b]=new ks)).bind(e,this,T,V?V.getPaintVertexBuffers():[],S,K.vertexOffset,j,U,Z),B.drawElements(a,K.primitiveLength*X,B.UNSIGNED_SHORT,K.primitiveOffset*X*2)}}}function Dn(h,e,a){let s=1/He(a,1,e.transform.tileZoom),o=Math.pow(2,a.tileID.overscaledZ),c=a.tileSize*Math.pow(2,e.transform.tileZoom)/o,f=c*(a.tileID.canonical.x+a.tileID.wrap*o),_=c*a.tileID.canonical.y;return{u_image:0,u_texsize:a.imageAtlasTexture.size,u_scale:[s,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[f>>16,_>>16],u_pixel_coord_lower:[65535&f,65535&_]}}let rn=(h,e,a,s)=>{let o=e.style.light,c=o.properties.get("position"),f=[c.x,c.y,c.z],_=function(){var b=new d.A(9);return d.A!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[5]=0,b[6]=0,b[7]=0),b[0]=1,b[4]=1,b[8]=1,b}();o.properties.get("anchor")==="viewport"&&function(b,T){var S=Math.sin(T),z=Math.cos(T);b[0]=z,b[1]=S,b[2]=0,b[3]=-S,b[4]=z,b[5]=0,b[6]=0,b[7]=0,b[8]=1}(_,-e.transform.angle),function(b,T,S){var z=T[0],D=T[1],R=T[2];b[0]=z*S[0]+D*S[3]+R*S[6],b[1]=z*S[1]+D*S[4]+R*S[7],b[2]=z*S[2]+D*S[5]+R*S[8]}(f,f,_);let y=o.properties.get("color");return{u_matrix:h,u_lightpos:f,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_vertical_gradient:+a,u_opacity:s}},Ln=(h,e,a,s,o,c,f)=>d.e(rn(h,e,a,s),Dn(c,e,f),{u_height_factor:-Math.pow(2,o.overscaledZ)/f.tileSize/8}),ya=h=>({u_matrix:h}),Lo=(h,e,a,s)=>d.e(ya(h),Dn(a,e,s)),Vl=(h,e)=>({u_matrix:h,u_world:e}),Ro=(h,e,a,s,o)=>d.e(Lo(h,e,a,s),{u_world:o}),ql=(h,e,a,s)=>{let o=h.transform,c,f;if(s.paint.get("circle-pitch-alignment")==="map"){let _=He(a,1,o.zoom);c=!0,f=[_,_]}else c=!1,f=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:h.translatePosMatrix(e.posMatrix,a,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+c,u_device_pixel_ratio:h.pixelRatio,u_extrude_scale:f}},Wr=(h,e,a)=>({u_matrix:h,u_inv_matrix:e,u_camera_to_center_distance:a.cameraToCenterDistance,u_viewport_size:[a.width,a.height]}),an=(h,e,a=1)=>({u_matrix:h,u_color:e,u_overlay:0,u_overlay_scale:a}),gi=h=>({u_matrix:h}),_i=(h,e,a,s)=>({u_matrix:h,u_extrude_scale:He(e,1,a),u_intensity:s}),Rn=(h,e,a,s)=>{let o=d.H();d.aP(o,0,h.width,h.height,0,0,1);let c=h.context.gl;return{u_matrix:o,u_world:[c.drawingBufferWidth,c.drawingBufferHeight],u_image:a,u_color_ramp:s,u_opacity:e.paint.get("heatmap-opacity")}};function Bn(h,e){let a=Math.pow(2,e.canonical.z),s=e.canonical.y;return[new d.Z(0,s/a).toLngLat().lat,new d.Z(0,(s+1)/a).toLngLat().lat]}let Fn=(h,e,a,s)=>{let o=h.transform;return{u_matrix:Oo(h,e,a,s),u_ratio:1/He(e,1,o.zoom),u_device_pixel_ratio:h.pixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Bo=(h,e,a,s,o)=>d.e(Fn(h,e,a,o),{u_image:0,u_image_height:s}),xa=(h,e,a,s,o)=>{let c=h.transform,f=Fo(e,c);return{u_matrix:Oo(h,e,a,o),u_texsize:e.imageAtlasTexture.size,u_ratio:1/He(e,1,c.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[f,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},Nl=(h,e,a,s,o,c)=>{let f=h.lineAtlas,_=Fo(e,h.transform),y=a.layout.get("line-cap")==="round",b=f.getDash(s.from,y),T=f.getDash(s.to,y),S=b.width*o.fromScale,z=T.width*o.toScale;return d.e(Fn(h,e,a,c),{u_patternscale_a:[_/S,-b.height/2],u_patternscale_b:[_/z,-T.height/2],u_sdfgamma:f.width/(256*Math.min(S,z)*h.pixelRatio)/2,u_image:0,u_tex_y_a:b.y,u_tex_y_b:T.y,u_mix:o.t})};function Fo(h,e){return 1/He(h,1,e.tileZoom)}function Oo(h,e,a,s){return h.translatePosMatrix(s?s.posMatrix:e.tileID.posMatrix,e,a.paint.get("line-translate"),a.paint.get("line-translate-anchor"))}let jl=(h,e,a,s,o)=>{return{u_matrix:h,u_tl_parent:e,u_scale_parent:a,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.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:(f=o.paint.get("raster-saturation"),f>0?1-1/(1.001-f):-f),u_contrast_factor:(c=o.paint.get("raster-contrast"),c>0?1/(1-c):1+c),u_spin_weights:Ul(o.paint.get("raster-hue-rotate"))};var c,f};function Ul(h){h*=Math.PI/180;let e=Math.sin(h),a=Math.cos(h);return[(2*a+1)/3,(-Math.sqrt(3)*e-a+1)/3,(Math.sqrt(3)*e-a+1)/3]}let Vo=(h,e,a,s,o,c,f,_,y,b,T,S,z,D)=>{let R=f.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:R.cameraToCenterDistance,u_pitch:R.pitch/360*2*Math.PI,u_rotate_symbol:+a,u_aspect_ratio:R.width/R.height,u_fade_change:f.options.fadeDuration?f.symbolFadeChange:1,u_matrix:_,u_label_plane_matrix:y,u_coord_matrix:b,u_is_text:+S,u_pitch_with_map:+s,u_is_along_line:o,u_is_variable_anchor:c,u_texsize:z,u_texture:0,u_translation:T,u_pitched_scale:D}},nn=(h,e,a,s,o,c,f,_,y,b,T,S,z,D,R)=>{let V=f.transform;return d.e(Vo(h,e,a,s,o,c,f,_,y,b,T,S,z,R),{u_gamma_scale:s?Math.cos(V._pitch)*V.cameraToCenterDistance:1,u_device_pixel_ratio:f.pixelRatio,u_is_halo:+D})},As=(h,e,a,s,o,c,f,_,y,b,T,S,z,D)=>d.e(nn(h,e,a,s,o,c,f,_,y,b,T,!0,S,!0,D),{u_texsize_icon:z,u_texture_icon:1}),On=(h,e,a)=>({u_matrix:h,u_opacity:e,u_color:a}),Ps=(h,e,a,s,o,c)=>d.e(function(f,_,y,b){let T=y.imageManager.getPattern(f.from.toString()),S=y.imageManager.getPattern(f.to.toString()),{width:z,height:D}=y.imageManager.getPixelSize(),R=Math.pow(2,b.tileID.overscaledZ),V=b.tileSize*Math.pow(2,y.transform.tileZoom)/R,j=V*(b.tileID.canonical.x+b.tileID.wrap*R),U=V*b.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:S.tl,u_pattern_br_b:S.br,u_texsize:[z,D],u_mix:_.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:S.displaySize,u_scale_a:_.fromScale,u_scale_b:_.toScale,u_tile_units_to_pixels:1/He(b,1,y.transform.tileZoom),u_pixel_coord_upper:[j>>16,U>>16],u_pixel_coord_lower:[65535&j,65535&U]}}(s,c,a,o),{u_matrix:h,u_opacity:e}),Ds={fillExtrusion:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_lightpos:new d.aN(h,e.u_lightpos),u_lightintensity:new d.aI(h,e.u_lightintensity),u_lightcolor:new d.aN(h,e.u_lightcolor),u_vertical_gradient:new d.aI(h,e.u_vertical_gradient),u_opacity:new d.aI(h,e.u_opacity)}),fillExtrusionPattern:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_lightpos:new d.aN(h,e.u_lightpos),u_lightintensity:new d.aI(h,e.u_lightintensity),u_lightcolor:new d.aN(h,e.u_lightcolor),u_vertical_gradient:new d.aI(h,e.u_vertical_gradient),u_height_factor:new d.aI(h,e.u_height_factor),u_image:new d.aH(h,e.u_image),u_texsize:new d.aO(h,e.u_texsize),u_pixel_coord_upper:new d.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new d.aO(h,e.u_pixel_coord_lower),u_scale:new d.aN(h,e.u_scale),u_fade:new d.aI(h,e.u_fade),u_opacity:new d.aI(h,e.u_opacity)}),fill:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix)}),fillPattern:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_image:new d.aH(h,e.u_image),u_texsize:new d.aO(h,e.u_texsize),u_pixel_coord_upper:new d.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new d.aO(h,e.u_pixel_coord_lower),u_scale:new d.aN(h,e.u_scale),u_fade:new d.aI(h,e.u_fade)}),fillOutline:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_world:new d.aO(h,e.u_world)}),fillOutlinePattern:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_world:new d.aO(h,e.u_world),u_image:new d.aH(h,e.u_image),u_texsize:new d.aO(h,e.u_texsize),u_pixel_coord_upper:new d.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new d.aO(h,e.u_pixel_coord_lower),u_scale:new d.aN(h,e.u_scale),u_fade:new d.aI(h,e.u_fade)}),circle:(h,e)=>({u_camera_to_center_distance:new d.aI(h,e.u_camera_to_center_distance),u_scale_with_map:new d.aH(h,e.u_scale_with_map),u_pitch_with_map:new d.aH(h,e.u_pitch_with_map),u_extrude_scale:new d.aO(h,e.u_extrude_scale),u_device_pixel_ratio:new d.aI(h,e.u_device_pixel_ratio),u_matrix:new d.aJ(h,e.u_matrix)}),collisionBox:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_pixel_extrude_scale:new d.aO(h,e.u_pixel_extrude_scale)}),collisionCircle:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_inv_matrix:new d.aJ(h,e.u_inv_matrix),u_camera_to_center_distance:new d.aI(h,e.u_camera_to_center_distance),u_viewport_size:new d.aO(h,e.u_viewport_size)}),debug:(h,e)=>({u_color:new d.aL(h,e.u_color),u_matrix:new d.aJ(h,e.u_matrix),u_overlay:new d.aH(h,e.u_overlay),u_overlay_scale:new d.aI(h,e.u_overlay_scale)}),clippingMask:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix)}),heatmap:(h,e)=>({u_extrude_scale:new d.aI(h,e.u_extrude_scale),u_intensity:new d.aI(h,e.u_intensity),u_matrix:new d.aJ(h,e.u_matrix)}),heatmapTexture:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_world:new d.aO(h,e.u_world),u_image:new d.aH(h,e.u_image),u_color_ramp:new d.aH(h,e.u_color_ramp),u_opacity:new d.aI(h,e.u_opacity)}),hillshade:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_image:new d.aH(h,e.u_image),u_latrange:new d.aO(h,e.u_latrange),u_light:new d.aO(h,e.u_light),u_shadow:new d.aL(h,e.u_shadow),u_highlight:new d.aL(h,e.u_highlight),u_accent:new d.aL(h,e.u_accent)}),hillshadePrepare:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_image:new d.aH(h,e.u_image),u_dimension:new d.aO(h,e.u_dimension),u_zoom:new d.aI(h,e.u_zoom),u_unpack:new d.aK(h,e.u_unpack)}),line:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_ratio:new d.aI(h,e.u_ratio),u_device_pixel_ratio:new d.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new d.aO(h,e.u_units_to_pixels)}),lineGradient:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_ratio:new d.aI(h,e.u_ratio),u_device_pixel_ratio:new d.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new d.aO(h,e.u_units_to_pixels),u_image:new d.aH(h,e.u_image),u_image_height:new d.aI(h,e.u_image_height)}),linePattern:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_texsize:new d.aO(h,e.u_texsize),u_ratio:new d.aI(h,e.u_ratio),u_device_pixel_ratio:new d.aI(h,e.u_device_pixel_ratio),u_image:new d.aH(h,e.u_image),u_units_to_pixels:new d.aO(h,e.u_units_to_pixels),u_scale:new d.aN(h,e.u_scale),u_fade:new d.aI(h,e.u_fade)}),lineSDF:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_ratio:new d.aI(h,e.u_ratio),u_device_pixel_ratio:new d.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new d.aO(h,e.u_units_to_pixels),u_patternscale_a:new d.aO(h,e.u_patternscale_a),u_patternscale_b:new d.aO(h,e.u_patternscale_b),u_sdfgamma:new d.aI(h,e.u_sdfgamma),u_image:new d.aH(h,e.u_image),u_tex_y_a:new d.aI(h,e.u_tex_y_a),u_tex_y_b:new d.aI(h,e.u_tex_y_b),u_mix:new d.aI(h,e.u_mix)}),raster:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_tl_parent:new d.aO(h,e.u_tl_parent),u_scale_parent:new d.aI(h,e.u_scale_parent),u_buffer_scale:new d.aI(h,e.u_buffer_scale),u_fade_t:new d.aI(h,e.u_fade_t),u_opacity:new d.aI(h,e.u_opacity),u_image0:new d.aH(h,e.u_image0),u_image1:new d.aH(h,e.u_image1),u_brightness_low:new d.aI(h,e.u_brightness_low),u_brightness_high:new d.aI(h,e.u_brightness_high),u_saturation_factor:new d.aI(h,e.u_saturation_factor),u_contrast_factor:new d.aI(h,e.u_contrast_factor),u_spin_weights:new d.aN(h,e.u_spin_weights)}),symbolIcon:(h,e)=>({u_is_size_zoom_constant:new d.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new d.aH(h,e.u_is_size_feature_constant),u_size_t:new d.aI(h,e.u_size_t),u_size:new d.aI(h,e.u_size),u_camera_to_center_distance:new d.aI(h,e.u_camera_to_center_distance),u_pitch:new d.aI(h,e.u_pitch),u_rotate_symbol:new d.aH(h,e.u_rotate_symbol),u_aspect_ratio:new d.aI(h,e.u_aspect_ratio),u_fade_change:new d.aI(h,e.u_fade_change),u_matrix:new d.aJ(h,e.u_matrix),u_label_plane_matrix:new d.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new d.aJ(h,e.u_coord_matrix),u_is_text:new d.aH(h,e.u_is_text),u_pitch_with_map:new d.aH(h,e.u_pitch_with_map),u_is_along_line:new d.aH(h,e.u_is_along_line),u_is_variable_anchor:new d.aH(h,e.u_is_variable_anchor),u_texsize:new d.aO(h,e.u_texsize),u_texture:new d.aH(h,e.u_texture),u_translation:new d.aO(h,e.u_translation),u_pitched_scale:new d.aI(h,e.u_pitched_scale)}),symbolSDF:(h,e)=>({u_is_size_zoom_constant:new d.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new d.aH(h,e.u_is_size_feature_constant),u_size_t:new d.aI(h,e.u_size_t),u_size:new d.aI(h,e.u_size),u_camera_to_center_distance:new d.aI(h,e.u_camera_to_center_distance),u_pitch:new d.aI(h,e.u_pitch),u_rotate_symbol:new d.aH(h,e.u_rotate_symbol),u_aspect_ratio:new d.aI(h,e.u_aspect_ratio),u_fade_change:new d.aI(h,e.u_fade_change),u_matrix:new d.aJ(h,e.u_matrix),u_label_plane_matrix:new d.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new d.aJ(h,e.u_coord_matrix),u_is_text:new d.aH(h,e.u_is_text),u_pitch_with_map:new d.aH(h,e.u_pitch_with_map),u_is_along_line:new d.aH(h,e.u_is_along_line),u_is_variable_anchor:new d.aH(h,e.u_is_variable_anchor),u_texsize:new d.aO(h,e.u_texsize),u_texture:new d.aH(h,e.u_texture),u_gamma_scale:new d.aI(h,e.u_gamma_scale),u_device_pixel_ratio:new d.aI(h,e.u_device_pixel_ratio),u_is_halo:new d.aH(h,e.u_is_halo),u_translation:new d.aO(h,e.u_translation),u_pitched_scale:new d.aI(h,e.u_pitched_scale)}),symbolTextAndIcon:(h,e)=>({u_is_size_zoom_constant:new d.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new d.aH(h,e.u_is_size_feature_constant),u_size_t:new d.aI(h,e.u_size_t),u_size:new d.aI(h,e.u_size),u_camera_to_center_distance:new d.aI(h,e.u_camera_to_center_distance),u_pitch:new d.aI(h,e.u_pitch),u_rotate_symbol:new d.aH(h,e.u_rotate_symbol),u_aspect_ratio:new d.aI(h,e.u_aspect_ratio),u_fade_change:new d.aI(h,e.u_fade_change),u_matrix:new d.aJ(h,e.u_matrix),u_label_plane_matrix:new d.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new d.aJ(h,e.u_coord_matrix),u_is_text:new d.aH(h,e.u_is_text),u_pitch_with_map:new d.aH(h,e.u_pitch_with_map),u_is_along_line:new d.aH(h,e.u_is_along_line),u_is_variable_anchor:new d.aH(h,e.u_is_variable_anchor),u_texsize:new d.aO(h,e.u_texsize),u_texsize_icon:new d.aO(h,e.u_texsize_icon),u_texture:new d.aH(h,e.u_texture),u_texture_icon:new d.aH(h,e.u_texture_icon),u_gamma_scale:new d.aI(h,e.u_gamma_scale),u_device_pixel_ratio:new d.aI(h,e.u_device_pixel_ratio),u_is_halo:new d.aH(h,e.u_is_halo),u_translation:new d.aO(h,e.u_translation),u_pitched_scale:new d.aI(h,e.u_pitched_scale)}),background:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_opacity:new d.aI(h,e.u_opacity),u_color:new d.aL(h,e.u_color)}),backgroundPattern:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_opacity:new d.aI(h,e.u_opacity),u_image:new d.aH(h,e.u_image),u_pattern_tl_a:new d.aO(h,e.u_pattern_tl_a),u_pattern_br_a:new d.aO(h,e.u_pattern_br_a),u_pattern_tl_b:new d.aO(h,e.u_pattern_tl_b),u_pattern_br_b:new d.aO(h,e.u_pattern_br_b),u_texsize:new d.aO(h,e.u_texsize),u_mix:new d.aI(h,e.u_mix),u_pattern_size_a:new d.aO(h,e.u_pattern_size_a),u_pattern_size_b:new d.aO(h,e.u_pattern_size_b),u_scale_a:new d.aI(h,e.u_scale_a),u_scale_b:new d.aI(h,e.u_scale_b),u_pixel_coord_upper:new d.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new d.aO(h,e.u_pixel_coord_lower),u_tile_units_to_pixels:new d.aI(h,e.u_tile_units_to_pixels)}),terrain:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_texture:new d.aH(h,e.u_texture),u_ele_delta:new d.aI(h,e.u_ele_delta),u_fog_matrix:new d.aJ(h,e.u_fog_matrix),u_fog_color:new d.aL(h,e.u_fog_color),u_fog_ground_blend:new d.aI(h,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new d.aI(h,e.u_fog_ground_blend_opacity),u_horizon_color:new d.aL(h,e.u_horizon_color),u_horizon_fog_blend:new d.aI(h,e.u_horizon_fog_blend)}),terrainDepth:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_ele_delta:new d.aI(h,e.u_ele_delta)}),terrainCoords:(h,e)=>({u_matrix:new d.aJ(h,e.u_matrix),u_texture:new d.aH(h,e.u_texture),u_terrain_coords_id:new d.aI(h,e.u_terrain_coords_id),u_ele_delta:new d.aI(h,e.u_ele_delta)}),sky:(h,e)=>({u_sky_color:new d.aL(h,e.u_sky_color),u_horizon_color:new d.aL(h,e.u_horizon_color),u_horizon:new d.aI(h,e.u_horizon),u_sky_horizon_blend:new d.aI(h,e.u_sky_horizon_blend)})};class dr{constructor(e,a,s){this.context=e;let o=e.gl;this.buffer=o.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let 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,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let $l={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ls{constructor(e,a,s,o){this.length=a.length,this.attributes=s,this.itemSize=a.bytesPerElement,this.dynamicDraw=o,this.context=e;let c=e.gl;this.buffer=c.createBuffer(),e.bindVertexBuffer.set(this.buffer),c.bufferData(c.ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,a){for(let s=0;s0){let ee=d.H();d.aQ(ee,B.placementInvProjMatrix,h.transform.glCoordMatrix),d.aQ(ee,ee,B.placementViewportMatrix),y.push({circleArray:K,circleOffset:T,transform:Z.posMatrix,invTransform:ee,coord:Z}),b+=K.length/4,T=b}X&&_.draw(c,f.LINES,Ge.disabled,mt.disabled,h.colorModeForRenderPass(),lt.disabled,{u_matrix:Z.posMatrix,u_pixel_extrude_scale:[1/(S=h.transform).width,1/S.height]},h.style.map.terrain&&h.style.map.terrain.getTerrainData(Z),a.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,null,h.transform.zoom,null,null,X.collisionVertexBuffer)}var S;if(!o||!y.length)return;let z=h.useProgram("collisionCircle"),D=new d.aR;D.resize(4*b),D._trim();let R=0;for(let U of y)for(let Z=0;Z=0&&(U[B.associatedIconIndex]={shiftedAnchor:Oe,angle:yt})}else Le(B.numGlyphs,V)}if(b){j.clear();let Z=h.icon.placedSymbolArray;for(let B=0;Bh.style.map.terrain.getElevation(fe,Va,qa):null,na=a.layout.get("text-rotation-alignment")==="map";L(ke,fe.posMatrix,h,o,Fa,Oa,U,b,na,V,fe.toUnwrapped(),R.width,R.height,Vi,Ke)}let qi=fe.posMatrix,Ni=o&&ue||fo,Fr=Z||Ni?ln:Fa,Qi=ls,Xt=be&&a.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ei;ei=be?ke.iconsInText?As(Oe.kind,Xe,B,U,Z,Ni,h,qi,Fr,Qi,Vi,Yt,ci,Te):nn(Oe.kind,Xe,B,U,Z,Ni,h,qi,Fr,Qi,Vi,o,Yt,!0,Te):Vo(Oe.kind,Xe,B,U,Z,Ni,h,qi,Fr,Qi,Vi,o,Yt,Te);let Ei={program:Ue,buffers:qe,uniformValues:ei,atlasTexture:Yi,atlasTextureIcon:Qt,atlasInterpolation:vt,atlasInterpolationIcon:yi,isSDF:be,hasHalo:Xt};if(K&&ke.canOverlap){ee=!0;let Ke=qe.segments.get();for(let na of Ke)xe.push({segments:new d.a0([na]),sortKey:na.sortKey,state:Ei,terrainData:xt})}else xe.push({segments:qe.segments,sortKey:0,state:Ei,terrainData:xt})}ee&&xe.sort((fe,me)=>fe.sortKey-me.sortKey);for(let fe of xe){let me=fe.state;if(z.activeTexture.set(D.TEXTURE0),me.atlasTexture.bind(me.atlasInterpolation,D.CLAMP_TO_EDGE),me.atlasTextureIcon&&(z.activeTexture.set(D.TEXTURE1),me.atlasTextureIcon&&me.atlasTextureIcon.bind(me.atlasInterpolationIcon,D.CLAMP_TO_EDGE)),me.isSDF){let ke=me.uniformValues;me.hasHalo&&(ke.u_is_halo=1,$s(me.buffers,fe.segments,a,h,me.program,le,T,S,ke,fe.terrainData)),ke.u_is_halo=0}$s(me.buffers,fe.segments,a,h,me.program,le,T,S,me.uniformValues,fe.terrainData)}}function $s(h,e,a,s,o,c,f,_,y,b){let T=s.context;o.draw(T,T.gl.TRIANGLES,c,f,_,lt.disabled,y,b,a.id,h.layoutVertexBuffer,h.indexBuffer,e,a.paint,s.transform.zoom,h.programConfigurations.get(a.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function Zs(h,e,a,s){let o=h.context,c=o.gl,f=mt.disabled,_=new At([c.ONE,c.ONE],d.aM.transparent,[!0,!0,!0,!0]),y=e.getBucket(a);if(!y)return;let b=s.key,T=a.heatmapFbos.get(b);T||(T=cn(o,e.tileSize,e.tileSize),a.heatmapFbos.set(b,T)),o.bindFramebuffer.set(T.framebuffer),o.viewport.set([0,0,e.tileSize,e.tileSize]),o.clear({color:d.aM.transparent});let S=y.programConfigurations.get(a.id),z=h.useProgram("heatmap",S),D=h.style.map.terrain.getTerrainData(s);z.draw(o,c.TRIANGLES,Ge.disabled,f,_,lt.disabled,_i(s.posMatrix,e,h.transform.zoom,a.paint.get("heatmap-intensity")),D,a.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,a.paint,h.transform.zoom,S)}function ta(h,e,a){let s=h.context,o=s.gl;s.setColorMode(h.colorModeForRenderPass());let c=hn(s,e),f=a.key,_=e.heatmapFbos.get(f);_&&(s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,_.colorAttachment.get()),s.activeTexture.set(o.TEXTURE1),c.bind(o.LINEAR,o.CLAMP_TO_EDGE),h.useProgram("heatmapTexture").draw(s,o.TRIANGLES,Ge.disabled,mt.disabled,h.colorModeForRenderPass(),lt.disabled,Rn(h,e,0,1),null,e.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments,e.paint,h.transform.zoom),_.destroy(),e.heatmapFbos.delete(f))}function cn(h,e,a){var s,o;let c=h.gl,f=c.createTexture();c.bindTexture(c.TEXTURE_2D,f),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);let _=(s=h.HALF_FLOAT)!==null&&s!==void 0?s:c.UNSIGNED_BYTE,y=(o=h.RGBA16F)!==null&&o!==void 0?o:c.RGBA;c.texImage2D(c.TEXTURE_2D,0,y,e,a,0,c.RGBA,_,null);let b=h.createFramebuffer(e,a,!1,!1);return b.colorAttachment.set(f),b}function hn(h,e){return e.colorRampTexture||(e.colorRampTexture=new ot(h,e.colorRamp,h.gl.RGBA)),e.colorRampTexture}function wa(h,e,a,s,o){if(!a||!s||!s.imageAtlas)return;let c=s.imageAtlas.patternPositions,f=c[a.to.toString()],_=c[a.from.toString()];if(!f&&_&&(f=_),!_&&f&&(_=f),!f||!_){let y=o.getPaintProperty(e);f=c[y],_=c[y]}f&&_&&h.setConstantPatternPositions(f,_)}function un(h,e,a,s,o,c,f){let _=h.context.gl,y="fill-pattern",b=a.paint.get(y),T=b&&b.constantOr(1),S=a.getCrossfadeParameters(),z,D,R,V,j;f?(D=T&&!a.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",z=_.LINES):(D=T?"fillPattern":"fill",z=_.TRIANGLES);let U=b.constantOr(null);for(let Z of s){let B=e.getTile(Z);if(T&&!B.patternsLoaded())continue;let X=B.getBucket(a);if(!X)continue;let K=X.programConfigurations.get(a.id),ee=h.useProgram(D,K),le=h.style.map.terrain&&h.style.map.terrain.getTerrainData(Z);T&&(h.context.activeTexture.set(_.TEXTURE0),B.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),K.updatePaintBuffers(S)),wa(K,y,U,B,a);let ue=le?Z:null,xe=h.translatePosMatrix(ue?ue.posMatrix:Z.posMatrix,B,a.paint.get("fill-translate"),a.paint.get("fill-translate-anchor"));if(f){V=X.indexBuffer2,j=X.segments2;let Te=[_.drawingBufferWidth,_.drawingBufferHeight];R=D==="fillOutlinePattern"&&T?Ro(xe,h,S,B,Te):Vl(xe,Te)}else V=X.indexBuffer,j=X.segments,R=T?Lo(xe,h,S,B):ya(xe);ee.draw(h.context,z,o,h.stencilModeForClipping(Z),c,lt.disabled,R,le,a.id,X.layoutVertexBuffer,V,j,a.paint,h.transform.zoom,K)}}function $n(h,e,a,s,o,c,f){let _=h.context,y=_.gl,b="fill-extrusion-pattern",T=a.paint.get(b),S=T.constantOr(1),z=a.getCrossfadeParameters(),D=a.paint.get("fill-extrusion-opacity"),R=T.constantOr(null);for(let V of s){let j=e.getTile(V),U=j.getBucket(a);if(!U)continue;let Z=h.style.map.terrain&&h.style.map.terrain.getTerrainData(V),B=U.programConfigurations.get(a.id),X=h.useProgram(S?"fillExtrusionPattern":"fillExtrusion",B);S&&(h.context.activeTexture.set(y.TEXTURE0),j.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),B.updatePaintBuffers(z)),wa(B,b,R,j,a);let K=h.translatePosMatrix(V.posMatrix,j,a.paint.get("fill-extrusion-translate"),a.paint.get("fill-extrusion-translate-anchor")),ee=a.paint.get("fill-extrusion-vertical-gradient"),le=S?Ln(K,h,ee,D,V,z,j):rn(K,h,ee,D);X.draw(_,_.gl.TRIANGLES,o,c,f,lt.backCCW,le,Z,a.id,U.layoutVertexBuffer,U.indexBuffer,U.segments,a.paint,h.transform.zoom,B,h.style.map.terrain&&U.centroidVertexBuffer)}}function Ta(h,e,a,s,o,c,f){let _=h.context,y=_.gl,b=a.fbo;if(!b)return;let T=h.useProgram("hillshade"),S=h.style.map.terrain&&h.style.map.terrain.getTerrainData(e);_.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,b.colorAttachment.get()),T.draw(_,y.TRIANGLES,o,c,f,lt.disabled,((z,D,R,V)=>{let j=R.paint.get("hillshade-shadow-color"),U=R.paint.get("hillshade-highlight-color"),Z=R.paint.get("hillshade-accent-color"),B=R.paint.get("hillshade-illumination-direction")*(Math.PI/180);R.paint.get("hillshade-illumination-anchor")==="viewport"&&(B-=z.transform.angle);let X=!z.options.moving;return{u_matrix:V?V.posMatrix:z.transform.calculatePosMatrix(D.tileID.toUnwrapped(),X),u_image:0,u_latrange:Bn(0,D.tileID),u_light:[R.paint.get("hillshade-exaggeration"),B],u_shadow:j,u_highlight:U,u_accent:Z}})(h,a,s,S?e:null),S,s.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}function Sa(h,e,a,s,o,c){let f=h.context,_=f.gl,y=e.dem;if(y&&y.data){let b=y.dim,T=y.stride,S=y.getPixels();if(f.activeTexture.set(_.TEXTURE1),f.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||h.getTileTexture(T),e.demTexture){let D=e.demTexture;D.update(S,{premultiply:!1}),D.bind(_.NEAREST,_.CLAMP_TO_EDGE)}else e.demTexture=new ot(f,S,_.RGBA,{premultiply:!1}),e.demTexture.bind(_.NEAREST,_.CLAMP_TO_EDGE);f.activeTexture.set(_.TEXTURE0);let z=e.fbo;if(!z){let D=new ot(f,{width:b,height:b,data:null},_.RGBA);D.bind(_.LINEAR,_.CLAMP_TO_EDGE),z=e.fbo=f.createFramebuffer(b,b,!0,!1),z.colorAttachment.set(D.texture)}f.bindFramebuffer.set(z.framebuffer),f.viewport.set([0,0,b,b]),h.useProgram("hillshadePrepare").draw(f,_.TRIANGLES,s,o,c,lt.disabled,((D,R)=>{let V=R.stride,j=d.H();return d.aP(j,0,d.X,-d.X,0,0,1),d.J(j,j,[0,-d.X,0]),{u_matrix:j,u_image:1,u_dimension:[V,V],u_zoom:D.overscaledZ,u_unpack:R.getUnpackVector()}})(e.tileID,y),null,a.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function Yo(h,e,a,s,o,c){let f=s.paint.get("raster-fade-duration");if(!c&&f>0){let _=se.now(),y=(_-h.timeAdded)/f,b=e?(_-e.timeAdded)/f:-1,T=a.getSource(),S=o.coveringZoomLevel({tileSize:T.tileSize,roundZoom:T.roundZoom}),z=!e||Math.abs(e.tileID.overscaledZ-S)>Math.abs(h.tileID.overscaledZ-S),D=z&&h.refreshedUponExpiration?1:d.ac(z?y:1-b,0,1);return h.refreshedUponExpiration&&y>=1&&(h.refreshedUponExpiration=!1),e?{opacity:1,mix:1-D}:{opacity:D,mix:0}}return{opacity:1,mix:0}}let Gs=new d.aM(1,0,0,1),et=new d.aM(0,1,0,1),Zn=new d.aM(0,0,1,1),ec=new d.aM(1,0,1,1),Qo=new d.aM(0,1,1,1);function Ia(h,e,a,s){Gn(h,0,e+a/2,h.transform.width,a,s)}function el(h,e,a,s){Gn(h,e-a/2,0,a,h.transform.height,s)}function Gn(h,e,a,s,o,c){let f=h.context,_=f.gl;_.enable(_.SCISSOR_TEST),_.scissor(e*h.pixelRatio,a*h.pixelRatio,s*h.pixelRatio,o*h.pixelRatio),f.clear({color:c}),_.disable(_.SCISSOR_TEST)}function tl(h,e,a){let s=h.context,o=s.gl,c=a.posMatrix,f=h.useProgram("debug"),_=Ge.disabled,y=mt.disabled,b=h.colorModeForRenderPass(),T="$debug",S=h.style.map.terrain&&h.style.map.terrain.getTerrainData(a);s.activeTexture.set(o.TEXTURE0);let z=e.getTileByID(a.key).latestRawTileData,D=Math.floor((z&&z.byteLength||0)/1024),R=e.getTile(a).tileSize,V=512/Math.min(R,512)*(a.overscaledZ/h.transform.zoom)*.5,j=a.canonical.toString();a.overscaledZ!==a.canonical.z&&(j+=` => ${a.overscaledZ}`),function(U,Z){U.initDebugOverlayCanvas();let B=U.debugOverlayCanvas,X=U.context.gl,K=U.debugOverlayCanvas.getContext("2d");K.clearRect(0,0,B.width,B.height),K.shadowColor="white",K.shadowBlur=2,K.lineWidth=1.5,K.strokeStyle="white",K.textBaseline="top",K.font="bold 36px Open Sans, sans-serif",K.fillText(Z,5,5),K.strokeText(Z,5,5),U.debugOverlayTexture.update(B),U.debugOverlayTexture.bind(X.LINEAR,X.CLAMP_TO_EDGE)}(h,`${j} ${D}kB`),f.draw(s,o.TRIANGLES,_,y,At.alphaBlended,lt.disabled,an(c,d.aM.transparent,V),null,T,h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments),f.draw(s,o.LINE_STRIP,_,y,b,lt.disabled,an(c,d.aM.red),S,T,h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments)}function il(h,e,a){let s=h.context,o=s.gl,c=h.colorModeForRenderPass(),f=new Ge(o.LEQUAL,Ge.ReadWrite,h.depthRangeFor3D),_=h.useProgram("terrain"),y=e.getTerrainMesh();s.bindFramebuffer.set(null),s.viewport.set([0,0,h.width,h.height]);for(let b of a){let T=h.renderToTexture.getTexture(b),S=e.getTerrainData(b.tileID);s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,T.texture);let z=h.transform.calculatePosMatrix(b.tileID.toUnwrapped()),D=e.getMeshFrameDelta(h.transform.zoom),R=h.transform.calculateFogMatrix(b.tileID.toUnwrapped()),V=zs(z,D,R,h.style.sky,h.transform.pitch);_.draw(s,o.TRIANGLES,f,mt.disabled,c,lt.backCCW,V,S,"terrain",y.vertexBuffer,y.indexBuffer,y.segments)}}class Hn{constructor(e,a,s){this.vertexBuffer=e,this.indexBuffer=a,this.segments=s}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Xn{constructor(e,a){this.context=new Ql(e),this.transform=a,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:d.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Fe.maxUnderzooming+Fe.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ms}resize(e,a,s){if(this.width=Math.floor(e*s),this.height=Math.floor(a*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let o of this.style._order)this.style._layers[o].resize()}setup(){let e=this.context,a=new d.aX;a.emplaceBack(0,0),a.emplaceBack(d.X,0),a.emplaceBack(0,d.X),a.emplaceBack(d.X,d.X),this.tileExtentBuffer=e.createVertexBuffer(a,Xr.members),this.tileExtentSegments=d.a0.simpleSegment(0,0,4,2);let s=new d.aX;s.emplaceBack(0,0),s.emplaceBack(d.X,0),s.emplaceBack(0,d.X),s.emplaceBack(d.X,d.X),this.debugBuffer=e.createVertexBuffer(s,Xr.members),this.debugSegments=d.a0.simpleSegment(0,0,4,5);let o=new d.$;o.emplaceBack(0,0,0,0),o.emplaceBack(d.X,0,d.X,0),o.emplaceBack(0,d.X,0,d.X),o.emplaceBack(d.X,d.X,d.X,d.X),this.rasterBoundsBuffer=e.createVertexBuffer(o,Pr.members),this.rasterBoundsSegments=d.a0.simpleSegment(0,0,4,2);let c=new d.aX;c.emplaceBack(0,0),c.emplaceBack(1,0),c.emplaceBack(0,1),c.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(c,Xr.members),this.viewportSegments=d.a0.simpleSegment(0,0,4,2);let f=new d.aZ;f.emplaceBack(0),f.emplaceBack(1),f.emplaceBack(3),f.emplaceBack(2),f.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(f);let _=new d.aY;_.emplaceBack(0,1,2),_.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(_);let y=this.context.gl;this.stencilClearMode=new mt({func:y.ALWAYS,mask:0},0,255,y.ZERO,y.ZERO,y.ZERO)}clearStencil(){let e=this.context,a=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let s=d.H();d.aP(s,0,this.width,this.height,0,0,1),d.K(s,s,[a.drawingBufferWidth,a.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,a.TRIANGLES,Ge.disabled,this.stencilClearMode,At.disabled,lt.disabled,gi(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,a){if(this.currentStencilSource===e.source||!e.isTileClipped()||!a||!a.length)return;this.currentStencilSource=e.source;let s=this.context,o=s.gl;this.nextStencilID+a.length>256&&this.clearStencil(),s.setColorMode(At.disabled),s.setDepthMode(Ge.disabled);let c=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let f of a){let _=this._tileClippingMaskIDs[f.key]=this.nextStencilID++,y=this.style.map.terrain&&this.style.map.terrain.getTerrainData(f);c.draw(s,o.TRIANGLES,Ge.disabled,new mt({func:o.ALWAYS,mask:0},_,255,o.KEEP,o.KEEP,o.REPLACE),At.disabled,lt.disabled,gi(f.posMatrix),y,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,a=this.context.gl;return new mt({func:a.NOTEQUAL,mask:255},e,255,a.KEEP,a.KEEP,a.REPLACE)}stencilModeForClipping(e){let a=this.context.gl;return new mt({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,a.KEEP,a.KEEP,a.REPLACE)}stencilConfigForOverlap(e){let a=this.context.gl,s=e.sort((f,_)=>_.overscaledZ-f.overscaledZ),o=s[s.length-1].overscaledZ,c=s[0].overscaledZ-o+1;if(c>1){this.currentStencilSource=void 0,this.nextStencilID+c>256&&this.clearStencil();let f={};for(let _=0;_({u_sky_color:U.properties.get("sky-color"),u_horizon_color:U.properties.get("horizon-color"),u_horizon:(Z.height/2+Z.getHorizon())*B,u_sky_horizon_blend:U.properties.get("sky-horizon-blend")*Z.height/2*B}))(b,y.style.map.transform,y.pixelRatio),D=new Ge(S.LEQUAL,Ge.ReadWrite,[0,1]),R=mt.disabled,V=y.colorModeForRenderPass(),j=y.useProgram("sky");if(!b.mesh){let U=new d.aX;U.emplaceBack(-1,-1),U.emplaceBack(1,-1),U.emplaceBack(1,1),U.emplaceBack(-1,1);let Z=new d.aY;Z.emplaceBack(0,1,2),Z.emplaceBack(0,2,3),b.mesh=new Hn(T.createVertexBuffer(U,Xr.members),T.createIndexBuffer(Z),d.a0.simpleSegment(0,0,U.length,Z.length))}j.draw(T,S.TRIANGLES,D,R,V,lt.disabled,z,void 0,"sky",b.mesh.vertexBuffer,b.mesh.indexBuffer,b.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){let y=this.style._layers[s[this.currentLayer]],b=o[y.source],T=c[y.source];this._renderTileClippingMasks(y,T),this.renderLayer(this,b,y,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerj.source&&!j.isHidden(T)?[b.sourceCaches[j.source]]:[]),D=z.filter(j=>j.getSource().type==="vector"),R=z.filter(j=>j.getSource().type!=="vector"),V=j=>{(!S||S.getSource().maxzoomV(j)),S||R.forEach(j=>V(j)),S}(this.style,this.transform.zoom);y&&function(b,T,S){for(let z=0;z0),o&&(d.b0(a,s),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(c,f){let _=c.context,y=_.gl,b=At.unblended,T=new Ge(y.LEQUAL,Ge.ReadWrite,[0,1]),S=f.getTerrainMesh(),z=f.sourceCache.getRenderableTiles(),D=c.useProgram("terrainDepth");_.bindFramebuffer.set(f.getFramebuffer("depth").framebuffer),_.viewport.set([0,0,c.width/devicePixelRatio,c.height/devicePixelRatio]),_.clear({color:d.aM.transparent,depth:1});for(let R of z){let V=f.getTerrainData(R.tileID),j={u_matrix:c.transform.calculatePosMatrix(R.tileID.toUnwrapped()),u_ele_delta:f.getMeshFrameDelta(c.transform.zoom)};D.draw(_,y.TRIANGLES,T,mt.disabled,b,lt.backCCW,j,V,"terrain",S.vertexBuffer,S.indexBuffer,S.segments)}_.bindFramebuffer.set(null),_.viewport.set([0,0,c.width,c.height])}(this,this.style.map.terrain),function(c,f){let _=c.context,y=_.gl,b=At.unblended,T=new Ge(y.LEQUAL,Ge.ReadWrite,[0,1]),S=f.getTerrainMesh(),z=f.getCoordsTexture(),D=f.sourceCache.getRenderableTiles(),R=c.useProgram("terrainCoords");_.bindFramebuffer.set(f.getFramebuffer("coords").framebuffer),_.viewport.set([0,0,c.width/devicePixelRatio,c.height/devicePixelRatio]),_.clear({color:d.aM.transparent,depth:1}),f.coordsIndex=[];for(let V of D){let j=f.getTerrainData(V.tileID);_.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,z.texture);let U={u_matrix:c.transform.calculatePosMatrix(V.tileID.toUnwrapped()),u_terrain_coords_id:(255-f.coordsIndex.length)/255,u_texture:0,u_ele_delta:f.getMeshFrameDelta(c.transform.zoom)};R.draw(_,y.TRIANGLES,T,mt.disabled,b,lt.backCCW,U,j,"terrain",S.vertexBuffer,S.indexBuffer,S.segments),f.coordsIndex.push(V.tileID.key)}_.bindFramebuffer.set(null),_.viewport.set([0,0,c.width,c.height])}(this,this.style.map.terrain))}renderLayer(e,a,s,o){if(!s.isHidden(this.transform.zoom)&&(s.type==="background"||s.type==="custom"||(o||[]).length))switch(this.id=s.id,s.type){case"symbol":(function(c,f,_,y,b){if(c.renderPass!=="translucent")return;let T=mt.disabled,S=c.colorModeForRenderPass();(_._unevaluatedLayout.hasValue("text-variable-anchor")||_._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(z,D,R,V,j,U,Z,B,X){let K=D.transform,ee=Hr(),le=j==="map",ue=U==="map";for(let xe of z){let Te=V.getTile(xe),fe=Te.getBucket(R);if(!fe||!fe.text||!fe.text.segments.get().length)continue;let me=d.ag(fe.textSizeData,K.zoom),ke=He(Te,1,D.transform.zoom),qe=Lr(xe.posMatrix,ue,le,D.transform,ke),_e=R.layout.get("icon-text-fit")!=="none"&&fe.hasIconData();if(me){let be=Math.pow(2,K.zoom-Te.tileID.overscaledZ),Oe=D.style.map.terrain?(Ue,Xe)=>D.style.map.terrain.getElevation(xe,Ue,Xe):null,yt=ee.translatePosition(K,Te,Z,B);ba(fe,le,ue,X,K,qe,xe.posMatrix,be,me,_e,ee,yt,xe.toUnwrapped(),Oe)}}}(y,c,_,f,_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),b),_.paint.get("icon-opacity").constantOr(1)!==0&&Us(c,f,_,y,!1,_.paint.get("icon-translate"),_.paint.get("icon-translate-anchor"),_.layout.get("icon-rotation-alignment"),_.layout.get("icon-pitch-alignment"),_.layout.get("icon-keep-upright"),T,S),_.paint.get("text-opacity").constantOr(1)!==0&&Us(c,f,_,y,!0,_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),_.layout.get("text-keep-upright"),T,S),f.map.showCollisionBoxes&&(on(c,f,_,y,!0),on(c,f,_,y,!1))})(e,a,s,o,this.style.placement.variableOffsets);break;case"circle":(function(c,f,_,y){if(c.renderPass!=="translucent")return;let b=_.paint.get("circle-opacity"),T=_.paint.get("circle-stroke-width"),S=_.paint.get("circle-stroke-opacity"),z=!_.layout.get("circle-sort-key").isConstant();if(b.constantOr(1)===0&&(T.constantOr(1)===0||S.constantOr(1)===0))return;let D=c.context,R=D.gl,V=c.depthModeForSublayer(0,Ge.ReadOnly),j=mt.disabled,U=c.colorModeForRenderPass(),Z=[];for(let B=0;BB.sortKey-X.sortKey);for(let B of Z){let{programConfiguration:X,program:K,layoutVertexBuffer:ee,indexBuffer:le,uniformValues:ue,terrainData:xe}=B.state;K.draw(D,R.TRIANGLES,V,j,U,lt.disabled,ue,xe,_.id,ee,le,B.segments,_.paint,c.transform.zoom,X)}})(e,a,s,o);break;case"heatmap":(function(c,f,_,y){if(_.paint.get("heatmap-opacity")===0)return;let b=c.context;if(c.style.map.terrain){for(let T of y){let S=f.getTile(T);f.hasRenderableParent(T)||(c.renderPass==="offscreen"?Zs(c,S,_,T):c.renderPass==="translucent"&&ta(c,_,T))}b.viewport.set([0,0,c.width,c.height])}else c.renderPass==="offscreen"?function(T,S,z,D){let R=T.context,V=R.gl,j=mt.disabled,U=new At([V.ONE,V.ONE],d.aM.transparent,[!0,!0,!0,!0]);(function(Z,B,X){let K=Z.gl;Z.activeTexture.set(K.TEXTURE1),Z.viewport.set([0,0,B.width/4,B.height/4]);let ee=X.heatmapFbos.get(d.aU);ee?(K.bindTexture(K.TEXTURE_2D,ee.colorAttachment.get()),Z.bindFramebuffer.set(ee.framebuffer)):(ee=cn(Z,B.width/4,B.height/4),X.heatmapFbos.set(d.aU,ee))})(R,T,z),R.clear({color:d.aM.transparent});for(let Z=0;Z20&&T.texParameterf(T.TEXTURE_2D,b.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,b.extTextureFilterAnisotropicMax);let fe=c.style.map.terrain&&c.style.map.terrain.getTerrainData(Z),me=fe?Z:null,ke=me?me.posMatrix:c.transform.calculatePosMatrix(Z.toUnwrapped(),U),qe=jl(ke,xe||[0,0],ue||1,le,_);S instanceof wr?z.draw(b,T.TRIANGLES,B,mt.disabled,D,lt.disabled,qe,fe,_.id,S.boundsBuffer,c.quadTriangleIndexBuffer,S.boundsSegments):z.draw(b,T.TRIANGLES,B,R[Z.overscaledZ],D,lt.disabled,qe,fe,_.id,c.rasterBoundsBuffer,c.quadTriangleIndexBuffer,c.rasterBoundsSegments)}})(e,a,s,o);break;case"background":(function(c,f,_,y){let b=_.paint.get("background-color"),T=_.paint.get("background-opacity");if(T===0)return;let S=c.context,z=S.gl,D=c.transform,R=D.tileSize,V=_.paint.get("background-pattern");if(c.isPatternMissing(V))return;let j=!V&&b.a===1&&T===1&&c.opaquePassEnabledForLayer()?"opaque":"translucent";if(c.renderPass!==j)return;let U=mt.disabled,Z=c.depthModeForSublayer(0,j==="opaque"?Ge.ReadWrite:Ge.ReadOnly),B=c.colorModeForRenderPass(),X=c.useProgram(V?"backgroundPattern":"background"),K=y||D.coveringTiles({tileSize:R,terrain:c.style.map.terrain});V&&(S.activeTexture.set(z.TEXTURE0),c.imageManager.bind(c.context));let ee=_.getCrossfadeParameters();for(let le of K){let ue=y?le.posMatrix:c.transform.calculatePosMatrix(le.toUnwrapped()),xe=V?Ps(ue,T,c,V,{tileID:le,tileSize:R},ee):On(ue,T,b),Te=c.style.map.terrain&&c.style.map.terrain.getTerrainData(le);X.draw(S,z.TRIANGLES,Z,U,B,lt.disabled,xe,Te,_.id,c.tileExtentBuffer,c.quadTriangleIndexBuffer,c.tileExtentSegments)}})(e,0,s,o);break;case"custom":(function(c,f,_){let y=c.context,b=_.implementation;if(c.renderPass==="offscreen"){let T=b.prerender;T&&(c.setCustomLayerDefaults(),y.setColorMode(c.colorModeForRenderPass()),T.call(b,y.gl,c.transform.customLayerMatrix()),y.setDirty(),c.setBaseState())}else if(c.renderPass==="translucent"){c.setCustomLayerDefaults(),y.setColorMode(c.colorModeForRenderPass()),y.setStencilMode(mt.disabled);let T=b.renderingMode==="3d"?new Ge(c.context.gl.LEQUAL,Ge.ReadWrite,c.depthRangeFor3D):c.depthModeForSublayer(0,Ge.ReadOnly);y.setDepthMode(T),b.render(y.gl,c.transform.customLayerMatrix(),{farZ:c.transform.farZ,nearZ:c.transform.nearZ,fov:c.transform._fov,modelViewProjectionMatrix:c.transform.modelViewProjectionMatrix,projectionMatrix:c.transform.projectionMatrix}),y.setDirty(),c.setBaseState(),y.bindFramebuffer.set(null)}})(e,0,s)}}translatePosMatrix(e,a,s,o,c){if(!s[0]&&!s[1])return e;let f=c?o==="map"?this.transform.angle:0:o==="viewport"?-this.transform.angle:0;if(f){let b=Math.sin(f),T=Math.cos(f);s=[s[0]*T-s[1]*b,s[0]*b+s[1]*T]}let _=[c?s[0]:He(a,s[0],this.transform.zoom),c?s[1]:He(a,s[1],this.transform.zoom),0],y=new Float32Array(16);return d.J(y,e,_),y}saveTileTexture(e){let a=this._tileTextures[e.size[0]];a?a.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){let a=this._tileTextures[e];return a&&a.length>0?a.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let a=this.imageManager.getPattern(e.from.toString()),s=this.imageManager.getPattern(e.to.toString());return!a||!s}useProgram(e,a){this.cache=this.cache||{};let s=e+(a?a.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[s]||(this.cache[s]=new Es(this.context,Rr[e],a,Ds[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[s]}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(){let e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new ot(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:a}=this.context.gl;return this.width!==e||this.height!==a}}class Ca{constructor(e,a){this.points=e,this.planes=a}static fromInvProjectionMatrix(e,a,s){let o=Math.pow(2,s),c=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(_=>{let y=1/(_=d.af([],_,e))[3]/a*o;return d.b1(_,_,[y,y,1/_[3],y])}),f=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(_=>{let y=function(z,D){var R=D[0],V=D[1],j=D[2],U=R*R+V*V+j*j;return U>0&&(U=1/Math.sqrt(U)),z[0]=D[0]*U,z[1]=D[1]*U,z[2]=D[2]*U,z}([],function(z,D,R){var V=D[0],j=D[1],U=D[2],Z=R[0],B=R[1],X=R[2];return z[0]=j*X-U*B,z[1]=U*Z-V*X,z[2]=V*B-j*Z,z}([],Di([],c[_[0]],c[_[1]]),Di([],c[_[2]],c[_[1]]))),b=-((T=y)[0]*(S=c[_[1]])[0]+T[1]*S[1]+T[2]*S[2]);var T,S;return y.concat(b)});return new Ca(c,f)}}class Ma{constructor(e,a){this.min=e,this.max=a,this.center=function(s,o,c){return s[0]=.5*o[0],s[1]=.5*o[1],s[2]=.5*o[2],s}([],function(s,o,c){return s[0]=o[0]+c[0],s[1]=o[1]+c[1],s[2]=o[2]+c[2],s}([],this.min,this.max))}quadrant(e){let a=[e%2==0,e<2],s=di(this.min),o=di(this.max);for(let c=0;c=0&&f++;if(f===0)return 0;f!==a.length&&(s=!1)}if(s)return 2;for(let o=0;o<3;o++){let c=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let _=0;_this.max[o]-this.min[o])return 0}return 1}}class ka{constructor(e=0,a=0,s=0,o=0){if(isNaN(e)||e<0||isNaN(a)||a<0||isNaN(s)||s<0||isNaN(o)||o<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=a,this.left=s,this.right=o}interpolate(e,a,s){return a.top!=null&&e.top!=null&&(this.top=d.y.number(e.top,a.top,s)),a.bottom!=null&&e.bottom!=null&&(this.bottom=d.y.number(e.bottom,a.bottom,s)),a.left!=null&&e.left!=null&&(this.left=d.y.number(e.left,a.left,s)),a.right!=null&&e.right!=null&&(this.right=d.y.number(e.right,a.right,s)),this}getCenter(e,a){let s=d.ac((this.left+e-this.right)/2,0,e),o=d.ac((this.top+a-this.bottom)/2,0,a);return new d.P(s,o)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.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}}}let Hs=85.051129;class za{constructor(e,a,s,o,c){this.tileSize=512,this._renderWorldCopies=c===void 0||!!c,this._minZoom=e||0,this._maxZoom=a||22,this._minPitch=s??0,this._maxPitch=o??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new d.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ka,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let e=new za(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.lngRange=e.lngRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new d.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){let a=-d.b3(e,-180,180)*Math.PI/180;this.angle!==a&&(this._unmodified=!1,this.angle=a,this._calcMatrices(),this.rotationMatrix=function(){var s=new d.A(4);return d.A!=Float32Array&&(s[1]=0,s[2]=0),s[0]=1,s[3]=1,s}(),function(s,o,c){var f=o[0],_=o[1],y=o[2],b=o[3],T=Math.sin(c),S=Math.cos(c);s[0]=f*S+y*T,s[1]=_*S+b*T,s[2]=f*-T+y*S,s[3]=_*-T+b*S}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){let a=d.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==a&&(this._unmodified=!1,this._pitch=a,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){let a=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this.tileZoom=Math.max(0,Math.floor(a)),this.scale=this.zoomScale(a),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,a,s){this._unmodified=!1,this._edgeInsets.interpolate(e,a,s),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){let a=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,a)}getVisibleUnwrappedCoordinates(e){let a=[new d.b4(0,e)];if(this._renderWorldCopies){let s=this.pointCoordinate(new d.P(0,0)),o=this.pointCoordinate(new d.P(this.width,0)),c=this.pointCoordinate(new d.P(this.width,this.height)),f=this.pointCoordinate(new d.P(0,this.height)),_=Math.floor(Math.min(s.x,o.x,c.x,f.x)),y=Math.floor(Math.max(s.x,o.x,c.x,f.x)),b=1;for(let T=_-b;T<=y+b;T++)T!==0&&a.push(new d.b4(T,e))}return a}coveringTiles(e){var a,s;let o=this.coveringZoomLevel(e),c=o;if(e.minzoom!==void 0&&oe.maxzoom&&(o=e.maxzoom);let f=this.pointCoordinate(this.getCameraPoint()),_=d.Z.fromLngLat(this.center),y=Math.pow(2,o),b=[y*f.x,y*f.y,0],T=[y*_.x,y*_.y,0],S=Ca.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,o),z=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(z=o);let D=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,R=B=>({aabb:new Ma([B*y,0,0],[(B+1)*y,y,0]),zoom:0,x:0,y:0,wrap:B,fullyVisible:!1}),V=[],j=[],U=o,Z=e.reparseOverscaled?c:o;if(this._renderWorldCopies)for(let B=1;B<=3;B++)V.push(R(-B)),V.push(R(B));for(V.push(R(0));V.length>0;){let B=V.pop(),X=B.x,K=B.y,ee=B.fullyVisible;if(!ee){let fe=B.aabb.intersects(S);if(fe===0)continue;ee=fe===2}let le=e.terrain?b:T,ue=B.aabb.distanceX(le),xe=B.aabb.distanceY(le),Te=Math.max(Math.abs(ue),Math.abs(xe));if(B.zoom===U||Te>D+(1<=z){let fe=U-B.zoom,me=b[0]-.5-(X<>1),qe=B.zoom+1,_e=B.aabb.quadrant(fe);if(e.terrain){let be=new d.S(qe,B.wrap,qe,me,ke),Oe=e.terrain.getMinMaxElevation(be),yt=(a=Oe.minElevation)!==null&&a!==void 0?a:this.elevation,Ue=(s=Oe.maxElevation)!==null&&s!==void 0?s:this.elevation;_e=new Ma([_e.min[0],_e.min[1],yt],[_e.max[0],_e.max[1],Ue])}V.push({aabb:_e,zoom:qe,x:me,y:ke,wrap:B.wrap,fullyVisible:ee})}}return j.sort((B,X)=>B.distanceSq-X.distanceSq).map(B=>B.tileID)}resize(e,a){this.width=e,this.height=a,this.pixelsToGLUnits=[2/e,-2/a],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){let a=d.ac(e.lat,-85.051129,Hs);return new d.P(d.O(e.lng)*this.worldSize,d.Q(a)*this.worldSize)}unproject(e){return new d.Z(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){let a=this.elevation,s=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,o=this.pointLocation(this.centerPoint,e),c=e.getElevationForLngLatZoom(o,this.tileZoom);if(!(this.elevation-c))return;let f=s+a-c,_=Math.cos(this._pitch)*this.cameraToCenterDistance/f/d.b5(1,o.lat),y=this.scaleZoom(_/this.tileSize);this._elevation=c,this._center=o,this.zoom=y}setLocationAtPoint(e,a){let s=this.pointCoordinate(a),o=this.pointCoordinate(this.centerPoint),c=this.locationCoordinate(e),f=new d.Z(c.x-(s.x-o.x),c.y-(s.y-o.y));this.center=this.coordinateLocation(f),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,a){return a?this.coordinatePoint(this.locationCoordinate(e),a.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,a){return this.coordinateLocation(this.pointCoordinate(e,a))}locationCoordinate(e){return d.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,a){if(a){let z=a.pointCoordinate(e);if(z!=null)return z}let s=[e.x,e.y,0,1],o=[e.x,e.y,1,1];d.af(s,s,this.pixelMatrixInverse),d.af(o,o,this.pixelMatrixInverse);let c=s[3],f=o[3],_=s[1]/c,y=o[1]/f,b=s[2]/c,T=o[2]/f,S=b===T?0:(0-b)/(T-b);return new d.Z(d.y.number(s[0]/c,o[0]/f,S)/this.worldSize,d.y.number(_,y,S)/this.worldSize)}coordinatePoint(e,a=0,s=this.pixelMatrix){let o=[e.x*this.worldSize,e.y*this.worldSize,a,1];return d.af(o,o,s),new d.P(o[0]/o[3],o[1]/o[3])}getBounds(){let e=Math.max(0,this.height/2-this.getHorizon());return new re().extend(this.pointLocation(new d.P(0,e))).extend(this.pointLocation(new d.P(this.width,e))).extend(this.pointLocation(new d.P(this.width,this.height))).extend(this.pointLocation(new d.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new re([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Hs])}calculateTileMatrix(e){let a=e.canonical,s=this.worldSize/this.zoomScale(a.z),o=a.x+Math.pow(2,a.z)*e.wrap,c=d.an(new Float64Array(16));return d.J(c,c,[o*s,a.y*s,0]),d.K(c,c,[s/d.X,s/d.X,1]),c}calculatePosMatrix(e,a=!1){let s=e.key,o=a?this._alignedPosMatrixCache:this._posMatrixCache;if(o[s])return o[s];let c=this.calculateTileMatrix(e);return d.L(c,a?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,c),o[s]=new Float32Array(c),o[s]}calculateFogMatrix(e){let a=e.key,s=this._fogMatrixCache;if(s[a])return s[a];let o=this.calculateTileMatrix(e);return d.L(o,this.fogMatrix,o),s[a]=new Float32Array(o),s[a]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,a){a=d.ac(+a,this.minZoom,this.maxZoom);let s={center:new d.N(e.lng,e.lat),zoom:a},o=this.lngRange;if(!this._renderWorldCopies&&o===null){let B=179.9999999999;o=[-B,B]}let c=this.tileSize*this.zoomScale(s.zoom),f=0,_=c,y=0,b=c,T=0,S=0,{x:z,y:D}=this.size;if(this.latRange){let B=this.latRange;f=d.Q(B[1])*c,_=d.Q(B[0])*c,_-f_&&(U=_-B)}if(o){let B=(y+b)/2,X=R;this._renderWorldCopies&&(X=d.b3(R,B-c/2,B+c/2));let K=z/2;X-Kb&&(j=b-K)}if(j!==void 0||U!==void 0){let B=new d.P(j??R,U??V);s.center=this.unproject.call({worldSize:c},B).wrap()}return s}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:a,zoom:s}=this.getConstrained(this.center,this.zoom);this.center=a,this.zoom=s,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;let e=this.centerOffset,a=this.point.x,s=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=d.b5(1,this.center.lat)*this.worldSize;let o=d.an(new Float64Array(16));d.K(o,o,[this.width/2,-this.height/2,1]),d.J(o,o,[1,-1,0]),this.labelPlaneMatrix=o,o=d.an(new Float64Array(16)),d.K(o,o,[1,-1,1]),d.J(o,o,[-1,-1,0]),d.K(o,o,[2/this.width,2/this.height,1]),this.glCoordMatrix=o;let c=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),f=Math.min(this.elevation,this.minElevationForCurrentTile),_=c-f*this._pixelPerMeter/Math.cos(this._pitch),y=f<0?_:c,b=Math.PI/2+this._pitch,T=this._fov*(.5+e.y/this.height),S=Math.sin(T)*y/Math.sin(d.ac(Math.PI-b-T,.01,Math.PI-.01)),z=this.getHorizon(),D=2*Math.atan(z/this.cameraToCenterDistance)*(.5+e.y/(2*z)),R=Math.sin(D)*y/Math.sin(d.ac(Math.PI-b-D,.01,Math.PI-.01)),V=Math.min(S,R);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*V+y),this.nearZ=this.height/50,o=new Float64Array(16),d.b6(o,this._fov,this.width/this.height,this.nearZ,this.farZ),o[8]=2*-e.x/this.width,o[9]=2*e.y/this.height,this.projectionMatrix=d.ae(o),d.K(o,o,[1,-1,1]),d.J(o,o,[0,0,-this.cameraToCenterDistance]),d.b7(o,o,this._pitch),d.ad(o,o,this.angle),d.J(o,o,[-a,-s,0]),this.mercatorMatrix=d.K([],o,[this.worldSize,this.worldSize,this.worldSize]),d.K(o,o,[1,1,this._pixelPerMeter]),this.pixelMatrix=d.L(new Float64Array(16),this.labelPlaneMatrix,o),d.J(o,o,[0,0,-this.elevation]),this.modelViewProjectionMatrix=o,this.invModelViewProjectionMatrix=d.as([],o),this.fogMatrix=new Float64Array(16),d.b6(this.fogMatrix,this._fov,this.width/this.height,c,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,d.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),d.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),d.b7(this.fogMatrix,this.fogMatrix,this._pitch),d.ad(this.fogMatrix,this.fogMatrix,this.angle),d.J(this.fogMatrix,this.fogMatrix,[-a,-s,0]),d.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),d.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=d.L(new Float64Array(16),this.labelPlaneMatrix,o);let j=this.width%2/2,U=this.height%2/2,Z=Math.cos(this.angle),B=Math.sin(this.angle),X=a-Math.round(a)+Z*j+B*U,K=s-Math.round(s)+Z*U+B*j,ee=new Float64Array(o);if(d.J(ee,ee,[X>.5?X-1:X,K>.5?K-1:K,0]),this.alignedModelViewProjectionMatrix=ee,o=d.as(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let e=this.pointCoordinate(new d.P(0,0)),a=[e.x*this.worldSize,e.y*this.worldSize,0,1];return d.af(a,a,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new d.P(0,e))}getCameraQueryGeometry(e){let a=this.getCameraPoint();if(e.length===1)return[e[0],a];{let s=a.x,o=a.y,c=a.x,f=a.y;for(let _ of e)s=Math.min(s,_.x),o=Math.min(o,_.y),c=Math.max(c,_.x),f=Math.max(f,_.y);return[new d.P(s,o),new d.P(c,o),new d.P(c,f),new d.P(s,f),new d.P(s,o)]}}lngLatToCameraDepth(e,a){let s=this.locationCoordinate(e),o=[s.x*this.worldSize,s.y*this.worldSize,a,1];return d.af(o,o,this.modelViewProjectionMatrix),o[2]/o[3]}}function pn(h,e){let a,s=!1,o=null,c=null,f=()=>{o=null,s&&(h.apply(c,a),o=setTimeout(f,e),s=!1)};return(..._)=>(s=!0,c=this,a=_,o||f(),o)}class Wn{constructor(e){this._getCurrentHash=()=>{let a=window.location.hash.replace("#","");if(this._hashName){let s;return a.split("&").map(o=>o.split("=")).forEach(o=>{o[0]===this._hashName&&(s=o)}),(s&&s[1]||"").split("/")}return a.split("/")},this._onHashChange=()=>{let a=this._getCurrentHash();if(a.length>=3&&!a.some(s=>isNaN(s))){let s=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:s,pitch:+(a[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let a=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,a)},this._removeHash=()=>{let a=this._getCurrentHash();if(a.length===0)return;let s=a.join("/"),o=s;o.split("&").length>0&&(o=o.split("&")[0]),this._hashName&&(o=`${this._hashName}=${s}`);let c=window.location.hash.replace(o,"");c.startsWith("#&")?c=c.slice(0,1)+c.slice(2):c==="#"&&(c="");let f=window.location.href.replace(/(#.+)?$/,c);f=f.replace("&&","&"),window.history.replaceState(window.history.state,null,f)},this._updateHash=pn(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let a=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,o=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),c=Math.pow(10,o),f=Math.round(a.lng*c)/c,_=Math.round(a.lat*c)/c,y=this._map.getBearing(),b=this._map.getPitch(),T="";if(T+=e?`/${f}/${_}/${s}`:`${s}/${_}/${f}`,(y||b)&&(T+="/"+Math.round(10*y)/10),b&&(T+=`/${Math.round(b)}`),this._hashName){let S=this._hashName,z=!1,D=window.location.hash.slice(1).split("&").map(R=>{let V=R.split("=")[0];return V===S?(z=!0,`${V}=${T}`):R}).filter(R=>R);return z||D.push(`${S}=${T}`),`#${D.join("&")}`}return`#${T}`}}let Kn={linearity:.3,easing:d.b8(0,0,.3,1)},Xs=d.e({deceleration:2500,maxSpeed:1400},Kn),tc=d.e({deceleration:20,maxSpeed:1400},Kn),rl=d.e({deceleration:1e3,maxSpeed:360},Kn),Jn=d.e({deceleration:1e3,maxSpeed:90},Kn);class Ws{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:se.now(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,a=se.now();for(;e.length>0&&a-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let a={zoom:0,bearing:0,pitch:0,pan:new d.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:c}of this._inertiaBuffer)a.zoom+=c.zoomDelta||0,a.bearing+=c.bearingDelta||0,a.pitch+=c.pitchDelta||0,c.panDelta&&a.pan._add(c.panDelta),c.around&&(a.around=c.around),c.pinchAround&&(a.pinchAround=c.pinchAround);let s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,o={};if(a.pan.mag()){let c=mn(a.pan.mag(),s,d.e({},Xs,e||{}));o.offset=a.pan.mult(c.amount/a.pan.mag()),o.center=this._map.transform.center,dn(o,c)}if(a.zoom){let c=mn(a.zoom,s,tc);o.zoom=this._map.transform.zoom+c.amount,dn(o,c)}if(a.bearing){let c=mn(a.bearing,s,rl);o.bearing=this._map.transform.bearing+d.ac(c.amount,-179,179),dn(o,c)}if(a.pitch){let c=mn(a.pitch,s,Jn);o.pitch=this._map.transform.pitch+c.amount,dn(o,c)}if(o.zoom||o.bearing){let c=a.pinchAround===void 0?a.around:a.pinchAround;o.around=c?this._map.unproject(c):this._map.getCenter()}return this.clear(),d.e(o,{noMoveStart:!0})}}function dn(h,e){(!h.duration||h.durationa.unproject(y)),_=c.reduce((y,b,T,S)=>y.add(b.div(S.length)),new d.P(0,0));super(e,{points:c,point:_,lngLats:f,lngLat:a.unproject(_),originalEvent:s}),this._defaultPrevented=!1}}class al extends d.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,a,s){super(e,{originalEvent:s}),this._defaultPrevented=!1}}class nl{constructor(e,a){this._map=e,this._clickTolerance=a.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new al(e.type,this._map,e))}mousedown(e,a){return this._mousedownPos=a,this._firePreventable(new Jt(e.type,this._map,e))}mouseup(e){this._map.fire(new Jt(e.type,this._map,e))}click(e,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new Jt(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Jt(e.type,this._map,e))}mouseover(e){this._map.fire(new Jt(e.type,this._map,e))}mouseout(e){this._map.fire(new Jt(e.type,this._map,e))}touchstart(e){return this._firePreventable(new ia(e.type,this._map,e))}touchmove(e){this._map.fire(new ia(e.type,this._map,e))}touchend(e){this._map.fire(new ia(e.type,this._map,e))}touchcancel(e){this._map.fire(new ia(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Pt{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Jt(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Jt("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Jt(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ki{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(d.P.convert(e),this._map.terrain)}}class ki{constructor(e,a){this._map=e,this._tr=new Ki(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=a.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,a){this.isEnabled()&&e.shiftKey&&e.button===0&&(te.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)}mousemoveWindow(e,a){if(!this._active)return;let s=a;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)c.fitScreenCoordinates(s,o,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(te.remove(this._box),this._box=null),te.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,a){return this._map.fire(new d.k(e,{originalEvent:a}))}}function fn(h,e){if(h.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${h.length}, points ${e.length}`);let a={};for(let s=0;sthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),s.length===this.numTouches&&(this.centroid=function(o){let c=new d.P(0,0);for(let f of o)c._add(f);return c.div(o.length)}(a),this.touches=fn(s,a)))}touchmove(e,a,s){if(this.aborted||!this.centroid)return;let o=fn(s,a);for(let c in this.touches){let f=o[c];(!f||f.dist(this.touches[c])>30)&&(this.aborted=!0)}}touchend(e,a,s){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){let o=!this.aborted&&this.centroid;if(this.reset(),o)return o}}}class Yn{constructor(e){this.singleTap=new Ks(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,a,s){this.singleTap.touchstart(e,a,s)}touchmove(e,a,s){this.singleTap.touchmove(e,a,s)}touchend(e,a,s){let o=this.singleTap.touchend(e,a,s);if(o){let c=e.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(o)<30;if(c&&f||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=o,this.count===this.numTaps)return this.reset(),o}}}class Ea{constructor(e){this._tr=new Ki(e),this._zoomIn=new Yn({numTouches:1,numTaps:2}),this._zoomOut=new Yn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,a,s){this._zoomIn.touchstart(e,a,s),this._zoomOut.touchstart(e,a,s)}touchmove(e,a,s){this._zoomIn.touchmove(e,a,s),this._zoomOut.touchmove(e,a,s)}touchend(e,a,s){let o=this._zoomIn.touchend(e,a,s),c=this._zoomOut.touchend(e,a,s),f=this._tr;return o?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:f.zoom+1,around:f.unproject(o)},{originalEvent:e})}):c?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:f.zoom-1,around:f.unproject(c)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ir{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let a=this._moveFunction(...e);if(a.bearingDelta||a.pitchDelta||a.around||a.panDelta)return this._active=!0,a}dragStart(e,a){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=a.length?a[0]:a,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,a){if(!this.isEnabled())return;let s=this._lastPoint;if(!s)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);let o=a.length?a[0]:a;return!this._moved&&o.dist(s){h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=e=>{e.preventDefault()}},Qs=({enable:h,clickTolerance:e,bearingDegreesPerPixelMoved:a=.8})=>{let s=new Qn({checkCorrectEvent:o=>te.mouseButton(o)===0&&o.ctrlKey||te.mouseButton(o)===2});return new Ir({clickTolerance:e,move:(o,c)=>({bearingDelta:(c.x-o.x)*a}),moveStateManager:s,enable:h,assignEvents:es})},eo=({enable:h,clickTolerance:e,pitchDegreesPerPixelMoved:a=-.5})=>{let s=new Qn({checkCorrectEvent:o=>te.mouseButton(o)===0&&o.ctrlKey||te.mouseButton(o)===2});return new Ir({clickTolerance:e,move:(o,c)=>({pitchDelta:(c.y-o.y)*a}),moveStateManager:s,enable:h,assignEvents:es})};class ra{constructor(e,a){this._clickTolerance=e.clickTolerance||1,this._map=a,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new d.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,a,s){return this._calculateTransform(e,a,s)}touchmove(e,a,s){if(this._active){if(!this._shouldBePrevented(s.length))return e.preventDefault(),this._calculateTransform(e,a,s);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,a,s){this._calculateTransform(e,a,s),this._active&&this._shouldBePrevented(s.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,a,s){s.length>0&&(this._active=!0);let o=fn(s,a),c=new d.P(0,0),f=new d.P(0,0),_=0;for(let b in o){let T=o[b],S=this._touches[b];S&&(c._add(T),f._add(T.sub(S)),_++,o[b]=T)}if(this._touches=o,this._shouldBePrevented(_)||!f.mag())return;let y=f.div(_);return this._sum._add(y),this._sum.mag()Math.abs(h.x)}class Aa extends ts{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,a,s){super.touchstart(e,a,s),this._currentTouchCount=s.length}_start(e){this._lastPoints=e,is(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,a,s){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let o=e[0].sub(this._lastPoints[0]),c=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(o,c,s.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(o.y+c.y)/2*-.5}):void 0}gestureBeginsVertically(e,a,s){if(this._valid!==void 0)return this._valid;let o=e.mag()>=2,c=a.mag()>=2;if(!o&&!c)return;if(!o||!c)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;let f=e.y>0==a.y>0;return is(e)&&is(a)&&f}}let sl={panStep:100,bearingStep:15,pitchStep:10};class Fi{constructor(e){this._tr=new Ki(e);let a=sl;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let a=0,s=0,o=0,c=0,f=0;switch(e.keyCode){case 61:case 107:case 171:case 187:a=1;break;case 189:case 109:case 173:a=-1;break;case 37:e.shiftKey?s=-1:(e.preventDefault(),c=-1);break;case 39:e.shiftKey?s=1:(e.preventDefault(),c=1);break;case 38:e.shiftKey?o=1:(e.preventDefault(),f=-1);break;case 40:e.shiftKey?o=-1:(e.preventDefault(),f=1);break;default:return}return this._rotationDisabled&&(s=0,o=0),{cameraAnimation:_=>{let y=this._tr;_.easeTo({duration:300,easeId:"keyboardHandler",easing:mr,zoom:a?Math.round(y.zoom)+a*(e.shiftKey?2:1):y.zoom,bearing:y.bearing+s*this._bearingStep,pitch:y.pitch+o*this._pitchStep,offset:[-c*this._panStep,-f*this._panStep],center:y.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function mr(h){return h*(2-h)}let no=4.000244140625;class Ji{constructor(e,a){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=e,this._tr=new Ki(e),this._triggerRenderFrame=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let a=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,s=se.now(),o=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,a!==0&&a%no==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),e.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=e,this._delta-=a,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let a=te.mousePos(this._map.getCanvas(),e),s=this._tr;this._around=a.y>s.transform.height/2-s.transform.getHorizon()?d.N.convert(this._aroundCenter?s.center:s.unproject(a)):d.N.convert(s.center),this._aroundPoint=s.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let e=this._tr.transform;if(this._delta!==0){let y=this._type==="wheel"&&Math.abs(this._delta)>no?this._wheelZoomRate:this._defaultZoomRate,b=2/(1+Math.exp(-Math.abs(this._delta*y)));this._delta<0&&b!==0&&(b=1/b);let T=typeof this._targetZoom=="number"?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(T*b))),this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let a=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,s=this._startZoom,o=this._easing,c,f=!1,_=se.now()-this._lastWheelEventTime;if(this._type==="wheel"&&s&&o&&_){let y=Math.min(_/200,1),b=o(y);c=d.y.number(s,a,b),y<1?this._frameId||(this._frameId=!0):f=!0}else c=a,f=!0;return this._active=!0,f&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!f,zoomDelta:c-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let a=d.b9;if(this._prevEase){let s=this._prevEase,o=(se.now()-s.start)/s.duration,c=s.easing(o+.01)-s.easing(o),f=.27/Math.sqrt(c*c+1e-4)*.01,_=Math.sqrt(.0729-f*f);a=d.b8(f,_,.25,1)}return this._prevEase={start:se.now(),duration:e,easing:a},a}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class aa{constructor(e,a){this._clickZoom=e,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 ic{constructor(e){this._tr=new Ki(e),this.reset()}reset(){this._active=!1}dblclick(e,a){return e.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(a)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class rc{constructor(){this._tap=new Yn({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,a,s){if(!this._swipePoint)if(this._tapTime){let o=a[0],c=e.timeStamp-this._tapTime<500,f=this._tapPoint.dist(o)<30;c&&f?s.length>0&&(this._swipePoint=o,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(e,a,s)}touchmove(e,a,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;let o=a[0],c=o.y-this._swipePoint.y;return this._swipePoint=o,e.preventDefault(),this._active=!0,{zoomDelta:c/128}}}else this._tap.touchmove(e,a,s)}touchend(e,a,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{let o=this._tap.touchend(e,a,s);o&&(this._tapTime=e.timeStamp,this._tapPoint=o)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ol{constructor(e,a,s){this._el=e,this._mousePan=a,this._touchPan=s}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ll{constructor(e,a,s){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=a,this._mousePitch=s}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class so{constructor(e,a,s,o){this._el=e,this._touchZoom=a,this._touchRotate=s,this._tapDragZoom=o,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Pa{constructor(e,a){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=a,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=te.create("div","maplibregl-cooperative-gesture-screen",e);let a=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(a=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let s=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),o=document.createElement("div");o.className="maplibregl-desktop-message",o.textContent=a,this._container.appendChild(o);let c=document.createElement("div");c.className="maplibregl-mobile-message",c.textContent=s,this._container.appendChild(c),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(te.remove(this._container),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(e){return e[this._bypassKey]}notifyGestureBlocked(e,a){this._enabled&&(this._map.fire(new d.k("cooperativegestureprevented",{gestureType:e,originalEvent:a})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let Oi=h=>h.zoom||h.drag||h.pitch||h.rotate;class Ie extends d.k{}function rs(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}class oo{constructor(e,a){this.handleWindowEvent=o=>{this.handleEvent(o,`${o.type}Window`)},this.handleEvent=(o,c)=>{if(o.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let f=o.type==="renderFrame"?void 0:o,_={needsRenderFrame:!1},y={},b={},T=o.touches,S=T?this._getMapTouches(T):void 0,z=S?te.touchPos(this._map.getCanvas(),S):te.mousePos(this._map.getCanvas(),o);for(let{handlerName:V,handler:j,allowed:U}of this._handlers){if(!j.isEnabled())continue;let Z;this._blockedByActive(b,U,V)?j.reset():j[c||o.type]&&(Z=j[c||o.type](o,z,S),this.mergeHandlerResult(_,y,Z,V,f),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||j.isActive())&&(b[V]=j)}let D={};for(let V in this._previousActiveHandlers)b[V]||(D[V]=f);this._previousActiveHandlers=b,(Object.keys(D).length||rs(_))&&(this._changes.push([_,y,D]),this._triggerRenderFrame()),(Object.keys(b).length||rs(_))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:R}=_;R&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],R(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ws(e),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a);let s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[window,"blur",void 0]];for(let[o,c,f]of this._listeners)te.addEventListener(o,c,o===document?this.handleWindowEvent:this.handleEvent,f)}destroy(){for(let[e,a,s]of this._listeners)te.removeEventListener(e,a,e===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(e){let a=this._map,s=a.getCanvasContainer();this._add("mapEvent",new nl(a,e));let o=a.boxZoom=new ki(a,e);this._add("boxZoom",o),e.interactive&&e.boxZoom&&o.enable();let c=a.cooperativeGestures=new Pa(a,e.cooperativeGestures);this._add("cooperativeGestures",c),e.cooperativeGestures&&c.enable();let f=new Ea(a),_=new ic(a);a.doubleClickZoom=new aa(_,f),this._add("tapZoom",f),this._add("clickZoom",_),e.interactive&&e.doubleClickZoom&&a.doubleClickZoom.enable();let y=new rc;this._add("tapDragZoom",y);let b=a.touchPitch=new Aa(a);this._add("touchPitch",b),e.interactive&&e.touchPitch&&a.touchPitch.enable(e.touchPitch);let T=Qs(e),S=eo(e);a.dragRotate=new ll(e,T,S),this._add("mouseRotate",T,["mousePitch"]),this._add("mousePitch",S,["mouseRotate"]),e.interactive&&e.dragRotate&&a.dragRotate.enable();let z=(({enable:Z,clickTolerance:B})=>{let X=new Qn({checkCorrectEvent:K=>te.mouseButton(K)===0&&!K.ctrlKey});return new Ir({clickTolerance:B,move:(K,ee)=>({around:ee,panDelta:ee.sub(K)}),activateOnStart:!0,moveStateManager:X,enable:Z,assignEvents:es})})(e),D=new ra(e,a);a.dragPan=new ol(s,z,D),this._add("mousePan",z),this._add("touchPan",D,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&a.dragPan.enable(e.dragPan);let R=new ao,V=new io;a.touchZoomRotate=new so(s,V,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",V,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&a.touchZoomRotate.enable(e.touchZoomRotate);let j=a.scrollZoom=new Ji(a,()=>this._triggerRenderFrame());this._add("scrollZoom",j,["mousePan"]),e.interactive&&e.scrollZoom&&a.scrollZoom.enable(e.scrollZoom);let U=a.keyboard=new Fi(a);this._add("keyboard",U),e.interactive&&e.keyboard&&a.keyboard.enable(),this._add("blockableMapEvent",new Pt(a))}_add(e,a,s){this._handlers.push({handlerName:e,handler:a,allowed:s}),this._handlersById[e]=a}stop(e){if(!this._updatingCamera){for(let{handler:a}of this._handlers)a.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Oi(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,a,s){for(let o in e)if(o!==s&&(!a||a.indexOf(o)<0))return!0;return!1}_getMapTouches(e){let a=[];for(let s of e)this._el.contains(s.target)&&a.push(s);return a}mergeHandlerResult(e,a,s,o,c){if(!s)return;d.e(e,s);let f={handlerName:o,originalEvent:s.originalEvent||c};s.zoomDelta!==void 0&&(a.zoom=f),s.panDelta!==void 0&&(a.drag=f),s.pitchDelta!==void 0&&(a.pitch=f),s.bearingDelta!==void 0&&(a.rotate=f)}_applyChanges(){let e={},a={},s={};for(let[o,c,f]of this._changes)o.panDelta&&(e.panDelta=(e.panDelta||new d.P(0,0))._add(o.panDelta)),o.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+o.pitchDelta),o.around!==void 0&&(e.around=o.around),o.pinchAround!==void 0&&(e.pinchAround=o.pinchAround),o.noInertia&&(e.noInertia=o.noInertia),d.e(a,c),d.e(s,f);this._updateMapTransform(e,a,s),this._changes=[]}_updateMapTransform(e,a,s){let o=this._map,c=o._getTransformForUpdate(),f=o.terrain;if(!(rs(e)||f&&this._terrainMovement))return this._fireEvents(a,s,!0);let{panDelta:_,zoomDelta:y,bearingDelta:b,pitchDelta:T,around:S,pinchAround:z}=e;z!==void 0&&(S=z),o._stop(!0),S=S||o.transform.centerPoint;let D=c.pointLocation(_?S.sub(_):S);b&&(c.bearing+=b),T&&(c.pitch+=T),y&&(c.zoom+=y),f?this._terrainMovement||!a.drag&&!a.zoom?a.drag&&this._terrainMovement?c.center=c.pointLocation(c.centerPoint.sub(_)):c.setLocationAtPoint(D,S):(this._terrainMovement=!0,this._map._elevationFreeze=!0,c.setLocationAtPoint(D,S)):c.setLocationAtPoint(D,S),o._applyUpdatedTransform(c),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(a,s,!0)}_fireEvents(e,a,s){let o=Oi(this._eventsInProgress),c=Oi(e),f={};for(let S in e){let{originalEvent:z}=e[S];this._eventsInProgress[S]||(f[`${S}start`]=z),this._eventsInProgress[S]=e[S]}!o&&c&&this._fireEvent("movestart",c.originalEvent);for(let S in f)this._fireEvent(S,f[S]);c&&this._fireEvent("move",c.originalEvent);for(let S in e){let{originalEvent:z}=e[S];this._fireEvent(S,z)}let _={},y;for(let S in this._eventsInProgress){let{handlerName:z,originalEvent:D}=this._eventsInProgress[S];this._handlersById[z].isActive()||(delete this._eventsInProgress[S],y=a[z]||D,_[`${S}end`]=y)}for(let S in _)this._fireEvent(S,_[S]);let b=Oi(this._eventsInProgress),T=(o||c)&&!b;if(T&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let S=this._map._getTransformForUpdate();S.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(S)}if(s&&T){this._updatingCamera=!0;let S=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),z=D=>D!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Ie("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class cl extends d.E{constructor(e,a){super(),this._renderFrameCallback=()=>{let s=Math.min((se.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=a.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new d.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,a){return this.jumpTo({center:e},a)}panBy(e,a,s){return e=d.P.convert(e).mult(-1),this.panTo(this.transform.center,d.e({offset:e},a),s)}panTo(e,a,s){return this.easeTo(d.e({center:e},a),s)}getZoom(){return this.transform.zoom}setZoom(e,a){return this.jumpTo({zoom:e},a),this}zoomTo(e,a,s){return this.easeTo(d.e({zoom:e},a),s)}zoomIn(e,a){return this.zoomTo(this.getZoom()+1,e,a),this}zoomOut(e,a){return this.zoomTo(this.getZoom()-1,e,a),this}getBearing(){return this.transform.bearing}setBearing(e,a){return this.jumpTo({bearing:e},a),this}getPadding(){return this.transform.padding}setPadding(e,a){return this.jumpTo({padding:e},a),this}rotateTo(e,a,s){return this.easeTo(d.e({bearing:e},a),s)}resetNorth(e,a){return this.rotateTo(0,d.e({duration:1e3},e),a),this}resetNorthPitch(e,a){return this.easeTo(d.e({bearing:0,pitch:0,duration:1e3},e),a),this}snapToNorth(e,a){return Math.abs(this.getBearing()){if(this._zooming&&(o.zoom=d.y.number(c,j,le)),this._rotating&&(o.bearing=d.y.number(f,b,le)),this._pitching&&(o.pitch=d.y.number(_,T,le)),this._padding&&(o.interpolatePadding(y,S,le),D=o.centerPoint.add(z)),this.terrain&&!e.freezeElevation&&this._updateElevation(le),X)o.setLocationAtPoint(X,K);else{let ue=o.zoomScale(o.zoom-c),xe=j>c?Math.min(2,B):Math.max(.5,B),Te=Math.pow(xe,1-le),fe=o.unproject(U.add(Z.mult(le*Te)).mult(ue));o.setLocationAtPoint(o.renderWorldCopies?fe.wrap():fe,D)}this._applyUpdatedTransform(o),this._fireMoveEvents(a)},le=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(a,le)},e),this}_prepareEase(e,a,s={}){this._moving=!0,a||s.moving||this.fire(new d.k("movestart",e)),this._zooming&&!s.zooming&&this.fire(new d.k("zoomstart",e)),this._rotating&&!s.rotating&&this.fire(new d.k("rotatestart",e)),this._pitching&&!s.pitching&&this.fire(new d.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let a=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&a!==this._elevationTarget){let s=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(s-(a-(s*e+this._elevationStart))/(1-e)),this._elevationTarget=a}this.transform.elevation=d.y.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){let a=e.getCameraPosition(),s=this.terrain.getElevationForLngLatZoom(a.lngLat,e.zoom);if(a.altitudethis._elevateCameraIfInsideTerrain(o)),this.transformCameraUpdate&&a.push(o=>this.transformCameraUpdate(o)),!a.length)return;let s=e.clone();for(let o of a){let c=s.clone(),{center:f,zoom:_,pitch:y,bearing:b,elevation:T}=o(c);f&&(c.center=f),_!==void 0&&(c.zoom=_),y!==void 0&&(c.pitch=y),b!==void 0&&(c.bearing=b),T!==void 0&&(c.elevation=T),s.apply(c)}this.transform.apply(s)}_fireMoveEvents(e){this.fire(new d.k("move",e)),this._zooming&&this.fire(new d.k("zoom",e)),this._rotating&&this.fire(new d.k("rotate",e)),this._pitching&&this.fire(new d.k("pitch",e))}_afterEase(e,a){if(this._easeId&&a&&this._easeId===a)return;delete this._easeId;let s=this._zooming,o=this._rotating,c=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,s&&this.fire(new d.k("zoomend",e)),o&&this.fire(new d.k("rotateend",e)),c&&this.fire(new d.k("pitchend",e)),this.fire(new d.k("moveend",e))}flyTo(e,a){var s;if(!e.essential&&se.prefersReducedMotion){let be=d.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(be,a)}this.stop(),e=d.e({offset:[0,0],speed:1.2,curve:1.42,easing:d.b9},e);let o=this._getTransformForUpdate(),c=o.zoom,f=o.bearing,_=o.pitch,y=o.padding,b="bearing"in e?this._normalizeBearing(e.bearing,f):f,T="pitch"in e?+e.pitch:_,S="padding"in e?e.padding:o.padding,z=d.P.convert(e.offset),D=o.centerPoint.add(z),R=o.pointLocation(D),{center:V,zoom:j}=o.getConstrained(d.N.convert(e.center||R),(s=e.zoom)!==null&&s!==void 0?s:c);this._normalizeCenter(V,o);let U=o.zoomScale(j-c),Z=o.project(R),B=o.project(V).sub(Z),X=e.curve,K=Math.max(o.width,o.height),ee=K/U,le=B.mag();if("minZoom"in e){let be=d.ac(Math.min(e.minZoom,c,j),o.minZoom,o.maxZoom),Oe=K/o.zoomScale(be-c);X=Math.sqrt(Oe/le*2)}let ue=X*X;function xe(be){let Oe=(ee*ee-K*K+(be?-1:1)*ue*ue*le*le)/(2*(be?ee:K)*ue*le);return Math.log(Math.sqrt(Oe*Oe+1)-Oe)}function Te(be){return(Math.exp(be)-Math.exp(-be))/2}function fe(be){return(Math.exp(be)+Math.exp(-be))/2}let me=xe(!1),ke=function(be){return fe(me)/fe(me+X*be)},qe=function(be){return K*((fe(me)*(Te(Oe=me+X*be)/fe(Oe))-Te(me))/ue)/le;var Oe},_e=(xe(!0)-me)/X;if(Math.abs(le)<1e-6||!isFinite(_e)){if(Math.abs(K-ee)<1e-6)return this.easeTo(e,a);let be=ee0,ke=Oe=>Math.exp(be*X*Oe)}return e.duration="duration"in e?+e.duration:1e3*_e/("screenSpeed"in e?+e.screenSpeed/X:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=f!==b,this._pitching=T!==_,this._padding=!o.isPaddingEqual(S),this._prepareEase(a,!1),this.terrain&&this._prepareElevation(V),this._ease(be=>{let Oe=be*_e,yt=1/ke(Oe);o.zoom=be===1?j:c+o.scaleZoom(yt),this._rotating&&(o.bearing=d.y.number(f,b,be)),this._pitching&&(o.pitch=d.y.number(_,T,be)),this._padding&&(o.interpolatePadding(y,S,be),D=o.centerPoint.add(z)),this.terrain&&!e.freezeElevation&&this._updateElevation(be);let Ue=be===1?V:o.unproject(Z.add(B.mult(qe(Oe))).mult(yt));o.setLocationAtPoint(o.renderWorldCopies?Ue.wrap():Ue,D),this._applyUpdatedTransform(o),this._fireMoveEvents(a)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(a)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,a){var s;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let o=this._onEaseEnd;delete this._onEaseEnd,o.call(this,a)}return e||(s=this.handlers)===null||s===void 0||s.stop(!1),this}_ease(e,a,s){s.animate===!1||s.duration===0?(e(1),a()):(this._easeStart=se.now(),this._easeOptions=s,this._onEaseFrame=e,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,a){e=d.b3(e,-180,180);let s=Math.abs(e-a);return Math.abs(e-360-a)180?-360:s<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(d.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}let Da={compact:!0,customAttribution:'MapLibre'};class La{constructor(e=Da){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=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=te.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=te.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=te.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(){te.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,a){let s=this._map._getUIString(`AttributionControl.${a}`);e.title=s,e.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(o=>typeof o!="string"?"":o)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}let a=this._map.style.sourceCaches;for(let o in a){let c=a[o];if(c.used||c.usedForTerrain){let f=c.getSource();f.attribution&&e.indexOf(f.attribution)<0&&e.push(f.attribution)}}e=e.filter(o=>String(o).trim()),e.sort((o,c)=>o.length-c.length),e=e.filter((o,c)=>{for(let f=c+1;f=0)return!1;return!0});let s=e.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,e.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class lo{constructor(e={}){this._updateCompact=()=>{let a=this._container.children;if(a.length){let s=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&s.classList.add("maplibregl-compact"):s.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=te.create("div","maplibregl-ctrl");let a=te.create("a","maplibregl-ctrl-logo");return a.target="_blank",a.rel="noopener nofollow",a.href="https://maplibre.org/",a.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),a.setAttribute("rel","noopener nofollow"),this._container.appendChild(a),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){te.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class We{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let a=++this._id;return this._queue.push({callback:e,id:a,cancelled:!1}),a}remove(e){let a=this._currentlyRunning,s=a?this._queue.concat(a):this._queue;for(let o of s)if(o.id===e)return void(o.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let a=this._currentlyRunning=this._queue;this._queue=[];for(let s of a)if(!s.cancelled&&(s.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var co=d.Y([{name:"a_pos3d",type:"Int16",components:3}]);class ac extends d.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,a){this.sourceCache.update(e,a),this._renderableTilesKeys=[];let s={};for(let o of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:a}))s[o.key]=!0,this._renderableTilesKeys.push(o.key),this._tiles[o.key]||(o.posMatrix=new Float64Array(16),d.aP(o.posMatrix,0,d.X,0,d.X,0,1),this._tiles[o.key]=new Dr(o,this.tileSize));for(let o in this._tiles)s[o]||delete this._tiles[o]}freeRtt(e){for(let a in this._tiles){let s=this._tiles[a];(!e||s.tileID.equals(e)||s.tileID.isChildOf(e)||e.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){let a={};for(let s of this._renderableTilesKeys){let o=this._tiles[s].tileID;if(o.canonical.equals(e.canonical)){let c=e.clone();c.posMatrix=new Float64Array(16),d.aP(c.posMatrix,0,d.X,0,d.X,0,1),a[s]=c}else if(o.canonical.isChildOf(e.canonical)){let c=e.clone();c.posMatrix=new Float64Array(16);let f=o.canonical.z-e.canonical.z,_=o.canonical.x-(o.canonical.x>>f<>f<>f;d.aP(c.posMatrix,0,b,0,b,0,1),d.J(c.posMatrix,c.posMatrix,[-_*b,-y*b,0]),a[s]=c}else if(e.canonical.isChildOf(o.canonical)){let c=e.clone();c.posMatrix=new Float64Array(16);let f=e.canonical.z-o.canonical.z,_=e.canonical.x-(e.canonical.x>>f<>f<>f;d.aP(c.posMatrix,0,d.X,0,d.X,0,1),d.J(c.posMatrix,c.posMatrix,[_*b,y*b,0]),d.K(c.posMatrix,c.posMatrix,[1/2**f,1/2**f,0]),a[s]=c}}return a}getSourceTile(e,a){let s=this.sourceCache._source,o=e.overscaledZ-this.deltaZoom;if(o>s.maxzoom&&(o=s.maxzoom),o=s.minzoom&&(!c||!c.dem);)c=this.sourceCache.getTileByID(e.scaledTo(o--).key);return c}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(a=>a.timeAdded>=e)}}class ho{constructor(e,a,s){this.painter=e,this.sourceCache=new ac(a),this.options=s,this.exaggeration=typeof s.exaggeration=="number"?s.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,a,s,o=d.X){var c;if(!(a>=0&&a=0&&se.canonical.z&&(e.canonical.z>=o?c=e.canonical.z-o:d.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let f=e.canonical.x-(e.canonical.x>>c<>c<>8<<4|c>>8,a[f+3]=0;let s=new d.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(a.buffer)),o=new ot(e,s,e.gl.RGBA,{premultiply:!1});return o.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=o,o}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);let a=new Uint8Array(4),s=this.painter.context,o=s.gl,c=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),f=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),_=Math.round(this.painter.height/devicePixelRatio);s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(c,_-f-1,1,1,o.RGBA,o.UNSIGNED_BYTE,a),s.bindFramebuffer.set(null);let y=a[0]+(a[2]>>4<<8),b=a[1]+((15&a[2])<<8),T=this.coordsIndex[255-a[3]],S=T&&this.sourceCache.getTileByID(T);if(!S)return null;let z=this._coordsTextureSize,D=(1<e.id!==a),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(let 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!");let e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(let e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length!e.inUse)===!1}}let Ra={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class hl{constructor(e,a){this.painter=e,this.terrain=a,this.pool=new nc(e.context,30,a.sourceCache.tileSize*a.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,a){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(s=>!e._layers[s].isHidden(a)),this._coordsDescendingInv={};for(let s in e.sourceCaches){this._coordsDescendingInv[s]={};let o=e.sourceCaches[s].getVisibleCoordinates();for(let c of o){let f=this.terrain.sourceCache.getTerrainCoords(c);for(let _ in f)this._coordsDescendingInv[s][_]||(this._coordsDescendingInv[s][_]=[]),this._coordsDescendingInv[s][_].push(f[_])}}this._coordsDescendingInvStr={};for(let s of e._order){let o=e._layers[s],c=o.source;if(Ra[o.type]&&!this._coordsDescendingInvStr[c]){this._coordsDescendingInvStr[c]={};for(let f in this._coordsDescendingInv[c])this._coordsDescendingInvStr[c][f]=this._coordsDescendingInv[c][f].map(_=>_.key).sort().join()}}for(let s of this._renderableTiles)for(let o in this._coordsDescendingInvStr){let c=this._coordsDescendingInvStr[o][s.tileID.key];c&&c!==s.rttCoords[o]&&(s.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;let a=e.type,s=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Ra[a]&&(this._prevType&&Ra[this._prevType]||this._stacks.push([]),this._prevType=a,this._stacks[this._stacks.length-1].push(e.id),!o))return!0;if(Ra[this._prevType]||Ra[a]&&o){this._prevType=a;let c=this._stacks.length-1,f=this._stacks[c]||[];for(let _ of this._renderableTiles){if(this.pool.isFull()&&(il(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(_),_.rtt[c]){let b=this.pool.getObjectForId(_.rtt[c].id);if(b.stamp===_.rtt[c].stamp){this.pool.useObject(b);continue}}let y=this.pool.getOrCreateFreeObject();this.pool.useObject(y),this.pool.stampObject(y),_.rtt[c]={id:y.id,stamp:y.stamp},s.context.bindFramebuffer.set(y.fbo.framebuffer),s.context.clear({color:d.aM.transparent,stencil:0}),s.currentStencilSource=void 0;for(let b=0;b{h.touchstart=h.dragStart,h.touchmoveWindow=h.dragMove,h.touchend=h.dragEnd},oc={showCompass:!0,showZoom:!0,visualizePitch:!1};class lc{constructor(e,a,s=!1){this.mousedown=f=>{this.startMouse(d.e({},f,{ctrlKey:!0,preventDefault:()=>f.preventDefault()}),te.mousePos(this.element,f)),te.addEventListener(window,"mousemove",this.mousemove),te.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=f=>{this.moveMouse(f,te.mousePos(this.element,f))},this.mouseup=f=>{this.mouseRotate.dragEnd(f),this.mousePitch&&this.mousePitch.dragEnd(f),this.offTemp()},this.touchstart=f=>{f.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=te.touchPos(this.element,f.targetTouches)[0],this.startTouch(f,this._startPos),te.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),te.addEventListener(window,"touchend",this.touchend))},this.touchmove=f=>{f.targetTouches.length!==1?this.reset():(this._lastPos=te.touchPos(this.element,f.targetTouches)[0],this.moveTouch(f,this._lastPos))},this.touchend=f=>{f.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let o=e.dragRotate._mouseRotate.getClickTolerance(),c=e.dragRotate._mousePitch.getClickTolerance();this.element=a,this.mouseRotate=Qs({clickTolerance:o,enable:!0}),this.touchRotate=(({enable:f,clickTolerance:_,bearingDegreesPerPixelMoved:y=.8})=>{let b=new Ys;return new Ir({clickTolerance:_,move:(T,S)=>({bearingDelta:(S.x-T.x)*y}),moveStateManager:b,enable:f,assignEvents:po})})({clickTolerance:o,enable:!0}),this.map=e,s&&(this.mousePitch=eo({clickTolerance:c,enable:!0}),this.touchPitch=(({enable:f,clickTolerance:_,pitchDegreesPerPixelMoved:y=-.5})=>{let b=new Ys;return new Ir({clickTolerance:_,move:(T,S)=>({pitchDelta:(S.y-T.y)*y}),moveStateManager:b,enable:f,assignEvents:po})})({clickTolerance:c,enable:!0})),te.addEventListener(a,"mousedown",this.mousedown),te.addEventListener(a,"touchstart",this.touchstart,{passive:!1}),te.addEventListener(a,"touchcancel",this.reset)}startMouse(e,a){this.mouseRotate.dragStart(e,a),this.mousePitch&&this.mousePitch.dragStart(e,a),te.disableDrag()}startTouch(e,a){this.touchRotate.dragStart(e,a),this.touchPitch&&this.touchPitch.dragStart(e,a),te.disableDrag()}moveMouse(e,a){let s=this.map,{bearingDelta:o}=this.mouseRotate.dragMove(e,a)||{};if(o&&s.setBearing(s.getBearing()+o),this.mousePitch){let{pitchDelta:c}=this.mousePitch.dragMove(e,a)||{};c&&s.setPitch(s.getPitch()+c)}}moveTouch(e,a){let s=this.map,{bearingDelta:o}=this.touchRotate.dragMove(e,a)||{};if(o&&s.setBearing(s.getBearing()+o),this.touchPitch){let{pitchDelta:c}=this.touchPitch.dragMove(e,a)||{};c&&s.setPitch(s.getPitch()+c)}}off(){let e=this.element;te.removeEventListener(e,"mousedown",this.mousedown),te.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),te.removeEventListener(window,"touchend",this.touchend),te.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){te.enableDrag(),te.removeEventListener(window,"mousemove",this.mousemove),te.removeEventListener(window,"mouseup",this.mouseup),te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),te.removeEventListener(window,"touchend",this.touchend)}}let zi;function _t(h,e,a){let s=new d.N(h.lng,h.lat);if(h=new d.N(h.lng,h.lat),e){let o=new d.N(h.lng-360,h.lat),c=new d.N(h.lng+360,h.lat),f=a.locationPoint(h).distSqr(e);a.locationPoint(o).distSqr(e)180;){let o=a.locationPoint(h);if(o.x>=0&&o.y>=0&&o.x<=a.width&&o.y<=a.height)break;h.lng>a.center.lng?h.lng-=360:h.lng+=360}return h.lng!==s.lng&&a.locationPoint(h).y>a.height/2-a.getHorizon()?h:s}let Ba={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 as(h,e,a){let s=h.classList;for(let o in Ba)s.remove(`maplibregl-${a}-anchor-${o}`);s.add(`maplibregl-${a}-anchor-${e}`)}class ns extends d.E{constructor(e){if(super(),this._onKeyPress=a=>{let s=a.code,o=a.charCode||a.keyCode;s!=="Space"&&s!=="Enter"&&o!==32&&o!==13||this.togglePopup()},this._onMapClick=a=>{let s=a.originalEvent.target,o=this._element;this._popup&&(s===o||o.contains(s))&&this.togglePopup()},this._update=a=>{var s;if(!this._map)return;let o=this._map.loaded()&&!this._map.isMoving();(a?.type==="terrain"||a?.type==="render"&&!o)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?_t(this._lngLat,this._flatPos,this._map.transform):(s=this._lngLat)===null||s===void 0?void 0:s.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(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()),te.setTransform(this._element,`${Ba[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${f} ${c}`),se.frameAsync(new AbortController).then(()=>{this._updateOpacity(a&&a.type==="moveend")}).catch(()=>{})},this._onMove=a=>{if(!this._isDragging){let s=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=s}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 d.k("dragstart"))),this.fire(new d.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new d.k("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=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(e?.opacity,e?.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=d.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=te.create("div");let a=te.createNS("http://www.w3.org/2000/svg","svg"),s=41,o=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${s}px`),a.setAttributeNS(null,"width",`${o}px`),a.setAttributeNS(null,"viewBox",`0 0 ${o} ${s}`);let c=te.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"stroke","none"),c.setAttributeNS(null,"stroke-width","1"),c.setAttributeNS(null,"fill","none"),c.setAttributeNS(null,"fill-rule","evenodd");let f=te.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill-rule","nonzero");let _=te.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");let y=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let U of y){let Z=te.createNS("http://www.w3.org/2000/svg","ellipse");Z.setAttributeNS(null,"opacity","0.04"),Z.setAttributeNS(null,"cx","10.5"),Z.setAttributeNS(null,"cy","5.80029008"),Z.setAttributeNS(null,"rx",U.rx),Z.setAttributeNS(null,"ry",U.ry),_.appendChild(Z)}let b=te.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"fill",this._color);let T=te.createNS("http://www.w3.org/2000/svg","path");T.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"),b.appendChild(T);let S=te.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"opacity","0.25"),S.setAttributeNS(null,"fill","#000000");let z=te.createNS("http://www.w3.org/2000/svg","path");z.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),S.appendChild(z);let D=te.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"transform","translate(6.0, 7.0)"),D.setAttributeNS(null,"fill","#FFFFFF");let R=te.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"transform","translate(8.0, 8.0)");let V=te.createNS("http://www.w3.org/2000/svg","circle");V.setAttributeNS(null,"fill","#000000"),V.setAttributeNS(null,"opacity","0.25"),V.setAttributeNS(null,"cx","5.5"),V.setAttributeNS(null,"cy","5.5"),V.setAttributeNS(null,"r","5.4999962");let j=te.createNS("http://www.w3.org/2000/svg","circle");j.setAttributeNS(null,"fill","#FFFFFF"),j.setAttributeNS(null,"cx","5.5"),j.setAttributeNS(null,"cy","5.5"),j.setAttributeNS(null,"r","5.4999962"),R.appendChild(V),R.appendChild(j),f.appendChild(_),f.appendChild(b),f.appendChild(S),f.appendChild(D),f.appendChild(R),a.appendChild(f),a.setAttributeNS(null,"height",s*this._scale+"px"),a.setAttributeNS(null,"width",o*this._scale+"px"),this._element.appendChild(a),this._offset=d.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",a=>{a.preventDefault()}),this._element.addEventListener("mousedown",a=>{a.preventDefault()}),as(this._element,this._anchor,"marker"),e&&e.className)for(let a of e.className.split(" "))this._element.classList.add(a);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",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),te.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=d.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){let o=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[o,-1*(38.1-13.5+o)],"bottom-right":[-o,-1*(38.1-13.5+o)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){let e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var a,s;if(!(!((a=this._map)===null||a===void 0)&&a.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let o=this._map,c=o.terrain.depthAtPoint(this._pos),f=o.terrain.getElevationForLngLatZoom(this._lngLat,o.transform.tileZoom);if(o.transform.lngLatToCameraDepth(this._lngLat,f)-c<.006)return void(this._element.style.opacity=this._opacity);let _=-this._offset.y/o.transform._pixelPerMeter,y=Math.sin(o.getPitch()*Math.PI/180)*_,b=o.terrain.depthAtPoint(new d.P(this._pos.x,this._pos.y-this._offset.y)),T=o.transform.lngLatToCameraDepth(this._lngLat,f+y)-b>.006;!((s=this._popup)===null||s===void 0)&&s.isOpen()&&T&&this._popup.remove(),this._element.style.opacity=T?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=d.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,a){return e===void 0&&a===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),a!==void 0&&(this._opacityWhenCovered=a),this._map&&this._updateOpacity(!0),this}}let pl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},_n=0,yn=!1,fr={maxWidth:100,unit:"metric"};function xn(h,e,a){let s=a&&a.maxWidth||100,o=h._container.clientHeight/2,c=h.unproject([0,o]),f=h.unproject([s,o]),_=c.distanceTo(f);if(a&&a.unit==="imperial"){let y=3.2808*_;y>5280?Me(e,s,y/5280,h._getUIString("ScaleControl.Miles")):Me(e,s,y,h._getUIString("ScaleControl.Feet"))}else a&&a.unit==="nautical"?Me(e,s,_/1852,h._getUIString("ScaleControl.NauticalMiles")):_>=1e3?Me(e,s,_/1e3,h._getUIString("ScaleControl.Kilometers")):Me(e,s,_,h._getUIString("ScaleControl.Meters"))}function Me(h,e,a,s){let o=function(c){let f=Math.pow(10,`${Math.floor(c)}`.length-1),_=c/f;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:_>=1?1:function(y){let b=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*b)/b}(_),f*_}(a);h.style.width=e*(o/a)+"px",h.innerHTML=`${o} ${s}`}let Be={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ss=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function os(h){if(h){if(typeof h=="number"){let e=Math.round(Math.abs(h)/Math.SQRT2);return{center:new d.P(0,0),top:new d.P(0,h),"top-left":new d.P(e,e),"top-right":new d.P(-e,e),bottom:new d.P(0,-h),"bottom-left":new d.P(e,-e),"bottom-right":new d.P(-e,-e),left:new d.P(h,0),right:new d.P(-h,0)}}if(h instanceof d.P||Array.isArray(h)){let e=d.P.convert(h);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:d.P.convert(h.center||[0,0]),top:d.P.convert(h.top||[0,0]),"top-left":d.P.convert(h["top-left"]||[0,0]),"top-right":d.P.convert(h["top-right"]||[0,0]),bottom:d.P.convert(h.bottom||[0,0]),"bottom-left":d.P.convert(h["bottom-left"]||[0,0]),"bottom-right":d.P.convert(h["bottom-right"]||[0,0]),left:d.P.convert(h.left||[0,0]),right:d.P.convert(h.right||[0,0])}}return os(new d.P(0,0))}let mo=qt;P.AJAXError=d.bh,P.Evented=d.E,P.LngLat=d.N,P.MercatorCoordinate=d.Z,P.Point=d.P,P.addProtocol=d.bi,P.config=d.a,P.removeProtocol=d.bj,P.AttributionControl=La,P.BoxZoomHandler=ki,P.CanvasSource=Li,P.CooperativeGesturesHandler=Pa,P.DoubleClickZoomHandler=aa,P.DragPanHandler=ol,P.DragRotateHandler=ll,P.EdgeInsets=ka,P.FullscreenControl=class extends d.E{constructor(h={}){super(),this._onFullscreenChange=()=>{var e;let a=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=a?.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)a=a.shadowRoot.fullscreenElement;a===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:d.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){te.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let h=this._fullscreenButton=te.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);te.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new d.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new d.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},P.GeoJSONSource=Ya,P.GeolocateControl=class extends d.E{constructor(h){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new d.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new d.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{let a=new d.N(e.coords.longitude,e.coords.latitude),s=e.coords.accuracy,o=this._map.getBearing(),c=d.e({bearing:o},this.options.fitBoundsOptions),f=re.fromLngLat(a,s);this._map.fitBounds(f,c,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let a=new d.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&yn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new d.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=te.create("button","maplibregl-ctrl-geolocate",this._container),te.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){d.w("Geolocation support is not available so the GeolocateControl will be disabled.");let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{let 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=te.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ns({element:this._dotElement}),this._circleElement=te.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ns({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",a=>{a.geolocateSource||this._watchState!=="ACTIVE_LOCK"||a.originalEvent&&a.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new d.k("trackuserlocationend")),this.fire(new d.k("userlocationlostfocus")))})}},this.options=d.e({},pl,h)}onAdd(h){return this._map=h,this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return d._(this,arguments,void 0,function*(e=!1){if(zi!==void 0&&!e)return zi;if(window.navigator.permissions===void 0)return zi=!!window.navigator.geolocation,zi;try{zi=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{zi=!!window.navigator.geolocation}return zi})}().then(e=>this._finishSetupUI(e)),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(),te.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,_n=0,yn=!1}_isOutOfMapMaxBounds(h){let e=this._map.getMaxBounds(),a=h.coords;return e&&(a.longitudee.getEast()||a.latitudee.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let h=this._map.getBounds(),e=h.getSouthEast(),a=h.getNorthEast(),s=e.distanceTo(a),o=Math.ceil(this._accuracy/(s/this._map._container.clientHeight)*2);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}trigger(){if(!this._setup)return d.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 d.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":_n--,yn=!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 d.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new d.k("trackuserlocationstart")),this.fire(new d.k("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 h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),_n++,_n>1?(h={maximumAge:6e5,timeout:0},yn=!0):(h=this.options.positionOptions,yn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},P.Hash=Wn,P.ImageSource=wr,P.KeyboardHandler=Fi,P.LngLatBounds=re,P.LogoControl=lo,P.Map=class extends cl{constructor(h){d.bf.mark(d.bg.create);let e=Object.assign(Object.assign({},sc),h);if(e.minZoom!=null&&e.maxZoom!=null&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(e.minPitch!=null&&e.maxPitch!=null&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(e.minPitch!=null&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(e.maxPitch!=null&&e.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new za(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),{bearingSnap:e.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new We,this._controls=[],this._mapId=d.a4(),this._contextLost=a=>{a.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new d.k("webglcontextlost",{originalEvent:a}))},this._contextRestored=a=>{this._setupPainter(),this.resize(),this._update(),this.fire(new d.k("webglcontextrestored",{originalEvent:a}))},this._onMapScroll=a=>{if(a.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._maxTileCacheZoomLevels=e.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=e.preserveDrawingBuffer===!0,this._antialias=e.antialias===!0,this._trackResize=e.trackResize===!0,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles===!0,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions===!0,this._collectResourceTiming=e.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},uo),e.locale),this._clickTolerance=e.clickTolerance,this._overridePixelRatio=e.pixelRatio,this._maxCanvasSize=e.maxCanvasSize,this.transformCameraUpdate=e.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=e.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=dt.addThrottleControl(()=>this.isMoving()),this._requestManager=new Ui(e.transformRequest),typeof e.container=="string"){if(this._container=document.getElementById(e.container),!this._container)throw new Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let a=!1,s=pn(o=>{this._trackResize&&!this._removed&&(this.resize(o),this.redraw())},50);this._resizeObserver=new ResizeObserver(o=>{a?s(o):a=!0}),this._resizeObserver.observe(this._container)}this.handlers=new oo(this,e),this._hash=e.hash&&new Wn(typeof e.hash=="string"&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,d.e({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,this._validateStyle=e.validateStyle,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new La(typeof e.attributionControl=="boolean"?void 0:e.attributionControl)),e.maplibreLogo&&this.addControl(new lo,e.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(new d.k(`${a.dataType}data`,a))}),this.on("dataloading",a=>{this.fire(new d.k(`${a.dataType}dataloading`,a))}),this.on("dataabort",a=>{this.fire(new d.k("sourcedataabort",a))})}_getMapId(){return this._mapId}addControl(h,e){if(e===void 0&&(e=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new d.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let a=h.onAdd(this);this._controls.push(h);let s=this._controlPositions[e];return e.indexOf("bottom")!==-1?s.insertBefore(a,s.firstChild):s.appendChild(a),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new d.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let e=this._controls.indexOf(h);return e>-1&&this._controls.splice(e,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}calculateCameraOptionsFromTo(h,e,a,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(a,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,e,a,s)}resize(h){var e;let a=this._containerDimensions(),s=a[0],o=a[1],c=this._getClampedPixelRatio(s,o);if(this._resizeCanvas(s,o,c),this.painter.resize(s,o,c),this.painter.overLimit()){let _=this.painter.context.gl;this._maxCanvasSize=[_.drawingBufferWidth,_.drawingBufferHeight];let y=this._getClampedPixelRatio(s,o);this._resizeCanvas(s,o,y),this.painter.resize(s,o,y)}this.transform.resize(s,o),(e=this._requestedCameraState)===null||e===void 0||e.resize(s,o);let f=!this._moving;return f&&(this.stop(),this.fire(new d.k("movestart",h)).fire(new d.k("move",h))),this.fire(new d.k("resize",h)),f&&this.fire(new d.k("moveend",h)),this}_getClampedPixelRatio(h,e){let{0:a,1:s}=this._maxCanvasSize,o=this.getPixelRatio(),c=h*o,f=e*o;return Math.min(c>a?a/c:1,f>s?s/f:1)*o}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(re.convert(h)),this._update()}setMinZoom(h){if((h=h??-2)>=-2&&h<=this.transform.maxZoom)return this.transform.minZoom=h,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=h,this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.minPitch=h,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(h>=this.transform.minPitch)return this.transform.maxPitch=h,this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.renderWorldCopies=h,this._update()}project(h){return this.transform.locationPoint(d.N.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.pointLocation(d.P.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,e,a){if(h==="mouseenter"||h==="mouseover"){let s=!1;return{layers:e,listener:a,delegates:{mousemove:c=>{let f=e.filter(y=>this.getLayer(y)),_=f.length!==0?this.queryRenderedFeatures(c.point,{layers:f}):[];_.length?s||(s=!0,a.call(this,new Jt(h,this,c.originalEvent,{features:_}))):s=!1},mouseout:()=>{s=!1}}}}if(h==="mouseleave"||h==="mouseout"){let s=!1;return{layers:e,listener:a,delegates:{mousemove:f=>{let _=e.filter(y=>this.getLayer(y));(_.length!==0?this.queryRenderedFeatures(f.point,{layers:_}):[]).length?s=!0:s&&(s=!1,a.call(this,new Jt(h,this,f.originalEvent)))},mouseout:f=>{s&&(s=!1,a.call(this,new Jt(h,this,f.originalEvent)))}}}}{let s=o=>{let c=e.filter(_=>this.getLayer(_)),f=c.length!==0?this.queryRenderedFeatures(o.point,{layers:c}):[];f.length&&(o.features=f,a.call(this,o),delete o.features)};return{layers:e,listener:a,delegates:{[h]:s}}}}_saveDelegatedListener(h,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(e)}_removeDelegatedListener(h,e,a){if(!this._delegatedListeners||!this._delegatedListeners[h])return;let s=this._delegatedListeners[h];for(let o=0;oe.includes(f))){for(let f in c.delegates)this.off(f,c.delegates[f]);return void s.splice(o,1)}}}on(h,e,a){if(a===void 0)return super.on(h,e);let s=this._createDelegatedListener(h,typeof e=="string"?[e]:e,a);this._saveDelegatedListener(h,s);for(let o in s.delegates)this.on(o,s.delegates[o]);return this}once(h,e,a){if(a===void 0)return super.once(h,e);let s=typeof e=="string"?[e]:e,o=this._createDelegatedListener(h,s,a);for(let c in o.delegates){let f=o.delegates[c];o.delegates[c]=(..._)=>{this._removeDelegatedListener(h,s,a),f(..._)}}this._saveDelegatedListener(h,o);for(let c in o.delegates)this.once(c,o.delegates[c]);return this}off(h,e,a){return a===void 0?super.off(h,e):(this._removeDelegatedListener(h,typeof e=="string"?[e]:e,a),this)}queryRenderedFeatures(h,e){if(!this.style)return[];let a,s=h instanceof d.P||Array.isArray(h),o=s?h:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(s?{}:h)||{},o instanceof d.P||typeof o[0]=="number")a=[d.P.convert(o)];else{let c=d.P.convert(o[0]),f=d.P.convert(o[1]);a=[c,new d.P(f.x,c.y),f,new d.P(c.x,f.y),c]}return this.style.queryRenderedFeatures(a,e,this.transform)}querySourceFeatures(h,e){return this.style.querySourceFeatures(h,e)}setStyle(h,e){return(e=d.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&h?(this._diffStyle(h,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(h,e))}setTransformRequest(h){return this._requestManager.setTransformRequest(h),this}_getUIString(h){let e=this._locale[h];if(e==null)throw new Error(`Missing UI string '${h}'`);return e}_updateStyle(h,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(h,e));let a=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new Pn(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,e,a):this.style.loadJSON(h,e,a),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Pn(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,e){if(typeof h=="string"){let a=this._requestManager.transformRequest(h,"Style");d.h(a,new AbortController).then(s=>{this._updateDiff(s.data,e)}).catch(s=>{s&&this.fire(new d.j(s))})}else typeof h=="object"&&this._updateDiff(h,e)}_updateDiff(h,e){try{this.style.setState(h,e)&&this._update(!0)}catch(a){d.w(`Unable to perform style diff: ${a.message||a.error||a}. Rebuilding the style from scratch.`),this._updateStyle(h,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():d.w("There is no style added to the map.")}addSource(h,e){return this._lazyInitEmptyStyle(),this.style.addSource(h,e),this._update(!0)}isSourceLoaded(h){let e=this.style&&this.style.sourceCaches[h];if(e!==void 0)return e.loaded();this.fire(new d.j(new Error(`There is no source with ID '${h}'`)))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){let e=this.style.sourceCaches[h.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${h.source}`);this.terrain===null&&e.reload();for(let a in this.style._layers){let s=this.style._layers[a];s.type==="hillshade"&&s.source===h.source&&d.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new ho(this.painter,e,h),this.painter.renderToTexture=new hl(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=a=>{a.dataType==="style"?this.terrain.sourceCache.freeRtt():a.dataType==="source"&&a.tile&&(a.sourceId!==h.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(a.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new d.k("terrain",{terrain:h})),this}getTerrain(){var h,e;return(e=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&e!==void 0?e:null}areTilesLoaded(){let h=this.style&&this.style.sourceCaches;for(let e in h){let a=h[e]._tiles;for(let s in a){let o=a[s];if(o.state!=="loaded"&&o.state!=="errored")return!1}}return!0}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}addImage(h,e,a={}){let{pixelRatio:s=1,sdf:o=!1,stretchX:c,stretchY:f,content:_,textFitWidth:y,textFitHeight:b}=a;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||d.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new d.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:T,height:S,data:z}=e,D=e;return this.style.addImage(h,{data:new d.R({width:T,height:S},new Uint8Array(z)),pixelRatio:s,stretchX:c,stretchY:f,content:_,textFitWidth:y,textFitHeight:b,sdf:o,version:0,userImage:D}),D.onAdd&&D.onAdd(this,h),this}}{let{width:T,height:S,data:z}=se.getImageData(e);this.style.addImage(h,{data:new d.R({width:T,height:S},z),pixelRatio:s,stretchX:c,stretchY:f,content:_,textFitWidth:y,textFitHeight:b,sdf:o,version:0})}}updateImage(h,e){let a=this.style.getImage(h);if(!a)return this.fire(new d.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let s=e instanceof HTMLImageElement||d.b(e)?se.getImageData(e):e,{width:o,height:c,data:f}=s;if(o===void 0||c===void 0)return this.fire(new d.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==a.data.width||c!==a.data.height)return this.fire(new d.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let _=!(e instanceof HTMLImageElement||d.b(e));return a.data.replace(f,_),this.style.updateImage(h,a),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new d.j(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h){return dt.getImage(this._requestManager.transformRequest(h,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(h,e){return this._lazyInitEmptyStyle(),this.style.addLayer(h,e),this._update(!0)}moveLayer(h,e){return this.style.moveLayer(h,e),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(h,e,a){return this.style.setLayerZoomRange(h,e,a),this._update(!0)}setFilter(h,e,a={}){return this.style.setFilter(h,e,a),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,e,a,s={}){return this.style.setPaintProperty(h,e,a,s),this._update(!0)}getPaintProperty(h,e){return this.style.getPaintProperty(h,e)}setLayoutProperty(h,e,a,s={}){return this.style.setLayoutProperty(h,e,a,s),this._update(!0)}getLayoutProperty(h,e){return this.style.getLayoutProperty(h,e)}setGlyphs(h,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,e,a={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,e,a,s=>{s||this._update(!0)}),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,e,a=>{a||this._update(!0)}),this}setLight(h,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(h){return this._lazyInitEmptyStyle(),this.style.setSky(h),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(h,e){return this.style.setFeatureState(h,e),this._update()}removeFeatureState(h,e){return this.style.removeFeatureState(h,e),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,e=0;return this._container&&(h=this._container.clientWidth||400,e=this._container.clientHeight||300),[h,e]}_setupContainer(){let h=this._container;h.classList.add("maplibregl-map");let e=this._canvasContainer=te.create("div","maplibregl-canvas-container",h);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=te.create("canvas","maplibregl-canvas",e),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");let a=this._containerDimensions(),s=this._getClampedPixelRatio(a[0],a[1]);this._resizeCanvas(a[0],a[1],s);let o=this._controlContainer=te.create("div","maplibregl-control-container",h),c=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(f=>{c[f]=te.create("div",`maplibregl-ctrl-${f} `,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(h,e,a){this._canvas.width=Math.floor(a*h),this._canvas.height=Math.floor(a*e),this._canvas.style.width=`${h}px`,this._canvas.style.height=`${e}px`}_setupPainter(){let h={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},e=null;this._canvas.addEventListener("webglcontextcreationerror",s=>{e={requestedAttributes:h},s&&(e.statusMessage=s.statusMessage,e.type=s.type)},{once:!0});let a=this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h);if(!a){let s="Failed to initialize WebGL";throw e?(e.message=s,new Error(JSON.stringify(e))):new Error(s)}this.painter=new Xn(a,this.transform),Tt.testSupport(a)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){let e=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let o=this.transform.zoom,c=se.now();this.style.zoomHistory.update(o,c);let f=new d.z(o,{now:c,fadeDuration:e,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),_=f.crossFadingFactor();_===1&&_===this._crossFadingFactor||(a=!0,this._crossFadingFactor=_),this.style.update(f)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,e,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:e,showPadding:this.showPadding}),this.fire(new d.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,d.bf.mark(d.bg.load),this.fire(new d.k("load"))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new d.k("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,d.bf.mark(d.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(let a of this._controls)a.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),dt.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();let e=this.painter.context.gl.getExtension("WEBGL_lose_context");e?.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),te.remove(this._canvasContainer),te.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),d.bf.clearMetrics(),this._removed=!0,this.fire(new d.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,se.frameAsync(this._frameRequest).then(h=>{d.bf.frame(h),this._frameRequest=null,this._render(h)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return ul}getCameraTargetElevation(){return this.transform.elevation}},P.MapMouseEvent=Jt,P.MapTouchEvent=ia,P.MapWheelEvent=al,P.Marker=ns,P.NavigationControl=class{constructor(h){this._updateZoomButtons=()=>{let e=this._map.getZoom(),a=e===this._map.getMaxZoom(),s=e===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.toString())},this._rotateCompassArrow=()=>{let e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,a)=>{let s=this._map._getUIString(`NavigationControl.${a}`);e.title=s,e.setAttribute("aria-label",s)},this.options=d.e({},oc,h),this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),te.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),te.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=te.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new lc(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){te.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,e){let a=te.create("button",h,this._container);return a.type="button",a.addEventListener("click",e),a}},P.Popup=class extends d.E{constructor(h){super(),this.remove=()=>(this._content&&te.remove(this._content),this._container&&(te.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new d.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var a;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=te.create("div","maplibregl-popup",this._map.getContainer()),this._tip=te.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let _ of this.options.className.split(" "))this._container.classList.add(_);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?_t(this._lngLat,this._flatPos,this._map.transform):(a=this._lngLat)===null||a===void 0?void 0:a.wrap(),this._trackPointer&&!e)return;let s=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let o=this.options.anchor,c=os(this.options.offset);if(!o){let _=this._container.offsetWidth,y=this._container.offsetHeight,b;b=s.y+c.bottom.ythis._map.transform.height-y?["bottom"]:[],s.x<_/2?b.push("left"):s.x>this._map.transform.width-_/2&&b.push("right"),o=b.length===0?"bottom":b.join("-")}let f=s.add(c[o]);this.options.subpixelPositioning||(f=f.round()),te.setTransform(this._container,`${Ba[o]} translate(${f.x}px,${f.y}px)`),as(this._container,o,"popup")},this._onClose=()=>{this.remove()},this.options=d.e(Object.create(Be),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new d.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=d.N.convert(h),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){let e=document.createDocumentFragment(),a=document.createElement("body"),s;for(a.innerHTML=h;s=a.firstChild,s;)e.appendChild(s);return this.setDOMContent(e)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=te.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){return this._container&&this._container.classList.add(h),this}removeClassName(h){return this._container&&this._container.classList.remove(h),this}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}setSubpixelPositioning(h){this.options.subpixelPositioning=h}_createCloseButton(){this.options.closeButton&&(this._closeButton=te.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let h=this._container.querySelector(ss);h&&h.focus()}},P.RasterDEMTileSource=Mt,P.RasterTileSource=it,P.ScaleControl=class{constructor(h){this._onMove=()=>{xn(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,xn(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},fr),h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){te.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},P.ScrollZoomHandler=Ji,P.Style=Pn,P.TerrainControl=class{constructor(h){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=h}onAdd(h){return this._map=h,this._container=te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=te.create("button","maplibregl-ctrl-terrain",this._container),te.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(){te.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},P.TwoFingersTouchPitchHandler=Aa,P.TwoFingersTouchRotateHandler=ao,P.TwoFingersTouchZoomHandler=io,P.TwoFingersTouchZoomRotateHandler=so,P.VectorTileSource=Ja,P.VideoSource=ma,P.addSourceType=(h,e)=>d._(void 0,void 0,void 0,function*(){if(en(h))throw new Error(`A source type called "${h}" already exists.`);((a,s)=>{Qa[a]=s})(h,e)}),P.clearPrewarmedResources=function(){let h=Si;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(zr),Si=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()"))},P.getMaxParallelImageRequests=function(){return d.a.MAX_PARALLEL_IMAGE_REQUESTS},P.getRTLTextPluginStatus=function(){return hr().getRTLTextPluginStatus()},P.getVersion=function(){return mo},P.getWorkerCount=function(){return lr.workerCount},P.getWorkerUrl=function(){return d.a.WORKER_URL},P.importScriptInWorkers=function(h){return Ka().broadcast("IS",h)},P.prewarm=function(){$r().acquire(zr)},P.setMaxParallelImageRequests=function(h){d.a.MAX_PARALLEL_IMAGE_REQUESTS=h},P.setRTLTextPlugin=function(h,e){return hr().setRTLTextPlugin(h,e)},P.setWorkerCount=function(h){lr.workerCount=h},P.setWorkerUrl=function(h){d.a.WORKER_URL=h}});var ni=Qe;return ni})});var Uu=Bl((eh,th)=>{var Vd=function(){var Qe={},wt=1e-10,Et=Math.PI/180,ni=180/Math.PI,P=6378137,d=20037508342789244e-9;function qt(De){return Number(De)===De&&De%1!==0}function gt(De){if(De=De||{},this.size=De.size||256,this.expansion=De.antimeridian===!0?2:1,!Qe[this.size]){var se=this.size,te=Qe[this.size]={};te.Bc=[],te.Cc=[],te.zc=[],te.Ac=[];for(var Tt=0;Tt<30;Tt++)te.Bc.push(se/360),te.Cc.push(se/(2*Math.PI)),te.zc.push(se/2),te.Ac.push(se),se*=2}this.Bc=Qe[this.size].Bc,this.Cc=Qe[this.size].Cc,this.zc=Qe[this.size].zc,this.Ac=Qe[this.size].Ac}return gt.prototype.px=function(De,se){if(qt(se)){var te=this.size*Math.pow(2,se),Tt=te/2,Nt=te/360,Lt=te/(2*Math.PI),It=te,pt=Math.min(Math.max(Math.sin(Et*De[1]),-.9999),.9999),Ct=Tt+De[0]*Nt,dt=Tt+.5*Math.log((1+pt)/(1-pt))*-Lt;return Ct>It*this.expansion&&(Ct=It*this.expansion),dt>It&&(dt=It),[Ct,dt]}else{var Tt=this.zc[se],pt=Math.min(Math.max(Math.sin(Et*De[1]),-.9999),.9999),Ct=Math.round(Tt+De[0]*this.Bc[se]),dt=Math.round(Tt+.5*Math.log((1+pt)/(1-pt))*-this.Cc[se]);return Ct>this.Ac[se]*this.expansion&&(Ct=this.Ac[se]*this.expansion),dt>this.Ac[se]&&(dt=this.Ac[se]),[Ct,dt]}},gt.prototype.ll=function(De,se){if(qt(se)){var te=this.size*Math.pow(2,se),Tt=te/360,Nt=te/(2*Math.PI),Lt=te/2,It=(De[1]-Lt)/-Nt,pt=(De[0]-Lt)/Tt,Ct=ni*(2*Math.atan(Math.exp(It))-.5*Math.PI);return[pt,Ct]}else{var It=(De[1]-this.zc[se])/-this.Cc[se],pt=(De[0]-this.zc[se])/this.Bc[se],Ct=ni*(2*Math.atan(Math.exp(It))-.5*Math.PI);return[pt,Ct]}},gt.prototype.bbox=function(De,se,te,Tt,Nt){Tt&&(se=Math.pow(2,te)-1-se);var Lt=[De*this.size,(+se+1)*this.size],It=[(+De+1)*this.size,se*this.size],pt=this.ll(Lt,te).concat(this.ll(It,te));return Nt==="900913"?this.convert(pt,"900913"):pt},gt.prototype.xyz=function(De,se,te,Tt){Tt==="900913"&&(De=this.convert(De,"WGS84"));var Nt=[De[0],De[1]],Lt=[De[2],De[3]],It=this.px(Nt,se),pt=this.px(Lt,se),Ct=[Math.floor(It[0]/this.size),Math.floor((pt[0]-1)/this.size)],dt=[Math.floor(pt[1]/this.size),Math.floor((It[1]-1)/this.size)],Ui={minX:Math.min.apply(Math,Ct)<0?0:Math.min.apply(Math,Ct),minY:Math.min.apply(Math,dt)<0?0:Math.min.apply(Math,dt),maxX:Math.max.apply(Math,Ct),maxY:Math.max.apply(Math,dt)};if(te){var di={minY:Math.pow(2,se)-1-Ui.maxY,maxY:Math.pow(2,se)-1-Ui.minY};Ui.minY=di.minY,Ui.maxY=di.maxY}return Ui},gt.prototype.convert=function(De,se){return se==="900913"?this.forward(De.slice(0,2)).concat(this.forward(De.slice(2,4))):this.inverse(De.slice(0,2)).concat(this.inverse(De.slice(2,4)))},gt.prototype.forward=function(De){var se=[P*De[0]*Et,P*Math.log(Math.tan(Math.PI*.25+.5*De[1]*Et))];return se[0]>d&&(se[0]=d),se[0]<-d&&(se[0]=-d),se[1]>d&&(se[1]=d),se[1]<-d&&(se[1]=-d),se},gt.prototype.inverse=function(De){return[De[0]*ni/P,(Math.PI*.5-2*Math.atan(Math.exp(-De[1]/P)))*ni]},gt}();typeof th<"u"&&typeof eh<"u"&&(th.exports=eh=Vd)});var Zu=Bl((fm,rh)=>{var qd=Uu(),ih={};rh.exports.viewport=jd;rh.exports.bounds=Ud;function $u(Qe,wt){Qe=Qe||256,antiMeridian=wt||!1;var Et=Qe+String(antiMeridian);return ih[Et]||(ih[Et]=new qd({size:Qe,antimeridian:antiMeridian})),ih[Et]}function Nd(Qe,wt,Et){var ni=Math.min(Qe-Math.log(wt[0])/Math.log(2),Qe-Math.log(wt[1])/Math.log(2));return Et?ni:Math.floor(ni)}function jd(Qe,wt,Et,ni,P,d,qt){Et=Et===void 0?0:Et,ni=ni===void 0?20:ni;var gt=$u(P,qt),De=ni,se=gt.px([Qe[0],Qe[1]],De),te=gt.px([Qe[2],Qe[3]],De),Tt=te[0]-se[0],Nt=se[1]-te[1],Lt=se[0]+Tt/2,It=te[1]+Nt/2,pt=[Tt/wt[0],Nt/wt[1]],Ct=Nd(De,pt,d),dt=gt.ll([Lt,It],De),Ui=Math.max(Et,Math.min(ni,Ct));return{center:dt,zoom:Ui}}function Ud(Qe,wt,Et,ni){Qe.lon!==void 0&&(Qe=[Qe.lon,Qe.lat]);var P=$u(ni),d=P.px(Qe,wt),qt=P.ll([d[0]-Et[0]/2,d[1]-Et[1]/2],wt),gt=P.ll([d[0]+Et[0]/2,d[1]+Et[1]/2],wt);return[qt[0],gt[1],gt[0],qt[1]]}});var Gu=Bl((gm,$d)=>{$d.exports={}});window.maplibregl=ju();window.geoViewport=Zu();Gu();})(); +/*! Bundled license information: + +maplibre-gl/dist/maplibre-gl.js: + (** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt + *) +*/ diff --git a/handlers/templates/static/package-lock.json b/handlers/templates/static/package-lock.json index 6263fc6..a5c1f41 100644 --- a/handlers/templates/static/package-lock.json +++ b/handlers/templates/static/package-lock.json @@ -1,23 +1,38 @@ { "name": "mbtileserver", - "version": "0.10.0", + "version": "0.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mbtileserver", - "version": "0.10.0", + "version": "0.11.0", "license": "ISC", "dependencies": { "@mapbox/geo-viewport": "^0.5.0", - "esbuild": "^0.19.5", - "maplibre-gl": "^3.5.1" + "esbuild": "^0.24.0", + "maplibre-gl": "^4.7.1" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", + "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz", - "integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", + "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", "cpu": [ "arm" ], @@ -26,13 +41,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz", - "integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", + "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", "cpu": [ "arm64" ], @@ -41,13 +56,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz", - "integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", + "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", "cpu": [ "x64" ], @@ -56,13 +71,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz", - "integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", + "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", "cpu": [ "arm64" ], @@ -71,13 +86,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz", - "integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", + "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", "cpu": [ "x64" ], @@ -86,13 +101,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz", - "integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", + "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", "cpu": [ "arm64" ], @@ -101,13 +116,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz", - "integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", + "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", "cpu": [ "x64" ], @@ -116,13 +131,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz", - "integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", + "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", "cpu": [ "arm" ], @@ -131,13 +146,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz", - "integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", + "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", "cpu": [ "arm64" ], @@ -146,13 +161,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz", - "integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", + "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", "cpu": [ "ia32" ], @@ -161,13 +176,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz", - "integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", + "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", "cpu": [ "loong64" ], @@ -176,13 +191,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz", - "integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", + "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", "cpu": [ "mips64el" ], @@ -191,13 +206,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz", - "integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", + "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", "cpu": [ "ppc64" ], @@ -206,13 +221,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz", - "integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", + "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", "cpu": [ "riscv64" ], @@ -221,13 +236,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz", - "integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", + "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", "cpu": [ "s390x" ], @@ -236,13 +251,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz", - "integrity": "sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", + "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", "cpu": [ "x64" ], @@ -251,13 +266,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz", - "integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", + "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", "cpu": [ "x64" ], @@ -266,13 +281,28 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", + "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz", - "integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", + "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", "cpu": [ "x64" ], @@ -281,13 +311,13 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz", - "integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", + "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", "cpu": [ "x64" ], @@ -296,13 +326,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz", - "integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", + "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", "cpu": [ "arm64" ], @@ -311,13 +341,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz", - "integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", + "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", "cpu": [ "ia32" ], @@ -326,13 +356,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz", - "integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", "cpu": [ "x64" ], @@ -341,7 +371,7 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@mapbox/geo-viewport": { @@ -415,16 +445,18 @@ } }, "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "19.3.2", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.2.tgz", - "integrity": "sha512-C2JAk64XUz9v78+bpyTk1zvgjjnDsB8CCjNumyAYdWK2dvdDtILzh1AGBMdS/llX3KaHjGYxAE5wOwfdwq4Pog==", + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.3.1.tgz", + "integrity": "sha512-5ueL4UDitzVtceQ8J4kY+Px3WK+eZTsmGwha3MBKHKqiHvKrjWWwBCIl1K8BuJSc5OFh83uI8IFNoFvQxX2uUw==", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", "@mapbox/unitbezier": "^0.0.1", - "json-stringify-pretty-compact": "^3.0.0", + "json-stringify-pretty-compact": "^4.0.0", "minimist": "^1.2.8", + "quickselect": "^2.0.0", "rw": "^1.3.3", - "sort-object": "^3.0.3" + "sort-object": "^3.0.3", + "tinyqueue": "^3.0.0" }, "bin": { "gl-style-format": "dist/gl-style-format.mjs", @@ -432,20 +464,33 @@ "gl-style-validate": "dist/gl-style-validate.mjs" } }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + }, "node_modules/@types/geojson": { - "version": "7946.0.12", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.12.tgz", - "integrity": "sha512-uK2z1ZHJyC0nQRbuovXFt4mzXDwf27vQeUWNhfKGwRcWW429GOhP8HxUHlM6TLH4bzmlv/HlEjpvJh3JfmGsAA==" + "version": "7946.0.14", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", + "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==" + }, + "node_modules/@types/geojson-vt": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz", + "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==", + "dependencies": { + "@types/geojson": "*" + } }, "node_modules/@types/mapbox__point-geometry": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.3.tgz", - "integrity": "sha512-2W46IOXlu7vC8m3+M5rDqSnuY22GFxxx3xhkoyqyPWrD+eP2iAwNst0A1+umLYjCTJMJTSpiofphn9h9k+Kw+w==" + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", + "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==" }, "node_modules/@types/mapbox__vector-tile": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.3.tgz", - "integrity": "sha512-d263B3KCQtXKVZMHpMJrEW5EeLBsQ8jvAS9nhpUKC5hHIlQaACG9PWkW8qxEeNuceo9120AwPjeS91uNa4ltqA==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz", + "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==", "dependencies": { "@types/geojson": "*", "@types/mapbox__point-geometry": "*", @@ -453,14 +498,14 @@ } }, "node_modules/@types/pbf": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.4.tgz", - "integrity": "sha512-SOFlLGZkLbEXJRwcWCqeP/Koyaf/uAqLXHUsdo/nMfjLsNd8kqauwHe9GBOljSmpcHp/LC6kOjo3SidGjNirVA==" + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", + "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==" }, "node_modules/@types/supercluster": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.2.tgz", - "integrity": "sha512-qMhofL945Z4njQUuntadexAgPtpiBC014WvVqU70Prj42LC77Xgmz04us7hSMmwjs7KbgAwGBmje+FSOvDbP0Q==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz", + "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==", "dependencies": { "@types/geojson": "*" } @@ -499,44 +544,46 @@ } }, "node_modules/earcut": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", - "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.0.tgz", + "integrity": "sha512-41Fs7Q/PLq1SDbqjsgcY7GA42T0jvaCNGXgGtsNdvg+Yv8eIu06bxv4/PoREkZ9nMDNwnUSG9OFB9+yv8eKhDg==" }, "node_modules/esbuild": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz", - "integrity": "sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/android-arm": "0.19.5", - "@esbuild/android-arm64": "0.19.5", - "@esbuild/android-x64": "0.19.5", - "@esbuild/darwin-arm64": "0.19.5", - "@esbuild/darwin-x64": "0.19.5", - "@esbuild/freebsd-arm64": "0.19.5", - "@esbuild/freebsd-x64": "0.19.5", - "@esbuild/linux-arm": "0.19.5", - "@esbuild/linux-arm64": "0.19.5", - "@esbuild/linux-ia32": "0.19.5", - "@esbuild/linux-loong64": "0.19.5", - "@esbuild/linux-mips64el": "0.19.5", - "@esbuild/linux-ppc64": "0.19.5", - "@esbuild/linux-riscv64": "0.19.5", - "@esbuild/linux-s390x": "0.19.5", - "@esbuild/linux-x64": "0.19.5", - "@esbuild/netbsd-x64": "0.19.5", - "@esbuild/openbsd-x64": "0.19.5", - "@esbuild/sunos-x64": "0.19.5", - "@esbuild/win32-arm64": "0.19.5", - "@esbuild/win32-ia32": "0.19.5", - "@esbuild/win32-x64": "0.19.5" + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" } }, "node_modules/extend-shallow": { @@ -551,9 +598,9 @@ } }, "node_modules/geojson-vt": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", - "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", + "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==" }, "node_modules/get-stream": { "version": "6.0.1", @@ -580,16 +627,16 @@ "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==" }, "node_modules/global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz", + "integrity": "sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==", "dependencies": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" + "ini": "^4.1.3", + "kind-of": "^6.0.3", + "which": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=16" } }, "node_modules/ieee754": { @@ -612,9 +659,12 @@ ] }, "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, "node_modules/is-extendable": { "version": "0.1.1", @@ -636,9 +686,12 @@ } }, "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "engines": { + "node": ">=16" + } }, "node_modules/isobject": { "version": "3.0.1", @@ -649,9 +702,9 @@ } }, "node_modules/json-stringify-pretty-compact": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz", - "integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz", + "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==" }, "node_modules/kdbush": { "version": "4.0.2", @@ -667,9 +720,9 @@ } }, "node_modules/maplibre-gl": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-3.5.1.tgz", - "integrity": "sha512-XFpqAKjpm7Y6cV3B1MDZ3FGUCXyrfeM2QkXloKc4x2QK9/e6/BEHdVebtxXcTrwdzpQexKrMqzdYCbaobJRNrw==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.7.1.tgz", + "integrity": "sha512-lgL7XpIwsgICiL82ITplfS7IGwrB1OJIw/pCvprDp2dhmSSEBgmPzYRvwYYYvJGJD7fxUv1Tvpih4nZ6VrLuaA==", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", @@ -678,23 +731,24 @@ "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^19.3.2", - "@types/geojson": "^7946.0.11", - "@types/mapbox__point-geometry": "^0.1.2", - "@types/mapbox__vector-tile": "^1.3.1", - "@types/pbf": "^3.0.3", - "@types/supercluster": "^7.1.1", - "earcut": "^2.2.4", - "geojson-vt": "^3.2.1", + "@maplibre/maplibre-gl-style-spec": "^20.3.1", + "@types/geojson": "^7946.0.14", + "@types/geojson-vt": "3.2.5", + "@types/mapbox__point-geometry": "^0.1.4", + "@types/mapbox__vector-tile": "^1.3.4", + "@types/pbf": "^3.0.5", + "@types/supercluster": "^7.1.3", + "earcut": "^3.0.0", + "geojson-vt": "^4.0.2", "gl-matrix": "^3.4.3", - "global-prefix": "^3.0.0", + "global-prefix": "^4.0.0", "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", - "pbf": "^3.2.1", + "pbf": "^3.3.0", "potpack": "^2.0.0", - "quickselect": "^2.0.0", + "quickselect": "^3.0.0", "supercluster": "^8.0.1", - "tinyqueue": "^2.0.3", + "tinyqueue": "^3.0.0", "vt-pbf": "^3.1.3" }, "engines": { @@ -719,9 +773,9 @@ "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==" }, "node_modules/pbf": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", - "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz", + "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==", "dependencies": { "ieee754": "^1.1.12", "resolve-protobuf-schema": "^2.1.0" @@ -741,9 +795,9 @@ "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==" }, "node_modules/quickselect": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", - "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", + "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==" }, "node_modules/resolve-protobuf-schema": { "version": "2.1.0", @@ -847,9 +901,9 @@ } }, "node_modules/tinyqueue": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", - "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", + "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==" }, "node_modules/typewise": { "version": "1.0.3", @@ -889,14 +943,17 @@ } }, "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { - "which": "bin/which" + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" } } } diff --git a/handlers/templates/static/package.json b/handlers/templates/static/package.json index c7c06c8..a5361b0 100644 --- a/handlers/templates/static/package.json +++ b/handlers/templates/static/package.json @@ -1,6 +1,6 @@ { "name": "mbtileserver", - "version": "0.10.0", + "version": "0.11.0", "description": "Go powered mbtiles tile map server", "main": "index.js", "scripts": { @@ -23,7 +23,7 @@ "homepage": "https://github.com/consbio/mbtileserver", "dependencies": { "@mapbox/geo-viewport": "^0.5.0", - "esbuild": "^0.19.5", - "maplibre-gl": "^3.5.1" + "esbuild": "^0.24.0", + "maplibre-gl": "^4.7.1" } }